Merge commit 'origin/silc.1.1.branch' master
authorPekka Riikonen <priikone@silcnet.org>
Sun, 5 Oct 2008 14:45:59 +0000 (17:45 +0300)
committerPekka Riikonen <priikone@silcnet.org>
Sun, 5 Oct 2008 14:45:59 +0000 (17:45 +0300)
Conflicts:

CHANGES
TODO
apps/Makefile.ad
apps/autodist/CHANGES
apps/autodist/autodist.in
apps/autodist/doc/autodist.1.in
apps/autodist/doc/autodist.texi
apps/silcd/command.c
apps/silcd/server.c
apps/silcd/server_backup.c
apps/silcd/server_query.c
configure.ad
distdir/autodist
distdir/pre-dist-client
distdir/pre-dist-toolkit
includes/silc.h.in
includes/silcversion.h.in
lib/Makefile.ad
lib/configure.ad
lib/contrib/Makefile.ad
lib/silcasn1/silcasn1.c
lib/silcasn1/silcasn1_decode.c
lib/silcasn1/silcasn1_encode.c
lib/silcclient/client.h
lib/silcclient/client_entry.c
lib/silcclient/silcclient.h
lib/silccore/silcpacket.c
lib/silccrypt/Makefile.ad
lib/silccrypt/aes.c
lib/silccrypt/aes_x86.asm
lib/silccrypt/aes_x86_64.asm
lib/silccrypt/ciphers.h
lib/silccrypt/configure.ad
lib/silccrypt/rijndael_internal.h
lib/silccrypt/silccipher.c
lib/silccrypt/silcpk.c
lib/silccrypt/silcpkcs.c
lib/silccrypt/silcpkcs1.c
lib/silcmath/configure.ad
lib/silcsim/Makefile.ad
lib/silcske/silcconnauth.c
lib/silcske/silcske.c
lib/silcskr/silcskr.c
lib/silcutil/silcatomic.h
lib/silcutil/silcbuffer.h
lib/silcutil/silcbuffmt.c
lib/silcutil/silcconfig.c
lib/silcutil/silcdlist.h
lib/silcutil/silcfdstream.c
lib/silcutil/silcfsm.c
lib/silcutil/silclist.h
lib/silcutil/silclog.c
lib/silcutil/silcmime.c
lib/silcutil/silcmutex.h
lib/silcutil/silcnet.h
lib/silcutil/silcschedule.c
lib/silcutil/silcschedule.h
lib/silcutil/silcschedule_i.h
lib/silcutil/silcsocketstream.c
lib/silcutil/silcsocketstream_i.h
lib/silcutil/silcstack.c
lib/silcutil/silcstack.h
lib/silcutil/silcstringprep.c
lib/silcutil/silctime.c
lib/silcutil/silctypes.h
lib/silcutil/silcutil.c
lib/silcutil/stacktrace.c
lib/silcutil/tests/test_silcschedule.c
lib/silcutil/tests/test_silctime.c
lib/silcutil/unix/silcunixnet.c
lib/silcutil/unix/silcunixschedule.c
lib/silcutil/unix/silcunixsocketstream.c
lib/silcutil/unix/silcunixthread.c
lib/silcutil/win32/silcwin32schedule.c
win32/libsilc/libsilc.def

561 files changed:
.cvsignore [deleted file]
CHANGES
CHANGES.TOOLKIT [new file with mode: 0644]
README.GIT [moved from README.CVS with 85% similarity]
TODO
TODO-SILC
apps/Makefile.ad
apps/autodist/AUTHORS [deleted file]
apps/autodist/CHANGES [deleted file]
apps/autodist/COPYING [deleted file]
apps/autodist/INSTALL [deleted file]
apps/autodist/Makefile.am [deleted file]
apps/autodist/README [deleted file]
apps/autodist/TODO [deleted file]
apps/autodist/autodist.conf [deleted file]
apps/autodist/autodist.in [deleted file]
apps/autodist/autodist.spec.in [deleted file]
apps/autodist/configure.ad [deleted file]
apps/autodist/default [deleted file]
apps/autodist/doc/Makefile.am [deleted file]
apps/autodist/doc/autodist.1.in [deleted file]
apps/autodist/doc/autodist.texi [deleted file]
apps/autodist/doc/fdl.texi [deleted file]
apps/autodist/doc/mdate-sh [deleted file]
apps/autodist/doc/texinfo.tex [deleted file]
apps/autodist/makedist.in [deleted file]
apps/autodist/tests/Makefile.am [deleted file]
apps/autodist/tests/autodist1.test [deleted file]
apps/autodist/tests/autodist2.test [deleted file]
apps/autodist/tests/autodist3.test [deleted file]
apps/autodist/tests/autodist4.test [deleted file]
apps/autodist/tests/autodist5.test [deleted file]
apps/autodist/tests/autodist6.test [deleted file]
apps/autodist/tests/autodist7.test [deleted file]
apps/irssi/.cvsignore [deleted file]
apps/irssi/CHANGES [new file with mode: 0644]
apps/irssi/docs/.cvsignore [deleted file]
apps/irssi/docs/help/in/.cvsignore [deleted file]
apps/irssi/scripts/.cvsignore [deleted file]
apps/irssi/src/.cvsignore [deleted file]
apps/irssi/src/core/.cvsignore [deleted file]
apps/irssi/src/fe-common/core/.cvsignore [deleted file]
apps/irssi/src/fe-common/silc/module-formats.c
apps/irssi/src/fe-common/silc/module-formats.h
apps/irssi/src/fe-text/.cvsignore [deleted file]
apps/irssi/src/lib-config/.cvsignore [deleted file]
apps/irssi/src/lib-popt/.cvsignore [deleted file]
apps/irssi/src/perl/.cvsignore [deleted file]
apps/irssi/src/perl/common/.cvsignore [deleted file]
apps/irssi/src/perl/silc/Makefile.PL.in
apps/irssi/src/perl/textui/.cvsignore [deleted file]
apps/irssi/src/perl/ui/.cvsignore [deleted file]
apps/irssi/src/silc/core/client_ops.c
apps/irssi/src/silc/core/clientutil.c
apps/irssi/src/silc/core/silc-channels.c
apps/irssi/src/silc/core/silc-core.c
apps/irssi/src/silc/core/silc-queries.c
apps/irssi/src/silc/core/silc-servers.c
apps/silcd/.cvsignore [deleted file]
apps/silcd/server.c
config.guess [deleted file]
config.sub
configure.ad
distdir/autodist [deleted file]
distdir/autodist-post-process-dist [deleted file]
distdir/autodist.conf
distdir/common
distdir/default
distdir/server
distdir/silcmap
distdir/toolkit
doc/.cvsignore [deleted file]
includes/.cvsignore [deleted file]
includes/silc.h.in
includes/silccompile.h [new file with mode: 0644]
includes/silcversion.h.in
includes/silcwin32.h
lib/.cvsignore [deleted file]
lib/Makefile.ad
lib/configure.ad [deleted file]
lib/contrib/.cvsignore [deleted file]
lib/contrib/Makefile.ad [deleted file]
lib/contrib/getopti.c [deleted file]
lib/contrib/getopti.h [deleted file]
lib/contrib/gunicomp.h [deleted file]
lib/contrib/gunidecomp.h [deleted file]
lib/contrib/nfkc.c [deleted file]
lib/contrib/regexpr.c [deleted file]
lib/contrib/regexpr.h [deleted file]
lib/contrib/rfc3454.c [deleted file]
lib/contrib/stringprep.c [deleted file]
lib/contrib/stringprep.h [deleted file]
lib/doc/command_reply_args.html
lib/silcapputil/Makefile.ad
lib/silcapputil/silcapputil.c
lib/silcapputil/silcidcache.c
lib/silcasn1/DIRECTORY [deleted file]
lib/silcasn1/Makefile.ad [deleted file]
lib/silcasn1/silcasn1.c [deleted file]
lib/silcasn1/silcasn1.h [deleted file]
lib/silcasn1/silcasn1_decode.c [deleted file]
lib/silcasn1/silcasn1_encode.c [deleted file]
lib/silcasn1/silcasn1_i.h [deleted file]
lib/silcasn1/silcber.c [deleted file]
lib/silcasn1/silcber.h [deleted file]
lib/silcasn1/tests/Makefile.am [deleted file]
lib/silcasn1/tests/test_silcasn1.c [deleted file]
lib/silcclient/.cvsignore [deleted file]
lib/silcclient/client.c
lib/silcclient/client_attrs.c
lib/silcclient/client_channel.c
lib/silcclient/client_connect.c
lib/silcclient/client_entry.c
lib/silcclient/client_ftp.c
lib/silcclient/client_internal.h
lib/silcclient/client_listener.c
lib/silcclient/client_prvmsg.c
lib/silcclient/client_register.c
lib/silcclient/client_register.h
lib/silcclient/command.c
lib/silcclient/command_reply.c
lib/silcclient/silcclient.h
lib/silccore/.cvsignore [deleted file]
lib/silccore/silcauth.c
lib/silccore/silcauth.h
lib/silccore/silccommand.h
lib/silccore/silcid.c
lib/silccore/silcid.h
lib/silccore/silcmessage.c
lib/silccore/silcmessage.h
lib/silccore/silcpacket.c
lib/silccore/silcpubkey.c
lib/silccore/silcpubkey.h
lib/silccrypt/.cvsignore [deleted file]
lib/silccrypt/DIRECTORY [deleted file]
lib/silccrypt/Makefile.ad [deleted file]
lib/silccrypt/aes.c [deleted file]
lib/silccrypt/aes.h [deleted file]
lib/silccrypt/aes_x86.asm [deleted file]
lib/silccrypt/aes_x86_64.asm [deleted file]
lib/silccrypt/blowfish.c [deleted file]
lib/silccrypt/blowfish.h [deleted file]
lib/silccrypt/blowfish_internal.h [deleted file]
lib/silccrypt/cast.c [deleted file]
lib/silccrypt/cast.h [deleted file]
lib/silccrypt/cast_internal.h [deleted file]
lib/silccrypt/ciphers.h [deleted file]
lib/silccrypt/ciphers_def.h [deleted file]
lib/silccrypt/configure.ad [deleted file]
lib/silccrypt/md5.c [deleted file]
lib/silccrypt/md5.h [deleted file]
lib/silccrypt/md5_internal.h [deleted file]
lib/silccrypt/none.c [deleted file]
lib/silccrypt/none.h [deleted file]
lib/silccrypt/rc5.c [deleted file]
lib/silccrypt/rc5.h [deleted file]
lib/silccrypt/rc5_internal.h [deleted file]
lib/silccrypt/rijndael_internal.h [deleted file]
lib/silccrypt/rsa.c [deleted file]
lib/silccrypt/rsa.h [deleted file]
lib/silccrypt/sha1.c [deleted file]
lib/silccrypt/sha1.h [deleted file]
lib/silccrypt/sha1_internal.h [deleted file]
lib/silccrypt/sha256.c [deleted file]
lib/silccrypt/sha256.h [deleted file]
lib/silccrypt/sha256_internal.h [deleted file]
lib/silccrypt/silccipher.c [deleted file]
lib/silccrypt/silccipher.h [deleted file]
lib/silccrypt/silcdh.h [deleted file]
lib/silccrypt/silchash.c [deleted file]
lib/silccrypt/silchash.h [deleted file]
lib/silccrypt/silchmac.c [deleted file]
lib/silccrypt/silchmac.h [deleted file]
lib/silccrypt/silcpk.c [deleted file]
lib/silccrypt/silcpk.h [deleted file]
lib/silccrypt/silcpk_i.h [deleted file]
lib/silccrypt/silcpkcs.c [deleted file]
lib/silccrypt/silcpkcs.h [deleted file]
lib/silccrypt/silcpkcs1.c [deleted file]
lib/silccrypt/silcpkcs1.h [deleted file]
lib/silccrypt/silcpkcs1_i.h [deleted file]
lib/silccrypt/silcrng.c [deleted file]
lib/silccrypt/silcrng.h [deleted file]
lib/silccrypt/tests/Makefile.am [deleted file]
lib/silccrypt/tests/test_aes.c [deleted file]
lib/silccrypt/tests/test_hmacmd5.c [deleted file]
lib/silccrypt/tests/test_hmacsha1.c [deleted file]
lib/silccrypt/tests/test_hmacsha256.c [deleted file]
lib/silccrypt/tests/test_md5.c [deleted file]
lib/silccrypt/tests/test_sha1.c [deleted file]
lib/silccrypt/tests/test_sha256.c [deleted file]
lib/silccrypt/tests/test_silcpkcs.c [deleted file]
lib/silccrypt/tests/test_speed.c [deleted file]
lib/silccrypt/tests/test_twofish.c [deleted file]
lib/silccrypt/twofish.c [deleted file]
lib/silccrypt/twofish.h [deleted file]
lib/silccrypt/twofish_internal.h [deleted file]
lib/silchttp/DIRECTORY [deleted file]
lib/silchttp/Makefile.ad [deleted file]
lib/silchttp/silchttpphp.c [deleted file]
lib/silchttp/silchttpphp.h [deleted file]
lib/silchttp/silchttpserver.c [deleted file]
lib/silchttp/silchttpserver.h [deleted file]
lib/silchttp/tests/Makefile.am [deleted file]
lib/silchttp/tests/test_silchttpserver.c [deleted file]
lib/silcmath/.cvsignore [deleted file]
lib/silcmath/DIRECTORY [deleted file]
lib/silcmath/Makefile.ad [deleted file]
lib/silcmath/configure.ad [deleted file]
lib/silcmath/modinv.c [deleted file]
lib/silcmath/mp_gmp.c [deleted file]
lib/silcmath/mp_gmp.h [deleted file]
lib/silcmath/mp_tfm.c [deleted file]
lib/silcmath/mp_tfm.h [deleted file]
lib/silcmath/mp_tma.c [deleted file]
lib/silcmath/mp_tma.h [deleted file]
lib/silcmath/mpbin.c [deleted file]
lib/silcmath/silcmath.h [deleted file]
lib/silcmath/silcmp.h [deleted file]
lib/silcmath/silcprimegen.c [deleted file]
lib/silcmath/tfm.c [deleted file]
lib/silcmath/tfm.h [deleted file]
lib/silcmath/tma.c [deleted file]
lib/silcmath/tma.h [deleted file]
lib/silcmath/tma_class.h [deleted file]
lib/silcmath/tma_superclass.h [deleted file]
lib/silcsftp/.cvsignore [deleted file]
lib/silcsftp/sftp_client.c
lib/silcsftp/sftp_fs_memory.c
lib/silcsftp/sftp_server.c
lib/silcsftp/sftp_util.c
lib/silcsftp/sftp_util.h
lib/silcsftp/silcsftp.h
lib/silcsftp/tests/sftp_client.c
lib/silcsftp/tests/sftp_server.c
lib/silcsim/.cvsignore [deleted file]
lib/silcsim/Makefile.ad [deleted file]
lib/silcsim/silcsim.c [deleted file]
lib/silcsim/silcsim.h [deleted file]
lib/silcsim/silcsimutil.c [deleted file]
lib/silcsim/silcsimutil.h [deleted file]
lib/silcske/.cvsignore [deleted file]
lib/silcske/silcconnauth.c
lib/silcske/silcske.c
lib/silcske/silcske_i.h
lib/silcskr/DIRECTORY [deleted file]
lib/silcskr/Makefile.ad [deleted file]
lib/silcskr/silcskr.c [deleted file]
lib/silcskr/silcskr.h [deleted file]
lib/silcskr/silcskr_i.h [deleted file]
lib/silcskr/tests/Makefile.am [deleted file]
lib/silcskr/tests/test_silcskr.c [deleted file]
lib/silcutil/.cvsignore [deleted file]
lib/silcutil/DIRECTORY [deleted file]
lib/silcutil/Makefile.ad [deleted file]
lib/silcutil/beos/.cvsignore [deleted file]
lib/silcutil/beos/Makefile.am [deleted file]
lib/silcutil/beos/silcbeosmutex.c [deleted file]
lib/silcutil/beos/silcbeosnet.c [deleted file]
lib/silcutil/beos/silcbeosschedule.c [deleted file]
lib/silcutil/beos/silcbeossockconn.c [deleted file]
lib/silcutil/beos/silcbeosthread.c [deleted file]
lib/silcutil/beos/silcbeosutil.c [deleted file]
lib/silcutil/os2/.cvsignore [deleted file]
lib/silcutil/os2/Makefile.am [deleted file]
lib/silcutil/os2/silcos2mutex.c [deleted file]
lib/silcutil/os2/silcos2net.c [deleted file]
lib/silcutil/os2/silcos2schedule.c [deleted file]
lib/silcutil/os2/silcos2sockconn.c [deleted file]
lib/silcutil/os2/silcos2thread.c [deleted file]
lib/silcutil/os2/silcos2util.c [deleted file]
lib/silcutil/silcasync.c [deleted file]
lib/silcutil/silcasync.h [deleted file]
lib/silcutil/silcasync_i.h [deleted file]
lib/silcutil/silcatomic.h [deleted file]
lib/silcutil/silcbuffer.h [deleted file]
lib/silcutil/silcbuffmt.c [deleted file]
lib/silcutil/silcbuffmt.h [deleted file]
lib/silcutil/silccond.h [deleted file]
lib/silcutil/silcconfig.c [deleted file]
lib/silcutil/silcconfig.h [deleted file]
lib/silcutil/silcdlist.h [deleted file]
lib/silcutil/silcfdstream.c [deleted file]
lib/silcutil/silcfdstream.h [deleted file]
lib/silcutil/silcfileutil.c [deleted file]
lib/silcutil/silcfileutil.h [deleted file]
lib/silcutil/silcfsm.c [deleted file]
lib/silcutil/silcfsm.h [deleted file]
lib/silcutil/silcfsm_i.h [deleted file]
lib/silcutil/silchashtable.c [deleted file]
lib/silcutil/silchashtable.h [deleted file]
lib/silcutil/silclist.h [deleted file]
lib/silcutil/silclog.c [deleted file]
lib/silcutil/silclog.h [deleted file]
lib/silcutil/silclog_i.h [deleted file]
lib/silcutil/silcmemory.c [deleted file]
lib/silcutil/silcmemory.h [deleted file]
lib/silcutil/silcmime.c [deleted file]
lib/silcutil/silcmime.h [deleted file]
lib/silcutil/silcmime_i.h [deleted file]
lib/silcutil/silcmutex.h [deleted file]
lib/silcutil/silcnet.c [deleted file]
lib/silcutil/silcnet.h [deleted file]
lib/silcutil/silcnet_i.h [deleted file]
lib/silcutil/silcschedule.c [deleted file]
lib/silcutil/silcschedule.h [deleted file]
lib/silcutil/silcschedule_i.h [deleted file]
lib/silcutil/silcsnprintf.c [deleted file]
lib/silcutil/silcsnprintf.h [deleted file]
lib/silcutil/silcsocketstream.c [deleted file]
lib/silcutil/silcsocketstream.h [deleted file]
lib/silcutil/silcsocketstream_i.h [deleted file]
lib/silcutil/silcstack.c [deleted file]
lib/silcutil/silcstack.h [deleted file]
lib/silcutil/silcstack_i.h [deleted file]
lib/silcutil/silcstream.c [deleted file]
lib/silcutil/silcstream.h [deleted file]
lib/silcutil/silcstringprep.c [deleted file]
lib/silcutil/silcstringprep.h [deleted file]
lib/silcutil/silcstrutil.c [deleted file]
lib/silcutil/silcstrutil.h [deleted file]
lib/silcutil/silcthread.h [deleted file]
lib/silcutil/silctime.c [deleted file]
lib/silcutil/silctime.h [deleted file]
lib/silcutil/silctypes.h [deleted file]
lib/silcutil/silcutf8.c [deleted file]
lib/silcutil/silcutf8.h [deleted file]
lib/silcutil/silcutil.c [deleted file]
lib/silcutil/silcutil.h [deleted file]
lib/silcutil/stacktrace.c [deleted file]
lib/silcutil/stacktrace.h [deleted file]
lib/silcutil/symbian/.cvsignore [deleted file]
lib/silcutil/symbian/Makefile.am [deleted file]
lib/silcutil/symbian/silcsymbiannet.cpp [deleted file]
lib/silcutil/symbian/silcsymbianscheduler.cpp [deleted file]
lib/silcutil/symbian/silcsymbiansocketstream.cpp [deleted file]
lib/silcutil/symbian/silcsymbiansocketstream.h [deleted file]
lib/silcutil/symbian/silcsymbianthread.cpp [deleted file]
lib/silcutil/symbian/silcsymbianutil.cpp [deleted file]
lib/silcutil/tests/Makefile.am [deleted file]
lib/silcutil/tests/test_silcasync.c [deleted file]
lib/silcutil/tests/test_silcatomic.c [deleted file]
lib/silcutil/tests/test_silcfdstream.c [deleted file]
lib/silcutil/tests/test_silcfsm.c [deleted file]
lib/silcutil/tests/test_silchashtable.c [deleted file]
lib/silcutil/tests/test_silclist.c [deleted file]
lib/silcutil/tests/test_silcmime.c [deleted file]
lib/silcutil/tests/test_silcmutex.c [deleted file]
lib/silcutil/tests/test_silcnet.c [deleted file]
lib/silcutil/tests/test_silcschedule.c [deleted file]
lib/silcutil/tests/test_silcstack.c [deleted file]
lib/silcutil/tests/test_silcstringprep.c [deleted file]
lib/silcutil/tests/test_silcstrutil.c [deleted file]
lib/silcutil/tests/test_silctime.c [deleted file]
lib/silcutil/unix/.cvsignore [deleted file]
lib/silcutil/unix/Makefile.am [deleted file]
lib/silcutil/unix/silcunixnet.c [deleted file]
lib/silcutil/unix/silcunixschedule.c [deleted file]
lib/silcutil/unix/silcunixsocketstream.c [deleted file]
lib/silcutil/unix/silcunixthread.c [deleted file]
lib/silcutil/unix/silcunixutil.c [deleted file]
lib/silcutil/win32/.cvsignore [deleted file]
lib/silcutil/win32/Makefile.am [deleted file]
lib/silcutil/win32/silcwin32net.c [deleted file]
lib/silcutil/win32/silcwin32schedule.c [deleted file]
lib/silcutil/win32/silcwin32socketstream.c [deleted file]
lib/silcutil/win32/silcwin32thread.c [deleted file]
lib/silcutil/win32/silcwin32util.c [deleted file]
lib/zlib/ChangeLog [deleted file]
lib/zlib/FAQ [deleted file]
lib/zlib/INDEX [deleted file]
lib/zlib/Make_vms.com [deleted file]
lib/zlib/Makefile [deleted file]
lib/zlib/Makefile.in [deleted file]
lib/zlib/Makefile.riscos [deleted file]
lib/zlib/README [deleted file]
lib/zlib/adler32.c [deleted file]
lib/zlib/algorithm.txt [deleted file]
lib/zlib/amiga/Makefile.pup [deleted file]
lib/zlib/amiga/Makefile.sas [deleted file]
lib/zlib/compress.c [deleted file]
lib/zlib/configure [deleted file]
lib/zlib/contrib/README.contrib [deleted file]
lib/zlib/contrib/asm386/gvmat32.asm [deleted file]
lib/zlib/contrib/asm386/gvmat32c.c [deleted file]
lib/zlib/contrib/asm386/mkgvmt32.bat [deleted file]
lib/zlib/contrib/asm386/zlibvc.def [deleted file]
lib/zlib/contrib/asm386/zlibvc.dsp [deleted file]
lib/zlib/contrib/asm386/zlibvc.dsw [deleted file]
lib/zlib/contrib/asm586/README.586 [deleted file]
lib/zlib/contrib/asm586/match.S [deleted file]
lib/zlib/contrib/asm686/README.686 [deleted file]
lib/zlib/contrib/asm686/match.S [deleted file]
lib/zlib/contrib/delphi/zlib.mak [deleted file]
lib/zlib/contrib/delphi/zlibdef.pas [deleted file]
lib/zlib/contrib/delphi2/d_zlib.bpr [deleted file]
lib/zlib/contrib/delphi2/d_zlib.cpp [deleted file]
lib/zlib/contrib/delphi2/readme.txt [deleted file]
lib/zlib/contrib/delphi2/zlib.bpg [deleted file]
lib/zlib/contrib/delphi2/zlib.bpr [deleted file]
lib/zlib/contrib/delphi2/zlib.cpp [deleted file]
lib/zlib/contrib/delphi2/zlib.pas [deleted file]
lib/zlib/contrib/delphi2/zlib32.bpr [deleted file]
lib/zlib/contrib/delphi2/zlib32.cpp [deleted file]
lib/zlib/contrib/iostream/test.cpp [deleted file]
lib/zlib/contrib/iostream/zfstream.cpp [deleted file]
lib/zlib/contrib/iostream/zfstream.h [deleted file]
lib/zlib/contrib/iostream2/zstream.h [deleted file]
lib/zlib/contrib/iostream2/zstream_test.cpp [deleted file]
lib/zlib/contrib/minizip/ChangeLogUnzip [deleted file]
lib/zlib/contrib/minizip/Makefile [deleted file]
lib/zlib/contrib/minizip/miniunz.c [deleted file]
lib/zlib/contrib/minizip/minizip.c [deleted file]
lib/zlib/contrib/minizip/readme.txt [deleted file]
lib/zlib/contrib/minizip/unzip.c [deleted file]
lib/zlib/contrib/minizip/unzip.def [deleted file]
lib/zlib/contrib/minizip/unzip.h [deleted file]
lib/zlib/contrib/minizip/zip.c [deleted file]
lib/zlib/contrib/minizip/zip.def [deleted file]
lib/zlib/contrib/minizip/zip.h [deleted file]
lib/zlib/contrib/minizip/zlibvc.def [deleted file]
lib/zlib/contrib/minizip/zlibvc.dsp [deleted file]
lib/zlib/contrib/minizip/zlibvc.dsw [deleted file]
lib/zlib/contrib/untgz/Makefile [deleted file]
lib/zlib/contrib/untgz/makefile.w32 [deleted file]
lib/zlib/contrib/untgz/untgz.c [deleted file]
lib/zlib/contrib/visual-basic.txt [deleted file]
lib/zlib/crc32.c [deleted file]
lib/zlib/deflate.c [deleted file]
lib/zlib/deflate.h [deleted file]
lib/zlib/descrip.mms [deleted file]
lib/zlib/example.c [deleted file]
lib/zlib/gzio.c [deleted file]
lib/zlib/infblock.c [deleted file]
lib/zlib/infblock.h [deleted file]
lib/zlib/infcodes.c [deleted file]
lib/zlib/infcodes.h [deleted file]
lib/zlib/inffast.c [deleted file]
lib/zlib/inffast.h [deleted file]
lib/zlib/inffixed.h [deleted file]
lib/zlib/inflate.c [deleted file]
lib/zlib/inftrees.c [deleted file]
lib/zlib/inftrees.h [deleted file]
lib/zlib/infutil.c [deleted file]
lib/zlib/infutil.h [deleted file]
lib/zlib/maketree.c [deleted file]
lib/zlib/minigzip.c [deleted file]
lib/zlib/msdos/Makefile.b32 [deleted file]
lib/zlib/msdos/Makefile.bor [deleted file]
lib/zlib/msdos/Makefile.dj2 [deleted file]
lib/zlib/msdos/Makefile.emx [deleted file]
lib/zlib/msdos/Makefile.msc [deleted file]
lib/zlib/msdos/Makefile.tc [deleted file]
lib/zlib/msdos/Makefile.w32 [deleted file]
lib/zlib/msdos/Makefile.wat [deleted file]
lib/zlib/msdos/zlib.def [deleted file]
lib/zlib/msdos/zlib.rc [deleted file]
lib/zlib/nt/Makefile.emx [deleted file]
lib/zlib/nt/Makefile.gcc [deleted file]
lib/zlib/nt/Makefile.nt [deleted file]
lib/zlib/nt/zlib.dnt [deleted file]
lib/zlib/os2/Makefile.os2 [deleted file]
lib/zlib/os2/zlib.def [deleted file]
lib/zlib/trees.c [deleted file]
lib/zlib/trees.h [deleted file]
lib/zlib/uncompr.c [deleted file]
lib/zlib/zconf.h [deleted file]
lib/zlib/zlib.3 [deleted file]
lib/zlib/zlib.h [deleted file]
lib/zlib/zlib.html [deleted file]
lib/zlib/zutil.c [deleted file]
lib/zlib/zutil.h [deleted file]
public_html/html/about.php [deleted file]
public_html/html/contact.php [deleted file]
public_html/html/contribute.php [deleted file]
public_html/html/copying.php [deleted file]
public_html/html/counter.php [deleted file]
public_html/html/cryptofaq.php [deleted file]
public_html/html/cvs.php [deleted file]
public_html/html/docs.php [deleted file]
public_html/html/download.php [deleted file]
public_html/html/faq.php [deleted file]
public_html/html/features.php [deleted file]
public_html/html/help.php [deleted file]
public_html/html/history.php [deleted file]
public_html/html/install.php [deleted file]
public_html/html/links.php [deleted file]
public_html/html/lists.php [deleted file]
public_html/html/mirrors.php [deleted file]
public_html/html/news.php [deleted file]
public_html/html/servers.php [deleted file]
public_html/html/todo.php [deleted file]
public_html/html/whitepaper.php [deleted file]
public_html/img/silc.gif [deleted file]
public_html/index.php [deleted file]
public_html/silc.css [deleted file]
util/robodoc/AUTHORS [deleted file]
util/robodoc/COPYING [deleted file]
util/robodoc/ChangeLog [deleted file]
util/robodoc/Docs/example.c [deleted file]
util/robodoc/Docs/example_makefile [deleted file]
util/robodoc/Docs/general.m4 [deleted file]
util/robodoc/Docs/main.css [deleted file]
util/robodoc/Docs/makefile.am [deleted file]
util/robodoc/Docs/makefile.in [deleted file]
util/robodoc/Docs/robodoc.1 [deleted file]
util/robodoc/Docs/robodoc.html [deleted file]
util/robodoc/Docs/robodoc.m4 [deleted file]
util/robodoc/Docs/tocgen.m4 [deleted file]
util/robodoc/Examples/C/makefile [deleted file]
util/robodoc/Examples/C/prog1.c [deleted file]
util/robodoc/Examples/C/prog1.c.html [deleted file]
util/robodoc/Examples/C/prog2.c [deleted file]
util/robodoc/Examples/C/prog2.c.html [deleted file]
util/robodoc/Examples/CPP/makefile [deleted file]
util/robodoc/Examples/CPP/masterindex.html [deleted file]
util/robodoc/Examples/CPP/muppets.cpp [deleted file]
util/robodoc/Examples/CPP/muppets.cpp.html [deleted file]
util/robodoc/Examples/CPP/muppets.h [deleted file]
util/robodoc/Examples/CPP/muppets.h.html [deleted file]
util/robodoc/Headers/assembler.sample [deleted file]
util/robodoc/Headers/basic.sample [deleted file]
util/robodoc/Headers/c.sample [deleted file]
util/robodoc/Headers/cpp.sample [deleted file]
util/robodoc/Headers/fortan.sample [deleted file]
util/robodoc/Headers/html.sample [deleted file]
util/robodoc/Headers/tcl.sample [deleted file]
util/robodoc/INSTALL [deleted file]
util/robodoc/NEWS [deleted file]
util/robodoc/README [deleted file]
util/robodoc/Source/analyser.c [deleted file]
util/robodoc/Source/analyser.h [deleted file]
util/robodoc/Source/config.h.in [deleted file]
util/robodoc/Source/folds.c [deleted file]
util/robodoc/Source/folds.h [deleted file]
util/robodoc/Source/generator.c [deleted file]
util/robodoc/Source/generator.h [deleted file]
util/robodoc/Source/headers.c [deleted file]
util/robodoc/Source/headers.h [deleted file]
util/robodoc/Source/items.c [deleted file]
util/robodoc/Source/items.h [deleted file]
util/robodoc/Source/links.c [deleted file]
util/robodoc/Source/links.h [deleted file]
util/robodoc/Source/makefile.am [deleted file]
util/robodoc/Source/makefile.in [deleted file]
util/robodoc/Source/makefile.plain [deleted file]
util/robodoc/Source/robodoc.c [deleted file]
util/robodoc/Source/robodoc.h [deleted file]
util/robodoc/Source/stamp-h.in [deleted file]
util/robodoc/Source/util.c [deleted file]
util/robodoc/Source/util.h [deleted file]
util/robodoc/TODO [deleted file]
util/robodoc/aclocal.m4 [deleted file]
util/robodoc/configure [deleted file]
util/robodoc/configure.in [deleted file]
util/robodoc/install-sh [deleted file]
util/robodoc/makefile.am [deleted file]
util/robodoc/makefile.in [deleted file]
util/robodoc/missing [deleted file]
util/robodoc/mkinstalldirs [deleted file]
win32/libsilc/libsilc.def

diff --git a/.cvsignore b/.cvsignore
deleted file mode 100644 (file)
index b79d574..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-Makefile
-Makefile.in
-Makefile.am
-Makefile.defines
-Makefile.defines.in
-Makefile.defines_int
-Makefile.defines_int.in
-acconfig.h
-aclocal.m4
-autom4te.cache
-autom4te-*.cache
-config.cache
-config.guess
-config.h
-config.h.in
-config.log
-config.status
-config.sub
-configure
-configure.in
-libtool
-libtool-shared
-ltconfig
-ltmain.sh
-stamp-h
-stamp-h.in
diff --git a/CHANGES b/CHANGES
index 128c76fc0e4f0c678163c10a901c6b3d6d69f297..dfaf9cadbae55981ea2df9552cabef5e08e93242 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -129,7 +129,7 @@ Sun Sep  9 17:52:49 EEST 2007  Pekka Riikonen <priikone@silcnet.org>
        * SILC Toolkit 1.1.3.
 
        * Fixed possible buffer overflows from SILC Config code.
-         Patch from Jérémy Bobbio.  Affected file is
+         Patch from J�r�my Bobbio.  Affected file is
          lib/silcutil/silcconfig.c.
 
 Sun Aug 26 12:28:49 EEST 2007  Pekka Riikonen <priikone@silcnet.org>
@@ -160,7 +160,7 @@ Thu Jul 19 21:08:49 EEST 2007  Pekka Riikonen <priikone@silcnet.org>
          files are lib/silccrypt/aes.c.
 
        * Fixed lib/silcutil/silcatomic.h compilation on IA64.  Patch
-         from Jérémy Bobbio.
+         from J�r�my Bobbio.
 
        * Fixed public key identifier parsing to check lengths
          correctly.  Affected file is lib/silccrypt/silcpk.c.
@@ -1535,7 +1535,7 @@ Sun Apr  3 14:58:53 EEST 2005  Pekka Riikonen <priikone@silcnet.org>
          file silcd/packet_receive.c.
 
        * Added getrusage() to take noise in SILC RNG.  A patch by
-         Mika Boström.  Affected files are configure.in.pre,
+         Mika Bostr�m.  Affected files are configure.in.pre,
          includes/silcincludes.h.in, lib/silccrypt/silcrng.c.
 
 Sat Apr  2 18:09:30 EEST 2005  Pekka Riikonen <priikone@silcnet.org>
@@ -1705,7 +1705,7 @@ Wed Nov 24 18:24:05 CET 2004  Pekka Riikonen <priikone@silcnet.org>
 Tue Nov 23 16:54:35 CET 2004  Pekka Riikonen <priikone@silcnet.org>
 
        * Fixed Win32 scheduler to not stuck anymore.  A patch from
-         Juha Räsänen.  Affected file is
+         Juha R�s�nen.  Affected file is
          lib/silcutil/win32/silcwin32schedule.c.
 
        * Fixed QoS parsing for connection blocks in server.  Affected
@@ -1803,7 +1803,7 @@ Sat Feb 28 16:25:09 EET 2004  Pekka Riikonen <priikone@silcnet.org>
          on the channel.  Affected file lib/silcclient/client_channel.c.
 
        * The channel private key used to decrypt message is now
-         delivered to the application in the 'channel_messageÃ' client
+         delivered to the application in the 'channel_message�' client
          operation.  Affected files are lib/silcclient/silcclient.h
          and client_channel.c.
 
@@ -2689,7 +2689,7 @@ Tue Dec 17 10:05:00 CET 2002  Pekka Riikonen <priikone@silcnet.org>
          Aldous <Matthew@Aldous.com>.
 
        * Added better implementation using CriticalSection of
-         SilcMutex on WIN32.  A patch by Mikko Lähteenmäki
+         SilcMutex on WIN32.  A patch by Mikko L�hteenm�ki
          <mikko.lahteenmaki@pikabaana.net>.
 
        * Added some Winsock WIN32 compatiblity defines into
@@ -3060,7 +3060,7 @@ Sun Nov 24 18:26:42 EET 2002  Pekka Riikonen <priikone@silcnet.org>
          notifys in Irssi SILC Client.  Affected file is
          irssi/src/silc/core/client_ops.c.  Bug #82.
 
-       * Applied Ville Räsänen's manual page and --mandir bugfix
+       * Applied Ville R�s�nen's manual page and --mandir bugfix
          patch.  Affected files are configure.in.pre and Makefile.am.pre.
          Bug #88.
 
@@ -3239,8 +3239,8 @@ Thu Nov  7 10:05:28 CET 2002  Pekka Riikonen <priikone@silcnet.org>
 
 Wed Nov  6 17:18:13 EET 2002  Pekka Riikonen <priikone@silcnet.org>
 
-       * Fixed manual page installation patch by Ville Räsänen.
-         USERS help page fix patch by Ville Räsänen
+       * Fixed manual page installation patch by Ville R�s�nen.
+         USERS help page fix patch by Ville R�s�nen
 
        * Changed the silc_client_command_call interface to make
          the command call simpler for the application.  The library
@@ -3286,7 +3286,7 @@ Sun Nov  3 17:59:15 EET 2002  Pekka Riikonen <priikone@silcnet.org>
          was missing altogether.  Affected file silcd/command_reply.c.
          Bug #44.
 
-Sun Nov  3 00:42:05 EET 2002  Mika Boström <bostik@lut.fi>
+Sun Nov  3 00:42:05 EET 2002  Mika Bostr�m <bostik@lut.fi>
 
        * Added man-pages for silc(1), silcd(8) and silcd.conf(5).
          Included yodl sources for each of these. Also modified
@@ -3487,7 +3487,7 @@ Sun Oct 20 14:12:24 CEST 2002  Pekka Riikonen <priikone@silcnet.org>
 Sat Oct 19 13:32:15 CEST 2002  Pekka Riikonen <priikone@silcnet.org>
 
        * ROBODoc documented lib/silcutil/silcbuffer.h and
-         lib/silcutil/silcdlist.h.  Patch by Ville Räsänen
+         lib/silcutil/silcdlist.h.  Patch by Ville R�s�nen
          <ville.rasanen@iki.fi>.
 
 Fri Oct 18 10:51:04 EEST 2002  Pekka Riikonen <priikone@silcnet.org>
@@ -3739,7 +3739,7 @@ Sun Sep 15 12:25:10 EEST 2002  Pekka Riikonen <priikone@silcnet.org>
          file lib/silcutil/silcutil.[ch].
 
        * Added STATS command to client library and Irssi SILC client.
-         Patch provided by Ville Räsänen <ville.rasanen@iki.fi>.
+         Patch provided by Ville R�s�nen <ville.rasanen@iki.fi>.
 
 Wed Sep 11 09:22:00 CEST 2002  Pekka Riikonen <priikone@silcnet.org>
 
@@ -3961,7 +3961,7 @@ Fri Jun 28 11:53:25 CEST 2002 Pekka Riikonen <priikone@silcnet.org>
 Thu Jun 27 20:07:27 EEST 2002 Pekka Riikonen <priikone@silcnet.org>
 
        * Buffer overflow with CUMODE command's mode->mode character
-         conversion.  Reported by Ville Räsänen.  Affected file
+         conversion.  Reported by Ville R�s�nen.  Affected file
          lib/silcutil/silcutil.c.
 
 Thu Jun 27 16:54:33 EEST 2002 Pekka Riikonen <priikone@silcnet.org>
@@ -4049,7 +4049,7 @@ Tue Jun 25 18:47:39 EEST 2002 Pekka Riikonen <priikone@silcnet.org>
 
        * Fixed a bug in version string parsing which could crash
          the program with specially formatted version string.
-         Bug reported and patch provided by Ville Räsänen.  Affected
+         Bug reported and patch provided by Ville R�s�nen.  Affected
          file lib/silcutil/silcutil.c.
 
        * Handle the disconnection immediately when DISCONNECT
@@ -7861,7 +7861,7 @@ Thu Sep  6 12:47:37 EEST 2001  Pekka Riikonen <priikone@silcnet.org>
          Added function silc_client_nickname_format to the file
          lib/silcclient/idlist.c.  It performs the nickname formatting.
 
-         Added new field `hostname´ to the SilcClientEntry context.
+         Added new field `hostname� to the SilcClientEntry context.
          It holds the hostname of the client.  Affected file is
          lib/silcclient/idlist.h.
 
@@ -11232,7 +11232,7 @@ Wed Feb 21 14:17:04 EET 2001  Pekka Riikonen <priikone@poseidon.pspt.fi>
        * Fixed buffer overflow from lib/silcclient/command.c in USERS
          command parsing.
 
-Wed Feb 21 12:44:00 EET 2001  Mika Boström <bostik@lut.fi>
+Wed Feb 21 12:44:00 EET 2001  Mika Bostr�m <bostik@lut.fi>
 
        * Changed all SilcConfigServer* and silc_config_server* to
          SilcServerConfig* and silc_server_config*, respectively.
diff --git a/CHANGES.TOOLKIT b/CHANGES.TOOLKIT
new file mode 100644 (file)
index 0000000..6609651
--- /dev/null
@@ -0,0 +1,75 @@
+Tue Jan  8 17:09:25 EET 2008  Pekka Riikonen <priikone@silcnet.org>
+
+       * Moved SILC ID utility functions to utility library to 
+         core library.  Affected files are lib/silccore/silcid.[ch].
+
+Tue Jan  8 16:24:56 EET 2008  Pekka Riikonen <priikone@silcnet.org>
+
+       * Fixed silc_nickname_parse to always return valid nickname
+         when it returns TRUE.  Affected files are 
+         lib/silcclient/client_entry,c and command.c
+
+Thu Nov 15 16:45:48 EET 2007  Pekka Riikonen <priikone@silcnet.org>
+
+       * Fixed public key authentication as responder.  Affected file
+         is lib/silcske/silcconnauth.c.
+
+       * Report packet engine errors to client application.  Affected
+         file is lib/silcclient/client.c.
+
+       * If channel user list could not be resolved or was not even
+         closely fully resolved, report it to application.  Affected
+         file is lib/silcclient/command_reply.c.
+
+       * Reprocess JOIN command synchronously after resolving channel
+         user list.  Affected file is lib/silcclient/command_reply.c.
+
+       * In JOIN command reply check if the channel key is already
+         saved.  If it is we have received new key from server while
+         resolving user and must not save the old key.  Affected file
+         is lib/silcclient/command_reply.c.
+
+       * Remove all channel keys and hmacs after giving LEAVE command.
+         Affected file is lib/silcclient/command_reply.c.
+
+Tue Nov 13 18:24:56 EET 2007 Pekka Riikonen <priikone@silcnet.org>
+
+       * Added missing channel unreferencing in CMODE, CUMODE,
+         TOPIC, INVITE, BAN and KICK command replies.  Affected
+         file is lib/silcclient/command_reply.c.
+
+Mon Nov  5 23:07:58 EET 2007  Pekka Riikonen <priikone@silcnet.org>
+
+       * Zero tail of CTR mode IV in IV Included mode.  Change does
+         not cause compatibility issues.  Affected file is
+         lib/silcske/silcske.c.
+
+Mon Nov  5 22:24:25 EET 2007  Pekka Riikonen <priikone@silcnet.org>
+
+       * Fixed CTR mode rekey.  Affected file is lib/silcske/silcske.c.
+
+       * Rewrote the IV Included CTR mode encryption/decryption in
+         packet engine.  Affected file is lib/silccore/silcpacket.c.
+
+Sun Aug 26 12:28:49 EEST 2007  Pekka Riikonen <priikone@silcnet.org>
+
+        * Fixed TIMEOUT handling in user info resolving during JOINing,
+          fixes crash.  Affected file is lib/silcclient/client_notify.c.
+
+Tue Jul 10 20:02:04 EEST 2007  Pekka Riikonen <priikone@silcnet.org>
+
+       * Added support for new PKCS API and other API changes from
+          Crypto Toolkit to client library.  Affected files are in
+         lib/silcclient/.
+
+Sun Jul  8 20:20:22 EEST 2007  Pekka Riikonen <priikone@silcnet.org>
+
+       * Changed message payload encoding async, due to the PKCS API
+         changes.  Affected files are lib/silccore/silcmessage.[ch].
+
+       * Added new PKCS API support for connauth and SKE.  Affected
+         files are lib/silcske/silconnauth.c and silcske.c.
+
+-----------------------------------------------------------------------------
+
+For older changes please see the CHANGES file from the CVS tree.
similarity index 85%
rename from README.CVS
rename to README.GIT
index c50be0b5183baab236405b690e521f029fa841a8..0dd847d32c8f06da21d1601c369e2afe950bbc1b 100644 (file)
@@ -231,3 +231,42 @@ distributions live in distdir/ directory.  The distdefs can be used in any
 file in the source tree, but mainly they are used in Makefile.ad, 
 configure.ad and source and headers files.  See autodist documentation for 
 more information how to use distdefs.
+
+
+Merging Between CVS Branches
+============================
+
+Usually development moves from trunk to a specific branch when we are 
+nearing releasing the software.  After release the trunk will continue new 
+development and the branch will continue maintenance of the latest 
+version.  At some point the branch needs to be merged back to trunk to
+bring all relevant fixes back to trunk.  The merge is to be done as 
+follows:
+
+  cvs -z3 co -j branch_to_merge silc
+  cd silc
+  ... check trunk status ...
+  cvs -z3 commit
+
+The first command will merge the branch_to_merge to the trunk.  After 
+merging the state of the trunk should be checked for any possible 
+conflicts and fix if any exist.  The trunk then must be committed.
+
+After merge has been done the branch must be tagged:
+
+  cvs -z3 co -r branch_to_merge silc
+  cd silc
+  cvs -z3 tag branch_merged_20070701
+
+This tag can be used later when merging more changes from the same branch 
+to the trunk:
+
+  cvs -z3 co -j branch_merged_20070701 -j branch_to_merge silc
+  cd silc
+  ... check trunk status ...
+  cvs -z3 commit
+
+The tag is relevant so that the earlier changes would not be merged twice.  
+The tag assures that only changes made after the last merge will be merged 
+to trunk.  After this merge has been done the branch must be tagged again 
+in case more changes are merged again later.
diff --git a/TODO b/TODO
index d89901f838d4d88b4a9e2383c80f75b620de1642..e6950f06db8f133972622b978e342ba7981d623d 100644 (file)
--- a/TODO
+++ b/TODO
-TODO for 1.1
-============
+TODO for 1.2 And Beyond
+=======================
 
 NOTE: Any item that doesn't have (***DONE) in it, isn't done yet.  The
 (***TESTING NEEDED) means that the item has been done but not yet properly
 tested.
 
+NOTE: A TODO entry does not mean that it is ever going to be done.  Some
+of the entries may be just ideas, good, bad or ugly.  If you want to work
+on some of the TODO entries simply let us know about it by dropping a note
+to silc-devel mailing list or appear on 'silc' channel on SILCNet.
 
-apps/silcd, The SILC Server    ****PARTLY DONE****
-===========================
-
- o Fix/test GETKEY. (***DONE)
-
- o Fix/test MOTD. (***DONE)
-
- o Rewrite rehash, HUP.
-
- o Heartbeat-keepalive.
-
- o Port all code to use SILC Toolkit 1.1 APIs. (***DONE)
-
- o Remove protocol.[ch].  (***DONE)
-
- o Rewrite connecting accepting. (***DONE)
-
- o Rewrite async connecting. (***DONE)
-
- o Test backup router resuming protocol. (***DONE)
-
- o Check all packet receive routines that they call silc_packet_free. 
-   (***DONE)
-
- o Add Web statistics module using lib/silchttp.  Give out server
-   statistics. (***DONE)
-
-
-SILC Client    ****DONE****
-===========
-
- o Porting to new Toolkit API and new Client Library API (***DONE)
-
- o Improve help files, especially /cmode, /cumode and /key. (***DONE)
-
-
-lib/silcclient, The Client Library     ***DONE****
-==================================
-
- o silcclient.h clean up and API rewrites. (***DONE)
-
- o silcclient_entry.h finishing, all entry relates APIs to this header.
-   (***DONE)
-
- o SilcChannelEntry, SilcServerEntry, SilcChannelUser, allocating,
-   freeing, finding, etc. rewrite.  Also making them reference counted for
-   multi threads use. (***DONE)
-
- o Rewrite client side WHOIS command (for whois -details). (***DONE)
-
- o Finish all the missing SILC packet processings, rewrites. (***DONE)
-
- o The client_notify.c rewrite. (***DONE)
-
- o Resuming to client_register.c (remove client_resume.c) (***DONE)
-
- o Rekey rewrite. (***DONE)
-
- o Remove protocol.[ch]. (***DONE)
-
- o File transfer rewrite. (***DONE)
-
- o File transfer API documentation. (***DONE)
-
- o Connection auth request. (***DONE)
-
- o Password auth test, public key auth test. (***DONE)
-
- o Starting key exchange directly, rewrite. (***DONE)
-
- o Channel messages, channel private keys, channel entires, channel
-   search, etc. rewrite. (***DONE)
-
- o For many APIs leave the hash context allocations to the caller instead
-   of using client->sha1hash and client->md5hash, or some kind of thread
-   safe (no locking) concept. (***DONE)
-
- o Key agreement rewrite. (***DONE)
-
- o Connecting to remote client (***DONE)
-
- o Private message waiting API (in threads) (***TESTING NEEDED)
-
- o client_attrs.c, attributes rewrite. (***DONE)
-
- o No SilcBuffer lists back to application in command_reply operations.
-   Convert them all to real lists and/or structures for easier use.
-   (***DONE)
-
- o Nickname formatting rewrite. (***DONE)
 
- o UDP connections. (***TESTING NEEDED)
-
-
-lib/silcsftp                   ****DONE****
+lib/silccore
 ============
 
- o Porting to use the new util library. (***DONE)
-
-
-lib/silccore/silcpacket.[ch]   ****DONE****
-============================
-
- o SilcPacketEngine. (***DONE)
-
- o New SILC Packet API. (***DONE)
-
- o Implement silc_packet_engine_stop and silc_packet_stream_destroy. (***DONE)
-
- o IV Included flag support, UDP transport support (***TESTING NEEDED)
-
-
-lib/silccore/silcid.[ch]       ****DONE****
-========================
-
- o Add silc_id_str2id to accept the destination buffer as argument
-   and thus not require any memory allocation.  Same will happen
-   with silc_id_payload_* functions. (***DONE)
-
- o silc_id_str2id, silc_id2str to non-allocating routines. (***DONE)
-
-
-lib/silcskr    ****DONE****
-===========
-
- o Removing key from the repository is not possible currently.  It should
-   be. (***DONE)
-
-
-lib/silcske/silcske.[ch]       ***DONE****
-========================
-
- o Responder rekey (***DONE)
-
- o IV Included flag support in SKE (***DONE)
+ o SILC_PACKET_FLAG_ACK support.  Implement ACK packet and packet payload
+   to silcpacket.c.
 
- o UDP transport changes; retransmission support by using exponential
-   backoff algorithm. (***DONE)
+ o All payload encoding routines should take SilcStack as argument.
 
- o SilcConnAuth header file documentation. (***DONE)
+ o Remove SilcCommandCb from silccommand.h. (***DONE)
 
+ o All payload test routines into lib/silccore/tests/.
 
-lib/silccrypt                  ****DONE****
-=============
 
- o Implement PKCS #1 sign/verify with hash OID. (***TESTING NEEDED)
-
- o Implement SILC Public Key Version 2 handling in sign/verify.  Implement
-   Version (V) identifier (***DONE)
-
- o SILC PKCS (silcpkcs.h) reorganizing when other PK supports added.
-   Move the SILC Public Key routines away from the crypto library into
-   the core library (silccore).  silc_pkcs_public/private_key_* routines
-   to silc_public/private_key_* routines.  The silc_public_key_* routines
-   should also automatically handle SILC Public Keys, and other keys
-   and certificates as well.  Add fe. silcpk.h into silccore.  It should
-   also include the Public Key Payload encoding and decoding routines.
-   (***DONE)
-
- o Assembler AES (***DONE)
-
-
-lib/silcutil                   ****DONE****
-============
+lib/silcclient, The Client Library
+==================================
 
- o The regex code from lib/contrib might compile fine on all platforms.
-   No need to make it silcutil/unix/ specific.  Add them to generic
-   silcutil.c. (***DONE)
+ o LIST command should take server name as argument, a server name whose
+   channels to list.  This way it is possible to list channels from
+   any server in internet, eg.  /LIST example.com.
 
- o Silc FD Stream to WIN32 (lib/silcutil/silcfdstream.h) (***TESTING NEEDED)
+ o UDP SILC connection support to SILC server
 
- o bool -> SilcBool (***DONE)
+ o Giving WHOIS for nick that doesn't exist should remove any same
+   named entries from the client cache.
 
+ o peer-to-peer private messages
 
-lib/silcutil/silcbuffer.h      ****DONE****
-=========================
+ o Private message key request notification to application.  See XXX in
+   client_prvmsg.c.
 
- o Remove the `truelen' field from SilcBuffer as it is entirely
-   redundant since we can get the true length of the buffer by
-   doing buffer->end - buffer->header.  Add silc_buffer_truelen
-   macro instead.  Consider also removing `len' field too since
-   it effectively is buffer->tail - buffer->data, and adding
-   silc_buffer_len macro can do the same.  These would save
-   totally 8 bytes of memory per buffer. (***DONE)
+ o in JOIN notify handle resolving that timedout.  Currently the user is
+   never joined the channel if this happens.  What to do if message is
+   received from user that hasn't been resolved/joined?
 
+ o Connection option that attemps to connect to remot host with various
+   different mechanisms: UDP 706, TCP 706, TCP 80, TCP 443, UDP 7706 and
+   TCP 7706.  This is the so called hole punching mechanism.
 
-lib/silcutil/silcbuffmt.[ch]   ****DONE****
-============================
+ o Message ACKing support.
 
- o SilcStack aware silc_buffer_unformat (***DONE)
+ o in /cmode and /cumode with +r, maybe the public key and private key
+   could be just some "string", which would then match to "string.pub" and
+   "string.prv".
 
- o SilcStack aware silc_buffer_format (***DONE)
+ o If the SILC Events (see below) are implemented, perhaps client library
+   should provide events so that application developer has a choice of
+   developing the SILC app with callbacks or with events.
 
- o silc_buffer_format reallocates automatically (***DONE)
+ o Ability to recover from rekey errors, at least try to.
 
- o SILC_STR_OFFSET (***DONE)
+ o Add the SilcStream (socket stream) from the SilcPacketStream and
+   SilcSocket from the socket stream to SilcClientConnection for easier
+   access to them for programmers.  Currently these have to be digged up
+   from the packet stream. (***DONE)
 
 
-lib/silcutil/silcstack.[ch]    ****DONE****
+SFTP Library, lib/silcsftp/
 ===========================
 
- o Data stack implementation (***DONE)
-
-
-lib/silcutil/silcstream.[ch]   ****DONE****
-============================
-
- o Add abstract SilcStream. (***DONE)
+ o Read prefetch (read-ahead, reading ahead of time).  Maybe if this can
+   be done easily.
 
 
-lib/silcutil/silcsocketstream.[ch]     ****DONE****
-==================================
-
- o Add SilcSocketStream (***DONE)
-
- o Add SilcSocketStream for WIN32 (***TESTING NEEDED)
-
- o Test QoS after the changes made to socket stream
-
+lib/silcske/silcske.[ch]
+========================
 
-lib/silcutil/silcschedule*.[ch]                ****DONE****
-===============================
+ o Ratelimit to UDP/IP transport for incoming packets.
 
- o Scheduler can be optimized for FD tasks by changing the fd_queue
-   to SilcHashTable instead of using linked list.  We need to do
-   one-to-one mapping of FD to task and hash table is more efficient
-   for this usage.
 
-   Also redefine the silc_select to perhaps return a separate
-   structure of the events that actually occurred, instead of
-   returning the events in the fd_list which is then traversed
-   in the generic code to find the changed events.  This can be
-   made faster by having own struct which includes only the
-   changed events, thus the tarversing is faster since the whole
-   fd_list is not traversed anymore (it is still traversed in the
-   silc_select but at least it removes one extra tarversing later
-   for the same list).
+apps/silcd
+==========
 
-   Other task queues should be changed to use SilcList.  (***DONE)
+ o Deprecate the old server.  Write interface for the new lib/silcserver
+   server library.  The interface should work on Unix/Linux systems.
 
- o Add SILC scheduler's internal routines into a table of implementation
-   function pointers, that the generic code then takes as extern from
-   implementation.  These are the silc_schedule_internal_* routines.
-   (***DONE)
+ o Consider deprecating also the old config file format and use XML
+   istead.  This should require SILC XML API implementation first.
 
- o Change SILC_TASK_CALLBACK to non-static, and remove the macro
-   SILC_TASK_CALLBACK_GLOBAL. (***DONE)
+ o The configuration must support dynamic router and server connections.
+   The silcd must work without specifying any servers or routers to
+   connect to.
 
- o SILC Schedule API changes to WIN32. (***DONE)
+ o The configuration must support specifying whether the server is
+   SILC Server or SILC Router.  This should not be deduced from the
+   configuration as it was in < 1.2.
 
+ o The configuration must support specifying the ciphers and hmacs and
+   their order so that user can specify which algorithms take preference.
 
-lib/silcutil/silcasync.[ch]    ****DONE****
-===========================
 
- o Add SilcAsyncOperation to utility library.  Any function that takes
-   callback as an argument must/should return SilcAsyncOperation.
-   (***DONE)
+lib/silcserver
+==============
 
+ o Rewrite the entire server.  Deprecate apps/silcd as the main server
+   implementation and create lib/silcserver/.  It is a platform
+   independent server library.  The apps/silcd will merely provide a
+   a simple interface for the library.
 
-lib/silcutil/silctime.[ch]     ****DONE****
-===========================
+ o Write the SILC Server library extensively using SILC FSM.
 
- o SilcTime. (***DONE)
+ o Server library must support multiple networks.  This means that one
+   server must be able to create multiple connections that each reach
+   different SILC network.  This means also that all cache's etc. must
+   be either connection-specific or network-specific.
 
- o system time, universal, generalized. (***DONE)
+ o Library must support dynamic router and server connections.  This means
+   that connections are create only when they are needed, like when someone
+   says JOIN foo@foo.bar.com or WHOIS foobar@silcnet.org.
 
+ o Library must support server-to-server connections even though protocol
+   prohibits that.  The responder of the connection should automatically
+   act as a router.  The two servers create an own, isolated, SILC network.
+   To be used specifically with dynamic connections.
 
-lib/silcutil/silcfsm.[ch]      ****DONE****
-=========================
+ o Library must support multiple threads and must be entirely thread safe.
 
- o SILC Finite State Machine API.  Replaces SILC Protocol API (***DONE)
+ o Library must have support for SERVICE command.
 
+ o Both UDP and TCP support for incoming connecetions.  Maintaining long
+   term UDP sessions.
 
-lib/silcutil/silcnet*, lib/silcutil/*/silc*net*                ****DONE****
-===============================================
+ o The server must be able to run behind NAT device.  This means that
+   Server ID must be based on public IP instead of private IP (See
+   also NAT detection protocol in SILC protocol specification).
 
- o Add UDP interface (***DONE)
+ o The following data must be in per-connection context: client id cache,
+   server id cache, channel id cache, all statistics must be
+   per-connection.
 
- o Add UDP interface for WIN32 (***TESTING NEEDED)
+ o The following data must be in per-thread context: command context
+   freelist/pool, pending commands, random number generator.
 
- o New network interfaces (***DONE)
+ o Do inccoming packet processing in an own FSM thread in the
+   server-threads FSM.  Same as in client library.
 
+ o Binding to other ports than 706 too.  To allow easier traversing
+   through NATs and firewalls server should also bind to 80, 443 and 7706
+   by default (at least try to bind).  Connections must work normally
+   even if they were established to some other port other than 706.
 
-lib/silcmath                   ****DONE****
-============
+   Connection option that attemps to connect to remot server with various
+   different mechanisms: UDP 706, TCP 706, TCP 80, TCP 443, UDP 7706 and
+   TCP 7706.  This is the so called hole punching mechanism.
 
- o Test on x86_64. (***TESTING NEEDED)
+ o Ability to recover from rekey errors, at least try to.
 
- o Change LTM and TFM function names when importing to SILC tree to avoid
-   rare linking problems on system that has same named symbols already in
-   the system. (***DONE)
+ o Reference count all Silc*Entry structures.
 
+ o All channel names in any command (where appropriate) must be allowed to
+   be in format channel@server so that the server can be connected to do
+   the command for the channel.  Change protocol if it doesn't allow it.
 
-lib/silcutil/symbian/          ****DONE****
-=====================
+ o All nicknames in any command (where appropriate) must be allowed to be
+   in format nick@server so that the server can be connected to do the
+   command for the nickname.  Change protocol if it doesn't allow it.
 
-  o lib/silcutil/symbian routines missing or not completed.
-    (****TESTING NEEDED)
+ Some issues that must be kept in mind from 1.0 and 1.1 silcd's:
 
-  o Something needs to be thought to the logging globals as well,
-    like silc_debug etc.  They won't work on EPOC.  Perhaps logging
-    and debugging is to be disabled on EPOC.
+ o The server and router software MUST work out of the box.  After
+   installation the server must not require any configuration to run the
+   most basic working configuration.  No defining IP addresses, etc.
+   The server must work just by running it.
 
+ o The SERVER_SIGNOFF notify handing is not optimal, because it'll
+   cause sending of multiple SIGNOFF notify's instead of the one
+   SERVER_SIGNOFF notify that the server received.  This should be
+   optimized so that the only SERVER_SIGNOFF is sent and not
+   SIGNOFF of notify at all (using SIGNOFF takes the idea about
+   SERVER_SIGNOFF away entirely).
 
-lib/silcasn1                   ****DONE****
-============
+ o Another SERVER_SIGNOFF opt/bugfix:  Currently the signoff is
+   sent to a client if it is on same channel as the client that
+   signoffed.  However, the entire SERVER_SIGNOFF list is sent to
+   the client, ie. it may receive clients that was not on the
+   same channel.  This is actually against the specs.  It must be
+   done per channel.  It shouldn't receive the whole list just
+   because one client happened to be on same channel.
 
- o ASN.1 library (***DONE)
+ o If client's public key is saved in the server (and doing public key
+   authentication) then the hostname and the username information could
+   be taken from the public key.  Should be a configuration option!
 
- o Header documentation missing. (***DONE)
+ o Add a timeout to handling incoming JOIN commands.  It should be
+   enforced that JOIN command is executed only once in a second or two
+   seconds.  Now it is possible to accept n incoming JOIN commands
+   and process them without any timeouts.  THis must be employed because
+   each JOIN command will create and distribute the new channel key
+   to everybody on the channel.
 
- o Some string encodings missing (copy/paste matter). (***DONE)
+ o Related to above.  If multiple JOINs are received in sequence perhaps
+   new key should be created only once, if the JOINs are handeled at the same
+   time.  Now we create multiple keys and never end up using them because
+   many JOINs are processed at the same time in sequence.  Only the last
+   key ends up being used.
index 533dd9b72a712911483b0cdc50f5edea0a037a32..2ce1eb7a689d2e6bf498640d6d1785d456c2b39d 100644 (file)
--- a/TODO-SILC
+++ b/TODO-SILC
@@ -11,11 +11,35 @@ point.
    silc-architecture-xx.txt
    silc-specification-xx.txt
 
+ o Make @ reserved character in channel names.  Accept channel@server
+   names in all commands and notify types.
+
  o Add acknowlegments section to specification documents.
-   
+
  o Group Diffie-Hellman protocol for establishig key with two or more
    users on a channel.
 
+ o Change CTR mode description:
+
+    Truncated HASH from SKE (4 bytes) - This value is the first 4
+    bytes from the HASH value that was computed as a result of SKE
+    protocol.  This acts as session identifier and each rekey MUST
+    produce a new HASH value.
+
+   to
+
+    Truncated HASH from SKE (4 bytes) - This value is the first 4
+    bytes from the HASH value that was computed in SKE.  In each rekey
+    the value MUST be recomputed as follows:
+
+      HASH = hash(new Sending/Receiving IV from SKE)
+
+    The hash function is the one used in SKE.  The 'new Sending/Receiving
+    IV from SKE' is the first 8 bytes of the new value computed during
+    rekey.  The first 4 bytes are used from the recomputed HASH.
+
+ o Consider for future authenticated encryption modes, especially GCM.
+
  o Extend the Channel ID port to be actually a counter, allowing the
    2^32 channels per cell, instead of 2^16 like now.  The port with
    compliant implementation would always be 706, and it could be used
@@ -26,11 +50,21 @@ point.
    the one that actually WANTs to establish the keys.  So no need for
    responder to retransmit.  Define this clearly in the specs.
 
- o Dynamic server and router connections, ala Jabber.  SILC has allowed 
+ o Define clearly that the DSS signature format is the the Dss-Sig-Value
+   ASN.1 encoding defined for PKIX.
+
+ o Define clearly the SSH2 signature format is the one specified for SSH2
+   protocol.
+
+ o Dynamic server and router connections, ala Jabber.  SILC has allowed
    this from the beginning.  It should be written out clearly in the
    specs.  Connection would be created with nick strings (which are of
    format nick@server).
 
+ o NAT detection protocool during SKE so that party behind NAT can
+   detect if it is behind NAT and receive the public IP address and port
+   that it may need (servers need it to create valid Server ID).  (***DONE)
+
  o Counter block send/receive IV 64 bits instead of 32 bits, and the
    value itself is used as 64-bit MSB ordered counter, which must
    be reset before the packet sequence counter wraps.  It's basically
@@ -41,7 +75,7 @@ point.
  o Add Source and Destination ID in message MAC computation to fully
    associate the Message Payload with the true sender and the true
    recipient of the message.  This will fix some security issues that
-   currently exists.  It is currently possible in some specific set of 
+   currently exists.  It is currently possible in some specific set of
    conditions to mount a replay attack using Message Payload.  This change
    will remove the possibility of these attacks.
 
@@ -55,12 +89,12 @@ point.
       has changed nickname, has detached and resumed, or has reconnected
       to other server.
    4. the original receiver of the message is still in the network, has
-      not changed nickname, has not detached and resumed, and has not  
+      not changed nickname, has not detached and resumed, and has not
       reconnected to any other server, or, some other user has the same
       client ID.
-   5. the attacker is able to get the same client ID as the original   
+   5. the attacker is able to get the same client ID as the original
       sender.
-   6. the original receiver still has the static key set for the same  
+   6. the original receiver still has the static key set for the same
       remote client ID (for original sender's client ID).
 
    All this is possible to happen though likelyhood is quite small.  It
@@ -68,7 +102,7 @@ point.
 
  o The SILC public key identifier separator is ', ' not ','.  The
    whitespace is mandatory. (***DONE)
-   
+
  o Definition of EAP as new authentication method for connection auth
    protocol (RFC 3748).
 
@@ -82,5 +116,3 @@ point.
    silc-users.  (This is very old issue)
 
  o The time values in STATS is 32-bits.  After 2038 it's over 32-bits.
-
- o Consider for future authenticated encryption modes.
index 2be826d5341c2a1a056e4ed6ce2571cbb50736b3..4c8d26d6b6d8f0bd2ea735047ce95fc16bf91baa 100644 (file)
 
 AUTOMAKE_OPTIONS = 1.0 no-dependencies foreign
 
-SUBDIRS =      \
+SUBDIRS =              \
 #ifdef SILC_DIST_AUTODIST
-       autodist \
+       autodist        \
 #endif SILC_DIST_AUTODIST
 #ifdef SILC_DIST_SERVER
-       @SILCD_SUBDIR@ \
+       @SILCD_SUBDIR@  \
 #endif SILC_DIST_SERVER
 #ifdef SILC_DIST_CLIENT
-       @IRSSI_SUBDIR@ \
+       @IRSSI_SUBDIR@  \
 #endif SILC_DIST_CLIENT
 #ifdef SILC_DIST_INPLACE
-#      silcstress
+#      silcstress      \
 #endif SILC_DIST_INPLACE
+#ifdef SILC_DIST_ASN1UTILS
+       asn1utils       \
+#endif SILC_DIST_ASN1UTILS
+
 
diff --git a/apps/autodist/AUTHORS b/apps/autodist/AUTHORS
deleted file mode 100644 (file)
index 99141c0..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-Authors of SILC Autodist.
-
-Pekka Riikonen <priikone@iki.fi>
diff --git a/apps/autodist/CHANGES b/apps/autodist/CHANGES
deleted file mode 100644 (file)
index 73d44ff..0000000
+++ /dev/null
@@ -1,126 +0,0 @@
-Thu May 31 23:34:00 EEST 2007 Pekka Riikonen <priikone@silcnet.org>
-
-       * Autodist 1.3.2.
-
-       * Added 'prereq' directive to support encforcment of Autodist
-         version.
-
-       * Added support for providing extra parameters to autodist that
-         are passed to the hook scripts.  User can specify whatever
-         extra parameter they want.
-
-Wed Feb 21 15:45:50 EET 2007 Pekka Riikonen <priikone@silcnet.org>
-
-       * Autodist 1.3.1.
-
-Sat Jun 24 23:38:24 EEST 2006 Pekka Riikonen <priikone@silcnet.org>
-
-       * Match distdef names exactly (/^foo$/ instead of /^foo/).
-
-Wed May  4 10:58:24 EEST 2005 Pekka Riikonen <priikone@silcnet.org>
-
-       * Autodist 1.3.
-
-Sun May  1 17:31:55 EEST 2005 Pekka Riikonen <priikone@silcnet.org>
-
-       * Added support for dependencies in makefiles.
-
-       * Added AD_DISABLE_DEPENDENCIES macro to disable Autodist
-         dependencies in makefiles.  Added support for dependencies
-         in makefiles.
-
-       * Added -p option to Autodist.  It can be used to a process file
-         from the command line.
-
-       * Added dependency support for configure.ad files as well.
-
-Sat Apr 30 17:49:05 EEST 2005 Pekka Riikonen <priikone@silcnet.org>
-
-       * The 'noprocess' directive now works recursively with
-         directories.
-
-Sat Apr 30 11:49:01 EEST 2005 Pekka Riikonen <priikone@silcnet.org>
-
-       * Added better debug messages.
-
-       * Added log file creation, autodist.log and makedist.log.
-
-       * Fixed license-header to change license only during packaging,
-         not also during preparation.
-
-       * Fixed .ad processing when the file was not processed, to
-         copy the original to new name.
-
-       * Fixed 'include' when copying directories to root of the
-         distdir, and the destination directory already exist.
-
-Fri Apr 29 16:48:16 EEST 2005 Pekka Riikonen <priikone@silcnet.org>
-
-       * Fixed configure.ac creation when no fragments in use.
-
-Thu Apr 28 11:44:59 EEST 2005 Pekka Riikonen <priikone@silcnet.org>
-
-       * The '.in' suffix with source file suffixes expects source code 
-         format for the distdefs.
-
-Sun Apr 24 21:11:49 EEST 2005 Pekka Riikonen <priikone@silcnet.org>
-
-       * Fixed undefining to actually work.
-
-       * The top distribution now takes precedence on defined
-         distdefs over inherited distributions, and can override
-         defined and undefined distdefs (previously it could only
-         undefine defined but not define specificly undefined :)).
-
-       * Prettier distdef output with -s.
-
-Sat Apr 23 12:49:09 EEST 2005 Pekka Riikonen <priikone@silcnet.org>
-
-       * Autodist 1.2.1.
-
-       * Fixed 'noprocess' sed script.
-
-Fri Apr 22 20:23:06 EEST 2005  Pekka Riikonen <priikone@silcnet.org>
-
-       * Autodist 1.2.
-
-       * Various 'cat' optimizations.
-
-       * More test cases in tests/.
-
-       * No Autodist header for "other" '.ad' files as we don't know 
-         what the file contains.
-
-       * No non-source distdef format processing for source files
-         anymore.
-
-Tue Apr 19 17:12:09 EEST 2005  Pekka Riikonen <priikone@silcnet.org>
-
-       * Remove extra ' ' and '\t' when joining backslashed lines.
-
-       * Fixed argument delivery to hook scripts.
-
-Mon Apr 18 21:05:42 EEST 2005  Pekka Riikonen <priikone@silcnet.org>
-
-       * Process '*.ad' files before calling autoconf and automake.
-
-       * Various shell compatibility kludges added.
-
-Mon Apr 18 20:06:24 EEST 2005  Pekka Riikonen <priikone@silcnet.org>
-
-       * Autodist 1.1.
-
-       * All 'local' variables must be at the start of function for
-         compatibility.
-
-Sun Apr 17 20:08:28 EEST 2005  Pekka Riikonen <priikone@silcnet.org>
-
-       * Added TODO.
-
-       * Added pre-process-dist-hook and post-process-dist-hook.
-
-       * Added autodist.1.
-
-Sun Apr 16 23:00:02 EEST 2005  Pekka Riikonen <priikone@silcnet.org>
-
-       * First release, Autodist 1.0.
diff --git a/apps/autodist/COPYING b/apps/autodist/COPYING
deleted file mode 100644 (file)
index 5329321..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
-
-   1. Redistributions of source code must retain the above copyright
-      notice, this list of conditions and the following disclaimer.
-   2. Redistributions in binary form must reproduce the above copyright
-      notice, this list of conditions and the following disclaimer in the
-      documentation and/or other materials provided with the distribution.
-   3. The name of the author may not be used to endorse or promote
-      products derived from this software without specific prior written
-      permission.
-
-THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
-IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
-OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
-NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
-TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
diff --git a/apps/autodist/INSTALL b/apps/autodist/INSTALL
deleted file mode 100644 (file)
index 56b077d..0000000
+++ /dev/null
@@ -1,236 +0,0 @@
-Installation Instructions
-*************************
-
-Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005 Free
-Software Foundation, Inc.
-
-This file is free documentation; the Free Software Foundation gives
-unlimited permission to copy, distribute and modify it.
-
-Basic Installation
-==================
-
-These are generic installation instructions.
-
-   The `configure' shell script attempts to guess correct values for
-various system-dependent variables used during compilation.  It uses
-those values to create a `Makefile' in each directory of the package.
-It may also create one or more `.h' files containing system-dependent
-definitions.  Finally, it creates a shell script `config.status' that
-you can run in the future to recreate the current configuration, and a
-file `config.log' containing compiler output (useful mainly for
-debugging `configure').
-
-   It can also use an optional file (typically called `config.cache'
-and enabled with `--cache-file=config.cache' or simply `-C') that saves
-the results of its tests to speed up reconfiguring.  (Caching is
-disabled by default to prevent problems with accidental use of stale
-cache files.)
-
-   If you need to do unusual things to compile the package, please try
-to figure out how `configure' could check whether to do them, and mail
-diffs or instructions to the address given in the `README' so they can
-be considered for the next release.  If you are using the cache, and at
-some point `config.cache' contains results you don't want to keep, you
-may remove or edit it.
-
-   The file `configure.ac' (or `configure.in') is used to create
-`configure' by a program called `autoconf'.  You only need
-`configure.ac' if you want to change it or regenerate `configure' using
-a newer version of `autoconf'.
-
-The simplest way to compile this package is:
-
-  1. `cd' to the directory containing the package's source code and type
-     `./configure' to configure the package for your system.  If you're
-     using `csh' on an old version of System V, you might need to type
-     `sh ./configure' instead to prevent `csh' from trying to execute
-     `configure' itself.
-
-     Running `configure' takes awhile.  While running, it prints some
-     messages telling which features it is checking for.
-
-  2. Type `make' to compile the package.
-
-  3. Optionally, type `make check' to run any self-tests that come with
-     the package.
-
-  4. Type `make install' to install the programs and any data files and
-     documentation.
-
-  5. You can remove the program binaries and object files from the
-     source code directory by typing `make clean'.  To also remove the
-     files that `configure' created (so you can compile the package for
-     a different kind of computer), type `make distclean'.  There is
-     also a `make maintainer-clean' target, but that is intended mainly
-     for the package's developers.  If you use it, you may have to get
-     all sorts of other programs in order to regenerate files that came
-     with the distribution.
-
-Compilers and Options
-=====================
-
-Some systems require unusual options for compilation or linking that the
-`configure' script does not know about.  Run `./configure --help' for
-details on some of the pertinent environment variables.
-
-   You can give `configure' initial values for configuration parameters
-by setting variables in the command line or in the environment.  Here
-is an example:
-
-     ./configure CC=c89 CFLAGS=-O2 LIBS=-lposix
-
-   *Note Defining Variables::, for more details.
-
-Compiling For Multiple Architectures
-====================================
-
-You can compile the package for more than one kind of computer at the
-same time, by placing the object files for each architecture in their
-own directory.  To do this, you must use a version of `make' that
-supports the `VPATH' variable, such as GNU `make'.  `cd' to the
-directory where you want the object files and executables to go and run
-the `configure' script.  `configure' automatically checks for the
-source code in the directory that `configure' is in and in `..'.
-
-   If you have to use a `make' that does not support the `VPATH'
-variable, you have to compile the package for one architecture at a
-time in the source code directory.  After you have installed the
-package for one architecture, use `make distclean' before reconfiguring
-for another architecture.
-
-Installation Names
-==================
-
-By default, `make install' will install the package's files in
-`/usr/local/bin', `/usr/local/man', etc.  You can specify an
-installation prefix other than `/usr/local' by giving `configure' the
-option `--prefix=PREFIX'.
-
-   You can specify separate installation prefixes for
-architecture-specific files and architecture-independent files.  If you
-give `configure' the option `--exec-prefix=PREFIX', the package will
-use PREFIX as the prefix for installing programs and libraries.
-Documentation and other data files will still use the regular prefix.
-
-   In addition, if you use an unusual directory layout you can give
-options like `--bindir=DIR' to specify different values for particular
-kinds of files.  Run `configure --help' for a list of the directories
-you can set and what kinds of files go in them.
-
-   If the package supports it, you can cause programs to be installed
-with an extra prefix or suffix on their names by giving `configure' the
-option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
-
-Optional Features
-=================
-
-Some packages pay attention to `--enable-FEATURE' options to
-`configure', where FEATURE indicates an optional part of the package.
-They may also pay attention to `--with-PACKAGE' options, where PACKAGE
-is something like `gnu-as' or `x' (for the X Window System).  The
-`README' should mention any `--enable-' and `--with-' options that the
-package recognizes.
-
-   For packages that use the X Window System, `configure' can usually
-find the X include and library files automatically, but if it doesn't,
-you can use the `configure' options `--x-includes=DIR' and
-`--x-libraries=DIR' to specify their locations.
-
-Specifying the System Type
-==========================
-
-There may be some features `configure' cannot figure out automatically,
-but needs to determine by the type of machine the package will run on.
-Usually, assuming the package is built to be run on the _same_
-architectures, `configure' can figure that out, but if it prints a
-message saying it cannot guess the machine type, give it the
-`--build=TYPE' option.  TYPE can either be a short name for the system
-type, such as `sun4', or a canonical name which has the form:
-
-     CPU-COMPANY-SYSTEM
-
-where SYSTEM can have one of these forms:
-
-     OS KERNEL-OS
-
-   See the file `config.sub' for the possible values of each field.  If
-`config.sub' isn't included in this package, then this package doesn't
-need to know the machine type.
-
-   If you are _building_ compiler tools for cross-compiling, you should
-use the `--target=TYPE' option to select the type of system they will
-produce code for.
-
-   If you want to _use_ a cross compiler, that generates code for a
-platform different from the build platform, you should specify the
-"host" platform (i.e., that on which the generated programs will
-eventually be run) with `--host=TYPE'.
-
-Sharing Defaults
-================
-
-If you want to set default values for `configure' scripts to share, you
-can create a site shell script called `config.site' that gives default
-values for variables like `CC', `cache_file', and `prefix'.
-`configure' looks for `PREFIX/share/config.site' if it exists, then
-`PREFIX/etc/config.site' if it exists.  Or, you can set the
-`CONFIG_SITE' environment variable to the location of the site script.
-A warning: not all `configure' scripts look for a site script.
-
-Defining Variables
-==================
-
-Variables not defined in a site shell script can be set in the
-environment passed to `configure'.  However, some packages may run
-configure again during the build, and the customized values of these
-variables may be lost.  In order to avoid this problem, you should set
-them in the `configure' command line, using `VAR=value'.  For example:
-
-     ./configure CC=/usr/local2/bin/gcc
-
-causes the specified `gcc' to be used as the C compiler (unless it is
-overridden in the site shell script).  Here is a another example:
-
-     /bin/bash ./configure CONFIG_SHELL=/bin/bash
-
-Here the `CONFIG_SHELL=/bin/bash' operand causes subsequent
-configuration-related scripts to be executed by `/bin/bash'.
-
-`configure' Invocation
-======================
-
-`configure' recognizes the following options to control how it operates.
-
-`--help'
-`-h'
-     Print a summary of the options to `configure', and exit.
-
-`--version'
-`-V'
-     Print the version of Autoconf used to generate the `configure'
-     script, and exit.
-
-`--cache-file=FILE'
-     Enable the cache: use and save the results of the tests in FILE,
-     traditionally `config.cache'.  FILE defaults to `/dev/null' to
-     disable caching.
-
-`--config-cache'
-`-C'
-     Alias for `--cache-file=config.cache'.
-
-`--quiet'
-`--silent'
-`-q'
-     Do not print messages saying which checks are being made.  To
-     suppress all normal output, redirect it to `/dev/null' (any error
-     messages will still be shown).
-
-`--srcdir=DIR'
-     Look for the package's source code in directory DIR.  Usually
-     `configure' can determine that directory automatically.
-
-`configure' also accepts some other, not widely useful, options.  Run
-`configure --help' for more details.
-
diff --git a/apps/autodist/Makefile.am b/apps/autodist/Makefile.am
deleted file mode 100644 (file)
index c9d8c9a..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-#
-#  Makefile.am
-#
-#  Author: Pekka Riikonen <priikone@silcnet.org>
-#
-#  Copyright (C) 2005 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.
-#
-
-AUTOMAKE_OPTIONS = 1.0 no-dependencies foreign
-
-SUBDIRS = . doc tests
-
-AUTODIST_SOURCE = autodist.in makedist.in
-bin_SCRIPTS = autodist makedist
-
-autodistdir = @AUTODISTDIR@
-autodist_DATA = autodist.conf default COPYING
-
-CLEANFILES = $(bin_SCRIPTS)
-
-APIVERSION = @APIVERSION@
-# Install versioned links.
-install-exec-hook:
-       @for i in $(bin_SCRIPTS); do                                    \
-         f="`echo $$i | sed '$(transform)'`";                          \
-         fv="$$f-$(APIVERSION)";                                       \
-         rm -f $(DESTDIR)$(bindir)/$$fv;                               \
-         chmod +x $(DESTDIR)$(bindir)/$$f;                             \
-         chmod a-w $(DESTDIR)$(bindir)/$$f;                            \
-         ln $(DESTDIR)$(bindir)/$$f $(DESTDIR)$(bindir)/$$fv;          \
-       done
-
-uninstall-hook:
-       @for i in $(bin_SCRIPTS); do                                    \
-         f="`echo $$i|sed '$(transform)'`";                            \
-         fv="$$f-$(APIVERSION)";                                       \
-         rm -f $(DESTDIR)$(bindir)/$$fv;                               \
-        done
-
-EXTRA_DIST = $(AUTODIST_SOURCE) default autodist.conf
diff --git a/apps/autodist/README b/apps/autodist/README
deleted file mode 100644 (file)
index e954599..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-Autodist
-
-The Autodist is a source distribution management system that allows 
-powerful mechanisms to define what is included in and excluded from a 
-distribution, and what license the distribution is released under.  It is 
-also used to create the actual distribution source packages.  Autodist 
-allows distribution management in file, directory and file content level.  
-Different distributions may include different portions of files, for 
-example, excluding certain features from certain distributions.  It is 
-always guaranteed that anything not defined for the distribution, is 
-removed automatically (files, file content, directories), thus ensuring 
-that nothing is accidentally included in the distribution.
-
-Autodist is closely related to the Autoconf and Automake tools, and 
-complements the features Autoconf and Automake provides.  It is especially 
-targeted into circumstances where multiple distributions are created from 
-one source tree.  The Autoconf and Automake environment is mainly designed 
-for one application per one source tree situations.  Autodist provides 
-mechanisms to create all kinds of distributions that can be created from 
-one source tree.  To be able to use Autodist, the Autoconf and Automake 
-must be installed into the system.
-
-The motivation behind Autodist stems from need to be able to create 
-multiple distributions from one large source tree in a precise and 
-controllable manner.  The Autoconf and Automake provides mere basic 
-control what is included in and excluded from distributions and how the 
-distributions are created.  They also do not provide mechanism to define 
-different licensing conditions for different distributions, or changing 
-the license automatically for different user or customer purposes.  Many 
-large software projects, companies and corporations have commonly been 
-using Autoconf and Automake tools, but have had the need to create their 
-own ad-hoc mechanisms to control distribution creation.  The Autodist 
-attempts to provide a tool that any size software project or company can 
-effectively use to manage their distributions.
-
-Autodist is not a binary packaging system.  It is specificly used to 
-create source distributions.  A binary packaging system, however can be 
-hooked to the distribution creation process, if needed.
-
-Read the INSTALL file on how to install the Autodist.  Refer info pages 
-for Autodist documentation by giving 'info autodist'.  Mail suggestions 
-and/or patches to autodist@silcnet.org, and bugs to 
-autodist-bugs@silcnet.org.  Please, always include the Autodist version 
-number to your email.  Give 'autodist --version' to get version.
-
-Autodist was originally written for the SILC Project (Secure Internet Live 
-Conferencing), which needed controlled mechanism to create several 
-distinct distributions from one source tree.
-
diff --git a/apps/autodist/TODO b/apps/autodist/TODO
deleted file mode 100644 (file)
index 106cb48..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-TODO In Autodist
-================
-
-o Better 'license-header' implementation.
-
-o Perhaps ability to partially re-license the source tree.  Now all files
-  will be processed if 'license-header' is used.  Only way to control
-  this is to use 'noprocess' or specify different header in file.
diff --git a/apps/autodist/autodist.conf b/apps/autodist/autodist.conf
deleted file mode 100644 (file)
index cbf17b5..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-# Autodist configuration file
-
-# By default distdef prefix is '_DIST_'.  To add your own prefix set the
-# prefix here.  NOTE: Remember to change all 'define' directives in
-# distributions to use the new prefix if you change it.  Example:
-#
-# DISTPREFIX="SILC"
-#
-# Will set the distdef prefix as 'SILC_DIST_'.
-# 
-DISTPREFIX=""
-
-# The distdef header will be created by the Autodist.  It need to be included
-# in the source code in order for the preprocessor to respect distdef 
-# conditionals in source code.  Example:
-#
-# DISTDEFS="include/distdefs.h"
-#
-DISTDEFS="distdefs.h"
-
-# Location of the aclocal tool.  If this is omitted the Autodist will not
-# run aclocal.  User need to run it manually then.
-#
-ACLOCAL="aclocal"
-
-# Location of the autoheader tool.  If this is omitted the Autodist will not
-# run autoheader.  User need to run it manually then.
-#
-AUTOHEADER="autoheader"
-
-# Location of the autoconf tool.  If this is omitted the Autodist will not
-# run autoconf.  User need to run it manually then.
-#
-AUTOCONF="autoconf"
-
-# Location of the automake tool.  If this is omitted the Autodist will not
-# run automake.  User need to run it manually then.
-#
-AUTOMAKE="automake -a -c"
-
-# Location of the libtoolize tool.  This option should be omitted if your
-# source tree does not use libtool.
-#
-LIBTOOLIZE="libtoolize --automake --copy"
-
-# Location of the make program.  This must be specified in order to be 
-# able to create distributions.
-#
-MAKE="make"
diff --git a/apps/autodist/autodist.in b/apps/autodist/autodist.in
deleted file mode 100755 (executable)
index e4388ab..0000000
+++ /dev/null
@@ -1,2056 +0,0 @@
-#!/bin/sh
-#
-# Author: Pekka Riikonen <priikone@silcnet.org>
-#
-# Copyright (C) 2005 - 2007 Pekka Riikonen
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-#   1. Redistributions of source code must retain the above copyright
-#      notice, this list of conditions and the following disclaimer.
-#   2. Redistributions in binary form must reproduce the above copyright
-#      notice, this list of conditions and the following disclaimer in the
-#      documentation and/or other materials provided with the distribution.
-#   3. The name of the author may not be used to endorse or promote
-#      products derived from this software without specific prior written
-#      permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
-# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
-# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
-# NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
-# TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#
-
-###############################################################################
-# Shell compatibility
-
-# Be Bourne compatible
-if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
-  # Despite of this, we have managed to segfault some zsh's.
-  emulate sh
-  NULLCMD=:
-  # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
-  # is contrary to our usage.  Disable this feature.
-  alias -g '${1+"$@"}'='"$@"'
-fi
-DUALCASE=1; export DUALCASE # for MKS sh
-
-# Support unset when possible.
-if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
-  as_unset=unset
-else
-  as_unset=false
-fi
-
-# Work around bugs in pre-3.0 UWIN ksh.
-$as_unset ENV MAIL MAILPATH
-PS1='$ '
-PS2='> '
-PS4='+ '
-
-# NLS nuisances.
-for as_var in \
-  LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
-  LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
-  LC_TELEPHONE LC_TIME
-do
-  if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
-    eval $as_var=C; export $as_var
-  else
-    $as_unset $as_var
-  fi
-done
-
-
-###############################################################################
-# Global variables
-
-# Packaging and compressing
-ad_gzip=true
-ad_bzip2=false
-ad_compress=false
-ad_zip=false
-
-# Distribution subdirectory
-distdir="distdir"
-am_distdir=
-
-# This current distribution
-distribution=default
-distfile=$distribution
-dist_version=0.0
-package=
-bug_report=
-
-# All inherited distributions in this distribution
-inherits=
-
-# All distribution defines for this distribution
-distdefs=
-
-# All distribution undefines for this distribution
-undistdefs=
-
-# All distribution options
-doptions=
-opt_template=false
-opt_no_dist=false
-opt_no_inherit=false
-
-# All includes
-includes=
-
-# All excludes
-excludes=
-
-# All noprocesses
-noprocess=
-
-# All hooks
-pre_hooks=
-post_hooks=
-pre_dist_hooks=
-post_dist_hooks=
-pre_p_dist_hooks=
-post_p_dist_hooks=
-
-# Distribution license and license header
-license=
-licenseh=
-
-# Whether to output ad_debug information
-debug=false
-nolog=false
-
-# Autodist version
-ver=@VERSION@
-
-###############################################################################
-# Configuration file
-if test -f "$distdir/autodist.conf"; then
-  . $distdir/autodist.conf
-fi
-
-DP=$DISTPREFIX
-
-
-###############################################################################
-# Functions
-
-#
-# Print out debug information if debugging is enabled.  To enable debugging
-# set the global variable "debug" to true value.
-#
-# Arguments: ad_debug <ad_debug string>
-#
-ad_debug()
-{
-  if test x$debug = xtrue; then
-    set -f
-    echo autodist: $1
-    set +f
-  fi
-}
-
-#
-# Prints out error message and exits the script.
-#
-# Arguments: ad_fatal <error message>
-#
-ad_fatal()
-{
-  set -f
-  ad_log "error: $1"
-  echo autodist: error: $1
-  set +f
-  exit 1
-}
-
-#
-# Prints out warning message
-#
-# Arguments: ad_warning <warning message>
-#
-ad_warning()
-{
-  set -f
-  ad_log "warning: $1"
-  echo autodist: warning: $1
-  set +f
-}
-
-#
-# Opens a log file.
-#
-# Arguments: ad_log_open <logfile>
-#
-ad_log_open()
-{
-  rm -rf $1
-  exec 5> $1
-
-  cat >&5 << EOF
-This file contains messages produced by the Autodist $ver.
-
-EOF
-}
-
-#
-# Prints to an open log file
-#
-# Arguments: ad_log
-#
-ad_log()
-{
-  if test x$nolog = xfalse; then
-    echo "$1" >&5
-  fi
-}
-
-#
-# Initializes the Autodist environment, creates default distribution
-# directory, and default distribution.
-#
-# Arguments: ad_initialize
-#
-ad_initialize()
-{
-  ad_debug "Initializing Autodist environment"
-
-  # Create default distdir
-  if test '!' -f $distdir; then
-    mkdir -p -- $distdir
-  fi
-
-  # Create Autodist configuration file
-  if test -f @AUTODISTDIR@/autodist.conf; then
-    cp -p @AUTODISTDIR@/autodist.conf $distdir
-  fi
-
-  # Create default distribution
-  if test -f @AUTODISTDIR@/default; then
-    cp -p @AUTODISTDIR@/default $distdir
-  fi
-
-  ad_debug "Autodist environment initialized"
-}
-
-#
-# Creates the distdefs header file including defined distdefs
-#
-# Arguments: ad_create_distdefs_h
-#
-ad_create_distdefs_h()
-{
-  ad_debug "Creating distdef header file"
-
-  fname=$DISTDEFS
-  rm -f $fname
-  cat > $fname <<EOF
-/*
-  Automatically generated by Autodist $ver.  Do not edit.
-
-  Generated: `date` by `whoami`
-  Distribution: $distribution
-  License: $license
-*/
-
-#ifndef _`echo $DP`_DISTDEFS_H
-#define _`echo $DP`_DISTDEFS_H
-
-EOF
-
-  for i in $distdefs
-  do
-    echo "#define $i 1" >>$fname
-  done
-
-  cat >> $fname <<EOF
-
-#endif /* _`echo $DP`_DISTDEFS_H */
-EOF
-
-  ad_debug "Distdef header file created"
-}
-
-#
-# Creates the main configure script for the distribution.  This runs
-# the aclocal, autoheader and autoconf tools.
-#
-# Arguments: ad_make_configure
-#
-ad_make_configure()
-{
-  local run_autoconf=false
-
-  ad_debug "Starting configure creation"
-
-  rm -f configure
-
-  if test "$ACLOCAL"; then
-    ad_debug "Running aclocal"
-    if test x$debug = xtrue; then
-      $ACLOCAL
-    else
-      $ACLOCAL 1>/dev/null 2>/dev/null
-    fi
-    if test $? != 0; then
-      ad_fatal "aclocal failed"
-    fi
-  fi
-
-  if test "$AUTOCONF"; then
-    ad_debug "Running autoconf"
-    $AUTOCONF
-    if test $? != 0; then
-      ad_fatal "autoconf failed"
-    fi
-    run_autoconf=true
-  fi
-
-  if test "$AUTOHEADER"; then
-    ad_debug "Running autoheader"
-    $AUTOHEADER
-    if test $? != 0; then
-      ad_fatal "autoheader failed"
-    fi
-  fi
-
-  if test "$LIBTOOLIZE"; then
-    ad_debug "Running libtoolize"
-    $LIBTOOLIZE
-    if test $? != 0; then
-      ad_fatal "libtoolize failed"
-    fi
-  fi
-
-  if test x$run_autoconf = xtrue; then
-    if test '!' -f configure; then
-      ad_fatal "creating configure script failed"
-    fi
-  fi
-
-  ad_debug "Ending configure creation"
-}
-
-#
-# Creates the configure.ac script from the configure.ad fragments in
-# the source tree.  Takes the source configure file as argument which
-# is used to create the actual configure.ac.
-#
-# Arguments: ad_make_configure_ac <configure_ac_source>
-#
-ad_make_configure_ac()
-{
-  local check
-
-  ad_debug "Starting creating configure.ac: $1"
-
-  ad_log ""
-  ad_log "Following configure.ad files were processed into configure.ac:"
-  ad_log "--------------------------------------------------------------"
-
-  if test '!' -f $1; then
-    ad_fatal "The configure file '$1' does not exist"
-  fi
-
-  check="`sed 's/^[    ]*//' < $1 | grep -v "^#" | grep -e "AD_INIT"`"
-  if test -z $check; then
-    rm -f configure.ad.cfs
-    rm -f $fname $fname.tmp
-    ad_fatal "The 'AD_INIT' macro has not been set in configure.ac"
-  fi
-
-  rm -f configure.ac configure.ad.cfs
-
-  cfs=`find . -type f -name configure\*\.ad`
-  for i in $cfs
-  do
-    if test "x$i" = "x$1"; then
-      continue
-    fi
-
-    ad_debug "including $i"
-    ad_log "  $i"
-
-    cat $i >> configure.ad.cfs
-  done
-
-  if test -f configure.ad.cfs; then
-    check="`sed 's/^[  ]*//' < $1 | grep -v "^#" | grep -e "AD_INCLUDE_CONFIGURE"`"
-    if test -z $check; then
-      rm -f configure.ad.cfs
-      ad_warning "configure.ad fragments found but 'AD_INCLUDE_CONFIGURE' is not set"
-    fi
-  fi
-
-  # Header for configure.ac
-  fname="configure.tmp.ac"
-  cat > $fname <<EOF
-# Automatically generated by Autodist $ver.  Do not edit.
-# To make changes edit the configure.ad file in the source tree.
-
-# Source: configure.ad
-# Generated: `date` by `whoami`
-# Distribution: $distribution
-# License: $license
-
-EOF
-
-  ad_debug "creating configure.ac"
-  if test -f configure.ad.cfs; then
-    sed '/^AD_INCLUDE_CONFIGURE/ r configure.ad.cfs' $1 > $fname.tmp
-    sed -e "/^AD_INCLUDE_CONFIGURE/d" $fname.tmp >> $fname
-    rm -f configure.ad.cfs $fname.tmp
-  else
-    cat $1 >> $fname
-  fi
-
-  # Process AD_INIT
-  sed -e "/AD_INIT/s//AC_INIT([$distribution], [$dist_version], [$bug_report], [$package])/" $fname > $fname.tmp
-
-  # Remove AD_DISABLE_DEPENDENCIES
-  sed -e "/^AD_DISABLE_DEPENDENCIES/d" $fname.tmp > $fname
-
-  # Process for distribution
-  rm -f $fname.tmp
-  ad_process_file $fname $fname.tmp false
-
-  # Remove any trailing backslashes
-  if test -f "$fname.tmp"; then
-    sed -e :a -e '/\\$/N; s/[  ]*\\\n//; ta' < $fname.tmp > configure.ac
-  else
-    cp -p $fname configure.ac
-  fi
-  rm -f $fname $fname.tmp
-
-  ad_log "  ./configure.ad"
-  ad_log ""
-
-  ad_debug "Ending creating configure.ac: $1"
-}
-
-#
-# Creates the Makefile.in files by running the automake tool.
-#
-# Arguments: ad_make_makefile_ins
-#
-ad_make_makefile_ins()
-{
-  ad_debug "Starting creating Makefile.in files"
-
-  if test "$AUTOMAKE"; then
-    ad_debug "Running automake"
-    $AUTOMAKE
-    if test $? != 0; then
-      ad_fatal "automake failed"
-    fi
-  fi
-
-  ad_debug "Ending creating Makefile.in files"
-}
-
-#
-# Creates the Makefile.am files from the Makefile.ad files in the
-# source tree.  This runs the distribution specific processing for the
-# Makefile.ad files.
-#
-# Arguments: ad_make_makefile_ams
-#
-ad_make_makefile_ams()
-{
-  ad_debug "Starting creating Makefile.am files"
-
-  ad_log ""
-  ad_log "Following Makefile.ad files were processed into Makefile.am files:"
-  ad_log "------------------------------------------------------------------"
-
-  files=`find . -type f -name Makefile\.ad`
-  for ff in $files
-  do
-    ad_log "  $ff"
-    fname=`echo $ff | sed s/\.ad//`
-    ad_make_makefile_am $ff $fname.am
-  done
-  ad_log ""
-
-  ad_debug "Ending creating Makefile.am files"
-}
-
-#
-# Creates Makefile.am file from the Makefile.ad file.
-#
-# Arguments: ad_make_makefile_am <src> <dst>
-#
-ad_make_makefile_am()
-{
-  local am_deps=true
-  local f=$1
-  local fname=$2
-
-  # Disable dependencies if requested
-  dc=`sed 's/^[        ]*//' < configure.ad | grep -v "^#" \
-    | grep "AD_DISABLE_DEPENDENCIES"`
-  if test "$dc" = "AD_DISABLE_DEPENDENCIES"; then
-    am_deps=false
-  fi
-
-  # Header for the Makefile.am
-  cat > $fname <<EOF
-# Automatically generated by Autodist $ver from Makefile.ad.  Do not edit.
-# To make changes edit the $f file in the source tree.
-
-# Source: $f
-# Generated: `date` by `whoami`
-# Distribution: $distribution
-# License: $license
-
-EOF
-
-  # Run the distribution processing for this Makefile.ad
-  ad_debug "Processing $f to be $fname"
-  ad_process_file $f $fname.tmp false
-
-  # Remove any trailing backslashes
-  if test -f "$fname.tmp"; then
-    sed -e :a -e '/\\$/N; s/[  ]*\\\n//; ta' < $fname.tmp >> $fname
-  else
-    cat $f >> $fname
-  fi
-
-  # Enable dependencies if requested
-  if test x$am_deps = xtrue; then
-    # Get list of configure.ad's to get them into deps also
-    cfs=`find . -type f -name configure\*\.ad`
-    cfs=`echo $cfs | sed 's/\.\///g'`
-
-    cat >> $fname <<EOF
-
-# S_AD_ENABLE_DEPENDENCIES
-\$(srcdir)/Makefile.am: Makefile.ad
-       cd \$(top_srcdir) && autodist -p makefile \$(subdir)/Makefile.ad \$(subdir)/Makefile.am && cd \$(subdir)
-\$(srcdir)/configure.ac: $cfs
-       cd \$(top_srcdir) && autodist -p configure \$(top_srcdir)/configure.ad && cd \$(subdir)
-# E_AD_ENABLE_DEPENDENCIES
-EOF
-  fi
-
-  rm -f $fname.tmp
-}
-
-#
-# Processes all files with .ad suffix, with exception of configure*.ad
-# and Makefile.ad files, for distribution from the source tree.
-#
-# Arguments: ad_process_ads false
-#
-ad_process_ads()
-{
-  ad_debug "Starting processing .ad files"
-
-  ad_log ""
-  ad_log "Following .ad files were processed:"
-  ad_log "-----------------------------------"
-
-  files=`find . -type f -name \*\.ad \! -name configure\*\.ad \! -name Makefile\.ad`
-  for i in $files
-  do
-    fname=`echo $i | sed s/\.ad//`
-
-    ad_debug "Processing $i to be $fname"
-    ad_log "  $i into $fname"
-
-    # Run the distribution processing for this file
-    ad_process_file $i $fname false
-    if test -f $fname; then
-      cp -p $i $fname || exit 1
-    fi
-
-  done
-  ad_log ""
-
-  ad_debug "Ending processing .ad files"
-}
-
-#
-# Includes files specified in the distribution for inclusion.  Used when
-# creating the distribution for packaging.
-#
-# include has the following format in distfile:
-#
-#   include <path> [<dest path>]
-#
-# If only source path, which may be file, directory or regular expression,
-# is specified the path will be same in distribution.  If the destination
-# path is specified that will be the new name and/or new location of the
-# source path.  This, in effect, is a cp utility with ability to create
-# directories if they do not exist.
-#
-# Arguments: ad_dist_includes <includeslist> <recursive> <log>
-#
-ad_dist_includes()
-{
-  local incs
-
-  ad_debug "Starting running includes: $1 $2"
-
-  if test x$3 = xtrue; then
-    ad_log ""
-    ad_log "Following files and directories were included in distribution:"
-    ad_log "--------------------------------------------------------------"
-  fi
-
-  # By default do not expand pathnames
-  set -f
-
-  # Add : separator at the end
-  incs="`echo "$1" | sed 's/$/ : /'`"
-
-  src=
-  dst=
-  for i in $incs
-  do
-    if test "$i" = ":" && test -z "$src"; then
-      continue
-    fi
-    if test -z "$src"; then
-      src=$i
-      continue
-    fi
-    if test -z "$dst" && test "$i" != ":"; then
-      dst=$i
-    else
-      dst=$src
-    fi
-
-    ad_debug "Including $src into $dst"
-
-    if test -f "$src"; then
-      # Add file
-
-      if test "$src" = "$dst"; then
-        # Add to same location
-        d=`echo $src | sed 's,/[^/]*$,,'`
-        if test "$d" != "$src" && test "$d" != "." && \
-          test '!' -d $am_distdir/$d; then
-          mkdir -p -- $am_distdir/$d || exit 1
-        fi
-      else
-        # Add to different location
-        check=`echo "$dst" | sed 's/?//; s/*//; s/\[//; s/\]//'`
-        if test "$check" != "$dst"; then
-          ad_fatal "Invalid destination in 'include $src $dst'"
-        fi
-
-        d=`echo $dst | sed 's,/[^/]*$,,'`
-        if test "$d" != "$dst" && test "$d" != "." && \
-          test '!' -d $am_distdir/$d; then
-          mkdir -p -- $am_distdir/$d || exit 1
-        fi
-      fi
-
-      if test x$3 = xtrue; then
-       ad_log "  $src into $am_distdir/$d"
-      fi
-      cp -p $src $am_distdir/$d || exit 1
-
-    elif test -d "$src"; then
-      # Add directory
-
-      if test "$src" = "$dst"; then
-       # Add to same location
-       d=`echo $src | sed 's,/[^/]*$,,'`
-       ds=`echo $src | sed 's/\/$//'`
-       if test "$ds" = "$d"; then
-          d=`echo $d | sed 's,/[^/]*$,,'`
-       fi
-       if test "$ds" = "$d"; then
-         d=""
-       fi
-       if test '!' -d $am_distdir/$d && test "$ds" != "$d"; then
-          mkdir -p -- $am_distdir/$d || exit 1
-       fi
-
-       if test x$3 = xtrue; then
-         ad_log "  $src into $am_distdir/$d"
-       fi
-       cp -pR $src $am_distdir/$d || exit 1
-      else
-       # Add to different location
-        check=`echo "$dst" | sed 's/?//; s/*//; s/\[//; s/\]//'`
-        if test "$check" != "$dst"; then
-          ad_fatal "Invalid destination in 'include $src $dst'"
-        fi
-
-        d=`echo $dst | sed 's,/[^/]*$,,'`
-        ds=`echo $dst | sed 's/\/$//'`
-        if test "$ds" = "$d"; then
-          d=`echo $d | sed 's,/[^/]*$,,'`
-        fi
-        if test '!' -d $am_distdir/$d && test "$dst" != "$d"; then
-          mkdir -p -- $am_distdir/$d || exit 1
-        fi
-
-       if test x$3 = xtrue; then
-         ad_log "  $src into $am_distdir/$dst"
-       fi
-        cp -pR $src $am_distdir/$dst || exit 1
-      fi
-
-    elif test x$2 != xtrue; then
-      # We assume regular expression in filename
-      check=`echo "$src" | sed 's/?//; s/*//; s/\[//; s/\]//'`
-      if test "$check" == "$src"; then
-       if test '!' -a $src; then
-         ad_fatal "Including $src: No such file or directory"
-       fi
-       src=
-       dst=
-       continue
-      fi
-
-      # Recursively call this function with expanded pathnames.  The
-      # reason why we don't let sh by default expand pathnames is that
-      # the include's destination is optional.  If sh expands by default
-      # we don't know the destination.  For this reason, we handle the
-      # expansion here ourselves.
-
-      # If src and dst are same, then expand the pathname as we'll copy
-      # matches to their own locations.
-      if test "$src" = "$dst"; then
-       # Expand pathnames, and format to our include format
-       set +f
-       srcs=`echo $src | sed -e 's/ / : /g' -e 's/^/ : /'` || exit 1
-       set -f
-      else
-       # Destination is new, and it has to be a directory.
-       check=`echo "$dst" | sed 's/?//; s/*//; s/\[//; s/\]//'`
-       if test "$check" != "$dst"; then
-         ad_fatal "Invalid destination in 'include $src $dst'"
-       fi
-
-       # Make sure dst has / at the end, as this must be a directory
-       dst=`echo $dst | sed 's/\/$//; s/$/\//'`
-
-       # Escape dst for sed
-       dste=`echo $dst | sed 's/\\//\\\\\//g'` || exit 1
-
-       # Expand pathnames, and format to our include format
-       set +f
-       srcs=`echo $src | sed -e "s/ / $dste : /g" \
-         -e 's/^/ : /' -e "s/$/ $dste/"` || exit 1
-       set -f
-      fi
-
-      # Include recursively
-      ad_dist_includes "$srcs" true
-
-    elif test '!' -a $src; then
-      ad_fatal "Including $src: No such file or directory"
-    fi
-
-    src=
-    dst=
-  done
-
-  if test x$3 = xtrue; then
-    ad_log ""
-  fi
-
-  set +f
-
-  ad_debug "Ending running includes: $1 $2"
-}
-
-#
-# Excludes files specified in the distribution for exclusion.  Used when
-# creating the distribution for packaging.
-#
-# exclude has the following format in distfile:
-#
-#  exclude <path>
-#
-# The path may be file, directory or regular expression.
-#
-# Arguments: ad_dist_includes <excludelist> <log>
-#
-ad_dist_excludes()
-{
-  ad_debug "Starting running excludes: $1"
-
-  if test x$2 = xtrue; then
-    ad_log ""
-    ad_log "Following files and directories were excluded from distribution:"
-    ad_log "----------------------------------------------------------------"
-  fi
-
-  cur=`pwd`
-  cd $am_distdir || exit 1
-  for i in $1
-  do
-    ad_debug "Excluding $i"
-    if test x$2 = xtrue; then
-      ad_log "  $i"
-    fi
-    rm -rf $i
-  done
-  cd $cur || exit 1
-
-  if test x$2 = xtrue; then
-    ad_log ""
-  fi
-
-  ad_debug "Ending running excludes: $1"
-}
-
-#
-# Processes the entire tree for distribution.  This inspects files other
-# than source and header files, with exception of any file with .ad
-# suffix, and performs distribution processing for the file.  The original
-# file is replaced with the processed file.  This function is used when
-# creating the distribution for packaging.
-#
-# Arguments: ad_process_tree <directory>
-#
-ad_process_tree()
-{
-  ad_debug "Starting processing non-source files: $1"
-
-  # Take files, except source and .ad files.
-  files=`find $am_distdir -type f \! -name \*\.ad \( \
-       \! -name \*\.[cC] -a \
-       \! -name \*\.[cC][cCpP] -a \
-       \! -name \*\.[cC][xX][xX] -a \
-       \! -name \*\.[cC][pP][pP] -a \
-       \! -name \*\.[cC]++ -a \
-       \! -name \*\.m -a \
-       \! -name \*\.[hH] -a \
-       \! -name \*\.hh -a \
-       \! -name \*\.[cC]\.in -a \
-       \! -name \*\.[cC][cCpP]\.in -a \
-       \! -name \*\.[cC][xX][xX]\.in -a \
-       \! -name \*\.[cC][pP][pP]\.in -a \
-       \! -name \*\.[cC]++\.in -a \
-       \! -name \*\.m\.in -a \
-       \! -name \*\.[hH]\.in -a \
-       \! -name \*\.hh\.in \)`
-  files=`echo $files | sed 's/$am_distdir//'`
-
-  for ff in $files
-  do
-    ad_process_file $ff $ff.tmp true
-    if test -f $ff.tmp; then
-      rm -f $ff || exit 1
-      mv -f $ff.tmp $ff || exit 1
-    fi
-  done
-
-  ad_debug "Ending processing non-source files: $1"
-}
-
-#
-# Processes the entire source tree for distribution.  This inspects files
-# in the source tree, with exception of any file with .ad suffix, and
-# performs distribution processing for the file.  The original file is
-# replaced with the processed file.  This function is used when creating
-# the distribution for packaging.
-#
-# Call this before ad_process_tree().
-#
-# Arguments: ad_process_source_tree <directory>
-#
-ad_process_source_tree()
-{
-  ad_debug "Starting processing source files: $1"
-
-  # We take only C/C++ files since they use the C compiler friendly
-  # version of distdefs.  Other files are not assumed to use them.
-  files=`find $am_distdir -type f \! -name \*\.ad \( \
-       -name \*\.[cC] -o \
-       -name \*\.[cC][cCpP] -o \
-       -name \*\.[cC][xX][xX] -o \
-       -name \*\.[cC][pP][pP] -o \
-       -name \*\.[cC]++ -o \
-       -name \*\.m -o \
-       -name \*\.[hH] -o \
-       -name \*\.hh -o \
-       -name \*\.[cC]\.in -o \
-       -name \*\.[cC][cCpP]\.in -o \
-       -name \*\.[cC][xX][xX]\.in -o \
-       -name \*\.[cC][pP][pP]\.in -o \
-       -name \*\.[cC]++\.in -o \
-       -name \*\.m\.in -o \
-       -name \*\.[hH]\.in -o \
-       -name \*\.hh\.in \)`
-
-  for ff in $files
-  do
-    ad_process_source_file $ff $ff.tmp true
-    if test -f $ff.tmp; then
-      rm -f $ff || exit 1
-      mv -f $ff.tmp $ff || exit 1
-    fi
-  done
-
-  ad_debug "Ending processing source files: $1"
-}
-
-#
-# Removes Autodist dependencies, as they cannot be delivered to distribution.
-#
-# Arguments: ad_remove_dependencies <distdir>
-#
-ad_remove_dependencies()
-{
-  ad_debug "Removing dependencies"
-
-  ams=`find $1 -type f -name Makefile\.\*`
-  for i in $ams
-  do
-    sed -e "/^# S_AD_ENABLE_DEPENDENCIES/,/^# E_AD_ENABLE_DEPENDENCIES/d" $i > $i.tmp
-    mv $i.tmp $i
-  done
-}
-
-#
-# Makes distribution sane, ala modtimes.  Since we modify the distribution
-# we need to make it sane after that.
-#
-# Arguments: ad_makedist_makesane
-#
-ad_makedist_makesane()
-{
-  ad_debug "Making distribution file modtimes sane"
-
-  # DO NOT change these order unless you know what you are doing.
-  if test -f $am_distdir/configure.ac; then
-    touch $am_distdir/configure.ac
-  fi
-
-  if test -f $am_distdir/aclocal.m4; then
-    touch $am_distdir/aclocal.m4
-  fi
-
-  if test '!' -f Makefile; then
-    ad_fatal "Makefile: No such file or directory"
-  fi
-
-  configh=`grep "^CONFIG_HEADER" Makefile | cut -d= -f2 | sed 's/^[    ]*//'`
-  touch $am_distdir/$configh.in 1>/dev/null 2>/dev/null
-
-  files=`find $am_distdir -type f -name Makefile\.in`
-  for i in $files
-  do
-    touch $i
-  done
-
-  if test -f $am_distdir/configure; then
-    touch $am_distdir/configure
-  fi
-
-  if test -f $am_distdir/config.status; then
-    touch $am_distdir/config.status
-  fi
-
-  ad_debug "Distribution made sane"
-}
-
-#
-# Creates distribution of the source tree.  All files in the distribution
-# will be processed and the distribution will be packaged.
-#
-# Arguments: ad_makedist
-#
-ad_makedist()
-{
-  ad_log_open "makedist.log"
-  ad_debug "Starting distribution creation"
-
-  ad_log "Created distribution"
-  ad_log "--------------------"
-  ad_log ""
-
-  if test '!' -f autodist.dist; then
-    ad_fatal "Autodist has not been run yet to prepare source tree"
-  fi
-
-  if test -z $MAKE; then
-    ad_fatal "The MAKE variable is not set in autodist.conf"
-  fi
-
-  # Get distdir from Makefile
-  if test '!' -f Makefile; then
-    ad_fatal "The source tree is not configured, run ./configure first"
-  fi
-
-  # Parse the requested distribution
-  distribution=`grep "dist:" < autodist.dist | cut -d: -f2` || exit 1
-  dist_version=`grep "ver:" < autodist.dist | cut -d: -f2` || exit 1
-  am_distdir=`grep "distdir:" < autodist.dist | cut -d: -f2` || exit 1
-  params=`grep "params:" < autodist.dist | cut -d: -f2` || exit 1
-  ad_parse_distribution $distribution false
-  ad_log "  Distribution: $distribution $dist_version"
-  ad_log "  Destination directory: $am_distdir"
-  ad_log ""
-  ad_process_distdefs
-
-  if test x$opt_no_dist = xtrue; then
-    ad_fatal "The '$distribution' distribution cannot be packaged"
-  fi
-
-  # Run pre-dist-hooks
-  ad_run_dist_hooks "$pre_dist_hooks" "$params"
-
-  # Create distribution directory
-  ad_debug "Creating distribution directory $am_distdir"
-  $MAKE distdir || exit 1
-  chmod -R a+r $am_distdir
-
-  if test '!' -d $am_distdir; then
-    ad_fatal "Distribution directory $am_distdir not created"
-  fi
-
-  # Run pre-process-dist-hooks
-  ad_run_dist_hooks "$pre_p_dist_hooks" "$params"
-
-  # Run excludes
-  ad_dist_excludes "$excludes" true
-
-  # Run includes
-  ad_dist_includes "$includes" false true
-
-  # Include specific license file if specified
-  if test "$license" != ""; then
-    ad_log ""
-    ad_log "License file in distribution:"
-    ad_log "-----------------------------"
-    ad_log "  $license into $am_distdir/COPYING"
-    ad_log ""
-    cp -p $license $am_distdir/COPYING || exit 1
-  fi
-
-  # Remove dependencies
-  ad_remove_dependencies $am_distdir
-
-  # Process noprocesses, first pass
-  ad_process_noprocess true
-
-  ad_log ""
-  ad_log "Following files were not re-licensed:"
-  ad_log "-------------------------------------"
-
-  # Process source files
-  ad_debug "Process distribution source tree"
-  ad_process_source_tree $am_distdir
-
-  # Process non-source files
-  ad_debug "Process distribution tree"
-  ad_process_tree $am_distdir
-
-  ad_log ""
-
-  # Process noprocesses, second pass
-  ad_process_noprocess false
-
-  # Run post-process_dist-hooks
-  ad_run_dist_hooks "$post_p_dist_hooks" "$params"
-
-  # Make distribution sane
-  ad_makedist_makesane
-
-  # Package
-  ad_debug "Packaging distribution"
-  tar chof $am_distdir.tar $am_distdir || exit 1
-
-  # Compress
-  ad_debug "Compressing distribution package"
-  if test x$ad_gzip = xtrue; then
-    ad_debug "Compressing distribution package $am_distdir.tar.gz"
-    gzip -9 -c $am_distdir.tar > $am_distdir.tar.gz || exit 1
-  fi
-  if test x$ad_bzip2 = xtrue; then
-    ad_debug "Compressing distribution package $am_distdir.tar.bz2"
-    bzip2 -9 -c $am_distdir.tar > $am_distdir.tar.bz2 || exit 1
-  fi
-  if test x$ad_compress = xtrue; then
-    ad_debug "Compressing distribution package $am_distdir.tar.Z"
-    compress -c $am_distdir.tar > $am_distdir.tar.Z || exit 1
-  fi
-  if test x$ad_zip = xtrue; then
-    rm -f $am_distdir.zip
-    ad_debug "Compressing distribution package $am_distdir.zip"
-    zip -rq $am_distdir.zip $am_distdir || exit 1
-  fi
-  rm -f $am_distdir.tar
-
-  # Run post-dist-hooks
-  ad_run_dist_hooks "$post_dist_hooks" "$params"
-
-  # Cleanup
-  rm -rf $am_distdir
-
-  ad_log "Distribution created successfully."
-
-  ad_debug "Ending distribution creation"
-}
-
-#
-# Handles distribution options.
-#
-# option has the following format in distfile:
-#
-#   option <option>
-#
-# Following options are supported:
-#
-#   template
-#   no-dist
-#   no-inherit
-#
-# Arguments: ad_handle_options <options>
-#
-ad_handle_options()
-{
-  ad_debug "Handling options: $1"
-
-  for i in $1
-  do
-    if test "$i" = "template"; then
-      opt_template=true
-      continue
-    elif test "$i" = "no-dist"; then
-      opt_no_dist=true
-      continue
-    elif test "$i" = "no-inherit"; then
-      opt_no_inherit=true
-      continue
-    fi
-  done
-}
-
-#
-# Clears set options
-#
-# Arguments: ad_clear_options
-#
-ad_clear_options()
-{
-  opt_template=false
-  opt_no_dist=false
-  opt_no_inherit=false
-}
-
-#
-# Parses the distribution.  Gets all distribution defines from the
-# distribution.  This also expands all inherited distributions recursively
-# to get all inherited distribution defines.  From inherited distributions
-# their name and package name is not inherited.
-#
-# Arguments: ad_parse_distribution <distribution name> <inherit>
-#
-ad_parse_distribution()
-{
-  local inhs
-  local defs
-  local undefs
-  local incs
-  local excs
-  local nops
-  local opts
-  local dname
-  local dpname
-  local bugr
-  local prh
-  local poh
-  local prdh
-  local podh
-  local prpdh
-  local popdh
-
-  ad_debug "Starting parsing distribution: $1 $2"
-
-  if test '!' -f $distdir/$1; then
-    ad_fatal "Distribution '$1' is not declared"
-  fi
-
-  # Get and enforce prereq version
-  prereq=`sed 's/^[    ]*//' < $distdir/$1 | grep -v "^#" \
-    | grep "prereq " | cut -d' ' -f2- | sort | uniq`
-  if test '!' -z $prereq; then
-    if [[ $ver < $prereq ]]; then
-      ad_fatal "Autodist $prereq or newer is required for distribution $1"
-    fi
-  fi
-
-  # Get inherited
-  inhs=`sed 's/^[      ]*//' < $distdir/$1 | grep -v "^#" \
-    | grep "inherit " | cut -d' ' -f2 | sort | uniq`
-
-  # Get distdefs
-  defs=`sed 's/^[      ]*//' < $distdir/$1 | grep -v "^#" \
-   | grep "define " | cut -d' ' -f2 | sort | uniq`
-
-  if test "$inhs" = "" && test "$defs" = ""; then
-    ad_fatal "Distribution '$1' does not define anything"
-  fi
-
-  # Get undefined distdefs
-  undefs=`sed 's/^[    ]*//' < $distdir/$1 | grep -v "^#" \
-   | grep "undef " | cut -d' ' -f2 | sort | uniq`
-
-  # Get includes
-  incs=`sed 's/^[      ]*//' < $distdir/$1 | grep -v "^#" \
-    | grep "include " | sed 's/include / : /'`
-
-  # Get excludes
-  excs=`sed 's/^[      ]*//' < $distdir/$1 | grep -v "^#" \
-    | grep "exclude " | cut -d' ' -f2- | sort | uniq`
-
-  # Get noprocesses
-  nops=`sed 's/^[      ]*//' < $distdir/$1 | grep -v "^#" \
-    | grep "noprocess " | cut -d' ' -f2- | sort | uniq`
-
-  # Get options
-  opts=`sed 's/^[      ]*//' < $distdir/$1 | grep -v "^#" \
-    | grep "option " | cut -d' ' -f2- | sort | uniq`
-
-  # Check options
-  ad_handle_options "$opts"
-  if test x$2 = xtrue && test x$opt_no_inherit = xtrue; then
-    ad_fatal "Distribution '$1' cannot be inherited"
-  fi
-  if test x$2 = xfalse && test x$opt_template = xtrue; then
-    ad_fatal "Template distribution '$1' cannot be prepared or packaged"
-  fi
-
-  ad_debug "inherits: $inhs"
-  ad_debug "distdefs: $defs"
-  ad_debug "includes: $incs"
-  ad_debug "excludes: $excs"
-  ad_debug "noprocess: $nops"
-  ad_debug "undistdefs: $undefs"
-  ad_debug "options: $opts"
-
-  # Expand distdefs from inherited distributions
-  for i in $inhs
-  do
-    if test x$1 = x$i; then
-      ad_fatal "Infinite recursion detected.  Fix the '$distdir/$1' \
-            distribution to not have 'inherit $i' declared."
-    fi
-
-    if test '!' -f $distdir/$i; then
-      ad_fatal "Distribution '$i' is not declared (inherited from '$1')"
-    fi
-
-    ad_parse_distribution $i true
-    ad_clear_options
-  done
-
-  # Get license
-  license=`sed 's/^[   ]*//' < $distdir/$1 | grep -v "^#" \
-    | grep "license " | cut -d' ' -f2`
-  licenseh=`sed 's/^[  ]*//' < $distdir/$1 | grep -v "^#" \
-    | grep "license-header " | sed 's/license-header / : /'`
-
-  ad_debug "license: $license"
-  ad_debug "licenseh: $licenseh"
-
-  if test x$2 = xfalse; then
-    # Take rest of the stuff from top distribution
-
-    # We take precedence on defined and undefined distdefs.  Remove
-    # undefined distdefs if we have defined them.
-    for d in $defs
-    do
-      ad_debug "defining undefined $d distdef"
-      undistdefs=`echo $undistdefs | sed s/$d//g`
-    done
-
-    # Get distribution name
-    dname=`sed 's/^[   ]*//' < $distdir/$1 | grep -v "^#" \
-      | grep "name " | cut -d' ' -f2-`
-
-    if test "$dname"; then
-      distribution=$dname
-    fi
-
-    # Get distribution package name (optional)
-    dpname=`sed 's/^[  ]*//' < $distdir/$1 | grep -v "^#" \
-     | grep "package " | cut -d' ' -f2`
-
-    if test "$dpname"; then
-      package=$dpname
-    else
-      package=$distribution
-    fi
-
-    # Get Bug-report email address (optional)
-    bugr=`sed 's/^[    ]*//' < $distdir/$1 | grep -v "^#" \
-     | grep "bug-report " | cut -d' ' -f2-`
-
-    if test "$bugr"; then
-      bug_report=$bugr
-    fi
-
-    ad_debug "distribution: $distribution"
-    ad_debug "package: $package"
-    ad_debug "bug-report: $bug_report"
-
-    # Get hooks (optional)
-    prh=`sed 's/^[     ]*//' < $distdir/$1 | grep -v "^#" \
-     | grep "pre-hook " | cut -d' ' -f2-`
-    poh=`sed 's/^[     ]*//' < $distdir/$1 | grep -v "^#" \
-     | grep "post-hook " | cut -d' ' -f2-`
-    prdh=`sed 's/^[    ]*//' < $distdir/$1 | grep -v "^#" \
-     | grep "pre-dist-hook " | cut -d' ' -f2-`
-    podh=`sed 's/^[    ]*//' < $distdir/$1 | grep -v "^#" \
-     | grep "post-dist-hook " | cut -d' ' -f2-`
-    prpdh=`sed 's/^[   ]*//' < $distdir/$1 | grep -v "^#" \
-     | grep "pre-process-dist-hook " | cut -d' ' -f2-`
-    popdh=`sed 's/^[   ]*//' < $distdir/$1 | grep -v "^#" \
-     | grep "post-process-dist-hook " | cut -d' ' -f2-`
-
-    pre_hooks="$pre_hooks $prh"
-    post_hooks="$post_hooks $poh"
-    pre_dist_hooks="$pre_dist_hooks $prdh"
-    post_dist_hooks="$post_dist_hooks $podh"
-    pre_p_dist_hooks="$pre_p_dist_hooks $prpdh"
-    post_p_dist_hooks="$post_p_dist_hooks $popdh"
-    doptions="$doptions $opts"
-
-    ad_handle_options "$doptions"
-    ad_debug "options: $doptions"
-  fi
-
-  # Return to caller
-  inherits="$inherits $inhs"
-  distdefs="$distdefs $defs"
-  includes="$includes $incs"
-  excludes="$excludes $excs"
-  noprocess="$noprocess $nops"
-  undistdefs="$undistdefs $undefs"
-
-  ad_debug "Ending parsing distribution: $1 $2"
-}
-
-#
-# Processes parsed distdefs.  Removes duplicates, and undefined distdefs
-# from the distdefs.
-#
-# Arguments: ad_process_distdefs
-#
-ad_process_distdefs()
-{
-  ad_debug "Starting processing distdefs"
-
-  ad_log ""
-  ad_log "Following distdefs were processed:"
-  ad_log "----------------------------------"
-
-  # Remove all undefined distribution defines
-  for i in $undistdefs
-  do
-    ad_debug "undefining $i distdef"
-    distdefs=`echo $distdefs | sed s/$i//g`
-  done
-
-  rm -f autodist.tmp.defs
-
-  # Remove duplicate distdefs
-  for i in $distdefs
-  do
-    echo $i >>autodist.tmp.defs
-  done
-  distdefs=`sort < autodist.tmp.defs | uniq`
-  distdefs=`echo $distdefs`
-  rm -f autodist.tmp.defs
-
-  # Log
-  for i in $distdefs
-  do
-    ad_log "  $i"
-  done
-  ad_log ""
-
-  ad_debug "distdefs=$distdefs"
-
-  ad_debug "Ending processing distdefs"
-}
-
-#
-# Processes for a license header change.
-#
-# Arguments: ad_process_license_header <scriptfile> <sourcefile>
-#
-ad_process_license_header()
-{
-  ad_debug "Starting license header processing"
-
-  # Add : separator at the end
-  lics=`echo "$licenseh" | sed 's/$/ : /'`
-
-  src=
-  dst=
-  for i in $lics
-  do
-    if test "$i" = ":" && test -z "$src"; then
-      continue
-    fi
-    if test -z "$src"; then
-      src=$i
-      continue
-    fi
-    if test -z "$dst" && test "$i" != ":"; then
-      dst=$i
-    else
-      ad_fatal "Missing argument in 'license-header $src'"
-    fi
-
-    ad_debug "Replacing $src license with $dst license"
-
-    if test '!' -f $src; then
-      ad_fatal "License header $src: No such file or directory"
-    fi
-
-    if test '!' -f $dst; then
-      ad_fatal "License header $dst: No such file or directory"
-    fi
-
-    # Awk script to replace the license header
-    fl=`sed q $src | sed 's/\\//\\\\\//g' > autodist.lsrc` || exit 1
-    ll=`sed -n '$p' $src | sed 's/\\//\\\\\//g' > autodist.ldst` || exit 1
-    echo "BEGIN { N=0; } /`cat autodist.lsrc`/,/`cat autodist.ldst`/ { FILE1=\"$src\"; FILE2=\"$dst\"; getline F1 < FILE1; getline F2 < FILE2; if (F1) { N=sub(F1, F2); } else { F1=\"\$\"; N=sub(F1, F2); } if (N == 0) print 0 > \"$2.norelicense\"; } END { if (N == 0) print 0 > \"$2.norelicense\"; }" >> $1
-    rm -f autodist.lsrc autodist.ldst
-
-    src=
-    dst=
-  done
-
-  ad_debug "Ending license header processing"
-}
-
-#
-# Process specified noprocesses.  This is called during makedist.
-# The noprocess first copies the noprocess files and dirs into a temp
-# directory, and then removes them from the distdir.  This way they are
-# not processed by Autodist.  After processing they are returned to their
-# correct locations from the temp dir.  Dirty, yeah, but the way we do
-# this until better one comes along.
-#
-# Arguments: ad_process_noprocess <process>
-#
-# If <process> is true this excludes and if false this includes.
-#
-ad_process_noprocess()
-{
-  ad_debug "Starting running noprocesses"
-
-  set -f
-
-  cur=`pwd`
-
-  if test x$1 = xtrue; then
-    ad_log ""
-    ad_log "Following files and directories were not processed:"
-    ad_log "---------------------------------------------------"
-
-    f="$cur/autodist__noprocess"
-    rm -rf $f
-    mkdir -p -- $f || exit 1
-
-    # First, include them to new location with correct directory structure.
-    old_am_distdir="$am_distdir"
-    cd $am_distdir || exit 1
-    am_distdir="$f"
-    nops=" $noprocess"
-    nops=`echo $nops | sed -e 's/ / : /g' -e 's/^/ : /'` || exit 1
-    ad_dist_includes "$nops" false false
-    am_distdir="$old_am_distdir"
-
-    # Then, remove from distdir (they are in temp dir now)
-    for i in $noprocess
-    do
-      ad_log "  $i"
-      rm -rf $i
-    done
-    cd $cur || exit 1
-
-    ad_log ""
-  else
-    # Copy from the temp dir back to distdir
-    cd autodist__noprocess || exit 1
-    old_am_distdir="$am_distdir"
-    am_distdir="$cur/$old_am_distdir"
-    nops=" $noprocess"
-    nops=`echo $nops | sed -e 's/ / : /g' -e 's/^/ : /'` || exit 1
-
-    ad_dist_includes "$nops" false false
-
-    am_distdir="$old_am_distdir"
-    cd $cur || exit 1
-    rm -rf autodist__noprocess
-  fi
-
-  set +f
-
-  ad_debug "Ending running noprocesses"
-}
-
-#
-# Process a file given as argument for the distribution.
-#
-# Arguments: ad_process_file <filepath> <dest_filepath> <re-license>
-#
-ad_process_file()
-{
-  local found=false
-  local f
-  local defs
-  local ndefs
-
-  # Process only regular files
-  if test '!' -f $1; then
-    return
-  fi
-
-  ad_debug "Starting processing file: $1 $2"
-
-  f="autodist.tmp.script"
-  rm -f $f
-
-  # If license header is provided, replace the license header in the file.
-  if test x$3 = xtrue; then
-    ad_process_license_header $f $1
-  fi
-
-  # Get defined distribution defines
-  defs=`awk "/^#ifdef "$DP"_DIST_|^#else "$DP"_DIST_/ { print; }" \
-    $1 |cut -d'*' -f2 |cut -d' ' -f2 | sort | uniq`
-
-  # Get explicitly not-defined distribution defines
-  ndefs=`awk "/^#ifndef "$DP"_DIST_|^#else !"$DP"_DIST_/ { print; }" \
-    $1 |cut -d'*' -f2 |cut -d' ' -f2 | cut -d'!' -f2 | sort | uniq`
-
-  ad_debug "defs in $1: $defs"
-  ad_debug "ndefs in $1: $ndefs"
-
-  # Create the script to include and exclude stuff in the file according
-  # to the distribution defines
-
-  # ifdefs
-  ad_debug "processing ifdefs"
-  for d in $defs
-  do
-    found=false
-    for i in $distdefs
-    do
-      if test x$d = x$i; then
-        found=true
-        break
-      fi
-    done
-
-    # If distribution define was not found exclude those lines from the file.
-    # This also handles the #ifdef's #else (ie. #ifndef) branch.
-    if test x$found = xfalse; then
-      ad_debug "ifdef $d will be excluded (it is NOT defined)"
-      echo "/^#ifdef $d$/,/^#else !$d$|^#endif $d$/ { next; }" >> $f
-    else
-      echo "/^#else !$d$/,/^#endif $d$/ { next; }" >> $f
-    fi
-  done
-
-  # ifndefs
-  ad_debug "processing ifndefs"
-  for d in $ndefs
-  do
-    found=false
-    for i in $distdefs
-    do
-      if test x$d = x$i; then
-        found=true
-        break
-      fi
-    done
-
-    # If distribution define was found exclude those lines from the file.
-    # This also handles the #ifndef's #else (ie. #ifdef) branch.
-    if test x$found = xtrue; then
-      ad_debug "ifndef $d will be excluded (it IS defined)"
-      echo "/^#ifndef $d$/,/^#else $d$|^#endif $d$/ { next; }" >> $f
-    else
-      echo "/^#else $d$/,/^#endif $d$/ { next; }" >> $f
-    fi
-  done
-
-  # Now process the file with the script
-  if test -f $f; then
-
-    # Those distdef lines that remain in the file are removed to make
-    # the appearance prettier
-    echo "/^#ifdef "$DP"_DIST_|^#endif "$DP"_DIST_|^#else "$DP"_DIST_|^#else !"$DP"_DIST_|^#ifndef "$DP"_DIST_/ { next; }" >> $f
-    echo "{ print; }" >> $f
-
-    # Execute the script
-    cp -p $1 $2 || exit 1
-    awk -f $f $1 > $2 || exit 1
-  fi
-
-  rm -f $f
-
-  # Log if file was not relicensed
-  if test -f "$1.norelicense"; then
-    ad_log "  $1"
-    rm -f $1.norelicense
-  fi
-
-  ad_debug "Ending processing file: $1 $2"
-}
-
-#
-# Process a source file given as argument for the distribution.
-#
-# Arguments: ad_process_source_file <filepath> <dest_filepath> <re-license>
-#
-ad_process_source_file()
-{
-  local found=false
-  local f
-  local defs
-  local ndefs
-
-  # Process only regular files
-  if test '!' -f $1; then
-    return
-  fi
-
-  ad_debug "Starting processing source file: $1 $2"
-
-  f="autodist.tmp.script"
-  rm -f $f
-
-  # If license header is provided, replace the license header in the file.
-  if test x$3 = xtrue; then
-    ad_process_license_header $f $1
-  fi
-
-  # Get defined distribution defines
-  defs=`awk '/^#ifdef SILC_DIST_|^#else \/\* SILC_DIST_/ { print; }' \
-    $1 |cut -d'*' -f2 |cut -d' ' -f2 | sort | uniq`
-
-  # Get explicitly not-defined distribution defines
-  ndefs=`awk '/^#ifndef SILC_DIST_|^#else \/\* \!SILC_DIST_/ { print; }' \
-    $1 |cut -d'*' -f2 |cut -d' ' -f2 | cut -d'!' -f2 | sort | uniq`
-
-  ad_debug "defs in $1: $defs"
-  ad_debug "ndefs in $1: $ndefs"
-
-  # Create the script to include and exclude stuff in the file according
-  # to the distribution defines
-
-  # ifdefs
-  ad_debug "processing ifdefs"
-  for d in $defs
-  do
-    found=false
-    for i in $distdefs
-    do
-      if test x$d = x$i; then
-        found=true
-        break
-      fi
-    done
-
-    # If distribution define was not found exclude those lines from the file.
-    # This also handles the #ifdef's #else (ie. #ifndef) branch.
-    if test x$found = xfalse; then
-      ad_debug "ifdef $d will be excluded (it is NOT defined)"
-      echo "/^#ifdef $d$/,/^#else \/\* \!$d |^#endif \/\* $d / { next; }" >> $f
-    else
-      echo "/^#else \/\* \!$d /,/^#endif \/\* $d / { next; }" >> $f
-    fi
-  done
-
-  # ifndefs
-  ad_debug "processing ifndefs"
-  for d in $ndefs
-  do
-    found=false
-    for i in $distdefs
-    do
-      if test x$d = x$i; then
-        found=true
-        break
-      fi
-    done
-
-    # If distribution define was found exclude those lines from the file.
-    # This also handles the #ifndef's #else (ie. #ifdef) branch.
-    if test x$found = xtrue; then
-      ad_debug "ifndef $d will be excluded (it IS defined)"
-      echo "/^#ifndef $d$/,/^#else \/\* $d |^#endif \/\* $d / { next; }" >> $f
-    else
-      echo "/^#else \/\* $d /,/^#endif \/\* $d / { next; }" >> $f
-    fi
-  done
-
-  # Now process the file with the script
-  if test -f $f; then
-
-    # Those distdef lines that remain in the file are removed to make
-    # the appearance prettier
-    echo "/^#ifdef SILC_DIST_|^#endif \/\* SILC_DIST_|^#else \/\* SILC_DIST_|^#else \/\* \!SILC_DIST_|^#ifndef SILC_DIST_/ { next; }" >> $f
-    echo "{ print; }" >> $f
-
-    # Execute the script
-    cp -p $1 $2 || exit 1
-    awk -f $f $1 > $2 || exit 1
-  fi
-
-  rm -f $f
-
-  # Log if file was not relicensed
-  if test -f "$1.norelicense"; then
-    ad_log "  $1"
-    rm -f $1.norelicense
-  fi
-
-  ad_debug "Ending processing source file: $1 $2"
-}
-
-#
-# Processes a file.  This is the -p, --process option.
-#
-# Arguments: ad_process <type> <src> <dst>
-#
-ad_process()
-{
-  ad_debug "Starting process: $1 $2 $3"
-
-  nolog=true
-
-  if test '!' -f autodist.dist; then
-    ad_fatal "Autodist has not been run yet to prepare source tree"
-  fi
-
-  # Parse distribution
-  distribution=`grep "dist:" < autodist.dist | cut -d: -f2` || exit 1
-  dist_version=`grep "ver:" < autodist.dist | cut -d: -f2` || exit 1
-  ad_parse_distribution $distribution false
-  ad_process_distdefs
-
-  # Process file
-  case "$1" in
-    makefile)
-      if test -z $3; then
-       ad_fatal "File type $1 requires <dst> argument"
-      fi
-      ad_make_makefile_am $2 $3
-      exit 0;;
-
-    configure)
-      ad_make_configure_ac $2
-      exit 0;;
-
-    non-source)
-      if test -z $3; then
-       ad_fatal "File type $1 requires <dst> argument"
-      fi
-      ad_process_file $2 $3 false
-      exit 0;;
-
-    source)
-      if test -z $3; then
-       ad_fatal "File type $1 requires <dst> argument"
-      fi
-      ad_process_source_file $2 $3 false
-      exit 0;;
-
-    *)
-      ad_fatal "Unknown file type: $1";
-      ;;
-  esac
-}
-
-#
-# Run hooks
-#
-# Arguments: ad_run_hooks <hooks> <params>
-#
-ad_run_hooks()
-{
-  ad_debug "Running hooks: $1"
-
-  ad_log ""
-  ad_log "Hooks executed:"
-  ad_log "--------------"
-
-  for i in $1
-  do
-    if test '!' -f $i; then
-      ad_fatal "Hook script $i does not exist"
-    fi
-    ad_log "  sh $i \"$distribution\" \"$dist_version\" \"$package\" \"$2\""
-    sh $i "$distribution" "$dist_version" "$package" "$2" || exit 1
-  done
-  ad_log ""
-
-  ad_debug "Ending running hooks: $1"
-}
-
-#
-# Run dist hooks
-#
-# Arguments: ad_run_dist_hooks <hooks> <params>
-#
-ad_run_dist_hooks()
-{
-  ad_debug "Starting running distributions hooks: $1"
-
-  ad_log ""
-  ad_log "Distribution hooks executed:"
-  ad_log "----------------------------"
-
-  for i in $1
-  do
-    if test '!' -f $i; then
-      ad_fatal "Dist hook script $i does not exist"
-    fi
-
-    ad_log "  sh $i \"$distribution\" \"$dist_version\" \"$package\" \"$am_distdir\" \"$2\""
-    sh $i "$distribution" "$dist_version" "$package" "$am_distdir" "$2" || exit 1
-  done
-  ad_log ""
-
-  ad_debug "Ending running distribution hooks"
-}
-
-###############################################################################
-# Autodist code
-
-usage="Usage: autodist [options] [distribution] [version] [params]"
-help="\
-Autodist prepares source tree for configuration, compilation and
-distribution.  Generates Automake.am files from Automake.ad files, 
-configure.ac file from configure.ad file(s), generates the configure 
-script by running Autoconf tool, and generates Makefile.in files by 
-running Automake tool.
-
-Operation modes:
-  -h, --help                print this help, then exit
-  -V, --version             print version number, then exit
-  -v, --verbose             verbosely report processing
-  -d, --distdir <dir>       search distributions from <dir>
-  -s, --distdefs [<dist>]   print distribution defines of <dist>, then exit
-  -i, --init                initialize Autodist environment, create default
-                            distribution directory and distribution, then exit
-  -p, --process <type> <src> [<dst>]
-                            process file <src> into <dst> for distribution,
-                            <type> is 'makefile', 'configure', 'non-source'
-                            or 'source' and defines the type of <src>
-  -m, --makedist            create and package distribution
-      --gzip                create package compressed with gzip (default)
-      --bzip2               create also package compressed with bzip2
-      --compress            create also package compressed with compress
-      --zip                 create also package compressed with zip"
-
-#
-# Process command line arguments
-#
-while test $# -gt 0; do
-  case "${1}" in
-
-  -d |--distdir)
-    shift;
-    test $# -eq 0 && { echo "${usage}" 1>&2; exit 1; }
-    distdir="${1}";
-    shift;;
-
-  --list)
-    exit 0;;
-
-  -s | --distdefs)
-    shift;
-    if test $# -eq 0; then
-      ad_parse_distribution $distribution false
-      echo "Distribution: ${distribution}" 1>&2;
-    else
-      ad_parse_distribution $1 false
-      echo "Distribution: ${1}" 1>&2;
-    fi
-    ad_process_distdefs
-    echo "Distdefs:" 1>&2;
-    for i in $distdefs
-    do
-      echo "$i";
-    done
-    exit 0;;
-
-  -i | --init)
-    ad_initialize;
-    exit 0;;
-
-  -p | --process)
-    shift;
-    if test $# -ge 2; then
-      ad_process $1 $2 $3
-    else
-      echo "${usage}" 1>&2;
-    fi
-    exit 0;;
-
-  -m | --makedist)
-    ad_makedist
-    exit 0;;
-
-  --gzip)
-    ad_gzip=true
-    shift;;
-
-  --bzip2)
-    ad_bzip2=true
-    shift;;
-
-  --compress)
-    ad_compress=true
-    shift;;
-
-  --zip)
-    ad_zip=true
-    shift;;
-
-  -v | --verbose)
-    debug=true
-    shift;;
-
-  -h | --help | --h*)
-    echo "${usage}" 1>&2;
-    echo 1>&2;
-    echo "${help}" 1>&2;
-    echo 1>&2;
-    exit 0;;
-
-  -V | --version)
-    echo "@PACKAGE@ (@PACKAGE_NAME@) $ver" 1>&2;
-    echo "Written by Pekka Riikonen" 1>&2;
-    echo 1>&2;
-    echo "Copyright (C) 2004 - 2007 SILC Project" 1>&2;
-    echo "\
-This is free software; see the source for copying conditions.  There is NO
-warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. " 1>&2;
-    exit 0;;
-
-  --)
-    shift;
-    break;;
-
-  -*)
-    echo "${usage}" 1>&2;
-    exit 1;;
-
-  *)
-    break;;
-
-  esac
-done
-
-# Open log file
-ad_log_open "autodist.log"
-
-ad_log "Processing source tree for compilation and configuration"
-ad_log "--------------------------------------------------------"
-ad_log ""
-
-#
-# Parse the requested distribution
-#
-if test $# != 0; then
-  distribution="${1}";
-  distfile=$distribution
-  shift
-fi
-
-ad_parse_distribution $distribution false
-
-if test $# != 0; then
-  dist_version="${1}";
-fi
-
-ad_log "  Distribution: $distribution $dist_version"
-ad_log ""
-
-ad_process_distdefs
-
-ad_debug "Preparing source tree for configuration and compilation..."
-ad_debug "Preparing $distribution distribution version $dist_version"
-
-#
-# Create the distribution defines header file
-#
-if test "$DISTDEFS"; then
-  ad_create_distdefs_h
-else
-  ad_fatal "DISTDEFS not defined in $distdir/autodist.conf"
-fi
-
-# Get extra parameters from command line
-shift
-
-#
-# Run pre-hooks
-#
-ad_run_hooks "$pre_hooks" "$@"
-
-#
-# Generate the Makefile.am files from Makefile.ad files
-#
-ad_make_makefile_ams
-
-#
-# Generate the configure.ac from configure.ad file(s)
-#
-ad_make_configure_ac ./configure.ad
-
-#
-# Process all files with .ad suffix for distribution processing
-#
-ad_process_ads
-
-#
-# Generate configure script
-#
-ad_make_configure
-
-#
-# Generate Makefile.in files
-#
-ad_make_makefile_ins
-
-#
-# Create autodist.dist
-#
-ad_debug "Creating autodist.dist"
-echo "dist:$distfile" > autodist.dist
-echo "ver:$dist_version" >> autodist.dist
-echo "distdir:$package-$dist_version" >> autodist.dist
-echo "params:$@" >> autodist.dist
-
-#
-# Run post-hooks
-#
-ad_run_hooks "$post_hooks" "$@"
-
-ad_log "Source tree processed successfully."
-ad_debug "Done, now run ./configure and make."
-
-exit 0
diff --git a/apps/autodist/autodist.spec.in b/apps/autodist/autodist.spec.in
deleted file mode 100644 (file)
index 257af83..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-Summary: Source distribution management system
-Name: autodist
-Version: AUTODIST_VERSION
-Release: AUTODIST_RELEASE
-License: BSD
-Group: Development/Tools
-URL: http://silcnet.org/software/developers/autodist/
-Source0: http://silcnet.org/download/autodist/sources/autodist-%{version}.tar.bz2
-BuildArch: noarch
-BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
-Requires: autoconf >= 2.58
-Requires: automake >= 1.9
-
-%description
-The Autodist is a source distribution management system that allows
-powerful mechanisms to define what is included in and excluded from a
-distribution, and what license the distribution is released under.  It
-is also used to create the actual distribution source packages.
-Autodist allows distribution management in file, directory and file
-content level.  Different distributions may include different portions
-of files, for example, excluding certain features from certain
-distributions.  It is always guaranteed that anything not defined for
-the distribution, is removed automatically (files, file content,
-directories), thus ensuring that nothing is accidentally included in
-the distribution.
-
-%prep
-%setup -q
-
-%build
-./configure --prefix=%{_prefix} --mandir=%{_mandir} --infodir=%{_infodir} \
-  --bindir=%{_bindir} --datadir=%{_datadir}
-make
-
-%install
-rm -rf $RPM_BUILD_ROOT
-make install DESTDIR=$RPM_BUILD_ROOT
-rm -f $RPM_BUILD_ROOT/%{_datadir}/autodist/COPYING
-
-%clean
-rm -rf $RPM_BUILD_ROOT
-
-%files
-%defattr(-, root, root, -)
-%{_bindir}/*
-%{_datadir}/autodist/*.conf
-%{_datadir}/autodist/default
-%{_infodir}/autodist.info*
-%{_mandir}/man1/*
-%doc COPYING README TODO CHANGES AUTHORS
-
-%changelog
-* Thu May 31 2007 Pekka Riikonen <priikone@silcnet.org>
-- Initial version
diff --git a/apps/autodist/configure.ad b/apps/autodist/configure.ad
deleted file mode 100644 (file)
index 3f2d1f7..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-#ifdef SILC_DIST_AUTODIST
-#
-#  apps/autodist/configure.ad
-#
-#  Author: Pekka Riikonen <priikone@silcnet.org>
-#
-#  Copyright (C) 2005 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.
-#
-
-# The APIVERSION is appended to the filename, to give versioned name.
-# The base version (X.Y) is taken.
-APIVERSION=`echo "$VERSION" | sed -e 's/^\([[0-9]]*\.[[0-9]]*[[a-z]]*\).*$/\1/'`
-AC_SUBST(APIVERSION)
-
-old_exec_prefix=$exec_prefix
-old_prefix=$prefix
-exec_prefix=$silc_prefix
-prefix=$silc_prefix
-
-# Path to the autodist in installed environment
-s_bindir=`eval echo $bindir`;s_bindir=`eval echo $s_bindir`
-AUTODIST=$s_bindir/autodist
-AC_SUBST(AUTODIST)
-
-# Path to the Autodist data
-s_datadir=`eval echo $datadir`;s_bindir=`eval echo $s_datadir`
-AUTODISTDIR=$s_datadir/autodist
-AC_SUBST(AUTODISTDIR)
-
-exec_prefix=$old_exec_prefix
-prefix=$old_prefix
-
-#
-# Makefile outputs
-#
-AC_CONFIG_FILES(
-apps/autodist/Makefile
-apps/autodist/autodist
-apps/autodist/makedist
-apps/autodist/doc/Makefile
-apps/autodist/doc/autodist.1
-apps/autodist/tests/Makefile
-)
-#endif SILC_DIST_AUTODIST
diff --git a/apps/autodist/default b/apps/autodist/default
deleted file mode 100644 (file)
index 84cea7c..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-# Default distribution
-#
-# NOTE: By default, this distribution cannot be packaged.  Take away the
-# 'no-dist option if you whish to use this as a normal distribution.
-#
-# If you add new distributions into distdir/ you may want to inherit them 
-# here.
-#
-option no-dist
-define _DIST_DEFAULT
diff --git a/apps/autodist/doc/Makefile.am b/apps/autodist/doc/Makefile.am
deleted file mode 100644 (file)
index 003c074..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-#
-#  Makefile.am
-#
-#  Author: Pekka Riikonen <priikone@silcnet.org>
-#
-#  Copyright (C) 2005 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.
-#
-
-info_TEXINFOS = autodist.texi
-autodist_TEXINFOS = fdl.texi
-
-man_MANS = autodist.1
-EXTRA_DIST = $(man_MANS)
diff --git a/apps/autodist/doc/autodist.1.in b/apps/autodist/doc/autodist.1.in
deleted file mode 100644 (file)
index 5d877ba..0000000
+++ /dev/null
@@ -1,103 +0,0 @@
-.TH AUTODIST "1" "April 2005" "@PACKAGE_NAME@ @VERSION@" "User Commands"
-.SH NAME
-Autodist \- Source distribution management system
-.SH SYNOPSIS
-.B autodist
-[options] [distribution] [version] [params]
-.PP
-.SH DESCRIPTION
-.PP
-The Autodist is a source distribution management system that allows 
-powerful mechanisms to define what is included in and excluded from a 
-distribution, and what license the distribution is released under.  It is 
-also used to create the actual distribution source packages.  Autodist 
-allows distribution management in file, directory and file content level.  
-Different distributions may include different portions of files, for 
-example, excluding certain features from certain distributions.  It is 
-always guaranteed that anything not defined for the distribution, is 
-removed automatically (files, file content, directories), thus ensuring 
-that nothing is accidentally included in the distribution.
-.PP
-Autodist is closely related to the Autoconf and Automake tools, and 
-complements the features Autoconf and Automake provides.  It is especially 
-targeted into circumstances where multiple distributions are created from 
-one source tree.  The Autoconf and Automake environment is mainly designed 
-for one application per one source tree situations.  Autodist provides 
-mechanisms to create all kinds of distributions that can be created from 
-one source tree.  To be able to use Autodist, the Autoconf and Automake 
-must be installed into the system.
-.PP
-.SH OPTIONS
-.B Operation modes:
-.PP
-.TP
-\fB\-h\fR, \fB\-\-help\fR
-Prints the help for the Autodist and exits.
-.PP
-.TP
-\fB\-V\fR, \fB\-\-version\fR
-Prints version number and exits.
-.PP
-.TP
-\fB\-v\fR, \fB\-\-verbose\fR
-Verbosely report processing.
-.PP
-.TP
-\fB\-d\fR, \fB\-\-distdir\fR
-Search distributions from <dir> instead of default 'distdir'.
-.PP
-.TP
-\fB\-s\fR, \fB\-\-distdefs\fR \fB[<dist>]\fR
-Prints distribution defines of <dist> and exits.
-.PP
-.TP
-\fB\-i\fR, \fB\-\-init\fR
-Initializes Autodist environment.  Creates the default distribution
-directory 'distdir', 'autodist.conf' configuration file and the
-default distribution 'default', then exits.
-.PP
-.TP
-\fB\-p\fR, \fB\-\-process\fR \fB<type>\fR \fB<src>\fR \fB<dst>\fR
-Process file <src> into <dst> for distribution, <type> is 'makefile', 
-'configure', 'non-source' or 'source' and defines the type of <src>.
-.PP
-.TP
-\fB\-m\fR, \fB\-\-makedist\fR
-Creates and packages distribution
-.PP
-.TP
-\fB\-\-gzip\fR
-Create package compressed with gzip (default)
-.PP
-.TP
-\fB\-\-bzip2\fR
-Create also package compressed with bzip2
-.PP
-.TP
-\fB\-\-compress\fR
-Create also package compressed with compress
-.PP
-.TP
-\fB\-\-zip\fR
-Create also package compressed with zip
-.SH COPYRIGHT
-Copyright \(co 2005 Pekka Riikonen, SILC Project
-.br
-This is free software; see the source for copying conditions.  There is NO
-warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR 
-PURPOSE.
-.SH "SEE ALSO"
-.BR autoconf (1),
-.BR automake (1),
-.PP
-The full documentation for
-.B autodist
-is maintained as a Texinfo manual.  If the
-.B info
-and
-.B autodist
-programs are properly installed at your site, the command
-.IP
-.B info autodist
-.PP
-should give you access to the complete manual.
diff --git a/apps/autodist/doc/autodist.texi b/apps/autodist/doc/autodist.texi
deleted file mode 100644 (file)
index aadb62f..0000000
+++ /dev/null
@@ -1,1812 +0,0 @@
-\input texinfo   @c -*-texinfo-*-
-@c %**start of header
-@setfilename autodist.info
-@settitle autodist
-@setchapternewpage off
-@c %**end of header
-
-@include version.texi
-
-@copying
-
-This manual is for SILC Autodist (version @value{VERSION},
-@value{UPDATED}), a program which is used to manage and create source
-distributions.
-
-Copyright @copyright{} 2004 - 2005 Pekka Riikonen, SILC Project
-
-@quotation
-Permission is granted to copy, distribute and/or modify this document
-under the terms of the @acronym{GNU} Free Documentation License,
-Version 1.2 or any later version published by the Free Software
-Foundation; with no Invariant Sections, with the Front-Cover texts
-being ``A @acronym{GNU} Manual,'' and with the Back-Cover Texts as in
-(a) below.  A copy of the license is included in the section entitled
-``@acronym{GNU} Free Documentation License.''
-
-(a) The FSF's Back-Cover Text is: ``You have freedom to copy and
-modify this @acronym{GNU} Manual, like @acronym{GNU} software.  Copies
-published by the Free Software Foundation raise funds for
-@acronym{GNU} development.''
-@end quotation
-@end copying
-
-@dircategory Software development
-@direntry
-* autodist: (autodist).         Managing and creating source distributions.
-@end direntry
-
-@dircategory Individual utilities
-@direntry
-* makedist: (autodist)Invoking makedist.          Creating distribution
-@end direntry
-
-@titlepage
-@title SILC Autodist
-@subtitle For version @value{VERSION}, @value{UPDATED}
-@author Pekka Riikonen
-@page
-@vskip 0pt plus 1filll
-@insertcopying
-@end titlepage
-
-@ifnottex
-@node Top
-@comment  node-name,  next,  previous,  up
-@top SILC Autodist
-
-@insertcopying
-
-@menu
-* Introduction::                Purpose of Autodist
-* Integrating Autodist::        Integrating Autodist into your project
-* Invoking Autodist::           Running Autodist
-* Examples::                    Examples using Autodist
-
-@detailmenu
- --- The Detailed Node Listing ---
-
-Introduction
-
-* Motivation::                  Reasons for using Autodist
-
-Integrating Autodist
-
-* Creating distdir::            Creating distributions directory
-* autodist.conf::               Configuring Autodist
-* Creating new distribution::   Adding new distribution
-* Distribution file format::    Detailed document for distfile format
-* configure.ad files::          configure script for creating configure.ac
-* Makefile.ad files::           Makefile.ad for creating Makefile.am
-* Other .ad files::             Other files with .ad suffix
-* Distdefines::                 Using distdefs in files
-* Dependencies::                Autodist dependency support
-
-Invoking Autodist
-
-* Preparing source tree::       Preparing source tree with Autodist
-* Creating distribution::       Creating distribution with Autodist
-
-Examples
-
-* Single distribution tree::    Single distribution example
-* Multiple distribution tree::  Multiple distributions example
-
-@end detailmenu
-@end menu
-
-@end ifnottex
-
-
-@node Introduction
-@chapter Introduction
-
-The Autodist is a source distribution management system that allows
-powerful mechanisms to define what is included in and excluded from a
-distribution, and what license the distribution is released under.  It is
-also used to create the actual distribution source packages.  Autodist
-allows distribution management in file, directory and file content level.
-Different distributions may include different portions of files, for
-example, excluding certain features from certain distributions.  It is
-always guaranteed that anything not defined for the distribution, is
-removed automatically (files, file content, directories), thus ensuring
-that nothing is accidentally included in the distribution.
-
-The Autodist creates 'Makefile.am' files from 'Makefile.ad' files and
-'configure.ac' file from one or more 'configure.ad' files.  Any other file
-ending with '.ad' suffix will also be processed.  The processed file will
-have the '.ad' suffix removed (@pxref{Preparing source tree, , , , }).
-Autodist also creates and packages the distribution using common GNU
-distribution creation process, specificly `make dist'.  Autodist, however,
-controls this process and during packaging phase the Autodist processes
-all files in the distribution (other than '*.ad' files, which has already
-been processed earlier by Autodist).  The resulted package is a processed
-source distribution package, processed according to the rules specified
-in the distribution file(s) (@pxref{Creating distribution, , , , }).
-
-Any file in the source tree may use distdefs (distribution defines (@pxref{Distdefines, , , , })) which are defined in the distributions.  When distribution
-is packaged only the files, directories and file content that is either
-outside of any distdef, or inside the defined distdefs will be included
-in the distribution.  Any other file, directory or content in the file
-will be removed.  It is guaranteed, if a file, a directory or a piece of
-file content is not inside a defined distdef it will not be delivered to
-the distribution.
-
-Any file, 'Makefile.am', 'configure.ac', or source file processed with
-Autodist is always compliant with the tools needed to process them.  All
-files can also be processed with the corresponding tools even before
-processing them with Autodist.  This makes it possible, for example, to
-compile sources before they have been processed, and undefined lines
-are removed.  The distdefs are respected in source files by the
-preprocessor.
-
-Autodist is not a binary packaging system.  It is specificly used to
-create source distributions.  A binary packaging system, however can be
-hooked to the distribution creation process, if needed.
-
-@menu
-* Motivation::                  Reasons for using Autodist
-@end menu
-
-
-@node Motivation
-@section Reasons for using Autodist
-
-Autodist is closely related to the Autoconf and Automake tools, and
-complements the features Autoconf and Automake provides.  It is especially
-targeted into circumstances where multiple distributions are created from
-one source tree.  The Autoconf and Automake environment is mainly designed
-for one distribution (one application) per one source tree situations.
-Autodist provides mechanisms to create all kinds of distributions that can
-be created from one source tree.  To be able to use Autodist, the Autoconf
-and Automake must be installed into the system (@pxref{Integrating Autodist, , , , }).
-Autoconf version must be at least 2.52g.
-
-Small software projects usually do very well with Autoconf and Automake
-and their distribution management features.  Often these projects do not
-need Autodist, though they can benefit from it.  However, if your software
-project is large, you need to create multiple distributions from one source
-tree, you have complex licensing terms for different distributions, you
-have different target users or customers that may require different
-feature set or licenses in different distributions, you have need to
-continue concurrent development in the main source tree and still be able
-to create stable distributions, and/or you have need to control file
-content in different distributions (to avoid distributing code or features
-that aren't supposed to be distributed, or to avoid leaking information
-to your competitors on what new features you are working on), then Autodist
-is a tool you may find usefull.
-
-The motivation behind Autodist stems from need to be able to create
-multiple distributions from one large source tree in a precise and
-controllable manner, and guarantee that anything that is not part of the
-distribution is removed from the distribution.  The Autoconf and Automake
-provides mere basic control what is included in and excluded from
-distributions and how the distributions are created.  They also do not
-provide mechanism to define different licensing conditions for different
-distributions, or changing the license automatically for different user
-or customer purposes.  Many large software projects, companies and
-corporations have commonly been using Autoconf and Automake tools, but
-have had the need to create their own ad-hoc mechanisms to control
-distribution creation.  The Autodist attempts to provide a tool that any
-size software project can effectively use to manage their distributions.
-
-Without a tool like Autodist, large software projects usually has to be
-split into separate source trees, which may not always be possible because
-they may share large portions of common code (which may further make
-concurrent development of the applications hard), or multiple Autoconf and
-Automake environments (multiple configure scripts) needs to be created
-in one source tree.  In this case the source tree usually gets very
-complicated and controlling what is compiled and what is included in
-distributions becomes harder, especially when different parts code is shared
-between applications and libraries.
-
-
-@node Integrating Autodist
-@chapter Integrating Autodist
-
-Integrating Autodist into existing software project can be a very simple
-task or a fairly complicated task.  It depends on the size and complexity
-of the software project.  Generally speaking, integrating Autodist into
-software project is fairly straightforward process:
-
-1. The distributions directory and 'default' distribution are created
-
-2. The 'configure.ad' is created
-
-3. If needed, 'Makefile.ad' file(s) are created
-
-After this the Autodist can already be used to prepare the source tree
-for configuration and compilation (@pxref{Preparing source tree, , , , }).
-Adding a new distribution would then allow the actual distribution
-packaging also.
-
-If the software project has had own ad-hoc distribution system already in
-place, it may take some work to move from that system into the Autodist.
-If there are multiple applications and distributions created from the
-source tree, the distributions and distribution defines for them need to
-be created.  While this may be unthankful job, it only needs to be done
-once.
-
-Integrating Autodist into a new software project is a very simple task as
-renaming 'configure.ac' and possibly 'Makefile.am' files are not required,
-as they may not exist yet.
-
-
-@menu
-* Creating distdir::            Creating distributions directory
-* autodist.conf::               Configuring Autodist
-* Creating new distribution::   Adding new distribution
-* Distribution file format::    Detailed document for distfile format
-* configure.ad files::          configure script for creating configure.ac
-* Makefile.ad files::           Makefile.ad for creating Makefile.am
-* Other .ad files::             Other files with .ad suffix
-* Distdefines::                 Using distdefs in files
-* Dependencies::                Autodist dependency support
-@end menu
-
-
-@node Creating distdir
-@section Creating distributions directory
-
-The distributions directory is 'distdir', which is expected to be
-located in the root of the source tree.  This directory will hold all
-the distribution files, and the Autodist configuration file 'autodist.conf' (@pxref{autodist.conf, , , , }).
-If this directory does not exist it can be created with the Autodist.
-
-@example
-  autodist -i
-@end example
-
-This will create the 'distdir' and copy the default 'autodist.conf'
-configuration file and the 'default' distribution into the directory.
-The 'default' distribution will be used by default by the Autodist
-unless other distribution is specified.
-
-After this the Autodist has effectively been integrated into the
-software project.  However, usually after this, one would create new
-distributions, the 'configure.ad' and possibly 'Makefile.ad' file(s).
-Without 'configure.ad' file a distribution package cannot be created.
-However, even without 'configure.ad' file the source tree can be
-prepared for configuration and compilation (@pxref{Preparing source tree, , , , }).
-
-@menu
-* autodist.conf::               Configuring Autodist
-@end menu
-
-
-@node autodist.conf
-@section Configuring Autodist
-
-After the Autodist has been integrated into the software by creating
-the 'distdir', the 'autodist.conf' configuration file was added to the
-'distdir' also.  Usually software projects will want to modify some of
-the 'autodist.conf' options, mainly specifying the distdef prefix.
-
-The 'autodist.conf' is a text file.  The following options are available
-in 'autodist.conf':
-
-
-@example
-DISTPREFIX=""
-@end example
-
-By default the distdef prefix is '_DIST_'.  To add own software package
-specific prefix the 'DISTPREFIX' can be defined.
-
-Example:
-@example
-DISTPREFIX="SILC"
-@end example
-
-Will set the distdef prefix as 'SILC_DIST_'.
-
-
-@example
-DISTDEFS="distdefs.h"
-@end example
-
-The 'DISTDEFS' option specifies the file name of the distdef header file
-which Autodist will create.  The software project should '#include' the
-header file in order for the preprocessor to respect the distdef
-conditionals (@pxref{Distdefines, , , , }).  By default the file name
-is 'distdefs.h' and is created at the root of source tree.  Other location
-may be specified if needed.
-
-Example:
-@example
-DISTDEFS="include/distdefs.h"
-@end example
-
-
-@example
-ACLOCAL="aclocal"
-@end example
-
-The 'ACLOCAL' specifies the location of the 'aclocal' tool.  If Autodist
-should not run 'aclocal' this option may be removed or set to empty value.
-User need to then run it manually.
-
-
-@example
-AUTOHEADER="autoheader"
-@end example
-
-The 'AUTOHEADER' specifies the location of the 'autoheader' tool.  If
-Autodist should not run 'autoheader' this option may be removed or set
-to empty value.  User need to then run it manually.
-
-@example
-AUTOCONF="autoconf"
-@end example
-
-The 'AUTOCONF' specifies the location of the 'autoconf' tool.  If
-Autodist should not run 'autoconf' this option may be removed or set
-to empty value.  User need to then run it manually.
-
-
-@example
-AUTOMAKE="automake -a -c"
-@end example
-
-The 'AUTOMAKE' specifies the location of the 'automake' tool.  If
-Autodist should not run 'automake' this option may be removed or set
-to empty value.  User need to then run it manually.  By default, the
-'-a'  and '-c' options are given to 'automake' to add any missing required
-files.
-
-
-@example
-LIBTOOLIZE="libtoolize --automake -c"
-@end example
-
-The 'LIBTOOLIZE' specifies the location of the 'libtoolize' tool.
-This option should be removed or ste to empty value if 'libtool' is not
-used in the source tree.
-
-
-@example
-MAKE=make
-@end example
-
-The 'MAKE' specifies the location of the 'make' program.  This option must
-be set to valid value in order to create distributions.
-
-
-@menu
-* Creating new distribution::   Adding new distribution
-@end menu
-
-
-@node Creating new distribution
-@section Creating new distribution
-
-After the Autodist has been integrated into the software project by
-creating the 'distdir' and 'default' distribution, the source tree
-can be prepared for configuration and compilation (@pxref{Preparing source tree, , , , }).  However, the 'default' distribution should be used only as
-a development distribution.  Usually it is used to prepare the raw source
-tree (such as a tree just checkout
-from CVS) for configuration and compilation.  By default, the 'default'
-distribution cannot be packaged.  However, if the software project is
-small (one distribution), it may be convenient to edit the 'default'
-distribution to be as the distribution that is packaged from the source
-tree.  In software project where multiple distributions are created using
-the 'default' only as a development distribution is recommended.  The
-real distributions should be defined as separate distributions.
-
-Creating a new distribution is a simple process.  Each distribution
-is placed in the 'distdir' and the file name of the distribution file is
-used to reference to it.  By default, the distribution name is the
-file name of the distribution file.  The actual distribution file is
-a simple text file with various directives that define the distribution.
-
-If the 'default' distribution is used as a development distribution it
-might be desired to inherit some or all of the created distributions in
-it, so that development becomes possible with the 'default' distribution.
-Adding 'inherit' directive into the 'distdir/default' will inherit the
-specified distribution.
-
-
-@menu
-* Distribution file format::    Detailed document for distfile format
-@end menu
-
-
-@node Distribution file format
-@section Distribution file format in detail
-
-The distribution file, or distfile from now on, defines your distribution,
-distribution defines, options, included and excluded files and
-directories, license, and additional processing.  Each distribution is
-defined in a separate file and the distributions are referenced by
-their file name.
-
-The distfile is a text file that contains various directives that define
-the actual distribution.  Lines starting with '#' are considered comments
-and are ignored.
-
-
-@section Directive: name <name>
-
-The 'name' directive defines the name of the distribution.  It is optional
-directive, and if omitted the distribution name will be the name of the
-distfile.  The 'PACKAGE_NAME' define delivered by Autoconf will contain
-this name string.
-
-Example:
-@example
-name FOO Application
-@end example
-
-Will set your distribution name as 'Foo Application'.
-
-
-@section Directive: package <package>
-
-The 'package' directive defines the name of the distribution package.  It is
-optional directive, and if omitted the distribution package name will
-be the name of the distribution, if defined, or if omitted, then the name
-of the distfile.  If this directive is omitted then normal GNU convention
-is used to decide the package name, derived from the distribution name.
-The 'PACKAGE_TARNAME' define delivered by Autoconf will contain this
-package name string.
-
-Example:
-@example
-package foo-client
-@end example
-
-Will create distribution packages named, for example, as
-'foo-client-1.0.tar.gz'.
-
-
-@section Directive: bug-report <email address>
-
-The 'bug-report' directive can be used to define the email address where
-the bug-reports for the distribution should be sent.  The directive is
-optional.  The 'PACKAGE_BUGREPORT' define delivered by Autoconf will
-contain this bug report string.
-
-
-@section Directive: license <filename>
-
-The 'license' directive can be used to define the license file for the
-distribution.  This directive is optional.  The license file will be
-copied into the distribution in the name 'COPYING'.  If the 'COPYING'
-file already exist it will be replaced.
-
-Example:
-@example
-license license/GPL
-@end example
-
-Will include the file 'license/GPL' into the distribution in the file
-name 'COPYING'.
-
-
-@section Directive: license-header <current-license> <new-license>
-
-The 'license-header' can be used to re-license your files into a new
-license.  This directive is optional.  There may be zero or more
-'license-header' directives in distribution.  The 'license-header'
-directive will compare the license header that usually appear at the
-start of a file to the <current-license>.  If it matches it will
-be replaced with the <new-license>.  The license header in the file
-will be replaced and the file will have effectively been re-licensed.
-
-Example:
-@example
-license-header license/BSD-header license/GPL-header
-@end example
-
-Will replace all appearances of the license header in 'license/BSD-header'
-file to the license header in 'license/GPL-header' in any file in the
-distribution.  Note that, the header change will be performed when
-the distribution is packaged (@pxref{Creating distribution, , , , }).
-The 'makedist.log' file created by Autodist during distribution packaging
-will list all files that were not re-licensed.  The log file can be used
-to check that the distribution is re-licensed correctly, and fix any
-possible mistakes.
-
-With 'license-header' directive you may initially set your files in the
-source tree into what ever license you prefer.  However, if you need to
-re-license parts of the source tree in certain distributions the
-'license-header' will achieve this automatically.  For example, suppose
-one wants to create two different versions of a library distribution, with
-different feature sets, in two different licenses.
-
-There are several limitations in the current implementation of Autodist
-with the 'license-header' directive:
-
-First limitation is that the header files must have equal amount of lines.
-If the new header file has fewer lines that the current header file, all
-of the lines from the current header will not be replaced.  If the new header
-has fewer lines, empty lines must be added to it.  If the new header file
-has more lines than the current header file, the extra lines will not appear
-in the replaced header.  Basic rule is to always make sure the header 
-files have equal amount of lines in them.
-
-Second limitation is in indentation of the header files.  It is suggested,
-though not mandatory, that the header files have the same indentation as
-is commonly used in the source tree; if the license header text in a file
-starts at the second character instead of at the start of the line, then
-the header file should start the license text at the second character also.
-If same indentation is not used the appearance of the replaced header
-may not be perfect.  While this is a cosmetic issue, one still to remember.
-
-Third limitation is that the distribution cannot be partially re-licensed.  
-If the 'license-header' directive is used then all files that have the 
-specified header will be replaced with the new header.  There are 
-currently two ways to not re-license a file;  use different license header 
-in the file than one specified in 'license-header', or specify the file or 
-directory in 'noprocess' directive.  Using 'noprocess' is not possible if 
-the file needs to be otherwise processed for the distribution.  Future 
-versions of Autodist may provide a mechanism to re-license only part of 
-the distribution.
-
-Example current header:
-@example
---- Start example
-  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.
---- end example
-@end example
-
-Example new header:
-@example
---- Start example
-  All rights reserved.
-
-  Redistribution and use in source and binary forms, with or without
-  modification, are permitted provided that the conditions listed in the
-  COPYING file are met.
-
-
-
---- end example
-@end example
-
-In this example, if the text in the current header file is found in any
-file in the distribution it will be replaced with the new header file.
-Notice that, both header files has same amount of lines (8 lines).
-
-Note that, the current header must match exactly the header used in
-files.  Otherwise the replacement will not be complete.
-
-
-@section Directive: prereq <version>
-
-The 'prereq' may be used to enforce the Autodist version.  If the Autodist 
-version used to process the distribution is older than the version 
-specified with 'prereq' the Autodist will fail.
-
-Example:
-@example
-prereq 1.3.2
-@end example
-
-Will require Autodist 1.3.2 or newer for this distribution.
-
-
-@section Directive: inherit <distfile>
-
-The Autodist provides inheritance of distributions.  The 'inherit'
-directive is used to define the distribution which will be inherited
-into the distribution.  The <distfile> specifies the name of the
-inherited distribution.  If the distribution cannot be inherited Autodist
-will give an error.
-
-The 'inherit' will inherit the following information from the 
-distribution: distdefs, undefines, includes, excludes and noprocesses.  
-Other information will not be inherited.  If the inherited distribution 
-inherits other distributions, they will also be inherited automatically.  
-User should be careful when inheriting distributions as it may be possible 
-to create an infinite recursion.  The Autodist would allow for this and 
-not detect this error.  Zero or more 'inherit' directives may be set for 
-distribution.
-
-Example:
-@example
-inherit common
-inherit client
-inherit toolkit
-@end example
-
-Will inherit distributions 'common', 'client' and 'toolkit' into this
-distribution.  All distdefs, undefines, includes, excludes and noprocesses
-from these distributions are now also part this distribution.
-
-The distribution that is being prepared or packaged take precedence when 
-defining distdefs that were specificly undefined in the inherited 
-distribution.  This means that if the inherited distribution specificly 
-undefines a distdefs but the inheriting distribution (one being prepared 
-or packaged) specificly defines it, the distdef will be defined.  
-Similarly, if the inherited distribution defines a distdef but the 
-inheriting distribution undefines it, the distdef will be undefined.  
-Note that, this precedence works only in the top distribution (the one 
-being prepared or packaged).  If the inherited distribution inherits other 
-distributions, all distdefs (defined and specificly undefined) will be 
-inherited as is.  This means that if one inherited distribution defines a 
-distdef that other inherited distribution distdef undefines, it will be 
-undefined.  However, the top distribution can then override them if 
-needed.
-
-
-@section Directive: define <symbol>
-
-The 'define' directive is used to define the distdef symbols for the
-distribution.  This directive is optional, however, all distributions
-should define at least one distdef so that the distribution may be
-controlled with the distdef conditionals in files in the source tree (@pxref{Distdefines, , , , }).  By default, the distdef prefix is '_DIST_'.  Many
-software projects will want to set their own prefix for the distdefs
-for consistency.  The prefix may be defined in the 'autodist.conf' file
-(@pxref{autodist.conf, , , , }).
-
-Example:
-@example
-define _DIST_FOO
-define _DIST_FEATURE_X
-define _DIST_LIBRARY_Y
-@end example
-
-Will define the following distdefs for the distribution: '_DIST_FOO',
-'_DIST_FEATURE_X' and '_DIST_LIBRARY_Y'.  These distdefs may then be
-used in the source tree and source code to control what is included in
-or excluded from this distribution.
-
-
-@section Directive: undef <symbol>
-
-The 'undef' directive may be used to explicitly undefine a distdef.
-When inheriting distributions it may be desired to be able undefine
-certain distdefs.  This directive is optional.
-
-Example:
-@example
-undef _DIST_FEATURE_Y
-@end example
-
-Will undefine '_DIST_FEATURE_Y' distdef.  This distdef will not be part
-of this distribution anymore, even if it is defined in some inherited
-distribution.
-
-
-@section Directive: option <option> [...]
-
-The 'option' directive is used to define various options for the
-distribution.  The options can change the behavior of the distribution.
-This directive is optional.  One or more options may be defined in one
-'option' directive.  Zero or more 'option' directives may be set for
-distribution.  The following options are available.
-
-@example
-template
-@end example
-
-When set, the distribution is a template distribution.  Templates are 
-special distributions which cannot be prepared or packaged with Autodist. 
-Templates can only be inherited.  Usually, templates are used to define a 
-common template distribution for other distributions.  Templates may set 
-distdefs, undefines, includes, excludes and noprocesses.  A large software 
-project could have several distributions that share a common base.  In 
-this case defining the common base as a template distribution and then 
-inheriting that distribution makes it easier to manage the distfiles.
-
-@example
-no-dist
-@end example
-
-Distributions with the 'no-dist' option are similar to templates, except
-that they can be prepared with Autodist, but they cannot be packaged.
-These are usually used as a common development distribution, such as the
-'default' distribution created with 'autodist -i'.
-
-@example
-no-inherit
-@end example
-
-If this option is set to normal distributions or distributions with
-'no-dist' option, the distribution cannot be inherited.  For template
-this option has no effect.  If distribution with this option is inherited
-the Autodist will give an error.
-
-
-@section Directive: include <source> [<destination>]
-
-The 'include' directive can be used to include files or directories into
-the distribution.  Sometimes it may be desired to specify included
-files and directories in distribution instead of Makefile.am and
-EXTRA_DIST, especially if there are many distributions that need to
-include specific files and directories.  While it would be possible
-to define them in Makefile.ad and use distdef conditionals to define
-which will be included in which distribution, if there are many different
-distributions it may pollute the Makefile.ad unnecessarily.
-
-This directive is optional.  The <source> may be a single file, a  single
-directory or a regular expression which will match several files and/or
-directories.  The <destination> is optional.  If it is omitted then
-the <source> will be copied into the same location in the distribution.
-If the <destination> is provided the <source> will be copied into the
-specified location.
-
-Example:
-@example
-include apps/foobar/README README
-include lib/libfoo
-include lib/libfoobar lib/foobarlib
-include doc/foo*
-include scripts/foobar.sh foo.sh
-@end example
-
-Will include the file 'apps/foobar/README' into the top distribution
-directory in the name 'README', the directory 'lib/libfoo' into same
-location in distribution, the directory 'lib/libfoobar' into
-'lib/foobarlib' changing the name of the directory into 'foobarlib',
-the files and directories that match 'doc/foo*' into the same locations
-in distribution, and finally the 'scripts/foobar.sh' into the top
-distribution directory changing the name of the file into 'foo.sh'.
-
-Note that, the 'include' directives will be processed by the Autodist
-only when the distribution is packaged (@pxref{Creating distribution, , , , }).  When preparing the source
-tree for configuration and compilation (@pxref{Preparing source tree, , , , })
-the 'include' directives are ignored.  This is same behavior as with
-Makefile.am's EXTRA_DIST.
-
-If the included file or directory does not exist the Autodist will
-give an error and stop the distribution creation.  If the destination
-file exist, it will be replaced with the included file.  If the
-destination directory already exists, the contents of the source
-directory will be copied into the directory.  Note that, the directory
-will not be copied into the directory; if the <destination> is specified,
-also the name of the <source> file or directory must be specified,
-otherwise the 'include' will change the name into the one specified.
-
-Example:
-@example
-include lib/libfoo lib
-@end example
-
-In this example the 'lib/libfoo' will be included as 'lib'.  If the 'lib'
-already exists, this effectively copies the contents of the 'lib/libfoo'
-into 'lib'.  In order to include the directory with same name, the
-name must be specified.
-
-Example:
-@example
-include lib/libfoo lib/libfoo
-include lib/foobar new_lib/foobar
-@end example
-
-This will include the 'lib/libfoo' into 'lib/libfoo' in distribution,
-and 'lib/foobar' into 'new_lib/foobar' in distribution.
-
-
-@section Directive: exclude <filename> [...]
-
-The 'exclude' directive can be used to exclude files and directories from
-the distribution.  This directive is optional.  This directive is
-processed before processing the 'include' directive.  The <filename>
-can be a single file, a single directory or a regular expression that
-will match several files and/or directories.
-
-Example:
-@example
-exclude README
-exclude doc/client*
-@end example
-
-This will exclude the file 'README' and anything that match 'doc/client*'.
-
-
-@section Directive: noprocess <filename> [...]
-
-The 'noprocess' directive can be used to tell Autodist specificly not to 
-process files or directories.  The Autodist will not process the files 
-during distribution packaging.  This directive is optional.  One or more 
-files can be specified in the 'noprocess' directive.  Zero or more 
-'noprocess' directives can be used in distribution.  The <filename> can be 
-a single file, a single directory or a regular expression that will match 
-several files and/or directories.
-
-Example:
-@example
-noprocess autodist.texi
-noprocess apps/foo/
-@end example
-
-Autodist will not process 'autodist.texi' file, and any files and 
-directories under 'apps/foo/'.
-
-Note that, 'noprocess' directive cannot be used to disallow 
-processing of any file with '.ad' suffix.
-
-
-@section Directive: pre-hook <filename> [...]
-
-The 'pre-hook' directive can be used define additional scripts that
-will be run before the source tree is prepared.  This directive is
-optional.  One or more scripts may be defined in one 'pre-hook' directive.
-Zero or more 'pre-hook' directives may be set for distribution.  The
-'pre-hook' hook will be run immediately after invoking Autodist to start
-preparing the source tree for configuration and compilation (@pxref{Preparing source tree, , , , }).
-
-The scripts will get at least three (3) command line arguments when 
-Autodist executes the script: distribution name, distribution version and 
-package name of distribution.  The script may use these arguments if it 
-needs them.  If user passed any extra parameters to autodist in the 
-command line they will also be passed to the script as last arguments.
-
-
-@section Directive: post-hook <filename> [...]
-
-The 'post-hook' directive can be used define additional scripts that
-will be run after the source tree is prepared.  This directive is
-optional.  One or more scripts may be defined in one 'post-hook' directive.
-Zero or more 'post-hook' directives may be set for distribution.  The
-'post-hook' hook will be run immediately after the Autodist has finished
-preparing the source three for configuration and compilation (@pxref{Preparing source tree, , , , }).  The Autodist will exit after it has run the
-'post-hook' scripts.
-
-The scripts will get at least three (3) command line arguments when 
-Autodist executes the script: distribution name, distribution version and 
-package name of distribution.  The script may use these arguments if it 
-needs them.  If user passed any extra parameters to autodist in the 
-command line they will also be passed to the script as last arguments.
-
-
-@section Directive: pre-process-dist-hook <filename> [...]
-
-The 'pre-process-dist-hook' directive can be used define additional
-scripts that will be run when Autodist has started distribution creation.
-This directive is optional.  One or more scripts may be defined in one
-'pre-process-dist-hook' directive.  Zero or more 'pre-process-dist-hook'
-directives may be set for distribution.  The 'pre-process-dist-hook' hook
-will be run immediately after the Autodist has created the distribution
-directory but has not yet started any distribution processing.
-
-The scripts will get at least four (4) command line arguments when 
-Autodist executes the script: distribution name, distribution version, 
-package name of distribution and destination distribution directory name.  
-The script may use these arguments if it needs them.  If user passed any 
-extra parameters to autodist in the command line they will also be passed 
-to the script as last arguments.
-
-
-@section Directive: post-process-dist-hook <filename> [...]
-
-The 'post-process-dist-hook' directive can be used define additional
-scripts that will be run when Autodist has finished distribution
-processing.  This directive is optional.  One or more scripts may be
-defined in one 'post-process-dist-hook' directive.  Zero or more
-'post-process-dist-hook' directives may be set for distribution.  The
-'post-process-dist-hook' hook will be run immediately after the Autodist
-has finished processing the destination distribution directory but has not
-yet created the distribution package.
-
-The scripts will get at least four (4) command line arguments when 
-Autodist executes the script: distribution name, distribution version, 
-package name of distribution and destination distribution directory name.  
-The script may use these arguments if it needs them.  If user passed any 
-extra parameters to autodist in the command line they will also be passed 
-to the script as last arguments.
-
-
-@section Directive: pre-dist-hook <filename> [...]
-
-The 'pre-dist-hook' directive can be used define additional scripts that
-will be run when Autodist has started distribution creation.  This directive
-is optional.  One or more scripts may be defined in one 'pre-dist-hook'
-directive.  Zero or more 'pre-dist-hook' directives may be set for
-distribution.  The 'pre-dist-hook' hook will be run immediately after
-the Autodist has started distribution creation, but has not yet created
-the distribution directory.  This hook is run before 'pre-process-dist-hook'.
-
-The scripts will get at least four (4) command line arguments when 
-Autodist executes the script: distribution name, distribution version, 
-package name of distribution and destination distribution directory name. 
-The script may use these arguments if it needs them.  If user passed any 
-extra parameters to autodist in the command line they will also be passed 
-to the script as last arguments.
-
-
-@section Directive: post-dist-hook <filename> [...]
-
-The 'post-dist-hook' directive can be used define additional scripts that
-will be run when Autodist has finished distribution creation.  This
-directive is optional.  One or more scripts may be defined in one
-'post-dist-hook' directive.  Zero or more 'post-dist-hook' directives may
-be set for distribution.  The 'post-dist-hook' hook will be run
-immediately after the Autodist has finished creating the distribution
-package.  This is the last hook Autodist runs.
-
-The scripts will get at least four (4) command line arguments when 
-Autodist executes the script: distribution name, distribution version, 
-package name of distribution and destination distribution directory name. 
-The script may use these arguments if it needs them.  If user passed any 
-extra parameters to autodist in the command line they will also be passed 
-to the script as last arguments.
-
-
-@section Running hooks
-
-The Autodist runs the hooks in the following order:
-
-Preparing source tree for configuration and compilation:
-
-@example
-<...Autodist started...>
-pre-hook
-<...preparation...>
-post-hook
-<...Autodist exits...>
-@end example
-
-Creating distribution:
-
-@example
-<...Autodist started...>
-pre-dist-hook
-<...distribution directory created...>
-pre-process-dist-hook
-<...processing all files, processing excludes and includes...>
-post-process-dist-hook
-<...creating distribution package...>
-post-dist-hook
-<...Autodist exits...>
-@end example
-
-When creating distribution the 'pre-hook' and 'post-hook' are not run.
-
-
-@section Example distfile
-
-The following is a simple distfile example.  The example assumes that the
-distdefs prefix is 'SILC'.
-
-@example
-# SILC Client distribution
-name SILC Client
-package silc-client
-bug-report silc-client-bugs@@silcnet.org
-inherit common
-inherit platform-unix
-inherit platform-win32
-define SILC_DIST_CLIENT
-define SILC_DIST_CLIENTLIB
-define SILC_DIST_IRSSI
-undef SILC_DIST_MPI
-exclude doc/draft*
-pre-hook scripts/client-pre-run
-post-process-dist-hook scripts/client-post-process
-post-dist-hook scripts/client-post-dist-bin
-@end example
-
-@menu
-* configure.ad files::          configure script for creating configure.ac
-@end menu
-
-
-@node configure.ad files
-@section configure.ad files
-
-Autodist creates 'configure.ac' file from the 'configure.ad' file.  The
-'configure.ad' file is a rather normal 'configure.ac' except that it accepts
-also Autodist macros.  Autodist also supports configure script fragments,
-also named as 'configure.ad'.  Any 'configure.ad' file in the source tree
-can be incorporated into the the top 'configure.ad' file.  Sometimes it may
-be useful to split a large configure script into smaller fragments.
-Especially in multi distribution system where certain libraries or features
-can be excluded from certain distributions it may be useful to handle
-their configuration from a configure fragment.  If the library is
-excluded then also its configuration can be excluded.
-
-If the software project already has a 'configure.ac' or 'configure.in'
-file, the 'configure.ad' can be created by simply renaming the current
-file to 'configure.ad'.  In this case the current configure script
-must be edited to support Autodist.  This is done by replacing the
-'AC_INIT' to 'AD_INIT'.  After specifying the 'AD_INIT' as the first
-macro in the 'configure.ad', the Autodist support has been fully
-integrated into the software project.
-
-If your software project is going to use configure fragments, then
-also Autodist macro 'AD_INCLUDE_CONFIGURE' must be used.  Autodist will
-automatically combine the fragments with the top 'configure.ac' script.
-To exclude a 'configure.ad' fragment from a distribution use the distdef
-conditionals inside the 'configure.ad' fragment file.  If the distdef is
-not defined the fragment will be excluded automatically.
-
-The following macros are available in current Autodist version.
-
-@defmac AD_INIT
-
-The 'AD_INIT' macro is used in place of Autoconf macro 'AC_INIT'.  The
-'AD_INIT' must be the first macro in the 'configure.ad', just like the
-'AC_INIT' macro in 'configure.ac'.  The AD_INIT macro is used to deliver
-the distribution names, distribution version, package name and bug-report
-email address to the 'configure.ac' file that Autodist will create.
-The 'AC_INIT' macro must not be used in 'configure.ad' file.
-
-This macro is mandatory and Autodist will exit with error if it is not
-specified in 'configure.ad'.  This macro has no arguments.
-@end defmac
-
-
-@defmac AD_INCLUDE_CONFIGURE
-
-This macro is used to tell Autodist that it should include any other
-'configure.ad' fragment that is found from the source tree into the
-top 'configure.ad' file.  Note that, the 'configure.ad' fragments will
-be incorporated at the location where this macro is used in the
-'configure.ad'.  Usually this macro is placed just before the Autoconf
-macro 'AC_OUTPUT'.  This macro has no arguments.
-
-Note that, the 'configure.ad' fragments are not real full featured
-configure scripts.  They must not use 'AD_INIT', 'AD_INCLUDE_CONFIGURE',
-'AC_INIT' or any other initialization macros.
-@end defmac
-
-
-@defmac AD_DISABLE_DEPENDENCIES
-
-This macro is used to disable Autodist dependencies.  If this macro is
-used, then after editing 'Makefile.ad' and 'configure.ad' files the
-Autodist must be run manually.  When dependencies are enabled Autodist is
-run automatically when source is compiled with 'make'.  Dependencies make
-the development easier.  This macro has no arguments.
-
-Note that, the dependencies are enabled only in the prepared source tree.  
-Depedencies are not delivered to distribution, as they would require the 
-presence of 'Makefile.ad' and 'configure.ad' files, which are not 
-delivered to distribution.
-@end defmac
-
-@menu
-* Makefile.ad files::           Makefile.ad for creating Makefile.am
-@end menu
-
-
-@node Makefile.ad files
-@section Makefile.ad files
-
-Autodist creates 'Makefile.am' files from 'Makefile.ad' files.  A software
-project do not need to use 'Makefile.ad' files if there is no need to
-use distdef conditionals inside makefiles.  Usually a multi distribution
-software project, however will need to define certain things to different
-distributions.  In these cases 'Makefile.ad' file needs to be created.
-
-Even though it would be possible to use distdef conditionals also inside
-'Makefile.am' files, Autodist does not process 'Makefile.am' files when
-preparing the source tree for configuration and compilation (@pxref{Preparing source tree, , , , }).  Thus, the prepared environment would not be
-identical to the created distribution package (when the 'Makefile.am'
-will be processed), and configuration and compilation would be inconsistent.
-Basic rule is, if you need distdefs (@pxref{Distdefines, , , , }) inside
-makefiles, put them inside 'Makefile.ad' file.
-
-
-@menu
-* Other .ad files::             Other files with .ad suffix
-@end menu
-
-
-@node Other .ad files
-@section Other .ad files
-
-Any file in the source tree can have the '.ad' suffix appended.  Autodist
-will process any file that has the suffix when the source tree is
-prepared for configuration and compilation (@pxref{Preparing source tree, , , , }).  If the files have distdef conditionals the Autodist will process them.
-The files will have the '.ad' suffix removed.
-
-Basic rule is, if you need to process some file when preparing the
-source tree for configuration and compilation, add '.ad' suffix to it.
-Distdefs (@pxref{Distdefines, , , , }) can be used in any file in source
-tree but without '.ad' suffix Autodist will not process those files during
-preparation.  They will be processed when creating the distribution package.
-If you need processed files during configuration or compilation then they
-need to have '.ad' suffix.
-
-Note that, the distdef format used in these files must be the non-source
-format, even if the file is source file.  This is because the distdefs
-are processed during source tree preparation, and the source file will
-have all distdefs removed when it is compiled.
-
-@menu
-* Distdefines::                 Using distdefs in files
-@end menu
-
-
-@node Distdefines
-@section Using distribution defines (distdefs)
-
-Distribution defines, or distdefs from now on, are used to define inside
-a file what will be included in the distribution.  Distribution may define
-many different distdefs, for example, based on feature sets, platforms, or
-for other similar reasons.  If distdef is not defined for the distribution
-but is used in a file, anything inside the distdef in that file will be
-removed when the distribution is packaged (@pxref{Creating distribution, , , , }).  This guarantees that only the files, directories and file content
-(such as source code) that is supposed to be delivered with the distribution
-are delivered.  Delivering files or code accidentally in the distribution
-cannot happen.
-
-All other files, except files ending with '.ad' suffix are processed for
-distdefs only when the distribution is packaged.  Files ending with '.ad'
-suffix are processed for distdefs when preparing the source tree for
-configuration and compilation (@pxref{Preparing source tree, , , , }).
-
-By default the distdefs are named '_DIST_XXX', where 'XXX' is the name of
-distdef.  However, many projects will want to define their own prefix
-for distdefs in the 'autodist.conf' configuration file (@pxref{autodist.conf, , , , }).
-In the following examples a prefix 'SILC' is used, hence the prefix for
-the distdefs are 'SILC_DIST_'.
-
-The basic format for the distdefs are as follows:
-
-@example
-#ifdef SILC_DIST_DEFINE
-#endif SILC_DIST_DEFINE
-
-#ifndef SILC_DIST_DEFINE
-#endif SILC_DIST_DEFINE
-
-#ifdef SILC_DIST_DEFINE
-#else !SILC_DIST_DEFINE
-#endif SILC_DIST_DEFINE
-
-#ifndef SILC_DIST_DEFINE
-#else SILC_DIST_DEFINE
-#endif SILC_DIST_DEFINE
-@end example
-
-This format should be used only in non-source files, as for example C and
-C++ compilers will not like this format inside a file.  In source files
-a compiler friendly format, defined below, should be used.
-
-@example
-#ifdef SILC_DIST_DEFINE
-#endif /* SILC_DIST_DEFINE */
-
-#ifndef SILC_DIST_DEFINE
-#endif /* SILC_DIST_DEFINE */
-
-#ifdef SILC_DIST_DEFINE
-#else /* !SILC_DIST_DEFINE */
-#endif /* SILC_DIST_DEFINE */
-
-#ifndef SILC_DIST_DEFINE
-#else /* SILC_DIST_DEFINE */
-#endif /* SILC_DIST_DEFINE */
-@end example
-
-Note that, only the format defined above is supported.  Other more complex
-use of the preprocessor directives such as using '&&' and '||' in the
-'#ifdef' or '#ifndef' are not supported, and neither is '#elif'.  Also
-note, that the name of the distdef in '#else' and '#endif' directives in
-non-source format and in source format inside C comments (/* */), and the
-use of '!' character in the '#else' branch of '#ifdef'" are mandatory.
-Also note, that the distdef conditionals must be placed at the start of
-the line, they must not be indented.
-
-The following example shows the use of non-source format:
-
-@example
-SUBDIRS =                        \
-#ifdef SILC_DIST_SERVER
-       server                    \
-       server-foobar             \
-#endif SILC_DIST_SERVER
-#ifndef SILC_DIST_CLIENT
-       tests                     \
-#endif SILC_DIST_CLIENT
-#ifdef SILC_DIST_TOOLKIT
-       toolkit                   \
-       toolkit-docs              \
-#else !SILC_DIST_TOOLKIT
-       doc                       \
-       lib                       \
-#ifdef SILC_DIST_CLIENT
-       client                    \
-#endif SILC_DIST_CLIENT
-#endif SILC_DIST_TOOLKIT
-@end example
-
-Say, in this example, your distribution has the SILC_DIST_CLIENT and
-SILC_DIST_SERVER defined, but not the SILC_DIST_TOOLKIT, the end result
-would be:
-
-@example
-SUBDIRS =                        \
-       server                    \
-       server-foobar             \
-       doc                       \
-       lib                       \
-       client                    \
-@end example
-
-The lines defined specificly for the SILC_DIST_TOOLKIT, which in our
-example was not defined, were removed.  Also lines that specificly
-expected certain distdefs not to be defined ('#ifndef') were removed.
-(Note the last remaining '\' in example above would be removed by the
-Autodist automatically to avoid errors with Automake.)
-
-The following example shows the use of source code format:
-
-@example
-  initialize_lib();
-#ifdef SILC_DIST_MPI
-  init_mpi();
-  mpi = mpi_alloc();
-#else /* !SILC_DIST_MPI */
-  init_gmp();
-#endif /* SILC_DIST_MPI */
-
-#ifndef SILC_DIST_FOOBAR
-  foobar_replacement();
-  foobar_hack_init();
-  foobar_init();
-#else /* SILC_DIST_FOOBAR */
-  real_foobar();
-#endif /* SILC_DIST_FOOBAR */
-@end example
-
-Say, you have both SILC_DIST_MPI and SILC_DIST_FOOBAR defined, the end result
-would be:
-
-@example
-  initialize_lib();
-  init_mpi();
-  mpi = mpi_alloc();
-
-  real_foobar();
-@end example
-
-Even before processing the source files with Autodist, the preprocessor
-will respect the preprocessor directives if the code use '#include' to
-include the distdef header file created by the Autodist (see
-'autodist.conf' (@pxref{autodist.conf, , , , })).  When the distribution
-is packaged (@pxref{Creating distribution, , , , }) the Autodist will
-process the files, and will remove any line not defined to be included.
-The preprocessor directives will also be removed.
-
-Because the software project includes the header file with '#include' the
-distdef header file needs to be present in the distribution, unless it is
-placed inside some other '#ifdef' conditional.  If the distribution is
-prepared but not compiled (it is packaged after preparation without
-compilation) then including the distdef header in the source is not
-necessary.  Including it then in the distribution is not necessary either.
-
-The software project should not use the same name space that distdef
-conditionals use for other than distribution usage.  The Autodist will
-process any line that uses the formats above and has the specified prefix
-(eg. 'SILC_DIST_') in those lines.  Using same prefix for other purposes
-will produce unexpected results and invalid distributions.
-
-The following suffixes will be considered as source files by the Autodist:
-
-@example
-    .c
-    .C
-    .cc
-    .cp
-    .cpp
-    .CPP
-    .cxx
-    .CXX
-    .c++
-    .m
-    .h
-    .H
-    .hh
-@end example
-
-Also, any file that has '.in' suffix with any of the above source file 
-suffixes, the format inside the file must follow the source code format.  
-Using distdefs in any other file must follow the non-source format.
-
-Example:
-@example
-    .c.in
-    .h.in
-@end example
-
-In this example, in both of the files the source code format is used.
-
-
-@node Dependencies
-@section Autodist dependency support
-
-Autodist support dependencies for 'Makefile.ad' and 'configure.ad' files.  
-When these files are edited, they are processed by Autodist automatically 
-when the source tree is compiled with 'make'.  This makes development in 
-the source tree easier, when Autodist does not have to be run manually.
-The dependencies can be disabled by using 'AD_DISABLE_DEPENDENCIES' macro 
-in the 'configure.ad' file.
-
-When editing 'configure.ad' fragments the modifcation is detected when the 
-source tree is compiled with 'make' from the top source directory.  
-Giving 'make' in a subdirectory will not detect a change in 'configure.ad' 
-fragment.
-
-Dependencies are present only in the prepared source tree.  They are not 
-delivered to created distribution, as they depend on 'Makefile.ad' and 
-'configure.ad' files which are not present in the created distribution.  
-Autodist automatically removes the dependencies when the distribution is 
-created.
-
-
-@node Invoking Autodist
-@chapter Invoking Autodist
-
-The Autodist has two basic functions:
-
-    1. Preparing source tree for configuration and compilation (@pxref{Preparing source tree, , , , })
-
-    2. Creating distribution packages (@pxref{Creating distribution, , , , })
-
-The 'autodist' accepts the following options:
-
-@table @samp
-
-@item -h
-@itemx --help
-Prints the help for the Autodist and exits.
-
-@item -V
-@itemx --version
-Prints version number and exits.
-
-@item -v
-@itemx --verbose
-Verbosely report processing.
-
-@item -d
-@itemx --distdir <dir>
-Search distributions from <dir> instead of default 'distdir'.
-
-@item -s
-@itemx --distdefs [<dist>]
-Prints distribution defines of <dist> and exits.
-
-@item -i
-@itemx --init
-Initializes Autodist environment.  Creates the default distribution
-directory 'distdir', 'autodist.conf' configuration file and the
-default distribution 'default', then exits.
-
-@item -p
-@itemx --process <type> <src> <dst>
-Process file <src> into <dst> for distribution, <type> is 'makefile',
-'configure', 'non-source' or 'source' and defines the type of <src>,
-then exits.
-
-@item -m
-@itemx --makedist
-Creates and packages distribution
-
-@itemx --gzip
-Create package compressed with gzip (default)
-
-@itemx --bzip2
-Create also package compressed with bzip2
-
-@itemx --compress
-Create also package compressed with compress
-
-@itemx --zip
-Create also package compressed with zip
-
-
-@end table
-
-@menu
-* Preparing source tree::       Preparing source tree with Autodist
-* Creating distribution::       Creating distribution with Autodist
-@end menu
-
-
-@node Preparing source tree
-@section Preparing source tree for configuration and compilation
-
-Before distribution can be created from the source tree, the source tree
-must be prepared for configuration and compilation.  If your project is
-not using Autodist, then you would do this by running perhaps 'aclocal',
-'autoconf', 'autoheader' and 'automake' tools manually, or you would run an
-'autogen.sh' script that prepares your raw source tree.  With Autodist
-this process is performed by Autodist, and running these tools manually
-or using 'autogen.sh' script is not necessary.
-
-By default the 'autodist.conf' (@pxref{autodist.conf, , , , }) has defined
-the tools that will be run by the Autodist when preparing the source tree.
-These are 'aclocal', 'autoheader', 'autoconf', 'automake' and
-'libtoolize'.  If you do not wish that Autodist runs some or any of these
-tools automatically, do not set them in the 'autodist.conf'.  You would
-then need to run them manually. However, this is not recommended.  If you
-need to run additional preparation scripts you may set your scripts either
-in the 'pre-hook' and/or 'post-hook' where you can run what ever
-additional processing you may need to prepare your source tree.
-
-By default the Autodist creates a 'default' distribution when you
-initialize your project by running 'autodist -i'.  The 'default'
-distribution should be used when you are developing in your source
-tree.  By default, the 'default' distribution cannot be packaged,
-however, if your project creates only one distribution you may find
-it more convenient to define your distribution inside the 'default'
-distribution and allow it to be packaged also.  If your source tree
-will create multiple distributions, the 'default' should be used only
-as development distribution.  You would use it when you, for example,
-checkout your source tree from CVS and prepare it for configuration
-and compilation.  To prepare your source tree with the 'default'
-distribution run Autodist without any arguments.
-
-@example
-  autodist
-@end example
-
-The Autodist will prepare your source tree.  After that you may run
-'./configure' and continue to compile with 'make'.
-
-If you do not wish to use the 'default' distribution, or you wish
-to do the development in a tree specificly prepared for some specific
-distribution, or you are preparing to create a new distribution package,
-you will need to run the Autodist with the distribution you wish to
-prepare.
-
-@example
-  autodist example-distribution 1.0.3
-@end example
-
-This prepares your source tree for 'example-distribution' of version
-'1.0.3'.  After that you may run './configure' and continue to compile
-with 'make'.  If the version is omitted the version will be '0.0'.
-The 'PACKAGE_VERSION' define delivered by Autoconf will contain this
-version.
-
-Note that, running Autodist for preparation merely prepares your source
-tree for the distribution, it does not create an actual distribution
-package.  When preparing source tree for configuration and compilation
-the Autodist will process any file that ends with '.ad' suffix.  It will
-process all 'configure.ad' and 'Makefile.ad' files for that distribution.
-When you run './configure' your tree will be configured for that
-distribution, and when you compile with 'make' it will compile for that
-distribution.
-
-However, the source files, or any other file (except files ending with
-'.ad' suffix) are not processed by the Autodist.  When compiling
-your sources the preprocessor, however, will respect your distdef
-conditionals inside your source files if you '#include' the distdef header
-file.  This way, even the compiled binaries will be compiled for that
-distribution, even though the source files has not yet been processed
-by the Autodist.  Rest of the files in the distribution will be processed
-when you create the actual distribution package.  It is guaranteed that
-the distribution you have prepared will behave in your source tree exactly
-the same way as if it was already packaged with Autodist (providing that
-you remember to include the distdef header file in your code).
-
-When preparing the source tree Autodist will create a file 'autodist.dist'
-which will contain information on the prepared distribution.  When
-Creating the distribution that file will be read by the Autodist
-automatically.  That file should not be removed or the distribution
-cannot be packaged.
-
-Autodist also created a log file, 'autodist.log', that will include
-messages created by Autodist during preparation.
-
-@menu
-* Creating distribution::       Creating distribution with Autodist
-@end menu
-
-
-@node Creating distribution
-@section Creating distribution package(s)
-
-Before creating a new distribution package, you will need to prepare
-the source tree for the distribution you want to create.  After preparing
-your source tree you will be ready to create a new distribution.  The
-Autodist package provides a simple helper script 'makedist' that may
-be used to create the distribution.  However, if you wish, you may
-run the Autodist yourself, as the 'makedist' will call Autodist anyway.
-
-To create a new distribution for the distribution you have prepared for,
-run first './configure' and then 'makedist'.
-
-@example
-  makedist
-@end example
-
-This will run the Autodist and create a new distribution package that
-is archived with 'tar' and compressed with 'gzip'.  If you wish to
-create packages also compressed with 'bzip2', 'compress' and/or 'zip'
-you may give one or all of the following options:
-
-@example
-  makedist --bzip2 --compress --zip
-@end example
-
-This example would create, in addition of 'tar.gz' package, also a
-'tar.bz2', 'tar.Z' and '.zip' packages.  Current version of Autodist does
-not support archiving with 'shar'.
-
-If you wish to run additional processing for your distributions when they 
-are being packaged you may set 'pre-process-dist-hook', 
-'post-process-dist-hook, 'pre-dist-hook' and/or 'post-dist-hook' in your 
-distribution file.  Also note that any hooks provided by Automake in 
-Makefiles will be run in normal manner.
-
-When creating the distribution Autodist creates a log file, 
-'makedist.log', that will include messages created by Autodist.  It is 
-suggested that this file is checked after distribution is created.  For 
-example, when the 'license-header' directive is used to re-license the 
-distribution, the 'makedist.log' will include list of files that were not 
-re-licensed.  The log file can be used to verify that the distribution was 
-re-licensed correctly, and fix any possible mistakes.
-
-
-@node Examples
-@chapter Examples
-
-@menu
-* Single distribution tree::    Single distribution example
-* Multiple distribution tree::  Multiple distributions example
-@end menu
-
-@node Single distribution tree
-@section Single distribution tree example, start to finish
-
-Lets suppose you have a simple source tree with one application,
-called 'foozbar' you wish to release.  While you would probably suffice
-using Autoconf and Automake features you may still use Autodist.
-
-First, you create the default 'distdir' into your software package:
-
-@example
-  autodist -i
-@end example
-
-Then, you create the 'configure.ad' file from your existing 'configure.ac'
-or 'configure.in' file.  If you don't have configure script written yet,
-please refer to the Autoconf manual.  In the 'configure.ad' you add as
-first macro in the file:
-
-@example
-  AD_INIT
-@end example
-
-Then, you create distribution file for your application:
-
-@example
-# Foozbar distribution
-name Foozbar
-package foozbar
-bug-report foozbar-bugs@@foo.z.bar
-define _DIST_FOOZBAR
-@end example
-
-This distribution file go into 'distdir/foozbar'.
-
-And there you go.  You have succesfully integrated Autodist into your
-source tree.  If you need to do development and you wish to use the
-'default' distribution for that, you should inherit the new 'foozbar'
-distribution in it.  Add the following line in 'distdir/default':
-
-@example
-  inherit foozbar
-@end example
-
-After that, you can prepare the source tree for configuration and
-compilation by giving:
-
-@example
-  autodist
-@end example
-
-After this command you can give './configure' and 'make'.
-
-If you want to do development directly in a tree prepared for the
-'foozbar' distribution, or you are ready to start creating a new
-distribution package, you give:
-
-@example
-  autodist foozbar 1.0
-@end example
-
-After this command you can give './configure' and 'make'.
-
-To create the distribution package, you will give:
-
-@example
-  makedist
-@end example
-
-The end result will be a 'foozbar-1.0.tar.gz' package.
-
-
-@node Multiple distribution tree
-@section Multiple distribution tree example, start to finish
-
-Lets suppose you have a source tree from which you create multiple
-distributions, say three.  If you really have a such source tree you
-must have by now noticed the difficulty of maintaining such a source tree
-and problems with controlling the distributions.  Maybe you have sufficed
-with Autoconf and Automake, or perhaps you have created your own scripts
-that carry out the kludges.  No more, for Autodist is here.
-
-First, you integrate Autodist into your tree by creating the distributions
-directory 'distdir':
-
-@example
-  autodist -i
-@end example
-
-Then, you create the 'configure.ad' file from your existing 'configure.ac'
-or 'configure.in' file.  If you don't have configure script written yet,
-please refer to the Autoconf manual.  In the 'configure.ad' you add as
-first macro in the file:
-
-@example
-  AD_INIT
-@end example
-
-You then continue with creating the distribution files for your three
-distributions.  Let's name them 'foozbar', 'libfoozbar' and 'nomad'.
-We will also create a common template that all distributions inherit.
-
-@example
-# Foozbar distribution
-name Foozbar
-package foozbar
-bug-report foozbar-bugs@@foo.z.bar
-inherit common
-define _DIST_FOOZBAR
-@end example
-
-@example
-# libfoozbar distribution
-name libfoozbar
-bug-report libfoozbar-bugs@@foo.z.bar
-inherit common
-define _DIST_LIBFOOZBAR
-@end example
-
-@example
-# Nomad distribution
-name Nomad
-package nomad-the-server
-bug-report nomad-bugs@@foo.z.bar
-inherit common
-include doc/nomad
-define _DIST_NOMAD
-define _DIST_NOMAD_LIB
-undef _DIST_CRYPTO
-pre-dist-hook nomad-pre-dist-hook
-@end example
-
-@example
-# Common template
-option template
-define _DIST_DOC
-define _DIST_LIB
-define _DIST_MATH
-define _DIST_CRYPTO
-define _DIST_UNIX
-define _DIST_MACOSX
-define _DIST_WIN32
-@end example
-
-You put the distribution files in the 'distdir' directory.  In addition
-you will be doing development in the source tree using the 'default'
-distribution, you will add the new distributions to the 'distdir/default':
-
-@example
-inherit foozbar
-inherit libfoozbar
-inherit nomad
-@end example
-
-To prepare the source tree for configuration and compilation you would
-simply give:
-
-@example
-autodist
-@end example
-
-This will prepare your source tree for configuration and compilation.  Since
-the 'default' distribution inherits all distributions your development
-source tree will have all of them included.  If you do not want to do this
-then don't inherit them in the 'default', but run the autodist specificly
-for the distributions, for example:
-
-@example
-autodist foozbar
-@end example
-
-Since all the distributions inherit the 'common' distribution they get
-all the distdefs that the 'common' defines.  In this example various distdefs
-has been defined.  You would use them in your code and in your makefiles
-to control various things.  For example, let's say the 'common' distdefs
-control what directories distributions have.  An example 'Makefile.ad'
-file:
-
-@example
-SUBDIRS =                       \
-#ifdef _DIST_LIB
-       lib                      \
-#endif _DIST_LIB
-#ifdef _DIST_DOC
-       doc                      \
-#endif _DIST_DOC
-@end example
-
-Perhaps the 'Makefile.ad' in 'lib' subdirectory could define something
-like this:
-
-@example
-SUBDIRS =                       \
-        util                    \
-#ifdef _DIST_MATH
-        mathlib                 \
-#endif _DIST_MATH
-#ifdef _DIST_CRYPTO
-        cryptolib               \
-#endif _DIST_CRYPTO
-#ifdef _DIST_NOMAD_LIB
-        nomadlib                \
-#endif _DIST_NOMAD_LIB
-#ifdef _DIST_LIBFOOZBAR
-        foozbarlib               \
-#endif _DIST_LIBFOOZBAR
-@end example
-
-Since the 'nomad' distribution undefined the '_DIST_CRYPTO' distdef it
-would not have the 'cryptolib' in its distribution.  Clearly Nomad
-don't need it.  In addition of using the distdefs just in the makefiles
-you may want to use them in the source code as well:
-
-@example
-     ...some code...
-
-#ifdef _DIST_MATH
-  /* Initialize math library */
-  math_init();
-#endif /* _DIST_MATH */
-
-     ...some code...
-@end example
-
-After an intensive development period you're ready to create new releases.
-Let's say you're going to release all distributions:
-
-First you release Foozbar 0.5.1:
-
-@example
-autodist foozbar 0.5.1
-makedist --bzip2
-@end example
-
-The end result is two files: 'foozbar-0.5.1.tar.gz' and
-'foozbar-0.5.1.tar.bz2'.
-
-Then you continue with libfoozbar and Nomad:
-
-@example
-autodist libfoozbar 1.0.5
-makedist
-
-Nomad has also an RPM .spec file that you have written and a pre-dist-hook 
-that will replace the RPM release version with sed tool with the one you 
-give as extra parameter to autodist:
-
-autodist nomad 2.0 0.fc7
-makedist
-@end example
-
-The end results are: 'libfoozbar-1.0.5.tar.gz' and 'nomad-2.0.tar.gz', and 
-the RPM will have a release version '0.fc7' when you compile the RPM.  Any 
-extra parameter that you pass to autodist will be delivered to your hook 
-scripts.
-
-@page
-@contents
-@bye
diff --git a/apps/autodist/doc/fdl.texi b/apps/autodist/doc/fdl.texi
deleted file mode 100644 (file)
index 5385f32..0000000
+++ /dev/null
@@ -1,452 +0,0 @@
-
-@node GNU Free Documentation License
-@appendixsec GNU Free Documentation License
-
-@cindex FDL, GNU Free Documentation License
-@center Version 1.2, November 2002
-
-@display
-Copyright @copyright{} 2000,2001,2002 Free Software Foundation, Inc.
-59 Temple Place, Suite 330, Boston, MA  02111-1307, USA
-
-Everyone is permitted to copy and distribute verbatim copies
-of this license document, but changing it is not allowed.
-@end display
-
-@enumerate 0
-@item
-PREAMBLE
-
-The purpose of this License is to make a manual, textbook, or other
-functional and useful document @dfn{free} in the sense of freedom: to
-assure everyone the effective freedom to copy and redistribute it,
-with or without modifying it, either commercially or noncommercially.
-Secondarily, this License preserves for the author and publisher a way
-to get credit for their work, while not being considered responsible
-for modifications made by others.
-
-This License is a kind of ``copyleft'', which means that derivative
-works of the document must themselves be free in the same sense.  It
-complements the GNU General Public License, which is a copyleft
-license designed for free software.
-
-We have designed this License in order to use it for manuals for free
-software, because free software needs free documentation: a free
-program should come with manuals providing the same freedoms that the
-software does.  But this License is not limited to software manuals;
-it can be used for any textual work, regardless of subject matter or
-whether it is published as a printed book.  We recommend this License
-principally for works whose purpose is instruction or reference.
-
-@item
-APPLICABILITY AND DEFINITIONS
-
-This License applies to any manual or other work, in any medium, that
-contains a notice placed by the copyright holder saying it can be
-distributed under the terms of this License.  Such a notice grants a
-world-wide, royalty-free license, unlimited in duration, to use that
-work under the conditions stated herein.  The ``Document'', below,
-refers to any such manual or work.  Any member of the public is a
-licensee, and is addressed as ``you''.  You accept the license if you
-copy, modify or distribute the work in a way requiring permission
-under copyright law.
-
-A ``Modified Version'' of the Document means any work containing the
-Document or a portion of it, either copied verbatim, or with
-modifications and/or translated into another language.
-
-A ``Secondary Section'' is a named appendix or a front-matter section
-of the Document that deals exclusively with the relationship of the
-publishers or authors of the Document to the Document's overall
-subject (or to related matters) and contains nothing that could fall
-directly within that overall subject.  (Thus, if the Document is in
-part a textbook of mathematics, a Secondary Section may not explain
-any mathematics.)  The relationship could be a matter of historical
-connection with the subject or with related matters, or of legal,
-commercial, philosophical, ethical or political position regarding
-them.
-
-The ``Invariant Sections'' are certain Secondary Sections whose titles
-are designated, as being those of Invariant Sections, in the notice
-that says that the Document is released under this License.  If a
-section does not fit the above definition of Secondary then it is not
-allowed to be designated as Invariant.  The Document may contain zero
-Invariant Sections.  If the Document does not identify any Invariant
-Sections then there are none.
-
-The ``Cover Texts'' are certain short passages of text that are listed,
-as Front-Cover Texts or Back-Cover Texts, in the notice that says that
-the Document is released under this License.  A Front-Cover Text may
-be at most 5 words, and a Back-Cover Text may be at most 25 words.
-
-A ``Transparent'' copy of the Document means a machine-readable copy,
-represented in a format whose specification is available to the
-general public, that is suitable for revising the document
-straightforwardly with generic text editors or (for images composed of
-pixels) generic paint programs or (for drawings) some widely available
-drawing editor, and that is suitable for input to text formatters or
-for automatic translation to a variety of formats suitable for input
-to text formatters.  A copy made in an otherwise Transparent file
-format whose markup, or absence of markup, has been arranged to thwart
-or discourage subsequent modification by readers is not Transparent.
-An image format is not Transparent if used for any substantial amount
-of text.  A copy that is not ``Transparent'' is called ``Opaque''.
-
-Examples of suitable formats for Transparent copies include plain
-@sc{ascii} without markup, Texinfo input format, La@TeX{} input
-format, @acronym{SGML} or @acronym{XML} using a publicly available
-@acronym{DTD}, and standard-conforming simple @acronym{HTML},
-PostScript or @acronym{PDF} designed for human modification.  Examples
-of transparent image formats include @acronym{PNG}, @acronym{XCF} and
-@acronym{JPG}.  Opaque formats include proprietary formats that can be
-read and edited only by proprietary word processors, @acronym{SGML} or
-@acronym{XML} for which the @acronym{DTD} and/or processing tools are
-not generally available, and the machine-generated @acronym{HTML},
-PostScript or @acronym{PDF} produced by some word processors for
-output purposes only.
-
-The ``Title Page'' means, for a printed book, the title page itself,
-plus such following pages as are needed to hold, legibly, the material
-this License requires to appear in the title page.  For works in
-formats which do not have any title page as such, ``Title Page'' means
-the text near the most prominent appearance of the work's title,
-preceding the beginning of the body of the text.
-
-A section ``Entitled XYZ'' means a named subunit of the Document whose
-title either is precisely XYZ or contains XYZ in parentheses following
-text that translates XYZ in another language.  (Here XYZ stands for a
-specific section name mentioned below, such as ``Acknowledgements'',
-``Dedications'', ``Endorsements'', or ``History''.)  To ``Preserve the Title''
-of such a section when you modify the Document means that it remains a
-section ``Entitled XYZ'' according to this definition.
-
-The Document may include Warranty Disclaimers next to the notice which
-states that this License applies to the Document.  These Warranty
-Disclaimers are considered to be included by reference in this
-License, but only as regards disclaiming warranties: any other
-implication that these Warranty Disclaimers may have is void and has
-no effect on the meaning of this License.
-
-@item
-VERBATIM COPYING
-
-You may copy and distribute the Document in any medium, either
-commercially or noncommercially, provided that this License, the
-copyright notices, and the license notice saying this License applies
-to the Document are reproduced in all copies, and that you add no other
-conditions whatsoever to those of this License.  You may not use
-technical measures to obstruct or control the reading or further
-copying of the copies you make or distribute.  However, you may accept
-compensation in exchange for copies.  If you distribute a large enough
-number of copies you must also follow the conditions in section 3.
-
-You may also lend copies, under the same conditions stated above, and
-you may publicly display copies.
-
-@item
-COPYING IN QUANTITY
-
-If you publish printed copies (or copies in media that commonly have
-printed covers) of the Document, numbering more than 100, and the
-Document's license notice requires Cover Texts, you must enclose the
-copies in covers that carry, clearly and legibly, all these Cover
-Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on
-the back cover.  Both covers must also clearly and legibly identify
-you as the publisher of these copies.  The front cover must present
-the full title with all words of the title equally prominent and
-visible.  You may add other material on the covers in addition.
-Copying with changes limited to the covers, as long as they preserve
-the title of the Document and satisfy these conditions, can be treated
-as verbatim copying in other respects.
-
-If the required texts for either cover are too voluminous to fit
-legibly, you should put the first ones listed (as many as fit
-reasonably) on the actual cover, and continue the rest onto adjacent
-pages.
-
-If you publish or distribute Opaque copies of the Document numbering
-more than 100, you must either include a machine-readable Transparent
-copy along with each Opaque copy, or state in or with each Opaque copy
-a computer-network location from which the general network-using
-public has access to download using public-standard network protocols
-a complete Transparent copy of the Document, free of added material.
-If you use the latter option, you must take reasonably prudent steps,
-when you begin distribution of Opaque copies in quantity, to ensure
-that this Transparent copy will remain thus accessible at the stated
-location until at least one year after the last time you distribute an
-Opaque copy (directly or through your agents or retailers) of that
-edition to the public.
-
-It is requested, but not required, that you contact the authors of the
-Document well before redistributing any large number of copies, to give
-them a chance to provide you with an updated version of the Document.
-
-@item
-MODIFICATIONS
-
-You may copy and distribute a Modified Version of the Document under
-the conditions of sections 2 and 3 above, provided that you release
-the Modified Version under precisely this License, with the Modified
-Version filling the role of the Document, thus licensing distribution
-and modification of the Modified Version to whoever possesses a copy
-of it.  In addition, you must do these things in the Modified Version:
-
-@enumerate A
-@item
-Use in the Title Page (and on the covers, if any) a title distinct
-from that of the Document, and from those of previous versions
-(which should, if there were any, be listed in the History section
-of the Document).  You may use the same title as a previous version
-if the original publisher of that version gives permission.
-
-@item
-List on the Title Page, as authors, one or more persons or entities
-responsible for authorship of the modifications in the Modified
-Version, together with at least five of the principal authors of the
-Document (all of its principal authors, if it has fewer than five),
-unless they release you from this requirement.
-
-@item
-State on the Title page the name of the publisher of the
-Modified Version, as the publisher.
-
-@item
-Preserve all the copyright notices of the Document.
-
-@item
-Add an appropriate copyright notice for your modifications
-adjacent to the other copyright notices.
-
-@item
-Include, immediately after the copyright notices, a license notice
-giving the public permission to use the Modified Version under the
-terms of this License, in the form shown in the Addendum below.
-
-@item
-Preserve in that license notice the full lists of Invariant Sections
-and required Cover Texts given in the Document's license notice.
-
-@item
-Include an unaltered copy of this License.
-
-@item
-Preserve the section Entitled ``History'', Preserve its Title, and add
-to it an item stating at least the title, year, new authors, and
-publisher of the Modified Version as given on the Title Page.  If
-there is no section Entitled ``History'' in the Document, create one
-stating the title, year, authors, and publisher of the Document as
-given on its Title Page, then add an item describing the Modified
-Version as stated in the previous sentence.
-
-@item
-Preserve the network location, if any, given in the Document for
-public access to a Transparent copy of the Document, and likewise
-the network locations given in the Document for previous versions
-it was based on.  These may be placed in the ``History'' section.
-You may omit a network location for a work that was published at
-least four years before the Document itself, or if the original
-publisher of the version it refers to gives permission.
-
-@item
-For any section Entitled ``Acknowledgements'' or ``Dedications'', Preserve
-the Title of the section, and preserve in the section all the
-substance and tone of each of the contributor acknowledgements and/or
-dedications given therein.
-
-@item
-Preserve all the Invariant Sections of the Document,
-unaltered in their text and in their titles.  Section numbers
-or the equivalent are not considered part of the section titles.
-
-@item
-Delete any section Entitled ``Endorsements''.  Such a section
-may not be included in the Modified Version.
-
-@item
-Do not retitle any existing section to be Entitled ``Endorsements'' or
-to conflict in title with any Invariant Section.
-
-@item
-Preserve any Warranty Disclaimers.
-@end enumerate
-
-If the Modified Version includes new front-matter sections or
-appendices that qualify as Secondary Sections and contain no material
-copied from the Document, you may at your option designate some or all
-of these sections as invariant.  To do this, add their titles to the
-list of Invariant Sections in the Modified Version's license notice.
-These titles must be distinct from any other section titles.
-
-You may add a section Entitled ``Endorsements'', provided it contains
-nothing but endorsements of your Modified Version by various
-parties---for example, statements of peer review or that the text has
-been approved by an organization as the authoritative definition of a
-standard.
-
-You may add a passage of up to five words as a Front-Cover Text, and a
-passage of up to 25 words as a Back-Cover Text, to the end of the list
-of Cover Texts in the Modified Version.  Only one passage of
-Front-Cover Text and one of Back-Cover Text may be added by (or
-through arrangements made by) any one entity.  If the Document already
-includes a cover text for the same cover, previously added by you or
-by arrangement made by the same entity you are acting on behalf of,
-you may not add another; but you may replace the old one, on explicit
-permission from the previous publisher that added the old one.
-
-The author(s) and publisher(s) of the Document do not by this License
-give permission to use their names for publicity for or to assert or
-imply endorsement of any Modified Version.
-
-@item
-COMBINING DOCUMENTS
-
-You may combine the Document with other documents released under this
-License, under the terms defined in section 4 above for modified
-versions, provided that you include in the combination all of the
-Invariant Sections of all of the original documents, unmodified, and
-list them all as Invariant Sections of your combined work in its
-license notice, and that you preserve all their Warranty Disclaimers.
-
-The combined work need only contain one copy of this License, and
-multiple identical Invariant Sections may be replaced with a single
-copy.  If there are multiple Invariant Sections with the same name but
-different contents, make the title of each such section unique by
-adding at the end of it, in parentheses, the name of the original
-author or publisher of that section if known, or else a unique number.
-Make the same adjustment to the section titles in the list of
-Invariant Sections in the license notice of the combined work.
-
-In the combination, you must combine any sections Entitled ``History''
-in the various original documents, forming one section Entitled
-``History''; likewise combine any sections Entitled ``Acknowledgements'',
-and any sections Entitled ``Dedications''.  You must delete all
-sections Entitled ``Endorsements.''
-
-@item
-COLLECTIONS OF DOCUMENTS
-
-You may make a collection consisting of the Document and other documents
-released under this License, and replace the individual copies of this
-License in the various documents with a single copy that is included in
-the collection, provided that you follow the rules of this License for
-verbatim copying of each of the documents in all other respects.
-
-You may extract a single document from such a collection, and distribute
-it individually under this License, provided you insert a copy of this
-License into the extracted document, and follow this License in all
-other respects regarding verbatim copying of that document.
-
-@item
-AGGREGATION WITH INDEPENDENT WORKS
-
-A compilation of the Document or its derivatives with other separate
-and independent documents or works, in or on a volume of a storage or
-distribution medium, is called an ``aggregate'' if the copyright
-resulting from the compilation is not used to limit the legal rights
-of the compilation's users beyond what the individual works permit.
-When the Document is included an aggregate, this License does not
-apply to the other works in the aggregate which are not themselves
-derivative works of the Document.
-
-If the Cover Text requirement of section 3 is applicable to these
-copies of the Document, then if the Document is less than one half of
-the entire aggregate, the Document's Cover Texts may be placed on
-covers that bracket the Document within the aggregate, or the
-electronic equivalent of covers if the Document is in electronic form.
-Otherwise they must appear on printed covers that bracket the whole
-aggregate.
-
-@item
-TRANSLATION
-
-Translation is considered a kind of modification, so you may
-distribute translations of the Document under the terms of section 4.
-Replacing Invariant Sections with translations requires special
-permission from their copyright holders, but you may include
-translations of some or all Invariant Sections in addition to the
-original versions of these Invariant Sections.  You may include a
-translation of this License, and all the license notices in the
-Document, and any Warrany Disclaimers, provided that you also include
-the original English version of this License and the original versions
-of those notices and disclaimers.  In case of a disagreement between
-the translation and the original version of this License or a notice
-or disclaimer, the original version will prevail.
-
-If a section in the Document is Entitled ``Acknowledgements'',
-``Dedications'', or ``History'', the requirement (section 4) to Preserve
-its Title (section 1) will typically require changing the actual
-title.
-
-@item
-TERMINATION
-
-You may not copy, modify, sublicense, or distribute the Document except
-as expressly provided for under this License.  Any other attempt to
-copy, modify, sublicense or distribute the Document is void, and will
-automatically terminate your rights under this License.  However,
-parties who have received copies, or rights, from you under this
-License will not have their licenses terminated so long as such
-parties remain in full compliance.
-
-@item
-FUTURE REVISIONS OF THIS LICENSE
-
-The Free Software Foundation may publish new, revised versions
-of the GNU Free Documentation License from time to time.  Such new
-versions will be similar in spirit to the present version, but may
-differ in detail to address new problems or concerns.  See
-@uref{http://www.gnu.org/copyleft/}.
-
-Each version of the License is given a distinguishing version number.
-If the Document specifies that a particular numbered version of this
-License ``or any later version'' applies to it, you have the option of
-following the terms and conditions either of that specified version or
-of any later version that has been published (not as a draft) by the
-Free Software Foundation.  If the Document does not specify a version
-number of this License, you may choose any version ever published (not
-as a draft) by the Free Software Foundation.
-@end enumerate
-
-@page
-@appendixsubsec ADDENDUM: How to use this License for your documents
-
-To use this License in a document you have written, include a copy of
-the License in the document and put the following copyright and
-license notices just after the title page:
-
-@smallexample
-@group
-  Copyright (C)  @var{year}  @var{your name}.
-  Permission is granted to copy, distribute and/or modify this document
-  under the terms of the GNU Free Documentation License, Version 1.2
-  or any later version published by the Free Software Foundation;
-  with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.
-  A copy of the license is included in the section entitled ``GNU
-  Free Documentation License''.
-@end group
-@end smallexample
-
-If you have Invariant Sections, Front-Cover Texts and Back-Cover Texts,
-replace the ``with...Texts.'' line with this:
-
-@smallexample
-@group
-    with the Invariant Sections being @var{list their titles}, with
-    the Front-Cover Texts being @var{list}, and with the Back-Cover Texts
-    being @var{list}.
-@end group
-@end smallexample
-
-If you have Invariant Sections without Cover Texts, or some other
-combination of the three, merge those two alternatives to suit the
-situation.
-
-If your document contains nontrivial examples of program code, we
-recommend releasing these examples in parallel under your choice of
-free software license, such as the GNU General Public License,
-to permit their use in free software.
-
-@c Local Variables:
-@c ispell-local-pdict: "ispell-dict"
-@c End:
-
diff --git a/apps/autodist/doc/mdate-sh b/apps/autodist/doc/mdate-sh
deleted file mode 100755 (executable)
index b610b47..0000000
+++ /dev/null
@@ -1,133 +0,0 @@
-#!/bin/sh
-# Get modification time of a file or directory and pretty-print it.
-# Copyright (C) 1995, 1996, 1997, 2003  Free Software Foundation, Inc.
-# written by Ulrich Drepper <drepper@gnu.ai.mit.edu>, June 1995
-#
-# 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; either version 2, or (at your option)
-# any later version.
-#
-# 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.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software Foundation,
-# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-
-# As a special exception to the GNU General Public License, if you
-# distribute this file as part of a program that contains a
-# configuration script generated by Autoconf, you may include it under
-# the same distribution terms that you use for the rest of that program.
-
-# Prevent date giving response in another language.
-LANG=C
-export LANG
-LC_ALL=C
-export LC_ALL
-LC_TIME=C
-export LC_TIME
-
-save_arg1="$1"
-
-# Find out how to get the extended ls output of a file or directory.
-if ls -L /dev/null 1>/dev/null 2>&1; then
-  ls_command='ls -L -l -d'
-else
-  ls_command='ls -l -d'
-fi
-
-# A `ls -l' line looks as follows on OS/2.
-#  drwxrwx---        0 Aug 11  2001 foo
-# This differs from Unix, which adds ownership information.
-#  drwxrwx---   2 root  root      4096 Aug 11  2001 foo
-#
-# To find the date, we split the line on spaces and iterate on words
-# until we find a month.  This cannot work with files whose owner is a
-# user named `Jan', or `Feb', etc.  However, it's unlikely that `/'
-# will be owned by a user whose name is a month.  So we first look at
-# the extended ls output of the root directory to decide how many
-# words should be skipped to get the date.
-
-# On HPUX /bin/sh, "set" interprets "-rw-r--r--" as options, so the "x" below.
-set - x`$ls_command /`
-
-# Find which argument is the month.
-month=
-command=
-until test $month
-do
-  shift
-  # Add another shift to the command.
-  command="$command shift;"
-  case $1 in
-    Jan) month=January; nummonth=1;;
-    Feb) month=February; nummonth=2;;
-    Mar) month=March; nummonth=3;;
-    Apr) month=April; nummonth=4;;
-    May) month=May; nummonth=5;;
-    Jun) month=June; nummonth=6;;
-    Jul) month=July; nummonth=7;;
-    Aug) month=August; nummonth=8;;
-    Sep) month=September; nummonth=9;;
-    Oct) month=October; nummonth=10;;
-    Nov) month=November; nummonth=11;;
-    Dec) month=December; nummonth=12;;
-  esac
-done
-
-# Get the extended ls output of the file or directory.
-set - x`eval "$ls_command \"\$save_arg1\""`
-
-# Remove all preceding arguments
-eval $command
-
-# Get the month.  Next argument is day, followed by the year or time.
-case $1 in
-  Jan) month=January; nummonth=1;;
-  Feb) month=February; nummonth=2;;
-  Mar) month=March; nummonth=3;;
-  Apr) month=April; nummonth=4;;
-  May) month=May; nummonth=5;;
-  Jun) month=June; nummonth=6;;
-  Jul) month=July; nummonth=7;;
-  Aug) month=August; nummonth=8;;
-  Sep) month=September; nummonth=9;;
-  Oct) month=October; nummonth=10;;
-  Nov) month=November; nummonth=11;;
-  Dec) month=December; nummonth=12;;
-esac
-
-day=$2
-
-# Here we have to deal with the problem that the ls output gives either
-# the time of day or the year.
-case $3 in
-  *:*) set `date`; eval year=\$$#
-       case $2 in
-        Jan) nummonthtod=1;;
-        Feb) nummonthtod=2;;
-        Mar) nummonthtod=3;;
-        Apr) nummonthtod=4;;
-        May) nummonthtod=5;;
-        Jun) nummonthtod=6;;
-        Jul) nummonthtod=7;;
-        Aug) nummonthtod=8;;
-        Sep) nummonthtod=9;;
-        Oct) nummonthtod=10;;
-        Nov) nummonthtod=11;;
-        Dec) nummonthtod=12;;
-       esac
-       # For the first six month of the year the time notation can also
-       # be used for files modified in the last year.
-       if (expr $nummonth \> $nummonthtod) > /dev/null;
-       then
-        year=`expr $year - 1`
-       fi;;
-  *) year=$3;;
-esac
-
-# The result.
-echo $day $month $year
diff --git a/apps/autodist/doc/texinfo.tex b/apps/autodist/doc/texinfo.tex
deleted file mode 100644 (file)
index 54c170d..0000000
+++ /dev/null
@@ -1,6740 +0,0 @@
-% texinfo.tex -- TeX macros to handle Texinfo files.
-%
-% Load plain if necessary, i.e., if running under initex.
-\expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi
-%
-\def\texinfoversion{2003-10-16.18}
-%
-% Copyright (C) 1985, 1986, 1988, 1990, 1991, 1992, 1993, 1994, 1995,
-% 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
-%
-% This texinfo.tex file 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; either version 2, or (at
-% your option) any later version.
-%
-% This texinfo.tex file 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.
-%
-% You should have received a copy of the GNU General Public License
-% along with this texinfo.tex file; see the file COPYING.  If not, write
-% to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-% Boston, MA 02111-1307, USA.
-%
-% In other words, you are welcome to use, share and improve this program.
-% You are forbidden to forbid anyone else to use, share and improve
-% what you give them.   Help stamp out software-hoarding!
-%
-% Please try the latest version of texinfo.tex before submitting bug
-% reports; you can get the latest version from:
-%   ftp://ftp.gnu.org/gnu/texinfo/texinfo.tex
-%     (and all GNU mirrors, see http://www.gnu.org/order/ftp.html)
-%   ftp://tug.org/tex/texinfo.tex
-%     (and all CTAN mirrors, see http://www.ctan.org),
-%   and /home/gd/gnu/doc/texinfo.tex on the GNU machines.
-%
-% The GNU Texinfo home page is http://www.gnu.org/software/texinfo.
-%
-% The texinfo.tex in any given Texinfo distribution could well be out
-% of date, so if that's what you're using, please check.
-%
-% Send bug reports to bug-texinfo@gnu.org.  Please include including a
-% complete document in each bug report with which we can reproduce the
-% problem.  Patches are, of course, greatly appreciated.
-%
-% To process a Texinfo manual with TeX, it's most reliable to use the
-% texi2dvi shell script that comes with the distribution.  For a simple
-% manual foo.texi, however, you can get away with this:
-%   tex foo.texi
-%   texindex foo.??
-%   tex foo.texi
-%   tex foo.texi
-%   dvips foo.dvi -o  # or whatever; this makes foo.ps.
-% The extra TeX runs get the cross-reference information correct.
-% Sometimes one run after texindex suffices, and sometimes you need more
-% than two; texi2dvi does it as many times as necessary.
-%
-% It is possible to adapt texinfo.tex for other languages, to some
-% extent.  You can get the existing language-specific files from the
-% full Texinfo distribution.
-
-\message{Loading texinfo [version \texinfoversion]:}
-
-% If in a .fmt file, print the version number
-% and turn on active characters that we couldn't do earlier because
-% they might have appeared in the input file name.
-\everyjob{\message{[Texinfo version \texinfoversion]}%
-  \catcode`+=\active \catcode`\_=\active}
-
-\message{Basics,}
-\chardef\other=12
-
-% We never want plain's \outer definition of \+ in Texinfo.
-% For @tex, we can use \tabalign.
-\let\+ = \relax
-
-% Save some plain tex macros whose names we will redefine.
-\let\ptexb=\b
-\let\ptexbullet=\bullet
-\let\ptexc=\c
-\let\ptexcomma=\,
-\let\ptexdot=\.
-\let\ptexdots=\dots
-\let\ptexend=\end
-\let\ptexequiv=\equiv
-\let\ptexexclam=\!
-\let\ptexgtr=>
-\let\ptexhat=^
-\let\ptexi=\i
-\let\ptexindent=\indent
-\let\ptexnoindent=\noindent
-\let\ptexlbrace=\{
-\let\ptexless=<
-\let\ptexplus=+
-\let\ptexrbrace=\}
-\let\ptexslash=\/
-\let\ptexstar=\*
-\let\ptext=\t
-
-% If this character appears in an error message or help string, it
-% starts a new line in the output.
-\newlinechar = `^^J
-
-% Set up fixed words for English if not already set.
-\ifx\putwordAppendix\undefined  \gdef\putwordAppendix{Appendix}\fi
-\ifx\putwordChapter\undefined   \gdef\putwordChapter{Chapter}\fi
-\ifx\putwordfile\undefined      \gdef\putwordfile{file}\fi
-\ifx\putwordin\undefined        \gdef\putwordin{in}\fi
-\ifx\putwordIndexIsEmpty\undefined     \gdef\putwordIndexIsEmpty{(Index is empty)}\fi
-\ifx\putwordIndexNonexistent\undefined \gdef\putwordIndexNonexistent{(Index is nonexistent)}\fi
-\ifx\putwordInfo\undefined      \gdef\putwordInfo{Info}\fi
-\ifx\putwordInstanceVariableof\undefined \gdef\putwordInstanceVariableof{Instance Variable of}\fi
-\ifx\putwordMethodon\undefined  \gdef\putwordMethodon{Method on}\fi
-\ifx\putwordNoTitle\undefined   \gdef\putwordNoTitle{No Title}\fi
-\ifx\putwordof\undefined        \gdef\putwordof{of}\fi
-\ifx\putwordon\undefined        \gdef\putwordon{on}\fi
-\ifx\putwordpage\undefined      \gdef\putwordpage{page}\fi
-\ifx\putwordsection\undefined   \gdef\putwordsection{section}\fi
-\ifx\putwordSection\undefined   \gdef\putwordSection{Section}\fi
-\ifx\putwordsee\undefined       \gdef\putwordsee{see}\fi
-\ifx\putwordSee\undefined       \gdef\putwordSee{See}\fi
-\ifx\putwordShortTOC\undefined  \gdef\putwordShortTOC{Short Contents}\fi
-\ifx\putwordTOC\undefined       \gdef\putwordTOC{Table of Contents}\fi
-%
-\ifx\putwordMJan\undefined \gdef\putwordMJan{January}\fi
-\ifx\putwordMFeb\undefined \gdef\putwordMFeb{February}\fi
-\ifx\putwordMMar\undefined \gdef\putwordMMar{March}\fi
-\ifx\putwordMApr\undefined \gdef\putwordMApr{April}\fi
-\ifx\putwordMMay\undefined \gdef\putwordMMay{May}\fi
-\ifx\putwordMJun\undefined \gdef\putwordMJun{June}\fi
-\ifx\putwordMJul\undefined \gdef\putwordMJul{July}\fi
-\ifx\putwordMAug\undefined \gdef\putwordMAug{August}\fi
-\ifx\putwordMSep\undefined \gdef\putwordMSep{September}\fi
-\ifx\putwordMOct\undefined \gdef\putwordMOct{October}\fi
-\ifx\putwordMNov\undefined \gdef\putwordMNov{November}\fi
-\ifx\putwordMDec\undefined \gdef\putwordMDec{December}\fi
-%
-\ifx\putwordDefmac\undefined    \gdef\putwordDefmac{Macro}\fi
-\ifx\putwordDefspec\undefined   \gdef\putwordDefspec{Special Form}\fi
-\ifx\putwordDefvar\undefined    \gdef\putwordDefvar{Variable}\fi
-\ifx\putwordDefopt\undefined    \gdef\putwordDefopt{User Option}\fi
-\ifx\putwordDeftypevar\undefined\gdef\putwordDeftypevar{Variable}\fi
-\ifx\putwordDeffunc\undefined   \gdef\putwordDeffunc{Function}\fi
-\ifx\putwordDeftypefun\undefined\gdef\putwordDeftypefun{Function}\fi
-
-% In some macros, we cannot use the `\? notation---the left quote is
-% in some cases the escape char.
-\chardef\colonChar = `\:
-\chardef\commaChar = `\,
-\chardef\dotChar   = `\.
-\chardef\equalChar = `\=
-\chardef\exclamChar= `\!
-\chardef\questChar = `\?
-\chardef\semiChar  = `\;
-\chardef\spaceChar = `\ %
-\chardef\underChar = `\_
-
-% Ignore a token.
-%
-\def\gobble#1{}
-
-% Hyphenation fixes.
-\hyphenation{ap-pen-dix}
-\hyphenation{eshell}
-\hyphenation{mini-buf-fer mini-buf-fers}
-\hyphenation{time-stamp}
-\hyphenation{white-space}
-
-% Margin to add to right of even pages, to left of odd pages.
-\newdimen\bindingoffset
-\newdimen\normaloffset
-\newdimen\pagewidth \newdimen\pageheight
-
-% Sometimes it is convenient to have everything in the transcript file
-% and nothing on the terminal.  We don't just call \tracingall here,
-% since that produces some useless output on the terminal.  We also make
-% some effort to order the tracing commands to reduce output in the log
-% file; cf. trace.sty in LaTeX.
-%
-\def\gloggingall{\begingroup \globaldefs = 1 \loggingall \endgroup}%
-\def\loggingall{%
-  \tracingstats2
-  \tracingpages1
-  \tracinglostchars2  % 2 gives us more in etex
-  \tracingparagraphs1
-  \tracingoutput1
-  \tracingmacros2
-  \tracingrestores1
-  \showboxbreadth\maxdimen \showboxdepth\maxdimen
-  \ifx\eTeXversion\undefined\else % etex gives us more logging
-    \tracingscantokens1
-    \tracingifs1
-    \tracinggroups1
-    \tracingnesting2
-    \tracingassigns1
-  \fi
-  \tracingcommands3  % 3 gives us more in etex
-  \errorcontextlines\maxdimen
-}%
-
-% add check for \lastpenalty to plain's definitions.  If the last thing
-% we did was a \nobreak, we don't want to insert more space.
-%
-\def\smallbreak{\ifnum\lastpenalty<10000\par\ifdim\lastskip<\smallskipamount
-  \removelastskip\penalty-50\smallskip\fi\fi}
-\def\medbreak{\ifnum\lastpenalty<10000\par\ifdim\lastskip<\medskipamount
-  \removelastskip\penalty-100\medskip\fi\fi}
-\def\bigbreak{\ifnum\lastpenalty<10000\par\ifdim\lastskip<\bigskipamount
-  \removelastskip\penalty-200\bigskip\fi\fi}
-
-% For @cropmarks command.
-% Do @cropmarks to get crop marks.
-%
-\newif\ifcropmarks
-\let\cropmarks = \cropmarkstrue
-%
-% Dimensions to add cropmarks at corners.
-% Added by P. A. MacKay, 12 Nov. 1986
-%
-\newdimen\outerhsize \newdimen\outervsize % set by the paper size routines
-\newdimen\cornerlong  \cornerlong=1pc
-\newdimen\cornerthick \cornerthick=.3pt
-\newdimen\topandbottommargin \topandbottommargin=.75in
-
-% Main output routine.
-\chardef\PAGE = 255
-\output = {\onepageout{\pagecontents\PAGE}}
-
-\newbox\headlinebox
-\newbox\footlinebox
-
-% \onepageout takes a vbox as an argument.  Note that \pagecontents
-% does insertions, but you have to call it yourself.
-\def\onepageout#1{%
-  \ifcropmarks \hoffset=0pt \else \hoffset=\normaloffset \fi
-  %
-  \ifodd\pageno  \advance\hoffset by \bindingoffset
-  \else \advance\hoffset by -\bindingoffset\fi
-  %
-  % Do this outside of the \shipout so @code etc. will be expanded in
-  % the headline as they should be, not taken literally (outputting ''code).
-  \setbox\headlinebox = \vbox{\let\hsize=\pagewidth \makeheadline}%
-  \setbox\footlinebox = \vbox{\let\hsize=\pagewidth \makefootline}%
-  %
-  {%
-    % Have to do this stuff outside the \shipout because we want it to
-    % take effect in \write's, yet the group defined by the \vbox ends
-    % before the \shipout runs.
-    %
-    \escapechar = `\\     % use backslash in output files.
-    \indexdummies         % don't expand commands in the output.
-    \normalturnoffactive  % \ in index entries must not stay \, e.g., if
-                   % the page break happens to be in the middle of an example.
-    \shipout\vbox{%
-      % Do this early so pdf references go to the beginning of the page.
-      \ifpdfmakepagedest \pdfdest name{\the\pageno} xyz\fi
-      %
-      \ifcropmarks \vbox to \outervsize\bgroup
-        \hsize = \outerhsize
-        \vskip-\topandbottommargin
-        \vtop to0pt{%
-          \line{\ewtop\hfil\ewtop}%
-          \nointerlineskip
-          \line{%
-            \vbox{\moveleft\cornerthick\nstop}%
-            \hfill
-            \vbox{\moveright\cornerthick\nstop}%
-          }%
-          \vss}%
-        \vskip\topandbottommargin
-        \line\bgroup
-          \hfil % center the page within the outer (page) hsize.
-          \ifodd\pageno\hskip\bindingoffset\fi
-          \vbox\bgroup
-      \fi
-      %
-      \unvbox\headlinebox
-      \pagebody{#1}%
-      \ifdim\ht\footlinebox > 0pt
-        % Only leave this space if the footline is nonempty.
-        % (We lessened \vsize for it in \oddfootingxxx.)
-        % The \baselineskip=24pt in plain's \makefootline has no effect.
-        \vskip 2\baselineskip
-        \unvbox\footlinebox
-      \fi
-      %
-      \ifcropmarks
-          \egroup % end of \vbox\bgroup
-        \hfil\egroup % end of (centering) \line\bgroup
-        \vskip\topandbottommargin plus1fill minus1fill
-        \boxmaxdepth = \cornerthick
-        \vbox to0pt{\vss
-          \line{%
-            \vbox{\moveleft\cornerthick\nsbot}%
-            \hfill
-            \vbox{\moveright\cornerthick\nsbot}%
-          }%
-          \nointerlineskip
-          \line{\ewbot\hfil\ewbot}%
-        }%
-      \egroup % \vbox from first cropmarks clause
-      \fi
-    }% end of \shipout\vbox
-  }% end of group with \normalturnoffactive
-  \advancepageno
-  \ifnum\outputpenalty>-20000 \else\dosupereject\fi
-}
-
-\newinsert\margin \dimen\margin=\maxdimen
-
-\def\pagebody#1{\vbox to\pageheight{\boxmaxdepth=\maxdepth #1}}
-{\catcode`\@ =11
-\gdef\pagecontents#1{\ifvoid\topins\else\unvbox\topins\fi
-% marginal hacks, juha@viisa.uucp (Juha Takala)
-\ifvoid\margin\else % marginal info is present
-  \rlap{\kern\hsize\vbox to\z@{\kern1pt\box\margin \vss}}\fi
-\dimen@=\dp#1 \unvbox#1
-\ifvoid\footins\else\vskip\skip\footins\footnoterule \unvbox\footins\fi
-\ifr@ggedbottom \kern-\dimen@ \vfil \fi}
-}
-
-% Here are the rules for the cropmarks.  Note that they are
-% offset so that the space between them is truly \outerhsize or \outervsize
-% (P. A. MacKay, 12 November, 1986)
-%
-\def\ewtop{\vrule height\cornerthick depth0pt width\cornerlong}
-\def\nstop{\vbox
-  {\hrule height\cornerthick depth\cornerlong width\cornerthick}}
-\def\ewbot{\vrule height0pt depth\cornerthick width\cornerlong}
-\def\nsbot{\vbox
-  {\hrule height\cornerlong depth\cornerthick width\cornerthick}}
-
-% Parse an argument, then pass it to #1.  The argument is the rest of
-% the input line (except we remove a trailing comment).  #1 should be a
-% macro which expects an ordinary undelimited TeX argument.
-%
-\def\parsearg#1{%
-  \let\next = #1%
-  \begingroup
-    \obeylines
-    \futurelet\temp\parseargx
-}
-
-% If the next token is an obeyed space (from an @example environment or
-% the like), remove it and recurse.  Otherwise, we're done.
-\def\parseargx{%
-  % \obeyedspace is defined far below, after the definition of \sepspaces.
-  \ifx\obeyedspace\temp
-    \expandafter\parseargdiscardspace
-  \else
-    \expandafter\parseargline
-  \fi
-}
-
-% Remove a single space (as the delimiter token to the macro call).
-{\obeyspaces %
- \gdef\parseargdiscardspace {\futurelet\temp\parseargx}}
-
-{\obeylines %
-  \gdef\parseargline#1^^M{%
-    \endgroup % End of the group started in \parsearg.
-    %
-    % First remove any @c comment, then any @comment.
-    % Result of each macro is put in \toks0.
-    \argremovec #1\c\relax %
-    \expandafter\argremovecomment \the\toks0 \comment\relax %
-    %
-    % Call the caller's macro, saved as \next in \parsearg.
-    \expandafter\next\expandafter{\the\toks0}%
-  }%
-}
-
-% Since all \c{,omment} does is throw away the argument, we can let TeX
-% do that for us.  The \relax here is matched by the \relax in the call
-% in \parseargline; it could be more or less anything, its purpose is
-% just to delimit the argument to the \c.
-\def\argremovec#1\c#2\relax{\toks0 = {#1}}
-\def\argremovecomment#1\comment#2\relax{\toks0 = {#1}}
-
-% \argremovec{,omment} might leave us with trailing spaces, though; e.g.,
-%    @end itemize  @c foo
-% will have two active spaces as part of the argument with the
-% `itemize'.  Here we remove all active spaces from #1, and assign the
-% result to \toks0.
-%
-% This loses if there are any *other* active characters besides spaces
-% in the argument -- _ ^ +, for example -- since they get expanded.
-% Fortunately, Texinfo does not define any such commands.  (If it ever
-% does, the catcode of the characters in questionwill have to be changed
-% here.)  But this means we cannot call \removeactivespaces as part of
-% \argremovec{,omment}, since @c uses \parsearg, and thus the argument
-% that \parsearg gets might well have any character at all in it.
-%
-\def\removeactivespaces#1{%
-  \begingroup
-    \ignoreactivespaces
-    \edef\temp{#1}%
-    \global\toks0 = \expandafter{\temp}%
-  \endgroup
-}
-
-% Change the active space to expand to nothing.
-%
-\begingroup
-  \obeyspaces
-  \gdef\ignoreactivespaces{\obeyspaces\let =\empty}
-\endgroup
-
-
-\def\flushcr{\ifx\par\lisppar \def\next##1{}\else \let\next=\relax \fi \next}
-
-%% These are used to keep @begin/@end levels from running away
-%% Call \inENV within environments (after a \begingroup)
-\newif\ifENV \ENVfalse \def\inENV{\ifENV\relax\else\ENVtrue\fi}
-\def\ENVcheck{%
-\ifENV\errmessage{Still within an environment; press RETURN to continue}
-\endgroup\fi} % This is not perfect, but it should reduce lossage
-
-% @begin foo  is the same as @foo, for now.
-\newhelp\EMsimple{Press RETURN to continue.}
-
-\outer\def\begin{\parsearg\beginxxx}
-
-\def\beginxxx #1{%
-\expandafter\ifx\csname #1\endcsname\relax
-{\errhelp=\EMsimple \errmessage{Undefined command @begin #1}}\else
-\csname #1\endcsname\fi}
-
-% @end foo executes the definition of \Efoo.
-%
-\def\end{\parsearg\endxxx}
-\def\endxxx #1{%
-  \removeactivespaces{#1}%
-  \edef\endthing{\the\toks0}%
-  %
-  \expandafter\ifx\csname E\endthing\endcsname\relax
-    \expandafter\ifx\csname \endthing\endcsname\relax
-      % There's no \foo, i.e., no ``environment'' foo.
-      \errhelp = \EMsimple
-      \errmessage{Undefined command `@end \endthing'}%
-    \else
-      \unmatchedenderror\endthing
-    \fi
-  \else
-    % Everything's ok; the right environment has been started.
-    \csname E\endthing\endcsname
-  \fi
-}
-
-% There is an environment #1, but it hasn't been started.  Give an error.
-%
-\def\unmatchedenderror#1{%
-  \errhelp = \EMsimple
-  \errmessage{This `@end #1' doesn't have a matching `@#1'}%
-}
-
-% Define the control sequence \E#1 to give an unmatched @end error.
-%
-\def\defineunmatchedend#1{%
-  \expandafter\def\csname E#1\endcsname{\unmatchedenderror{#1}}%
-}
-
-
-%% Simple single-character @ commands
-
-% @@ prints an @
-% Kludge this until the fonts are right (grr).
-\def\@{{\tt\char64}}
-
-% This is turned off because it was never documented
-% and you can use @w{...} around a quote to suppress ligatures.
-%% Define @` and @' to be the same as ` and '
-%% but suppressing ligatures.
-%\def\`{{`}}
-%\def\'{{'}}
-
-% Used to generate quoted braces.
-\def\mylbrace {{\tt\char123}}
-\def\myrbrace {{\tt\char125}}
-\let\{=\mylbrace
-\let\}=\myrbrace
-\begingroup
-  % Definitions to produce \{ and \} commands for indices,
-  % and @{ and @} for the aux file.
-  \catcode`\{ = \other \catcode`\} = \other
-  \catcode`\[ = 1 \catcode`\] = 2
-  \catcode`\! = 0 \catcode`\\ = \other
-  !gdef!lbracecmd[\{]%
-  !gdef!rbracecmd[\}]%
-  !gdef!lbraceatcmd[@{]%
-  !gdef!rbraceatcmd[@}]%
-!endgroup
-
-% Accents: @, @dotaccent @ringaccent @ubaraccent @udotaccent
-% Others are defined by plain TeX: @` @' @" @^ @~ @= @u @v @H.
-\let\, = \c
-\let\dotaccent = \.
-\def\ringaccent#1{{\accent23 #1}}
-\let\tieaccent = \t
-\let\ubaraccent = \b
-\let\udotaccent = \d
-
-% Other special characters: @questiondown @exclamdown
-% Plain TeX defines: @AA @AE @O @OE @L (plus lowercase versions) @ss.
-\def\questiondown{?`}
-\def\exclamdown{!`}
-
-% Dotless i and dotless j, used for accents.
-\def\imacro{i}
-\def\jmacro{j}
-\def\dotless#1{%
-  \def\temp{#1}%
-  \ifx\temp\imacro \ptexi
-  \else\ifx\temp\jmacro \j
-  \else \errmessage{@dotless can be used only with i or j}%
-  \fi\fi
-}
-
-% Be sure we're in horizontal mode when doing a tie, since we make space
-% equivalent to this in @example-like environments. Otherwise, a space
-% at the beginning of a line will start with \penalty -- and
-% since \penalty is valid in vertical mode, we'd end up putting the
-% penalty on the vertical list instead of in the new paragraph.
-{\catcode`@ = 11
- % Avoid using \@M directly, because that causes trouble
- % if the definition is written into an index file.
- \global\let\tiepenalty = \@M
- \gdef\tie{\leavevmode\penalty\tiepenalty\ }
-}
-
-% @: forces normal size whitespace following.
-\def\:{\spacefactor=1000 }
-
-% @* forces a line break.
-\def\*{\hfil\break\hbox{}\ignorespaces}
-
-% @/ allows a line break.
-\let\/=\allowbreak
-
-% @. is an end-of-sentence period.
-\def\.{.\spacefactor=3000 }
-
-% @! is an end-of-sentence bang.
-\def\!{!\spacefactor=3000 }
-
-% @? is an end-of-sentence query.
-\def\?{?\spacefactor=3000 }
-
-% @w prevents a word break.  Without the \leavevmode, @w at the
-% beginning of a paragraph, when TeX is still in vertical mode, would
-% produce a whole line of output instead of starting the paragraph.
-\def\w#1{\leavevmode\hbox{#1}}
-
-% @group ... @end group forces ... to be all on one page, by enclosing
-% it in a TeX vbox.  We use \vtop instead of \vbox to construct the box
-% to keep its height that of a normal line.  According to the rules for
-% \topskip (p.114 of the TeXbook), the glue inserted is
-% max (\topskip - \ht (first item), 0).  If that height is large,
-% therefore, no glue is inserted, and the space between the headline and
-% the text is small, which looks bad.
-%
-% Another complication is that the group might be very large.  This can
-% cause the glue on the previous page to be unduly stretched, because it
-% does not have much material.  In this case, it's better to add an
-% explicit \vfill so that the extra space is at the bottom.  The
-% threshold for doing this is if the group is more than \vfilllimit
-% percent of a page (\vfilllimit can be changed inside of @tex).
-%
-\newbox\groupbox
-\def\vfilllimit{0.7}
-%
-\def\group{\begingroup
-  \ifnum\catcode13=\active \else
-    \errhelp = \groupinvalidhelp
-    \errmessage{@group invalid in context where filling is enabled}%
-  \fi
-  %
-  % The \vtop we start below produces a box with normal height and large
-  % depth; thus, TeX puts \baselineskip glue before it, and (when the
-  % next line of text is done) \lineskip glue after it.  (See p.82 of
-  % the TeXbook.)  Thus, space below is not quite equal to space
-  % above.  But it's pretty close.
-  \def\Egroup{%
-    \egroup           % End the \vtop.
-    % \dimen0 is the vertical size of the group's box.
-    \dimen0 = \ht\groupbox  \advance\dimen0 by \dp\groupbox
-    % \dimen2 is how much space is left on the page (more or less).
-    \dimen2 = \pageheight   \advance\dimen2 by -\pagetotal
-    % if the group doesn't fit on the current page, and it's a big big
-    % group, force a page break.
-    \ifdim \dimen0 > \dimen2
-      \ifdim \pagetotal < \vfilllimit\pageheight
-        \page
-      \fi
-    \fi
-    \copy\groupbox
-    \endgroup         % End the \group.
-  }%
-  %
-  \setbox\groupbox = \vtop\bgroup
-    % We have to put a strut on the last line in case the @group is in
-    % the midst of an example, rather than completely enclosing it.
-    % Otherwise, the interline space between the last line of the group
-    % and the first line afterwards is too small.  But we can't put the
-    % strut in \Egroup, since there it would be on a line by itself.
-    % Hence this just inserts a strut at the beginning of each line.
-    \everypar = {\strut}%
-    %
-    % Since we have a strut on every line, we don't need any of TeX's
-    % normal interline spacing.
-    \offinterlineskip
-    %
-    % OK, but now we have to do something about blank
-    % lines in the input in @example-like environments, which normally
-    % just turn into \lisppar, which will insert no space now that we've
-    % turned off the interline space.  Simplest is to make them be an
-    % empty paragraph.
-    \ifx\par\lisppar
-      \edef\par{\leavevmode \par}%
-      %
-      % Reset ^^M's definition to new definition of \par.
-      \obeylines
-    \fi
-    %
-    % Do @comment since we are called inside an environment such as
-    % @example, where each end-of-line in the input causes an
-    % end-of-line in the output.  We don't want the end-of-line after
-    % the `@group' to put extra space in the output.  Since @group
-    % should appear on a line by itself (according to the Texinfo
-    % manual), we don't worry about eating any user text.
-    \comment
-}
-%
-% TeX puts in an \escapechar (i.e., `@') at the beginning of the help
-% message, so this ends up printing `@group can only ...'.
-%
-\newhelp\groupinvalidhelp{%
-group can only be used in environments such as @example,^^J%
-where each line of input produces a line of output.}
-
-% @need space-in-mils
-% forces a page break if there is not space-in-mils remaining.
-
-\newdimen\mil  \mil=0.001in
-
-\def\need{\parsearg\needx}
-
-% Old definition--didn't work.
-%\def\needx #1{\par %
-%% This method tries to make TeX break the page naturally
-%% if the depth of the box does not fit.
-%{\baselineskip=0pt%
-%\vtop to #1\mil{\vfil}\kern -#1\mil\nobreak
-%\prevdepth=-1000pt
-%}}
-
-\def\needx#1{%
-  % Ensure vertical mode, so we don't make a big box in the middle of a
-  % paragraph.
-  \par
-  %
-  % If the @need value is less than one line space, it's useless.
-  \dimen0 = #1\mil
-  \dimen2 = \ht\strutbox
-  \advance\dimen2 by \dp\strutbox
-  \ifdim\dimen0 > \dimen2
-    %
-    % Do a \strut just to make the height of this box be normal, so the
-    % normal leading is inserted relative to the preceding line.
-    % And a page break here is fine.
-    \vtop to #1\mil{\strut\vfil}%
-    %
-    % TeX does not even consider page breaks if a penalty added to the
-    % main vertical list is 10000 or more.  But in order to see if the
-    % empty box we just added fits on the page, we must make it consider
-    % page breaks.  On the other hand, we don't want to actually break the
-    % page after the empty box.  So we use a penalty of 9999.
-    %
-    % There is an extremely small chance that TeX will actually break the
-    % page at this \penalty, if there are no other feasible breakpoints in
-    % sight.  (If the user is using lots of big @group commands, which
-    % almost-but-not-quite fill up a page, TeX will have a hard time doing
-    % good page breaking, for example.)  However, I could not construct an
-    % example where a page broke at this \penalty; if it happens in a real
-    % document, then we can reconsider our strategy.
-    \penalty9999
-    %
-    % Back up by the size of the box, whether we did a page break or not.
-    \kern -#1\mil
-    %
-    % Do not allow a page break right after this kern.
-    \nobreak
-  \fi
-}
-
-% @br   forces paragraph break
-
-\let\br = \par
-
-% @dots{} output an ellipsis using the current font.
-% We do .5em per period so that it has the same spacing in a typewriter
-% font as three actual period characters.
-%
-\def\dots{%
-  \leavevmode
-  \hbox to 1.5em{%
-    \hskip 0pt plus 0.25fil minus 0.25fil
-    .\hss.\hss.%
-    \hskip 0pt plus 0.5fil minus 0.5fil
-  }%
-}
-
-% @enddots{} is an end-of-sentence ellipsis.
-%
-\def\enddots{%
-  \leavevmode
-  \hbox to 2em{%
-    \hskip 0pt plus 0.25fil minus 0.25fil
-    .\hss.\hss.\hss.%
-    \hskip 0pt plus 0.5fil minus 0.5fil
-  }%
-  \spacefactor=3000
-}
-
-% @page forces the start of a new page.
-%
-\def\page{\par\vfill\supereject}
-
-% @exdent text....
-% outputs text on separate line in roman font, starting at standard page margin
-
-% This records the amount of indent in the innermost environment.
-% That's how much \exdent should take out.
-\newskip\exdentamount
-
-% This defn is used inside fill environments such as @defun.
-\def\exdent{\parsearg\exdentyyy}
-\def\exdentyyy #1{{\hfil\break\hbox{\kern -\exdentamount{\rm#1}}\hfil\break}}
-
-% This defn is used inside nofill environments such as @example.
-\def\nofillexdent{\parsearg\nofillexdentyyy}
-\def\nofillexdentyyy #1{{\advance \leftskip by -\exdentamount
-\leftline{\hskip\leftskip{\rm#1}}}}
-
-% @inmargin{WHICH}{TEXT} puts TEXT in the WHICH margin next to the current
-% paragraph.  For more general purposes, use the \margin insertion
-% class.  WHICH is `l' or `r'.
-%
-\newskip\inmarginspacing \inmarginspacing=1cm
-\def\strutdepth{\dp\strutbox}
-%
-\def\doinmargin#1#2{\strut\vadjust{%
-  \nobreak
-  \kern-\strutdepth
-  \vtop to \strutdepth{%
-    \baselineskip=\strutdepth
-    \vss
-    % if you have multiple lines of stuff to put here, you'll need to
-    % make the vbox yourself of the appropriate size.
-    \ifx#1l%
-      \llap{\ignorespaces #2\hskip\inmarginspacing}%
-    \else
-      \rlap{\hskip\hsize \hskip\inmarginspacing \ignorespaces #2}%
-    \fi
-    \null
-  }%
-}}
-\def\inleftmargin{\doinmargin l}
-\def\inrightmargin{\doinmargin r}
-%
-% @inmargin{TEXT [, RIGHT-TEXT]}
-% (if RIGHT-TEXT is given, use TEXT for left page, RIGHT-TEXT for right;
-% else use TEXT for both).
-%
-\def\inmargin#1{\parseinmargin #1,,\finish}
-\def\parseinmargin#1,#2,#3\finish{% not perfect, but better than nothing.
-  \setbox0 = \hbox{\ignorespaces #2}%
-  \ifdim\wd0 > 0pt
-    \def\lefttext{#1}%  have both texts
-    \def\righttext{#2}%
-  \else
-    \def\lefttext{#1}%  have only one text
-    \def\righttext{#1}%
-  \fi
-  %
-  \ifodd\pageno
-    \def\temp{\inrightmargin\righttext}% odd page -> outside is right margin
-  \else
-    \def\temp{\inleftmargin\lefttext}%
-  \fi
-  \temp
-}
-
-% @include file    insert text of that file as input.
-% Allow normal characters that  we make active in the argument (a file name).
-\def\include{\begingroup
-  \catcode`\\=\other
-  \catcode`~=\other
-  \catcode`^=\other
-  \catcode`_=\other
-  \catcode`|=\other
-  \catcode`<=\other
-  \catcode`>=\other
-  \catcode`+=\other
-  \parsearg\includezzz}
-% Restore active chars for included file.
-\def\includezzz#1{\endgroup\begingroup
-  % Read the included file in a group so nested @include's work.
-  \def\thisfile{#1}%
-  \let\value=\expandablevalue
-  \input\thisfile
-\endgroup}
-
-\def\thisfile{}
-
-% @center line
-% outputs that line, centered.
-%
-\def\center{\parsearg\docenter}
-\def\docenter#1{{%
-  \ifhmode \hfil\break \fi
-  \advance\hsize by -\leftskip
-  \advance\hsize by -\rightskip
-  \line{\hfil \ignorespaces#1\unskip \hfil}%
-  \ifhmode \break \fi
-}}
-
-% @sp n   outputs n lines of vertical space
-
-\def\sp{\parsearg\spxxx}
-\def\spxxx #1{\vskip #1\baselineskip}
-
-% @comment ...line which is ignored...
-% @c is the same as @comment
-% @ignore ... @end ignore  is another way to write a comment
-
-\def\comment{\begingroup \catcode`\^^M=\other%
-\catcode`\@=\other \catcode`\{=\other \catcode`\}=\other%
-\commentxxx}
-{\catcode`\^^M=\other \gdef\commentxxx#1^^M{\endgroup}}
-
-\let\c=\comment
-
-% @paragraphindent NCHARS
-% We'll use ems for NCHARS, close enough.
-% NCHARS can also be the word `asis' or `none'.
-% We cannot feasibly implement @paragraphindent asis, though.
-%
-\def\asisword{asis} % no translation, these are keywords
-\def\noneword{none}
-%
-\def\paragraphindent{\parsearg\doparagraphindent}
-\def\doparagraphindent#1{%
-  \def\temp{#1}%
-  \ifx\temp\asisword
-  \else
-    \ifx\temp\noneword
-      \defaultparindent = 0pt
-    \else
-      \defaultparindent = #1em
-    \fi
-  \fi
-  \parindent = \defaultparindent
-}
-
-% @exampleindent NCHARS
-% We'll use ems for NCHARS like @paragraphindent.
-% It seems @exampleindent asis isn't necessary, but
-% I preserve it to make it similar to @paragraphindent.
-\def\exampleindent{\parsearg\doexampleindent}
-\def\doexampleindent#1{%
-  \def\temp{#1}%
-  \ifx\temp\asisword
-  \else
-    \ifx\temp\noneword
-      \lispnarrowing = 0pt
-    \else
-      \lispnarrowing = #1em
-    \fi
-  \fi
-}
-
-% @firstparagraphindent WORD
-% If WORD is `none', then suppress indentation of the first paragraph
-% after a section heading.  If WORD is `insert', then do indent at such
-% paragraphs.
-%
-% The paragraph indentation is suppressed or not by calling
-% \suppressfirstparagraphindent, which the sectioning commands do.
-% We switch the definition of this back and forth according to WORD.
-% By default, we suppress indentation.
-%
-\def\suppressfirstparagraphindent{\dosuppressfirstparagraphindent}
-\newdimen\currentparindent
-%
-\def\insertword{insert}
-%
-\def\firstparagraphindent{\parsearg\dofirstparagraphindent}
-\def\dofirstparagraphindent#1{%
-  \def\temp{#1}%
-  \ifx\temp\noneword
-    \let\suppressfirstparagraphindent = \dosuppressfirstparagraphindent
-  \else\ifx\temp\insertword
-    \let\suppressfirstparagraphindent = \relax
-  \else
-    \errhelp = \EMsimple
-    \errmessage{Unknown @firstparagraphindent option `\temp'}%
-  \fi\fi
-}
-
-% Here is how we actually suppress indentation.  Redefine \everypar to
-% \kern backwards by \parindent, and then reset itself to empty.
-%
-% We also make \indent itself not actually do anything until the next
-% paragraph.
-%
-\gdef\dosuppressfirstparagraphindent{%
-  \gdef\indent{%
-    \restorefirstparagraphindent
-    \indent
-  }%
-  \gdef\noindent{%
-    \restorefirstparagraphindent
-    \noindent
-  }%
-  \global\everypar = {%
-    \kern -\parindent
-    \restorefirstparagraphindent
-  }%
-}
-
-\gdef\restorefirstparagraphindent{%
-  \global \let \indent = \ptexindent
-  \global \let \noindent = \ptexnoindent
-  \global \everypar = {}%
-}
-
-
-% @asis just yields its argument.  Used with @table, for example.
-%
-\def\asis#1{#1}
-
-% @math outputs its argument in math mode.
-% We don't use $'s directly in the definition of \math because we need
-% to set catcodes according to plain TeX first, to allow for subscripts,
-% superscripts, special math chars, etc.
-%
-\let\implicitmath = $%$ font-lock fix
-%
-% One complication: _ usually means subscripts, but it could also mean
-% an actual _ character, as in @math{@var{some_variable} + 1}.  So make
-% _ within @math be active (mathcode "8000), and distinguish by seeing
-% if the current family is \slfam, which is what @var uses.
-%
-{\catcode\underChar = \active
-\gdef\mathunderscore{%
-  \catcode\underChar=\active
-  \def_{\ifnum\fam=\slfam \_\else\sb\fi}%
-}}
-%
-% Another complication: we want \\ (and @\) to output a \ character.
-% FYI, plain.tex uses \\ as a temporary control sequence (why?), but
-% this is not advertised and we don't care.  Texinfo does not
-% otherwise define @\.
-%
-% The \mathchar is class=0=ordinary, family=7=ttfam, position=5C=\.
-\def\mathbackslash{\ifnum\fam=\ttfam \mathchar"075C \else\backslash \fi}
-%
-\def\math{%
-  \tex
-  \mathcode`\_="8000 \mathunderscore
-  \let\\ = \mathbackslash
-  \mathactive
-  \implicitmath\finishmath}
-\def\finishmath#1{#1\implicitmath\Etex}
-
-% Some active characters (such as <) are spaced differently in math.
-% We have to reset their definitions in case the @math was an
-% argument to a command which set the catcodes (such as @item or @section).
-%
-{
-  \catcode`^ = \active
-  \catcode`< = \active
-  \catcode`> = \active
-  \catcode`+ = \active
-  \gdef\mathactive{%
-    \let^ = \ptexhat
-    \let< = \ptexless
-    \let> = \ptexgtr
-    \let+ = \ptexplus
-  }
-}
-
-% @bullet and @minus need the same treatment as @math, just above.
-\def\bullet{\implicitmath\ptexbullet\implicitmath}
-\def\minus{\implicitmath-\implicitmath}
-
-% @refill is a no-op.
-\let\refill=\relax
-
-% If working on a large document in chapters, it is convenient to
-% be able to disable indexing, cross-referencing, and contents, for test runs.
-% This is done with @novalidate (before @setfilename).
-%
-\newif\iflinks \linkstrue % by default we want the aux files.
-\let\novalidate = \linksfalse
-
-% @setfilename is done at the beginning of every texinfo file.
-% So open here the files we need to have open while reading the input.
-% This makes it possible to make a .fmt file for texinfo.
-\def\setfilename{%
-   \iflinks
-     \readauxfile
-   \fi % \openindices needs to do some work in any case.
-   \openindices
-   \fixbackslash  % Turn off hack to swallow `\input texinfo'.
-   \global\let\setfilename=\comment % Ignore extra @setfilename cmds.
-   %
-   % If texinfo.cnf is present on the system, read it.
-   % Useful for site-wide @afourpaper, etc.
-   % Just to be on the safe side, close the input stream before the \input.
-   \openin 1 texinfo.cnf
-   \ifeof1 \let\temp=\relax \else \def\temp{\input texinfo.cnf }\fi
-   \closein1
-   \temp
-   %
-   \comment % Ignore the actual filename.
-}
-
-% Called from \setfilename.
-%
-\def\openindices{%
-  \newindex{cp}%
-  \newcodeindex{fn}%
-  \newcodeindex{vr}%
-  \newcodeindex{tp}%
-  \newcodeindex{ky}%
-  \newcodeindex{pg}%
-}
-
-% @bye.
-\outer\def\bye{\pagealignmacro\tracingstats=1\ptexend}
-
-
-\message{pdf,}
-% adobe `portable' document format
-\newcount\tempnum
-\newcount\lnkcount
-\newtoks\filename
-\newcount\filenamelength
-\newcount\pgn
-\newtoks\toksA
-\newtoks\toksB
-\newtoks\toksC
-\newtoks\toksD
-\newbox\boxA
-\newcount\countA
-\newif\ifpdf
-\newif\ifpdfmakepagedest
-
-\ifx\pdfoutput\undefined
-  \pdffalse
-  \let\pdfmkdest = \gobble
-  \let\pdfurl = \gobble
-  \let\endlink = \relax
-  \let\linkcolor = \relax
-  \let\pdfmakeoutlines = \relax
-\else
-  \pdftrue
-  \pdfoutput = 1
-  \input pdfcolor
-  \pdfcatalog{/PageMode /UseOutlines}%
-  \def\dopdfimage#1#2#3{%
-    \def\imagewidth{#2}%
-    \def\imageheight{#3}%
-    % without \immediate, pdftex seg faults when the same image is
-    % included twice.  (Version 3.14159-pre-1.0-unofficial-20010704.)
-    \ifnum\pdftexversion < 14
-      \immediate\pdfimage
-    \else
-      \immediate\pdfximage
-    \fi
-      \ifx\empty\imagewidth\else width \imagewidth \fi
-      \ifx\empty\imageheight\else height \imageheight \fi
-      \ifnum\pdftexversion<13
-         #1.pdf%
-       \else
-         {#1.pdf}%
-       \fi
-    \ifnum\pdftexversion < 14 \else
-      \pdfrefximage \pdflastximage
-    \fi}
-  \def\pdfmkdest#1{{%
-    % We have to set dummies so commands such as @code in a section title
-    % aren't expanded.
-    \atdummies
-    \normalturnoffactive
-    \pdfdest name{#1} xyz%
-  }}
-  \def\pdfmkpgn#1{#1}
-  \let\linkcolor = \Blue  % was Cyan, but that seems light?
-  \def\endlink{\Black\pdfendlink}
-  % Adding outlines to PDF; macros for calculating structure of outlines
-  % come from Petr Olsak
-  \def\expnumber#1{\expandafter\ifx\csname#1\endcsname\relax 0%
-    \else \csname#1\endcsname \fi}
-  \def\advancenumber#1{\tempnum=\expnumber{#1}\relax
-    \advance\tempnum by 1
-    \expandafter\xdef\csname#1\endcsname{\the\tempnum}}
-  %
-  % #1 is the section text.  #2 is the pdf expression for the number
-  % of subentries (or empty, for subsubsections).  #3 is the node
-  % text, which might be empty if this toc entry had no
-  % corresponding node.  #4 is the page number.
-  % 
-  \def\dopdfoutline#1#2#3#4{%
-    % Generate a link to the node text if that exists; else, use the
-    % page number.  We could generate a destination for the section
-    % text in the case where a section has no node, but it doesn't
-    % seem worthwhile, since most documents are normally structured.
-    \def\pdfoutlinedest{#3}%
-    \ifx\pdfoutlinedest\empty \def\pdfoutlinedest{#4}\fi
-    %
-    \pdfoutline goto name{\pdfmkpgn{\pdfoutlinedest}}#2{#1}%
-  }
-  %
-  \def\pdfmakeoutlines{%
-    \openin 1 \jobname.toc
-    \ifeof 1\else\begingroup
-      \closein 1
-      % Thanh's hack / proper braces in bookmarks
-      \edef\mylbrace{\iftrue \string{\else}\fi}\let\{=\mylbrace
-      \edef\myrbrace{\iffalse{\else\string}\fi}\let\}=\myrbrace
-      %
-      % Read toc silently, to get counts of subentries for \pdfoutline.
-      \def\numchapentry##1##2##3##4{\def\thischapnum{##2}}%
-      \def\numsecentry##1##2##3##4{%
-        \def\thissecnum{##2}%
-        \advancenumber{chap\thischapnum}}%
-      \def\numsubsecentry##1##2##3##4{%
-        \def\thissubsecnum{##2}%
-        \advancenumber{sec\thissecnum}}%
-      \def\numsubsubsecentry##1##2##3##4{\advancenumber{subsec\thissubsecnum}}%
-      %
-      % use \def rather than \let here because we redefine \chapentry et
-      % al. a second time, below.
-      \def\appentry{\numchapentry}%
-      \def\appsecentry{\numsecentry}%
-      \def\appsubsecentry{\numsubsecentry}%
-      \def\appsubsubsecentry{\numsubsubsecentry}%
-      \def\unnchapentry{\numchapentry}%
-      \def\unnsecentry{\numsecentry}%
-      \def\unnsubsecentry{\numsubsecentry}%
-      \def\unnsubsubsecentry{\numsubsubsecentry}%
-      \input \jobname.toc
-      %
-      % Read toc second time, this time actually producing the outlines.
-      % The `-' means take the \expnumber as the absolute number of
-      % subentries, which we calculated on our first read of the .toc above.
-      % 
-      % We use the node names as the destinations.
-      \def\numchapentry##1##2##3##4{%
-        \dopdfoutline{##1}{count-\expnumber{chap##2}}{##3}{##4}}%
-      \def\numsecentry##1##2##3##4{%
-        \dopdfoutline{##1}{count-\expnumber{sec##2}}{##3}{##4}}%
-      \def\numsubsecentry##1##2##3##4{%
-        \dopdfoutline{##1}{count-\expnumber{subsec##2}}{##3}{##4}}%
-      \def\numsubsubsecentry##1##2##3##4{% count is always zero
-        \dopdfoutline{##1}{}{##3}{##4}}%
-      %
-      % Make special characters normal for writing to the pdf file.
-      \indexnofonts
-      \turnoffactive
-      \input \jobname.toc
-    \endgroup\fi
-  }
-  %
-  \def\makelinks #1,{%
-    \def\params{#1}\def\E{END}%
-    \ifx\params\E
-      \let\nextmakelinks=\relax
-    \else
-      \let\nextmakelinks=\makelinks
-      \ifnum\lnkcount>0,\fi
-      \picknum{#1}%
-      \startlink attr{/Border [0 0 0]}
-        goto name{\pdfmkpgn{\the\pgn}}%
-      \linkcolor #1%
-      \advance\lnkcount by 1%
-      \endlink
-    \fi
-    \nextmakelinks
-  }
-  \def\picknum#1{\expandafter\pn#1}
-  \def\pn#1{%
-    \def\p{#1}%
-    \ifx\p\lbrace
-      \let\nextpn=\ppn
-    \else
-      \let\nextpn=\ppnn
-      \def\first{#1}
-    \fi
-    \nextpn
-  }
-  \def\ppn#1{\pgn=#1\gobble}
-  \def\ppnn{\pgn=\first}
-  \def\pdfmklnk#1{\lnkcount=0\makelinks #1,END,}
-  \def\addtokens#1#2{\edef\addtoks{\noexpand#1={\the#1#2}}\addtoks}
-  \def\skipspaces#1{\def\PP{#1}\def\D{|}%
-    \ifx\PP\D\let\nextsp\relax
-    \else\let\nextsp\skipspaces
-      \ifx\p\space\else\addtokens{\filename}{\PP}%
-        \advance\filenamelength by 1
-      \fi
-    \fi
-    \nextsp}
-  \def\getfilename#1{\filenamelength=0\expandafter\skipspaces#1|\relax}
-  \ifnum\pdftexversion < 14
-    \let \startlink \pdfannotlink
-  \else
-    \let \startlink \pdfstartlink
-  \fi
-  \def\pdfurl#1{%
-    \begingroup
-      \normalturnoffactive\def\@{@}%
-      \let\value=\expandablevalue
-      \leavevmode\Red
-      \startlink attr{/Border [0 0 0]}%
-        user{/Subtype /Link /A << /S /URI /URI (#1) >>}%
-        % #1
-    \endgroup}
-  \def\pdfgettoks#1.{\setbox\boxA=\hbox{\toksA={#1.}\toksB={}\maketoks}}
-  \def\addtokens#1#2{\edef\addtoks{\noexpand#1={\the#1#2}}\addtoks}
-  \def\adn#1{\addtokens{\toksC}{#1}\global\countA=1\let\next=\maketoks}
-  \def\poptoks#1#2|ENDTOKS|{\let\first=#1\toksD={#1}\toksA={#2}}
-  \def\maketoks{%
-    \expandafter\poptoks\the\toksA|ENDTOKS|
-    \ifx\first0\adn0
-    \else\ifx\first1\adn1 \else\ifx\first2\adn2 \else\ifx\first3\adn3
-    \else\ifx\first4\adn4 \else\ifx\first5\adn5 \else\ifx\first6\adn6
-    \else\ifx\first7\adn7 \else\ifx\first8\adn8 \else\ifx\first9\adn9
-    \else
-      \ifnum0=\countA\else\makelink\fi
-      \ifx\first.\let\next=\done\else
-        \let\next=\maketoks
-        \addtokens{\toksB}{\the\toksD}
-        \ifx\first,\addtokens{\toksB}{\space}\fi
-      \fi
-    \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi
-    \next}
-  \def\makelink{\addtokens{\toksB}%
-    {\noexpand\pdflink{\the\toksC}}\toksC={}\global\countA=0}
-  \def\pdflink#1{%
-    \startlink attr{/Border [0 0 0]} goto name{\pdfmkpgn{#1}}
-    \linkcolor #1\endlink}
-  \def\done{\edef\st{\global\noexpand\toksA={\the\toksB}}\st}
-\fi % \ifx\pdfoutput
-
-
-\message{fonts,}
-% Font-change commands.
-
-% Texinfo sort of supports the sans serif font style, which plain TeX does not.
-% So we set up a \sf analogous to plain's \rm, etc.
-\newfam\sffam
-\def\sf{\fam=\sffam \tensf}
-\let\li = \sf % Sometimes we call it \li, not \sf.
-
-% We don't need math for this one.
-\def\ttsl{\tenttsl}
-
-% Default leading.
-\newdimen\textleading  \textleading = 13.2pt
-
-% Set the baselineskip to #1, and the lineskip and strut size
-% correspondingly.  There is no deep meaning behind these magic numbers
-% used as factors; they just match (closely enough) what Knuth defined.
-%
-\def\lineskipfactor{.08333}
-\def\strutheightpercent{.70833}
-\def\strutdepthpercent {.29167}
-%
-\def\setleading#1{%
-  \normalbaselineskip = #1\relax
-  \normallineskip = \lineskipfactor\normalbaselineskip
-  \normalbaselines
-  \setbox\strutbox =\hbox{%
-    \vrule width0pt height\strutheightpercent\baselineskip
-                    depth \strutdepthpercent \baselineskip
-  }%
-}
-
-% Set the font macro #1 to the font named #2, adding on the
-% specified font prefix (normally `cm').
-% #3 is the font's design size, #4 is a scale factor
-\def\setfont#1#2#3#4{\font#1=\fontprefix#2#3 scaled #4}
-
-% Use cm as the default font prefix.
-% To specify the font prefix, you must define \fontprefix
-% before you read in texinfo.tex.
-\ifx\fontprefix\undefined
-\def\fontprefix{cm}
-\fi
-% Support font families that don't use the same naming scheme as CM.
-\def\rmshape{r}
-\def\rmbshape{bx}               %where the normal face is bold
-\def\bfshape{b}
-\def\bxshape{bx}
-\def\ttshape{tt}
-\def\ttbshape{tt}
-\def\ttslshape{sltt}
-\def\itshape{ti}
-\def\itbshape{bxti}
-\def\slshape{sl}
-\def\slbshape{bxsl}
-\def\sfshape{ss}
-\def\sfbshape{ss}
-\def\scshape{csc}
-\def\scbshape{csc}
-
-\newcount\mainmagstep
-\ifx\bigger\relax
-  % not really supported.
-  \mainmagstep=\magstep1
-  \setfont\textrm\rmshape{12}{1000}
-  \setfont\texttt\ttshape{12}{1000}
-\else
-  \mainmagstep=\magstephalf
-  \setfont\textrm\rmshape{10}{\mainmagstep}
-  \setfont\texttt\ttshape{10}{\mainmagstep}
-\fi
-\setfont\textbf\bfshape{10}{\mainmagstep}
-\setfont\textit\itshape{10}{\mainmagstep}
-\setfont\textsl\slshape{10}{\mainmagstep}
-\setfont\textsf\sfshape{10}{\mainmagstep}
-\setfont\textsc\scshape{10}{\mainmagstep}
-\setfont\textttsl\ttslshape{10}{\mainmagstep}
-\font\texti=cmmi10 scaled \mainmagstep
-\font\textsy=cmsy10 scaled \mainmagstep
-
-% A few fonts for @defun, etc.
-\setfont\defbf\bfshape{10}{\magstep1}
-\setfont\deftt\ttshape{10}{\magstep1}
-\def\df{\let\tentt=\deftt \let\tenbf = \defbf \bf}
-
-% Fonts for indices, footnotes, small examples (9pt).
-\setfont\smallrm\rmshape{9}{1000}
-\setfont\smalltt\ttshape{9}{1000}
-\setfont\smallbf\bfshape{10}{900}
-\setfont\smallit\itshape{9}{1000}
-\setfont\smallsl\slshape{9}{1000}
-\setfont\smallsf\sfshape{9}{1000}
-\setfont\smallsc\scshape{10}{900}
-\setfont\smallttsl\ttslshape{10}{900}
-\font\smalli=cmmi9
-\font\smallsy=cmsy9
-
-% Fonts for small examples (8pt).
-\setfont\smallerrm\rmshape{8}{1000}
-\setfont\smallertt\ttshape{8}{1000}
-\setfont\smallerbf\bfshape{10}{800}
-\setfont\smallerit\itshape{8}{1000}
-\setfont\smallersl\slshape{8}{1000}
-\setfont\smallersf\sfshape{8}{1000}
-\setfont\smallersc\scshape{10}{800}
-\setfont\smallerttsl\ttslshape{10}{800}
-\font\smalleri=cmmi8
-\font\smallersy=cmsy8
-
-% Fonts for title page:
-\setfont\titlerm\rmbshape{12}{\magstep3}
-\setfont\titleit\itbshape{10}{\magstep4}
-\setfont\titlesl\slbshape{10}{\magstep4}
-\setfont\titlett\ttbshape{12}{\magstep3}
-\setfont\titlettsl\ttslshape{10}{\magstep4}
-\setfont\titlesf\sfbshape{17}{\magstep1}
-\let\titlebf=\titlerm
-\setfont\titlesc\scbshape{10}{\magstep4}
-\font\titlei=cmmi12 scaled \magstep3
-\font\titlesy=cmsy10 scaled \magstep4
-\def\authorrm{\secrm}
-\def\authortt{\sectt}
-
-% Chapter (and unnumbered) fonts (17.28pt).
-\setfont\chaprm\rmbshape{12}{\magstep2}
-\setfont\chapit\itbshape{10}{\magstep3}
-\setfont\chapsl\slbshape{10}{\magstep3}
-\setfont\chaptt\ttbshape{12}{\magstep2}
-\setfont\chapttsl\ttslshape{10}{\magstep3}
-\setfont\chapsf\sfbshape{17}{1000}
-\let\chapbf=\chaprm
-\setfont\chapsc\scbshape{10}{\magstep3}
-\font\chapi=cmmi12 scaled \magstep2
-\font\chapsy=cmsy10 scaled \magstep3
-
-% Section fonts (14.4pt).
-\setfont\secrm\rmbshape{12}{\magstep1}
-\setfont\secit\itbshape{10}{\magstep2}
-\setfont\secsl\slbshape{10}{\magstep2}
-\setfont\sectt\ttbshape{12}{\magstep1}
-\setfont\secttsl\ttslshape{10}{\magstep2}
-\setfont\secsf\sfbshape{12}{\magstep1}
-\let\secbf\secrm
-\setfont\secsc\scbshape{10}{\magstep2}
-\font\seci=cmmi12 scaled \magstep1
-\font\secsy=cmsy10 scaled \magstep2
-
-% Subsection fonts (13.15pt).
-\setfont\ssecrm\rmbshape{12}{\magstephalf}
-\setfont\ssecit\itbshape{10}{1315}
-\setfont\ssecsl\slbshape{10}{1315}
-\setfont\ssectt\ttbshape{12}{\magstephalf}
-\setfont\ssecttsl\ttslshape{10}{1315}
-\setfont\ssecsf\sfbshape{12}{\magstephalf}
-\let\ssecbf\ssecrm
-\setfont\ssecsc\scbshape{10}{\magstep1}
-\font\sseci=cmmi12 scaled \magstephalf
-\font\ssecsy=cmsy10 scaled 1315
-% The smallcaps and symbol fonts should actually be scaled \magstep1.5,
-% but that is not a standard magnification.
-
-% In order for the font changes to affect most math symbols and letters,
-% we have to define the \textfont of the standard families.  Since
-% texinfo doesn't allow for producing subscripts and superscripts except
-% in the main text, we don't bother to reset \scriptfont and
-% \scriptscriptfont (which would also require loading a lot more fonts).
-%
-\def\resetmathfonts{%
-  \textfont0=\tenrm \textfont1=\teni \textfont2=\tensy
-  \textfont\itfam=\tenit \textfont\slfam=\tensl \textfont\bffam=\tenbf
-  \textfont\ttfam=\tentt \textfont\sffam=\tensf
-}
-
-% The font-changing commands redefine the meanings of \tenSTYLE, instead
-% of just \STYLE.  We do this so that font changes will continue to work
-% in math mode, where it is the current \fam that is relevant in most
-% cases, not the current font.  Plain TeX does \def\bf{\fam=\bffam
-% \tenbf}, for example.  By redefining \tenbf, we obviate the need to
-% redefine \bf itself.
-\def\textfonts{%
-  \let\tenrm=\textrm \let\tenit=\textit \let\tensl=\textsl
-  \let\tenbf=\textbf \let\tentt=\texttt \let\smallcaps=\textsc
-  \let\tensf=\textsf \let\teni=\texti \let\tensy=\textsy \let\tenttsl=\textttsl
-  \resetmathfonts \setleading{\textleading}}
-\def\titlefonts{%
-  \let\tenrm=\titlerm \let\tenit=\titleit \let\tensl=\titlesl
-  \let\tenbf=\titlebf \let\tentt=\titlett \let\smallcaps=\titlesc
-  \let\tensf=\titlesf \let\teni=\titlei \let\tensy=\titlesy
-  \let\tenttsl=\titlettsl
-  \resetmathfonts \setleading{25pt}}
-\def\titlefont#1{{\titlefonts\rm #1}}
-\def\chapfonts{%
-  \let\tenrm=\chaprm \let\tenit=\chapit \let\tensl=\chapsl
-  \let\tenbf=\chapbf \let\tentt=\chaptt \let\smallcaps=\chapsc
-  \let\tensf=\chapsf \let\teni=\chapi \let\tensy=\chapsy \let\tenttsl=\chapttsl
-  \resetmathfonts \setleading{19pt}}
-\def\secfonts{%
-  \let\tenrm=\secrm \let\tenit=\secit \let\tensl=\secsl
-  \let\tenbf=\secbf \let\tentt=\sectt \let\smallcaps=\secsc
-  \let\tensf=\secsf \let\teni=\seci \let\tensy=\secsy \let\tenttsl=\secttsl
-  \resetmathfonts \setleading{16pt}}
-\def\subsecfonts{%
-  \let\tenrm=\ssecrm \let\tenit=\ssecit \let\tensl=\ssecsl
-  \let\tenbf=\ssecbf \let\tentt=\ssectt \let\smallcaps=\ssecsc
-  \let\tensf=\ssecsf \let\teni=\sseci \let\tensy=\ssecsy \let\tenttsl=\ssecttsl
-  \resetmathfonts \setleading{15pt}}
-\let\subsubsecfonts = \subsecfonts % Maybe make sssec fonts scaled magstephalf?
-\def\smallfonts{%
-  \let\tenrm=\smallrm \let\tenit=\smallit \let\tensl=\smallsl
-  \let\tenbf=\smallbf \let\tentt=\smalltt \let\smallcaps=\smallsc
-  \let\tensf=\smallsf \let\teni=\smalli \let\tensy=\smallsy
-  \let\tenttsl=\smallttsl
-  \resetmathfonts \setleading{10.5pt}}
-\def\smallerfonts{%
-  \let\tenrm=\smallerrm \let\tenit=\smallerit \let\tensl=\smallersl
-  \let\tenbf=\smallerbf \let\tentt=\smallertt \let\smallcaps=\smallersc
-  \let\tensf=\smallersf \let\teni=\smalleri \let\tensy=\smallersy
-  \let\tenttsl=\smallerttsl
-  \resetmathfonts \setleading{9.5pt}}
-
-% Set the fonts to use with the @small... environments.
-\let\smallexamplefonts = \smallfonts
-
-% About \smallexamplefonts.  If we use \smallfonts (9pt), @smallexample
-% can fit this many characters:
-%   8.5x11=86   smallbook=72  a4=90  a5=69
-% If we use \smallerfonts (8pt), then we can fit this many characters:
-%   8.5x11=90+  smallbook=80  a4=90+  a5=77
-% For me, subjectively, the few extra characters that fit aren't worth
-% the additional smallness of 8pt.  So I'm making the default 9pt.
-%
-% By the way, for comparison, here's what fits with @example (10pt):
-%   8.5x11=71  smallbook=60  a4=75  a5=58
-%
-% I wish we used A4 paper on this side of the Atlantic.
-%
-% --karl, 24jan03.
-
-
-% Set up the default fonts, so we can use them for creating boxes.
-%
-\textfonts
-
-% Define these so they can be easily changed for other fonts.
-\def\angleleft{$\langle$}
-\def\angleright{$\rangle$}
-
-% Count depth in font-changes, for error checks
-\newcount\fontdepth \fontdepth=0
-
-% Fonts for short table of contents.
-\setfont\shortcontrm\rmshape{12}{1000}
-\setfont\shortcontbf\bfshape{10}{\magstep1}  % no cmb12
-\setfont\shortcontsl\slshape{12}{1000}
-\setfont\shortconttt\ttshape{12}{1000}
-
-%% Add scribe-like font environments, plus @l for inline lisp (usually sans
-%% serif) and @ii for TeX italic
-
-% \smartitalic{ARG} outputs arg in italics, followed by an italic correction
-% unless the following character is such as not to need one.
-\def\smartitalicx{\ifx\next,\else\ifx\next-\else\ifx\next.\else
-                    \ptexslash\fi\fi\fi}
-\def\smartslanted#1{{\ifusingtt\ttsl\sl #1}\futurelet\next\smartitalicx}
-\def\smartitalic#1{{\ifusingtt\ttsl\it #1}\futurelet\next\smartitalicx}
-
-\let\i=\smartitalic
-\let\var=\smartslanted
-\let\dfn=\smartslanted
-\let\emph=\smartitalic
-\let\cite=\smartslanted
-
-\def\b#1{{\bf #1}}
-\let\strong=\b
-
-% We can't just use \exhyphenpenalty, because that only has effect at
-% the end of a paragraph.  Restore normal hyphenation at the end of the
-% group within which \nohyphenation is presumably called.
-%
-\def\nohyphenation{\hyphenchar\font = -1  \aftergroup\restorehyphenation}
-\def\restorehyphenation{\hyphenchar\font = `- }
-
-% Set sfcode to normal for the chars that usually have another value.
-% Can't use plain's \frenchspacing because it uses the `\x notation, and
-% sometimes \x has an active definition that messes things up.
-%
-\catcode`@=11
-  \def\frenchspacing{%
-    \sfcode\dotChar  =\@m \sfcode\questChar=\@m \sfcode\exclamChar=\@m
-    \sfcode\colonChar=\@m \sfcode\semiChar =\@m \sfcode\commaChar =\@m
-  }
-\catcode`@=\other
-
-\def\t#1{%
-  {\tt \rawbackslash \frenchspacing #1}%
-  \null
-}
-\let\ttfont=\t
-\def\samp#1{`\tclose{#1}'\null}
-\setfont\keyrm\rmshape{8}{1000}
-\font\keysy=cmsy9
-\def\key#1{{\keyrm\textfont2=\keysy \leavevmode\hbox{%
-  \raise0.4pt\hbox{\angleleft}\kern-.08em\vtop{%
-    \vbox{\hrule\kern-0.4pt
-     \hbox{\raise0.4pt\hbox{\vphantom{\angleleft}}#1}}%
-    \kern-0.4pt\hrule}%
-  \kern-.06em\raise0.4pt\hbox{\angleright}}}}
-% The old definition, with no lozenge:
-%\def\key #1{{\ttsl \nohyphenation \uppercase{#1}}\null}
-\def\ctrl #1{{\tt \rawbackslash \hat}#1}
-
-% @file, @option are the same as @samp.
-\let\file=\samp
-\let\option=\samp
-
-% @code is a modification of @t,
-% which makes spaces the same size as normal in the surrounding text.
-\def\tclose#1{%
-  {%
-    % Change normal interword space to be same as for the current font.
-    \spaceskip = \fontdimen2\font
-    %
-    % Switch to typewriter.
-    \tt
-    %
-    % But `\ ' produces the large typewriter interword space.
-    \def\ {{\spaceskip = 0pt{} }}%
-    %
-    % Turn off hyphenation.
-    \nohyphenation
-    %
-    \rawbackslash
-    \frenchspacing
-    #1%
-  }%
-  \null
-}
-
-% We *must* turn on hyphenation at `-' and `_' in \code.
-% Otherwise, it is too hard to avoid overfull hboxes
-% in the Emacs manual, the Library manual, etc.
-
-% Unfortunately, TeX uses one parameter (\hyphenchar) to control
-% both hyphenation at - and hyphenation within words.
-% We must therefore turn them both off (\tclose does that)
-% and arrange explicitly to hyphenate at a dash.
-%  -- rms.
-{
-  \catcode`\-=\active
-  \catcode`\_=\active
-  %
-  \global\def\code{\begingroup
-    \catcode`\-=\active \let-\codedash
-    \catcode`\_=\active \let_\codeunder
-    \codex
-  }
-  %
-  % If we end up with any active - characters when handling the index,
-  % just treat them as a normal -.
-  \global\def\indexbreaks{\catcode`\-=\active \let-\realdash}
-}
-
-\def\realdash{-}
-\def\codedash{-\discretionary{}{}{}}
-\def\codeunder{%
-  % this is all so @math{@code{var_name}+1} can work.  In math mode, _
-  % is "active" (mathcode"8000) and \normalunderscore (or \char95, etc.)
-  % will therefore expand the active definition of _, which is us
-  % (inside @code that is), therefore an endless loop.
-  \ifusingtt{\ifmmode
-               \mathchar"075F % class 0=ordinary, family 7=ttfam, pos 0x5F=_.
-             \else\normalunderscore \fi
-             \discretionary{}{}{}}%
-            {\_}%
-}
-\def\codex #1{\tclose{#1}\endgroup}
-
-% @kbd is like @code, except that if the argument is just one @key command,
-% then @kbd has no effect.
-
-% @kbdinputstyle -- arg is `distinct' (@kbd uses slanted tty font always),
-%   `example' (@kbd uses ttsl only inside of @example and friends),
-%   or `code' (@kbd uses normal tty font always).
-\def\kbdinputstyle{\parsearg\kbdinputstylexxx}
-\def\kbdinputstylexxx#1{%
-  \def\arg{#1}%
-  \ifx\arg\worddistinct
-    \gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\ttsl}%
-  \else\ifx\arg\wordexample
-    \gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\tt}%
-  \else\ifx\arg\wordcode
-    \gdef\kbdexamplefont{\tt}\gdef\kbdfont{\tt}%
-  \else
-    \errhelp = \EMsimple
-    \errmessage{Unknown @kbdinputstyle option `\arg'}%
-  \fi\fi\fi
-}
-\def\worddistinct{distinct}
-\def\wordexample{example}
-\def\wordcode{code}
-
-% Default is `distinct.'
-\kbdinputstyle distinct
-
-\def\xkey{\key}
-\def\kbdfoo#1#2#3\par{\def\one{#1}\def\three{#3}\def\threex{??}%
-\ifx\one\xkey\ifx\threex\three \key{#2}%
-\else{\tclose{\kbdfont\look}}\fi
-\else{\tclose{\kbdfont\look}}\fi}
-
-% For @url, @env, @command quotes seem unnecessary, so use \code.
-\let\url=\code
-\let\env=\code
-\let\command=\code
-
-% @uref (abbreviation for `urlref') takes an optional (comma-separated)
-% second argument specifying the text to display and an optional third
-% arg as text to display instead of (rather than in addition to) the url
-% itself.  First (mandatory) arg is the url.  Perhaps eventually put in
-% a hypertex \special here.
-%
-\def\uref#1{\douref #1,,,\finish}
-\def\douref#1,#2,#3,#4\finish{\begingroup
-  \unsepspaces
-  \pdfurl{#1}%
-  \setbox0 = \hbox{\ignorespaces #3}%
-  \ifdim\wd0 > 0pt
-    \unhbox0 % third arg given, show only that
-  \else
-    \setbox0 = \hbox{\ignorespaces #2}%
-    \ifdim\wd0 > 0pt
-      \ifpdf
-        \unhbox0             % PDF: 2nd arg given, show only it
-      \else
-        \unhbox0\ (\code{#1})% DVI: 2nd arg given, show both it and url
-      \fi
-    \else
-      \code{#1}% only url given, so show it
-    \fi
-  \fi
-  \endlink
-\endgroup}
-
-% rms does not like angle brackets --karl, 17may97.
-% So now @email is just like @uref, unless we are pdf.
-%
-%\def\email#1{\angleleft{\tt #1}\angleright}
-\ifpdf
-  \def\email#1{\doemail#1,,\finish}
-  \def\doemail#1,#2,#3\finish{\begingroup
-    \unsepspaces
-    \pdfurl{mailto:#1}%
-    \setbox0 = \hbox{\ignorespaces #2}%
-    \ifdim\wd0>0pt\unhbox0\else\code{#1}\fi
-    \endlink
-  \endgroup}
-\else
-  \let\email=\uref
-\fi
-
-% Check if we are currently using a typewriter font.  Since all the
-% Computer Modern typewriter fonts have zero interword stretch (and
-% shrink), and it is reasonable to expect all typewriter fonts to have
-% this property, we can check that font parameter.
-%
-\def\ifmonospace{\ifdim\fontdimen3\font=0pt }
-
-% Typeset a dimension, e.g., `in' or `pt'.  The only reason for the
-% argument is to make the input look right: @dmn{pt} instead of @dmn{}pt.
-%
-\def\dmn#1{\thinspace #1}
-
-\def\kbd#1{\def\look{#1}\expandafter\kbdfoo\look??\par}
-
-% @l was never documented to mean ``switch to the Lisp font'',
-% and it is not used as such in any manual I can find.  We need it for
-% Polish suppressed-l.  --karl, 22sep96.
-%\def\l#1{{\li #1}\null}
-
-% Explicit font changes: @r, @sc, undocumented @ii.
-\def\r#1{{\rm #1}}              % roman font
-\def\sc#1{{\smallcaps#1}}       % smallcaps font
-\def\ii#1{{\it #1}}             % italic font
-
-% @acronym downcases the argument and prints in smallcaps.
-\def\acronym#1{{\smallcaps \lowercase{#1}}}
-
-% @pounds{} is a sterling sign.
-\def\pounds{{\it\$}}
-
-% @registeredsymbol - R in a circle.  For now, only works in text size;
-% we'd have to redo the font mechanism to change the \scriptstyle and
-% \scriptscriptstyle font sizes to make it look right in headings.
-% Adapted from the plain.tex definition of \copyright.
-%
-\def\registeredsymbol{%
-  $^{{\ooalign{\hfil\raise.07ex\hbox{$\scriptstyle\rm R$}\hfil\crcr\Orb}}%
-    }$%
-}
-
-
-\message{page headings,}
-
-\newskip\titlepagetopglue \titlepagetopglue = 1.5in
-\newskip\titlepagebottomglue \titlepagebottomglue = 2pc
-
-% First the title page.  Must do @settitle before @titlepage.
-\newif\ifseenauthor
-\newif\iffinishedtitlepage
-
-% Do an implicit @contents or @shortcontents after @end titlepage if the
-% user says @setcontentsaftertitlepage or @setshortcontentsaftertitlepage.
-%
-\newif\ifsetcontentsaftertitlepage
- \let\setcontentsaftertitlepage = \setcontentsaftertitlepagetrue
-\newif\ifsetshortcontentsaftertitlepage
- \let\setshortcontentsaftertitlepage = \setshortcontentsaftertitlepagetrue
-
-\def\shorttitlepage{\parsearg\shorttitlepagezzz}
-\def\shorttitlepagezzz #1{\begingroup\hbox{}\vskip 1.5in \chaprm \centerline{#1}%
-        \endgroup\page\hbox{}\page}
-
-\def\titlepage{\begingroup \parindent=0pt \textfonts
-   \let\subtitlerm=\tenrm
-   \def\subtitlefont{\subtitlerm \normalbaselineskip = 13pt \normalbaselines}%
-   %
-   \def\authorfont{\authorrm \normalbaselineskip = 16pt \normalbaselines
-                   \let\tt=\authortt}%
-   %
-   % Leave some space at the very top of the page.
-   \vglue\titlepagetopglue
-   %
-   % Now you can print the title using @title.
-   \def\title{\parsearg\titlezzz}%
-   \def\titlezzz##1{\leftline{\titlefonts\rm ##1}
-                    % print a rule at the page bottom also.
-                    \finishedtitlepagefalse
-                    \vskip4pt \hrule height 4pt width \hsize \vskip4pt}%
-   % No rule at page bottom unless we print one at the top with @title.
-   \finishedtitlepagetrue
-   %
-   % Now you can put text using @subtitle.
-   \def\subtitle{\parsearg\subtitlezzz}%
-   \def\subtitlezzz##1{{\subtitlefont \rightline{##1}}}%
-   %
-   % @author should come last, but may come many times.
-   \def\author{\parsearg\authorzzz}%
-   \def\authorzzz##1{\ifseenauthor\else\vskip 0pt plus 1filll\seenauthortrue\fi
-      {\authorfont \leftline{##1}}}%
-   %
-   % Most title ``pages'' are actually two pages long, with space
-   % at the top of the second.  We don't want the ragged left on the second.
-   \let\oldpage = \page
-   \def\page{%
-      \iffinishedtitlepage\else
-         \finishtitlepage
-      \fi
-      \oldpage
-      \let\page = \oldpage
-      \hbox{}}%
-%   \def\page{\oldpage \hbox{}}
-}
-
-\def\Etitlepage{%
-   \iffinishedtitlepage\else
-      \finishtitlepage
-   \fi
-   % It is important to do the page break before ending the group,
-   % because the headline and footline are only empty inside the group.
-   % If we use the new definition of \page, we always get a blank page
-   % after the title page, which we certainly don't want.
-   \oldpage
-   \endgroup
-   %
-   % Need this before the \...aftertitlepage checks so that if they are
-   % in effect the toc pages will come out with page numbers.
-   \HEADINGSon
-   %
-   % If they want short, they certainly want long too.
-   \ifsetshortcontentsaftertitlepage
-     \shortcontents
-     \contents
-     \global\let\shortcontents = \relax
-     \global\let\contents = \relax
-   \fi
-   %
-   \ifsetcontentsaftertitlepage
-     \contents
-     \global\let\contents = \relax
-     \global\let\shortcontents = \relax
-   \fi
-}
-
-\def\finishtitlepage{%
-   \vskip4pt \hrule height 2pt width \hsize
-   \vskip\titlepagebottomglue
-   \finishedtitlepagetrue
-}
-
-%%% Set up page headings and footings.
-
-\let\thispage=\folio
-
-\newtoks\evenheadline    % headline on even pages
-\newtoks\oddheadline     % headline on odd pages
-\newtoks\evenfootline    % footline on even pages
-\newtoks\oddfootline     % footline on odd pages
-
-% Now make Tex use those variables
-\headline={{\textfonts\rm \ifodd\pageno \the\oddheadline
-                            \else \the\evenheadline \fi}}
-\footline={{\textfonts\rm \ifodd\pageno \the\oddfootline
-                            \else \the\evenfootline \fi}\HEADINGShook}
-\let\HEADINGShook=\relax
-
-% Commands to set those variables.
-% For example, this is what  @headings on  does
-% @evenheading @thistitle|@thispage|@thischapter
-% @oddheading @thischapter|@thispage|@thistitle
-% @evenfooting @thisfile||
-% @oddfooting ||@thisfile
-
-\def\evenheading{\parsearg\evenheadingxxx}
-\def\oddheading{\parsearg\oddheadingxxx}
-\def\everyheading{\parsearg\everyheadingxxx}
-
-\def\evenfooting{\parsearg\evenfootingxxx}
-\def\oddfooting{\parsearg\oddfootingxxx}
-\def\everyfooting{\parsearg\everyfootingxxx}
-
-{\catcode`\@=0 %
-
-\gdef\evenheadingxxx #1{\evenheadingyyy #1@|@|@|@|\finish}
-\gdef\evenheadingyyy #1@|#2@|#3@|#4\finish{%
-\global\evenheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
-
-\gdef\oddheadingxxx #1{\oddheadingyyy #1@|@|@|@|\finish}
-\gdef\oddheadingyyy #1@|#2@|#3@|#4\finish{%
-\global\oddheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
-
-\gdef\everyheadingxxx#1{\oddheadingxxx{#1}\evenheadingxxx{#1}}%
-
-\gdef\evenfootingxxx #1{\evenfootingyyy #1@|@|@|@|\finish}
-\gdef\evenfootingyyy #1@|#2@|#3@|#4\finish{%
-\global\evenfootline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
-
-\gdef\oddfootingxxx #1{\oddfootingyyy #1@|@|@|@|\finish}
-\gdef\oddfootingyyy #1@|#2@|#3@|#4\finish{%
-  \global\oddfootline = {\rlap{\centerline{#2}}\line{#1\hfil#3}}%
-  %
-  % Leave some space for the footline.  Hopefully ok to assume
-  % @evenfooting will not be used by itself.
-  \global\advance\pageheight by -\baselineskip
-  \global\advance\vsize by -\baselineskip
-}
-
-\gdef\everyfootingxxx#1{\oddfootingxxx{#1}\evenfootingxxx{#1}}
-%
-}% unbind the catcode of @.
-
-% @headings double      turns headings on for double-sided printing.
-% @headings single      turns headings on for single-sided printing.
-% @headings off         turns them off.
-% @headings on          same as @headings double, retained for compatibility.
-% @headings after       turns on double-sided headings after this page.
-% @headings doubleafter turns on double-sided headings after this page.
-% @headings singleafter turns on single-sided headings after this page.
-% By default, they are off at the start of a document,
-% and turned `on' after @end titlepage.
-
-\def\headings #1 {\csname HEADINGS#1\endcsname}
-
-\def\HEADINGSoff{
-\global\evenheadline={\hfil} \global\evenfootline={\hfil}
-\global\oddheadline={\hfil} \global\oddfootline={\hfil}}
-\HEADINGSoff
-% When we turn headings on, set the page number to 1.
-% For double-sided printing, put current file name in lower left corner,
-% chapter name on inside top of right hand pages, document
-% title on inside top of left hand pages, and page numbers on outside top
-% edge of all pages.
-\def\HEADINGSdouble{
-\global\pageno=1
-\global\evenfootline={\hfil}
-\global\oddfootline={\hfil}
-\global\evenheadline={\line{\folio\hfil\thistitle}}
-\global\oddheadline={\line{\thischapter\hfil\folio}}
-\global\let\contentsalignmacro = \chapoddpage
-}
-\let\contentsalignmacro = \chappager
-
-% For single-sided printing, chapter title goes across top left of page,
-% page number on top right.
-\def\HEADINGSsingle{
-\global\pageno=1
-\global\evenfootline={\hfil}
-\global\oddfootline={\hfil}
-\global\evenheadline={\line{\thischapter\hfil\folio}}
-\global\oddheadline={\line{\thischapter\hfil\folio}}
-\global\let\contentsalignmacro = \chappager
-}
-\def\HEADINGSon{\HEADINGSdouble}
-
-\def\HEADINGSafter{\let\HEADINGShook=\HEADINGSdoublex}
-\let\HEADINGSdoubleafter=\HEADINGSafter
-\def\HEADINGSdoublex{%
-\global\evenfootline={\hfil}
-\global\oddfootline={\hfil}
-\global\evenheadline={\line{\folio\hfil\thistitle}}
-\global\oddheadline={\line{\thischapter\hfil\folio}}
-\global\let\contentsalignmacro = \chapoddpage
-}
-
-\def\HEADINGSsingleafter{\let\HEADINGShook=\HEADINGSsinglex}
-\def\HEADINGSsinglex{%
-\global\evenfootline={\hfil}
-\global\oddfootline={\hfil}
-\global\evenheadline={\line{\thischapter\hfil\folio}}
-\global\oddheadline={\line{\thischapter\hfil\folio}}
-\global\let\contentsalignmacro = \chappager
-}
-
-% Subroutines used in generating headings
-% This produces Day Month Year style of output.
-% Only define if not already defined, in case a txi-??.tex file has set
-% up a different format (e.g., txi-cs.tex does this).
-\ifx\today\undefined
-\def\today{%
-  \number\day\space
-  \ifcase\month
-  \or\putwordMJan\or\putwordMFeb\or\putwordMMar\or\putwordMApr
-  \or\putwordMMay\or\putwordMJun\or\putwordMJul\or\putwordMAug
-  \or\putwordMSep\or\putwordMOct\or\putwordMNov\or\putwordMDec
-  \fi
-  \space\number\year}
-\fi
-
-% @settitle line...  specifies the title of the document, for headings.
-% It generates no output of its own.
-\def\thistitle{\putwordNoTitle}
-\def\settitle{\parsearg\settitlezzz}
-\def\settitlezzz #1{\gdef\thistitle{#1}}
-
-
-\message{tables,}
-% Tables -- @table, @ftable, @vtable, @item(x), @kitem(x), @xitem(x).
-
-% default indentation of table text
-\newdimen\tableindent \tableindent=.8in
-% default indentation of @itemize and @enumerate text
-\newdimen\itemindent  \itemindent=.3in
-% margin between end of table item and start of table text.
-\newdimen\itemmargin  \itemmargin=.1in
-
-% used internally for \itemindent minus \itemmargin
-\newdimen\itemmax
-
-% Note @table, @vtable, and @vtable define @item, @itemx, etc., with
-% these defs.
-% They also define \itemindex
-% to index the item name in whatever manner is desired (perhaps none).
-
-\newif\ifitemxneedsnegativevskip
-
-\def\itemxpar{\par\ifitemxneedsnegativevskip\nobreak\vskip-\parskip\nobreak\fi}
-
-\def\internalBitem{\smallbreak \parsearg\itemzzz}
-\def\internalBitemx{\itemxpar \parsearg\itemzzz}
-
-\def\internalBxitem "#1"{\def\xitemsubtopix{#1} \smallbreak \parsearg\xitemzzz}
-\def\internalBxitemx "#1"{\def\xitemsubtopix{#1} \itemxpar \parsearg\xitemzzz}
-
-\def\internalBkitem{\smallbreak \parsearg\kitemzzz}
-\def\internalBkitemx{\itemxpar \parsearg\kitemzzz}
-
-\def\kitemzzz #1{\dosubind {kw}{\code{#1}}{for {\bf \lastfunction}}%
-                 \itemzzz {#1}}
-
-\def\xitemzzz #1{\dosubind {kw}{\code{#1}}{for {\bf \xitemsubtopic}}%
-                 \itemzzz {#1}}
-
-\def\itemzzz #1{\begingroup %
-  \advance\hsize by -\rightskip
-  \advance\hsize by -\tableindent
-  \setbox0=\hbox{\itemfont{#1}}%
-  \itemindex{#1}%
-  \nobreak % This prevents a break before @itemx.
-  %
-  % If the item text does not fit in the space we have, put it on a line
-  % by itself, and do not allow a page break either before or after that
-  % line.  We do not start a paragraph here because then if the next
-  % command is, e.g., @kindex, the whatsit would get put into the
-  % horizontal list on a line by itself, resulting in extra blank space.
-  \ifdim \wd0>\itemmax
-    %
-    % Make this a paragraph so we get the \parskip glue and wrapping,
-    % but leave it ragged-right.
-    \begingroup
-      \advance\leftskip by-\tableindent
-      \advance\hsize by\tableindent
-      \advance\rightskip by0pt plus1fil
-      \leavevmode\unhbox0\par
-    \endgroup
-    %
-    % We're going to be starting a paragraph, but we don't want the
-    % \parskip glue -- logically it's part of the @item we just started.
-    \nobreak \vskip-\parskip
-    %
-    % Stop a page break at the \parskip glue coming up.  (Unfortunately
-    % we can't prevent a possible page break at the following
-    % \baselineskip glue.)  However, if what follows is an environment
-    % such as @example, there will be no \parskip glue; then
-    % the negative vskip we just would cause the example and the item to
-    % crash together.  So we use this bizarre value of 10001 as a signal
-    % to \aboveenvbreak to insert \parskip glue after all.
-    % (Possibly there are other commands that could be followed by
-    % @example which need the same treatment, but not section titles; or
-    % maybe section titles are the only special case and they should be
-    % penalty 10001...)
-    \penalty 10001
-    \endgroup
-    \itemxneedsnegativevskipfalse
-  \else
-    % The item text fits into the space.  Start a paragraph, so that the
-    % following text (if any) will end up on the same line.
-    \noindent
-    % Do this with kerns and \unhbox so that if there is a footnote in
-    % the item text, it can migrate to the main vertical list and
-    % eventually be printed.
-    \nobreak\kern-\tableindent
-    \dimen0 = \itemmax  \advance\dimen0 by \itemmargin \advance\dimen0 by -\wd0
-    \unhbox0
-    \nobreak\kern\dimen0
-    \endgroup
-    \itemxneedsnegativevskiptrue
-  \fi
-}
-
-\def\item{\errmessage{@item while not in a table}}
-\def\itemx{\errmessage{@itemx while not in a table}}
-\def\kitem{\errmessage{@kitem while not in a table}}
-\def\kitemx{\errmessage{@kitemx while not in a table}}
-\def\xitem{\errmessage{@xitem while not in a table}}
-\def\xitemx{\errmessage{@xitemx while not in a table}}
-
-% Contains a kludge to get @end[description] to work.
-\def\description{\tablez{\dontindex}{1}{}{}{}{}}
-
-% @table, @ftable, @vtable.
-\def\table{\begingroup\inENV\obeylines\obeyspaces\tablex}
-{\obeylines\obeyspaces%
-\gdef\tablex #1^^M{%
-\tabley\dontindex#1        \endtabley}}
-
-\def\ftable{\begingroup\inENV\obeylines\obeyspaces\ftablex}
-{\obeylines\obeyspaces%
-\gdef\ftablex #1^^M{%
-\tabley\fnitemindex#1        \endtabley
-\def\Eftable{\endgraf\afterenvbreak\endgroup}%
-\let\Etable=\relax}}
-
-\def\vtable{\begingroup\inENV\obeylines\obeyspaces\vtablex}
-{\obeylines\obeyspaces%
-\gdef\vtablex #1^^M{%
-\tabley\vritemindex#1        \endtabley
-\def\Evtable{\endgraf\afterenvbreak\endgroup}%
-\let\Etable=\relax}}
-
-\def\dontindex #1{}
-\def\fnitemindex #1{\doind {fn}{\code{#1}}}%
-\def\vritemindex #1{\doind {vr}{\code{#1}}}%
-
-{\obeyspaces %
-\gdef\tabley#1#2 #3 #4 #5 #6 #7\endtabley{\endgroup%
-\tablez{#1}{#2}{#3}{#4}{#5}{#6}}}
-
-\def\tablez #1#2#3#4#5#6{%
-\aboveenvbreak %
-\begingroup %
-\def\Edescription{\Etable}% Necessary kludge.
-\let\itemindex=#1%
-\ifnum 0#3>0 \advance \leftskip by #3\mil \fi %
-\ifnum 0#4>0 \tableindent=#4\mil \fi %
-\ifnum 0#5>0 \advance \rightskip by #5\mil \fi %
-\def\itemfont{#2}%
-\itemmax=\tableindent %
-\advance \itemmax by -\itemmargin %
-\advance \leftskip by \tableindent %
-\exdentamount=\tableindent
-\parindent = 0pt
-\parskip = \smallskipamount
-\ifdim \parskip=0pt \parskip=2pt \fi%
-\def\Etable{\endgraf\afterenvbreak\endgroup}%
-\let\item = \internalBitem %
-\let\itemx = \internalBitemx %
-\let\kitem = \internalBkitem %
-\let\kitemx = \internalBkitemx %
-\let\xitem = \internalBxitem %
-\let\xitemx = \internalBxitemx %
-}
-
-% This is the counter used by @enumerate, which is really @itemize
-
-\newcount \itemno
-
-\def\itemize{\parsearg\itemizezzz}
-
-\def\itemizezzz #1{%
-  \begingroup % ended by the @end itemize
-  \itemizey {#1}{\Eitemize}
-}
-
-\def\itemizey#1#2{%
-  \aboveenvbreak
-  \itemmax=\itemindent
-  \advance\itemmax by -\itemmargin
-  \advance\leftskip by \itemindent
-  \exdentamount=\itemindent
-  \parindent=0pt
-  \parskip=\smallskipamount
-  \ifdim\parskip=0pt \parskip=2pt \fi
-  \def#2{\endgraf\afterenvbreak\endgroup}%
-  \def\itemcontents{#1}%
-  % @itemize with no arg is equivalent to @itemize @bullet.
-  \ifx\itemcontents\empty\def\itemcontents{\bullet}\fi
-  \let\item=\itemizeitem
-}
-
-% \splitoff TOKENS\endmark defines \first to be the first token in
-% TOKENS, and \rest to be the remainder.
-%
-\def\splitoff#1#2\endmark{\def\first{#1}\def\rest{#2}}%
-
-% Allow an optional argument of an uppercase letter, lowercase letter,
-% or number, to specify the first label in the enumerated list.  No
-% argument is the same as `1'.
-%
-\def\enumerate{\parsearg\enumeratezzz}
-\def\enumeratezzz #1{\enumeratey #1  \endenumeratey}
-\def\enumeratey #1 #2\endenumeratey{%
-  \begingroup % ended by the @end enumerate
-  %
-  % If we were given no argument, pretend we were given `1'.
-  \def\thearg{#1}%
-  \ifx\thearg\empty \def\thearg{1}\fi
-  %
-  % Detect if the argument is a single token.  If so, it might be a
-  % letter.  Otherwise, the only valid thing it can be is a number.
-  % (We will always have one token, because of the test we just made.
-  % This is a good thing, since \splitoff doesn't work given nothing at
-  % all -- the first parameter is undelimited.)
-  \expandafter\splitoff\thearg\endmark
-  \ifx\rest\empty
-    % Only one token in the argument.  It could still be anything.
-    % A ``lowercase letter'' is one whose \lccode is nonzero.
-    % An ``uppercase letter'' is one whose \lccode is both nonzero, and
-    %   not equal to itself.
-    % Otherwise, we assume it's a number.
-    %
-    % We need the \relax at the end of the \ifnum lines to stop TeX from
-    % continuing to look for a <number>.
-    %
-    \ifnum\lccode\expandafter`\thearg=0\relax
-      \numericenumerate % a number (we hope)
-    \else
-      % It's a letter.
-      \ifnum\lccode\expandafter`\thearg=\expandafter`\thearg\relax
-        \lowercaseenumerate % lowercase letter
-      \else
-        \uppercaseenumerate % uppercase letter
-      \fi
-    \fi
-  \else
-    % Multiple tokens in the argument.  We hope it's a number.
-    \numericenumerate
-  \fi
-}
-
-% An @enumerate whose labels are integers.  The starting integer is
-% given in \thearg.
-%
-\def\numericenumerate{%
-  \itemno = \thearg
-  \startenumeration{\the\itemno}%
-}
-
-% The starting (lowercase) letter is in \thearg.
-\def\lowercaseenumerate{%
-  \itemno = \expandafter`\thearg
-  \startenumeration{%
-    % Be sure we're not beyond the end of the alphabet.
-    \ifnum\itemno=0
-      \errmessage{No more lowercase letters in @enumerate; get a bigger
-                  alphabet}%
-    \fi
-    \char\lccode\itemno
-  }%
-}
-
-% The starting (uppercase) letter is in \thearg.
-\def\uppercaseenumerate{%
-  \itemno = \expandafter`\thearg
-  \startenumeration{%
-    % Be sure we're not beyond the end of the alphabet.
-    \ifnum\itemno=0
-      \errmessage{No more uppercase letters in @enumerate; get a bigger
-                  alphabet}
-    \fi
-    \char\uccode\itemno
-  }%
-}
-
-% Call itemizey, adding a period to the first argument and supplying the
-% common last two arguments.  Also subtract one from the initial value in
-% \itemno, since @item increments \itemno.
-%
-\def\startenumeration#1{%
-  \advance\itemno by -1
-  \itemizey{#1.}\Eenumerate\flushcr
-}
-
-% @alphaenumerate and @capsenumerate are abbreviations for giving an arg
-% to @enumerate.
-%
-\def\alphaenumerate{\enumerate{a}}
-\def\capsenumerate{\enumerate{A}}
-\def\Ealphaenumerate{\Eenumerate}
-\def\Ecapsenumerate{\Eenumerate}
-
-% Definition of @item while inside @itemize.
-
-\def\itemizeitem{%
-\advance\itemno by 1
-{\let\par=\endgraf \smallbreak}%
-\ifhmode \errmessage{In hmode at itemizeitem}\fi
-{\parskip=0in \hskip 0pt
-\hbox to 0pt{\hss \itemcontents\hskip \itemmargin}%
-\vadjust{\penalty 1200}}%
-\flushcr}
-
-% @multitable macros
-% Amy Hendrickson, 8/18/94, 3/6/96
-%
-% @multitable ... @end multitable will make as many columns as desired.
-% Contents of each column will wrap at width given in preamble.  Width
-% can be specified either with sample text given in a template line,
-% or in percent of \hsize, the current width of text on page.
-
-% Table can continue over pages but will only break between lines.
-
-% To make preamble:
-%
-% Either define widths of columns in terms of percent of \hsize:
-%   @multitable @columnfractions .25 .3 .45
-%   @item ...
-%
-%   Numbers following @columnfractions are the percent of the total
-%   current hsize to be used for each column. You may use as many
-%   columns as desired.
-
-
-% Or use a template:
-%   @multitable {Column 1 template} {Column 2 template} {Column 3 template}
-%   @item ...
-%   using the widest term desired in each column.
-%
-% For those who want to use more than one line's worth of words in
-% the preamble, break the line within one argument and it
-% will parse correctly, i.e.,
-%
-%     @multitable {Column 1 template} {Column 2 template} {Column 3
-%      template}
-% Not:
-%     @multitable {Column 1 template} {Column 2 template}
-%      {Column 3 template}
-
-% Each new table line starts with @item, each subsequent new column
-% starts with @tab. Empty columns may be produced by supplying @tab's
-% with nothing between them for as many times as empty columns are needed,
-% ie, @tab@tab@tab will produce two empty columns.
-
-% @item, @tab, @multitable or @end multitable do not need to be on their
-% own lines, but it will not hurt if they are.
-
-% Sample multitable:
-
-%   @multitable {Column 1 template} {Column 2 template} {Column 3 template}
-%   @item first col stuff @tab second col stuff @tab third col
-%   @item
-%   first col stuff
-%   @tab
-%   second col stuff
-%   @tab
-%   third col
-%   @item first col stuff @tab second col stuff
-%   @tab Many paragraphs of text may be used in any column.
-%
-%         They will wrap at the width determined by the template.
-%   @item@tab@tab This will be in third column.
-%   @end multitable
-
-% Default dimensions may be reset by user.
-% @multitableparskip is vertical space between paragraphs in table.
-% @multitableparindent is paragraph indent in table.
-% @multitablecolmargin is horizontal space to be left between columns.
-% @multitablelinespace is space to leave between table items, baseline
-%                                                            to baseline.
-%   0pt means it depends on current normal line spacing.
-%
-\newskip\multitableparskip
-\newskip\multitableparindent
-\newdimen\multitablecolspace
-\newskip\multitablelinespace
-\multitableparskip=0pt
-\multitableparindent=6pt
-\multitablecolspace=12pt
-\multitablelinespace=0pt
-
-% Macros used to set up halign preamble:
-%
-\let\endsetuptable\relax
-\def\xendsetuptable{\endsetuptable}
-\let\columnfractions\relax
-\def\xcolumnfractions{\columnfractions}
-\newif\ifsetpercent
-
-% #1 is the part of the @columnfraction before the decimal point, which
-% is presumably either 0 or the empty string (but we don't check, we
-% just throw it away).  #2 is the decimal part, which we use as the
-% percent of \hsize for this column.
-\def\pickupwholefraction#1.#2 {%
-  \global\advance\colcount by 1
-  \expandafter\xdef\csname col\the\colcount\endcsname{.#2\hsize}%
-  \setuptable
-}
-
-\newcount\colcount
-\def\setuptable#1{%
-  \def\firstarg{#1}%
-  \ifx\firstarg\xendsetuptable
-    \let\go = \relax
-  \else
-    \ifx\firstarg\xcolumnfractions
-      \global\setpercenttrue
-    \else
-      \ifsetpercent
-         \let\go\pickupwholefraction
-      \else
-         \global\advance\colcount by 1
-         \setbox0=\hbox{#1\unskip\space}% Add a normal word space as a
-                   % separator; typically that is always in the input, anyway.
-         \expandafter\xdef\csname col\the\colcount\endcsname{\the\wd0}%
-      \fi
-    \fi
-    \ifx\go\pickupwholefraction
-      % Put the argument back for the \pickupwholefraction call, so
-      % we'll always have a period there to be parsed.
-      \def\go{\pickupwholefraction#1}%
-    \else
-      \let\go = \setuptable
-    \fi%
-  \fi
-  \go
-}
-
-% @multitable ... @end multitable definitions:
-%
-\def\multitable{\parsearg\dotable}
-\def\dotable#1{\bgroup
-  \vskip\parskip
-  \let\item=\crcrwithfootnotes
-  % A \tab used to include \hskip1sp.  But then the space in a template
-  % line is not enough.  That is bad.  So let's go back to just & until
-  % we encounter the problem it was intended to solve again.  --karl,
-  % nathan@acm.org, 20apr99.
-  \let\tab=&%
-  \let\startfootins=\startsavedfootnote
-  \tolerance=9500
-  \hbadness=9500
-  \setmultitablespacing
-  \parskip=\multitableparskip
-  \parindent=\multitableparindent
-  \overfullrule=0pt
-  \global\colcount=0
-  \def\Emultitable{%
-    \global\setpercentfalse
-    \crcrwithfootnotes\crcr
-    \egroup\egroup
-  }%
-  %
-  % To parse everything between @multitable and @item:
-  \setuptable#1 \endsetuptable
-  %
-  % \everycr will reset column counter, \colcount, at the end of
-  % each line. Every column entry will cause \colcount to advance by one.
-  % The table preamble
-  % looks at the current \colcount to find the correct column width.
-  \everycr{\noalign{%
-  %
-  % \filbreak%% keeps underfull box messages off when table breaks over pages.
-  % Maybe so, but it also creates really weird page breaks when the table
-  % breaks over pages. Wouldn't \vfil be better?  Wait until the problem
-  % manifests itself, so it can be fixed for real --karl.
-    \global\colcount=0\relax}}%
-  %
-  % This preamble sets up a generic column definition, which will
-  % be used as many times as user calls for columns.
-  % \vtop will set a single line and will also let text wrap and
-  % continue for many paragraphs if desired.
-  \halign\bgroup&\global\advance\colcount by 1\relax
-    \multistrut\vtop{\hsize=\expandafter\csname col\the\colcount\endcsname
-  %
-  % In order to keep entries from bumping into each other
-  % we will add a \leftskip of \multitablecolspace to all columns after
-  % the first one.
-  %
-  % If a template has been used, we will add \multitablecolspace
-  % to the width of each template entry.
-  %
-  % If the user has set preamble in terms of percent of \hsize we will
-  % use that dimension as the width of the column, and the \leftskip
-  % will keep entries from bumping into each other.  Table will start at
-  % left margin and final column will justify at right margin.
-  %
-  % Make sure we don't inherit \rightskip from the outer environment.
-  \rightskip=0pt
-  \ifnum\colcount=1
-    % The first column will be indented with the surrounding text.
-    \advance\hsize by\leftskip
-  \else
-    \ifsetpercent \else
-      % If user has not set preamble in terms of percent of \hsize
-      % we will advance \hsize by \multitablecolspace.
-      \advance\hsize by \multitablecolspace
-    \fi
-   % In either case we will make \leftskip=\multitablecolspace:
-  \leftskip=\multitablecolspace
-  \fi
-  % Ignoring space at the beginning and end avoids an occasional spurious
-  % blank line, when TeX decides to break the line at the space before the
-  % box from the multistrut, so the strut ends up on a line by itself.
-  % For example:
-  % @multitable @columnfractions .11 .89
-  % @item @code{#}
-  % @tab Legal holiday which is valid in major parts of the whole country.
-  % Is automatically provided with highlighting sequences respectively marking
-  % characters.
-  \noindent\ignorespaces##\unskip\multistrut}\cr
-}
-
-\def\setmultitablespacing{% test to see if user has set \multitablelinespace.
-% If so, do nothing. If not, give it an appropriate dimension based on
-% current baselineskip.
-\ifdim\multitablelinespace=0pt
-\setbox0=\vbox{X}\global\multitablelinespace=\the\baselineskip
-\global\advance\multitablelinespace by-\ht0
-%% strut to put in table in case some entry doesn't have descenders,
-%% to keep lines equally spaced
-\let\multistrut = \strut
-\else
-%% FIXME: what is \box0 supposed to be?
-\gdef\multistrut{\vrule height\multitablelinespace depth\dp0
-width0pt\relax} \fi
-%% Test to see if parskip is larger than space between lines of
-%% table. If not, do nothing.
-%%        If so, set to same dimension as multitablelinespace.
-\ifdim\multitableparskip>\multitablelinespace
-\global\multitableparskip=\multitablelinespace
-\global\advance\multitableparskip-7pt %% to keep parskip somewhat smaller
-                                      %% than skip between lines in the table.
-\fi%
-\ifdim\multitableparskip=0pt
-\global\multitableparskip=\multitablelinespace
-\global\advance\multitableparskip-7pt %% to keep parskip somewhat smaller
-                                      %% than skip between lines in the table.
-\fi}
-
-% In case a @footnote appears inside an alignment, save the footnote
-% text to a box and make the \insert when a row of the table is
-% finished.  Otherwise, the insertion is lost, it never migrates to the
-% main vertical list.  --kasal, 22jan03.
-%
-\newbox\savedfootnotes
-%
-% \dotable \let's \startfootins to this, so that \dofootnote will call
-% it instead of starting the insertion right away.
-\def\startsavedfootnote{%
-  \global\setbox\savedfootnotes = \vbox\bgroup
-    \unvbox\savedfootnotes
-}
-\def\crcrwithfootnotes{%
-  \crcr
-  \ifvoid\savedfootnotes \else
-    \noalign{\insert\footins{\box\savedfootnotes}}%
-  \fi
-}
-
-\message{conditionals,}
-% Prevent errors for section commands.
-% Used in @ignore and in failing conditionals.
-\def\ignoresections{%
-  \let\appendix=\relax
-  \let\appendixsec=\relax
-  \let\appendixsection=\relax
-  \let\appendixsubsec=\relax
-  \let\appendixsubsection=\relax
-  \let\appendixsubsubsec=\relax
-  \let\appendixsubsubsection=\relax
-  %\let\begin=\relax
-  %\let\bye=\relax
-  \let\centerchap=\relax
-  \let\chapter=\relax
-  \let\contents=\relax
-  \let\section=\relax
-  \let\smallbook=\relax
-  \let\subsec=\relax
-  \let\subsection=\relax
-  \let\subsubsec=\relax
-  \let\subsubsection=\relax
-  \let\titlepage=\relax
-  \let\top=\relax
-  \let\unnumbered=\relax
-  \let\unnumberedsec=\relax
-  \let\unnumberedsection=\relax
-  \let\unnumberedsubsec=\relax
-  \let\unnumberedsubsection=\relax
-  \let\unnumberedsubsubsec=\relax
-  \let\unnumberedsubsubsection=\relax
-}
-
-% Ignore @ignore, @ifhtml, @ifinfo, and the like.
-%
-\def\direntry{\doignore{direntry}}
-\def\documentdescriptionword{documentdescription}
-\def\documentdescription{\doignore{documentdescription}}
-\def\html{\doignore{html}}
-\def\ifhtml{\doignore{ifhtml}}
-\def\ifinfo{\doignore{ifinfo}}
-\def\ifnottex{\doignore{ifnottex}}
-\def\ifplaintext{\doignore{ifplaintext}}
-\def\ifxml{\doignore{ifxml}}
-\def\ignore{\doignore{ignore}}
-\def\menu{\doignore{menu}}
-\def\xml{\doignore{xml}}
-
-% @dircategory CATEGORY  -- specify a category of the dir file
-% which this file should belong to.  Ignore this in TeX.
-\let\dircategory = \comment
-
-% Ignore text until a line `@end #1', keeping track of nested conditionals.
-%
-% A count to remember the depth of nesting.
-\newcount\doignorecount
-
-\def\doignore#1{\begingroup
-  % Don't complain about control sequences we have declared \outer.
-  \ignoresections
-  %
-  % Make sure that spaces turn into tokens that match what \doignoretext wants.
-  \catcode\spaceChar = 10
-  %
-  % Ignore braces, so mismatched braces don't cause trouble.
-  \catcode`\{ = 9
-  \catcode`\} = 9
-  %
-  % Count number of #1's that we've seen.
-  \doignorecount = 0
-  %
-  % Swallow text until we reach the matching `@end #1'.
-  \expandafter \dodoignore \csname#1\endcsname {#1}%
-}
-
-{ \catcode`@=11 % We want to use \ST@P which cannot appear in texinfo source.
-  \obeylines %
-  %
-  \gdef\dodoignore#1#2{%
-    % #1 contains, e.g., \ifinfo, a.k.a. @ifinfo.
-    % #2 contains the string `ifinfo'.
-    %
-    % Define a command to find the next `@end #2', which must be on a line
-    % by itself.
-    \long\def\doignoretext##1^^M\end #2{\doignoretextyyy##1^^M#1\ST@P}%
-    % And this command to find another #1 command, at the beginning of a
-    % line.  (Otherwise, we would consider a line `@c @ifset', for
-    % example, to count as an @ifset for nesting.)
-    \long\def\doignoretextyyy##1^^M#1##2\ST@P{\doignoreyyy{##2}\ST@P}%
-    %
-    % And now expand that command.
-    \obeylines %
-    \doignoretext ^^M%
-  }%
-}
-
-\def\doignoreyyy#1{%
-  \def\temp{#1}%
-  \ifx\temp\empty                      % Nothing found.
-    \let\next\doignoretextzzz
-  \else                                        % Found a nested condition, ...
-    \advance\doignorecount by 1
-    \let\next\doignoretextyyy          % ..., look for another.
-    % If we're here, #1 ends with ^^M\ifinfo (for example).
-  \fi
-  \next #1% the token \ST@P is present just after this macro.
-}
-
-% We have to swallow the remaining "\ST@P".
-% 
-\def\doignoretextzzz#1{%
-  \ifnum\doignorecount = 0     % We have just found the outermost @end.
-    \let\next\enddoignore
-  \else                                % Still inside a nested condition.
-    \advance\doignorecount by -1
-    \let\next\doignoretext      % Look for the next @end.
-  \fi
-  \next
-}
-
-% Finish off ignored text.
-\def\enddoignore{\endgroup\ignorespaces}
-
-
-% @set VAR sets the variable VAR to an empty value.
-% @set VAR REST-OF-LINE sets VAR to the value REST-OF-LINE.
-%
-% Since we want to separate VAR from REST-OF-LINE (which might be
-% empty), we can't just use \parsearg; we have to insert a space of our
-% own to delimit the rest of the line, and then take it out again if we
-% didn't need it.  Make sure the catcode of space is correct to avoid
-% losing inside @example, for instance.
-%
-\def\set{\begingroup\catcode` =10
-  \catcode`\-=12 \catcode`\_=12 % Allow - and _ in VAR.
-  \parsearg\setxxx}
-\def\setxxx#1{\setyyy#1 \endsetyyy}
-\def\setyyy#1 #2\endsetyyy{%
-  \def\temp{#2}%
-  \ifx\temp\empty \global\expandafter\let\csname SET#1\endcsname = \empty
-  \else \setzzz{#1}#2\endsetzzz % Remove the trailing space \setxxx inserted.
-  \fi
-  \endgroup
-}
-% Can't use \xdef to pre-expand #2 and save some time, since \temp or
-% \next or other control sequences that we've defined might get us into
-% an infinite loop. Consider `@set foo @cite{bar}'.
-\def\setzzz#1#2 \endsetzzz{\expandafter\gdef\csname SET#1\endcsname{#2}}
-
-% @clear VAR clears (i.e., unsets) the variable VAR.
-%
-\def\clear{\parsearg\clearxxx}
-\def\clearxxx#1{\global\expandafter\let\csname SET#1\endcsname=\relax}
-
-% @value{foo} gets the text saved in variable foo.
-{
-  \catcode`\_ = \active
-  %
-  % We might end up with active _ or - characters in the argument if
-  % we're called from @code, as @code{@value{foo-bar_}}.  So \let any
-  % such active characters to their normal equivalents.
-  \gdef\value{\begingroup
-    \catcode`\-=\other \catcode`\_=\other
-    \indexbreaks \let_\normalunderscore
-    \valuexxx}
-}
-\def\valuexxx#1{\expandablevalue{#1}\endgroup}
-
-% We have this subroutine so that we can handle at least some @value's
-% properly in indexes (we \let\value to this in \indexdummies).  Ones
-% whose names contain - or _ still won't work, but we can't do anything
-% about that.  The command has to be fully expandable (if the variable
-% is set), since the result winds up in the index file.  This means that
-% if the variable's value contains other Texinfo commands, it's almost
-% certain it will fail (although perhaps we could fix that with
-% sufficient work to do a one-level expansion on the result, instead of
-% complete).
-%
-\def\expandablevalue#1{%
-  \expandafter\ifx\csname SET#1\endcsname\relax
-    {[No value for ``#1'']}%
-    \message{Variable `#1', used in @value, is not set.}%
-  \else
-    \csname SET#1\endcsname
-  \fi
-}
-
-% @ifset VAR ... @end ifset reads the `...' iff VAR has been defined
-% with @set.
-%
-\def\ifset{\parsearg\doifset}
-\def\doifset#1{%
-  \expandafter\ifx\csname SET#1\endcsname\relax
-    \let\next=\ifsetfail
-  \else
-    \let\next=\ifsetsucceed
-  \fi
-  \next
-}
-\def\ifsetsucceed{\conditionalsucceed{ifset}}
-\def\ifsetfail{\doignore{ifset}}
-\defineunmatchedend{ifset}
-
-% @ifclear VAR ... @end ifclear reads the `...' iff VAR has never been
-% defined with @set, or has been undefined with @clear.
-%
-\def\ifclear{\parsearg\doifclear}
-\def\doifclear#1{%
-  \expandafter\ifx\csname SET#1\endcsname\relax
-    \let\next=\ifclearsucceed
-  \else
-    \let\next=\ifclearfail
-  \fi
-  \next
-}
-\def\ifclearsucceed{\conditionalsucceed{ifclear}}
-\def\ifclearfail{\doignore{ifclear}}
-\defineunmatchedend{ifclear}
-
-% @iftex, @ifnothtml, @ifnotinfo, @ifnotplaintext always succeed; we
-% read the text following, through the first @end iftex (etc.).  Make
-% `@end iftex' (etc.) valid only after an @iftex.
-%
-\def\iftex{\conditionalsucceed{iftex}}
-\def\ifnothtml{\conditionalsucceed{ifnothtml}}
-\def\ifnotinfo{\conditionalsucceed{ifnotinfo}}
-\def\ifnotplaintext{\conditionalsucceed{ifnotplaintext}}
-\defineunmatchedend{iftex}
-\defineunmatchedend{ifnothtml}
-\defineunmatchedend{ifnotinfo}
-\defineunmatchedend{ifnotplaintext}
-
-% True conditional.  Since \set globally defines its variables, we can
-% just start and end a group (to keep the @end definition undefined at
-% the outer level).
-%
-\def\conditionalsucceed#1{\begingroup
-  \expandafter\def\csname E#1\endcsname{\endgroup}%
-}
-
-% @defininfoenclose.
-\let\definfoenclose=\comment
-
-
-\message{indexing,}
-% Index generation facilities
-
-% Define \newwrite to be identical to plain tex's \newwrite
-% except not \outer, so it can be used within \newindex.
-{\catcode`\@=11
-\gdef\newwrite{\alloc@7\write\chardef\sixt@@n}}
-
-% \newindex {foo} defines an index named foo.
-% It automatically defines \fooindex such that
-% \fooindex ...rest of line... puts an entry in the index foo.
-% It also defines \fooindfile to be the number of the output channel for
-% the file that accumulates this index.  The file's extension is foo.
-% The name of an index should be no more than 2 characters long
-% for the sake of vms.
-%
-\def\newindex#1{%
-  \iflinks
-    \expandafter\newwrite \csname#1indfile\endcsname
-    \openout \csname#1indfile\endcsname \jobname.#1 % Open the file
-  \fi
-  \expandafter\xdef\csname#1index\endcsname{%     % Define @#1index
-    \noexpand\doindex{#1}}
-}
-
-% @defindex foo  ==  \newindex{foo}
-%
-\def\defindex{\parsearg\newindex}
-
-% Define @defcodeindex, like @defindex except put all entries in @code.
-%
-\def\defcodeindex{\parsearg\newcodeindex}
-%
-\def\newcodeindex#1{%
-  \iflinks
-    \expandafter\newwrite \csname#1indfile\endcsname
-    \openout \csname#1indfile\endcsname \jobname.#1
-  \fi
-  \expandafter\xdef\csname#1index\endcsname{%
-    \noexpand\docodeindex{#1}}%
-}
-
-
-% @synindex foo bar    makes index foo feed into index bar.
-% Do this instead of @defindex foo if you don't want it as a separate index.
-%
-% @syncodeindex foo bar   similar, but put all entries made for index foo
-% inside @code.
-%
-\def\synindex#1 #2 {\dosynindex\doindex{#1}{#2}}
-\def\syncodeindex#1 #2 {\dosynindex\docodeindex{#1}{#2}}
-
-% #1 is \doindex or \docodeindex, #2 the index getting redefined (foo),
-% #3 the target index (bar).
-\def\dosynindex#1#2#3{%
-  % Only do \closeout if we haven't already done it, else we'll end up
-  % closing the target index.
-  \expandafter \ifx\csname donesynindex#2\endcsname \undefined
-    % The \closeout helps reduce unnecessary open files; the limit on the
-    % Acorn RISC OS is a mere 16 files.
-    \expandafter\closeout\csname#2indfile\endcsname
-    \expandafter\let\csname\donesynindex#2\endcsname = 1
-  \fi
-  % redefine \fooindfile:
-  \expandafter\let\expandafter\temp\expandafter=\csname#3indfile\endcsname
-  \expandafter\let\csname#2indfile\endcsname=\temp
-  % redefine \fooindex:
-  \expandafter\xdef\csname#2index\endcsname{\noexpand#1{#3}}%
-}
-
-% Define \doindex, the driver for all \fooindex macros.
-% Argument #1 is generated by the calling \fooindex macro,
-%  and it is "foo", the name of the index.
-
-% \doindex just uses \parsearg; it calls \doind for the actual work.
-% This is because \doind is more useful to call from other macros.
-
-% There is also \dosubind {index}{topic}{subtopic}
-% which makes an entry in a two-level index such as the operation index.
-
-\def\doindex#1{\edef\indexname{#1}\parsearg\singleindexer}
-\def\singleindexer #1{\doind{\indexname}{#1}}
-
-% like the previous two, but they put @code around the argument.
-\def\docodeindex#1{\edef\indexname{#1}\parsearg\singlecodeindexer}
-\def\singlecodeindexer #1{\doind{\indexname}{\code{#1}}}
-
-% Take care of Texinfo commands that can appear in an index entry.
-% Since there are some commands we want to expand, and others we don't,
-% we have to laboriously prevent expansion for those that we don't.
-%
-\def\indexdummies{%
-  \def\@{@}% change to @@ when we switch to @ as escape char in index files.
-  \def\ {\realbackslash\space }%
-  % Need these in case \tex is in effect and \{ is a \delimiter again.
-  % But can't use \lbracecmd and \rbracecmd because texindex assumes
-  % braces and backslashes are used only as delimiters.
-  \let\{ = \mylbrace
-  \let\} = \myrbrace
-  %
-  % \definedummyword defines \#1 as \realbackslash #1\space, thus
-  % effectively preventing its expansion.  This is used only for control
-  % words, not control letters, because the \space would be incorrect
-  % for control characters, but is needed to separate the control word
-  % from whatever follows.
-  %
-  % For control letters, we have \definedummyletter, which omits the
-  % space.
-  %
-  % These can be used both for control words that take an argument and
-  % those that do not.  If it is followed by {arg} in the input, then
-  % that will dutifully get written to the index (or wherever).
-  %
-  \def\definedummyword##1{%
-    \expandafter\def\csname ##1\endcsname{\realbackslash ##1\space}%
-  }%
-  \def\definedummyletter##1{%
-    \expandafter\def\csname ##1\endcsname{\realbackslash ##1}%
-  }%
-  %
-  % Do the redefinitions.
-  \commondummies
-}
-
-% For the aux file, @ is the escape character.  So we want to redefine
-% everything using @ instead of \realbackslash.  When everything uses
-% @, this will be simpler.
-%
-\def\atdummies{%
-  \def\@{@@}%
-  \def\ {@ }%
-  \let\{ = \lbraceatcmd
-  \let\} = \rbraceatcmd
-  %
-  % (See comments in \indexdummies.)
-  \def\definedummyword##1{%
-    \expandafter\def\csname ##1\endcsname{@##1\space}%
-  }%
-  \def\definedummyletter##1{%
-    \expandafter\def\csname ##1\endcsname{@##1}%
-  }%
-  %
-  % Do the redefinitions.
-  \commondummies
-}
-
-% Called from \indexdummies and \atdummies.  \definedummyword and
-% \definedummyletter must be defined first.
-%
-\def\commondummies{%
-  %
-  \normalturnoffactive
-  %
-  % Control letters and accents.
-  \definedummyletter{_}%
-  \definedummyletter{,}%
-  \definedummyletter{"}%
-  \definedummyletter{`}%
-  \definedummyletter{'}%
-  \definedummyletter{^}%
-  \definedummyletter{~}%
-  \definedummyletter{=}%
-  \definedummyword{u}%
-  \definedummyword{v}%
-  \definedummyword{H}%
-  \definedummyword{dotaccent}%
-  \definedummyword{ringaccent}%
-  \definedummyword{tieaccent}%
-  \definedummyword{ubaraccent}%
-  \definedummyword{udotaccent}%
-  \definedummyword{dotless}%
-  %
-  % Other non-English letters.
-  \definedummyword{AA}%
-  \definedummyword{AE}%
-  \definedummyword{L}%
-  \definedummyword{OE}%
-  \definedummyword{O}%
-  \definedummyword{aa}%
-  \definedummyword{ae}%
-  \definedummyword{l}%
-  \definedummyword{oe}%
-  \definedummyword{o}%
-  \definedummyword{ss}%
-  %
-  % Although these internal commands shouldn't show up, sometimes they do.
-  \definedummyword{bf}%
-  \definedummyword{gtr}%
-  \definedummyword{hat}%
-  \definedummyword{less}%
-  \definedummyword{sf}%
-  \definedummyword{sl}%
-  \definedummyword{tclose}%
-  \definedummyword{tt}%
-  %
-  % Texinfo font commands.
-  \definedummyword{b}%
-  \definedummyword{i}%
-  \definedummyword{r}%
-  \definedummyword{sc}%
-  \definedummyword{t}%
-  %
-  \definedummyword{TeX}%
-  \definedummyword{acronym}%
-  \definedummyword{cite}%
-  \definedummyword{code}%
-  \definedummyword{command}%
-  \definedummyword{dfn}%
-  \definedummyword{dots}%
-  \definedummyword{emph}%
-  \definedummyword{env}%
-  \definedummyword{file}%
-  \definedummyword{kbd}%
-  \definedummyword{key}%
-  \definedummyword{math}%
-  \definedummyword{option}%
-  \definedummyword{samp}%
-  \definedummyword{strong}%
-  \definedummyword{uref}%
-  \definedummyword{url}%
-  \definedummyword{var}%
-  \definedummyword{verb}%
-  \definedummyword{w}%
-  %
-  % Assorted special characters.
-  \definedummyword{bullet}%
-  \definedummyword{copyright}%
-  \definedummyword{dots}%
-  \definedummyword{enddots}%
-  \definedummyword{equiv}%
-  \definedummyword{error}%
-  \definedummyword{expansion}%
-  \definedummyword{minus}%
-  \definedummyword{pounds}%
-  \definedummyword{point}%
-  \definedummyword{print}%
-  \definedummyword{result}%
-  %
-  % Handle some cases of @value -- where the variable name does not
-  % contain - or _, and the value does not contain any
-  % (non-fully-expandable) commands.
-  \let\value = \expandablevalue
-  %
-  % Normal spaces, not active ones.
-  \unsepspaces
-  %
-  % No macro expansion.
-  \turnoffmacros
-}
-
-% If an index command is used in an @example environment, any spaces
-% therein should become regular spaces in the raw index file, not the
-% expansion of \tie (\leavevmode \penalty \@M \ ).
-{\obeyspaces
- \gdef\unsepspaces{\obeyspaces\let =\space}}
-
-
-% \indexnofonts is used when outputting the strings to sort the index
-% by, and when constructing control sequence names.  It eliminates all
-% control sequences and just writes whatever the best ASCII sort string
-% would be for a given command (usually its argument).
-%
-\def\indexdummytex{TeX}
-\def\indexdummydots{...}
-%
-\def\indexnofonts{%
-  \def\ { }%
-  \def\@{@}%
-  % how to handle braces?
-  \def\_{\normalunderscore}%
-  %
-  \let\,=\asis
-  \let\"=\asis
-  \let\`=\asis
-  \let\'=\asis
-  \let\^=\asis
-  \let\~=\asis
-  \let\==\asis
-  \let\u=\asis
-  \let\v=\asis
-  \let\H=\asis
-  \let\dotaccent=\asis
-  \let\ringaccent=\asis
-  \let\tieaccent=\asis
-  \let\ubaraccent=\asis
-  \let\udotaccent=\asis
-  \let\dotless=\asis
-  %
-  % Other non-English letters.
-  \def\AA{AA}%
-  \def\AE{AE}%
-  \def\L{L}%
-  \def\OE{OE}%
-  \def\O{O}%
-  \def\aa{aa}%
-  \def\ae{ae}%
-  \def\l{l}%
-  \def\oe{oe}%
-  \def\o{o}%
-  \def\ss{ss}%
-  \def\exclamdown{!}%
-  \def\questiondown{?}%
-  %
-  % Don't no-op \tt, since it isn't a user-level command
-  % and is used in the definitions of the active chars like <, >, |, etc.
-  % Likewise with the other plain tex font commands.
-  %\let\tt=\asis
-  %
-  % Texinfo font commands.
-  \let\b=\asis
-  \let\i=\asis
-  \let\r=\asis
-  \let\sc=\asis
-  \let\t=\asis
-  %
-  \let\TeX=\indexdummytex
-  \let\acronym=\asis
-  \let\cite=\asis
-  \let\code=\asis
-  \let\command=\asis
-  \let\dfn=\asis
-  \let\dots=\indexdummydots
-  \let\emph=\asis
-  \let\env=\asis
-  \let\file=\asis
-  \let\kbd=\asis
-  \let\key=\asis
-  \let\math=\asis
-  \let\option=\asis
-  \let\samp=\asis
-  \let\strong=\asis
-  \let\uref=\asis
-  \let\url=\asis
-  \let\var=\asis
-  \let\verb=\asis
-  \let\w=\asis
-}
-
-\let\indexbackslash=0  %overridden during \printindex.
-\let\SETmarginindex=\relax % put index entries in margin (undocumented)?
-
-% Most index entries go through here, but \dosubind is the general case.
-%
-\def\doind#1#2{\dosubind{#1}{#2}{}}
-
-% Workhorse for all \fooindexes.
-% #1 is name of index, #2 is stuff to put there, #3 is subentry --
-% \empty if called from \doind, as we usually are.  The main exception
-% is with defuns, which call us directly.
-%
-\def\dosubind#1#2#3{%
-  \iflinks
-  {%
-    % Store the main index entry text (including the third arg).
-    \toks0 = {#2}%
-    % If third arg is present, precede it with space.
-    \def\thirdarg{#3}%
-    \ifx\thirdarg\empty \else
-      \toks0 = \expandafter{\the\toks0 \space #3}%
-    \fi
-    %
-    \edef\writeto{\csname#1indfile\endcsname}%
-    %
-    \ifvmode
-      \dosubindsanitize
-    \else
-      \dosubindwrite
-    \fi
-  }%
-  \fi
-}
-
-% Write the entry to the index file:
-%
-\def\dosubindwrite{%
-  % Put the index entry in the margin if desired.
-  \ifx\SETmarginindex\relax\else
-    \insert\margin{\hbox{\vrule height8pt depth3pt width0pt \the\toks0}}%
-  \fi
-  %
-  % Remember, we are within a group.
-  \indexdummies % Must do this here, since \bf, etc expand at this stage
-  \escapechar=`\\
-  \def\rawbackslashxx{\indexbackslash}% \indexbackslash isn't defined now
-      % so it will be output as is; and it will print as backslash.
-  %
-  % Process the index entry with all font commands turned off, to
-  % get the string to sort by.
-  {\indexnofonts
-   \edef\temp{\the\toks0}% need full expansion
-   \xdef\indexsorttmp{\temp}%
-  }%
-  %
-  % Set up the complete index entry, with both the sort key and
-  % the original text, including any font commands.  We write
-  % three arguments to \entry to the .?? file (four in the
-  % subentry case), texindex reduces to two when writing the .??s
-  % sorted result.
-  \edef\temp{%
-    \write\writeto{%
-      \string\entry{\indexsorttmp}{\noexpand\folio}{\the\toks0}}%
-  }%
-  \temp
-}
-
-% Take care of unwanted page breaks:
-%
-% If a skip is the last thing on the list now, preserve it
-% by backing up by \lastskip, doing the \write, then inserting
-% the skip again.  Otherwise, the whatsit generated by the
-% \write will make \lastskip zero.  The result is that sequences
-% like this:
-% @end defun
-% @tindex whatever
-% @defun ...
-% will have extra space inserted, because the \medbreak in the
-% start of the @defun won't see the skip inserted by the @end of
-% the previous defun.
-%
-% But don't do any of this if we're not in vertical mode.  We
-% don't want to do a \vskip and prematurely end a paragraph.
-%
-% Avoid page breaks due to these extra skips, too.
-%
-\def\dosubindsanitize{%
-  % \lastskip and \lastpenalty cannot both be nonzero simultaneously.
-  \skip0 = \lastskip
-  \count255 = \lastpenalty
-  %
-  % If \lastskip is nonzero, that means the last item was a
-  % skip.  And since a skip is discardable, that means this
-  % -\skip0 glue we're inserting is preceded by a
-  % non-discardable item, therefore it is not a potential
-  % breakpoint, therefore no \nobreak needed.
-  \ifdim\lastskip = 0pt \else \vskip-\skip0 \fi
-  %
-  \dosubindwrite
-  %
-  \ifdim\skip0 = 0pt
-    % if \lastskip was zero, perhaps the last item was a
-    % penalty, and perhaps it was >=10000, e.g., a \nobreak.
-    % In that case, we want to re-insert the penalty; since we
-    % just inserted a non-discardable item, any following glue
-    % (such as a \parskip) would be a breakpoint.  For example:
-    %   @deffn deffn-whatever
-    %   @vindex index-whatever
-    %   Description.
-    % would allow a break between the index-whatever whatsit
-    % and the "Description." paragraph.
-    \ifnum\count255>9999 \nobreak \fi
-  \else
-    % On the other hand, if we had a nonzero \lastskip,
-    % this make-up glue would be preceded by a non-discardable item
-    % (the whatsit from the \write), so we must insert a \nobreak.
-    \nobreak\vskip\skip0
-  \fi
-}
-
-% The index entry written in the file actually looks like
-%  \entry {sortstring}{page}{topic}
-% or
-%  \entry {sortstring}{page}{topic}{subtopic}
-% The texindex program reads in these files and writes files
-% containing these kinds of lines:
-%  \initial {c}
-%     before the first topic whose initial is c
-%  \entry {topic}{pagelist}
-%     for a topic that is used without subtopics
-%  \primary {topic}
-%     for the beginning of a topic that is used with subtopics
-%  \secondary {subtopic}{pagelist}
-%     for each subtopic.
-
-% Define the user-accessible indexing commands
-% @findex, @vindex, @kindex, @cindex.
-
-\def\findex {\fnindex}
-\def\kindex {\kyindex}
-\def\cindex {\cpindex}
-\def\vindex {\vrindex}
-\def\tindex {\tpindex}
-\def\pindex {\pgindex}
-
-\def\cindexsub {\begingroup\obeylines\cindexsub}
-{\obeylines %
-\gdef\cindexsub "#1" #2^^M{\endgroup %
-\dosubind{cp}{#2}{#1}}}
-
-% Define the macros used in formatting output of the sorted index material.
-
-% @printindex causes a particular index (the ??s file) to get printed.
-% It does not print any chapter heading (usually an @unnumbered).
-%
-\def\printindex{\parsearg\doprintindex}
-\def\doprintindex#1{\begingroup
-  \dobreak \chapheadingskip{10000}%
-  %
-  \smallfonts \rm
-  \tolerance = 9500
-  \everypar = {}% don't want the \kern\-parindent from indentation suppression.
-  \indexbreaks
-  %
-  % See if the index file exists and is nonempty.
-  % Change catcode of @ here so that if the index file contains
-  % \initial {@}
-  % as its first line, TeX doesn't complain about mismatched braces
-  % (because it thinks @} is a control sequence).
-  \catcode`\@ = 11
-  \openin 1 \jobname.#1s
-  \ifeof 1
-    % \enddoublecolumns gets confused if there is no text in the index,
-    % and it loses the chapter title and the aux file entries for the
-    % index.  The easiest way to prevent this problem is to make sure
-    % there is some text.
-    \putwordIndexNonexistent
-  \else
-    %
-    % If the index file exists but is empty, then \openin leaves \ifeof
-    % false.  We have to make TeX try to read something from the file, so
-    % it can discover if there is anything in it.
-    \read 1 to \temp
-    \ifeof 1
-      \putwordIndexIsEmpty
-    \else
-      % Index files are almost Texinfo source, but we use \ as the escape
-      % character.  It would be better to use @, but that's too big a change
-      % to make right now.
-      \def\indexbackslash{\rawbackslashxx}%
-      \catcode`\\ = 0
-      \escapechar = `\\
-      \begindoublecolumns
-      \input \jobname.#1s
-      \enddoublecolumns
-    \fi
-  \fi
-  \closein 1
-\endgroup}
-
-% These macros are used by the sorted index file itself.
-% Change them to control the appearance of the index.
-
-\def\initial#1{{%
-  % Some minor font changes for the special characters.
-  \let\tentt=\sectt \let\tt=\sectt \let\sf=\sectt
-  %
-  % Remove any glue we may have, we'll be inserting our own.
-  \removelastskip
-  %
-  % We like breaks before the index initials, so insert a bonus.
-  \penalty -300
-  %
-  % Typeset the initial.  Making this add up to a whole number of
-  % baselineskips increases the chance of the dots lining up from column
-  % to column.  It still won't often be perfect, because of the stretch
-  % we need before each entry, but it's better.
-  %
-  % No shrink because it confuses \balancecolumns.
-  \vskip 1.67\baselineskip plus .5\baselineskip
-  \leftline{\secbf #1}%
-  \vskip .33\baselineskip plus .1\baselineskip
-  %
-  % Do our best not to break after the initial.
-  \nobreak
-}}
-
-% This typesets a paragraph consisting of #1, dot leaders, and then #2
-% flush to the right margin.  It is used for index and table of contents
-% entries.  The paragraph is indented by \leftskip.
-%
-\def\entry#1#2{\begingroup
-  %
-  % Start a new paragraph if necessary, so our assignments below can't
-  % affect previous text.
-  \par
-  %
-  % Do not fill out the last line with white space.
-  \parfillskip = 0in
-  %
-  % No extra space above this paragraph.
-  \parskip = 0in
-  %
-  % Do not prefer a separate line ending with a hyphen to fewer lines.
-  \finalhyphendemerits = 0
-  %
-  % \hangindent is only relevant when the entry text and page number
-  % don't both fit on one line.  In that case, bob suggests starting the
-  % dots pretty far over on the line.  Unfortunately, a large
-  % indentation looks wrong when the entry text itself is broken across
-  % lines.  So we use a small indentation and put up with long leaders.
-  %
-  % \hangafter is reset to 1 (which is the value we want) at the start
-  % of each paragraph, so we need not do anything with that.
-  \hangindent = 2em
-  %
-  % When the entry text needs to be broken, just fill out the first line
-  % with blank space.
-  \rightskip = 0pt plus1fil
-  %
-  % A bit of stretch before each entry for the benefit of balancing columns.
-  \vskip 0pt plus1pt
-  %
-  % Start a ``paragraph'' for the index entry so the line breaking
-  % parameters we've set above will have an effect.
-  \noindent
-  %
-  % Insert the text of the index entry.  TeX will do line-breaking on it.
-  #1%
-  % The following is kludged to not output a line of dots in the index if
-  % there are no page numbers.  The next person who breaks this will be
-  % cursed by a Unix daemon.
-  \def\tempa{{\rm }}%
-  \def\tempb{#2}%
-  \edef\tempc{\tempa}%
-  \edef\tempd{\tempb}%
-  \ifx\tempc\tempd\ \else%
-    %
-    % If we must, put the page number on a line of its own, and fill out
-    % this line with blank space.  (The \hfil is overwhelmed with the
-    % fill leaders glue in \indexdotfill if the page number does fit.)
-    \hfil\penalty50
-    \null\nobreak\indexdotfill % Have leaders before the page number.
-    %
-    % The `\ ' here is removed by the implicit \unskip that TeX does as
-    % part of (the primitive) \par.  Without it, a spurious underfull
-    % \hbox ensues.
-    \ifpdf
-      \pdfgettoks#2.\ \the\toksA % The page number ends the paragraph.
-    \else
-      \ #2% The page number ends the paragraph.
-    \fi
-  \fi%
-  \par
-\endgroup}
-
-% Like \dotfill except takes at least 1 em.
-\def\indexdotfill{\cleaders
-  \hbox{$\mathsurround=0pt \mkern1.5mu ${\it .}$ \mkern1.5mu$}\hskip 1em plus 1fill}
-
-\def\primary #1{\line{#1\hfil}}
-
-\newskip\secondaryindent \secondaryindent=0.5cm
-\def\secondary#1#2{{%
-  \parfillskip=0in
-  \parskip=0in
-  \hangindent=1in
-  \hangafter=1
-  \noindent\hskip\secondaryindent\hbox{#1}\indexdotfill
-  \ifpdf
-    \pdfgettoks#2.\ \the\toksA % The page number ends the paragraph.
-  \else
-    #2
-  \fi
-  \par
-}}
-
-% Define two-column mode, which we use to typeset indexes.
-% Adapted from the TeXbook, page 416, which is to say,
-% the manmac.tex format used to print the TeXbook itself.
-\catcode`\@=11
-
-\newbox\partialpage
-\newdimen\doublecolumnhsize
-
-\def\begindoublecolumns{\begingroup % ended by \enddoublecolumns
-  % Grab any single-column material above us.
-  \output = {%
-    %
-    % Here is a possibility not foreseen in manmac: if we accumulate a
-    % whole lot of material, we might end up calling this \output
-    % routine twice in a row (see the doublecol-lose test, which is
-    % essentially a couple of indexes with @setchapternewpage off).  In
-    % that case we just ship out what is in \partialpage with the normal
-    % output routine.  Generally, \partialpage will be empty when this
-    % runs and this will be a no-op.  See the indexspread.tex test case.
-    \ifvoid\partialpage \else
-      \onepageout{\pagecontents\partialpage}%
-    \fi
-    %
-    \global\setbox\partialpage = \vbox{%
-      % Unvbox the main output page.
-      \unvbox\PAGE
-      \kern-\topskip \kern\baselineskip
-    }%
-  }%
-  \eject % run that output routine to set \partialpage
-  %
-  % Use the double-column output routine for subsequent pages.
-  \output = {\doublecolumnout}%
-  %
-  % Change the page size parameters.  We could do this once outside this
-  % routine, in each of @smallbook, @afourpaper, and the default 8.5x11
-  % format, but then we repeat the same computation.  Repeating a couple
-  % of assignments once per index is clearly meaningless for the
-  % execution time, so we may as well do it in one place.
-  %
-  % First we halve the line length, less a little for the gutter between
-  % the columns.  We compute the gutter based on the line length, so it
-  % changes automatically with the paper format.  The magic constant
-  % below is chosen so that the gutter has the same value (well, +-<1pt)
-  % as it did when we hard-coded it.
-  %
-  % We put the result in a separate register, \doublecolumhsize, so we
-  % can restore it in \pagesofar, after \hsize itself has (potentially)
-  % been clobbered.
-  %
-  \doublecolumnhsize = \hsize
-    \advance\doublecolumnhsize by -.04154\hsize
-    \divide\doublecolumnhsize by 2
-  \hsize = \doublecolumnhsize
-  %
-  % Double the \vsize as well.  (We don't need a separate register here,
-  % since nobody clobbers \vsize.)
-  \vsize = 2\vsize
-}
-
-% The double-column output routine for all double-column pages except
-% the last.
-%
-\def\doublecolumnout{%
-  \splittopskip=\topskip \splitmaxdepth=\maxdepth
-  % Get the available space for the double columns -- the normal
-  % (undoubled) page height minus any material left over from the
-  % previous page.
-  \dimen@ = \vsize
-  \divide\dimen@ by 2
-  \advance\dimen@ by -\ht\partialpage
-  %
-  % box0 will be the left-hand column, box2 the right.
-  \setbox0=\vsplit255 to\dimen@ \setbox2=\vsplit255 to\dimen@
-  \onepageout\pagesofar
-  \unvbox255
-  \penalty\outputpenalty
-}
-%
-% Re-output the contents of the output page -- any previous material,
-% followed by the two boxes we just split, in box0 and box2.
-\def\pagesofar{%
-  \unvbox\partialpage
-  %
-  \hsize = \doublecolumnhsize
-  \wd0=\hsize \wd2=\hsize
-  \hbox to\pagewidth{\box0\hfil\box2}%
-}
-%
-% All done with double columns.
-\def\enddoublecolumns{%
-  \output = {%
-    % Split the last of the double-column material.  Leave it on the
-    % current page, no automatic page break.
-    \balancecolumns
-    %
-    % If we end up splitting too much material for the current page,
-    % though, there will be another page break right after this \output
-    % invocation ends.  Having called \balancecolumns once, we do not
-    % want to call it again.  Therefore, reset \output to its normal
-    % definition right away.  (We hope \balancecolumns will never be
-    % called on to balance too much material, but if it is, this makes
-    % the output somewhat more palatable.)
-    \global\output = {\onepageout{\pagecontents\PAGE}}%
-  }%
-  \eject
-  \endgroup % started in \begindoublecolumns
-  %
-  % \pagegoal was set to the doubled \vsize above, since we restarted
-  % the current page.  We're now back to normal single-column
-  % typesetting, so reset \pagegoal to the normal \vsize (after the
-  % \endgroup where \vsize got restored).
-  \pagegoal = \vsize
-}
-%
-% Called at the end of the double column material.
-\def\balancecolumns{%
-  \setbox0 = \vbox{\unvbox255}% like \box255 but more efficient, see p.120.
-  \dimen@ = \ht0
-  \advance\dimen@ by \topskip
-  \advance\dimen@ by-\baselineskip
-  \divide\dimen@ by 2 % target to split to
-  %debug\message{final 2-column material height=\the\ht0, target=\the\dimen@.}%
-  \splittopskip = \topskip
-  % Loop until we get a decent breakpoint.
-  {%
-    \vbadness = 10000
-    \loop
-      \global\setbox3 = \copy0
-      \global\setbox1 = \vsplit3 to \dimen@
-    \ifdim\ht3>\dimen@
-      \global\advance\dimen@ by 1pt
-    \repeat
-  }%
-  %debug\message{split to \the\dimen@, column heights: \the\ht1, \the\ht3.}%
-  \setbox0=\vbox to\dimen@{\unvbox1}%
-  \setbox2=\vbox to\dimen@{\unvbox3}%
-  %
-  \pagesofar
-}
-\catcode`\@ = \other
-
-
-\message{sectioning,}
-% Chapters, sections, etc.
-
-% \unnumberedno is an oxymoron, of course.  But we count the unnumbered
-% sections so that we can refer to them unambiguously in the pdf
-% outlines by their "section number".  We avoid collisions with chapter
-% numbers by starting them at 10000.  (If a document ever has 10000
-% chapters, we're in trouble anyway, I'm sure.)
-\newcount\unnumberedno \unnumberedno = 10000
-\newcount\chapno
-\newcount\secno        \secno=0
-\newcount\subsecno     \subsecno=0
-\newcount\subsubsecno  \subsubsecno=0
-
-% This counter is funny since it counts through charcodes of letters A, B, ...
-\newcount\appendixno  \appendixno = `\@
-%
-% \def\appendixletter{\char\the\appendixno}
-% We do the following ugly conditional instead of the above simple
-% construct for the sake of pdftex, which needs the actual
-% letter in the expansion, not just typeset.
-% 
-\def\appendixletter{%
-  \ifnum\appendixno=`A A%
-  \else\ifnum\appendixno=`B B%
-  \else\ifnum\appendixno=`C C%
-  \else\ifnum\appendixno=`D D%
-  \else\ifnum\appendixno=`E E%
-  \else\ifnum\appendixno=`F F%
-  \else\ifnum\appendixno=`G G%
-  \else\ifnum\appendixno=`H H%
-  \else\ifnum\appendixno=`I I%
-  \else\ifnum\appendixno=`J J%
-  \else\ifnum\appendixno=`K K%
-  \else\ifnum\appendixno=`L L%
-  \else\ifnum\appendixno=`M M%
-  \else\ifnum\appendixno=`N N%
-  \else\ifnum\appendixno=`O O%
-  \else\ifnum\appendixno=`P P%
-  \else\ifnum\appendixno=`Q Q%
-  \else\ifnum\appendixno=`R R%
-  \else\ifnum\appendixno=`S S%
-  \else\ifnum\appendixno=`T T%
-  \else\ifnum\appendixno=`U U%
-  \else\ifnum\appendixno=`V V%
-  \else\ifnum\appendixno=`W W%
-  \else\ifnum\appendixno=`X X%
-  \else\ifnum\appendixno=`Y Y%
-  \else\ifnum\appendixno=`Z Z%
-  % The \the is necessary, despite appearances, because \appendixletter is
-  % expanded while writing the .toc file.  \char\appendixno is not
-  % expandable, thus it is written literally, thus all appendixes come out
-  % with the same letter (or @) in the toc without it.
-  \else\char\the\appendixno
-  \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi
-  \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi}
-
-% Each @chapter defines this as the name of the chapter.
-% page headings and footings can use it.  @section does likewise.
-% However, they are not reliable, because we don't use marks.
-\def\thischapter{}
-\def\thissection{}
-
-\newcount\absseclevel % used to calculate proper heading level
-\newcount\secbase\secbase=0 % @raisesections/@lowersections modify this count
-
-% @raisesections: treat @section as chapter, @subsection as section, etc.
-\def\raisesections{\global\advance\secbase by -1}
-\let\up=\raisesections % original BFox name
-
-% @lowersections: treat @chapter as section, @section as subsection, etc.
-\def\lowersections{\global\advance\secbase by 1}
-\let\down=\lowersections % original BFox name
-
-% Choose a numbered-heading macro
-% #1 is heading level if unmodified by @raisesections or @lowersections
-% #2 is text for heading
-\def\numhead#1#2{\absseclevel=\secbase\advance\absseclevel by #1
-\ifcase\absseclevel
-      \chapterzzz{#2}%
-  \or \seczzz{#2}%
-  \or \numberedsubseczzz{#2}%
-  \or \numberedsubsubseczzz{#2}%
-  \else
-    \ifnum \absseclevel<0 \chapterzzz{#2}%
-    \else \numberedsubsubseczzz{#2}%
-    \fi
-  \fi
-  \suppressfirstparagraphindent
-}
-
-% like \numhead, but chooses appendix heading levels
-\def\apphead#1#2{\absseclevel=\secbase\advance\absseclevel by #1
-\ifcase\absseclevel
-      \appendixzzz{#2}%
-  \or \appendixsectionzzz{#2}%
-  \or \appendixsubseczzz{#2}%
-  \or \appendixsubsubseczzz{#2}%
-  \else
-    \ifnum \absseclevel<0 \appendixzzz{#2}%
-    \else \appendixsubsubseczzz{#2}%
-    \fi
-  \fi
-  \suppressfirstparagraphindent
-}
-
-% like \numhead, but chooses numberless heading levels
-\def\unnmhead#1#2{\absseclevel=\secbase\advance\absseclevel by #1
-  \ifcase\absseclevel
-      \unnumberedzzz{#2}%
-  \or \unnumberedseczzz{#2}%
-  \or \unnumberedsubseczzz{#2}%
-  \or \unnumberedsubsubseczzz{#2}%
-  \else
-    \ifnum \absseclevel<0 \unnumberedzzz{#2}%
-    \else \unnumberedsubsubseczzz{#2}%
-    \fi
-  \fi
-  \suppressfirstparagraphindent
-}
-
-% @chapter, @appendix, @unnumbered.
-%
-\outer\def\chapter{\parsearg\chapteryyy}
-\def\chapteryyy#1{\numhead0{#1}} % normally numhead0 calls chapterzzz
-\def\chapterzzz#1{%
-  % section resetting is \global in case the chapter is in a group, such
-  % as an @include file.
-  \global\secno=0 \global\subsecno=0 \global\subsubsecno=0
-    \global\advance\chapno by 1
-  \message{\putwordChapter\space \the\chapno}%
-  %
-  % Write the actual heading.
-  \chapmacro{#1}{Ynumbered}{\the\chapno}%
-  %
-  % So @section and the like are numbered underneath this chapter.
-  \global\let\section = \numberedsec
-  \global\let\subsection = \numberedsubsec
-  \global\let\subsubsection = \numberedsubsubsec
-}
-
-\outer\def\appendix{\parsearg\appendixyyy}
-\def\appendixyyy#1{\apphead0{#1}} % normally apphead0 calls appendixzzz
-\def\appendixzzz#1{%
-  \global\secno=0 \global\subsecno=0 \global\subsubsecno=0
-    \global\advance\appendixno by 1
-  \def\appendixnum{\putwordAppendix\space \appendixletter}%
-  \message{\appendixnum}%
-  \chapmacro{#1}{Yappendix}{\appendixletter}%
-  \global\let\section = \appendixsec
-  \global\let\subsection = \appendixsubsec
-  \global\let\subsubsection = \appendixsubsubsec
-}
-
-% @centerchap is like @unnumbered, but the heading is centered.
-\outer\def\centerchap{\parsearg\centerchapyyy}
-\def\centerchapyyy#1{{\unnumberedyyy{#1}}}
-
-% @top is like @unnumbered.
-\outer\def\top{\parsearg\unnumberedyyy}
-
-\outer\def\unnumbered{\parsearg\unnumberedyyy}
-\def\unnumberedyyy#1{\unnmhead0{#1}} % normally unnmhead0 calls unnumberedzzz
-\def\unnumberedzzz#1{%
-  \global\secno=0 \global\subsecno=0 \global\subsubsecno=0
-    \global\advance\unnumberedno by 1
-  %
-  % This used to be simply \message{#1}, but TeX fully expands the
-  % argument to \message.  Therefore, if #1 contained @-commands, TeX
-  % expanded them.  For example, in `@unnumbered The @cite{Book}', TeX
-  % expanded @cite (which turns out to cause errors because \cite is meant
-  % to be executed, not expanded).
-  %
-  % Anyway, we don't want the fully-expanded definition of @cite to appear
-  % as a result of the \message, we just want `@cite' itself.  We use
-  % \the<toks register> to achieve this: TeX expands \the<toks> only once,
-  % simply yielding the contents of <toks register>.  (We also do this for
-  % the toc entries.)
-  \toks0 = {#1}\message{(\the\toks0)}%
-  %
-  \chapmacro{#1}{Ynothing}{\the\unnumberedno}%
-  %
-  \global\let\section = \unnumberedsec
-  \global\let\subsection = \unnumberedsubsec
-  \global\let\subsubsection = \unnumberedsubsubsec
-}
-
-% Sections.
-\outer\def\numberedsec{\parsearg\secyyy}
-\def\secyyy#1{\numhead1{#1}} % normally calls seczzz
-\def\seczzz#1{%
-  \global\subsecno=0 \global\subsubsecno=0  \global\advance\secno by 1
-  \sectionheading{#1}{sec}{Ynumbered}{\the\chapno.\the\secno}%
-}
-
-\outer\def\appendixsection{\parsearg\appendixsecyyy}
-\outer\def\appendixsec{\parsearg\appendixsecyyy}
-\def\appendixsecyyy#1{\apphead1{#1}} % normally calls appendixsectionzzz
-\def\appendixsectionzzz#1{%
-  \global\subsecno=0 \global\subsubsecno=0  \global\advance\secno by 1
-  \sectionheading{#1}{sec}{Yappendix}{\appendixletter.\the\secno}%
-}
-
-\outer\def\unnumberedsec{\parsearg\unnumberedsecyyy}
-\def\unnumberedsecyyy#1{\unnmhead1{#1}} % normally calls unnumberedseczzz
-\def\unnumberedseczzz#1{%
-  \global\subsecno=0 \global\subsubsecno=0  \global\advance\secno by 1
-  \sectionheading{#1}{sec}{Ynothing}{\the\unnumberedno.\the\secno}%
-}
-
-% Subsections.
-\outer\def\numberedsubsec{\parsearg\numberedsubsecyyy}
-\def\numberedsubsecyyy#1{\numhead2{#1}} % normally calls numberedsubseczzz
-\def\numberedsubseczzz#1{%
-  \global\subsubsecno=0  \global\advance\subsecno by 1
-  \sectionheading{#1}{subsec}{Ynumbered}{\the\chapno.\the\secno.\the\subsecno}%
-}
-
-\outer\def\appendixsubsec{\parsearg\appendixsubsecyyy}
-\def\appendixsubsecyyy#1{\apphead2{#1}} % normally calls appendixsubseczzz
-\def\appendixsubseczzz#1{%
-  \global\subsubsecno=0  \global\advance\subsecno by 1
-  \sectionheading{#1}{subsec}{Yappendix}%
-                 {\appendixletter.\the\secno.\the\subsecno}%
-}
-
-\outer\def\unnumberedsubsec{\parsearg\unnumberedsubsecyyy}
-\def\unnumberedsubsecyyy#1{\unnmhead2{#1}} %normally calls unnumberedsubseczzz
-\def\unnumberedsubseczzz#1{%
-  \global\subsubsecno=0  \global\advance\subsecno by 1
-  \sectionheading{#1}{subsec}{Ynothing}%
-                 {\the\unnumberedno.\the\secno.\the\subsecno}%
-}
-
-% Subsubsections.
-\outer\def\numberedsubsubsec{\parsearg\numberedsubsubsecyyy}
-\def\numberedsubsubsecyyy#1{\numhead3{#1}} % normally numberedsubsubseczzz
-\def\numberedsubsubseczzz#1{%
-  \global\advance\subsubsecno by 1
-  \sectionheading{#1}{subsubsec}{Ynumbered}%
-                 {\the\chapno.\the\secno.\the\subsecno.\the\subsubsecno}%
-}
-
-\outer\def\appendixsubsubsec{\parsearg\appendixsubsubsecyyy}
-\def\appendixsubsubsecyyy#1{\apphead3{#1}} % normally appendixsubsubseczzz
-\def\appendixsubsubseczzz#1{%
-  \global\advance\subsubsecno by 1
-  \sectionheading{#1}{subsubsec}{Yappendix}%
-                 {\appendixletter.\the\secno.\the\subsecno.\the\subsubsecno}%
-}
-
-\outer\def\unnumberedsubsubsec{\parsearg\unnumberedsubsubsecyyy}
-\def\unnumberedsubsubsecyyy#1{\unnmhead3{#1}} %normally unnumberedsubsubseczzz
-\def\unnumberedsubsubseczzz#1{%
-  \global\advance\subsubsecno by 1
-  \sectionheading{#1}{subsubsec}{Ynothing}%
-                 {\the\unnumberedno.\the\secno.\the\subsecno.\the\subsubsecno}%
-}
-
-% These are variants which are not "outer", so they can appear in @ifinfo.
-% Actually, they are now be obsolete; ordinary section commands should work.
-\def\infotop{\parsearg\unnumberedzzz}
-\def\infounnumbered{\parsearg\unnumberedzzz}
-\def\infounnumberedsec{\parsearg\unnumberedseczzz}
-\def\infounnumberedsubsec{\parsearg\unnumberedsubseczzz}
-\def\infounnumberedsubsubsec{\parsearg\unnumberedsubsubseczzz}
-
-\def\infoappendix{\parsearg\appendixzzz}
-\def\infoappendixsec{\parsearg\appendixseczzz}
-\def\infoappendixsubsec{\parsearg\appendixsubseczzz}
-\def\infoappendixsubsubsec{\parsearg\appendixsubsubseczzz}
-
-\def\infochapter{\parsearg\chapterzzz}
-\def\infosection{\parsearg\sectionzzz}
-\def\infosubsection{\parsearg\subsectionzzz}
-\def\infosubsubsection{\parsearg\subsubsectionzzz}
-
-% These macros control what the section commands do, according
-% to what kind of chapter we are in (ordinary, appendix, or unnumbered).
-% Define them by default for a numbered chapter.
-\let\section = \numberedsec
-\let\subsection = \numberedsubsec
-\let\subsubsection = \numberedsubsubsec
-
-% Define @majorheading, @heading and @subheading
-
-% NOTE on use of \vbox for chapter headings, section headings, and such:
-%       1) We use \vbox rather than the earlier \line to permit
-%          overlong headings to fold.
-%       2) \hyphenpenalty is set to 10000 because hyphenation in a
-%          heading is obnoxious; this forbids it.
-%       3) Likewise, headings look best if no \parindent is used, and
-%          if justification is not attempted.  Hence \raggedright.
-
-
-\def\majorheading{%
-  {\advance\chapheadingskip by 10pt \chapbreak }%
-  \parsearg\chapheadingzzz
-}
-
-\def\chapheading{\chapbreak \parsearg\chapheadingzzz}
-\def\chapheadingzzz#1{%
-  {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000
-                    \parindent=0pt\raggedright
-                    \rm #1\hfill}}%
-  \bigskip \par\penalty 200\relax
-  \suppressfirstparagraphindent
-}
-
-% @heading, @subheading, @subsubheading.
-\def\heading{\parsearg\doheading}
-\def\subheading{\parsearg\dosubheading}
-\def\subsubheading{\parsearg\dosubsubheading}
-\def\doheading#1{\sectionheading{#1}{sec}{Yomitfromtoc}{}
-  \suppressfirstparagraphindent}
-\def\dosubheading#1{\sectionheading{#1}{subsec}{Yomitfromtoc}{}
-  \suppressfirstparagraphindent}
-\def\dosubsubheading#1{\sectionheading{#1}{subsubsec}{Yomitfromtoc}{}
-  \suppressfirstparagraphindent}
-
-% These macros generate a chapter, section, etc. heading only
-% (including whitespace, linebreaking, etc. around it),
-% given all the information in convenient, parsed form.
-
-%%% Args are the skip and penalty (usually negative)
-\def\dobreak#1#2{\par\ifdim\lastskip<#1\removelastskip\penalty#2\vskip#1\fi}
-
-\def\setchapterstyle #1 {\csname CHAPF#1\endcsname}
-
-%%% Define plain chapter starts, and page on/off switching for it
-% Parameter controlling skip before chapter headings (if needed)
-
-\newskip\chapheadingskip
-
-\def\chapbreak{\dobreak \chapheadingskip {-4000}}
-\def\chappager{\par\vfill\supereject}
-\def\chapoddpage{\chappager \ifodd\pageno \else \hbox to 0pt{} \chappager\fi}
-
-\def\setchapternewpage #1 {\csname CHAPPAG#1\endcsname}
-
-\def\CHAPPAGoff{%
-\global\let\contentsalignmacro = \chappager
-\global\let\pchapsepmacro=\chapbreak
-\global\let\pagealignmacro=\chappager}
-
-\def\CHAPPAGon{%
-\global\let\contentsalignmacro = \chappager
-\global\let\pchapsepmacro=\chappager
-\global\let\pagealignmacro=\chappager
-\global\def\HEADINGSon{\HEADINGSsingle}}
-
-\def\CHAPPAGodd{%
-\global\let\contentsalignmacro = \chapoddpage
-\global\let\pchapsepmacro=\chapoddpage
-\global\let\pagealignmacro=\chapoddpage
-\global\def\HEADINGSon{\HEADINGSdouble}}
-
-\CHAPPAGon
-
-\def\CHAPFplain{%
-\global\let\chapmacro=\chfplain
-\global\let\centerchapmacro=\centerchfplain}
-
-% Normal chapter opening.
-% 
-% #1 is the text, #2 is the section type (Ynumbered, Ynothing,
-% Yappendix, Yomitfromtoc), #3 the chapter number.
-% 
-% To test against our argument.
-\def\Ynothingkeyword{Ynothing}
-\def\Yomitfromtockeyword{Yomitfromtoc}
-\def\Yappendixkeyword{Yappendix}
-%
-\def\chfplain#1#2#3{%
-  \pchapsepmacro
-  {%
-    \chapfonts \rm
-    %
-    % Have to define \thissection before calling \donoderef, because the
-    % xref code eventually uses it.  On the other hand, it has to be called
-    % after \pchapsepmacro, or the headline will change too soon.
-    \gdef\thissection{#1}%
-    \gdef\thischaptername{#1}%
-    %
-    % Only insert the separating space if we have a chapter/appendix
-    % number, and don't print the unnumbered ``number''.
-    \def\temptype{#2}%
-    \ifx\temptype\Ynothingkeyword
-      \setbox0 = \hbox{}%
-      \def\toctype{unnchap}%
-      \def\thischapter{#1}%
-    \else\ifx\temptype\Yomitfromtockeyword
-      \setbox0 = \hbox{}% contents like unnumbered, but no toc entry
-      \def\toctype{omit}%
-      \xdef\thischapter{}%
-    \else\ifx\temptype\Yappendixkeyword
-      \setbox0 = \hbox{\putwordAppendix{} #3\enspace}%
-      \def\toctype{app}%
-      % We don't substitute the actual chapter name into \thischapter
-      % because we don't want its macros evaluated now.  And we don't
-      % use \thissection because that changes with each section.
-      %
-      \xdef\thischapter{\putwordAppendix{} \appendixletter:
-                        \noexpand\thischaptername}%
-    \else
-      \setbox0 = \hbox{#3\enspace}%
-      \def\toctype{numchap}%
-      \xdef\thischapter{\putwordChapter{} \the\chapno:
-                        \noexpand\thischaptername}%
-    \fi\fi\fi
-    %
-    % Write the toc entry for this chapter.  Must come before the
-    % \donoderef, because we include the current node name in the toc
-    % entry, and \donoderef resets it to empty.
-    \writetocentry{\toctype}{#1}{#3}%
-    %
-    % For pdftex, we have to write out the node definition (aka, make
-    % the pdfdest) after any page break, but before the actual text has
-    % been typeset.  If the destination for the pdf outline is after the
-    % text, then jumping from the outline may wind up with the text not
-    % being visible, for instance under high magnification.
-    \donoderef{#2}%
-    %
-    % Typeset the actual heading.
-    \vbox{\hyphenpenalty=10000 \tolerance=5000 \parindent=0pt \raggedright
-          \hangindent=\wd0 \centerparametersmaybe
-          \unhbox0 #1\par}%
-  }%
-  \nobreak\bigskip % no page break after a chapter title
-  \nobreak
-}
-
-% @centerchap -- centered and unnumbered.
-\let\centerparametersmaybe = \relax
-\def\centerchfplain#1{{%
-  \def\centerparametersmaybe{%
-    \advance\rightskip by 3\rightskip
-    \leftskip = \rightskip
-    \parfillskip = 0pt
-  }%
-  \chfplain{#1}{Ynothing}{}%
-}}
-
-\CHAPFplain % The default
-
-% I don't think this chapter style is supported any more, so I'm not
-% updating it with the new noderef stuff.  We'll see.  --karl, 11aug03.
-% 
-\def\unnchfopen #1{%
-\chapoddpage {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000
-                       \parindent=0pt\raggedright
-                       \rm #1\hfill}}\bigskip \par\nobreak
-}
-
-\def\chfopen #1#2{\chapoddpage {\chapfonts
-\vbox to 3in{\vfil \hbox to\hsize{\hfil #2} \hbox to\hsize{\hfil #1} \vfil}}%
-\par\penalty 5000 %
-}
-
-\def\centerchfopen #1{%
-\chapoddpage {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000
-                       \parindent=0pt
-                       \hfill {\rm #1}\hfill}}\bigskip \par\nobreak
-}
-
-\def\CHAPFopen{%
-\global\let\chapmacro=\chfopen
-\global\let\centerchapmacro=\centerchfopen}
-
-
-% Section titles.  These macros combine the section number parts and
-% call the generic \sectionheading to do the printing.
-% 
-\newskip\secheadingskip
-\def\secheadingbreak{\dobreak \secheadingskip{-1000}}
-
-% Subsection titles.
-\newskip\subsecheadingskip
-\def\subsecheadingbreak{\dobreak \subsecheadingskip{-500}}
-
-% Subsubsection titles.
-\def\subsubsecheadingskip{\subsecheadingskip}
-\def\subsubsecheadingbreak{\subsecheadingbreak}
-
-
-% Print any size, any type, section title.
-% 
-% #1 is the text, #2 is the section level (sec/subsec/subsubsec), #3 is
-% the section type for xrefs (Ynumbered, Ynothing, Yappendix), #4 is the
-% section number.
-% 
-\def\sectionheading#1#2#3#4{%
-  {%
-    % Switch to the right set of fonts.
-    \csname #2fonts\endcsname \rm
-    %
-    % Insert space above the heading.
-    \csname #2headingbreak\endcsname
-    %
-    % Only insert the space after the number if we have a section number.
-    \def\sectionlevel{#2}%
-    \def\temptype{#3}%
-    %
-    \ifx\temptype\Ynothingkeyword
-      \setbox0 = \hbox{}%
-      \def\toctype{unn}%
-      \gdef\thissection{#1}%
-    \else\ifx\temptype\Yomitfromtockeyword
-      % for @headings -- no section number, don't include in toc,
-      % and don't redefine \thissection.
-      \setbox0 = \hbox{}%
-      \def\toctype{omit}%
-      \let\sectionlevel=\empty
-    \else\ifx\temptype\Yappendixkeyword
-      \setbox0 = \hbox{#4\enspace}%
-      \def\toctype{app}%
-      \gdef\thissection{#1}%
-    \else
-      \setbox0 = \hbox{#4\enspace}%
-      \def\toctype{num}%
-      \gdef\thissection{#1}%
-    \fi\fi\fi
-    %
-    % Write the toc entry (before \donoderef).  See comments in \chfplain.
-    \writetocentry{\toctype\sectionlevel}{#1}{#4}%
-    %
-    % Write the node reference (= pdf destination for pdftex).
-    % Again, see comments in \chfplain.
-    \donoderef{#3}%
-    %
-    % Output the actual section heading.
-    \vbox{\hyphenpenalty=10000 \tolerance=5000 \parindent=0pt \raggedright
-          \hangindent=\wd0  % zero if no section number
-          \unhbox0 #1}%
-  }%
-  % Add extra space after the heading -- half of whatever came above it.
-  % Don't allow stretch, though.
-  \kern .5 \csname #2headingskip\endcsname
-  %
-  % Do not let the kern be a potential breakpoint, as it would be if it
-  % was followed by glue.
-  \nobreak
-  %
-  % We'll almost certainly start a paragraph next, so don't let that
-  % glue accumulate.  (Not a breakpoint because it's preceded by a
-  % discardable item.)
-  \vskip-\parskip
-  %
-  % This \nobreak is purely so the last item on the list is a \penalty
-  % of 10000.  This is so other code, for instance \parsebodycommon, can
-  % check for and avoid allowing breakpoints.  Otherwise, it would
-  % insert a valid breakpoint between:
-  %   @section sec-whatever
-  %   @deffn def-whatever
-  \nobreak
-}
-
-
-\message{toc,}
-% Table of contents.
-\newwrite\tocfile
-
-% Write an entry to the toc file, opening it if necessary.
-% Called from @chapter, etc.  
-% 
-% Example usage: \writetocentry{sec}{Section Name}{\the\chapno.\the\secno}
-% We append the current node name (if any) and page number as additional
-% arguments for the \{chap,sec,...}entry macros which will eventually
-% read this.  The node name is used in the pdf outlines as the
-% destination to jump to.
-% 
-% We open the .toc file for writing here instead of at @setfilename (or
-% any other fixed time) so that @contents can be anywhere in the document.
-% But if #1 is `omit', then we don't do anything.  This is used for the
-% table of contents chapter openings themselves.
-%
-\newif\iftocfileopened
-\def\omitkeyword{omit}%
-%
-\def\writetocentry#1#2#3{%
-  \edef\writetoctype{#1}%
-  \ifx\writetoctype\omitkeyword \else
-    \iftocfileopened\else
-      \immediate\openout\tocfile = \jobname.toc
-      \global\tocfileopenedtrue
-    \fi
-    %
-    \iflinks
-      \toks0 = {#2}%
-      \toks2 = \expandafter{\lastnode}%
-      \edef\temp{\write\tocfile{\realbackslash #1entry{\the\toks0}{#3}%
-                               {\the\toks2}{\noexpand\folio}}}%
-      \temp
-    \fi
-  \fi
-  %
-  % Tell \shipout to create a pdf destination on each page, if we're
-  % writing pdf.  These are used in the table of contents.  We can't
-  % just write one on every page because the title pages are numbered
-  % 1 and 2 (the page numbers aren't printed), and so are the first
-  % two pages of the document.  Thus, we'd have two destinations named
-  % `1', and two named `2'.
-  \ifpdf \global\pdfmakepagedesttrue \fi
-}
-
-\newskip\contentsrightmargin \contentsrightmargin=1in
-\newcount\savepageno
-\newcount\lastnegativepageno \lastnegativepageno = -1
-
-% Prepare to read what we've written to \tocfile.
-%
-\def\startcontents#1{%
-   % If @setchapternewpage on, and @headings double, the contents should
-   % start on an odd page, unlike chapters.  Thus, we maintain
-   % \contentsalignmacro in parallel with \pagealignmacro.
-   % From: Torbjorn Granlund <tege@matematik.su.se>
-   \contentsalignmacro
-   \immediate\closeout\tocfile
-   %
-   % Don't need to put `Contents' or `Short Contents' in the headline.
-   % It is abundantly clear what they are.
-   \def\thischapter{}%
-   \chapmacro{#1}{Yomitfromtoc}{}%
-   %
-   \savepageno = \pageno
-   \begingroup                  % Set up to handle contents files properly.
-      \catcode`\\=0  \catcode`\{=1  \catcode`\}=2  \catcode`\@=11
-      % We can't do this, because then an actual ^ in a section
-      % title fails, e.g., @chapter ^ -- exponentiation.  --karl, 9jul97.
-      %\catcode`\^=7 % to see ^^e4 as \"a etc. juha@piuha.ydi.vtt.fi
-      \raggedbottom             % Worry more about breakpoints than the bottom.
-      \advance\hsize by -\contentsrightmargin % Don't use the full line length.
-      %
-      % Roman numerals for page numbers.
-      \ifnum \pageno>0 \global\pageno = \lastnegativepageno \fi
-}
-
-
-% Normal (long) toc.
-\def\contents{%
-   \startcontents{\putwordTOC}%
-     \openin 1 \jobname.toc
-     \ifeof 1 \else
-       \closein 1
-       \input \jobname.toc
-     \fi
-     \vfill \eject
-     \contentsalignmacro % in case @setchapternewpage odd is in effect
-     \pdfmakeoutlines
-   \endgroup
-   \lastnegativepageno = \pageno
-   \global\pageno = \savepageno
-}
-
-% And just the chapters.
-\def\summarycontents{%
-   \startcontents{\putwordShortTOC}%
-      %
-      \let\numchapentry = \shortchapentry
-      \let\appentry = \shortchapentry
-      \let\unnchapentry = \shortunnchapentry
-      % We want a true roman here for the page numbers.
-      \secfonts
-      \let\rm=\shortcontrm \let\bf=\shortcontbf
-      \let\sl=\shortcontsl \let\tt=\shortconttt
-      \rm
-      \hyphenpenalty = 10000
-      \advance\baselineskip by 1pt % Open it up a little.
-      \def\numsecentry##1##2##3##4{}
-      \let\appsecentry = \numsecentry
-      \let\unnsecentry = \numsecentry
-      \let\numsubsecentry = \numsecentry
-      \let\appsubsecentry = \numsecentry
-      \let\unnsubsecentry = \numsecentry
-      \let\numsubsubsecentry = \numsecentry
-      \let\appsubsubsecentry = \numsecentry
-      \let\unnsubsubsecentry = \numsecentry
-      \openin 1 \jobname.toc
-      \ifeof 1 \else
-        \closein 1
-        \input \jobname.toc
-      \fi
-     \vfill \eject
-     \contentsalignmacro % in case @setchapternewpage odd is in effect
-   \endgroup
-   \lastnegativepageno = \pageno
-   \global\pageno = \savepageno
-}
-\let\shortcontents = \summarycontents
-
-% Typeset the label for a chapter or appendix for the short contents.
-% The arg is, e.g., `A' for an appendix, or `3' for a chapter.
-%
-\def\shortchaplabel#1{%
-  % This space should be enough, since a single number is .5em, and the
-  % widest letter (M) is 1em, at least in the Computer Modern fonts.
-  % But use \hss just in case.
-  % (This space doesn't include the extra space that gets added after
-  % the label; that gets put in by \shortchapentry above.)
-  % 
-  % We'd like to right-justify chapter numbers, but that looks strange
-  % with appendix letters.  And right-justifying numbers and
-  % left-justifying letters looks strange when there is less than 10
-  % chapters.  Have to read the whole toc once to know how many chapters
-  % there are before deciding ...
-  \hbox to 1em{#1\hss}%
-}
-
-% These macros generate individual entries in the table of contents.
-% The first argument is the chapter or section name.
-% The last argument is the page number.
-% The arguments in between are the chapter number, section number, ...
-
-% Chapters, in the main contents.
-\def\numchapentry#1#2#3#4{\dochapentry{#2\labelspace#1}{#4}}
-%
-% Chapters, in the short toc.
-% See comments in \dochapentry re vbox and related settings.
-\def\shortchapentry#1#2#3#4{%
-  \tocentry{\shortchaplabel{#2}\labelspace #1}{\doshortpageno\bgroup#4\egroup}%
-}
-
-% Appendices, in the main contents.
-% Need the word Appendix, and a fixed-size box.
-% 
-\def\appendixbox#1{%
-  % We use M since it's probably the widest letter.
-  \setbox0 = \hbox{\putwordAppendix{} M}%
-  \hbox to \wd0{\putwordAppendix{} #1\hss}}
-%
-\def\appentry#1#2#3#4{\dochapentry{\appendixbox{#2}\labelspace#1}{#4}}
-
-% Unnumbered chapters.
-\def\unnchapentry#1#2#3#4{\dochapentry{#1}{#4}}
-\def\shortunnchapentry#1#2#3#4{\tocentry{#1}{\doshortpageno\bgroup#4\egroup}}
-
-% Sections.
-\def\numsecentry#1#2#3#4{\dosecentry{#2\labelspace#1}{#4}}
-\let\appsecentry=\numsecentry
-\def\unnsecentry#1#2#3#4{\dosecentry{#1}{#4}}
-
-% Subsections.
-\def\numsubsecentry#1#2#3#4{\dosubsecentry{#2\labelspace#1}{#4}}
-\let\appsubsecentry=\numsubsecentry
-\def\unnsubsecentry#1#2#3#4{\dosubsecentry{#1}{#4}}
-
-% And subsubsections.
-\def\numsubsubsecentry#1#2#3#4{\dosubsubsecentry{#2\labelspace#1}{#4}}
-\let\appsubsubsecentry=\numsubsubsecentry
-\def\unnsubsubsecentry#1#2#3#4{\dosubsubsecentry{#1}{#4}}
-
-% This parameter controls the indentation of the various levels.
-\newdimen\tocindent \tocindent = 2pc
-
-% Now for the actual typesetting. In all these, #1 is the text and #2 is the
-% page number.
-%
-% If the toc has to be broken over pages, we want it to be at chapters
-% if at all possible; hence the \penalty.
-\def\dochapentry#1#2{%
-   \penalty-300 \vskip1\baselineskip plus.33\baselineskip minus.25\baselineskip
-   \begingroup
-     \chapentryfonts
-     \tocentry{#1}{\dopageno\bgroup#2\egroup}%
-   \endgroup
-   \nobreak\vskip .25\baselineskip plus.1\baselineskip
-}
-
-\def\dosecentry#1#2{\begingroup
-  \secentryfonts \leftskip=\tocindent
-  \tocentry{#1}{\dopageno\bgroup#2\egroup}%
-\endgroup}
-
-\def\dosubsecentry#1#2{\begingroup
-  \subsecentryfonts \leftskip=2\tocindent
-  \tocentry{#1}{\dopageno\bgroup#2\egroup}%
-\endgroup}
-
-\def\dosubsubsecentry#1#2{\begingroup
-  \subsubsecentryfonts \leftskip=3\tocindent
-  \tocentry{#1}{\dopageno\bgroup#2\egroup}%
-\endgroup}
-
-% Final typesetting of a toc entry; we use the same \entry macro as for
-% the index entries, but we want to suppress hyphenation here.  (We
-% can't do that in the \entry macro, since index entries might consist
-% of hyphenated-identifiers-that-do-not-fit-on-a-line-and-nothing-else.)
-\def\tocentry#1#2{\begingroup
-  \vskip 0pt plus1pt % allow a little stretch for the sake of nice page breaks
-  % Do not use \turnoffactive in these arguments.  Since the toc is
-  % typeset in cmr, characters such as _ would come out wrong; we
-  % have to do the usual translation tricks.
-  \entry{#1}{#2}%
-\endgroup}
-
-% Space between chapter (or whatever) number and the title.
-\def\labelspace{\hskip1em \relax}
-
-\def\dopageno#1{{\rm #1}}
-\def\doshortpageno#1{{\rm #1}}
-
-\def\chapentryfonts{\secfonts \rm}
-\def\secentryfonts{\textfonts}
-\def\subsecentryfonts{\textfonts}
-\def\subsubsecentryfonts{\textfonts}
-
-
-\message{environments,}
-% @foo ... @end foo.
-
-% @point{}, @result{}, @expansion{}, @print{}, @equiv{}.
-%
-% Since these characters are used in examples, it should be an even number of
-% \tt widths. Each \tt character is 1en, so two makes it 1em.
-%
-\def\point{$\star$}
-\def\result{\leavevmode\raise.15ex\hbox to 1em{\hfil$\Rightarrow$\hfil}}
-\def\expansion{\leavevmode\raise.1ex\hbox to 1em{\hfil$\mapsto$\hfil}}
-\def\print{\leavevmode\lower.1ex\hbox to 1em{\hfil$\dashv$\hfil}}
-\def\equiv{\leavevmode\lower.1ex\hbox to 1em{\hfil$\ptexequiv$\hfil}}
-
-% The @error{} command.
-% Adapted from the TeXbook's \boxit.
-%
-\newbox\errorbox
-%
-{\tentt \global\dimen0 = 3em}% Width of the box.
-\dimen2 = .55pt % Thickness of rules
-% The text. (`r' is open on the right, `e' somewhat less so on the left.)
-\setbox0 = \hbox{\kern-.75pt \tensf error\kern-1.5pt}
-%
-\global\setbox\errorbox=\hbox to \dimen0{\hfil
-   \hsize = \dimen0 \advance\hsize by -5.8pt % Space to left+right.
-   \advance\hsize by -2\dimen2 % Rules.
-   \vbox{
-      \hrule height\dimen2
-      \hbox{\vrule width\dimen2 \kern3pt          % Space to left of text.
-         \vtop{\kern2.4pt \box0 \kern2.4pt}% Space above/below.
-         \kern3pt\vrule width\dimen2}% Space to right.
-      \hrule height\dimen2}
-    \hfil}
-%
-\def\error{\leavevmode\lower.7ex\copy\errorbox}
-
-% @tex ... @end tex    escapes into raw Tex temporarily.
-% One exception: @ is still an escape character, so that @end tex works.
-% But \@ or @@ will get a plain tex @ character.
-
-\def\tex{\begingroup
-  \catcode `\\=0 \catcode `\{=1 \catcode `\}=2
-  \catcode `\$=3 \catcode `\&=4 \catcode `\#=6
-  \catcode `\^=7 \catcode `\_=8 \catcode `\~=\active \let~=\tie
-  \catcode `\%=14
-  \catcode `\+=\other
-  \catcode `\"=\other
-  \catcode `\==\other
-  \catcode `\|=\other
-  \catcode `\<=\other
-  \catcode `\>=\other
-  \escapechar=`\\
-  %
-  \let\b=\ptexb
-  \let\bullet=\ptexbullet
-  \let\c=\ptexc
-  \let\,=\ptexcomma
-  \let\.=\ptexdot
-  \let\dots=\ptexdots
-  \let\equiv=\ptexequiv
-  \let\!=\ptexexclam
-  \let\i=\ptexi
-  \let\indent=\ptexindent
-  \let\noindent=\ptexnoindent
-  \let\{=\ptexlbrace
-  \let\+=\tabalign
-  \let\}=\ptexrbrace
-  \let\/=\ptexslash
-  \let\*=\ptexstar
-  \let\t=\ptext
-  %
-  \def\endldots{\mathinner{\ldots\ldots\ldots\ldots}}%
-  \def\enddots{\relax\ifmmode\endldots\else$\mathsurround=0pt \endldots\,$\fi}%
-  \def\@{@}%
-\let\Etex=\endgroup}
-
-% Define @lisp ... @end lisp.
-% @lisp does a \begingroup so it can rebind things,
-% including the definition of @end lisp (which normally is erroneous).
-
-% Amount to narrow the margins by for @lisp.
-\newskip\lispnarrowing \lispnarrowing=0.4in
-
-% This is the definition that ^^M gets inside @lisp, @example, and other
-% such environments.  \null is better than a space, since it doesn't
-% have any width.
-\def\lisppar{\null\endgraf}
-
-% Make each space character in the input produce a normal interword
-% space in the output.  Don't allow a line break at this space, as this
-% is used only in environments like @example, where each line of input
-% should produce a line of output anyway.
-%
-{\obeyspaces %
-\gdef\sepspaces{\obeyspaces\let =\tie}}
-
-% Define \obeyedspace to be our active space, whatever it is.  This is
-% for use in \parsearg.
-{\sepspaces%
-\global\let\obeyedspace= }
-
-% This space is always present above and below environments.
-\newskip\envskipamount \envskipamount = 0pt
-
-% Make spacing and below environment symmetrical.  We use \parskip here
-% to help in doing that, since in @example-like environments \parskip
-% is reset to zero; thus the \afterenvbreak inserts no space -- but the
-% start of the next paragraph will insert \parskip.
-%
-\def\aboveenvbreak{{%
-  % =10000 instead of <10000 because of a special case in \itemzzz, q.v.
-  \ifnum \lastpenalty=10000 \else
-    \advance\envskipamount by \parskip
-    \endgraf
-    \ifdim\lastskip<\envskipamount
-      \removelastskip
-      % it's not a good place to break if the last penalty was \nobreak
-      % or better ...
-      \ifnum\lastpenalty>10000 \else \penalty-50 \fi
-      \vskip\envskipamount
-    \fi
-  \fi
-}}
-
-\let\afterenvbreak = \aboveenvbreak
-
-% \nonarrowing is a flag.  If "set", @lisp etc don't narrow margins.
-\let\nonarrowing=\relax
-
-% @cartouche ... @end cartouche: draw rectangle w/rounded corners around
-% environment contents.
-\font\circle=lcircle10
-\newdimen\circthick
-\newdimen\cartouter\newdimen\cartinner
-\newskip\normbskip\newskip\normpskip\newskip\normlskip
-\circthick=\fontdimen8\circle
-%
-\def\ctl{{\circle\char'013\hskip -6pt}}% 6pt from pl file: 1/2charwidth
-\def\ctr{{\hskip 6pt\circle\char'010}}
-\def\cbl{{\circle\char'012\hskip -6pt}}
-\def\cbr{{\hskip 6pt\circle\char'011}}
-\def\carttop{\hbox to \cartouter{\hskip\lskip
-        \ctl\leaders\hrule height\circthick\hfil\ctr
-        \hskip\rskip}}
-\def\cartbot{\hbox to \cartouter{\hskip\lskip
-        \cbl\leaders\hrule height\circthick\hfil\cbr
-        \hskip\rskip}}
-%
-\newskip\lskip\newskip\rskip
-
-\def\cartouche{%
-\par  % can't be in the midst of a paragraph.
-\begingroup
-        \lskip=\leftskip \rskip=\rightskip
-        \leftskip=0pt\rightskip=0pt %we want these *outside*.
-        \cartinner=\hsize \advance\cartinner by-\lskip
-                          \advance\cartinner by-\rskip
-        \cartouter=\hsize
-        \advance\cartouter by 18.4pt % allow for 3pt kerns on either
-%                                    side, and for 6pt waste from
-%                                    each corner char, and rule thickness
-        \normbskip=\baselineskip \normpskip=\parskip \normlskip=\lineskip
-        % Flag to tell @lisp, etc., not to narrow margin.
-        \let\nonarrowing=\comment
-        \vbox\bgroup
-                \baselineskip=0pt\parskip=0pt\lineskip=0pt
-                \carttop
-                \hbox\bgroup
-                        \hskip\lskip
-                        \vrule\kern3pt
-                        \vbox\bgroup
-                                \hsize=\cartinner
-                                \kern3pt
-                                \begingroup
-                                        \baselineskip=\normbskip
-                                        \lineskip=\normlskip
-                                        \parskip=\normpskip
-                                        \vskip -\parskip
-\def\Ecartouche{%
-                                \endgroup
-                                \kern3pt
-                        \egroup
-                        \kern3pt\vrule
-                        \hskip\rskip
-                \egroup
-                \cartbot
-        \egroup
-\endgroup
-}}
-
-
-% This macro is called at the beginning of all the @example variants,
-% inside a group.
-\def\nonfillstart{%
-  \aboveenvbreak
-  \inENV % This group ends at the end of the body
-  \hfuzz = 12pt % Don't be fussy
-  \sepspaces % Make spaces be word-separators rather than space tokens.
-  \let\par = \lisppar % don't ignore blank lines
-  \obeylines % each line of input is a line of output
-  \parskip = 0pt
-  \parindent = 0pt
-  \emergencystretch = 0pt % don't try to avoid overfull boxes
-  % @cartouche defines \nonarrowing to inhibit narrowing
-  % at next level down.
-  \ifx\nonarrowing\relax
-    \advance \leftskip by \lispnarrowing
-    \exdentamount=\lispnarrowing
-    \let\exdent=\nofillexdent
-    \let\nonarrowing=\relax
-  \fi
-}
-
-% Define the \E... control sequence only if we are inside the particular
-% environment, so the error checking in \end will work.
-%
-% To end an @example-like environment, we first end the paragraph (via
-% \afterenvbreak's vertical glue), and then the group.  That way we keep
-% the zero \parskip that the environments set -- \parskip glue will be
-% inserted at the beginning of the next paragraph in the document, after
-% the environment.
-%
-\def\nonfillfinish{\afterenvbreak\endgroup}
-
-% @lisp: indented, narrowed, typewriter font.
-\def\lisp{\begingroup
-  \nonfillstart
-  \let\Elisp = \nonfillfinish
-  \tt
-  \let\kbdfont = \kbdexamplefont % Allow @kbd to do something special.
-  \gobble       % eat return
-}
-
-% @example: Same as @lisp.
-\def\example{\begingroup \def\Eexample{\nonfillfinish\endgroup}\lisp}
-
-% @smallexample and @smalllisp: use smaller fonts.
-% Originally contributed by Pavel@xerox.
-\def\smalllisp{\begingroup
-  \def\Esmalllisp{\nonfillfinish\endgroup}%
-  \def\Esmallexample{\nonfillfinish\endgroup}%
-  \smallexamplefonts
-  \lisp
-}
-\let\smallexample = \smalllisp
-
-
-% @display: same as @lisp except keep current font.
-%
-\def\display{\begingroup
-  \nonfillstart
-  \let\Edisplay = \nonfillfinish
-  \gobble
-}
-%
-% @smalldisplay: @display plus smaller fonts.
-%
-\def\smalldisplay{\begingroup
-  \def\Esmalldisplay{\nonfillfinish\endgroup}%
-  \smallexamplefonts \rm
-  \display
-}
-
-% @format: same as @display except don't narrow margins.
-%
-\def\format{\begingroup
-  \let\nonarrowing = t
-  \nonfillstart
-  \let\Eformat = \nonfillfinish
-  \gobble
-}
-%
-% @smallformat: @format plus smaller fonts.
-%
-\def\smallformat{\begingroup
-  \def\Esmallformat{\nonfillfinish\endgroup}%
-  \smallexamplefonts \rm
-  \format
-}
-
-% @flushleft (same as @format).
-%
-\def\flushleft{\begingroup \def\Eflushleft{\nonfillfinish\endgroup}\format}
-
-% @flushright.
-%
-\def\flushright{\begingroup
-  \let\nonarrowing = t
-  \nonfillstart
-  \let\Eflushright = \nonfillfinish
-  \advance\leftskip by 0pt plus 1fill
-  \gobble
-}
-
-
-% @quotation does normal linebreaking (hence we can't use \nonfillstart)
-% and narrows the margins.
-%
-\def\quotation{%
-  \begingroup\inENV %This group ends at the end of the @quotation body
-  {\parskip=0pt \aboveenvbreak}% because \aboveenvbreak inserts \parskip
-  \parindent=0pt
-  % We have retained a nonzero parskip for the environment, since we're
-  % doing normal filling. So to avoid extra space below the environment...
-  \def\Equotation{\parskip = 0pt \nonfillfinish}%
-  %
-  % @cartouche defines \nonarrowing to inhibit narrowing at next level down.
-  \ifx\nonarrowing\relax
-    \advance\leftskip by \lispnarrowing
-    \advance\rightskip by \lispnarrowing
-    \exdentamount = \lispnarrowing
-    \let\nonarrowing = \relax
-  \fi
-}
-
-
-% LaTeX-like @verbatim...@end verbatim and @verb{<char>...<char>}
-% If we want to allow any <char> as delimiter,
-% we need the curly braces so that makeinfo sees the @verb command, eg:
-% `@verbx...x' would look like the '@verbx' command.  --janneke@gnu.org
-%
-% [Knuth]: Donald Ervin Knuth, 1996.  The TeXbook.
-%
-% [Knuth] p.344; only we need to do the other characters Texinfo sets
-% active too.  Otherwise, they get lost as the first character on a
-% verbatim line.
-\def\dospecials{%
-  \do\ \do\\\do\{\do\}\do\$\do\&%
-  \do\#\do\^\do\^^K\do\_\do\^^A\do\%\do\~%
-  \do\<\do\>\do\|\do\@\do+\do\"%
-}
-%
-% [Knuth] p. 380
-\def\uncatcodespecials{%
-  \def\do##1{\catcode`##1=12}\dospecials}
-%
-% [Knuth] pp. 380,381,391
-% Disable Spanish ligatures ?` and !` of \tt font
-\begingroup
-  \catcode`\`=\active\gdef`{\relax\lq}
-\endgroup
-%
-% Setup for the @verb command.
-%
-% Eight spaces for a tab
-\begingroup
-  \catcode`\^^I=\active
-  \gdef\tabeightspaces{\catcode`\^^I=\active\def^^I{\ \ \ \ \ \ \ \ }}
-\endgroup
-%
-\def\setupverb{%
-  \tt  % easiest (and conventionally used) font for verbatim
-  \def\par{\leavevmode\endgraf}%
-  \catcode`\`=\active
-  \tabeightspaces
-  % Respect line breaks,
-  % print special symbols as themselves, and
-  % make each space count
-  % must do in this order:
-  \obeylines \uncatcodespecials \sepspaces
-}
-
-% Setup for the @verbatim environment
-%
-% Real tab expansion
-\newdimen\tabw \setbox0=\hbox{\tt\space} \tabw=8\wd0 % tab amount
-%
-\def\starttabbox{\setbox0=\hbox\bgroup}
-\begingroup
-  \catcode`\^^I=\active
-  \gdef\tabexpand{%
-    \catcode`\^^I=\active
-    \def^^I{\leavevmode\egroup
-      \dimen0=\wd0 % the width so far, or since the previous tab
-      \divide\dimen0 by\tabw
-      \multiply\dimen0 by\tabw % compute previous multiple of \tabw
-      \advance\dimen0 by\tabw  % advance to next multiple of \tabw
-      \wd0=\dimen0 \box0 \starttabbox
-    }%
-  }
-\endgroup
-\def\setupverbatim{%
-  % Easiest (and conventionally used) font for verbatim
-  \tt
-  \def\par{\leavevmode\egroup\box0\endgraf}%
-  \catcode`\`=\active
-  \tabexpand
-  % Respect line breaks,
-  % print special symbols as themselves, and
-  % make each space count
-  % must do in this order:
-  \obeylines \uncatcodespecials \sepspaces
-  \everypar{\starttabbox}%
-}
-
-% Do the @verb magic: verbatim text is quoted by unique
-% delimiter characters.  Before first delimiter expect a
-% right brace, after last delimiter expect closing brace:
-%
-%    \def\doverb'{'<char>#1<char>'}'{#1}
-%
-% [Knuth] p. 382; only eat outer {}
-\begingroup
-  \catcode`[=1\catcode`]=2\catcode`\{=12\catcode`\}=12
-  \gdef\doverb{#1[\def\next##1#1}[##1\endgroup]\next]
-\endgroup
-%
-\def\verb{\begingroup\setupverb\doverb}
-%
-%
-% Do the @verbatim magic: define the macro \doverbatim so that
-% the (first) argument ends when '@end verbatim' is reached, ie:
-%
-%     \def\doverbatim#1@end verbatim{#1}
-%
-% For Texinfo it's a lot easier than for LaTeX,
-% because texinfo's \verbatim doesn't stop at '\end{verbatim}':
-% we need not redefine '\', '{' and '}'.
-%
-% Inspired by LaTeX's verbatim command set [latex.ltx]
-%% Include LaTeX hack for completeness -- never know
-%% \begingroup
-%% \catcode`|=0 \catcode`[=1
-%% \catcode`]=2\catcode`\{=12\catcode`\}=12\catcode`\ =\active
-%% \catcode`\\=12|gdef|doverbatim#1@end verbatim[
-%% #1|endgroup|def|Everbatim[]|end[verbatim]]
-%% |endgroup
-%
-\begingroup
-  \catcode`\ =\active
-  \obeylines %
-  % ignore everything up to the first ^^M, that's the newline at the end
-  % of the @verbatim input line itself.  Otherwise we get an extra blank
-  % line in the output.
-  \gdef\doverbatim#1^^M#2@end verbatim{#2\end{verbatim}}%
-\endgroup
-%
-\def\verbatim{%
-  \def\Everbatim{\nonfillfinish\endgroup}%
-  \begingroup
-    \nonfillstart
-    \advance\leftskip by -\defbodyindent
-    \begingroup\setupverbatim\doverbatim
-}
-
-% @verbatiminclude FILE - insert text of file in verbatim environment.
-%
-% Allow normal characters that we make active in the argument (a file name).
-\def\verbatiminclude{%
-  \begingroup
-    \catcode`\\=\other
-    \catcode`~=\other
-    \catcode`^=\other
-    \catcode`_=\other
-    \catcode`|=\other
-    \catcode`<=\other
-    \catcode`>=\other
-    \catcode`+=\other
-    \parsearg\doverbatiminclude
-}
-\def\setupverbatiminclude{%
-  \begingroup
-    \nonfillstart
-    \advance\leftskip by -\defbodyindent
-    \begingroup\setupverbatim
-}
-%
-\def\doverbatiminclude#1{%
-     % Restore active chars for included file.
-  \endgroup
-  \begingroup
-    \let\value=\expandablevalue
-    \def\thisfile{#1}%
-    \expandafter\expandafter\setupverbatiminclude\input\thisfile
-  \endgroup
-  \nonfillfinish
-  \endgroup
-}
-
-% @copying ... @end copying.
-% Save the text away for @insertcopying later.  Many commands won't be
-% allowed in this context, but that's ok.
-%
-% We save the uninterpreted tokens, rather than creating a box.
-% Saving the text in a box would be much easier, but then all the
-% typesetting commands (@smallbook, font changes, etc.) have to be done
-% beforehand -- and a) we want @copying to be done first in the source
-% file; b) letting users define the frontmatter in as flexible order as
-% possible is very desirable.
-%
-\def\copying{\begingroup
-  % Define a command to swallow text until we reach `@end copying'.
-  % \ is the escape char in this texinfo.tex file, so it is the
-  % delimiter for the command; @ will be the escape char when we read
-  % it, but that doesn't matter.
-  \long\def\docopying##1\end copying{\gdef\copyingtext{##1}\enddocopying}%
-  %
-  % We must preserve ^^M's in the input file; see \insertcopying below.
-  \catcode`\^^M = \active
-  \docopying
-}
-
-% What we do to finish off the copying text.
-%
-\def\enddocopying{\endgroup\ignorespaces}
-
-% @insertcopying.  Here we must play games with ^^M's.  On the one hand,
-% we need them to delimit commands such as `@end quotation', so they
-% must be active.  On the other hand, we certainly don't want every
-% end-of-line to be a \par, as would happen with the normal active
-% definition of ^^M.  On the third hand, two ^^M's in a row should still
-% generate a \par.
-%
-% Our approach is to make ^^M insert a space and a penalty1 normally;
-% then it can also check if \lastpenalty=1.  If it does, then manually
-% do \par.
-%
-% This messes up the normal definitions of @c[omment], so we redefine
-% it.  Similarly for @ignore.  (These commands are used in the gcc
-% manual for man page generation.)
-%
-% Seems pretty fragile, most line-oriented commands will presumably
-% fail, but for the limited use of getting the copying text (which
-% should be quite simple) inserted, we can hope it's ok.
-%
-{\catcode`\^^M=\active %
-\gdef\insertcopying{\begingroup %
-  \parindent = 0pt  % looks wrong on title page
-  \def^^M{%
-    \ifnum \lastpenalty=1 %
-      \par %
-    \else %
-      \space \penalty 1 %
-    \fi %
-  }%
-  %
-  % Fix @c[omment] for catcode 13 ^^M's.
-  \def\c##1^^M{\ignorespaces}%
-  \let\comment = \c %
-  %
-  % Don't bother jumping through all the hoops that \doignore does, it
-  % would be very hard since the catcodes are already set.
-  \long\def\ignore##1\end ignore{\ignorespaces}%
-  %
-  \copyingtext %
-\endgroup}%
-}
-
-\message{defuns,}
-% @defun etc.
-
-\newskip\defbodyindent \defbodyindent=.4in
-\newskip\defargsindent \defargsindent=50pt
-\newskip\deflastargmargin \deflastargmargin=18pt
-
-\newcount\parencount
-
-% We want ()&[] to print specially on the defun line.
-%
-\def\activeparens{%
-  \catcode`\(=\active \catcode`\)=\active
-  \catcode`\&=\active
-  \catcode`\[=\active \catcode`\]=\active
-}
-
-% Make control sequences which act like normal parenthesis chars.
-\let\lparen = ( \let\rparen = )
-
-{\activeparens % Now, smart parens don't turn on until &foo (see \amprm)
-
-% Be sure that we always have a definition for `(', etc.  For example,
-% if the fn name has parens in it, \boldbrax will not be in effect yet,
-% so TeX would otherwise complain about undefined control sequence.
-\global\let(=\lparen \global\let)=\rparen
-\global\let[=\lbrack \global\let]=\rbrack
-
-\gdef\functionparens{\boldbrax\let&=\amprm\parencount=0 }
-\gdef\boldbrax{\let(=\opnr\let)=\clnr\let[=\lbrb\let]=\rbrb}
-% This is used to turn on special parens
-% but make & act ordinary (given that it's active).
-\gdef\boldbraxnoamp{\let(=\opnr\let)=\clnr\let[=\lbrb\let]=\rbrb\let&=\ampnr}
-
-% Definitions of (, ) and & used in args for functions.
-% This is the definition of ( outside of all parentheses.
-\gdef\oprm#1 {{\rm\char`\(}#1 \bf \let(=\opnested
-  \global\advance\parencount by 1
-}
-%
-% This is the definition of ( when already inside a level of parens.
-\gdef\opnested{\char`\(\global\advance\parencount by 1 }
-%
-\gdef\clrm{% Print a paren in roman if it is taking us back to depth of 0.
-  % also in that case restore the outer-level definition of (.
-  \ifnum \parencount=1 {\rm \char `\)}\sl \let(=\oprm \else \char `\) \fi
-  \global\advance \parencount by -1 }
-% If we encounter &foo, then turn on ()-hacking afterwards
-\gdef\amprm#1 {{\rm\&#1}\let(=\oprm \let)=\clrm\ }
-%
-\gdef\normalparens{\boldbrax\let&=\ampnr}
-} % End of definition inside \activeparens
-%% These parens (in \boldbrax) actually are a little bolder than the
-%% contained text.  This is especially needed for [ and ]
-\def\opnr{{\sf\char`\(}\global\advance\parencount by 1 }
-\def\clnr{{\sf\char`\)}\global\advance\parencount by -1 }
-\let\ampnr = \&
-\def\lbrb{{\bf\char`\[}}
-\def\rbrb{{\bf\char`\]}}
-
-% Active &'s sneak into the index arguments, so make sure it's defined.
-{
-  \catcode`& = \active
-  \global\let& = \ampnr
-}
-
-% \defname, which formats the name of the @def (not the args).
-% #1 is the function name.
-% #2 is the type of definition, such as "Function".
-%
-\def\defname#1#2{%
-  % How we'll output the type name.  Putting it in brackets helps
-  % distinguish it from the body text that may end up on the next line
-  % just below it.
-  \def\temp{#2}%
-  \ifx\temp\empty
-    \def\defnametype{}%
-  \else
-    \def\defnametype{[\rm #2]}%
-  \fi
-  %
-  % Get the values of \leftskip and \rightskip as they were outside the @def...
-  \dimen2=\leftskip
-  \advance\dimen2 by -\defbodyindent
-  %
-  % Figure out values for the paragraph shape.
-  \setbox0=\hbox{\hskip \deflastargmargin{\defnametype}}%
-  \dimen0=\hsize \advance \dimen0 by -\wd0  % compute size for first line
-  \dimen1=\hsize \advance \dimen1 by -\defargsindent  % size for continuations
-  \parshape 2 0in \dimen0 \defargsindent \dimen1
-  %
-  % Output arg 2 ("Function" or some such) but stuck inside a box of
-  % width 0 so it does not interfere with linebreaking.
-  \noindent
-  %
-  {% Adjust \hsize to exclude the ambient margins,
-   % so that \rightline will obey them.
-   \advance \hsize by -\dimen2
-   \dimen3 = 0pt  % was -1.25pc
-   \rlap{\rightline{\defnametype\kern\dimen3}}%
-  }%
-  %
-  % Allow all lines to be underfull without complaint:
-  \tolerance=10000 \hbadness=10000
-  \advance\leftskip by -\defbodyindent
-  \exdentamount=\defbodyindent
-  {\df #1}\enskip        % output function name
-  % \defunargs will be called next to output the arguments, if any.
-}
-
-% Common pieces to start any @def...
-% #1 is the \E... control sequence to end the definition (which we define).
-% #2 is the \...x control sequence (which our caller defines).
-% #3 is the control sequence to process the header, such as \defunheader.
-%
-\def\parsebodycommon#1#2#3{%
-  \begingroup\inENV
-  % If there are two @def commands in a row, we'll have a \nobreak,
-  % which is there to keep the function description together with its
-  % header.  But if there's nothing but headers, we need to allow a
-  % break somewhere.  Check for penalty 10002 (inserted by
-  % \defargscommonending) instead of 10000, since the sectioning
-  % commands insert a \penalty10000, and we don't want to allow a break
-  % between a section heading and a defun.
-  \ifnum\lastpenalty=10002 \penalty2000 \fi
-  %
-  % Similarly, after a section heading, do not allow a break.
-  % But do insert the glue.
-  \ifnum\lastpenalty<10000 \medbreak
-  \else \medskip  % preceded by discardable penalty, so not a breakpoint
-  \fi
-  %
-  % Define the \E... end token that this defining construct specifies
-  % so that it will exit this group.
-  \def#1{\endgraf\endgroup\medbreak}%
-  %
-  \parindent=0in
-  \advance\leftskip by \defbodyindent
-  \exdentamount=\defbodyindent
-}
-
-% Common part of the \...x definitions.
-%
-\def\defxbodycommon{%
-  % As with \parsebodycommon above, allow line break if we have multiple
-  % x headers in a row.  It's not a great place, though.
-  \ifnum\lastpenalty=10002 \penalty2000 \fi
-  %
-  \begingroup\obeylines
-}
-
-% Process body of @defun, @deffn, @defmac, etc.
-%
-\def\defparsebody#1#2#3{%
-  \parsebodycommon{#1}{#2}{#3}%
-  \def#2{\defxbodycommon \activeparens \spacesplit#3}%
-  \catcode\equalChar=\active
-  \begingroup\obeylines\activeparens
-  \spacesplit#3%
-}
-
-% #1, #2, #3 are the common arguments (see \parsebodycommon above).
-% #4, delimited by the space, is the class name.
-%
-\def\defmethparsebody#1#2#3#4 {%
-  \parsebodycommon{#1}{#2}{#3}%
-  \def#2##1 {\defxbodycommon \activeparens \spacesplit{#3{##1}}}%
-  \begingroup\obeylines\activeparens
-  % The \empty here prevents misinterpretation of a construct such as
-  %   @deffn {whatever} {Enharmonic comma}
-  % See comments at \deftpparsebody, although in our case we don't have
-  % to remove the \empty afterwards, since it is empty.
-  \spacesplit{#3{#4}}\empty
-}
-
-% Used for @deftypemethod and @deftypeivar.
-% #1, #2, #3 are the common arguments (see \defparsebody).
-% #4, delimited by a space, is the class name.
-% #5 is the method's return type.
-%
-\def\deftypemethparsebody#1#2#3#4 #5 {%
-  \parsebodycommon{#1}{#2}{#3}%
-  \def#2##1 ##2 {\defxbodycommon \activeparens \spacesplit{#3{##1}{##2}}}%
-  \begingroup\obeylines\activeparens
-  \spacesplit{#3{#4}{#5}}%
-}
-
-% Used for @deftypeop.  The change from \deftypemethparsebody is an
-% extra argument at the beginning which is the `category', instead of it
-% being the hardwired string `Method' or `Instance Variable'.  We have
-% to account for this both in the \...x definition and in parsing the
-% input at hand.  Thus also need a control sequence (passed as #5) for
-% the \E... definition to assign the category name to.
-%
-\def\deftypeopparsebody#1#2#3#4#5 #6 {%
-  \parsebodycommon{#1}{#2}{#3}%
-  \def#2##1 ##2 ##3 {\def#4{##1}%
-    \defxbodycommon \activeparens \spacesplit{#3{##2}{##3}}}%
-  \begingroup\obeylines\activeparens
-  \spacesplit{#3{#5}{#6}}%
-}
-
-% For @defop.
-\def\defopparsebody #1#2#3#4#5 {%
-  \parsebodycommon{#1}{#2}{#3}%
-  \def#2##1 ##2 {\def#4{##1}%
-    \defxbodycommon \activeparens \spacesplit{#3{##2}}}%
-  \begingroup\obeylines\activeparens
-  \spacesplit{#3{#5}}%
-}
-
-% These parsing functions are similar to the preceding ones
-% except that they do not make parens into active characters.
-% These are used for "variables" since they have no arguments.
-%
-\def\defvarparsebody #1#2#3{%
-  \parsebodycommon{#1}{#2}{#3}%
-  \def#2{\defxbodycommon \spacesplit#3}%
-  \catcode\equalChar=\active
-  \begingroup\obeylines
-  \spacesplit#3%
-}
-
-% @defopvar.
-\def\defopvarparsebody #1#2#3#4#5 {%
-  \parsebodycommon{#1}{#2}{#3}%
-  \def#2##1 ##2 {\def#4{##1}%
-    \defxbodycommon \spacesplit{#3{##2}}}%
-  \begingroup\obeylines
-  \spacesplit{#3{#5}}%
-}
-
-\def\defvrparsebody#1#2#3#4 {%
-  \parsebodycommon{#1}{#2}{#3}%
-  \def#2##1 {\defxbodycommon \spacesplit{#3{##1}}}%
-  \begingroup\obeylines
-  \spacesplit{#3{#4}}%
-}
-
-% This loses on `@deftp {Data Type} {struct termios}' -- it thinks the
-% type is just `struct', because we lose the braces in `{struct
-% termios}' when \spacesplit reads its undelimited argument.  Sigh.
-% \let\deftpparsebody=\defvrparsebody
-%
-% So, to get around this, we put \empty in with the type name.  That
-% way, TeX won't find exactly `{...}' as an undelimited argument, and
-% won't strip off the braces.
-%
-\def\deftpparsebody #1#2#3#4 {%
-  \parsebodycommon{#1}{#2}{#3}%
-  \def#2##1 {\defxbodycommon \spacesplit{#3{##1}}}%
-  \begingroup\obeylines
-  \spacesplit{\parsetpheaderline{#3{#4}}}\empty
-}
-
-% Fine, but then we have to eventually remove the \empty *and* the
-% braces (if any).  That's what this does.
-%
-\def\removeemptybraces\empty#1\relax{#1}
-
-% After \spacesplit has done its work, this is called -- #1 is the final
-% thing to call, #2 the type name (which starts with \empty), and #3
-% (which might be empty) the arguments.
-%
-\def\parsetpheaderline#1#2#3{%
-  #1{\removeemptybraces#2\relax}{#3}%
-}%
-
-% Split up #2 (the rest of the input line) at the first space token.
-% call #1 with two arguments:
-%  the first is all of #2 before the space token,
-%  the second is all of #2 after that space token.
-% If #2 contains no space token, all of it is passed as the first arg
-% and the second is passed as empty.
-%
-{\obeylines %
- \gdef\spacesplit#1#2^^M{\endgroup\spacesplitx{#1}#2 \relax\spacesplitx}%
- \long\gdef\spacesplitx#1#2 #3#4\spacesplitx{%
-   \ifx\relax #3%
-     #1{#2}{}%
-   \else %
-     #1{#2}{#3#4}%
-   \fi}%
-}
-
-% Define @defun.
-
-% This is called to end the arguments processing for all the @def... commands.
-%
-\def\defargscommonending{%
-  \interlinepenalty = 10000
-  \advance\rightskip by 0pt plus 1fil
-  \endgraf
-  \nobreak\vskip -\parskip
-  \penalty 10002  % signal to \parsebodycommon and \defxbodycommon.
-}
-
-% This expands the args and terminates the paragraph they comprise.
-%
-\def\defunargs#1{\functionparens \sl
-% Expand, preventing hyphenation at `-' chars.
-% Note that groups don't affect changes in \hyphenchar.
-% Set the font temporarily and use \font in case \setfont made \tensl a macro.
-{\tensl\hyphenchar\font=0}%
-#1%
-{\tensl\hyphenchar\font=45}%
-\ifnum\parencount=0 \else \errmessage{Unbalanced parentheses in @def}\fi%
-  \defargscommonending
-}
-
-\def\deftypefunargs #1{%
-% Expand, preventing hyphenation at `-' chars.
-% Note that groups don't affect changes in \hyphenchar.
-% Use \boldbraxnoamp, not \functionparens, so that & is not special.
-\boldbraxnoamp
-\tclose{#1}% avoid \code because of side effects on active chars
-  \defargscommonending
-}
-
-% Do complete processing of one @defun or @defunx line already parsed.
-
-% @deffn Command forward-char nchars
-
-\def\deffn{\defmethparsebody\Edeffn\deffnx\deffnheader}
-
-\def\deffnheader #1#2#3{\doind {fn}{\code{#2}}%
-\begingroup\defname {#2}{#1}\defunargs{#3}\endgroup %
-\catcode\equalChar=\other % Turn off change made in \defparsebody
-}
-
-% @defun == @deffn Function
-
-\def\defun{\defparsebody\Edefun\defunx\defunheader}
-
-\def\defunheader #1#2{\doind {fn}{\code{#1}}% Make entry in function index
-\begingroup\defname {#1}{\putwordDeffunc}%
-\defunargs {#2}\endgroup %
-\catcode\equalChar=\other % Turn off change made in \defparsebody
-}
-
-% @deftypefun int foobar (int @var{foo}, float @var{bar})
-
-\def\deftypefun{\defparsebody\Edeftypefun\deftypefunx\deftypefunheader}
-
-% #1 is the data type.  #2 is the name and args.
-\def\deftypefunheader #1#2{\deftypefunheaderx{#1}#2 \relax}
-% #1 is the data type, #2 the name, #3 the args.
-\def\deftypefunheaderx #1#2 #3\relax{%
-\doind {fn}{\code{#2}}% Make entry in function index
-\begingroup\defname {\defheaderxcond#1\relax$.$#2}{\putwordDeftypefun}%
-\deftypefunargs {#3}\endgroup %
-\catcode\equalChar=\other % Turn off change made in \defparsebody
-}
-
-% @deftypefn {Library Function} int foobar (int @var{foo}, float @var{bar})
-
-\def\deftypefn{\defmethparsebody\Edeftypefn\deftypefnx\deftypefnheader}
-
-% \defheaderxcond#1\relax$.$
-% puts #1 in @code, followed by a space, but does nothing if #1 is null.
-\def\defheaderxcond#1#2$.${\ifx#1\relax\else\code{#1#2} \fi}
-
-% #1 is the classification.  #2 is the data type.  #3 is the name and args.
-\def\deftypefnheader #1#2#3{\deftypefnheaderx{#1}{#2}#3 \relax}
-% #1 is the classification, #2 the data type, #3 the name, #4 the args.
-\def\deftypefnheaderx #1#2#3 #4\relax{%
-\doind {fn}{\code{#3}}% Make entry in function index
-\begingroup
-\normalparens % notably, turn off `&' magic, which prevents
-%               at least some C++ text from working
-\defname {\defheaderxcond#2\relax$.$#3}{#1}%
-\deftypefunargs {#4}\endgroup %
-\catcode\equalChar=\other % Turn off change made in \defparsebody
-}
-
-% @defmac == @deffn Macro
-
-\def\defmac{\defparsebody\Edefmac\defmacx\defmacheader}
-
-\def\defmacheader #1#2{\doind {fn}{\code{#1}}% Make entry in function index
-\begingroup\defname {#1}{\putwordDefmac}%
-\defunargs {#2}\endgroup %
-\catcode\equalChar=\other % Turn off change made in \defparsebody
-}
-
-% @defspec == @deffn Special Form
-
-\def\defspec{\defparsebody\Edefspec\defspecx\defspecheader}
-
-\def\defspecheader #1#2{\doind {fn}{\code{#1}}% Make entry in function index
-\begingroup\defname {#1}{\putwordDefspec}%
-\defunargs {#2}\endgroup %
-\catcode\equalChar=\other % Turn off change made in \defparsebody
-}
-
-% @defop CATEGORY CLASS OPERATION ARG...
-%
-\def\defop #1 {\def\defoptype{#1}%
-\defopparsebody\Edefop\defopx\defopheader\defoptype}
-%
-\def\defopheader#1#2#3{%
-  \dosubind{fn}{\code{#2}}{\putwordon\ \code{#1}}% function index entry
-  \begingroup
-    \defname{#2}{\defoptype\ \putwordon\ #1}%
-    \defunargs{#3}%
-  \endgroup
-}
-
-% @deftypeop CATEGORY CLASS TYPE OPERATION ARG...
-%
-\def\deftypeop #1 {\def\deftypeopcategory{#1}%
-  \deftypeopparsebody\Edeftypeop\deftypeopx\deftypeopheader
-                       \deftypeopcategory}
-%
-% #1 is the class name, #2 the data type, #3 the operation name, #4 the args.
-\def\deftypeopheader#1#2#3#4{%
-  \dosubind{fn}{\code{#3}}{\putwordon\ \code{#1}}% entry in function index
-  \begingroup
-    \defname{\defheaderxcond#2\relax$.$#3}
-            {\deftypeopcategory\ \putwordon\ \code{#1}}%
-    \deftypefunargs{#4}%
-  \endgroup
-}
-
-% @deftypemethod CLASS TYPE METHOD ARG...
-%
-\def\deftypemethod{%
-  \deftypemethparsebody\Edeftypemethod\deftypemethodx\deftypemethodheader}
-%
-% #1 is the class name, #2 the data type, #3 the method name, #4 the args.
-\def\deftypemethodheader#1#2#3#4{%
-  \dosubind{fn}{\code{#3}}{\putwordon\ \code{#1}}% entry in function index
-  \begingroup
-    \defname{\defheaderxcond#2\relax$.$#3}{\putwordMethodon\ \code{#1}}%
-    \deftypefunargs{#4}%
-  \endgroup
-}
-
-% @deftypeivar CLASS TYPE VARNAME
-%
-\def\deftypeivar{%
-  \deftypemethparsebody\Edeftypeivar\deftypeivarx\deftypeivarheader}
-%
-% #1 is the class name, #2 the data type, #3 the variable name.
-\def\deftypeivarheader#1#2#3{%
-  \dosubind{vr}{\code{#3}}{\putwordof\ \code{#1}}% entry in variable index
-  \begingroup
-    \defname{\defheaderxcond#2\relax$.$#3}
-            {\putwordInstanceVariableof\ \code{#1}}%
-    \defvarargs{#3}%
-  \endgroup
-}
-
-% @defmethod == @defop Method
-%
-\def\defmethod{\defmethparsebody\Edefmethod\defmethodx\defmethodheader}
-%
-% #1 is the class name, #2 the method name, #3 the args.
-\def\defmethodheader#1#2#3{%
-  \dosubind{fn}{\code{#2}}{\putwordon\ \code{#1}}% entry in function index
-  \begingroup
-    \defname{#2}{\putwordMethodon\ \code{#1}}%
-    \defunargs{#3}%
-  \endgroup
-}
-
-% @defcv {Class Option} foo-class foo-flag
-
-\def\defcv #1 {\def\defcvtype{#1}%
-\defopvarparsebody\Edefcv\defcvx\defcvarheader\defcvtype}
-
-\def\defcvarheader #1#2#3{%
-  \dosubind{vr}{\code{#2}}{\putwordof\ \code{#1}}% variable index entry
-  \begingroup
-    \defname{#2}{\defcvtype\ \putwordof\ #1}%
-    \defvarargs{#3}%
-  \endgroup
-}
-
-% @defivar CLASS VARNAME == @defcv {Instance Variable} CLASS VARNAME
-%
-\def\defivar{\defvrparsebody\Edefivar\defivarx\defivarheader}
-%
-\def\defivarheader#1#2#3{%
-  \dosubind{vr}{\code{#2}}{\putwordof\ \code{#1}}% entry in var index
-  \begingroup
-    \defname{#2}{\putwordInstanceVariableof\ #1}%
-    \defvarargs{#3}%
-  \endgroup
-}
-
-% @defvar
-% First, define the processing that is wanted for arguments of @defvar.
-% This is actually simple: just print them in roman.
-% This must expand the args and terminate the paragraph they make up
-\def\defvarargs #1{\normalparens #1%
-  \defargscommonending
-}
-
-% @defvr Counter foo-count
-
-\def\defvr{\defvrparsebody\Edefvr\defvrx\defvrheader}
-
-\def\defvrheader #1#2#3{\doind {vr}{\code{#2}}%
-\begingroup\defname {#2}{#1}\defvarargs{#3}\endgroup}
-
-% @defvar == @defvr Variable
-
-\def\defvar{\defvarparsebody\Edefvar\defvarx\defvarheader}
-
-\def\defvarheader #1#2{\doind {vr}{\code{#1}}% Make entry in var index
-\begingroup\defname {#1}{\putwordDefvar}%
-\defvarargs {#2}\endgroup %
-}
-
-% @defopt == @defvr {User Option}
-
-\def\defopt{\defvarparsebody\Edefopt\defoptx\defoptheader}
-
-\def\defoptheader #1#2{\doind {vr}{\code{#1}}% Make entry in var index
-\begingroup\defname {#1}{\putwordDefopt}%
-\defvarargs {#2}\endgroup %
-}
-
-% @deftypevar int foobar
-
-\def\deftypevar{\defvarparsebody\Edeftypevar\deftypevarx\deftypevarheader}
-
-% #1 is the data type.  #2 is the name, perhaps followed by text that
-% is actually part of the data type, which should not be put into the index.
-\def\deftypevarheader #1#2{%
-\dovarind#2 \relax% Make entry in variables index
-\begingroup\defname {\defheaderxcond#1\relax$.$#2}{\putwordDeftypevar}%
-  \defargscommonending
-\endgroup}
-\def\dovarind#1 #2\relax{\doind{vr}{\code{#1}}}
-
-% @deftypevr {Global Flag} int enable
-
-\def\deftypevr{\defvrparsebody\Edeftypevr\deftypevrx\deftypevrheader}
-
-\def\deftypevrheader #1#2#3{\dovarind#3 \relax%
-\begingroup\defname {\defheaderxcond#2\relax$.$#3}{#1}
-  \defargscommonending
-\endgroup}
-
-% Now define @deftp
-% Args are printed in bold, a slight difference from @defvar.
-
-\def\deftpargs #1{\bf \defvarargs{#1}}
-
-% @deftp Class window height width ...
-
-\def\deftp{\deftpparsebody\Edeftp\deftpx\deftpheader}
-
-\def\deftpheader #1#2#3{\doind {tp}{\code{#2}}%
-\begingroup\defname {#2}{#1}\deftpargs{#3}\endgroup}
-
-% These definitions are used if you use @defunx (etc.)
-% anywhere other than immediately after a @defun or @defunx.
-%
-\def\defcvx#1 {\errmessage{@defcvx in invalid context}}
-\def\deffnx#1 {\errmessage{@deffnx in invalid context}}
-\def\defivarx#1 {\errmessage{@defivarx in invalid context}}
-\def\defmacx#1 {\errmessage{@defmacx in invalid context}}
-\def\defmethodx#1 {\errmessage{@defmethodx in invalid context}}
-\def\defoptx #1 {\errmessage{@defoptx in invalid context}}
-\def\defopx#1 {\errmessage{@defopx in invalid context}}
-\def\defspecx#1 {\errmessage{@defspecx in invalid context}}
-\def\deftpx#1 {\errmessage{@deftpx in invalid context}}
-\def\deftypefnx#1 {\errmessage{@deftypefnx in invalid context}}
-\def\deftypefunx#1 {\errmessage{@deftypefunx in invalid context}}
-\def\deftypeivarx#1 {\errmessage{@deftypeivarx in invalid context}}
-\def\deftypemethodx#1 {\errmessage{@deftypemethodx in invalid context}}
-\def\deftypeopx#1 {\errmessage{@deftypeopx in invalid context}}
-\def\deftypevarx#1 {\errmessage{@deftypevarx in invalid context}}
-\def\deftypevrx#1 {\errmessage{@deftypevrx in invalid context}}
-\def\defunx#1 {\errmessage{@defunx in invalid context}}
-\def\defvarx#1 {\errmessage{@defvarx in invalid context}}
-\def\defvrx#1 {\errmessage{@defvrx in invalid context}}
-
-
-\message{macros,}
-% @macro.
-
-% To do this right we need a feature of e-TeX, \scantokens,
-% which we arrange to emulate with a temporary file in ordinary TeX.
-\ifx\eTeXversion\undefined
- \newwrite\macscribble
- \def\scanmacro#1{%
-   \begingroup \newlinechar`\^^M
-   % Undo catcode changes of \startcontents and \doprintindex
-   \catcode`\@=0 \catcode`\\=\other \escapechar=`\@
-   % Append \endinput to make sure that TeX does not see the ending newline.
-   \toks0={#1\endinput}%
-   \immediate\openout\macscribble=\jobname.tmp
-   \immediate\write\macscribble{\the\toks0}%
-   \immediate\closeout\macscribble
-   \let\xeatspaces\eatspaces
-   \input \jobname.tmp
-   \endgroup
-}
-\else
-\def\scanmacro#1{%
-\begingroup \newlinechar`\^^M
-% Undo catcode changes of \startcontents and \doprintindex
-\catcode`\@=0 \catcode`\\=\other \escapechar=`\@
-\let\xeatspaces\eatspaces\scantokens{#1\endinput}\endgroup}
-\fi
-
-\newcount\paramno   % Count of parameters
-\newtoks\macname    % Macro name
-\newif\ifrecursive  % Is it recursive?
-\def\macrolist{}    % List of all defined macros in the form
-                    % \do\macro1\do\macro2...
-
-% Utility routines.
-% Thisdoes \let #1 = #2, except with \csnames.
-\def\cslet#1#2{%
-\expandafter\expandafter
-\expandafter\let
-\expandafter\expandafter
-\csname#1\endcsname
-\csname#2\endcsname}
-
-% Trim leading and trailing spaces off a string.
-% Concepts from aro-bend problem 15 (see CTAN).
-{\catcode`\@=11
-\gdef\eatspaces #1{\expandafter\trim@\expandafter{#1 }}
-\gdef\trim@ #1{\trim@@ @#1 @ #1 @ @@}
-\gdef\trim@@ #1@ #2@ #3@@{\trim@@@\empty #2 @}
-\def\unbrace#1{#1}
-\unbrace{\gdef\trim@@@ #1 } #2@{#1}
-}
-
-% Trim a single trailing ^^M off a string.
-{\catcode`\^^M=\other \catcode`\Q=3%
-\gdef\eatcr #1{\eatcra #1Q^^MQ}%
-\gdef\eatcra#1^^MQ{\eatcrb#1Q}%
-\gdef\eatcrb#1Q#2Q{#1}%
-}
-
-% Macro bodies are absorbed as an argument in a context where
-% all characters are catcode 10, 11 or 12, except \ which is active
-% (as in normal texinfo). It is necessary to change the definition of \.
-
-% It's necessary to have hard CRs when the macro is executed. This is
-% done by  making ^^M (\endlinechar) catcode 12 when reading the macro
-% body, and then making it the \newlinechar in \scanmacro.
-
-\def\macrobodyctxt{%
-  \catcode`\~=\other
-  \catcode`\^=\other
-  \catcode`\_=\other
-  \catcode`\|=\other
-  \catcode`\<=\other
-  \catcode`\>=\other
-  \catcode`\+=\other
-  \catcode`\{=\other
-  \catcode`\}=\other
-  \catcode`\@=\other
-  \catcode`\^^M=\other
-  \usembodybackslash}
-
-\def\macroargctxt{%
-  \catcode`\~=\other
-  \catcode`\^=\other
-  \catcode`\_=\other
-  \catcode`\|=\other
-  \catcode`\<=\other
-  \catcode`\>=\other
-  \catcode`\+=\other
-  \catcode`\@=\other
-  \catcode`\\=\other}
-
-% \mbodybackslash is the definition of \ in @macro bodies.
-% It maps \foo\ => \csname macarg.foo\endcsname => #N
-% where N is the macro parameter number.
-% We define \csname macarg.\endcsname to be \realbackslash, so
-% \\ in macro replacement text gets you a backslash.
-
-{\catcode`@=0 @catcode`@\=@active
- @gdef@usembodybackslash{@let\=@mbodybackslash}
- @gdef@mbodybackslash#1\{@csname macarg.#1@endcsname}
-}
-\expandafter\def\csname macarg.\endcsname{\realbackslash}
-
-\def\macro{\recursivefalse\parsearg\macroxxx}
-\def\rmacro{\recursivetrue\parsearg\macroxxx}
-
-\def\macroxxx#1{%
-  \getargs{#1}%           now \macname is the macname and \argl the arglist
-  \ifx\argl\empty       % no arguments
-     \paramno=0%
-  \else
-     \expandafter\parsemargdef \argl;%
-  \fi
-  \if1\csname ismacro.\the\macname\endcsname
-     \message{Warning: redefining \the\macname}%
-  \else
-     \expandafter\ifx\csname \the\macname\endcsname \relax
-     \else \errmessage{Macro name \the\macname\space already defined}\fi
-     \global\cslet{macsave.\the\macname}{\the\macname}%
-     \global\expandafter\let\csname ismacro.\the\macname\endcsname=1%
-     % Add the macroname to \macrolist
-     \toks0 = \expandafter{\macrolist\do}%
-     \xdef\macrolist{\the\toks0
-       \expandafter\noexpand\csname\the\macname\endcsname}%
-  \fi
-  \begingroup \macrobodyctxt
-  \ifrecursive \expandafter\parsermacbody
-  \else \expandafter\parsemacbody
-  \fi}
-
-\def\unmacro{\parsearg\dounmacro}
-\def\dounmacro#1{%
-  \if1\csname ismacro.#1\endcsname
-    \global\cslet{#1}{macsave.#1}%
-    \global\expandafter\let \csname ismacro.#1\endcsname=0%
-    % Remove the macro name from \macrolist:
-    \begingroup
-      \expandafter\let\csname#1\endcsname \relax
-      \let\do\unmacrodo
-      \xdef\macrolist{\macrolist}%
-    \endgroup
-  \else
-    \errmessage{Macro #1 not defined}%
-  \fi
-}
-
-% Called by \do from \dounmacro on each macro.  The idea is to omit any
-% macro definitions that have been changed to \relax.
-%
-\def\unmacrodo#1{%
-  \ifx#1\relax
-    % remove this
-  \else
-    \noexpand\do \noexpand #1%
-  \fi
-}
-
-% This makes use of the obscure feature that if the last token of a
-% <parameter list> is #, then the preceding argument is delimited by
-% an opening brace, and that opening brace is not consumed.
-\def\getargs#1{\getargsxxx#1{}}
-\def\getargsxxx#1#{\getmacname #1 \relax\getmacargs}
-\def\getmacname #1 #2\relax{\macname={#1}}
-\def\getmacargs#1{\def\argl{#1}}
-
-% Parse the optional {params} list.  Set up \paramno and \paramlist
-% so \defmacro knows what to do.  Define \macarg.blah for each blah
-% in the params list, to be ##N where N is the position in that list.
-% That gets used by \mbodybackslash (above).
-
-% We need to get `macro parameter char #' into several definitions.
-% The technique used is stolen from LaTeX:  let \hash be something
-% unexpandable, insert that wherever you need a #, and then redefine
-% it to # just before using the token list produced.
-%
-% The same technique is used to protect \eatspaces till just before
-% the macro is used.
-
-\def\parsemargdef#1;{\paramno=0\def\paramlist{}%
-        \let\hash\relax\let\xeatspaces\relax\parsemargdefxxx#1,;,}
-\def\parsemargdefxxx#1,{%
-  \if#1;\let\next=\relax
-  \else \let\next=\parsemargdefxxx
-    \advance\paramno by 1%
-    \expandafter\edef\csname macarg.\eatspaces{#1}\endcsname
-        {\xeatspaces{\hash\the\paramno}}%
-    \edef\paramlist{\paramlist\hash\the\paramno,}%
-  \fi\next}
-
-% These two commands read recursive and nonrecursive macro bodies.
-% (They're different since rec and nonrec macros end differently.)
-
-\long\def\parsemacbody#1@end macro%
-{\xdef\temp{\eatcr{#1}}\endgroup\defmacro}%
-\long\def\parsermacbody#1@end rmacro%
-{\xdef\temp{\eatcr{#1}}\endgroup\defmacro}%
-
-% This defines the macro itself. There are six cases: recursive and
-% nonrecursive macros of zero, one, and many arguments.
-% Much magic with \expandafter here.
-% \xdef is used so that macro definitions will survive the file
-% they're defined in; @include reads the file inside a group.
-\def\defmacro{%
-  \let\hash=##% convert placeholders to macro parameter chars
-  \ifrecursive
-    \ifcase\paramno
-    % 0
-      \expandafter\xdef\csname\the\macname\endcsname{%
-        \noexpand\scanmacro{\temp}}%
-    \or % 1
-      \expandafter\xdef\csname\the\macname\endcsname{%
-         \bgroup\noexpand\macroargctxt
-         \noexpand\braceorline
-         \expandafter\noexpand\csname\the\macname xxx\endcsname}%
-      \expandafter\xdef\csname\the\macname xxx\endcsname##1{%
-         \egroup\noexpand\scanmacro{\temp}}%
-    \else % many
-      \expandafter\xdef\csname\the\macname\endcsname{%
-         \bgroup\noexpand\macroargctxt
-         \noexpand\csname\the\macname xx\endcsname}%
-      \expandafter\xdef\csname\the\macname xx\endcsname##1{%
-          \expandafter\noexpand\csname\the\macname xxx\endcsname ##1,}%
-      \expandafter\expandafter
-      \expandafter\xdef
-      \expandafter\expandafter
-        \csname\the\macname xxx\endcsname
-          \paramlist{\egroup\noexpand\scanmacro{\temp}}%
-    \fi
-  \else
-    \ifcase\paramno
-    % 0
-      \expandafter\xdef\csname\the\macname\endcsname{%
-        \noexpand\norecurse{\the\macname}%
-        \noexpand\scanmacro{\temp}\egroup}%
-    \or % 1
-      \expandafter\xdef\csname\the\macname\endcsname{%
-         \bgroup\noexpand\macroargctxt
-         \noexpand\braceorline
-         \expandafter\noexpand\csname\the\macname xxx\endcsname}%
-      \expandafter\xdef\csname\the\macname xxx\endcsname##1{%
-        \egroup
-        \noexpand\norecurse{\the\macname}%
-        \noexpand\scanmacro{\temp}\egroup}%
-    \else % many
-      \expandafter\xdef\csname\the\macname\endcsname{%
-         \bgroup\noexpand\macroargctxt
-         \expandafter\noexpand\csname\the\macname xx\endcsname}%
-      \expandafter\xdef\csname\the\macname xx\endcsname##1{%
-          \expandafter\noexpand\csname\the\macname xxx\endcsname ##1,}%
-      \expandafter\expandafter
-      \expandafter\xdef
-      \expandafter\expandafter
-      \csname\the\macname xxx\endcsname
-      \paramlist{%
-          \egroup
-          \noexpand\norecurse{\the\macname}%
-          \noexpand\scanmacro{\temp}\egroup}%
-    \fi
-  \fi}
-
-\def\norecurse#1{\bgroup\cslet{#1}{macsave.#1}}
-
-% \braceorline decides whether the next nonwhitespace character is a
-% {.  If so it reads up to the closing }, if not, it reads the whole
-% line.  Whatever was read is then fed to the next control sequence
-% as an argument (by \parsebrace or \parsearg)
-\def\braceorline#1{\let\next=#1\futurelet\nchar\braceorlinexxx}
-\def\braceorlinexxx{%
-  \ifx\nchar\bgroup\else
-    \expandafter\parsearg
-  \fi \next}
-
-% We mant to disable all macros during \shipout so that they are not
-% expanded by \write.
-\def\turnoffmacros{\begingroup \def\do##1{\let\noexpand##1=\relax}%
-  \edef\next{\macrolist}\expandafter\endgroup\next}
-
-
-% @alias.
-% We need some trickery to remove the optional spaces around the equal
-% sign.  Just make them active and then expand them all to nothing.
-\def\alias{\begingroup\obeyspaces\parsearg\aliasxxx}
-\def\aliasxxx #1{\aliasyyy#1\relax}
-\def\aliasyyy #1=#2\relax{\ignoreactivespaces
-\edef\next{\global\let\expandafter\noexpand\csname#1\endcsname=%
-           \expandafter\noexpand\csname#2\endcsname}%
-\expandafter\endgroup\next}
-
-
-\message{cross references,}
-
-\newwrite\auxfile
-
-\newif\ifhavexrefs    % True if xref values are known.
-\newif\ifwarnedxrefs  % True if we warned once that they aren't known.
-
-% @inforef is relatively simple.
-\def\inforef #1{\inforefzzz #1,,,,**}
-\def\inforefzzz #1,#2,#3,#4**{\putwordSee{} \putwordInfo{} \putwordfile{} \file{\ignorespaces #3{}},
-  node \samp{\ignorespaces#1{}}}
-
-% @node's only job in TeX is to define \lastnode, which is used in
-% cross-references.
-\def\node{\ENVcheck\parsearg\nodezzz}
-\def\nodezzz#1{\nodexxx #1,\finishnodeparse}
-\def\nodexxx#1,#2\finishnodeparse{\gdef\lastnode{#1}}
-\let\nwnode=\node
-\let\lastnode=\empty
-
-% Write a cross-reference definition for the current node.  #1 is the
-% type (Ynumbered, Yappendix, Ynothing).
-% 
-\def\donoderef#1{%
-  \ifx\lastnode\empty\else
-    \setref{\lastnode}{#1}%
-    \global\let\lastnode=\empty
-  \fi
-}
-
-% @anchor{NAME} -- define xref target at arbitrary point.
-%
-\newcount\savesfregister
-%
-\gdef\savesf{\relax \ifhmode \savesfregister=\spacefactor \fi}
-\gdef\restoresf{\relax \ifhmode \spacefactor=\savesfregister \fi}
-\gdef\anchor#1{\savesf \setref{#1}{Ynothing}\restoresf \ignorespaces}
-
-% \setref{NAME}{SNT} defines a cross-reference point NAME (a node or an
-% anchor), namely NAME-title (the corresponding @chapter/etc. name),
-% NAME-pg (the page number), and NAME-snt (section number and type).
-% Called from \foonoderef.
-% 
-% We take care not to expand the title.
-%
-% Use \turnoffactive so that punctuation chars such as underscore
-% and backslash work in node names.
-%
-\def\setref#1#2{%
-  \pdfmkdest{#1}%
-  \iflinks
-    {%
-      \turnoffactive
-      \edef\writexrdef##1##2{%
-       \write\auxfile{@xrdef{#1-% #1 of \setref, expanded by the \edef
-         ##1}{##2}}% these are parameters of \writexrdef
-      }
-      \toks0 = \expandafter{\thissection}
-      \immediate \writexrdef{title}{\the\toks0 }%
-      \immediate \writexrdef{snt}{\csname #2\endcsname}% \Ynumbered etc.
-      \writexrdef{pg}{\folio}% will be written later, during \shipout
-    }%
-  \fi
-}
-
-% @xref, @pxref, and @ref generate cross-references.  For \xrefX, #1 is
-% the node name, #2 the name of the Info cross-reference, #3 the printed
-% node name, #4 the name of the Info file, #5 the name of the printed
-% manual.  All but the node name can be omitted.
-%
-\def\pxref#1{\putwordsee{} \xrefX[#1,,,,,,,]}
-\def\xref#1{\putwordSee{} \xrefX[#1,,,,,,,]}
-\def\ref#1{\xrefX[#1,,,,,,,]}
-\def\xrefX[#1,#2,#3,#4,#5,#6]{\begingroup
-  \unsepspaces
-  \def\printedmanual{\ignorespaces #5}%
-  \def\printednodename{\ignorespaces #3}%
-  \setbox1=\hbox{\printedmanual}%
-  \setbox0=\hbox{\printednodename}%
-  \ifdim \wd0 = 0pt
-    % No printed node name was explicitly given.
-    \expandafter\ifx\csname SETxref-automatic-section-title\endcsname\relax
-      % Use the node name inside the square brackets.
-      \def\printednodename{\ignorespaces #1}%
-    \else
-      % Use the actual chapter/section title appear inside
-      % the square brackets.  Use the real section title if we have it.
-      \ifdim \wd1 > 0pt
-        % It is in another manual, so we don't have it.
-        \def\printednodename{\ignorespaces #1}%
-      \else
-        \ifhavexrefs
-          % We know the real title if we have the xref values.
-          \def\printednodename{\refx{#1-title}{}}%
-        \else
-          % Otherwise just copy the Info node name.
-          \def\printednodename{\ignorespaces #1}%
-        \fi%
-      \fi
-    \fi
-  \fi
-  %
-  % If we use \unhbox0 and \unhbox1 to print the node names, TeX does not
-  % insert empty discretionaries after hyphens, which means that it will
-  % not find a line break at a hyphen in a node names.  Since some manuals
-  % are best written with fairly long node names, containing hyphens, this
-  % is a loss.  Therefore, we give the text of the node name again, so it
-  % is as if TeX is seeing it for the first time.
-  \ifpdf
-    \leavevmode
-    \getfilename{#4}%
-    {\turnoffactive \otherbackslash
-     \ifnum\filenamelength>0
-       \startlink attr{/Border [0 0 0]}%
-         goto file{\the\filename.pdf} name{#1}%
-     \else
-       \startlink attr{/Border [0 0 0]}%
-         goto name{\pdfmkpgn{#1}}%
-     \fi
-    }%
-    \linkcolor
-  \fi
-  %
-  \ifdim \wd1 > 0pt
-    \putwordsection{} ``\printednodename'' \putwordin{} \cite{\printedmanual}%
-  \else
-    % _ (for example) has to be the character _ for the purposes of the
-    % control sequence corresponding to the node, but it has to expand
-    % into the usual \leavevmode...\vrule stuff for purposes of
-    % printing. So we \turnoffactive for the \refx-snt, back on for the
-    % printing, back off for the \refx-pg.
-    {\turnoffactive \otherbackslash
-     % Only output a following space if the -snt ref is nonempty; for
-     % @unnumbered and @anchor, it won't be.
-     \setbox2 = \hbox{\ignorespaces \refx{#1-snt}{}}%
-     \ifdim \wd2 > 0pt \refx{#1-snt}\space\fi
-    }%
-    % output the `[mynode]' via a macro.
-    \xrefprintnodename\printednodename
-    %
-    % But we always want a comma and a space:
-    ,\space
-    %
-    % output the `page 3'.
-    \turnoffactive \otherbackslash \putwordpage\tie\refx{#1-pg}{}%
-  \fi
-  \endlink
-\endgroup}
-
-% This macro is called from \xrefX for the `[nodename]' part of xref
-% output.  It's a separate macro only so it can be changed more easily,
-% since not square brackets don't work in some documents.  Particularly
-% one that Bob is working on :).
-%
-\def\xrefprintnodename#1{[#1]}
-
-% Things referred to by \setref.
-%
-\def\Ynothing{}
-\def\Yomitfromtoc{}
-\def\Ynumbered{%
-  \ifnum\secno=0
-    \putwordChapter@tie \the\chapno
-  \else \ifnum\subsecno=0
-    \putwordSection@tie \the\chapno.\the\secno
-  \else \ifnum\subsubsecno=0
-    \putwordSection@tie \the\chapno.\the\secno.\the\subsecno
-  \else
-    \putwordSection@tie \the\chapno.\the\secno.\the\subsecno.\the\subsubsecno
-  \fi\fi\fi
-}
-\def\Yappendix{%
-  \ifnum\secno=0
-     \putwordAppendix@tie @char\the\appendixno{}%
-  \else \ifnum\subsecno=0
-     \putwordSection@tie @char\the\appendixno.\the\secno
-  \else \ifnum\subsubsecno=0
-    \putwordSection@tie @char\the\appendixno.\the\secno.\the\subsecno
-  \else
-    \putwordSection@tie
-      @char\the\appendixno.\the\secno.\the\subsecno.\the\subsubsecno
-  \fi\fi\fi
-}
-
-% Use TeX 3.0's \inputlineno to get the line number, for better error
-% messages, but if we're using an old version of TeX, don't do anything.
-%
-\ifx\inputlineno\thisisundefined
-  \let\linenumber = \empty % Pre-3.0.
-\else
-  \def\linenumber{\the\inputlineno:\space}
-\fi
-
-% Define \refx{NAME}{SUFFIX} to reference a cross-reference string named NAME.
-% If its value is nonempty, SUFFIX is output afterward.
-%
-\def\refx#1#2{%
-  {%
-    \indexnofonts
-    \otherbackslash
-    \expandafter\global\expandafter\let\expandafter\thisrefX
-      \csname X#1\endcsname
-  }%
-  \ifx\thisrefX\relax
-    % If not defined, say something at least.
-    \angleleft un\-de\-fined\angleright
-    \iflinks
-      \ifhavexrefs
-        \message{\linenumber Undefined cross reference `#1'.}%
-      \else
-        \ifwarnedxrefs\else
-          \global\warnedxrefstrue
-          \message{Cross reference values unknown; you must run TeX again.}%
-        \fi
-      \fi
-    \fi
-  \else
-    % It's defined, so just use it.
-    \thisrefX
-  \fi
-  #2% Output the suffix in any case.
-}
-
-% This is the macro invoked by entries in the aux file.
-%
-\def\xrdef#1{\expandafter\gdef\csname X#1\endcsname}
-
-% Read the last existing aux file, if any.  No error if none exists.
-\def\readauxfile{\begingroup
-  \catcode`\^^@=\other
-  \catcode`\^^A=\other
-  \catcode`\^^B=\other
-  \catcode`\^^C=\other
-  \catcode`\^^D=\other
-  \catcode`\^^E=\other
-  \catcode`\^^F=\other
-  \catcode`\^^G=\other
-  \catcode`\^^H=\other
-  \catcode`\^^K=\other
-  \catcode`\^^L=\other
-  \catcode`\^^N=\other
-  \catcode`\^^P=\other
-  \catcode`\^^Q=\other
-  \catcode`\^^R=\other
-  \catcode`\^^S=\other
-  \catcode`\^^T=\other
-  \catcode`\^^U=\other
-  \catcode`\^^V=\other
-  \catcode`\^^W=\other
-  \catcode`\^^X=\other
-  \catcode`\^^Z=\other
-  \catcode`\^^[=\other
-  \catcode`\^^\=\other
-  \catcode`\^^]=\other
-  \catcode`\^^^=\other
-  \catcode`\^^_=\other
-  % It was suggested to set the catcode of ^ to 7, which would allow ^^e4 etc.
-  % in xref tags, i.e., node names.  But since ^^e4 notation isn't
-  % supported in the main text, it doesn't seem desirable.  Furthermore,
-  % that is not enough: for node names that actually contain a ^
-  % character, we would end up writing a line like this: 'xrdef {'hat
-  % b-title}{'hat b} and \xrdef does a \csname...\endcsname on the first
-  % argument, and \hat is not an expandable control sequence.  It could
-  % all be worked out, but why?  Either we support ^^ or we don't.
-  %
-  % The other change necessary for this was to define \auxhat:
-  % \def\auxhat{\def^{'hat }}% extra space so ok if followed by letter
-  % and then to call \auxhat in \setq.
-  %
-  \catcode`\^=\other
-  %
-  % Special characters.  Should be turned off anyway, but...
-  \catcode`\~=\other
-  \catcode`\[=\other
-  \catcode`\]=\other
-  \catcode`\"=\other
-  \catcode`\_=\other
-  \catcode`\|=\other
-  \catcode`\<=\other
-  \catcode`\>=\other
-  \catcode`\$=\other
-  \catcode`\#=\other
-  \catcode`\&=\other
-  \catcode`\%=\other
-  \catcode`+=\other % avoid \+ for paranoia even though we've turned it off
-  %
-  % Make the characters 128-255 be printing characters
-  {%
-    \count 1=128
-    \def\loop{%
-      \catcode\count 1=\other
-      \advance\count 1 by 1
-      \ifnum \count 1<256 \loop \fi
-    }%
-  }%
-  %
-  % Turn off \ as an escape so we do not lose on
-  % entries which were dumped with control sequences in their names.
-  % For example, @xrdef{$\leq $-fun}{page ...} made by @defun ^^
-  % Reference to such entries still does not work the way one would wish,
-  % but at least they do not bomb out when the aux file is read in.
-  \catcode`\\=\other
-  %
-  % @ is our escape character in .aux files.
-  \catcode`\{=1
-  \catcode`\}=2
-  \catcode`\@=0
-  %
-  \openin 1 \jobname.aux
-  \ifeof 1 \else
-    \closein 1
-    \input \jobname.aux
-    \global\havexrefstrue
-  \fi
-  % Open the new aux file.  TeX will close it automatically at exit.
-  \openout\auxfile=\jobname.aux
-\endgroup}
-
-
-% Footnotes.
-
-\newcount \footnoteno
-
-% The trailing space in the following definition for supereject is
-% vital for proper filling; pages come out unaligned when you do a
-% pagealignmacro call if that space before the closing brace is
-% removed. (Generally, numeric constants should always be followed by a
-% space to prevent strange expansion errors.)
-\def\supereject{\par\penalty -20000\footnoteno =0 }
-
-% @footnotestyle is meaningful for info output only.
-\let\footnotestyle=\comment
-
-\let\ptexfootnote=\footnote
-
-{\catcode `\@=11
-%
-% Auto-number footnotes.  Otherwise like plain.
-\gdef\footnote{%
-  \let\indent=\ptexindent
-  \let\noindent=\ptexnoindent
-  \global\advance\footnoteno by \@ne
-  \edef\thisfootno{$^{\the\footnoteno}$}%
-  %
-  % In case the footnote comes at the end of a sentence, preserve the
-  % extra spacing after we do the footnote number.
-  \let\@sf\empty
-  \ifhmode\edef\@sf{\spacefactor\the\spacefactor}\ptexslash\fi
-  %
-  % Remove inadvertent blank space before typesetting the footnote number.
-  \unskip
-  \thisfootno\@sf
-  \dofootnote
-}%
-
-% Don't bother with the trickery in plain.tex to not require the
-% footnote text as a parameter.  Our footnotes don't need to be so general.
-%
-% Oh yes, they do; otherwise, @ifset and anything else that uses
-% \parseargline fail inside footnotes because the tokens are fixed when
-% the footnote is read.  --karl, 16nov96.
-%
-% The start of the footnote looks usually like this:
-\gdef\startfootins{\insert\footins\bgroup}
-%
-% ... but this macro is redefined inside @multitable.
-%
-\gdef\dofootnote{%
-  \startfootins
-  % We want to typeset this text as a normal paragraph, even if the
-  % footnote reference occurs in (for example) a display environment.
-  % So reset some parameters.
-  \hsize=\pagewidth
-  \interlinepenalty\interfootnotelinepenalty
-  \splittopskip\ht\strutbox % top baseline for broken footnotes
-  \splitmaxdepth\dp\strutbox
-  \floatingpenalty\@MM
-  \leftskip\z@skip
-  \rightskip\z@skip
-  \spaceskip\z@skip
-  \xspaceskip\z@skip
-  \parindent\defaultparindent
-  %
-  \smallfonts \rm
-  %
-  % Because we use hanging indentation in footnotes, a @noindent appears
-  % to exdent this text, so make it be a no-op.  makeinfo does not use
-  % hanging indentation so @noindent can still be needed within footnote
-  % text after an @example or the like (not that this is good style).
-  \let\noindent = \relax
-  %
-  % Hang the footnote text off the number.  Use \everypar in case the
-  % footnote extends for more than one paragraph.
-  \everypar = {\hang}%
-  \textindent{\thisfootno}%
-  %
-  % Don't crash into the line above the footnote text.  Since this
-  % expands into a box, it must come within the paragraph, lest it
-  % provide a place where TeX can split the footnote.
-  \footstrut
-  \futurelet\next\fo@t
-}
-}%end \catcode `\@=11
-
-% @| inserts a changebar to the left of the current line.  It should
-% surround any changed text.  This approach does *not* work if the
-% change spans more than two lines of output.  To handle that, we would
-% have adopt a much more difficult approach (putting marks into the main
-% vertical list for the beginning and end of each change).
-%
-\def\|{%
-  % \vadjust can only be used in horizontal mode.
-  \leavevmode
-  %
-  % Append this vertical mode material after the current line in the output.
-  \vadjust{%
-    % We want to insert a rule with the height and depth of the current
-    % leading; that is exactly what \strutbox is supposed to record.
-    \vskip-\baselineskip
-    %
-    % \vadjust-items are inserted at the left edge of the type.  So
-    % the \llap here moves out into the left-hand margin.
-    \llap{%
-      %
-      % For a thicker or thinner bar, change the `1pt'.
-      \vrule height\baselineskip width1pt
-      %
-      % This is the space between the bar and the text.
-      \hskip 12pt
-    }%
-  }%
-}
-
-% For a final copy, take out the rectangles
-% that mark overfull boxes (in case you have decided
-% that the text looks ok even though it passes the margin).
-%
-\def\finalout{\overfullrule=0pt}
-
-% @image.  We use the macros from epsf.tex to support this.
-% If epsf.tex is not installed and @image is used, we complain.
-%
-% Check for and read epsf.tex up front.  If we read it only at @image
-% time, we might be inside a group, and then its definitions would get
-% undone and the next image would fail.
-\openin 1 = epsf.tex
-\ifeof 1 \else
-  \closein 1
-  % Do not bother showing banner with epsf.tex v2.7k (available in
-  % doc/epsf.tex and on ctan).
-  \def\epsfannounce{\toks0 = }%
-  \input epsf.tex
-\fi
-%
-% We will only complain once about lack of epsf.tex.
-\newif\ifwarnednoepsf
-\newhelp\noepsfhelp{epsf.tex must be installed for images to
-  work.  It is also included in the Texinfo distribution, or you can get
-  it from ftp://tug.org/tex/epsf.tex.}
-%
-\def\image#1{%
-  \ifx\epsfbox\undefined
-    \ifwarnednoepsf \else
-      \errhelp = \noepsfhelp
-      \errmessage{epsf.tex not found, images will be ignored}%
-      \global\warnednoepsftrue
-    \fi
-  \else
-    \imagexxx #1,,,,,\finish
-  \fi
-}
-%
-% Arguments to @image:
-% #1 is (mandatory) image filename; we tack on .eps extension.
-% #2 is (optional) width, #3 is (optional) height.
-% #4 is (ignored optional) html alt text.
-% #5 is (ignored optional) extension.
-% #6 is just the usual extra ignored arg for parsing this stuff.
-\newif\ifimagevmode
-\def\imagexxx#1,#2,#3,#4,#5,#6\finish{\begingroup
-  \catcode`\^^M = 5     % in case we're inside an example
-  \normalturnoffactive  % allow _ et al. in names
-  % If the image is by itself, center it.
-  \ifvmode
-    \imagevmodetrue
-    \nobreak\bigskip
-    % Usually we'll have text after the image which will insert
-    % \parskip glue, so insert it here too to equalize the space
-    % above and below.
-    \nobreak\vskip\parskip
-    \nobreak
-    \line\bgroup\hss
-  \fi
-  %
-  % Output the image.
-  \ifpdf
-    \dopdfimage{#1}{#2}{#3}%
-  \else
-    % \epsfbox itself resets \epsf?size at each figure.
-    \setbox0 = \hbox{\ignorespaces #2}\ifdim\wd0 > 0pt \epsfxsize=#2\relax \fi
-    \setbox0 = \hbox{\ignorespaces #3}\ifdim\wd0 > 0pt \epsfysize=#3\relax \fi
-    \epsfbox{#1.eps}%
-  \fi
-  %
-  \ifimagevmode \hss \egroup \bigbreak \fi  % space after the image
-\endgroup}
-
-
-\message{localization,}
-% and i18n.
-
-% @documentlanguage is usually given very early, just after
-% @setfilename.  If done too late, it may not override everything
-% properly.  Single argument is the language abbreviation.
-% It would be nice if we could set up a hyphenation file here.
-%
-\def\documentlanguage{\parsearg\dodocumentlanguage}
-\def\dodocumentlanguage#1{%
-  \tex % read txi-??.tex file in plain TeX.
-  % Read the file if it exists.
-  \openin 1 txi-#1.tex
-  \ifeof1
-    \errhelp = \nolanghelp
-    \errmessage{Cannot read language file txi-#1.tex}%
-    \let\temp = \relax
-  \else
-    \def\temp{\input txi-#1.tex }%
-  \fi
-  \temp
-  \endgroup
-}
-\newhelp\nolanghelp{The given language definition file cannot be found or
-is empty.  Maybe you need to install it?  In the current directory
-should work if nowhere else does.}
-
-
-% @documentencoding should change something in TeX eventually, most
-% likely, but for now just recognize it.
-\let\documentencoding = \comment
-
-
-% Page size parameters.
-%
-\newdimen\defaultparindent \defaultparindent = 15pt
-
-\chapheadingskip = 15pt plus 4pt minus 2pt
-\secheadingskip = 12pt plus 3pt minus 2pt
-\subsecheadingskip = 9pt plus 2pt minus 2pt
-
-% Prevent underfull vbox error messages.
-\vbadness = 10000
-
-% Don't be so finicky about underfull hboxes, either.
-\hbadness = 2000
-
-% Following George Bush, just get rid of widows and orphans.
-\widowpenalty=10000
-\clubpenalty=10000
-
-% Use TeX 3.0's \emergencystretch to help line breaking, but if we're
-% using an old version of TeX, don't do anything.  We want the amount of
-% stretch added to depend on the line length, hence the dependence on
-% \hsize.  We call this whenever the paper size is set.
-%
-\def\setemergencystretch{%
-  \ifx\emergencystretch\thisisundefined
-    % Allow us to assign to \emergencystretch anyway.
-    \def\emergencystretch{\dimen0}%
-  \else
-    \emergencystretch = .15\hsize
-  \fi
-}
-
-% Parameters in order: 1) textheight; 2) textwidth; 3) voffset;
-% 4) hoffset; 5) binding offset; 6) topskip; 7) physical page height; 8)
-% physical page width.
-%
-% We also call \setleading{\textleading}, so the caller should define
-% \textleading.  The caller should also set \parskip.
-%
-\def\internalpagesizes#1#2#3#4#5#6#7#8{%
-  \voffset = #3\relax
-  \topskip = #6\relax
-  \splittopskip = \topskip
-  %
-  \vsize = #1\relax
-  \advance\vsize by \topskip
-  \outervsize = \vsize
-  \advance\outervsize by 2\topandbottommargin
-  \pageheight = \vsize
-  %
-  \hsize = #2\relax
-  \outerhsize = \hsize
-  \advance\outerhsize by 0.5in
-  \pagewidth = \hsize
-  %
-  \normaloffset = #4\relax
-  \bindingoffset = #5\relax
-  %
-  \ifpdf
-    \pdfpageheight #7\relax
-    \pdfpagewidth #8\relax
-  \fi
-  %
-  \setleading{\textleading}
-  %
-  \parindent = \defaultparindent
-  \setemergencystretch
-}
-
-% @letterpaper (the default).
-\def\letterpaper{{\globaldefs = 1
-  \parskip = 3pt plus 2pt minus 1pt
-  \textleading = 13.2pt
-  %
-  % If page is nothing but text, make it come out even.
-  \internalpagesizes{46\baselineskip}{6in}%
-                    {\voffset}{.25in}%
-                    {\bindingoffset}{36pt}%
-                    {11in}{8.5in}%
-}}
-
-% Use @smallbook to reset parameters for 7x9.5 (or so) format.
-\def\smallbook{{\globaldefs = 1
-  \parskip = 2pt plus 1pt
-  \textleading = 12pt
-  %
-  \internalpagesizes{7.5in}{5in}%
-                    {\voffset}{.25in}%
-                    {\bindingoffset}{16pt}%
-                    {9.25in}{7in}%
-  %
-  \lispnarrowing = 0.3in
-  \tolerance = 700
-  \hfuzz = 1pt
-  \contentsrightmargin = 0pt
-  \defbodyindent = .5cm
-}}
-
-% Use @afourpaper to print on European A4 paper.
-\def\afourpaper{{\globaldefs = 1
-  \parskip = 3pt plus 2pt minus 1pt
-  \textleading = 13.2pt
-  %
-  % Double-side printing via postscript on Laserjet 4050
-  % prints double-sided nicely when \bindingoffset=10mm and \hoffset=-6mm.
-  % To change the settings for a different printer or situation, adjust
-  % \normaloffset until the front-side and back-side texts align.  Then
-  % do the same for \bindingoffset.  You can set these for testing in
-  % your texinfo source file like this:
-  % @tex
-  % \global\normaloffset = -6mm
-  % \global\bindingoffset = 10mm
-  % @end tex
-  \internalpagesizes{51\baselineskip}{160mm}
-                    {\voffset}{\hoffset}%
-                    {\bindingoffset}{44pt}%
-                    {297mm}{210mm}%
-  %
-  \tolerance = 700
-  \hfuzz = 1pt
-  \contentsrightmargin = 0pt
-  \defbodyindent = 5mm
-}}
-
-% Use @afivepaper to print on European A5 paper.
-% From romildo@urano.iceb.ufop.br, 2 July 2000.
-% He also recommends making @example and @lisp be small.
-\def\afivepaper{{\globaldefs = 1
-  \parskip = 2pt plus 1pt minus 0.1pt
-  \textleading = 12.5pt
-  %
-  \internalpagesizes{160mm}{120mm}%
-                    {\voffset}{\hoffset}%
-                    {\bindingoffset}{8pt}%
-                    {210mm}{148mm}%
-  %
-  \lispnarrowing = 0.2in
-  \tolerance = 800
-  \hfuzz = 1.2pt
-  \contentsrightmargin = 0pt
-  \defbodyindent = 2mm
-  \tableindent = 12mm
-}}
-
-% A specific text layout, 24x15cm overall, intended for A4 paper.
-\def\afourlatex{{\globaldefs = 1
-  \afourpaper
-  \internalpagesizes{237mm}{150mm}%
-                    {\voffset}{4.6mm}%
-                    {\bindingoffset}{7mm}%
-                    {297mm}{210mm}%
-  %
-  % Must explicitly reset to 0 because we call \afourpaper.
-  \globaldefs = 0
-}}
-
-% Use @afourwide to print on A4 paper in landscape format.
-\def\afourwide{{\globaldefs = 1
-  \afourpaper
-  \internalpagesizes{241mm}{165mm}%
-                    {\voffset}{-2.95mm}%
-                    {\bindingoffset}{7mm}%
-                    {297mm}{210mm}%
-  \globaldefs = 0
-}}
-
-% @pagesizes TEXTHEIGHT[,TEXTWIDTH]
-% Perhaps we should allow setting the margins, \topskip, \parskip,
-% and/or leading, also. Or perhaps we should compute them somehow.
-%
-\def\pagesizes{\parsearg\pagesizesxxx}
-\def\pagesizesxxx#1{\pagesizesyyy #1,,\finish}
-\def\pagesizesyyy#1,#2,#3\finish{{%
-  \setbox0 = \hbox{\ignorespaces #2}\ifdim\wd0 > 0pt \hsize=#2\relax \fi
-  \globaldefs = 1
-  %
-  \parskip = 3pt plus 2pt minus 1pt
-  \setleading{\textleading}%
-  %
-  \dimen0 = #1
-  \advance\dimen0 by \voffset
-  %
-  \dimen2 = \hsize
-  \advance\dimen2 by \normaloffset
-  %
-  \internalpagesizes{#1}{\hsize}%
-                    {\voffset}{\normaloffset}%
-                    {\bindingoffset}{44pt}%
-                    {\dimen0}{\dimen2}%
-}}
-
-% Set default to letter.
-%
-\letterpaper
-
-
-\message{and turning on texinfo input format.}
-
-% Define macros to output various characters with catcode for normal text.
-\catcode`\"=\other
-\catcode`\~=\other
-\catcode`\^=\other
-\catcode`\_=\other
-\catcode`\|=\other
-\catcode`\<=\other
-\catcode`\>=\other
-\catcode`\+=\other
-\catcode`\$=\other
-\def\normaldoublequote{"}
-\def\normaltilde{~}
-\def\normalcaret{^}
-\def\normalunderscore{_}
-\def\normalverticalbar{|}
-\def\normalless{<}
-\def\normalgreater{>}
-\def\normalplus{+}
-\def\normaldollar{$}%$ font-lock fix
-
-% This macro is used to make a character print one way in ttfont
-% where it can probably just be output, and another way in other fonts,
-% where something hairier probably needs to be done.
-%
-% #1 is what to print if we are indeed using \tt; #2 is what to print
-% otherwise.  Since all the Computer Modern typewriter fonts have zero
-% interword stretch (and shrink), and it is reasonable to expect all
-% typewriter fonts to have this, we can check that font parameter.
-%
-\def\ifusingtt#1#2{\ifdim \fontdimen3\font=0pt #1\else #2\fi}
-
-% Same as above, but check for italic font.  Actually this also catches
-% non-italic slanted fonts since it is impossible to distinguish them from
-% italic fonts.  But since this is only used by $ and it uses \sl anyway
-% this is not a problem.
-\def\ifusingit#1#2{\ifdim \fontdimen1\font>0pt #1\else #2\fi}
-
-% Turn off all special characters except @
-% (and those which the user can use as if they were ordinary).
-% Most of these we simply print from the \tt font, but for some, we can
-% use math or other variants that look better in normal text.
-
-\catcode`\"=\active
-\def\activedoublequote{{\tt\char34}}
-\let"=\activedoublequote
-\catcode`\~=\active
-\def~{{\tt\char126}}
-\chardef\hat=`\^
-\catcode`\^=\active
-\def^{{\tt \hat}}
-
-\catcode`\_=\active
-\def_{\ifusingtt\normalunderscore\_}
-% Subroutine for the previous macro.
-\def\_{\leavevmode \kern.07em \vbox{\hrule width.3em height.1ex}\kern .07em }
-
-\catcode`\|=\active
-\def|{{\tt\char124}}
-\chardef \less=`\<
-\catcode`\<=\active
-\def<{{\tt \less}}
-\chardef \gtr=`\>
-\catcode`\>=\active
-\def>{{\tt \gtr}}
-\catcode`\+=\active
-\def+{{\tt \char 43}}
-\catcode`\$=\active
-\def${\ifusingit{{\sl\$}}\normaldollar}%$ font-lock fix
-
-% Set up an active definition for =, but don't enable it most of the time.
-{\catcode`\==\active
-\global\def={{\tt \char 61}}}
-
-\catcode`+=\active
-\catcode`\_=\active
-
-% If a .fmt file is being used, characters that might appear in a file
-% name cannot be active until we have parsed the command line.
-% So turn them off again, and have \everyjob (or @setfilename) turn them on.
-% \otherifyactive is called near the end of this file.
-\def\otherifyactive{\catcode`+=\other \catcode`\_=\other}
-
-\catcode`\@=0
-
-% \rawbackslashxx outputs one backslash character in current font,
-% as in \char`\\.
-\global\chardef\rawbackslashxx=`\\
-
-% \rawbackslash defines an active \ to do \rawbackslashxx.
-% \otherbackslash defines an active \ to be a literal `\' character with
-% catcode other.
-{\catcode`\\=\active
- @gdef@rawbackslash{@let\=@rawbackslashxx}
- @gdef@otherbackslash{@let\=@realbackslash}
-}
-
-% \realbackslash is an actual character `\' with catcode other.
-{\catcode`\\=\other @gdef@realbackslash{\}}
-
-% \normalbackslash outputs one backslash in fixed width font.
-\def\normalbackslash{{\tt\rawbackslashxx}}
-
-\catcode`\\=\active
-
-% Used sometimes to turn off (effectively) the active characters
-% even after parsing them.
-@def@turnoffactive{%
-  @let"=@normaldoublequote
-  @let\=@realbackslash
-  @let~=@normaltilde
-  @let^=@normalcaret
-  @let_=@normalunderscore
-  @let|=@normalverticalbar
-  @let<=@normalless
-  @let>=@normalgreater
-  @let+=@normalplus
-  @let$=@normaldollar %$ font-lock fix
-}
-
-% Same as @turnoffactive except outputs \ as {\tt\char`\\} instead of
-% the literal character `\'.  (Thus, \ is not expandable when this is in
-% effect.)
-%
-@def@normalturnoffactive{@turnoffactive @let\=@normalbackslash}
-
-% Make _ and + \other characters, temporarily.
-% This is canceled by @fixbackslash.
-@otherifyactive
-
-% If a .fmt file is being used, we don't want the `\input texinfo' to show up.
-% That is what \eatinput is for; after that, the `\' should revert to printing
-% a backslash.
-%
-@gdef@eatinput input texinfo{@fixbackslash}
-@global@let\ = @eatinput
-
-% On the other hand, perhaps the file did not have a `\input texinfo'. Then
-% the first `\{ in the file would cause an error. This macro tries to fix
-% that, assuming it is called before the first `\' could plausibly occur.
-% Also back turn on active characters that might appear in the input
-% file name, in case not using a pre-dumped format.
-%
-@gdef@fixbackslash{%
-  @ifx\@eatinput @let\ = @normalbackslash @fi
-  @catcode`+=@active
-  @catcode`@_=@active
-}
-
-% Say @foo, not \foo, in error messages.
-@escapechar = `@@
-
-% These look ok in all fonts, so just make them not special.
-@catcode`@& = @other
-@catcode`@# = @other
-@catcode`@% = @other
-
-@c Set initial fonts.
-@textfonts
-@rm
-
-
-@c Local variables:
-@c eval: (add-hook 'write-file-hooks 'time-stamp)
-@c page-delimiter: "^\\\\message"
-@c time-stamp-start: "def\\\\texinfoversion{"
-@c time-stamp-format: "%:y-%02m-%02d.%02H"
-@c time-stamp-end: "}"
-@c End:
-
-@ignore
-   arch-tag: e1b36e32-c96e-4135-a41a-0b2efa2ea115
-@end ignore
diff --git a/apps/autodist/makedist.in b/apps/autodist/makedist.in
deleted file mode 100755 (executable)
index 8979e58..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-#!/bin/sh
-#
-# Author: Pekka Riikonen <priikone@silcnet.org>
-#
-# Copyright (C) 2005 Pekka Riikonen
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-#   1. Redistributions of source code must retain the above copyright
-#      notice, this list of conditions and the following disclaimer.
-#   2. Redistributions in binary form must reproduce the above copyright
-#      notice, this list of conditions and the following disclaimer in the
-#      documentation and/or other materials provided with the distribution.
-#   3. The name of the author may not be used to endorse or promote
-#      products derived from this software without specific prior written
-#      permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
-# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
-# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
-# NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
-# TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#
-
-AUTODIST="@AUTODIST@"
-
-$AUTODIST $@ -m
diff --git a/apps/autodist/tests/Makefile.am b/apps/autodist/tests/Makefile.am
deleted file mode 100644 (file)
index f17d43b..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-#
-#  Makefile.am
-#
-#  Author: Pekka Riikonen <priikone@silcnet.org>
-#
-#  Copyright (C) 2005 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.
-#
-
-AUTOMAKE_OPTIONS = 1.0 no-dependencies foreign
-
-TESTS =                        \
-       autodist1.test          \
-       autodist2.test          \
-       autodist3.test          \
-       autodist4.test          \
-       autodist5.test          \
-       autodist6.test          \
-       autodist7.test
-
-clean-local:
-       -rm -rf test
-
-EXTRA_DIST = $(TESTS)
diff --git a/apps/autodist/tests/autodist1.test b/apps/autodist/tests/autodist1.test
deleted file mode 100755 (executable)
index f1b7093..0000000
+++ /dev/null
@@ -1,83 +0,0 @@
-#!/bin/sh
-
-AUTODIST=../../autodist
-
-rm -rf test
-mkdir test
-
-cd test || exit 1
-
-chmod +x $AUTODIST || exit 1
-
-cat << EOF > configure.ad
-AD_INIT
-#ifdef _DIST_DEFAULT
-AC_CANONICAL_BUILD
-AM_INIT_AUTOMAKE
-AC_PREREQ(2.52)
-AC_CONFIG_HEADERS(config.h)
-AD_INCLUDE_CONFIGURE
-AC_CONFIG_FILES(
-Makefile
-)
-AC_OUTPUT
-echo configure.ad ok
-#else !_DIST_DEFAULT
-echo "ERROR"
-exit 1
-#endif _DIST_DEFAULT
-EOF
-
-cat << EOF > Makefile.ad
-SUBDIRS=       \\
-#ifdef _DIST_NODEF
-       nodef   \\
-       poa     \\
-       paa     \\
-#endif _DIST_NODEF
-       .       \\
-       .       \\
-       .       \\
-       .       \\
-
-EOF
-
-rm -rf distdir subdir
-mkdir -p subdir || exit 1
-
-cat << EOF > subdir/configure.ad
-# subdir/configure.ad fragment
-#ifndef _DIST_NODEF
-echo "_DIST_NODEF ok"
-#else _DIST_NODEF
-echo "ERROR"
-exit 1
-#endif _DIST_NODEF
-EOF
-
-$AUTODIST -i || exit 1
-if test '!' -d distdir; then
-  echo "error: distdir/ does no exist"
-  exit 1
-fi 
-
-cp -p ../../default distdir || exit 1
-cp -p ../../autodist.conf distdir || exit 1
-
-touch README NEWS AUTHORS ChangeLog
-
-$AUTODIST || exit 1
-
-./configure || exit 1
-make || exit 1
-echo make ok
-
-echo update test
-touch Makefile.ad
-make || exit 1
-echo update test ok
-
-echo test ok
-
-# Cleanup
-rm -rf subdir distdir
diff --git a/apps/autodist/tests/autodist2.test b/apps/autodist/tests/autodist2.test
deleted file mode 100755 (executable)
index 16e5f93..0000000
+++ /dev/null
@@ -1,90 +0,0 @@
-#!/bin/sh
-
-AUTODIST=../../autodist
-
-rm -rf test
-mkdir test
-
-cd test || exit 1
-
-chmod +x $AUTODIST || exit 1
-
-cat << EOF > configure.ad
-AD_INIT
-#ifdef _DIST_TEST
-AC_CANONICAL_BUILD
-AM_INIT_AUTOMAKE
-AC_PREREQ(2.52)
-AC_CONFIG_HEADERS(config.h)
-AD_INCLUDE_CONFIGURE
-AC_CONFIG_FILES(
-Makefile
-)
-AC_OUTPUT
-echo configure.ad ok
-#else !_DIST_TEST
-echo "ERROR"
-exit 1
-#endif _DIST_TEST
-EOF
-
-cat << EOF > Makefile.ad
-SUBDIRS=       \\
-#ifndef _DIST_TEST
-       nodef   \\
-#endif _DIST_TEST
-       .       \\
-
-EOF
-
-rm -rf distdir subdir
-mkdir -p subdir || exit 1
-
-cat << EOF > subdir/configure.ad
-# subdir/configure.ad fragment
-#ifndef _DIST_NODEF
-#ifdef _DIST_TEST
-echo "_DIST_NODEF ok"
-#endif _DIST_TEST
-#endif _DIST_NODEF
-EOF
-
-$AUTODIST -i || exit 1
-if test '!' -d distdir; then
-  echo "error: distdir/ does no exist"
-  exit 1
-fi 
-
-cp -p ../../default distdir || exit 1
-cp -p ../../autodist.conf distdir || exit 1
-
-cat << EOF > distdir/test
-name Test Distribution
-package test-distro
-bug-report test-dist@test.org
-define _DIST_TEST
-EOF
-
-touch README NEWS AUTHORS ChangeLog
-
-echo "inherit test" >> distdir/default
-
-$AUTODIST || exit 1
-$AUTODIST test 1.0 || exit 1
-
-./configure || exit 1
-make || exit 1
-echo make ok
-
-$AUTODIST -m || exit 1
-
-if test '!' -f test-distro-1.0.tar.gz; then
-  echo "error: makedist failed"
-  exit 1
-fi
-
-echo test ok
-
-# Cleanup
-rm -rf subdir distdir
-
diff --git a/apps/autodist/tests/autodist3.test b/apps/autodist/tests/autodist3.test
deleted file mode 100755 (executable)
index e70109d..0000000
+++ /dev/null
@@ -1,103 +0,0 @@
-#!/bin/sh
-
-AUTODIST=../autodist
-
-rm -f ./autodist
-
-echo "Testing with /bin/zsh"
-
-# Change shell to zsh
-if test '!' -f /bin/zsh; then
-  echo "/bin/zsh does not exist, cannot run test"
-  exit 0
-fi
-cat $AUTODIST | sed 's/#!\/bin\/sh/#!\/bin\/zsh/' > ./autodist
-
-AUTODIST=../autodist   # from inside tests/test
-
-rm -rf test
-mkdir test
-
-cd test || exit 1
-
-chmod +x $AUTODIST || exit 1
-
-cat << EOF > configure.ad
-AD_INIT
-#ifdef _DIST_TEST
-AC_CANONICAL_BUILD
-AM_INIT_AUTOMAKE
-AC_PREREQ(2.52)
-AC_CONFIG_HEADERS(config.h)
-AD_INCLUDE_CONFIGURE
-AC_CONFIG_FILES(
-Makefile
-)
-AC_OUTPUT
-echo configure.ad ok
-#else !_DIST_TEST
-echo "ERROR"
-exit 1
-#endif _DIST_TEST
-EOF
-
-cat << EOF > Makefile.ad
-SUBDIRS=       \\
-#ifndef _DIST_TEST
-       nodef   \\
-#endif _DIST_TEST
-       .       \\
-
-EOF
-
-rm -rf distdir subdir
-mkdir -p subdir || exit 1
-
-cat << EOF > subdir/configure.ad
-# subdir/configure.ad fragment
-#ifndef _DIST_NODEF
-#ifdef _DIST_TEST
-echo "_DIST_NODEF ok"
-#endif _DIST_TEST
-#endif _DIST_NODEF
-EOF
-
-$AUTODIST -i || exit 1
-if test '!' -d distdir; then
-  echo "error: distdir/ does no exist"
-  exit 1
-fi 
-
-cp -p ../../default distdir || exit 1
-cp -p ../../autodist.conf distdir || exit 1
-
-cat << EOF > distdir/test
-name Test Distribution
-package test-distro
-bug-report test-dist@test.org
-define _DIST_TEST
-EOF
-
-touch README NEWS AUTHORS ChangeLog
-
-echo "inherit test" >> distdir/default
-
-$AUTODIST || exit 1
-$AUTODIST test 1.0 || exit 1
-
-./configure || exit 1
-make || exit 1
-echo make ok
-
-$AUTODIST -m || exit 1
-
-if test '!' -f test-distro-1.0.tar.gz; then
-  echo "error: makedist failed"
-  exit 1
-fi
-
-echo test ok
-
-# Cleanup
-rm -rf subdir distdir $AUTODIST
-
diff --git a/apps/autodist/tests/autodist4.test b/apps/autodist/tests/autodist4.test
deleted file mode 100755 (executable)
index 1de8011..0000000
+++ /dev/null
@@ -1,103 +0,0 @@
-#!/bin/sh
-
-AUTODIST=../autodist
-
-rm -f ./autodist
-
-echo "Testing with /bin/ksh"
-
-# Change shell to ksh
-if test '!' -f /bin/ksh; then
-  echo "/bin/zsh does not exist, cannot run test"
-  exit 0
-fi
-cat $AUTODIST | sed 's/#!\/bin\/sh/#!\/bin\/ksh/' > ./autodist
-
-AUTODIST=../autodist   # from inside tests/test
-
-rm -rf test
-mkdir test
-
-cd test || exit 1
-
-chmod +x $AUTODIST || exit 1
-
-cat << EOF > configure.ad
-AD_INIT
-#ifdef _DIST_TEST
-AC_CANONICAL_BUILD
-AM_INIT_AUTOMAKE
-AC_PREREQ(2.52)
-AC_CONFIG_HEADERS(config.h)
-AD_INCLUDE_CONFIGURE
-AC_CONFIG_FILES(
-Makefile
-)
-AC_OUTPUT
-echo configure.ad ok
-#else !_DIST_TEST
-echo "ERROR"
-exit 1
-#endif _DIST_TEST
-EOF
-
-cat << EOF > Makefile.ad
-SUBDIRS=       \\
-#ifndef _DIST_TEST
-       nodef   \\
-#endif _DIST_TEST
-       .       \\
-
-EOF
-
-rm -rf distdir subdir
-mkdir -p subdir || exit 1
-
-cat << EOF > subdir/configure.ad
-# subdir/configure.ad fragment
-#ifndef _DIST_NODEF
-#ifdef _DIST_TEST
-echo "_DIST_NODEF ok"
-#endif _DIST_TEST
-#endif _DIST_NODEF
-EOF
-
-$AUTODIST -i || exit 1
-if test '!' -d distdir; then
-  echo "error: distdir/ does no exist"
-  exit 1
-fi 
-
-cp -p ../../default distdir || exit 1
-cp -p ../../autodist.conf distdir || exit 1
-
-cat << EOF > distdir/test
-       name Test Distribution
-       package test-distro
-       bug-report test-dist@test.org
-       define _DIST_TEST
-EOF
-
-touch README NEWS AUTHORS ChangeLog
-
-echo "inherit test" >> distdir/default
-
-$AUTODIST || exit 1
-$AUTODIST test 1.0 || exit 1
-
-./configure || exit 1
-make || exit 1
-echo make ok
-
-$AUTODIST -m || exit 1
-
-if test '!' -f test-distro-1.0.tar.gz; then
-  echo "error: makedist failed"
-  exit 1
-fi
-
-echo test ok
-
-# Cleanup
-rm -rf subdir distdir $AUTODIST
-
diff --git a/apps/autodist/tests/autodist5.test b/apps/autodist/tests/autodist5.test
deleted file mode 100755 (executable)
index 58691e3..0000000
+++ /dev/null
@@ -1,104 +0,0 @@
-#!/bin/sh
-
-AUTODIST=../autodist
-
-rm -f ./autodist
-
-echo "Testing with /bin/ash"
-
-# Change shell to ash
-if test '!' -f /bin/ash; then
-  echo "/bin/zsh does not exist, cannot run test"
-  exit 0
-fi
-cat $AUTODIST | sed 's/#!\/bin\/sh/#!\/bin\/ash/' > ./autodist
-
-AUTODIST=../autodist   # from inside tests/test
-
-rm -rf test
-mkdir test
-
-cd test || exit 1
-
-chmod +x $AUTODIST || exit 1
-
-cat << EOF > configure.ad
-AD_INIT
-#ifdef _DIST_TEST
-AC_CANONICAL_BUILD
-AM_INIT_AUTOMAKE
-AC_PREREQ(2.52)
-AC_CONFIG_HEADERS(config.h)
-AD_INCLUDE_CONFIGURE
-AC_CONFIG_FILES(
-Makefile
-)
-AC_OUTPUT
-echo configure.ad ok
-#else !_DIST_TEST
-echo "ERROR"
-exit 1
-#endif _DIST_TEST
-EOF
-
-cat << EOF > Makefile.ad
-SUBDIRS=       \\
-#ifndef _DIST_TEST
-       nodef   \\
-#endif _DIST_TEST
-       .       \\
-
-EOF
-
-rm -rf distdir subdir
-mkdir -p subdir || exit 1
-
-cat << EOF > subdir/configure.ad
-# subdir/configure.ad fragment
-#ifndef _DIST_NODEF
-#ifdef _DIST_TEST
-echo "_DIST_NODEF ok"
-#endif _DIST_TEST
-#endif _DIST_NODEF
-EOF
-
-$AUTODIST -i || exit 1
-if test '!' -d distdir; then
-  echo "error: distdir/ does no exist"
-  exit 1
-fi 
-
-cp -p ../../default distdir || exit 1
-cp -p ../../autodist.conf distdir || exit 1
-
-cat << EOF > distdir/test
- name Test Distribution
-       package test-distro
-bug-report test-dist@test.org
-define _DIST_TEST
-#define _DIST_NODEF
-EOF
-
-touch README NEWS AUTHORS ChangeLog
-
-echo "inherit test" >> distdir/default
-
-$AUTODIST || exit 1
-$AUTODIST test 1.0 || exit 1
-
-./configure || exit 1
-make || exit 1
-echo make ok
-
-$AUTODIST -m || exit 1
-
-if test '!' -f test-distro-1.0.tar.gz; then
-  echo "error: makedist failed"
-  exit 1
-fi
-
-echo test ok
-
-# Cleanup
-rm -rf subdir distdir $AUTODIST
-
diff --git a/apps/autodist/tests/autodist6.test b/apps/autodist/tests/autodist6.test
deleted file mode 100755 (executable)
index c4e2d9e..0000000
+++ /dev/null
@@ -1,68 +0,0 @@
-#!/bin/sh
-
-AUTODIST=../../autodist
-
-rm -rf test
-mkdir test
-
-cd test || exit 1
-
-chmod +x $AUTODIST || exit 1
-
-cat << EOF > configure.ad
-AD_INIT
-#ifdef _DIST_DEFAULT
-AC_CANONICAL_BUILD
-AM_INIT_AUTOMAKE
-AC_PREREQ(2.52)
-AC_CONFIG_HEADERS(config.h)
-AC_CONFIG_FILES(
-Makefile
-)
-AC_OUTPUT
-echo configure.ad ok
-#else !_DIST_DEFAULT
-echo "ERROR"
-exit 1
-#endif _DIST_DEFAULT
-EOF
-
-cat << EOF > Makefile.ad
-SUBDIRS=       \\
-#ifdef _DIST_NODEF
-       nodef   \\
-       poa     \\
-       paa     \\
-#endif _DIST_NODEF
-       .       \\
-       .       \\
-       .       \\
-       .       \\
-
-EOF
-
-rm -rf distdir subdir
-mkdir -p subdir || exit 1
-
-$AUTODIST -i || exit 1
-if test '!' -d distdir; then
-  echo "error: distdir/ does no exist"
-  exit 1
-fi 
-
-cp -p ../../default distdir || exit 1
-cp -p ../../autodist.conf distdir || exit 1
-
-touch README NEWS AUTHORS ChangeLog
-
-$AUTODIST || exit 1
-
-./configure || exit 1
-make || exit 1
-echo make ok
-
-echo test ok
-
-# Cleanup
-rm -rf subdir distdir
-
diff --git a/apps/autodist/tests/autodist7.test b/apps/autodist/tests/autodist7.test
deleted file mode 100755 (executable)
index 6570cab..0000000
+++ /dev/null
@@ -1,69 +0,0 @@
-#!/bin/sh
-
-AUTODIST=../../autodist
-
-rm -rf test
-mkdir test
-
-cd test || exit 1
-
-chmod +x $AUTODIST || exit 1
-
-cat << EOF > configure.ad
-AD_INIT
-AD_DISABLE_DEPENDENCIES
-#ifdef _DIST_DEFAULT
-AC_CANONICAL_BUILD
-AM_INIT_AUTOMAKE
-AC_PREREQ(2.52)
-AC_CONFIG_HEADERS(config.h)
-AC_CONFIG_FILES(
-Makefile
-)
-AC_OUTPUT
-echo configure.ad ok
-#else !_DIST_DEFAULT
-echo "ERROR"
-exit 1
-#endif _DIST_DEFAULT
-EOF
-
-cat << EOF > Makefile.ad
-SUBDIRS=       \\
-#ifdef _DIST_NODEF
-       nodef   \\
-       poa     \\
-       paa     \\
-#endif _DIST_NODEF
-       .       \\
-       .       \\
-       .       \\
-       .       \\
-
-EOF
-
-rm -rf distdir subdir
-mkdir -p subdir || exit 1
-
-$AUTODIST -i || exit 1
-if test '!' -d distdir; then
-  echo "error: distdir/ does no exist"
-  exit 1
-fi 
-
-cp -p ../../default distdir || exit 1
-cp -p ../../autodist.conf distdir || exit 1
-
-touch README NEWS AUTHORS ChangeLog
-
-$AUTODIST || exit 1
-
-./configure || exit 1
-make || exit 1
-echo make ok
-
-echo test ok
-
-# Cleanup
-rm -rf subdir distdir
-
diff --git a/apps/irssi/.cvsignore b/apps/irssi/.cvsignore
deleted file mode 100644 (file)
index 6b0f2e0..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-Makefile
-Makefile.in
-aclocal.m4
-config.cache
-config.guess
-config.h
-config.log
-config.status
-config.sub
-configure
-configure.scan
-libtool
-libtool-shared
-ltconfig
-ltmain.sh
-stamp-h
-stamp-h.in
-stamp.h
-stamp-h1
-version.h
-config.h.in
-.exrc
-install-sh
-missing
-mkinstalldirs
-INSTALL
-intl
-ABOUT-NLS
-COPYING
-irssi.spec
-default-config.h
-default-theme.h
-irssi-version.h
-irssi-config
-build-stamp
-configure-stamp
-glib.m4
-glib-2.0.m4
diff --git a/apps/irssi/CHANGES b/apps/irssi/CHANGES
new file mode 100644 (file)
index 0000000..63270c8
--- /dev/null
@@ -0,0 +1,12 @@
+Tue Nov 13 18:34:06 EET 2007  Pekka Riikonen <priikone@silcnet.org>
+
+       * Added support for detecting when channel founder public key
+         is changed with CMODE command (founder rights transfered).
+
+Tue Jul 10 20:13:47 EEST 2007  Pekka Riikonen <priikone@silcnet.org>
+
+       * Added support for the new PKCS API.
+
+-----------------------------------------------------------------------------
+
+For older changes please see the CHANGES file from the CVS tree.
diff --git a/apps/irssi/docs/.cvsignore b/apps/irssi/docs/.cvsignore
deleted file mode 100644 (file)
index c5b9e55..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-Makefile
-Makefile.in
-startup-HOWTO.txt
diff --git a/apps/irssi/docs/help/in/.cvsignore b/apps/irssi/docs/help/in/.cvsignore
deleted file mode 100644 (file)
index 4717c0c..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-Makefile.am
-Makefile.in
-Makefile
diff --git a/apps/irssi/scripts/.cvsignore b/apps/irssi/scripts/.cvsignore
deleted file mode 100644 (file)
index 282522d..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-Makefile
-Makefile.in
diff --git a/apps/irssi/src/.cvsignore b/apps/irssi/src/.cvsignore
deleted file mode 100644 (file)
index 282522d..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-Makefile
-Makefile.in
diff --git a/apps/irssi/src/core/.cvsignore b/apps/irssi/src/core/.cvsignore
deleted file mode 100644 (file)
index 8553e9e..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-*.la
-*.lo
-*.o
-.deps
-.libs
-Makefile
-Makefile.in
-so_locations
diff --git a/apps/irssi/src/fe-common/core/.cvsignore b/apps/irssi/src/fe-common/core/.cvsignore
deleted file mode 100644 (file)
index 8553e9e..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-*.la
-*.lo
-*.o
-.deps
-.libs
-Makefile
-Makefile.in
-so_locations
index 2859b9341096ce319788cd0d9cd8b4147e07ed0b..8ad3fcdd0483a4f96486d37f68e4c2a916198bf5 100644 (file)
@@ -29,6 +29,7 @@ FORMAT_REC fecommon_silc_formats[] = {
 
        { "channel_founder_you", "You are channel founder on {channel $0}", 1, { 0 } },
        { "channel_founder", "channel founder on {channel $0} is: {channick_hilight $1}", 2, { 0, 0 } },
+       { "channel_founder_changed", "Channel founder public key changed on {channel $0}", 1, { 0 } },
        { "channel_topic", "Topic for {channel $0} is: $1", 2, { 0, 0 } },
        { "channel_topic_not_set", "Topic for {channel $0} not set", 1, { 0 } },
        { "cmode", "channel mode/{channel $0} {mode $1} by {nick $2}", 3, { 0, 0, 0 } },
index 4fdae389e710e4b78671e6fb16cffad9a0915f91..408715be917b7b61ed48ecb9b6d507f462239185 100644 (file)
@@ -26,6 +26,7 @@ enum {
 
   SILCTXT_CHANNEL_FOUNDER_YOU,
   SILCTXT_CHANNEL_FOUNDER,
+  SILCTXT_CHANNEL_FOUNDER_CHANGED,
   SILCTXT_CHANNEL_TOPIC,
   SILCTXT_CHANNEL_TOPIC_NOT_SET,
   SILCTXT_CHANNEL_CMODE,
diff --git a/apps/irssi/src/fe-text/.cvsignore b/apps/irssi/src/fe-text/.cvsignore
deleted file mode 100644 (file)
index 6974ee8..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-*.la
-*.lo
-*.o
-.deps
-.libs
-Makefile
-Makefile.in
-so_locations
-irssi
diff --git a/apps/irssi/src/lib-config/.cvsignore b/apps/irssi/src/lib-config/.cvsignore
deleted file mode 100644 (file)
index 577aa17..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-*.la
-*.lo
-.deps
-.libs
-Makefile
-Makefile.in
-so_locations
diff --git a/apps/irssi/src/lib-popt/.cvsignore b/apps/irssi/src/lib-popt/.cvsignore
deleted file mode 100644 (file)
index 577aa17..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-*.la
-*.lo
-.deps
-.libs
-Makefile
-Makefile.in
-so_locations
diff --git a/apps/irssi/src/perl/.cvsignore b/apps/irssi/src/perl/.cvsignore
deleted file mode 100644 (file)
index 189d2fd..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-*.la
-*.lo
-*.o
-.deps
-.libs
-Makefile
-Makefile.in
-so_locations
-perl-signals-list.h
-irssi-core.pl.h
diff --git a/apps/irssi/src/perl/common/.cvsignore b/apps/irssi/src/perl/common/.cvsignore
deleted file mode 100644 (file)
index e965849..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-Makefile
-Makefile.PL
-Irssi.bs
-*.c
-*.o
-pm_to_blib
-blib
index 9c1b07716d3ae1972483954468c65e4152cab83e..e8382ab80eeeeef1208821b1f63c094973cabae4 100644 (file)
@@ -8,5 +8,5 @@ WriteMakefile('NAME' => 'Irssi::Silc',
              'LIBS' => '',
              'OBJECT' => '$(O_FILES)',
              'TYPEMAPS' => ['../common/typemap'],
-             'INC' => '-I../../.. -I@top_srcdir@/src -I@top_srcdir@/src/core -I@top_srcdir@/src/silc/core -I@top_srcdir@/src/silc -I$(silc_top_srcdir) -I$(silc_top_srcdir)/lib/silccore -I$(silc_top_srcdir)/lib/silccrypt -I$(silc_top_srcdir)/lib/silcmath -DHAVE_SILCDEFS_H -I$(silc_top_srcdir)/lib/silcske -I$(silc_top_srcdir)/lib/silcsim -I$(silc_top_srcdir)/lib/silcskr -I$(silc_top_srcdir)/lib/silchttp -I$(silc_top_srcdir)/lib/silcasn1 -I$(silc_top_srcdir)/lib/silcapputil -I$(silc_top_srcdir)/lib/silcvcard -I$(silc_top_srcdir)/lib/silcutil -I$(silc_top_srcdir)/lib/silcsftp -I$(silc_top_srcdir)/lib/silcclient -I$(silc_top_srcdir)/lib/contrib -I$(silc_top_srcdir)/includes -I$(silc_top_srcdir)/doc @GLIB_CFLAGS@',
+             'INC' => '-I../../.. -I@top_srcdir@/src -I@top_srcdir@/src/core -I@top_srcdir@/src/silc/core -I@top_srcdir@/src/silc -I$(silc_top_srcdir) -I$(silc_top_srcdir)/lib/silccore -I$(silc_top_srcdir)/lib/silccrypt -I$(silc_top_srcdir)/lib/silcmath -DHAVE_SILCDEFS_H -I$(silc_top_srcdir)/lib/silcske -I$(silc_top_srcdir)/lib/silcsim -I$(silc_top_srcdir)/lib/silcskr -I$(silc_top_srcdir)/lib/silchttp -I$(silc_top_srcdir)/lib/silcasn1 -I$(silc_top_srcdir)/lib/silcapputil -I$(silc_top_srcdir)/lib/silcvcard -I$(silc_top_srcdir)/lib/silcutil -I$(silc_top_srcdir)/lib/silcsftp -I$(silc_top_srcdir)/lib/silcssh -I$(silc_top_srcdir)/lib/silcclient -I$(silc_top_srcdir)/lib/silcacc -I$(silc_top_srcdir)/lib/contrib -I$(silc_top_srcdir)/includes -I$(silc_top_srcdir)/doc @GLIB_CFLAGS@',
              'VERSION_FROM' => '@srcdir@/Silc.pm');
diff --git a/apps/irssi/src/perl/textui/.cvsignore b/apps/irssi/src/perl/textui/.cvsignore
deleted file mode 100644 (file)
index 517db94..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-Makefile
-Makefile.PL
-TextUI.bs
-*.c
-*.o
-pm_to_blib
-blib
diff --git a/apps/irssi/src/perl/ui/.cvsignore b/apps/irssi/src/perl/ui/.cvsignore
deleted file mode 100644 (file)
index 335ef88..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-Makefile
-Makefile.PL
-UI.bs
-*.c
-*.o
-pm_to_blib
-blib
index 38e90d0844553855d9cc38cc2497756754e37975..5da2cea29017314d1cdee99b6bd993928fe992be 100644 (file)
@@ -185,13 +185,13 @@ static void silc_parse_channel_public_keys(SILC_SERVER_REC *server,
     if (silc_pkcs_get_type(pubkey) != SILC_PKCS_SILC)
       continue;
 
-    pk = silc_pkcs_public_key_encode(pubkey, &pk_len);
+    pk = silc_pkcs_public_key_encode(NULL, pubkey, &pk_len);
     if (!pk)
       continue;
 
     fingerprint = silc_hash_fingerprint(NULL, pk, pk_len);
     babbleprint = silc_hash_babbleprint(NULL, pk, pk_len);
-    silc_pubkey = silc_pkcs_get_context(SILC_PKCS_SILC, pubkey);
+    silc_pubkey = silc_pkcs_public_key_get_pkcs(SILC_PKCS_SILC, pubkey);
 
     printformat_module("fe-common/silc", server, NULL,
                       MSGLEVEL_CRAP, SILCTXT_CHANNEL_PK_LIST_ENTRY,
@@ -236,6 +236,12 @@ void silc_say_error(char *msg, ...)
   va_end(va);
 }
 
+void static verify_message_signature_verified(SilcBool success,
+                                             void *context)
+{
+  *(SilcBool *)context = success;
+}
+
 /* Try to verify a message using locally stored public key data */
 
 int verify_message_signature(SilcClientEntry sender,
@@ -248,6 +254,7 @@ int verify_message_signature(SilcClientEntry sender,
   SilcUInt32 pk_datalen;
   struct stat st;
   int ret = SILC_MSG_SIGNED_VERIFIED, i;
+  SilcBool verified = FALSE;
 
   /* get public key from the signature payload and compare it with the
      one stored in the client entry */
@@ -292,7 +299,7 @@ int verify_message_signature(SilcClientEntry sender,
     SilcPublicKey cached_pk=NULL;
 
     /* try to load the file */
-    if (!silc_pkcs_load_public_key(filename, &cached_pk)) {
+    if (!silc_pkcs_load_public_key(filename, SILC_PKCS_ANY, &cached_pk)) {
       printformat_module("fe-common/silc", NULL, NULL, MSGLEVEL_CRAP,
                         SILCTXT_PUBKEY_COULD_NOT_LOAD, "client");
       if (pk == NULL)
@@ -309,9 +316,12 @@ int verify_message_signature(SilcClientEntry sender,
   }
 
   /* the public key is now in pk, our "level of trust" in ret */
-  if ((pk) && silc_message_signed_verify(message, pk,
-                                        sha1hash) != SILC_AUTH_OK)
-    ret = SILC_MSG_SIGNED_FAILED;
+  if (pk) {
+    silc_message_signed_verify(message, pk, sha1hash,
+                              verify_message_signature_verified, &verified);
+    if (!verified)
+      ret = SILC_MSG_SIGNED_FAILED;
+  }
 
   if (pk)
     silc_pkcs_public_key_free(pk);
@@ -1417,7 +1427,7 @@ void silc_getkey_cb(bool success, void *context)
                              ((SilcServerEntry)getkey->entry)->public_key);
   SilcSILCPublicKey silc_pubkey;
 
-  silc_pubkey = silc_pkcs_get_context(SILC_PKCS_SILC, public_key);
+  silc_pubkey = silc_pkcs_public_key_get_pkcs(SILC_PKCS_SILC, public_key);
 
   if (success) {
     if (getkey->id_type == SILC_ID_CLIENT)
@@ -2283,24 +2293,35 @@ void silc_command_reply(SilcClient client, SilcClientConnection conn,
     {
       SilcChannelEntry channel_entry;
       SilcDList chpks;
+      SilcPublicKey founder_key;
 
       channel_entry = va_arg(vp, SilcChannelEntry);
       (void)va_arg(vp, SilcUInt32);
-      (void)va_arg(vp, SilcPublicKey);
+      founder_key = va_arg(vp, SilcPublicKey);
       chpks = va_arg(vp, SilcDList);
 
-      if (SILC_STATUS_IS_ERROR(status) || !cmode_list_chpks ||
-         !channel_entry || !channel_entry->channel_name)
+      if (SILC_STATUS_IS_ERROR(status) || !channel_entry ||
+         !channel_entry->channel_name)
        return;
 
-      /* Print the channel public key list */
-      if (chpks)
-        silc_parse_channel_public_keys(server, channel_entry, chpks);
-      else
+      /* If founder was changed successfully, tell it to user */
+      if (founder_key && channel_entry->founder_key &&
+         !silc_pkcs_public_key_compare(founder_key,
+                                       channel_entry->founder_key)) {
         printformat_module("fe-common/silc", server, NULL,
-                         MSGLEVEL_CRAP, SILCTXT_CHANNEL_PK_NO_LIST,
-                         channel_entry->channel_name);
+                          MSGLEVEL_CRAP, SILCTXT_CHANNEL_FOUNDER_CHANGED,
+                          channel_entry->channel_name);
+      }
 
+      /* Print the channel public key list */
+      if (cmode_list_chpks) {
+       if (chpks)
+         silc_parse_channel_public_keys(server, channel_entry, chpks);
+       else
+         printformat_module("fe-common/silc", server, NULL,
+                            MSGLEVEL_CRAP, SILCTXT_CHANNEL_PK_NO_LIST,
+                            channel_entry->channel_name);
+      }
     }
     break;
 
@@ -2433,14 +2454,14 @@ silc_verify_public_key_internal(SilcClient client, SilcClientConnection conn,
   }
 
   /* Encode public key */
-  pk = silc_pkcs_public_key_encode(public_key, &pk_len);
+  pk = silc_pkcs_public_key_encode(NULL, public_key, &pk_len);
   if (!pk) {
     if (completion)
       completion(FALSE, context);
     return;
   }
 
-  silc_pubkey = silc_pkcs_get_context(SILC_PKCS_SILC, public_key);
+  silc_pubkey = silc_pkcs_public_key_get_pkcs(SILC_PKCS_SILC, public_key);
 
   pw = getpwuid(getuid());
   if (!pw) {
@@ -2544,8 +2565,9 @@ silc_verify_public_key_internal(SilcClient client, SilcClientConnection conn,
     SilcUInt32 encpk_len;
 
     /* Load the key file, try for both IP filename and hostname filename */
-    if (!silc_pkcs_load_public_key(ipf, &local_pubkey) &&
-       (!hostf || (!silc_pkcs_load_public_key(hostf, &local_pubkey)))) {
+    if (!silc_pkcs_load_public_key(ipf, SILC_PKCS_ANY, &local_pubkey) &&
+       (!hostf || (!silc_pkcs_load_public_key(hostf, SILC_PKCS_ANY,
+                                              &local_pubkey)))) {
       printformat_module("fe-common/silc", NULL, NULL, MSGLEVEL_CRAP,
                         SILCTXT_PUBKEY_RECEIVED,verify->entity_name ?
                         verify->entity_name : entity);
@@ -2574,7 +2596,7 @@ silc_verify_public_key_internal(SilcClient client, SilcClientConnection conn,
     }
 
     /* Encode the key data */
-    encpk = silc_pkcs_public_key_encode(local_pubkey, &encpk_len);
+    encpk = silc_pkcs_public_key_encode(NULL, local_pubkey, &encpk_len);
     if (!encpk) {
       printformat_module("fe-common/silc", NULL, NULL, MSGLEVEL_CRAP,
                         SILCTXT_PUBKEY_RECEIVED,verify->entity_name ?
index 836347338a3457deaa8af281f5d37ef4d6775dc1..c1632fea0d621615e278ab289df1c352b81c318c 100644 (file)
@@ -4,7 +4,7 @@
 
   Author: Pekka Riikonen <priikone@silcnet.org>
 
-  Copyright (C) 1997 - 2006 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
@@ -66,7 +66,7 @@ void silc_client_print_list(char *list)
 
 void silc_client_list_ciphers()
 {
-  char *ciphers = silc_cipher_get_supported();
+  char *ciphers = silc_cipher_get_supported(FALSE);
 #ifdef SILC_PLUGIN
   printformat_module("fe-common/silc", NULL, NULL,
                     MSGLEVEL_CRAP, SILCTXT_CONFIG_ALGOS,
index 1c6bb8d979a47376e49d0825e37da818a0292e45..4bd4e49ef556fb0d8a464fb930f8f014028eafa7 100644 (file)
@@ -1074,7 +1074,8 @@ void silc_list_key(const char *pub_filename, int verbose)
   SilcUInt32 key_len = 0;
   int is_server_key = (strstr(pub_filename, "serverkeys") != NULL);
 
-  if (!silc_pkcs_load_public_key((char *)pub_filename, &public_key)) {
+  if (!silc_pkcs_load_public_key((char *)pub_filename, SILC_PKCS_ANY,
+                                &public_key)) {
     printformat_module("fe-common/silc", NULL, NULL,
                       MSGLEVEL_CRAP, SILCTXT_LISTKEY_LOADPUB,
                       pub_filename);
@@ -1089,10 +1090,10 @@ void silc_list_key(const char *pub_filename, int verbose)
     return;
   }
 
-  silc_pubkey = silc_pkcs_get_context(SILC_PKCS_SILC, public_key);
+  silc_pubkey = silc_pkcs_public_key_get_pkcs(SILC_PKCS_SILC, public_key);
   ident = &silc_pubkey->identifier;
 
-  pk = silc_pkcs_public_key_encode(public_key, &pk_len);
+  pk = silc_pkcs_public_key_encode(NULL, public_key, &pk_len);
   if (!pk)
     return;
   fingerprint = silc_hash_fingerprint(NULL, pk, pk_len);
index 8b6f9f74ed50fc08326068ad805b09a3c27d86d0..8253713d99296961144c5f3f49c68ade0519f3a8 100644 (file)
@@ -302,9 +302,6 @@ static void silc_register_cipher(SilcClient client, const char *cipher)
 #endif
     }
   }
-
-  /* Register other defaults */
-  silc_cipher_register_default();
 }
 
 static void silc_register_hash(SilcClient client, const char *hash)
@@ -328,9 +325,6 @@ static void silc_register_hash(SilcClient client, const char *hash)
 #endif
     }
   }
-
-  /* Register other defaults */
-  silc_hash_register_default();
 }
 
 static void silc_register_hmac(SilcClient client, const char *hmac)
@@ -354,9 +348,6 @@ static void silc_register_hmac(SilcClient client, const char *hmac)
 #endif
     }
   }
-
-  /* Register other defaults */
-  silc_hmac_register_default();
 }
 
 /* Finalize init. Init finish signal calls this. */
@@ -408,7 +399,6 @@ void silc_opt_callback(poptContext con,
   if ((argc == 2) && (strcasecmp(argv[1], "list-ciphers") == 0)) {
 #else
   if (strcmp(opt->longName, "list-ciphers") == 0) {
-    silc_cipher_register_default();
 #endif
     silc_client_list_ciphers();
     FUNCTION_EXIT;
@@ -418,7 +408,6 @@ void silc_opt_callback(poptContext con,
   if ((argc == 2) && (strcasecmp(argv[1], "list-hash-funcs") == 0)) {
 #else
   if (strcmp(opt->longName, "list-hash-funcs") == 0) {
-    silc_hash_register_default();
 #endif
     silc_client_list_hash_funcs();
     FUNCTION_EXIT;
@@ -428,7 +417,6 @@ void silc_opt_callback(poptContext con,
   if ((argc == 2) && (strcasecmp(argv[1], "list-hmacs") == 0)) {
 #else
   if (strcmp(opt->longName, "list-hmacs") == 0) {
-    silc_hmac_register_default();
 #endif
     silc_client_list_hmacs();
     FUNCTION_EXIT;
@@ -438,7 +426,6 @@ void silc_opt_callback(poptContext con,
   if ((argc == 2) && (strcasecmp(argv[1], "list-pkcs") == 0)) {
 #else
   if (strcmp(opt->longName, "list-pkcs") == 0) {
-    silc_pkcs_register_default();
 #endif
     silc_client_list_pkcs();
     FUNCTION_EXIT;
@@ -534,10 +521,7 @@ void silc_opt_callback(poptContext con,
                       MSGLEVEL_CRAP, SILCTXT_CONFIG_NEXTTIME);
     goto out;
 #else
-    silc_cipher_register_default();
-    silc_pkcs_register_default();
-    silc_hash_register_default();
-    silc_hmac_register_default();
+    silc_crypto_init(NULL);
     silc_create_key_pair(opt_pkcs, opt_bits, NULL, NULL,
                         NULL, NULL, NULL, NULL, TRUE);
     exit(0);
@@ -562,10 +546,7 @@ void silc_opt_callback(poptContext con,
                            ENTRY_REDIRECT_FLAG_HIDDEN, rec);
     goto out;
 #else
-    silc_cipher_register_default();
-    silc_pkcs_register_default();
-    silc_hash_register_default();
-    silc_hmac_register_default();
+    silc_crypto_init(NULL);
     silc_change_private_key_passphrase(arg, NULL, NULL);
     exit(0);
 #endif
@@ -574,10 +555,7 @@ void silc_opt_callback(poptContext con,
 #ifndef SILC_PLUGIN
   if (strcmp(opt->longName, "show-key") == 0) {
     /* Dump the key */
-    silc_cipher_register_default();
-    silc_pkcs_register_default();
-    silc_hash_register_default();
-    silc_hmac_register_default();
+    silc_crypto_init(NULL);
     silc_show_public_key_file((char *)arg);
     exit(0);
   }
@@ -794,7 +772,6 @@ void silc_core_init(void)
   if (init_failed)
     return;
 #endif
-  silc_pkcs_register_default();
 
 #ifdef SILC_PLUGIN
   command_bind("silc", MODULE_NAME, (SIGNAL_FUNC) silc_opt_callback);
index 1e7f75132230b18e746d7825f4ed9b32c89f8883..18590f767e5d15defcb07a8726b9157fc07e7bf4 100644 (file)
@@ -4,7 +4,7 @@
 
   Author: Pekka Riikonen <priikone@silcnet.org>
 
-  Copyright (C) 2002 - 2007 Pekka Riikonen
+  Copyright (C) 2002 - 2008 Pekka Riikonen
 
   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
@@ -292,7 +292,7 @@ void silc_query_attributes_default(SilcClient client,
     /* Put USER_INFO */
     silc_client_attribute_del(silc_client, conn,
                              SILC_ATTRIBUTE_USER_INFO, NULL);
-    tmp = silc_file_readfile(sv, &tmp_len);
+    tmp = silc_file_readfile(sv, &tmp_len, NULL);
     if (tmp) {
       tmp[tmp_len] = 0;
       if (silc_vcard_decode(tmp, tmp_len, &vcard))
@@ -364,7 +364,8 @@ void silc_query_attributes_default(SilcClient client,
        mask |= SILC_ATTRIBUTE_MOOD_ANXIOUS;
     }
     silc_client_attribute_add(silc_client, conn,
-                             SILC_ATTRIBUTE_STATUS_MOOD, (void *)mask,
+                             SILC_ATTRIBUTE_STATUS_MOOD,
+                             SILC_32_TO_PTR(mask),
                              sizeof(SilcUInt32));
     g_strfreev(list);
   }
@@ -384,7 +385,7 @@ void silc_query_attributes_default(SilcClient client,
     /* Put STATUS_MESSAGE */
     silc_client_attribute_del(silc_client, conn,
                              SILC_ATTRIBUTE_STATUS_MESSAGE, NULL);
-    tmp = silc_file_readfile(sv, &tmp_len);
+    tmp = silc_file_readfile(sv, &tmp_len, NULL);
     if (tmp) {
       mime = silc_mime_decode(NULL, tmp, tmp_len);
       if (mime)
@@ -435,7 +436,8 @@ void silc_query_attributes_default(SilcClient client,
        mask |= SILC_ATTRIBUTE_CONTACT_VIDEO;
     }
     silc_client_attribute_add(silc_client, conn,
-                             SILC_ATTRIBUTE_PREFERRED_CONTACT, (void *)mask,
+                             SILC_ATTRIBUTE_PREFERRED_CONTACT,
+                             SILC_32_TO_PTR(mask),
                              sizeof(SilcUInt32));
     g_strfreev(list);
   }
@@ -529,7 +531,7 @@ void silc_query_attributes_default(SilcClient client,
     list = g_strsplit(sv, " ", -1);
     for (entry = list; *entry != NULL; entry++) {
       if (!strncasecmp(*entry, "silc-rsa:", 8)) {
-       tmp = silc_file_readfile((*entry) + 8, &tmp_len);
+       tmp = silc_file_readfile((*entry) + 8, &tmp_len, NULL);
        if (tmp) {
          tmp[tmp_len] = 0;
          pk.type = "silc-rsa";
@@ -560,6 +562,11 @@ typedef struct {
   bool nopk;
 } *AttrVerify;
 
+static void silc_query_attributes_verify(SilcBool success, void *context)
+{
+  *(SilcBool *)context = success;
+}
+
 void silc_query_attributes_print(SILC_SERVER_REC *server,
                                 SilcClient client,
                                 SilcClientConnection conn,
@@ -842,14 +849,17 @@ void silc_query_attributes_print(SILC_SERVER_REC *server,
     /* Verify the signature now */
     unsigned char *verifyd;
     SilcUInt32 verify_len;
+    SilcBool verified = FALSE;
 
     if (verify->public_key) {
       verifyd = silc_attribute_get_verify_data(attrs, FALSE, &verify_len);
-      if (verifyd && silc_pkcs_verify(verify->public_key,
-                                     usersign.data,
-                                     usersign.data_len,
-                                     verifyd, verify_len,
-                                     sha1hash)) {
+      if (verifyd)
+       silc_pkcs_verify_async(verify->public_key, usersign.data,
+                              usersign.data_len, verifyd, verify_len,
+                              TRUE, sha1hash,
+                              silc_query_attributes_verify, &verified);
+
+      if (verified) {
        printformat_module("fe-common/silc", server, NULL,
                           MSGLEVEL_CRAP, SILCTXT_ATTR_USER_SIGN_VERIFIED);
       } else {
@@ -873,6 +883,7 @@ void silc_query_attributes_print(SILC_SERVER_REC *server,
     SilcPKCSType type = 0;
     unsigned char *verifyd;
     SilcUInt32 verify_len;
+    SilcBool verified = FALSE;
 
     if (!strcmp(serverpk.type, "silc-rsa"))
       type = SILC_PKCS_SILC;
@@ -887,11 +898,12 @@ void silc_query_attributes_print(SILC_SERVER_REC *server,
                                   serverpk.data_len,
                                   &public_key)) {
       verifyd = silc_attribute_get_verify_data(attrs, TRUE, &verify_len);
-      if (verifyd && silc_pkcs_verify(public_key,
-                                     serversign.data,
-                                     serversign.data_len,
-                                     verifyd, verify_len,
-                                     sha1hash)) {
+      if (verifyd)
+       silc_pkcs_verify_async(public_key, serversign.data,
+                              serversign.data_len, verifyd,
+                              verify_len, TRUE, sha1hash,
+                              silc_query_attributes_verify, &verified);
+      if (verified) {
        printformat_module("fe-common/silc", server, NULL,
                           MSGLEVEL_CRAP, SILCTXT_ATTR_SERVER_SIGN_VERIFIED);
       } else {
index e16fb02cdc056fef1116a982f49259c3bf0d7483..bfd5f600e5e67012156f3990fa1c21d6edb0f41a 100644 (file)
@@ -418,7 +418,7 @@ static void sig_connected_stream_created(SilcSocketStreamStatus status,
 
   /* Try to read detached session data and use it if found. */
   file = silc_get_session_filename(server);
-  params.detach_data = silc_file_readfile(file, &params.detach_data_len);
+  params.detach_data = silc_file_readfile(file, &params.detach_data_len, NULL);
   if (params.detach_data)
     params.detach_data[params.detach_data_len] = 0;
   if (params.detach_data)
diff --git a/apps/silcd/.cvsignore b/apps/silcd/.cvsignore
deleted file mode 100644 (file)
index d6970be..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-Makefile
-Makefile.in
-silcd
index c2df082c61118703639b85fca1f9ad34de233bfd..f03581bcd081bbe9135d07e59bf6ba2f103be4a4 100644 (file)
@@ -701,6 +701,10 @@ void silc_server_free(SilcServer server)
   silc_skr_free(server->repository);
   silc_packet_engine_stop(server->packet_engine);
 
+  silc_schedule_task_del_by_context(server->schedule, server);
+  silc_schedule_uninit(server->schedule);
+  server->schedule = NULL;
+
   silc_free(server->local_list);
   silc_free(server->global_list);
   silc_free(server->server_name);
@@ -935,7 +939,6 @@ SilcBool silc_server_init(SilcServer server)
   } else {
     server->stat.routers = 1;
   }
-
   /* If we are normal server we'll retrieve network statisticial information
      once in a while from the router. */
   if (server->server_type != SILC_ROUTER)
@@ -1269,6 +1272,8 @@ SILC_TASK_CALLBACK(silc_server_purge_expired_clients)
 
   silc_dlist_start(server->expired_clients);
   while ((client = silc_dlist_get(server->expired_clients))) {
+      continue;
+
     /* For unregistered clients the created timestamp is actually
        unregistered timestamp.  Make sure client remains in history
        at least 500 seconds. */
@@ -1373,8 +1378,6 @@ silc_server_ke_auth_compl(SilcConnAuth connauth, SilcBool success,
     if (sconn->callback)
       (*sconn->callback)(server, NULL, sconn->callback_context);
     silc_server_free_sock_user_data(server, sconn->sock, NULL);
-    silc_server_disconnect_remote(server, sconn->sock,
-                                 SILC_STATUS_ERR_AUTH_FAILED, NULL);
     return;
   }
 
@@ -1396,11 +1399,11 @@ silc_server_ke_auth_compl(SilcConnAuth connauth, SilcBool success,
                                      strdup(sconn->remote_host),
                                      SILC_SERVER, NULL, NULL, sconn->sock);
     if (!id_entry) {
+      silc_server_disconnect_remote(server, sconn->sock,
+                                   SILC_STATUS_ERR_RESOURCE_LIMIT, NULL);
       if (sconn->callback)
        (*sconn->callback)(server, NULL, sconn->callback_context);
       silc_server_free_sock_user_data(server, sconn->sock, NULL);
-      silc_server_disconnect_remote(server, sconn->sock,
-                                   SILC_STATUS_ERR_RESOURCE_LIMIT, NULL);
       return;
     }
 
@@ -1425,11 +1428,11 @@ silc_server_ke_auth_compl(SilcConnAuth connauth, SilcBool success,
                             SILC_STR_DATA(server->server_name,
                                           strlen(server->server_name)),
                             SILC_STR_END)) {
+      silc_server_disconnect_remote(server, sconn->sock,
+                                   SILC_STATUS_ERR_RESOURCE_LIMIT, NULL);
       if (sconn->callback)
        (*sconn->callback)(server, NULL, sconn->callback_context);
       silc_server_free_sock_user_data(server, sconn->sock, NULL);
-      silc_server_disconnect_remote(server, sconn->sock,
-                                   SILC_STATUS_ERR_RESOURCE_LIMIT, NULL);
       return;
     }
 
@@ -1475,8 +1478,6 @@ silc_server_ke_auth_compl(SilcConnAuth connauth, SilcBool success,
       if (sconn->callback)
        (*sconn->callback)(server, NULL, sconn->callback_context);
       silc_server_free_sock_user_data(server, sconn->sock, NULL);
-      silc_server_disconnect_remote(server, sconn->sock,
-                                   SILC_STATUS_ERR_RESOURCE_LIMIT, NULL);
       return;
     }
 
@@ -1537,6 +1538,8 @@ silc_server_ke_auth_compl(SilcConnAuth connauth, SilcBool success,
        /* We already have primary router.  Disconnect this connection */
        SILC_LOG_DEBUG(("We already have primary router, disconnect"));
        silc_idlist_del_server(server->global_list, id_entry);
+       silc_server_disconnect_remote(server, sconn->sock,
+                                     SILC_STATUS_ERR_RESOURCE_LIMIT, NULL);
        if (sconn->callback)
          (*sconn->callback)(server, NULL, sconn->callback_context);
        silc_server_free_sock_user_data(server, sconn->sock, NULL);
@@ -1555,11 +1558,11 @@ silc_server_ke_auth_compl(SilcConnAuth connauth, SilcBool success,
     break;
 
   default:
+    silc_server_disconnect_remote(server, sconn->sock,
+                                 SILC_STATUS_ERR_AUTH_FAILED, NULL);
     if (sconn->callback)
       (*sconn->callback)(server, NULL, sconn->callback_context);
     silc_server_free_sock_user_data(server, sconn->sock, NULL);
-    silc_server_disconnect_remote(server, sconn->sock,
-                                 SILC_STATUS_ERR_AUTH_FAILED, NULL);
     return;
   }
 
@@ -1635,8 +1638,6 @@ static void silc_server_ke_completed(SilcSKE ske, SilcSKEStatus status,
     if (sconn->callback)
       (*sconn->callback)(server, NULL, sconn->callback_context);
     silc_server_free_sock_user_data(server, sconn->sock, NULL);
-    silc_server_disconnect_remote(server, sconn->sock,
-                                 SILC_STATUS_ERR_KEY_EXCHANGE_FAILED, NULL);
     return;
   }
 
@@ -1657,11 +1658,11 @@ static void silc_server_ke_completed(SilcSKE ske, SilcSKEStatus status,
     }
 
     /* Error setting keys */
+    silc_server_disconnect_remote(server, sconn->sock,
+                                 SILC_STATUS_ERR_KEY_EXCHANGE_FAILED, NULL);
     if (sconn->callback)
       (*sconn->callback)(server, NULL, sconn->callback_context);
     silc_server_free_sock_user_data(server, sconn->sock, NULL);
-    silc_server_disconnect_remote(server, sconn->sock,
-                                 SILC_STATUS_ERR_KEY_EXCHANGE_FAILED, NULL);
     return;
   }
   silc_packet_set_keys(sconn->sock, send_key, receive_key, hmac_send,
@@ -1684,11 +1685,11 @@ static void silc_server_ke_completed(SilcSKE ske, SilcSKEStatus status,
     }
 
     /** Error allocating auth protocol */
+    silc_server_disconnect_remote(server, sconn->sock,
+                                 SILC_STATUS_ERR_RESOURCE_LIMIT, NULL);
     if (sconn->callback)
       (*sconn->callback)(server, NULL, sconn->callback_context);
     silc_server_free_sock_user_data(server, sconn->sock, NULL);
-    silc_server_disconnect_remote(server, sconn->sock,
-                                 SILC_STATUS_ERR_RESOURCE_LIMIT, NULL);
     return;
   }
 
@@ -2108,7 +2109,6 @@ SILC_TASK_CALLBACK(silc_server_connect_to_router)
     sconn->no_reconnect = param->reconnect_keep_trying == FALSE;
 
     SILC_LOG_DEBUG(("Created connection %p", sconn));
-
     if (!server->router_conn && !sconn->backup)
       server->router_conn = sconn;
 
@@ -3016,8 +3016,6 @@ void silc_server_close_connection(SilcServer server,
   SilcUInt16 port;
 
   if (!silc_packet_stream_is_valid(sock))
-    return;
-
   memset(tmp, 0, sizeof(tmp));
   //  silc_socket_get_error(sock, tmp, sizeof(tmp));
   silc_socket_stream_get_info(silc_packet_stream_get_stream(sock),
diff --git a/config.guess b/config.guess
deleted file mode 100755 (executable)
index e3ef63f..0000000
+++ /dev/null
@@ -1,1471 +0,0 @@
-#! /bin/sh
-# Attempt to guess a canonical system name.
-#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-#   2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
-
-timestamp='2005-12-13'
-
-# This file 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; either version 2 of the License, or
-# (at your option) any later version.
-#
-# 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.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
-# 02110-1301, USA.
-#
-# As a special exception to the GNU General Public License, if you
-# distribute this file as part of a program that contains a
-# configuration script generated by Autoconf, you may include it under
-# the same distribution terms that you use for the rest of that program.
-
-
-# Originally written by Per Bothner <per@bothner.com>.
-# Please send patches to <config-patches@gnu.org>.  Submit a context
-# diff and a properly formatted ChangeLog entry.
-#
-# This script attempts to guess a canonical system name similar to
-# config.sub.  If it succeeds, it prints the system name on stdout, and
-# exits with 0.  Otherwise, it exits with 1.
-#
-# The plan is that this can be called by configure scripts if you
-# don't specify an explicit build system type.
-
-me=`echo "$0" | sed -e 's,.*/,,'`
-
-usage="\
-Usage: $0 [OPTION]
-
-Output the configuration name of the system \`$me' is run on.
-
-Operation modes:
-  -h, --help         print this help, then exit
-  -t, --time-stamp   print date of last modification, then exit
-  -v, --version      print version number, then exit
-
-Report bugs and patches to <config-patches@gnu.org>."
-
-version="\
-GNU config.guess ($timestamp)
-
-Originally written by Per Bothner.
-Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
-Free Software Foundation, Inc.
-
-This is free software; see the source for copying conditions.  There is NO
-warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
-
-help="
-Try \`$me --help' for more information."
-
-# Parse command line
-while test $# -gt 0 ; do
-  case $1 in
-    --time-stamp | --time* | -t )
-       echo "$timestamp" ; exit ;;
-    --version | -v )
-       echo "$version" ; exit ;;
-    --help | --h* | -h )
-       echo "$usage"; exit ;;
-    -- )     # Stop option processing
-       shift; break ;;
-    - )        # Use stdin as input.
-       break ;;
-    -* )
-       echo "$me: invalid option $1$help" >&2
-       exit 1 ;;
-    * )
-       break ;;
-  esac
-done
-
-if test $# != 0; then
-  echo "$me: too many arguments$help" >&2
-  exit 1
-fi
-
-trap 'exit 1' 1 2 15
-
-# CC_FOR_BUILD -- compiler used by this script. Note that the use of a
-# compiler to aid in system detection is discouraged as it requires
-# temporary files to be created and, as you can see below, it is a
-# headache to deal with in a portable fashion.
-
-# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
-# use `HOST_CC' if defined, but it is deprecated.
-
-# Portable tmp directory creation inspired by the Autoconf team.
-
-set_cc_for_build='
-trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
-trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
-: ${TMPDIR=/tmp} ;
- { tmp=`(umask 077 && mktemp -d -q "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
- { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
- { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
- { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
-dummy=$tmp/dummy ;
-tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ;
-case $CC_FOR_BUILD,$HOST_CC,$CC in
- ,,)    echo "int x;" > $dummy.c ;
-       for c in cc gcc c89 c99 ; do
-         if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then
-            CC_FOR_BUILD="$c"; break ;
-         fi ;
-       done ;
-       if test x"$CC_FOR_BUILD" = x ; then
-         CC_FOR_BUILD=no_compiler_found ;
-       fi
-       ;;
- ,,*)   CC_FOR_BUILD=$CC ;;
- ,*,*)  CC_FOR_BUILD=$HOST_CC ;;
-esac ; set_cc_for_build= ;'
-
-# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
-# (ghazi@noc.rutgers.edu 1994-08-24)
-if (test -f /.attbin/uname) >/dev/null 2>&1 ; then
-       PATH=$PATH:/.attbin ; export PATH
-fi
-
-UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
-UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
-UNAME_SYSTEM=`(uname -s) 2>/dev/null`  || UNAME_SYSTEM=unknown
-UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
-
-# Note: order is significant - the case branches are not exclusive.
-
-case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
-    *:NetBSD:*:*)
-       # NetBSD (nbsd) targets should (where applicable) match one or
-       # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*,
-       # *-*-netbsdecoff* and *-*-netbsd*.  For targets that recently
-       # switched to ELF, *-*-netbsd* would select the old
-       # object file format.  This provides both forward
-       # compatibility and a consistent mechanism for selecting the
-       # object file format.
-       #
-       # Note: NetBSD doesn't particularly care about the vendor
-       # portion of the name.  We always set it to "unknown".
-       sysctl="sysctl -n hw.machine_arch"
-       UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \
-           /usr/sbin/$sysctl 2>/dev/null || echo unknown)`
-       case "${UNAME_MACHINE_ARCH}" in
-           armeb) machine=armeb-unknown ;;
-           arm*) machine=arm-unknown ;;
-           sh3el) machine=shl-unknown ;;
-           sh3eb) machine=sh-unknown ;;
-           *) machine=${UNAME_MACHINE_ARCH}-unknown ;;
-       esac
-       # The Operating System including object format, if it has switched
-       # to ELF recently, or will in the future.
-       case "${UNAME_MACHINE_ARCH}" in
-           arm*|i386|m68k|ns32k|sh3*|sparc|vax)
-               eval $set_cc_for_build
-               if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
-                       | grep __ELF__ >/dev/null
-               then
-                   # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
-                   # Return netbsd for either.  FIX?
-                   os=netbsd
-               else
-                   os=netbsdelf
-               fi
-               ;;
-           *)
-               os=netbsd
-               ;;
-       esac
-       # The OS release
-       # Debian GNU/NetBSD machines have a different userland, and
-       # thus, need a distinct triplet. However, they do not need
-       # kernel version information, so it can be replaced with a
-       # suitable tag, in the style of linux-gnu.
-       case "${UNAME_VERSION}" in
-           Debian*)
-               release='-gnu'
-               ;;
-           *)
-               release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
-               ;;
-       esac
-       # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
-       # contains redundant information, the shorter form:
-       # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
-       echo "${machine}-${os}${release}"
-       exit ;;
-    *:OpenBSD:*:*)
-       UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
-       echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
-       exit ;;
-    *:ekkoBSD:*:*)
-       echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
-       exit ;;
-    macppc:MirBSD:*:*)
-       echo powerppc-unknown-mirbsd${UNAME_RELEASE}
-       exit ;;
-    *:MirBSD:*:*)
-       echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
-       exit ;;
-    alpha:OSF1:*:*)
-       case $UNAME_RELEASE in
-       *4.0)
-               UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
-               ;;
-       *5.*)
-               UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
-               ;;
-       esac
-       # According to Compaq, /usr/sbin/psrinfo has been available on
-       # OSF/1 and Tru64 systems produced since 1995.  I hope that
-       # covers most systems running today.  This code pipes the CPU
-       # types through head -n 1, so we only detect the type of CPU 0.
-       ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^  The alpha \(.*\) processor.*$/\1/p' | head -n 1`
-       case "$ALPHA_CPU_TYPE" in
-           "EV4 (21064)")
-               UNAME_MACHINE="alpha" ;;
-           "EV4.5 (21064)")
-               UNAME_MACHINE="alpha" ;;
-           "LCA4 (21066/21068)")
-               UNAME_MACHINE="alpha" ;;
-           "EV5 (21164)")
-               UNAME_MACHINE="alphaev5" ;;
-           "EV5.6 (21164A)")
-               UNAME_MACHINE="alphaev56" ;;
-           "EV5.6 (21164PC)")
-               UNAME_MACHINE="alphapca56" ;;
-           "EV5.7 (21164PC)")
-               UNAME_MACHINE="alphapca57" ;;
-           "EV6 (21264)")
-               UNAME_MACHINE="alphaev6" ;;
-           "EV6.7 (21264A)")
-               UNAME_MACHINE="alphaev67" ;;
-           "EV6.8CB (21264C)")
-               UNAME_MACHINE="alphaev68" ;;
-           "EV6.8AL (21264B)")
-               UNAME_MACHINE="alphaev68" ;;
-           "EV6.8CX (21264D)")
-               UNAME_MACHINE="alphaev68" ;;
-           "EV6.9A (21264/EV69A)")
-               UNAME_MACHINE="alphaev69" ;;
-           "EV7 (21364)")
-               UNAME_MACHINE="alphaev7" ;;
-           "EV7.9 (21364A)")
-               UNAME_MACHINE="alphaev79" ;;
-       esac
-       # A Pn.n version is a patched version.
-       # A Vn.n version is a released version.
-       # A Tn.n version is a released field test version.
-       # A Xn.n version is an unreleased experimental baselevel.
-       # 1.2 uses "1.2" for uname -r.
-       echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
-       exit ;;
-    Alpha\ *:Windows_NT*:*)
-       # How do we know it's Interix rather than the generic POSIX subsystem?
-       # Should we change UNAME_MACHINE based on the output of uname instead
-       # of the specific Alpha model?
-       echo alpha-pc-interix
-       exit ;;
-    21064:Windows_NT:50:3)
-       echo alpha-dec-winnt3.5
-       exit ;;
-    Amiga*:UNIX_System_V:4.0:*)
-       echo m68k-unknown-sysv4
-       exit ;;
-    *:[Aa]miga[Oo][Ss]:*:*)
-       echo ${UNAME_MACHINE}-unknown-amigaos
-       exit ;;
-    *:[Mm]orph[Oo][Ss]:*:*)
-       echo ${UNAME_MACHINE}-unknown-morphos
-       exit ;;
-    *:OS/390:*:*)
-       echo i370-ibm-openedition
-       exit ;;
-    *:z/VM:*:*)
-       echo s390-ibm-zvmoe
-       exit ;;
-    *:OS400:*:*)
-        echo powerpc-ibm-os400
-       exit ;;
-    arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
-       echo arm-acorn-riscix${UNAME_RELEASE}
-       exit ;;
-    arm:riscos:*:*|arm:RISCOS:*:*)
-       echo arm-unknown-riscos
-       exit ;;
-    SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
-       echo hppa1.1-hitachi-hiuxmpp
-       exit ;;
-    Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
-       # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
-       if test "`(/bin/universe) 2>/dev/null`" = att ; then
-               echo pyramid-pyramid-sysv3
-       else
-               echo pyramid-pyramid-bsd
-       fi
-       exit ;;
-    NILE*:*:*:dcosx)
-       echo pyramid-pyramid-svr4
-       exit ;;
-    DRS?6000:unix:4.0:6*)
-       echo sparc-icl-nx6
-       exit ;;
-    DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*)
-       case `/usr/bin/uname -p` in
-           sparc) echo sparc-icl-nx7; exit ;;
-       esac ;;
-    sun4H:SunOS:5.*:*)
-       echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
-       exit ;;
-    sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
-       echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
-       exit ;;
-    i86pc:SunOS:5.*:*)
-       echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
-       exit ;;
-    sun4*:SunOS:6*:*)
-       # According to config.sub, this is the proper way to canonicalize
-       # SunOS6.  Hard to guess exactly what SunOS6 will be like, but
-       # it's likely to be more like Solaris than SunOS4.
-       echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
-       exit ;;
-    sun4*:SunOS:*:*)
-       case "`/usr/bin/arch -k`" in
-           Series*|S4*)
-               UNAME_RELEASE=`uname -v`
-               ;;
-       esac
-       # Japanese Language versions have a version number like `4.1.3-JL'.
-       echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
-       exit ;;
-    sun3*:SunOS:*:*)
-       echo m68k-sun-sunos${UNAME_RELEASE}
-       exit ;;
-    sun*:*:4.2BSD:*)
-       UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
-       test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
-       case "`/bin/arch`" in
-           sun3)
-               echo m68k-sun-sunos${UNAME_RELEASE}
-               ;;
-           sun4)
-               echo sparc-sun-sunos${UNAME_RELEASE}
-               ;;
-       esac
-       exit ;;
-    aushp:SunOS:*:*)
-       echo sparc-auspex-sunos${UNAME_RELEASE}
-       exit ;;
-    # The situation for MiNT is a little confusing.  The machine name
-    # can be virtually everything (everything which is not
-    # "atarist" or "atariste" at least should have a processor
-    # > m68000).  The system name ranges from "MiNT" over "FreeMiNT"
-    # to the lowercase version "mint" (or "freemint").  Finally
-    # the system name "TOS" denotes a system which is actually not
-    # MiNT.  But MiNT is downward compatible to TOS, so this should
-    # be no problem.
-    atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
-        echo m68k-atari-mint${UNAME_RELEASE}
-       exit ;;
-    atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
-       echo m68k-atari-mint${UNAME_RELEASE}
-        exit ;;
-    *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
-        echo m68k-atari-mint${UNAME_RELEASE}
-       exit ;;
-    milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
-        echo m68k-milan-mint${UNAME_RELEASE}
-        exit ;;
-    hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
-        echo m68k-hades-mint${UNAME_RELEASE}
-        exit ;;
-    *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
-        echo m68k-unknown-mint${UNAME_RELEASE}
-        exit ;;
-    m68k:machten:*:*)
-       echo m68k-apple-machten${UNAME_RELEASE}
-       exit ;;
-    powerpc:machten:*:*)
-       echo powerpc-apple-machten${UNAME_RELEASE}
-       exit ;;
-    RISC*:Mach:*:*)
-       echo mips-dec-mach_bsd4.3
-       exit ;;
-    RISC*:ULTRIX:*:*)
-       echo mips-dec-ultrix${UNAME_RELEASE}
-       exit ;;
-    VAX*:ULTRIX*:*:*)
-       echo vax-dec-ultrix${UNAME_RELEASE}
-       exit ;;
-    2020:CLIX:*:* | 2430:CLIX:*:*)
-       echo clipper-intergraph-clix${UNAME_RELEASE}
-       exit ;;
-    mips:*:*:UMIPS | mips:*:*:RISCos)
-       eval $set_cc_for_build
-       sed 's/^        //' << EOF >$dummy.c
-#ifdef __cplusplus
-#include <stdio.h>  /* for printf() prototype */
-       int main (int argc, char *argv[]) {
-#else
-       int main (argc, argv) int argc; char *argv[]; {
-#endif
-       #if defined (host_mips) && defined (MIPSEB)
-       #if defined (SYSTYPE_SYSV)
-         printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0);
-       #endif
-       #if defined (SYSTYPE_SVR4)
-         printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0);
-       #endif
-       #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
-         printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0);
-       #endif
-       #endif
-         exit (-1);
-       }
-EOF
-       $CC_FOR_BUILD -o $dummy $dummy.c &&
-         dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` &&
-         SYSTEM_NAME=`$dummy $dummyarg` &&
-           { echo "$SYSTEM_NAME"; exit; }
-       echo mips-mips-riscos${UNAME_RELEASE}
-       exit ;;
-    Motorola:PowerMAX_OS:*:*)
-       echo powerpc-motorola-powermax
-       exit ;;
-    Motorola:*:4.3:PL8-*)
-       echo powerpc-harris-powermax
-       exit ;;
-    Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
-       echo powerpc-harris-powermax
-       exit ;;
-    Night_Hawk:Power_UNIX:*:*)
-       echo powerpc-harris-powerunix
-       exit ;;
-    m88k:CX/UX:7*:*)
-       echo m88k-harris-cxux7
-       exit ;;
-    m88k:*:4*:R4*)
-       echo m88k-motorola-sysv4
-       exit ;;
-    m88k:*:3*:R3*)
-       echo m88k-motorola-sysv3
-       exit ;;
-    AViiON:dgux:*:*)
-        # DG/UX returns AViiON for all architectures
-        UNAME_PROCESSOR=`/usr/bin/uname -p`
-       if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
-       then
-           if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
-              [ ${TARGET_BINARY_INTERFACE}x = x ]
-           then
-               echo m88k-dg-dgux${UNAME_RELEASE}
-           else
-               echo m88k-dg-dguxbcs${UNAME_RELEASE}
-           fi
-       else
-           echo i586-dg-dgux${UNAME_RELEASE}
-       fi
-       exit ;;
-    M88*:DolphinOS:*:*)        # DolphinOS (SVR3)
-       echo m88k-dolphin-sysv3
-       exit ;;
-    M88*:*:R3*:*)
-       # Delta 88k system running SVR3
-       echo m88k-motorola-sysv3
-       exit ;;
-    XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
-       echo m88k-tektronix-sysv3
-       exit ;;
-    Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
-       echo m68k-tektronix-bsd
-       exit ;;
-    *:IRIX*:*:*)
-       echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
-       exit ;;
-    ????????:AIX?:[12].1:2)   # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
-       echo romp-ibm-aix     # uname -m gives an 8 hex-code CPU id
-       exit ;;               # Note that: echo "'`uname -s`'" gives 'AIX '
-    i*86:AIX:*:*)
-       echo i386-ibm-aix
-       exit ;;
-    ia64:AIX:*:*)
-       if [ -x /usr/bin/oslevel ] ; then
-               IBM_REV=`/usr/bin/oslevel`
-       else
-               IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
-       fi
-       echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
-       exit ;;
-    *:AIX:2:3)
-       if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
-               eval $set_cc_for_build
-               sed 's/^                //' << EOF >$dummy.c
-               #include <sys/systemcfg.h>
-
-               main()
-                       {
-                       if (!__power_pc())
-                               exit(1);
-                       puts("powerpc-ibm-aix3.2.5");
-                       exit(0);
-                       }
-EOF
-               if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy`
-               then
-                       echo "$SYSTEM_NAME"
-               else
-                       echo rs6000-ibm-aix3.2.5
-               fi
-       elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
-               echo rs6000-ibm-aix3.2.4
-       else
-               echo rs6000-ibm-aix3.2
-       fi
-       exit ;;
-    *:AIX:*:[45])
-       IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
-       if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
-               IBM_ARCH=rs6000
-       else
-               IBM_ARCH=powerpc
-       fi
-       if [ -x /usr/bin/oslevel ] ; then
-               IBM_REV=`/usr/bin/oslevel`
-       else
-               IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
-       fi
-       echo ${IBM_ARCH}-ibm-aix${IBM_REV}
-       exit ;;
-    *:AIX:*:*)
-       echo rs6000-ibm-aix
-       exit ;;
-    ibmrt:4.4BSD:*|romp-ibm:BSD:*)
-       echo romp-ibm-bsd4.4
-       exit ;;
-    ibmrt:*BSD:*|romp-ibm:BSD:*)            # covers RT/PC BSD and
-       echo romp-ibm-bsd${UNAME_RELEASE}   # 4.3 with uname added to
-       exit ;;                             # report: romp-ibm BSD 4.3
-    *:BOSX:*:*)
-       echo rs6000-bull-bosx
-       exit ;;
-    DPX/2?00:B.O.S.:*:*)
-       echo m68k-bull-sysv3
-       exit ;;
-    9000/[34]??:4.3bsd:1.*:*)
-       echo m68k-hp-bsd
-       exit ;;
-    hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
-       echo m68k-hp-bsd4.4
-       exit ;;
-    9000/[34678]??:HP-UX:*:*)
-       HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
-       case "${UNAME_MACHINE}" in
-           9000/31? )            HP_ARCH=m68000 ;;
-           9000/[34]?? )         HP_ARCH=m68k ;;
-           9000/[678][0-9][0-9])
-               if [ -x /usr/bin/getconf ]; then
-                   sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
-                    sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
-                    case "${sc_cpu_version}" in
-                      523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
-                      528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
-                      532)                      # CPU_PA_RISC2_0
-                        case "${sc_kernel_bits}" in
-                          32) HP_ARCH="hppa2.0n" ;;
-                          64) HP_ARCH="hppa2.0w" ;;
-                         '') HP_ARCH="hppa2.0" ;;   # HP-UX 10.20
-                        esac ;;
-                    esac
-               fi
-               if [ "${HP_ARCH}" = "" ]; then
-                   eval $set_cc_for_build
-                   sed 's/^              //' << EOF >$dummy.c
-
-              #define _HPUX_SOURCE
-              #include <stdlib.h>
-              #include <unistd.h>
-
-              int main ()
-              {
-              #if defined(_SC_KERNEL_BITS)
-                  long bits = sysconf(_SC_KERNEL_BITS);
-              #endif
-                  long cpu  = sysconf (_SC_CPU_VERSION);
-
-                  switch (cpu)
-               {
-               case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
-               case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
-               case CPU_PA_RISC2_0:
-              #if defined(_SC_KERNEL_BITS)
-                   switch (bits)
-                       {
-                       case 64: puts ("hppa2.0w"); break;
-                       case 32: puts ("hppa2.0n"); break;
-                       default: puts ("hppa2.0"); break;
-                       } break;
-              #else  /* !defined(_SC_KERNEL_BITS) */
-                   puts ("hppa2.0"); break;
-              #endif
-               default: puts ("hppa1.0"); break;
-               }
-                  exit (0);
-              }
-EOF
-                   (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
-                   test -z "$HP_ARCH" && HP_ARCH=hppa
-               fi ;;
-       esac
-       if [ ${HP_ARCH} = "hppa2.0w" ]
-       then
-           eval $set_cc_for_build
-
-           # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating
-           # 32-bit code.  hppa64-hp-hpux* has the same kernel and a compiler
-           # generating 64-bit code.  GNU and HP use different nomenclature:
-           #
-           # $ CC_FOR_BUILD=cc ./config.guess
-           # => hppa2.0w-hp-hpux11.23
-           # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess
-           # => hppa64-hp-hpux11.23
-
-           if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) |
-               grep __LP64__ >/dev/null
-           then
-               HP_ARCH="hppa2.0w"
-           else
-               HP_ARCH="hppa64"
-           fi
-       fi
-       echo ${HP_ARCH}-hp-hpux${HPUX_REV}
-       exit ;;
-    ia64:HP-UX:*:*)
-       HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
-       echo ia64-hp-hpux${HPUX_REV}
-       exit ;;
-    3050*:HI-UX:*:*)
-       eval $set_cc_for_build
-       sed 's/^        //' << EOF >$dummy.c
-       #include <unistd.h>
-       int
-       main ()
-       {
-         long cpu = sysconf (_SC_CPU_VERSION);
-         /* The order matters, because CPU_IS_HP_MC68K erroneously returns
-            true for CPU_PA_RISC1_0.  CPU_IS_PA_RISC returns correct
-            results, however.  */
-         if (CPU_IS_PA_RISC (cpu))
-           {
-             switch (cpu)
-               {
-                 case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break;
-                 case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break;
-                 case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break;
-                 default: puts ("hppa-hitachi-hiuxwe2"); break;
-               }
-           }
-         else if (CPU_IS_HP_MC68K (cpu))
-           puts ("m68k-hitachi-hiuxwe2");
-         else puts ("unknown-hitachi-hiuxwe2");
-         exit (0);
-       }
-EOF
-       $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` &&
-               { echo "$SYSTEM_NAME"; exit; }
-       echo unknown-hitachi-hiuxwe2
-       exit ;;
-    9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
-       echo hppa1.1-hp-bsd
-       exit ;;
-    9000/8??:4.3bsd:*:*)
-       echo hppa1.0-hp-bsd
-       exit ;;
-    *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
-       echo hppa1.0-hp-mpeix
-       exit ;;
-    hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
-       echo hppa1.1-hp-osf
-       exit ;;
-    hp8??:OSF1:*:*)
-       echo hppa1.0-hp-osf
-       exit ;;
-    i*86:OSF1:*:*)
-       if [ -x /usr/sbin/sysversion ] ; then
-           echo ${UNAME_MACHINE}-unknown-osf1mk
-       else
-           echo ${UNAME_MACHINE}-unknown-osf1
-       fi
-       exit ;;
-    parisc*:Lites*:*:*)
-       echo hppa1.1-hp-lites
-       exit ;;
-    C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
-       echo c1-convex-bsd
-        exit ;;
-    C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
-       if getsysinfo -f scalar_acc
-       then echo c32-convex-bsd
-       else echo c2-convex-bsd
-       fi
-        exit ;;
-    C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
-       echo c34-convex-bsd
-        exit ;;
-    C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
-       echo c38-convex-bsd
-        exit ;;
-    C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
-       echo c4-convex-bsd
-        exit ;;
-    CRAY*Y-MP:*:*:*)
-       echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
-       exit ;;
-    CRAY*[A-Z]90:*:*:*)
-       echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
-       | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
-             -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
-             -e 's/\.[^.]*$/.X/'
-       exit ;;
-    CRAY*TS:*:*:*)
-       echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
-       exit ;;
-    CRAY*T3E:*:*:*)
-       echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
-       exit ;;
-    CRAY*SV1:*:*:*)
-       echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
-       exit ;;
-    *:UNICOS/mp:*:*)
-       echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
-       exit ;;
-    F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
-       FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
-        FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
-        FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
-        echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
-        exit ;;
-    5000:UNIX_System_V:4.*:*)
-        FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
-        FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
-        echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
-       exit ;;
-    i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
-       echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
-       exit ;;
-    sparc*:BSD/OS:*:*)
-       echo sparc-unknown-bsdi${UNAME_RELEASE}
-       exit ;;
-    *:BSD/OS:*:*)
-       echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
-       exit ;;
-    *:FreeBSD:*:*)
-       echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
-       exit ;;
-    i*:CYGWIN*:*)
-       echo ${UNAME_MACHINE}-pc-cygwin
-       exit ;;
-    i*:MINGW*:*)
-       echo ${UNAME_MACHINE}-pc-mingw32
-       exit ;;
-    i*:windows32*:*)
-       # uname -m includes "-pc" on this system.
-       echo ${UNAME_MACHINE}-mingw32
-       exit ;;
-    i*:PW*:*)
-       echo ${UNAME_MACHINE}-pc-pw32
-       exit ;;
-    x86:Interix*:[345]*)
-       echo i586-pc-interix${UNAME_RELEASE}|sed -e 's/\..*//'
-       exit ;;
-    [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
-       echo i${UNAME_MACHINE}-pc-mks
-       exit ;;
-    i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
-       # How do we know it's Interix rather than the generic POSIX subsystem?
-       # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
-       # UNAME_MACHINE based on the output of uname instead of i386?
-       echo i586-pc-interix
-       exit ;;
-    i*:UWIN*:*)
-       echo ${UNAME_MACHINE}-pc-uwin
-       exit ;;
-    amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
-       echo x86_64-unknown-cygwin
-       exit ;;
-    p*:CYGWIN*:*)
-       echo powerpcle-unknown-cygwin
-       exit ;;
-    prep*:SunOS:5.*:*)
-       echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
-       exit ;;
-    *:GNU:*:*)
-       # the GNU system
-       echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
-       exit ;;
-    *:GNU/*:*:*)
-       # other systems with GNU libc and userland
-       echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu
-       exit ;;
-    i*86:Minix:*:*)
-       echo ${UNAME_MACHINE}-pc-minix
-       exit ;;
-    arm*:Linux:*:*)
-       echo ${UNAME_MACHINE}-unknown-linux-gnu
-       exit ;;
-    cris:Linux:*:*)
-       echo cris-axis-linux-gnu
-       exit ;;
-    crisv32:Linux:*:*)
-       echo crisv32-axis-linux-gnu
-       exit ;;
-    frv:Linux:*:*)
-       echo frv-unknown-linux-gnu
-       exit ;;
-    ia64:Linux:*:*)
-       echo ${UNAME_MACHINE}-unknown-linux-gnu
-       exit ;;
-    m32r*:Linux:*:*)
-       echo ${UNAME_MACHINE}-unknown-linux-gnu
-       exit ;;
-    m68*:Linux:*:*)
-       echo ${UNAME_MACHINE}-unknown-linux-gnu
-       exit ;;
-    mips:Linux:*:*)
-       eval $set_cc_for_build
-       sed 's/^        //' << EOF >$dummy.c
-       #undef CPU
-       #undef mips
-       #undef mipsel
-       #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
-       CPU=mipsel
-       #else
-       #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
-       CPU=mips
-       #else
-       CPU=
-       #endif
-       #endif
-EOF
-       eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '/^CPU/{s: ::g;p;}'`"
-       test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
-       ;;
-    mips64:Linux:*:*)
-       eval $set_cc_for_build
-       sed 's/^        //' << EOF >$dummy.c
-       #undef CPU
-       #undef mips64
-       #undef mips64el
-       #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
-       CPU=mips64el
-       #else
-       #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
-       CPU=mips64
-       #else
-       CPU=
-       #endif
-       #endif
-EOF
-       eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '/^CPU/{s: ::g;p;}'`"
-       test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
-       ;;
-    or32:Linux:*:*)
-       echo or32-unknown-linux-gnu
-       exit ;;
-    ppc:Linux:*:*)
-       echo powerpc-unknown-linux-gnu
-       exit ;;
-    ppc64:Linux:*:*)
-       echo powerpc64-unknown-linux-gnu
-       exit ;;
-    alpha:Linux:*:*)
-       case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
-         EV5)   UNAME_MACHINE=alphaev5 ;;
-         EV56)  UNAME_MACHINE=alphaev56 ;;
-         PCA56) UNAME_MACHINE=alphapca56 ;;
-         PCA57) UNAME_MACHINE=alphapca56 ;;
-         EV6)   UNAME_MACHINE=alphaev6 ;;
-         EV67)  UNAME_MACHINE=alphaev67 ;;
-         EV68*) UNAME_MACHINE=alphaev68 ;;
-        esac
-       objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null
-       if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
-       echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
-       exit ;;
-    parisc:Linux:*:* | hppa:Linux:*:*)
-       # Look for CPU level
-       case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
-         PA7*) echo hppa1.1-unknown-linux-gnu ;;
-         PA8*) echo hppa2.0-unknown-linux-gnu ;;
-         *)    echo hppa-unknown-linux-gnu ;;
-       esac
-       exit ;;
-    parisc64:Linux:*:* | hppa64:Linux:*:*)
-       echo hppa64-unknown-linux-gnu
-       exit ;;
-    s390:Linux:*:* | s390x:Linux:*:*)
-       echo ${UNAME_MACHINE}-ibm-linux
-       exit ;;
-    sh64*:Linux:*:*)
-       echo ${UNAME_MACHINE}-unknown-linux-gnu
-       exit ;;
-    sh*:Linux:*:*)
-       echo ${UNAME_MACHINE}-unknown-linux-gnu
-       exit ;;
-    sparc:Linux:*:* | sparc64:Linux:*:*)
-       echo ${UNAME_MACHINE}-unknown-linux-gnu
-       exit ;;
-    vax:Linux:*:*)
-       echo ${UNAME_MACHINE}-dec-linux-gnu
-       exit ;;
-    x86_64:Linux:*:*)
-       echo x86_64-unknown-linux-gnu
-       exit ;;
-    i*86:Linux:*:*)
-       # The BFD linker knows what the default object file format is, so
-       # first see if it will tell us. cd to the root directory to prevent
-       # problems with other programs or directories called `ld' in the path.
-       # Set LC_ALL=C to ensure ld outputs messages in English.
-       ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \
-                        | sed -ne '/supported targets:/!d
-                                   s/[         ][      ]*/ /g
-                                   s/.*supported targets: *//
-                                   s/ .*//
-                                   p'`
-        case "$ld_supported_targets" in
-         elf32-i386)
-               TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu"
-               ;;
-         a.out-i386-linux)
-               echo "${UNAME_MACHINE}-pc-linux-gnuaout"
-               exit ;;
-         coff-i386)
-               echo "${UNAME_MACHINE}-pc-linux-gnucoff"
-               exit ;;
-         "")
-               # Either a pre-BFD a.out linker (linux-gnuoldld) or
-               # one that does not give us useful --help.
-               echo "${UNAME_MACHINE}-pc-linux-gnuoldld"
-               exit ;;
-       esac
-       # Determine whether the default compiler is a.out or elf
-       eval $set_cc_for_build
-       sed 's/^        //' << EOF >$dummy.c
-       #include <features.h>
-       #ifdef __ELF__
-       # ifdef __GLIBC__
-       #  if __GLIBC__ >= 2
-       LIBC=gnu
-       #  else
-       LIBC=gnulibc1
-       #  endif
-       # else
-       LIBC=gnulibc1
-       # endif
-       #else
-       #if defined(__INTEL_COMPILER) || defined(__PGI)
-       LIBC=gnu
-       #else
-       LIBC=gnuaout
-       #endif
-       #endif
-       #ifdef __dietlibc__
-       LIBC=dietlibc
-       #endif
-EOF
-       eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '/^LIBC/{s: ::g;p;}'`"
-       test x"${LIBC}" != x && {
-               echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
-               exit
-       }
-       test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; exit; }
-       ;;
-    i*86:DYNIX/ptx:4*:*)
-       # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
-       # earlier versions are messed up and put the nodename in both
-       # sysname and nodename.
-       echo i386-sequent-sysv4
-       exit ;;
-    i*86:UNIX_SV:4.2MP:2.*)
-        # Unixware is an offshoot of SVR4, but it has its own version
-        # number series starting with 2...
-        # I am not positive that other SVR4 systems won't match this,
-       # I just have to hope.  -- rms.
-        # Use sysv4.2uw... so that sysv4* matches it.
-       echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
-       exit ;;
-    i*86:OS/2:*:*)
-       # If we were able to find `uname', then EMX Unix compatibility
-       # is probably installed.
-       echo ${UNAME_MACHINE}-pc-os2-emx
-       exit ;;
-    i*86:XTS-300:*:STOP)
-       echo ${UNAME_MACHINE}-unknown-stop
-       exit ;;
-    i*86:atheos:*:*)
-       echo ${UNAME_MACHINE}-unknown-atheos
-       exit ;;
-    i*86:syllable:*:*)
-       echo ${UNAME_MACHINE}-pc-syllable
-       exit ;;
-    i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*)
-       echo i386-unknown-lynxos${UNAME_RELEASE}
-       exit ;;
-    i*86:*DOS:*:*)
-       echo ${UNAME_MACHINE}-pc-msdosdjgpp
-       exit ;;
-    i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
-       UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
-       if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
-               echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL}
-       else
-               echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
-       fi
-       exit ;;
-    i*86:*:5:[678]*)
-       # UnixWare 7.x, OpenUNIX and OpenServer 6.
-       case `/bin/uname -X | grep "^Machine"` in
-           *486*)           UNAME_MACHINE=i486 ;;
-           *Pentium)        UNAME_MACHINE=i586 ;;
-           *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
-       esac
-       echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
-       exit ;;
-    i*86:*:3.2:*)
-       if test -f /usr/options/cb.name; then
-               UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
-               echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
-       elif /bin/uname -X 2>/dev/null >/dev/null ; then
-               UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
-               (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
-               (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \
-                       && UNAME_MACHINE=i586
-               (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \
-                       && UNAME_MACHINE=i686
-               (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
-                       && UNAME_MACHINE=i686
-               echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
-       else
-               echo ${UNAME_MACHINE}-pc-sysv32
-       fi
-       exit ;;
-    pc:*:*:*)
-       # Left here for compatibility:
-        # uname -m prints for DJGPP always 'pc', but it prints nothing about
-        # the processor, so we play safe by assuming i386.
-       echo i386-pc-msdosdjgpp
-        exit ;;
-    Intel:Mach:3*:*)
-       echo i386-pc-mach3
-       exit ;;
-    paragon:*:*:*)
-       echo i860-intel-osf1
-       exit ;;
-    i860:*:4.*:*) # i860-SVR4
-       if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
-         echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
-       else # Add other i860-SVR4 vendors below as they are discovered.
-         echo i860-unknown-sysv${UNAME_RELEASE}  # Unknown i860-SVR4
-       fi
-       exit ;;
-    mini*:CTIX:SYS*5:*)
-       # "miniframe"
-       echo m68010-convergent-sysv
-       exit ;;
-    mc68k:UNIX:SYSTEM5:3.51m)
-       echo m68k-convergent-sysv
-       exit ;;
-    M680?0:D-NIX:5.3:*)
-       echo m68k-diab-dnix
-       exit ;;
-    M68*:*:R3V[5678]*:*)
-       test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;;
-    3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0)
-       OS_REL=''
-       test -r /etc/.relid \
-       && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
-       /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
-         && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
-       /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
-         && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
-    3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
-        /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
-          && { echo i486-ncr-sysv4; exit; } ;;
-    m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
-       echo m68k-unknown-lynxos${UNAME_RELEASE}
-       exit ;;
-    mc68030:UNIX_System_V:4.*:*)
-       echo m68k-atari-sysv4
-       exit ;;
-    TSUNAMI:LynxOS:2.*:*)
-       echo sparc-unknown-lynxos${UNAME_RELEASE}
-       exit ;;
-    rs6000:LynxOS:2.*:*)
-       echo rs6000-unknown-lynxos${UNAME_RELEASE}
-       exit ;;
-    PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*)
-       echo powerpc-unknown-lynxos${UNAME_RELEASE}
-       exit ;;
-    SM[BE]S:UNIX_SV:*:*)
-       echo mips-dde-sysv${UNAME_RELEASE}
-       exit ;;
-    RM*:ReliantUNIX-*:*:*)
-       echo mips-sni-sysv4
-       exit ;;
-    RM*:SINIX-*:*:*)
-       echo mips-sni-sysv4
-       exit ;;
-    *:SINIX-*:*:*)
-       if uname -p 2>/dev/null >/dev/null ; then
-               UNAME_MACHINE=`(uname -p) 2>/dev/null`
-               echo ${UNAME_MACHINE}-sni-sysv4
-       else
-               echo ns32k-sni-sysv
-       fi
-       exit ;;
-    PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
-                      # says <Richard.M.Bartel@ccMail.Census.GOV>
-        echo i586-unisys-sysv4
-        exit ;;
-    *:UNIX_System_V:4*:FTX*)
-       # From Gerald Hewes <hewes@openmarket.com>.
-       # How about differentiating between stratus architectures? -djm
-       echo hppa1.1-stratus-sysv4
-       exit ;;
-    *:*:*:FTX*)
-       # From seanf@swdc.stratus.com.
-       echo i860-stratus-sysv4
-       exit ;;
-    i*86:VOS:*:*)
-       # From Paul.Green@stratus.com.
-       echo ${UNAME_MACHINE}-stratus-vos
-       exit ;;
-    *:VOS:*:*)
-       # From Paul.Green@stratus.com.
-       echo hppa1.1-stratus-vos
-       exit ;;
-    mc68*:A/UX:*:*)
-       echo m68k-apple-aux${UNAME_RELEASE}
-       exit ;;
-    news*:NEWS-OS:6*:*)
-       echo mips-sony-newsos6
-       exit ;;
-    R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
-       if [ -d /usr/nec ]; then
-               echo mips-nec-sysv${UNAME_RELEASE}
-       else
-               echo mips-unknown-sysv${UNAME_RELEASE}
-       fi
-        exit ;;
-    BeBox:BeOS:*:*)    # BeOS running on hardware made by Be, PPC only.
-       echo powerpc-be-beos
-       exit ;;
-    BeMac:BeOS:*:*)    # BeOS running on Mac or Mac clone, PPC only.
-       echo powerpc-apple-beos
-       exit ;;
-    BePC:BeOS:*:*)     # BeOS running on Intel PC compatible.
-       echo i586-pc-beos
-       exit ;;
-    SX-4:SUPER-UX:*:*)
-       echo sx4-nec-superux${UNAME_RELEASE}
-       exit ;;
-    SX-5:SUPER-UX:*:*)
-       echo sx5-nec-superux${UNAME_RELEASE}
-       exit ;;
-    SX-6:SUPER-UX:*:*)
-       echo sx6-nec-superux${UNAME_RELEASE}
-       exit ;;
-    Power*:Rhapsody:*:*)
-       echo powerpc-apple-rhapsody${UNAME_RELEASE}
-       exit ;;
-    *:Rhapsody:*:*)
-       echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
-       exit ;;
-    *:Darwin:*:*)
-       UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
-       case $UNAME_PROCESSOR in
-           unknown) UNAME_PROCESSOR=powerpc ;;
-       esac
-       echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
-       exit ;;
-    *:procnto*:*:* | *:QNX:[0123456789]*:*)
-       UNAME_PROCESSOR=`uname -p`
-       if test "$UNAME_PROCESSOR" = "x86"; then
-               UNAME_PROCESSOR=i386
-               UNAME_MACHINE=pc
-       fi
-       echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
-       exit ;;
-    *:QNX:*:4*)
-       echo i386-pc-qnx
-       exit ;;
-    NSE-?:NONSTOP_KERNEL:*:*)
-       echo nse-tandem-nsk${UNAME_RELEASE}
-       exit ;;
-    NSR-?:NONSTOP_KERNEL:*:*)
-       echo nsr-tandem-nsk${UNAME_RELEASE}
-       exit ;;
-    *:NonStop-UX:*:*)
-       echo mips-compaq-nonstopux
-       exit ;;
-    BS2000:POSIX*:*:*)
-       echo bs2000-siemens-sysv
-       exit ;;
-    DS/*:UNIX_System_V:*:*)
-       echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
-       exit ;;
-    *:Plan9:*:*)
-       # "uname -m" is not consistent, so use $cputype instead. 386
-       # is converted to i386 for consistency with other x86
-       # operating systems.
-       if test "$cputype" = "386"; then
-           UNAME_MACHINE=i386
-       else
-           UNAME_MACHINE="$cputype"
-       fi
-       echo ${UNAME_MACHINE}-unknown-plan9
-       exit ;;
-    *:TOPS-10:*:*)
-       echo pdp10-unknown-tops10
-       exit ;;
-    *:TENEX:*:*)
-       echo pdp10-unknown-tenex
-       exit ;;
-    KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
-       echo pdp10-dec-tops20
-       exit ;;
-    XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
-       echo pdp10-xkl-tops20
-       exit ;;
-    *:TOPS-20:*:*)
-       echo pdp10-unknown-tops20
-       exit ;;
-    *:ITS:*:*)
-       echo pdp10-unknown-its
-       exit ;;
-    SEI:*:*:SEIUX)
-        echo mips-sei-seiux${UNAME_RELEASE}
-       exit ;;
-    *:DragonFly:*:*)
-       echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
-       exit ;;
-    *:*VMS:*:*)
-       UNAME_MACHINE=`(uname -p) 2>/dev/null`
-       case "${UNAME_MACHINE}" in
-           A*) echo alpha-dec-vms ; exit ;;
-           I*) echo ia64-dec-vms ; exit ;;
-           V*) echo vax-dec-vms ; exit ;;
-       esac ;;
-    *:XENIX:*:SysV)
-       echo i386-pc-xenix
-       exit ;;
-    i*86:skyos:*:*)
-       echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//'
-       exit ;;
-    i*86:rdos:*:*)
-       echo ${UNAME_MACHINE}-pc-rdos
-       exit ;;
-esac
-
-#echo '(No uname command or uname output not recognized.)' 1>&2
-#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
-
-eval $set_cc_for_build
-cat >$dummy.c <<EOF
-#ifdef _SEQUENT_
-# include <sys/types.h>
-# include <sys/utsname.h>
-#endif
-main ()
-{
-#if defined (sony)
-#if defined (MIPSEB)
-  /* BFD wants "bsd" instead of "newsos".  Perhaps BFD should be changed,
-     I don't know....  */
-  printf ("mips-sony-bsd\n"); exit (0);
-#else
-#include <sys/param.h>
-  printf ("m68k-sony-newsos%s\n",
-#ifdef NEWSOS4
-          "4"
-#else
-         ""
-#endif
-         ); exit (0);
-#endif
-#endif
-
-#if defined (__arm) && defined (__acorn) && defined (__unix)
-  printf ("arm-acorn-riscix\n"); exit (0);
-#endif
-
-#if defined (hp300) && !defined (hpux)
-  printf ("m68k-hp-bsd\n"); exit (0);
-#endif
-
-#if defined (NeXT)
-#if !defined (__ARCHITECTURE__)
-#define __ARCHITECTURE__ "m68k"
-#endif
-  int version;
-  version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
-  if (version < 4)
-    printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
-  else
-    printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
-  exit (0);
-#endif
-
-#if defined (MULTIMAX) || defined (n16)
-#if defined (UMAXV)
-  printf ("ns32k-encore-sysv\n"); exit (0);
-#else
-#if defined (CMU)
-  printf ("ns32k-encore-mach\n"); exit (0);
-#else
-  printf ("ns32k-encore-bsd\n"); exit (0);
-#endif
-#endif
-#endif
-
-#if defined (__386BSD__)
-  printf ("i386-pc-bsd\n"); exit (0);
-#endif
-
-#if defined (sequent)
-#if defined (i386)
-  printf ("i386-sequent-dynix\n"); exit (0);
-#endif
-#if defined (ns32000)
-  printf ("ns32k-sequent-dynix\n"); exit (0);
-#endif
-#endif
-
-#if defined (_SEQUENT_)
-    struct utsname un;
-
-    uname(&un);
-
-    if (strncmp(un.version, "V2", 2) == 0) {
-       printf ("i386-sequent-ptx2\n"); exit (0);
-    }
-    if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
-       printf ("i386-sequent-ptx1\n"); exit (0);
-    }
-    printf ("i386-sequent-ptx\n"); exit (0);
-
-#endif
-
-#if defined (vax)
-# if !defined (ultrix)
-#  include <sys/param.h>
-#  if defined (BSD)
-#   if BSD == 43
-      printf ("vax-dec-bsd4.3\n"); exit (0);
-#   else
-#    if BSD == 199006
-      printf ("vax-dec-bsd4.3reno\n"); exit (0);
-#    else
-      printf ("vax-dec-bsd\n"); exit (0);
-#    endif
-#   endif
-#  else
-    printf ("vax-dec-bsd\n"); exit (0);
-#  endif
-# else
-    printf ("vax-dec-ultrix\n"); exit (0);
-# endif
-#endif
-
-#if defined (alliant) && defined (i860)
-  printf ("i860-alliant-bsd\n"); exit (0);
-#endif
-
-  exit (1);
-}
-EOF
-
-$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` &&
-       { echo "$SYSTEM_NAME"; exit; }
-
-# Apollos put the system type in the environment.
-
-test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; }
-
-# Convex versions that predate uname can use getsysinfo(1)
-
-if [ -x /usr/convex/getsysinfo ]
-then
-    case `getsysinfo -f cpu_type` in
-    c1*)
-       echo c1-convex-bsd
-       exit ;;
-    c2*)
-       if getsysinfo -f scalar_acc
-       then echo c32-convex-bsd
-       else echo c2-convex-bsd
-       fi
-       exit ;;
-    c34*)
-       echo c34-convex-bsd
-       exit ;;
-    c38*)
-       echo c38-convex-bsd
-       exit ;;
-    c4*)
-       echo c4-convex-bsd
-       exit ;;
-    esac
-fi
-
-cat >&2 <<EOF
-$0: unable to guess system type
-
-This script, last modified $timestamp, has failed to recognize
-the operating system you are using. It is advised that you
-download the most up to date version of the config scripts from
-
-  http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.guess
-and
-  http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.sub
-
-If the version you run ($0) is already up to date, please
-send the following data and any information you think might be
-pertinent to <config-patches@gnu.org> in order to provide the needed
-information to handle your system.
-
-config.guess timestamp = $timestamp
-
-uname -m = `(uname -m) 2>/dev/null || echo unknown`
-uname -r = `(uname -r) 2>/dev/null || echo unknown`
-uname -s = `(uname -s) 2>/dev/null || echo unknown`
-uname -v = `(uname -v) 2>/dev/null || echo unknown`
-
-/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null`
-/bin/uname -X     = `(/bin/uname -X) 2>/dev/null`
-
-hostinfo               = `(hostinfo) 2>/dev/null`
-/bin/universe          = `(/bin/universe) 2>/dev/null`
-/usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null`
-/bin/arch              = `(/bin/arch) 2>/dev/null`
-/usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null`
-/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
-
-UNAME_MACHINE = ${UNAME_MACHINE}
-UNAME_RELEASE = ${UNAME_RELEASE}
-UNAME_SYSTEM  = ${UNAME_SYSTEM}
-UNAME_VERSION = ${UNAME_VERSION}
-EOF
-
-exit 1
-
-# Local variables:
-# eval: (add-hook 'write-file-hooks 'time-stamp)
-# time-stamp-start: "timestamp='"
-# time-stamp-format: "%:y-%02m-%02d"
-# time-stamp-end: "'"
-# End:
index 285164700ddb55c39383879f0ce1604a0abb7b24..c060f4483392e413a117c86be997c656e9186f22 100755 (executable)
@@ -1,9 +1,10 @@
 #! /bin/sh
 # Configuration validation subroutine script.
 #   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-#   2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
+#   2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation,
+#   Inc.
 
-timestamp='2005-12-11'
+timestamp='2007-04-29'
 
 # This file is (in principle) common to ALL GNU software.
 # The presence of a machine in this file suggests that SOME GNU software
@@ -240,15 +241,16 @@ case $basic_machine in
        | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
        | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
        | am33_2.0 \
-       | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \
+       | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \
        | bfin \
        | c4x | clipper \
        | d10v | d30v | dlx | dsp16xx \
-       | fr30 | frv \
+       | fido | fr30 | frv \
        | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
        | i370 | i860 | i960 | ia64 \
        | ip2k | iq2000 \
-       | m32r | m32rle | m68000 | m68k | m88k | maxq | mcore \
+       | m32c | m32r | m32rle | m68000 | m68k | m88k \
+       | maxq | mb | microblaze | mcore | mep \
        | mips | mipsbe | mipseb | mipsel | mipsle \
        | mips16 \
        | mips64 | mips64el \
@@ -268,26 +270,25 @@ case $basic_machine in
        | mn10200 | mn10300 \
        | mt \
        | msp430 \
+       | nios | nios2 \
        | ns16k | ns32k \
        | or32 \
        | pdp10 | pdp11 | pj | pjl \
        | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
        | pyramid \
-       | sh | sh[1234] | sh[24]a | sh[23]e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \
+       | score \
+       | sh | sh[1234] | sh[24]a | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
        | sh64 | sh64le \
-       | sparc | sparc64 | sparc64b | sparc86x | sparclet | sparclite \
-       | sparcv8 | sparcv9 | sparcv9b \
-       | strongarm \
+       | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
+       | sparcv8 | sparcv9 | sparcv9b | sparcv9v \
+       | spu | strongarm \
        | tahoe | thumb | tic4x | tic80 | tron \
        | v850 | v850e \
        | we32k \
-       | x86 | xscale | xscalee[bl] | xstormy16 | xtensa \
+       | x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \
        | z8k)
                basic_machine=$basic_machine-unknown
                ;;
-       m32c)
-               basic_machine=$basic_machine-unknown
-               ;;
        m6811 | m68hc11 | m6812 | m68hc12)
                # Motorola 68HC11/12.
                basic_machine=$basic_machine-unknown
@@ -317,18 +318,18 @@ case $basic_machine in
        | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
        | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
        | arm-*  | armbe-* | armle-* | armeb-* | armv*-* \
-       | avr-* \
+       | avr-* | avr32-* \
        | bfin-* | bs2000-* \
        | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \
        | clipper-* | craynv-* | cydra-* \
        | d10v-* | d30v-* | dlx-* \
        | elxsi-* \
-       | f30[01]-* | f700-* | fr30-* | frv-* | fx80-* \
+       | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
        | h8300-* | h8500-* \
        | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
        | i*86-* | i860-* | i960-* | ia64-* \
        | ip2k-* | iq2000-* \
-       | m32r-* | m32rle-* \
+       | m32c-* | m32r-* | m32rle-* \
        | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
        | m88110-* | m88k-* | maxq-* | mcore-* \
        | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
@@ -350,29 +351,28 @@ case $basic_machine in
        | mmix-* \
        | mt-* \
        | msp430-* \
+       | nios-* | nios2-* \
        | none-* | np1-* | ns16k-* | ns32k-* \
        | orion-* \
        | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
        | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
        | pyramid-* \
        | romp-* | rs6000-* \
-       | sh-* | sh[1234]-* | sh[24]a-* | sh[23]e-* | sh[34]eb-* | shbe-* \
+       | sh-* | sh[1234]-* | sh[24]a-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
        | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
-       | sparc-* | sparc64-* | sparc64b-* | sparc86x-* | sparclet-* \
+       | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
        | sparclite-* \
-       | sparcv8-* | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \
+       | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \
        | tahoe-* | thumb-* \
        | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
        | tron-* \
        | v850-* | v850e-* | vax-* \
        | we32k-* \
-       | x86-* | x86_64-* | xps100-* | xscale-* | xscalee[bl]-* \
+       | x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \
        | xstormy16-* | xtensa-* \
        | ymp-* \
        | z8k-*)
                ;;
-       m32c-*)
-               ;;
        # Recognize the various machine names and aliases which stand
        # for a CPU type and a company and sometimes even an OS.
        386bsd)
@@ -683,6 +683,10 @@ case $basic_machine in
                basic_machine=i386-pc
                os=-mingw32
                ;;
+       mingw32ce)
+               basic_machine=arm-unknown
+               os=-mingw32ce
+               ;;
        miniframe)
                basic_machine=m68000-convergent
                ;;
@@ -818,6 +822,12 @@ case $basic_machine in
        pc532 | pc532-*)
                basic_machine=ns32k-pc532
                ;;
+       pc98)
+               basic_machine=i386-pc
+               ;;
+       pc98-*)
+               basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'`
+               ;;
        pentium | p5 | k5 | k6 | nexgen | viac3)
                basic_machine=i586-pc
                ;;
@@ -904,6 +914,10 @@ case $basic_machine in
        sb1el)
                basic_machine=mipsisa64sb1el-unknown
                ;;
+       sde)
+               basic_machine=mipsisa32-sde
+               os=-elf
+               ;;
        sei)
                basic_machine=mips-sei
                os=-seiux
@@ -915,6 +929,9 @@ case $basic_machine in
                basic_machine=sh-hitachi
                os=-hms
                ;;
+       sh5el)
+               basic_machine=sh5le-unknown
+               ;;
        sh64)
                basic_machine=sh64-unknown
                ;;
@@ -1120,7 +1137,7 @@ case $basic_machine in
        sh[1234] | sh[24]a | sh[34]eb | sh[1234]le | sh[23]ele)
                basic_machine=sh-unknown
                ;;
-       sparc | sparcv8 | sparcv9 | sparcv9b)
+       sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v)
                basic_machine=sparc-sun
                ;;
        cydra)
@@ -1193,7 +1210,8 @@ case $os in
              | -aos* \
              | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
              | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
-             | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* | -openbsd* \
+             | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
+             | -openbsd* | -solidbsd* \
              | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
              | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
              | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
@@ -1208,7 +1226,7 @@ case $os in
              | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
              | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
              | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
-             | -skyos* | -haiku* | -rdos*)
+             | -skyos* | -haiku* | -rdos* | -toppers* | -drops*)
        # Remember, each alternative MUST END IN *, to match a version number.
                ;;
        -qnx*)
@@ -1360,6 +1378,12 @@ else
 # system, and we'll never get to this point.
 
 case $basic_machine in
+        score-*)
+               os=-elf
+               ;;
+        spu-*)
+               os=-elf
+               ;;
        *-acorn)
                os=-riscix1.2
                ;;
@@ -1369,9 +1393,9 @@ case $basic_machine in
        arm*-semi)
                os=-aout
                ;;
-    c4x-* | tic4x-*)
-        os=-coff
-        ;;
+        c4x-* | tic4x-*)
+               os=-coff
+               ;;
        # This must come before the *-dec entry.
        pdp10-*)
                os=-tops20
@@ -1397,6 +1421,9 @@ case $basic_machine in
        m68*-cisco)
                os=-aout
                ;;
+        mep-*)
+               os=-elf
+               ;;
        mips*-cisco)
                os=-elf
                ;;
index c99faef62d772ccaec7564652532ca580826285b..08bc39156879b5354683f5334c3277ba694aa99a 100644 (file)
@@ -3,7 +3,7 @@
 #
 #  Author: Pekka Riikonen <priikone@silcnet.org>
 #
-#  Copyright (C) 2000 - 2007 Pekka Riikonen
+#  Copyright (C) 2000 - 2008 Pekka Riikonen
 #
 #  This program is free software; you can redistribute it and/or modify
 #  it under the terms of the GNU General Public License as published by
@@ -29,74 +29,86 @@ AC_PROG_EGREP
 AC_SUBST(LN_S)
 AC_PATH_PROG(sedpath, sed)
 
-#ifdef SILC_DIST_COMPILER
-# Put here any platform specific stuff
+AC_PROG_CC
+AM_PROG_AS
+AC_C_INLINE
+AC_C_CONST
+
+AC_PROG_RANLIB
+#ifndef SILC_DIST_TOOLKIT
+AC_DISABLE_SHARED
+#endif SILC_DIST_TOOLKIT
+#ifdef SILC_DIST_INPLACE
+AC_DISABLE_SHARED
+#endif SILC_DIST_INPLACE
+AC_PROG_LIBTOOL
+
+SILC_TOP_SRCDIR=`pwd`
+
+
+##
+## Library versioning.
+##
+
+# Do the releases and library versioning according to following rules:
+#
+#  - If any code has changed in library, increment [LIB]_REVISION
+#  - If functions were added, removed or changed, set [LIB]_REVISION to 0
+#  - If functions were added, removed or changed, increment [LIB]_CURRENT
+#  - If functions were added, increment [LIB]_AGE
+#  - If functions were removed, set [LIB]_AGE to 0
+#
+# where [LIB] is LIBSILC, LIBSILCCLIENT or LIBSILCSERVER, and where
+# "functions" means functions public interfaces (API).
+#
+# The LIB_BASE_VERSION defines the SILC software major.minor version and
+# it is increment only when these version numbers actually change.
 #
-case "$target" in
-  *-*-linux*)
-    check_threads=true
-    CFLAGS=`echo $CFLAGS -D_GNU_SOURCE`
-    ;;
-  *-*-freebsd*)
-    check_threads=true
-    ;;
-  *-*-netbsd*)
-    check_threads=true
-    ;;
-  *-*-*bsd*)
-    check_threads=false
-    ;;
-  *)
-    check_threads=true
-    ;;
-esac
 
-# Get CPU
-cpu_i386=false
-cpu_ix86=false
-cpu_x86_64=false
-cpu_ppc=false
-cpu_ia64=false
-case "$host_cpu" in
-  i386)
-    AC_DEFINE([SILC_I386], [], [SILC_I386])
-    AC_DEFINE([SILC_I486], [], [SILC_I486])
-    cpu_i386=true
-    cpu_ix86=true
-    ;;
-  i?86)
-    AC_DEFINE([SILC_I486], [], [SILC_I486])
-    cpu_ix86=true
-    ;;
-  x86_64)
-    AC_DEFINE([SILC_X86_64], [], [SILC_X86_64])
-    cpu_x86_64=true
-    ;;
-  powerpc*)
-    AC_DEFINE([SILC_POWERPC], [], [SILC_POWERPC])
-    cpu_ppc=true
-    ;;
-  ia64)
-    AC_DEFINE([SILC_IA64], [], [SILC_IA64])
-    cpu_ia64=true
-    ;;
-esac
-AM_CONDITIONAL(SILC_I386, test x$cpu_i386 = xtrue)
-AM_CONDITIONAL(SILC_I486, test x$cpu_ix86 = xtrue)
-AM_CONDITIONAL(SILC_X86_64, test x$cpu_x86_64 = xtrue)
-AM_CONDITIONAL(SILC_POWERPC, test x$cpu_ppc = xtrue)
-AM_CONDITIONAL(SILC_IA64, test x$cpu_ia64 = xtrue)
+# Base version for libraries.  Do not change this unless SILC version
+# changes too.
+LIB_BASE_VERSION=1.2
 
-# Control compiler optimizations
-CFLAGS=`echo $CFLAGS | sed 's/-O[ 0123456789s]*//g'`
+# libsilc versions
+LIBSILC_CURRENT=1              # prev = 0
+LIBSILC_REVISION=0             # prev = 0
+LIBSILC_AGE=0                  # prev = 0
 
-AC_PROG_CC
-AC_C_INLINE
-AC_C_CONST
+# libsilcclient versions
+LIBSILCCLIENT_CURRENT=1                # prev = 0
+LIBSILCCLIENT_REVISION=0       # prev = 0
+LIBSILCCLIENT_AGE=0            # prev = 0
+
+# libsilcserver versions
+LIBSILCSERVER_CURRENT=1                # prev = 0
+LIBSILCSERVER_REVISION=0       # prev = 0
+LIBSILCSERVER_AGE=0            # prev = 0
+
+# Substitute the version numbers
+AC_SUBST(LIB_BASE_VERSION)
+AC_SUBST(LIBSILC_CURRENT)
+AC_SUBST(LIBSILC_REVISION)
+AC_SUBST(LIBSILC_AGE)
+AC_SUBST(LIBSILCCLIENT_CURRENT)
+AC_SUBST(LIBSILCCLIENT_REVISION)
+AC_SUBST(LIBSILCCLIENT_AGE)
+AC_SUBST(LIBSILCSERVER_CURRENT)
+AC_SUBST(LIBSILCSERVER_REVISION)
+AC_SUBST(LIBSILCSERVER_AGE)
+
+
+##
+##  Installation
+##
 
-__SILC_HAVE_PTHREAD=""
-__SILC_HAVE_SIM=""
-__SILC_ENABLE_DEBUG=""
+# Default installation destination
+AC_PREFIX_DEFAULT(/usr/local)
+if test "x$prefix" != xNONE; then
+  silc_prefix="$prefix"
+else
+  silc_prefix="$ac_default_prefix"
+  prefix="$silc_prefix"
+fi
 
 #ifdef SILC_DIST_TOOLKIT
 toolkitver=`echo $VERSION | sed 's/\./ /g'`
@@ -121,373 +133,252 @@ done
 __SILC_PACKAGE_VERSION="#define __SILC_TOOLKIT_VERSION SILC_VERSION($maj,$min,$bld)"
 #endif SILC_DIST_TOOLKIT
 
-AC_PROG_RANLIB
-#ifndef SILC_DIST_TOOLKIT
-AC_DISABLE_SHARED
-#endif SILC_DIST_TOOLKIT
-#ifdef SILC_DIST_INPLACE
-AC_DISABLE_SHARED
-#endif SILC_DIST_INPLACE
-AC_PROG_LIBTOOL
 
-# Header checking
-#
-AC_HEADER_STDC
-AC_HEADER_TIME
-AC_HEADER_STAT
+##
+## Required dependencies
+##
 
-# More header checking
-#
-AC_CHECK_HEADERS(unistd.h string.h getopt.h errno.h fcntl.h assert.h)
-AC_CHECK_HEADERS(sys/types.h sys/stat.h sys/time.h stddef.h)
-AC_CHECK_HEADERS(netinet/in.h netinet/tcp.h xti.h netdb.h sys/resource.h)
-AC_CHECK_HEADERS(pwd.h grp.h termcap.h paths.h)
-AC_CHECK_HEADERS(ncurses.h signal.h ctype.h utime.h)
-AC_CHECK_HEADERS(arpa/inet.h sys/mman.h limits.h termios.h locale.h langinfo.h)
-
-# Data type checking
-#
-AC_TYPE_SIGNAL
-AC_TYPE_SIZE_T
-AC_TYPE_MODE_T
-AC_TYPE_UID_T
-AC_TYPE_PID_T
-
-AC_CHECK_SIZEOF(long long, 0)
-AC_SUBST(SILC_SIZEOF_LONG_LONG, $ac_cv_sizeof_long_long)
-AC_CHECK_SIZEOF(long, 0)
-AC_SUBST(SILC_SIZEOF_LONG, $ac_cv_sizeof_long)
-AC_CHECK_SIZEOF(int, 0)
-AC_SUBST(SILC_SIZEOF_INT, $ac_cv_sizeof_int)
-AC_CHECK_SIZEOF(short, 0)
-AC_SUBST(SILC_SIZEOF_SHORT, $ac_cv_sizeof_short)
-AC_CHECK_SIZEOF(char, 0)
-AC_SUBST(SILC_SIZEOF_CHAR, $ac_cv_sizeof_char)
-AC_CHECK_SIZEOF(void *, 0)
-AC_SUBST(SILC_SIZEOF_VOID_P, $ac_cv_sizeof_void_p)
-AC_CHECK_TYPES(long long)
-AC_CHECK_TYPES(long double)
-
-# Function to check if compiler flag works
-# Usage: SILC_ADD_CFLAGS(FLAGS, [ACTION-IF-FAILED])
-AC_DEFUN([SILC_ADD_CFLAGS],
-[ tmp_CFLAGS="$CFLAGS"
-  CFLAGS="$CFLAGS $1"
-  AC_MSG_CHECKING(whether $CC accepts $1 flag)
-  AC_TRY_LINK([], [], [AC_MSG_RESULT(yes)], [AC_MSG_RESULT(no)
-                                      CFLAGS="$tmp_CFLAGS"
-                                      $2])
-  unset tmp_CFLAGS
-])
-
-# Function to check if compiler flag works, destination specifiable
-# Usage: SILC_ADD_CC_FLAGS(VAR, FLAGS, [ACTION-IF-FAILED])
-AC_DEFUN([SILC_ADD_CC_FLAGS],
-[ tmp_CFLAGS="$1_CFLAGS"
-  $1_CFLAGS="${$1_CFLAGS} $2"
-  AC_MSG_CHECKING(whether $CC accepts $2 flag)
-  AC_TRY_LINK([], [], [AC_MSG_RESULT(yes)], [AC_MSG_RESULT(no)
-                                      $1_CFLAGS="$tmp_CFLAGS"
-                                      $3])
-  unset tmp_CFLAGS
-])
-
-# Function and library checking
-#
-AC_CHECK_FUNC(gethostbyname, [],
-  [
-    AC_CHECK_LIB(nsl, gethostbyname, LIBS="$LIBS -lnsl")
-    AC_CHECK_FUNC(res_gethostbyname, [],
-       AC_CHECK_LIB(resolv, res_gethostbyname, LIBS="$LIBS -lresolv")
-    )
-  ])
-AC_CHECK_FUNC(socket, [],
-  AC_CHECK_LIB(socket, socket, LIBS="$LIBS -lsocket")
-)
-AC_CHECK_FUNCS(gethostname gethostbyaddr getservbyname getservbyport)
-AC_CHECK_FUNCS(poll select listen bind shutdown close connect setsockopt)
-AC_CHECK_FUNCS(setrlimit time ctime utime gettimeofday getrusage)
-AC_CHECK_FUNCS(chmod fcntl stat fstat getenv putenv strerror)
-AC_CHECK_FUNCS(getpid getgid getsid getpgid getpgrp getuid sched_yield)
-AC_CHECK_FUNCS(setgroups initgroups nl_langinfo nanosleep)
-AC_CHECK_FUNCS(strchr snprintf strstr strcpy strncpy memcpy memset memmove)
-
-# lib/contrib conditionals
-#
-AC_CHECK_HEADER(regex.h,
-  [
-    AC_DEFINE([HAVE_REGEX_H], [], [HAVE_REGEX_H])
-    have_regex=1
-  ], have_regex=0
-)
-AM_CONDITIONAL(HAVE_REGEX, test x$have_regex = x1)
+compile_libs=true
+LIBSUBDIR=lib
+LDFLAGS="-L\$(silc_top_srcdir)/lib $LDFLAGS"
 
-AC_CHECK_FUNC(getopt_long,
-  [
-    AC_DEFINE([HAVE_GETOPT_LONG], [], [HAVE_GETOPT_LONG])
-    have_getopt_long=1
-  ], have_getopt_long=0
-)
+# SILC Runtime Toolkit checking
+AC_ARG_WITH(srt-includes,
+  [  --with-srt-includes=DIR  SILC Runtime Toolkit includes [search in DIR]],
+  [ac_srt_includes="$withval"], [ac_srt_includes="no"])
+AC_ARG_WITH(srt-libs,
+  [  --with-srt-libs=DIR      SILC Runtime Toolkit libraries [search in DIR]],
+  [ac_srt_libs="$withval"], [ac_srt_libs="no"])
 
-AC_CHECK_FUNC(getopt,
-  [
-    AC_DEFINE([HAVE_GETOPT], [], [HAVE_GETOPT])
-    have_getopt=1
-  ], have_getopt=0
-)
+if test -n "$with_srt_includes" || test -n "$with_srt_libs"; then
+  # Manually provided libs
+  if test "$ac_srt_includes" != "no"; then
+    SILC_LIB_INCLUDES="-I$ac_srt_includes"
+  fi
+  if test "$ac_srt_libs" != "no"; then
+    LDFLAGS="-L$ac_srt_libs $LDFLAGS"
+  fi
 
-##
-##  Enable/disable checking
-##
+  # Check libs to link against
+  f=`$EGREP __SILC_HAVE_PTHREAD $ac_srt_includes/silc.h`
+  if test -n "$f"; then
+    LIBS="$LIBS -lpthread"
+    has_threads=true
+  fi
+else
+  # pkg-config check
+  PKG_CHECK_MODULES(SRT, [srt >= 1.2])
+  LIBS="$SRT_LIBS $LIBS"
+  CFLAGS="$CFLAGS $SRT_CFLAGS"
+fi
 
-# IPv6 support
-#
-AC_MSG_CHECKING(whether to enable IPv6 support)
-AC_ARG_ENABLE(ipv6,
-  [  --enable-ipv6           enable IPv6 support],
-  [
-    case "${enableval}" in
-      yes)
-        want_ipv6=true
-        check_ipv6=false
-       summary_ipv6="yes"
-        AC_DEFINE([HAVE_IPV6], [], [HAVE_IPV6])
-        AC_MSG_RESULT(yes)
-        ;;
-      *)
-        want_ipv6=false
-        check_ipv6=false
-       summary_ipv6="no"
-        AC_MSG_RESULT(no)
-        ;;
-    esac
-  ],
-    check_ipv6=true
-  )
+# SILC Crypto Toolkit checking
+AC_ARG_WITH(sct-includes,
+  [  --with-sct-includes=DIR  SILC Crypto Toolkit includes [search in DIR]],
+  [ac_sct_includes="$withval"], [ac_sct_includes="no"])
+AC_ARG_WITH(sct-libs,
+  [  --with-sct-libs=DIR      SILC Crypto Toolkit libraries [search in DIR]],
+  [ac_sct_libs="$withval"], [ac_sct_libs="no"])
 
-if test x$check_ipv6 = xtrue; then
-  summary_ipv6="no"
-  AC_TRY_COMPILE(
-    [
-      #ifdef HAVE_SYS_TYPES_H
-      #include <sys/types.h>
-      #endif
-      #ifdef HAVE_NETINET_TCP_H
-      #include <netinet/tcp.h>
-      #endif
-      #ifdef HAVE_NETDB_H
-      #include <netdb.h>
-      #endif
-      #include <sys/socket.h>
-      #ifdef HAVE_NETINET_IN_H
-      #include <netinet/in.h>
-      #endif
-    ],
-    [
-      struct sockaddr_in6 sin6;
-      int family = AF_INET6;
-    ],
-    [
-      AC_DEFINE([HAVE_IPV6], [], [HAVE_IPV6])
-      AC_MSG_RESULT(yes)
-      summary_ipv6="yes"
-    ],
-      AC_MSG_RESULT(no)
-    )
+if test -n "$with_sct_includes" || test -n "$with_sct_libs"; then
+  # Manually provided libs
+  if test "$ac_sct_includes" != "no"; then
+    SILC_LIB_INCLUDES="-I$ac_sct_includes"
+  fi
+  if test "$ac_sct_libs" != "no"; then
+    LDFLAGS="-L$ac_sct_libs $LDFLAGS"
+  fi
+
+  # Check libs to link against
+  f=`$EGREP __SILC_HAVE_PTHREAD $ac_sct_includes/silc.h`
+  if test -n "$f"; then
+    LIBS="$LIBS -lpthread"
+    has_threads=true
+  fi
+else
+  # pkg-config check
+  PKG_CHECK_MODULES(SCT, [sct >= 1.2])
+  LIBS="$SCT_LIBS $LIBS"
+  CFLAGS="$CFLAGS $SCT_CFLAGS"
 fi
 
-# Debug checking
-#
-AC_MSG_CHECKING(whether to enable debugging)
-summary_debug="no"
-__SILC_ENABLE_DEBUG=""
-AC_ARG_ENABLE(debug,
-  [  --enable-debug          enable debugging],
-  [
-    case "${enableval}" in
-      yes)
-        AC_MSG_RESULT(yes)
-        AC_DEFINE([SILC_DEBUG], [], [enable-debug])
-       summary_debug="yes"
-        __SILC_ENABLE_DEBUG="#define __SILC_ENABLE_DEBUG 1"
-        ;;
-      *)
-        AC_MSG_RESULT(no)
-        ;;
-    esac
-  ],
-  [
-    AC_MSG_RESULT(no)
-  ])
 
-# Disable all compiler optimizations
-#
-AC_MSG_CHECKING(whether to enable compiler optimizations)
-want_cc_optimizations=true
-AC_ARG_ENABLE(optimizations,
-  [  --disable-optimizations do not use any compiler optimizations],
-  [
-    AC_MSG_RESULT(no)
-    AC_DEFINE([SILC_NO_CC_OPTIMIZATIONS], [], [SILC_NO_CC_OPTIMIZATIONS])
-    want_cc_optimizations=false
-  ],
-  [
-    AC_MSG_RESULT(yes)
-    want_cc_optimizations=true
-  ])
-AM_CONDITIONAL(SILC_NO_CC_OPTIMIZATIONS, test x$want_cc_optimizations = xfalse)
+##
+## Detect CPU
+##
 
-# Disable all assembler optimizations
-#
-AC_MSG_CHECKING(whether to enable assembler optimizations)
-want_asm=true
-AC_ARG_ENABLE(asm,
-  [  --disable-asm           do not use assembler optimizations],
+# Disable all CPU feature optimizations
+AC_MSG_CHECKING(whether to enable CPU feature optimizations)
+AC_ARG_ENABLE(cpu-optimizations,
+  [  --disable-cpu-optimizations  do not use any CPU feature optimizations],
   [
     AC_MSG_RESULT(no)
-    AC_DEFINE([SILC_NO_ASM], [], [SILC_NO_ASM])
-    want_asm=false
+    AC_DEFINE([SILC_NO_CPU_OPTIMIZATIONS], [], [SILC_NO_CPU_OPTIMIZATIONS])
+    want_cpu_optimizations=false
   ],
   [
     AC_MSG_RESULT(yes)
-    want_asm=true
+    want_cpu_optimizations=true
   ])
-AM_CONDITIONAL(SILC_NO_ASM, test x$want_asm = xfalse)
+AM_CONDITIONAL(SILC_NO_CPU_OPTIMIZATIONS,
+               test x$want_cpu_optimizations = xfalse)
 
-# Check for assembler
-#
-SILC_ASSEMBLER=""
-have_assembler=false
-if test x$want_asm = xtrue; then
-  AC_PATH_PROG([NASM], [nasm], [no])
-  if test "x$NASM" != "xno"; then
-    if test x$cpu_x86_64 = xtrue; then
-      SILC_ASSEMBLER="$NASM -O2 -felf64"
-    else
-      SILC_ASSEMBLER="$NASM -O2 -felf"
+SILC_SYSTEM_IS_SMP(AC_DEFINE([SILC_SMP], [], [SILC_SMP]), [],
+                   AC_DEFINE([SILC_SMP], [], [SILC_SMP]))
+cpu_i386=false
+cpu_i486=false
+cpu_i586=false
+cpu_i686=false
+cpu_i786=false
+cpu_x86_64=false
+cpu_ppc=false
+cpu_ia64=false
+case "$host_cpu" in
+  # All following Intels are considered 32-bit CPUs.
+  i?86)
+    # All CPUs of today are considered i386 and i486 compatible */
+    cpu_i386=true
+    cpu_i486=true
+
+    if test "x$host_cpu" = "xi586"; then
+      cpu_i586=true
     fi
-    have_assembler=true
-  fi
 
-  AC_PATH_PROG([YASM], [yasm], [no])
-  if test "x$YASM" != "xno"; then
-    if test x$cpu_x86_64 = xtrue; then
-      SILC_ASSEMBLER="$YASM -Xgnu -felf64"
-    else
-      SILC_ASSEMBLER="$YASM -Xgnu -felf"
+    if test "x$host_cpu" = "xi686"; then
+      cpu_i586=true
+      cpu_i686=true
+    fi
+
+    if test "x$host_cpu" = "xi786"; then
+      cpu_i586=true
+      cpu_i686=true
+      cpu_i786=true
+    fi
+
+    # Check for specific CPU features
+    SILC_CPU_FLAG(mmx, true, AC_DEFINE([SILC_CPU_MMX], [], [SILC_CPU_MMX]), [])
+    SILC_CPU_FLAG(sse2, true, AC_DEFINE([SILC_CPU_SSE2], [], [SILC_CPU_SSE2]), [])
+    SILC_CPU_FLAG(pni, true, AC_DEFINE([SILC_CPU_SSE3], [], [SILC_CPU_SSE3]), [])
+    SILC_CPU_FLAG(ssse3, true, AC_DEFINE([SILC_CPU_SSSE3], [], [SILC_CPU_SSSE3]), [])
+    SILC_CPU_FLAG(sse4, true, AC_DEFINE([SILC_CPU_SSE4], [], [SILC_CPU_SSE4]), [])
+    ;;
+
+  # Intel IA-64, 64-bit CPU (not x86_64 compatible)
+  ia64)
+    AC_DEFINE([SILC_IA64], [], [SILC_IA64])
+    cpu_ia64=true
+    ;;
+
+  # AMD/Intel x86_64, 64-bit CPU
+  x86_64)
+    cpu_x86_64=true
+
+    # Check for specific CPU features
+    SILC_CPU_FLAG(mmx, true, AC_DEFINE([SILC_CPU_MMX], [], [SILC_CPU_MMX]), [])
+    SILC_CPU_FLAG(sse2, true, AC_DEFINE([SILC_CPU_SSE2], [], [SILC_CPU_SSE2]), [])
+    SILC_CPU_FLAG(pni, true, AC_DEFINE([SILC_CPU_SSE3], [], [SILC_CPU_SSE3]), [])
+    SILC_CPU_FLAG(ssse3, true, AC_DEFINE([SILC_CPU_SSSE3], [], [SILC_CPU_SSSE3]), [])
+    SILC_CPU_FLAG(sse4, true, AC_DEFINE([SILC_CPU_SSE4], [], [SILC_CPU_SSE4]), [])
+    ;;
+
+  # PowerPC, 32-bit and 64-bit CPUs
+  powerpc*)
+    cpu_ppc=true
+    ;;
+esac
+AM_CONDITIONAL(SILC_I386, test x$cpu_i386 = xtrue)
+AM_CONDITIONAL(SILC_I486, test x$cpu_i486 = xtrue)
+AM_CONDITIONAL(SILC_I586, test x$cpu_i586 = xtrue)
+AM_CONDITIONAL(SILC_I686, test x$cpu_i686 = xtrue)
+AM_CONDITIONAL(SILC_7686, test x$cpu_i786 = xtrue)
+AM_CONDITIONAL(SILC_X86_64, test x$cpu_x86_64 = xtrue)
+AM_CONDITIONAL(SILC_POWERPC, test x$cpu_ppc = xtrue)
+AM_CONDITIONAL(SILC_IA64, test x$cpu_ia64 = xtrue)
+
+if test x$want_cpu_optimizations = xtrue; then
+  # Set some compiler options based on CPU
+  if test "x$CC" = "xicc"; then
+    # ICC flags
+    if test x$x_have_cpu_sse4 = xtrue; then
+      SILC_ADD_CFLAGS(-axS)
+    fi
+    if test x$x_have_cpu_ssse3 = xtrue; then
+      SILC_ADD_CFLAGS(-axT)
+    elif test x$x_have_cpu_pni = xtrue; then
+      SILC_ADD_CFLAGS(-axP)
+    elif test x$x_have_cpu_sse2 = xtrue; then
+      SILC_ADD_CFLAGS(-axW)
+    fi
+  else
+    # Other compilers
+    if test x$x_have_cpu_sse2 = xtrue; then
+      SILC_ADD_CFLAGS(-msse2)
+    fi
+    if test x$x_have_cpu_pni = xtrue; then
+      SILC_ADD_CFLAGS(-msse3)
+    fi
+    if test x$x_have_cpu_ssse3 = xtrue; then
+      SILC_ADD_CFLAGS(-mssse3)
+    fi
+    if test x$x_have_cpu_sse4 = xtrue; then
+      SILC_ADD_CFLAGS(-msse4)
     fi
-    have_assembler=true
   fi
 fi
-AC_SUBST(SILC_ASSEMBLER)
+
 
 ##
-## va_copy checks
+## Put here any platform specific stuff
 ##
-va_copy=false
-AC_MSG_CHECKING(for va_copy)
-AC_TRY_COMPILE(
-  [
-    #include <stdarg.h>
-    #include <stdlib.h>
-  ],
-  [
-    int t(int x, ...)
-    {
-      va_list va, cp;
-      va_start(va, x);
-      va_copy(cp, va);
-      if (va_arg(cp, int) != 0xff11)
-        return 1;
-      va_end(va);
-      va_end(cp);
-      return 0;
-    }
-    int main()
-    {
-      return t(0, 0xff11);
-    }
-  ],
-  [
-    AC_DEFINE([HAVE_VA_COPY], [], [HAVE_VA_COPY])
-    AC_MSG_RESULT(yes)
-    va_copy=true
-  ],
-  [
-    AC_MSG_RESULT(no)
-    va_copy=false
-  ]
-)
 
-if test x$va_copy = xfalse; then
-  AC_MSG_CHECKING(for __va_copy)
-  AC_TRY_COMPILE(
-  [
-    #include <stdarg.h>
-    #include <stdlib.h>
-  ],
-  [
-    int t(int x, ...)
-    {
-      va_list va, cp;
-      va_start(va, x);
-      __va_copy(cp, va);
-      if (va_arg(cp, int) != 0xff11)
-        return 1;
-      va_end(va);
-      va_end(cp);
-      return 0;
-    }
-    int main()
-    {
-      return t(0, 0xff11);
-    }
-  ],
-  [
-    AC_DEFINE([HAVE___VA_COPY], [], [HAVE___VA_COPY])
-    AC_MSG_RESULT(yes)
-    va_copy=true
-  ],
-  [
-    AC_MSG_RESULT(no)
-    va_copy=false
-  ]
-  )
-fi
+case "$target" in
+  *-*-linux*)
+    CFLAGS=`echo $CFLAGS -D_GNU_SOURCE`
+    ;;
+  *-*-freebsd*)
+    ;;
+  *-*-netbsd*)
+    ;;
+  *-*-*bsd*)
+    ;;
+  *)
+    ;;
+esac
+
+
+##
+## Header checking
+##
+AC_HEADER_STDC
+
+# More header checking
+#
+AC_CHECK_HEADERS(unistd.h assert.h time.h fcntl.h stdarg.h)
+AC_CHECK_HEADERS(sys/types.h sys/times.h sys/time.h)
+
+# Check for big-endian machines
+AC_C_BIGENDIAN
 
-if test x$va_copy = xfalse; then
-  AC_RUN_IFELSE(
-    [
-      #include <stdarg.h>
-      #include <stdlib.h>
-      int t(int x, ...)
-      {
-        va_list va, cp;
-        va_start(va, x);
-        cp = va;
-        if (va_arg(cp, int) != 0xff11)
-          return 1;
-        va_end(va);
-        va_end(cp);
-        return 0;
-      }
-      int main()
-      {
-        return t(0, 0xff11);
-      }
-    ],
-    [va_copy=false],
-    [
-      AC_DEFINE([SILC_VA_COPY_ARRAY], [], [SILC_VA_COPY_ARRAY])
-    ],
-    [va=copy=false]
-  )
-fi
 
 ##
 ## Compiler and compiler flag checks
 ##
 
+# Disable all compiler optimizations
+AC_MSG_CHECKING(whether to enable compiler optimizations)
+AC_ARG_ENABLE(optimizations,
+  [  --disable-optimizations do not use any compiler optimizations],
+  [
+    AC_MSG_RESULT(no)
+    AC_DEFINE([SILC_NO_CC_OPTIMIZATIONS], [], [SILC_NO_CC_OPTIMIZATIONS])
+    want_cc_optimizations=false
+  ],
+  [
+    AC_MSG_RESULT(yes)
+    want_cc_optimizations=true
+  ])
+AM_CONDITIONAL(SILC_NO_CC_OPTIMIZATIONS, test x$want_cc_optimizations = xfalse)
+
 if test "$GCC"; then
   # GCC specific options
   if test "x$summary_debug" = "xyes"; then
@@ -511,9 +402,13 @@ else
       ;;
   esac
 
-  # Intel C++ Compiler needs -restrict
+  # Intel C++ Compiler flags
   if test "x$CC" = "xicc"; then
     SILC_ADD_CFLAGS(-restrict)
+    SILC_ADD_CFLAGS(-finline-functions)
+
+    # Don't define __GNUC__ except for system includes
+    SILC_ADD_CFLAGS(-gcc-sys)
   fi
 fi
 
@@ -541,66 +436,102 @@ if test x$want_cc_optimizations = xtrue; then
   fi
 fi
 
-#
-# Workaround a bug in GCC 2.x which causes memory exhaustion
-# when compiling sha1 with optimizations on UltraSPARC.
-#
-FIX_SHA1='#'
-if test "$GCC" -a "$host_cpu" = "sparc64"; then
-  AC_MSG_CHECKING(whether to enable GCC 2.x workaround for SHA1)
-  AC_TRY_COMPILE(
-    [
-      #if defined(__sparc64__) && (__GNUC__ == 2)
-      #else
-      choke me
-      #endif
-    ],
-    [],
-    [
-      FIX_SHA1=''
-      AC_MSG_RESULT(yes)
-    ],
-      AC_MSG_RESULT(no)
-    )
-fi
-AC_SUBST(FIX_SHA1)
-#endif SILC_DIST_COMPILER
 
 ##
-##  Installation
+## Function and libary checking
 ##
 
-# Default installation destination
+
+##
+##  Enable/disable checking
+##
+
+#ifdef SILC_DIST_INPLACE
 #
-AC_PREFIX_DEFAULT(/usr/local)
-if test "x$prefix" != xNONE; then
-  silc_prefix="$prefix"
-else
-  silc_prefix="$ac_default_prefix"
-  prefix="$silc_prefix"
-fi
+# Profiling options (never delivered to distributions)
+#
+AC_MSG_CHECKING(whether to enable gprof)
+AC_ARG_ENABLE(gprof,
+  [  --enable-gprof          enable gprof profiling],
+  [
+    case "${enableval}" in
+      yes)
+        AC_MSG_RESULT(yes)
+        SILC_ADD_CFLAGS(-pg)
+        LIBS="$LIBS -pg"
+        ;;
+      *)
+        AC_MSG_RESULT(no)
+        ;;
+    esac
+  ],
+  [
+    AC_MSG_RESULT(no)
+  ])
+
+AC_MSG_CHECKING(whether to enable gcov)
+AC_ARG_ENABLE(gcov,
+  [  --enable-gcov           enable gcov],
+  [
+    case "${enableval}" in
+      yes)
+        AC_MSG_RESULT(yes)
+        SILC_ADD_CFLAGS(-fprofile-arcs)
+        LIBS="$LIBS -lgcov"
+        ;;
+      *)
+        AC_MSG_RESULT(no)
+        ;;
+    esac
+  ],
+  [
+    AC_MSG_RESULT(no)
+  ])
+#endif SILC_DIST_INPLACE
+
+# Debug checking
+AC_MSG_CHECKING(whether to enable debugging)
+summary_debug="no"
+AC_ARG_ENABLE(debug,
+  [  --enable-debug          enable debugging],
+  [
+    case "${enableval}" in
+      yes)
+        AC_MSG_RESULT(yes)
+       summary_debug="yes"
+        ;;
+      *)
+        AC_MSG_RESULT(no)
+        ;;
+    esac
+  ],
+  [
+    AC_MSG_RESULT(no)
+  ])
 
-#ifndef SILC_DIST_AUTODIST
-ETCDIR=`eval echo $sysconfdir`;ETCDIR=`eval echo $ETCDIR`
-AC_SUBST(ETCDIR)
-AC_DEFINE_UNQUOTED([SILC_ETCDIR], "$ETCDIR", [SILC_ETCDIR])
+# Disable all assembler optimizations
+AC_MSG_CHECKING(whether to enable assembler optimizations)
+want_asm=true
+AC_ARG_ENABLE(asm,
+  [  --disable-asm           do not use assembler optimizations],
+  [
+    AC_MSG_RESULT(no)
+    AC_DEFINE([SILC_NO_ASM], [], [SILC_NO_ASM])
+    want_asm=false
+  ],
+  [
+    AC_MSG_RESULT(yes)
+    want_asm=true
+  ])
+AM_CONDITIONAL(SILC_NO_ASM, test x$want_asm = xfalse)
 
-DOCDIR=`eval echo $docdir`;DOCDIR=`eval echo $DOCDIR`
-AC_SUBST(DOCDIR)
-AC_DEFINE_UNQUOTED([SILC_DOCDIR], "$DOCDIR", [SILC_DOCDIR])
-#endif SILC_DIST_AUTODIST
 
-#ifdef SILC_DIST_COMPILER
 ##
 ##  With/without checkings
 ##
 
-#
-# SILC library checking
-compile_libs=true
-LIBSUBDIR=lib
-
 #ifndef SILC_DIST_TOOLKIT
+# SILC Protocol Toolkit checking
 AC_ARG_WITH(silc-includes,
   [  --with-silc-includes=DIR SILC Toolkit includes [search in DIR]],
   [ac_silc_includes="$withval"], [ac_silc_includes="no"])
@@ -620,8 +551,6 @@ if test -n "$with_silc_includes" || test -n "$with_silc_libs"; then
     compile_libs=false
     LIBSUBDIR=
     LDFLAGS="-L$ac_silc_libs $LDFLAGS"
-  else
-    LDFLAGS="-L\$(silc_top_srcdir)/lib $LDFLAGS"
   fi
 
   # Check libs to link against
@@ -638,9 +567,9 @@ if test -n "$with_silc_includes" || test -n "$with_silc_libs"; then
 
 else
   # pkg-config check
-  PKG_CHECK_MODULES(SILC, [silc >= 1.1], compile_libs=false, compile_libs=true)
+  PKG_CHECK_MODULES(SILC, [silc >= 1.2], compile_libs=false, compile_libs=true)
 #ifdef SILC_DIST_CLIENTLIB
-  PKG_CHECK_MODULES(SILCCLIENT, [silcclient >= 1.1.1], compile_libs=false, compile_libs=true)
+  PKG_CHECK_MODULES(SILCCLIENT, [silcclient >= 1.2], compile_libs=false, compile_libs=true)
 #endif SILC_DIST_CLIENTLIB
 #ifdef SILC_DIST_SERVERLIB
   PKG_CHECK_MODULES(SILCSERVER, silcserver, compile_libs=false, compile_libs=true)
@@ -658,50 +587,29 @@ else
     LIBS="$LIBS $SILCSERVER_LIBS"
     CFLAGS="$CFLAGS $SILCSERVER_CFLAGS"
 #endif SILC_DIST_SERVERLIB
-  else
-    LDFLAGS="-L\$(silc_top_srcdir)/lib $LDFLAGS"
   fi
 fi
-#else SILC_DIST_TOOLKIT
-LDFLAGS="-L\$(silc_top_srcdir)/lib $LDFLAGS"
 #endif SILC_DIST_TOOLKIT
 
-#ifdef SILC_DIST_SIM
-# SIM support checking
-# XXX These needs to be changed as more supported platforms appear.
-# XXX This probably needs to be made platform dependant check.
-#
-sim_support=false
-AC_MSG_CHECKING(for SIM support)
-AC_MSG_RESULT()
-AC_CHECK_HEADERS(dlfcn.h,
-  [
-    AC_CHECK_LIB(dl, dlopen,
-      [
-        AC_DEFINE([SILC_SIM], [], [HAVE_SIM])
-        sim_support=true
-        LIBS="$LIBS -ldl"
-      ],
-      [
-        AC_CHECK_LIB(c, dlopen,
-          [
-            AC_DEFINE([SILC_SIM], [], [HAVE_SIM])
-            sim_support=true
-          ])
-      ])
-   ])
-
-AM_CONDITIONAL(SILC_SIM, test x$sim_support = xtrue)
-if test x$sim_support = xtrue; then
-  AC_MSG_RESULT(Enabled SIM support.)
-  __SILC_HAVE_SIM="#define __SILC_HAVE_SIM 1"
-else
-  AC_MSG_RESULT(No SIM support found.)
+if test x$compile_libs = xtrue; then
+SILC_LIB_INCLUDES="$SILC_LIB_INCLUDES -I$SILC_TOP_SRCDIR/lib/silccore"
+SILC_LIB_INCLUDES="$SILC_LIB_INCLUDES -I$SILC_TOP_SRCDIR/lib/silcapputil"
+SILC_LIB_INCLUDES="$SILC_LIB_INCLUDES -I$SILC_TOP_SRCDIR/lib/silcske"
+#ifdef SILC_DIST_SFTP
+SILC_LIB_INCLUDES="$SILC_LIB_INCLUDES -I$SILC_TOP_SRCDIR/lib/silcsftp"
+#endif SILC_DIST_SFTP
+#ifdef SILC_DIST_CLIENTLIB
+SILC_LIB_INCLUDES="$SILC_LIB_INCLUDES -I$SILC_TOP_SRCDIR/lib/silcclient"
+#endif SILC_DIST_CLIENTLIB
+#ifdef SILC_DIST_SERVERLIB
+SILC_LIB_INCLUDES="$SILC_LIB_INCLUDES -I$SILC_TOP_SRCDIR/lib/silcserver"
+#endif SILC_DIST_SERVERLIB
+#ifdef SILC_DIST_VCARD
+SILC_LIB_INCLUDES="$SILC_LIB_INCLUDES -I$SILC_TOP_SRCDIR/lib/silcvcard"
+#endif SILC_DIST_VCARD
 fi
-#endif SILC_DIST_SIM
 
 # SOCKS4 support checking
-#
 SAVE_LIBS="$LIBS"
 SAVE_CFLAGS="$CFLAGS"
 SAVE_LDFLAGS="$LDFLAGS"
@@ -743,7 +651,6 @@ AC_ARG_WITH(socks4,
   )
 
 # SOCKS5 support checking
-#
 SAVE_LIBS="$LIBS"
 SAVE_CFLAGS="$CFLAGS"
 SAVE_LDFLAGS="$LDFLAGS"
@@ -815,467 +722,10 @@ if test "x$socks" = "x5"; then
   AC_DEFINE([Rgethostbyname], [SOCKSgethostbyname], [Socks])
 fi
 
-#ifdef SILC_DIST_MATH
-# MP library checking. First check whether user wants to use GMP and use
-# it if found. If not or not defined then compile the default library in the
-# source tree.
-#
-mp_gmp=false
-SAVE_LIBS="$LIBS"
-SAVE_CFLAGS="$CFLAGS"
-SAVE_LDFLAGS="$LDFLAGS"
-AC_MSG_CHECKING(whether to search for GMP)
-AC_ARG_WITH(gmp,
-  [[  --with-gmp[=DIR]        use GMP instead of SILC Math [search in DIR/lib and DIR/include]]],
-  [
-    case "$withval" in
-      no)
-        AC_MSG_RESULT(no)
-        ;;
-      *)
-        AC_MSG_RESULT(yes)
-
-        if test -d "$withval/include"; then
-          CFLAGS="$CFLAGS -I$withval/include"
-        fi
-        if test -d "$withval/lib"; then
-          LDFLAGS="$LDFLAGS -L$withval/lib"
-        fi
-
-        LIBS="-lgmp $LIBS"
-        ;;
-    esac
-
-    AC_CHECK_LIB(gmp, __gmpz_init,
-      [
-        mp_gmp=true
-        AC_DEFINE([SILC_MP_GMP], [], [GMP])
-        AC_MSG_RESULT(Using GMP as a MP library.)
-      ],
-      [
-        LIBS="$SAVE_LIBS"
-        CFLAGS="$SAVE_CFLAGS"
-        LDFLAGS="$SAVE_LDFLAGS"
-      ])
-  ],
-    AC_MSG_RESULT(no)
-  )
-
-AM_CONDITIONAL(SILC_MP_GMP, test x$mp_gmp = xtrue)
-AM_CONDITIONAL(SILC_MP_SILCMATH, test x$mp_gmp = xfalse)
-if test x$mp_gmp = xfalse; then
-  AC_DEFINE([SILC_MP_SILCMATH], [], [SILCMATH])
-  AC_MSG_RESULT(Using SILC Math as a MP library.)
-fi
-#endif SILC_DIST_MATH
-
-# iconv support
-#
-check_iconv=true
-has_iconv=false
-SAVE_LIBS="$LIBS"
-SAVE_CFLAGS="$CFLAGS"
-SAVE_LDFLAGS="$LDFLAGS"
-SAVE_CPPFLAGS="$CPPFLAGS"
-AC_MSG_CHECKING(whether to implicit search for libiconv)
-AC_ARG_WITH(iconv,
-  [[  --with-iconv[=DIR]      use libiconv [search in DIR/include and DIR/lib]]],
-  [
-    case "${withval}" in
-      no)
-        AC_MSG_RESULT(no)
-        AC_CHECK_HEADERS(iconv.h,
-          [
-            AC_CHECK_FUNC(iconv, has_iconv=true)
-          ])
-        check_iconv=false
-        ;;
-      *)
-        AC_MSG_RESULT(yes)
-        if test -d $withval/include; then
-          CPPFLAGS="$CPPFLAGS -I$withval/include"
-          CFLAGS="$CFLAGS -I$withval/include"
-        fi
-        if test -d $withval/lib; then
-          LDFLAGS="$LDFLAGS -L$withval/lib"
-        fi
-        ;;
-    esac
-  ],
-  [
-    AC_MSG_RESULT(no)
-    AC_CHECK_HEADERS(iconv.h,
-      [
-        AC_CHECK_FUNCS(iconv,
-          [
-            has_iconv=true
-            check_iconv=false
-          ])
-      ])
-  ])
-
-if test x$check_iconv = xtrue; then
-  AC_MSG_RESULT(Searching for iconv...)
-
-  # XXX
-  unset ac_cv_header__iconv_h_ ac_cv_header_iconv_h || true
-
-  AC_CHECK_HEADERS(iconv.h,
-    [
-      LIBS="$LIBS -liconv"
-      AC_MSG_CHECKING(for iconv in -liconv)
-      AC_TRY_LINK(
-        [
-          #include <stdlib.h>
-          #include <iconv.h>
-        ],
-        [
-          iconv_t cd = iconv_open("", "");
-          iconv(cd, NULL, NULL, NULL, NULL);
-          iconv_close(cd);
-        ],
-        [
-          echo "yes"
-          AC_DEFINE([HAVE_ICONV], [], [Define if you have the iconv() function.])
-          has_iconv=true
-          check_iconv=false
-        ],
-        [
-          echo "no"
-          LIBS="$SAVE_LIBS"
-          CFLAGS="$SAVE_CFLAGS"
-          LDFLAGS="$SAVE_LDFLAGS"
-          CPPFLAGS="$SAVE_CPPFLAGS"
-        ])
-     ])
-fi
-
-if test x$check_iconv = xtrue; then
-  # search for iconv library..
-  SAVE_LIBS="$LIBS"
-  SAVE_CFLAGS="$CFLAGS"
-  SAVE_LDFLAGS="$LDFLAGS"
-  SAVE_CPPFLAGS="$CPPFLAGS"
-
-  for dir in `echo "/usr/local /usr/pkg /usr/contrib"`; do
-    if test x$has_iconv = xfalse; then
-      AC_MSG_RESULT(searching in $dir...)
-
-      if test -d $dir/include; then
-        CPPFLAGS="$CPPFLAGS -I$dir/include"
-        CFLAGS="$CFLAGS -I$dir/include"
-      fi
-      if test -d $dir/lib; then
-        LDFLAGS="$LDFLAGS -L$dir/lib"
-      fi
-
-      # XXX
-      unset ac_cv_header__iconv_h_ ac_cv_header_iconv_h || true
-
-      AC_CHECK_HEADERS(iconv.h,
-        [
-          LIBS="$LIBS -liconv"
-          AC_MSG_CHECKING(for iconv in -liconv)
-          AC_TRY_LINK(
-            [
-              #include <stdlib.h>
-              #include <iconv.h>
-            ],
-            [
-              iconv_t cd = iconv_open("", "");
-              iconv(cd, NULL, NULL, NULL, NULL);
-              iconv_close(cd);
-            ],
-            [
-              echo "yes"
-              has_iconv=true
-              AC_DEFINE([HAVE_ICONV], [], [Define if you have the iconv() function.])
-            ],
-            [
-              echo "no"
-              has_iconv=false
-
-              LIBS="$SAVE_LIBS"
-              CFLAGS="$SAVE_CFLAGS"
-              LDFLAGS="$SAVE_LDFLAGS"
-              CPPFLAGS="$SAVE_CPPFLAGS"
-            ])
-         ],
-         [
-           CFLAGS="$SAVE_CFLAGS"
-           LDFLAGS="$SAVE_LDFLAGS"
-           CPPFLAGS="$SAVE_CPPFLAGS"
-         ])
-      fi
-    done
-fi
-
-if test x$has_iconv = xtrue; then
-  # (1) Some implementations of iconv won't convert from UTF-8 to UTF-8.
-  # (2) In glibc-2.1.2 and earlier there is a bug that messes up ob and
-  #     obl when args 2 and 3 are 0 (fixed in glibc-2.1.3).
-  #
-  AC_CACHE_CHECK([whether this iconv is good enough], ac_iconv_good,
-    AC_TRY_RUN(
-      [
-        #include <iconv.h>
-        int main() {
-          iconv_t cd;
-        changequote(, )dnl
-          char buf[4];
-        changequote([, ])dnl
-          char *ob;
-          size_t obl;
-          ob = buf, obl = sizeof(buf);
-          return ((cd = iconv_open("UTF-8", "UTF-8")) != (iconv_t)(-1) &&
-                 (iconv(cd, 0, 0, &ob, &obl) ||
-                 !(ob == buf && obl == sizeof(buf)) ||
-                 iconv_close(cd)));
-        }
-      ],
-      [
-        ac_iconv_good=yes
-      ],
-      [
-        ac_iconv_good=no
-      ],
-      [
-        ac_iconv_good=yes
-      ])
-    )
-
-  if test x$ac_iconv_good = xno; then
-    AC_MSG_RESULT(Try using libiconv instead.)
-  fi
-fi
-
-# POSIX threads support
-#
-AC_MSG_CHECKING(whether to search for POSIX threads)
-AC_ARG_WITH(pthreads,
-  [[  --with-pthreads[=DIR]   use POSIX threads [search in DIR/include and DIR/lib]]],
-  [
-    case "${withval}" in
-      no)
-        check_threads=false
-        ;;
-      *)
-        if test -d $withval/include; then
-          CPPFLAGS="$CPPFLAGS -I$withval/include"
-          CFLAGS="$CFLAGS -I$withval/include"
-        fi
-        if test -d $withval/lib; then
-          LDFLAGS="$LDFLAGS -L$withval/lib"
-        fi
-
-        check_threads=true
-        ;;
-    esac
-  ])
-
-if test x$check_threads = xtrue; then
-  has_threads=false
-  SAVE_LIBS="$LIBS"
-  SAVE_CFLAGS="$CFLAGS"
-  SAVE_LDFLAGS="$LDFLAGS"
-  SAVE_CPPFLAGS="$CPPFLAGS"
-
-  AC_MSG_RESULT(yes)
-  AC_CHECK_HEADERS(pthread.h,
-    [
-      LIBS="$LIBS -lpthread"
-      AC_CHECK_LIB(pthread, pthread_attr_init, has_threads=true,
-        [
-          # FreeBSD
-          case "${target}" in
-            *-*-freebsd*)
-              LIBS="$SAVE_LIBS -pthread"
-              AC_CHECK_LIB(c_r, pthread_attr_init, has_threads=true, LIBS="$SAVE_LIBS")
-              ;;
-            *)
-              LIBS="$SAVE_LIBS"
-              ;;
-          esac
-        ])
-    ],
-    [
-      # search for pthread library..
-      for dir in `echo "/usr/local /usr/pkg /usr/contrib /usr/pkg/pthreads /usr/local/pthreads"`; do
-        if test x$has_threads = xfalse; then
-          AC_MSG_RESULT(searching in $dir...)
-
-          if test -d $dir/include; then
-            CPPFLAGS="$CPPFLAGS -I$dir/include"
-            CFLAGS="$CFLAGS -I$dir/include"
-          fi
-          if test -d $dir/lib; then
-            LDFLAGS="$LDFLAGS -L$dir/lib"
-          fi
-
-          # XXX
-          unset ac_cv_header__pthread_h_ ac_cv_header_pthread_h || true
-
-          AC_CHECK_HEADERS(pthread.h,
-            [
-              LIBS="$LIBS -lpthread"
-              AC_CHECK_LIB(pthread, pthread_attr_init, has_threads=true,
-                [
-                  has_threads=false
-
-                  LIBS="$SAVE_LIBS"
-                  CFLAGS="$SAVE_CFLAGS"
-                  LDFLAGS="$SAVE_LDFLAGS"
-                  CPPFLAGS="$SAVE_CPPFLAGS"
-                ])
-            ],
-            [
-              CFLAGS="$SAVE_CFLAGS"
-              LDFLAGS="$SAVE_LDFLAGS"
-              CPPFLAGS="$SAVE_CPPFLAGS"
-            ])
-        fi
-      done
-    ])
-else
-  AC_MSG_RESULT(no)
-  has_threads=false
-fi
-
-__SILC_HAVE_PTHREAD=""
-AM_CONDITIONAL(SILC_THREADS, test x$has_threads = xtrue)
-if test x$has_threads = xtrue; then
-  CFLAGS="$CFLAGS -D_REENTRANT"
-
-  # XXX possibly incomplete
-  case "${target}" in
-    *-*-aix*)
-      CFLAGS="$CFLAGS -D_THREAD_SAFE"
-      if test x"$GCC" = xyes; then
-        CFLAGS="$CFLAGS -mthreads"
-      fi
-      ;;
-    *-*-freebsd*)
-      CFLAGS="$CFLAGS -D_THREAD_SAFE"
-      ;;
-    *-*-sysv5uw7*)  # UnixWare 7
-      if test "$GCC" != "yes"; then
-        CFLAGS="$CFLAGS -Kthread"
-      else
-        CFLAGS="$CFLAGS -pthread"
-      fi
-      ;;
-    *-dg-dgux*)  # DG/UX
-      CFLAGS="$CFLAGS -D_POSIX4A_DRAFT10_SOURCE"
-      ;;
-   esac
-
-  # Check for threads
-  AC_CHECK_FUNC(pthread_create)
-
-  # Check for read/write locks
-  AC_CHECK_FUNC(pthread_rwlock_init,
-  [
-    AC_RUN_IFELSE(
-      [
-        #include <pthread.h>
-        int main()
-        {
-          pthread_rwlock_t rwlock;
-          pthread_rwlock_init(&rwlock, NULL);
-          pthread_rwlock_destroy(&rwlock);
-          return 0;
-        }
-      ],
-      [],
-      [
-       # Rwlock not defined
-        CFLAGS="$CFLAGS -D_XOPEN_SOURCE=600"
-      ]
-    )
-  ],
-  [
-    # Rwlock not defined
-    CFLAGS="$CFLAGS -D_XOPEN_SOURCE=600"
-  ])
-
-  AC_DEFINE([SILC_HAVE_PTHREAD], [], [HAVE_PTHREAD])
-  AC_DEFINE([SILC_THREADS], [], [HAVE_THREAD])
-  __SILC_HAVE_PTHREAD="#define __SILC_HAVE_PTHREAD 1"
-fi
-
-#
-# Check for timezone and tm_gmtoff for timezone information
-#
-AC_MSG_CHECKING(whether system has timezone)
-AC_RUN_IFELSE(
-  [
-    #include <stdio.h>
-    #include <time.h>
-    int main()
-    {
-      timezone = 0;
-      return 0;
-    }
-  ],
-  [ AC_MSG_RESULT(yes)
-    AC_DEFINE([HAVE_TIMEZONE], [], [HAVE_TIMEZONE]) ],
-  [ AC_MSG_RESULT(no) ],
-  [ AC_MSG_RESULT(no) ]
-)
-AC_MSG_CHECKING(whether system has tm_gmtoff)
-AC_RUN_IFELSE(
-  [
-    #include <stdio.h>
-    #include <time.h>
-    int main()
-    {
-      struct tm tm;
-      tm.tm_gmtoff = 0;
-      return 0;
-    }
-  ],
-  [ AC_MSG_RESULT(yes)
-    AC_DEFINE([HAVE_TM_GMTOFF], [], [HAVE_TM_GMTOFF]) ],
-  [ AC_MSG_RESULT(no) ],
-  [ AC_MSG_RESULT(no) ]
-)
-AC_MSG_CHECKING(whether system has __tm_gmtoff)
-AC_RUN_IFELSE(
-  [
-    #include <stdio.h>
-    #include <time.h>
-    int main()
-    {
-      struct tm tm;
-      tm.__tm_gmtoff = 0;
-      return 0;
-    }
-  ],
-  [ AC_MSG_RESULT(yes)
-    AC_DEFINE([HAVE___TM_GMTOFF], [], [HAVE___TM_GMTOFF]) ],
-  [ AC_MSG_RESULT(no) ],
-  [ AC_MSG_RESULT(no) ]
-)
-AC_MSG_CHECKING(whether system has __tm_gmtoff__)
-AC_RUN_IFELSE(
-  [
-    #include <stdio.h>
-    #include <time.h>
-    int main()
-    {
-      struct tm tm;
-      tm.__tm_gmtoff__ = 0;
-      return 0;
-    }
-  ],
-  [ AC_MSG_RESULT(yes)
-    AC_DEFINE([HAVE___TM_GMTOFF__], [], [HAVE___TM_GMTOFF__]) ],
-  [ AC_MSG_RESULT(no) ],
-  [ AC_MSG_RESULT(no) ]
-)
 
-# Native WIN32 compilation under cygwin
-#
+##
+## 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)],
@@ -1291,17 +741,6 @@ AC_ARG_WITH(win32,
   ])
 AM_CONDITIONAL(SILC_WIN32, test x$win32_support = xtrue)
 
-# Native Symbian OS support (disabled by default)
-#
-AM_CONDITIONAL(SILC_SYMBIAN, test xfalse = xtrue)
-
-# Native BeOS support (disabled by default)
-#
-AM_CONDITIONAL(SILC_BEOS, test xfalse = xtrue)
-
-# Native OS2 support (disabled by default)
-#
-AM_CONDITIONAL(SILC_OS2, test xfalse = xtrue)
 
 #ifdef SILC_DIST_SERVER
 without_silcd=false
@@ -1314,62 +753,49 @@ without_irssi=false
 without_silcd=false
 #endif SILC_DIST_INPLACE
 
-libtoolfix=true
-AC_MSG_CHECKING(whether to do libtoolfix)
-AC_ARG_WITH(libtoolfix,
-  [  --without-libtoolfix    Do not fix libtool, for package builders],
-  [
-    AC_MSG_RESULT(no)
-    libtoolfix=false
-  ],
-  [
-    AC_MSG_RESULT(yes)
-  ])
-
-AC_SUBST(ETCDIR)
-AC_DEFINE_UNQUOTED([SILC_ETCDIR], "$ETCDIR", [SILC_ETCDIR])
-#endif SILC_DIST_COMPILER
 
 ##
-##  Misc
+## Include configure fragments
 ##
+AD_INCLUDE_CONFIGURE
 
-# Make enable-shared aware
-AM_CONDITIONAL(SILC_ENABLE_SHARED, test "$enable_shared" = yes)
-
-SILC_TOP_SRCDIR=`pwd`
 
-# Included configure scripts
-AD_INCLUDE_CONFIGURE
+##
+## Outputs and substitutions
+##
 
-#ifdef SILC_DIST_COMPILER
-#
-# Substitutions
-#
 AC_SUBST(LIBSUBDIR)
 AC_SUBST(SILC_TOP_SRCDIR)
 AC_SUBST(LDFLAGS)
 AC_SUBST(LIBS)
 AC_SUBST(SILC_LIB_INCLUDES)
-AC_SUBST(__SILC_HAVE_PTHREAD)
-AC_SUBST(__SILC_HAVE_SIM)
-AC_SUBST(__SILC_ENABLE_DEBUG)
 AC_SUBST(__SILC_PACKAGE_VERSION)
 
-#
-# Fix the libtool to support run-time configuration.  This allows us
-# to in run-time specify when to compile shared/static libraries without
-# need to reconfigure the entire libtool.
-#
-if test x$libtoolfix = xtrue; then
-  ./libtoolfix $SILC_TOP_SRCDIR/ltmain.sh
-fi
-AM_CONDITIONAL(SILC_LIBTOOLFIX, test x$libtoolfix = xtrue)
+AC_SUBST(ETCDIR)
+AC_DEFINE_UNQUOTED([SILC_ETCDIR], "$ETCDIR", [SILC_ETCDIR])
+
+#ifndef SILC_DIST_AUTODIST
+ETCDIR=`eval echo $sysconfdir`;ETCDIR=`eval echo $ETCDIR`
+AC_SUBST(ETCDIR)
+AC_DEFINE_UNQUOTED([SILC_ETCDIR], "$ETCDIR", [SILC_ETCDIR])
+
+DOCDIR=`eval echo $docdir`;DOCDIR=`eval echo $DOCDIR`
+AC_SUBST(DOCDIR)
+AC_DEFINE_UNQUOTED([SILC_DOCDIR], "$DOCDIR", [SILC_DOCDIR])
+#endif SILC_DIST_AUTODIST
+
+# Native Symbian OS support (disabled by default)
+AM_CONDITIONAL(SILC_SYMBIAN, test xfalse = xtrue)
+
+# Make enable-shared aware
+AM_CONDITIONAL(SILC_ENABLE_SHARED, test "$enable_shared" = yes)
 
 INCLUDE_DEFINES_INT="include \$(top_srcdir)/Makefile.defines_int"
 AC_SUBST(INCLUDE_DEFINES_INT)
 
-#endif SILC_DIST_COMPILER
+DATE=`date`
+AC_SUBST(DATE)
+
 
 #
 # Makefile outputs
@@ -1379,13 +805,11 @@ Makefile
 #ifdef SILC_DIST_DOC
 doc/Makefile
 #endif SILC_DIST_DOC
-#ifdef SILC_DIST_COMPILER
 Makefile.defines
 Makefile.defines_int
 includes/Makefile
 includes/silcversion.h
 includes/silc.h
-#endif SILC_DIST_COMPILER
 #ifdef SILC_DIST_APPS
 apps/Makefile
 #endif SILC_DIST_APPS
@@ -1402,9 +826,51 @@ tutorial/Makefile.defines_int
 )
 #endif SILC_DIST_TOOLKIT
 
+if test x$compile_libs = xtrue; then
+
+AC_CONFIG_FILES(
+lib/Makefile
+lib/silccore/Makefile
+lib/silcske/Makefile
+lib/silcapputil/Makefile
+#ifdef SILC_DIST_SFTP
+lib/silcsftp/Makefile
+lib/silcsftp/tests/Makefile
+#endif SILC_DIST_SFTP
+)
+
+#ifdef SILC_DIST_TOOLKIT
+AC_CONFIG_FILES(
+lib/silc.pc
+lib/silcclient.pc
+lib/silcserver.pc
+)
+#endif SILC_DIST_TOOLKIT
+
+#ifdef SILC_DIST_CLIENTLIB
+AC_CONFIG_FILES(
+lib/silcclient/Makefile
+lib/silcclient/tests/Makefile
+)
+#endif SILC_DIST_CLIENTLIB
+
+#ifdef SILC_DIST_SERVERLIB
+AC_CONFIG_FILES(
+lib/silcserver/Makefile
+lib/silcserver/tests/Makefile
+)
+#endif SILC_DIST_SERVERLIB
+
+#ifdef SILC_DIST_VCARD
+AC_CONFIG_FILES(
+lib/silcvcard/Makefile
+)
+#endif SILC_DIST_VCARD
+
+fi     # compile_libs
+
 AC_OUTPUT
 
-#ifdef SILC_DIST_COMPILER
 s_bindir=`eval echo $bindir`;s_bindir=`eval echo $s_bindir`
 s_sbindir=`eval echo $sbindir`;s_sbindir=`eval echo $s_sbindir`
 s_mandir=`eval echo $mandir`;s_mandir=`eval echo $s_mandir`
@@ -1425,9 +891,6 @@ echo " sbin directory ................: $s_sbindir"
 echo " etc directory .................: $ETCDIR"
 echo " man directory .................: $s_mandir"
 echo " doc directory .................: $DOCDIR"
-#ifdef SILC_DIST_SIM
-echo " SIM directory .................: $MODULESDIR"
-#endif SILC_DIST_SIM
 #ifdef SILC_DIST_INCLUDES
 echo " include directory .............: $s_includedir"
 #endif SILC_DIST_INCLUDES
@@ -1447,43 +910,6 @@ fi
 echo " Compile SILC Server ...........: $silcd"
 #endif SILC_DIST_SERVER
 
-#ifdef SILC_DIST_SIM
-if test x$sim_support = xfalse; then
-  sim_support="no"
-else
-  sim_support="yes"
-fi
-echo " SIM support ...................: $sim_support"
-#endif SILC_DIST_SIM
-
-echo " IPv6 support ..................: $summary_ipv6"
-
-if test x$has_iconv = xfalse; then
-  iconv_support="no"
-else
-  iconv_support="yes"
-fi
-echo " Iconv support .................: $iconv_support"
-
-if test x$want_asm = xfalse; then
-  summary_asm="no"
-else
-  summary_asm="yes"
-fi
-echo " Assembler optimizations .......: $summary_asm"
-
-#ifdef SILC_DIST_MATH
-if test x$mp_gmp = xtrue; then
-  echo " Arithmetic library ............: GMP"
-fi
-#endif SILC_DIST_MATH
-
-threads="no"
-if test x$has_threads = xtrue; then
-  threads="yes"
-fi
-echo " Multi-threads support .........: $threads"
 echo " Debugging enabled .............: $summary_debug"
 echo ""
 echo "Compile the sources with 'make' or 'gmake' command."
-#endif SILC_DIST_COMPILER
diff --git a/distdir/autodist b/distdir/autodist
deleted file mode 100644 (file)
index 475a3f6..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-name SILC Autodist
-package autodist
-bug-report autodist-bugs@silcnet.org
-prereq 1.3.2
-
-license apps/autodist/COPYING
-license-header distdir/GPL-header distdir/BSD-header
-
-define SILC_DIST_AUTODIST
-define SILC_DIST_APPS
-
-include apps/autodist/INSTALL INSTALL
-include apps/autodist/AUTHORS AUTHORS
-include apps/autodist/README README
-include apps/autodist/TODO TODO
-include apps/autodist/CHANGES CHANGES
-exclude apps/autodist/INSTALL apps/autodist/AUTHORS apps/autodist/README
-exclude apps/autodist/TODO apps/autodist/CHANGES
-exclude README.* ltmain.sh
-
-noprocess apps/autodist/doc/* apps/autodist/tests/*
-
-post-process-dist-hook distdir/autodist-post-process-dist
-post-dist-hook distdir/post-dist
diff --git a/distdir/autodist-post-process-dist b/distdir/autodist-post-process-dist
deleted file mode 100644 (file)
index 768ce02..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-#!/bin/sh
-
-distribution=$1
-dist_version=$2
-package=$3
-distdir=$4
-
-# Remove all CVS directories, as some may be left when we put directories
-# in EXTRA_DIST or 'include' them in distribution.
-
-if test -d $distdir; then
-  rm -rf `find $distdir -name CVS`
-  rm -rf `find $distdir -name Makefile`
-fi
-
-release=$5
-if test -z $release; then
-  release="0.fc7"
-fi
-
-sed -e "s/AUTODIST_VERSION/$dist_version/" -e "s/AUTODIST_RELEASE/$release/" \
-  apps/autodist/autodist.spec.in > $distdir/autodist.spec
-
index 22cc82ba5fb2f7d36b8724ec16791975255ef021..207e228c784f8576480871155a87802065a7d46b 100644 (file)
@@ -21,7 +21,7 @@ DISTDEFS="includes/silcdistdefs.h"
 # Location of the aclocal tool.  If this is omitted the Autodist will not
 # run aclocal.  User need to run it manually then.
 #
-ACLOCAL="aclocal"
+ACLOCAL="aclocal -I ."
 
 # Location of the autoheader tool.  If this is omitted the Autodist will not
 # run autoheader.  User need to run it manually then.
index 100936f9fec534a3a9da503a743dc66b919cffa0..ab01083a4f470c6bd564f2cbcbe560e64be718b6 100644 (file)
@@ -7,17 +7,4 @@ define SILC_DIST_INCLUDES
 define SILC_DIST_DOC
 define SILC_DIST_SFTP
 define SILC_DIST_COMPILER
-define SILC_DIST_IDCACHE
 define SILC_DIST_VCARD
-define SILC_DIST_CRYPTO
-
-# Math library, define only TMA or TFM, not both.
-define SILC_DIST_MATH
-define SILC_DIST_TMA
-#define SILC_DIST_TFM
-
-# ASN.1 library
-define SILC_DIST_ASN1
-
-# Key Repository library
-define SILC_DIST_SKR
index 9479c050405083e00242d364ee740badb257219a..3eef2b73b5cce44d48227c13e3bebb38620741a8 100644 (file)
@@ -14,7 +14,6 @@ inherit server
 inherit toolkit
 
 define SILC_DIST_INPLACE
-define SILC_DIST_SIM
 
 # SFTP and VCARD is undefined in server, so force it here
 define SILC_DIST_SFTP
index 793321e18a9c564a64d85e1dfd7a7b6abc064119..a35f758731bfc16ebf9c565da11763c0756d7f47 100644 (file)
@@ -4,7 +4,6 @@ bug-report silc-devel@lists.silcnet.org
 
 inherit common
 define SILC_DIST_SERVER
-define SILC_DIST_HTTP
 undef SILC_DIST_SFTP
 undef SILC_DIST_VCARD
 
index 1bd9205146a9b6594ded93ef9441ab59dc996ce5..3e379889d85c6a3a74a2d6e795a75e29759c6054 100644 (file)
@@ -8,7 +8,6 @@ define SILC_DIST_CLIENTLIB
 define SILC_DIST_APPS
 undef SILC_DIST_LIB
 undef SILC_DIST_DOC
-undef SILC_DIST_SIM
 undef SILC_DIST_MATH
 undef SILC_DIST_MPI
 
index 9d32fc2980d9d1108b7cfa6f7fee4ceb34acd9ec..cb054865e255032ba03d8fd1ad4074f30a9a72dc 100644 (file)
@@ -15,8 +15,6 @@ license-header distdir/GPL-header distdir/TOOLKIT-header
 # Distdefs
 define SILC_DIST_TOOLKIT
 define SILC_DIST_CLIENTLIB
-define SILC_DIST_HTTP
-define SILC_DIST_SIM
 
 # Includes
 include README.CVS
diff --git a/doc/.cvsignore b/doc/.cvsignore
deleted file mode 100644 (file)
index 3a6da56..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-Makefile
-Makefile.in
-Makefile.am
-example_silcd.conf
-*.txt
diff --git a/includes/.cvsignore b/includes/.cvsignore
deleted file mode 100644 (file)
index 282522d..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-Makefile
-Makefile.in
index 2efe2285ce92ad418fa31f09ae651895da7aee71..b4a65f679f7528980222385102afec224c8ab6df 100644 (file)
@@ -4,7 +4,7 @@
 
   Author: Pekka Riikonen <priikone@silcnet.org>
 
-  Copyright (C) 1997 - 2007 Pekka Riikonen
+  Copyright (C) 1997 - 2008 Pekka Riikonen
 
   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
   by all files in SILC (directly or through other global include file).
 */
 
-#ifndef SILCINCLUDES_H
-#define SILCINCLUDES_H
+#ifndef SILC_H
+#define SILC_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.
+   Example:
 
-#define SILC_UNIX
-
-#ifdef WIN32
-#ifndef SILC_WIN32
-#define SILC_WIN32
-#undef SILC_UNIX
-#endif
-#endif
+   #if __SILC_TOOLKIT_VERSION < SILC_VERSION(1,2,0)
+     ...
+   #endif
+*/
+#ifndef SILC_VERSION
+#define SILC_VERSION(a, b, c) (((a) << 24) + ((b) << 16) + ((c) << 8)
+#endif /* !SILC_VERSION */
 
-#if defined(__EPOC32__) || defined(__SYMBIAN32__)
-#ifndef SILC_SYMBIAN
-#define SILC_SYMBIAN
-#undef SILC_UNIX
-#undef SILC_WIN32
-#endif
-#endif
+/* SILC Crypto Toolkit version */
+@__SILC_PACKAGE_VERSION@
 
-#if defined(__MACH__) && defined(__APPLE__)
-#ifndef SILC_MACOSX
-#define SILC_MACOSX
-#undef SILC_WIN32
-#undef SILC_SYMBIAN
-#endif
+#ifdef __cplusplus
+extern "C" {
 #endif
 
-/* Types */
-#define SILC_SIZEOF_LONG_LONG @SILC_SIZEOF_LONG_LONG@
-#define SILC_SIZEOF_LONG @SILC_SIZEOF_LONG@
-#define SILC_SIZEOF_INT @SILC_SIZEOF_INT@
-#define SILC_SIZEOF_SHORT @SILC_SIZEOF_SHORT@
-#define SILC_SIZEOF_CHAR @SILC_SIZEOF_CHAR@
-#define SILC_SIZEOF_VOID_P @SILC_SIZEOF_VOID_P@
-
-/* Compilation time defines, for third-party software */
-@__SILC_HAVE_PTHREAD@
-@__SILC_HAVE_SIM@
-@__SILC_ENABLE_DEBUG@
+/* We except all systems to have these include files */
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
 
 #if defined(HAVE_SILCDEFS_H)
-/* Automatically generated configuration header */
+/* Automatically generated configuration header.  These are included only
+   when the SILC Toolkit itself is compiled. */
 #ifndef SILC_SYMBIAN
 #include "silcdefs.h"
 #else
-#include "../symbian/silcdefs.h"
+#include "../../symbian/silcdefs.h"
 #endif /* SILC_SYMBIAN */
 #include "silcdistdefs.h"
-#endif /* HAVE_SILCDEFS_H */
-
-/* Platform specific includes */
-
-#if defined(SILC_WIN32)
-#include "silcwin32.h"
-#endif
-
-#if defined(SILC_SYMBIAN)
-#include "silcsymbian.h"
-#endif
-
-#ifndef DLLAPI
-#define DLLAPI
-#endif
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <stdarg.h>
-#include <ctype.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <time.h>
-
-#ifdef HAVE_SIGNAL_H
-#include <signal.h>
-#endif
-
-#ifdef HAVE_FCNTL_H
-#include <fcntl.h>
-#endif
+#include "silccompile.h"
+#endif /* HAVE_CRYPTODEFS_H */
 
-#ifdef HAVE_ERRNO_H
-#include <errno.h>
-#endif
-
-#ifdef HAVE_ASSERT_H
-#include <assert.h>
-#endif
+/* SRT and SCT include */
+#include <silcruntime.h>
+#include <silccrypto.h>
 
-#if !defined(SILC_WIN32)
-
-#include <unistd.h>
-#include <sys/time.h>
-#include <pwd.h>
-#include <sys/times.h>
-
-#ifdef HAVE_GRP_H
-#include <grp.h>
-#endif
-
-#if defined(HAVE_GETOPT_H) && defined(HAVE_GETOPT)
-#include <getopt.h>
-#else
-#if defined(HAVE_SILCDEFS_H)
-#include "getopti.h"
-#endif /* HAVE_SILCDEFS_H */
-#endif
-
-#ifdef SOCKS5
-#include "socks.h"
-#endif
-
-#include <sys/socket.h>
-#ifdef HAVE_NETINET_IN_H
-#include <netinet/in.h>
-#endif
-
-#ifdef HAVE_XTI_H
-#include <xti.h>
-#else
-#ifdef HAVE_NETINET_TCP_H
-#include <netinet/tcp.h>
-#endif
-#endif
-
-#ifdef HAVE_NETDB_H
-#include <netdb.h>
-#endif
-
-#ifdef HAVE_ARPA_INET_H
-#include <arpa/inet.h>
-#endif
-
-#ifdef HAVE_SYS_MMAN_H
-#include <sys/mman.h>
-#endif
-
-#ifdef HAVE_DLFCN_H
-#include <dlfcn.h>
-#endif
-
-#ifdef HAVE_LIMITS_H
-#include <limits.h>
-#endif
-
-#ifndef HAVE_REGEX_H
-#if defined(HAVE_SILCDEFS_H)
-#include "regexpr.h"
-#endif /* HAVE_SILCDEFS_H */
-#else
-#include <regex.h>
-#endif
-
-#ifdef SILC_HAVE_PTHREAD
-#include <pthread.h>
-#endif
-
-#ifdef HAVE_STDDEF_H
-#include <stddef.h>
-#endif
-
-#ifdef HAVE_TERMIOS_H
-#include <termios.h>
-#endif
-
-#ifdef HAVE_UTIME_H
-#include <utime.h>
-#endif
-
-#ifdef HAVE_ICONV_H
-#include <iconv.h>
-#endif
-
-#ifdef HAVE_LOCALE_H
-#include <locale.h>
-#endif
-
-#ifdef HAVE_LANGINFO_H
-#include <langinfo.h>
-#endif
-
-#ifdef HAVE_SYS_RESOURCE_H
-#include <sys/resource.h>
-#endif
-
-#endif                         /* !SILC_WIN32 */
-
-/* Include generic SILC type definitions */
-#include "silctypes.h"
-#include "silcmutex.h"
-#include "silcatomic.h"
-#include "silcversion.h"
-
-/* SILC util library includes */
-#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 "silccond.h"
-#include "silcthread.h"
-#include "silcschedule.h"
-#include "silclog.h"
-#include "silcbuffer.h"
-#include "silcbuffmt.h"
-
-/* Crypto library includes */
-#include "silccipher.h"
-#include "silchash.h"
-#include "silchmac.h"
-#include "silcrng.h"
-#include "silcpkcs.h"
-#include "silcpk.h"
-#include "silcpkcs1.h"
-
-/* More SILC util library includes */
-#include "silchashtable.h"
-#include "silclist.h"
-#include "silcdlist.h"
-#include "silcasync.h"
-#include "silcstream.h"
-#include "silcnet.h"
-#include "silcfileutil.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"
+#include <silcversion.h>
 
 #ifdef SILC_DIST_VCARD
-#include "silcvcard.h"
+#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"
+#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
+#include <silcapputil.h>
+#include <silcidcache.h>
 
 /* SILC Key Exchange library includes */
-#include "silcske.h"
-#include "silcske_payload.h"
-#include "silcske_groups.h"
-#include "silcconnauth.h"
+#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"
+#include <silcsftp.h>
+#include <silcsftp_fs.h>
 #endif /* SILC_DIST_SFTP */
 
 #ifdef SILC_DIST_HTTP
 /* SILC HTTP library */
-#include "silchttpserver.h"
-#include "silchttpphp.h"
+#include <silchttpserver.h>
+#include <silchttpphp.h>
 #endif /* SILC_DIST_HTTP */
 
 #ifdef __cplusplus
 }
 #endif
 
-#endif /* SILCINCLUDES_H */
+#endif /* SILC_H */
diff --git a/includes/silccompile.h b/includes/silccompile.h
new file mode 100644 (file)
index 0000000..9cd0378
--- /dev/null
@@ -0,0 +1,131 @@
+/*
+
+  silccompile.h
+
+  Author: Pekka Riikonen <priikone@silcnet.org>
+
+  Copyright (C) 2008 Pekka Riikonen
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+
+*/
+
+#ifndef SILCCOMPILE_H
+#define SILCCOMPILE_H
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <stdarg.h>
+#include <ctype.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <time.h>
+#include <dirent.h>
+
+#ifdef HAVE_SIGNAL_H
+#include <signal.h>
+#endif
+
+#ifdef HAVE_FCNTL_H
+#include <fcntl.h>
+#endif
+
+#ifdef HAVE_ERRNO_H
+#include <errno.h>
+#endif
+
+#ifdef HAVE_ASSERT_H
+#include <assert.h>
+#endif
+
+#if !defined(SILC_WIN32)
+
+#include <unistd.h>
+#include <sys/time.h>
+#include <pwd.h>
+#include <sys/times.h>
+
+#ifdef HAVE_GRP_H
+#include <grp.h>
+#endif
+
+#ifdef SOCKS5
+#include "socks.h"
+#endif
+
+#include <sys/socket.h>
+#ifdef HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+
+#ifdef HAVE_XTI_H
+#include <xti.h>
+#else
+#ifdef HAVE_NETINET_TCP_H
+#include <netinet/tcp.h>
+#endif
+#endif
+
+#ifdef HAVE_NETDB_H
+#include <netdb.h>
+#endif
+
+#ifdef HAVE_ARPA_INET_H
+#include <arpa/inet.h>
+#endif
+
+#ifdef HAVE_SYS_MMAN_H
+#include <sys/mman.h>
+#endif
+
+#ifdef HAVE_DLFCN_H
+#include <dlfcn.h>
+#endif
+
+#ifdef HAVE_LIMITS_H
+#include <limits.h>
+#endif
+
+#ifdef SILC_HAVE_PTHREAD
+#include <pthread.h>
+#endif
+
+#ifdef HAVE_STDDEF_H
+#include <stddef.h>
+#endif
+
+#ifdef HAVE_TERMIOS_H
+#include <termios.h>
+#endif
+
+#ifdef HAVE_UTIME_H
+#include <utime.h>
+#endif
+
+#ifdef HAVE_ICONV_H
+#include <iconv.h>
+#endif
+
+#ifdef HAVE_LOCALE_H
+#include <locale.h>
+#endif
+
+#ifdef HAVE_LANGINFO_H
+#include <langinfo.h>
+#endif
+
+#ifdef HAVE_SYS_RESOURCE_H
+#include <sys/resource.h>
+#endif
+
+#endif /* !SILC_WIN32 */
+
+#endif /* SILCCOMPILE_H */
index e542f9e622ef007db57c83bad247d51099dda364..280f04bc727b6feca16d153558e7841216b88850 100644 (file)
@@ -4,7 +4,7 @@
 
   Author: Pekka Riikonen <priikone@silcnet.org>
 
-  Copyright (C) 1997 - 2007 Pekka Riikonen
+  Copyright (C) 1997 - 2008 Pekka Riikonen
 
   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
@@ -26,7 +26,9 @@ extern "C" {
 
 /* 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))
+#ifndef SILC_VERSION
+#define SILC_VERSION(a, b, c) (((a) << 24) + ((b) << 16) + ((c) << 8)
+#endif /* !SILC_VERSION */
 @__SILC_PACKAGE_VERSION@
 
 #define SILC_VERSION_STRING "@VERSION@"
index 41af979413ff5efae53f5d38b2e5e5743e751fee..79430bd990cd8a0b0b06403f58b8baa55e281c3d 100644 (file)
@@ -4,7 +4,7 @@
 
   Author: Pekka Riikonen <priikone@silcnet.org>
 
-  Copyright (C) 2001 - 2003 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
@@ -31,8 +31,8 @@
 #include "regexpr.h"
 #endif /* HAVE_SILCDEFS_H */
 
-#define snprintf _snprintf
-#define vsnprintf _vsnprintf
+#define snprintf silc_snprintf
+#define vsnprintf silc_vsnprintf
 
 #ifdef WIN32
 #define strcasecmp stricmp
diff --git a/lib/.cvsignore b/lib/.cvsignore
deleted file mode 100644 (file)
index a324157..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-Makefile
-Makefile.in
-Makefile.am
index df6fa0a530dfe4d68d04638383dbf5a42ccfc012..9312320c993b48e7c9f6d1c037212257b45f269f 100644 (file)
@@ -3,7 +3,7 @@
 #
 #  Author: Pekka Riikonen <priikone@silcnet.org>
 #
-#  Copyright (C) 2000 - 2005, 2007 Pekka Riikonen
+#  Copyright (C) 2000 - 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
@@ -19,29 +19,9 @@ AUTOMAKE_OPTIONS = 1.0 no-dependencies foreign
 
 # SILC Library dirs
 SILCLIB_DIRS =                 \
-       contrib         \
        silccore        \
-       silcutil        \
        silcapputil     \
-#ifdef SILC_DIST_CRYPTO
-       silccrypt       \
-#endif SILC_DIST_CRYPTO
-#ifdef SILC_DIST_SKR
-       silcskr         \
-#endif SILC_DIST_SKR
-#ifdef SILC_DIST_MATH
-       silcmath        \
-#endif SILC_DIST_MATH
-#ifdef SILC_DIST_SIM
-       silcsim         \
-#endif SILC_DIST_SIM
-#ifdef SILC_DIST_ASN1
-       silcasn1        \
-#endif SILC_DIST_ASN1
        silcske         \
-#ifdef SILC_DIST_HTTP
-       silchttp        \
-#endif SILC_DIST_HTTP
 #ifdef SILC_DIST_SFTP
        silcsftp        \
 #endif SILC_DIST_SFTP
diff --git a/lib/configure.ad b/lib/configure.ad
deleted file mode 100644 (file)
index 9ff9f49..0000000
+++ /dev/null
@@ -1,313 +0,0 @@
-#ifdef SILC_DIST_LIB
-#
-#  lib/configure.ad
-#
-#  Author: Pekka Riikonen <priikone@silcnet.org>
-#
-#  Copyright (C) 2005, 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.
-#
-
-if test x$compile_libs = xtrue; then
-
-##
-## Will compile included libs
-##
-AC_MSG_NOTICE([Configuring SILC libraries])
-
-# SILC Library directories
-SILC_LIB_INCLUDES="$SILC_LIB_INCLUDES -I$SILC_TOP_SRCDIR/lib/contrib"
-SILC_LIB_INCLUDES="$SILC_LIB_INCLUDES -I$SILC_TOP_SRCDIR/lib/silccore"
-#ifdef SILC_DIST_CRYPTO
-SILC_LIB_INCLUDES="$SILC_LIB_INCLUDES -I$SILC_TOP_SRCDIR/lib/silccrypt"
-#endif SILC_DIST_CRYPTO
-#ifdef SILC_DIST_MATH
-SILC_LIB_INCLUDES="$SILC_LIB_INCLUDES -I$SILC_TOP_SRCDIR/lib/silcmath"
-#endif SILC_DIST_MATH
-SILC_LIB_INCLUDES="$SILC_LIB_INCLUDES -I$SILC_TOP_SRCDIR/lib/silcutil"
-SILC_LIB_INCLUDES="$SILC_LIB_INCLUDES -I$SILC_TOP_SRCDIR/lib/silcapputil"
-SILC_LIB_INCLUDES="$SILC_LIB_INCLUDES -I$SILC_TOP_SRCDIR/lib/silcske"
-#ifdef SILC_DIST_SFTP
-SILC_LIB_INCLUDES="$SILC_LIB_INCLUDES -I$SILC_TOP_SRCDIR/lib/silcsftp"
-#endif SILC_DIST_SFTP
-#ifdef SILC_DIST_SIM
-SILC_LIB_INCLUDES="$SILC_LIB_INCLUDES -I$SILC_TOP_SRCDIR/lib/silcsim"
-#endif SILC_DIST_SIM
-#ifdef SILC_DIST_CLIENTLIB
-SILC_LIB_INCLUDES="$SILC_LIB_INCLUDES -I$SILC_TOP_SRCDIR/lib/silcclient"
-#endif SILC_DIST_CLIENTLIB
-#ifdef SILC_DIST_ASN1
-SILC_LIB_INCLUDES="$SILC_LIB_INCLUDES -I$SILC_TOP_SRCDIR/lib/silcasn1"
-#endif SILC_DIST_ASN1
-#ifdef SILC_DIST_SKR
-SILC_LIB_INCLUDES="$SILC_LIB_INCLUDES -I$SILC_TOP_SRCDIR/lib/silcskr"
-#endif SILC_DIST_SKR
-#ifdef SILC_DIST_SERVERLIB
-SILC_LIB_INCLUDES="$SILC_LIB_INCLUDES -I$SILC_TOP_SRCDIR/lib/silcserver"
-#endif SILC_DIST_SERVERLIB
-#ifdef SILC_DIST_HTTP
-SILC_LIB_INCLUDES="$SILC_LIB_INCLUDES -I$SILC_TOP_SRCDIR/lib/silchttp"
-#endif SILC_DIST_HTTP
-#ifdef SILC_DIST_VCARD
-SILC_LIB_INCLUDES="$SILC_LIB_INCLUDES -I$SILC_TOP_SRCDIR/lib/silcvcard"
-#endif SILC_DIST_VCARD
-
-##
-## Library versioning.
-##
-# Do the releases and library versioning according to following rules:
-#
-#  - If any code has changed in library, increment [LIB]_REVISION
-#  - If functions were added, removed or changed, set [LIB]_REVISION to 0
-#  - If functions were added, removed or changed, increment [LIB]_CURRENT
-#  - If functions were added, increment [LIB]_AGE
-#  - If functions were removed, set [LIB]_AGE to 0
-#
-# where [LIB] is LIBSILC, LIBSILCCLIENT or LIBSILCSERVER, and where
-# "functions" means functions public interfaces (API).
-#
-# The LIB_BASE_VERSION defines the SILC software major.minor version and
-# it is increment only when these version numbers actually change.
-#
-
-# Base version for libraries.  Do not change this unless SILC version
-# changes too.
-LIB_BASE_VERSION=1.1
-
-# libsilc versions
-LIBSILC_CURRENT=3              # prev = 2
-LIBSILC_REVISION=0             # prev = 1
-LIBSILC_AGE=1                  # prev = 1
-
-# libsilcclient versions
-LIBSILCCLIENT_CURRENT=2                # prev = 1
-LIBSILCCLIENT_REVISION=1       # prev = 1
-LIBSILCCLIENT_AGE=0            # prev = 0
-
-# libsilcserver versions
-LIBSILCSERVER_CURRENT=1                # prev = 0
-LIBSILCSERVER_REVISION=0       # prev = 0
-LIBSILCSERVER_AGE=0            # prev = 0
-
-# Substitute the version numbers
-AC_SUBST(LIB_BASE_VERSION)
-AC_SUBST(LIBSILC_CURRENT)
-AC_SUBST(LIBSILC_REVISION)
-AC_SUBST(LIBSILC_AGE)
-AC_SUBST(LIBSILCCLIENT_CURRENT)
-AC_SUBST(LIBSILCCLIENT_REVISION)
-AC_SUBST(LIBSILCCLIENT_AGE)
-AC_SUBST(LIBSILCSERVER_CURRENT)
-AC_SUBST(LIBSILCSERVER_REVISION)
-AC_SUBST(LIBSILCSERVER_AGE)
-
-# Check for big-endian machines
-AC_C_BIGENDIAN
-
-# Check for epoll_wait and verify that epoll_create works
-AC_CHECK_FUNC(epoll_wait,
-  [
-    AC_RUN_IFELSE(
-      [
-        #include <sys/epoll.h>
-        int main()
-        {
-          int ret = epoll_create(5);
-          if (ret < 0)
-            return 1;
-          close(ret);
-          return 0;
-        }
-      ],
-      [
-        AC_DEFINE([HAVE_EPOLL_WAIT], [1], [HAVE_EPOLL_WAIT])
-      ],
-    )
-  ])
-
-MODULESDIR="$silc_prefix/lib/modules"
-#ifdef SILC_DIST_SIM
-# SIM modules directory
-#
-AC_ARG_WITH(simdir,
-  [[  --with-simdir=DIR       directory for SIM modules [PREFIX/modules]]],
-  [
-    case "$withval" in
-      no|yes)
-        ;;
-      *)
-        MODULESDIR="$withval"
-        ;;
-    esac
-  ])
-AC_DEFINE_UNQUOTED([SILC_MODULESDIR], "$MODULESDIR", [SILC_MODULESDIR])
-#endif SILC_DIST_SIM
-AC_SUBST(MODULESDIR)
-
-#ifdef SILC_DIST_TOOLKIT
-# Stack trace checking
-#
-AC_MSG_CHECKING(whether to enable stack tracing)
-AC_ARG_ENABLE(stack-trace,
-  [  --enable-stack-trace    enable memory stack trace],
-  [
-    case "${enableval}" in
-    yes)
-      AC_MSG_RESULT(yes)
-      AC_DEFINE([SILC_STACKTRACE], [], [SILC_STACKTRACE])
-      ;;
-    *)
-      AC_MSG_RESULT(no)
-      ;;
-    esac
-  ],
-    AC_MSG_RESULT(no)
-  )
-#endif SILC_DIST_TOOLKIT
-
-#ifdef SILC_DIST_INPLACE
-#
-# Profiling options (never delivered to distributions)
-#
-AC_MSG_CHECKING(whether to enable gprof)
-AC_ARG_ENABLE(gprof,
-  [  --enable-gprof          enable gprof profiling],
-  [
-    case "${enableval}" in
-      yes)
-        AC_MSG_RESULT(yes)
-        SILC_ADD_CFLAGS(-pg)
-        LIBS="$LIBS -pg"
-        ;;
-      *)
-        AC_MSG_RESULT(no)
-        ;;
-    esac
-  ],
-  [
-    AC_MSG_RESULT(no)
-  ])
-
-AC_MSG_CHECKING(whether to enable gcov)
-AC_ARG_ENABLE(gcov,
-  [  --enable-gcov           enable gcov],
-  [
-    case "${enableval}" in
-      yes)
-        AC_MSG_RESULT(yes)
-        SILC_ADD_CFLAGS(-fprofile-arcs)
-        LIBS="$LIBS -lgcov"
-        ;;
-      *)
-        AC_MSG_RESULT(no)
-        ;;
-    esac
-  ],
-  [
-    AC_MSG_RESULT(no)
-  ])
-#endif SILC_DIST_INPLACE
-
-#
-# Makefile outputs
-#
-AC_CONFIG_FILES(
-lib/Makefile
-lib/contrib/Makefile
-lib/silccore/Makefile
-#ifdef SILC_DIST_SIM
-lib/silcsim/Makefile
-#endif SILC_DIST_SIM
-lib/silcske/Makefile
-lib/silcutil/Makefile
-#ifdef SILC_DIST_TOOLKIT
-lib/silcutil/unix/Makefile
-lib/silcutil/win32/Makefile
-lib/silcutil/symbian/Makefile
-#else !SILC_DIST_TOOLKIT
-#ifdef SILC_DIST_CLIENT
-lib/silcutil/unix/Makefile
-lib/silcutil/win32/Makefile
-#else !SILC_DIST_CLIENT
-#ifdef SILC_DIST_SERVER
-lib/silcutil/unix/Makefile
-#endif SILC_DIST_SERVER
-#endif SILC_DIST_CLIENT
-#endif SILC_DIST_TOOLKIT
-lib/silcapputil/Makefile
-#ifdef SILC_DIST_SFTP
-lib/silcsftp/Makefile
-#endif SILC_DIST_SFTP
-#ifdef SILC_DIST_INPLACE
-lib/silcutil/tests/Makefile
-lib/silccore/tests/Makefile
-lib/silcsftp/tests/Makefile
-#endif SILC_DIST_INPLACE
-)
-
-#ifdef SILC_DIST_TOOLKIT
-AC_CONFIG_FILES(
-lib/silc.pc
-lib/silcclient.pc
-lib/silcserver.pc
-)
-#endif SILC_DIST_TOOLKIT
-
-#ifdef SILC_DIST_CLIENTLIB
-AC_CONFIG_FILES(
-lib/silcclient/Makefile
-lib/silcclient/tests/Makefile
-)
-#endif SILC_DIST_CLIENTLIB
-
-#ifdef SILC_DIST_SERVERLIB
-AC_CONFIG_FILES(
-lib/silcserver/Makefile
-lib/silcserver/tests/Makefile
-)
-#endif SILC_DIST_SERVERLIB
-
-#ifdef SILC_DIST_ASN1
-AC_CONFIG_FILES(
-lib/silcasn1/Makefile
-#ifdef SILC_DIST_INPLACE
-lib/silcasn1/tests/Makefile
-#endif SILC_DIST_INPLACE
-)
-#endif SILC_DIST_ASN1
-
-#ifdef SILC_DIST_SKR
-AC_CONFIG_FILES(
-lib/silcskr/Makefile
-#ifdef SILC_DIST_INPLACE
-lib/silcskr/tests/Makefile
-#endif SILC_DIST_INPLACE
-)
-#endif SILC_DIST_SKR
-
-#ifdef SILC_DIST_HTTP
-AC_CONFIG_FILES(
-lib/silchttp/Makefile
-#ifdef SILC_DIST_INPLACE
-lib/silchttp/tests/Makefile
-#endif SILC_DIST_INPLACE
-)
-#endif SILC_DIST_HTTP
-
-#ifdef SILC_DIST_VCARD
-AC_CONFIG_FILES(
-lib/silcvcard/Makefile
-)
-#endif SILC_DIST_VCARD
-
-fi     # compile_libs
-
-#endif SILC_DIST_LIB
diff --git a/lib/contrib/.cvsignore b/lib/contrib/.cvsignore
deleted file mode 100644 (file)
index 282522d..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-Makefile
-Makefile.in
diff --git a/lib/contrib/Makefile.ad b/lib/contrib/Makefile.ad
deleted file mode 100644 (file)
index 960a374..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-#
-#  Makefile.am
-#
-#  Author: Pekka Riikonen <priikone@silcnet.org>
-#
-#  Copyright (C) 2000 - 2005 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.
-#
-
-AUTOMAKE_OPTIONS = 1.0 no-dependencies foreign
-
-noinst_LTLIBRARIES = libcontrib.la
-
-if HAVE_REGEX
-REGEX =
-else
-REGEX = regexpr.c
-endif
-
-STRINGPREP = nfkc.c rfc3454.c stringprep.c
-
-libcontrib_la_SOURCES = getopti.c $(STRINGPREP) $(REGEX)
-
-EXTRA_DIST = *.c *.h
-
-include $(top_srcdir)/Makefile.defines.in
diff --git a/lib/contrib/getopti.c b/lib/contrib/getopti.c
deleted file mode 100644 (file)
index 9cd7a21..0000000
+++ /dev/null
@@ -1,70 +0,0 @@
-/* Our own convenience getopt.  Public Domain. */
-#include "silc.h"
-
-#ifndef SILC_SYMBIAN
-#if !defined(HAVE_GETOPT) && !defined(HAVE_GETOPT_H)
-int    opterr = 1;
-int    optind = 1;
-int    optopt;
-char   *optarg;
-
-#define GETOPT_ERR(s, c)                       \
-do {                                           \
-  if (opterr) {                                        \
-    char errbuf[2];                            \
-    errbuf[0] = c;                             \
-    errbuf[1] = '\n';                          \
-    (void) write(2, argv[0], strlen(argv[0])); \
-    (void) write(2, s, strlen(s));             \
-    (void) write(2, errbuf, 2);                        \
-  }                                            \
-} while(0)
-
-int getopt(int argc, char * const *argv, const char *optstring)
-{
-  static int sp = 1;
-  register int c;
-  register char *cp;
-
-  if (sp == 1) {
-    if (optind >= argc ||
-       argv[optind][0] != '-' || argv[optind][1] == '\0') {
-      return EOF;
-    } else if (strcmp(argv[optind], "--") == 0) {
-      optind++;
-      return EOF;
-    }
-  }
-  optopt = c = argv[optind][sp];
-
-  if (c == ':' || (cp=strchr(optstring, c)) == NULL) {
-    GETOPT_ERR(": illegal option -- ", c);
-    if (argv[optind][++sp] == '\0') {
-      optind++;
-      sp = 1;
-    }
-    return '?';
-  }
-
-  if (*++cp == ':') {
-    if (argv[optind][sp+1] != '\0')
-      optarg = &argv[optind++][sp+1];
-    else if (++optind >= argc) {
-      GETOPT_ERR(": option requires an argument -- ", c);
-      sp = 1;
-      return '?';
-    } else
-      optarg = argv[optind++];
-    sp = 1;
-  } else {
-    if (argv[optind][++sp] == '\0') {
-      sp = 1;
-      optind++;
-    }
-    optarg = NULL;
-  }
-
-  return c;
-}
-#endif /* !HAVE_GETOPT && !HAVE_GETOPT_H */
-#endif /* !SILC_SYMBIAN */
diff --git a/lib/contrib/getopti.h b/lib/contrib/getopti.h
deleted file mode 100644 (file)
index aeec6a2..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-#ifndef GETOPTI_H
-#define GETOPTI_H
-
-#ifndef SILC_SYMBIAN
-#if !defined(HAVE_GETOPT) && !defined(HAVE_GETOPT_H)
-/* Our own convenience getopt. */
-extern int opterr;
-extern int optind;
-extern int optopt;
-extern char *optarg;
-int getopt(int argc, char * const *argv, const char *optstring);
-#endif /* !HAVE_GETOPT && !HAVE_GETOPT_H */
-#endif /* !SILC_SYMBIAN */
-
-#endif /* GETOPTI_H */
diff --git a/lib/contrib/gunicomp.h b/lib/contrib/gunicomp.h
deleted file mode 100644 (file)
index b5fa880..0000000
+++ /dev/null
@@ -1,661 +0,0 @@
-/* This file is automatically generated.  DO NOT EDIT!
-   Instead, edit gen-unicode-tables.pl and re-run.  */
-
-#define COMPOSE_FIRST_START 1
-#define COMPOSE_FIRST_SINGLE_START 147
-#define COMPOSE_SECOND_START 357
-#define COMPOSE_SECOND_SINGLE_START 388
-
-#define COMPOSE_TABLE_LAST 48
-
-static const guint16 compose_data[][256] = {
-  { /* page 0, index 0 */
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 147, 148, 149, 0, 0, 1, 2, 3, 4, 5, 
-    150, 6, 7, 8, 151, 9, 10, 11, 12, 13, 14, 0, 15, 16, 17, 18, 19, 20, 21, 
-    22, 23, 0, 0, 0, 0, 0, 0, 24, 25, 26, 27, 28, 152, 29, 30, 31, 32, 33, 
-    34, 35, 36, 37, 38, 0, 39, 40, 41, 42, 43, 44, 45, 46, 47, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 48, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 49, 0, 153, 154, 
-    50, 155, 0, 0, 51, 0, 0, 0, 0, 156, 0, 0, 0, 0, 52, 53, 157, 0, 158, 0, 
-    0, 0, 54, 0, 0, 0, 0, 0, 55, 0, 159, 160, 56, 161, 0, 0, 57, 0, 0, 0, 0, 
-    162, 0, 0, 0, 0, 58, 59, 163, 0, 164, 0, 0, 0, 60, 0, 0, 0
-  },
-  { /* page 1, index 1 */
-    0, 0, 61, 62, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63, 64, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 65, 66, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 165, 166, 0, 
-    0, 0, 0, 167, 168, 0, 0, 0, 0, 0, 0, 169, 170, 171, 172, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 173, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 67, 
-    68, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 69, 70, 0, 0, 0, 0, 0, 0, 174, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 175, 176, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0
-  },
-  { /* page 2, index 2 */
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 177, 178, 179, 180, 0, 0, 0, 0, 
-    181, 182, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 183, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
-  },
-  { /* page 3, index 3 */
-    357, 358, 359, 360, 361, 0, 362, 363, 364, 365, 366, 367, 368, 0, 0, 369, 
-    0, 370, 0, 371, 372, 0, 0, 0, 0, 0, 0, 373, 0, 0, 0, 0, 0, 0, 0, 374, 
-    375, 376, 377, 378, 379, 0, 0, 0, 0, 380, 381, 0, 382, 383, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 384, 0, 0, 385, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 71, 0, 0, 0, 
-    72, 0, 73, 0, 74, 0, 0, 0, 0, 0, 75, 0, 184, 0, 0, 0, 76, 0, 0, 0, 77, 0, 
-    0, 185, 0, 186, 0, 0, 78, 0, 0, 0, 79, 0, 80, 0, 81, 0, 0, 0, 0, 0, 82, 
-    0, 83, 0, 0, 0, 84, 0, 0, 0, 85, 86, 87, 0, 0, 187, 0, 0, 0, 88, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
-  },
-  { /* page 4, index 4 */
-    0, 0, 0, 0, 0, 0, 188, 0, 0, 0, 0, 0, 0, 0, 0, 0, 89, 0, 0, 189, 0, 90, 
-    91, 190, 92, 0, 191, 0, 0, 0, 192, 0, 0, 0, 0, 93, 0, 0, 0, 193, 0, 0, 0, 
-    194, 0, 195, 0, 0, 94, 0, 0, 196, 0, 95, 96, 197, 97, 0, 198, 0, 0, 0, 
-    199, 0, 0, 0, 0, 98, 0, 0, 0, 200, 0, 0, 0, 201, 0, 202, 0, 0, 0, 0, 0, 
-    0, 0, 0, 203, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 204, 205, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 206, 207, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 208, 209, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0
-  },
-  { /* page 6, index 5 */
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 99, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    210, 0, 211, 0, 0, 0, 0, 0, 0, 0, 0, 388, 389, 390, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 212, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 213, 0, 
-    0, 214, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
-  },
-  { /* page 9, index 6 */
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 215, 0, 0, 0, 0, 0, 0, 0, 
-    216, 0, 0, 217, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 391, 
-    0, 0, 0, 0, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    392, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
-  },
-  { /* page 11, index 7 */
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 393, 0, 0, 0, 0, 0, 0, 0, 0, 
-    101, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 394, 395, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 218, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 396, 0, 0, 0, 0, 0, 0, 0, 102, 219, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 397, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
-  },
-  { /* page 12, index 8 */
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 220, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 221, 
-    0, 0, 398, 0, 0, 0, 103, 0, 0, 0, 222, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 399, 
-    400, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
-  },
-  { /* page 13, index 9 */
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 401, 0, 0, 0, 0, 0, 0, 0, 104, 
-    223, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 402, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 403, 0, 0, 0, 0, 404, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 105, 0, 0, 224, 0, 0, 405, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
-  },
-  { /* page 16, index 10 */
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 225, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
-  },
-  { /* page 30, index 11 */
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 226, 227, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 229, 0, 0, 
-    0, 0, 0, 0, 230, 231, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 106, 107, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 232, 233, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 234, 235, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
-  },
-  { /* page 31, index 12 */
-    108, 109, 236, 237, 238, 239, 240, 241, 110, 111, 242, 243, 244, 245, 
-    246, 247, 112, 113, 0, 0, 0, 0, 0, 0, 114, 115, 0, 0, 0, 0, 0, 0, 116, 
-    117, 248, 249, 250, 251, 252, 253, 118, 119, 254, 255, 256, 257, 258, 
-    259, 120, 121, 0, 0, 0, 0, 0, 0, 122, 123, 0, 0, 0, 0, 0, 0, 124, 125, 0, 
-    0, 0, 0, 0, 0, 126, 127, 0, 0, 0, 0, 0, 0, 128, 129, 0, 0, 0, 0, 0, 0, 0, 
-    130, 0, 0, 0, 0, 0, 0, 131, 132, 260, 261, 262, 263, 264, 265, 133, 134, 
-    266, 267, 268, 269, 270, 271, 272, 0, 0, 0, 273, 0, 0, 0, 0, 0, 0, 0, 
-    274, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 275, 0, 0, 0, 0, 0, 0, 0, 0, 135, 0, 0, 0, 
-    0, 0, 0, 276, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 277, 0, 0, 0, 0, 0, 0, 0, 136, 0
-  },
-  { /* page 33, index 13 */
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    278, 0, 279, 0, 280, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 281, 0, 282, 0, 
-    283, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
-  },
-  { /* page 34, index 14 */
-    0, 0, 0, 284, 0, 0, 0, 0, 285, 0, 0, 286, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 287, 0, 288, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 289, 0, 0, 0, 0, 0, 0, 290, 
-    0, 291, 0, 0, 292, 0, 0, 0, 0, 293, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 294, 0, 0, 295, 296, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 297, 298, 0, 0, 299, 300, 0, 0, 301, 302, 303, 304, 0, 0, 0, 0, 
-    305, 306, 0, 0, 307, 308, 0, 0, 0, 0, 0, 0, 0, 0, 0, 309, 310, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 311, 0, 0, 0, 0, 0, 312, 313, 0, 314, 
-    0, 0, 0, 0, 0, 0, 315, 316, 317, 318, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
-  },
-  { /* page 48, index 15 */
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 319, 0, 
-    0, 0, 0, 320, 0, 321, 0, 322, 0, 323, 0, 324, 0, 325, 0, 326, 0, 327, 0, 
-    328, 0, 329, 0, 330, 0, 331, 0, 0, 332, 0, 333, 0, 334, 0, 0, 0, 0, 0, 0, 
-    137, 0, 0, 138, 0, 0, 139, 0, 0, 140, 0, 0, 141, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 386, 387, 
-    0, 0, 335, 0, 0, 0, 0, 0, 0, 0, 0, 336, 0, 0, 0, 0, 337, 0, 338, 0, 339, 
-    0, 340, 0, 341, 0, 342, 0, 343, 0, 344, 0, 345, 0, 346, 0, 347, 0, 348, 
-    0, 0, 349, 0, 350, 0, 351, 0, 0, 0, 0, 0, 0, 142, 0, 0, 143, 0, 0, 144, 
-    0, 0, 145, 0, 0, 146, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 352, 353, 354, 355, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 356, 0, 0
-  }
-};
-
-static const gint16 compose_table[COMPOSE_TABLE_LAST + 1] = {
-  0 /* page 0 */,
-  1 /* page 1 */,
-  2 /* page 2 */,
-  3 /* page 3 */,
-  4 /* page 4 */,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  5 /* page 6 */,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  6 /* page 9 */,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  7 /* page 11 */,
-  8 /* page 12 */,
-  9 /* page 13 */,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  10 /* page 16 */,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  11 /* page 30 */,
-  12 /* page 31 */,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  13 /* page 33 */,
-  14 /* page 34 */,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  15 /* page 48 */
-};
-
-static const guint16 compose_first_single[][2] = {
- { 0x0338, 0x226e },
- { 0x0338, 0x2260 },
- { 0x0338, 0x226f },
- { 0x0307, 0x1e1e },
- { 0x0302, 0x0134 },
- { 0x0307, 0x1e1f },
- { 0x0304, 0x01de },
- { 0x0301, 0x01fa },
- { 0x0301, 0x1e08 },
- { 0x0301, 0x1e2e },
- { 0x0304, 0x022a },
- { 0x0301, 0x01fe },
- { 0x0304, 0x01df },
- { 0x0301, 0x01fb },
- { 0x0301, 0x1e09 },
- { 0x0301, 0x1e2f },
- { 0x0304, 0x022b },
- { 0x0301, 0x01ff },
- { 0x0307, 0x1e64 },
- { 0x0307, 0x1e65 },
- { 0x0307, 0x1e66 },
- { 0x0307, 0x1e67 },
- { 0x0301, 0x1e78 },
- { 0x0301, 0x1e79 },
- { 0x0308, 0x1e7a },
- { 0x0308, 0x1e7b },
- { 0x0307, 0x1e9b },
- { 0x030c, 0x01ee },
- { 0x0304, 0x01ec },
- { 0x0304, 0x01ed },
- { 0x0304, 0x01e0 },
- { 0x0304, 0x01e1 },
- { 0x0306, 0x1e1c },
- { 0x0306, 0x1e1d },
- { 0x0304, 0x0230 },
- { 0x0304, 0x0231 },
- { 0x030c, 0x01ef },
- { 0x0314, 0x1fec },
- { 0x0345, 0x1fb4 },
- { 0x0345, 0x1fc4 },
- { 0x0345, 0x1ff4 },
- { 0x0308, 0x0407 },
- { 0x0301, 0x0403 },
- { 0x0308, 0x04de },
- { 0x0301, 0x040c },
- { 0x0308, 0x04e6 },
- { 0x0308, 0x04f4 },
- { 0x0308, 0x04f8 },
- { 0x0308, 0x04ec },
- { 0x0301, 0x0453 },
- { 0x0308, 0x04df },
- { 0x0301, 0x045c },
- { 0x0308, 0x04e7 },
- { 0x0308, 0x04f5 },
- { 0x0308, 0x04f9 },
- { 0x0308, 0x04ed },
- { 0x0308, 0x0457 },
- { 0x030f, 0x0476 },
- { 0x030f, 0x0477 },
- { 0x0308, 0x04da },
- { 0x0308, 0x04db },
- { 0x0308, 0x04ea },
- { 0x0308, 0x04eb },
- { 0x0654, 0x0624 },
- { 0x0654, 0x0626 },
- { 0x0654, 0x06c2 },
- { 0x0654, 0x06d3 },
- { 0x0654, 0x06c0 },
- { 0x093c, 0x0929 },
- { 0x093c, 0x0931 },
- { 0x093c, 0x0934 },
- { 0x0bd7, 0x0b94 },
- { 0x0bbe, 0x0bcb },
- { 0x0c56, 0x0c48 },
- { 0x0cd5, 0x0cc0 },
- { 0x0cd5, 0x0ccb },
- { 0x0d3e, 0x0d4b },
- { 0x0dca, 0x0ddd },
- { 0x102e, 0x1026 },
- { 0x0304, 0x1e38 },
- { 0x0304, 0x1e39 },
- { 0x0304, 0x1e5c },
- { 0x0304, 0x1e5d },
- { 0x0307, 0x1e68 },
- { 0x0307, 0x1e69 },
- { 0x0302, 0x1ec6 },
- { 0x0302, 0x1ec7 },
- { 0x0302, 0x1ed8 },
- { 0x0302, 0x1ed9 },
- { 0x0345, 0x1f82 },
- { 0x0345, 0x1f83 },
- { 0x0345, 0x1f84 },
- { 0x0345, 0x1f85 },
- { 0x0345, 0x1f86 },
- { 0x0345, 0x1f87 },
- { 0x0345, 0x1f8a },
- { 0x0345, 0x1f8b },
- { 0x0345, 0x1f8c },
- { 0x0345, 0x1f8d },
- { 0x0345, 0x1f8e },
- { 0x0345, 0x1f8f },
- { 0x0345, 0x1f92 },
- { 0x0345, 0x1f93 },
- { 0x0345, 0x1f94 },
- { 0x0345, 0x1f95 },
- { 0x0345, 0x1f96 },
- { 0x0345, 0x1f97 },
- { 0x0345, 0x1f9a },
- { 0x0345, 0x1f9b },
- { 0x0345, 0x1f9c },
- { 0x0345, 0x1f9d },
- { 0x0345, 0x1f9e },
- { 0x0345, 0x1f9f },
- { 0x0345, 0x1fa2 },
- { 0x0345, 0x1fa3 },
- { 0x0345, 0x1fa4 },
- { 0x0345, 0x1fa5 },
- { 0x0345, 0x1fa6 },
- { 0x0345, 0x1fa7 },
- { 0x0345, 0x1faa },
- { 0x0345, 0x1fab },
- { 0x0345, 0x1fac },
- { 0x0345, 0x1fad },
- { 0x0345, 0x1fae },
- { 0x0345, 0x1faf },
- { 0x0345, 0x1fb2 },
- { 0x0345, 0x1fc2 },
- { 0x0345, 0x1ff2 },
- { 0x0345, 0x1fb7 },
- { 0x0345, 0x1fc7 },
- { 0x0345, 0x1ff7 },
- { 0x0338, 0x219a },
- { 0x0338, 0x219b },
- { 0x0338, 0x21ae },
- { 0x0338, 0x21cd },
- { 0x0338, 0x21cf },
- { 0x0338, 0x21ce },
- { 0x0338, 0x2204 },
- { 0x0338, 0x2209 },
- { 0x0338, 0x220c },
- { 0x0338, 0x2224 },
- { 0x0338, 0x2226 },
- { 0x0338, 0x2241 },
- { 0x0338, 0x2244 },
- { 0x0338, 0x2247 },
- { 0x0338, 0x2249 },
- { 0x0338, 0x226d },
- { 0x0338, 0x2262 },
- { 0x0338, 0x2270 },
- { 0x0338, 0x2271 },
- { 0x0338, 0x2274 },
- { 0x0338, 0x2275 },
- { 0x0338, 0x2278 },
- { 0x0338, 0x2279 },
- { 0x0338, 0x2280 },
- { 0x0338, 0x2281 },
- { 0x0338, 0x22e0 },
- { 0x0338, 0x22e1 },
- { 0x0338, 0x2284 },
- { 0x0338, 0x2285 },
- { 0x0338, 0x2288 },
- { 0x0338, 0x2289 },
- { 0x0338, 0x22e2 },
- { 0x0338, 0x22e3 },
- { 0x0338, 0x22ac },
- { 0x0338, 0x22ad },
- { 0x0338, 0x22ae },
- { 0x0338, 0x22af },
- { 0x0338, 0x22ea },
- { 0x0338, 0x22eb },
- { 0x0338, 0x22ec },
- { 0x0338, 0x22ed },
- { 0x3099, 0x3094 },
- { 0x3099, 0x304c },
- { 0x3099, 0x304e },
- { 0x3099, 0x3050 },
- { 0x3099, 0x3052 },
- { 0x3099, 0x3054 },
- { 0x3099, 0x3056 },
- { 0x3099, 0x3058 },
- { 0x3099, 0x305a },
- { 0x3099, 0x305c },
- { 0x3099, 0x305e },
- { 0x3099, 0x3060 },
- { 0x3099, 0x3062 },
- { 0x3099, 0x3065 },
- { 0x3099, 0x3067 },
- { 0x3099, 0x3069 },
- { 0x3099, 0x309e },
- { 0x3099, 0x30f4 },
- { 0x3099, 0x30ac },
- { 0x3099, 0x30ae },
- { 0x3099, 0x30b0 },
- { 0x3099, 0x30b2 },
- { 0x3099, 0x30b4 },
- { 0x3099, 0x30b6 },
- { 0x3099, 0x30b8 },
- { 0x3099, 0x30ba },
- { 0x3099, 0x30bc },
- { 0x3099, 0x30be },
- { 0x3099, 0x30c0 },
- { 0x3099, 0x30c2 },
- { 0x3099, 0x30c5 },
- { 0x3099, 0x30c7 },
- { 0x3099, 0x30c9 },
- { 0x3099, 0x30f7 },
- { 0x3099, 0x30f8 },
- { 0x3099, 0x30f9 },
- { 0x3099, 0x30fa },
- { 0x3099, 0x30fe }
-};
-static const guint16 compose_second_single[][2] = {
- { 0x0627, 0x0622 },
- { 0x0627, 0x0623 },
- { 0x0627, 0x0625 },
- { 0x09c7, 0x09cb },
- { 0x09c7, 0x09cc },
- { 0x0b47, 0x0b4b },
- { 0x0b47, 0x0b48 },
- { 0x0b47, 0x0b4c },
- { 0x0bc6, 0x0bca },
- { 0x0bc6, 0x0bcc },
- { 0x0cc6, 0x0cca },
- { 0x0cc6, 0x0cc7 },
- { 0x0cc6, 0x0cc8 },
- { 0x0d46, 0x0d4a },
- { 0x0d46, 0x0d4c },
- { 0x0dd9, 0x0dda },
- { 0x0dd9, 0x0ddc },
- { 0x0dd9, 0x0dde }
-};
-static const guint16 compose_array[146][31] = {
- { 0x00c0, 0x00c1, 0x00c2, 0x00c3, 0x0100, 0x0102, 0x0226, 0x00c4, 0x1ea2, 0x00c5,      0, 0x01cd, 0x0200, 0x0202,      0,      0,      0, 0x1ea0,      0, 0x1e00,      0,      0, 0x0104,      0,      0,      0,      0,      0,      0,      0,      0 },
- {      0,      0,      0,      0,      0,      0, 0x1e02,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0, 0x1e04,      0,      0,      0,      0,      0,      0,      0,      0, 0x1e06,      0,      0,      0,      0 },
- {      0, 0x0106, 0x0108,      0,      0,      0, 0x010a,      0,      0,      0,      0, 0x010c,      0,      0,      0,      0,      0,      0,      0,      0,      0, 0x00c7,      0,      0,      0,      0,      0,      0,      0,      0,      0 },
- {      0,      0,      0,      0,      0,      0, 0x1e0a,      0,      0,      0,      0, 0x010e,      0,      0,      0,      0,      0, 0x1e0c,      0,      0,      0, 0x1e10,      0, 0x1e12,      0,      0, 0x1e0e,      0,      0,      0,      0 },
- { 0x00c8, 0x00c9, 0x00ca, 0x1ebc, 0x0112, 0x0114, 0x0116, 0x00cb, 0x1eba,      0,      0, 0x011a, 0x0204, 0x0206,      0,      0,      0, 0x1eb8,      0,      0,      0, 0x0228, 0x0118, 0x1e18,      0, 0x1e1a,      0,      0,      0,      0,      0 },
- {      0, 0x01f4, 0x011c,      0, 0x1e20, 0x011e, 0x0120,      0,      0,      0,      0, 0x01e6,      0,      0,      0,      0,      0,      0,      0,      0,      0, 0x0122,      0,      0,      0,      0,      0,      0,      0,      0,      0 },
- {      0,      0, 0x0124,      0,      0,      0, 0x1e22, 0x1e26,      0,      0,      0, 0x021e,      0,      0,      0,      0,      0, 0x1e24,      0,      0,      0, 0x1e28,      0,      0, 0x1e2a,      0,      0,      0,      0,      0,      0 },
- { 0x00cc, 0x00cd, 0x00ce, 0x0128, 0x012a, 0x012c, 0x0130, 0x00cf, 0x1ec8,      0,      0, 0x01cf, 0x0208, 0x020a,      0,      0,      0, 0x1eca,      0,      0,      0,      0, 0x012e,      0,      0, 0x1e2c,      0,      0,      0,      0,      0 },
- {      0, 0x1e30,      0,      0,      0,      0,      0,      0,      0,      0,      0, 0x01e8,      0,      0,      0,      0,      0, 0x1e32,      0,      0,      0, 0x0136,      0,      0,      0,      0, 0x1e34,      0,      0,      0,      0 },
- {      0, 0x0139,      0,      0,      0,      0,      0,      0,      0,      0,      0, 0x013d,      0,      0,      0,      0,      0, 0x1e36,      0,      0,      0, 0x013b,      0, 0x1e3c,      0,      0, 0x1e3a,      0,      0,      0,      0 },
- {      0, 0x1e3e,      0,      0,      0,      0, 0x1e40,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0, 0x1e42,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0 },
- { 0x01f8, 0x0143,      0, 0x00d1,      0,      0, 0x1e44,      0,      0,      0,      0, 0x0147,      0,      0,      0,      0,      0, 0x1e46,      0,      0,      0, 0x0145,      0, 0x1e4a,      0,      0, 0x1e48,      0,      0,      0,      0 },
- { 0x00d2, 0x00d3, 0x00d4, 0x00d5, 0x014c, 0x014e, 0x022e, 0x00d6, 0x1ece,      0, 0x0150, 0x01d1, 0x020c, 0x020e,      0,      0, 0x01a0, 0x1ecc,      0,      0,      0,      0, 0x01ea,      0,      0,      0,      0,      0,      0,      0,      0 },
- {      0, 0x1e54,      0,      0,      0,      0, 0x1e56,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0 },
- {      0, 0x0154,      0,      0,      0,      0, 0x1e58,      0,      0,      0,      0, 0x0158, 0x0210, 0x0212,      0,      0,      0, 0x1e5a,      0,      0,      0, 0x0156,      0,      0,      0,      0, 0x1e5e,      0,      0,      0,      0 },
- {      0, 0x015a, 0x015c,      0,      0,      0, 0x1e60,      0,      0,      0,      0, 0x0160,      0,      0,      0,      0,      0, 0x1e62,      0,      0, 0x0218, 0x015e,      0,      0,      0,      0,      0,      0,      0,      0,      0 },
- {      0,      0,      0,      0,      0,      0, 0x1e6a,      0,      0,      0,      0, 0x0164,      0,      0,      0,      0,      0, 0x1e6c,      0,      0, 0x021a, 0x0162,      0, 0x1e70,      0,      0, 0x1e6e,      0,      0,      0,      0 },
- { 0x00d9, 0x00da, 0x00db, 0x0168, 0x016a, 0x016c,      0, 0x00dc, 0x1ee6, 0x016e, 0x0170, 0x01d3, 0x0214, 0x0216,      0,      0, 0x01af, 0x1ee4, 0x1e72,      0,      0,      0, 0x0172, 0x1e76,      0, 0x1e74,      0,      0,      0,      0,      0 },
- {      0,      0,      0, 0x1e7c,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0, 0x1e7e,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0 },
- { 0x1e80, 0x1e82, 0x0174,      0,      0,      0, 0x1e86, 0x1e84,      0,      0,      0,      0,      0,      0,      0,      0,      0, 0x1e88,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0 },
- {      0,      0,      0,      0,      0,      0, 0x1e8a, 0x1e8c,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0 },
- { 0x1ef2, 0x00dd, 0x0176, 0x1ef8, 0x0232,      0, 0x1e8e, 0x0178, 0x1ef6,      0,      0,      0,      0,      0,      0,      0,      0, 0x1ef4,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0 },
- {      0, 0x0179, 0x1e90,      0,      0,      0, 0x017b,      0,      0,      0,      0, 0x017d,      0,      0,      0,      0,      0, 0x1e92,      0,      0,      0,      0,      0,      0,      0,      0, 0x1e94,      0,      0,      0,      0 },
- { 0x00e0, 0x00e1, 0x00e2, 0x00e3, 0x0101, 0x0103, 0x0227, 0x00e4, 0x1ea3, 0x00e5,      0, 0x01ce, 0x0201, 0x0203,      0,      0,      0, 0x1ea1,      0, 0x1e01,      0,      0, 0x0105,      0,      0,      0,      0,      0,      0,      0,      0 },
- {      0,      0,      0,      0,      0,      0, 0x1e03,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0, 0x1e05,      0,      0,      0,      0,      0,      0,      0,      0, 0x1e07,      0,      0,      0,      0 },
- {      0, 0x0107, 0x0109,      0,      0,      0, 0x010b,      0,      0,      0,      0, 0x010d,      0,      0,      0,      0,      0,      0,      0,      0,      0, 0x00e7,      0,      0,      0,      0,      0,      0,      0,      0,      0 },
- {      0,      0,      0,      0,      0,      0, 0x1e0b,      0,      0,      0,      0, 0x010f,      0,      0,      0,      0,      0, 0x1e0d,      0,      0,      0, 0x1e11,      0, 0x1e13,      0,      0, 0x1e0f,      0,      0,      0,      0 },
- { 0x00e8, 0x00e9, 0x00ea, 0x1ebd, 0x0113, 0x0115, 0x0117, 0x00eb, 0x1ebb,      0,      0, 0x011b, 0x0205, 0x0207,      0,      0,      0, 0x1eb9,      0,      0,      0, 0x0229, 0x0119, 0x1e19,      0, 0x1e1b,      0,      0,      0,      0,      0 },
- {      0, 0x01f5, 0x011d,      0, 0x1e21, 0x011f, 0x0121,      0,      0,      0,      0, 0x01e7,      0,      0,      0,      0,      0,      0,      0,      0,      0, 0x0123,      0,      0,      0,      0,      0,      0,      0,      0,      0 },
- {      0,      0, 0x0125,      0,      0,      0, 0x1e23, 0x1e27,      0,      0,      0, 0x021f,      0,      0,      0,      0,      0, 0x1e25,      0,      0,      0, 0x1e29,      0,      0, 0x1e2b,      0, 0x1e96,      0,      0,      0,      0 },
- { 0x00ec, 0x00ed, 0x00ee, 0x0129, 0x012b, 0x012d,      0, 0x00ef, 0x1ec9,      0,      0, 0x01d0, 0x0209, 0x020b,      0,      0,      0, 0x1ecb,      0,      0,      0,      0, 0x012f,      0,      0, 0x1e2d,      0,      0,      0,      0,      0 },
- {      0,      0, 0x0135,      0,      0,      0,      0,      0,      0,      0,      0, 0x01f0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0 },
- {      0, 0x1e31,      0,      0,      0,      0,      0,      0,      0,      0,      0, 0x01e9,      0,      0,      0,      0,      0, 0x1e33,      0,      0,      0, 0x0137,      0,      0,      0,      0, 0x1e35,      0,      0,      0,      0 },
- {      0, 0x013a,      0,      0,      0,      0,      0,      0,      0,      0,      0, 0x013e,      0,      0,      0,      0,      0, 0x1e37,      0,      0,      0, 0x013c,      0, 0x1e3d,      0,      0, 0x1e3b,      0,      0,      0,      0 },
- {      0, 0x1e3f,      0,      0,      0,      0, 0x1e41,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0, 0x1e43,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0 },
- { 0x01f9, 0x0144,      0, 0x00f1,      0,      0, 0x1e45,      0,      0,      0,      0, 0x0148,      0,      0,      0,      0,      0, 0x1e47,      0,      0,      0, 0x0146,      0, 0x1e4b,      0,      0, 0x1e49,      0,      0,      0,      0 },
- { 0x00f2, 0x00f3, 0x00f4, 0x00f5, 0x014d, 0x014f, 0x022f, 0x00f6, 0x1ecf,      0, 0x0151, 0x01d2, 0x020d, 0x020f,      0,      0, 0x01a1, 0x1ecd,      0,      0,      0,      0, 0x01eb,      0,      0,      0,      0,      0,      0,      0,      0 },
- {      0, 0x1e55,      0,      0,      0,      0, 0x1e57,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0 },
- {      0, 0x0155,      0,      0,      0,      0, 0x1e59,      0,      0,      0,      0, 0x0159, 0x0211, 0x0213,      0,      0,      0, 0x1e5b,      0,      0,      0, 0x0157,      0,      0,      0,      0, 0x1e5f,      0,      0,      0,      0 },
- {      0, 0x015b, 0x015d,      0,      0,      0, 0x1e61,      0,      0,      0,      0, 0x0161,      0,      0,      0,      0,      0, 0x1e63,      0,      0, 0x0219, 0x015f,      0,      0,      0,      0,      0,      0,      0,      0,      0 },
- {      0,      0,      0,      0,      0,      0, 0x1e6b, 0x1e97,      0,      0,      0, 0x0165,      0,      0,      0,      0,      0, 0x1e6d,      0,      0, 0x021b, 0x0163,      0, 0x1e71,      0,      0, 0x1e6f,      0,      0,      0,      0 },
- { 0x00f9, 0x00fa, 0x00fb, 0x0169, 0x016b, 0x016d,      0, 0x00fc, 0x1ee7, 0x016f, 0x0171, 0x01d4, 0x0215, 0x0217,      0,      0, 0x01b0, 0x1ee5, 0x1e73,      0,      0,      0, 0x0173, 0x1e77,      0, 0x1e75,      0,      0,      0,      0,      0 },
- {      0,      0,      0, 0x1e7d,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0, 0x1e7f,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0 },
- { 0x1e81, 0x1e83, 0x0175,      0,      0,      0, 0x1e87, 0x1e85,      0, 0x1e98,      0,      0,      0,      0,      0,      0,      0, 0x1e89,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0 },
- {      0,      0,      0,      0,      0,      0, 0x1e8b, 0x1e8d,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0 },
- { 0x1ef3, 0x00fd, 0x0177, 0x1ef9, 0x0233,      0, 0x1e8f, 0x00ff, 0x1ef7, 0x1e99,      0,      0,      0,      0,      0,      0,      0, 0x1ef5,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0 },
- {      0, 0x017a, 0x1e91,      0,      0,      0, 0x017c,      0,      0,      0,      0, 0x017e,      0,      0,      0,      0,      0, 0x1e93,      0,      0,      0,      0,      0,      0,      0,      0, 0x1e95,      0,      0,      0,      0 },
- { 0x1fed, 0x0385,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0, 0x1fc1,      0,      0,      0 },
- { 0x1ea6, 0x1ea4,      0, 0x1eaa,      0,      0,      0,      0, 0x1ea8,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0 },
- {      0, 0x01fc,      0,      0, 0x01e2,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0 },
- { 0x1ec0, 0x1ebe,      0, 0x1ec4,      0,      0,      0,      0, 0x1ec2,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0 },
- { 0x1ed2, 0x1ed0,      0, 0x1ed6,      0,      0,      0,      0, 0x1ed4,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0 },
- {      0, 0x1e4c,      0,      0, 0x022c,      0,      0, 0x1e4e,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0 },
- { 0x01db, 0x01d7,      0,      0, 0x01d5,      0,      0,      0,      0,      0,      0, 0x01d9,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0 },
- { 0x1ea7, 0x1ea5,      0, 0x1eab,      0,      0,      0,      0, 0x1ea9,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0 },
- {      0, 0x01fd,      0,      0, 0x01e3,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0 },
- { 0x1ec1, 0x1ebf,      0, 0x1ec5,      0,      0,      0,      0, 0x1ec3,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0 },
- { 0x1ed3, 0x1ed1,      0, 0x1ed7,      0,      0,      0,      0, 0x1ed5,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0 },
- {      0, 0x1e4d,      0,      0, 0x022d,      0,      0, 0x1e4f,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0 },
- { 0x01dc, 0x01d8,      0,      0, 0x01d6,      0,      0,      0,      0,      0,      0, 0x01da,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0 },
- { 0x1eb0, 0x1eae,      0, 0x1eb4,      0,      0,      0,      0, 0x1eb2,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0 },
- { 0x1eb1, 0x1eaf,      0, 0x1eb5,      0,      0,      0,      0, 0x1eb3,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0 },
- { 0x1e14, 0x1e16,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0 },
- { 0x1e15, 0x1e17,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0 },
- { 0x1e50, 0x1e52,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0 },
- { 0x1e51, 0x1e53,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0 },
- { 0x1edc, 0x1eda,      0, 0x1ee0,      0,      0,      0,      0, 0x1ede,      0,      0,      0,      0,      0,      0,      0,      0, 0x1ee2,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0 },
- { 0x1edd, 0x1edb,      0, 0x1ee1,      0,      0,      0,      0, 0x1edf,      0,      0,      0,      0,      0,      0,      0,      0, 0x1ee3,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0 },
- { 0x1eea, 0x1ee8,      0, 0x1eee,      0,      0,      0,      0, 0x1eec,      0,      0,      0,      0,      0,      0,      0,      0, 0x1ef0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0 },
- { 0x1eeb, 0x1ee9,      0, 0x1eef,      0,      0,      0,      0, 0x1eed,      0,      0,      0,      0,      0,      0,      0,      0, 0x1ef1,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0 },
- { 0x1fba, 0x0386,      0,      0, 0x1fb9, 0x1fb8,      0,      0,      0,      0,      0,      0,      0,      0, 0x1f08, 0x1f09,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0, 0x1fbc,      0,      0 },
- { 0x1fc8, 0x0388,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0, 0x1f18, 0x1f19,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0 },
- { 0x1fca, 0x0389,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0, 0x1f28, 0x1f29,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0, 0x1fcc,      0,      0 },
- { 0x1fda, 0x038a,      0,      0, 0x1fd9, 0x1fd8,      0, 0x03aa,      0,      0,      0,      0,      0,      0, 0x1f38, 0x1f39,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0 },
- { 0x1ff8, 0x038c,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0, 0x1f48, 0x1f49,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0 },
- { 0x1fea, 0x038e,      0,      0, 0x1fe9, 0x1fe8,      0, 0x03ab,      0,      0,      0,      0,      0,      0,      0, 0x1f59,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0 },
- { 0x1ffa, 0x038f,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0, 0x1f68, 0x1f69,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0, 0x1ffc,      0,      0 },
- { 0x1f70, 0x03ac,      0,      0, 0x1fb1, 0x1fb0,      0,      0,      0,      0,      0,      0,      0,      0, 0x1f00, 0x1f01,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0, 0x1fb6, 0x1fb3,      0,      0 },
- { 0x1f72, 0x03ad,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0, 0x1f10, 0x1f11,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0 },
- { 0x1f74, 0x03ae,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0, 0x1f20, 0x1f21,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0, 0x1fc6, 0x1fc3,      0,      0 },
- { 0x1f76, 0x03af,      0,      0, 0x1fd1, 0x1fd0,      0, 0x03ca,      0,      0,      0,      0,      0,      0, 0x1f30, 0x1f31,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0, 0x1fd6,      0,      0,      0 },
- { 0x1f78, 0x03cc,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0, 0x1f40, 0x1f41,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0 },
- {      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0, 0x1fe4, 0x1fe5,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0 },
- { 0x1f7a, 0x03cd,      0,      0, 0x1fe1, 0x1fe0,      0, 0x03cb,      0,      0,      0,      0,      0,      0, 0x1f50, 0x1f51,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0, 0x1fe6,      0,      0,      0 },
- { 0x1f7c, 0x03ce,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0, 0x1f60, 0x1f61,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0, 0x1ff6, 0x1ff3,      0,      0 },
- { 0x1fd2, 0x0390,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0, 0x1fd7,      0,      0,      0 },
- { 0x1fe2, 0x03b0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0, 0x1fe7,      0,      0,      0 },
- {      0, 0x03d3,      0,      0,      0,      0,      0, 0x03d4,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0 },
- {      0,      0,      0,      0,      0, 0x04d0,      0, 0x04d2,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0 },
- { 0x0400,      0,      0,      0,      0, 0x04d6,      0, 0x0401,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0 },
- {      0,      0,      0,      0,      0, 0x04c1,      0, 0x04dc,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0 },
- { 0x040d,      0,      0,      0, 0x04e2, 0x0419,      0, 0x04e4,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0 },
- {      0,      0,      0,      0, 0x04ee, 0x040e,      0, 0x04f0,      0,      0, 0x04f2,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0 },
- {      0,      0,      0,      0,      0, 0x04d1,      0, 0x04d3,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0 },
- { 0x0450,      0,      0,      0,      0, 0x04d7,      0, 0x0451,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0 },
- {      0,      0,      0,      0,      0, 0x04c2,      0, 0x04dd,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0 },
- { 0x045d,      0,      0,      0, 0x04e3, 0x0439,      0, 0x04e5,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0 },
- {      0,      0,      0,      0, 0x04ef, 0x045e,      0, 0x04f1,      0,      0, 0x04f3,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0 },
- {      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0 },
- {      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0 },
- {      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0 },
- {      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0 },
- {      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0 },
- {      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0 },
- {      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0 },
- {      0,      0, 0x1eac,      0,      0, 0x1eb6,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0 },
- {      0,      0, 0x1ead,      0,      0, 0x1eb7,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0 },
- { 0x1f02, 0x1f04,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0, 0x1f06, 0x1f80,      0,      0 },
- { 0x1f03, 0x1f05,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0, 0x1f07, 0x1f81,      0,      0 },
- { 0x1f0a, 0x1f0c,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0, 0x1f0e, 0x1f88,      0,      0 },
- { 0x1f0b, 0x1f0d,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0, 0x1f0f, 0x1f89,      0,      0 },
- { 0x1f12, 0x1f14,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0 },
- { 0x1f13, 0x1f15,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0 },
- { 0x1f1a, 0x1f1c,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0 },
- { 0x1f1b, 0x1f1d,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0 },
- { 0x1f22, 0x1f24,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0, 0x1f26, 0x1f90,      0,      0 },
- { 0x1f23, 0x1f25,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0, 0x1f27, 0x1f91,      0,      0 },
- { 0x1f2a, 0x1f2c,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0, 0x1f2e, 0x1f98,      0,      0 },
- { 0x1f2b, 0x1f2d,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0, 0x1f2f, 0x1f99,      0,      0 },
- { 0x1f32, 0x1f34,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0, 0x1f36,      0,      0,      0 },
- { 0x1f33, 0x1f35,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0, 0x1f37,      0,      0,      0 },
- { 0x1f3a, 0x1f3c,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0, 0x1f3e,      0,      0,      0 },
- { 0x1f3b, 0x1f3d,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0, 0x1f3f,      0,      0,      0 },
- { 0x1f42, 0x1f44,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0 },
- { 0x1f43, 0x1f45,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0 },
- { 0x1f4a, 0x1f4c,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0 },
- { 0x1f4b, 0x1f4d,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0 },
- { 0x1f52, 0x1f54,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0, 0x1f56,      0,      0,      0 },
- { 0x1f53, 0x1f55,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0, 0x1f57,      0,      0,      0 },
- { 0x1f5b, 0x1f5d,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0, 0x1f5f,      0,      0,      0 },
- { 0x1f62, 0x1f64,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0, 0x1f66, 0x1fa0,      0,      0 },
- { 0x1f63, 0x1f65,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0, 0x1f67, 0x1fa1,      0,      0 },
- { 0x1f6a, 0x1f6c,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0, 0x1f6e, 0x1fa8,      0,      0 },
- { 0x1f6b, 0x1f6d,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0, 0x1f6f, 0x1fa9,      0,      0 },
- { 0x1fcd, 0x1fce,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0, 0x1fcf,      0,      0,      0 },
- { 0x1fdd, 0x1fde,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0, 0x1fdf,      0,      0,      0 },
- {      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0, 0x3070, 0x3071 },
- {      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0, 0x3073, 0x3074 },
- {      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0, 0x3076, 0x3077 },
- {      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0, 0x3079, 0x307a },
- {      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0, 0x307c, 0x307d },
- {      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0, 0x30d0, 0x30d1 },
- {      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0, 0x30d3, 0x30d4 },
- {      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0, 0x30d6, 0x30d7 },
- {      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0, 0x30d9, 0x30da },
- {      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0, 0x30dc, 0x30dd }
-};
diff --git a/lib/contrib/gunidecomp.h b/lib/contrib/gunidecomp.h
deleted file mode 100644 (file)
index 1c48c21..0000000
+++ /dev/null
@@ -1,10363 +0,0 @@
-/* This file is automatically generated.  DO NOT EDIT!
-   Instead, edit gen-unicode-tables.pl and re-run.  */
-
-#ifndef DECOMP_H
-#define DECOMP_H
-
-#define G_UNICODE_LAST_CHAR 0x10ffff
-
-#define G_UNICODE_MAX_TABLE_INDEX (0x110000 / 256)
-
-#define G_UNICODE_LAST_CHAR_PART1 0x2FAFF
-
-#define G_UNICODE_LAST_PAGE_PART1 762
-
-#define G_UNICODE_NOT_PRESENT_OFFSET 65535
-
-static const guchar cclass_data[][256] = {
-  { /* page 3, index 0 */
-    230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 
-    230, 230, 230, 230, 230, 230, 230, 232, 220, 220, 220, 220, 232, 216, 
-    220, 220, 220, 220, 220, 202, 202, 220, 220, 220, 220, 202, 202, 220, 
-    220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1, 1, 1, 1, 1, 220, 
-    220, 220, 220, 230, 230, 230, 230, 230, 230, 230, 230, 240, 230, 220, 
-    220, 220, 230, 230, 230, 220, 220, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 234, 234, 233, 230, 230, 230, 230, 230, 230, 230, 230, 230, 
-    230, 230, 230, 230, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0
-  },
-  { /* page 4, index 1 */
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 230, 230, 230, 230, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
-  },
-  { /* page 5, index 2 */
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 220, 230, 230, 230, 230, 220, 230, 230, 230, 222, 220, 230, 230, 230, 
-    230, 230, 230, 0, 220, 220, 220, 220, 220, 230, 230, 220, 230, 230, 222, 
-    228, 230, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 0, 20, 21, 22, 0, 23, 
-    0, 24, 25, 0, 230, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
-  },
-  { /* page 6, index 3 */
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 27, 28, 29, 30, 31, 32, 33, 34, 230, 230, 220, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 35, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 230, 230, 230, 230, 230, 230, 230, 0, 0, 230, 230, 230, 230, 220, 
-    230, 0, 0, 230, 230, 0, 220, 230, 230, 220, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0
-  },
-  { /* page 7, index 4 */
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 36, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    230, 220, 230, 230, 220, 230, 230, 220, 220, 220, 230, 220, 220, 230, 
-    220, 230, 230, 230, 220, 230, 220, 230, 220, 230, 220, 230, 230, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0
-  },
-  { /* page 9, index 5 */
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 9, 0, 0, 0, 230, 220, 230, 230, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
-  },
-  { /* page 10, index 6 */
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
-  },
-  { /* page 11, index 7 */
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
-  },
-  { /* page 12, index 8 */
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 84, 91, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
-  },
-  { /* page 13, index 9 */
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
-  },
-  { /* page 14, index 10 */
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 103, 103, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 107, 107, 107, 107, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 118, 118, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 122, 122, 122, 122, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
-  },
-  { /* page 15, index 11 */
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    220, 220, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 220, 0, 220, 0, 216, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 129, 130, 0, 
-    132, 0, 0, 0, 0, 0, 130, 130, 130, 130, 0, 0, 130, 0, 230, 230, 9, 0, 
-    230, 230, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 220, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0
-  },
-  { /* page 16, index 12 */
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 7, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
-  },
-  { /* page 23, index 13 */
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
-  },
-  { /* page 24, index 14 */
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 228, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
-  },
-  { /* page 32, index 15 */
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 230, 230, 1, 1, 230, 230, 
-    230, 230, 1, 1, 1, 230, 230, 0, 0, 0, 0, 230, 0, 0, 0, 1, 1, 230, 220, 
-    230, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
-  },
-  { /* page 48, index 16 */
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 218, 228, 232, 222, 
-    224, 224, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
-  },
-  { /* page 251, index 17 */
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 26, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
-  },
-  { /* page 254, index 18 */
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 230, 230, 230, 230, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
-  },
-  { /* page 465, index 19 */
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 216, 216, 1, 1, 1, 0, 0, 0, 226, 216, 216, 216, 216, 216, 
-    0, 0, 0, 0, 0, 0, 0, 0, 220, 220, 220, 220, 220, 220, 220, 220, 0, 0, 
-    230, 230, 230, 230, 230, 220, 220, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 230, 230, 230, 230, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0
-  }
-};
-
-static const gint16 combining_class_table_part1[763] = {
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 /* page 3 */,
-  1 /* page 4 */,
-  2 /* page 5 */,
-  3 /* page 6 */,
-  4 /* page 7 */,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  5 /* page 9 */,
-  6 /* page 10 */,
-  7 /* page 11 */,
-  8 /* page 12 */,
-  9 /* page 13 */,
-  10 /* page 14 */,
-  11 /* page 15 */,
-  12 /* page 16 */,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  13 /* page 23 */,
-  14 /* page 24 */,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  15 /* page 32 */,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  16 /* page 48 */,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  17 /* page 251 */,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  18 /* page 254 */,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  19 /* page 465 */,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX
-};
-
-static const gint16 combining_class_table_part2[768] = {
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX,
-  0 + G_UNICODE_MAX_TABLE_INDEX
-};
-
-typedef struct
-{
-  gunichar ch;
-  guint16 canon_offset;
-  guint16 compat_offset;
-} decomposition;
-
-static const decomposition decomp_table[] =
-{
-  { 0x00a0, G_UNICODE_NOT_PRESENT_OFFSET, 0 },
-  { 0x00a8, G_UNICODE_NOT_PRESENT_OFFSET, 2 },
-  { 0x00aa, G_UNICODE_NOT_PRESENT_OFFSET, 6 },
-  { 0x00af, G_UNICODE_NOT_PRESENT_OFFSET, 8 },
-  { 0x00b2, G_UNICODE_NOT_PRESENT_OFFSET, 12 },
-  { 0x00b3, G_UNICODE_NOT_PRESENT_OFFSET, 14 },
-  { 0x00b4, G_UNICODE_NOT_PRESENT_OFFSET, 16 },
-  { 0x00b5, G_UNICODE_NOT_PRESENT_OFFSET, 20 },
-  { 0x00b8, G_UNICODE_NOT_PRESENT_OFFSET, 23 },
-  { 0x00b9, G_UNICODE_NOT_PRESENT_OFFSET, 27 },
-  { 0x00ba, G_UNICODE_NOT_PRESENT_OFFSET, 29 },
-  { 0x00bc, G_UNICODE_NOT_PRESENT_OFFSET, 31 },
-  { 0x00bd, G_UNICODE_NOT_PRESENT_OFFSET, 37 },
-  { 0x00be, G_UNICODE_NOT_PRESENT_OFFSET, 43 },
-  { 0x00c0, 49, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x00c1, 53, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x00c2, 57, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x00c3, 61, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x00c4, 65, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x00c5, 69, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x00c7, 73, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x00c8, 77, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x00c9, 81, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x00ca, 85, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x00cb, 89, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x00cc, 93, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x00cd, 97, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x00ce, 101, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x00cf, 105, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x00d1, 109, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x00d2, 113, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x00d3, 117, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x00d4, 121, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x00d5, 125, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x00d6, 129, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x00d9, 133, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x00da, 137, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x00db, 141, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x00dc, 145, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x00dd, 149, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x00e0, 153, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x00e1, 157, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x00e2, 161, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x00e3, 165, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x00e4, 169, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x00e5, 173, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x00e7, 177, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x00e8, 181, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x00e9, 185, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x00ea, 189, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x00eb, 193, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x00ec, 197, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x00ed, 201, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x00ee, 205, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x00ef, 209, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x00f1, 213, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x00f2, 217, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x00f3, 221, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x00f4, 225, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x00f5, 229, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x00f6, 233, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x00f9, 237, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x00fa, 241, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x00fb, 245, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x00fc, 249, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x00fd, 253, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x00ff, 257, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x0100, 261, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x0101, 265, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x0102, 269, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x0103, 273, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x0104, 277, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x0105, 281, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x0106, 285, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x0107, 289, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x0108, 293, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x0109, 297, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x010a, 301, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x010b, 305, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x010c, 309, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x010d, 313, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x010e, 317, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x010f, 321, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x0112, 325, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x0113, 329, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x0114, 333, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x0115, 337, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x0116, 341, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x0117, 345, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x0118, 349, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x0119, 353, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x011a, 357, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x011b, 361, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x011c, 365, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x011d, 369, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x011e, 373, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x011f, 377, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x0120, 381, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x0121, 385, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x0122, 389, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x0123, 393, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x0124, 397, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x0125, 401, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x0128, 405, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x0129, 409, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x012a, 413, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x012b, 417, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x012c, 421, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x012d, 425, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x012e, 429, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x012f, 433, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x0130, 437, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x0132, G_UNICODE_NOT_PRESENT_OFFSET, 441 },
-  { 0x0133, G_UNICODE_NOT_PRESENT_OFFSET, 444 },
-  { 0x0134, 447, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x0135, 451, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x0136, 455, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x0137, 459, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x0139, 463, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x013a, 467, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x013b, 471, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x013c, 475, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x013d, 479, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x013e, 483, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x013f, G_UNICODE_NOT_PRESENT_OFFSET, 487 },
-  { 0x0140, G_UNICODE_NOT_PRESENT_OFFSET, 491 },
-  { 0x0143, 495, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x0144, 499, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x0145, 503, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x0146, 507, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x0147, 511, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x0148, 515, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x0149, G_UNICODE_NOT_PRESENT_OFFSET, 519 },
-  { 0x014c, 523, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x014d, 527, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x014e, 531, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x014f, 535, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x0150, 539, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x0151, 543, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x0154, 547, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x0155, 551, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x0156, 555, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x0157, 559, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x0158, 563, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x0159, 567, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x015a, 571, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x015b, 575, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x015c, 579, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x015d, 583, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x015e, 587, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x015f, 591, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x0160, 595, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x0161, 599, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x0162, 603, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x0163, 607, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x0164, 611, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x0165, 615, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x0168, 619, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x0169, 623, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x016a, 627, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x016b, 631, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x016c, 635, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x016d, 639, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x016e, 643, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x016f, 647, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x0170, 651, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x0171, 655, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x0172, 659, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x0173, 663, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x0174, 667, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x0175, 671, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x0176, 675, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x0177, 679, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x0178, 683, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x0179, 687, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x017a, 691, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x017b, 695, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x017c, 699, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x017d, 703, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x017e, 707, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x017f, G_UNICODE_NOT_PRESENT_OFFSET, 711 },
-  { 0x01a0, 713, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x01a1, 717, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x01af, 721, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x01b0, 725, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x01c4, G_UNICODE_NOT_PRESENT_OFFSET, 729 },
-  { 0x01c5, G_UNICODE_NOT_PRESENT_OFFSET, 734 },
-  { 0x01c6, G_UNICODE_NOT_PRESENT_OFFSET, 739 },
-  { 0x01c7, G_UNICODE_NOT_PRESENT_OFFSET, 744 },
-  { 0x01c8, G_UNICODE_NOT_PRESENT_OFFSET, 747 },
-  { 0x01c9, G_UNICODE_NOT_PRESENT_OFFSET, 750 },
-  { 0x01ca, G_UNICODE_NOT_PRESENT_OFFSET, 753 },
-  { 0x01cb, G_UNICODE_NOT_PRESENT_OFFSET, 756 },
-  { 0x01cc, G_UNICODE_NOT_PRESENT_OFFSET, 759 },
-  { 0x01cd, 762, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x01ce, 766, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x01cf, 770, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x01d0, 774, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x01d1, 778, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x01d2, 782, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x01d3, 786, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x01d4, 790, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x01d5, 794, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x01d6, 800, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x01d7, 806, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x01d8, 812, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x01d9, 818, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x01da, 824, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x01db, 830, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x01dc, 836, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x01de, 842, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x01df, 848, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x01e0, 854, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x01e1, 860, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x01e2, 866, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x01e3, 871, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x01e6, 876, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x01e7, 880, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x01e8, 884, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x01e9, 888, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x01ea, 892, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x01eb, 896, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x01ec, 900, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x01ed, 906, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x01ee, 912, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x01ef, 917, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x01f0, 922, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x01f1, G_UNICODE_NOT_PRESENT_OFFSET, 926 },
-  { 0x01f2, G_UNICODE_NOT_PRESENT_OFFSET, 929 },
-  { 0x01f3, G_UNICODE_NOT_PRESENT_OFFSET, 932 },
-  { 0x01f4, 935, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x01f5, 939, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x01f8, 943, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x01f9, 947, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x01fa, 951, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x01fb, 957, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x01fc, 963, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x01fd, 968, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x01fe, 973, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x01ff, 978, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x0200, 983, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x0201, 987, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x0202, 991, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x0203, 995, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x0204, 999, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x0205, 1003, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x0206, 1007, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x0207, 1011, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x0208, 1015, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x0209, 1019, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x020a, 1023, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x020b, 1027, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x020c, 1031, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x020d, 1035, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x020e, 1039, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x020f, 1043, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x0210, 1047, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x0211, 1051, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x0212, 1055, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x0213, 1059, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x0214, 1063, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x0215, 1067, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x0216, 1071, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x0217, 1075, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x0218, 1079, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x0219, 1083, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x021a, 1087, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x021b, 1091, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x021e, 1095, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x021f, 1099, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x0226, 1103, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x0227, 1107, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x0228, 1111, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x0229, 1115, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x022a, 1119, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x022b, 1125, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x022c, 1131, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x022d, 1137, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x022e, 1143, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x022f, 1147, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x0230, 1151, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x0231, 1157, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x0232, 1163, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x0233, 1167, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x02b0, G_UNICODE_NOT_PRESENT_OFFSET, 1171 },
-  { 0x02b1, G_UNICODE_NOT_PRESENT_OFFSET, 1173 },
-  { 0x02b2, G_UNICODE_NOT_PRESENT_OFFSET, 1176 },
-  { 0x02b3, G_UNICODE_NOT_PRESENT_OFFSET, 1178 },
-  { 0x02b4, G_UNICODE_NOT_PRESENT_OFFSET, 1180 },
-  { 0x02b5, G_UNICODE_NOT_PRESENT_OFFSET, 1183 },
-  { 0x02b6, G_UNICODE_NOT_PRESENT_OFFSET, 1186 },
-  { 0x02b7, G_UNICODE_NOT_PRESENT_OFFSET, 1189 },
-  { 0x02b8, G_UNICODE_NOT_PRESENT_OFFSET, 1191 },
-  { 0x02d8, G_UNICODE_NOT_PRESENT_OFFSET, 1193 },
-  { 0x02d9, G_UNICODE_NOT_PRESENT_OFFSET, 1197 },
-  { 0x02da, G_UNICODE_NOT_PRESENT_OFFSET, 1201 },
-  { 0x02db, G_UNICODE_NOT_PRESENT_OFFSET, 1205 },
-  { 0x02dc, G_UNICODE_NOT_PRESENT_OFFSET, 1209 },
-  { 0x02dd, G_UNICODE_NOT_PRESENT_OFFSET, 1213 },
-  { 0x02e0, G_UNICODE_NOT_PRESENT_OFFSET, 1217 },
-  { 0x02e1, G_UNICODE_NOT_PRESENT_OFFSET, 1220 },
-  { 0x02e2, G_UNICODE_NOT_PRESENT_OFFSET, 711 },
-  { 0x02e3, G_UNICODE_NOT_PRESENT_OFFSET, 1222 },
-  { 0x02e4, G_UNICODE_NOT_PRESENT_OFFSET, 1224 },
-  { 0x0340, 1227, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x0341, 1230, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x0343, 1233, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x0344, 1236, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x0374, 1241, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x037a, G_UNICODE_NOT_PRESENT_OFFSET, 1244 },
-  { 0x037e, 1248, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x0384, G_UNICODE_NOT_PRESENT_OFFSET, 16 },
-  { 0x0385, 1250, 1255 },
-  { 0x0386, 1261, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x0387, 1266, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x0388, 1269, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x0389, 1274, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x038a, 1279, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x038c, 1284, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x038e, 1289, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x038f, 1294, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x0390, 1299, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x03aa, 1306, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x03ab, 1311, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x03ac, 1316, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x03ad, 1321, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x03ae, 1326, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x03af, 1331, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x03b0, 1336, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x03ca, 1343, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x03cb, 1348, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x03cc, 1353, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x03cd, 1358, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x03ce, 1363, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x03d0, G_UNICODE_NOT_PRESENT_OFFSET, 1368 },
-  { 0x03d1, G_UNICODE_NOT_PRESENT_OFFSET, 1371 },
-  { 0x03d2, G_UNICODE_NOT_PRESENT_OFFSET, 1374 },
-  { 0x03d3, 1377, 1289 },
-  { 0x03d4, 1382, 1311 },
-  { 0x03d5, G_UNICODE_NOT_PRESENT_OFFSET, 1387 },
-  { 0x03d6, G_UNICODE_NOT_PRESENT_OFFSET, 1390 },
-  { 0x03f0, G_UNICODE_NOT_PRESENT_OFFSET, 1393 },
-  { 0x03f1, G_UNICODE_NOT_PRESENT_OFFSET, 1396 },
-  { 0x03f2, G_UNICODE_NOT_PRESENT_OFFSET, 1399 },
-  { 0x03f4, G_UNICODE_NOT_PRESENT_OFFSET, 1402 },
-  { 0x03f5, G_UNICODE_NOT_PRESENT_OFFSET, 1405 },
-  { 0x0400, 1408, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x0401, 1413, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x0403, 1418, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x0407, 1423, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x040c, 1428, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x040d, 1433, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x040e, 1438, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x0419, 1443, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x0439, 1448, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x0450, 1453, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x0451, 1458, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x0453, 1463, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x0457, 1468, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x045c, 1473, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x045d, 1478, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x045e, 1483, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x0476, 1488, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x0477, 1493, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x04c1, 1498, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x04c2, 1503, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x04d0, 1508, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x04d1, 1513, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x04d2, 1518, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x04d3, 1523, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x04d6, 1528, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x04d7, 1533, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x04da, 1538, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x04db, 1543, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x04dc, 1548, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x04dd, 1553, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x04de, 1558, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x04df, 1563, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x04e2, 1568, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x04e3, 1573, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x04e4, 1578, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x04e5, 1583, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x04e6, 1588, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x04e7, 1593, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x04ea, 1598, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x04eb, 1603, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x04ec, 1608, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x04ed, 1613, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x04ee, 1618, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x04ef, 1623, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x04f0, 1628, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x04f1, 1633, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x04f2, 1638, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x04f3, 1643, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x04f4, 1648, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x04f5, 1653, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x04f8, 1658, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x04f9, 1663, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x0587, G_UNICODE_NOT_PRESENT_OFFSET, 1668 },
-  { 0x0622, 1673, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x0623, 1678, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x0624, 1683, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x0625, 1688, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x0626, 1693, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x0675, G_UNICODE_NOT_PRESENT_OFFSET, 1698 },
-  { 0x0676, G_UNICODE_NOT_PRESENT_OFFSET, 1703 },
-  { 0x0677, G_UNICODE_NOT_PRESENT_OFFSET, 1708 },
-  { 0x0678, G_UNICODE_NOT_PRESENT_OFFSET, 1713 },
-  { 0x06c0, 1718, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x06c2, 1723, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x06d3, 1728, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x0929, 1733, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x0931, 1740, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x0934, 1747, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x0958, 1754, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x0959, 1761, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x095a, 1768, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x095b, 1775, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x095c, 1782, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x095d, 1789, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x095e, 1796, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x095f, 1803, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x09cb, 1810, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x09cc, 1817, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x09dc, 1824, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x09dd, 1831, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x09df, 1838, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x0a33, 1845, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x0a36, 1852, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x0a59, 1859, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x0a5a, 1866, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x0a5b, 1873, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x0a5e, 1880, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x0b48, 1887, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x0b4b, 1894, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x0b4c, 1901, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x0b5c, 1908, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x0b5d, 1915, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x0b94, 1922, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x0bca, 1929, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x0bcb, 1936, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x0bcc, 1943, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x0c48, 1950, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x0cc0, 1957, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x0cc7, 1964, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x0cc8, 1971, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x0cca, 1978, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x0ccb, 1985, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x0d4a, 1995, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x0d4b, 2002, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x0d4c, 2009, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x0dda, 2016, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x0ddc, 2023, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x0ddd, 2030, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x0dde, 2040, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x0e33, G_UNICODE_NOT_PRESENT_OFFSET, 2047 },
-  { 0x0eb3, G_UNICODE_NOT_PRESENT_OFFSET, 2054 },
-  { 0x0edc, G_UNICODE_NOT_PRESENT_OFFSET, 2061 },
-  { 0x0edd, G_UNICODE_NOT_PRESENT_OFFSET, 2068 },
-  { 0x0f0c, G_UNICODE_NOT_PRESENT_OFFSET, 2075 },
-  { 0x0f43, 2079, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x0f4d, 2086, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x0f52, 2093, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x0f57, 2100, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x0f5c, 2107, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x0f69, 2114, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x0f73, 2121, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x0f75, 2128, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x0f76, 2135, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x0f77, G_UNICODE_NOT_PRESENT_OFFSET, 2142 },
-  { 0x0f78, 2152, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x0f79, G_UNICODE_NOT_PRESENT_OFFSET, 2159 },
-  { 0x0f81, 2169, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x0f93, 2176, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x0f9d, 2183, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x0fa2, 2190, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x0fa7, 2197, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x0fac, 2204, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x0fb9, 2211, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1026, 2218, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1e00, 2225, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1e01, 2229, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1e02, 2233, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1e03, 2237, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1e04, 2241, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1e05, 2245, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1e06, 2249, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1e07, 2253, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1e08, 2257, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1e09, 2263, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1e0a, 2269, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1e0b, 2273, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1e0c, 2277, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1e0d, 2281, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1e0e, 2285, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1e0f, 2289, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1e10, 2293, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1e11, 2297, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1e12, 2301, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1e13, 2305, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1e14, 2309, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1e15, 2315, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1e16, 2321, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1e17, 2327, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1e18, 2333, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1e19, 2337, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1e1a, 2341, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1e1b, 2345, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1e1c, 2349, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1e1d, 2355, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1e1e, 2361, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1e1f, 2365, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1e20, 2369, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1e21, 2373, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1e22, 2377, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1e23, 2381, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1e24, 2385, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1e25, 2389, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1e26, 2393, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1e27, 2397, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1e28, 2401, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1e29, 2405, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1e2a, 2409, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1e2b, 2413, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1e2c, 2417, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1e2d, 2421, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1e2e, 2425, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1e2f, 2431, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1e30, 2437, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1e31, 2441, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1e32, 2445, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1e33, 2449, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1e34, 2453, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1e35, 2457, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1e36, 2461, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1e37, 2465, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1e38, 2469, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1e39, 2475, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1e3a, 2481, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1e3b, 2485, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1e3c, 2489, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1e3d, 2493, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1e3e, 2497, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1e3f, 2501, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1e40, 2505, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1e41, 2509, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1e42, 2513, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1e43, 2517, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1e44, 2521, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1e45, 2525, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1e46, 2529, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1e47, 2533, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1e48, 2537, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1e49, 2541, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1e4a, 2545, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1e4b, 2549, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1e4c, 2553, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1e4d, 2559, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1e4e, 2565, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1e4f, 2571, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1e50, 2577, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1e51, 2583, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1e52, 2589, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1e53, 2595, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1e54, 2601, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1e55, 2605, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1e56, 2609, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1e57, 2613, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1e58, 2617, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1e59, 2621, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1e5a, 2625, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1e5b, 2629, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1e5c, 2633, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1e5d, 2639, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1e5e, 2645, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1e5f, 2649, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1e60, 2653, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1e61, 2657, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1e62, 2661, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1e63, 2665, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1e64, 2669, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1e65, 2675, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1e66, 2681, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1e67, 2687, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1e68, 2693, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1e69, 2699, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1e6a, 2705, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1e6b, 2709, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1e6c, 2713, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1e6d, 2717, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1e6e, 2721, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1e6f, 2725, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1e70, 2729, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1e71, 2733, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1e72, 2737, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1e73, 2741, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1e74, 2745, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1e75, 2749, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1e76, 2753, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1e77, 2757, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1e78, 2761, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1e79, 2767, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1e7a, 2773, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1e7b, 2779, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1e7c, 2785, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1e7d, 2789, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1e7e, 2793, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1e7f, 2797, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1e80, 2801, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1e81, 2805, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1e82, 2809, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1e83, 2813, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1e84, 2817, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1e85, 2821, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1e86, 2825, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1e87, 2829, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1e88, 2833, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1e89, 2837, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1e8a, 2841, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1e8b, 2845, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1e8c, 2849, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1e8d, 2853, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1e8e, 2857, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1e8f, 2861, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1e90, 2865, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1e91, 2869, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1e92, 2873, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1e93, 2877, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1e94, 2881, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1e95, 2885, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1e96, 2889, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1e97, 2893, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1e98, 2897, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1e99, 2901, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1e9a, G_UNICODE_NOT_PRESENT_OFFSET, 2905 },
-  { 0x1e9b, 2909, 2657 },
-  { 0x1ea0, 2914, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1ea1, 2918, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1ea2, 2922, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1ea3, 2926, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1ea4, 2930, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1ea5, 2936, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1ea6, 2942, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1ea7, 2948, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1ea8, 2954, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1ea9, 2960, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1eaa, 2966, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1eab, 2972, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1eac, 2978, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1ead, 2984, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1eae, 2990, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1eaf, 2996, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1eb0, 3002, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1eb1, 3008, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1eb2, 3014, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1eb3, 3020, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1eb4, 3026, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1eb5, 3032, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1eb6, 3038, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1eb7, 3044, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1eb8, 3050, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1eb9, 3054, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1eba, 3058, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1ebb, 3062, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1ebc, 3066, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1ebd, 3070, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1ebe, 3074, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1ebf, 3080, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1ec0, 3086, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1ec1, 3092, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1ec2, 3098, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1ec3, 3104, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1ec4, 3110, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1ec5, 3116, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1ec6, 3122, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1ec7, 3128, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1ec8, 3134, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1ec9, 3138, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1eca, 3142, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1ecb, 3146, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1ecc, 3150, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1ecd, 3154, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1ece, 3158, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1ecf, 3162, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1ed0, 3166, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1ed1, 3172, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1ed2, 3178, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1ed3, 3184, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1ed4, 3190, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1ed5, 3196, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1ed6, 3202, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1ed7, 3208, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1ed8, 3214, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1ed9, 3220, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1eda, 3226, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1edb, 3232, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1edc, 3238, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1edd, 3244, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1ede, 3250, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1edf, 3256, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1ee0, 3262, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1ee1, 3268, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1ee2, 3274, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1ee3, 3280, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1ee4, 3286, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1ee5, 3290, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1ee6, 3294, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1ee7, 3298, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1ee8, 3302, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1ee9, 3308, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1eea, 3314, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1eeb, 3320, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1eec, 3326, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1eed, 3332, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1eee, 3338, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1eef, 3344, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1ef0, 3350, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1ef1, 3356, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1ef2, 3362, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1ef3, 3366, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1ef4, 3370, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1ef5, 3374, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1ef6, 3378, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1ef7, 3382, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1ef8, 3386, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1ef9, 3390, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1f00, 3394, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1f01, 3399, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1f02, 3404, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1f03, 3411, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1f04, 3418, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1f05, 3425, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1f06, 3432, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1f07, 3439, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1f08, 3446, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1f09, 3451, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1f0a, 3456, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1f0b, 3463, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1f0c, 3470, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1f0d, 3477, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1f0e, 3484, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1f0f, 3491, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1f10, 3498, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1f11, 3503, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1f12, 3508, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1f13, 3515, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1f14, 3522, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1f15, 3529, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1f18, 3536, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1f19, 3541, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1f1a, 3546, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1f1b, 3553, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1f1c, 3560, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1f1d, 3567, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1f20, 3574, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1f21, 3579, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1f22, 3584, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1f23, 3591, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1f24, 3598, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1f25, 3605, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1f26, 3612, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1f27, 3619, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1f28, 3626, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1f29, 3631, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1f2a, 3636, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1f2b, 3643, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1f2c, 3650, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1f2d, 3657, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1f2e, 3664, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1f2f, 3671, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1f30, 3678, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1f31, 3683, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1f32, 3688, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1f33, 3695, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1f34, 3702, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1f35, 3709, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1f36, 3716, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1f37, 3723, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1f38, 3730, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1f39, 3735, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1f3a, 3740, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1f3b, 3747, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1f3c, 3754, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1f3d, 3761, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1f3e, 3768, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1f3f, 3775, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1f40, 3782, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1f41, 3787, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1f42, 3792, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1f43, 3799, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1f44, 3806, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1f45, 3813, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1f48, 3820, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1f49, 3825, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1f4a, 3830, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1f4b, 3837, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1f4c, 3844, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1f4d, 3851, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1f50, 3858, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1f51, 3863, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1f52, 3868, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1f53, 3875, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1f54, 3882, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1f55, 3889, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1f56, 3896, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1f57, 3903, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1f59, 3910, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1f5b, 3915, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1f5d, 3922, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1f5f, 3929, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1f60, 3936, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1f61, 3941, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1f62, 3946, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1f63, 3953, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1f64, 3960, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1f65, 3967, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1f66, 3974, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1f67, 3981, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1f68, 3988, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1f69, 3993, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1f6a, 3998, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1f6b, 4005, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1f6c, 4012, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1f6d, 4019, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1f6e, 4026, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1f6f, 4033, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1f70, 4040, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1f71, 1316, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1f72, 4045, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1f73, 1321, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1f74, 4050, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1f75, 1326, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1f76, 4055, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1f77, 1331, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1f78, 4060, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1f79, 1353, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1f7a, 4065, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1f7b, 1358, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1f7c, 4070, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1f7d, 1363, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1f80, 4075, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1f81, 4082, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1f82, 4089, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1f83, 4098, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1f84, 4107, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1f85, 4116, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1f86, 4125, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1f87, 4134, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1f88, 4143, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1f89, 4150, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1f8a, 4157, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1f8b, 4166, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1f8c, 4175, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1f8d, 4184, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1f8e, 4193, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1f8f, 4202, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1f90, 4211, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1f91, 4218, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1f92, 4225, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1f93, 4234, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1f94, 4243, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1f95, 4252, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1f96, 4261, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1f97, 4270, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1f98, 4279, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1f99, 4286, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1f9a, 4293, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1f9b, 4302, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1f9c, 4311, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1f9d, 4320, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1f9e, 4329, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1f9f, 4338, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1fa0, 4347, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1fa1, 4354, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1fa2, 4361, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1fa3, 4370, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1fa4, 4379, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1fa5, 4388, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1fa6, 4397, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1fa7, 4406, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1fa8, 4415, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1fa9, 4422, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1faa, 4429, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1fab, 4438, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1fac, 4447, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1fad, 4456, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1fae, 4465, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1faf, 4474, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1fb0, 4483, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1fb1, 4488, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1fb2, 4493, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1fb3, 4500, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1fb4, 4505, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1fb6, 4512, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1fb7, 4517, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1fb8, 4524, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1fb9, 4529, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1fba, 4534, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1fbb, 1261, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1fbc, 4539, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1fbd, G_UNICODE_NOT_PRESENT_OFFSET, 4544 },
-  { 0x1fbe, 4548, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1fbf, G_UNICODE_NOT_PRESENT_OFFSET, 4544 },
-  { 0x1fc0, G_UNICODE_NOT_PRESENT_OFFSET, 4551 },
-  { 0x1fc1, 4555, 4560 },
-  { 0x1fc2, 4566, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1fc3, 4573, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1fc4, 4578, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1fc6, 4585, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1fc7, 4590, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1fc8, 4597, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1fc9, 1269, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1fca, 4602, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1fcb, 1274, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1fcc, 4607, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1fcd, 4612, 4618 },
-  { 0x1fce, 4624, 4630 },
-  { 0x1fcf, 4636, 4642 },
-  { 0x1fd0, 4648, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1fd1, 4653, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1fd2, 4658, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1fd3, 1299, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1fd6, 4665, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1fd7, 4670, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1fd8, 4677, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1fd9, 4682, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1fda, 4687, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1fdb, 1279, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1fdd, 4692, 4698 },
-  { 0x1fde, 4704, 4710 },
-  { 0x1fdf, 4716, 4722 },
-  { 0x1fe0, 4728, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1fe1, 4733, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1fe2, 4738, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1fe3, 1336, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1fe4, 4745, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1fe5, 4750, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1fe6, 4755, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1fe7, 4760, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1fe8, 4767, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1fe9, 4772, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1fea, 4777, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1feb, 1289, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1fec, 4782, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1fed, 4787, 4792 },
-  { 0x1fee, 1250, 1255 },
-  { 0x1fef, 4798, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1ff2, 4800, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1ff3, 4807, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1ff4, 4812, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1ff6, 4819, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1ff7, 4824, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1ff8, 4831, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1ff9, 1284, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1ffa, 4836, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1ffb, 1294, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1ffc, 4841, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1ffd, 4846, 16 },
-  { 0x1ffe, G_UNICODE_NOT_PRESENT_OFFSET, 4849 },
-  { 0x2000, 4853, 0 },
-  { 0x2001, 4857, 0 },
-  { 0x2002, G_UNICODE_NOT_PRESENT_OFFSET, 0 },
-  { 0x2003, G_UNICODE_NOT_PRESENT_OFFSET, 0 },
-  { 0x2004, G_UNICODE_NOT_PRESENT_OFFSET, 0 },
-  { 0x2005, G_UNICODE_NOT_PRESENT_OFFSET, 0 },
-  { 0x2006, G_UNICODE_NOT_PRESENT_OFFSET, 0 },
-  { 0x2007, G_UNICODE_NOT_PRESENT_OFFSET, 0 },
-  { 0x2008, G_UNICODE_NOT_PRESENT_OFFSET, 0 },
-  { 0x2009, G_UNICODE_NOT_PRESENT_OFFSET, 0 },
-  { 0x200a, G_UNICODE_NOT_PRESENT_OFFSET, 0 },
-  { 0x2011, G_UNICODE_NOT_PRESENT_OFFSET, 4861 },
-  { 0x2017, G_UNICODE_NOT_PRESENT_OFFSET, 4865 },
-  { 0x2024, G_UNICODE_NOT_PRESENT_OFFSET, 4869 },
-  { 0x2025, G_UNICODE_NOT_PRESENT_OFFSET, 4871 },
-  { 0x2026, G_UNICODE_NOT_PRESENT_OFFSET, 4874 },
-  { 0x202f, G_UNICODE_NOT_PRESENT_OFFSET, 0 },
-  { 0x2033, G_UNICODE_NOT_PRESENT_OFFSET, 4878 },
-  { 0x2034, G_UNICODE_NOT_PRESENT_OFFSET, 4885 },
-  { 0x2036, G_UNICODE_NOT_PRESENT_OFFSET, 4895 },
-  { 0x2037, G_UNICODE_NOT_PRESENT_OFFSET, 4902 },
-  { 0x203c, G_UNICODE_NOT_PRESENT_OFFSET, 4912 },
-  { 0x203e, G_UNICODE_NOT_PRESENT_OFFSET, 4915 },
-  { 0x2047, G_UNICODE_NOT_PRESENT_OFFSET, 4919 },
-  { 0x2048, G_UNICODE_NOT_PRESENT_OFFSET, 4922 },
-  { 0x2049, G_UNICODE_NOT_PRESENT_OFFSET, 4925 },
-  { 0x2057, G_UNICODE_NOT_PRESENT_OFFSET, 4928 },
-  { 0x205f, G_UNICODE_NOT_PRESENT_OFFSET, 0 },
-  { 0x2070, G_UNICODE_NOT_PRESENT_OFFSET, 4941 },
-  { 0x2071, G_UNICODE_NOT_PRESENT_OFFSET, 4943 },
-  { 0x2074, G_UNICODE_NOT_PRESENT_OFFSET, 4945 },
-  { 0x2075, G_UNICODE_NOT_PRESENT_OFFSET, 4947 },
-  { 0x2076, G_UNICODE_NOT_PRESENT_OFFSET, 4949 },
-  { 0x2077, G_UNICODE_NOT_PRESENT_OFFSET, 4951 },
-  { 0x2078, G_UNICODE_NOT_PRESENT_OFFSET, 4953 },
-  { 0x2079, G_UNICODE_NOT_PRESENT_OFFSET, 4955 },
-  { 0x207a, G_UNICODE_NOT_PRESENT_OFFSET, 4957 },
-  { 0x207b, G_UNICODE_NOT_PRESENT_OFFSET, 4959 },
-  { 0x207c, G_UNICODE_NOT_PRESENT_OFFSET, 4963 },
-  { 0x207d, G_UNICODE_NOT_PRESENT_OFFSET, 4965 },
-  { 0x207e, G_UNICODE_NOT_PRESENT_OFFSET, 4967 },
-  { 0x207f, G_UNICODE_NOT_PRESENT_OFFSET, 4969 },
-  { 0x2080, G_UNICODE_NOT_PRESENT_OFFSET, 4941 },
-  { 0x2081, G_UNICODE_NOT_PRESENT_OFFSET, 27 },
-  { 0x2082, G_UNICODE_NOT_PRESENT_OFFSET, 12 },
-  { 0x2083, G_UNICODE_NOT_PRESENT_OFFSET, 14 },
-  { 0x2084, G_UNICODE_NOT_PRESENT_OFFSET, 4945 },
-  { 0x2085, G_UNICODE_NOT_PRESENT_OFFSET, 4947 },
-  { 0x2086, G_UNICODE_NOT_PRESENT_OFFSET, 4949 },
-  { 0x2087, G_UNICODE_NOT_PRESENT_OFFSET, 4951 },
-  { 0x2088, G_UNICODE_NOT_PRESENT_OFFSET, 4953 },
-  { 0x2089, G_UNICODE_NOT_PRESENT_OFFSET, 4955 },
-  { 0x208a, G_UNICODE_NOT_PRESENT_OFFSET, 4957 },
-  { 0x208b, G_UNICODE_NOT_PRESENT_OFFSET, 4959 },
-  { 0x208c, G_UNICODE_NOT_PRESENT_OFFSET, 4963 },
-  { 0x208d, G_UNICODE_NOT_PRESENT_OFFSET, 4965 },
-  { 0x208e, G_UNICODE_NOT_PRESENT_OFFSET, 4967 },
-  { 0x20a8, G_UNICODE_NOT_PRESENT_OFFSET, 4971 },
-  { 0x2100, G_UNICODE_NOT_PRESENT_OFFSET, 4974 },
-  { 0x2101, G_UNICODE_NOT_PRESENT_OFFSET, 4978 },
-  { 0x2102, G_UNICODE_NOT_PRESENT_OFFSET, 4982 },
-  { 0x2103, G_UNICODE_NOT_PRESENT_OFFSET, 4984 },
-  { 0x2105, G_UNICODE_NOT_PRESENT_OFFSET, 4988 },
-  { 0x2106, G_UNICODE_NOT_PRESENT_OFFSET, 4992 },
-  { 0x2107, G_UNICODE_NOT_PRESENT_OFFSET, 4996 },
-  { 0x2109, G_UNICODE_NOT_PRESENT_OFFSET, 4999 },
-  { 0x210a, G_UNICODE_NOT_PRESENT_OFFSET, 5003 },
-  { 0x210b, G_UNICODE_NOT_PRESENT_OFFSET, 5005 },
-  { 0x210c, G_UNICODE_NOT_PRESENT_OFFSET, 5005 },
-  { 0x210d, G_UNICODE_NOT_PRESENT_OFFSET, 5005 },
-  { 0x210e, G_UNICODE_NOT_PRESENT_OFFSET, 1171 },
-  { 0x210f, G_UNICODE_NOT_PRESENT_OFFSET, 5007 },
-  { 0x2110, G_UNICODE_NOT_PRESENT_OFFSET, 5010 },
-  { 0x2111, G_UNICODE_NOT_PRESENT_OFFSET, 5010 },
-  { 0x2112, G_UNICODE_NOT_PRESENT_OFFSET, 5012 },
-  { 0x2113, G_UNICODE_NOT_PRESENT_OFFSET, 1220 },
-  { 0x2115, G_UNICODE_NOT_PRESENT_OFFSET, 5014 },
-  { 0x2116, G_UNICODE_NOT_PRESENT_OFFSET, 5016 },
-  { 0x2119, G_UNICODE_NOT_PRESENT_OFFSET, 5019 },
-  { 0x211a, G_UNICODE_NOT_PRESENT_OFFSET, 5021 },
-  { 0x211b, G_UNICODE_NOT_PRESENT_OFFSET, 5023 },
-  { 0x211c, G_UNICODE_NOT_PRESENT_OFFSET, 5023 },
-  { 0x211d, G_UNICODE_NOT_PRESENT_OFFSET, 5023 },
-  { 0x2120, G_UNICODE_NOT_PRESENT_OFFSET, 5025 },
-  { 0x2121, G_UNICODE_NOT_PRESENT_OFFSET, 5028 },
-  { 0x2122, G_UNICODE_NOT_PRESENT_OFFSET, 5032 },
-  { 0x2124, G_UNICODE_NOT_PRESENT_OFFSET, 5035 },
-  { 0x2126, 5037, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2128, G_UNICODE_NOT_PRESENT_OFFSET, 5035 },
-  { 0x212a, 5040, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x212b, 69, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x212c, G_UNICODE_NOT_PRESENT_OFFSET, 5042 },
-  { 0x212d, G_UNICODE_NOT_PRESENT_OFFSET, 4982 },
-  { 0x212f, G_UNICODE_NOT_PRESENT_OFFSET, 5044 },
-  { 0x2130, G_UNICODE_NOT_PRESENT_OFFSET, 5046 },
-  { 0x2131, G_UNICODE_NOT_PRESENT_OFFSET, 5048 },
-  { 0x2133, G_UNICODE_NOT_PRESENT_OFFSET, 5050 },
-  { 0x2134, G_UNICODE_NOT_PRESENT_OFFSET, 29 },
-  { 0x2135, G_UNICODE_NOT_PRESENT_OFFSET, 5052 },
-  { 0x2136, G_UNICODE_NOT_PRESENT_OFFSET, 5055 },
-  { 0x2137, G_UNICODE_NOT_PRESENT_OFFSET, 5058 },
-  { 0x2138, G_UNICODE_NOT_PRESENT_OFFSET, 5061 },
-  { 0x2139, G_UNICODE_NOT_PRESENT_OFFSET, 4943 },
-  { 0x213d, G_UNICODE_NOT_PRESENT_OFFSET, 5064 },
-  { 0x213e, G_UNICODE_NOT_PRESENT_OFFSET, 5067 },
-  { 0x213f, G_UNICODE_NOT_PRESENT_OFFSET, 5070 },
-  { 0x2140, G_UNICODE_NOT_PRESENT_OFFSET, 5073 },
-  { 0x2145, G_UNICODE_NOT_PRESENT_OFFSET, 5077 },
-  { 0x2146, G_UNICODE_NOT_PRESENT_OFFSET, 5079 },
-  { 0x2147, G_UNICODE_NOT_PRESENT_OFFSET, 5044 },
-  { 0x2148, G_UNICODE_NOT_PRESENT_OFFSET, 4943 },
-  { 0x2149, G_UNICODE_NOT_PRESENT_OFFSET, 1176 },
-  { 0x2153, G_UNICODE_NOT_PRESENT_OFFSET, 5081 },
-  { 0x2154, G_UNICODE_NOT_PRESENT_OFFSET, 5087 },
-  { 0x2155, G_UNICODE_NOT_PRESENT_OFFSET, 5093 },
-  { 0x2156, G_UNICODE_NOT_PRESENT_OFFSET, 5099 },
-  { 0x2157, G_UNICODE_NOT_PRESENT_OFFSET, 5105 },
-  { 0x2158, G_UNICODE_NOT_PRESENT_OFFSET, 5111 },
-  { 0x2159, G_UNICODE_NOT_PRESENT_OFFSET, 5117 },
-  { 0x215a, G_UNICODE_NOT_PRESENT_OFFSET, 5123 },
-  { 0x215b, G_UNICODE_NOT_PRESENT_OFFSET, 5129 },
-  { 0x215c, G_UNICODE_NOT_PRESENT_OFFSET, 5135 },
-  { 0x215d, G_UNICODE_NOT_PRESENT_OFFSET, 5141 },
-  { 0x215e, G_UNICODE_NOT_PRESENT_OFFSET, 5147 },
-  { 0x215f, G_UNICODE_NOT_PRESENT_OFFSET, 5153 },
-  { 0x2160, G_UNICODE_NOT_PRESENT_OFFSET, 5010 },
-  { 0x2161, G_UNICODE_NOT_PRESENT_OFFSET, 5158 },
-  { 0x2162, G_UNICODE_NOT_PRESENT_OFFSET, 5161 },
-  { 0x2163, G_UNICODE_NOT_PRESENT_OFFSET, 5165 },
-  { 0x2164, G_UNICODE_NOT_PRESENT_OFFSET, 5168 },
-  { 0x2165, G_UNICODE_NOT_PRESENT_OFFSET, 5170 },
-  { 0x2166, G_UNICODE_NOT_PRESENT_OFFSET, 5173 },
-  { 0x2167, G_UNICODE_NOT_PRESENT_OFFSET, 5177 },
-  { 0x2168, G_UNICODE_NOT_PRESENT_OFFSET, 5182 },
-  { 0x2169, G_UNICODE_NOT_PRESENT_OFFSET, 5185 },
-  { 0x216a, G_UNICODE_NOT_PRESENT_OFFSET, 5187 },
-  { 0x216b, G_UNICODE_NOT_PRESENT_OFFSET, 5190 },
-  { 0x216c, G_UNICODE_NOT_PRESENT_OFFSET, 5012 },
-  { 0x216d, G_UNICODE_NOT_PRESENT_OFFSET, 4982 },
-  { 0x216e, G_UNICODE_NOT_PRESENT_OFFSET, 5077 },
-  { 0x216f, G_UNICODE_NOT_PRESENT_OFFSET, 5050 },
-  { 0x2170, G_UNICODE_NOT_PRESENT_OFFSET, 4943 },
-  { 0x2171, G_UNICODE_NOT_PRESENT_OFFSET, 5194 },
-  { 0x2172, G_UNICODE_NOT_PRESENT_OFFSET, 5197 },
-  { 0x2173, G_UNICODE_NOT_PRESENT_OFFSET, 5201 },
-  { 0x2174, G_UNICODE_NOT_PRESENT_OFFSET, 5204 },
-  { 0x2175, G_UNICODE_NOT_PRESENT_OFFSET, 5206 },
-  { 0x2176, G_UNICODE_NOT_PRESENT_OFFSET, 5209 },
-  { 0x2177, G_UNICODE_NOT_PRESENT_OFFSET, 5213 },
-  { 0x2178, G_UNICODE_NOT_PRESENT_OFFSET, 5218 },
-  { 0x2179, G_UNICODE_NOT_PRESENT_OFFSET, 1222 },
-  { 0x217a, G_UNICODE_NOT_PRESENT_OFFSET, 5221 },
-  { 0x217b, G_UNICODE_NOT_PRESENT_OFFSET, 5224 },
-  { 0x217c, G_UNICODE_NOT_PRESENT_OFFSET, 1220 },
-  { 0x217d, G_UNICODE_NOT_PRESENT_OFFSET, 5228 },
-  { 0x217e, G_UNICODE_NOT_PRESENT_OFFSET, 5079 },
-  { 0x217f, G_UNICODE_NOT_PRESENT_OFFSET, 5230 },
-  { 0x219a, 5232, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x219b, 5238, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x21ae, 5244, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x21cd, 5250, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x21ce, 5256, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x21cf, 5262, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2204, 5268, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2209, 5274, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x220c, 5280, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2224, 5286, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2226, 5292, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x222c, G_UNICODE_NOT_PRESENT_OFFSET, 5298 },
-  { 0x222d, G_UNICODE_NOT_PRESENT_OFFSET, 5305 },
-  { 0x222f, G_UNICODE_NOT_PRESENT_OFFSET, 5315 },
-  { 0x2230, G_UNICODE_NOT_PRESENT_OFFSET, 5322 },
-  { 0x2241, 5332, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2244, 5338, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2247, 5344, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2249, 5350, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2260, 5356, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2262, 5360, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x226d, 5366, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x226e, 5372, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x226f, 5376, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2270, 5380, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2271, 5386, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2274, 5392, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2275, 5398, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2278, 5404, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2279, 5410, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2280, 5416, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2281, 5422, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2284, 5428, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2285, 5434, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2288, 5440, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2289, 5446, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x22ac, 5452, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x22ad, 5458, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x22ae, 5464, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x22af, 5470, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x22e0, 5476, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x22e1, 5482, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x22e2, 5488, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x22e3, 5494, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x22ea, 5500, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x22eb, 5506, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x22ec, 5512, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x22ed, 5518, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2329, 5524, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x232a, 5528, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2460, G_UNICODE_NOT_PRESENT_OFFSET, 27 },
-  { 0x2461, G_UNICODE_NOT_PRESENT_OFFSET, 12 },
-  { 0x2462, G_UNICODE_NOT_PRESENT_OFFSET, 14 },
-  { 0x2463, G_UNICODE_NOT_PRESENT_OFFSET, 4945 },
-  { 0x2464, G_UNICODE_NOT_PRESENT_OFFSET, 4947 },
-  { 0x2465, G_UNICODE_NOT_PRESENT_OFFSET, 4949 },
-  { 0x2466, G_UNICODE_NOT_PRESENT_OFFSET, 4951 },
-  { 0x2467, G_UNICODE_NOT_PRESENT_OFFSET, 4953 },
-  { 0x2468, G_UNICODE_NOT_PRESENT_OFFSET, 4955 },
-  { 0x2469, G_UNICODE_NOT_PRESENT_OFFSET, 5532 },
-  { 0x246a, G_UNICODE_NOT_PRESENT_OFFSET, 5535 },
-  { 0x246b, G_UNICODE_NOT_PRESENT_OFFSET, 5538 },
-  { 0x246c, G_UNICODE_NOT_PRESENT_OFFSET, 5541 },
-  { 0x246d, G_UNICODE_NOT_PRESENT_OFFSET, 5544 },
-  { 0x246e, G_UNICODE_NOT_PRESENT_OFFSET, 5547 },
-  { 0x246f, G_UNICODE_NOT_PRESENT_OFFSET, 5550 },
-  { 0x2470, G_UNICODE_NOT_PRESENT_OFFSET, 5553 },
-  { 0x2471, G_UNICODE_NOT_PRESENT_OFFSET, 5556 },
-  { 0x2472, G_UNICODE_NOT_PRESENT_OFFSET, 5559 },
-  { 0x2473, G_UNICODE_NOT_PRESENT_OFFSET, 5562 },
-  { 0x2474, G_UNICODE_NOT_PRESENT_OFFSET, 5565 },
-  { 0x2475, G_UNICODE_NOT_PRESENT_OFFSET, 5569 },
-  { 0x2476, G_UNICODE_NOT_PRESENT_OFFSET, 5573 },
-  { 0x2477, G_UNICODE_NOT_PRESENT_OFFSET, 5577 },
-  { 0x2478, G_UNICODE_NOT_PRESENT_OFFSET, 5581 },
-  { 0x2479, G_UNICODE_NOT_PRESENT_OFFSET, 5585 },
-  { 0x247a, G_UNICODE_NOT_PRESENT_OFFSET, 5589 },
-  { 0x247b, G_UNICODE_NOT_PRESENT_OFFSET, 5593 },
-  { 0x247c, G_UNICODE_NOT_PRESENT_OFFSET, 5597 },
-  { 0x247d, G_UNICODE_NOT_PRESENT_OFFSET, 5601 },
-  { 0x247e, G_UNICODE_NOT_PRESENT_OFFSET, 5606 },
-  { 0x247f, G_UNICODE_NOT_PRESENT_OFFSET, 5611 },
-  { 0x2480, G_UNICODE_NOT_PRESENT_OFFSET, 5616 },
-  { 0x2481, G_UNICODE_NOT_PRESENT_OFFSET, 5621 },
-  { 0x2482, G_UNICODE_NOT_PRESENT_OFFSET, 5626 },
-  { 0x2483, G_UNICODE_NOT_PRESENT_OFFSET, 5631 },
-  { 0x2484, G_UNICODE_NOT_PRESENT_OFFSET, 5636 },
-  { 0x2485, G_UNICODE_NOT_PRESENT_OFFSET, 5641 },
-  { 0x2486, G_UNICODE_NOT_PRESENT_OFFSET, 5646 },
-  { 0x2487, G_UNICODE_NOT_PRESENT_OFFSET, 5651 },
-  { 0x2488, G_UNICODE_NOT_PRESENT_OFFSET, 5656 },
-  { 0x2489, G_UNICODE_NOT_PRESENT_OFFSET, 5659 },
-  { 0x248a, G_UNICODE_NOT_PRESENT_OFFSET, 5662 },
-  { 0x248b, G_UNICODE_NOT_PRESENT_OFFSET, 5665 },
-  { 0x248c, G_UNICODE_NOT_PRESENT_OFFSET, 5668 },
-  { 0x248d, G_UNICODE_NOT_PRESENT_OFFSET, 5671 },
-  { 0x248e, G_UNICODE_NOT_PRESENT_OFFSET, 5674 },
-  { 0x248f, G_UNICODE_NOT_PRESENT_OFFSET, 5677 },
-  { 0x2490, G_UNICODE_NOT_PRESENT_OFFSET, 5680 },
-  { 0x2491, G_UNICODE_NOT_PRESENT_OFFSET, 5683 },
-  { 0x2492, G_UNICODE_NOT_PRESENT_OFFSET, 5687 },
-  { 0x2493, G_UNICODE_NOT_PRESENT_OFFSET, 5691 },
-  { 0x2494, G_UNICODE_NOT_PRESENT_OFFSET, 5695 },
-  { 0x2495, G_UNICODE_NOT_PRESENT_OFFSET, 5699 },
-  { 0x2496, G_UNICODE_NOT_PRESENT_OFFSET, 5703 },
-  { 0x2497, G_UNICODE_NOT_PRESENT_OFFSET, 5707 },
-  { 0x2498, G_UNICODE_NOT_PRESENT_OFFSET, 5711 },
-  { 0x2499, G_UNICODE_NOT_PRESENT_OFFSET, 5715 },
-  { 0x249a, G_UNICODE_NOT_PRESENT_OFFSET, 5719 },
-  { 0x249b, G_UNICODE_NOT_PRESENT_OFFSET, 5723 },
-  { 0x249c, G_UNICODE_NOT_PRESENT_OFFSET, 5727 },
-  { 0x249d, G_UNICODE_NOT_PRESENT_OFFSET, 5731 },
-  { 0x249e, G_UNICODE_NOT_PRESENT_OFFSET, 5735 },
-  { 0x249f, G_UNICODE_NOT_PRESENT_OFFSET, 5739 },
-  { 0x24a0, G_UNICODE_NOT_PRESENT_OFFSET, 5743 },
-  { 0x24a1, G_UNICODE_NOT_PRESENT_OFFSET, 5747 },
-  { 0x24a2, G_UNICODE_NOT_PRESENT_OFFSET, 5751 },
-  { 0x24a3, G_UNICODE_NOT_PRESENT_OFFSET, 5755 },
-  { 0x24a4, G_UNICODE_NOT_PRESENT_OFFSET, 5759 },
-  { 0x24a5, G_UNICODE_NOT_PRESENT_OFFSET, 5763 },
-  { 0x24a6, G_UNICODE_NOT_PRESENT_OFFSET, 5767 },
-  { 0x24a7, G_UNICODE_NOT_PRESENT_OFFSET, 5771 },
-  { 0x24a8, G_UNICODE_NOT_PRESENT_OFFSET, 5775 },
-  { 0x24a9, G_UNICODE_NOT_PRESENT_OFFSET, 5779 },
-  { 0x24aa, G_UNICODE_NOT_PRESENT_OFFSET, 5783 },
-  { 0x24ab, G_UNICODE_NOT_PRESENT_OFFSET, 5787 },
-  { 0x24ac, G_UNICODE_NOT_PRESENT_OFFSET, 5791 },
-  { 0x24ad, G_UNICODE_NOT_PRESENT_OFFSET, 5795 },
-  { 0x24ae, G_UNICODE_NOT_PRESENT_OFFSET, 5799 },
-  { 0x24af, G_UNICODE_NOT_PRESENT_OFFSET, 5803 },
-  { 0x24b0, G_UNICODE_NOT_PRESENT_OFFSET, 5807 },
-  { 0x24b1, G_UNICODE_NOT_PRESENT_OFFSET, 5811 },
-  { 0x24b2, G_UNICODE_NOT_PRESENT_OFFSET, 5815 },
-  { 0x24b3, G_UNICODE_NOT_PRESENT_OFFSET, 5819 },
-  { 0x24b4, G_UNICODE_NOT_PRESENT_OFFSET, 5823 },
-  { 0x24b5, G_UNICODE_NOT_PRESENT_OFFSET, 5827 },
-  { 0x24b6, G_UNICODE_NOT_PRESENT_OFFSET, 5831 },
-  { 0x24b7, G_UNICODE_NOT_PRESENT_OFFSET, 5042 },
-  { 0x24b8, G_UNICODE_NOT_PRESENT_OFFSET, 4982 },
-  { 0x24b9, G_UNICODE_NOT_PRESENT_OFFSET, 5077 },
-  { 0x24ba, G_UNICODE_NOT_PRESENT_OFFSET, 5046 },
-  { 0x24bb, G_UNICODE_NOT_PRESENT_OFFSET, 5048 },
-  { 0x24bc, G_UNICODE_NOT_PRESENT_OFFSET, 5833 },
-  { 0x24bd, G_UNICODE_NOT_PRESENT_OFFSET, 5005 },
-  { 0x24be, G_UNICODE_NOT_PRESENT_OFFSET, 5010 },
-  { 0x24bf, G_UNICODE_NOT_PRESENT_OFFSET, 5835 },
-  { 0x24c0, G_UNICODE_NOT_PRESENT_OFFSET, 5040 },
-  { 0x24c1, G_UNICODE_NOT_PRESENT_OFFSET, 5012 },
-  { 0x24c2, G_UNICODE_NOT_PRESENT_OFFSET, 5050 },
-  { 0x24c3, G_UNICODE_NOT_PRESENT_OFFSET, 5014 },
-  { 0x24c4, G_UNICODE_NOT_PRESENT_OFFSET, 5837 },
-  { 0x24c5, G_UNICODE_NOT_PRESENT_OFFSET, 5019 },
-  { 0x24c6, G_UNICODE_NOT_PRESENT_OFFSET, 5021 },
-  { 0x24c7, G_UNICODE_NOT_PRESENT_OFFSET, 5023 },
-  { 0x24c8, G_UNICODE_NOT_PRESENT_OFFSET, 5839 },
-  { 0x24c9, G_UNICODE_NOT_PRESENT_OFFSET, 5841 },
-  { 0x24ca, G_UNICODE_NOT_PRESENT_OFFSET, 5843 },
-  { 0x24cb, G_UNICODE_NOT_PRESENT_OFFSET, 5168 },
-  { 0x24cc, G_UNICODE_NOT_PRESENT_OFFSET, 5845 },
-  { 0x24cd, G_UNICODE_NOT_PRESENT_OFFSET, 5185 },
-  { 0x24ce, G_UNICODE_NOT_PRESENT_OFFSET, 5847 },
-  { 0x24cf, G_UNICODE_NOT_PRESENT_OFFSET, 5035 },
-  { 0x24d0, G_UNICODE_NOT_PRESENT_OFFSET, 6 },
-  { 0x24d1, G_UNICODE_NOT_PRESENT_OFFSET, 5849 },
-  { 0x24d2, G_UNICODE_NOT_PRESENT_OFFSET, 5228 },
-  { 0x24d3, G_UNICODE_NOT_PRESENT_OFFSET, 5079 },
-  { 0x24d4, G_UNICODE_NOT_PRESENT_OFFSET, 5044 },
-  { 0x24d5, G_UNICODE_NOT_PRESENT_OFFSET, 5851 },
-  { 0x24d6, G_UNICODE_NOT_PRESENT_OFFSET, 5003 },
-  { 0x24d7, G_UNICODE_NOT_PRESENT_OFFSET, 1171 },
-  { 0x24d8, G_UNICODE_NOT_PRESENT_OFFSET, 4943 },
-  { 0x24d9, G_UNICODE_NOT_PRESENT_OFFSET, 1176 },
-  { 0x24da, G_UNICODE_NOT_PRESENT_OFFSET, 5853 },
-  { 0x24db, G_UNICODE_NOT_PRESENT_OFFSET, 1220 },
-  { 0x24dc, G_UNICODE_NOT_PRESENT_OFFSET, 5230 },
-  { 0x24dd, G_UNICODE_NOT_PRESENT_OFFSET, 4969 },
-  { 0x24de, G_UNICODE_NOT_PRESENT_OFFSET, 29 },
-  { 0x24df, G_UNICODE_NOT_PRESENT_OFFSET, 5855 },
-  { 0x24e0, G_UNICODE_NOT_PRESENT_OFFSET, 5857 },
-  { 0x24e1, G_UNICODE_NOT_PRESENT_OFFSET, 1178 },
-  { 0x24e2, G_UNICODE_NOT_PRESENT_OFFSET, 711 },
-  { 0x24e3, G_UNICODE_NOT_PRESENT_OFFSET, 5859 },
-  { 0x24e4, G_UNICODE_NOT_PRESENT_OFFSET, 5861 },
-  { 0x24e5, G_UNICODE_NOT_PRESENT_OFFSET, 5204 },
-  { 0x24e6, G_UNICODE_NOT_PRESENT_OFFSET, 1189 },
-  { 0x24e7, G_UNICODE_NOT_PRESENT_OFFSET, 1222 },
-  { 0x24e8, G_UNICODE_NOT_PRESENT_OFFSET, 1191 },
-  { 0x24e9, G_UNICODE_NOT_PRESENT_OFFSET, 5863 },
-  { 0x24ea, G_UNICODE_NOT_PRESENT_OFFSET, 4941 },
-  { 0x2a0c, G_UNICODE_NOT_PRESENT_OFFSET, 5865 },
-  { 0x2a74, G_UNICODE_NOT_PRESENT_OFFSET, 5878 },
-  { 0x2a75, G_UNICODE_NOT_PRESENT_OFFSET, 5882 },
-  { 0x2a76, G_UNICODE_NOT_PRESENT_OFFSET, 5885 },
-  { 0x2adc, 5889, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2e9f, G_UNICODE_NOT_PRESENT_OFFSET, 5895 },
-  { 0x2ef3, G_UNICODE_NOT_PRESENT_OFFSET, 5899 },
-  { 0x2f00, G_UNICODE_NOT_PRESENT_OFFSET, 5903 },
-  { 0x2f01, G_UNICODE_NOT_PRESENT_OFFSET, 5907 },
-  { 0x2f02, G_UNICODE_NOT_PRESENT_OFFSET, 5911 },
-  { 0x2f03, G_UNICODE_NOT_PRESENT_OFFSET, 5915 },
-  { 0x2f04, G_UNICODE_NOT_PRESENT_OFFSET, 5919 },
-  { 0x2f05, G_UNICODE_NOT_PRESENT_OFFSET, 5923 },
-  { 0x2f06, G_UNICODE_NOT_PRESENT_OFFSET, 5927 },
-  { 0x2f07, G_UNICODE_NOT_PRESENT_OFFSET, 5931 },
-  { 0x2f08, G_UNICODE_NOT_PRESENT_OFFSET, 5935 },
-  { 0x2f09, G_UNICODE_NOT_PRESENT_OFFSET, 5939 },
-  { 0x2f0a, G_UNICODE_NOT_PRESENT_OFFSET, 5943 },
-  { 0x2f0b, G_UNICODE_NOT_PRESENT_OFFSET, 5947 },
-  { 0x2f0c, G_UNICODE_NOT_PRESENT_OFFSET, 5951 },
-  { 0x2f0d, G_UNICODE_NOT_PRESENT_OFFSET, 5955 },
-  { 0x2f0e, G_UNICODE_NOT_PRESENT_OFFSET, 5959 },
-  { 0x2f0f, G_UNICODE_NOT_PRESENT_OFFSET, 5963 },
-  { 0x2f10, G_UNICODE_NOT_PRESENT_OFFSET, 5967 },
-  { 0x2f11, G_UNICODE_NOT_PRESENT_OFFSET, 5971 },
-  { 0x2f12, G_UNICODE_NOT_PRESENT_OFFSET, 5975 },
-  { 0x2f13, G_UNICODE_NOT_PRESENT_OFFSET, 5979 },
-  { 0x2f14, G_UNICODE_NOT_PRESENT_OFFSET, 5983 },
-  { 0x2f15, G_UNICODE_NOT_PRESENT_OFFSET, 5987 },
-  { 0x2f16, G_UNICODE_NOT_PRESENT_OFFSET, 5991 },
-  { 0x2f17, G_UNICODE_NOT_PRESENT_OFFSET, 5995 },
-  { 0x2f18, G_UNICODE_NOT_PRESENT_OFFSET, 5999 },
-  { 0x2f19, G_UNICODE_NOT_PRESENT_OFFSET, 6003 },
-  { 0x2f1a, G_UNICODE_NOT_PRESENT_OFFSET, 6007 },
-  { 0x2f1b, G_UNICODE_NOT_PRESENT_OFFSET, 6011 },
-  { 0x2f1c, G_UNICODE_NOT_PRESENT_OFFSET, 6015 },
-  { 0x2f1d, G_UNICODE_NOT_PRESENT_OFFSET, 6019 },
-  { 0x2f1e, G_UNICODE_NOT_PRESENT_OFFSET, 6023 },
-  { 0x2f1f, G_UNICODE_NOT_PRESENT_OFFSET, 6027 },
-  { 0x2f20, G_UNICODE_NOT_PRESENT_OFFSET, 6031 },
-  { 0x2f21, G_UNICODE_NOT_PRESENT_OFFSET, 6035 },
-  { 0x2f22, G_UNICODE_NOT_PRESENT_OFFSET, 6039 },
-  { 0x2f23, G_UNICODE_NOT_PRESENT_OFFSET, 6043 },
-  { 0x2f24, G_UNICODE_NOT_PRESENT_OFFSET, 6047 },
-  { 0x2f25, G_UNICODE_NOT_PRESENT_OFFSET, 6051 },
-  { 0x2f26, G_UNICODE_NOT_PRESENT_OFFSET, 6055 },
-  { 0x2f27, G_UNICODE_NOT_PRESENT_OFFSET, 6059 },
-  { 0x2f28, G_UNICODE_NOT_PRESENT_OFFSET, 6063 },
-  { 0x2f29, G_UNICODE_NOT_PRESENT_OFFSET, 6067 },
-  { 0x2f2a, G_UNICODE_NOT_PRESENT_OFFSET, 6071 },
-  { 0x2f2b, G_UNICODE_NOT_PRESENT_OFFSET, 6075 },
-  { 0x2f2c, G_UNICODE_NOT_PRESENT_OFFSET, 6079 },
-  { 0x2f2d, G_UNICODE_NOT_PRESENT_OFFSET, 6083 },
-  { 0x2f2e, G_UNICODE_NOT_PRESENT_OFFSET, 6087 },
-  { 0x2f2f, G_UNICODE_NOT_PRESENT_OFFSET, 6091 },
-  { 0x2f30, G_UNICODE_NOT_PRESENT_OFFSET, 6095 },
-  { 0x2f31, G_UNICODE_NOT_PRESENT_OFFSET, 6099 },
-  { 0x2f32, G_UNICODE_NOT_PRESENT_OFFSET, 6103 },
-  { 0x2f33, G_UNICODE_NOT_PRESENT_OFFSET, 6107 },
-  { 0x2f34, G_UNICODE_NOT_PRESENT_OFFSET, 6111 },
-  { 0x2f35, G_UNICODE_NOT_PRESENT_OFFSET, 6115 },
-  { 0x2f36, G_UNICODE_NOT_PRESENT_OFFSET, 6119 },
-  { 0x2f37, G_UNICODE_NOT_PRESENT_OFFSET, 6123 },
-  { 0x2f38, G_UNICODE_NOT_PRESENT_OFFSET, 6127 },
-  { 0x2f39, G_UNICODE_NOT_PRESENT_OFFSET, 6131 },
-  { 0x2f3a, G_UNICODE_NOT_PRESENT_OFFSET, 6135 },
-  { 0x2f3b, G_UNICODE_NOT_PRESENT_OFFSET, 6139 },
-  { 0x2f3c, G_UNICODE_NOT_PRESENT_OFFSET, 6143 },
-  { 0x2f3d, G_UNICODE_NOT_PRESENT_OFFSET, 6147 },
-  { 0x2f3e, G_UNICODE_NOT_PRESENT_OFFSET, 6151 },
-  { 0x2f3f, G_UNICODE_NOT_PRESENT_OFFSET, 6155 },
-  { 0x2f40, G_UNICODE_NOT_PRESENT_OFFSET, 6159 },
-  { 0x2f41, G_UNICODE_NOT_PRESENT_OFFSET, 6163 },
-  { 0x2f42, G_UNICODE_NOT_PRESENT_OFFSET, 6167 },
-  { 0x2f43, G_UNICODE_NOT_PRESENT_OFFSET, 6171 },
-  { 0x2f44, G_UNICODE_NOT_PRESENT_OFFSET, 6175 },
-  { 0x2f45, G_UNICODE_NOT_PRESENT_OFFSET, 6179 },
-  { 0x2f46, G_UNICODE_NOT_PRESENT_OFFSET, 6183 },
-  { 0x2f47, G_UNICODE_NOT_PRESENT_OFFSET, 6187 },
-  { 0x2f48, G_UNICODE_NOT_PRESENT_OFFSET, 6191 },
-  { 0x2f49, G_UNICODE_NOT_PRESENT_OFFSET, 6195 },
-  { 0x2f4a, G_UNICODE_NOT_PRESENT_OFFSET, 6199 },
-  { 0x2f4b, G_UNICODE_NOT_PRESENT_OFFSET, 6203 },
-  { 0x2f4c, G_UNICODE_NOT_PRESENT_OFFSET, 6207 },
-  { 0x2f4d, G_UNICODE_NOT_PRESENT_OFFSET, 6211 },
-  { 0x2f4e, G_UNICODE_NOT_PRESENT_OFFSET, 6215 },
-  { 0x2f4f, G_UNICODE_NOT_PRESENT_OFFSET, 6219 },
-  { 0x2f50, G_UNICODE_NOT_PRESENT_OFFSET, 6223 },
-  { 0x2f51, G_UNICODE_NOT_PRESENT_OFFSET, 6227 },
-  { 0x2f52, G_UNICODE_NOT_PRESENT_OFFSET, 6231 },
-  { 0x2f53, G_UNICODE_NOT_PRESENT_OFFSET, 6235 },
-  { 0x2f54, G_UNICODE_NOT_PRESENT_OFFSET, 6239 },
-  { 0x2f55, G_UNICODE_NOT_PRESENT_OFFSET, 6243 },
-  { 0x2f56, G_UNICODE_NOT_PRESENT_OFFSET, 6247 },
-  { 0x2f57, G_UNICODE_NOT_PRESENT_OFFSET, 6251 },
-  { 0x2f58, G_UNICODE_NOT_PRESENT_OFFSET, 6255 },
-  { 0x2f59, G_UNICODE_NOT_PRESENT_OFFSET, 6259 },
-  { 0x2f5a, G_UNICODE_NOT_PRESENT_OFFSET, 6263 },
-  { 0x2f5b, G_UNICODE_NOT_PRESENT_OFFSET, 6267 },
-  { 0x2f5c, G_UNICODE_NOT_PRESENT_OFFSET, 6271 },
-  { 0x2f5d, G_UNICODE_NOT_PRESENT_OFFSET, 6275 },
-  { 0x2f5e, G_UNICODE_NOT_PRESENT_OFFSET, 6279 },
-  { 0x2f5f, G_UNICODE_NOT_PRESENT_OFFSET, 6283 },
-  { 0x2f60, G_UNICODE_NOT_PRESENT_OFFSET, 6287 },
-  { 0x2f61, G_UNICODE_NOT_PRESENT_OFFSET, 6291 },
-  { 0x2f62, G_UNICODE_NOT_PRESENT_OFFSET, 6295 },
-  { 0x2f63, G_UNICODE_NOT_PRESENT_OFFSET, 6299 },
-  { 0x2f64, G_UNICODE_NOT_PRESENT_OFFSET, 6303 },
-  { 0x2f65, G_UNICODE_NOT_PRESENT_OFFSET, 6307 },
-  { 0x2f66, G_UNICODE_NOT_PRESENT_OFFSET, 6311 },
-  { 0x2f67, G_UNICODE_NOT_PRESENT_OFFSET, 6315 },
-  { 0x2f68, G_UNICODE_NOT_PRESENT_OFFSET, 6319 },
-  { 0x2f69, G_UNICODE_NOT_PRESENT_OFFSET, 6323 },
-  { 0x2f6a, G_UNICODE_NOT_PRESENT_OFFSET, 6327 },
-  { 0x2f6b, G_UNICODE_NOT_PRESENT_OFFSET, 6331 },
-  { 0x2f6c, G_UNICODE_NOT_PRESENT_OFFSET, 6335 },
-  { 0x2f6d, G_UNICODE_NOT_PRESENT_OFFSET, 6339 },
-  { 0x2f6e, G_UNICODE_NOT_PRESENT_OFFSET, 6343 },
-  { 0x2f6f, G_UNICODE_NOT_PRESENT_OFFSET, 6347 },
-  { 0x2f70, G_UNICODE_NOT_PRESENT_OFFSET, 6351 },
-  { 0x2f71, G_UNICODE_NOT_PRESENT_OFFSET, 6355 },
-  { 0x2f72, G_UNICODE_NOT_PRESENT_OFFSET, 6359 },
-  { 0x2f73, G_UNICODE_NOT_PRESENT_OFFSET, 6363 },
-  { 0x2f74, G_UNICODE_NOT_PRESENT_OFFSET, 6367 },
-  { 0x2f75, G_UNICODE_NOT_PRESENT_OFFSET, 6371 },
-  { 0x2f76, G_UNICODE_NOT_PRESENT_OFFSET, 6375 },
-  { 0x2f77, G_UNICODE_NOT_PRESENT_OFFSET, 6379 },
-  { 0x2f78, G_UNICODE_NOT_PRESENT_OFFSET, 6383 },
-  { 0x2f79, G_UNICODE_NOT_PRESENT_OFFSET, 6387 },
-  { 0x2f7a, G_UNICODE_NOT_PRESENT_OFFSET, 6391 },
-  { 0x2f7b, G_UNICODE_NOT_PRESENT_OFFSET, 6395 },
-  { 0x2f7c, G_UNICODE_NOT_PRESENT_OFFSET, 6399 },
-  { 0x2f7d, G_UNICODE_NOT_PRESENT_OFFSET, 6403 },
-  { 0x2f7e, G_UNICODE_NOT_PRESENT_OFFSET, 6407 },
-  { 0x2f7f, G_UNICODE_NOT_PRESENT_OFFSET, 6411 },
-  { 0x2f80, G_UNICODE_NOT_PRESENT_OFFSET, 6415 },
-  { 0x2f81, G_UNICODE_NOT_PRESENT_OFFSET, 6419 },
-  { 0x2f82, G_UNICODE_NOT_PRESENT_OFFSET, 6423 },
-  { 0x2f83, G_UNICODE_NOT_PRESENT_OFFSET, 6427 },
-  { 0x2f84, G_UNICODE_NOT_PRESENT_OFFSET, 6431 },
-  { 0x2f85, G_UNICODE_NOT_PRESENT_OFFSET, 6435 },
-  { 0x2f86, G_UNICODE_NOT_PRESENT_OFFSET, 6439 },
-  { 0x2f87, G_UNICODE_NOT_PRESENT_OFFSET, 6443 },
-  { 0x2f88, G_UNICODE_NOT_PRESENT_OFFSET, 6447 },
-  { 0x2f89, G_UNICODE_NOT_PRESENT_OFFSET, 6451 },
-  { 0x2f8a, G_UNICODE_NOT_PRESENT_OFFSET, 6455 },
-  { 0x2f8b, G_UNICODE_NOT_PRESENT_OFFSET, 6459 },
-  { 0x2f8c, G_UNICODE_NOT_PRESENT_OFFSET, 6463 },
-  { 0x2f8d, G_UNICODE_NOT_PRESENT_OFFSET, 6467 },
-  { 0x2f8e, G_UNICODE_NOT_PRESENT_OFFSET, 6471 },
-  { 0x2f8f, G_UNICODE_NOT_PRESENT_OFFSET, 6475 },
-  { 0x2f90, G_UNICODE_NOT_PRESENT_OFFSET, 6479 },
-  { 0x2f91, G_UNICODE_NOT_PRESENT_OFFSET, 6483 },
-  { 0x2f92, G_UNICODE_NOT_PRESENT_OFFSET, 6487 },
-  { 0x2f93, G_UNICODE_NOT_PRESENT_OFFSET, 6491 },
-  { 0x2f94, G_UNICODE_NOT_PRESENT_OFFSET, 6495 },
-  { 0x2f95, G_UNICODE_NOT_PRESENT_OFFSET, 6499 },
-  { 0x2f96, G_UNICODE_NOT_PRESENT_OFFSET, 6503 },
-  { 0x2f97, G_UNICODE_NOT_PRESENT_OFFSET, 6507 },
-  { 0x2f98, G_UNICODE_NOT_PRESENT_OFFSET, 6511 },
-  { 0x2f99, G_UNICODE_NOT_PRESENT_OFFSET, 6515 },
-  { 0x2f9a, G_UNICODE_NOT_PRESENT_OFFSET, 6519 },
-  { 0x2f9b, G_UNICODE_NOT_PRESENT_OFFSET, 6523 },
-  { 0x2f9c, G_UNICODE_NOT_PRESENT_OFFSET, 6527 },
-  { 0x2f9d, G_UNICODE_NOT_PRESENT_OFFSET, 6531 },
-  { 0x2f9e, G_UNICODE_NOT_PRESENT_OFFSET, 6535 },
-  { 0x2f9f, G_UNICODE_NOT_PRESENT_OFFSET, 6539 },
-  { 0x2fa0, G_UNICODE_NOT_PRESENT_OFFSET, 6543 },
-  { 0x2fa1, G_UNICODE_NOT_PRESENT_OFFSET, 6547 },
-  { 0x2fa2, G_UNICODE_NOT_PRESENT_OFFSET, 6551 },
-  { 0x2fa3, G_UNICODE_NOT_PRESENT_OFFSET, 6555 },
-  { 0x2fa4, G_UNICODE_NOT_PRESENT_OFFSET, 6559 },
-  { 0x2fa5, G_UNICODE_NOT_PRESENT_OFFSET, 6563 },
-  { 0x2fa6, G_UNICODE_NOT_PRESENT_OFFSET, 6567 },
-  { 0x2fa7, G_UNICODE_NOT_PRESENT_OFFSET, 6571 },
-  { 0x2fa8, G_UNICODE_NOT_PRESENT_OFFSET, 6575 },
-  { 0x2fa9, G_UNICODE_NOT_PRESENT_OFFSET, 6579 },
-  { 0x2faa, G_UNICODE_NOT_PRESENT_OFFSET, 6583 },
-  { 0x2fab, G_UNICODE_NOT_PRESENT_OFFSET, 6587 },
-  { 0x2fac, G_UNICODE_NOT_PRESENT_OFFSET, 6591 },
-  { 0x2fad, G_UNICODE_NOT_PRESENT_OFFSET, 6595 },
-  { 0x2fae, G_UNICODE_NOT_PRESENT_OFFSET, 6599 },
-  { 0x2faf, G_UNICODE_NOT_PRESENT_OFFSET, 6603 },
-  { 0x2fb0, G_UNICODE_NOT_PRESENT_OFFSET, 6607 },
-  { 0x2fb1, G_UNICODE_NOT_PRESENT_OFFSET, 6611 },
-  { 0x2fb2, G_UNICODE_NOT_PRESENT_OFFSET, 6615 },
-  { 0x2fb3, G_UNICODE_NOT_PRESENT_OFFSET, 6619 },
-  { 0x2fb4, G_UNICODE_NOT_PRESENT_OFFSET, 6623 },
-  { 0x2fb5, G_UNICODE_NOT_PRESENT_OFFSET, 6627 },
-  { 0x2fb6, G_UNICODE_NOT_PRESENT_OFFSET, 6631 },
-  { 0x2fb7, G_UNICODE_NOT_PRESENT_OFFSET, 6635 },
-  { 0x2fb8, G_UNICODE_NOT_PRESENT_OFFSET, 6639 },
-  { 0x2fb9, G_UNICODE_NOT_PRESENT_OFFSET, 6643 },
-  { 0x2fba, G_UNICODE_NOT_PRESENT_OFFSET, 6647 },
-  { 0x2fbb, G_UNICODE_NOT_PRESENT_OFFSET, 6651 },
-  { 0x2fbc, G_UNICODE_NOT_PRESENT_OFFSET, 6655 },
-  { 0x2fbd, G_UNICODE_NOT_PRESENT_OFFSET, 6659 },
-  { 0x2fbe, G_UNICODE_NOT_PRESENT_OFFSET, 6663 },
-  { 0x2fbf, G_UNICODE_NOT_PRESENT_OFFSET, 6667 },
-  { 0x2fc0, G_UNICODE_NOT_PRESENT_OFFSET, 6671 },
-  { 0x2fc1, G_UNICODE_NOT_PRESENT_OFFSET, 6675 },
-  { 0x2fc2, G_UNICODE_NOT_PRESENT_OFFSET, 6679 },
-  { 0x2fc3, G_UNICODE_NOT_PRESENT_OFFSET, 6683 },
-  { 0x2fc4, G_UNICODE_NOT_PRESENT_OFFSET, 6687 },
-  { 0x2fc5, G_UNICODE_NOT_PRESENT_OFFSET, 6691 },
-  { 0x2fc6, G_UNICODE_NOT_PRESENT_OFFSET, 6695 },
-  { 0x2fc7, G_UNICODE_NOT_PRESENT_OFFSET, 6699 },
-  { 0x2fc8, G_UNICODE_NOT_PRESENT_OFFSET, 6703 },
-  { 0x2fc9, G_UNICODE_NOT_PRESENT_OFFSET, 6707 },
-  { 0x2fca, G_UNICODE_NOT_PRESENT_OFFSET, 6711 },
-  { 0x2fcb, G_UNICODE_NOT_PRESENT_OFFSET, 6715 },
-  { 0x2fcc, G_UNICODE_NOT_PRESENT_OFFSET, 6719 },
-  { 0x2fcd, G_UNICODE_NOT_PRESENT_OFFSET, 6723 },
-  { 0x2fce, G_UNICODE_NOT_PRESENT_OFFSET, 6727 },
-  { 0x2fcf, G_UNICODE_NOT_PRESENT_OFFSET, 6731 },
-  { 0x2fd0, G_UNICODE_NOT_PRESENT_OFFSET, 6735 },
-  { 0x2fd1, G_UNICODE_NOT_PRESENT_OFFSET, 6739 },
-  { 0x2fd2, G_UNICODE_NOT_PRESENT_OFFSET, 6743 },
-  { 0x2fd3, G_UNICODE_NOT_PRESENT_OFFSET, 6747 },
-  { 0x2fd4, G_UNICODE_NOT_PRESENT_OFFSET, 6751 },
-  { 0x2fd5, G_UNICODE_NOT_PRESENT_OFFSET, 6755 },
-  { 0x3000, G_UNICODE_NOT_PRESENT_OFFSET, 0 },
-  { 0x3036, G_UNICODE_NOT_PRESENT_OFFSET, 6759 },
-  { 0x3038, G_UNICODE_NOT_PRESENT_OFFSET, 5995 },
-  { 0x3039, G_UNICODE_NOT_PRESENT_OFFSET, 6763 },
-  { 0x303a, G_UNICODE_NOT_PRESENT_OFFSET, 6767 },
-  { 0x304c, 6771, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x304e, 6778, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x3050, 6785, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x3052, 6792, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x3054, 6799, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x3056, 6806, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x3058, 6813, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x305a, 6820, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x305c, 6827, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x305e, 6834, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x3060, 6841, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x3062, 6848, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x3065, 6855, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x3067, 6862, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x3069, 6869, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x3070, 6876, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x3071, 6883, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x3073, 6890, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x3074, 6897, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x3076, 6904, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x3077, 6911, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x3079, 6918, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x307a, 6925, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x307c, 6932, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x307d, 6939, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x3094, 6946, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x309b, G_UNICODE_NOT_PRESENT_OFFSET, 6953 },
-  { 0x309c, G_UNICODE_NOT_PRESENT_OFFSET, 6958 },
-  { 0x309e, 6963, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x309f, G_UNICODE_NOT_PRESENT_OFFSET, 6970 },
-  { 0x30ac, 6977, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x30ae, 6984, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x30b0, 6991, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x30b2, 6998, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x30b4, 7005, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x30b6, 7012, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x30b8, 7019, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x30ba, 7026, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x30bc, 7033, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x30be, 7040, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x30c0, 7047, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x30c2, 7054, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x30c5, 7061, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x30c7, 7068, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x30c9, 7075, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x30d0, 7082, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x30d1, 7089, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x30d3, 7096, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x30d4, 7103, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x30d6, 7110, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x30d7, 7117, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x30d9, 7124, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x30da, 7131, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x30dc, 7138, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x30dd, 7145, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x30f4, 7152, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x30f7, 7159, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x30f8, 7166, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x30f9, 7173, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x30fa, 7180, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x30fe, 7187, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x30ff, G_UNICODE_NOT_PRESENT_OFFSET, 7194 },
-  { 0x3131, G_UNICODE_NOT_PRESENT_OFFSET, 7201 },
-  { 0x3132, G_UNICODE_NOT_PRESENT_OFFSET, 7205 },
-  { 0x3133, G_UNICODE_NOT_PRESENT_OFFSET, 7209 },
-  { 0x3134, G_UNICODE_NOT_PRESENT_OFFSET, 7213 },
-  { 0x3135, G_UNICODE_NOT_PRESENT_OFFSET, 7217 },
-  { 0x3136, G_UNICODE_NOT_PRESENT_OFFSET, 7221 },
-  { 0x3137, G_UNICODE_NOT_PRESENT_OFFSET, 7225 },
-  { 0x3138, G_UNICODE_NOT_PRESENT_OFFSET, 7229 },
-  { 0x3139, G_UNICODE_NOT_PRESENT_OFFSET, 7233 },
-  { 0x313a, G_UNICODE_NOT_PRESENT_OFFSET, 7237 },
-  { 0x313b, G_UNICODE_NOT_PRESENT_OFFSET, 7241 },
-  { 0x313c, G_UNICODE_NOT_PRESENT_OFFSET, 7245 },
-  { 0x313d, G_UNICODE_NOT_PRESENT_OFFSET, 7249 },
-  { 0x313e, G_UNICODE_NOT_PRESENT_OFFSET, 7253 },
-  { 0x313f, G_UNICODE_NOT_PRESENT_OFFSET, 7257 },
-  { 0x3140, G_UNICODE_NOT_PRESENT_OFFSET, 7261 },
-  { 0x3141, G_UNICODE_NOT_PRESENT_OFFSET, 7265 },
-  { 0x3142, G_UNICODE_NOT_PRESENT_OFFSET, 7269 },
-  { 0x3143, G_UNICODE_NOT_PRESENT_OFFSET, 7273 },
-  { 0x3144, G_UNICODE_NOT_PRESENT_OFFSET, 7277 },
-  { 0x3145, G_UNICODE_NOT_PRESENT_OFFSET, 7281 },
-  { 0x3146, G_UNICODE_NOT_PRESENT_OFFSET, 7285 },
-  { 0x3147, G_UNICODE_NOT_PRESENT_OFFSET, 7289 },
-  { 0x3148, G_UNICODE_NOT_PRESENT_OFFSET, 7293 },
-  { 0x3149, G_UNICODE_NOT_PRESENT_OFFSET, 7297 },
-  { 0x314a, G_UNICODE_NOT_PRESENT_OFFSET, 7301 },
-  { 0x314b, G_UNICODE_NOT_PRESENT_OFFSET, 7305 },
-  { 0x314c, G_UNICODE_NOT_PRESENT_OFFSET, 7309 },
-  { 0x314d, G_UNICODE_NOT_PRESENT_OFFSET, 7313 },
-  { 0x314e, G_UNICODE_NOT_PRESENT_OFFSET, 7317 },
-  { 0x314f, G_UNICODE_NOT_PRESENT_OFFSET, 7321 },
-  { 0x3150, G_UNICODE_NOT_PRESENT_OFFSET, 7325 },
-  { 0x3151, G_UNICODE_NOT_PRESENT_OFFSET, 7329 },
-  { 0x3152, G_UNICODE_NOT_PRESENT_OFFSET, 7333 },
-  { 0x3153, G_UNICODE_NOT_PRESENT_OFFSET, 7337 },
-  { 0x3154, G_UNICODE_NOT_PRESENT_OFFSET, 7341 },
-  { 0x3155, G_UNICODE_NOT_PRESENT_OFFSET, 7345 },
-  { 0x3156, G_UNICODE_NOT_PRESENT_OFFSET, 7349 },
-  { 0x3157, G_UNICODE_NOT_PRESENT_OFFSET, 7353 },
-  { 0x3158, G_UNICODE_NOT_PRESENT_OFFSET, 7357 },
-  { 0x3159, G_UNICODE_NOT_PRESENT_OFFSET, 7361 },
-  { 0x315a, G_UNICODE_NOT_PRESENT_OFFSET, 7365 },
-  { 0x315b, G_UNICODE_NOT_PRESENT_OFFSET, 7369 },
-  { 0x315c, G_UNICODE_NOT_PRESENT_OFFSET, 7373 },
-  { 0x315d, G_UNICODE_NOT_PRESENT_OFFSET, 7377 },
-  { 0x315e, G_UNICODE_NOT_PRESENT_OFFSET, 7381 },
-  { 0x315f, G_UNICODE_NOT_PRESENT_OFFSET, 7385 },
-  { 0x3160, G_UNICODE_NOT_PRESENT_OFFSET, 7389 },
-  { 0x3161, G_UNICODE_NOT_PRESENT_OFFSET, 7393 },
-  { 0x3162, G_UNICODE_NOT_PRESENT_OFFSET, 7397 },
-  { 0x3163, G_UNICODE_NOT_PRESENT_OFFSET, 7401 },
-  { 0x3164, G_UNICODE_NOT_PRESENT_OFFSET, 7405 },
-  { 0x3165, G_UNICODE_NOT_PRESENT_OFFSET, 7409 },
-  { 0x3166, G_UNICODE_NOT_PRESENT_OFFSET, 7413 },
-  { 0x3167, G_UNICODE_NOT_PRESENT_OFFSET, 7417 },
-  { 0x3168, G_UNICODE_NOT_PRESENT_OFFSET, 7421 },
-  { 0x3169, G_UNICODE_NOT_PRESENT_OFFSET, 7425 },
-  { 0x316a, G_UNICODE_NOT_PRESENT_OFFSET, 7429 },
-  { 0x316b, G_UNICODE_NOT_PRESENT_OFFSET, 7433 },
-  { 0x316c, G_UNICODE_NOT_PRESENT_OFFSET, 7437 },
-  { 0x316d, G_UNICODE_NOT_PRESENT_OFFSET, 7441 },
-  { 0x316e, G_UNICODE_NOT_PRESENT_OFFSET, 7445 },
-  { 0x316f, G_UNICODE_NOT_PRESENT_OFFSET, 7449 },
-  { 0x3170, G_UNICODE_NOT_PRESENT_OFFSET, 7453 },
-  { 0x3171, G_UNICODE_NOT_PRESENT_OFFSET, 7457 },
-  { 0x3172, G_UNICODE_NOT_PRESENT_OFFSET, 7461 },
-  { 0x3173, G_UNICODE_NOT_PRESENT_OFFSET, 7465 },
-  { 0x3174, G_UNICODE_NOT_PRESENT_OFFSET, 7469 },
-  { 0x3175, G_UNICODE_NOT_PRESENT_OFFSET, 7473 },
-  { 0x3176, G_UNICODE_NOT_PRESENT_OFFSET, 7477 },
-  { 0x3177, G_UNICODE_NOT_PRESENT_OFFSET, 7481 },
-  { 0x3178, G_UNICODE_NOT_PRESENT_OFFSET, 7485 },
-  { 0x3179, G_UNICODE_NOT_PRESENT_OFFSET, 7489 },
-  { 0x317a, G_UNICODE_NOT_PRESENT_OFFSET, 7493 },
-  { 0x317b, G_UNICODE_NOT_PRESENT_OFFSET, 7497 },
-  { 0x317c, G_UNICODE_NOT_PRESENT_OFFSET, 7501 },
-  { 0x317d, G_UNICODE_NOT_PRESENT_OFFSET, 7505 },
-  { 0x317e, G_UNICODE_NOT_PRESENT_OFFSET, 7509 },
-  { 0x317f, G_UNICODE_NOT_PRESENT_OFFSET, 7513 },
-  { 0x3180, G_UNICODE_NOT_PRESENT_OFFSET, 7517 },
-  { 0x3181, G_UNICODE_NOT_PRESENT_OFFSET, 7521 },
-  { 0x3182, G_UNICODE_NOT_PRESENT_OFFSET, 7525 },
-  { 0x3183, G_UNICODE_NOT_PRESENT_OFFSET, 7529 },
-  { 0x3184, G_UNICODE_NOT_PRESENT_OFFSET, 7533 },
-  { 0x3185, G_UNICODE_NOT_PRESENT_OFFSET, 7537 },
-  { 0x3186, G_UNICODE_NOT_PRESENT_OFFSET, 7541 },
-  { 0x3187, G_UNICODE_NOT_PRESENT_OFFSET, 7545 },
-  { 0x3188, G_UNICODE_NOT_PRESENT_OFFSET, 7549 },
-  { 0x3189, G_UNICODE_NOT_PRESENT_OFFSET, 7553 },
-  { 0x318a, G_UNICODE_NOT_PRESENT_OFFSET, 7557 },
-  { 0x318b, G_UNICODE_NOT_PRESENT_OFFSET, 7561 },
-  { 0x318c, G_UNICODE_NOT_PRESENT_OFFSET, 7565 },
-  { 0x318d, G_UNICODE_NOT_PRESENT_OFFSET, 7569 },
-  { 0x318e, G_UNICODE_NOT_PRESENT_OFFSET, 7573 },
-  { 0x3192, G_UNICODE_NOT_PRESENT_OFFSET, 5903 },
-  { 0x3193, G_UNICODE_NOT_PRESENT_OFFSET, 5927 },
-  { 0x3194, G_UNICODE_NOT_PRESENT_OFFSET, 7577 },
-  { 0x3195, G_UNICODE_NOT_PRESENT_OFFSET, 7581 },
-  { 0x3196, G_UNICODE_NOT_PRESENT_OFFSET, 7585 },
-  { 0x3197, G_UNICODE_NOT_PRESENT_OFFSET, 7589 },
-  { 0x3198, G_UNICODE_NOT_PRESENT_OFFSET, 7593 },
-  { 0x3199, G_UNICODE_NOT_PRESENT_OFFSET, 7597 },
-  { 0x319a, G_UNICODE_NOT_PRESENT_OFFSET, 5919 },
-  { 0x319b, G_UNICODE_NOT_PRESENT_OFFSET, 7601 },
-  { 0x319c, G_UNICODE_NOT_PRESENT_OFFSET, 7605 },
-  { 0x319d, G_UNICODE_NOT_PRESENT_OFFSET, 7609 },
-  { 0x319e, G_UNICODE_NOT_PRESENT_OFFSET, 7613 },
-  { 0x319f, G_UNICODE_NOT_PRESENT_OFFSET, 5935 },
-  { 0x3200, G_UNICODE_NOT_PRESENT_OFFSET, 7617 },
-  { 0x3201, G_UNICODE_NOT_PRESENT_OFFSET, 7623 },
-  { 0x3202, G_UNICODE_NOT_PRESENT_OFFSET, 7629 },
-  { 0x3203, G_UNICODE_NOT_PRESENT_OFFSET, 7635 },
-  { 0x3204, G_UNICODE_NOT_PRESENT_OFFSET, 7641 },
-  { 0x3205, G_UNICODE_NOT_PRESENT_OFFSET, 7647 },
-  { 0x3206, G_UNICODE_NOT_PRESENT_OFFSET, 7653 },
-  { 0x3207, G_UNICODE_NOT_PRESENT_OFFSET, 7659 },
-  { 0x3208, G_UNICODE_NOT_PRESENT_OFFSET, 7665 },
-  { 0x3209, G_UNICODE_NOT_PRESENT_OFFSET, 7671 },
-  { 0x320a, G_UNICODE_NOT_PRESENT_OFFSET, 7677 },
-  { 0x320b, G_UNICODE_NOT_PRESENT_OFFSET, 7683 },
-  { 0x320c, G_UNICODE_NOT_PRESENT_OFFSET, 7689 },
-  { 0x320d, G_UNICODE_NOT_PRESENT_OFFSET, 7695 },
-  { 0x320e, G_UNICODE_NOT_PRESENT_OFFSET, 7701 },
-  { 0x320f, G_UNICODE_NOT_PRESENT_OFFSET, 7710 },
-  { 0x3210, G_UNICODE_NOT_PRESENT_OFFSET, 7719 },
-  { 0x3211, G_UNICODE_NOT_PRESENT_OFFSET, 7728 },
-  { 0x3212, G_UNICODE_NOT_PRESENT_OFFSET, 7737 },
-  { 0x3213, G_UNICODE_NOT_PRESENT_OFFSET, 7746 },
-  { 0x3214, G_UNICODE_NOT_PRESENT_OFFSET, 7755 },
-  { 0x3215, G_UNICODE_NOT_PRESENT_OFFSET, 7764 },
-  { 0x3216, G_UNICODE_NOT_PRESENT_OFFSET, 7773 },
-  { 0x3217, G_UNICODE_NOT_PRESENT_OFFSET, 7782 },
-  { 0x3218, G_UNICODE_NOT_PRESENT_OFFSET, 7791 },
-  { 0x3219, G_UNICODE_NOT_PRESENT_OFFSET, 7800 },
-  { 0x321a, G_UNICODE_NOT_PRESENT_OFFSET, 7809 },
-  { 0x321b, G_UNICODE_NOT_PRESENT_OFFSET, 7818 },
-  { 0x321c, G_UNICODE_NOT_PRESENT_OFFSET, 7827 },
-  { 0x3220, G_UNICODE_NOT_PRESENT_OFFSET, 7836 },
-  { 0x3221, G_UNICODE_NOT_PRESENT_OFFSET, 7842 },
-  { 0x3222, G_UNICODE_NOT_PRESENT_OFFSET, 7848 },
-  { 0x3223, G_UNICODE_NOT_PRESENT_OFFSET, 7854 },
-  { 0x3224, G_UNICODE_NOT_PRESENT_OFFSET, 7860 },
-  { 0x3225, G_UNICODE_NOT_PRESENT_OFFSET, 7866 },
-  { 0x3226, G_UNICODE_NOT_PRESENT_OFFSET, 7872 },
-  { 0x3227, G_UNICODE_NOT_PRESENT_OFFSET, 7878 },
-  { 0x3228, G_UNICODE_NOT_PRESENT_OFFSET, 7884 },
-  { 0x3229, G_UNICODE_NOT_PRESENT_OFFSET, 7890 },
-  { 0x322a, G_UNICODE_NOT_PRESENT_OFFSET, 7896 },
-  { 0x322b, G_UNICODE_NOT_PRESENT_OFFSET, 7902 },
-  { 0x322c, G_UNICODE_NOT_PRESENT_OFFSET, 7908 },
-  { 0x322d, G_UNICODE_NOT_PRESENT_OFFSET, 7914 },
-  { 0x322e, G_UNICODE_NOT_PRESENT_OFFSET, 7920 },
-  { 0x322f, G_UNICODE_NOT_PRESENT_OFFSET, 7926 },
-  { 0x3230, G_UNICODE_NOT_PRESENT_OFFSET, 7932 },
-  { 0x3231, G_UNICODE_NOT_PRESENT_OFFSET, 7938 },
-  { 0x3232, G_UNICODE_NOT_PRESENT_OFFSET, 7944 },
-  { 0x3233, G_UNICODE_NOT_PRESENT_OFFSET, 7950 },
-  { 0x3234, G_UNICODE_NOT_PRESENT_OFFSET, 7956 },
-  { 0x3235, G_UNICODE_NOT_PRESENT_OFFSET, 7962 },
-  { 0x3236, G_UNICODE_NOT_PRESENT_OFFSET, 7968 },
-  { 0x3237, G_UNICODE_NOT_PRESENT_OFFSET, 7974 },
-  { 0x3238, G_UNICODE_NOT_PRESENT_OFFSET, 7980 },
-  { 0x3239, G_UNICODE_NOT_PRESENT_OFFSET, 7986 },
-  { 0x323a, G_UNICODE_NOT_PRESENT_OFFSET, 7992 },
-  { 0x323b, G_UNICODE_NOT_PRESENT_OFFSET, 7998 },
-  { 0x323c, G_UNICODE_NOT_PRESENT_OFFSET, 8004 },
-  { 0x323d, G_UNICODE_NOT_PRESENT_OFFSET, 8010 },
-  { 0x323e, G_UNICODE_NOT_PRESENT_OFFSET, 8016 },
-  { 0x323f, G_UNICODE_NOT_PRESENT_OFFSET, 8022 },
-  { 0x3240, G_UNICODE_NOT_PRESENT_OFFSET, 8028 },
-  { 0x3241, G_UNICODE_NOT_PRESENT_OFFSET, 8034 },
-  { 0x3242, G_UNICODE_NOT_PRESENT_OFFSET, 8040 },
-  { 0x3243, G_UNICODE_NOT_PRESENT_OFFSET, 8046 },
-  { 0x3251, G_UNICODE_NOT_PRESENT_OFFSET, 8052 },
-  { 0x3252, G_UNICODE_NOT_PRESENT_OFFSET, 8055 },
-  { 0x3253, G_UNICODE_NOT_PRESENT_OFFSET, 8058 },
-  { 0x3254, G_UNICODE_NOT_PRESENT_OFFSET, 8061 },
-  { 0x3255, G_UNICODE_NOT_PRESENT_OFFSET, 8064 },
-  { 0x3256, G_UNICODE_NOT_PRESENT_OFFSET, 8067 },
-  { 0x3257, G_UNICODE_NOT_PRESENT_OFFSET, 8070 },
-  { 0x3258, G_UNICODE_NOT_PRESENT_OFFSET, 8073 },
-  { 0x3259, G_UNICODE_NOT_PRESENT_OFFSET, 8076 },
-  { 0x325a, G_UNICODE_NOT_PRESENT_OFFSET, 8079 },
-  { 0x325b, G_UNICODE_NOT_PRESENT_OFFSET, 8082 },
-  { 0x325c, G_UNICODE_NOT_PRESENT_OFFSET, 8085 },
-  { 0x325d, G_UNICODE_NOT_PRESENT_OFFSET, 8088 },
-  { 0x325e, G_UNICODE_NOT_PRESENT_OFFSET, 8091 },
-  { 0x325f, G_UNICODE_NOT_PRESENT_OFFSET, 8094 },
-  { 0x3260, G_UNICODE_NOT_PRESENT_OFFSET, 7201 },
-  { 0x3261, G_UNICODE_NOT_PRESENT_OFFSET, 7213 },
-  { 0x3262, G_UNICODE_NOT_PRESENT_OFFSET, 7225 },
-  { 0x3263, G_UNICODE_NOT_PRESENT_OFFSET, 7233 },
-  { 0x3264, G_UNICODE_NOT_PRESENT_OFFSET, 7265 },
-  { 0x3265, G_UNICODE_NOT_PRESENT_OFFSET, 7269 },
-  { 0x3266, G_UNICODE_NOT_PRESENT_OFFSET, 7281 },
-  { 0x3267, G_UNICODE_NOT_PRESENT_OFFSET, 7289 },
-  { 0x3268, G_UNICODE_NOT_PRESENT_OFFSET, 7293 },
-  { 0x3269, G_UNICODE_NOT_PRESENT_OFFSET, 7301 },
-  { 0x326a, G_UNICODE_NOT_PRESENT_OFFSET, 7305 },
-  { 0x326b, G_UNICODE_NOT_PRESENT_OFFSET, 7309 },
-  { 0x326c, G_UNICODE_NOT_PRESENT_OFFSET, 7313 },
-  { 0x326d, G_UNICODE_NOT_PRESENT_OFFSET, 7317 },
-  { 0x326e, G_UNICODE_NOT_PRESENT_OFFSET, 8097 },
-  { 0x326f, G_UNICODE_NOT_PRESENT_OFFSET, 8104 },
-  { 0x3270, G_UNICODE_NOT_PRESENT_OFFSET, 8111 },
-  { 0x3271, G_UNICODE_NOT_PRESENT_OFFSET, 8118 },
-  { 0x3272, G_UNICODE_NOT_PRESENT_OFFSET, 8125 },
-  { 0x3273, G_UNICODE_NOT_PRESENT_OFFSET, 8132 },
-  { 0x3274, G_UNICODE_NOT_PRESENT_OFFSET, 8139 },
-  { 0x3275, G_UNICODE_NOT_PRESENT_OFFSET, 8146 },
-  { 0x3276, G_UNICODE_NOT_PRESENT_OFFSET, 8153 },
-  { 0x3277, G_UNICODE_NOT_PRESENT_OFFSET, 8160 },
-  { 0x3278, G_UNICODE_NOT_PRESENT_OFFSET, 8167 },
-  { 0x3279, G_UNICODE_NOT_PRESENT_OFFSET, 8174 },
-  { 0x327a, G_UNICODE_NOT_PRESENT_OFFSET, 8181 },
-  { 0x327b, G_UNICODE_NOT_PRESENT_OFFSET, 8188 },
-  { 0x3280, G_UNICODE_NOT_PRESENT_OFFSET, 5903 },
-  { 0x3281, G_UNICODE_NOT_PRESENT_OFFSET, 5927 },
-  { 0x3282, G_UNICODE_NOT_PRESENT_OFFSET, 7577 },
-  { 0x3283, G_UNICODE_NOT_PRESENT_OFFSET, 7581 },
-  { 0x3284, G_UNICODE_NOT_PRESENT_OFFSET, 8195 },
-  { 0x3285, G_UNICODE_NOT_PRESENT_OFFSET, 8199 },
-  { 0x3286, G_UNICODE_NOT_PRESENT_OFFSET, 8203 },
-  { 0x3287, G_UNICODE_NOT_PRESENT_OFFSET, 5947 },
-  { 0x3288, G_UNICODE_NOT_PRESENT_OFFSET, 8207 },
-  { 0x3289, G_UNICODE_NOT_PRESENT_OFFSET, 5995 },
-  { 0x328a, G_UNICODE_NOT_PRESENT_OFFSET, 6195 },
-  { 0x328b, G_UNICODE_NOT_PRESENT_OFFSET, 6243 },
-  { 0x328c, G_UNICODE_NOT_PRESENT_OFFSET, 6239 },
-  { 0x328d, G_UNICODE_NOT_PRESENT_OFFSET, 6199 },
-  { 0x328e, G_UNICODE_NOT_PRESENT_OFFSET, 6567 },
-  { 0x328f, G_UNICODE_NOT_PRESENT_OFFSET, 6027 },
-  { 0x3290, G_UNICODE_NOT_PRESENT_OFFSET, 6187 },
-  { 0x3291, G_UNICODE_NOT_PRESENT_OFFSET, 8211 },
-  { 0x3292, G_UNICODE_NOT_PRESENT_OFFSET, 8215 },
-  { 0x3293, G_UNICODE_NOT_PRESENT_OFFSET, 8219 },
-  { 0x3294, G_UNICODE_NOT_PRESENT_OFFSET, 8223 },
-  { 0x3295, G_UNICODE_NOT_PRESENT_OFFSET, 8227 },
-  { 0x3296, G_UNICODE_NOT_PRESENT_OFFSET, 8231 },
-  { 0x3297, G_UNICODE_NOT_PRESENT_OFFSET, 8235 },
-  { 0x3298, G_UNICODE_NOT_PRESENT_OFFSET, 8239 },
-  { 0x3299, G_UNICODE_NOT_PRESENT_OFFSET, 8243 },
-  { 0x329a, G_UNICODE_NOT_PRESENT_OFFSET, 8247 },
-  { 0x329b, G_UNICODE_NOT_PRESENT_OFFSET, 6051 },
-  { 0x329c, G_UNICODE_NOT_PRESENT_OFFSET, 8251 },
-  { 0x329d, G_UNICODE_NOT_PRESENT_OFFSET, 8255 },
-  { 0x329e, G_UNICODE_NOT_PRESENT_OFFSET, 8259 },
-  { 0x329f, G_UNICODE_NOT_PRESENT_OFFSET, 8263 },
-  { 0x32a0, G_UNICODE_NOT_PRESENT_OFFSET, 8267 },
-  { 0x32a1, G_UNICODE_NOT_PRESENT_OFFSET, 8271 },
-  { 0x32a2, G_UNICODE_NOT_PRESENT_OFFSET, 8275 },
-  { 0x32a3, G_UNICODE_NOT_PRESENT_OFFSET, 8279 },
-  { 0x32a4, G_UNICODE_NOT_PRESENT_OFFSET, 7585 },
-  { 0x32a5, G_UNICODE_NOT_PRESENT_OFFSET, 7589 },
-  { 0x32a6, G_UNICODE_NOT_PRESENT_OFFSET, 7593 },
-  { 0x32a7, G_UNICODE_NOT_PRESENT_OFFSET, 8283 },
-  { 0x32a8, G_UNICODE_NOT_PRESENT_OFFSET, 8287 },
-  { 0x32a9, G_UNICODE_NOT_PRESENT_OFFSET, 8291 },
-  { 0x32aa, G_UNICODE_NOT_PRESENT_OFFSET, 8295 },
-  { 0x32ab, G_UNICODE_NOT_PRESENT_OFFSET, 8299 },
-  { 0x32ac, G_UNICODE_NOT_PRESENT_OFFSET, 8303 },
-  { 0x32ad, G_UNICODE_NOT_PRESENT_OFFSET, 8307 },
-  { 0x32ae, G_UNICODE_NOT_PRESENT_OFFSET, 8311 },
-  { 0x32af, G_UNICODE_NOT_PRESENT_OFFSET, 8315 },
-  { 0x32b0, G_UNICODE_NOT_PRESENT_OFFSET, 8319 },
-  { 0x32b1, G_UNICODE_NOT_PRESENT_OFFSET, 8323 },
-  { 0x32b2, G_UNICODE_NOT_PRESENT_OFFSET, 8326 },
-  { 0x32b3, G_UNICODE_NOT_PRESENT_OFFSET, 8329 },
-  { 0x32b4, G_UNICODE_NOT_PRESENT_OFFSET, 8332 },
-  { 0x32b5, G_UNICODE_NOT_PRESENT_OFFSET, 8335 },
-  { 0x32b6, G_UNICODE_NOT_PRESENT_OFFSET, 8338 },
-  { 0x32b7, G_UNICODE_NOT_PRESENT_OFFSET, 8341 },
-  { 0x32b8, G_UNICODE_NOT_PRESENT_OFFSET, 8344 },
-  { 0x32b9, G_UNICODE_NOT_PRESENT_OFFSET, 8347 },
-  { 0x32ba, G_UNICODE_NOT_PRESENT_OFFSET, 8350 },
-  { 0x32bb, G_UNICODE_NOT_PRESENT_OFFSET, 8353 },
-  { 0x32bc, G_UNICODE_NOT_PRESENT_OFFSET, 8356 },
-  { 0x32bd, G_UNICODE_NOT_PRESENT_OFFSET, 8359 },
-  { 0x32be, G_UNICODE_NOT_PRESENT_OFFSET, 8362 },
-  { 0x32bf, G_UNICODE_NOT_PRESENT_OFFSET, 8365 },
-  { 0x32c0, G_UNICODE_NOT_PRESENT_OFFSET, 8368 },
-  { 0x32c1, G_UNICODE_NOT_PRESENT_OFFSET, 8373 },
-  { 0x32c2, G_UNICODE_NOT_PRESENT_OFFSET, 8378 },
-  { 0x32c3, G_UNICODE_NOT_PRESENT_OFFSET, 8383 },
-  { 0x32c4, G_UNICODE_NOT_PRESENT_OFFSET, 8388 },
-  { 0x32c5, G_UNICODE_NOT_PRESENT_OFFSET, 8393 },
-  { 0x32c6, G_UNICODE_NOT_PRESENT_OFFSET, 8398 },
-  { 0x32c7, G_UNICODE_NOT_PRESENT_OFFSET, 8403 },
-  { 0x32c8, G_UNICODE_NOT_PRESENT_OFFSET, 8408 },
-  { 0x32c9, G_UNICODE_NOT_PRESENT_OFFSET, 8413 },
-  { 0x32ca, G_UNICODE_NOT_PRESENT_OFFSET, 8419 },
-  { 0x32cb, G_UNICODE_NOT_PRESENT_OFFSET, 8425 },
-  { 0x32d0, G_UNICODE_NOT_PRESENT_OFFSET, 8431 },
-  { 0x32d1, G_UNICODE_NOT_PRESENT_OFFSET, 8435 },
-  { 0x32d2, G_UNICODE_NOT_PRESENT_OFFSET, 8439 },
-  { 0x32d3, G_UNICODE_NOT_PRESENT_OFFSET, 8443 },
-  { 0x32d4, G_UNICODE_NOT_PRESENT_OFFSET, 8447 },
-  { 0x32d5, G_UNICODE_NOT_PRESENT_OFFSET, 8451 },
-  { 0x32d6, G_UNICODE_NOT_PRESENT_OFFSET, 8455 },
-  { 0x32d7, G_UNICODE_NOT_PRESENT_OFFSET, 8459 },
-  { 0x32d8, G_UNICODE_NOT_PRESENT_OFFSET, 8463 },
-  { 0x32d9, G_UNICODE_NOT_PRESENT_OFFSET, 8467 },
-  { 0x32da, G_UNICODE_NOT_PRESENT_OFFSET, 8471 },
-  { 0x32db, G_UNICODE_NOT_PRESENT_OFFSET, 8475 },
-  { 0x32dc, G_UNICODE_NOT_PRESENT_OFFSET, 8479 },
-  { 0x32dd, G_UNICODE_NOT_PRESENT_OFFSET, 8483 },
-  { 0x32de, G_UNICODE_NOT_PRESENT_OFFSET, 8487 },
-  { 0x32df, G_UNICODE_NOT_PRESENT_OFFSET, 8491 },
-  { 0x32e0, G_UNICODE_NOT_PRESENT_OFFSET, 8495 },
-  { 0x32e1, G_UNICODE_NOT_PRESENT_OFFSET, 8499 },
-  { 0x32e2, G_UNICODE_NOT_PRESENT_OFFSET, 8503 },
-  { 0x32e3, G_UNICODE_NOT_PRESENT_OFFSET, 8507 },
-  { 0x32e4, G_UNICODE_NOT_PRESENT_OFFSET, 8511 },
-  { 0x32e5, G_UNICODE_NOT_PRESENT_OFFSET, 8515 },
-  { 0x32e6, G_UNICODE_NOT_PRESENT_OFFSET, 8519 },
-  { 0x32e7, G_UNICODE_NOT_PRESENT_OFFSET, 8523 },
-  { 0x32e8, G_UNICODE_NOT_PRESENT_OFFSET, 8527 },
-  { 0x32e9, G_UNICODE_NOT_PRESENT_OFFSET, 8531 },
-  { 0x32ea, G_UNICODE_NOT_PRESENT_OFFSET, 8535 },
-  { 0x32eb, G_UNICODE_NOT_PRESENT_OFFSET, 8539 },
-  { 0x32ec, G_UNICODE_NOT_PRESENT_OFFSET, 8543 },
-  { 0x32ed, G_UNICODE_NOT_PRESENT_OFFSET, 8547 },
-  { 0x32ee, G_UNICODE_NOT_PRESENT_OFFSET, 8551 },
-  { 0x32ef, G_UNICODE_NOT_PRESENT_OFFSET, 8555 },
-  { 0x32f0, G_UNICODE_NOT_PRESENT_OFFSET, 8559 },
-  { 0x32f1, G_UNICODE_NOT_PRESENT_OFFSET, 8563 },
-  { 0x32f2, G_UNICODE_NOT_PRESENT_OFFSET, 8567 },
-  { 0x32f3, G_UNICODE_NOT_PRESENT_OFFSET, 8571 },
-  { 0x32f4, G_UNICODE_NOT_PRESENT_OFFSET, 8575 },
-  { 0x32f5, G_UNICODE_NOT_PRESENT_OFFSET, 8579 },
-  { 0x32f6, G_UNICODE_NOT_PRESENT_OFFSET, 8583 },
-  { 0x32f7, G_UNICODE_NOT_PRESENT_OFFSET, 8587 },
-  { 0x32f8, G_UNICODE_NOT_PRESENT_OFFSET, 8591 },
-  { 0x32f9, G_UNICODE_NOT_PRESENT_OFFSET, 8595 },
-  { 0x32fa, G_UNICODE_NOT_PRESENT_OFFSET, 8599 },
-  { 0x32fb, G_UNICODE_NOT_PRESENT_OFFSET, 8603 },
-  { 0x32fc, G_UNICODE_NOT_PRESENT_OFFSET, 8607 },
-  { 0x32fd, G_UNICODE_NOT_PRESENT_OFFSET, 8611 },
-  { 0x32fe, G_UNICODE_NOT_PRESENT_OFFSET, 8615 },
-  { 0x3300, G_UNICODE_NOT_PRESENT_OFFSET, 8619 },
-  { 0x3301, G_UNICODE_NOT_PRESENT_OFFSET, 8635 },
-  { 0x3302, G_UNICODE_NOT_PRESENT_OFFSET, 8648 },
-  { 0x3303, G_UNICODE_NOT_PRESENT_OFFSET, 8664 },
-  { 0x3304, G_UNICODE_NOT_PRESENT_OFFSET, 8674 },
-  { 0x3305, G_UNICODE_NOT_PRESENT_OFFSET, 8690 },
-  { 0x3306, G_UNICODE_NOT_PRESENT_OFFSET, 8700 },
-  { 0x3307, G_UNICODE_NOT_PRESENT_OFFSET, 8710 },
-  { 0x3308, G_UNICODE_NOT_PRESENT_OFFSET, 8729 },
-  { 0x3309, G_UNICODE_NOT_PRESENT_OFFSET, 8742 },
-  { 0x330a, G_UNICODE_NOT_PRESENT_OFFSET, 8752 },
-  { 0x330b, G_UNICODE_NOT_PRESENT_OFFSET, 8762 },
-  { 0x330c, G_UNICODE_NOT_PRESENT_OFFSET, 8772 },
-  { 0x330d, G_UNICODE_NOT_PRESENT_OFFSET, 8785 },
-  { 0x330e, G_UNICODE_NOT_PRESENT_OFFSET, 8798 },
-  { 0x330f, G_UNICODE_NOT_PRESENT_OFFSET, 8811 },
-  { 0x3310, G_UNICODE_NOT_PRESENT_OFFSET, 8824 },
-  { 0x3311, G_UNICODE_NOT_PRESENT_OFFSET, 8837 },
-  { 0x3312, G_UNICODE_NOT_PRESENT_OFFSET, 8850 },
-  { 0x3313, G_UNICODE_NOT_PRESENT_OFFSET, 8863 },
-  { 0x3314, G_UNICODE_NOT_PRESENT_OFFSET, 8882 },
-  { 0x3315, G_UNICODE_NOT_PRESENT_OFFSET, 8889 },
-  { 0x3316, G_UNICODE_NOT_PRESENT_OFFSET, 8908 },
-  { 0x3317, G_UNICODE_NOT_PRESENT_OFFSET, 8927 },
-  { 0x3318, G_UNICODE_NOT_PRESENT_OFFSET, 8943 },
-  { 0x3319, G_UNICODE_NOT_PRESENT_OFFSET, 8956 },
-  { 0x331a, G_UNICODE_NOT_PRESENT_OFFSET, 8975 },
-  { 0x331b, G_UNICODE_NOT_PRESENT_OFFSET, 8994 },
-  { 0x331c, G_UNICODE_NOT_PRESENT_OFFSET, 9007 },
-  { 0x331d, G_UNICODE_NOT_PRESENT_OFFSET, 9017 },
-  { 0x331e, G_UNICODE_NOT_PRESENT_OFFSET, 9027 },
-  { 0x331f, G_UNICODE_NOT_PRESENT_OFFSET, 9040 },
-  { 0x3320, G_UNICODE_NOT_PRESENT_OFFSET, 9053 },
-  { 0x3321, G_UNICODE_NOT_PRESENT_OFFSET, 9069 },
-  { 0x3322, G_UNICODE_NOT_PRESENT_OFFSET, 9085 },
-  { 0x3323, G_UNICODE_NOT_PRESENT_OFFSET, 9095 },
-  { 0x3324, G_UNICODE_NOT_PRESENT_OFFSET, 9105 },
-  { 0x3325, G_UNICODE_NOT_PRESENT_OFFSET, 9118 },
-  { 0x3326, G_UNICODE_NOT_PRESENT_OFFSET, 9128 },
-  { 0x3327, G_UNICODE_NOT_PRESENT_OFFSET, 9138 },
-  { 0x3328, G_UNICODE_NOT_PRESENT_OFFSET, 9145 },
-  { 0x3329, G_UNICODE_NOT_PRESENT_OFFSET, 9152 },
-  { 0x332a, G_UNICODE_NOT_PRESENT_OFFSET, 9162 },
-  { 0x332b, G_UNICODE_NOT_PRESENT_OFFSET, 9172 },
-  { 0x332c, G_UNICODE_NOT_PRESENT_OFFSET, 9191 },
-  { 0x332d, G_UNICODE_NOT_PRESENT_OFFSET, 9204 },
-  { 0x332e, G_UNICODE_NOT_PRESENT_OFFSET, 9220 },
-  { 0x332f, G_UNICODE_NOT_PRESENT_OFFSET, 9239 },
-  { 0x3330, G_UNICODE_NOT_PRESENT_OFFSET, 9252 },
-  { 0x3331, G_UNICODE_NOT_PRESENT_OFFSET, 9262 },
-  { 0x3332, G_UNICODE_NOT_PRESENT_OFFSET, 9272 },
-  { 0x3333, G_UNICODE_NOT_PRESENT_OFFSET, 9291 },
-  { 0x3334, G_UNICODE_NOT_PRESENT_OFFSET, 9304 },
-  { 0x3335, G_UNICODE_NOT_PRESENT_OFFSET, 9323 },
-  { 0x3336, G_UNICODE_NOT_PRESENT_OFFSET, 9333 },
-  { 0x3337, G_UNICODE_NOT_PRESENT_OFFSET, 9349 },
-  { 0x3338, G_UNICODE_NOT_PRESENT_OFFSET, 9359 },
-  { 0x3339, G_UNICODE_NOT_PRESENT_OFFSET, 9372 },
-  { 0x333a, G_UNICODE_NOT_PRESENT_OFFSET, 9382 },
-  { 0x333b, G_UNICODE_NOT_PRESENT_OFFSET, 9395 },
-  { 0x333c, G_UNICODE_NOT_PRESENT_OFFSET, 9411 },
-  { 0x333d, G_UNICODE_NOT_PRESENT_OFFSET, 9424 },
-  { 0x333e, G_UNICODE_NOT_PRESENT_OFFSET, 9440 },
-  { 0x333f, G_UNICODE_NOT_PRESENT_OFFSET, 9453 },
-  { 0x3340, G_UNICODE_NOT_PRESENT_OFFSET, 9460 },
-  { 0x3341, G_UNICODE_NOT_PRESENT_OFFSET, 9476 },
-  { 0x3342, G_UNICODE_NOT_PRESENT_OFFSET, 9486 },
-  { 0x3343, G_UNICODE_NOT_PRESENT_OFFSET, 9496 },
-  { 0x3344, G_UNICODE_NOT_PRESENT_OFFSET, 9509 },
-  { 0x3345, G_UNICODE_NOT_PRESENT_OFFSET, 9519 },
-  { 0x3346, G_UNICODE_NOT_PRESENT_OFFSET, 9529 },
-  { 0x3347, G_UNICODE_NOT_PRESENT_OFFSET, 9539 },
-  { 0x3348, G_UNICODE_NOT_PRESENT_OFFSET, 9555 },
-  { 0x3349, G_UNICODE_NOT_PRESENT_OFFSET, 9568 },
-  { 0x334a, G_UNICODE_NOT_PRESENT_OFFSET, 9575 },
-  { 0x334b, G_UNICODE_NOT_PRESENT_OFFSET, 9594 },
-  { 0x334c, G_UNICODE_NOT_PRESENT_OFFSET, 9604 },
-  { 0x334d, G_UNICODE_NOT_PRESENT_OFFSET, 9620 },
-  { 0x334e, G_UNICODE_NOT_PRESENT_OFFSET, 9633 },
-  { 0x334f, G_UNICODE_NOT_PRESENT_OFFSET, 9646 },
-  { 0x3350, G_UNICODE_NOT_PRESENT_OFFSET, 9656 },
-  { 0x3351, G_UNICODE_NOT_PRESENT_OFFSET, 9666 },
-  { 0x3352, G_UNICODE_NOT_PRESENT_OFFSET, 9679 },
-  { 0x3353, G_UNICODE_NOT_PRESENT_OFFSET, 9686 },
-  { 0x3354, G_UNICODE_NOT_PRESENT_OFFSET, 9699 },
-  { 0x3355, G_UNICODE_NOT_PRESENT_OFFSET, 9715 },
-  { 0x3356, G_UNICODE_NOT_PRESENT_OFFSET, 9722 },
-  { 0x3357, G_UNICODE_NOT_PRESENT_OFFSET, 9741 },
-  { 0x3358, G_UNICODE_NOT_PRESENT_OFFSET, 9751 },
-  { 0x3359, G_UNICODE_NOT_PRESENT_OFFSET, 9756 },
-  { 0x335a, G_UNICODE_NOT_PRESENT_OFFSET, 9761 },
-  { 0x335b, G_UNICODE_NOT_PRESENT_OFFSET, 9766 },
-  { 0x335c, G_UNICODE_NOT_PRESENT_OFFSET, 9771 },
-  { 0x335d, G_UNICODE_NOT_PRESENT_OFFSET, 9776 },
-  { 0x335e, G_UNICODE_NOT_PRESENT_OFFSET, 9781 },
-  { 0x335f, G_UNICODE_NOT_PRESENT_OFFSET, 9786 },
-  { 0x3360, G_UNICODE_NOT_PRESENT_OFFSET, 9791 },
-  { 0x3361, G_UNICODE_NOT_PRESENT_OFFSET, 9796 },
-  { 0x3362, G_UNICODE_NOT_PRESENT_OFFSET, 9801 },
-  { 0x3363, G_UNICODE_NOT_PRESENT_OFFSET, 9807 },
-  { 0x3364, G_UNICODE_NOT_PRESENT_OFFSET, 9813 },
-  { 0x3365, G_UNICODE_NOT_PRESENT_OFFSET, 9819 },
-  { 0x3366, G_UNICODE_NOT_PRESENT_OFFSET, 9825 },
-  { 0x3367, G_UNICODE_NOT_PRESENT_OFFSET, 9831 },
-  { 0x3368, G_UNICODE_NOT_PRESENT_OFFSET, 9837 },
-  { 0x3369, G_UNICODE_NOT_PRESENT_OFFSET, 9843 },
-  { 0x336a, G_UNICODE_NOT_PRESENT_OFFSET, 9849 },
-  { 0x336b, G_UNICODE_NOT_PRESENT_OFFSET, 9855 },
-  { 0x336c, G_UNICODE_NOT_PRESENT_OFFSET, 9861 },
-  { 0x336d, G_UNICODE_NOT_PRESENT_OFFSET, 9867 },
-  { 0x336e, G_UNICODE_NOT_PRESENT_OFFSET, 9873 },
-  { 0x336f, G_UNICODE_NOT_PRESENT_OFFSET, 9879 },
-  { 0x3370, G_UNICODE_NOT_PRESENT_OFFSET, 9885 },
-  { 0x3371, G_UNICODE_NOT_PRESENT_OFFSET, 9891 },
-  { 0x3372, G_UNICODE_NOT_PRESENT_OFFSET, 9895 },
-  { 0x3373, G_UNICODE_NOT_PRESENT_OFFSET, 9898 },
-  { 0x3374, G_UNICODE_NOT_PRESENT_OFFSET, 9901 },
-  { 0x3375, G_UNICODE_NOT_PRESENT_OFFSET, 9905 },
-  { 0x3376, G_UNICODE_NOT_PRESENT_OFFSET, 9908 },
-  { 0x337b, G_UNICODE_NOT_PRESENT_OFFSET, 9911 },
-  { 0x337c, G_UNICODE_NOT_PRESENT_OFFSET, 9918 },
-  { 0x337d, G_UNICODE_NOT_PRESENT_OFFSET, 9925 },
-  { 0x337e, G_UNICODE_NOT_PRESENT_OFFSET, 9932 },
-  { 0x337f, G_UNICODE_NOT_PRESENT_OFFSET, 9939 },
-  { 0x3380, G_UNICODE_NOT_PRESENT_OFFSET, 9952 },
-  { 0x3381, G_UNICODE_NOT_PRESENT_OFFSET, 9955 },
-  { 0x3382, G_UNICODE_NOT_PRESENT_OFFSET, 9958 },
-  { 0x3383, G_UNICODE_NOT_PRESENT_OFFSET, 9962 },
-  { 0x3384, G_UNICODE_NOT_PRESENT_OFFSET, 9965 },
-  { 0x3385, G_UNICODE_NOT_PRESENT_OFFSET, 9968 },
-  { 0x3386, G_UNICODE_NOT_PRESENT_OFFSET, 9971 },
-  { 0x3387, G_UNICODE_NOT_PRESENT_OFFSET, 9974 },
-  { 0x3388, G_UNICODE_NOT_PRESENT_OFFSET, 9977 },
-  { 0x3389, G_UNICODE_NOT_PRESENT_OFFSET, 9981 },
-  { 0x338a, G_UNICODE_NOT_PRESENT_OFFSET, 9986 },
-  { 0x338b, G_UNICODE_NOT_PRESENT_OFFSET, 9989 },
-  { 0x338c, G_UNICODE_NOT_PRESENT_OFFSET, 9992 },
-  { 0x338d, G_UNICODE_NOT_PRESENT_OFFSET, 9996 },
-  { 0x338e, G_UNICODE_NOT_PRESENT_OFFSET, 10000 },
-  { 0x338f, G_UNICODE_NOT_PRESENT_OFFSET, 10003 },
-  { 0x3390, G_UNICODE_NOT_PRESENT_OFFSET, 10006 },
-  { 0x3391, G_UNICODE_NOT_PRESENT_OFFSET, 10009 },
-  { 0x3392, G_UNICODE_NOT_PRESENT_OFFSET, 10013 },
-  { 0x3393, G_UNICODE_NOT_PRESENT_OFFSET, 10017 },
-  { 0x3394, G_UNICODE_NOT_PRESENT_OFFSET, 10021 },
-  { 0x3395, G_UNICODE_NOT_PRESENT_OFFSET, 10025 },
-  { 0x3396, G_UNICODE_NOT_PRESENT_OFFSET, 10029 },
-  { 0x3397, G_UNICODE_NOT_PRESENT_OFFSET, 10032 },
-  { 0x3398, G_UNICODE_NOT_PRESENT_OFFSET, 10035 },
-  { 0x3399, G_UNICODE_NOT_PRESENT_OFFSET, 10038 },
-  { 0x339a, G_UNICODE_NOT_PRESENT_OFFSET, 10041 },
-  { 0x339b, G_UNICODE_NOT_PRESENT_OFFSET, 10044 },
-  { 0x339c, G_UNICODE_NOT_PRESENT_OFFSET, 10048 },
-  { 0x339d, G_UNICODE_NOT_PRESENT_OFFSET, 10051 },
-  { 0x339e, G_UNICODE_NOT_PRESENT_OFFSET, 10054 },
-  { 0x339f, G_UNICODE_NOT_PRESENT_OFFSET, 10057 },
-  { 0x33a0, G_UNICODE_NOT_PRESENT_OFFSET, 10061 },
-  { 0x33a1, G_UNICODE_NOT_PRESENT_OFFSET, 10065 },
-  { 0x33a2, G_UNICODE_NOT_PRESENT_OFFSET, 10068 },
-  { 0x33a3, G_UNICODE_NOT_PRESENT_OFFSET, 10072 },
-  { 0x33a4, G_UNICODE_NOT_PRESENT_OFFSET, 10076 },
-  { 0x33a5, G_UNICODE_NOT_PRESENT_OFFSET, 10080 },
-  { 0x33a6, G_UNICODE_NOT_PRESENT_OFFSET, 10083 },
-  { 0x33a7, G_UNICODE_NOT_PRESENT_OFFSET, 10087 },
-  { 0x33a8, G_UNICODE_NOT_PRESENT_OFFSET, 10093 },
-  { 0x33a9, G_UNICODE_NOT_PRESENT_OFFSET, 10100 },
-  { 0x33aa, G_UNICODE_NOT_PRESENT_OFFSET, 10103 },
-  { 0x33ab, G_UNICODE_NOT_PRESENT_OFFSET, 10107 },
-  { 0x33ac, G_UNICODE_NOT_PRESENT_OFFSET, 10111 },
-  { 0x33ad, G_UNICODE_NOT_PRESENT_OFFSET, 10115 },
-  { 0x33ae, G_UNICODE_NOT_PRESENT_OFFSET, 10119 },
-  { 0x33af, G_UNICODE_NOT_PRESENT_OFFSET, 10127 },
-  { 0x33b0, G_UNICODE_NOT_PRESENT_OFFSET, 10136 },
-  { 0x33b1, G_UNICODE_NOT_PRESENT_OFFSET, 10139 },
-  { 0x33b2, G_UNICODE_NOT_PRESENT_OFFSET, 10142 },
-  { 0x33b3, G_UNICODE_NOT_PRESENT_OFFSET, 10146 },
-  { 0x33b4, G_UNICODE_NOT_PRESENT_OFFSET, 10149 },
-  { 0x33b5, G_UNICODE_NOT_PRESENT_OFFSET, 10152 },
-  { 0x33b6, G_UNICODE_NOT_PRESENT_OFFSET, 10155 },
-  { 0x33b7, G_UNICODE_NOT_PRESENT_OFFSET, 10159 },
-  { 0x33b8, G_UNICODE_NOT_PRESENT_OFFSET, 10162 },
-  { 0x33b9, G_UNICODE_NOT_PRESENT_OFFSET, 10165 },
-  { 0x33ba, G_UNICODE_NOT_PRESENT_OFFSET, 10168 },
-  { 0x33bb, G_UNICODE_NOT_PRESENT_OFFSET, 10171 },
-  { 0x33bc, G_UNICODE_NOT_PRESENT_OFFSET, 10174 },
-  { 0x33bd, G_UNICODE_NOT_PRESENT_OFFSET, 10178 },
-  { 0x33be, G_UNICODE_NOT_PRESENT_OFFSET, 10181 },
-  { 0x33bf, G_UNICODE_NOT_PRESENT_OFFSET, 10184 },
-  { 0x33c0, G_UNICODE_NOT_PRESENT_OFFSET, 10187 },
-  { 0x33c1, G_UNICODE_NOT_PRESENT_OFFSET, 10191 },
-  { 0x33c2, G_UNICODE_NOT_PRESENT_OFFSET, 10195 },
-  { 0x33c3, G_UNICODE_NOT_PRESENT_OFFSET, 10200 },
-  { 0x33c4, G_UNICODE_NOT_PRESENT_OFFSET, 10203 },
-  { 0x33c5, G_UNICODE_NOT_PRESENT_OFFSET, 10206 },
-  { 0x33c6, G_UNICODE_NOT_PRESENT_OFFSET, 10209 },
-  { 0x33c7, G_UNICODE_NOT_PRESENT_OFFSET, 10216 },
-  { 0x33c8, G_UNICODE_NOT_PRESENT_OFFSET, 10220 },
-  { 0x33c9, G_UNICODE_NOT_PRESENT_OFFSET, 10223 },
-  { 0x33ca, G_UNICODE_NOT_PRESENT_OFFSET, 10226 },
-  { 0x33cb, G_UNICODE_NOT_PRESENT_OFFSET, 10229 },
-  { 0x33cc, G_UNICODE_NOT_PRESENT_OFFSET, 10232 },
-  { 0x33cd, G_UNICODE_NOT_PRESENT_OFFSET, 10235 },
-  { 0x33ce, G_UNICODE_NOT_PRESENT_OFFSET, 10238 },
-  { 0x33cf, G_UNICODE_NOT_PRESENT_OFFSET, 10241 },
-  { 0x33d0, G_UNICODE_NOT_PRESENT_OFFSET, 10244 },
-  { 0x33d1, G_UNICODE_NOT_PRESENT_OFFSET, 10247 },
-  { 0x33d2, G_UNICODE_NOT_PRESENT_OFFSET, 10250 },
-  { 0x33d3, G_UNICODE_NOT_PRESENT_OFFSET, 10254 },
-  { 0x33d4, G_UNICODE_NOT_PRESENT_OFFSET, 10257 },
-  { 0x33d5, G_UNICODE_NOT_PRESENT_OFFSET, 10260 },
-  { 0x33d6, G_UNICODE_NOT_PRESENT_OFFSET, 10264 },
-  { 0x33d7, G_UNICODE_NOT_PRESENT_OFFSET, 10268 },
-  { 0x33d8, G_UNICODE_NOT_PRESENT_OFFSET, 10271 },
-  { 0x33d9, G_UNICODE_NOT_PRESENT_OFFSET, 10276 },
-  { 0x33da, G_UNICODE_NOT_PRESENT_OFFSET, 10280 },
-  { 0x33db, G_UNICODE_NOT_PRESENT_OFFSET, 10283 },
-  { 0x33dc, G_UNICODE_NOT_PRESENT_OFFSET, 10286 },
-  { 0x33dd, G_UNICODE_NOT_PRESENT_OFFSET, 10289 },
-  { 0x33e0, G_UNICODE_NOT_PRESENT_OFFSET, 10292 },
-  { 0x33e1, G_UNICODE_NOT_PRESENT_OFFSET, 10297 },
-  { 0x33e2, G_UNICODE_NOT_PRESENT_OFFSET, 10302 },
-  { 0x33e3, G_UNICODE_NOT_PRESENT_OFFSET, 10307 },
-  { 0x33e4, G_UNICODE_NOT_PRESENT_OFFSET, 10312 },
-  { 0x33e5, G_UNICODE_NOT_PRESENT_OFFSET, 10317 },
-  { 0x33e6, G_UNICODE_NOT_PRESENT_OFFSET, 10322 },
-  { 0x33e7, G_UNICODE_NOT_PRESENT_OFFSET, 10327 },
-  { 0x33e8, G_UNICODE_NOT_PRESENT_OFFSET, 10332 },
-  { 0x33e9, G_UNICODE_NOT_PRESENT_OFFSET, 10337 },
-  { 0x33ea, G_UNICODE_NOT_PRESENT_OFFSET, 10343 },
-  { 0x33eb, G_UNICODE_NOT_PRESENT_OFFSET, 10349 },
-  { 0x33ec, G_UNICODE_NOT_PRESENT_OFFSET, 10355 },
-  { 0x33ed, G_UNICODE_NOT_PRESENT_OFFSET, 10361 },
-  { 0x33ee, G_UNICODE_NOT_PRESENT_OFFSET, 10367 },
-  { 0x33ef, G_UNICODE_NOT_PRESENT_OFFSET, 10373 },
-  { 0x33f0, G_UNICODE_NOT_PRESENT_OFFSET, 10379 },
-  { 0x33f1, G_UNICODE_NOT_PRESENT_OFFSET, 10385 },
-  { 0x33f2, G_UNICODE_NOT_PRESENT_OFFSET, 10391 },
-  { 0x33f3, G_UNICODE_NOT_PRESENT_OFFSET, 10397 },
-  { 0x33f4, G_UNICODE_NOT_PRESENT_OFFSET, 10403 },
-  { 0x33f5, G_UNICODE_NOT_PRESENT_OFFSET, 10409 },
-  { 0x33f6, G_UNICODE_NOT_PRESENT_OFFSET, 10415 },
-  { 0x33f7, G_UNICODE_NOT_PRESENT_OFFSET, 10421 },
-  { 0x33f8, G_UNICODE_NOT_PRESENT_OFFSET, 10427 },
-  { 0x33f9, G_UNICODE_NOT_PRESENT_OFFSET, 10433 },
-  { 0x33fa, G_UNICODE_NOT_PRESENT_OFFSET, 10439 },
-  { 0x33fb, G_UNICODE_NOT_PRESENT_OFFSET, 10445 },
-  { 0x33fc, G_UNICODE_NOT_PRESENT_OFFSET, 10451 },
-  { 0x33fd, G_UNICODE_NOT_PRESENT_OFFSET, 10457 },
-  { 0x33fe, G_UNICODE_NOT_PRESENT_OFFSET, 10463 },
-  { 0xf900, 10469, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf901, 10473, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf902, 6535, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf903, 10477, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf904, 10481, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf905, 10485, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf906, 10489, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf907, 6751, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf908, 6751, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf909, 10493, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf90a, 6567, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf90b, 10497, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf90c, 10501, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf90d, 10505, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf90e, 10509, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf90f, 10513, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf910, 10517, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf911, 10521, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf912, 10525, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf913, 10529, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf914, 10533, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf915, 10537, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf916, 10541, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf917, 10545, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf918, 10549, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf919, 10553, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf91a, 10557, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf91b, 10561, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf91c, 10565, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf91d, 10569, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf91e, 10573, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf91f, 10577, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf920, 10581, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf921, 10585, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf922, 10589, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf923, 10593, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf924, 10597, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf925, 10601, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf926, 10605, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf927, 10609, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf928, 10613, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf929, 10617, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf92a, 10621, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf92b, 10625, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf92c, 10629, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf92d, 10633, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf92e, 10637, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf92f, 10641, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf930, 10645, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf931, 10649, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf932, 10653, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf933, 10657, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf934, 6399, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf935, 10661, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf936, 10665, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf937, 10669, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf938, 10673, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf939, 10677, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf93a, 10681, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf93b, 10685, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf93c, 10689, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf93d, 10693, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf93e, 10697, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf93f, 10701, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf940, 6691, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf941, 10705, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf942, 10709, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf943, 10713, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf944, 10717, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf945, 10721, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf946, 10725, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf947, 10729, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf948, 10733, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf949, 10737, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf94a, 10741, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf94b, 10745, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf94c, 10749, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf94d, 10753, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf94e, 10757, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf94f, 10761, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf950, 10765, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf951, 10769, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf952, 10773, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf953, 10777, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf954, 10781, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf955, 10785, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf956, 10789, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf957, 10793, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf958, 10797, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf959, 10801, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf95a, 10805, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf95b, 10809, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf95c, 10533, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf95d, 10813, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf95e, 10817, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf95f, 10821, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf960, 10825, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf961, 10829, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf962, 10833, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf963, 10837, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf964, 10841, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf965, 10845, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf966, 10849, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf967, 10853, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf968, 10857, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf969, 10861, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf96a, 10865, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf96b, 10869, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf96c, 10873, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf96d, 10877, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf96e, 10881, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf96f, 10885, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf970, 10889, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf971, 6543, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf972, 10893, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf973, 10897, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf974, 10901, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf975, 10905, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf976, 10909, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf977, 10913, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf978, 10917, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf979, 10921, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf97a, 10925, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf97b, 10929, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf97c, 10933, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf97d, 10937, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf97e, 10941, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf97f, 10945, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf980, 10949, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf981, 6051, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf982, 10953, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf983, 10957, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf984, 10961, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf985, 10965, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf986, 10969, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf987, 10973, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf988, 10977, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf989, 10981, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf98a, 5975, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf98b, 10985, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf98c, 10989, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf98d, 10993, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf98e, 10997, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf98f, 11001, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf990, 11005, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf991, 11009, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf992, 11013, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf993, 11017, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf994, 11021, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf995, 11025, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf996, 11029, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf997, 11033, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf998, 11037, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf999, 11041, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf99a, 11045, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf99b, 11049, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf99c, 11053, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf99d, 11057, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf99e, 11061, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf99f, 11065, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf9a0, 11069, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf9a1, 10885, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf9a2, 11073, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf9a3, 11077, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf9a4, 11081, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf9a5, 11085, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf9a6, 11089, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf9a7, 11093, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf9a8, 11097, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf9a9, 11101, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf9aa, 10821, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf9ab, 11105, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf9ac, 11109, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf9ad, 11113, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf9ae, 11117, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf9af, 11121, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf9b0, 11125, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf9b1, 11129, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf9b2, 11133, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf9b3, 11137, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf9b4, 11141, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf9b5, 11145, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf9b6, 11149, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf9b7, 11153, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf9b8, 11157, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf9b9, 11161, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf9ba, 11165, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf9bb, 11169, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf9bc, 11173, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf9bd, 11177, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf9be, 11181, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf9bf, 10533, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf9c0, 11185, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf9c1, 11189, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf9c2, 11193, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf9c3, 11197, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf9c4, 6747, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf9c5, 11201, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf9c6, 11205, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf9c7, 11209, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf9c8, 11213, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf9c9, 11217, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf9ca, 11221, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf9cb, 11225, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf9cc, 11229, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf9cd, 11233, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf9ce, 11237, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf9cf, 11241, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf9d0, 11245, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf9d1, 8199, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf9d2, 11249, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf9d3, 11253, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf9d4, 11257, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf9d5, 11261, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf9d6, 11265, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf9d7, 11269, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf9d8, 11273, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf9d9, 11277, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf9da, 11281, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf9db, 10829, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf9dc, 11285, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf9dd, 11289, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf9de, 11293, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf9df, 11297, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf9e0, 11301, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf9e1, 11305, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf9e2, 11309, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf9e3, 11313, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf9e4, 11317, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf9e5, 11321, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf9e6, 11325, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf9e7, 11329, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf9e8, 11333, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf9e9, 6563, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf9ea, 11337, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf9eb, 11341, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf9ec, 11345, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf9ed, 11349, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf9ee, 11353, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf9ef, 11357, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf9f0, 11361, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf9f1, 11365, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf9f2, 11369, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf9f3, 11373, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf9f4, 11377, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf9f5, 11381, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf9f6, 11385, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf9f7, 6367, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf9f8, 11389, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf9f9, 11393, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf9fa, 11397, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf9fb, 11401, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf9fc, 11405, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf9fd, 11409, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf9fe, 11413, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xf9ff, 11417, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xfa00, 11421, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xfa01, 11425, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xfa02, 11429, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xfa03, 11433, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xfa04, 11437, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xfa05, 11441, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xfa06, 11445, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xfa07, 11449, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xfa08, 6475, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xfa09, 11453, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xfa0a, 6487, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xfa0b, 11457, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xfa0c, 11461, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xfa0d, 11465, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xfa10, 11469, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xfa12, 11473, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xfa15, 11477, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xfa16, 11481, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xfa17, 11485, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xfa18, 11489, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xfa19, 11493, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xfa1a, 11497, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xfa1b, 11501, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xfa1c, 11505, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xfa1d, 11509, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xfa1e, 6395, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xfa20, 11513, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xfa22, 11517, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xfa25, 11521, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xfa26, 11525, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xfa2a, 11529, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xfa2b, 11533, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xfa2c, 11537, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xfa2d, 11541, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xfa30, 11545, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xfa31, 11549, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xfa32, 11553, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xfa33, 11557, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xfa34, 11561, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xfa35, 11565, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xfa36, 11569, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xfa37, 11573, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xfa38, 11577, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xfa39, 11581, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xfa3a, 11585, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xfa3b, 11589, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xfa3c, 6079, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xfa3d, 11593, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xfa3e, 11597, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xfa3f, 11601, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xfa40, 11605, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xfa41, 11609, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xfa42, 11613, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xfa43, 11617, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xfa44, 11621, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xfa45, 11625, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xfa46, 11629, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xfa47, 11633, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xfa48, 11637, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xfa49, 11641, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xfa4a, 11645, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xfa4b, 11649, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xfa4c, 8219, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xfa4d, 11653, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xfa4e, 11657, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xfa4f, 11661, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xfa50, 11665, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xfa51, 8235, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xfa52, 11669, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xfa53, 11673, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xfa54, 11677, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xfa55, 11681, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xfa56, 11685, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xfa57, 11029, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xfa58, 11689, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xfa59, 11693, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xfa5a, 11697, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xfa5b, 11701, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xfa5c, 11705, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xfa5d, 11709, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xfa5e, 11709, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xfa5f, 11713, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xfa60, 11717, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xfa61, 11721, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xfa62, 11725, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xfa63, 11729, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xfa64, 11733, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xfa65, 11737, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xfa66, 11741, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xfa67, 11521, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xfa68, 11745, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xfa69, 11749, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xfa6a, 11753, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xfb00, G_UNICODE_NOT_PRESENT_OFFSET, 11757 },
-  { 0xfb01, G_UNICODE_NOT_PRESENT_OFFSET, 11760 },
-  { 0xfb02, G_UNICODE_NOT_PRESENT_OFFSET, 11763 },
-  { 0xfb03, G_UNICODE_NOT_PRESENT_OFFSET, 11766 },
-  { 0xfb04, G_UNICODE_NOT_PRESENT_OFFSET, 11770 },
-  { 0xfb05, G_UNICODE_NOT_PRESENT_OFFSET, 11774 },
-  { 0xfb06, G_UNICODE_NOT_PRESENT_OFFSET, 11774 },
-  { 0xfb13, G_UNICODE_NOT_PRESENT_OFFSET, 11777 },
-  { 0xfb14, G_UNICODE_NOT_PRESENT_OFFSET, 11782 },
-  { 0xfb15, G_UNICODE_NOT_PRESENT_OFFSET, 11787 },
-  { 0xfb16, G_UNICODE_NOT_PRESENT_OFFSET, 11792 },
-  { 0xfb17, G_UNICODE_NOT_PRESENT_OFFSET, 11797 },
-  { 0xfb1d, 11802, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xfb1f, 11807, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xfb20, G_UNICODE_NOT_PRESENT_OFFSET, 11812 },
-  { 0xfb21, G_UNICODE_NOT_PRESENT_OFFSET, 5052 },
-  { 0xfb22, G_UNICODE_NOT_PRESENT_OFFSET, 5061 },
-  { 0xfb23, G_UNICODE_NOT_PRESENT_OFFSET, 11815 },
-  { 0xfb24, G_UNICODE_NOT_PRESENT_OFFSET, 11818 },
-  { 0xfb25, G_UNICODE_NOT_PRESENT_OFFSET, 11821 },
-  { 0xfb26, G_UNICODE_NOT_PRESENT_OFFSET, 11824 },
-  { 0xfb27, G_UNICODE_NOT_PRESENT_OFFSET, 11827 },
-  { 0xfb28, G_UNICODE_NOT_PRESENT_OFFSET, 11830 },
-  { 0xfb29, G_UNICODE_NOT_PRESENT_OFFSET, 4957 },
-  { 0xfb2a, 11833, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xfb2b, 11838, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xfb2c, 11843, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xfb2d, 11850, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xfb2e, 11857, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xfb2f, 11862, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xfb30, 11867, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xfb31, 11872, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xfb32, 11877, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xfb33, 11882, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xfb34, 11887, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xfb35, 11892, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xfb36, 11897, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xfb38, 11902, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xfb39, 11907, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xfb3a, 11912, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xfb3b, 11917, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xfb3c, 11922, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xfb3e, 11927, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xfb40, 11932, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xfb41, 11937, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xfb43, 11942, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xfb44, 11947, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xfb46, 11952, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xfb47, 11957, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xfb48, 11962, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xfb49, 11967, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xfb4a, 11972, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xfb4b, 11977, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xfb4c, 11982, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xfb4d, 11987, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xfb4e, 11992, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0xfb4f, G_UNICODE_NOT_PRESENT_OFFSET, 11997 },
-  { 0xfb50, G_UNICODE_NOT_PRESENT_OFFSET, 12002 },
-  { 0xfb51, G_UNICODE_NOT_PRESENT_OFFSET, 12002 },
-  { 0xfb52, G_UNICODE_NOT_PRESENT_OFFSET, 12005 },
-  { 0xfb53, G_UNICODE_NOT_PRESENT_OFFSET, 12005 },
-  { 0xfb54, G_UNICODE_NOT_PRESENT_OFFSET, 12005 },
-  { 0xfb55, G_UNICODE_NOT_PRESENT_OFFSET, 12005 },
-  { 0xfb56, G_UNICODE_NOT_PRESENT_OFFSET, 12008 },
-  { 0xfb57, G_UNICODE_NOT_PRESENT_OFFSET, 12008 },
-  { 0xfb58, G_UNICODE_NOT_PRESENT_OFFSET, 12008 },
-  { 0xfb59, G_UNICODE_NOT_PRESENT_OFFSET, 12008 },
-  { 0xfb5a, G_UNICODE_NOT_PRESENT_OFFSET, 12011 },
-  { 0xfb5b, G_UNICODE_NOT_PRESENT_OFFSET, 12011 },
-  { 0xfb5c, G_UNICODE_NOT_PRESENT_OFFSET, 12011 },
-  { 0xfb5d, G_UNICODE_NOT_PRESENT_OFFSET, 12011 },
-  { 0xfb5e, G_UNICODE_NOT_PRESENT_OFFSET, 12014 },
-  { 0xfb5f, G_UNICODE_NOT_PRESENT_OFFSET, 12014 },
-  { 0xfb60, G_UNICODE_NOT_PRESENT_OFFSET, 12014 },
-  { 0xfb61, G_UNICODE_NOT_PRESENT_OFFSET, 12014 },
-  { 0xfb62, G_UNICODE_NOT_PRESENT_OFFSET, 12017 },
-  { 0xfb63, G_UNICODE_NOT_PRESENT_OFFSET, 12017 },
-  { 0xfb64, G_UNICODE_NOT_PRESENT_OFFSET, 12017 },
-  { 0xfb65, G_UNICODE_NOT_PRESENT_OFFSET, 12017 },
-  { 0xfb66, G_UNICODE_NOT_PRESENT_OFFSET, 12020 },
-  { 0xfb67, G_UNICODE_NOT_PRESENT_OFFSET, 12020 },
-  { 0xfb68, G_UNICODE_NOT_PRESENT_OFFSET, 12020 },
-  { 0xfb69, G_UNICODE_NOT_PRESENT_OFFSET, 12020 },
-  { 0xfb6a, G_UNICODE_NOT_PRESENT_OFFSET, 12023 },
-  { 0xfb6b, G_UNICODE_NOT_PRESENT_OFFSET, 12023 },
-  { 0xfb6c, G_UNICODE_NOT_PRESENT_OFFSET, 12023 },
-  { 0xfb6d, G_UNICODE_NOT_PRESENT_OFFSET, 12023 },
-  { 0xfb6e, G_UNICODE_NOT_PRESENT_OFFSET, 12026 },
-  { 0xfb6f, G_UNICODE_NOT_PRESENT_OFFSET, 12026 },
-  { 0xfb70, G_UNICODE_NOT_PRESENT_OFFSET, 12026 },
-  { 0xfb71, G_UNICODE_NOT_PRESENT_OFFSET, 12026 },
-  { 0xfb72, G_UNICODE_NOT_PRESENT_OFFSET, 12029 },
-  { 0xfb73, G_UNICODE_NOT_PRESENT_OFFSET, 12029 },
-  { 0xfb74, G_UNICODE_NOT_PRESENT_OFFSET, 12029 },
-  { 0xfb75, G_UNICODE_NOT_PRESENT_OFFSET, 12029 },
-  { 0xfb76, G_UNICODE_NOT_PRESENT_OFFSET, 12032 },
-  { 0xfb77, G_UNICODE_NOT_PRESENT_OFFSET, 12032 },
-  { 0xfb78, G_UNICODE_NOT_PRESENT_OFFSET, 12032 },
-  { 0xfb79, G_UNICODE_NOT_PRESENT_OFFSET, 12032 },
-  { 0xfb7a, G_UNICODE_NOT_PRESENT_OFFSET, 12035 },
-  { 0xfb7b, G_UNICODE_NOT_PRESENT_OFFSET, 12035 },
-  { 0xfb7c, G_UNICODE_NOT_PRESENT_OFFSET, 12035 },
-  { 0xfb7d, G_UNICODE_NOT_PRESENT_OFFSET, 12035 },
-  { 0xfb7e, G_UNICODE_NOT_PRESENT_OFFSET, 12038 },
-  { 0xfb7f, G_UNICODE_NOT_PRESENT_OFFSET, 12038 },
-  { 0xfb80, G_UNICODE_NOT_PRESENT_OFFSET, 12038 },
-  { 0xfb81, G_UNICODE_NOT_PRESENT_OFFSET, 12038 },
-  { 0xfb82, G_UNICODE_NOT_PRESENT_OFFSET, 12041 },
-  { 0xfb83, G_UNICODE_NOT_PRESENT_OFFSET, 12041 },
-  { 0xfb84, G_UNICODE_NOT_PRESENT_OFFSET, 12044 },
-  { 0xfb85, G_UNICODE_NOT_PRESENT_OFFSET, 12044 },
-  { 0xfb86, G_UNICODE_NOT_PRESENT_OFFSET, 12047 },
-  { 0xfb87, G_UNICODE_NOT_PRESENT_OFFSET, 12047 },
-  { 0xfb88, G_UNICODE_NOT_PRESENT_OFFSET, 12050 },
-  { 0xfb89, G_UNICODE_NOT_PRESENT_OFFSET, 12050 },
-  { 0xfb8a, G_UNICODE_NOT_PRESENT_OFFSET, 12053 },
-  { 0xfb8b, G_UNICODE_NOT_PRESENT_OFFSET, 12053 },
-  { 0xfb8c, G_UNICODE_NOT_PRESENT_OFFSET, 12056 },
-  { 0xfb8d, G_UNICODE_NOT_PRESENT_OFFSET, 12056 },
-  { 0xfb8e, G_UNICODE_NOT_PRESENT_OFFSET, 12059 },
-  { 0xfb8f, G_UNICODE_NOT_PRESENT_OFFSET, 12059 },
-  { 0xfb90, G_UNICODE_NOT_PRESENT_OFFSET, 12059 },
-  { 0xfb91, G_UNICODE_NOT_PRESENT_OFFSET, 12059 },
-  { 0xfb92, G_UNICODE_NOT_PRESENT_OFFSET, 12062 },
-  { 0xfb93, G_UNICODE_NOT_PRESENT_OFFSET, 12062 },
-  { 0xfb94, G_UNICODE_NOT_PRESENT_OFFSET, 12062 },
-  { 0xfb95, G_UNICODE_NOT_PRESENT_OFFSET, 12062 },
-  { 0xfb96, G_UNICODE_NOT_PRESENT_OFFSET, 12065 },
-  { 0xfb97, G_UNICODE_NOT_PRESENT_OFFSET, 12065 },
-  { 0xfb98, G_UNICODE_NOT_PRESENT_OFFSET, 12065 },
-  { 0xfb99, G_UNICODE_NOT_PRESENT_OFFSET, 12065 },
-  { 0xfb9a, G_UNICODE_NOT_PRESENT_OFFSET, 12068 },
-  { 0xfb9b, G_UNICODE_NOT_PRESENT_OFFSET, 12068 },
-  { 0xfb9c, G_UNICODE_NOT_PRESENT_OFFSET, 12068 },
-  { 0xfb9d, G_UNICODE_NOT_PRESENT_OFFSET, 12068 },
-  { 0xfb9e, G_UNICODE_NOT_PRESENT_OFFSET, 12071 },
-  { 0xfb9f, G_UNICODE_NOT_PRESENT_OFFSET, 12071 },
-  { 0xfba0, G_UNICODE_NOT_PRESENT_OFFSET, 12074 },
-  { 0xfba1, G_UNICODE_NOT_PRESENT_OFFSET, 12074 },
-  { 0xfba2, G_UNICODE_NOT_PRESENT_OFFSET, 12074 },
-  { 0xfba3, G_UNICODE_NOT_PRESENT_OFFSET, 12074 },
-  { 0xfba4, G_UNICODE_NOT_PRESENT_OFFSET, 1718 },
-  { 0xfba5, G_UNICODE_NOT_PRESENT_OFFSET, 1718 },
-  { 0xfba6, G_UNICODE_NOT_PRESENT_OFFSET, 12077 },
-  { 0xfba7, G_UNICODE_NOT_PRESENT_OFFSET, 12077 },
-  { 0xfba8, G_UNICODE_NOT_PRESENT_OFFSET, 12077 },
-  { 0xfba9, G_UNICODE_NOT_PRESENT_OFFSET, 12077 },
-  { 0xfbaa, G_UNICODE_NOT_PRESENT_OFFSET, 12080 },
-  { 0xfbab, G_UNICODE_NOT_PRESENT_OFFSET, 12080 },
-  { 0xfbac, G_UNICODE_NOT_PRESENT_OFFSET, 12080 },
-  { 0xfbad, G_UNICODE_NOT_PRESENT_OFFSET, 12080 },
-  { 0xfbae, G_UNICODE_NOT_PRESENT_OFFSET, 12083 },
-  { 0xfbaf, G_UNICODE_NOT_PRESENT_OFFSET, 12083 },
-  { 0xfbb0, G_UNICODE_NOT_PRESENT_OFFSET, 1728 },
-  { 0xfbb1, G_UNICODE_NOT_PRESENT_OFFSET, 1728 },
-  { 0xfbd3, G_UNICODE_NOT_PRESENT_OFFSET, 12086 },
-  { 0xfbd4, G_UNICODE_NOT_PRESENT_OFFSET, 12086 },
-  { 0xfbd5, G_UNICODE_NOT_PRESENT_OFFSET, 12086 },
-  { 0xfbd6, G_UNICODE_NOT_PRESENT_OFFSET, 12086 },
-  { 0xfbd7, G_UNICODE_NOT_PRESENT_OFFSET, 12089 },
-  { 0xfbd8, G_UNICODE_NOT_PRESENT_OFFSET, 12089 },
-  { 0xfbd9, G_UNICODE_NOT_PRESENT_OFFSET, 12092 },
-  { 0xfbda, G_UNICODE_NOT_PRESENT_OFFSET, 12092 },
-  { 0xfbdb, G_UNICODE_NOT_PRESENT_OFFSET, 12095 },
-  { 0xfbdc, G_UNICODE_NOT_PRESENT_OFFSET, 12095 },
-  { 0xfbdd, G_UNICODE_NOT_PRESENT_OFFSET, 1708 },
-  { 0xfbde, G_UNICODE_NOT_PRESENT_OFFSET, 12098 },
-  { 0xfbdf, G_UNICODE_NOT_PRESENT_OFFSET, 12098 },
-  { 0xfbe0, G_UNICODE_NOT_PRESENT_OFFSET, 12101 },
-  { 0xfbe1, G_UNICODE_NOT_PRESENT_OFFSET, 12101 },
-  { 0xfbe2, G_UNICODE_NOT_PRESENT_OFFSET, 12104 },
-  { 0xfbe3, G_UNICODE_NOT_PRESENT_OFFSET, 12104 },
-  { 0xfbe4, G_UNICODE_NOT_PRESENT_OFFSET, 12107 },
-  { 0xfbe5, G_UNICODE_NOT_PRESENT_OFFSET, 12107 },
-  { 0xfbe6, G_UNICODE_NOT_PRESENT_OFFSET, 12107 },
-  { 0xfbe7, G_UNICODE_NOT_PRESENT_OFFSET, 12107 },
-  { 0xfbe8, G_UNICODE_NOT_PRESENT_OFFSET, 12110 },
-  { 0xfbe9, G_UNICODE_NOT_PRESENT_OFFSET, 12110 },
-  { 0xfbea, G_UNICODE_NOT_PRESENT_OFFSET, 12113 },
-  { 0xfbeb, G_UNICODE_NOT_PRESENT_OFFSET, 12113 },
-  { 0xfbec, G_UNICODE_NOT_PRESENT_OFFSET, 12120 },
-  { 0xfbed, G_UNICODE_NOT_PRESENT_OFFSET, 12120 },
-  { 0xfbee, G_UNICODE_NOT_PRESENT_OFFSET, 12127 },
-  { 0xfbef, G_UNICODE_NOT_PRESENT_OFFSET, 12127 },
-  { 0xfbf0, G_UNICODE_NOT_PRESENT_OFFSET, 12134 },
-  { 0xfbf1, G_UNICODE_NOT_PRESENT_OFFSET, 12134 },
-  { 0xfbf2, G_UNICODE_NOT_PRESENT_OFFSET, 12141 },
-  { 0xfbf3, G_UNICODE_NOT_PRESENT_OFFSET, 12141 },
-  { 0xfbf4, G_UNICODE_NOT_PRESENT_OFFSET, 12148 },
-  { 0xfbf5, G_UNICODE_NOT_PRESENT_OFFSET, 12148 },
-  { 0xfbf6, G_UNICODE_NOT_PRESENT_OFFSET, 12155 },
-  { 0xfbf7, G_UNICODE_NOT_PRESENT_OFFSET, 12155 },
-  { 0xfbf8, G_UNICODE_NOT_PRESENT_OFFSET, 12155 },
-  { 0xfbf9, G_UNICODE_NOT_PRESENT_OFFSET, 12162 },
-  { 0xfbfa, G_UNICODE_NOT_PRESENT_OFFSET, 12162 },
-  { 0xfbfb, G_UNICODE_NOT_PRESENT_OFFSET, 12162 },
-  { 0xfbfc, G_UNICODE_NOT_PRESENT_OFFSET, 12169 },
-  { 0xfbfd, G_UNICODE_NOT_PRESENT_OFFSET, 12169 },
-  { 0xfbfe, G_UNICODE_NOT_PRESENT_OFFSET, 12169 },
-  { 0xfbff, G_UNICODE_NOT_PRESENT_OFFSET, 12169 },
-  { 0xfc00, G_UNICODE_NOT_PRESENT_OFFSET, 12172 },
-  { 0xfc01, G_UNICODE_NOT_PRESENT_OFFSET, 12179 },
-  { 0xfc02, G_UNICODE_NOT_PRESENT_OFFSET, 12186 },
-  { 0xfc03, G_UNICODE_NOT_PRESENT_OFFSET, 12162 },
-  { 0xfc04, G_UNICODE_NOT_PRESENT_OFFSET, 12193 },
-  { 0xfc05, G_UNICODE_NOT_PRESENT_OFFSET, 12200 },
-  { 0xfc06, G_UNICODE_NOT_PRESENT_OFFSET, 12205 },
-  { 0xfc07, G_UNICODE_NOT_PRESENT_OFFSET, 12210 },
-  { 0xfc08, G_UNICODE_NOT_PRESENT_OFFSET, 12215 },
-  { 0xfc09, G_UNICODE_NOT_PRESENT_OFFSET, 12220 },
-  { 0xfc0a, G_UNICODE_NOT_PRESENT_OFFSET, 12225 },
-  { 0xfc0b, G_UNICODE_NOT_PRESENT_OFFSET, 12230 },
-  { 0xfc0c, G_UNICODE_NOT_PRESENT_OFFSET, 12235 },
-  { 0xfc0d, G_UNICODE_NOT_PRESENT_OFFSET, 12240 },
-  { 0xfc0e, G_UNICODE_NOT_PRESENT_OFFSET, 12245 },
-  { 0xfc0f, G_UNICODE_NOT_PRESENT_OFFSET, 12250 },
-  { 0xfc10, G_UNICODE_NOT_PRESENT_OFFSET, 12255 },
-  { 0xfc11, G_UNICODE_NOT_PRESENT_OFFSET, 12260 },
-  { 0xfc12, G_UNICODE_NOT_PRESENT_OFFSET, 12265 },
-  { 0xfc13, G_UNICODE_NOT_PRESENT_OFFSET, 12270 },
-  { 0xfc14, G_UNICODE_NOT_PRESENT_OFFSET, 12275 },
-  { 0xfc15, G_UNICODE_NOT_PRESENT_OFFSET, 12280 },
-  { 0xfc16, G_UNICODE_NOT_PRESENT_OFFSET, 12285 },
-  { 0xfc17, G_UNICODE_NOT_PRESENT_OFFSET, 12290 },
-  { 0xfc18, G_UNICODE_NOT_PRESENT_OFFSET, 12295 },
-  { 0xfc19, G_UNICODE_NOT_PRESENT_OFFSET, 12300 },
-  { 0xfc1a, G_UNICODE_NOT_PRESENT_OFFSET, 12305 },
-  { 0xfc1b, G_UNICODE_NOT_PRESENT_OFFSET, 12310 },
-  { 0xfc1c, G_UNICODE_NOT_PRESENT_OFFSET, 12315 },
-  { 0xfc1d, G_UNICODE_NOT_PRESENT_OFFSET, 12320 },
-  { 0xfc1e, G_UNICODE_NOT_PRESENT_OFFSET, 12325 },
-  { 0xfc1f, G_UNICODE_NOT_PRESENT_OFFSET, 12330 },
-  { 0xfc20, G_UNICODE_NOT_PRESENT_OFFSET, 12335 },
-  { 0xfc21, G_UNICODE_NOT_PRESENT_OFFSET, 12340 },
-  { 0xfc22, G_UNICODE_NOT_PRESENT_OFFSET, 12345 },
-  { 0xfc23, G_UNICODE_NOT_PRESENT_OFFSET, 12350 },
-  { 0xfc24, G_UNICODE_NOT_PRESENT_OFFSET, 12355 },
-  { 0xfc25, G_UNICODE_NOT_PRESENT_OFFSET, 12360 },
-  { 0xfc26, G_UNICODE_NOT_PRESENT_OFFSET, 12365 },
-  { 0xfc27, G_UNICODE_NOT_PRESENT_OFFSET, 12370 },
-  { 0xfc28, G_UNICODE_NOT_PRESENT_OFFSET, 12375 },
-  { 0xfc29, G_UNICODE_NOT_PRESENT_OFFSET, 12380 },
-  { 0xfc2a, G_UNICODE_NOT_PRESENT_OFFSET, 12385 },
-  { 0xfc2b, G_UNICODE_NOT_PRESENT_OFFSET, 12390 },
-  { 0xfc2c, G_UNICODE_NOT_PRESENT_OFFSET, 12395 },
-  { 0xfc2d, G_UNICODE_NOT_PRESENT_OFFSET, 12400 },
-  { 0xfc2e, G_UNICODE_NOT_PRESENT_OFFSET, 12405 },
-  { 0xfc2f, G_UNICODE_NOT_PRESENT_OFFSET, 12410 },
-  { 0xfc30, G_UNICODE_NOT_PRESENT_OFFSET, 12415 },
-  { 0xfc31, G_UNICODE_NOT_PRESENT_OFFSET, 12420 },
-  { 0xfc32, G_UNICODE_NOT_PRESENT_OFFSET, 12425 },
-  { 0xfc33, G_UNICODE_NOT_PRESENT_OFFSET, 12430 },
-  { 0xfc34, G_UNICODE_NOT_PRESENT_OFFSET, 12435 },
-  { 0xfc35, G_UNICODE_NOT_PRESENT_OFFSET, 12440 },
-  { 0xfc36, G_UNICODE_NOT_PRESENT_OFFSET, 12445 },
-  { 0xfc37, G_UNICODE_NOT_PRESENT_OFFSET, 12450 },
-  { 0xfc38, G_UNICODE_NOT_PRESENT_OFFSET, 12455 },
-  { 0xfc39, G_UNICODE_NOT_PRESENT_OFFSET, 12460 },
-  { 0xfc3a, G_UNICODE_NOT_PRESENT_OFFSET, 12465 },
-  { 0xfc3b, G_UNICODE_NOT_PRESENT_OFFSET, 12470 },
-  { 0xfc3c, G_UNICODE_NOT_PRESENT_OFFSET, 12475 },
-  { 0xfc3d, G_UNICODE_NOT_PRESENT_OFFSET, 12480 },
-  { 0xfc3e, G_UNICODE_NOT_PRESENT_OFFSET, 12485 },
-  { 0xfc3f, G_UNICODE_NOT_PRESENT_OFFSET, 12490 },
-  { 0xfc40, G_UNICODE_NOT_PRESENT_OFFSET, 12495 },
-  { 0xfc41, G_UNICODE_NOT_PRESENT_OFFSET, 12500 },
-  { 0xfc42, G_UNICODE_NOT_PRESENT_OFFSET, 12505 },
-  { 0xfc43, G_UNICODE_NOT_PRESENT_OFFSET, 12510 },
-  { 0xfc44, G_UNICODE_NOT_PRESENT_OFFSET, 12515 },
-  { 0xfc45, G_UNICODE_NOT_PRESENT_OFFSET, 12520 },
-  { 0xfc46, G_UNICODE_NOT_PRESENT_OFFSET, 12525 },
-  { 0xfc47, G_UNICODE_NOT_PRESENT_OFFSET, 12530 },
-  { 0xfc48, G_UNICODE_NOT_PRESENT_OFFSET, 12535 },
-  { 0xfc49, G_UNICODE_NOT_PRESENT_OFFSET, 12540 },
-  { 0xfc4a, G_UNICODE_NOT_PRESENT_OFFSET, 12545 },
-  { 0xfc4b, G_UNICODE_NOT_PRESENT_OFFSET, 12550 },
-  { 0xfc4c, G_UNICODE_NOT_PRESENT_OFFSET, 12555 },
-  { 0xfc4d, G_UNICODE_NOT_PRESENT_OFFSET, 12560 },
-  { 0xfc4e, G_UNICODE_NOT_PRESENT_OFFSET, 12565 },
-  { 0xfc4f, G_UNICODE_NOT_PRESENT_OFFSET, 12570 },
-  { 0xfc50, G_UNICODE_NOT_PRESENT_OFFSET, 12575 },
-  { 0xfc51, G_UNICODE_NOT_PRESENT_OFFSET, 12580 },
-  { 0xfc52, G_UNICODE_NOT_PRESENT_OFFSET, 12585 },
-  { 0xfc53, G_UNICODE_NOT_PRESENT_OFFSET, 12590 },
-  { 0xfc54, G_UNICODE_NOT_PRESENT_OFFSET, 12595 },
-  { 0xfc55, G_UNICODE_NOT_PRESENT_OFFSET, 12600 },
-  { 0xfc56, G_UNICODE_NOT_PRESENT_OFFSET, 12605 },
-  { 0xfc57, G_UNICODE_NOT_PRESENT_OFFSET, 12610 },
-  { 0xfc58, G_UNICODE_NOT_PRESENT_OFFSET, 12615 },
-  { 0xfc59, G_UNICODE_NOT_PRESENT_OFFSET, 12620 },
-  { 0xfc5a, G_UNICODE_NOT_PRESENT_OFFSET, 12625 },
-  { 0xfc5b, G_UNICODE_NOT_PRESENT_OFFSET, 12630 },
-  { 0xfc5c, G_UNICODE_NOT_PRESENT_OFFSET, 12635 },
-  { 0xfc5d, G_UNICODE_NOT_PRESENT_OFFSET, 12640 },
-  { 0xfc5e, G_UNICODE_NOT_PRESENT_OFFSET, 12645 },
-  { 0xfc5f, G_UNICODE_NOT_PRESENT_OFFSET, 12651 },
-  { 0xfc60, G_UNICODE_NOT_PRESENT_OFFSET, 12657 },
-  { 0xfc61, G_UNICODE_NOT_PRESENT_OFFSET, 12663 },
-  { 0xfc62, G_UNICODE_NOT_PRESENT_OFFSET, 12669 },
-  { 0xfc63, G_UNICODE_NOT_PRESENT_OFFSET, 12675 },
-  { 0xfc64, G_UNICODE_NOT_PRESENT_OFFSET, 12681 },
-  { 0xfc65, G_UNICODE_NOT_PRESENT_OFFSET, 12688 },
-  { 0xfc66, G_UNICODE_NOT_PRESENT_OFFSET, 12186 },
-  { 0xfc67, G_UNICODE_NOT_PRESENT_OFFSET, 12695 },
-  { 0xfc68, G_UNICODE_NOT_PRESENT_OFFSET, 12162 },
-  { 0xfc69, G_UNICODE_NOT_PRESENT_OFFSET, 12193 },
-  { 0xfc6a, G_UNICODE_NOT_PRESENT_OFFSET, 12702 },
-  { 0xfc6b, G_UNICODE_NOT_PRESENT_OFFSET, 12707 },
-  { 0xfc6c, G_UNICODE_NOT_PRESENT_OFFSET, 12215 },
-  { 0xfc6d, G_UNICODE_NOT_PRESENT_OFFSET, 12712 },
-  { 0xfc6e, G_UNICODE_NOT_PRESENT_OFFSET, 12220 },
-  { 0xfc6f, G_UNICODE_NOT_PRESENT_OFFSET, 12225 },
-  { 0xfc70, G_UNICODE_NOT_PRESENT_OFFSET, 12717 },
-  { 0xfc71, G_UNICODE_NOT_PRESENT_OFFSET, 12722 },
-  { 0xfc72, G_UNICODE_NOT_PRESENT_OFFSET, 12245 },
-  { 0xfc73, G_UNICODE_NOT_PRESENT_OFFSET, 12727 },
-  { 0xfc74, G_UNICODE_NOT_PRESENT_OFFSET, 12250 },
-  { 0xfc75, G_UNICODE_NOT_PRESENT_OFFSET, 12255 },
-  { 0xfc76, G_UNICODE_NOT_PRESENT_OFFSET, 12732 },
-  { 0xfc77, G_UNICODE_NOT_PRESENT_OFFSET, 12737 },
-  { 0xfc78, G_UNICODE_NOT_PRESENT_OFFSET, 12265 },
-  { 0xfc79, G_UNICODE_NOT_PRESENT_OFFSET, 12742 },
-  { 0xfc7a, G_UNICODE_NOT_PRESENT_OFFSET, 12270 },
-  { 0xfc7b, G_UNICODE_NOT_PRESENT_OFFSET, 12275 },
-  { 0xfc7c, G_UNICODE_NOT_PRESENT_OFFSET, 12420 },
-  { 0xfc7d, G_UNICODE_NOT_PRESENT_OFFSET, 12425 },
-  { 0xfc7e, G_UNICODE_NOT_PRESENT_OFFSET, 12440 },
-  { 0xfc7f, G_UNICODE_NOT_PRESENT_OFFSET, 12445 },
-  { 0xfc80, G_UNICODE_NOT_PRESENT_OFFSET, 12450 },
-  { 0xfc81, G_UNICODE_NOT_PRESENT_OFFSET, 12470 },
-  { 0xfc82, G_UNICODE_NOT_PRESENT_OFFSET, 12475 },
-  { 0xfc83, G_UNICODE_NOT_PRESENT_OFFSET, 12480 },
-  { 0xfc84, G_UNICODE_NOT_PRESENT_OFFSET, 12485 },
-  { 0xfc85, G_UNICODE_NOT_PRESENT_OFFSET, 12505 },
-  { 0xfc86, G_UNICODE_NOT_PRESENT_OFFSET, 12510 },
-  { 0xfc87, G_UNICODE_NOT_PRESENT_OFFSET, 12515 },
-  { 0xfc88, G_UNICODE_NOT_PRESENT_OFFSET, 12747 },
-  { 0xfc89, G_UNICODE_NOT_PRESENT_OFFSET, 12535 },
-  { 0xfc8a, G_UNICODE_NOT_PRESENT_OFFSET, 12752 },
-  { 0xfc8b, G_UNICODE_NOT_PRESENT_OFFSET, 12757 },
-  { 0xfc8c, G_UNICODE_NOT_PRESENT_OFFSET, 12565 },
-  { 0xfc8d, G_UNICODE_NOT_PRESENT_OFFSET, 12762 },
-  { 0xfc8e, G_UNICODE_NOT_PRESENT_OFFSET, 12570 },
-  { 0xfc8f, G_UNICODE_NOT_PRESENT_OFFSET, 12575 },
-  { 0xfc90, G_UNICODE_NOT_PRESENT_OFFSET, 12640 },
-  { 0xfc91, G_UNICODE_NOT_PRESENT_OFFSET, 12767 },
-  { 0xfc92, G_UNICODE_NOT_PRESENT_OFFSET, 12772 },
-  { 0xfc93, G_UNICODE_NOT_PRESENT_OFFSET, 12615 },
-  { 0xfc94, G_UNICODE_NOT_PRESENT_OFFSET, 12777 },
-  { 0xfc95, G_UNICODE_NOT_PRESENT_OFFSET, 12620 },
-  { 0xfc96, G_UNICODE_NOT_PRESENT_OFFSET, 12625 },
-  { 0xfc97, G_UNICODE_NOT_PRESENT_OFFSET, 12172 },
-  { 0xfc98, G_UNICODE_NOT_PRESENT_OFFSET, 12179 },
-  { 0xfc99, G_UNICODE_NOT_PRESENT_OFFSET, 12782 },
-  { 0xfc9a, G_UNICODE_NOT_PRESENT_OFFSET, 12186 },
-  { 0xfc9b, G_UNICODE_NOT_PRESENT_OFFSET, 12789 },
-  { 0xfc9c, G_UNICODE_NOT_PRESENT_OFFSET, 12200 },
-  { 0xfc9d, G_UNICODE_NOT_PRESENT_OFFSET, 12205 },
-  { 0xfc9e, G_UNICODE_NOT_PRESENT_OFFSET, 12210 },
-  { 0xfc9f, G_UNICODE_NOT_PRESENT_OFFSET, 12215 },
-  { 0xfca0, G_UNICODE_NOT_PRESENT_OFFSET, 12796 },
-  { 0xfca1, G_UNICODE_NOT_PRESENT_OFFSET, 12230 },
-  { 0xfca2, G_UNICODE_NOT_PRESENT_OFFSET, 12235 },
-  { 0xfca3, G_UNICODE_NOT_PRESENT_OFFSET, 12240 },
-  { 0xfca4, G_UNICODE_NOT_PRESENT_OFFSET, 12245 },
-  { 0xfca5, G_UNICODE_NOT_PRESENT_OFFSET, 12801 },
-  { 0xfca6, G_UNICODE_NOT_PRESENT_OFFSET, 12265 },
-  { 0xfca7, G_UNICODE_NOT_PRESENT_OFFSET, 12280 },
-  { 0xfca8, G_UNICODE_NOT_PRESENT_OFFSET, 12285 },
-  { 0xfca9, G_UNICODE_NOT_PRESENT_OFFSET, 12290 },
-  { 0xfcaa, G_UNICODE_NOT_PRESENT_OFFSET, 12295 },
-  { 0xfcab, G_UNICODE_NOT_PRESENT_OFFSET, 12300 },
-  { 0xfcac, G_UNICODE_NOT_PRESENT_OFFSET, 12310 },
-  { 0xfcad, G_UNICODE_NOT_PRESENT_OFFSET, 12315 },
-  { 0xfcae, G_UNICODE_NOT_PRESENT_OFFSET, 12320 },
-  { 0xfcaf, G_UNICODE_NOT_PRESENT_OFFSET, 12325 },
-  { 0xfcb0, G_UNICODE_NOT_PRESENT_OFFSET, 12330 },
-  { 0xfcb1, G_UNICODE_NOT_PRESENT_OFFSET, 12335 },
-  { 0xfcb2, G_UNICODE_NOT_PRESENT_OFFSET, 12806 },
-  { 0xfcb3, G_UNICODE_NOT_PRESENT_OFFSET, 12340 },
-  { 0xfcb4, G_UNICODE_NOT_PRESENT_OFFSET, 12345 },
-  { 0xfcb5, G_UNICODE_NOT_PRESENT_OFFSET, 12350 },
-  { 0xfcb6, G_UNICODE_NOT_PRESENT_OFFSET, 12355 },
-  { 0xfcb7, G_UNICODE_NOT_PRESENT_OFFSET, 12360 },
-  { 0xfcb8, G_UNICODE_NOT_PRESENT_OFFSET, 12365 },
-  { 0xfcb9, G_UNICODE_NOT_PRESENT_OFFSET, 12375 },
-  { 0xfcba, G_UNICODE_NOT_PRESENT_OFFSET, 12380 },
-  { 0xfcbb, G_UNICODE_NOT_PRESENT_OFFSET, 12385 },
-  { 0xfcbc, G_UNICODE_NOT_PRESENT_OFFSET, 12390 },
-  { 0xfcbd, G_UNICODE_NOT_PRESENT_OFFSET, 12395 },
-  { 0xfcbe, G_UNICODE_NOT_PRESENT_OFFSET, 12400 },
-  { 0xfcbf, G_UNICODE_NOT_PRESENT_OFFSET, 12405 },
-  { 0xfcc0, G_UNICODE_NOT_PRESENT_OFFSET, 12410 },
-  { 0xfcc1, G_UNICODE_NOT_PRESENT_OFFSET, 12415 },
-  { 0xfcc2, G_UNICODE_NOT_PRESENT_OFFSET, 12430 },
-  { 0xfcc3, G_UNICODE_NOT_PRESENT_OFFSET, 12435 },
-  { 0xfcc4, G_UNICODE_NOT_PRESENT_OFFSET, 12455 },
-  { 0xfcc5, G_UNICODE_NOT_PRESENT_OFFSET, 12460 },
-  { 0xfcc6, G_UNICODE_NOT_PRESENT_OFFSET, 12465 },
-  { 0xfcc7, G_UNICODE_NOT_PRESENT_OFFSET, 12470 },
-  { 0xfcc8, G_UNICODE_NOT_PRESENT_OFFSET, 12475 },
-  { 0xfcc9, G_UNICODE_NOT_PRESENT_OFFSET, 12490 },
-  { 0xfcca, G_UNICODE_NOT_PRESENT_OFFSET, 12495 },
-  { 0xfccb, G_UNICODE_NOT_PRESENT_OFFSET, 12500 },
-  { 0xfccc, G_UNICODE_NOT_PRESENT_OFFSET, 12505 },
-  { 0xfccd, G_UNICODE_NOT_PRESENT_OFFSET, 12811 },
-  { 0xfcce, G_UNICODE_NOT_PRESENT_OFFSET, 12520 },
-  { 0xfccf, G_UNICODE_NOT_PRESENT_OFFSET, 12525 },
-  { 0xfcd0, G_UNICODE_NOT_PRESENT_OFFSET, 12530 },
-  { 0xfcd1, G_UNICODE_NOT_PRESENT_OFFSET, 12535 },
-  { 0xfcd2, G_UNICODE_NOT_PRESENT_OFFSET, 12550 },
-  { 0xfcd3, G_UNICODE_NOT_PRESENT_OFFSET, 12555 },
-  { 0xfcd4, G_UNICODE_NOT_PRESENT_OFFSET, 12560 },
-  { 0xfcd5, G_UNICODE_NOT_PRESENT_OFFSET, 12565 },
-  { 0xfcd6, G_UNICODE_NOT_PRESENT_OFFSET, 12816 },
-  { 0xfcd7, G_UNICODE_NOT_PRESENT_OFFSET, 12580 },
-  { 0xfcd8, G_UNICODE_NOT_PRESENT_OFFSET, 12585 },
-  { 0xfcd9, G_UNICODE_NOT_PRESENT_OFFSET, 12821 },
-  { 0xfcda, G_UNICODE_NOT_PRESENT_OFFSET, 12600 },
-  { 0xfcdb, G_UNICODE_NOT_PRESENT_OFFSET, 12605 },
-  { 0xfcdc, G_UNICODE_NOT_PRESENT_OFFSET, 12610 },
-  { 0xfcdd, G_UNICODE_NOT_PRESENT_OFFSET, 12615 },
-  { 0xfcde, G_UNICODE_NOT_PRESENT_OFFSET, 12826 },
-  { 0xfcdf, G_UNICODE_NOT_PRESENT_OFFSET, 12186 },
-  { 0xfce0, G_UNICODE_NOT_PRESENT_OFFSET, 12789 },
-  { 0xfce1, G_UNICODE_NOT_PRESENT_OFFSET, 12215 },
-  { 0xfce2, G_UNICODE_NOT_PRESENT_OFFSET, 12796 },
-  { 0xfce3, G_UNICODE_NOT_PRESENT_OFFSET, 12245 },
-  { 0xfce4, G_UNICODE_NOT_PRESENT_OFFSET, 12801 },
-  { 0xfce5, G_UNICODE_NOT_PRESENT_OFFSET, 12265 },
-  { 0xfce6, G_UNICODE_NOT_PRESENT_OFFSET, 12831 },
-  { 0xfce7, G_UNICODE_NOT_PRESENT_OFFSET, 12330 },
-  { 0xfce8, G_UNICODE_NOT_PRESENT_OFFSET, 12836 },
-  { 0xfce9, G_UNICODE_NOT_PRESENT_OFFSET, 12841 },
-  { 0xfcea, G_UNICODE_NOT_PRESENT_OFFSET, 12846 },
-  { 0xfceb, G_UNICODE_NOT_PRESENT_OFFSET, 12470 },
-  { 0xfcec, G_UNICODE_NOT_PRESENT_OFFSET, 12475 },
-  { 0xfced, G_UNICODE_NOT_PRESENT_OFFSET, 12505 },
-  { 0xfcee, G_UNICODE_NOT_PRESENT_OFFSET, 12565 },
-  { 0xfcef, G_UNICODE_NOT_PRESENT_OFFSET, 12816 },
-  { 0xfcf0, G_UNICODE_NOT_PRESENT_OFFSET, 12615 },
-  { 0xfcf1, G_UNICODE_NOT_PRESENT_OFFSET, 12826 },
-  { 0xfcf2, G_UNICODE_NOT_PRESENT_OFFSET, 12851 },
-  { 0xfcf3, G_UNICODE_NOT_PRESENT_OFFSET, 12858 },
-  { 0xfcf4, G_UNICODE_NOT_PRESENT_OFFSET, 12865 },
-  { 0xfcf5, G_UNICODE_NOT_PRESENT_OFFSET, 12872 },
-  { 0xfcf6, G_UNICODE_NOT_PRESENT_OFFSET, 12877 },
-  { 0xfcf7, G_UNICODE_NOT_PRESENT_OFFSET, 12882 },
-  { 0xfcf8, G_UNICODE_NOT_PRESENT_OFFSET, 12887 },
-  { 0xfcf9, G_UNICODE_NOT_PRESENT_OFFSET, 12892 },
-  { 0xfcfa, G_UNICODE_NOT_PRESENT_OFFSET, 12897 },
-  { 0xfcfb, G_UNICODE_NOT_PRESENT_OFFSET, 12902 },
-  { 0xfcfc, G_UNICODE_NOT_PRESENT_OFFSET, 12907 },
-  { 0xfcfd, G_UNICODE_NOT_PRESENT_OFFSET, 12912 },
-  { 0xfcfe, G_UNICODE_NOT_PRESENT_OFFSET, 12917 },
-  { 0xfcff, G_UNICODE_NOT_PRESENT_OFFSET, 12922 },
-  { 0xfd00, G_UNICODE_NOT_PRESENT_OFFSET, 12927 },
-  { 0xfd01, G_UNICODE_NOT_PRESENT_OFFSET, 12932 },
-  { 0xfd02, G_UNICODE_NOT_PRESENT_OFFSET, 12937 },
-  { 0xfd03, G_UNICODE_NOT_PRESENT_OFFSET, 12942 },
-  { 0xfd04, G_UNICODE_NOT_PRESENT_OFFSET, 12947 },
-  { 0xfd05, G_UNICODE_NOT_PRESENT_OFFSET, 12952 },
-  { 0xfd06, G_UNICODE_NOT_PRESENT_OFFSET, 12957 },
-  { 0xfd07, G_UNICODE_NOT_PRESENT_OFFSET, 12962 },
-  { 0xfd08, G_UNICODE_NOT_PRESENT_OFFSET, 12967 },
-  { 0xfd09, G_UNICODE_NOT_PRESENT_OFFSET, 12972 },
-  { 0xfd0a, G_UNICODE_NOT_PRESENT_OFFSET, 12977 },
-  { 0xfd0b, G_UNICODE_NOT_PRESENT_OFFSET, 12982 },
-  { 0xfd0c, G_UNICODE_NOT_PRESENT_OFFSET, 12841 },
-  { 0xfd0d, G_UNICODE_NOT_PRESENT_OFFSET, 12987 },
-  { 0xfd0e, G_UNICODE_NOT_PRESENT_OFFSET, 12992 },
-  { 0xfd0f, G_UNICODE_NOT_PRESENT_OFFSET, 12997 },
-  { 0xfd10, G_UNICODE_NOT_PRESENT_OFFSET, 13002 },
-  { 0xfd11, G_UNICODE_NOT_PRESENT_OFFSET, 12872 },
-  { 0xfd12, G_UNICODE_NOT_PRESENT_OFFSET, 12877 },
-  { 0xfd13, G_UNICODE_NOT_PRESENT_OFFSET, 12882 },
-  { 0xfd14, G_UNICODE_NOT_PRESENT_OFFSET, 12887 },
-  { 0xfd15, G_UNICODE_NOT_PRESENT_OFFSET, 12892 },
-  { 0xfd16, G_UNICODE_NOT_PRESENT_OFFSET, 12897 },
-  { 0xfd17, G_UNICODE_NOT_PRESENT_OFFSET, 12902 },
-  { 0xfd18, G_UNICODE_NOT_PRESENT_OFFSET, 12907 },
-  { 0xfd19, G_UNICODE_NOT_PRESENT_OFFSET, 12912 },
-  { 0xfd1a, G_UNICODE_NOT_PRESENT_OFFSET, 12917 },
-  { 0xfd1b, G_UNICODE_NOT_PRESENT_OFFSET, 12922 },
-  { 0xfd1c, G_UNICODE_NOT_PRESENT_OFFSET, 12927 },
-  { 0xfd1d, G_UNICODE_NOT_PRESENT_OFFSET, 12932 },
-  { 0xfd1e, G_UNICODE_NOT_PRESENT_OFFSET, 12937 },
-  { 0xfd1f, G_UNICODE_NOT_PRESENT_OFFSET, 12942 },
-  { 0xfd20, G_UNICODE_NOT_PRESENT_OFFSET, 12947 },
-  { 0xfd21, G_UNICODE_NOT_PRESENT_OFFSET, 12952 },
-  { 0xfd22, G_UNICODE_NOT_PRESENT_OFFSET, 12957 },
-  { 0xfd23, G_UNICODE_NOT_PRESENT_OFFSET, 12962 },
-  { 0xfd24, G_UNICODE_NOT_PRESENT_OFFSET, 12967 },
-  { 0xfd25, G_UNICODE_NOT_PRESENT_OFFSET, 12972 },
-  { 0xfd26, G_UNICODE_NOT_PRESENT_OFFSET, 12977 },
-  { 0xfd27, G_UNICODE_NOT_PRESENT_OFFSET, 12982 },
-  { 0xfd28, G_UNICODE_NOT_PRESENT_OFFSET, 12841 },
-  { 0xfd29, G_UNICODE_NOT_PRESENT_OFFSET, 12987 },
-  { 0xfd2a, G_UNICODE_NOT_PRESENT_OFFSET, 12992 },
-  { 0xfd2b, G_UNICODE_NOT_PRESENT_OFFSET, 12997 },
-  { 0xfd2c, G_UNICODE_NOT_PRESENT_OFFSET, 13002 },
-  { 0xfd2d, G_UNICODE_NOT_PRESENT_OFFSET, 12972 },
-  { 0xfd2e, G_UNICODE_NOT_PRESENT_OFFSET, 12977 },
-  { 0xfd2f, G_UNICODE_NOT_PRESENT_OFFSET, 12982 },
-  { 0xfd30, G_UNICODE_NOT_PRESENT_OFFSET, 12841 },
-  { 0xfd31, G_UNICODE_NOT_PRESENT_OFFSET, 12836 },
-  { 0xfd32, G_UNICODE_NOT_PRESENT_OFFSET, 12846 },
-  { 0xfd33, G_UNICODE_NOT_PRESENT_OFFSET, 12370 },
-  { 0xfd34, G_UNICODE_NOT_PRESENT_OFFSET, 12315 },
-  { 0xfd35, G_UNICODE_NOT_PRESENT_OFFSET, 12320 },
-  { 0xfd36, G_UNICODE_NOT_PRESENT_OFFSET, 12325 },
-  { 0xfd37, G_UNICODE_NOT_PRESENT_OFFSET, 12972 },
-  { 0xfd38, G_UNICODE_NOT_PRESENT_OFFSET, 12977 },
-  { 0xfd39, G_UNICODE_NOT_PRESENT_OFFSET, 12982 },
-  { 0xfd3a, G_UNICODE_NOT_PRESENT_OFFSET, 12370 },
-  { 0xfd3b, G_UNICODE_NOT_PRESENT_OFFSET, 12375 },
-  { 0xfd3c, G_UNICODE_NOT_PRESENT_OFFSET, 13007 },
-  { 0xfd3d, G_UNICODE_NOT_PRESENT_OFFSET, 13007 },
-  { 0xfd50, G_UNICODE_NOT_PRESENT_OFFSET, 13012 },
-  { 0xfd51, G_UNICODE_NOT_PRESENT_OFFSET, 13019 },
-  { 0xfd52, G_UNICODE_NOT_PRESENT_OFFSET, 13019 },
-  { 0xfd53, G_UNICODE_NOT_PRESENT_OFFSET, 13026 },
-  { 0xfd54, G_UNICODE_NOT_PRESENT_OFFSET, 13033 },
-  { 0xfd55, G_UNICODE_NOT_PRESENT_OFFSET, 13040 },
-  { 0xfd56, G_UNICODE_NOT_PRESENT_OFFSET, 13047 },
-  { 0xfd57, G_UNICODE_NOT_PRESENT_OFFSET, 13054 },
-  { 0xfd58, G_UNICODE_NOT_PRESENT_OFFSET, 13061 },
-  { 0xfd59, G_UNICODE_NOT_PRESENT_OFFSET, 13061 },
-  { 0xfd5a, G_UNICODE_NOT_PRESENT_OFFSET, 13068 },
-  { 0xfd5b, G_UNICODE_NOT_PRESENT_OFFSET, 13075 },
-  { 0xfd5c, G_UNICODE_NOT_PRESENT_OFFSET, 13082 },
-  { 0xfd5d, G_UNICODE_NOT_PRESENT_OFFSET, 13089 },
-  { 0xfd5e, G_UNICODE_NOT_PRESENT_OFFSET, 13096 },
-  { 0xfd5f, G_UNICODE_NOT_PRESENT_OFFSET, 13103 },
-  { 0xfd60, G_UNICODE_NOT_PRESENT_OFFSET, 13103 },
-  { 0xfd61, G_UNICODE_NOT_PRESENT_OFFSET, 13110 },
-  { 0xfd62, G_UNICODE_NOT_PRESENT_OFFSET, 13117 },
-  { 0xfd63, G_UNICODE_NOT_PRESENT_OFFSET, 13117 },
-  { 0xfd64, G_UNICODE_NOT_PRESENT_OFFSET, 13124 },
-  { 0xfd65, G_UNICODE_NOT_PRESENT_OFFSET, 13124 },
-  { 0xfd66, G_UNICODE_NOT_PRESENT_OFFSET, 13131 },
-  { 0xfd67, G_UNICODE_NOT_PRESENT_OFFSET, 13138 },
-  { 0xfd68, G_UNICODE_NOT_PRESENT_OFFSET, 13138 },
-  { 0xfd69, G_UNICODE_NOT_PRESENT_OFFSET, 13145 },
-  { 0xfd6a, G_UNICODE_NOT_PRESENT_OFFSET, 13152 },
-  { 0xfd6b, G_UNICODE_NOT_PRESENT_OFFSET, 13152 },
-  { 0xfd6c, G_UNICODE_NOT_PRESENT_OFFSET, 13159 },
-  { 0xfd6d, G_UNICODE_NOT_PRESENT_OFFSET, 13159 },
-  { 0xfd6e, G_UNICODE_NOT_PRESENT_OFFSET, 13166 },
-  { 0xfd6f, G_UNICODE_NOT_PRESENT_OFFSET, 13173 },
-  { 0xfd70, G_UNICODE_NOT_PRESENT_OFFSET, 13173 },
-  { 0xfd71, G_UNICODE_NOT_PRESENT_OFFSET, 13180 },
-  { 0xfd72, G_UNICODE_NOT_PRESENT_OFFSET, 13180 },
-  { 0xfd73, G_UNICODE_NOT_PRESENT_OFFSET, 13187 },
-  { 0xfd74, G_UNICODE_NOT_PRESENT_OFFSET, 13194 },
-  { 0xfd75, G_UNICODE_NOT_PRESENT_OFFSET, 13201 },
-  { 0xfd76, G_UNICODE_NOT_PRESENT_OFFSET, 13208 },
-  { 0xfd77, G_UNICODE_NOT_PRESENT_OFFSET, 13208 },
-  { 0xfd78, G_UNICODE_NOT_PRESENT_OFFSET, 13215 },
-  { 0xfd79, G_UNICODE_NOT_PRESENT_OFFSET, 13222 },
-  { 0xfd7a, G_UNICODE_NOT_PRESENT_OFFSET, 13229 },
-  { 0xfd7b, G_UNICODE_NOT_PRESENT_OFFSET, 13236 },
-  { 0xfd7c, G_UNICODE_NOT_PRESENT_OFFSET, 13243 },
-  { 0xfd7d, G_UNICODE_NOT_PRESENT_OFFSET, 13243 },
-  { 0xfd7e, G_UNICODE_NOT_PRESENT_OFFSET, 13250 },
-  { 0xfd7f, G_UNICODE_NOT_PRESENT_OFFSET, 13257 },
-  { 0xfd80, G_UNICODE_NOT_PRESENT_OFFSET, 13264 },
-  { 0xfd81, G_UNICODE_NOT_PRESENT_OFFSET, 13271 },
-  { 0xfd82, G_UNICODE_NOT_PRESENT_OFFSET, 13278 },
-  { 0xfd83, G_UNICODE_NOT_PRESENT_OFFSET, 13285 },
-  { 0xfd84, G_UNICODE_NOT_PRESENT_OFFSET, 13285 },
-  { 0xfd85, G_UNICODE_NOT_PRESENT_OFFSET, 13292 },
-  { 0xfd86, G_UNICODE_NOT_PRESENT_OFFSET, 13292 },
-  { 0xfd87, G_UNICODE_NOT_PRESENT_OFFSET, 13299 },
-  { 0xfd88, G_UNICODE_NOT_PRESENT_OFFSET, 13299 },
-  { 0xfd89, G_UNICODE_NOT_PRESENT_OFFSET, 13306 },
-  { 0xfd8a, G_UNICODE_NOT_PRESENT_OFFSET, 13313 },
-  { 0xfd8b, G_UNICODE_NOT_PRESENT_OFFSET, 13320 },
-  { 0xfd8c, G_UNICODE_NOT_PRESENT_OFFSET, 13327 },
-  { 0xfd8d, G_UNICODE_NOT_PRESENT_OFFSET, 13334 },
-  { 0xfd8e, G_UNICODE_NOT_PRESENT_OFFSET, 13341 },
-  { 0xfd8f, G_UNICODE_NOT_PRESENT_OFFSET, 13348 },
-  { 0xfd92, G_UNICODE_NOT_PRESENT_OFFSET, 13355 },
-  { 0xfd93, G_UNICODE_NOT_PRESENT_OFFSET, 13362 },
-  { 0xfd94, G_UNICODE_NOT_PRESENT_OFFSET, 13369 },
-  { 0xfd95, G_UNICODE_NOT_PRESENT_OFFSET, 13376 },
-  { 0xfd96, G_UNICODE_NOT_PRESENT_OFFSET, 13383 },
-  { 0xfd97, G_UNICODE_NOT_PRESENT_OFFSET, 13390 },
-  { 0xfd98, G_UNICODE_NOT_PRESENT_OFFSET, 13390 },
-  { 0xfd99, G_UNICODE_NOT_PRESENT_OFFSET, 13397 },
-  { 0xfd9a, G_UNICODE_NOT_PRESENT_OFFSET, 13404 },
-  { 0xfd9b, G_UNICODE_NOT_PRESENT_OFFSET, 13411 },
-  { 0xfd9c, G_UNICODE_NOT_PRESENT_OFFSET, 13418 },
-  { 0xfd9d, G_UNICODE_NOT_PRESENT_OFFSET, 13418 },
-  { 0xfd9e, G_UNICODE_NOT_PRESENT_OFFSET, 13425 },
-  { 0xfd9f, G_UNICODE_NOT_PRESENT_OFFSET, 13432 },
-  { 0xfda0, G_UNICODE_NOT_PRESENT_OFFSET, 13439 },
-  { 0xfda1, G_UNICODE_NOT_PRESENT_OFFSET, 13446 },
-  { 0xfda2, G_UNICODE_NOT_PRESENT_OFFSET, 13453 },
-  { 0xfda3, G_UNICODE_NOT_PRESENT_OFFSET, 13460 },
-  { 0xfda4, G_UNICODE_NOT_PRESENT_OFFSET, 13467 },
-  { 0xfda5, G_UNICODE_NOT_PRESENT_OFFSET, 13474 },
-  { 0xfda6, G_UNICODE_NOT_PRESENT_OFFSET, 13481 },
-  { 0xfda7, G_UNICODE_NOT_PRESENT_OFFSET, 13488 },
-  { 0xfda8, G_UNICODE_NOT_PRESENT_OFFSET, 13495 },
-  { 0xfda9, G_UNICODE_NOT_PRESENT_OFFSET, 13502 },
-  { 0xfdaa, G_UNICODE_NOT_PRESENT_OFFSET, 13509 },
-  { 0xfdab, G_UNICODE_NOT_PRESENT_OFFSET, 13516 },
-  { 0xfdac, G_UNICODE_NOT_PRESENT_OFFSET, 13523 },
-  { 0xfdad, G_UNICODE_NOT_PRESENT_OFFSET, 13530 },
-  { 0xfdae, G_UNICODE_NOT_PRESENT_OFFSET, 13537 },
-  { 0xfdaf, G_UNICODE_NOT_PRESENT_OFFSET, 13544 },
-  { 0xfdb0, G_UNICODE_NOT_PRESENT_OFFSET, 13551 },
-  { 0xfdb1, G_UNICODE_NOT_PRESENT_OFFSET, 13558 },
-  { 0xfdb2, G_UNICODE_NOT_PRESENT_OFFSET, 13565 },
-  { 0xfdb3, G_UNICODE_NOT_PRESENT_OFFSET, 13572 },
-  { 0xfdb4, G_UNICODE_NOT_PRESENT_OFFSET, 13250 },
-  { 0xfdb5, G_UNICODE_NOT_PRESENT_OFFSET, 13264 },
-  { 0xfdb6, G_UNICODE_NOT_PRESENT_OFFSET, 13579 },
-  { 0xfdb7, G_UNICODE_NOT_PRESENT_OFFSET, 13586 },
-  { 0xfdb8, G_UNICODE_NOT_PRESENT_OFFSET, 13593 },
-  { 0xfdb9, G_UNICODE_NOT_PRESENT_OFFSET, 13600 },
-  { 0xfdba, G_UNICODE_NOT_PRESENT_OFFSET, 13607 },
-  { 0xfdbb, G_UNICODE_NOT_PRESENT_OFFSET, 13614 },
-  { 0xfdbc, G_UNICODE_NOT_PRESENT_OFFSET, 13607 },
-  { 0xfdbd, G_UNICODE_NOT_PRESENT_OFFSET, 13593 },
-  { 0xfdbe, G_UNICODE_NOT_PRESENT_OFFSET, 13621 },
-  { 0xfdbf, G_UNICODE_NOT_PRESENT_OFFSET, 13628 },
-  { 0xfdc0, G_UNICODE_NOT_PRESENT_OFFSET, 13635 },
-  { 0xfdc1, G_UNICODE_NOT_PRESENT_OFFSET, 13642 },
-  { 0xfdc2, G_UNICODE_NOT_PRESENT_OFFSET, 13649 },
-  { 0xfdc3, G_UNICODE_NOT_PRESENT_OFFSET, 13614 },
-  { 0xfdc4, G_UNICODE_NOT_PRESENT_OFFSET, 13201 },
-  { 0xfdc5, G_UNICODE_NOT_PRESENT_OFFSET, 13131 },
-  { 0xfdc6, G_UNICODE_NOT_PRESENT_OFFSET, 13656 },
-  { 0xfdc7, G_UNICODE_NOT_PRESENT_OFFSET, 13663 },
-  { 0xfdf0, G_UNICODE_NOT_PRESENT_OFFSET, 13670 },
-  { 0xfdf1, G_UNICODE_NOT_PRESENT_OFFSET, 13677 },
-  { 0xfdf2, G_UNICODE_NOT_PRESENT_OFFSET, 13684 },
-  { 0xfdf3, G_UNICODE_NOT_PRESENT_OFFSET, 13693 },
-  { 0xfdf4, G_UNICODE_NOT_PRESENT_OFFSET, 13702 },
-  { 0xfdf5, G_UNICODE_NOT_PRESENT_OFFSET, 13711 },
-  { 0xfdf6, G_UNICODE_NOT_PRESENT_OFFSET, 13720 },
-  { 0xfdf7, G_UNICODE_NOT_PRESENT_OFFSET, 13729 },
-  { 0xfdf8, G_UNICODE_NOT_PRESENT_OFFSET, 13738 },
-  { 0xfdf9, G_UNICODE_NOT_PRESENT_OFFSET, 13747 },
-  { 0xfdfa, G_UNICODE_NOT_PRESENT_OFFSET, 13754 },
-  { 0xfdfb, G_UNICODE_NOT_PRESENT_OFFSET, 13788 },
-  { 0xfdfc, G_UNICODE_NOT_PRESENT_OFFSET, 13804 },
-  { 0xfe30, G_UNICODE_NOT_PRESENT_OFFSET, 4871 },
-  { 0xfe31, G_UNICODE_NOT_PRESENT_OFFSET, 13813 },
-  { 0xfe32, G_UNICODE_NOT_PRESENT_OFFSET, 13817 },
-  { 0xfe33, G_UNICODE_NOT_PRESENT_OFFSET, 13821 },
-  { 0xfe34, G_UNICODE_NOT_PRESENT_OFFSET, 13821 },
-  { 0xfe35, G_UNICODE_NOT_PRESENT_OFFSET, 4965 },
-  { 0xfe36, G_UNICODE_NOT_PRESENT_OFFSET, 4967 },
-  { 0xfe37, G_UNICODE_NOT_PRESENT_OFFSET, 13823 },
-  { 0xfe38, G_UNICODE_NOT_PRESENT_OFFSET, 13825 },
-  { 0xfe39, G_UNICODE_NOT_PRESENT_OFFSET, 13827 },
-  { 0xfe3a, G_UNICODE_NOT_PRESENT_OFFSET, 13831 },
-  { 0xfe3b, G_UNICODE_NOT_PRESENT_OFFSET, 13835 },
-  { 0xfe3c, G_UNICODE_NOT_PRESENT_OFFSET, 13839 },
-  { 0xfe3d, G_UNICODE_NOT_PRESENT_OFFSET, 13843 },
-  { 0xfe3e, G_UNICODE_NOT_PRESENT_OFFSET, 13847 },
-  { 0xfe3f, G_UNICODE_NOT_PRESENT_OFFSET, 5524 },
-  { 0xfe40, G_UNICODE_NOT_PRESENT_OFFSET, 5528 },
-  { 0xfe41, G_UNICODE_NOT_PRESENT_OFFSET, 13851 },
-  { 0xfe42, G_UNICODE_NOT_PRESENT_OFFSET, 13855 },
-  { 0xfe43, G_UNICODE_NOT_PRESENT_OFFSET, 13859 },
-  { 0xfe44, G_UNICODE_NOT_PRESENT_OFFSET, 13863 },
-  { 0xfe49, G_UNICODE_NOT_PRESENT_OFFSET, 4915 },
-  { 0xfe4a, G_UNICODE_NOT_PRESENT_OFFSET, 4915 },
-  { 0xfe4b, G_UNICODE_NOT_PRESENT_OFFSET, 4915 },
-  { 0xfe4c, G_UNICODE_NOT_PRESENT_OFFSET, 4915 },
-  { 0xfe4d, G_UNICODE_NOT_PRESENT_OFFSET, 13821 },
-  { 0xfe4e, G_UNICODE_NOT_PRESENT_OFFSET, 13821 },
-  { 0xfe4f, G_UNICODE_NOT_PRESENT_OFFSET, 13821 },
-  { 0xfe50, G_UNICODE_NOT_PRESENT_OFFSET, 13867 },
-  { 0xfe51, G_UNICODE_NOT_PRESENT_OFFSET, 13869 },
-  { 0xfe52, G_UNICODE_NOT_PRESENT_OFFSET, 4869 },
-  { 0xfe54, G_UNICODE_NOT_PRESENT_OFFSET, 1248 },
-  { 0xfe55, G_UNICODE_NOT_PRESENT_OFFSET, 13873 },
-  { 0xfe56, G_UNICODE_NOT_PRESENT_OFFSET, 13875 },
-  { 0xfe57, G_UNICODE_NOT_PRESENT_OFFSET, 13877 },
-  { 0xfe58, G_UNICODE_NOT_PRESENT_OFFSET, 13813 },
-  { 0xfe59, G_UNICODE_NOT_PRESENT_OFFSET, 4965 },
-  { 0xfe5a, G_UNICODE_NOT_PRESENT_OFFSET, 4967 },
-  { 0xfe5b, G_UNICODE_NOT_PRESENT_OFFSET, 13823 },
-  { 0xfe5c, G_UNICODE_NOT_PRESENT_OFFSET, 13825 },
-  { 0xfe5d, G_UNICODE_NOT_PRESENT_OFFSET, 13827 },
-  { 0xfe5e, G_UNICODE_NOT_PRESENT_OFFSET, 13831 },
-  { 0xfe5f, G_UNICODE_NOT_PRESENT_OFFSET, 13879 },
-  { 0xfe60, G_UNICODE_NOT_PRESENT_OFFSET, 13881 },
-  { 0xfe61, G_UNICODE_NOT_PRESENT_OFFSET, 13883 },
-  { 0xfe62, G_UNICODE_NOT_PRESENT_OFFSET, 4957 },
-  { 0xfe63, G_UNICODE_NOT_PRESENT_OFFSET, 13885 },
-  { 0xfe64, G_UNICODE_NOT_PRESENT_OFFSET, 13887 },
-  { 0xfe65, G_UNICODE_NOT_PRESENT_OFFSET, 13889 },
-  { 0xfe66, G_UNICODE_NOT_PRESENT_OFFSET, 4963 },
-  { 0xfe68, G_UNICODE_NOT_PRESENT_OFFSET, 13891 },
-  { 0xfe69, G_UNICODE_NOT_PRESENT_OFFSET, 13893 },
-  { 0xfe6a, G_UNICODE_NOT_PRESENT_OFFSET, 13895 },
-  { 0xfe6b, G_UNICODE_NOT_PRESENT_OFFSET, 13897 },
-  { 0xfe70, G_UNICODE_NOT_PRESENT_OFFSET, 13899 },
-  { 0xfe71, G_UNICODE_NOT_PRESENT_OFFSET, 13903 },
-  { 0xfe72, G_UNICODE_NOT_PRESENT_OFFSET, 13908 },
-  { 0xfe74, G_UNICODE_NOT_PRESENT_OFFSET, 13912 },
-  { 0xfe76, G_UNICODE_NOT_PRESENT_OFFSET, 13916 },
-  { 0xfe77, G_UNICODE_NOT_PRESENT_OFFSET, 13920 },
-  { 0xfe78, G_UNICODE_NOT_PRESENT_OFFSET, 13925 },
-  { 0xfe79, G_UNICODE_NOT_PRESENT_OFFSET, 13929 },
-  { 0xfe7a, G_UNICODE_NOT_PRESENT_OFFSET, 13934 },
-  { 0xfe7b, G_UNICODE_NOT_PRESENT_OFFSET, 13938 },
-  { 0xfe7c, G_UNICODE_NOT_PRESENT_OFFSET, 13943 },
-  { 0xfe7d, G_UNICODE_NOT_PRESENT_OFFSET, 13947 },
-  { 0xfe7e, G_UNICODE_NOT_PRESENT_OFFSET, 13952 },
-  { 0xfe7f, G_UNICODE_NOT_PRESENT_OFFSET, 13956 },
-  { 0xfe80, G_UNICODE_NOT_PRESENT_OFFSET, 13961 },
-  { 0xfe81, G_UNICODE_NOT_PRESENT_OFFSET, 1673 },
-  { 0xfe82, G_UNICODE_NOT_PRESENT_OFFSET, 1673 },
-  { 0xfe83, G_UNICODE_NOT_PRESENT_OFFSET, 1678 },
-  { 0xfe84, G_UNICODE_NOT_PRESENT_OFFSET, 1678 },
-  { 0xfe85, G_UNICODE_NOT_PRESENT_OFFSET, 1683 },
-  { 0xfe86, G_UNICODE_NOT_PRESENT_OFFSET, 1683 },
-  { 0xfe87, G_UNICODE_NOT_PRESENT_OFFSET, 1688 },
-  { 0xfe88, G_UNICODE_NOT_PRESENT_OFFSET, 1688 },
-  { 0xfe89, G_UNICODE_NOT_PRESENT_OFFSET, 1693 },
-  { 0xfe8a, G_UNICODE_NOT_PRESENT_OFFSET, 1693 },
-  { 0xfe8b, G_UNICODE_NOT_PRESENT_OFFSET, 1693 },
-  { 0xfe8c, G_UNICODE_NOT_PRESENT_OFFSET, 1693 },
-  { 0xfe8d, G_UNICODE_NOT_PRESENT_OFFSET, 13964 },
-  { 0xfe8e, G_UNICODE_NOT_PRESENT_OFFSET, 13964 },
-  { 0xfe8f, G_UNICODE_NOT_PRESENT_OFFSET, 13967 },
-  { 0xfe90, G_UNICODE_NOT_PRESENT_OFFSET, 13967 },
-  { 0xfe91, G_UNICODE_NOT_PRESENT_OFFSET, 13967 },
-  { 0xfe92, G_UNICODE_NOT_PRESENT_OFFSET, 13967 },
-  { 0xfe93, G_UNICODE_NOT_PRESENT_OFFSET, 13970 },
-  { 0xfe94, G_UNICODE_NOT_PRESENT_OFFSET, 13970 },
-  { 0xfe95, G_UNICODE_NOT_PRESENT_OFFSET, 13973 },
-  { 0xfe96, G_UNICODE_NOT_PRESENT_OFFSET, 13973 },
-  { 0xfe97, G_UNICODE_NOT_PRESENT_OFFSET, 13973 },
-  { 0xfe98, G_UNICODE_NOT_PRESENT_OFFSET, 13973 },
-  { 0xfe99, G_UNICODE_NOT_PRESENT_OFFSET, 13976 },
-  { 0xfe9a, G_UNICODE_NOT_PRESENT_OFFSET, 13976 },
-  { 0xfe9b, G_UNICODE_NOT_PRESENT_OFFSET, 13976 },
-  { 0xfe9c, G_UNICODE_NOT_PRESENT_OFFSET, 13976 },
-  { 0xfe9d, G_UNICODE_NOT_PRESENT_OFFSET, 13979 },
-  { 0xfe9e, G_UNICODE_NOT_PRESENT_OFFSET, 13979 },
-  { 0xfe9f, G_UNICODE_NOT_PRESENT_OFFSET, 13979 },
-  { 0xfea0, G_UNICODE_NOT_PRESENT_OFFSET, 13979 },
-  { 0xfea1, G_UNICODE_NOT_PRESENT_OFFSET, 13982 },
-  { 0xfea2, G_UNICODE_NOT_PRESENT_OFFSET, 13982 },
-  { 0xfea3, G_UNICODE_NOT_PRESENT_OFFSET, 13982 },
-  { 0xfea4, G_UNICODE_NOT_PRESENT_OFFSET, 13982 },
-  { 0xfea5, G_UNICODE_NOT_PRESENT_OFFSET, 13985 },
-  { 0xfea6, G_UNICODE_NOT_PRESENT_OFFSET, 13985 },
-  { 0xfea7, G_UNICODE_NOT_PRESENT_OFFSET, 13985 },
-  { 0xfea8, G_UNICODE_NOT_PRESENT_OFFSET, 13985 },
-  { 0xfea9, G_UNICODE_NOT_PRESENT_OFFSET, 13988 },
-  { 0xfeaa, G_UNICODE_NOT_PRESENT_OFFSET, 13988 },
-  { 0xfeab, G_UNICODE_NOT_PRESENT_OFFSET, 13991 },
-  { 0xfeac, G_UNICODE_NOT_PRESENT_OFFSET, 13991 },
-  { 0xfead, G_UNICODE_NOT_PRESENT_OFFSET, 13994 },
-  { 0xfeae, G_UNICODE_NOT_PRESENT_OFFSET, 13994 },
-  { 0xfeaf, G_UNICODE_NOT_PRESENT_OFFSET, 13997 },
-  { 0xfeb0, G_UNICODE_NOT_PRESENT_OFFSET, 13997 },
-  { 0xfeb1, G_UNICODE_NOT_PRESENT_OFFSET, 14000 },
-  { 0xfeb2, G_UNICODE_NOT_PRESENT_OFFSET, 14000 },
-  { 0xfeb3, G_UNICODE_NOT_PRESENT_OFFSET, 14000 },
-  { 0xfeb4, G_UNICODE_NOT_PRESENT_OFFSET, 14000 },
-  { 0xfeb5, G_UNICODE_NOT_PRESENT_OFFSET, 14003 },
-  { 0xfeb6, G_UNICODE_NOT_PRESENT_OFFSET, 14003 },
-  { 0xfeb7, G_UNICODE_NOT_PRESENT_OFFSET, 14003 },
-  { 0xfeb8, G_UNICODE_NOT_PRESENT_OFFSET, 14003 },
-  { 0xfeb9, G_UNICODE_NOT_PRESENT_OFFSET, 14006 },
-  { 0xfeba, G_UNICODE_NOT_PRESENT_OFFSET, 14006 },
-  { 0xfebb, G_UNICODE_NOT_PRESENT_OFFSET, 14006 },
-  { 0xfebc, G_UNICODE_NOT_PRESENT_OFFSET, 14006 },
-  { 0xfebd, G_UNICODE_NOT_PRESENT_OFFSET, 14009 },
-  { 0xfebe, G_UNICODE_NOT_PRESENT_OFFSET, 14009 },
-  { 0xfebf, G_UNICODE_NOT_PRESENT_OFFSET, 14009 },
-  { 0xfec0, G_UNICODE_NOT_PRESENT_OFFSET, 14009 },
-  { 0xfec1, G_UNICODE_NOT_PRESENT_OFFSET, 14012 },
-  { 0xfec2, G_UNICODE_NOT_PRESENT_OFFSET, 14012 },
-  { 0xfec3, G_UNICODE_NOT_PRESENT_OFFSET, 14012 },
-  { 0xfec4, G_UNICODE_NOT_PRESENT_OFFSET, 14012 },
-  { 0xfec5, G_UNICODE_NOT_PRESENT_OFFSET, 14015 },
-  { 0xfec6, G_UNICODE_NOT_PRESENT_OFFSET, 14015 },
-  { 0xfec7, G_UNICODE_NOT_PRESENT_OFFSET, 14015 },
-  { 0xfec8, G_UNICODE_NOT_PRESENT_OFFSET, 14015 },
-  { 0xfec9, G_UNICODE_NOT_PRESENT_OFFSET, 14018 },
-  { 0xfeca, G_UNICODE_NOT_PRESENT_OFFSET, 14018 },
-  { 0xfecb, G_UNICODE_NOT_PRESENT_OFFSET, 14018 },
-  { 0xfecc, G_UNICODE_NOT_PRESENT_OFFSET, 14018 },
-  { 0xfecd, G_UNICODE_NOT_PRESENT_OFFSET, 14021 },
-  { 0xfece, G_UNICODE_NOT_PRESENT_OFFSET, 14021 },
-  { 0xfecf, G_UNICODE_NOT_PRESENT_OFFSET, 14021 },
-  { 0xfed0, G_UNICODE_NOT_PRESENT_OFFSET, 14021 },
-  { 0xfed1, G_UNICODE_NOT_PRESENT_OFFSET, 14024 },
-  { 0xfed2, G_UNICODE_NOT_PRESENT_OFFSET, 14024 },
-  { 0xfed3, G_UNICODE_NOT_PRESENT_OFFSET, 14024 },
-  { 0xfed4, G_UNICODE_NOT_PRESENT_OFFSET, 14024 },
-  { 0xfed5, G_UNICODE_NOT_PRESENT_OFFSET, 14027 },
-  { 0xfed6, G_UNICODE_NOT_PRESENT_OFFSET, 14027 },
-  { 0xfed7, G_UNICODE_NOT_PRESENT_OFFSET, 14027 },
-  { 0xfed8, G_UNICODE_NOT_PRESENT_OFFSET, 14027 },
-  { 0xfed9, G_UNICODE_NOT_PRESENT_OFFSET, 14030 },
-  { 0xfeda, G_UNICODE_NOT_PRESENT_OFFSET, 14030 },
-  { 0xfedb, G_UNICODE_NOT_PRESENT_OFFSET, 14030 },
-  { 0xfedc, G_UNICODE_NOT_PRESENT_OFFSET, 14030 },
-  { 0xfedd, G_UNICODE_NOT_PRESENT_OFFSET, 14033 },
-  { 0xfede, G_UNICODE_NOT_PRESENT_OFFSET, 14033 },
-  { 0xfedf, G_UNICODE_NOT_PRESENT_OFFSET, 14033 },
-  { 0xfee0, G_UNICODE_NOT_PRESENT_OFFSET, 14033 },
-  { 0xfee1, G_UNICODE_NOT_PRESENT_OFFSET, 14036 },
-  { 0xfee2, G_UNICODE_NOT_PRESENT_OFFSET, 14036 },
-  { 0xfee3, G_UNICODE_NOT_PRESENT_OFFSET, 14036 },
-  { 0xfee4, G_UNICODE_NOT_PRESENT_OFFSET, 14036 },
-  { 0xfee5, G_UNICODE_NOT_PRESENT_OFFSET, 14039 },
-  { 0xfee6, G_UNICODE_NOT_PRESENT_OFFSET, 14039 },
-  { 0xfee7, G_UNICODE_NOT_PRESENT_OFFSET, 14039 },
-  { 0xfee8, G_UNICODE_NOT_PRESENT_OFFSET, 14039 },
-  { 0xfee9, G_UNICODE_NOT_PRESENT_OFFSET, 14042 },
-  { 0xfeea, G_UNICODE_NOT_PRESENT_OFFSET, 14042 },
-  { 0xfeeb, G_UNICODE_NOT_PRESENT_OFFSET, 14042 },
-  { 0xfeec, G_UNICODE_NOT_PRESENT_OFFSET, 14042 },
-  { 0xfeed, G_UNICODE_NOT_PRESENT_OFFSET, 14045 },
-  { 0xfeee, G_UNICODE_NOT_PRESENT_OFFSET, 14045 },
-  { 0xfeef, G_UNICODE_NOT_PRESENT_OFFSET, 12110 },
-  { 0xfef0, G_UNICODE_NOT_PRESENT_OFFSET, 12110 },
-  { 0xfef1, G_UNICODE_NOT_PRESENT_OFFSET, 14048 },
-  { 0xfef2, G_UNICODE_NOT_PRESENT_OFFSET, 14048 },
-  { 0xfef3, G_UNICODE_NOT_PRESENT_OFFSET, 14048 },
-  { 0xfef4, G_UNICODE_NOT_PRESENT_OFFSET, 14048 },
-  { 0xfef5, G_UNICODE_NOT_PRESENT_OFFSET, 14051 },
-  { 0xfef6, G_UNICODE_NOT_PRESENT_OFFSET, 14051 },
-  { 0xfef7, G_UNICODE_NOT_PRESENT_OFFSET, 14058 },
-  { 0xfef8, G_UNICODE_NOT_PRESENT_OFFSET, 14058 },
-  { 0xfef9, G_UNICODE_NOT_PRESENT_OFFSET, 14065 },
-  { 0xfefa, G_UNICODE_NOT_PRESENT_OFFSET, 14065 },
-  { 0xfefb, G_UNICODE_NOT_PRESENT_OFFSET, 14072 },
-  { 0xfefc, G_UNICODE_NOT_PRESENT_OFFSET, 14072 },
-  { 0xff01, G_UNICODE_NOT_PRESENT_OFFSET, 13877 },
-  { 0xff02, G_UNICODE_NOT_PRESENT_OFFSET, 14077 },
-  { 0xff03, G_UNICODE_NOT_PRESENT_OFFSET, 13879 },
-  { 0xff04, G_UNICODE_NOT_PRESENT_OFFSET, 13893 },
-  { 0xff05, G_UNICODE_NOT_PRESENT_OFFSET, 13895 },
-  { 0xff06, G_UNICODE_NOT_PRESENT_OFFSET, 13881 },
-  { 0xff07, G_UNICODE_NOT_PRESENT_OFFSET, 14079 },
-  { 0xff08, G_UNICODE_NOT_PRESENT_OFFSET, 4965 },
-  { 0xff09, G_UNICODE_NOT_PRESENT_OFFSET, 4967 },
-  { 0xff0a, G_UNICODE_NOT_PRESENT_OFFSET, 13883 },
-  { 0xff0b, G_UNICODE_NOT_PRESENT_OFFSET, 4957 },
-  { 0xff0c, G_UNICODE_NOT_PRESENT_OFFSET, 13867 },
-  { 0xff0d, G_UNICODE_NOT_PRESENT_OFFSET, 13885 },
-  { 0xff0e, G_UNICODE_NOT_PRESENT_OFFSET, 4869 },
-  { 0xff0f, G_UNICODE_NOT_PRESENT_OFFSET, 14081 },
-  { 0xff10, G_UNICODE_NOT_PRESENT_OFFSET, 4941 },
-  { 0xff11, G_UNICODE_NOT_PRESENT_OFFSET, 27 },
-  { 0xff12, G_UNICODE_NOT_PRESENT_OFFSET, 12 },
-  { 0xff13, G_UNICODE_NOT_PRESENT_OFFSET, 14 },
-  { 0xff14, G_UNICODE_NOT_PRESENT_OFFSET, 4945 },
-  { 0xff15, G_UNICODE_NOT_PRESENT_OFFSET, 4947 },
-  { 0xff16, G_UNICODE_NOT_PRESENT_OFFSET, 4949 },
-  { 0xff17, G_UNICODE_NOT_PRESENT_OFFSET, 4951 },
-  { 0xff18, G_UNICODE_NOT_PRESENT_OFFSET, 4953 },
-  { 0xff19, G_UNICODE_NOT_PRESENT_OFFSET, 4955 },
-  { 0xff1a, G_UNICODE_NOT_PRESENT_OFFSET, 13873 },
-  { 0xff1b, G_UNICODE_NOT_PRESENT_OFFSET, 1248 },
-  { 0xff1c, G_UNICODE_NOT_PRESENT_OFFSET, 13887 },
-  { 0xff1d, G_UNICODE_NOT_PRESENT_OFFSET, 4963 },
-  { 0xff1e, G_UNICODE_NOT_PRESENT_OFFSET, 13889 },
-  { 0xff1f, G_UNICODE_NOT_PRESENT_OFFSET, 13875 },
-  { 0xff20, G_UNICODE_NOT_PRESENT_OFFSET, 13897 },
-  { 0xff21, G_UNICODE_NOT_PRESENT_OFFSET, 5831 },
-  { 0xff22, G_UNICODE_NOT_PRESENT_OFFSET, 5042 },
-  { 0xff23, G_UNICODE_NOT_PRESENT_OFFSET, 4982 },
-  { 0xff24, G_UNICODE_NOT_PRESENT_OFFSET, 5077 },
-  { 0xff25, G_UNICODE_NOT_PRESENT_OFFSET, 5046 },
-  { 0xff26, G_UNICODE_NOT_PRESENT_OFFSET, 5048 },
-  { 0xff27, G_UNICODE_NOT_PRESENT_OFFSET, 5833 },
-  { 0xff28, G_UNICODE_NOT_PRESENT_OFFSET, 5005 },
-  { 0xff29, G_UNICODE_NOT_PRESENT_OFFSET, 5010 },
-  { 0xff2a, G_UNICODE_NOT_PRESENT_OFFSET, 5835 },
-  { 0xff2b, G_UNICODE_NOT_PRESENT_OFFSET, 5040 },
-  { 0xff2c, G_UNICODE_NOT_PRESENT_OFFSET, 5012 },
-  { 0xff2d, G_UNICODE_NOT_PRESENT_OFFSET, 5050 },
-  { 0xff2e, G_UNICODE_NOT_PRESENT_OFFSET, 5014 },
-  { 0xff2f, G_UNICODE_NOT_PRESENT_OFFSET, 5837 },
-  { 0xff30, G_UNICODE_NOT_PRESENT_OFFSET, 5019 },
-  { 0xff31, G_UNICODE_NOT_PRESENT_OFFSET, 5021 },
-  { 0xff32, G_UNICODE_NOT_PRESENT_OFFSET, 5023 },
-  { 0xff33, G_UNICODE_NOT_PRESENT_OFFSET, 5839 },
-  { 0xff34, G_UNICODE_NOT_PRESENT_OFFSET, 5841 },
-  { 0xff35, G_UNICODE_NOT_PRESENT_OFFSET, 5843 },
-  { 0xff36, G_UNICODE_NOT_PRESENT_OFFSET, 5168 },
-  { 0xff37, G_UNICODE_NOT_PRESENT_OFFSET, 5845 },
-  { 0xff38, G_UNICODE_NOT_PRESENT_OFFSET, 5185 },
-  { 0xff39, G_UNICODE_NOT_PRESENT_OFFSET, 5847 },
-  { 0xff3a, G_UNICODE_NOT_PRESENT_OFFSET, 5035 },
-  { 0xff3b, G_UNICODE_NOT_PRESENT_OFFSET, 14083 },
-  { 0xff3c, G_UNICODE_NOT_PRESENT_OFFSET, 13891 },
-  { 0xff3d, G_UNICODE_NOT_PRESENT_OFFSET, 14085 },
-  { 0xff3e, G_UNICODE_NOT_PRESENT_OFFSET, 14087 },
-  { 0xff3f, G_UNICODE_NOT_PRESENT_OFFSET, 13821 },
-  { 0xff40, G_UNICODE_NOT_PRESENT_OFFSET, 4798 },
-  { 0xff41, G_UNICODE_NOT_PRESENT_OFFSET, 6 },
-  { 0xff42, G_UNICODE_NOT_PRESENT_OFFSET, 5849 },
-  { 0xff43, G_UNICODE_NOT_PRESENT_OFFSET, 5228 },
-  { 0xff44, G_UNICODE_NOT_PRESENT_OFFSET, 5079 },
-  { 0xff45, G_UNICODE_NOT_PRESENT_OFFSET, 5044 },
-  { 0xff46, G_UNICODE_NOT_PRESENT_OFFSET, 5851 },
-  { 0xff47, G_UNICODE_NOT_PRESENT_OFFSET, 5003 },
-  { 0xff48, G_UNICODE_NOT_PRESENT_OFFSET, 1171 },
-  { 0xff49, G_UNICODE_NOT_PRESENT_OFFSET, 4943 },
-  { 0xff4a, G_UNICODE_NOT_PRESENT_OFFSET, 1176 },
-  { 0xff4b, G_UNICODE_NOT_PRESENT_OFFSET, 5853 },
-  { 0xff4c, G_UNICODE_NOT_PRESENT_OFFSET, 1220 },
-  { 0xff4d, G_UNICODE_NOT_PRESENT_OFFSET, 5230 },
-  { 0xff4e, G_UNICODE_NOT_PRESENT_OFFSET, 4969 },
-  { 0xff4f, G_UNICODE_NOT_PRESENT_OFFSET, 29 },
-  { 0xff50, G_UNICODE_NOT_PRESENT_OFFSET, 5855 },
-  { 0xff51, G_UNICODE_NOT_PRESENT_OFFSET, 5857 },
-  { 0xff52, G_UNICODE_NOT_PRESENT_OFFSET, 1178 },
-  { 0xff53, G_UNICODE_NOT_PRESENT_OFFSET, 711 },
-  { 0xff54, G_UNICODE_NOT_PRESENT_OFFSET, 5859 },
-  { 0xff55, G_UNICODE_NOT_PRESENT_OFFSET, 5861 },
-  { 0xff56, G_UNICODE_NOT_PRESENT_OFFSET, 5204 },
-  { 0xff57, G_UNICODE_NOT_PRESENT_OFFSET, 1189 },
-  { 0xff58, G_UNICODE_NOT_PRESENT_OFFSET, 1222 },
-  { 0xff59, G_UNICODE_NOT_PRESENT_OFFSET, 1191 },
-  { 0xff5a, G_UNICODE_NOT_PRESENT_OFFSET, 5863 },
-  { 0xff5b, G_UNICODE_NOT_PRESENT_OFFSET, 13823 },
-  { 0xff5c, G_UNICODE_NOT_PRESENT_OFFSET, 14089 },
-  { 0xff5d, G_UNICODE_NOT_PRESENT_OFFSET, 13825 },
-  { 0xff5e, G_UNICODE_NOT_PRESENT_OFFSET, 14091 },
-  { 0xff5f, G_UNICODE_NOT_PRESENT_OFFSET, 14093 },
-  { 0xff60, G_UNICODE_NOT_PRESENT_OFFSET, 14097 },
-  { 0xff61, G_UNICODE_NOT_PRESENT_OFFSET, 14101 },
-  { 0xff62, G_UNICODE_NOT_PRESENT_OFFSET, 13851 },
-  { 0xff63, G_UNICODE_NOT_PRESENT_OFFSET, 13855 },
-  { 0xff64, G_UNICODE_NOT_PRESENT_OFFSET, 13869 },
-  { 0xff65, G_UNICODE_NOT_PRESENT_OFFSET, 14105 },
-  { 0xff66, G_UNICODE_NOT_PRESENT_OFFSET, 8615 },
-  { 0xff67, G_UNICODE_NOT_PRESENT_OFFSET, 14109 },
-  { 0xff68, G_UNICODE_NOT_PRESENT_OFFSET, 14113 },
-  { 0xff69, G_UNICODE_NOT_PRESENT_OFFSET, 14117 },
-  { 0xff6a, G_UNICODE_NOT_PRESENT_OFFSET, 14121 },
-  { 0xff6b, G_UNICODE_NOT_PRESENT_OFFSET, 14125 },
-  { 0xff6c, G_UNICODE_NOT_PRESENT_OFFSET, 14129 },
-  { 0xff6d, G_UNICODE_NOT_PRESENT_OFFSET, 14133 },
-  { 0xff6e, G_UNICODE_NOT_PRESENT_OFFSET, 14137 },
-  { 0xff6f, G_UNICODE_NOT_PRESENT_OFFSET, 14141 },
-  { 0xff70, G_UNICODE_NOT_PRESENT_OFFSET, 14145 },
-  { 0xff71, G_UNICODE_NOT_PRESENT_OFFSET, 8431 },
-  { 0xff72, G_UNICODE_NOT_PRESENT_OFFSET, 8435 },
-  { 0xff73, G_UNICODE_NOT_PRESENT_OFFSET, 8439 },
-  { 0xff74, G_UNICODE_NOT_PRESENT_OFFSET, 8443 },
-  { 0xff75, G_UNICODE_NOT_PRESENT_OFFSET, 8447 },
-  { 0xff76, G_UNICODE_NOT_PRESENT_OFFSET, 8451 },
-  { 0xff77, G_UNICODE_NOT_PRESENT_OFFSET, 8455 },
-  { 0xff78, G_UNICODE_NOT_PRESENT_OFFSET, 8459 },
-  { 0xff79, G_UNICODE_NOT_PRESENT_OFFSET, 8463 },
-  { 0xff7a, G_UNICODE_NOT_PRESENT_OFFSET, 8467 },
-  { 0xff7b, G_UNICODE_NOT_PRESENT_OFFSET, 8471 },
-  { 0xff7c, G_UNICODE_NOT_PRESENT_OFFSET, 8475 },
-  { 0xff7d, G_UNICODE_NOT_PRESENT_OFFSET, 8479 },
-  { 0xff7e, G_UNICODE_NOT_PRESENT_OFFSET, 8483 },
-  { 0xff7f, G_UNICODE_NOT_PRESENT_OFFSET, 8487 },
-  { 0xff80, G_UNICODE_NOT_PRESENT_OFFSET, 8491 },
-  { 0xff81, G_UNICODE_NOT_PRESENT_OFFSET, 8495 },
-  { 0xff82, G_UNICODE_NOT_PRESENT_OFFSET, 8499 },
-  { 0xff83, G_UNICODE_NOT_PRESENT_OFFSET, 8503 },
-  { 0xff84, G_UNICODE_NOT_PRESENT_OFFSET, 8507 },
-  { 0xff85, G_UNICODE_NOT_PRESENT_OFFSET, 8511 },
-  { 0xff86, G_UNICODE_NOT_PRESENT_OFFSET, 8515 },
-  { 0xff87, G_UNICODE_NOT_PRESENT_OFFSET, 8519 },
-  { 0xff88, G_UNICODE_NOT_PRESENT_OFFSET, 8523 },
-  { 0xff89, G_UNICODE_NOT_PRESENT_OFFSET, 8527 },
-  { 0xff8a, G_UNICODE_NOT_PRESENT_OFFSET, 8531 },
-  { 0xff8b, G_UNICODE_NOT_PRESENT_OFFSET, 8535 },
-  { 0xff8c, G_UNICODE_NOT_PRESENT_OFFSET, 8539 },
-  { 0xff8d, G_UNICODE_NOT_PRESENT_OFFSET, 8543 },
-  { 0xff8e, G_UNICODE_NOT_PRESENT_OFFSET, 8547 },
-  { 0xff8f, G_UNICODE_NOT_PRESENT_OFFSET, 8551 },
-  { 0xff90, G_UNICODE_NOT_PRESENT_OFFSET, 8555 },
-  { 0xff91, G_UNICODE_NOT_PRESENT_OFFSET, 8559 },
-  { 0xff92, G_UNICODE_NOT_PRESENT_OFFSET, 8563 },
-  { 0xff93, G_UNICODE_NOT_PRESENT_OFFSET, 8567 },
-  { 0xff94, G_UNICODE_NOT_PRESENT_OFFSET, 8571 },
-  { 0xff95, G_UNICODE_NOT_PRESENT_OFFSET, 8575 },
-  { 0xff96, G_UNICODE_NOT_PRESENT_OFFSET, 8579 },
-  { 0xff97, G_UNICODE_NOT_PRESENT_OFFSET, 8583 },
-  { 0xff98, G_UNICODE_NOT_PRESENT_OFFSET, 8587 },
-  { 0xff99, G_UNICODE_NOT_PRESENT_OFFSET, 8591 },
-  { 0xff9a, G_UNICODE_NOT_PRESENT_OFFSET, 8595 },
-  { 0xff9b, G_UNICODE_NOT_PRESENT_OFFSET, 8599 },
-  { 0xff9c, G_UNICODE_NOT_PRESENT_OFFSET, 8603 },
-  { 0xff9d, G_UNICODE_NOT_PRESENT_OFFSET, 14149 },
-  { 0xff9e, G_UNICODE_NOT_PRESENT_OFFSET, 14153 },
-  { 0xff9f, G_UNICODE_NOT_PRESENT_OFFSET, 14157 },
-  { 0xffa0, G_UNICODE_NOT_PRESENT_OFFSET, 7405 },
-  { 0xffa1, G_UNICODE_NOT_PRESENT_OFFSET, 7201 },
-  { 0xffa2, G_UNICODE_NOT_PRESENT_OFFSET, 7205 },
-  { 0xffa3, G_UNICODE_NOT_PRESENT_OFFSET, 7209 },
-  { 0xffa4, G_UNICODE_NOT_PRESENT_OFFSET, 7213 },
-  { 0xffa5, G_UNICODE_NOT_PRESENT_OFFSET, 7217 },
-  { 0xffa6, G_UNICODE_NOT_PRESENT_OFFSET, 7221 },
-  { 0xffa7, G_UNICODE_NOT_PRESENT_OFFSET, 7225 },
-  { 0xffa8, G_UNICODE_NOT_PRESENT_OFFSET, 7229 },
-  { 0xffa9, G_UNICODE_NOT_PRESENT_OFFSET, 7233 },
-  { 0xffaa, G_UNICODE_NOT_PRESENT_OFFSET, 7237 },
-  { 0xffab, G_UNICODE_NOT_PRESENT_OFFSET, 7241 },
-  { 0xffac, G_UNICODE_NOT_PRESENT_OFFSET, 7245 },
-  { 0xffad, G_UNICODE_NOT_PRESENT_OFFSET, 7249 },
-  { 0xffae, G_UNICODE_NOT_PRESENT_OFFSET, 7253 },
-  { 0xffaf, G_UNICODE_NOT_PRESENT_OFFSET, 7257 },
-  { 0xffb0, G_UNICODE_NOT_PRESENT_OFFSET, 7261 },
-  { 0xffb1, G_UNICODE_NOT_PRESENT_OFFSET, 7265 },
-  { 0xffb2, G_UNICODE_NOT_PRESENT_OFFSET, 7269 },
-  { 0xffb3, G_UNICODE_NOT_PRESENT_OFFSET, 7273 },
-  { 0xffb4, G_UNICODE_NOT_PRESENT_OFFSET, 7277 },
-  { 0xffb5, G_UNICODE_NOT_PRESENT_OFFSET, 7281 },
-  { 0xffb6, G_UNICODE_NOT_PRESENT_OFFSET, 7285 },
-  { 0xffb7, G_UNICODE_NOT_PRESENT_OFFSET, 7289 },
-  { 0xffb8, G_UNICODE_NOT_PRESENT_OFFSET, 7293 },
-  { 0xffb9, G_UNICODE_NOT_PRESENT_OFFSET, 7297 },
-  { 0xffba, G_UNICODE_NOT_PRESENT_OFFSET, 7301 },
-  { 0xffbb, G_UNICODE_NOT_PRESENT_OFFSET, 7305 },
-  { 0xffbc, G_UNICODE_NOT_PRESENT_OFFSET, 7309 },
-  { 0xffbd, G_UNICODE_NOT_PRESENT_OFFSET, 7313 },
-  { 0xffbe, G_UNICODE_NOT_PRESENT_OFFSET, 7317 },
-  { 0xffc2, G_UNICODE_NOT_PRESENT_OFFSET, 7321 },
-  { 0xffc3, G_UNICODE_NOT_PRESENT_OFFSET, 7325 },
-  { 0xffc4, G_UNICODE_NOT_PRESENT_OFFSET, 7329 },
-  { 0xffc5, G_UNICODE_NOT_PRESENT_OFFSET, 7333 },
-  { 0xffc6, G_UNICODE_NOT_PRESENT_OFFSET, 7337 },
-  { 0xffc7, G_UNICODE_NOT_PRESENT_OFFSET, 7341 },
-  { 0xffca, G_UNICODE_NOT_PRESENT_OFFSET, 7345 },
-  { 0xffcb, G_UNICODE_NOT_PRESENT_OFFSET, 7349 },
-  { 0xffcc, G_UNICODE_NOT_PRESENT_OFFSET, 7353 },
-  { 0xffcd, G_UNICODE_NOT_PRESENT_OFFSET, 7357 },
-  { 0xffce, G_UNICODE_NOT_PRESENT_OFFSET, 7361 },
-  { 0xffcf, G_UNICODE_NOT_PRESENT_OFFSET, 7365 },
-  { 0xffd2, G_UNICODE_NOT_PRESENT_OFFSET, 7369 },
-  { 0xffd3, G_UNICODE_NOT_PRESENT_OFFSET, 7373 },
-  { 0xffd4, G_UNICODE_NOT_PRESENT_OFFSET, 7377 },
-  { 0xffd5, G_UNICODE_NOT_PRESENT_OFFSET, 7381 },
-  { 0xffd6, G_UNICODE_NOT_PRESENT_OFFSET, 7385 },
-  { 0xffd7, G_UNICODE_NOT_PRESENT_OFFSET, 7389 },
-  { 0xffda, G_UNICODE_NOT_PRESENT_OFFSET, 7393 },
-  { 0xffdb, G_UNICODE_NOT_PRESENT_OFFSET, 7397 },
-  { 0xffdc, G_UNICODE_NOT_PRESENT_OFFSET, 7401 },
-  { 0xffe0, G_UNICODE_NOT_PRESENT_OFFSET, 14161 },
-  { 0xffe1, G_UNICODE_NOT_PRESENT_OFFSET, 14164 },
-  { 0xffe2, G_UNICODE_NOT_PRESENT_OFFSET, 14167 },
-  { 0xffe3, G_UNICODE_NOT_PRESENT_OFFSET, 8 },
-  { 0xffe4, G_UNICODE_NOT_PRESENT_OFFSET, 14170 },
-  { 0xffe5, G_UNICODE_NOT_PRESENT_OFFSET, 14173 },
-  { 0xffe6, G_UNICODE_NOT_PRESENT_OFFSET, 14176 },
-  { 0xffe8, G_UNICODE_NOT_PRESENT_OFFSET, 14180 },
-  { 0xffe9, G_UNICODE_NOT_PRESENT_OFFSET, 14184 },
-  { 0xffea, G_UNICODE_NOT_PRESENT_OFFSET, 14188 },
-  { 0xffeb, G_UNICODE_NOT_PRESENT_OFFSET, 14192 },
-  { 0xffec, G_UNICODE_NOT_PRESENT_OFFSET, 14196 },
-  { 0xffed, G_UNICODE_NOT_PRESENT_OFFSET, 14200 },
-  { 0xffee, G_UNICODE_NOT_PRESENT_OFFSET, 14204 },
-  { 0x1d15e, 14208, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1d15f, 14217, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1d160, 14226, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1d161, 14239, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1d162, 14252, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1d163, 14265, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1d164, 14278, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1d1bb, 14291, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1d1bc, 14300, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1d1bd, 14309, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1d1be, 14322, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1d1bf, 14335, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1d1c0, 14348, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x1d400, G_UNICODE_NOT_PRESENT_OFFSET, 5831 },
-  { 0x1d401, G_UNICODE_NOT_PRESENT_OFFSET, 5042 },
-  { 0x1d402, G_UNICODE_NOT_PRESENT_OFFSET, 4982 },
-  { 0x1d403, G_UNICODE_NOT_PRESENT_OFFSET, 5077 },
-  { 0x1d404, G_UNICODE_NOT_PRESENT_OFFSET, 5046 },
-  { 0x1d405, G_UNICODE_NOT_PRESENT_OFFSET, 5048 },
-  { 0x1d406, G_UNICODE_NOT_PRESENT_OFFSET, 5833 },
-  { 0x1d407, G_UNICODE_NOT_PRESENT_OFFSET, 5005 },
-  { 0x1d408, G_UNICODE_NOT_PRESENT_OFFSET, 5010 },
-  { 0x1d409, G_UNICODE_NOT_PRESENT_OFFSET, 5835 },
-  { 0x1d40a, G_UNICODE_NOT_PRESENT_OFFSET, 5040 },
-  { 0x1d40b, G_UNICODE_NOT_PRESENT_OFFSET, 5012 },
-  { 0x1d40c, G_UNICODE_NOT_PRESENT_OFFSET, 5050 },
-  { 0x1d40d, G_UNICODE_NOT_PRESENT_OFFSET, 5014 },
-  { 0x1d40e, G_UNICODE_NOT_PRESENT_OFFSET, 5837 },
-  { 0x1d40f, G_UNICODE_NOT_PRESENT_OFFSET, 5019 },
-  { 0x1d410, G_UNICODE_NOT_PRESENT_OFFSET, 5021 },
-  { 0x1d411, G_UNICODE_NOT_PRESENT_OFFSET, 5023 },
-  { 0x1d412, G_UNICODE_NOT_PRESENT_OFFSET, 5839 },
-  { 0x1d413, G_UNICODE_NOT_PRESENT_OFFSET, 5841 },
-  { 0x1d414, G_UNICODE_NOT_PRESENT_OFFSET, 5843 },
-  { 0x1d415, G_UNICODE_NOT_PRESENT_OFFSET, 5168 },
-  { 0x1d416, G_UNICODE_NOT_PRESENT_OFFSET, 5845 },
-  { 0x1d417, G_UNICODE_NOT_PRESENT_OFFSET, 5185 },
-  { 0x1d418, G_UNICODE_NOT_PRESENT_OFFSET, 5847 },
-  { 0x1d419, G_UNICODE_NOT_PRESENT_OFFSET, 5035 },
-  { 0x1d41a, G_UNICODE_NOT_PRESENT_OFFSET, 6 },
-  { 0x1d41b, G_UNICODE_NOT_PRESENT_OFFSET, 5849 },
-  { 0x1d41c, G_UNICODE_NOT_PRESENT_OFFSET, 5228 },
-  { 0x1d41d, G_UNICODE_NOT_PRESENT_OFFSET, 5079 },
-  { 0x1d41e, G_UNICODE_NOT_PRESENT_OFFSET, 5044 },
-  { 0x1d41f, G_UNICODE_NOT_PRESENT_OFFSET, 5851 },
-  { 0x1d420, G_UNICODE_NOT_PRESENT_OFFSET, 5003 },
-  { 0x1d421, G_UNICODE_NOT_PRESENT_OFFSET, 1171 },
-  { 0x1d422, G_UNICODE_NOT_PRESENT_OFFSET, 4943 },
-  { 0x1d423, G_UNICODE_NOT_PRESENT_OFFSET, 1176 },
-  { 0x1d424, G_UNICODE_NOT_PRESENT_OFFSET, 5853 },
-  { 0x1d425, G_UNICODE_NOT_PRESENT_OFFSET, 1220 },
-  { 0x1d426, G_UNICODE_NOT_PRESENT_OFFSET, 5230 },
-  { 0x1d427, G_UNICODE_NOT_PRESENT_OFFSET, 4969 },
-  { 0x1d428, G_UNICODE_NOT_PRESENT_OFFSET, 29 },
-  { 0x1d429, G_UNICODE_NOT_PRESENT_OFFSET, 5855 },
-  { 0x1d42a, G_UNICODE_NOT_PRESENT_OFFSET, 5857 },
-  { 0x1d42b, G_UNICODE_NOT_PRESENT_OFFSET, 1178 },
-  { 0x1d42c, G_UNICODE_NOT_PRESENT_OFFSET, 711 },
-  { 0x1d42d, G_UNICODE_NOT_PRESENT_OFFSET, 5859 },
-  { 0x1d42e, G_UNICODE_NOT_PRESENT_OFFSET, 5861 },
-  { 0x1d42f, G_UNICODE_NOT_PRESENT_OFFSET, 5204 },
-  { 0x1d430, G_UNICODE_NOT_PRESENT_OFFSET, 1189 },
-  { 0x1d431, G_UNICODE_NOT_PRESENT_OFFSET, 1222 },
-  { 0x1d432, G_UNICODE_NOT_PRESENT_OFFSET, 1191 },
-  { 0x1d433, G_UNICODE_NOT_PRESENT_OFFSET, 5863 },
-  { 0x1d434, G_UNICODE_NOT_PRESENT_OFFSET, 5831 },
-  { 0x1d435, G_UNICODE_NOT_PRESENT_OFFSET, 5042 },
-  { 0x1d436, G_UNICODE_NOT_PRESENT_OFFSET, 4982 },
-  { 0x1d437, G_UNICODE_NOT_PRESENT_OFFSET, 5077 },
-  { 0x1d438, G_UNICODE_NOT_PRESENT_OFFSET, 5046 },
-  { 0x1d439, G_UNICODE_NOT_PRESENT_OFFSET, 5048 },
-  { 0x1d43a, G_UNICODE_NOT_PRESENT_OFFSET, 5833 },
-  { 0x1d43b, G_UNICODE_NOT_PRESENT_OFFSET, 5005 },
-  { 0x1d43c, G_UNICODE_NOT_PRESENT_OFFSET, 5010 },
-  { 0x1d43d, G_UNICODE_NOT_PRESENT_OFFSET, 5835 },
-  { 0x1d43e, G_UNICODE_NOT_PRESENT_OFFSET, 5040 },
-  { 0x1d43f, G_UNICODE_NOT_PRESENT_OFFSET, 5012 },
-  { 0x1d440, G_UNICODE_NOT_PRESENT_OFFSET, 5050 },
-  { 0x1d441, G_UNICODE_NOT_PRESENT_OFFSET, 5014 },
-  { 0x1d442, G_UNICODE_NOT_PRESENT_OFFSET, 5837 },
-  { 0x1d443, G_UNICODE_NOT_PRESENT_OFFSET, 5019 },
-  { 0x1d444, G_UNICODE_NOT_PRESENT_OFFSET, 5021 },
-  { 0x1d445, G_UNICODE_NOT_PRESENT_OFFSET, 5023 },
-  { 0x1d446, G_UNICODE_NOT_PRESENT_OFFSET, 5839 },
-  { 0x1d447, G_UNICODE_NOT_PRESENT_OFFSET, 5841 },
-  { 0x1d448, G_UNICODE_NOT_PRESENT_OFFSET, 5843 },
-  { 0x1d449, G_UNICODE_NOT_PRESENT_OFFSET, 5168 },
-  { 0x1d44a, G_UNICODE_NOT_PRESENT_OFFSET, 5845 },
-  { 0x1d44b, G_UNICODE_NOT_PRESENT_OFFSET, 5185 },
-  { 0x1d44c, G_UNICODE_NOT_PRESENT_OFFSET, 5847 },
-  { 0x1d44d, G_UNICODE_NOT_PRESENT_OFFSET, 5035 },
-  { 0x1d44e, G_UNICODE_NOT_PRESENT_OFFSET, 6 },
-  { 0x1d44f, G_UNICODE_NOT_PRESENT_OFFSET, 5849 },
-  { 0x1d450, G_UNICODE_NOT_PRESENT_OFFSET, 5228 },
-  { 0x1d451, G_UNICODE_NOT_PRESENT_OFFSET, 5079 },
-  { 0x1d452, G_UNICODE_NOT_PRESENT_OFFSET, 5044 },
-  { 0x1d453, G_UNICODE_NOT_PRESENT_OFFSET, 5851 },
-  { 0x1d454, G_UNICODE_NOT_PRESENT_OFFSET, 5003 },
-  { 0x1d456, G_UNICODE_NOT_PRESENT_OFFSET, 4943 },
-  { 0x1d457, G_UNICODE_NOT_PRESENT_OFFSET, 1176 },
-  { 0x1d458, G_UNICODE_NOT_PRESENT_OFFSET, 5853 },
-  { 0x1d459, G_UNICODE_NOT_PRESENT_OFFSET, 1220 },
-  { 0x1d45a, G_UNICODE_NOT_PRESENT_OFFSET, 5230 },
-  { 0x1d45b, G_UNICODE_NOT_PRESENT_OFFSET, 4969 },
-  { 0x1d45c, G_UNICODE_NOT_PRESENT_OFFSET, 29 },
-  { 0x1d45d, G_UNICODE_NOT_PRESENT_OFFSET, 5855 },
-  { 0x1d45e, G_UNICODE_NOT_PRESENT_OFFSET, 5857 },
-  { 0x1d45f, G_UNICODE_NOT_PRESENT_OFFSET, 1178 },
-  { 0x1d460, G_UNICODE_NOT_PRESENT_OFFSET, 711 },
-  { 0x1d461, G_UNICODE_NOT_PRESENT_OFFSET, 5859 },
-  { 0x1d462, G_UNICODE_NOT_PRESENT_OFFSET, 5861 },
-  { 0x1d463, G_UNICODE_NOT_PRESENT_OFFSET, 5204 },
-  { 0x1d464, G_UNICODE_NOT_PRESENT_OFFSET, 1189 },
-  { 0x1d465, G_UNICODE_NOT_PRESENT_OFFSET, 1222 },
-  { 0x1d466, G_UNICODE_NOT_PRESENT_OFFSET, 1191 },
-  { 0x1d467, G_UNICODE_NOT_PRESENT_OFFSET, 5863 },
-  { 0x1d468, G_UNICODE_NOT_PRESENT_OFFSET, 5831 },
-  { 0x1d469, G_UNICODE_NOT_PRESENT_OFFSET, 5042 },
-  { 0x1d46a, G_UNICODE_NOT_PRESENT_OFFSET, 4982 },
-  { 0x1d46b, G_UNICODE_NOT_PRESENT_OFFSET, 5077 },
-  { 0x1d46c, G_UNICODE_NOT_PRESENT_OFFSET, 5046 },
-  { 0x1d46d, G_UNICODE_NOT_PRESENT_OFFSET, 5048 },
-  { 0x1d46e, G_UNICODE_NOT_PRESENT_OFFSET, 5833 },
-  { 0x1d46f, G_UNICODE_NOT_PRESENT_OFFSET, 5005 },
-  { 0x1d470, G_UNICODE_NOT_PRESENT_OFFSET, 5010 },
-  { 0x1d471, G_UNICODE_NOT_PRESENT_OFFSET, 5835 },
-  { 0x1d472, G_UNICODE_NOT_PRESENT_OFFSET, 5040 },
-  { 0x1d473, G_UNICODE_NOT_PRESENT_OFFSET, 5012 },
-  { 0x1d474, G_UNICODE_NOT_PRESENT_OFFSET, 5050 },
-  { 0x1d475, G_UNICODE_NOT_PRESENT_OFFSET, 5014 },
-  { 0x1d476, G_UNICODE_NOT_PRESENT_OFFSET, 5837 },
-  { 0x1d477, G_UNICODE_NOT_PRESENT_OFFSET, 5019 },
-  { 0x1d478, G_UNICODE_NOT_PRESENT_OFFSET, 5021 },
-  { 0x1d479, G_UNICODE_NOT_PRESENT_OFFSET, 5023 },
-  { 0x1d47a, G_UNICODE_NOT_PRESENT_OFFSET, 5839 },
-  { 0x1d47b, G_UNICODE_NOT_PRESENT_OFFSET, 5841 },
-  { 0x1d47c, G_UNICODE_NOT_PRESENT_OFFSET, 5843 },
-  { 0x1d47d, G_UNICODE_NOT_PRESENT_OFFSET, 5168 },
-  { 0x1d47e, G_UNICODE_NOT_PRESENT_OFFSET, 5845 },
-  { 0x1d47f, G_UNICODE_NOT_PRESENT_OFFSET, 5185 },
-  { 0x1d480, G_UNICODE_NOT_PRESENT_OFFSET, 5847 },
-  { 0x1d481, G_UNICODE_NOT_PRESENT_OFFSET, 5035 },
-  { 0x1d482, G_UNICODE_NOT_PRESENT_OFFSET, 6 },
-  { 0x1d483, G_UNICODE_NOT_PRESENT_OFFSET, 5849 },
-  { 0x1d484, G_UNICODE_NOT_PRESENT_OFFSET, 5228 },
-  { 0x1d485, G_UNICODE_NOT_PRESENT_OFFSET, 5079 },
-  { 0x1d486, G_UNICODE_NOT_PRESENT_OFFSET, 5044 },
-  { 0x1d487, G_UNICODE_NOT_PRESENT_OFFSET, 5851 },
-  { 0x1d488, G_UNICODE_NOT_PRESENT_OFFSET, 5003 },
-  { 0x1d489, G_UNICODE_NOT_PRESENT_OFFSET, 1171 },
-  { 0x1d48a, G_UNICODE_NOT_PRESENT_OFFSET, 4943 },
-  { 0x1d48b, G_UNICODE_NOT_PRESENT_OFFSET, 1176 },
-  { 0x1d48c, G_UNICODE_NOT_PRESENT_OFFSET, 5853 },
-  { 0x1d48d, G_UNICODE_NOT_PRESENT_OFFSET, 1220 },
-  { 0x1d48e, G_UNICODE_NOT_PRESENT_OFFSET, 5230 },
-  { 0x1d48f, G_UNICODE_NOT_PRESENT_OFFSET, 4969 },
-  { 0x1d490, G_UNICODE_NOT_PRESENT_OFFSET, 29 },
-  { 0x1d491, G_UNICODE_NOT_PRESENT_OFFSET, 5855 },
-  { 0x1d492, G_UNICODE_NOT_PRESENT_OFFSET, 5857 },
-  { 0x1d493, G_UNICODE_NOT_PRESENT_OFFSET, 1178 },
-  { 0x1d494, G_UNICODE_NOT_PRESENT_OFFSET, 711 },
-  { 0x1d495, G_UNICODE_NOT_PRESENT_OFFSET, 5859 },
-  { 0x1d496, G_UNICODE_NOT_PRESENT_OFFSET, 5861 },
-  { 0x1d497, G_UNICODE_NOT_PRESENT_OFFSET, 5204 },
-  { 0x1d498, G_UNICODE_NOT_PRESENT_OFFSET, 1189 },
-  { 0x1d499, G_UNICODE_NOT_PRESENT_OFFSET, 1222 },
-  { 0x1d49a, G_UNICODE_NOT_PRESENT_OFFSET, 1191 },
-  { 0x1d49b, G_UNICODE_NOT_PRESENT_OFFSET, 5863 },
-  { 0x1d49c, G_UNICODE_NOT_PRESENT_OFFSET, 5831 },
-  { 0x1d49e, G_UNICODE_NOT_PRESENT_OFFSET, 4982 },
-  { 0x1d49f, G_UNICODE_NOT_PRESENT_OFFSET, 5077 },
-  { 0x1d4a2, G_UNICODE_NOT_PRESENT_OFFSET, 5833 },
-  { 0x1d4a5, G_UNICODE_NOT_PRESENT_OFFSET, 5835 },
-  { 0x1d4a6, G_UNICODE_NOT_PRESENT_OFFSET, 5040 },
-  { 0x1d4a9, G_UNICODE_NOT_PRESENT_OFFSET, 5014 },
-  { 0x1d4aa, G_UNICODE_NOT_PRESENT_OFFSET, 5837 },
-  { 0x1d4ab, G_UNICODE_NOT_PRESENT_OFFSET, 5019 },
-  { 0x1d4ac, G_UNICODE_NOT_PRESENT_OFFSET, 5021 },
-  { 0x1d4ae, G_UNICODE_NOT_PRESENT_OFFSET, 5839 },
-  { 0x1d4af, G_UNICODE_NOT_PRESENT_OFFSET, 5841 },
-  { 0x1d4b0, G_UNICODE_NOT_PRESENT_OFFSET, 5843 },
-  { 0x1d4b1, G_UNICODE_NOT_PRESENT_OFFSET, 5168 },
-  { 0x1d4b2, G_UNICODE_NOT_PRESENT_OFFSET, 5845 },
-  { 0x1d4b3, G_UNICODE_NOT_PRESENT_OFFSET, 5185 },
-  { 0x1d4b4, G_UNICODE_NOT_PRESENT_OFFSET, 5847 },
-  { 0x1d4b5, G_UNICODE_NOT_PRESENT_OFFSET, 5035 },
-  { 0x1d4b6, G_UNICODE_NOT_PRESENT_OFFSET, 6 },
-  { 0x1d4b7, G_UNICODE_NOT_PRESENT_OFFSET, 5849 },
-  { 0x1d4b8, G_UNICODE_NOT_PRESENT_OFFSET, 5228 },
-  { 0x1d4b9, G_UNICODE_NOT_PRESENT_OFFSET, 5079 },
-  { 0x1d4bb, G_UNICODE_NOT_PRESENT_OFFSET, 5851 },
-  { 0x1d4bd, G_UNICODE_NOT_PRESENT_OFFSET, 1171 },
-  { 0x1d4be, G_UNICODE_NOT_PRESENT_OFFSET, 4943 },
-  { 0x1d4bf, G_UNICODE_NOT_PRESENT_OFFSET, 1176 },
-  { 0x1d4c0, G_UNICODE_NOT_PRESENT_OFFSET, 5853 },
-  { 0x1d4c2, G_UNICODE_NOT_PRESENT_OFFSET, 5230 },
-  { 0x1d4c3, G_UNICODE_NOT_PRESENT_OFFSET, 4969 },
-  { 0x1d4c5, G_UNICODE_NOT_PRESENT_OFFSET, 5855 },
-  { 0x1d4c6, G_UNICODE_NOT_PRESENT_OFFSET, 5857 },
-  { 0x1d4c7, G_UNICODE_NOT_PRESENT_OFFSET, 1178 },
-  { 0x1d4c8, G_UNICODE_NOT_PRESENT_OFFSET, 711 },
-  { 0x1d4c9, G_UNICODE_NOT_PRESENT_OFFSET, 5859 },
-  { 0x1d4ca, G_UNICODE_NOT_PRESENT_OFFSET, 5861 },
-  { 0x1d4cb, G_UNICODE_NOT_PRESENT_OFFSET, 5204 },
-  { 0x1d4cc, G_UNICODE_NOT_PRESENT_OFFSET, 1189 },
-  { 0x1d4cd, G_UNICODE_NOT_PRESENT_OFFSET, 1222 },
-  { 0x1d4ce, G_UNICODE_NOT_PRESENT_OFFSET, 1191 },
-  { 0x1d4cf, G_UNICODE_NOT_PRESENT_OFFSET, 5863 },
-  { 0x1d4d0, G_UNICODE_NOT_PRESENT_OFFSET, 5831 },
-  { 0x1d4d1, G_UNICODE_NOT_PRESENT_OFFSET, 5042 },
-  { 0x1d4d2, G_UNICODE_NOT_PRESENT_OFFSET, 4982 },
-  { 0x1d4d3, G_UNICODE_NOT_PRESENT_OFFSET, 5077 },
-  { 0x1d4d4, G_UNICODE_NOT_PRESENT_OFFSET, 5046 },
-  { 0x1d4d5, G_UNICODE_NOT_PRESENT_OFFSET, 5048 },
-  { 0x1d4d6, G_UNICODE_NOT_PRESENT_OFFSET, 5833 },
-  { 0x1d4d7, G_UNICODE_NOT_PRESENT_OFFSET, 5005 },
-  { 0x1d4d8, G_UNICODE_NOT_PRESENT_OFFSET, 5010 },
-  { 0x1d4d9, G_UNICODE_NOT_PRESENT_OFFSET, 5835 },
-  { 0x1d4da, G_UNICODE_NOT_PRESENT_OFFSET, 5040 },
-  { 0x1d4db, G_UNICODE_NOT_PRESENT_OFFSET, 5012 },
-  { 0x1d4dc, G_UNICODE_NOT_PRESENT_OFFSET, 5050 },
-  { 0x1d4dd, G_UNICODE_NOT_PRESENT_OFFSET, 5014 },
-  { 0x1d4de, G_UNICODE_NOT_PRESENT_OFFSET, 5837 },
-  { 0x1d4df, G_UNICODE_NOT_PRESENT_OFFSET, 5019 },
-  { 0x1d4e0, G_UNICODE_NOT_PRESENT_OFFSET, 5021 },
-  { 0x1d4e1, G_UNICODE_NOT_PRESENT_OFFSET, 5023 },
-  { 0x1d4e2, G_UNICODE_NOT_PRESENT_OFFSET, 5839 },
-  { 0x1d4e3, G_UNICODE_NOT_PRESENT_OFFSET, 5841 },
-  { 0x1d4e4, G_UNICODE_NOT_PRESENT_OFFSET, 5843 },
-  { 0x1d4e5, G_UNICODE_NOT_PRESENT_OFFSET, 5168 },
-  { 0x1d4e6, G_UNICODE_NOT_PRESENT_OFFSET, 5845 },
-  { 0x1d4e7, G_UNICODE_NOT_PRESENT_OFFSET, 5185 },
-  { 0x1d4e8, G_UNICODE_NOT_PRESENT_OFFSET, 5847 },
-  { 0x1d4e9, G_UNICODE_NOT_PRESENT_OFFSET, 5035 },
-  { 0x1d4ea, G_UNICODE_NOT_PRESENT_OFFSET, 6 },
-  { 0x1d4eb, G_UNICODE_NOT_PRESENT_OFFSET, 5849 },
-  { 0x1d4ec, G_UNICODE_NOT_PRESENT_OFFSET, 5228 },
-  { 0x1d4ed, G_UNICODE_NOT_PRESENT_OFFSET, 5079 },
-  { 0x1d4ee, G_UNICODE_NOT_PRESENT_OFFSET, 5044 },
-  { 0x1d4ef, G_UNICODE_NOT_PRESENT_OFFSET, 5851 },
-  { 0x1d4f0, G_UNICODE_NOT_PRESENT_OFFSET, 5003 },
-  { 0x1d4f1, G_UNICODE_NOT_PRESENT_OFFSET, 1171 },
-  { 0x1d4f2, G_UNICODE_NOT_PRESENT_OFFSET, 4943 },
-  { 0x1d4f3, G_UNICODE_NOT_PRESENT_OFFSET, 1176 },
-  { 0x1d4f4, G_UNICODE_NOT_PRESENT_OFFSET, 5853 },
-  { 0x1d4f5, G_UNICODE_NOT_PRESENT_OFFSET, 1220 },
-  { 0x1d4f6, G_UNICODE_NOT_PRESENT_OFFSET, 5230 },
-  { 0x1d4f7, G_UNICODE_NOT_PRESENT_OFFSET, 4969 },
-  { 0x1d4f8, G_UNICODE_NOT_PRESENT_OFFSET, 29 },
-  { 0x1d4f9, G_UNICODE_NOT_PRESENT_OFFSET, 5855 },
-  { 0x1d4fa, G_UNICODE_NOT_PRESENT_OFFSET, 5857 },
-  { 0x1d4fb, G_UNICODE_NOT_PRESENT_OFFSET, 1178 },
-  { 0x1d4fc, G_UNICODE_NOT_PRESENT_OFFSET, 711 },
-  { 0x1d4fd, G_UNICODE_NOT_PRESENT_OFFSET, 5859 },
-  { 0x1d4fe, G_UNICODE_NOT_PRESENT_OFFSET, 5861 },
-  { 0x1d4ff, G_UNICODE_NOT_PRESENT_OFFSET, 5204 },
-  { 0x1d500, G_UNICODE_NOT_PRESENT_OFFSET, 1189 },
-  { 0x1d501, G_UNICODE_NOT_PRESENT_OFFSET, 1222 },
-  { 0x1d502, G_UNICODE_NOT_PRESENT_OFFSET, 1191 },
-  { 0x1d503, G_UNICODE_NOT_PRESENT_OFFSET, 5863 },
-  { 0x1d504, G_UNICODE_NOT_PRESENT_OFFSET, 5831 },
-  { 0x1d505, G_UNICODE_NOT_PRESENT_OFFSET, 5042 },
-  { 0x1d507, G_UNICODE_NOT_PRESENT_OFFSET, 5077 },
-  { 0x1d508, G_UNICODE_NOT_PRESENT_OFFSET, 5046 },
-  { 0x1d509, G_UNICODE_NOT_PRESENT_OFFSET, 5048 },
-  { 0x1d50a, G_UNICODE_NOT_PRESENT_OFFSET, 5833 },
-  { 0x1d50d, G_UNICODE_NOT_PRESENT_OFFSET, 5835 },
-  { 0x1d50e, G_UNICODE_NOT_PRESENT_OFFSET, 5040 },
-  { 0x1d50f, G_UNICODE_NOT_PRESENT_OFFSET, 5012 },
-  { 0x1d510, G_UNICODE_NOT_PRESENT_OFFSET, 5050 },
-  { 0x1d511, G_UNICODE_NOT_PRESENT_OFFSET, 5014 },
-  { 0x1d512, G_UNICODE_NOT_PRESENT_OFFSET, 5837 },
-  { 0x1d513, G_UNICODE_NOT_PRESENT_OFFSET, 5019 },
-  { 0x1d514, G_UNICODE_NOT_PRESENT_OFFSET, 5021 },
-  { 0x1d516, G_UNICODE_NOT_PRESENT_OFFSET, 5839 },
-  { 0x1d517, G_UNICODE_NOT_PRESENT_OFFSET, 5841 },
-  { 0x1d518, G_UNICODE_NOT_PRESENT_OFFSET, 5843 },
-  { 0x1d519, G_UNICODE_NOT_PRESENT_OFFSET, 5168 },
-  { 0x1d51a, G_UNICODE_NOT_PRESENT_OFFSET, 5845 },
-  { 0x1d51b, G_UNICODE_NOT_PRESENT_OFFSET, 5185 },
-  { 0x1d51c, G_UNICODE_NOT_PRESENT_OFFSET, 5847 },
-  { 0x1d51e, G_UNICODE_NOT_PRESENT_OFFSET, 6 },
-  { 0x1d51f, G_UNICODE_NOT_PRESENT_OFFSET, 5849 },
-  { 0x1d520, G_UNICODE_NOT_PRESENT_OFFSET, 5228 },
-  { 0x1d521, G_UNICODE_NOT_PRESENT_OFFSET, 5079 },
-  { 0x1d522, G_UNICODE_NOT_PRESENT_OFFSET, 5044 },
-  { 0x1d523, G_UNICODE_NOT_PRESENT_OFFSET, 5851 },
-  { 0x1d524, G_UNICODE_NOT_PRESENT_OFFSET, 5003 },
-  { 0x1d525, G_UNICODE_NOT_PRESENT_OFFSET, 1171 },
-  { 0x1d526, G_UNICODE_NOT_PRESENT_OFFSET, 4943 },
-  { 0x1d527, G_UNICODE_NOT_PRESENT_OFFSET, 1176 },
-  { 0x1d528, G_UNICODE_NOT_PRESENT_OFFSET, 5853 },
-  { 0x1d529, G_UNICODE_NOT_PRESENT_OFFSET, 1220 },
-  { 0x1d52a, G_UNICODE_NOT_PRESENT_OFFSET, 5230 },
-  { 0x1d52b, G_UNICODE_NOT_PRESENT_OFFSET, 4969 },
-  { 0x1d52c, G_UNICODE_NOT_PRESENT_OFFSET, 29 },
-  { 0x1d52d, G_UNICODE_NOT_PRESENT_OFFSET, 5855 },
-  { 0x1d52e, G_UNICODE_NOT_PRESENT_OFFSET, 5857 },
-  { 0x1d52f, G_UNICODE_NOT_PRESENT_OFFSET, 1178 },
-  { 0x1d530, G_UNICODE_NOT_PRESENT_OFFSET, 711 },
-  { 0x1d531, G_UNICODE_NOT_PRESENT_OFFSET, 5859 },
-  { 0x1d532, G_UNICODE_NOT_PRESENT_OFFSET, 5861 },
-  { 0x1d533, G_UNICODE_NOT_PRESENT_OFFSET, 5204 },
-  { 0x1d534, G_UNICODE_NOT_PRESENT_OFFSET, 1189 },
-  { 0x1d535, G_UNICODE_NOT_PRESENT_OFFSET, 1222 },
-  { 0x1d536, G_UNICODE_NOT_PRESENT_OFFSET, 1191 },
-  { 0x1d537, G_UNICODE_NOT_PRESENT_OFFSET, 5863 },
-  { 0x1d538, G_UNICODE_NOT_PRESENT_OFFSET, 5831 },
-  { 0x1d539, G_UNICODE_NOT_PRESENT_OFFSET, 5042 },
-  { 0x1d53b, G_UNICODE_NOT_PRESENT_OFFSET, 5077 },
-  { 0x1d53c, G_UNICODE_NOT_PRESENT_OFFSET, 5046 },
-  { 0x1d53d, G_UNICODE_NOT_PRESENT_OFFSET, 5048 },
-  { 0x1d53e, G_UNICODE_NOT_PRESENT_OFFSET, 5833 },
-  { 0x1d540, G_UNICODE_NOT_PRESENT_OFFSET, 5010 },
-  { 0x1d541, G_UNICODE_NOT_PRESENT_OFFSET, 5835 },
-  { 0x1d542, G_UNICODE_NOT_PRESENT_OFFSET, 5040 },
-  { 0x1d543, G_UNICODE_NOT_PRESENT_OFFSET, 5012 },
-  { 0x1d544, G_UNICODE_NOT_PRESENT_OFFSET, 5050 },
-  { 0x1d546, G_UNICODE_NOT_PRESENT_OFFSET, 5837 },
-  { 0x1d54a, G_UNICODE_NOT_PRESENT_OFFSET, 5839 },
-  { 0x1d54b, G_UNICODE_NOT_PRESENT_OFFSET, 5841 },
-  { 0x1d54c, G_UNICODE_NOT_PRESENT_OFFSET, 5843 },
-  { 0x1d54d, G_UNICODE_NOT_PRESENT_OFFSET, 5168 },
-  { 0x1d54e, G_UNICODE_NOT_PRESENT_OFFSET, 5845 },
-  { 0x1d54f, G_UNICODE_NOT_PRESENT_OFFSET, 5185 },
-  { 0x1d550, G_UNICODE_NOT_PRESENT_OFFSET, 5847 },
-  { 0x1d552, G_UNICODE_NOT_PRESENT_OFFSET, 6 },
-  { 0x1d553, G_UNICODE_NOT_PRESENT_OFFSET, 5849 },
-  { 0x1d554, G_UNICODE_NOT_PRESENT_OFFSET, 5228 },
-  { 0x1d555, G_UNICODE_NOT_PRESENT_OFFSET, 5079 },
-  { 0x1d556, G_UNICODE_NOT_PRESENT_OFFSET, 5044 },
-  { 0x1d557, G_UNICODE_NOT_PRESENT_OFFSET, 5851 },
-  { 0x1d558, G_UNICODE_NOT_PRESENT_OFFSET, 5003 },
-  { 0x1d559, G_UNICODE_NOT_PRESENT_OFFSET, 1171 },
-  { 0x1d55a, G_UNICODE_NOT_PRESENT_OFFSET, 4943 },
-  { 0x1d55b, G_UNICODE_NOT_PRESENT_OFFSET, 1176 },
-  { 0x1d55c, G_UNICODE_NOT_PRESENT_OFFSET, 5853 },
-  { 0x1d55d, G_UNICODE_NOT_PRESENT_OFFSET, 1220 },
-  { 0x1d55e, G_UNICODE_NOT_PRESENT_OFFSET, 5230 },
-  { 0x1d55f, G_UNICODE_NOT_PRESENT_OFFSET, 4969 },
-  { 0x1d560, G_UNICODE_NOT_PRESENT_OFFSET, 29 },
-  { 0x1d561, G_UNICODE_NOT_PRESENT_OFFSET, 5855 },
-  { 0x1d562, G_UNICODE_NOT_PRESENT_OFFSET, 5857 },
-  { 0x1d563, G_UNICODE_NOT_PRESENT_OFFSET, 1178 },
-  { 0x1d564, G_UNICODE_NOT_PRESENT_OFFSET, 711 },
-  { 0x1d565, G_UNICODE_NOT_PRESENT_OFFSET, 5859 },
-  { 0x1d566, G_UNICODE_NOT_PRESENT_OFFSET, 5861 },
-  { 0x1d567, G_UNICODE_NOT_PRESENT_OFFSET, 5204 },
-  { 0x1d568, G_UNICODE_NOT_PRESENT_OFFSET, 1189 },
-  { 0x1d569, G_UNICODE_NOT_PRESENT_OFFSET, 1222 },
-  { 0x1d56a, G_UNICODE_NOT_PRESENT_OFFSET, 1191 },
-  { 0x1d56b, G_UNICODE_NOT_PRESENT_OFFSET, 5863 },
-  { 0x1d56c, G_UNICODE_NOT_PRESENT_OFFSET, 5831 },
-  { 0x1d56d, G_UNICODE_NOT_PRESENT_OFFSET, 5042 },
-  { 0x1d56e, G_UNICODE_NOT_PRESENT_OFFSET, 4982 },
-  { 0x1d56f, G_UNICODE_NOT_PRESENT_OFFSET, 5077 },
-  { 0x1d570, G_UNICODE_NOT_PRESENT_OFFSET, 5046 },
-  { 0x1d571, G_UNICODE_NOT_PRESENT_OFFSET, 5048 },
-  { 0x1d572, G_UNICODE_NOT_PRESENT_OFFSET, 5833 },
-  { 0x1d573, G_UNICODE_NOT_PRESENT_OFFSET, 5005 },
-  { 0x1d574, G_UNICODE_NOT_PRESENT_OFFSET, 5010 },
-  { 0x1d575, G_UNICODE_NOT_PRESENT_OFFSET, 5835 },
-  { 0x1d576, G_UNICODE_NOT_PRESENT_OFFSET, 5040 },
-  { 0x1d577, G_UNICODE_NOT_PRESENT_OFFSET, 5012 },
-  { 0x1d578, G_UNICODE_NOT_PRESENT_OFFSET, 5050 },
-  { 0x1d579, G_UNICODE_NOT_PRESENT_OFFSET, 5014 },
-  { 0x1d57a, G_UNICODE_NOT_PRESENT_OFFSET, 5837 },
-  { 0x1d57b, G_UNICODE_NOT_PRESENT_OFFSET, 5019 },
-  { 0x1d57c, G_UNICODE_NOT_PRESENT_OFFSET, 5021 },
-  { 0x1d57d, G_UNICODE_NOT_PRESENT_OFFSET, 5023 },
-  { 0x1d57e, G_UNICODE_NOT_PRESENT_OFFSET, 5839 },
-  { 0x1d57f, G_UNICODE_NOT_PRESENT_OFFSET, 5841 },
-  { 0x1d580, G_UNICODE_NOT_PRESENT_OFFSET, 5843 },
-  { 0x1d581, G_UNICODE_NOT_PRESENT_OFFSET, 5168 },
-  { 0x1d582, G_UNICODE_NOT_PRESENT_OFFSET, 5845 },
-  { 0x1d583, G_UNICODE_NOT_PRESENT_OFFSET, 5185 },
-  { 0x1d584, G_UNICODE_NOT_PRESENT_OFFSET, 5847 },
-  { 0x1d585, G_UNICODE_NOT_PRESENT_OFFSET, 5035 },
-  { 0x1d586, G_UNICODE_NOT_PRESENT_OFFSET, 6 },
-  { 0x1d587, G_UNICODE_NOT_PRESENT_OFFSET, 5849 },
-  { 0x1d588, G_UNICODE_NOT_PRESENT_OFFSET, 5228 },
-  { 0x1d589, G_UNICODE_NOT_PRESENT_OFFSET, 5079 },
-  { 0x1d58a, G_UNICODE_NOT_PRESENT_OFFSET, 5044 },
-  { 0x1d58b, G_UNICODE_NOT_PRESENT_OFFSET, 5851 },
-  { 0x1d58c, G_UNICODE_NOT_PRESENT_OFFSET, 5003 },
-  { 0x1d58d, G_UNICODE_NOT_PRESENT_OFFSET, 1171 },
-  { 0x1d58e, G_UNICODE_NOT_PRESENT_OFFSET, 4943 },
-  { 0x1d58f, G_UNICODE_NOT_PRESENT_OFFSET, 1176 },
-  { 0x1d590, G_UNICODE_NOT_PRESENT_OFFSET, 5853 },
-  { 0x1d591, G_UNICODE_NOT_PRESENT_OFFSET, 1220 },
-  { 0x1d592, G_UNICODE_NOT_PRESENT_OFFSET, 5230 },
-  { 0x1d593, G_UNICODE_NOT_PRESENT_OFFSET, 4969 },
-  { 0x1d594, G_UNICODE_NOT_PRESENT_OFFSET, 29 },
-  { 0x1d595, G_UNICODE_NOT_PRESENT_OFFSET, 5855 },
-  { 0x1d596, G_UNICODE_NOT_PRESENT_OFFSET, 5857 },
-  { 0x1d597, G_UNICODE_NOT_PRESENT_OFFSET, 1178 },
-  { 0x1d598, G_UNICODE_NOT_PRESENT_OFFSET, 711 },
-  { 0x1d599, G_UNICODE_NOT_PRESENT_OFFSET, 5859 },
-  { 0x1d59a, G_UNICODE_NOT_PRESENT_OFFSET, 5861 },
-  { 0x1d59b, G_UNICODE_NOT_PRESENT_OFFSET, 5204 },
-  { 0x1d59c, G_UNICODE_NOT_PRESENT_OFFSET, 1189 },
-  { 0x1d59d, G_UNICODE_NOT_PRESENT_OFFSET, 1222 },
-  { 0x1d59e, G_UNICODE_NOT_PRESENT_OFFSET, 1191 },
-  { 0x1d59f, G_UNICODE_NOT_PRESENT_OFFSET, 5863 },
-  { 0x1d5a0, G_UNICODE_NOT_PRESENT_OFFSET, 5831 },
-  { 0x1d5a1, G_UNICODE_NOT_PRESENT_OFFSET, 5042 },
-  { 0x1d5a2, G_UNICODE_NOT_PRESENT_OFFSET, 4982 },
-  { 0x1d5a3, G_UNICODE_NOT_PRESENT_OFFSET, 5077 },
-  { 0x1d5a4, G_UNICODE_NOT_PRESENT_OFFSET, 5046 },
-  { 0x1d5a5, G_UNICODE_NOT_PRESENT_OFFSET, 5048 },
-  { 0x1d5a6, G_UNICODE_NOT_PRESENT_OFFSET, 5833 },
-  { 0x1d5a7, G_UNICODE_NOT_PRESENT_OFFSET, 5005 },
-  { 0x1d5a8, G_UNICODE_NOT_PRESENT_OFFSET, 5010 },
-  { 0x1d5a9, G_UNICODE_NOT_PRESENT_OFFSET, 5835 },
-  { 0x1d5aa, G_UNICODE_NOT_PRESENT_OFFSET, 5040 },
-  { 0x1d5ab, G_UNICODE_NOT_PRESENT_OFFSET, 5012 },
-  { 0x1d5ac, G_UNICODE_NOT_PRESENT_OFFSET, 5050 },
-  { 0x1d5ad, G_UNICODE_NOT_PRESENT_OFFSET, 5014 },
-  { 0x1d5ae, G_UNICODE_NOT_PRESENT_OFFSET, 5837 },
-  { 0x1d5af, G_UNICODE_NOT_PRESENT_OFFSET, 5019 },
-  { 0x1d5b0, G_UNICODE_NOT_PRESENT_OFFSET, 5021 },
-  { 0x1d5b1, G_UNICODE_NOT_PRESENT_OFFSET, 5023 },
-  { 0x1d5b2, G_UNICODE_NOT_PRESENT_OFFSET, 5839 },
-  { 0x1d5b3, G_UNICODE_NOT_PRESENT_OFFSET, 5841 },
-  { 0x1d5b4, G_UNICODE_NOT_PRESENT_OFFSET, 5843 },
-  { 0x1d5b5, G_UNICODE_NOT_PRESENT_OFFSET, 5168 },
-  { 0x1d5b6, G_UNICODE_NOT_PRESENT_OFFSET, 5845 },
-  { 0x1d5b7, G_UNICODE_NOT_PRESENT_OFFSET, 5185 },
-  { 0x1d5b8, G_UNICODE_NOT_PRESENT_OFFSET, 5847 },
-  { 0x1d5b9, G_UNICODE_NOT_PRESENT_OFFSET, 5035 },
-  { 0x1d5ba, G_UNICODE_NOT_PRESENT_OFFSET, 6 },
-  { 0x1d5bb, G_UNICODE_NOT_PRESENT_OFFSET, 5849 },
-  { 0x1d5bc, G_UNICODE_NOT_PRESENT_OFFSET, 5228 },
-  { 0x1d5bd, G_UNICODE_NOT_PRESENT_OFFSET, 5079 },
-  { 0x1d5be, G_UNICODE_NOT_PRESENT_OFFSET, 5044 },
-  { 0x1d5bf, G_UNICODE_NOT_PRESENT_OFFSET, 5851 },
-  { 0x1d5c0, G_UNICODE_NOT_PRESENT_OFFSET, 5003 },
-  { 0x1d5c1, G_UNICODE_NOT_PRESENT_OFFSET, 1171 },
-  { 0x1d5c2, G_UNICODE_NOT_PRESENT_OFFSET, 4943 },
-  { 0x1d5c3, G_UNICODE_NOT_PRESENT_OFFSET, 1176 },
-  { 0x1d5c4, G_UNICODE_NOT_PRESENT_OFFSET, 5853 },
-  { 0x1d5c5, G_UNICODE_NOT_PRESENT_OFFSET, 1220 },
-  { 0x1d5c6, G_UNICODE_NOT_PRESENT_OFFSET, 5230 },
-  { 0x1d5c7, G_UNICODE_NOT_PRESENT_OFFSET, 4969 },
-  { 0x1d5c8, G_UNICODE_NOT_PRESENT_OFFSET, 29 },
-  { 0x1d5c9, G_UNICODE_NOT_PRESENT_OFFSET, 5855 },
-  { 0x1d5ca, G_UNICODE_NOT_PRESENT_OFFSET, 5857 },
-  { 0x1d5cb, G_UNICODE_NOT_PRESENT_OFFSET, 1178 },
-  { 0x1d5cc, G_UNICODE_NOT_PRESENT_OFFSET, 711 },
-  { 0x1d5cd, G_UNICODE_NOT_PRESENT_OFFSET, 5859 },
-  { 0x1d5ce, G_UNICODE_NOT_PRESENT_OFFSET, 5861 },
-  { 0x1d5cf, G_UNICODE_NOT_PRESENT_OFFSET, 5204 },
-  { 0x1d5d0, G_UNICODE_NOT_PRESENT_OFFSET, 1189 },
-  { 0x1d5d1, G_UNICODE_NOT_PRESENT_OFFSET, 1222 },
-  { 0x1d5d2, G_UNICODE_NOT_PRESENT_OFFSET, 1191 },
-  { 0x1d5d3, G_UNICODE_NOT_PRESENT_OFFSET, 5863 },
-  { 0x1d5d4, G_UNICODE_NOT_PRESENT_OFFSET, 5831 },
-  { 0x1d5d5, G_UNICODE_NOT_PRESENT_OFFSET, 5042 },
-  { 0x1d5d6, G_UNICODE_NOT_PRESENT_OFFSET, 4982 },
-  { 0x1d5d7, G_UNICODE_NOT_PRESENT_OFFSET, 5077 },
-  { 0x1d5d8, G_UNICODE_NOT_PRESENT_OFFSET, 5046 },
-  { 0x1d5d9, G_UNICODE_NOT_PRESENT_OFFSET, 5048 },
-  { 0x1d5da, G_UNICODE_NOT_PRESENT_OFFSET, 5833 },
-  { 0x1d5db, G_UNICODE_NOT_PRESENT_OFFSET, 5005 },
-  { 0x1d5dc, G_UNICODE_NOT_PRESENT_OFFSET, 5010 },
-  { 0x1d5dd, G_UNICODE_NOT_PRESENT_OFFSET, 5835 },
-  { 0x1d5de, G_UNICODE_NOT_PRESENT_OFFSET, 5040 },
-  { 0x1d5df, G_UNICODE_NOT_PRESENT_OFFSET, 5012 },
-  { 0x1d5e0, G_UNICODE_NOT_PRESENT_OFFSET, 5050 },
-  { 0x1d5e1, G_UNICODE_NOT_PRESENT_OFFSET, 5014 },
-  { 0x1d5e2, G_UNICODE_NOT_PRESENT_OFFSET, 5837 },
-  { 0x1d5e3, G_UNICODE_NOT_PRESENT_OFFSET, 5019 },
-  { 0x1d5e4, G_UNICODE_NOT_PRESENT_OFFSET, 5021 },
-  { 0x1d5e5, G_UNICODE_NOT_PRESENT_OFFSET, 5023 },
-  { 0x1d5e6, G_UNICODE_NOT_PRESENT_OFFSET, 5839 },
-  { 0x1d5e7, G_UNICODE_NOT_PRESENT_OFFSET, 5841 },
-  { 0x1d5e8, G_UNICODE_NOT_PRESENT_OFFSET, 5843 },
-  { 0x1d5e9, G_UNICODE_NOT_PRESENT_OFFSET, 5168 },
-  { 0x1d5ea, G_UNICODE_NOT_PRESENT_OFFSET, 5845 },
-  { 0x1d5eb, G_UNICODE_NOT_PRESENT_OFFSET, 5185 },
-  { 0x1d5ec, G_UNICODE_NOT_PRESENT_OFFSET, 5847 },
-  { 0x1d5ed, G_UNICODE_NOT_PRESENT_OFFSET, 5035 },
-  { 0x1d5ee, G_UNICODE_NOT_PRESENT_OFFSET, 6 },
-  { 0x1d5ef, G_UNICODE_NOT_PRESENT_OFFSET, 5849 },
-  { 0x1d5f0, G_UNICODE_NOT_PRESENT_OFFSET, 5228 },
-  { 0x1d5f1, G_UNICODE_NOT_PRESENT_OFFSET, 5079 },
-  { 0x1d5f2, G_UNICODE_NOT_PRESENT_OFFSET, 5044 },
-  { 0x1d5f3, G_UNICODE_NOT_PRESENT_OFFSET, 5851 },
-  { 0x1d5f4, G_UNICODE_NOT_PRESENT_OFFSET, 5003 },
-  { 0x1d5f5, G_UNICODE_NOT_PRESENT_OFFSET, 1171 },
-  { 0x1d5f6, G_UNICODE_NOT_PRESENT_OFFSET, 4943 },
-  { 0x1d5f7, G_UNICODE_NOT_PRESENT_OFFSET, 1176 },
-  { 0x1d5f8, G_UNICODE_NOT_PRESENT_OFFSET, 5853 },
-  { 0x1d5f9, G_UNICODE_NOT_PRESENT_OFFSET, 1220 },
-  { 0x1d5fa, G_UNICODE_NOT_PRESENT_OFFSET, 5230 },
-  { 0x1d5fb, G_UNICODE_NOT_PRESENT_OFFSET, 4969 },
-  { 0x1d5fc, G_UNICODE_NOT_PRESENT_OFFSET, 29 },
-  { 0x1d5fd, G_UNICODE_NOT_PRESENT_OFFSET, 5855 },
-  { 0x1d5fe, G_UNICODE_NOT_PRESENT_OFFSET, 5857 },
-  { 0x1d5ff, G_UNICODE_NOT_PRESENT_OFFSET, 1178 },
-  { 0x1d600, G_UNICODE_NOT_PRESENT_OFFSET, 711 },
-  { 0x1d601, G_UNICODE_NOT_PRESENT_OFFSET, 5859 },
-  { 0x1d602, G_UNICODE_NOT_PRESENT_OFFSET, 5861 },
-  { 0x1d603, G_UNICODE_NOT_PRESENT_OFFSET, 5204 },
-  { 0x1d604, G_UNICODE_NOT_PRESENT_OFFSET, 1189 },
-  { 0x1d605, G_UNICODE_NOT_PRESENT_OFFSET, 1222 },
-  { 0x1d606, G_UNICODE_NOT_PRESENT_OFFSET, 1191 },
-  { 0x1d607, G_UNICODE_NOT_PRESENT_OFFSET, 5863 },
-  { 0x1d608, G_UNICODE_NOT_PRESENT_OFFSET, 5831 },
-  { 0x1d609, G_UNICODE_NOT_PRESENT_OFFSET, 5042 },
-  { 0x1d60a, G_UNICODE_NOT_PRESENT_OFFSET, 4982 },
-  { 0x1d60b, G_UNICODE_NOT_PRESENT_OFFSET, 5077 },
-  { 0x1d60c, G_UNICODE_NOT_PRESENT_OFFSET, 5046 },
-  { 0x1d60d, G_UNICODE_NOT_PRESENT_OFFSET, 5048 },
-  { 0x1d60e, G_UNICODE_NOT_PRESENT_OFFSET, 5833 },
-  { 0x1d60f, G_UNICODE_NOT_PRESENT_OFFSET, 5005 },
-  { 0x1d610, G_UNICODE_NOT_PRESENT_OFFSET, 5010 },
-  { 0x1d611, G_UNICODE_NOT_PRESENT_OFFSET, 5835 },
-  { 0x1d612, G_UNICODE_NOT_PRESENT_OFFSET, 5040 },
-  { 0x1d613, G_UNICODE_NOT_PRESENT_OFFSET, 5012 },
-  { 0x1d614, G_UNICODE_NOT_PRESENT_OFFSET, 5050 },
-  { 0x1d615, G_UNICODE_NOT_PRESENT_OFFSET, 5014 },
-  { 0x1d616, G_UNICODE_NOT_PRESENT_OFFSET, 5837 },
-  { 0x1d617, G_UNICODE_NOT_PRESENT_OFFSET, 5019 },
-  { 0x1d618, G_UNICODE_NOT_PRESENT_OFFSET, 5021 },
-  { 0x1d619, G_UNICODE_NOT_PRESENT_OFFSET, 5023 },
-  { 0x1d61a, G_UNICODE_NOT_PRESENT_OFFSET, 5839 },
-  { 0x1d61b, G_UNICODE_NOT_PRESENT_OFFSET, 5841 },
-  { 0x1d61c, G_UNICODE_NOT_PRESENT_OFFSET, 5843 },
-  { 0x1d61d, G_UNICODE_NOT_PRESENT_OFFSET, 5168 },
-  { 0x1d61e, G_UNICODE_NOT_PRESENT_OFFSET, 5845 },
-  { 0x1d61f, G_UNICODE_NOT_PRESENT_OFFSET, 5185 },
-  { 0x1d620, G_UNICODE_NOT_PRESENT_OFFSET, 5847 },
-  { 0x1d621, G_UNICODE_NOT_PRESENT_OFFSET, 5035 },
-  { 0x1d622, G_UNICODE_NOT_PRESENT_OFFSET, 6 },
-  { 0x1d623, G_UNICODE_NOT_PRESENT_OFFSET, 5849 },
-  { 0x1d624, G_UNICODE_NOT_PRESENT_OFFSET, 5228 },
-  { 0x1d625, G_UNICODE_NOT_PRESENT_OFFSET, 5079 },
-  { 0x1d626, G_UNICODE_NOT_PRESENT_OFFSET, 5044 },
-  { 0x1d627, G_UNICODE_NOT_PRESENT_OFFSET, 5851 },
-  { 0x1d628, G_UNICODE_NOT_PRESENT_OFFSET, 5003 },
-  { 0x1d629, G_UNICODE_NOT_PRESENT_OFFSET, 1171 },
-  { 0x1d62a, G_UNICODE_NOT_PRESENT_OFFSET, 4943 },
-  { 0x1d62b, G_UNICODE_NOT_PRESENT_OFFSET, 1176 },
-  { 0x1d62c, G_UNICODE_NOT_PRESENT_OFFSET, 5853 },
-  { 0x1d62d, G_UNICODE_NOT_PRESENT_OFFSET, 1220 },
-  { 0x1d62e, G_UNICODE_NOT_PRESENT_OFFSET, 5230 },
-  { 0x1d62f, G_UNICODE_NOT_PRESENT_OFFSET, 4969 },
-  { 0x1d630, G_UNICODE_NOT_PRESENT_OFFSET, 29 },
-  { 0x1d631, G_UNICODE_NOT_PRESENT_OFFSET, 5855 },
-  { 0x1d632, G_UNICODE_NOT_PRESENT_OFFSET, 5857 },
-  { 0x1d633, G_UNICODE_NOT_PRESENT_OFFSET, 1178 },
-  { 0x1d634, G_UNICODE_NOT_PRESENT_OFFSET, 711 },
-  { 0x1d635, G_UNICODE_NOT_PRESENT_OFFSET, 5859 },
-  { 0x1d636, G_UNICODE_NOT_PRESENT_OFFSET, 5861 },
-  { 0x1d637, G_UNICODE_NOT_PRESENT_OFFSET, 5204 },
-  { 0x1d638, G_UNICODE_NOT_PRESENT_OFFSET, 1189 },
-  { 0x1d639, G_UNICODE_NOT_PRESENT_OFFSET, 1222 },
-  { 0x1d63a, G_UNICODE_NOT_PRESENT_OFFSET, 1191 },
-  { 0x1d63b, G_UNICODE_NOT_PRESENT_OFFSET, 5863 },
-  { 0x1d63c, G_UNICODE_NOT_PRESENT_OFFSET, 5831 },
-  { 0x1d63d, G_UNICODE_NOT_PRESENT_OFFSET, 5042 },
-  { 0x1d63e, G_UNICODE_NOT_PRESENT_OFFSET, 4982 },
-  { 0x1d63f, G_UNICODE_NOT_PRESENT_OFFSET, 5077 },
-  { 0x1d640, G_UNICODE_NOT_PRESENT_OFFSET, 5046 },
-  { 0x1d641, G_UNICODE_NOT_PRESENT_OFFSET, 5048 },
-  { 0x1d642, G_UNICODE_NOT_PRESENT_OFFSET, 5833 },
-  { 0x1d643, G_UNICODE_NOT_PRESENT_OFFSET, 5005 },
-  { 0x1d644, G_UNICODE_NOT_PRESENT_OFFSET, 5010 },
-  { 0x1d645, G_UNICODE_NOT_PRESENT_OFFSET, 5835 },
-  { 0x1d646, G_UNICODE_NOT_PRESENT_OFFSET, 5040 },
-  { 0x1d647, G_UNICODE_NOT_PRESENT_OFFSET, 5012 },
-  { 0x1d648, G_UNICODE_NOT_PRESENT_OFFSET, 5050 },
-  { 0x1d649, G_UNICODE_NOT_PRESENT_OFFSET, 5014 },
-  { 0x1d64a, G_UNICODE_NOT_PRESENT_OFFSET, 5837 },
-  { 0x1d64b, G_UNICODE_NOT_PRESENT_OFFSET, 5019 },
-  { 0x1d64c, G_UNICODE_NOT_PRESENT_OFFSET, 5021 },
-  { 0x1d64d, G_UNICODE_NOT_PRESENT_OFFSET, 5023 },
-  { 0x1d64e, G_UNICODE_NOT_PRESENT_OFFSET, 5839 },
-  { 0x1d64f, G_UNICODE_NOT_PRESENT_OFFSET, 5841 },
-  { 0x1d650, G_UNICODE_NOT_PRESENT_OFFSET, 5843 },
-  { 0x1d651, G_UNICODE_NOT_PRESENT_OFFSET, 5168 },
-  { 0x1d652, G_UNICODE_NOT_PRESENT_OFFSET, 5845 },
-  { 0x1d653, G_UNICODE_NOT_PRESENT_OFFSET, 5185 },
-  { 0x1d654, G_UNICODE_NOT_PRESENT_OFFSET, 5847 },
-  { 0x1d655, G_UNICODE_NOT_PRESENT_OFFSET, 5035 },
-  { 0x1d656, G_UNICODE_NOT_PRESENT_OFFSET, 6 },
-  { 0x1d657, G_UNICODE_NOT_PRESENT_OFFSET, 5849 },
-  { 0x1d658, G_UNICODE_NOT_PRESENT_OFFSET, 5228 },
-  { 0x1d659, G_UNICODE_NOT_PRESENT_OFFSET, 5079 },
-  { 0x1d65a, G_UNICODE_NOT_PRESENT_OFFSET, 5044 },
-  { 0x1d65b, G_UNICODE_NOT_PRESENT_OFFSET, 5851 },
-  { 0x1d65c, G_UNICODE_NOT_PRESENT_OFFSET, 5003 },
-  { 0x1d65d, G_UNICODE_NOT_PRESENT_OFFSET, 1171 },
-  { 0x1d65e, G_UNICODE_NOT_PRESENT_OFFSET, 4943 },
-  { 0x1d65f, G_UNICODE_NOT_PRESENT_OFFSET, 1176 },
-  { 0x1d660, G_UNICODE_NOT_PRESENT_OFFSET, 5853 },
-  { 0x1d661, G_UNICODE_NOT_PRESENT_OFFSET, 1220 },
-  { 0x1d662, G_UNICODE_NOT_PRESENT_OFFSET, 5230 },
-  { 0x1d663, G_UNICODE_NOT_PRESENT_OFFSET, 4969 },
-  { 0x1d664, G_UNICODE_NOT_PRESENT_OFFSET, 29 },
-  { 0x1d665, G_UNICODE_NOT_PRESENT_OFFSET, 5855 },
-  { 0x1d666, G_UNICODE_NOT_PRESENT_OFFSET, 5857 },
-  { 0x1d667, G_UNICODE_NOT_PRESENT_OFFSET, 1178 },
-  { 0x1d668, G_UNICODE_NOT_PRESENT_OFFSET, 711 },
-  { 0x1d669, G_UNICODE_NOT_PRESENT_OFFSET, 5859 },
-  { 0x1d66a, G_UNICODE_NOT_PRESENT_OFFSET, 5861 },
-  { 0x1d66b, G_UNICODE_NOT_PRESENT_OFFSET, 5204 },
-  { 0x1d66c, G_UNICODE_NOT_PRESENT_OFFSET, 1189 },
-  { 0x1d66d, G_UNICODE_NOT_PRESENT_OFFSET, 1222 },
-  { 0x1d66e, G_UNICODE_NOT_PRESENT_OFFSET, 1191 },
-  { 0x1d66f, G_UNICODE_NOT_PRESENT_OFFSET, 5863 },
-  { 0x1d670, G_UNICODE_NOT_PRESENT_OFFSET, 5831 },
-  { 0x1d671, G_UNICODE_NOT_PRESENT_OFFSET, 5042 },
-  { 0x1d672, G_UNICODE_NOT_PRESENT_OFFSET, 4982 },
-  { 0x1d673, G_UNICODE_NOT_PRESENT_OFFSET, 5077 },
-  { 0x1d674, G_UNICODE_NOT_PRESENT_OFFSET, 5046 },
-  { 0x1d675, G_UNICODE_NOT_PRESENT_OFFSET, 5048 },
-  { 0x1d676, G_UNICODE_NOT_PRESENT_OFFSET, 5833 },
-  { 0x1d677, G_UNICODE_NOT_PRESENT_OFFSET, 5005 },
-  { 0x1d678, G_UNICODE_NOT_PRESENT_OFFSET, 5010 },
-  { 0x1d679, G_UNICODE_NOT_PRESENT_OFFSET, 5835 },
-  { 0x1d67a, G_UNICODE_NOT_PRESENT_OFFSET, 5040 },
-  { 0x1d67b, G_UNICODE_NOT_PRESENT_OFFSET, 5012 },
-  { 0x1d67c, G_UNICODE_NOT_PRESENT_OFFSET, 5050 },
-  { 0x1d67d, G_UNICODE_NOT_PRESENT_OFFSET, 5014 },
-  { 0x1d67e, G_UNICODE_NOT_PRESENT_OFFSET, 5837 },
-  { 0x1d67f, G_UNICODE_NOT_PRESENT_OFFSET, 5019 },
-  { 0x1d680, G_UNICODE_NOT_PRESENT_OFFSET, 5021 },
-  { 0x1d681, G_UNICODE_NOT_PRESENT_OFFSET, 5023 },
-  { 0x1d682, G_UNICODE_NOT_PRESENT_OFFSET, 5839 },
-  { 0x1d683, G_UNICODE_NOT_PRESENT_OFFSET, 5841 },
-  { 0x1d684, G_UNICODE_NOT_PRESENT_OFFSET, 5843 },
-  { 0x1d685, G_UNICODE_NOT_PRESENT_OFFSET, 5168 },
-  { 0x1d686, G_UNICODE_NOT_PRESENT_OFFSET, 5845 },
-  { 0x1d687, G_UNICODE_NOT_PRESENT_OFFSET, 5185 },
-  { 0x1d688, G_UNICODE_NOT_PRESENT_OFFSET, 5847 },
-  { 0x1d689, G_UNICODE_NOT_PRESENT_OFFSET, 5035 },
-  { 0x1d68a, G_UNICODE_NOT_PRESENT_OFFSET, 6 },
-  { 0x1d68b, G_UNICODE_NOT_PRESENT_OFFSET, 5849 },
-  { 0x1d68c, G_UNICODE_NOT_PRESENT_OFFSET, 5228 },
-  { 0x1d68d, G_UNICODE_NOT_PRESENT_OFFSET, 5079 },
-  { 0x1d68e, G_UNICODE_NOT_PRESENT_OFFSET, 5044 },
-  { 0x1d68f, G_UNICODE_NOT_PRESENT_OFFSET, 5851 },
-  { 0x1d690, G_UNICODE_NOT_PRESENT_OFFSET, 5003 },
-  { 0x1d691, G_UNICODE_NOT_PRESENT_OFFSET, 1171 },
-  { 0x1d692, G_UNICODE_NOT_PRESENT_OFFSET, 4943 },
-  { 0x1d693, G_UNICODE_NOT_PRESENT_OFFSET, 1176 },
-  { 0x1d694, G_UNICODE_NOT_PRESENT_OFFSET, 5853 },
-  { 0x1d695, G_UNICODE_NOT_PRESENT_OFFSET, 1220 },
-  { 0x1d696, G_UNICODE_NOT_PRESENT_OFFSET, 5230 },
-  { 0x1d697, G_UNICODE_NOT_PRESENT_OFFSET, 4969 },
-  { 0x1d698, G_UNICODE_NOT_PRESENT_OFFSET, 29 },
-  { 0x1d699, G_UNICODE_NOT_PRESENT_OFFSET, 5855 },
-  { 0x1d69a, G_UNICODE_NOT_PRESENT_OFFSET, 5857 },
-  { 0x1d69b, G_UNICODE_NOT_PRESENT_OFFSET, 1178 },
-  { 0x1d69c, G_UNICODE_NOT_PRESENT_OFFSET, 711 },
-  { 0x1d69d, G_UNICODE_NOT_PRESENT_OFFSET, 5859 },
-  { 0x1d69e, G_UNICODE_NOT_PRESENT_OFFSET, 5861 },
-  { 0x1d69f, G_UNICODE_NOT_PRESENT_OFFSET, 5204 },
-  { 0x1d6a0, G_UNICODE_NOT_PRESENT_OFFSET, 1189 },
-  { 0x1d6a1, G_UNICODE_NOT_PRESENT_OFFSET, 1222 },
-  { 0x1d6a2, G_UNICODE_NOT_PRESENT_OFFSET, 1191 },
-  { 0x1d6a3, G_UNICODE_NOT_PRESENT_OFFSET, 5863 },
-  { 0x1d6a8, G_UNICODE_NOT_PRESENT_OFFSET, 14361 },
-  { 0x1d6a9, G_UNICODE_NOT_PRESENT_OFFSET, 14364 },
-  { 0x1d6aa, G_UNICODE_NOT_PRESENT_OFFSET, 5067 },
-  { 0x1d6ab, G_UNICODE_NOT_PRESENT_OFFSET, 14367 },
-  { 0x1d6ac, G_UNICODE_NOT_PRESENT_OFFSET, 14370 },
-  { 0x1d6ad, G_UNICODE_NOT_PRESENT_OFFSET, 14373 },
-  { 0x1d6ae, G_UNICODE_NOT_PRESENT_OFFSET, 14376 },
-  { 0x1d6af, G_UNICODE_NOT_PRESENT_OFFSET, 1402 },
-  { 0x1d6b0, G_UNICODE_NOT_PRESENT_OFFSET, 14379 },
-  { 0x1d6b1, G_UNICODE_NOT_PRESENT_OFFSET, 14382 },
-  { 0x1d6b2, G_UNICODE_NOT_PRESENT_OFFSET, 14385 },
-  { 0x1d6b3, G_UNICODE_NOT_PRESENT_OFFSET, 14388 },
-  { 0x1d6b4, G_UNICODE_NOT_PRESENT_OFFSET, 14391 },
-  { 0x1d6b5, G_UNICODE_NOT_PRESENT_OFFSET, 14394 },
-  { 0x1d6b6, G_UNICODE_NOT_PRESENT_OFFSET, 14397 },
-  { 0x1d6b7, G_UNICODE_NOT_PRESENT_OFFSET, 5070 },
-  { 0x1d6b8, G_UNICODE_NOT_PRESENT_OFFSET, 14400 },
-  { 0x1d6b9, G_UNICODE_NOT_PRESENT_OFFSET, 1402 },
-  { 0x1d6ba, G_UNICODE_NOT_PRESENT_OFFSET, 14403 },
-  { 0x1d6bb, G_UNICODE_NOT_PRESENT_OFFSET, 14406 },
-  { 0x1d6bc, G_UNICODE_NOT_PRESENT_OFFSET, 1374 },
-  { 0x1d6bd, G_UNICODE_NOT_PRESENT_OFFSET, 14409 },
-  { 0x1d6be, G_UNICODE_NOT_PRESENT_OFFSET, 14412 },
-  { 0x1d6bf, G_UNICODE_NOT_PRESENT_OFFSET, 14415 },
-  { 0x1d6c0, G_UNICODE_NOT_PRESENT_OFFSET, 5037 },
-  { 0x1d6c1, G_UNICODE_NOT_PRESENT_OFFSET, 14418 },
-  { 0x1d6c2, G_UNICODE_NOT_PRESENT_OFFSET, 14422 },
-  { 0x1d6c3, G_UNICODE_NOT_PRESENT_OFFSET, 1368 },
-  { 0x1d6c4, G_UNICODE_NOT_PRESENT_OFFSET, 5064 },
-  { 0x1d6c5, G_UNICODE_NOT_PRESENT_OFFSET, 14425 },
-  { 0x1d6c6, G_UNICODE_NOT_PRESENT_OFFSET, 1405 },
-  { 0x1d6c7, G_UNICODE_NOT_PRESENT_OFFSET, 14428 },
-  { 0x1d6c8, G_UNICODE_NOT_PRESENT_OFFSET, 14431 },
-  { 0x1d6c9, G_UNICODE_NOT_PRESENT_OFFSET, 1371 },
-  { 0x1d6ca, G_UNICODE_NOT_PRESENT_OFFSET, 4548 },
-  { 0x1d6cb, G_UNICODE_NOT_PRESENT_OFFSET, 1393 },
-  { 0x1d6cc, G_UNICODE_NOT_PRESENT_OFFSET, 14434 },
-  { 0x1d6cd, G_UNICODE_NOT_PRESENT_OFFSET, 20 },
-  { 0x1d6ce, G_UNICODE_NOT_PRESENT_OFFSET, 14437 },
-  { 0x1d6cf, G_UNICODE_NOT_PRESENT_OFFSET, 14440 },
-  { 0x1d6d0, G_UNICODE_NOT_PRESENT_OFFSET, 14443 },
-  { 0x1d6d1, G_UNICODE_NOT_PRESENT_OFFSET, 1390 },
-  { 0x1d6d2, G_UNICODE_NOT_PRESENT_OFFSET, 1396 },
-  { 0x1d6d3, G_UNICODE_NOT_PRESENT_OFFSET, 1399 },
-  { 0x1d6d4, G_UNICODE_NOT_PRESENT_OFFSET, 14446 },
-  { 0x1d6d5, G_UNICODE_NOT_PRESENT_OFFSET, 14449 },
-  { 0x1d6d6, G_UNICODE_NOT_PRESENT_OFFSET, 14452 },
-  { 0x1d6d7, G_UNICODE_NOT_PRESENT_OFFSET, 1387 },
-  { 0x1d6d8, G_UNICODE_NOT_PRESENT_OFFSET, 14455 },
-  { 0x1d6d9, G_UNICODE_NOT_PRESENT_OFFSET, 14458 },
-  { 0x1d6da, G_UNICODE_NOT_PRESENT_OFFSET, 14461 },
-  { 0x1d6db, G_UNICODE_NOT_PRESENT_OFFSET, 14464 },
-  { 0x1d6dc, G_UNICODE_NOT_PRESENT_OFFSET, 1405 },
-  { 0x1d6dd, G_UNICODE_NOT_PRESENT_OFFSET, 1371 },
-  { 0x1d6de, G_UNICODE_NOT_PRESENT_OFFSET, 1393 },
-  { 0x1d6df, G_UNICODE_NOT_PRESENT_OFFSET, 1387 },
-  { 0x1d6e0, G_UNICODE_NOT_PRESENT_OFFSET, 1396 },
-  { 0x1d6e1, G_UNICODE_NOT_PRESENT_OFFSET, 1390 },
-  { 0x1d6e2, G_UNICODE_NOT_PRESENT_OFFSET, 14361 },
-  { 0x1d6e3, G_UNICODE_NOT_PRESENT_OFFSET, 14364 },
-  { 0x1d6e4, G_UNICODE_NOT_PRESENT_OFFSET, 5067 },
-  { 0x1d6e5, G_UNICODE_NOT_PRESENT_OFFSET, 14367 },
-  { 0x1d6e6, G_UNICODE_NOT_PRESENT_OFFSET, 14370 },
-  { 0x1d6e7, G_UNICODE_NOT_PRESENT_OFFSET, 14373 },
-  { 0x1d6e8, G_UNICODE_NOT_PRESENT_OFFSET, 14376 },
-  { 0x1d6e9, G_UNICODE_NOT_PRESENT_OFFSET, 1402 },
-  { 0x1d6ea, G_UNICODE_NOT_PRESENT_OFFSET, 14379 },
-  { 0x1d6eb, G_UNICODE_NOT_PRESENT_OFFSET, 14382 },
-  { 0x1d6ec, G_UNICODE_NOT_PRESENT_OFFSET, 14385 },
-  { 0x1d6ed, G_UNICODE_NOT_PRESENT_OFFSET, 14388 },
-  { 0x1d6ee, G_UNICODE_NOT_PRESENT_OFFSET, 14391 },
-  { 0x1d6ef, G_UNICODE_NOT_PRESENT_OFFSET, 14394 },
-  { 0x1d6f0, G_UNICODE_NOT_PRESENT_OFFSET, 14397 },
-  { 0x1d6f1, G_UNICODE_NOT_PRESENT_OFFSET, 5070 },
-  { 0x1d6f2, G_UNICODE_NOT_PRESENT_OFFSET, 14400 },
-  { 0x1d6f3, G_UNICODE_NOT_PRESENT_OFFSET, 1402 },
-  { 0x1d6f4, G_UNICODE_NOT_PRESENT_OFFSET, 14403 },
-  { 0x1d6f5, G_UNICODE_NOT_PRESENT_OFFSET, 14406 },
-  { 0x1d6f6, G_UNICODE_NOT_PRESENT_OFFSET, 1374 },
-  { 0x1d6f7, G_UNICODE_NOT_PRESENT_OFFSET, 14409 },
-  { 0x1d6f8, G_UNICODE_NOT_PRESENT_OFFSET, 14412 },
-  { 0x1d6f9, G_UNICODE_NOT_PRESENT_OFFSET, 14415 },
-  { 0x1d6fa, G_UNICODE_NOT_PRESENT_OFFSET, 5037 },
-  { 0x1d6fb, G_UNICODE_NOT_PRESENT_OFFSET, 14418 },
-  { 0x1d6fc, G_UNICODE_NOT_PRESENT_OFFSET, 14422 },
-  { 0x1d6fd, G_UNICODE_NOT_PRESENT_OFFSET, 1368 },
-  { 0x1d6fe, G_UNICODE_NOT_PRESENT_OFFSET, 5064 },
-  { 0x1d6ff, G_UNICODE_NOT_PRESENT_OFFSET, 14425 },
-  { 0x1d700, G_UNICODE_NOT_PRESENT_OFFSET, 1405 },
-  { 0x1d701, G_UNICODE_NOT_PRESENT_OFFSET, 14428 },
-  { 0x1d702, G_UNICODE_NOT_PRESENT_OFFSET, 14431 },
-  { 0x1d703, G_UNICODE_NOT_PRESENT_OFFSET, 1371 },
-  { 0x1d704, G_UNICODE_NOT_PRESENT_OFFSET, 4548 },
-  { 0x1d705, G_UNICODE_NOT_PRESENT_OFFSET, 1393 },
-  { 0x1d706, G_UNICODE_NOT_PRESENT_OFFSET, 14434 },
-  { 0x1d707, G_UNICODE_NOT_PRESENT_OFFSET, 20 },
-  { 0x1d708, G_UNICODE_NOT_PRESENT_OFFSET, 14437 },
-  { 0x1d709, G_UNICODE_NOT_PRESENT_OFFSET, 14440 },
-  { 0x1d70a, G_UNICODE_NOT_PRESENT_OFFSET, 14443 },
-  { 0x1d70b, G_UNICODE_NOT_PRESENT_OFFSET, 1390 },
-  { 0x1d70c, G_UNICODE_NOT_PRESENT_OFFSET, 1396 },
-  { 0x1d70d, G_UNICODE_NOT_PRESENT_OFFSET, 1399 },
-  { 0x1d70e, G_UNICODE_NOT_PRESENT_OFFSET, 14446 },
-  { 0x1d70f, G_UNICODE_NOT_PRESENT_OFFSET, 14449 },
-  { 0x1d710, G_UNICODE_NOT_PRESENT_OFFSET, 14452 },
-  { 0x1d711, G_UNICODE_NOT_PRESENT_OFFSET, 1387 },
-  { 0x1d712, G_UNICODE_NOT_PRESENT_OFFSET, 14455 },
-  { 0x1d713, G_UNICODE_NOT_PRESENT_OFFSET, 14458 },
-  { 0x1d714, G_UNICODE_NOT_PRESENT_OFFSET, 14461 },
-  { 0x1d715, G_UNICODE_NOT_PRESENT_OFFSET, 14464 },
-  { 0x1d716, G_UNICODE_NOT_PRESENT_OFFSET, 1405 },
-  { 0x1d717, G_UNICODE_NOT_PRESENT_OFFSET, 1371 },
-  { 0x1d718, G_UNICODE_NOT_PRESENT_OFFSET, 1393 },
-  { 0x1d719, G_UNICODE_NOT_PRESENT_OFFSET, 1387 },
-  { 0x1d71a, G_UNICODE_NOT_PRESENT_OFFSET, 1396 },
-  { 0x1d71b, G_UNICODE_NOT_PRESENT_OFFSET, 1390 },
-  { 0x1d71c, G_UNICODE_NOT_PRESENT_OFFSET, 14361 },
-  { 0x1d71d, G_UNICODE_NOT_PRESENT_OFFSET, 14364 },
-  { 0x1d71e, G_UNICODE_NOT_PRESENT_OFFSET, 5067 },
-  { 0x1d71f, G_UNICODE_NOT_PRESENT_OFFSET, 14367 },
-  { 0x1d720, G_UNICODE_NOT_PRESENT_OFFSET, 14370 },
-  { 0x1d721, G_UNICODE_NOT_PRESENT_OFFSET, 14373 },
-  { 0x1d722, G_UNICODE_NOT_PRESENT_OFFSET, 14376 },
-  { 0x1d723, G_UNICODE_NOT_PRESENT_OFFSET, 1402 },
-  { 0x1d724, G_UNICODE_NOT_PRESENT_OFFSET, 14379 },
-  { 0x1d725, G_UNICODE_NOT_PRESENT_OFFSET, 14382 },
-  { 0x1d726, G_UNICODE_NOT_PRESENT_OFFSET, 14385 },
-  { 0x1d727, G_UNICODE_NOT_PRESENT_OFFSET, 14388 },
-  { 0x1d728, G_UNICODE_NOT_PRESENT_OFFSET, 14391 },
-  { 0x1d729, G_UNICODE_NOT_PRESENT_OFFSET, 14394 },
-  { 0x1d72a, G_UNICODE_NOT_PRESENT_OFFSET, 14397 },
-  { 0x1d72b, G_UNICODE_NOT_PRESENT_OFFSET, 5070 },
-  { 0x1d72c, G_UNICODE_NOT_PRESENT_OFFSET, 14400 },
-  { 0x1d72d, G_UNICODE_NOT_PRESENT_OFFSET, 1402 },
-  { 0x1d72e, G_UNICODE_NOT_PRESENT_OFFSET, 14403 },
-  { 0x1d72f, G_UNICODE_NOT_PRESENT_OFFSET, 14406 },
-  { 0x1d730, G_UNICODE_NOT_PRESENT_OFFSET, 1374 },
-  { 0x1d731, G_UNICODE_NOT_PRESENT_OFFSET, 14409 },
-  { 0x1d732, G_UNICODE_NOT_PRESENT_OFFSET, 14412 },
-  { 0x1d733, G_UNICODE_NOT_PRESENT_OFFSET, 14415 },
-  { 0x1d734, G_UNICODE_NOT_PRESENT_OFFSET, 5037 },
-  { 0x1d735, G_UNICODE_NOT_PRESENT_OFFSET, 14418 },
-  { 0x1d736, G_UNICODE_NOT_PRESENT_OFFSET, 14422 },
-  { 0x1d737, G_UNICODE_NOT_PRESENT_OFFSET, 1368 },
-  { 0x1d738, G_UNICODE_NOT_PRESENT_OFFSET, 5064 },
-  { 0x1d739, G_UNICODE_NOT_PRESENT_OFFSET, 14425 },
-  { 0x1d73a, G_UNICODE_NOT_PRESENT_OFFSET, 1405 },
-  { 0x1d73b, G_UNICODE_NOT_PRESENT_OFFSET, 14428 },
-  { 0x1d73c, G_UNICODE_NOT_PRESENT_OFFSET, 14431 },
-  { 0x1d73d, G_UNICODE_NOT_PRESENT_OFFSET, 1371 },
-  { 0x1d73e, G_UNICODE_NOT_PRESENT_OFFSET, 4548 },
-  { 0x1d73f, G_UNICODE_NOT_PRESENT_OFFSET, 1393 },
-  { 0x1d740, G_UNICODE_NOT_PRESENT_OFFSET, 14434 },
-  { 0x1d741, G_UNICODE_NOT_PRESENT_OFFSET, 20 },
-  { 0x1d742, G_UNICODE_NOT_PRESENT_OFFSET, 14437 },
-  { 0x1d743, G_UNICODE_NOT_PRESENT_OFFSET, 14440 },
-  { 0x1d744, G_UNICODE_NOT_PRESENT_OFFSET, 14443 },
-  { 0x1d745, G_UNICODE_NOT_PRESENT_OFFSET, 1390 },
-  { 0x1d746, G_UNICODE_NOT_PRESENT_OFFSET, 1396 },
-  { 0x1d747, G_UNICODE_NOT_PRESENT_OFFSET, 1399 },
-  { 0x1d748, G_UNICODE_NOT_PRESENT_OFFSET, 14446 },
-  { 0x1d749, G_UNICODE_NOT_PRESENT_OFFSET, 14449 },
-  { 0x1d74a, G_UNICODE_NOT_PRESENT_OFFSET, 14452 },
-  { 0x1d74b, G_UNICODE_NOT_PRESENT_OFFSET, 1387 },
-  { 0x1d74c, G_UNICODE_NOT_PRESENT_OFFSET, 14455 },
-  { 0x1d74d, G_UNICODE_NOT_PRESENT_OFFSET, 14458 },
-  { 0x1d74e, G_UNICODE_NOT_PRESENT_OFFSET, 14461 },
-  { 0x1d74f, G_UNICODE_NOT_PRESENT_OFFSET, 14464 },
-  { 0x1d750, G_UNICODE_NOT_PRESENT_OFFSET, 1405 },
-  { 0x1d751, G_UNICODE_NOT_PRESENT_OFFSET, 1371 },
-  { 0x1d752, G_UNICODE_NOT_PRESENT_OFFSET, 1393 },
-  { 0x1d753, G_UNICODE_NOT_PRESENT_OFFSET, 1387 },
-  { 0x1d754, G_UNICODE_NOT_PRESENT_OFFSET, 1396 },
-  { 0x1d755, G_UNICODE_NOT_PRESENT_OFFSET, 1390 },
-  { 0x1d756, G_UNICODE_NOT_PRESENT_OFFSET, 14361 },
-  { 0x1d757, G_UNICODE_NOT_PRESENT_OFFSET, 14364 },
-  { 0x1d758, G_UNICODE_NOT_PRESENT_OFFSET, 5067 },
-  { 0x1d759, G_UNICODE_NOT_PRESENT_OFFSET, 14367 },
-  { 0x1d75a, G_UNICODE_NOT_PRESENT_OFFSET, 14370 },
-  { 0x1d75b, G_UNICODE_NOT_PRESENT_OFFSET, 14373 },
-  { 0x1d75c, G_UNICODE_NOT_PRESENT_OFFSET, 14376 },
-  { 0x1d75d, G_UNICODE_NOT_PRESENT_OFFSET, 1402 },
-  { 0x1d75e, G_UNICODE_NOT_PRESENT_OFFSET, 14379 },
-  { 0x1d75f, G_UNICODE_NOT_PRESENT_OFFSET, 14382 },
-  { 0x1d760, G_UNICODE_NOT_PRESENT_OFFSET, 14385 },
-  { 0x1d761, G_UNICODE_NOT_PRESENT_OFFSET, 14388 },
-  { 0x1d762, G_UNICODE_NOT_PRESENT_OFFSET, 14391 },
-  { 0x1d763, G_UNICODE_NOT_PRESENT_OFFSET, 14394 },
-  { 0x1d764, G_UNICODE_NOT_PRESENT_OFFSET, 14397 },
-  { 0x1d765, G_UNICODE_NOT_PRESENT_OFFSET, 5070 },
-  { 0x1d766, G_UNICODE_NOT_PRESENT_OFFSET, 14400 },
-  { 0x1d767, G_UNICODE_NOT_PRESENT_OFFSET, 1402 },
-  { 0x1d768, G_UNICODE_NOT_PRESENT_OFFSET, 14403 },
-  { 0x1d769, G_UNICODE_NOT_PRESENT_OFFSET, 14406 },
-  { 0x1d76a, G_UNICODE_NOT_PRESENT_OFFSET, 1374 },
-  { 0x1d76b, G_UNICODE_NOT_PRESENT_OFFSET, 14409 },
-  { 0x1d76c, G_UNICODE_NOT_PRESENT_OFFSET, 14412 },
-  { 0x1d76d, G_UNICODE_NOT_PRESENT_OFFSET, 14415 },
-  { 0x1d76e, G_UNICODE_NOT_PRESENT_OFFSET, 5037 },
-  { 0x1d76f, G_UNICODE_NOT_PRESENT_OFFSET, 14418 },
-  { 0x1d770, G_UNICODE_NOT_PRESENT_OFFSET, 14422 },
-  { 0x1d771, G_UNICODE_NOT_PRESENT_OFFSET, 1368 },
-  { 0x1d772, G_UNICODE_NOT_PRESENT_OFFSET, 5064 },
-  { 0x1d773, G_UNICODE_NOT_PRESENT_OFFSET, 14425 },
-  { 0x1d774, G_UNICODE_NOT_PRESENT_OFFSET, 1405 },
-  { 0x1d775, G_UNICODE_NOT_PRESENT_OFFSET, 14428 },
-  { 0x1d776, G_UNICODE_NOT_PRESENT_OFFSET, 14431 },
-  { 0x1d777, G_UNICODE_NOT_PRESENT_OFFSET, 1371 },
-  { 0x1d778, G_UNICODE_NOT_PRESENT_OFFSET, 4548 },
-  { 0x1d779, G_UNICODE_NOT_PRESENT_OFFSET, 1393 },
-  { 0x1d77a, G_UNICODE_NOT_PRESENT_OFFSET, 14434 },
-  { 0x1d77b, G_UNICODE_NOT_PRESENT_OFFSET, 20 },
-  { 0x1d77c, G_UNICODE_NOT_PRESENT_OFFSET, 14437 },
-  { 0x1d77d, G_UNICODE_NOT_PRESENT_OFFSET, 14440 },
-  { 0x1d77e, G_UNICODE_NOT_PRESENT_OFFSET, 14443 },
-  { 0x1d77f, G_UNICODE_NOT_PRESENT_OFFSET, 1390 },
-  { 0x1d780, G_UNICODE_NOT_PRESENT_OFFSET, 1396 },
-  { 0x1d781, G_UNICODE_NOT_PRESENT_OFFSET, 1399 },
-  { 0x1d782, G_UNICODE_NOT_PRESENT_OFFSET, 14446 },
-  { 0x1d783, G_UNICODE_NOT_PRESENT_OFFSET, 14449 },
-  { 0x1d784, G_UNICODE_NOT_PRESENT_OFFSET, 14452 },
-  { 0x1d785, G_UNICODE_NOT_PRESENT_OFFSET, 1387 },
-  { 0x1d786, G_UNICODE_NOT_PRESENT_OFFSET, 14455 },
-  { 0x1d787, G_UNICODE_NOT_PRESENT_OFFSET, 14458 },
-  { 0x1d788, G_UNICODE_NOT_PRESENT_OFFSET, 14461 },
-  { 0x1d789, G_UNICODE_NOT_PRESENT_OFFSET, 14464 },
-  { 0x1d78a, G_UNICODE_NOT_PRESENT_OFFSET, 1405 },
-  { 0x1d78b, G_UNICODE_NOT_PRESENT_OFFSET, 1371 },
-  { 0x1d78c, G_UNICODE_NOT_PRESENT_OFFSET, 1393 },
-  { 0x1d78d, G_UNICODE_NOT_PRESENT_OFFSET, 1387 },
-  { 0x1d78e, G_UNICODE_NOT_PRESENT_OFFSET, 1396 },
-  { 0x1d78f, G_UNICODE_NOT_PRESENT_OFFSET, 1390 },
-  { 0x1d790, G_UNICODE_NOT_PRESENT_OFFSET, 14361 },
-  { 0x1d791, G_UNICODE_NOT_PRESENT_OFFSET, 14364 },
-  { 0x1d792, G_UNICODE_NOT_PRESENT_OFFSET, 5067 },
-  { 0x1d793, G_UNICODE_NOT_PRESENT_OFFSET, 14367 },
-  { 0x1d794, G_UNICODE_NOT_PRESENT_OFFSET, 14370 },
-  { 0x1d795, G_UNICODE_NOT_PRESENT_OFFSET, 14373 },
-  { 0x1d796, G_UNICODE_NOT_PRESENT_OFFSET, 14376 },
-  { 0x1d797, G_UNICODE_NOT_PRESENT_OFFSET, 1402 },
-  { 0x1d798, G_UNICODE_NOT_PRESENT_OFFSET, 14379 },
-  { 0x1d799, G_UNICODE_NOT_PRESENT_OFFSET, 14382 },
-  { 0x1d79a, G_UNICODE_NOT_PRESENT_OFFSET, 14385 },
-  { 0x1d79b, G_UNICODE_NOT_PRESENT_OFFSET, 14388 },
-  { 0x1d79c, G_UNICODE_NOT_PRESENT_OFFSET, 14391 },
-  { 0x1d79d, G_UNICODE_NOT_PRESENT_OFFSET, 14394 },
-  { 0x1d79e, G_UNICODE_NOT_PRESENT_OFFSET, 14397 },
-  { 0x1d79f, G_UNICODE_NOT_PRESENT_OFFSET, 5070 },
-  { 0x1d7a0, G_UNICODE_NOT_PRESENT_OFFSET, 14400 },
-  { 0x1d7a1, G_UNICODE_NOT_PRESENT_OFFSET, 1402 },
-  { 0x1d7a2, G_UNICODE_NOT_PRESENT_OFFSET, 14403 },
-  { 0x1d7a3, G_UNICODE_NOT_PRESENT_OFFSET, 14406 },
-  { 0x1d7a4, G_UNICODE_NOT_PRESENT_OFFSET, 1374 },
-  { 0x1d7a5, G_UNICODE_NOT_PRESENT_OFFSET, 14409 },
-  { 0x1d7a6, G_UNICODE_NOT_PRESENT_OFFSET, 14412 },
-  { 0x1d7a7, G_UNICODE_NOT_PRESENT_OFFSET, 14415 },
-  { 0x1d7a8, G_UNICODE_NOT_PRESENT_OFFSET, 5037 },
-  { 0x1d7a9, G_UNICODE_NOT_PRESENT_OFFSET, 14418 },
-  { 0x1d7aa, G_UNICODE_NOT_PRESENT_OFFSET, 14422 },
-  { 0x1d7ab, G_UNICODE_NOT_PRESENT_OFFSET, 1368 },
-  { 0x1d7ac, G_UNICODE_NOT_PRESENT_OFFSET, 5064 },
-  { 0x1d7ad, G_UNICODE_NOT_PRESENT_OFFSET, 14425 },
-  { 0x1d7ae, G_UNICODE_NOT_PRESENT_OFFSET, 1405 },
-  { 0x1d7af, G_UNICODE_NOT_PRESENT_OFFSET, 14428 },
-  { 0x1d7b0, G_UNICODE_NOT_PRESENT_OFFSET, 14431 },
-  { 0x1d7b1, G_UNICODE_NOT_PRESENT_OFFSET, 1371 },
-  { 0x1d7b2, G_UNICODE_NOT_PRESENT_OFFSET, 4548 },
-  { 0x1d7b3, G_UNICODE_NOT_PRESENT_OFFSET, 1393 },
-  { 0x1d7b4, G_UNICODE_NOT_PRESENT_OFFSET, 14434 },
-  { 0x1d7b5, G_UNICODE_NOT_PRESENT_OFFSET, 20 },
-  { 0x1d7b6, G_UNICODE_NOT_PRESENT_OFFSET, 14437 },
-  { 0x1d7b7, G_UNICODE_NOT_PRESENT_OFFSET, 14440 },
-  { 0x1d7b8, G_UNICODE_NOT_PRESENT_OFFSET, 14443 },
-  { 0x1d7b9, G_UNICODE_NOT_PRESENT_OFFSET, 1390 },
-  { 0x1d7ba, G_UNICODE_NOT_PRESENT_OFFSET, 1396 },
-  { 0x1d7bb, G_UNICODE_NOT_PRESENT_OFFSET, 1399 },
-  { 0x1d7bc, G_UNICODE_NOT_PRESENT_OFFSET, 14446 },
-  { 0x1d7bd, G_UNICODE_NOT_PRESENT_OFFSET, 14449 },
-  { 0x1d7be, G_UNICODE_NOT_PRESENT_OFFSET, 14452 },
-  { 0x1d7bf, G_UNICODE_NOT_PRESENT_OFFSET, 1387 },
-  { 0x1d7c0, G_UNICODE_NOT_PRESENT_OFFSET, 14455 },
-  { 0x1d7c1, G_UNICODE_NOT_PRESENT_OFFSET, 14458 },
-  { 0x1d7c2, G_UNICODE_NOT_PRESENT_OFFSET, 14461 },
-  { 0x1d7c3, G_UNICODE_NOT_PRESENT_OFFSET, 14464 },
-  { 0x1d7c4, G_UNICODE_NOT_PRESENT_OFFSET, 1405 },
-  { 0x1d7c5, G_UNICODE_NOT_PRESENT_OFFSET, 1371 },
-  { 0x1d7c6, G_UNICODE_NOT_PRESENT_OFFSET, 1393 },
-  { 0x1d7c7, G_UNICODE_NOT_PRESENT_OFFSET, 1387 },
-  { 0x1d7c8, G_UNICODE_NOT_PRESENT_OFFSET, 1396 },
-  { 0x1d7c9, G_UNICODE_NOT_PRESENT_OFFSET, 1390 },
-  { 0x1d7ce, G_UNICODE_NOT_PRESENT_OFFSET, 4941 },
-  { 0x1d7cf, G_UNICODE_NOT_PRESENT_OFFSET, 27 },
-  { 0x1d7d0, G_UNICODE_NOT_PRESENT_OFFSET, 12 },
-  { 0x1d7d1, G_UNICODE_NOT_PRESENT_OFFSET, 14 },
-  { 0x1d7d2, G_UNICODE_NOT_PRESENT_OFFSET, 4945 },
-  { 0x1d7d3, G_UNICODE_NOT_PRESENT_OFFSET, 4947 },
-  { 0x1d7d4, G_UNICODE_NOT_PRESENT_OFFSET, 4949 },
-  { 0x1d7d5, G_UNICODE_NOT_PRESENT_OFFSET, 4951 },
-  { 0x1d7d6, G_UNICODE_NOT_PRESENT_OFFSET, 4953 },
-  { 0x1d7d7, G_UNICODE_NOT_PRESENT_OFFSET, 4955 },
-  { 0x1d7d8, G_UNICODE_NOT_PRESENT_OFFSET, 4941 },
-  { 0x1d7d9, G_UNICODE_NOT_PRESENT_OFFSET, 27 },
-  { 0x1d7da, G_UNICODE_NOT_PRESENT_OFFSET, 12 },
-  { 0x1d7db, G_UNICODE_NOT_PRESENT_OFFSET, 14 },
-  { 0x1d7dc, G_UNICODE_NOT_PRESENT_OFFSET, 4945 },
-  { 0x1d7dd, G_UNICODE_NOT_PRESENT_OFFSET, 4947 },
-  { 0x1d7de, G_UNICODE_NOT_PRESENT_OFFSET, 4949 },
-  { 0x1d7df, G_UNICODE_NOT_PRESENT_OFFSET, 4951 },
-  { 0x1d7e0, G_UNICODE_NOT_PRESENT_OFFSET, 4953 },
-  { 0x1d7e1, G_UNICODE_NOT_PRESENT_OFFSET, 4955 },
-  { 0x1d7e2, G_UNICODE_NOT_PRESENT_OFFSET, 4941 },
-  { 0x1d7e3, G_UNICODE_NOT_PRESENT_OFFSET, 27 },
-  { 0x1d7e4, G_UNICODE_NOT_PRESENT_OFFSET, 12 },
-  { 0x1d7e5, G_UNICODE_NOT_PRESENT_OFFSET, 14 },
-  { 0x1d7e6, G_UNICODE_NOT_PRESENT_OFFSET, 4945 },
-  { 0x1d7e7, G_UNICODE_NOT_PRESENT_OFFSET, 4947 },
-  { 0x1d7e8, G_UNICODE_NOT_PRESENT_OFFSET, 4949 },
-  { 0x1d7e9, G_UNICODE_NOT_PRESENT_OFFSET, 4951 },
-  { 0x1d7ea, G_UNICODE_NOT_PRESENT_OFFSET, 4953 },
-  { 0x1d7eb, G_UNICODE_NOT_PRESENT_OFFSET, 4955 },
-  { 0x1d7ec, G_UNICODE_NOT_PRESENT_OFFSET, 4941 },
-  { 0x1d7ed, G_UNICODE_NOT_PRESENT_OFFSET, 27 },
-  { 0x1d7ee, G_UNICODE_NOT_PRESENT_OFFSET, 12 },
-  { 0x1d7ef, G_UNICODE_NOT_PRESENT_OFFSET, 14 },
-  { 0x1d7f0, G_UNICODE_NOT_PRESENT_OFFSET, 4945 },
-  { 0x1d7f1, G_UNICODE_NOT_PRESENT_OFFSET, 4947 },
-  { 0x1d7f2, G_UNICODE_NOT_PRESENT_OFFSET, 4949 },
-  { 0x1d7f3, G_UNICODE_NOT_PRESENT_OFFSET, 4951 },
-  { 0x1d7f4, G_UNICODE_NOT_PRESENT_OFFSET, 4953 },
-  { 0x1d7f5, G_UNICODE_NOT_PRESENT_OFFSET, 4955 },
-  { 0x1d7f6, G_UNICODE_NOT_PRESENT_OFFSET, 4941 },
-  { 0x1d7f7, G_UNICODE_NOT_PRESENT_OFFSET, 27 },
-  { 0x1d7f8, G_UNICODE_NOT_PRESENT_OFFSET, 12 },
-  { 0x1d7f9, G_UNICODE_NOT_PRESENT_OFFSET, 14 },
-  { 0x1d7fa, G_UNICODE_NOT_PRESENT_OFFSET, 4945 },
-  { 0x1d7fb, G_UNICODE_NOT_PRESENT_OFFSET, 4947 },
-  { 0x1d7fc, G_UNICODE_NOT_PRESENT_OFFSET, 4949 },
-  { 0x1d7fd, G_UNICODE_NOT_PRESENT_OFFSET, 4951 },
-  { 0x1d7fe, G_UNICODE_NOT_PRESENT_OFFSET, 4953 },
-  { 0x1d7ff, G_UNICODE_NOT_PRESENT_OFFSET, 4955 },
-  { 0x2f800, 14468, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f801, 14472, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f802, 14476, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f803, 14480, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f804, 14485, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f805, 11545, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f806, 14489, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f807, 14493, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f808, 14497, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f809, 14501, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f80a, 11549, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f80b, 14505, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f80c, 14509, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f80d, 14513, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f80e, 11553, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f80f, 14518, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f810, 14522, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f811, 14526, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f812, 14530, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f813, 14535, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f814, 14539, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f815, 14543, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f816, 14547, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f817, 14552, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f818, 14556, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f819, 14560, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f81a, 14564, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f81b, 14568, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f81c, 14572, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f81d, 5967, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f81e, 14577, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f81f, 14581, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f820, 14585, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f821, 14589, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f822, 14593, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f823, 14597, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f824, 14601, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f825, 14605, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f826, 11557, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f827, 11561, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f828, 14609, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f829, 14613, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f82a, 14617, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f82b, 10837, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f82c, 14621, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f82d, 11565, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f82e, 14625, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f82f, 14629, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f830, 14633, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f831, 14637, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f832, 14637, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f833, 14637, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f834, 14641, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f835, 14646, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f836, 14650, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f837, 14654, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f838, 14658, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f839, 14663, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f83a, 14667, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f83b, 14671, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f83c, 14675, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f83d, 14679, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f83e, 14683, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f83f, 14687, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f840, 14691, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f841, 14695, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f842, 14699, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f843, 14703, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f844, 14707, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f845, 14711, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f846, 14711, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f847, 14715, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f848, 14719, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f849, 14723, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f84a, 14727, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f84b, 14731, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f84c, 11573, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f84d, 14735, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f84e, 14739, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f84f, 14743, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f850, 11421, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f851, 14747, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f852, 14751, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f853, 14755, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f854, 14759, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f855, 14763, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f856, 14767, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f857, 14771, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f858, 14775, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f859, 14779, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f85a, 14784, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f85b, 14788, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f85c, 14792, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f85d, 14796, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f85e, 14800, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f85f, 14804, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f860, 14808, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f861, 14813, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f862, 14818, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f863, 14822, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f864, 14826, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f865, 14830, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f866, 14834, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f867, 14838, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f868, 14842, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f869, 14847, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f86a, 14851, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f86b, 14851, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f86c, 14855, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f86d, 14860, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f86e, 14864, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f86f, 10821, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f870, 14868, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f871, 14872, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f872, 14877, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f873, 14881, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f874, 14885, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f875, 6071, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f876, 14889, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f877, 14893, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f878, 6079, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f879, 14897, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f87a, 14901, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f87b, 14905, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f87c, 14910, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f87d, 14914, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f87e, 14919, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f87f, 14923, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f880, 14927, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f881, 14931, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f882, 14935, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f883, 14939, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f884, 14943, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f885, 14947, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f886, 14951, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f887, 14955, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f888, 14959, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f889, 14963, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f88a, 14968, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f88b, 14972, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f88c, 14976, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f88d, 14980, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f88e, 10613, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f88f, 14984, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f890, 6119, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f891, 14989, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f892, 14989, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f893, 14994, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f894, 14998, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f895, 14998, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f896, 15002, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f897, 15006, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f898, 15011, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f899, 15016, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f89a, 15020, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f89b, 15024, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f89c, 15028, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f89d, 15032, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f89e, 15036, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f89f, 15040, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f8a0, 15044, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f8a1, 15048, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f8a2, 15052, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f8a3, 11593, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f8a4, 15056, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f8a5, 15061, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f8a6, 15065, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f8a7, 15069, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f8a8, 15073, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f8a9, 15069, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f8aa, 15077, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f8ab, 11601, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f8ac, 15081, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f8ad, 15085, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f8ae, 15089, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f8af, 15093, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f8b0, 11605, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f8b1, 10505, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f8b2, 15097, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f8b3, 15101, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f8b4, 15105, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f8b5, 15109, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f8b6, 15113, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f8b7, 15117, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f8b8, 15121, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f8b9, 15126, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f8ba, 15130, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f8bb, 15134, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f8bc, 15138, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f8bd, 15142, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f8be, 15146, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f8bf, 15151, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f8c0, 15155, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f8c1, 15159, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f8c2, 15163, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f8c3, 15167, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f8c4, 15171, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f8c5, 15175, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f8c6, 15179, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f8c7, 15183, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f8c8, 11609, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f8c9, 15187, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f8ca, 15191, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f8cb, 15196, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f8cc, 15200, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f8cd, 15204, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f8ce, 15208, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f8cf, 11617, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f8d0, 15212, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f8d1, 15216, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f8d2, 15220, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f8d3, 15224, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f8d4, 15228, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f8d5, 15232, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f8d6, 15236, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f8d7, 15240, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f8d8, 10617, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f8d9, 15244, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f8da, 15248, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f8db, 15252, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f8dc, 15256, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f8dd, 15260, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f8de, 15265, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f8df, 15269, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f8e0, 15273, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f8e1, 15277, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f8e2, 11621, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f8e3, 15281, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f8e4, 15286, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f8e5, 15290, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f8e6, 15294, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f8e7, 15298, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f8e8, 15302, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f8e9, 15306, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f8ea, 15310, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f8eb, 15314, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f8ec, 15318, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f8ed, 15323, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f8ee, 15327, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f8ef, 15331, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f8f0, 15335, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f8f1, 15340, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f8f2, 15344, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f8f3, 15348, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f8f4, 15352, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f8f5, 10889, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f8f6, 15356, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f8f7, 15360, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f8f8, 15365, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f8f9, 15370, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f8fa, 15375, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f8fb, 15379, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f8fc, 15384, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f8fd, 15388, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f8fe, 15392, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f8ff, 15396, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f900, 15400, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f901, 11625, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f902, 11221, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f903, 15404, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f904, 15408, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f905, 15412, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f906, 15416, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f907, 15421, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f908, 15425, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f909, 15429, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f90a, 15433, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f90b, 15437, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f90c, 15441, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f90d, 15445, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f90e, 15450, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f90f, 15454, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f910, 15458, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f911, 15463, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f912, 15468, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f913, 15472, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f914, 15476, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f915, 15480, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f916, 15484, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f917, 15488, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f918, 15492, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f919, 15496, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f91a, 15500, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f91b, 15504, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f91c, 15509, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f91d, 15513, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f91e, 15518, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f91f, 15522, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f920, 15526, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f921, 15530, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f922, 15534, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f923, 15538, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f924, 15543, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f925, 15547, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f926, 15551, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f927, 15556, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f928, 15561, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f929, 15565, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f92a, 15569, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f92b, 15573, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f92c, 15577, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f92d, 15577, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f92e, 15581, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f92f, 15585, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f930, 15589, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f931, 15593, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f932, 15597, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f933, 15601, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f934, 15605, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f935, 15609, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f936, 15614, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f937, 15618, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f938, 10833, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f939, 15623, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f93a, 15628, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f93b, 15632, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f93c, 15637, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f93d, 15642, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f93e, 15647, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f93f, 15651, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f940, 15655, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f941, 15659, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f942, 15664, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f943, 15669, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f944, 15674, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f945, 15679, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f946, 15683, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f947, 15683, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f948, 15687, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f949, 15691, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f94a, 15695, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f94b, 15699, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f94c, 15703, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f94d, 15707, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f94e, 15712, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f94f, 10685, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f950, 15716, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f951, 15720, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f952, 15724, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f953, 11665, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f954, 15729, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f955, 15734, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f956, 11501, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f957, 15739, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f958, 15743, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f959, 11677, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f95a, 15747, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f95b, 15751, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f95c, 15755, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f95d, 15760, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f95e, 15760, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f95f, 15765, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f960, 15769, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f961, 15773, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f962, 15778, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f963, 15782, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f964, 15786, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f965, 15790, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f966, 15795, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f967, 15799, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f968, 15803, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f969, 15807, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f96a, 15811, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f96b, 15815, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f96c, 15820, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f96d, 15824, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f96e, 15828, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f96f, 15832, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f970, 15836, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f971, 15840, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f972, 15844, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f973, 15849, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f974, 15854, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f975, 15858, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f976, 15863, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f977, 15867, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f978, 15872, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f979, 15876, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f97a, 11701, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f97b, 15880, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f97c, 15885, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f97d, 15890, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f97e, 15894, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f97f, 15899, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f980, 15903, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f981, 15908, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f982, 15912, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f983, 15916, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f984, 15920, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f985, 15924, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f986, 15928, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f987, 15932, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f988, 15937, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f989, 15942, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f98a, 15947, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f98b, 14994, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f98c, 15952, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f98d, 15956, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f98e, 15960, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f98f, 15964, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f990, 15968, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f991, 15972, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f992, 15976, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f993, 15980, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f994, 15984, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f995, 15988, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f996, 15992, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f997, 15996, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f998, 10901, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f999, 16001, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f99a, 16005, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f99b, 16009, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f99c, 16013, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f99d, 16017, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f99e, 16021, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f99f, 11713, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f9a0, 16025, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f9a1, 16029, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f9a2, 16033, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f9a3, 16037, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f9a4, 16041, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f9a5, 16046, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f9a6, 16051, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f9a7, 16056, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f9a8, 16060, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f9a9, 16064, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f9aa, 16068, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f9ab, 16072, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f9ac, 16077, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f9ad, 16081, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f9ae, 16086, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f9af, 16090, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f9b0, 16094, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f9b1, 16099, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f9b2, 16104, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f9b3, 16108, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f9b4, 10665, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f9b5, 16112, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f9b6, 16116, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f9b7, 16120, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f9b8, 16124, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f9b9, 16128, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f9ba, 16132, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f9bb, 16136, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f9bc, 16140, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f9bd, 16144, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f9be, 16148, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f9bf, 16152, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f9c0, 16156, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f9c1, 16160, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f9c2, 16164, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f9c3, 16168, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f9c4, 6479, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f9c5, 16172, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f9c6, 16177, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f9c7, 16181, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f9c8, 16185, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f9c9, 16189, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f9ca, 16193, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f9cb, 16197, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f9cc, 16202, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f9cd, 16207, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f9ce, 16211, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f9cf, 16215, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f9d0, 16219, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f9d1, 16223, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f9d2, 6507, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f9d3, 16227, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f9d4, 16232, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f9d5, 16236, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f9d6, 16240, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f9d7, 16244, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f9d8, 16248, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f9d9, 16253, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f9da, 16258, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f9db, 16262, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f9dc, 16266, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f9dd, 16270, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f9de, 16275, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f9df, 16279, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f9e0, 16283, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f9e1, 16288, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f9e2, 16293, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f9e3, 16297, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f9e4, 16301, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f9e5, 16305, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f9e6, 16310, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f9e7, 16314, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f9e8, 16318, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f9e9, 16322, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f9ea, 16326, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f9eb, 16330, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f9ec, 16334, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f9ed, 16338, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f9ee, 16343, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f9ef, 16347, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f9f0, 16351, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f9f1, 16355, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f9f2, 16360, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f9f3, 16364, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f9f4, 16368, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f9f5, 16372, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f9f6, 16376, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f9f7, 16381, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f9f8, 16386, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f9f9, 16390, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f9fa, 16394, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f9fb, 16398, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f9fc, 16403, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f9fd, 16407, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f9fe, 16412, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2f9ff, 16412, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2fa00, 16416, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2fa01, 16420, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2fa02, 16425, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2fa03, 16429, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2fa04, 16433, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2fa05, 16437, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2fa06, 16441, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2fa07, 16445, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2fa08, 16449, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2fa09, 16453, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2fa0a, 16458, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2fa0b, 16462, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2fa0c, 16466, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2fa0d, 16470, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2fa0e, 16474, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2fa0f, 16478, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2fa10, 16482, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2fa11, 16487, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2fa12, 16491, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2fa13, 16496, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2fa14, 16501, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2fa15, 6699, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2fa16, 16506, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2fa17, 6715, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2fa18, 16510, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2fa19, 16514, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2fa1a, 16518, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2fa1b, 16522, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2fa1c, 6735, G_UNICODE_NOT_PRESENT_OFFSET },
-  { 0x2fa1d, 16526, G_UNICODE_NOT_PRESENT_OFFSET }
-};
-
-static const gchar decomp_expansion_string[] = 
-  "\x20\0" /* offset 0 */
-  "\x20\xcc\x88\0" /* offset 2 */
-  "\x61\0" /* offset 6 */
-  "\x20\xcc\x84\0" /* offset 8 */
-  "\x32\0" /* offset 12 */
-  "\x33\0" /* offset 14 */
-  "\x20\xcc\x81\0" /* offset 16 */
-  "\xce\xbc\0" /* offset 20 */
-  "\x20\xcc\xa7\0" /* offset 23 */
-  "\x31\0" /* offset 27 */
-  "\x6f\0" /* offset 29 */
-  "\x31\xe2\x81\x84\x34\0" /* offset 31 */
-  "\x31\xe2\x81\x84\x32\0" /* offset 37 */
-  "\x33\xe2\x81\x84\x34\0" /* offset 43 */
-  "\x41\xcc\x80\0" /* offset 49 */
-  "\x41\xcc\x81\0" /* offset 53 */
-  "\x41\xcc\x82\0" /* offset 57 */
-  "\x41\xcc\x83\0" /* offset 61 */
-  "\x41\xcc\x88\0" /* offset 65 */
-  "\x41\xcc\x8a\0" /* offset 69 */
-  "\x43\xcc\xa7\0" /* offset 73 */
-  "\x45\xcc\x80\0" /* offset 77 */
-  "\x45\xcc\x81\0" /* offset 81 */
-  "\x45\xcc\x82\0" /* offset 85 */
-  "\x45\xcc\x88\0" /* offset 89 */
-  "\x49\xcc\x80\0" /* offset 93 */
-  "\x49\xcc\x81\0" /* offset 97 */
-  "\x49\xcc\x82\0" /* offset 101 */
-  "\x49\xcc\x88\0" /* offset 105 */
-  "\x4e\xcc\x83\0" /* offset 109 */
-  "\x4f\xcc\x80\0" /* offset 113 */
-  "\x4f\xcc\x81\0" /* offset 117 */
-  "\x4f\xcc\x82\0" /* offset 121 */
-  "\x4f\xcc\x83\0" /* offset 125 */
-  "\x4f\xcc\x88\0" /* offset 129 */
-  "\x55\xcc\x80\0" /* offset 133 */
-  "\x55\xcc\x81\0" /* offset 137 */
-  "\x55\xcc\x82\0" /* offset 141 */
-  "\x55\xcc\x88\0" /* offset 145 */
-  "\x59\xcc\x81\0" /* offset 149 */
-  "\x61\xcc\x80\0" /* offset 153 */
-  "\x61\xcc\x81\0" /* offset 157 */
-  "\x61\xcc\x82\0" /* offset 161 */
-  "\x61\xcc\x83\0" /* offset 165 */
-  "\x61\xcc\x88\0" /* offset 169 */
-  "\x61\xcc\x8a\0" /* offset 173 */
-  "\x63\xcc\xa7\0" /* offset 177 */
-  "\x65\xcc\x80\0" /* offset 181 */
-  "\x65\xcc\x81\0" /* offset 185 */
-  "\x65\xcc\x82\0" /* offset 189 */
-  "\x65\xcc\x88\0" /* offset 193 */
-  "\x69\xcc\x80\0" /* offset 197 */
-  "\x69\xcc\x81\0" /* offset 201 */
-  "\x69\xcc\x82\0" /* offset 205 */
-  "\x69\xcc\x88\0" /* offset 209 */
-  "\x6e\xcc\x83\0" /* offset 213 */
-  "\x6f\xcc\x80\0" /* offset 217 */
-  "\x6f\xcc\x81\0" /* offset 221 */
-  "\x6f\xcc\x82\0" /* offset 225 */
-  "\x6f\xcc\x83\0" /* offset 229 */
-  "\x6f\xcc\x88\0" /* offset 233 */
-  "\x75\xcc\x80\0" /* offset 237 */
-  "\x75\xcc\x81\0" /* offset 241 */
-  "\x75\xcc\x82\0" /* offset 245 */
-  "\x75\xcc\x88\0" /* offset 249 */
-  "\x79\xcc\x81\0" /* offset 253 */
-  "\x79\xcc\x88\0" /* offset 257 */
-  "\x41\xcc\x84\0" /* offset 261 */
-  "\x61\xcc\x84\0" /* offset 265 */
-  "\x41\xcc\x86\0" /* offset 269 */
-  "\x61\xcc\x86\0" /* offset 273 */
-  "\x41\xcc\xa8\0" /* offset 277 */
-  "\x61\xcc\xa8\0" /* offset 281 */
-  "\x43\xcc\x81\0" /* offset 285 */
-  "\x63\xcc\x81\0" /* offset 289 */
-  "\x43\xcc\x82\0" /* offset 293 */
-  "\x63\xcc\x82\0" /* offset 297 */
-  "\x43\xcc\x87\0" /* offset 301 */
-  "\x63\xcc\x87\0" /* offset 305 */
-  "\x43\xcc\x8c\0" /* offset 309 */
-  "\x63\xcc\x8c\0" /* offset 313 */
-  "\x44\xcc\x8c\0" /* offset 317 */
-  "\x64\xcc\x8c\0" /* offset 321 */
-  "\x45\xcc\x84\0" /* offset 325 */
-  "\x65\xcc\x84\0" /* offset 329 */
-  "\x45\xcc\x86\0" /* offset 333 */
-  "\x65\xcc\x86\0" /* offset 337 */
-  "\x45\xcc\x87\0" /* offset 341 */
-  "\x65\xcc\x87\0" /* offset 345 */
-  "\x45\xcc\xa8\0" /* offset 349 */
-  "\x65\xcc\xa8\0" /* offset 353 */
-  "\x45\xcc\x8c\0" /* offset 357 */
-  "\x65\xcc\x8c\0" /* offset 361 */
-  "\x47\xcc\x82\0" /* offset 365 */
-  "\x67\xcc\x82\0" /* offset 369 */
-  "\x47\xcc\x86\0" /* offset 373 */
-  "\x67\xcc\x86\0" /* offset 377 */
-  "\x47\xcc\x87\0" /* offset 381 */
-  "\x67\xcc\x87\0" /* offset 385 */
-  "\x47\xcc\xa7\0" /* offset 389 */
-  "\x67\xcc\xa7\0" /* offset 393 */
-  "\x48\xcc\x82\0" /* offset 397 */
-  "\x68\xcc\x82\0" /* offset 401 */
-  "\x49\xcc\x83\0" /* offset 405 */
-  "\x69\xcc\x83\0" /* offset 409 */
-  "\x49\xcc\x84\0" /* offset 413 */
-  "\x69\xcc\x84\0" /* offset 417 */
-  "\x49\xcc\x86\0" /* offset 421 */
-  "\x69\xcc\x86\0" /* offset 425 */
-  "\x49\xcc\xa8\0" /* offset 429 */
-  "\x69\xcc\xa8\0" /* offset 433 */
-  "\x49\xcc\x87\0" /* offset 437 */
-  "\x49\x4a\0" /* offset 441 */
-  "\x69\x6a\0" /* offset 444 */
-  "\x4a\xcc\x82\0" /* offset 447 */
-  "\x6a\xcc\x82\0" /* offset 451 */
-  "\x4b\xcc\xa7\0" /* offset 455 */
-  "\x6b\xcc\xa7\0" /* offset 459 */
-  "\x4c\xcc\x81\0" /* offset 463 */
-  "\x6c\xcc\x81\0" /* offset 467 */
-  "\x4c\xcc\xa7\0" /* offset 471 */
-  "\x6c\xcc\xa7\0" /* offset 475 */
-  "\x4c\xcc\x8c\0" /* offset 479 */
-  "\x6c\xcc\x8c\0" /* offset 483 */
-  "\x4c\xc2\xb7\0" /* offset 487 */
-  "\x6c\xc2\xb7\0" /* offset 491 */
-  "\x4e\xcc\x81\0" /* offset 495 */
-  "\x6e\xcc\x81\0" /* offset 499 */
-  "\x4e\xcc\xa7\0" /* offset 503 */
-  "\x6e\xcc\xa7\0" /* offset 507 */
-  "\x4e\xcc\x8c\0" /* offset 511 */
-  "\x6e\xcc\x8c\0" /* offset 515 */
-  "\xca\xbc\x6e\0" /* offset 519 */
-  "\x4f\xcc\x84\0" /* offset 523 */
-  "\x6f\xcc\x84\0" /* offset 527 */
-  "\x4f\xcc\x86\0" /* offset 531 */
-  "\x6f\xcc\x86\0" /* offset 535 */
-  "\x4f\xcc\x8b\0" /* offset 539 */
-  "\x6f\xcc\x8b\0" /* offset 543 */
-  "\x52\xcc\x81\0" /* offset 547 */
-  "\x72\xcc\x81\0" /* offset 551 */
-  "\x52\xcc\xa7\0" /* offset 555 */
-  "\x72\xcc\xa7\0" /* offset 559 */
-  "\x52\xcc\x8c\0" /* offset 563 */
-  "\x72\xcc\x8c\0" /* offset 567 */
-  "\x53\xcc\x81\0" /* offset 571 */
-  "\x73\xcc\x81\0" /* offset 575 */
-  "\x53\xcc\x82\0" /* offset 579 */
-  "\x73\xcc\x82\0" /* offset 583 */
-  "\x53\xcc\xa7\0" /* offset 587 */
-  "\x73\xcc\xa7\0" /* offset 591 */
-  "\x53\xcc\x8c\0" /* offset 595 */
-  "\x73\xcc\x8c\0" /* offset 599 */
-  "\x54\xcc\xa7\0" /* offset 603 */
-  "\x74\xcc\xa7\0" /* offset 607 */
-  "\x54\xcc\x8c\0" /* offset 611 */
-  "\x74\xcc\x8c\0" /* offset 615 */
-  "\x55\xcc\x83\0" /* offset 619 */
-  "\x75\xcc\x83\0" /* offset 623 */
-  "\x55\xcc\x84\0" /* offset 627 */
-  "\x75\xcc\x84\0" /* offset 631 */
-  "\x55\xcc\x86\0" /* offset 635 */
-  "\x75\xcc\x86\0" /* offset 639 */
-  "\x55\xcc\x8a\0" /* offset 643 */
-  "\x75\xcc\x8a\0" /* offset 647 */
-  "\x55\xcc\x8b\0" /* offset 651 */
-  "\x75\xcc\x8b\0" /* offset 655 */
-  "\x55\xcc\xa8\0" /* offset 659 */
-  "\x75\xcc\xa8\0" /* offset 663 */
-  "\x57\xcc\x82\0" /* offset 667 */
-  "\x77\xcc\x82\0" /* offset 671 */
-  "\x59\xcc\x82\0" /* offset 675 */
-  "\x79\xcc\x82\0" /* offset 679 */
-  "\x59\xcc\x88\0" /* offset 683 */
-  "\x5a\xcc\x81\0" /* offset 687 */
-  "\x7a\xcc\x81\0" /* offset 691 */
-  "\x5a\xcc\x87\0" /* offset 695 */
-  "\x7a\xcc\x87\0" /* offset 699 */
-  "\x5a\xcc\x8c\0" /* offset 703 */
-  "\x7a\xcc\x8c\0" /* offset 707 */
-  "\x73\0" /* offset 711 */
-  "\x4f\xcc\x9b\0" /* offset 713 */
-  "\x6f\xcc\x9b\0" /* offset 717 */
-  "\x55\xcc\x9b\0" /* offset 721 */
-  "\x75\xcc\x9b\0" /* offset 725 */
-  "\x44\x5a\xcc\x8c\0" /* offset 729 */
-  "\x44\x7a\xcc\x8c\0" /* offset 734 */
-  "\x64\x7a\xcc\x8c\0" /* offset 739 */
-  "\x4c\x4a\0" /* offset 744 */
-  "\x4c\x6a\0" /* offset 747 */
-  "\x6c\x6a\0" /* offset 750 */
-  "\x4e\x4a\0" /* offset 753 */
-  "\x4e\x6a\0" /* offset 756 */
-  "\x6e\x6a\0" /* offset 759 */
-  "\x41\xcc\x8c\0" /* offset 762 */
-  "\x61\xcc\x8c\0" /* offset 766 */
-  "\x49\xcc\x8c\0" /* offset 770 */
-  "\x69\xcc\x8c\0" /* offset 774 */
-  "\x4f\xcc\x8c\0" /* offset 778 */
-  "\x6f\xcc\x8c\0" /* offset 782 */
-  "\x55\xcc\x8c\0" /* offset 786 */
-  "\x75\xcc\x8c\0" /* offset 790 */
-  "\x55\xcc\x88\xcc\x84\0" /* offset 794 */
-  "\x75\xcc\x88\xcc\x84\0" /* offset 800 */
-  "\x55\xcc\x88\xcc\x81\0" /* offset 806 */
-  "\x75\xcc\x88\xcc\x81\0" /* offset 812 */
-  "\x55\xcc\x88\xcc\x8c\0" /* offset 818 */
-  "\x75\xcc\x88\xcc\x8c\0" /* offset 824 */
-  "\x55\xcc\x88\xcc\x80\0" /* offset 830 */
-  "\x75\xcc\x88\xcc\x80\0" /* offset 836 */
-  "\x41\xcc\x88\xcc\x84\0" /* offset 842 */
-  "\x61\xcc\x88\xcc\x84\0" /* offset 848 */
-  "\x41\xcc\x87\xcc\x84\0" /* offset 854 */
-  "\x61\xcc\x87\xcc\x84\0" /* offset 860 */
-  "\xc3\x86\xcc\x84\0" /* offset 866 */
-  "\xc3\xa6\xcc\x84\0" /* offset 871 */
-  "\x47\xcc\x8c\0" /* offset 876 */
-  "\x67\xcc\x8c\0" /* offset 880 */
-  "\x4b\xcc\x8c\0" /* offset 884 */
-  "\x6b\xcc\x8c\0" /* offset 888 */
-  "\x4f\xcc\xa8\0" /* offset 892 */
-  "\x6f\xcc\xa8\0" /* offset 896 */
-  "\x4f\xcc\xa8\xcc\x84\0" /* offset 900 */
-  "\x6f\xcc\xa8\xcc\x84\0" /* offset 906 */
-  "\xc6\xb7\xcc\x8c\0" /* offset 912 */
-  "\xca\x92\xcc\x8c\0" /* offset 917 */
-  "\x6a\xcc\x8c\0" /* offset 922 */
-  "\x44\x5a\0" /* offset 926 */
-  "\x44\x7a\0" /* offset 929 */
-  "\x64\x7a\0" /* offset 932 */
-  "\x47\xcc\x81\0" /* offset 935 */
-  "\x67\xcc\x81\0" /* offset 939 */
-  "\x4e\xcc\x80\0" /* offset 943 */
-  "\x6e\xcc\x80\0" /* offset 947 */
-  "\x41\xcc\x8a\xcc\x81\0" /* offset 951 */
-  "\x61\xcc\x8a\xcc\x81\0" /* offset 957 */
-  "\xc3\x86\xcc\x81\0" /* offset 963 */
-  "\xc3\xa6\xcc\x81\0" /* offset 968 */
-  "\xc3\x98\xcc\x81\0" /* offset 973 */
-  "\xc3\xb8\xcc\x81\0" /* offset 978 */
-  "\x41\xcc\x8f\0" /* offset 983 */
-  "\x61\xcc\x8f\0" /* offset 987 */
-  "\x41\xcc\x91\0" /* offset 991 */
-  "\x61\xcc\x91\0" /* offset 995 */
-  "\x45\xcc\x8f\0" /* offset 999 */
-  "\x65\xcc\x8f\0" /* offset 1003 */
-  "\x45\xcc\x91\0" /* offset 1007 */
-  "\x65\xcc\x91\0" /* offset 1011 */
-  "\x49\xcc\x8f\0" /* offset 1015 */
-  "\x69\xcc\x8f\0" /* offset 1019 */
-  "\x49\xcc\x91\0" /* offset 1023 */
-  "\x69\xcc\x91\0" /* offset 1027 */
-  "\x4f\xcc\x8f\0" /* offset 1031 */
-  "\x6f\xcc\x8f\0" /* offset 1035 */
-  "\x4f\xcc\x91\0" /* offset 1039 */
-  "\x6f\xcc\x91\0" /* offset 1043 */
-  "\x52\xcc\x8f\0" /* offset 1047 */
-  "\x72\xcc\x8f\0" /* offset 1051 */
-  "\x52\xcc\x91\0" /* offset 1055 */
-  "\x72\xcc\x91\0" /* offset 1059 */
-  "\x55\xcc\x8f\0" /* offset 1063 */
-  "\x75\xcc\x8f\0" /* offset 1067 */
-  "\x55\xcc\x91\0" /* offset 1071 */
-  "\x75\xcc\x91\0" /* offset 1075 */
-  "\x53\xcc\xa6\0" /* offset 1079 */
-  "\x73\xcc\xa6\0" /* offset 1083 */
-  "\x54\xcc\xa6\0" /* offset 1087 */
-  "\x74\xcc\xa6\0" /* offset 1091 */
-  "\x48\xcc\x8c\0" /* offset 1095 */
-  "\x68\xcc\x8c\0" /* offset 1099 */
-  "\x41\xcc\x87\0" /* offset 1103 */
-  "\x61\xcc\x87\0" /* offset 1107 */
-  "\x45\xcc\xa7\0" /* offset 1111 */
-  "\x65\xcc\xa7\0" /* offset 1115 */
-  "\x4f\xcc\x88\xcc\x84\0" /* offset 1119 */
-  "\x6f\xcc\x88\xcc\x84\0" /* offset 1125 */
-  "\x4f\xcc\x83\xcc\x84\0" /* offset 1131 */
-  "\x6f\xcc\x83\xcc\x84\0" /* offset 1137 */
-  "\x4f\xcc\x87\0" /* offset 1143 */
-  "\x6f\xcc\x87\0" /* offset 1147 */
-  "\x4f\xcc\x87\xcc\x84\0" /* offset 1151 */
-  "\x6f\xcc\x87\xcc\x84\0" /* offset 1157 */
-  "\x59\xcc\x84\0" /* offset 1163 */
-  "\x79\xcc\x84\0" /* offset 1167 */
-  "\x68\0" /* offset 1171 */
-  "\xc9\xa6\0" /* offset 1173 */
-  "\x6a\0" /* offset 1176 */
-  "\x72\0" /* offset 1178 */
-  "\xc9\xb9\0" /* offset 1180 */
-  "\xc9\xbb\0" /* offset 1183 */
-  "\xca\x81\0" /* offset 1186 */
-  "\x77\0" /* offset 1189 */
-  "\x79\0" /* offset 1191 */
-  "\x20\xcc\x86\0" /* offset 1193 */
-  "\x20\xcc\x87\0" /* offset 1197 */
-  "\x20\xcc\x8a\0" /* offset 1201 */
-  "\x20\xcc\xa8\0" /* offset 1205 */
-  "\x20\xcc\x83\0" /* offset 1209 */
-  "\x20\xcc\x8b\0" /* offset 1213 */
-  "\xc9\xa3\0" /* offset 1217 */
-  "\x6c\0" /* offset 1220 */
-  "\x78\0" /* offset 1222 */
-  "\xca\x95\0" /* offset 1224 */
-  "\xcc\x80\0" /* offset 1227 */
-  "\xcc\x81\0" /* offset 1230 */
-  "\xcc\x93\0" /* offset 1233 */
-  "\xcc\x88\xcc\x81\0" /* offset 1236 */
-  "\xca\xb9\0" /* offset 1241 */
-  "\x20\xcd\x85\0" /* offset 1244 */
-  "\x3b\0" /* offset 1248 */
-  "\xc2\xa8\xcc\x81\0" /* offset 1250 */
-  "\x20\xcc\x88\xcc\x81\0" /* offset 1255 */
-  "\xce\x91\xcc\x81\0" /* offset 1261 */
-  "\xc2\xb7\0" /* offset 1266 */
-  "\xce\x95\xcc\x81\0" /* offset 1269 */
-  "\xce\x97\xcc\x81\0" /* offset 1274 */
-  "\xce\x99\xcc\x81\0" /* offset 1279 */
-  "\xce\x9f\xcc\x81\0" /* offset 1284 */
-  "\xce\xa5\xcc\x81\0" /* offset 1289 */
-  "\xce\xa9\xcc\x81\0" /* offset 1294 */
-  "\xce\xb9\xcc\x88\xcc\x81\0" /* offset 1299 */
-  "\xce\x99\xcc\x88\0" /* offset 1306 */
-  "\xce\xa5\xcc\x88\0" /* offset 1311 */
-  "\xce\xb1\xcc\x81\0" /* offset 1316 */
-  "\xce\xb5\xcc\x81\0" /* offset 1321 */
-  "\xce\xb7\xcc\x81\0" /* offset 1326 */
-  "\xce\xb9\xcc\x81\0" /* offset 1331 */
-  "\xcf\x85\xcc\x88\xcc\x81\0" /* offset 1336 */
-  "\xce\xb9\xcc\x88\0" /* offset 1343 */
-  "\xcf\x85\xcc\x88\0" /* offset 1348 */
-  "\xce\xbf\xcc\x81\0" /* offset 1353 */
-  "\xcf\x85\xcc\x81\0" /* offset 1358 */
-  "\xcf\x89\xcc\x81\0" /* offset 1363 */
-  "\xce\xb2\0" /* offset 1368 */
-  "\xce\xb8\0" /* offset 1371 */
-  "\xce\xa5\0" /* offset 1374 */
-  "\xcf\x92\xcc\x81\0" /* offset 1377 */
-  "\xcf\x92\xcc\x88\0" /* offset 1382 */
-  "\xcf\x86\0" /* offset 1387 */
-  "\xcf\x80\0" /* offset 1390 */
-  "\xce\xba\0" /* offset 1393 */
-  "\xcf\x81\0" /* offset 1396 */
-  "\xcf\x82\0" /* offset 1399 */
-  "\xce\x98\0" /* offset 1402 */
-  "\xce\xb5\0" /* offset 1405 */
-  "\xd0\x95\xcc\x80\0" /* offset 1408 */
-  "\xd0\x95\xcc\x88\0" /* offset 1413 */
-  "\xd0\x93\xcc\x81\0" /* offset 1418 */
-  "\xd0\x86\xcc\x88\0" /* offset 1423 */
-  "\xd0\x9a\xcc\x81\0" /* offset 1428 */
-  "\xd0\x98\xcc\x80\0" /* offset 1433 */
-  "\xd0\xa3\xcc\x86\0" /* offset 1438 */
-  "\xd0\x98\xcc\x86\0" /* offset 1443 */
-  "\xd0\xb8\xcc\x86\0" /* offset 1448 */
-  "\xd0\xb5\xcc\x80\0" /* offset 1453 */
-  "\xd0\xb5\xcc\x88\0" /* offset 1458 */
-  "\xd0\xb3\xcc\x81\0" /* offset 1463 */
-  "\xd1\x96\xcc\x88\0" /* offset 1468 */
-  "\xd0\xba\xcc\x81\0" /* offset 1473 */
-  "\xd0\xb8\xcc\x80\0" /* offset 1478 */
-  "\xd1\x83\xcc\x86\0" /* offset 1483 */
-  "\xd1\xb4\xcc\x8f\0" /* offset 1488 */
-  "\xd1\xb5\xcc\x8f\0" /* offset 1493 */
-  "\xd0\x96\xcc\x86\0" /* offset 1498 */
-  "\xd0\xb6\xcc\x86\0" /* offset 1503 */
-  "\xd0\x90\xcc\x86\0" /* offset 1508 */
-  "\xd0\xb0\xcc\x86\0" /* offset 1513 */
-  "\xd0\x90\xcc\x88\0" /* offset 1518 */
-  "\xd0\xb0\xcc\x88\0" /* offset 1523 */
-  "\xd0\x95\xcc\x86\0" /* offset 1528 */
-  "\xd0\xb5\xcc\x86\0" /* offset 1533 */
-  "\xd3\x98\xcc\x88\0" /* offset 1538 */
-  "\xd3\x99\xcc\x88\0" /* offset 1543 */
-  "\xd0\x96\xcc\x88\0" /* offset 1548 */
-  "\xd0\xb6\xcc\x88\0" /* offset 1553 */
-  "\xd0\x97\xcc\x88\0" /* offset 1558 */
-  "\xd0\xb7\xcc\x88\0" /* offset 1563 */
-  "\xd0\x98\xcc\x84\0" /* offset 1568 */
-  "\xd0\xb8\xcc\x84\0" /* offset 1573 */
-  "\xd0\x98\xcc\x88\0" /* offset 1578 */
-  "\xd0\xb8\xcc\x88\0" /* offset 1583 */
-  "\xd0\x9e\xcc\x88\0" /* offset 1588 */
-  "\xd0\xbe\xcc\x88\0" /* offset 1593 */
-  "\xd3\xa8\xcc\x88\0" /* offset 1598 */
-  "\xd3\xa9\xcc\x88\0" /* offset 1603 */
-  "\xd0\xad\xcc\x88\0" /* offset 1608 */
-  "\xd1\x8d\xcc\x88\0" /* offset 1613 */
-  "\xd0\xa3\xcc\x84\0" /* offset 1618 */
-  "\xd1\x83\xcc\x84\0" /* offset 1623 */
-  "\xd0\xa3\xcc\x88\0" /* offset 1628 */
-  "\xd1\x83\xcc\x88\0" /* offset 1633 */
-  "\xd0\xa3\xcc\x8b\0" /* offset 1638 */
-  "\xd1\x83\xcc\x8b\0" /* offset 1643 */
-  "\xd0\xa7\xcc\x88\0" /* offset 1648 */
-  "\xd1\x87\xcc\x88\0" /* offset 1653 */
-  "\xd0\xab\xcc\x88\0" /* offset 1658 */
-  "\xd1\x8b\xcc\x88\0" /* offset 1663 */
-  "\xd5\xa5\xd6\x82\0" /* offset 1668 */
-  "\xd8\xa7\xd9\x93\0" /* offset 1673 */
-  "\xd8\xa7\xd9\x94\0" /* offset 1678 */
-  "\xd9\x88\xd9\x94\0" /* offset 1683 */
-  "\xd8\xa7\xd9\x95\0" /* offset 1688 */
-  "\xd9\x8a\xd9\x94\0" /* offset 1693 */
-  "\xd8\xa7\xd9\xb4\0" /* offset 1698 */
-  "\xd9\x88\xd9\xb4\0" /* offset 1703 */
-  "\xdb\x87\xd9\xb4\0" /* offset 1708 */
-  "\xd9\x8a\xd9\xb4\0" /* offset 1713 */
-  "\xdb\x95\xd9\x94\0" /* offset 1718 */
-  "\xdb\x81\xd9\x94\0" /* offset 1723 */
-  "\xdb\x92\xd9\x94\0" /* offset 1728 */
-  "\xe0\xa4\xa8\xe0\xa4\xbc\0" /* offset 1733 */
-  "\xe0\xa4\xb0\xe0\xa4\xbc\0" /* offset 1740 */
-  "\xe0\xa4\xb3\xe0\xa4\xbc\0" /* offset 1747 */
-  "\xe0\xa4\x95\xe0\xa4\xbc\0" /* offset 1754 */
-  "\xe0\xa4\x96\xe0\xa4\xbc\0" /* offset 1761 */
-  "\xe0\xa4\x97\xe0\xa4\xbc\0" /* offset 1768 */
-  "\xe0\xa4\x9c\xe0\xa4\xbc\0" /* offset 1775 */
-  "\xe0\xa4\xa1\xe0\xa4\xbc\0" /* offset 1782 */
-  "\xe0\xa4\xa2\xe0\xa4\xbc\0" /* offset 1789 */
-  "\xe0\xa4\xab\xe0\xa4\xbc\0" /* offset 1796 */
-  "\xe0\xa4\xaf\xe0\xa4\xbc\0" /* offset 1803 */
-  "\xe0\xa7\x87\xe0\xa6\xbe\0" /* offset 1810 */
-  "\xe0\xa7\x87\xe0\xa7\x97\0" /* offset 1817 */
-  "\xe0\xa6\xa1\xe0\xa6\xbc\0" /* offset 1824 */
-  "\xe0\xa6\xa2\xe0\xa6\xbc\0" /* offset 1831 */
-  "\xe0\xa6\xaf\xe0\xa6\xbc\0" /* offset 1838 */
-  "\xe0\xa8\xb2\xe0\xa8\xbc\0" /* offset 1845 */
-  "\xe0\xa8\xb8\xe0\xa8\xbc\0" /* offset 1852 */
-  "\xe0\xa8\x96\xe0\xa8\xbc\0" /* offset 1859 */
-  "\xe0\xa8\x97\xe0\xa8\xbc\0" /* offset 1866 */
-  "\xe0\xa8\x9c\xe0\xa8\xbc\0" /* offset 1873 */
-  "\xe0\xa8\xab\xe0\xa8\xbc\0" /* offset 1880 */
-  "\xe0\xad\x87\xe0\xad\x96\0" /* offset 1887 */
-  "\xe0\xad\x87\xe0\xac\xbe\0" /* offset 1894 */
-  "\xe0\xad\x87\xe0\xad\x97\0" /* offset 1901 */
-  "\xe0\xac\xa1\xe0\xac\xbc\0" /* offset 1908 */
-  "\xe0\xac\xa2\xe0\xac\xbc\0" /* offset 1915 */
-  "\xe0\xae\x92\xe0\xaf\x97\0" /* offset 1922 */
-  "\xe0\xaf\x86\xe0\xae\xbe\0" /* offset 1929 */
-  "\xe0\xaf\x87\xe0\xae\xbe\0" /* offset 1936 */
-  "\xe0\xaf\x86\xe0\xaf\x97\0" /* offset 1943 */
-  "\xe0\xb1\x86\xe0\xb1\x96\0" /* offset 1950 */
-  "\xe0\xb2\xbf\xe0\xb3\x95\0" /* offset 1957 */
-  "\xe0\xb3\x86\xe0\xb3\x95\0" /* offset 1964 */
-  "\xe0\xb3\x86\xe0\xb3\x96\0" /* offset 1971 */
-  "\xe0\xb3\x86\xe0\xb3\x82\0" /* offset 1978 */
-  "\xe0\xb3\x86\xe0\xb3\x82\xe0\xb3\x95\0" /* offset 1985 */
-  "\xe0\xb5\x86\xe0\xb4\xbe\0" /* offset 1995 */
-  "\xe0\xb5\x87\xe0\xb4\xbe\0" /* offset 2002 */
-  "\xe0\xb5\x86\xe0\xb5\x97\0" /* offset 2009 */
-  "\xe0\xb7\x99\xe0\xb7\x8a\0" /* offset 2016 */
-  "\xe0\xb7\x99\xe0\xb7\x8f\0" /* offset 2023 */
-  "\xe0\xb7\x99\xe0\xb7\x8f\xe0\xb7\x8a\0" /* offset 2030 */
-  "\xe0\xb7\x99\xe0\xb7\x9f\0" /* offset 2040 */
-  "\xe0\xb9\x8d\xe0\xb8\xb2\0" /* offset 2047 */
-  "\xe0\xbb\x8d\xe0\xba\xb2\0" /* offset 2054 */
-  "\xe0\xba\xab\xe0\xba\x99\0" /* offset 2061 */
-  "\xe0\xba\xab\xe0\xba\xa1\0" /* offset 2068 */
-  "\xe0\xbc\x8b\0" /* offset 2075 */
-  "\xe0\xbd\x82\xe0\xbe\xb7\0" /* offset 2079 */
-  "\xe0\xbd\x8c\xe0\xbe\xb7\0" /* offset 2086 */
-  "\xe0\xbd\x91\xe0\xbe\xb7\0" /* offset 2093 */
-  "\xe0\xbd\x96\xe0\xbe\xb7\0" /* offset 2100 */
-  "\xe0\xbd\x9b\xe0\xbe\xb7\0" /* offset 2107 */
-  "\xe0\xbd\x80\xe0\xbe\xb5\0" /* offset 2114 */
-  "\xe0\xbd\xb1\xe0\xbd\xb2\0" /* offset 2121 */
-  "\xe0\xbd\xb1\xe0\xbd\xb4\0" /* offset 2128 */
-  "\xe0\xbe\xb2\xe0\xbe\x80\0" /* offset 2135 */
-  "\xe0\xbe\xb2\xe0\xbd\xb1\xe0\xbe\x80\0" /* offset 2142 */
-  "\xe0\xbe\xb3\xe0\xbe\x80\0" /* offset 2152 */
-  "\xe0\xbe\xb3\xe0\xbd\xb1\xe0\xbe\x80\0" /* offset 2159 */
-  "\xe0\xbd\xb1\xe0\xbe\x80\0" /* offset 2169 */
-  "\xe0\xbe\x92\xe0\xbe\xb7\0" /* offset 2176 */
-  "\xe0\xbe\x9c\xe0\xbe\xb7\0" /* offset 2183 */
-  "\xe0\xbe\xa1\xe0\xbe\xb7\0" /* offset 2190 */
-  "\xe0\xbe\xa6\xe0\xbe\xb7\0" /* offset 2197 */
-  "\xe0\xbe\xab\xe0\xbe\xb7\0" /* offset 2204 */
-  "\xe0\xbe\x90\xe0\xbe\xb5\0" /* offset 2211 */
-  "\xe1\x80\xa5\xe1\x80\xae\0" /* offset 2218 */
-  "\x41\xcc\xa5\0" /* offset 2225 */
-  "\x61\xcc\xa5\0" /* offset 2229 */
-  "\x42\xcc\x87\0" /* offset 2233 */
-  "\x62\xcc\x87\0" /* offset 2237 */
-  "\x42\xcc\xa3\0" /* offset 2241 */
-  "\x62\xcc\xa3\0" /* offset 2245 */
-  "\x42\xcc\xb1\0" /* offset 2249 */
-  "\x62\xcc\xb1\0" /* offset 2253 */
-  "\x43\xcc\xa7\xcc\x81\0" /* offset 2257 */
-  "\x63\xcc\xa7\xcc\x81\0" /* offset 2263 */
-  "\x44\xcc\x87\0" /* offset 2269 */
-  "\x64\xcc\x87\0" /* offset 2273 */
-  "\x44\xcc\xa3\0" /* offset 2277 */
-  "\x64\xcc\xa3\0" /* offset 2281 */
-  "\x44\xcc\xb1\0" /* offset 2285 */
-  "\x64\xcc\xb1\0" /* offset 2289 */
-  "\x44\xcc\xa7\0" /* offset 2293 */
-  "\x64\xcc\xa7\0" /* offset 2297 */
-  "\x44\xcc\xad\0" /* offset 2301 */
-  "\x64\xcc\xad\0" /* offset 2305 */
-  "\x45\xcc\x84\xcc\x80\0" /* offset 2309 */
-  "\x65\xcc\x84\xcc\x80\0" /* offset 2315 */
-  "\x45\xcc\x84\xcc\x81\0" /* offset 2321 */
-  "\x65\xcc\x84\xcc\x81\0" /* offset 2327 */
-  "\x45\xcc\xad\0" /* offset 2333 */
-  "\x65\xcc\xad\0" /* offset 2337 */
-  "\x45\xcc\xb0\0" /* offset 2341 */
-  "\x65\xcc\xb0\0" /* offset 2345 */
-  "\x45\xcc\xa7\xcc\x86\0" /* offset 2349 */
-  "\x65\xcc\xa7\xcc\x86\0" /* offset 2355 */
-  "\x46\xcc\x87\0" /* offset 2361 */
-  "\x66\xcc\x87\0" /* offset 2365 */
-  "\x47\xcc\x84\0" /* offset 2369 */
-  "\x67\xcc\x84\0" /* offset 2373 */
-  "\x48\xcc\x87\0" /* offset 2377 */
-  "\x68\xcc\x87\0" /* offset 2381 */
-  "\x48\xcc\xa3\0" /* offset 2385 */
-  "\x68\xcc\xa3\0" /* offset 2389 */
-  "\x48\xcc\x88\0" /* offset 2393 */
-  "\x68\xcc\x88\0" /* offset 2397 */
-  "\x48\xcc\xa7\0" /* offset 2401 */
-  "\x68\xcc\xa7\0" /* offset 2405 */
-  "\x48\xcc\xae\0" /* offset 2409 */
-  "\x68\xcc\xae\0" /* offset 2413 */
-  "\x49\xcc\xb0\0" /* offset 2417 */
-  "\x69\xcc\xb0\0" /* offset 2421 */
-  "\x49\xcc\x88\xcc\x81\0" /* offset 2425 */
-  "\x69\xcc\x88\xcc\x81\0" /* offset 2431 */
-  "\x4b\xcc\x81\0" /* offset 2437 */
-  "\x6b\xcc\x81\0" /* offset 2441 */
-  "\x4b\xcc\xa3\0" /* offset 2445 */
-  "\x6b\xcc\xa3\0" /* offset 2449 */
-  "\x4b\xcc\xb1\0" /* offset 2453 */
-  "\x6b\xcc\xb1\0" /* offset 2457 */
-  "\x4c\xcc\xa3\0" /* offset 2461 */
-  "\x6c\xcc\xa3\0" /* offset 2465 */
-  "\x4c\xcc\xa3\xcc\x84\0" /* offset 2469 */
-  "\x6c\xcc\xa3\xcc\x84\0" /* offset 2475 */
-  "\x4c\xcc\xb1\0" /* offset 2481 */
-  "\x6c\xcc\xb1\0" /* offset 2485 */
-  "\x4c\xcc\xad\0" /* offset 2489 */
-  "\x6c\xcc\xad\0" /* offset 2493 */
-  "\x4d\xcc\x81\0" /* offset 2497 */
-  "\x6d\xcc\x81\0" /* offset 2501 */
-  "\x4d\xcc\x87\0" /* offset 2505 */
-  "\x6d\xcc\x87\0" /* offset 2509 */
-  "\x4d\xcc\xa3\0" /* offset 2513 */
-  "\x6d\xcc\xa3\0" /* offset 2517 */
-  "\x4e\xcc\x87\0" /* offset 2521 */
-  "\x6e\xcc\x87\0" /* offset 2525 */
-  "\x4e\xcc\xa3\0" /* offset 2529 */
-  "\x6e\xcc\xa3\0" /* offset 2533 */
-  "\x4e\xcc\xb1\0" /* offset 2537 */
-  "\x6e\xcc\xb1\0" /* offset 2541 */
-  "\x4e\xcc\xad\0" /* offset 2545 */
-  "\x6e\xcc\xad\0" /* offset 2549 */
-  "\x4f\xcc\x83\xcc\x81\0" /* offset 2553 */
-  "\x6f\xcc\x83\xcc\x81\0" /* offset 2559 */
-  "\x4f\xcc\x83\xcc\x88\0" /* offset 2565 */
-  "\x6f\xcc\x83\xcc\x88\0" /* offset 2571 */
-  "\x4f\xcc\x84\xcc\x80\0" /* offset 2577 */
-  "\x6f\xcc\x84\xcc\x80\0" /* offset 2583 */
-  "\x4f\xcc\x84\xcc\x81\0" /* offset 2589 */
-  "\x6f\xcc\x84\xcc\x81\0" /* offset 2595 */
-  "\x50\xcc\x81\0" /* offset 2601 */
-  "\x70\xcc\x81\0" /* offset 2605 */
-  "\x50\xcc\x87\0" /* offset 2609 */
-  "\x70\xcc\x87\0" /* offset 2613 */
-  "\x52\xcc\x87\0" /* offset 2617 */
-  "\x72\xcc\x87\0" /* offset 2621 */
-  "\x52\xcc\xa3\0" /* offset 2625 */
-  "\x72\xcc\xa3\0" /* offset 2629 */
-  "\x52\xcc\xa3\xcc\x84\0" /* offset 2633 */
-  "\x72\xcc\xa3\xcc\x84\0" /* offset 2639 */
-  "\x52\xcc\xb1\0" /* offset 2645 */
-  "\x72\xcc\xb1\0" /* offset 2649 */
-  "\x53\xcc\x87\0" /* offset 2653 */
-  "\x73\xcc\x87\0" /* offset 2657 */
-  "\x53\xcc\xa3\0" /* offset 2661 */
-  "\x73\xcc\xa3\0" /* offset 2665 */
-  "\x53\xcc\x81\xcc\x87\0" /* offset 2669 */
-  "\x73\xcc\x81\xcc\x87\0" /* offset 2675 */
-  "\x53\xcc\x8c\xcc\x87\0" /* offset 2681 */
-  "\x73\xcc\x8c\xcc\x87\0" /* offset 2687 */
-  "\x53\xcc\xa3\xcc\x87\0" /* offset 2693 */
-  "\x73\xcc\xa3\xcc\x87\0" /* offset 2699 */
-  "\x54\xcc\x87\0" /* offset 2705 */
-  "\x74\xcc\x87\0" /* offset 2709 */
-  "\x54\xcc\xa3\0" /* offset 2713 */
-  "\x74\xcc\xa3\0" /* offset 2717 */
-  "\x54\xcc\xb1\0" /* offset 2721 */
-  "\x74\xcc\xb1\0" /* offset 2725 */
-  "\x54\xcc\xad\0" /* offset 2729 */
-  "\x74\xcc\xad\0" /* offset 2733 */
-  "\x55\xcc\xa4\0" /* offset 2737 */
-  "\x75\xcc\xa4\0" /* offset 2741 */
-  "\x55\xcc\xb0\0" /* offset 2745 */
-  "\x75\xcc\xb0\0" /* offset 2749 */
-  "\x55\xcc\xad\0" /* offset 2753 */
-  "\x75\xcc\xad\0" /* offset 2757 */
-  "\x55\xcc\x83\xcc\x81\0" /* offset 2761 */
-  "\x75\xcc\x83\xcc\x81\0" /* offset 2767 */
-  "\x55\xcc\x84\xcc\x88\0" /* offset 2773 */
-  "\x75\xcc\x84\xcc\x88\0" /* offset 2779 */
-  "\x56\xcc\x83\0" /* offset 2785 */
-  "\x76\xcc\x83\0" /* offset 2789 */
-  "\x56\xcc\xa3\0" /* offset 2793 */
-  "\x76\xcc\xa3\0" /* offset 2797 */
-  "\x57\xcc\x80\0" /* offset 2801 */
-  "\x77\xcc\x80\0" /* offset 2805 */
-  "\x57\xcc\x81\0" /* offset 2809 */
-  "\x77\xcc\x81\0" /* offset 2813 */
-  "\x57\xcc\x88\0" /* offset 2817 */
-  "\x77\xcc\x88\0" /* offset 2821 */
-  "\x57\xcc\x87\0" /* offset 2825 */
-  "\x77\xcc\x87\0" /* offset 2829 */
-  "\x57\xcc\xa3\0" /* offset 2833 */
-  "\x77\xcc\xa3\0" /* offset 2837 */
-  "\x58\xcc\x87\0" /* offset 2841 */
-  "\x78\xcc\x87\0" /* offset 2845 */
-  "\x58\xcc\x88\0" /* offset 2849 */
-  "\x78\xcc\x88\0" /* offset 2853 */
-  "\x59\xcc\x87\0" /* offset 2857 */
-  "\x79\xcc\x87\0" /* offset 2861 */
-  "\x5a\xcc\x82\0" /* offset 2865 */
-  "\x7a\xcc\x82\0" /* offset 2869 */
-  "\x5a\xcc\xa3\0" /* offset 2873 */
-  "\x7a\xcc\xa3\0" /* offset 2877 */
-  "\x5a\xcc\xb1\0" /* offset 2881 */
-  "\x7a\xcc\xb1\0" /* offset 2885 */
-  "\x68\xcc\xb1\0" /* offset 2889 */
-  "\x74\xcc\x88\0" /* offset 2893 */
-  "\x77\xcc\x8a\0" /* offset 2897 */
-  "\x79\xcc\x8a\0" /* offset 2901 */
-  "\x61\xca\xbe\0" /* offset 2905 */
-  "\xc5\xbf\xcc\x87\0" /* offset 2909 */
-  "\x41\xcc\xa3\0" /* offset 2914 */
-  "\x61\xcc\xa3\0" /* offset 2918 */
-  "\x41\xcc\x89\0" /* offset 2922 */
-  "\x61\xcc\x89\0" /* offset 2926 */
-  "\x41\xcc\x82\xcc\x81\0" /* offset 2930 */
-  "\x61\xcc\x82\xcc\x81\0" /* offset 2936 */
-  "\x41\xcc\x82\xcc\x80\0" /* offset 2942 */
-  "\x61\xcc\x82\xcc\x80\0" /* offset 2948 */
-  "\x41\xcc\x82\xcc\x89\0" /* offset 2954 */
-  "\x61\xcc\x82\xcc\x89\0" /* offset 2960 */
-  "\x41\xcc\x82\xcc\x83\0" /* offset 2966 */
-  "\x61\xcc\x82\xcc\x83\0" /* offset 2972 */
-  "\x41\xcc\xa3\xcc\x82\0" /* offset 2978 */
-  "\x61\xcc\xa3\xcc\x82\0" /* offset 2984 */
-  "\x41\xcc\x86\xcc\x81\0" /* offset 2990 */
-  "\x61\xcc\x86\xcc\x81\0" /* offset 2996 */
-  "\x41\xcc\x86\xcc\x80\0" /* offset 3002 */
-  "\x61\xcc\x86\xcc\x80\0" /* offset 3008 */
-  "\x41\xcc\x86\xcc\x89\0" /* offset 3014 */
-  "\x61\xcc\x86\xcc\x89\0" /* offset 3020 */
-  "\x41\xcc\x86\xcc\x83\0" /* offset 3026 */
-  "\x61\xcc\x86\xcc\x83\0" /* offset 3032 */
-  "\x41\xcc\xa3\xcc\x86\0" /* offset 3038 */
-  "\x61\xcc\xa3\xcc\x86\0" /* offset 3044 */
-  "\x45\xcc\xa3\0" /* offset 3050 */
-  "\x65\xcc\xa3\0" /* offset 3054 */
-  "\x45\xcc\x89\0" /* offset 3058 */
-  "\x65\xcc\x89\0" /* offset 3062 */
-  "\x45\xcc\x83\0" /* offset 3066 */
-  "\x65\xcc\x83\0" /* offset 3070 */
-  "\x45\xcc\x82\xcc\x81\0" /* offset 3074 */
-  "\x65\xcc\x82\xcc\x81\0" /* offset 3080 */
-  "\x45\xcc\x82\xcc\x80\0" /* offset 3086 */
-  "\x65\xcc\x82\xcc\x80\0" /* offset 3092 */
-  "\x45\xcc\x82\xcc\x89\0" /* offset 3098 */
-  "\x65\xcc\x82\xcc\x89\0" /* offset 3104 */
-  "\x45\xcc\x82\xcc\x83\0" /* offset 3110 */
-  "\x65\xcc\x82\xcc\x83\0" /* offset 3116 */
-  "\x45\xcc\xa3\xcc\x82\0" /* offset 3122 */
-  "\x65\xcc\xa3\xcc\x82\0" /* offset 3128 */
-  "\x49\xcc\x89\0" /* offset 3134 */
-  "\x69\xcc\x89\0" /* offset 3138 */
-  "\x49\xcc\xa3\0" /* offset 3142 */
-  "\x69\xcc\xa3\0" /* offset 3146 */
-  "\x4f\xcc\xa3\0" /* offset 3150 */
-  "\x6f\xcc\xa3\0" /* offset 3154 */
-  "\x4f\xcc\x89\0" /* offset 3158 */
-  "\x6f\xcc\x89\0" /* offset 3162 */
-  "\x4f\xcc\x82\xcc\x81\0" /* offset 3166 */
-  "\x6f\xcc\x82\xcc\x81\0" /* offset 3172 */
-  "\x4f\xcc\x82\xcc\x80\0" /* offset 3178 */
-  "\x6f\xcc\x82\xcc\x80\0" /* offset 3184 */
-  "\x4f\xcc\x82\xcc\x89\0" /* offset 3190 */
-  "\x6f\xcc\x82\xcc\x89\0" /* offset 3196 */
-  "\x4f\xcc\x82\xcc\x83\0" /* offset 3202 */
-  "\x6f\xcc\x82\xcc\x83\0" /* offset 3208 */
-  "\x4f\xcc\xa3\xcc\x82\0" /* offset 3214 */
-  "\x6f\xcc\xa3\xcc\x82\0" /* offset 3220 */
-  "\x4f\xcc\x9b\xcc\x81\0" /* offset 3226 */
-  "\x6f\xcc\x9b\xcc\x81\0" /* offset 3232 */
-  "\x4f\xcc\x9b\xcc\x80\0" /* offset 3238 */
-  "\x6f\xcc\x9b\xcc\x80\0" /* offset 3244 */
-  "\x4f\xcc\x9b\xcc\x89\0" /* offset 3250 */
-  "\x6f\xcc\x9b\xcc\x89\0" /* offset 3256 */
-  "\x4f\xcc\x9b\xcc\x83\0" /* offset 3262 */
-  "\x6f\xcc\x9b\xcc\x83\0" /* offset 3268 */
-  "\x4f\xcc\x9b\xcc\xa3\0" /* offset 3274 */
-  "\x6f\xcc\x9b\xcc\xa3\0" /* offset 3280 */
-  "\x55\xcc\xa3\0" /* offset 3286 */
-  "\x75\xcc\xa3\0" /* offset 3290 */
-  "\x55\xcc\x89\0" /* offset 3294 */
-  "\x75\xcc\x89\0" /* offset 3298 */
-  "\x55\xcc\x9b\xcc\x81\0" /* offset 3302 */
-  "\x75\xcc\x9b\xcc\x81\0" /* offset 3308 */
-  "\x55\xcc\x9b\xcc\x80\0" /* offset 3314 */
-  "\x75\xcc\x9b\xcc\x80\0" /* offset 3320 */
-  "\x55\xcc\x9b\xcc\x89\0" /* offset 3326 */
-  "\x75\xcc\x9b\xcc\x89\0" /* offset 3332 */
-  "\x55\xcc\x9b\xcc\x83\0" /* offset 3338 */
-  "\x75\xcc\x9b\xcc\x83\0" /* offset 3344 */
-  "\x55\xcc\x9b\xcc\xa3\0" /* offset 3350 */
-  "\x75\xcc\x9b\xcc\xa3\0" /* offset 3356 */
-  "\x59\xcc\x80\0" /* offset 3362 */
-  "\x79\xcc\x80\0" /* offset 3366 */
-  "\x59\xcc\xa3\0" /* offset 3370 */
-  "\x79\xcc\xa3\0" /* offset 3374 */
-  "\x59\xcc\x89\0" /* offset 3378 */
-  "\x79\xcc\x89\0" /* offset 3382 */
-  "\x59\xcc\x83\0" /* offset 3386 */
-  "\x79\xcc\x83\0" /* offset 3390 */
-  "\xce\xb1\xcc\x93\0" /* offset 3394 */
-  "\xce\xb1\xcc\x94\0" /* offset 3399 */
-  "\xce\xb1\xcc\x93\xcc\x80\0" /* offset 3404 */
-  "\xce\xb1\xcc\x94\xcc\x80\0" /* offset 3411 */
-  "\xce\xb1\xcc\x93\xcc\x81\0" /* offset 3418 */
-  "\xce\xb1\xcc\x94\xcc\x81\0" /* offset 3425 */
-  "\xce\xb1\xcc\x93\xcd\x82\0" /* offset 3432 */
-  "\xce\xb1\xcc\x94\xcd\x82\0" /* offset 3439 */
-  "\xce\x91\xcc\x93\0" /* offset 3446 */
-  "\xce\x91\xcc\x94\0" /* offset 3451 */
-  "\xce\x91\xcc\x93\xcc\x80\0" /* offset 3456 */
-  "\xce\x91\xcc\x94\xcc\x80\0" /* offset 3463 */
-  "\xce\x91\xcc\x93\xcc\x81\0" /* offset 3470 */
-  "\xce\x91\xcc\x94\xcc\x81\0" /* offset 3477 */
-  "\xce\x91\xcc\x93\xcd\x82\0" /* offset 3484 */
-  "\xce\x91\xcc\x94\xcd\x82\0" /* offset 3491 */
-  "\xce\xb5\xcc\x93\0" /* offset 3498 */
-  "\xce\xb5\xcc\x94\0" /* offset 3503 */
-  "\xce\xb5\xcc\x93\xcc\x80\0" /* offset 3508 */
-  "\xce\xb5\xcc\x94\xcc\x80\0" /* offset 3515 */
-  "\xce\xb5\xcc\x93\xcc\x81\0" /* offset 3522 */
-  "\xce\xb5\xcc\x94\xcc\x81\0" /* offset 3529 */
-  "\xce\x95\xcc\x93\0" /* offset 3536 */
-  "\xce\x95\xcc\x94\0" /* offset 3541 */
-  "\xce\x95\xcc\x93\xcc\x80\0" /* offset 3546 */
-  "\xce\x95\xcc\x94\xcc\x80\0" /* offset 3553 */
-  "\xce\x95\xcc\x93\xcc\x81\0" /* offset 3560 */
-  "\xce\x95\xcc\x94\xcc\x81\0" /* offset 3567 */
-  "\xce\xb7\xcc\x93\0" /* offset 3574 */
-  "\xce\xb7\xcc\x94\0" /* offset 3579 */
-  "\xce\xb7\xcc\x93\xcc\x80\0" /* offset 3584 */
-  "\xce\xb7\xcc\x94\xcc\x80\0" /* offset 3591 */
-  "\xce\xb7\xcc\x93\xcc\x81\0" /* offset 3598 */
-  "\xce\xb7\xcc\x94\xcc\x81\0" /* offset 3605 */
-  "\xce\xb7\xcc\x93\xcd\x82\0" /* offset 3612 */
-  "\xce\xb7\xcc\x94\xcd\x82\0" /* offset 3619 */
-  "\xce\x97\xcc\x93\0" /* offset 3626 */
-  "\xce\x97\xcc\x94\0" /* offset 3631 */
-  "\xce\x97\xcc\x93\xcc\x80\0" /* offset 3636 */
-  "\xce\x97\xcc\x94\xcc\x80\0" /* offset 3643 */
-  "\xce\x97\xcc\x93\xcc\x81\0" /* offset 3650 */
-  "\xce\x97\xcc\x94\xcc\x81\0" /* offset 3657 */
-  "\xce\x97\xcc\x93\xcd\x82\0" /* offset 3664 */
-  "\xce\x97\xcc\x94\xcd\x82\0" /* offset 3671 */
-  "\xce\xb9\xcc\x93\0" /* offset 3678 */
-  "\xce\xb9\xcc\x94\0" /* offset 3683 */
-  "\xce\xb9\xcc\x93\xcc\x80\0" /* offset 3688 */
-  "\xce\xb9\xcc\x94\xcc\x80\0" /* offset 3695 */
-  "\xce\xb9\xcc\x93\xcc\x81\0" /* offset 3702 */
-  "\xce\xb9\xcc\x94\xcc\x81\0" /* offset 3709 */
-  "\xce\xb9\xcc\x93\xcd\x82\0" /* offset 3716 */
-  "\xce\xb9\xcc\x94\xcd\x82\0" /* offset 3723 */
-  "\xce\x99\xcc\x93\0" /* offset 3730 */
-  "\xce\x99\xcc\x94\0" /* offset 3735 */
-  "\xce\x99\xcc\x93\xcc\x80\0" /* offset 3740 */
-  "\xce\x99\xcc\x94\xcc\x80\0" /* offset 3747 */
-  "\xce\x99\xcc\x93\xcc\x81\0" /* offset 3754 */
-  "\xce\x99\xcc\x94\xcc\x81\0" /* offset 3761 */
-  "\xce\x99\xcc\x93\xcd\x82\0" /* offset 3768 */
-  "\xce\x99\xcc\x94\xcd\x82\0" /* offset 3775 */
-  "\xce\xbf\xcc\x93\0" /* offset 3782 */
-  "\xce\xbf\xcc\x94\0" /* offset 3787 */
-  "\xce\xbf\xcc\x93\xcc\x80\0" /* offset 3792 */
-  "\xce\xbf\xcc\x94\xcc\x80\0" /* offset 3799 */
-  "\xce\xbf\xcc\x93\xcc\x81\0" /* offset 3806 */
-  "\xce\xbf\xcc\x94\xcc\x81\0" /* offset 3813 */
-  "\xce\x9f\xcc\x93\0" /* offset 3820 */
-  "\xce\x9f\xcc\x94\0" /* offset 3825 */
-  "\xce\x9f\xcc\x93\xcc\x80\0" /* offset 3830 */
-  "\xce\x9f\xcc\x94\xcc\x80\0" /* offset 3837 */
-  "\xce\x9f\xcc\x93\xcc\x81\0" /* offset 3844 */
-  "\xce\x9f\xcc\x94\xcc\x81\0" /* offset 3851 */
-  "\xcf\x85\xcc\x93\0" /* offset 3858 */
-  "\xcf\x85\xcc\x94\0" /* offset 3863 */
-  "\xcf\x85\xcc\x93\xcc\x80\0" /* offset 3868 */
-  "\xcf\x85\xcc\x94\xcc\x80\0" /* offset 3875 */
-  "\xcf\x85\xcc\x93\xcc\x81\0" /* offset 3882 */
-  "\xcf\x85\xcc\x94\xcc\x81\0" /* offset 3889 */
-  "\xcf\x85\xcc\x93\xcd\x82\0" /* offset 3896 */
-  "\xcf\x85\xcc\x94\xcd\x82\0" /* offset 3903 */
-  "\xce\xa5\xcc\x94\0" /* offset 3910 */
-  "\xce\xa5\xcc\x94\xcc\x80\0" /* offset 3915 */
-  "\xce\xa5\xcc\x94\xcc\x81\0" /* offset 3922 */
-  "\xce\xa5\xcc\x94\xcd\x82\0" /* offset 3929 */
-  "\xcf\x89\xcc\x93\0" /* offset 3936 */
-  "\xcf\x89\xcc\x94\0" /* offset 3941 */
-  "\xcf\x89\xcc\x93\xcc\x80\0" /* offset 3946 */
-  "\xcf\x89\xcc\x94\xcc\x80\0" /* offset 3953 */
-  "\xcf\x89\xcc\x93\xcc\x81\0" /* offset 3960 */
-  "\xcf\x89\xcc\x94\xcc\x81\0" /* offset 3967 */
-  "\xcf\x89\xcc\x93\xcd\x82\0" /* offset 3974 */
-  "\xcf\x89\xcc\x94\xcd\x82\0" /* offset 3981 */
-  "\xce\xa9\xcc\x93\0" /* offset 3988 */
-  "\xce\xa9\xcc\x94\0" /* offset 3993 */
-  "\xce\xa9\xcc\x93\xcc\x80\0" /* offset 3998 */
-  "\xce\xa9\xcc\x94\xcc\x80\0" /* offset 4005 */
-  "\xce\xa9\xcc\x93\xcc\x81\0" /* offset 4012 */
-  "\xce\xa9\xcc\x94\xcc\x81\0" /* offset 4019 */
-  "\xce\xa9\xcc\x93\xcd\x82\0" /* offset 4026 */
-  "\xce\xa9\xcc\x94\xcd\x82\0" /* offset 4033 */
-  "\xce\xb1\xcc\x80\0" /* offset 4040 */
-  "\xce\xb5\xcc\x80\0" /* offset 4045 */
-  "\xce\xb7\xcc\x80\0" /* offset 4050 */
-  "\xce\xb9\xcc\x80\0" /* offset 4055 */
-  "\xce\xbf\xcc\x80\0" /* offset 4060 */
-  "\xcf\x85\xcc\x80\0" /* offset 4065 */
-  "\xcf\x89\xcc\x80\0" /* offset 4070 */
-  "\xce\xb1\xcc\x93\xcd\x85\0" /* offset 4075 */
-  "\xce\xb1\xcc\x94\xcd\x85\0" /* offset 4082 */
-  "\xce\xb1\xcc\x93\xcc\x80\xcd\x85\0" /* offset 4089 */
-  "\xce\xb1\xcc\x94\xcc\x80\xcd\x85\0" /* offset 4098 */
-  "\xce\xb1\xcc\x93\xcc\x81\xcd\x85\0" /* offset 4107 */
-  "\xce\xb1\xcc\x94\xcc\x81\xcd\x85\0" /* offset 4116 */
-  "\xce\xb1\xcc\x93\xcd\x82\xcd\x85\0" /* offset 4125 */
-  "\xce\xb1\xcc\x94\xcd\x82\xcd\x85\0" /* offset 4134 */
-  "\xce\x91\xcc\x93\xcd\x85\0" /* offset 4143 */
-  "\xce\x91\xcc\x94\xcd\x85\0" /* offset 4150 */
-  "\xce\x91\xcc\x93\xcc\x80\xcd\x85\0" /* offset 4157 */
-  "\xce\x91\xcc\x94\xcc\x80\xcd\x85\0" /* offset 4166 */
-  "\xce\x91\xcc\x93\xcc\x81\xcd\x85\0" /* offset 4175 */
-  "\xce\x91\xcc\x94\xcc\x81\xcd\x85\0" /* offset 4184 */
-  "\xce\x91\xcc\x93\xcd\x82\xcd\x85\0" /* offset 4193 */
-  "\xce\x91\xcc\x94\xcd\x82\xcd\x85\0" /* offset 4202 */
-  "\xce\xb7\xcc\x93\xcd\x85\0" /* offset 4211 */
-  "\xce\xb7\xcc\x94\xcd\x85\0" /* offset 4218 */
-  "\xce\xb7\xcc\x93\xcc\x80\xcd\x85\0" /* offset 4225 */
-  "\xce\xb7\xcc\x94\xcc\x80\xcd\x85\0" /* offset 4234 */
-  "\xce\xb7\xcc\x93\xcc\x81\xcd\x85\0" /* offset 4243 */
-  "\xce\xb7\xcc\x94\xcc\x81\xcd\x85\0" /* offset 4252 */
-  "\xce\xb7\xcc\x93\xcd\x82\xcd\x85\0" /* offset 4261 */
-  "\xce\xb7\xcc\x94\xcd\x82\xcd\x85\0" /* offset 4270 */
-  "\xce\x97\xcc\x93\xcd\x85\0" /* offset 4279 */
-  "\xce\x97\xcc\x94\xcd\x85\0" /* offset 4286 */
-  "\xce\x97\xcc\x93\xcc\x80\xcd\x85\0" /* offset 4293 */
-  "\xce\x97\xcc\x94\xcc\x80\xcd\x85\0" /* offset 4302 */
-  "\xce\x97\xcc\x93\xcc\x81\xcd\x85\0" /* offset 4311 */
-  "\xce\x97\xcc\x94\xcc\x81\xcd\x85\0" /* offset 4320 */
-  "\xce\x97\xcc\x93\xcd\x82\xcd\x85\0" /* offset 4329 */
-  "\xce\x97\xcc\x94\xcd\x82\xcd\x85\0" /* offset 4338 */
-  "\xcf\x89\xcc\x93\xcd\x85\0" /* offset 4347 */
-  "\xcf\x89\xcc\x94\xcd\x85\0" /* offset 4354 */
-  "\xcf\x89\xcc\x93\xcc\x80\xcd\x85\0" /* offset 4361 */
-  "\xcf\x89\xcc\x94\xcc\x80\xcd\x85\0" /* offset 4370 */
-  "\xcf\x89\xcc\x93\xcc\x81\xcd\x85\0" /* offset 4379 */
-  "\xcf\x89\xcc\x94\xcc\x81\xcd\x85\0" /* offset 4388 */
-  "\xcf\x89\xcc\x93\xcd\x82\xcd\x85\0" /* offset 4397 */
-  "\xcf\x89\xcc\x94\xcd\x82\xcd\x85\0" /* offset 4406 */
-  "\xce\xa9\xcc\x93\xcd\x85\0" /* offset 4415 */
-  "\xce\xa9\xcc\x94\xcd\x85\0" /* offset 4422 */
-  "\xce\xa9\xcc\x93\xcc\x80\xcd\x85\0" /* offset 4429 */
-  "\xce\xa9\xcc\x94\xcc\x80\xcd\x85\0" /* offset 4438 */
-  "\xce\xa9\xcc\x93\xcc\x81\xcd\x85\0" /* offset 4447 */
-  "\xce\xa9\xcc\x94\xcc\x81\xcd\x85\0" /* offset 4456 */
-  "\xce\xa9\xcc\x93\xcd\x82\xcd\x85\0" /* offset 4465 */
-  "\xce\xa9\xcc\x94\xcd\x82\xcd\x85\0" /* offset 4474 */
-  "\xce\xb1\xcc\x86\0" /* offset 4483 */
-  "\xce\xb1\xcc\x84\0" /* offset 4488 */
-  "\xce\xb1\xcc\x80\xcd\x85\0" /* offset 4493 */
-  "\xce\xb1\xcd\x85\0" /* offset 4500 */
-  "\xce\xb1\xcc\x81\xcd\x85\0" /* offset 4505 */
-  "\xce\xb1\xcd\x82\0" /* offset 4512 */
-  "\xce\xb1\xcd\x82\xcd\x85\0" /* offset 4517 */
-  "\xce\x91\xcc\x86\0" /* offset 4524 */
-  "\xce\x91\xcc\x84\0" /* offset 4529 */
-  "\xce\x91\xcc\x80\0" /* offset 4534 */
-  "\xce\x91\xcd\x85\0" /* offset 4539 */
-  "\x20\xcc\x93\0" /* offset 4544 */
-  "\xce\xb9\0" /* offset 4548 */
-  "\x20\xcd\x82\0" /* offset 4551 */
-  "\xc2\xa8\xcd\x82\0" /* offset 4555 */
-  "\x20\xcc\x88\xcd\x82\0" /* offset 4560 */
-  "\xce\xb7\xcc\x80\xcd\x85\0" /* offset 4566 */
-  "\xce\xb7\xcd\x85\0" /* offset 4573 */
-  "\xce\xb7\xcc\x81\xcd\x85\0" /* offset 4578 */
-  "\xce\xb7\xcd\x82\0" /* offset 4585 */
-  "\xce\xb7\xcd\x82\xcd\x85\0" /* offset 4590 */
-  "\xce\x95\xcc\x80\0" /* offset 4597 */
-  "\xce\x97\xcc\x80\0" /* offset 4602 */
-  "\xce\x97\xcd\x85\0" /* offset 4607 */
-  "\xe1\xbe\xbf\xcc\x80\0" /* offset 4612 */
-  "\x20\xcc\x93\xcc\x80\0" /* offset 4618 */
-  "\xe1\xbe\xbf\xcc\x81\0" /* offset 4624 */
-  "\x20\xcc\x93\xcc\x81\0" /* offset 4630 */
-  "\xe1\xbe\xbf\xcd\x82\0" /* offset 4636 */
-  "\x20\xcc\x93\xcd\x82\0" /* offset 4642 */
-  "\xce\xb9\xcc\x86\0" /* offset 4648 */
-  "\xce\xb9\xcc\x84\0" /* offset 4653 */
-  "\xce\xb9\xcc\x88\xcc\x80\0" /* offset 4658 */
-  "\xce\xb9\xcd\x82\0" /* offset 4665 */
-  "\xce\xb9\xcc\x88\xcd\x82\0" /* offset 4670 */
-  "\xce\x99\xcc\x86\0" /* offset 4677 */
-  "\xce\x99\xcc\x84\0" /* offset 4682 */
-  "\xce\x99\xcc\x80\0" /* offset 4687 */
-  "\xe1\xbf\xbe\xcc\x80\0" /* offset 4692 */
-  "\x20\xcc\x94\xcc\x80\0" /* offset 4698 */
-  "\xe1\xbf\xbe\xcc\x81\0" /* offset 4704 */
-  "\x20\xcc\x94\xcc\x81\0" /* offset 4710 */
-  "\xe1\xbf\xbe\xcd\x82\0" /* offset 4716 */
-  "\x20\xcc\x94\xcd\x82\0" /* offset 4722 */
-  "\xcf\x85\xcc\x86\0" /* offset 4728 */
-  "\xcf\x85\xcc\x84\0" /* offset 4733 */
-  "\xcf\x85\xcc\x88\xcc\x80\0" /* offset 4738 */
-  "\xcf\x81\xcc\x93\0" /* offset 4745 */
-  "\xcf\x81\xcc\x94\0" /* offset 4750 */
-  "\xcf\x85\xcd\x82\0" /* offset 4755 */
-  "\xcf\x85\xcc\x88\xcd\x82\0" /* offset 4760 */
-  "\xce\xa5\xcc\x86\0" /* offset 4767 */
-  "\xce\xa5\xcc\x84\0" /* offset 4772 */
-  "\xce\xa5\xcc\x80\0" /* offset 4777 */
-  "\xce\xa1\xcc\x94\0" /* offset 4782 */
-  "\xc2\xa8\xcc\x80\0" /* offset 4787 */
-  "\x20\xcc\x88\xcc\x80\0" /* offset 4792 */
-  "\x60\0" /* offset 4798 */
-  "\xcf\x89\xcc\x80\xcd\x85\0" /* offset 4800 */
-  "\xcf\x89\xcd\x85\0" /* offset 4807 */
-  "\xcf\x89\xcc\x81\xcd\x85\0" /* offset 4812 */
-  "\xcf\x89\xcd\x82\0" /* offset 4819 */
-  "\xcf\x89\xcd\x82\xcd\x85\0" /* offset 4824 */
-  "\xce\x9f\xcc\x80\0" /* offset 4831 */
-  "\xce\xa9\xcc\x80\0" /* offset 4836 */
-  "\xce\xa9\xcd\x85\0" /* offset 4841 */
-  "\xc2\xb4\0" /* offset 4846 */
-  "\x20\xcc\x94\0" /* offset 4849 */
-  "\xe2\x80\x82\0" /* offset 4853 */
-  "\xe2\x80\x83\0" /* offset 4857 */
-  "\xe2\x80\x90\0" /* offset 4861 */
-  "\x20\xcc\xb3\0" /* offset 4865 */
-  "\x2e\0" /* offset 4869 */
-  "\x2e\x2e\0" /* offset 4871 */
-  "\x2e\x2e\x2e\0" /* offset 4874 */
-  "\xe2\x80\xb2\xe2\x80\xb2\0" /* offset 4878 */
-  "\xe2\x80\xb2\xe2\x80\xb2\xe2\x80\xb2\0" /* offset 4885 */
-  "\xe2\x80\xb5\xe2\x80\xb5\0" /* offset 4895 */
-  "\xe2\x80\xb5\xe2\x80\xb5\xe2\x80\xb5\0" /* offset 4902 */
-  "\x21\x21\0" /* offset 4912 */
-  "\x20\xcc\x85\0" /* offset 4915 */
-  "\x3f\x3f\0" /* offset 4919 */
-  "\x3f\x21\0" /* offset 4922 */
-  "\x21\x3f\0" /* offset 4925 */
-  "\xe2\x80\xb2\xe2\x80\xb2\xe2\x80\xb2\xe2\x80\xb2\0" /* offset 4928 */
-  "\x30\0" /* offset 4941 */
-  "\x69\0" /* offset 4943 */
-  "\x34\0" /* offset 4945 */
-  "\x35\0" /* offset 4947 */
-  "\x36\0" /* offset 4949 */
-  "\x37\0" /* offset 4951 */
-  "\x38\0" /* offset 4953 */
-  "\x39\0" /* offset 4955 */
-  "\x2b\0" /* offset 4957 */
-  "\xe2\x88\x92\0" /* offset 4959 */
-  "\x3d\0" /* offset 4963 */
-  "\x28\0" /* offset 4965 */
-  "\x29\0" /* offset 4967 */
-  "\x6e\0" /* offset 4969 */
-  "\x52\x73\0" /* offset 4971 */
-  "\x61\x2f\x63\0" /* offset 4974 */
-  "\x61\x2f\x73\0" /* offset 4978 */
-  "\x43\0" /* offset 4982 */
-  "\xc2\xb0\x43\0" /* offset 4984 */
-  "\x63\x2f\x6f\0" /* offset 4988 */
-  "\x63\x2f\x75\0" /* offset 4992 */
-  "\xc6\x90\0" /* offset 4996 */
-  "\xc2\xb0\x46\0" /* offset 4999 */
-  "\x67\0" /* offset 5003 */
-  "\x48\0" /* offset 5005 */
-  "\xc4\xa7\0" /* offset 5007 */
-  "\x49\0" /* offset 5010 */
-  "\x4c\0" /* offset 5012 */
-  "\x4e\0" /* offset 5014 */
-  "\x4e\x6f\0" /* offset 5016 */
-  "\x50\0" /* offset 5019 */
-  "\x51\0" /* offset 5021 */
-  "\x52\0" /* offset 5023 */
-  "\x53\x4d\0" /* offset 5025 */
-  "\x54\x45\x4c\0" /* offset 5028 */
-  "\x54\x4d\0" /* offset 5032 */
-  "\x5a\0" /* offset 5035 */
-  "\xce\xa9\0" /* offset 5037 */
-  "\x4b\0" /* offset 5040 */
-  "\x42\0" /* offset 5042 */
-  "\x65\0" /* offset 5044 */
-  "\x45\0" /* offset 5046 */
-  "\x46\0" /* offset 5048 */
-  "\x4d\0" /* offset 5050 */
-  "\xd7\x90\0" /* offset 5052 */
-  "\xd7\x91\0" /* offset 5055 */
-  "\xd7\x92\0" /* offset 5058 */
-  "\xd7\x93\0" /* offset 5061 */
-  "\xce\xb3\0" /* offset 5064 */
-  "\xce\x93\0" /* offset 5067 */
-  "\xce\xa0\0" /* offset 5070 */
-  "\xe2\x88\x91\0" /* offset 5073 */
-  "\x44\0" /* offset 5077 */
-  "\x64\0" /* offset 5079 */
-  "\x31\xe2\x81\x84\x33\0" /* offset 5081 */
-  "\x32\xe2\x81\x84\x33\0" /* offset 5087 */
-  "\x31\xe2\x81\x84\x35\0" /* offset 5093 */
-  "\x32\xe2\x81\x84\x35\0" /* offset 5099 */
-  "\x33\xe2\x81\x84\x35\0" /* offset 5105 */
-  "\x34\xe2\x81\x84\x35\0" /* offset 5111 */
-  "\x31\xe2\x81\x84\x36\0" /* offset 5117 */
-  "\x35\xe2\x81\x84\x36\0" /* offset 5123 */
-  "\x31\xe2\x81\x84\x38\0" /* offset 5129 */
-  "\x33\xe2\x81\x84\x38\0" /* offset 5135 */
-  "\x35\xe2\x81\x84\x38\0" /* offset 5141 */
-  "\x37\xe2\x81\x84\x38\0" /* offset 5147 */
-  "\x31\xe2\x81\x84\0" /* offset 5153 */
-  "\x49\x49\0" /* offset 5158 */
-  "\x49\x49\x49\0" /* offset 5161 */
-  "\x49\x56\0" /* offset 5165 */
-  "\x56\0" /* offset 5168 */
-  "\x56\x49\0" /* offset 5170 */
-  "\x56\x49\x49\0" /* offset 5173 */
-  "\x56\x49\x49\x49\0" /* offset 5177 */
-  "\x49\x58\0" /* offset 5182 */
-  "\x58\0" /* offset 5185 */
-  "\x58\x49\0" /* offset 5187 */
-  "\x58\x49\x49\0" /* offset 5190 */
-  "\x69\x69\0" /* offset 5194 */
-  "\x69\x69\x69\0" /* offset 5197 */
-  "\x69\x76\0" /* offset 5201 */
-  "\x76\0" /* offset 5204 */
-  "\x76\x69\0" /* offset 5206 */
-  "\x76\x69\x69\0" /* offset 5209 */
-  "\x76\x69\x69\x69\0" /* offset 5213 */
-  "\x69\x78\0" /* offset 5218 */
-  "\x78\x69\0" /* offset 5221 */
-  "\x78\x69\x69\0" /* offset 5224 */
-  "\x63\0" /* offset 5228 */
-  "\x6d\0" /* offset 5230 */
-  "\xe2\x86\x90\xcc\xb8\0" /* offset 5232 */
-  "\xe2\x86\x92\xcc\xb8\0" /* offset 5238 */
-  "\xe2\x86\x94\xcc\xb8\0" /* offset 5244 */
-  "\xe2\x87\x90\xcc\xb8\0" /* offset 5250 */
-  "\xe2\x87\x94\xcc\xb8\0" /* offset 5256 */
-  "\xe2\x87\x92\xcc\xb8\0" /* offset 5262 */
-  "\xe2\x88\x83\xcc\xb8\0" /* offset 5268 */
-  "\xe2\x88\x88\xcc\xb8\0" /* offset 5274 */
-  "\xe2\x88\x8b\xcc\xb8\0" /* offset 5280 */
-  "\xe2\x88\xa3\xcc\xb8\0" /* offset 5286 */
-  "\xe2\x88\xa5\xcc\xb8\0" /* offset 5292 */
-  "\xe2\x88\xab\xe2\x88\xab\0" /* offset 5298 */
-  "\xe2\x88\xab\xe2\x88\xab\xe2\x88\xab\0" /* offset 5305 */
-  "\xe2\x88\xae\xe2\x88\xae\0" /* offset 5315 */
-  "\xe2\x88\xae\xe2\x88\xae\xe2\x88\xae\0" /* offset 5322 */
-  "\xe2\x88\xbc\xcc\xb8\0" /* offset 5332 */
-  "\xe2\x89\x83\xcc\xb8\0" /* offset 5338 */
-  "\xe2\x89\x85\xcc\xb8\0" /* offset 5344 */
-  "\xe2\x89\x88\xcc\xb8\0" /* offset 5350 */
-  "\x3d\xcc\xb8\0" /* offset 5356 */
-  "\xe2\x89\xa1\xcc\xb8\0" /* offset 5360 */
-  "\xe2\x89\x8d\xcc\xb8\0" /* offset 5366 */
-  "\x3c\xcc\xb8\0" /* offset 5372 */
-  "\x3e\xcc\xb8\0" /* offset 5376 */
-  "\xe2\x89\xa4\xcc\xb8\0" /* offset 5380 */
-  "\xe2\x89\xa5\xcc\xb8\0" /* offset 5386 */
-  "\xe2\x89\xb2\xcc\xb8\0" /* offset 5392 */
-  "\xe2\x89\xb3\xcc\xb8\0" /* offset 5398 */
-  "\xe2\x89\xb6\xcc\xb8\0" /* offset 5404 */
-  "\xe2\x89\xb7\xcc\xb8\0" /* offset 5410 */
-  "\xe2\x89\xba\xcc\xb8\0" /* offset 5416 */
-  "\xe2\x89\xbb\xcc\xb8\0" /* offset 5422 */
-  "\xe2\x8a\x82\xcc\xb8\0" /* offset 5428 */
-  "\xe2\x8a\x83\xcc\xb8\0" /* offset 5434 */
-  "\xe2\x8a\x86\xcc\xb8\0" /* offset 5440 */
-  "\xe2\x8a\x87\xcc\xb8\0" /* offset 5446 */
-  "\xe2\x8a\xa2\xcc\xb8\0" /* offset 5452 */
-  "\xe2\x8a\xa8\xcc\xb8\0" /* offset 5458 */
-  "\xe2\x8a\xa9\xcc\xb8\0" /* offset 5464 */
-  "\xe2\x8a\xab\xcc\xb8\0" /* offset 5470 */
-  "\xe2\x89\xbc\xcc\xb8\0" /* offset 5476 */
-  "\xe2\x89\xbd\xcc\xb8\0" /* offset 5482 */
-  "\xe2\x8a\x91\xcc\xb8\0" /* offset 5488 */
-  "\xe2\x8a\x92\xcc\xb8\0" /* offset 5494 */
-  "\xe2\x8a\xb2\xcc\xb8\0" /* offset 5500 */
-  "\xe2\x8a\xb3\xcc\xb8\0" /* offset 5506 */
-  "\xe2\x8a\xb4\xcc\xb8\0" /* offset 5512 */
-  "\xe2\x8a\xb5\xcc\xb8\0" /* offset 5518 */
-  "\xe3\x80\x88\0" /* offset 5524 */
-  "\xe3\x80\x89\0" /* offset 5528 */
-  "\x31\x30\0" /* offset 5532 */
-  "\x31\x31\0" /* offset 5535 */
-  "\x31\x32\0" /* offset 5538 */
-  "\x31\x33\0" /* offset 5541 */
-  "\x31\x34\0" /* offset 5544 */
-  "\x31\x35\0" /* offset 5547 */
-  "\x31\x36\0" /* offset 5550 */
-  "\x31\x37\0" /* offset 5553 */
-  "\x31\x38\0" /* offset 5556 */
-  "\x31\x39\0" /* offset 5559 */
-  "\x32\x30\0" /* offset 5562 */
-  "\x28\x31\x29\0" /* offset 5565 */
-  "\x28\x32\x29\0" /* offset 5569 */
-  "\x28\x33\x29\0" /* offset 5573 */
-  "\x28\x34\x29\0" /* offset 5577 */
-  "\x28\x35\x29\0" /* offset 5581 */
-  "\x28\x36\x29\0" /* offset 5585 */
-  "\x28\x37\x29\0" /* offset 5589 */
-  "\x28\x38\x29\0" /* offset 5593 */
-  "\x28\x39\x29\0" /* offset 5597 */
-  "\x28\x31\x30\x29\0" /* offset 5601 */
-  "\x28\x31\x31\x29\0" /* offset 5606 */
-  "\x28\x31\x32\x29\0" /* offset 5611 */
-  "\x28\x31\x33\x29\0" /* offset 5616 */
-  "\x28\x31\x34\x29\0" /* offset 5621 */
-  "\x28\x31\x35\x29\0" /* offset 5626 */
-  "\x28\x31\x36\x29\0" /* offset 5631 */
-  "\x28\x31\x37\x29\0" /* offset 5636 */
-  "\x28\x31\x38\x29\0" /* offset 5641 */
-  "\x28\x31\x39\x29\0" /* offset 5646 */
-  "\x28\x32\x30\x29\0" /* offset 5651 */
-  "\x31\x2e\0" /* offset 5656 */
-  "\x32\x2e\0" /* offset 5659 */
-  "\x33\x2e\0" /* offset 5662 */
-  "\x34\x2e\0" /* offset 5665 */
-  "\x35\x2e\0" /* offset 5668 */
-  "\x36\x2e\0" /* offset 5671 */
-  "\x37\x2e\0" /* offset 5674 */
-  "\x38\x2e\0" /* offset 5677 */
-  "\x39\x2e\0" /* offset 5680 */
-  "\x31\x30\x2e\0" /* offset 5683 */
-  "\x31\x31\x2e\0" /* offset 5687 */
-  "\x31\x32\x2e\0" /* offset 5691 */
-  "\x31\x33\x2e\0" /* offset 5695 */
-  "\x31\x34\x2e\0" /* offset 5699 */
-  "\x31\x35\x2e\0" /* offset 5703 */
-  "\x31\x36\x2e\0" /* offset 5707 */
-  "\x31\x37\x2e\0" /* offset 5711 */
-  "\x31\x38\x2e\0" /* offset 5715 */
-  "\x31\x39\x2e\0" /* offset 5719 */
-  "\x32\x30\x2e\0" /* offset 5723 */
-  "\x28\x61\x29\0" /* offset 5727 */
-  "\x28\x62\x29\0" /* offset 5731 */
-  "\x28\x63\x29\0" /* offset 5735 */
-  "\x28\x64\x29\0" /* offset 5739 */
-  "\x28\x65\x29\0" /* offset 5743 */
-  "\x28\x66\x29\0" /* offset 5747 */
-  "\x28\x67\x29\0" /* offset 5751 */
-  "\x28\x68\x29\0" /* offset 5755 */
-  "\x28\x69\x29\0" /* offset 5759 */
-  "\x28\x6a\x29\0" /* offset 5763 */
-  "\x28\x6b\x29\0" /* offset 5767 */
-  "\x28\x6c\x29\0" /* offset 5771 */
-  "\x28\x6d\x29\0" /* offset 5775 */
-  "\x28\x6e\x29\0" /* offset 5779 */
-  "\x28\x6f\x29\0" /* offset 5783 */
-  "\x28\x70\x29\0" /* offset 5787 */
-  "\x28\x71\x29\0" /* offset 5791 */
-  "\x28\x72\x29\0" /* offset 5795 */
-  "\x28\x73\x29\0" /* offset 5799 */
-  "\x28\x74\x29\0" /* offset 5803 */
-  "\x28\x75\x29\0" /* offset 5807 */
-  "\x28\x76\x29\0" /* offset 5811 */
-  "\x28\x77\x29\0" /* offset 5815 */
-  "\x28\x78\x29\0" /* offset 5819 */
-  "\x28\x79\x29\0" /* offset 5823 */
-  "\x28\x7a\x29\0" /* offset 5827 */
-  "\x41\0" /* offset 5831 */
-  "\x47\0" /* offset 5833 */
-  "\x4a\0" /* offset 5835 */
-  "\x4f\0" /* offset 5837 */
-  "\x53\0" /* offset 5839 */
-  "\x54\0" /* offset 5841 */
-  "\x55\0" /* offset 5843 */
-  "\x57\0" /* offset 5845 */
-  "\x59\0" /* offset 5847 */
-  "\x62\0" /* offset 5849 */
-  "\x66\0" /* offset 5851 */
-  "\x6b\0" /* offset 5853 */
-  "\x70\0" /* offset 5855 */
-  "\x71\0" /* offset 5857 */
-  "\x74\0" /* offset 5859 */
-  "\x75\0" /* offset 5861 */
-  "\x7a\0" /* offset 5863 */
-  "\xe2\x88\xab\xe2\x88\xab\xe2\x88\xab\xe2\x88\xab\0" /* offset 5865 */
-  "\x3a\x3a\x3d\0" /* offset 5878 */
-  "\x3d\x3d\0" /* offset 5882 */
-  "\x3d\x3d\x3d\0" /* offset 5885 */
-  "\xe2\xab\x9d\xcc\xb8\0" /* offset 5889 */
-  "\xe6\xaf\x8d\0" /* offset 5895 */
-  "\xe9\xbe\x9f\0" /* offset 5899 */
-  "\xe4\xb8\x80\0" /* offset 5903 */
-  "\xe4\xb8\xa8\0" /* offset 5907 */
-  "\xe4\xb8\xb6\0" /* offset 5911 */
-  "\xe4\xb8\xbf\0" /* offset 5915 */
-  "\xe4\xb9\x99\0" /* offset 5919 */
-  "\xe4\xba\x85\0" /* offset 5923 */
-  "\xe4\xba\x8c\0" /* offset 5927 */
-  "\xe4\xba\xa0\0" /* offset 5931 */
-  "\xe4\xba\xba\0" /* offset 5935 */
-  "\xe5\x84\xbf\0" /* offset 5939 */
-  "\xe5\x85\xa5\0" /* offset 5943 */
-  "\xe5\x85\xab\0" /* offset 5947 */
-  "\xe5\x86\x82\0" /* offset 5951 */
-  "\xe5\x86\x96\0" /* offset 5955 */
-  "\xe5\x86\xab\0" /* offset 5959 */
-  "\xe5\x87\xa0\0" /* offset 5963 */
-  "\xe5\x87\xb5\0" /* offset 5967 */
-  "\xe5\x88\x80\0" /* offset 5971 */
-  "\xe5\x8a\x9b\0" /* offset 5975 */
-  "\xe5\x8b\xb9\0" /* offset 5979 */
-  "\xe5\x8c\x95\0" /* offset 5983 */
-  "\xe5\x8c\x9a\0" /* offset 5987 */
-  "\xe5\x8c\xb8\0" /* offset 5991 */
-  "\xe5\x8d\x81\0" /* offset 5995 */
-  "\xe5\x8d\x9c\0" /* offset 5999 */
-  "\xe5\x8d\xa9\0" /* offset 6003 */
-  "\xe5\x8e\x82\0" /* offset 6007 */
-  "\xe5\x8e\xb6\0" /* offset 6011 */
-  "\xe5\x8f\x88\0" /* offset 6015 */
-  "\xe5\x8f\xa3\0" /* offset 6019 */
-  "\xe5\x9b\x97\0" /* offset 6023 */
-  "\xe5\x9c\x9f\0" /* offset 6027 */
-  "\xe5\xa3\xab\0" /* offset 6031 */
-  "\xe5\xa4\x82\0" /* offset 6035 */
-  "\xe5\xa4\x8a\0" /* offset 6039 */
-  "\xe5\xa4\x95\0" /* offset 6043 */
-  "\xe5\xa4\xa7\0" /* offset 6047 */
-  "\xe5\xa5\xb3\0" /* offset 6051 */
-  "\xe5\xad\x90\0" /* offset 6055 */
-  "\xe5\xae\x80\0" /* offset 6059 */
-  "\xe5\xaf\xb8\0" /* offset 6063 */
-  "\xe5\xb0\x8f\0" /* offset 6067 */
-  "\xe5\xb0\xa2\0" /* offset 6071 */
-  "\xe5\xb0\xb8\0" /* offset 6075 */
-  "\xe5\xb1\xae\0" /* offset 6079 */
-  "\xe5\xb1\xb1\0" /* offset 6083 */
-  "\xe5\xb7\x9b\0" /* offset 6087 */
-  "\xe5\xb7\xa5\0" /* offset 6091 */
-  "\xe5\xb7\xb1\0" /* offset 6095 */
-  "\xe5\xb7\xbe\0" /* offset 6099 */
-  "\xe5\xb9\xb2\0" /* offset 6103 */
-  "\xe5\xb9\xba\0" /* offset 6107 */
-  "\xe5\xb9\xbf\0" /* offset 6111 */
-  "\xe5\xbb\xb4\0" /* offset 6115 */
-  "\xe5\xbb\xbe\0" /* offset 6119 */
-  "\xe5\xbc\x8b\0" /* offset 6123 */
-  "\xe5\xbc\x93\0" /* offset 6127 */
-  "\xe5\xbd\x90\0" /* offset 6131 */
-  "\xe5\xbd\xa1\0" /* offset 6135 */
-  "\xe5\xbd\xb3\0" /* offset 6139 */
-  "\xe5\xbf\x83\0" /* offset 6143 */
-  "\xe6\x88\x88\0" /* offset 6147 */
-  "\xe6\x88\xb6\0" /* offset 6151 */
-  "\xe6\x89\x8b\0" /* offset 6155 */
-  "\xe6\x94\xaf\0" /* offset 6159 */
-  "\xe6\x94\xb4\0" /* offset 6163 */
-  "\xe6\x96\x87\0" /* offset 6167 */
-  "\xe6\x96\x97\0" /* offset 6171 */
-  "\xe6\x96\xa4\0" /* offset 6175 */
-  "\xe6\x96\xb9\0" /* offset 6179 */
-  "\xe6\x97\xa0\0" /* offset 6183 */
-  "\xe6\x97\xa5\0" /* offset 6187 */
-  "\xe6\x9b\xb0\0" /* offset 6191 */
-  "\xe6\x9c\x88\0" /* offset 6195 */
-  "\xe6\x9c\xa8\0" /* offset 6199 */
-  "\xe6\xac\xa0\0" /* offset 6203 */
-  "\xe6\xad\xa2\0" /* offset 6207 */
-  "\xe6\xad\xb9\0" /* offset 6211 */
-  "\xe6\xae\xb3\0" /* offset 6215 */
-  "\xe6\xaf\x8b\0" /* offset 6219 */
-  "\xe6\xaf\x94\0" /* offset 6223 */
-  "\xe6\xaf\x9b\0" /* offset 6227 */
-  "\xe6\xb0\x8f\0" /* offset 6231 */
-  "\xe6\xb0\x94\0" /* offset 6235 */
-  "\xe6\xb0\xb4\0" /* offset 6239 */
-  "\xe7\x81\xab\0" /* offset 6243 */
-  "\xe7\x88\xaa\0" /* offset 6247 */
-  "\xe7\x88\xb6\0" /* offset 6251 */
-  "\xe7\x88\xbb\0" /* offset 6255 */
-  "\xe7\x88\xbf\0" /* offset 6259 */
-  "\xe7\x89\x87\0" /* offset 6263 */
-  "\xe7\x89\x99\0" /* offset 6267 */
-  "\xe7\x89\x9b\0" /* offset 6271 */
-  "\xe7\x8a\xac\0" /* offset 6275 */
-  "\xe7\x8e\x84\0" /* offset 6279 */
-  "\xe7\x8e\x89\0" /* offset 6283 */
-  "\xe7\x93\x9c\0" /* offset 6287 */
-  "\xe7\x93\xa6\0" /* offset 6291 */
-  "\xe7\x94\x98\0" /* offset 6295 */
-  "\xe7\x94\x9f\0" /* offset 6299 */
-  "\xe7\x94\xa8\0" /* offset 6303 */
-  "\xe7\x94\xb0\0" /* offset 6307 */
-  "\xe7\x96\x8b\0" /* offset 6311 */
-  "\xe7\x96\x92\0" /* offset 6315 */
-  "\xe7\x99\xb6\0" /* offset 6319 */
-  "\xe7\x99\xbd\0" /* offset 6323 */
-  "\xe7\x9a\xae\0" /* offset 6327 */
-  "\xe7\x9a\xbf\0" /* offset 6331 */
-  "\xe7\x9b\xae\0" /* offset 6335 */
-  "\xe7\x9f\x9b\0" /* offset 6339 */
-  "\xe7\x9f\xa2\0" /* offset 6343 */
-  "\xe7\x9f\xb3\0" /* offset 6347 */
-  "\xe7\xa4\xba\0" /* offset 6351 */
-  "\xe7\xa6\xb8\0" /* offset 6355 */
-  "\xe7\xa6\xbe\0" /* offset 6359 */
-  "\xe7\xa9\xb4\0" /* offset 6363 */
-  "\xe7\xab\x8b\0" /* offset 6367 */
-  "\xe7\xab\xb9\0" /* offset 6371 */
-  "\xe7\xb1\xb3\0" /* offset 6375 */
-  "\xe7\xb3\xb8\0" /* offset 6379 */
-  "\xe7\xbc\xb6\0" /* offset 6383 */
-  "\xe7\xbd\x91\0" /* offset 6387 */
-  "\xe7\xbe\x8a\0" /* offset 6391 */
-  "\xe7\xbe\xbd\0" /* offset 6395 */
-  "\xe8\x80\x81\0" /* offset 6399 */
-  "\xe8\x80\x8c\0" /* offset 6403 */
-  "\xe8\x80\x92\0" /* offset 6407 */
-  "\xe8\x80\xb3\0" /* offset 6411 */
-  "\xe8\x81\xbf\0" /* offset 6415 */
-  "\xe8\x82\x89\0" /* offset 6419 */
-  "\xe8\x87\xa3\0" /* offset 6423 */
-  "\xe8\x87\xaa\0" /* offset 6427 */
-  "\xe8\x87\xb3\0" /* offset 6431 */
-  "\xe8\x87\xbc\0" /* offset 6435 */
-  "\xe8\x88\x8c\0" /* offset 6439 */
-  "\xe8\x88\x9b\0" /* offset 6443 */
-  "\xe8\x88\x9f\0" /* offset 6447 */
-  "\xe8\x89\xae\0" /* offset 6451 */
-  "\xe8\x89\xb2\0" /* offset 6455 */
-  "\xe8\x89\xb8\0" /* offset 6459 */
-  "\xe8\x99\x8d\0" /* offset 6463 */
-  "\xe8\x99\xab\0" /* offset 6467 */
-  "\xe8\xa1\x80\0" /* offset 6471 */
-  "\xe8\xa1\x8c\0" /* offset 6475 */
-  "\xe8\xa1\xa3\0" /* offset 6479 */
-  "\xe8\xa5\xbe\0" /* offset 6483 */
-  "\xe8\xa6\x8b\0" /* offset 6487 */
-  "\xe8\xa7\x92\0" /* offset 6491 */
-  "\xe8\xa8\x80\0" /* offset 6495 */
-  "\xe8\xb0\xb7\0" /* offset 6499 */
-  "\xe8\xb1\x86\0" /* offset 6503 */
-  "\xe8\xb1\x95\0" /* offset 6507 */
-  "\xe8\xb1\xb8\0" /* offset 6511 */
-  "\xe8\xb2\x9d\0" /* offset 6515 */
-  "\xe8\xb5\xa4\0" /* offset 6519 */
-  "\xe8\xb5\xb0\0" /* offset 6523 */
-  "\xe8\xb6\xb3\0" /* offset 6527 */
-  "\xe8\xba\xab\0" /* offset 6531 */
-  "\xe8\xbb\x8a\0" /* offset 6535 */
-  "\xe8\xbe\x9b\0" /* offset 6539 */
-  "\xe8\xbe\xb0\0" /* offset 6543 */
-  "\xe8\xbe\xb5\0" /* offset 6547 */
-  "\xe9\x82\x91\0" /* offset 6551 */
-  "\xe9\x85\x89\0" /* offset 6555 */
-  "\xe9\x87\x86\0" /* offset 6559 */
-  "\xe9\x87\x8c\0" /* offset 6563 */
-  "\xe9\x87\x91\0" /* offset 6567 */
-  "\xe9\x95\xb7\0" /* offset 6571 */
-  "\xe9\x96\x80\0" /* offset 6575 */
-  "\xe9\x98\x9c\0" /* offset 6579 */
-  "\xe9\x9a\xb6\0" /* offset 6583 */
-  "\xe9\x9a\xb9\0" /* offset 6587 */
-  "\xe9\x9b\xa8\0" /* offset 6591 */
-  "\xe9\x9d\x91\0" /* offset 6595 */
-  "\xe9\x9d\x9e\0" /* offset 6599 */
-  "\xe9\x9d\xa2\0" /* offset 6603 */
-  "\xe9\x9d\xa9\0" /* offset 6607 */
-  "\xe9\x9f\x8b\0" /* offset 6611 */
-  "\xe9\x9f\xad\0" /* offset 6615 */
-  "\xe9\x9f\xb3\0" /* offset 6619 */
-  "\xe9\xa0\x81\0" /* offset 6623 */
-  "\xe9\xa2\xa8\0" /* offset 6627 */
-  "\xe9\xa3\x9b\0" /* offset 6631 */
-  "\xe9\xa3\x9f\0" /* offset 6635 */
-  "\xe9\xa6\x96\0" /* offset 6639 */
-  "\xe9\xa6\x99\0" /* offset 6643 */
-  "\xe9\xa6\xac\0" /* offset 6647 */
-  "\xe9\xaa\xa8\0" /* offset 6651 */
-  "\xe9\xab\x98\0" /* offset 6655 */
-  "\xe9\xab\x9f\0" /* offset 6659 */
-  "\xe9\xac\xa5\0" /* offset 6663 */
-  "\xe9\xac\xaf\0" /* offset 6667 */
-  "\xe9\xac\xb2\0" /* offset 6671 */
-  "\xe9\xac\xbc\0" /* offset 6675 */
-  "\xe9\xad\x9a\0" /* offset 6679 */
-  "\xe9\xb3\xa5\0" /* offset 6683 */
-  "\xe9\xb9\xb5\0" /* offset 6687 */
-  "\xe9\xb9\xbf\0" /* offset 6691 */
-  "\xe9\xba\xa5\0" /* offset 6695 */
-  "\xe9\xba\xbb\0" /* offset 6699 */
-  "\xe9\xbb\x83\0" /* offset 6703 */
-  "\xe9\xbb\x8d\0" /* offset 6707 */
-  "\xe9\xbb\x91\0" /* offset 6711 */
-  "\xe9\xbb\xb9\0" /* offset 6715 */
-  "\xe9\xbb\xbd\0" /* offset 6719 */
-  "\xe9\xbc\x8e\0" /* offset 6723 */
-  "\xe9\xbc\x93\0" /* offset 6727 */
-  "\xe9\xbc\xa0\0" /* offset 6731 */
-  "\xe9\xbc\xbb\0" /* offset 6735 */
-  "\xe9\xbd\x8a\0" /* offset 6739 */
-  "\xe9\xbd\x92\0" /* offset 6743 */
-  "\xe9\xbe\x8d\0" /* offset 6747 */
-  "\xe9\xbe\x9c\0" /* offset 6751 */
-  "\xe9\xbe\xa0\0" /* offset 6755 */
-  "\xe3\x80\x92\0" /* offset 6759 */
-  "\xe5\x8d\x84\0" /* offset 6763 */
-  "\xe5\x8d\x85\0" /* offset 6767 */
-  "\xe3\x81\x8b\xe3\x82\x99\0" /* offset 6771 */
-  "\xe3\x81\x8d\xe3\x82\x99\0" /* offset 6778 */
-  "\xe3\x81\x8f\xe3\x82\x99\0" /* offset 6785 */
-  "\xe3\x81\x91\xe3\x82\x99\0" /* offset 6792 */
-  "\xe3\x81\x93\xe3\x82\x99\0" /* offset 6799 */
-  "\xe3\x81\x95\xe3\x82\x99\0" /* offset 6806 */
-  "\xe3\x81\x97\xe3\x82\x99\0" /* offset 6813 */
-  "\xe3\x81\x99\xe3\x82\x99\0" /* offset 6820 */
-  "\xe3\x81\x9b\xe3\x82\x99\0" /* offset 6827 */
-  "\xe3\x81\x9d\xe3\x82\x99\0" /* offset 6834 */
-  "\xe3\x81\x9f\xe3\x82\x99\0" /* offset 6841 */
-  "\xe3\x81\xa1\xe3\x82\x99\0" /* offset 6848 */
-  "\xe3\x81\xa4\xe3\x82\x99\0" /* offset 6855 */
-  "\xe3\x81\xa6\xe3\x82\x99\0" /* offset 6862 */
-  "\xe3\x81\xa8\xe3\x82\x99\0" /* offset 6869 */
-  "\xe3\x81\xaf\xe3\x82\x99\0" /* offset 6876 */
-  "\xe3\x81\xaf\xe3\x82\x9a\0" /* offset 6883 */
-  "\xe3\x81\xb2\xe3\x82\x99\0" /* offset 6890 */
-  "\xe3\x81\xb2\xe3\x82\x9a\0" /* offset 6897 */
-  "\xe3\x81\xb5\xe3\x82\x99\0" /* offset 6904 */
-  "\xe3\x81\xb5\xe3\x82\x9a\0" /* offset 6911 */
-  "\xe3\x81\xb8\xe3\x82\x99\0" /* offset 6918 */
-  "\xe3\x81\xb8\xe3\x82\x9a\0" /* offset 6925 */
-  "\xe3\x81\xbb\xe3\x82\x99\0" /* offset 6932 */
-  "\xe3\x81\xbb\xe3\x82\x9a\0" /* offset 6939 */
-  "\xe3\x81\x86\xe3\x82\x99\0" /* offset 6946 */
-  "\x20\xe3\x82\x99\0" /* offset 6953 */
-  "\x20\xe3\x82\x9a\0" /* offset 6958 */
-  "\xe3\x82\x9d\xe3\x82\x99\0" /* offset 6963 */
-  "\xe3\x82\x88\xe3\x82\x8a\0" /* offset 6970 */
-  "\xe3\x82\xab\xe3\x82\x99\0" /* offset 6977 */
-  "\xe3\x82\xad\xe3\x82\x99\0" /* offset 6984 */
-  "\xe3\x82\xaf\xe3\x82\x99\0" /* offset 6991 */
-  "\xe3\x82\xb1\xe3\x82\x99\0" /* offset 6998 */
-  "\xe3\x82\xb3\xe3\x82\x99\0" /* offset 7005 */
-  "\xe3\x82\xb5\xe3\x82\x99\0" /* offset 7012 */
-  "\xe3\x82\xb7\xe3\x82\x99\0" /* offset 7019 */
-  "\xe3\x82\xb9\xe3\x82\x99\0" /* offset 7026 */
-  "\xe3\x82\xbb\xe3\x82\x99\0" /* offset 7033 */
-  "\xe3\x82\xbd\xe3\x82\x99\0" /* offset 7040 */
-  "\xe3\x82\xbf\xe3\x82\x99\0" /* offset 7047 */
-  "\xe3\x83\x81\xe3\x82\x99\0" /* offset 7054 */
-  "\xe3\x83\x84\xe3\x82\x99\0" /* offset 7061 */
-  "\xe3\x83\x86\xe3\x82\x99\0" /* offset 7068 */
-  "\xe3\x83\x88\xe3\x82\x99\0" /* offset 7075 */
-  "\xe3\x83\x8f\xe3\x82\x99\0" /* offset 7082 */
-  "\xe3\x83\x8f\xe3\x82\x9a\0" /* offset 7089 */
-  "\xe3\x83\x92\xe3\x82\x99\0" /* offset 7096 */
-  "\xe3\x83\x92\xe3\x82\x9a\0" /* offset 7103 */
-  "\xe3\x83\x95\xe3\x82\x99\0" /* offset 7110 */
-  "\xe3\x83\x95\xe3\x82\x9a\0" /* offset 7117 */
-  "\xe3\x83\x98\xe3\x82\x99\0" /* offset 7124 */
-  "\xe3\x83\x98\xe3\x82\x9a\0" /* offset 7131 */
-  "\xe3\x83\x9b\xe3\x82\x99\0" /* offset 7138 */
-  "\xe3\x83\x9b\xe3\x82\x9a\0" /* offset 7145 */
-  "\xe3\x82\xa6\xe3\x82\x99\0" /* offset 7152 */
-  "\xe3\x83\xaf\xe3\x82\x99\0" /* offset 7159 */
-  "\xe3\x83\xb0\xe3\x82\x99\0" /* offset 7166 */
-  "\xe3\x83\xb1\xe3\x82\x99\0" /* offset 7173 */
-  "\xe3\x83\xb2\xe3\x82\x99\0" /* offset 7180 */
-  "\xe3\x83\xbd\xe3\x82\x99\0" /* offset 7187 */
-  "\xe3\x82\xb3\xe3\x83\x88\0" /* offset 7194 */
-  "\xe1\x84\x80\0" /* offset 7201 */
-  "\xe1\x84\x81\0" /* offset 7205 */
-  "\xe1\x86\xaa\0" /* offset 7209 */
-  "\xe1\x84\x82\0" /* offset 7213 */
-  "\xe1\x86\xac\0" /* offset 7217 */
-  "\xe1\x86\xad\0" /* offset 7221 */
-  "\xe1\x84\x83\0" /* offset 7225 */
-  "\xe1\x84\x84\0" /* offset 7229 */
-  "\xe1\x84\x85\0" /* offset 7233 */
-  "\xe1\x86\xb0\0" /* offset 7237 */
-  "\xe1\x86\xb1\0" /* offset 7241 */
-  "\xe1\x86\xb2\0" /* offset 7245 */
-  "\xe1\x86\xb3\0" /* offset 7249 */
-  "\xe1\x86\xb4\0" /* offset 7253 */
-  "\xe1\x86\xb5\0" /* offset 7257 */
-  "\xe1\x84\x9a\0" /* offset 7261 */
-  "\xe1\x84\x86\0" /* offset 7265 */
-  "\xe1\x84\x87\0" /* offset 7269 */
-  "\xe1\x84\x88\0" /* offset 7273 */
-  "\xe1\x84\xa1\0" /* offset 7277 */
-  "\xe1\x84\x89\0" /* offset 7281 */
-  "\xe1\x84\x8a\0" /* offset 7285 */
-  "\xe1\x84\x8b\0" /* offset 7289 */
-  "\xe1\x84\x8c\0" /* offset 7293 */
-  "\xe1\x84\x8d\0" /* offset 7297 */
-  "\xe1\x84\x8e\0" /* offset 7301 */
-  "\xe1\x84\x8f\0" /* offset 7305 */
-  "\xe1\x84\x90\0" /* offset 7309 */
-  "\xe1\x84\x91\0" /* offset 7313 */
-  "\xe1\x84\x92\0" /* offset 7317 */
-  "\xe1\x85\xa1\0" /* offset 7321 */
-  "\xe1\x85\xa2\0" /* offset 7325 */
-  "\xe1\x85\xa3\0" /* offset 7329 */
-  "\xe1\x85\xa4\0" /* offset 7333 */
-  "\xe1\x85\xa5\0" /* offset 7337 */
-  "\xe1\x85\xa6\0" /* offset 7341 */
-  "\xe1\x85\xa7\0" /* offset 7345 */
-  "\xe1\x85\xa8\0" /* offset 7349 */
-  "\xe1\x85\xa9\0" /* offset 7353 */
-  "\xe1\x85\xaa\0" /* offset 7357 */
-  "\xe1\x85\xab\0" /* offset 7361 */
-  "\xe1\x85\xac\0" /* offset 7365 */
-  "\xe1\x85\xad\0" /* offset 7369 */
-  "\xe1\x85\xae\0" /* offset 7373 */
-  "\xe1\x85\xaf\0" /* offset 7377 */
-  "\xe1\x85\xb0\0" /* offset 7381 */
-  "\xe1\x85\xb1\0" /* offset 7385 */
-  "\xe1\x85\xb2\0" /* offset 7389 */
-  "\xe1\x85\xb3\0" /* offset 7393 */
-  "\xe1\x85\xb4\0" /* offset 7397 */
-  "\xe1\x85\xb5\0" /* offset 7401 */
-  "\xe1\x85\xa0\0" /* offset 7405 */
-  "\xe1\x84\x94\0" /* offset 7409 */
-  "\xe1\x84\x95\0" /* offset 7413 */
-  "\xe1\x87\x87\0" /* offset 7417 */
-  "\xe1\x87\x88\0" /* offset 7421 */
-  "\xe1\x87\x8c\0" /* offset 7425 */
-  "\xe1\x87\x8e\0" /* offset 7429 */
-  "\xe1\x87\x93\0" /* offset 7433 */
-  "\xe1\x87\x97\0" /* offset 7437 */
-  "\xe1\x87\x99\0" /* offset 7441 */
-  "\xe1\x84\x9c\0" /* offset 7445 */
-  "\xe1\x87\x9d\0" /* offset 7449 */
-  "\xe1\x87\x9f\0" /* offset 7453 */
-  "\xe1\x84\x9d\0" /* offset 7457 */
-  "\xe1\x84\x9e\0" /* offset 7461 */
-  "\xe1\x84\xa0\0" /* offset 7465 */
-  "\xe1\x84\xa2\0" /* offset 7469 */
-  "\xe1\x84\xa3\0" /* offset 7473 */
-  "\xe1\x84\xa7\0" /* offset 7477 */
-  "\xe1\x84\xa9\0" /* offset 7481 */
-  "\xe1\x84\xab\0" /* offset 7485 */
-  "\xe1\x84\xac\0" /* offset 7489 */
-  "\xe1\x84\xad\0" /* offset 7493 */
-  "\xe1\x84\xae\0" /* offset 7497 */
-  "\xe1\x84\xaf\0" /* offset 7501 */
-  "\xe1\x84\xb2\0" /* offset 7505 */
-  "\xe1\x84\xb6\0" /* offset 7509 */
-  "\xe1\x85\x80\0" /* offset 7513 */
-  "\xe1\x85\x87\0" /* offset 7517 */
-  "\xe1\x85\x8c\0" /* offset 7521 */
-  "\xe1\x87\xb1\0" /* offset 7525 */
-  "\xe1\x87\xb2\0" /* offset 7529 */
-  "\xe1\x85\x97\0" /* offset 7533 */
-  "\xe1\x85\x98\0" /* offset 7537 */
-  "\xe1\x85\x99\0" /* offset 7541 */
-  "\xe1\x86\x84\0" /* offset 7545 */
-  "\xe1\x86\x85\0" /* offset 7549 */
-  "\xe1\x86\x88\0" /* offset 7553 */
-  "\xe1\x86\x91\0" /* offset 7557 */
-  "\xe1\x86\x92\0" /* offset 7561 */
-  "\xe1\x86\x94\0" /* offset 7565 */
-  "\xe1\x86\x9e\0" /* offset 7569 */
-  "\xe1\x86\xa1\0" /* offset 7573 */
-  "\xe4\xb8\x89\0" /* offset 7577 */
-  "\xe5\x9b\x9b\0" /* offset 7581 */
-  "\xe4\xb8\x8a\0" /* offset 7585 */
-  "\xe4\xb8\xad\0" /* offset 7589 */
-  "\xe4\xb8\x8b\0" /* offset 7593 */
-  "\xe7\x94\xb2\0" /* offset 7597 */
-  "\xe4\xb8\x99\0" /* offset 7601 */
-  "\xe4\xb8\x81\0" /* offset 7605 */
-  "\xe5\xa4\xa9\0" /* offset 7609 */
-  "\xe5\x9c\xb0\0" /* offset 7613 */
-  "\x28\xe1\x84\x80\x29\0" /* offset 7617 */
-  "\x28\xe1\x84\x82\x29\0" /* offset 7623 */
-  "\x28\xe1\x84\x83\x29\0" /* offset 7629 */
-  "\x28\xe1\x84\x85\x29\0" /* offset 7635 */
-  "\x28\xe1\x84\x86\x29\0" /* offset 7641 */
-  "\x28\xe1\x84\x87\x29\0" /* offset 7647 */
-  "\x28\xe1\x84\x89\x29\0" /* offset 7653 */
-  "\x28\xe1\x84\x8b\x29\0" /* offset 7659 */
-  "\x28\xe1\x84\x8c\x29\0" /* offset 7665 */
-  "\x28\xe1\x84\x8e\x29\0" /* offset 7671 */
-  "\x28\xe1\x84\x8f\x29\0" /* offset 7677 */
-  "\x28\xe1\x84\x90\x29\0" /* offset 7683 */
-  "\x28\xe1\x84\x91\x29\0" /* offset 7689 */
-  "\x28\xe1\x84\x92\x29\0" /* offset 7695 */
-  "\x28\xe1\x84\x80\xe1\x85\xa1\x29\0" /* offset 7701 */
-  "\x28\xe1\x84\x82\xe1\x85\xa1\x29\0" /* offset 7710 */
-  "\x28\xe1\x84\x83\xe1\x85\xa1\x29\0" /* offset 7719 */
-  "\x28\xe1\x84\x85\xe1\x85\xa1\x29\0" /* offset 7728 */
-  "\x28\xe1\x84\x86\xe1\x85\xa1\x29\0" /* offset 7737 */
-  "\x28\xe1\x84\x87\xe1\x85\xa1\x29\0" /* offset 7746 */
-  "\x28\xe1\x84\x89\xe1\x85\xa1\x29\0" /* offset 7755 */
-  "\x28\xe1\x84\x8b\xe1\x85\xa1\x29\0" /* offset 7764 */
-  "\x28\xe1\x84\x8c\xe1\x85\xa1\x29\0" /* offset 7773 */
-  "\x28\xe1\x84\x8e\xe1\x85\xa1\x29\0" /* offset 7782 */
-  "\x28\xe1\x84\x8f\xe1\x85\xa1\x29\0" /* offset 7791 */
-  "\x28\xe1\x84\x90\xe1\x85\xa1\x29\0" /* offset 7800 */
-  "\x28\xe1\x84\x91\xe1\x85\xa1\x29\0" /* offset 7809 */
-  "\x28\xe1\x84\x92\xe1\x85\xa1\x29\0" /* offset 7818 */
-  "\x28\xe1\x84\x8c\xe1\x85\xae\x29\0" /* offset 7827 */
-  "\x28\xe4\xb8\x80\x29\0" /* offset 7836 */
-  "\x28\xe4\xba\x8c\x29\0" /* offset 7842 */
-  "\x28\xe4\xb8\x89\x29\0" /* offset 7848 */
-  "\x28\xe5\x9b\x9b\x29\0" /* offset 7854 */
-  "\x28\xe4\xba\x94\x29\0" /* offset 7860 */
-  "\x28\xe5\x85\xad\x29\0" /* offset 7866 */
-  "\x28\xe4\xb8\x83\x29\0" /* offset 7872 */
-  "\x28\xe5\x85\xab\x29\0" /* offset 7878 */
-  "\x28\xe4\xb9\x9d\x29\0" /* offset 7884 */
-  "\x28\xe5\x8d\x81\x29\0" /* offset 7890 */
-  "\x28\xe6\x9c\x88\x29\0" /* offset 7896 */
-  "\x28\xe7\x81\xab\x29\0" /* offset 7902 */
-  "\x28\xe6\xb0\xb4\x29\0" /* offset 7908 */
-  "\x28\xe6\x9c\xa8\x29\0" /* offset 7914 */
-  "\x28\xe9\x87\x91\x29\0" /* offset 7920 */
-  "\x28\xe5\x9c\x9f\x29\0" /* offset 7926 */
-  "\x28\xe6\x97\xa5\x29\0" /* offset 7932 */
-  "\x28\xe6\xa0\xaa\x29\0" /* offset 7938 */
-  "\x28\xe6\x9c\x89\x29\0" /* offset 7944 */
-  "\x28\xe7\xa4\xbe\x29\0" /* offset 7950 */
-  "\x28\xe5\x90\x8d\x29\0" /* offset 7956 */
-  "\x28\xe7\x89\xb9\x29\0" /* offset 7962 */
-  "\x28\xe8\xb2\xa1\x29\0" /* offset 7968 */
-  "\x28\xe7\xa5\x9d\x29\0" /* offset 7974 */
-  "\x28\xe5\x8a\xb4\x29\0" /* offset 7980 */
-  "\x28\xe4\xbb\xa3\x29\0" /* offset 7986 */
-  "\x28\xe5\x91\xbc\x29\0" /* offset 7992 */
-  "\x28\xe5\xad\xa6\x29\0" /* offset 7998 */
-  "\x28\xe7\x9b\xa3\x29\0" /* offset 8004 */
-  "\x28\xe4\xbc\x81\x29\0" /* offset 8010 */
-  "\x28\xe8\xb3\x87\x29\0" /* offset 8016 */
-  "\x28\xe5\x8d\x94\x29\0" /* offset 8022 */
-  "\x28\xe7\xa5\xad\x29\0" /* offset 8028 */
-  "\x28\xe4\xbc\x91\x29\0" /* offset 8034 */
-  "\x28\xe8\x87\xaa\x29\0" /* offset 8040 */
-  "\x28\xe8\x87\xb3\x29\0" /* offset 8046 */
-  "\x32\x31\0" /* offset 8052 */
-  "\x32\x32\0" /* offset 8055 */
-  "\x32\x33\0" /* offset 8058 */
-  "\x32\x34\0" /* offset 8061 */
-  "\x32\x35\0" /* offset 8064 */
-  "\x32\x36\0" /* offset 8067 */
-  "\x32\x37\0" /* offset 8070 */
-  "\x32\x38\0" /* offset 8073 */
-  "\x32\x39\0" /* offset 8076 */
-  "\x33\x30\0" /* offset 8079 */
-  "\x33\x31\0" /* offset 8082 */
-  "\x33\x32\0" /* offset 8085 */
-  "\x33\x33\0" /* offset 8088 */
-  "\x33\x34\0" /* offset 8091 */
-  "\x33\x35\0" /* offset 8094 */
-  "\xe1\x84\x80\xe1\x85\xa1\0" /* offset 8097 */
-  "\xe1\x84\x82\xe1\x85\xa1\0" /* offset 8104 */
-  "\xe1\x84\x83\xe1\x85\xa1\0" /* offset 8111 */
-  "\xe1\x84\x85\xe1\x85\xa1\0" /* offset 8118 */
-  "\xe1\x84\x86\xe1\x85\xa1\0" /* offset 8125 */
-  "\xe1\x84\x87\xe1\x85\xa1\0" /* offset 8132 */
-  "\xe1\x84\x89\xe1\x85\xa1\0" /* offset 8139 */
-  "\xe1\x84\x8b\xe1\x85\xa1\0" /* offset 8146 */
-  "\xe1\x84\x8c\xe1\x85\xa1\0" /* offset 8153 */
-  "\xe1\x84\x8e\xe1\x85\xa1\0" /* offset 8160 */
-  "\xe1\x84\x8f\xe1\x85\xa1\0" /* offset 8167 */
-  "\xe1\x84\x90\xe1\x85\xa1\0" /* offset 8174 */
-  "\xe1\x84\x91\xe1\x85\xa1\0" /* offset 8181 */
-  "\xe1\x84\x92\xe1\x85\xa1\0" /* offset 8188 */
-  "\xe4\xba\x94\0" /* offset 8195 */
-  "\xe5\x85\xad\0" /* offset 8199 */
-  "\xe4\xb8\x83\0" /* offset 8203 */
-  "\xe4\xb9\x9d\0" /* offset 8207 */
-  "\xe6\xa0\xaa\0" /* offset 8211 */
-  "\xe6\x9c\x89\0" /* offset 8215 */
-  "\xe7\xa4\xbe\0" /* offset 8219 */
-  "\xe5\x90\x8d\0" /* offset 8223 */
-  "\xe7\x89\xb9\0" /* offset 8227 */
-  "\xe8\xb2\xa1\0" /* offset 8231 */
-  "\xe7\xa5\x9d\0" /* offset 8235 */
-  "\xe5\x8a\xb4\0" /* offset 8239 */
-  "\xe7\xa7\x98\0" /* offset 8243 */
-  "\xe7\x94\xb7\0" /* offset 8247 */
-  "\xe9\x81\xa9\0" /* offset 8251 */
-  "\xe5\x84\xaa\0" /* offset 8255 */
-  "\xe5\x8d\xb0\0" /* offset 8259 */
-  "\xe6\xb3\xa8\0" /* offset 8263 */
-  "\xe9\xa0\x85\0" /* offset 8267 */
-  "\xe4\xbc\x91\0" /* offset 8271 */
-  "\xe5\x86\x99\0" /* offset 8275 */
-  "\xe6\xad\xa3\0" /* offset 8279 */
-  "\xe5\xb7\xa6\0" /* offset 8283 */
-  "\xe5\x8f\xb3\0" /* offset 8287 */
-  "\xe5\x8c\xbb\0" /* offset 8291 */
-  "\xe5\xae\x97\0" /* offset 8295 */
-  "\xe5\xad\xa6\0" /* offset 8299 */
-  "\xe7\x9b\xa3\0" /* offset 8303 */
-  "\xe4\xbc\x81\0" /* offset 8307 */
-  "\xe8\xb3\x87\0" /* offset 8311 */
-  "\xe5\x8d\x94\0" /* offset 8315 */
-  "\xe5\xa4\x9c\0" /* offset 8319 */
-  "\x33\x36\0" /* offset 8323 */
-  "\x33\x37\0" /* offset 8326 */
-  "\x33\x38\0" /* offset 8329 */
-  "\x33\x39\0" /* offset 8332 */
-  "\x34\x30\0" /* offset 8335 */
-  "\x34\x31\0" /* offset 8338 */
-  "\x34\x32\0" /* offset 8341 */
-  "\x34\x33\0" /* offset 8344 */
-  "\x34\x34\0" /* offset 8347 */
-  "\x34\x35\0" /* offset 8350 */
-  "\x34\x36\0" /* offset 8353 */
-  "\x34\x37\0" /* offset 8356 */
-  "\x34\x38\0" /* offset 8359 */
-  "\x34\x39\0" /* offset 8362 */
-  "\x35\x30\0" /* offset 8365 */
-  "\x31\xe6\x9c\x88\0" /* offset 8368 */
-  "\x32\xe6\x9c\x88\0" /* offset 8373 */
-  "\x33\xe6\x9c\x88\0" /* offset 8378 */
-  "\x34\xe6\x9c\x88\0" /* offset 8383 */
-  "\x35\xe6\x9c\x88\0" /* offset 8388 */
-  "\x36\xe6\x9c\x88\0" /* offset 8393 */
-  "\x37\xe6\x9c\x88\0" /* offset 8398 */
-  "\x38\xe6\x9c\x88\0" /* offset 8403 */
-  "\x39\xe6\x9c\x88\0" /* offset 8408 */
-  "\x31\x30\xe6\x9c\x88\0" /* offset 8413 */
-  "\x31\x31\xe6\x9c\x88\0" /* offset 8419 */
-  "\x31\x32\xe6\x9c\x88\0" /* offset 8425 */
-  "\xe3\x82\xa2\0" /* offset 8431 */
-  "\xe3\x82\xa4\0" /* offset 8435 */
-  "\xe3\x82\xa6\0" /* offset 8439 */
-  "\xe3\x82\xa8\0" /* offset 8443 */
-  "\xe3\x82\xaa\0" /* offset 8447 */
-  "\xe3\x82\xab\0" /* offset 8451 */
-  "\xe3\x82\xad\0" /* offset 8455 */
-  "\xe3\x82\xaf\0" /* offset 8459 */
-  "\xe3\x82\xb1\0" /* offset 8463 */
-  "\xe3\x82\xb3\0" /* offset 8467 */
-  "\xe3\x82\xb5\0" /* offset 8471 */
-  "\xe3\x82\xb7\0" /* offset 8475 */
-  "\xe3\x82\xb9\0" /* offset 8479 */
-  "\xe3\x82\xbb\0" /* offset 8483 */
-  "\xe3\x82\xbd\0" /* offset 8487 */
-  "\xe3\x82\xbf\0" /* offset 8491 */
-  "\xe3\x83\x81\0" /* offset 8495 */
-  "\xe3\x83\x84\0" /* offset 8499 */
-  "\xe3\x83\x86\0" /* offset 8503 */
-  "\xe3\x83\x88\0" /* offset 8507 */
-  "\xe3\x83\x8a\0" /* offset 8511 */
-  "\xe3\x83\x8b\0" /* offset 8515 */
-  "\xe3\x83\x8c\0" /* offset 8519 */
-  "\xe3\x83\x8d\0" /* offset 8523 */
-  "\xe3\x83\x8e\0" /* offset 8527 */
-  "\xe3\x83\x8f\0" /* offset 8531 */
-  "\xe3\x83\x92\0" /* offset 8535 */
-  "\xe3\x83\x95\0" /* offset 8539 */
-  "\xe3\x83\x98\0" /* offset 8543 */
-  "\xe3\x83\x9b\0" /* offset 8547 */
-  "\xe3\x83\x9e\0" /* offset 8551 */
-  "\xe3\x83\x9f\0" /* offset 8555 */
-  "\xe3\x83\xa0\0" /* offset 8559 */
-  "\xe3\x83\xa1\0" /* offset 8563 */
-  "\xe3\x83\xa2\0" /* offset 8567 */
-  "\xe3\x83\xa4\0" /* offset 8571 */
-  "\xe3\x83\xa6\0" /* offset 8575 */
-  "\xe3\x83\xa8\0" /* offset 8579 */
-  "\xe3\x83\xa9\0" /* offset 8583 */
-  "\xe3\x83\xaa\0" /* offset 8587 */
-  "\xe3\x83\xab\0" /* offset 8591 */
-  "\xe3\x83\xac\0" /* offset 8595 */
-  "\xe3\x83\xad\0" /* offset 8599 */
-  "\xe3\x83\xaf\0" /* offset 8603 */
-  "\xe3\x83\xb0\0" /* offset 8607 */
-  "\xe3\x83\xb1\0" /* offset 8611 */
-  "\xe3\x83\xb2\0" /* offset 8615 */
-  "\xe3\x82\xa2\xe3\x83\x8f\xe3\x82\x9a\xe3\x83\xbc\xe3\x83\x88\0" /* offset 8619 */
-  "\xe3\x82\xa2\xe3\x83\xab\xe3\x83\x95\xe3\x82\xa1\0" /* offset 8635 */
-  "\xe3\x82\xa2\xe3\x83\xb3\xe3\x83\x98\xe3\x82\x9a\xe3\x82\xa2\0" /* offset 8648 */
-  "\xe3\x82\xa2\xe3\x83\xbc\xe3\x83\xab\0" /* offset 8664 */
-  "\xe3\x82\xa4\xe3\x83\x8b\xe3\x83\xb3\xe3\x82\xaf\xe3\x82\x99\0" /* offset 8674 */
-  "\xe3\x82\xa4\xe3\x83\xb3\xe3\x83\x81\0" /* offset 8690 */
-  "\xe3\x82\xa6\xe3\x82\xa9\xe3\x83\xb3\0" /* offset 8700 */
-  "\xe3\x82\xa8\xe3\x82\xb9\xe3\x82\xaf\xe3\x83\xbc\xe3\x83\x88\xe3\x82\x99\0" /* offset 8710 */
-  "\xe3\x82\xa8\xe3\x83\xbc\xe3\x82\xab\xe3\x83\xbc\0" /* offset 8729 */
-  "\xe3\x82\xaa\xe3\x83\xb3\xe3\x82\xb9\0" /* offset 8742 */
-  "\xe3\x82\xaa\xe3\x83\xbc\xe3\x83\xa0\0" /* offset 8752 */
-  "\xe3\x82\xab\xe3\x82\xa4\xe3\x83\xaa\0" /* offset 8762 */
-  "\xe3\x82\xab\xe3\x83\xa9\xe3\x83\x83\xe3\x83\x88\0" /* offset 8772 */
-  "\xe3\x82\xab\xe3\x83\xad\xe3\x83\xaa\xe3\x83\xbc\0" /* offset 8785 */
-  "\xe3\x82\xab\xe3\x82\x99\xe3\x83\xad\xe3\x83\xb3\0" /* offset 8798 */
-  "\xe3\x82\xab\xe3\x82\x99\xe3\x83\xb3\xe3\x83\x9e\0" /* offset 8811 */
-  "\xe3\x82\xad\xe3\x82\x99\xe3\x82\xab\xe3\x82\x99\0" /* offset 8824 */
-  "\xe3\x82\xad\xe3\x82\x99\xe3\x83\x8b\xe3\x83\xbc\0" /* offset 8837 */
-  "\xe3\x82\xad\xe3\x83\xa5\xe3\x83\xaa\xe3\x83\xbc\0" /* offset 8850 */
-  "\xe3\x82\xad\xe3\x82\x99\xe3\x83\xab\xe3\x82\xbf\xe3\x82\x99\xe3\x83\xbc\0" /* offset 8863 */
-  "\xe3\x82\xad\xe3\x83\xad\0" /* offset 8882 */
-  "\xe3\x82\xad\xe3\x83\xad\xe3\x82\xaf\xe3\x82\x99\xe3\x83\xa9\xe3\x83\xa0\0" /* offset 8889 */
-  "\xe3\x82\xad\xe3\x83\xad\xe3\x83\xa1\xe3\x83\xbc\xe3\x83\x88\xe3\x83\xab\0" /* offset 8908 */
-  "\xe3\x82\xad\xe3\x83\xad\xe3\x83\xaf\xe3\x83\x83\xe3\x83\x88\0" /* offset 8927 */
-  "\xe3\x82\xaf\xe3\x82\x99\xe3\x83\xa9\xe3\x83\xa0\0" /* offset 8943 */
-  "\xe3\x82\xaf\xe3\x82\x99\xe3\x83\xa9\xe3\x83\xa0\xe3\x83\x88\xe3\x83\xb3\0" /* offset 8956 */
-  "\xe3\x82\xaf\xe3\x83\xab\xe3\x82\xbb\xe3\x82\x99\xe3\x82\xa4\xe3\x83\xad\0" /* offset 8975 */
-  "\xe3\x82\xaf\xe3\x83\xad\xe3\x83\xbc\xe3\x83\x8d\0" /* offset 8994 */
-  "\xe3\x82\xb1\xe3\x83\xbc\xe3\x82\xb9\0" /* offset 9007 */
-  "\xe3\x82\xb3\xe3\x83\xab\xe3\x83\x8a\0" /* offset 9017 */
-  "\xe3\x82\xb3\xe3\x83\xbc\xe3\x83\x9b\xe3\x82\x9a\0" /* offset 9027 */
-  "\xe3\x82\xb5\xe3\x82\xa4\xe3\x82\xaf\xe3\x83\xab\0" /* offset 9040 */
-  "\xe3\x82\xb5\xe3\x83\xb3\xe3\x83\x81\xe3\x83\xbc\xe3\x83\xa0\0" /* offset 9053 */
-  "\xe3\x82\xb7\xe3\x83\xaa\xe3\x83\xb3\xe3\x82\xaf\xe3\x82\x99\0" /* offset 9069 */
-  "\xe3\x82\xbb\xe3\x83\xb3\xe3\x83\x81\0" /* offset 9085 */
-  "\xe3\x82\xbb\xe3\x83\xb3\xe3\x83\x88\0" /* offset 9095 */
-  "\xe3\x82\xbf\xe3\x82\x99\xe3\x83\xbc\xe3\x82\xb9\0" /* offset 9105 */
-  "\xe3\x83\x86\xe3\x82\x99\xe3\x82\xb7\0" /* offset 9118 */
-  "\xe3\x83\x88\xe3\x82\x99\xe3\x83\xab\0" /* offset 9128 */
-  "\xe3\x83\x88\xe3\x83\xb3\0" /* offset 9138 */
-  "\xe3\x83\x8a\xe3\x83\x8e\0" /* offset 9145 */
-  "\xe3\x83\x8e\xe3\x83\x83\xe3\x83\x88\0" /* offset 9152 */
-  "\xe3\x83\x8f\xe3\x82\xa4\xe3\x83\x84\0" /* offset 9162 */
-  "\xe3\x83\x8f\xe3\x82\x9a\xe3\x83\xbc\xe3\x82\xbb\xe3\x83\xb3\xe3\x83\x88\0" /* offset 9172 */
-  "\xe3\x83\x8f\xe3\x82\x9a\xe3\x83\xbc\xe3\x83\x84\0" /* offset 9191 */
-  "\xe3\x83\x8f\xe3\x82\x99\xe3\x83\xbc\xe3\x83\xac\xe3\x83\xab\0" /* offset 9204 */
-  "\xe3\x83\x92\xe3\x82\x9a\xe3\x82\xa2\xe3\x82\xb9\xe3\x83\x88\xe3\x83\xab\0" /* offset 9220 */
-  "\xe3\x83\x92\xe3\x82\x9a\xe3\x82\xaf\xe3\x83\xab\0" /* offset 9239 */
-  "\xe3\x83\x92\xe3\x82\x9a\xe3\x82\xb3\0" /* offset 9252 */
-  "\xe3\x83\x92\xe3\x82\x99\xe3\x83\xab\0" /* offset 9262 */
-  "\xe3\x83\x95\xe3\x82\xa1\xe3\x83\xa9\xe3\x83\x83\xe3\x83\x88\xe3\x82\x99\0" /* offset 9272 */
-  "\xe3\x83\x95\xe3\x82\xa3\xe3\x83\xbc\xe3\x83\x88\0" /* offset 9291 */
-  "\xe3\x83\x95\xe3\x82\x99\xe3\x83\x83\xe3\x82\xb7\xe3\x82\xa7\xe3\x83\xab\0" /* offset 9304 */
-  "\xe3\x83\x95\xe3\x83\xa9\xe3\x83\xb3\0" /* offset 9323 */
-  "\xe3\x83\x98\xe3\x82\xaf\xe3\x82\xbf\xe3\x83\xbc\xe3\x83\xab\0" /* offset 9333 */
-  "\xe3\x83\x98\xe3\x82\x9a\xe3\x82\xbd\0" /* offset 9349 */
-  "\xe3\x83\x98\xe3\x82\x9a\xe3\x83\x8b\xe3\x83\x92\0" /* offset 9359 */
-  "\xe3\x83\x98\xe3\x83\xab\xe3\x83\x84\0" /* offset 9372 */
-  "\xe3\x83\x98\xe3\x82\x9a\xe3\x83\xb3\xe3\x82\xb9\0" /* offset 9382 */
-  "\xe3\x83\x98\xe3\x82\x9a\xe3\x83\xbc\xe3\x82\xb7\xe3\x82\x99\0" /* offset 9395 */
-  "\xe3\x83\x98\xe3\x82\x99\xe3\x83\xbc\xe3\x82\xbf\0" /* offset 9411 */
-  "\xe3\x83\x9b\xe3\x82\x9a\xe3\x82\xa4\xe3\x83\xb3\xe3\x83\x88\0" /* offset 9424 */
-  "\xe3\x83\x9b\xe3\x82\x99\xe3\x83\xab\xe3\x83\x88\0" /* offset 9440 */
-  "\xe3\x83\x9b\xe3\x83\xb3\0" /* offset 9453 */
-  "\xe3\x83\x9b\xe3\x82\x9a\xe3\x83\xb3\xe3\x83\x88\xe3\x82\x99\0" /* offset 9460 */
-  "\xe3\x83\x9b\xe3\x83\xbc\xe3\x83\xab\0" /* offset 9476 */
-  "\xe3\x83\x9b\xe3\x83\xbc\xe3\x83\xb3\0" /* offset 9486 */
-  "\xe3\x83\x9e\xe3\x82\xa4\xe3\x82\xaf\xe3\x83\xad\0" /* offset 9496 */
-  "\xe3\x83\x9e\xe3\x82\xa4\xe3\x83\xab\0" /* offset 9509 */
-  "\xe3\x83\x9e\xe3\x83\x83\xe3\x83\x8f\0" /* offset 9519 */
-  "\xe3\x83\x9e\xe3\x83\xab\xe3\x82\xaf\0" /* offset 9529 */
-  "\xe3\x83\x9e\xe3\x83\xb3\xe3\x82\xb7\xe3\x83\xa7\xe3\x83\xb3\0" /* offset 9539 */
-  "\xe3\x83\x9f\xe3\x82\xaf\xe3\x83\xad\xe3\x83\xb3\0" /* offset 9555 */
-  "\xe3\x83\x9f\xe3\x83\xaa\0" /* offset 9568 */
-  "\xe3\x83\x9f\xe3\x83\xaa\xe3\x83\x8f\xe3\x82\x99\xe3\x83\xbc\xe3\x83\xab\0" /* offset 9575 */
-  "\xe3\x83\xa1\xe3\x82\xab\xe3\x82\x99\0" /* offset 9594 */
-  "\xe3\x83\xa1\xe3\x82\xab\xe3\x82\x99\xe3\x83\x88\xe3\x83\xb3\0" /* offset 9604 */
-  "\xe3\x83\xa1\xe3\x83\xbc\xe3\x83\x88\xe3\x83\xab\0" /* offset 9620 */
-  "\xe3\x83\xa4\xe3\x83\xbc\xe3\x83\x88\xe3\x82\x99\0" /* offset 9633 */
-  "\xe3\x83\xa4\xe3\x83\xbc\xe3\x83\xab\0" /* offset 9646 */
-  "\xe3\x83\xa6\xe3\x82\xa2\xe3\x83\xb3\0" /* offset 9656 */
-  "\xe3\x83\xaa\xe3\x83\x83\xe3\x83\x88\xe3\x83\xab\0" /* offset 9666 */
-  "\xe3\x83\xaa\xe3\x83\xa9\0" /* offset 9679 */
-  "\xe3\x83\xab\xe3\x83\x92\xe3\x82\x9a\xe3\x83\xbc\0" /* offset 9686 */
-  "\xe3\x83\xab\xe3\x83\xbc\xe3\x83\x95\xe3\x82\x99\xe3\x83\xab\0" /* offset 9699 */
-  "\xe3\x83\xac\xe3\x83\xa0\0" /* offset 9715 */
-  "\xe3\x83\xac\xe3\x83\xb3\xe3\x83\x88\xe3\x82\xb1\xe3\x82\x99\xe3\x83\xb3\0" /* offset 9722 */
-  "\xe3\x83\xaf\xe3\x83\x83\xe3\x83\x88\0" /* offset 9741 */
-  "\x30\xe7\x82\xb9\0" /* offset 9751 */
-  "\x31\xe7\x82\xb9\0" /* offset 9756 */
-  "\x32\xe7\x82\xb9\0" /* offset 9761 */
-  "\x33\xe7\x82\xb9\0" /* offset 9766 */
-  "\x34\xe7\x82\xb9\0" /* offset 9771 */
-  "\x35\xe7\x82\xb9\0" /* offset 9776 */
-  "\x36\xe7\x82\xb9\0" /* offset 9781 */
-  "\x37\xe7\x82\xb9\0" /* offset 9786 */
-  "\x38\xe7\x82\xb9\0" /* offset 9791 */
-  "\x39\xe7\x82\xb9\0" /* offset 9796 */
-  "\x31\x30\xe7\x82\xb9\0" /* offset 9801 */
-  "\x31\x31\xe7\x82\xb9\0" /* offset 9807 */
-  "\x31\x32\xe7\x82\xb9\0" /* offset 9813 */
-  "\x31\x33\xe7\x82\xb9\0" /* offset 9819 */
-  "\x31\x34\xe7\x82\xb9\0" /* offset 9825 */
-  "\x31\x35\xe7\x82\xb9\0" /* offset 9831 */
-  "\x31\x36\xe7\x82\xb9\0" /* offset 9837 */
-  "\x31\x37\xe7\x82\xb9\0" /* offset 9843 */
-  "\x31\x38\xe7\x82\xb9\0" /* offset 9849 */
-  "\x31\x39\xe7\x82\xb9\0" /* offset 9855 */
-  "\x32\x30\xe7\x82\xb9\0" /* offset 9861 */
-  "\x32\x31\xe7\x82\xb9\0" /* offset 9867 */
-  "\x32\x32\xe7\x82\xb9\0" /* offset 9873 */
-  "\x32\x33\xe7\x82\xb9\0" /* offset 9879 */
-  "\x32\x34\xe7\x82\xb9\0" /* offset 9885 */
-  "\x68\x50\x61\0" /* offset 9891 */
-  "\x64\x61\0" /* offset 9895 */
-  "\x41\x55\0" /* offset 9898 */
-  "\x62\x61\x72\0" /* offset 9901 */
-  "\x6f\x56\0" /* offset 9905 */
-  "\x70\x63\0" /* offset 9908 */
-  "\xe5\xb9\xb3\xe6\x88\x90\0" /* offset 9911 */
-  "\xe6\x98\xad\xe5\x92\x8c\0" /* offset 9918 */
-  "\xe5\xa4\xa7\xe6\xad\xa3\0" /* offset 9925 */
-  "\xe6\x98\x8e\xe6\xb2\xbb\0" /* offset 9932 */
-  "\xe6\xa0\xaa\xe5\xbc\x8f\xe4\xbc\x9a\xe7\xa4\xbe\0" /* offset 9939 */
-  "\x70\x41\0" /* offset 9952 */
-  "\x6e\x41\0" /* offset 9955 */
-  "\xce\xbc\x41\0" /* offset 9958 */
-  "\x6d\x41\0" /* offset 9962 */
-  "\x6b\x41\0" /* offset 9965 */
-  "\x4b\x42\0" /* offset 9968 */
-  "\x4d\x42\0" /* offset 9971 */
-  "\x47\x42\0" /* offset 9974 */
-  "\x63\x61\x6c\0" /* offset 9977 */
-  "\x6b\x63\x61\x6c\0" /* offset 9981 */
-  "\x70\x46\0" /* offset 9986 */
-  "\x6e\x46\0" /* offset 9989 */
-  "\xce\xbc\x46\0" /* offset 9992 */
-  "\xce\xbc\x67\0" /* offset 9996 */
-  "\x6d\x67\0" /* offset 10000 */
-  "\x6b\x67\0" /* offset 10003 */
-  "\x48\x7a\0" /* offset 10006 */
-  "\x6b\x48\x7a\0" /* offset 10009 */
-  "\x4d\x48\x7a\0" /* offset 10013 */
-  "\x47\x48\x7a\0" /* offset 10017 */
-  "\x54\x48\x7a\0" /* offset 10021 */
-  "\xce\xbc\x6c\0" /* offset 10025 */
-  "\x6d\x6c\0" /* offset 10029 */
-  "\x64\x6c\0" /* offset 10032 */
-  "\x6b\x6c\0" /* offset 10035 */
-  "\x66\x6d\0" /* offset 10038 */
-  "\x6e\x6d\0" /* offset 10041 */
-  "\xce\xbc\x6d\0" /* offset 10044 */
-  "\x6d\x6d\0" /* offset 10048 */
-  "\x63\x6d\0" /* offset 10051 */
-  "\x6b\x6d\0" /* offset 10054 */
-  "\x6d\x6d\x32\0" /* offset 10057 */
-  "\x63\x6d\x32\0" /* offset 10061 */
-  "\x6d\x32\0" /* offset 10065 */
-  "\x6b\x6d\x32\0" /* offset 10068 */
-  "\x6d\x6d\x33\0" /* offset 10072 */
-  "\x63\x6d\x33\0" /* offset 10076 */
-  "\x6d\x33\0" /* offset 10080 */
-  "\x6b\x6d\x33\0" /* offset 10083 */
-  "\x6d\xe2\x88\x95\x73\0" /* offset 10087 */
-  "\x6d\xe2\x88\x95\x73\x32\0" /* offset 10093 */
-  "\x50\x61\0" /* offset 10100 */
-  "\x6b\x50\x61\0" /* offset 10103 */
-  "\x4d\x50\x61\0" /* offset 10107 */
-  "\x47\x50\x61\0" /* offset 10111 */
-  "\x72\x61\x64\0" /* offset 10115 */
-  "\x72\x61\x64\xe2\x88\x95\x73\0" /* offset 10119 */
-  "\x72\x61\x64\xe2\x88\x95\x73\x32\0" /* offset 10127 */
-  "\x70\x73\0" /* offset 10136 */
-  "\x6e\x73\0" /* offset 10139 */
-  "\xce\xbc\x73\0" /* offset 10142 */
-  "\x6d\x73\0" /* offset 10146 */
-  "\x70\x56\0" /* offset 10149 */
-  "\x6e\x56\0" /* offset 10152 */
-  "\xce\xbc\x56\0" /* offset 10155 */
-  "\x6d\x56\0" /* offset 10159 */
-  "\x6b\x56\0" /* offset 10162 */
-  "\x4d\x56\0" /* offset 10165 */
-  "\x70\x57\0" /* offset 10168 */
-  "\x6e\x57\0" /* offset 10171 */
-  "\xce\xbc\x57\0" /* offset 10174 */
-  "\x6d\x57\0" /* offset 10178 */
-  "\x6b\x57\0" /* offset 10181 */
-  "\x4d\x57\0" /* offset 10184 */
-  "\x6b\xce\xa9\0" /* offset 10187 */
-  "\x4d\xce\xa9\0" /* offset 10191 */
-  "\x61\x2e\x6d\x2e\0" /* offset 10195 */
-  "\x42\x71\0" /* offset 10200 */
-  "\x63\x63\0" /* offset 10203 */
-  "\x63\x64\0" /* offset 10206 */
-  "\x43\xe2\x88\x95\x6b\x67\0" /* offset 10209 */
-  "\x43\x6f\x2e\0" /* offset 10216 */
-  "\x64\x42\0" /* offset 10220 */
-  "\x47\x79\0" /* offset 10223 */
-  "\x68\x61\0" /* offset 10226 */
-  "\x48\x50\0" /* offset 10229 */
-  "\x69\x6e\0" /* offset 10232 */
-  "\x4b\x4b\0" /* offset 10235 */
-  "\x4b\x4d\0" /* offset 10238 */
-  "\x6b\x74\0" /* offset 10241 */
-  "\x6c\x6d\0" /* offset 10244 */
-  "\x6c\x6e\0" /* offset 10247 */
-  "\x6c\x6f\x67\0" /* offset 10250 */
-  "\x6c\x78\0" /* offset 10254 */
-  "\x6d\x62\0" /* offset 10257 */
-  "\x6d\x69\x6c\0" /* offset 10260 */
-  "\x6d\x6f\x6c\0" /* offset 10264 */
-  "\x50\x48\0" /* offset 10268 */
-  "\x70\x2e\x6d\x2e\0" /* offset 10271 */
-  "\x50\x50\x4d\0" /* offset 10276 */
-  "\x50\x52\0" /* offset 10280 */
-  "\x73\x72\0" /* offset 10283 */
-  "\x53\x76\0" /* offset 10286 */
-  "\x57\x62\0" /* offset 10289 */
-  "\x31\xe6\x97\xa5\0" /* offset 10292 */
-  "\x32\xe6\x97\xa5\0" /* offset 10297 */
-  "\x33\xe6\x97\xa5\0" /* offset 10302 */
-  "\x34\xe6\x97\xa5\0" /* offset 10307 */
-  "\x35\xe6\x97\xa5\0" /* offset 10312 */
-  "\x36\xe6\x97\xa5\0" /* offset 10317 */
-  "\x37\xe6\x97\xa5\0" /* offset 10322 */
-  "\x38\xe6\x97\xa5\0" /* offset 10327 */
-  "\x39\xe6\x97\xa5\0" /* offset 10332 */
-  "\x31\x30\xe6\x97\xa5\0" /* offset 10337 */
-  "\x31\x31\xe6\x97\xa5\0" /* offset 10343 */
-  "\x31\x32\xe6\x97\xa5\0" /* offset 10349 */
-  "\x31\x33\xe6\x97\xa5\0" /* offset 10355 */
-  "\x31\x34\xe6\x97\xa5\0" /* offset 10361 */
-  "\x31\x35\xe6\x97\xa5\0" /* offset 10367 */
-  "\x31\x36\xe6\x97\xa5\0" /* offset 10373 */
-  "\x31\x37\xe6\x97\xa5\0" /* offset 10379 */
-  "\x31\x38\xe6\x97\xa5\0" /* offset 10385 */
-  "\x31\x39\xe6\x97\xa5\0" /* offset 10391 */
-  "\x32\x30\xe6\x97\xa5\0" /* offset 10397 */
-  "\x32\x31\xe6\x97\xa5\0" /* offset 10403 */
-  "\x32\x32\xe6\x97\xa5\0" /* offset 10409 */
-  "\x32\x33\xe6\x97\xa5\0" /* offset 10415 */
-  "\x32\x34\xe6\x97\xa5\0" /* offset 10421 */
-  "\x32\x35\xe6\x97\xa5\0" /* offset 10427 */
-  "\x32\x36\xe6\x97\xa5\0" /* offset 10433 */
-  "\x32\x37\xe6\x97\xa5\0" /* offset 10439 */
-  "\x32\x38\xe6\x97\xa5\0" /* offset 10445 */
-  "\x32\x39\xe6\x97\xa5\0" /* offset 10451 */
-  "\x33\x30\xe6\x97\xa5\0" /* offset 10457 */
-  "\x33\x31\xe6\x97\xa5\0" /* offset 10463 */
-  "\xe8\xb1\x88\0" /* offset 10469 */
-  "\xe6\x9b\xb4\0" /* offset 10473 */
-  "\xe8\xb3\x88\0" /* offset 10477 */
-  "\xe6\xbb\x91\0" /* offset 10481 */
-  "\xe4\xb8\xb2\0" /* offset 10485 */
-  "\xe5\x8f\xa5\0" /* offset 10489 */
-  "\xe5\xa5\x91\0" /* offset 10493 */
-  "\xe5\x96\x87\0" /* offset 10497 */
-  "\xe5\xa5\x88\0" /* offset 10501 */
-  "\xe6\x87\xb6\0" /* offset 10505 */
-  "\xe7\x99\xa9\0" /* offset 10509 */
-  "\xe7\xbe\x85\0" /* offset 10513 */
-  "\xe8\x98\xbf\0" /* offset 10517 */
-  "\xe8\x9e\xba\0" /* offset 10521 */
-  "\xe8\xa3\xb8\0" /* offset 10525 */
-  "\xe9\x82\x8f\0" /* offset 10529 */
-  "\xe6\xa8\x82\0" /* offset 10533 */
-  "\xe6\xb4\x9b\0" /* offset 10537 */
-  "\xe7\x83\x99\0" /* offset 10541 */
-  "\xe7\x8f\x9e\0" /* offset 10545 */
-  "\xe8\x90\xbd\0" /* offset 10549 */
-  "\xe9\x85\xaa\0" /* offset 10553 */
-  "\xe9\xa7\xb1\0" /* offset 10557 */
-  "\xe4\xba\x82\0" /* offset 10561 */
-  "\xe5\x8d\xb5\0" /* offset 10565 */
-  "\xe6\xac\x84\0" /* offset 10569 */
-  "\xe7\x88\x9b\0" /* offset 10573 */
-  "\xe8\x98\xad\0" /* offset 10577 */
-  "\xe9\xb8\x9e\0" /* offset 10581 */
-  "\xe5\xb5\x90\0" /* offset 10585 */
-  "\xe6\xbf\xab\0" /* offset 10589 */
-  "\xe8\x97\x8d\0" /* offset 10593 */
-  "\xe8\xa5\xa4\0" /* offset 10597 */
-  "\xe6\x8b\x89\0" /* offset 10601 */
-  "\xe8\x87\x98\0" /* offset 10605 */
-  "\xe8\xa0\x9f\0" /* offset 10609 */
-  "\xe5\xbb\x8a\0" /* offset 10613 */
-  "\xe6\x9c\x97\0" /* offset 10617 */
-  "\xe6\xb5\xaa\0" /* offset 10621 */
-  "\xe7\x8b\xbc\0" /* offset 10625 */
-  "\xe9\x83\x8e\0" /* offset 10629 */
-  "\xe4\xbe\x86\0" /* offset 10633 */
-  "\xe5\x86\xb7\0" /* offset 10637 */
-  "\xe5\x8b\x9e\0" /* offset 10641 */
-  "\xe6\x93\x84\0" /* offset 10645 */
-  "\xe6\xab\x93\0" /* offset 10649 */
-  "\xe7\x88\x90\0" /* offset 10653 */
-  "\xe7\x9b\xa7\0" /* offset 10657 */
-  "\xe8\x98\x86\0" /* offset 10661 */
-  "\xe8\x99\x9c\0" /* offset 10665 */
-  "\xe8\xb7\xaf\0" /* offset 10669 */
-  "\xe9\x9c\xb2\0" /* offset 10673 */
-  "\xe9\xad\xaf\0" /* offset 10677 */
-  "\xe9\xb7\xba\0" /* offset 10681 */
-  "\xe7\xa2\x8c\0" /* offset 10685 */
-  "\xe7\xa5\xbf\0" /* offset 10689 */
-  "\xe7\xb6\xa0\0" /* offset 10693 */
-  "\xe8\x8f\x89\0" /* offset 10697 */
-  "\xe9\x8c\x84\0" /* offset 10701 */
-  "\xe8\xab\x96\0" /* offset 10705 */
-  "\xe5\xa3\x9f\0" /* offset 10709 */
-  "\xe5\xbc\x84\0" /* offset 10713 */
-  "\xe7\xb1\xa0\0" /* offset 10717 */
-  "\xe8\x81\xbe\0" /* offset 10721 */
-  "\xe7\x89\xa2\0" /* offset 10725 */
-  "\xe7\xa3\x8a\0" /* offset 10729 */
-  "\xe8\xb3\x82\0" /* offset 10733 */
-  "\xe9\x9b\xb7\0" /* offset 10737 */
-  "\xe5\xa3\x98\0" /* offset 10741 */
-  "\xe5\xb1\xa2\0" /* offset 10745 */
-  "\xe6\xa8\x93\0" /* offset 10749 */
-  "\xe6\xb7\x9a\0" /* offset 10753 */
-  "\xe6\xbc\x8f\0" /* offset 10757 */
-  "\xe7\xb4\xaf\0" /* offset 10761 */
-  "\xe7\xb8\xb7\0" /* offset 10765 */
-  "\xe9\x99\x8b\0" /* offset 10769 */
-  "\xe5\x8b\x92\0" /* offset 10773 */
-  "\xe8\x82\x8b\0" /* offset 10777 */
-  "\xe5\x87\x9c\0" /* offset 10781 */
-  "\xe5\x87\x8c\0" /* offset 10785 */
-  "\xe7\xa8\x9c\0" /* offset 10789 */
-  "\xe7\xb6\xbe\0" /* offset 10793 */
-  "\xe8\x8f\xb1\0" /* offset 10797 */
-  "\xe9\x99\xb5\0" /* offset 10801 */
-  "\xe8\xae\x80\0" /* offset 10805 */
-  "\xe6\x8b\x8f\0" /* offset 10809 */
-  "\xe8\xab\xbe\0" /* offset 10813 */
-  "\xe4\xb8\xb9\0" /* offset 10817 */
-  "\xe5\xaf\xa7\0" /* offset 10821 */
-  "\xe6\x80\x92\0" /* offset 10825 */
-  "\xe7\x8e\x87\0" /* offset 10829 */
-  "\xe7\x95\xb0\0" /* offset 10833 */
-  "\xe5\x8c\x97\0" /* offset 10837 */
-  "\xe7\xa3\xbb\0" /* offset 10841 */
-  "\xe4\xbe\xbf\0" /* offset 10845 */
-  "\xe5\xbe\xa9\0" /* offset 10849 */
-  "\xe4\xb8\x8d\0" /* offset 10853 */
-  "\xe6\xb3\x8c\0" /* offset 10857 */
-  "\xe6\x95\xb8\0" /* offset 10861 */
-  "\xe7\xb4\xa2\0" /* offset 10865 */
-  "\xe5\x8f\x83\0" /* offset 10869 */
-  "\xe5\xa1\x9e\0" /* offset 10873 */
-  "\xe7\x9c\x81\0" /* offset 10877 */
-  "\xe8\x91\x89\0" /* offset 10881 */
-  "\xe8\xaa\xaa\0" /* offset 10885 */
-  "\xe6\xae\xba\0" /* offset 10889 */
-  "\xe6\xb2\x88\0" /* offset 10893 */
-  "\xe6\x8b\xbe\0" /* offset 10897 */
-  "\xe8\x8b\xa5\0" /* offset 10901 */
-  "\xe6\x8e\xa0\0" /* offset 10905 */
-  "\xe7\x95\xa5\0" /* offset 10909 */
-  "\xe4\xba\xae\0" /* offset 10913 */
-  "\xe5\x85\xa9\0" /* offset 10917 */
-  "\xe5\x87\x89\0" /* offset 10921 */
-  "\xe6\xa2\x81\0" /* offset 10925 */
-  "\xe7\xb3\xa7\0" /* offset 10929 */
-  "\xe8\x89\xaf\0" /* offset 10933 */
-  "\xe8\xab\x92\0" /* offset 10937 */
-  "\xe9\x87\x8f\0" /* offset 10941 */
-  "\xe5\x8b\xb5\0" /* offset 10945 */
-  "\xe5\x91\x82\0" /* offset 10949 */
-  "\xe5\xbb\xac\0" /* offset 10953 */
-  "\xe6\x97\x85\0" /* offset 10957 */
-  "\xe6\xbf\xbe\0" /* offset 10961 */
-  "\xe7\xa4\xaa\0" /* offset 10965 */
-  "\xe9\x96\xad\0" /* offset 10969 */
-  "\xe9\xa9\xaa\0" /* offset 10973 */
-  "\xe9\xba\x97\0" /* offset 10977 */
-  "\xe9\xbb\x8e\0" /* offset 10981 */
-  "\xe6\x9b\x86\0" /* offset 10985 */
-  "\xe6\xad\xb7\0" /* offset 10989 */
-  "\xe8\xbd\xa2\0" /* offset 10993 */
-  "\xe5\xb9\xb4\0" /* offset 10997 */
-  "\xe6\x86\x90\0" /* offset 11001 */
-  "\xe6\x88\x80\0" /* offset 11005 */
-  "\xe6\x92\x9a\0" /* offset 11009 */
-  "\xe6\xbc\xa3\0" /* offset 11013 */
-  "\xe7\x85\x89\0" /* offset 11017 */
-  "\xe7\x92\x89\0" /* offset 11021 */
-  "\xe7\xa7\x8a\0" /* offset 11025 */
-  "\xe7\xb7\xb4\0" /* offset 11029 */
-  "\xe8\x81\xaf\0" /* offset 11033 */
-  "\xe8\xbc\xa6\0" /* offset 11037 */
-  "\xe8\x93\xae\0" /* offset 11041 */
-  "\xe9\x80\xa3\0" /* offset 11045 */
-  "\xe9\x8d\x8a\0" /* offset 11049 */
-  "\xe5\x88\x97\0" /* offset 11053 */
-  "\xe5\x8a\xa3\0" /* offset 11057 */
-  "\xe5\x92\xbd\0" /* offset 11061 */
-  "\xe7\x83\x88\0" /* offset 11065 */
-  "\xe8\xa3\x82\0" /* offset 11069 */
-  "\xe5\xbb\x89\0" /* offset 11073 */
-  "\xe5\xbf\xb5\0" /* offset 11077 */
-  "\xe6\x8d\xbb\0" /* offset 11081 */
-  "\xe6\xae\xae\0" /* offset 11085 */
-  "\xe7\xb0\xbe\0" /* offset 11089 */
-  "\xe7\x8d\xb5\0" /* offset 11093 */
-  "\xe4\xbb\xa4\0" /* offset 11097 */
-  "\xe5\x9b\xb9\0" /* offset 11101 */
-  "\xe5\xb6\xba\0" /* offset 11105 */
-  "\xe6\x80\x9c\0" /* offset 11109 */
-  "\xe7\x8e\xb2\0" /* offset 11113 */
-  "\xe7\x91\xa9\0" /* offset 11117 */
-  "\xe7\xbe\x9a\0" /* offset 11121 */
-  "\xe8\x81\x86\0" /* offset 11125 */
-  "\xe9\x88\xb4\0" /* offset 11129 */
-  "\xe9\x9b\xb6\0" /* offset 11133 */
-  "\xe9\x9d\x88\0" /* offset 11137 */
-  "\xe9\xa0\x98\0" /* offset 11141 */
-  "\xe4\xbe\x8b\0" /* offset 11145 */
-  "\xe7\xa6\xae\0" /* offset 11149 */
-  "\xe9\x86\xb4\0" /* offset 11153 */
-  "\xe9\x9a\xb8\0" /* offset 11157 */
-  "\xe6\x83\xa1\0" /* offset 11161 */
-  "\xe4\xba\x86\0" /* offset 11165 */
-  "\xe5\x83\x9a\0" /* offset 11169 */
-  "\xe5\xaf\xae\0" /* offset 11173 */
-  "\xe5\xb0\xbf\0" /* offset 11177 */
-  "\xe6\x96\x99\0" /* offset 11181 */
-  "\xe7\x87\x8e\0" /* offset 11185 */
-  "\xe7\x99\x82\0" /* offset 11189 */
-  "\xe8\x93\xbc\0" /* offset 11193 */
-  "\xe9\x81\xbc\0" /* offset 11197 */
-  "\xe6\x9a\x88\0" /* offset 11201 */
-  "\xe9\x98\xae\0" /* offset 11205 */
-  "\xe5\x8a\x89\0" /* offset 11209 */
-  "\xe6\x9d\xbb\0" /* offset 11213 */
-  "\xe6\x9f\xb3\0" /* offset 11217 */
-  "\xe6\xb5\x81\0" /* offset 11221 */
-  "\xe6\xba\x9c\0" /* offset 11225 */
-  "\xe7\x90\x89\0" /* offset 11229 */
-  "\xe7\x95\x99\0" /* offset 11233 */
-  "\xe7\xa1\xab\0" /* offset 11237 */
-  "\xe7\xb4\x90\0" /* offset 11241 */
-  "\xe9\xa1\x9e\0" /* offset 11245 */
-  "\xe6\x88\xae\0" /* offset 11249 */
-  "\xe9\x99\xb8\0" /* offset 11253 */
-  "\xe5\x80\xab\0" /* offset 11257 */
-  "\xe5\xb4\x99\0" /* offset 11261 */
-  "\xe6\xb7\xaa\0" /* offset 11265 */
-  "\xe8\xbc\xaa\0" /* offset 11269 */
-  "\xe5\xbe\x8b\0" /* offset 11273 */
-  "\xe6\x85\x84\0" /* offset 11277 */
-  "\xe6\xa0\x97\0" /* offset 11281 */
-  "\xe9\x9a\x86\0" /* offset 11285 */
-  "\xe5\x88\xa9\0" /* offset 11289 */
-  "\xe5\x90\x8f\0" /* offset 11293 */
-  "\xe5\xb1\xa5\0" /* offset 11297 */
-  "\xe6\x98\x93\0" /* offset 11301 */
-  "\xe6\x9d\x8e\0" /* offset 11305 */
-  "\xe6\xa2\xa8\0" /* offset 11309 */
-  "\xe6\xb3\xa5\0" /* offset 11313 */
-  "\xe7\x90\x86\0" /* offset 11317 */
-  "\xe7\x97\xa2\0" /* offset 11321 */
-  "\xe7\xbd\xb9\0" /* offset 11325 */
-  "\xe8\xa3\x8f\0" /* offset 11329 */
-  "\xe8\xa3\xa1\0" /* offset 11333 */
-  "\xe9\x9b\xa2\0" /* offset 11337 */
-  "\xe5\x8c\xbf\0" /* offset 11341 */
-  "\xe6\xba\xba\0" /* offset 11345 */
-  "\xe5\x90\x9d\0" /* offset 11349 */
-  "\xe7\x87\x90\0" /* offset 11353 */
-  "\xe7\x92\x98\0" /* offset 11357 */
-  "\xe8\x97\xba\0" /* offset 11361 */
-  "\xe9\x9a\xa3\0" /* offset 11365 */
-  "\xe9\xb1\x97\0" /* offset 11369 */
-  "\xe9\xba\x9f\0" /* offset 11373 */
-  "\xe6\x9e\x97\0" /* offset 11377 */
-  "\xe6\xb7\x8b\0" /* offset 11381 */
-  "\xe8\x87\xa8\0" /* offset 11385 */
-  "\xe7\xac\xa0\0" /* offset 11389 */
-  "\xe7\xb2\x92\0" /* offset 11393 */
-  "\xe7\x8b\x80\0" /* offset 11397 */
-  "\xe7\x82\x99\0" /* offset 11401 */
-  "\xe8\xad\x98\0" /* offset 11405 */
-  "\xe4\xbb\x80\0" /* offset 11409 */
-  "\xe8\x8c\xb6\0" /* offset 11413 */
-  "\xe5\x88\xba\0" /* offset 11417 */
-  "\xe5\x88\x87\0" /* offset 11421 */
-  "\xe5\xba\xa6\0" /* offset 11425 */
-  "\xe6\x8b\x93\0" /* offset 11429 */
-  "\xe7\xb3\x96\0" /* offset 11433 */
-  "\xe5\xae\x85\0" /* offset 11437 */
-  "\xe6\xb4\x9e\0" /* offset 11441 */
-  "\xe6\x9a\xb4\0" /* offset 11445 */
-  "\xe8\xbc\xbb\0" /* offset 11449 */
-  "\xe9\x99\x8d\0" /* offset 11453 */
-  "\xe5\xbb\x93\0" /* offset 11457 */
-  "\xe5\x85\x80\0" /* offset 11461 */
-  "\xe5\x97\x80\0" /* offset 11465 */
-  "\xe5\xa1\x9a\0" /* offset 11469 */
-  "\xe6\x99\xb4\0" /* offset 11473 */
-  "\xe5\x87\x9e\0" /* offset 11477 */
-  "\xe7\x8c\xaa\0" /* offset 11481 */
-  "\xe7\x9b\x8a\0" /* offset 11485 */
-  "\xe7\xa4\xbc\0" /* offset 11489 */
-  "\xe7\xa5\x9e\0" /* offset 11493 */
-  "\xe7\xa5\xa5\0" /* offset 11497 */
-  "\xe7\xa6\x8f\0" /* offset 11501 */
-  "\xe9\x9d\x96\0" /* offset 11505 */
-  "\xe7\xb2\xbe\0" /* offset 11509 */
-  "\xe8\x98\x92\0" /* offset 11513 */
-  "\xe8\xab\xb8\0" /* offset 11517 */
-  "\xe9\x80\xb8\0" /* offset 11521 */
-  "\xe9\x83\xbd\0" /* offset 11525 */
-  "\xe9\xa3\xaf\0" /* offset 11529 */
-  "\xe9\xa3\xbc\0" /* offset 11533 */
-  "\xe9\xa4\xa8\0" /* offset 11537 */
-  "\xe9\xb6\xb4\0" /* offset 11541 */
-  "\xe4\xbe\xae\0" /* offset 11545 */
-  "\xe5\x83\xa7\0" /* offset 11549 */
-  "\xe5\x85\x8d\0" /* offset 11553 */
-  "\xe5\x8b\x89\0" /* offset 11557 */
-  "\xe5\x8b\xa4\0" /* offset 11561 */
-  "\xe5\x8d\x91\0" /* offset 11565 */
-  "\xe5\x96\x9d\0" /* offset 11569 */
-  "\xe5\x98\x86\0" /* offset 11573 */
-  "\xe5\x99\xa8\0" /* offset 11577 */
-  "\xe5\xa1\x80\0" /* offset 11581 */
-  "\xe5\xa2\xa8\0" /* offset 11585 */
-  "\xe5\xb1\xa4\0" /* offset 11589 */
-  "\xe6\x82\x94\0" /* offset 11593 */
-  "\xe6\x85\xa8\0" /* offset 11597 */
-  "\xe6\x86\x8e\0" /* offset 11601 */
-  "\xe6\x87\xb2\0" /* offset 11605 */
-  "\xe6\x95\x8f\0" /* offset 11609 */
-  "\xe6\x97\xa2\0" /* offset 11613 */
-  "\xe6\x9a\x91\0" /* offset 11617 */
-  "\xe6\xa2\x85\0" /* offset 11621 */
-  "\xe6\xb5\xb7\0" /* offset 11625 */
-  "\xe6\xb8\x9a\0" /* offset 11629 */
-  "\xe6\xbc\xa2\0" /* offset 11633 */
-  "\xe7\x85\xae\0" /* offset 11637 */
-  "\xe7\x88\xab\0" /* offset 11641 */
-  "\xe7\x90\xa2\0" /* offset 11645 */
-  "\xe7\xa2\x91\0" /* offset 11649 */
-  "\xe7\xa5\x89\0" /* offset 11653 */
-  "\xe7\xa5\x88\0" /* offset 11657 */
-  "\xe7\xa5\x90\0" /* offset 11661 */
-  "\xe7\xa5\x96\0" /* offset 11665 */
-  "\xe7\xa6\x8d\0" /* offset 11669 */
-  "\xe7\xa6\x8e\0" /* offset 11673 */
-  "\xe7\xa9\x80\0" /* offset 11677 */
-  "\xe7\xaa\x81\0" /* offset 11681 */
-  "\xe7\xaf\x80\0" /* offset 11685 */
-  "\xe7\xb8\x89\0" /* offset 11689 */
-  "\xe7\xb9\x81\0" /* offset 11693 */
-  "\xe7\xbd\xb2\0" /* offset 11697 */
-  "\xe8\x80\x85\0" /* offset 11701 */
-  "\xe8\x87\xad\0" /* offset 11705 */
-  "\xe8\x89\xb9\0" /* offset 11709 */
-  "\xe8\x91\x97\0" /* offset 11713 */
-  "\xe8\xa4\x90\0" /* offset 11717 */
-  "\xe8\xa6\x96\0" /* offset 11721 */
-  "\xe8\xac\x81\0" /* offset 11725 */
-  "\xe8\xac\xb9\0" /* offset 11729 */
-  "\xe8\xb3\x93\0" /* offset 11733 */
-  "\xe8\xb4\x88\0" /* offset 11737 */
-  "\xe8\xbe\xb6\0" /* offset 11741 */
-  "\xe9\x9b\xa3\0" /* offset 11745 */
-  "\xe9\x9f\xbf\0" /* offset 11749 */
-  "\xe9\xa0\xbb\0" /* offset 11753 */
-  "\x66\x66\0" /* offset 11757 */
-  "\x66\x69\0" /* offset 11760 */
-  "\x66\x6c\0" /* offset 11763 */
-  "\x66\x66\x69\0" /* offset 11766 */
-  "\x66\x66\x6c\0" /* offset 11770 */
-  "\x73\x74\0" /* offset 11774 */
-  "\xd5\xb4\xd5\xb6\0" /* offset 11777 */
-  "\xd5\xb4\xd5\xa5\0" /* offset 11782 */
-  "\xd5\xb4\xd5\xab\0" /* offset 11787 */
-  "\xd5\xbe\xd5\xb6\0" /* offset 11792 */
-  "\xd5\xb4\xd5\xad\0" /* offset 11797 */
-  "\xd7\x99\xd6\xb4\0" /* offset 11802 */
-  "\xd7\xb2\xd6\xb7\0" /* offset 11807 */
-  "\xd7\xa2\0" /* offset 11812 */
-  "\xd7\x94\0" /* offset 11815 */
-  "\xd7\x9b\0" /* offset 11818 */
-  "\xd7\x9c\0" /* offset 11821 */
-  "\xd7\x9d\0" /* offset 11824 */
-  "\xd7\xa8\0" /* offset 11827 */
-  "\xd7\xaa\0" /* offset 11830 */
-  "\xd7\xa9\xd7\x81\0" /* offset 11833 */
-  "\xd7\xa9\xd7\x82\0" /* offset 11838 */
-  "\xd7\xa9\xd6\xbc\xd7\x81\0" /* offset 11843 */
-  "\xd7\xa9\xd6\xbc\xd7\x82\0" /* offset 11850 */
-  "\xd7\x90\xd6\xb7\0" /* offset 11857 */
-  "\xd7\x90\xd6\xb8\0" /* offset 11862 */
-  "\xd7\x90\xd6\xbc\0" /* offset 11867 */
-  "\xd7\x91\xd6\xbc\0" /* offset 11872 */
-  "\xd7\x92\xd6\xbc\0" /* offset 11877 */
-  "\xd7\x93\xd6\xbc\0" /* offset 11882 */
-  "\xd7\x94\xd6\xbc\0" /* offset 11887 */
-  "\xd7\x95\xd6\xbc\0" /* offset 11892 */
-  "\xd7\x96\xd6\xbc\0" /* offset 11897 */
-  "\xd7\x98\xd6\xbc\0" /* offset 11902 */
-  "\xd7\x99\xd6\xbc\0" /* offset 11907 */
-  "\xd7\x9a\xd6\xbc\0" /* offset 11912 */
-  "\xd7\x9b\xd6\xbc\0" /* offset 11917 */
-  "\xd7\x9c\xd6\xbc\0" /* offset 11922 */
-  "\xd7\x9e\xd6\xbc\0" /* offset 11927 */
-  "\xd7\xa0\xd6\xbc\0" /* offset 11932 */
-  "\xd7\xa1\xd6\xbc\0" /* offset 11937 */
-  "\xd7\xa3\xd6\xbc\0" /* offset 11942 */
-  "\xd7\xa4\xd6\xbc\0" /* offset 11947 */
-  "\xd7\xa6\xd6\xbc\0" /* offset 11952 */
-  "\xd7\xa7\xd6\xbc\0" /* offset 11957 */
-  "\xd7\xa8\xd6\xbc\0" /* offset 11962 */
-  "\xd7\xa9\xd6\xbc\0" /* offset 11967 */
-  "\xd7\xaa\xd6\xbc\0" /* offset 11972 */
-  "\xd7\x95\xd6\xb9\0" /* offset 11977 */
-  "\xd7\x91\xd6\xbf\0" /* offset 11982 */
-  "\xd7\x9b\xd6\xbf\0" /* offset 11987 */
-  "\xd7\xa4\xd6\xbf\0" /* offset 11992 */
-  "\xd7\x90\xd7\x9c\0" /* offset 11997 */
-  "\xd9\xb1\0" /* offset 12002 */
-  "\xd9\xbb\0" /* offset 12005 */
-  "\xd9\xbe\0" /* offset 12008 */
-  "\xda\x80\0" /* offset 12011 */
-  "\xd9\xba\0" /* offset 12014 */
-  "\xd9\xbf\0" /* offset 12017 */
-  "\xd9\xb9\0" /* offset 12020 */
-  "\xda\xa4\0" /* offset 12023 */
-  "\xda\xa6\0" /* offset 12026 */
-  "\xda\x84\0" /* offset 12029 */
-  "\xda\x83\0" /* offset 12032 */
-  "\xda\x86\0" /* offset 12035 */
-  "\xda\x87\0" /* offset 12038 */
-  "\xda\x8d\0" /* offset 12041 */
-  "\xda\x8c\0" /* offset 12044 */
-  "\xda\x8e\0" /* offset 12047 */
-  "\xda\x88\0" /* offset 12050 */
-  "\xda\x98\0" /* offset 12053 */
-  "\xda\x91\0" /* offset 12056 */
-  "\xda\xa9\0" /* offset 12059 */
-  "\xda\xaf\0" /* offset 12062 */
-  "\xda\xb3\0" /* offset 12065 */
-  "\xda\xb1\0" /* offset 12068 */
-  "\xda\xba\0" /* offset 12071 */
-  "\xda\xbb\0" /* offset 12074 */
-  "\xdb\x81\0" /* offset 12077 */
-  "\xda\xbe\0" /* offset 12080 */
-  "\xdb\x92\0" /* offset 12083 */
-  "\xda\xad\0" /* offset 12086 */
-  "\xdb\x87\0" /* offset 12089 */
-  "\xdb\x86\0" /* offset 12092 */
-  "\xdb\x88\0" /* offset 12095 */
-  "\xdb\x8b\0" /* offset 12098 */
-  "\xdb\x85\0" /* offset 12101 */
-  "\xdb\x89\0" /* offset 12104 */
-  "\xdb\x90\0" /* offset 12107 */
-  "\xd9\x89\0" /* offset 12110 */
-  "\xd9\x8a\xd9\x94\xd8\xa7\0" /* offset 12113 */
-  "\xd9\x8a\xd9\x94\xdb\x95\0" /* offset 12120 */
-  "\xd9\x8a\xd9\x94\xd9\x88\0" /* offset 12127 */
-  "\xd9\x8a\xd9\x94\xdb\x87\0" /* offset 12134 */
-  "\xd9\x8a\xd9\x94\xdb\x86\0" /* offset 12141 */
-  "\xd9\x8a\xd9\x94\xdb\x88\0" /* offset 12148 */
-  "\xd9\x8a\xd9\x94\xdb\x90\0" /* offset 12155 */
-  "\xd9\x8a\xd9\x94\xd9\x89\0" /* offset 12162 */
-  "\xdb\x8c\0" /* offset 12169 */
-  "\xd9\x8a\xd9\x94\xd8\xac\0" /* offset 12172 */
-  "\xd9\x8a\xd9\x94\xd8\xad\0" /* offset 12179 */
-  "\xd9\x8a\xd9\x94\xd9\x85\0" /* offset 12186 */
-  "\xd9\x8a\xd9\x94\xd9\x8a\0" /* offset 12193 */
-  "\xd8\xa8\xd8\xac\0" /* offset 12200 */
-  "\xd8\xa8\xd8\xad\0" /* offset 12205 */
-  "\xd8\xa8\xd8\xae\0" /* offset 12210 */
-  "\xd8\xa8\xd9\x85\0" /* offset 12215 */
-  "\xd8\xa8\xd9\x89\0" /* offset 12220 */
-  "\xd8\xa8\xd9\x8a\0" /* offset 12225 */
-  "\xd8\xaa\xd8\xac\0" /* offset 12230 */
-  "\xd8\xaa\xd8\xad\0" /* offset 12235 */
-  "\xd8\xaa\xd8\xae\0" /* offset 12240 */
-  "\xd8\xaa\xd9\x85\0" /* offset 12245 */
-  "\xd8\xaa\xd9\x89\0" /* offset 12250 */
-  "\xd8\xaa\xd9\x8a\0" /* offset 12255 */
-  "\xd8\xab\xd8\xac\0" /* offset 12260 */
-  "\xd8\xab\xd9\x85\0" /* offset 12265 */
-  "\xd8\xab\xd9\x89\0" /* offset 12270 */
-  "\xd8\xab\xd9\x8a\0" /* offset 12275 */
-  "\xd8\xac\xd8\xad\0" /* offset 12280 */
-  "\xd8\xac\xd9\x85\0" /* offset 12285 */
-  "\xd8\xad\xd8\xac\0" /* offset 12290 */
-  "\xd8\xad\xd9\x85\0" /* offset 12295 */
-  "\xd8\xae\xd8\xac\0" /* offset 12300 */
-  "\xd8\xae\xd8\xad\0" /* offset 12305 */
-  "\xd8\xae\xd9\x85\0" /* offset 12310 */
-  "\xd8\xb3\xd8\xac\0" /* offset 12315 */
-  "\xd8\xb3\xd8\xad\0" /* offset 12320 */
-  "\xd8\xb3\xd8\xae\0" /* offset 12325 */
-  "\xd8\xb3\xd9\x85\0" /* offset 12330 */
-  "\xd8\xb5\xd8\xad\0" /* offset 12335 */
-  "\xd8\xb5\xd9\x85\0" /* offset 12340 */
-  "\xd8\xb6\xd8\xac\0" /* offset 12345 */
-  "\xd8\xb6\xd8\xad\0" /* offset 12350 */
-  "\xd8\xb6\xd8\xae\0" /* offset 12355 */
-  "\xd8\xb6\xd9\x85\0" /* offset 12360 */
-  "\xd8\xb7\xd8\xad\0" /* offset 12365 */
-  "\xd8\xb7\xd9\x85\0" /* offset 12370 */
-  "\xd8\xb8\xd9\x85\0" /* offset 12375 */
-  "\xd8\xb9\xd8\xac\0" /* offset 12380 */
-  "\xd8\xb9\xd9\x85\0" /* offset 12385 */
-  "\xd8\xba\xd8\xac\0" /* offset 12390 */
-  "\xd8\xba\xd9\x85\0" /* offset 12395 */
-  "\xd9\x81\xd8\xac\0" /* offset 12400 */
-  "\xd9\x81\xd8\xad\0" /* offset 12405 */
-  "\xd9\x81\xd8\xae\0" /* offset 12410 */
-  "\xd9\x81\xd9\x85\0" /* offset 12415 */
-  "\xd9\x81\xd9\x89\0" /* offset 12420 */
-  "\xd9\x81\xd9\x8a\0" /* offset 12425 */
-  "\xd9\x82\xd8\xad\0" /* offset 12430 */
-  "\xd9\x82\xd9\x85\0" /* offset 12435 */
-  "\xd9\x82\xd9\x89\0" /* offset 12440 */
-  "\xd9\x82\xd9\x8a\0" /* offset 12445 */
-  "\xd9\x83\xd8\xa7\0" /* offset 12450 */
-  "\xd9\x83\xd8\xac\0" /* offset 12455 */
-  "\xd9\x83\xd8\xad\0" /* offset 12460 */
-  "\xd9\x83\xd8\xae\0" /* offset 12465 */
-  "\xd9\x83\xd9\x84\0" /* offset 12470 */
-  "\xd9\x83\xd9\x85\0" /* offset 12475 */
-  "\xd9\x83\xd9\x89\0" /* offset 12480 */
-  "\xd9\x83\xd9\x8a\0" /* offset 12485 */
-  "\xd9\x84\xd8\xac\0" /* offset 12490 */
-  "\xd9\x84\xd8\xad\0" /* offset 12495 */
-  "\xd9\x84\xd8\xae\0" /* offset 12500 */
-  "\xd9\x84\xd9\x85\0" /* offset 12505 */
-  "\xd9\x84\xd9\x89\0" /* offset 12510 */
-  "\xd9\x84\xd9\x8a\0" /* offset 12515 */
-  "\xd9\x85\xd8\xac\0" /* offset 12520 */
-  "\xd9\x85\xd8\xad\0" /* offset 12525 */
-  "\xd9\x85\xd8\xae\0" /* offset 12530 */
-  "\xd9\x85\xd9\x85\0" /* offset 12535 */
-  "\xd9\x85\xd9\x89\0" /* offset 12540 */
-  "\xd9\x85\xd9\x8a\0" /* offset 12545 */
-  "\xd9\x86\xd8\xac\0" /* offset 12550 */
-  "\xd9\x86\xd8\xad\0" /* offset 12555 */
-  "\xd9\x86\xd8\xae\0" /* offset 12560 */
-  "\xd9\x86\xd9\x85\0" /* offset 12565 */
-  "\xd9\x86\xd9\x89\0" /* offset 12570 */
-  "\xd9\x86\xd9\x8a\0" /* offset 12575 */
-  "\xd9\x87\xd8\xac\0" /* offset 12580 */
-  "\xd9\x87\xd9\x85\0" /* offset 12585 */
-  "\xd9\x87\xd9\x89\0" /* offset 12590 */
-  "\xd9\x87\xd9\x8a\0" /* offset 12595 */
-  "\xd9\x8a\xd8\xac\0" /* offset 12600 */
-  "\xd9\x8a\xd8\xad\0" /* offset 12605 */
-  "\xd9\x8a\xd8\xae\0" /* offset 12610 */
-  "\xd9\x8a\xd9\x85\0" /* offset 12615 */
-  "\xd9\x8a\xd9\x89\0" /* offset 12620 */
-  "\xd9\x8a\xd9\x8a\0" /* offset 12625 */
-  "\xd8\xb0\xd9\xb0\0" /* offset 12630 */
-  "\xd8\xb1\xd9\xb0\0" /* offset 12635 */
-  "\xd9\x89\xd9\xb0\0" /* offset 12640 */
-  "\x20\xd9\x8c\xd9\x91\0" /* offset 12645 */
-  "\x20\xd9\x8d\xd9\x91\0" /* offset 12651 */
-  "\x20\xd9\x8e\xd9\x91\0" /* offset 12657 */
-  "\x20\xd9\x8f\xd9\x91\0" /* offset 12663 */
-  "\x20\xd9\x90\xd9\x91\0" /* offset 12669 */
-  "\x20\xd9\x91\xd9\xb0\0" /* offset 12675 */
-  "\xd9\x8a\xd9\x94\xd8\xb1\0" /* offset 12681 */
-  "\xd9\x8a\xd9\x94\xd8\xb2\0" /* offset 12688 */
-  "\xd9\x8a\xd9\x94\xd9\x86\0" /* offset 12695 */
-  "\xd8\xa8\xd8\xb1\0" /* offset 12702 */
-  "\xd8\xa8\xd8\xb2\0" /* offset 12707 */
-  "\xd8\xa8\xd9\x86\0" /* offset 12712 */
-  "\xd8\xaa\xd8\xb1\0" /* offset 12717 */
-  "\xd8\xaa\xd8\xb2\0" /* offset 12722 */
-  "\xd8\xaa\xd9\x86\0" /* offset 12727 */
-  "\xd8\xab\xd8\xb1\0" /* offset 12732 */
-  "\xd8\xab\xd8\xb2\0" /* offset 12737 */
-  "\xd8\xab\xd9\x86\0" /* offset 12742 */
-  "\xd9\x85\xd8\xa7\0" /* offset 12747 */
-  "\xd9\x86\xd8\xb1\0" /* offset 12752 */
-  "\xd9\x86\xd8\xb2\0" /* offset 12757 */
-  "\xd9\x86\xd9\x86\0" /* offset 12762 */
-  "\xd9\x8a\xd8\xb1\0" /* offset 12767 */
-  "\xd9\x8a\xd8\xb2\0" /* offset 12772 */
-  "\xd9\x8a\xd9\x86\0" /* offset 12777 */
-  "\xd9\x8a\xd9\x94\xd8\xae\0" /* offset 12782 */
-  "\xd9\x8a\xd9\x94\xd9\x87\0" /* offset 12789 */
-  "\xd8\xa8\xd9\x87\0" /* offset 12796 */
-  "\xd8\xaa\xd9\x87\0" /* offset 12801 */
-  "\xd8\xb5\xd8\xae\0" /* offset 12806 */
-  "\xd9\x84\xd9\x87\0" /* offset 12811 */
-  "\xd9\x86\xd9\x87\0" /* offset 12816 */
-  "\xd9\x87\xd9\xb0\0" /* offset 12821 */
-  "\xd9\x8a\xd9\x87\0" /* offset 12826 */
-  "\xd8\xab\xd9\x87\0" /* offset 12831 */
-  "\xd8\xb3\xd9\x87\0" /* offset 12836 */
-  "\xd8\xb4\xd9\x85\0" /* offset 12841 */
-  "\xd8\xb4\xd9\x87\0" /* offset 12846 */
-  "\xd9\x80\xd9\x8e\xd9\x91\0" /* offset 12851 */
-  "\xd9\x80\xd9\x8f\xd9\x91\0" /* offset 12858 */
-  "\xd9\x80\xd9\x90\xd9\x91\0" /* offset 12865 */
-  "\xd8\xb7\xd9\x89\0" /* offset 12872 */
-  "\xd8\xb7\xd9\x8a\0" /* offset 12877 */
-  "\xd8\xb9\xd9\x89\0" /* offset 12882 */
-  "\xd8\xb9\xd9\x8a\0" /* offset 12887 */
-  "\xd8\xba\xd9\x89\0" /* offset 12892 */
-  "\xd8\xba\xd9\x8a\0" /* offset 12897 */
-  "\xd8\xb3\xd9\x89\0" /* offset 12902 */
-  "\xd8\xb3\xd9\x8a\0" /* offset 12907 */
-  "\xd8\xb4\xd9\x89\0" /* offset 12912 */
-  "\xd8\xb4\xd9\x8a\0" /* offset 12917 */
-  "\xd8\xad\xd9\x89\0" /* offset 12922 */
-  "\xd8\xad\xd9\x8a\0" /* offset 12927 */
-  "\xd8\xac\xd9\x89\0" /* offset 12932 */
-  "\xd8\xac\xd9\x8a\0" /* offset 12937 */
-  "\xd8\xae\xd9\x89\0" /* offset 12942 */
-  "\xd8\xae\xd9\x8a\0" /* offset 12947 */
-  "\xd8\xb5\xd9\x89\0" /* offset 12952 */
-  "\xd8\xb5\xd9\x8a\0" /* offset 12957 */
-  "\xd8\xb6\xd9\x89\0" /* offset 12962 */
-  "\xd8\xb6\xd9\x8a\0" /* offset 12967 */
-  "\xd8\xb4\xd8\xac\0" /* offset 12972 */
-  "\xd8\xb4\xd8\xad\0" /* offset 12977 */
-  "\xd8\xb4\xd8\xae\0" /* offset 12982 */
-  "\xd8\xb4\xd8\xb1\0" /* offset 12987 */
-  "\xd8\xb3\xd8\xb1\0" /* offset 12992 */
-  "\xd8\xb5\xd8\xb1\0" /* offset 12997 */
-  "\xd8\xb6\xd8\xb1\0" /* offset 13002 */
-  "\xd8\xa7\xd9\x8b\0" /* offset 13007 */
-  "\xd8\xaa\xd8\xac\xd9\x85\0" /* offset 13012 */
-  "\xd8\xaa\xd8\xad\xd8\xac\0" /* offset 13019 */
-  "\xd8\xaa\xd8\xad\xd9\x85\0" /* offset 13026 */
-  "\xd8\xaa\xd8\xae\xd9\x85\0" /* offset 13033 */
-  "\xd8\xaa\xd9\x85\xd8\xac\0" /* offset 13040 */
-  "\xd8\xaa\xd9\x85\xd8\xad\0" /* offset 13047 */
-  "\xd8\xaa\xd9\x85\xd8\xae\0" /* offset 13054 */
-  "\xd8\xac\xd9\x85\xd8\xad\0" /* offset 13061 */
-  "\xd8\xad\xd9\x85\xd9\x8a\0" /* offset 13068 */
-  "\xd8\xad\xd9\x85\xd9\x89\0" /* offset 13075 */
-  "\xd8\xb3\xd8\xad\xd8\xac\0" /* offset 13082 */
-  "\xd8\xb3\xd8\xac\xd8\xad\0" /* offset 13089 */
-  "\xd8\xb3\xd8\xac\xd9\x89\0" /* offset 13096 */
-  "\xd8\xb3\xd9\x85\xd8\xad\0" /* offset 13103 */
-  "\xd8\xb3\xd9\x85\xd8\xac\0" /* offset 13110 */
-  "\xd8\xb3\xd9\x85\xd9\x85\0" /* offset 13117 */
-  "\xd8\xb5\xd8\xad\xd8\xad\0" /* offset 13124 */
-  "\xd8\xb5\xd9\x85\xd9\x85\0" /* offset 13131 */
-  "\xd8\xb4\xd8\xad\xd9\x85\0" /* offset 13138 */
-  "\xd8\xb4\xd8\xac\xd9\x8a\0" /* offset 13145 */
-  "\xd8\xb4\xd9\x85\xd8\xae\0" /* offset 13152 */
-  "\xd8\xb4\xd9\x85\xd9\x85\0" /* offset 13159 */
-  "\xd8\xb6\xd8\xad\xd9\x89\0" /* offset 13166 */
-  "\xd8\xb6\xd8\xae\xd9\x85\0" /* offset 13173 */
-  "\xd8\xb7\xd9\x85\xd8\xad\0" /* offset 13180 */
-  "\xd8\xb7\xd9\x85\xd9\x85\0" /* offset 13187 */
-  "\xd8\xb7\xd9\x85\xd9\x8a\0" /* offset 13194 */
-  "\xd8\xb9\xd8\xac\xd9\x85\0" /* offset 13201 */
-  "\xd8\xb9\xd9\x85\xd9\x85\0" /* offset 13208 */
-  "\xd8\xb9\xd9\x85\xd9\x89\0" /* offset 13215 */
-  "\xd8\xba\xd9\x85\xd9\x85\0" /* offset 13222 */
-  "\xd8\xba\xd9\x85\xd9\x8a\0" /* offset 13229 */
-  "\xd8\xba\xd9\x85\xd9\x89\0" /* offset 13236 */
-  "\xd9\x81\xd8\xae\xd9\x85\0" /* offset 13243 */
-  "\xd9\x82\xd9\x85\xd8\xad\0" /* offset 13250 */
-  "\xd9\x82\xd9\x85\xd9\x85\0" /* offset 13257 */
-  "\xd9\x84\xd8\xad\xd9\x85\0" /* offset 13264 */
-  "\xd9\x84\xd8\xad\xd9\x8a\0" /* offset 13271 */
-  "\xd9\x84\xd8\xad\xd9\x89\0" /* offset 13278 */
-  "\xd9\x84\xd8\xac\xd8\xac\0" /* offset 13285 */
-  "\xd9\x84\xd8\xae\xd9\x85\0" /* offset 13292 */
-  "\xd9\x84\xd9\x85\xd8\xad\0" /* offset 13299 */
-  "\xd9\x85\xd8\xad\xd8\xac\0" /* offset 13306 */
-  "\xd9\x85\xd8\xad\xd9\x85\0" /* offset 13313 */
-  "\xd9\x85\xd8\xad\xd9\x8a\0" /* offset 13320 */
-  "\xd9\x85\xd8\xac\xd8\xad\0" /* offset 13327 */
-  "\xd9\x85\xd8\xac\xd9\x85\0" /* offset 13334 */
-  "\xd9\x85\xd8\xae\xd8\xac\0" /* offset 13341 */
-  "\xd9\x85\xd8\xae\xd9\x85\0" /* offset 13348 */
-  "\xd9\x85\xd8\xac\xd8\xae\0" /* offset 13355 */
-  "\xd9\x87\xd9\x85\xd8\xac\0" /* offset 13362 */
-  "\xd9\x87\xd9\x85\xd9\x85\0" /* offset 13369 */
-  "\xd9\x86\xd8\xad\xd9\x85\0" /* offset 13376 */
-  "\xd9\x86\xd8\xad\xd9\x89\0" /* offset 13383 */
-  "\xd9\x86\xd8\xac\xd9\x85\0" /* offset 13390 */
-  "\xd9\x86\xd8\xac\xd9\x89\0" /* offset 13397 */
-  "\xd9\x86\xd9\x85\xd9\x8a\0" /* offset 13404 */
-  "\xd9\x86\xd9\x85\xd9\x89\0" /* offset 13411 */
-  "\xd9\x8a\xd9\x85\xd9\x85\0" /* offset 13418 */
-  "\xd8\xa8\xd8\xae\xd9\x8a\0" /* offset 13425 */
-  "\xd8\xaa\xd8\xac\xd9\x8a\0" /* offset 13432 */
-  "\xd8\xaa\xd8\xac\xd9\x89\0" /* offset 13439 */
-  "\xd8\xaa\xd8\xae\xd9\x8a\0" /* offset 13446 */
-  "\xd8\xaa\xd8\xae\xd9\x89\0" /* offset 13453 */
-  "\xd8\xaa\xd9\x85\xd9\x8a\0" /* offset 13460 */
-  "\xd8\xaa\xd9\x85\xd9\x89\0" /* offset 13467 */
-  "\xd8\xac\xd9\x85\xd9\x8a\0" /* offset 13474 */
-  "\xd8\xac\xd8\xad\xd9\x89\0" /* offset 13481 */
-  "\xd8\xac\xd9\x85\xd9\x89\0" /* offset 13488 */
-  "\xd8\xb3\xd8\xae\xd9\x89\0" /* offset 13495 */
-  "\xd8\xb5\xd8\xad\xd9\x8a\0" /* offset 13502 */
-  "\xd8\xb4\xd8\xad\xd9\x8a\0" /* offset 13509 */
-  "\xd8\xb6\xd8\xad\xd9\x8a\0" /* offset 13516 */
-  "\xd9\x84\xd8\xac\xd9\x8a\0" /* offset 13523 */
-  "\xd9\x84\xd9\x85\xd9\x8a\0" /* offset 13530 */
-  "\xd9\x8a\xd8\xad\xd9\x8a\0" /* offset 13537 */
-  "\xd9\x8a\xd8\xac\xd9\x8a\0" /* offset 13544 */
-  "\xd9\x8a\xd9\x85\xd9\x8a\0" /* offset 13551 */
-  "\xd9\x85\xd9\x85\xd9\x8a\0" /* offset 13558 */
-  "\xd9\x82\xd9\x85\xd9\x8a\0" /* offset 13565 */
-  "\xd9\x86\xd8\xad\xd9\x8a\0" /* offset 13572 */
-  "\xd8\xb9\xd9\x85\xd9\x8a\0" /* offset 13579 */
-  "\xd9\x83\xd9\x85\xd9\x8a\0" /* offset 13586 */
-  "\xd9\x86\xd8\xac\xd8\xad\0" /* offset 13593 */
-  "\xd9\x85\xd8\xae\xd9\x8a\0" /* offset 13600 */
-  "\xd9\x84\xd8\xac\xd9\x85\0" /* offset 13607 */
-  "\xd9\x83\xd9\x85\xd9\x85\0" /* offset 13614 */
-  "\xd8\xac\xd8\xad\xd9\x8a\0" /* offset 13621 */
-  "\xd8\xad\xd8\xac\xd9\x8a\0" /* offset 13628 */
-  "\xd9\x85\xd8\xac\xd9\x8a\0" /* offset 13635 */
-  "\xd9\x81\xd9\x85\xd9\x8a\0" /* offset 13642 */
-  "\xd8\xa8\xd8\xad\xd9\x8a\0" /* offset 13649 */
-  "\xd8\xb3\xd8\xae\xd9\x8a\0" /* offset 13656 */
-  "\xd9\x86\xd8\xac\xd9\x8a\0" /* offset 13663 */
-  "\xd8\xb5\xd9\x84\xdb\x92\0" /* offset 13670 */
-  "\xd9\x82\xd9\x84\xdb\x92\0" /* offset 13677 */
-  "\xd8\xa7\xd9\x84\xd9\x84\xd9\x87\0" /* offset 13684 */
-  "\xd8\xa7\xd9\x83\xd8\xa8\xd8\xb1\0" /* offset 13693 */
-  "\xd9\x85\xd8\xad\xd9\x85\xd8\xaf\0" /* offset 13702 */
-  "\xd8\xb5\xd9\x84\xd8\xb9\xd9\x85\0" /* offset 13711 */
-  "\xd8\xb1\xd8\xb3\xd9\x88\xd9\x84\0" /* offset 13720 */
-  "\xd8\xb9\xd9\x84\xd9\x8a\xd9\x87\0" /* offset 13729 */
-  "\xd9\x88\xd8\xb3\xd9\x84\xd9\x85\0" /* offset 13738 */
-  "\xd8\xb5\xd9\x84\xd9\x89\0" /* offset 13747 */
-  "\xd8\xb5\xd9\x84\xd9\x89\x20\xd8\xa7\xd9\x84\xd9\x84\xd9\x87\x20\xd8\xb9\xd9\x84\xd9\x8a\xd9\x87\x20\xd9\x88\xd8\xb3\xd9\x84\xd9\x85\0" /* offset 13754 */
-  "\xd8\xac\xd9\x84\x20\xd8\xac\xd9\x84\xd8\xa7\xd9\x84\xd9\x87\0" /* offset 13788 */
-  "\xd8\xb1\xdb\x8c\xd8\xa7\xd9\x84\0" /* offset 13804 */
-  "\xe2\x80\x94\0" /* offset 13813 */
-  "\xe2\x80\x93\0" /* offset 13817 */
-  "\x5f\0" /* offset 13821 */
-  "\x7b\0" /* offset 13823 */
-  "\x7d\0" /* offset 13825 */
-  "\xe3\x80\x94\0" /* offset 13827 */
-  "\xe3\x80\x95\0" /* offset 13831 */
-  "\xe3\x80\x90\0" /* offset 13835 */
-  "\xe3\x80\x91\0" /* offset 13839 */
-  "\xe3\x80\x8a\0" /* offset 13843 */
-  "\xe3\x80\x8b\0" /* offset 13847 */
-  "\xe3\x80\x8c\0" /* offset 13851 */
-  "\xe3\x80\x8d\0" /* offset 13855 */
-  "\xe3\x80\x8e\0" /* offset 13859 */
-  "\xe3\x80\x8f\0" /* offset 13863 */
-  "\x2c\0" /* offset 13867 */
-  "\xe3\x80\x81\0" /* offset 13869 */
-  "\x3a\0" /* offset 13873 */
-  "\x3f\0" /* offset 13875 */
-  "\x21\0" /* offset 13877 */
-  "\x23\0" /* offset 13879 */
-  "\x26\0" /* offset 13881 */
-  "\x2a\0" /* offset 13883 */
-  "\x2d\0" /* offset 13885 */
-  "\x3c\0" /* offset 13887 */
-  "\x3e\0" /* offset 13889 */
-  "\x5c\0" /* offset 13891 */
-  "\x24\0" /* offset 13893 */
-  "\x25\0" /* offset 13895 */
-  "\x40\0" /* offset 13897 */
-  "\x20\xd9\x8b\0" /* offset 13899 */
-  "\xd9\x80\xd9\x8b\0" /* offset 13903 */
-  "\x20\xd9\x8c\0" /* offset 13908 */
-  "\x20\xd9\x8d\0" /* offset 13912 */
-  "\x20\xd9\x8e\0" /* offset 13916 */
-  "\xd9\x80\xd9\x8e\0" /* offset 13920 */
-  "\x20\xd9\x8f\0" /* offset 13925 */
-  "\xd9\x80\xd9\x8f\0" /* offset 13929 */
-  "\x20\xd9\x90\0" /* offset 13934 */
-  "\xd9\x80\xd9\x90\0" /* offset 13938 */
-  "\x20\xd9\x91\0" /* offset 13943 */
-  "\xd9\x80\xd9\x91\0" /* offset 13947 */
-  "\x20\xd9\x92\0" /* offset 13952 */
-  "\xd9\x80\xd9\x92\0" /* offset 13956 */
-  "\xd8\xa1\0" /* offset 13961 */
-  "\xd8\xa7\0" /* offset 13964 */
-  "\xd8\xa8\0" /* offset 13967 */
-  "\xd8\xa9\0" /* offset 13970 */
-  "\xd8\xaa\0" /* offset 13973 */
-  "\xd8\xab\0" /* offset 13976 */
-  "\xd8\xac\0" /* offset 13979 */
-  "\xd8\xad\0" /* offset 13982 */
-  "\xd8\xae\0" /* offset 13985 */
-  "\xd8\xaf\0" /* offset 13988 */
-  "\xd8\xb0\0" /* offset 13991 */
-  "\xd8\xb1\0" /* offset 13994 */
-  "\xd8\xb2\0" /* offset 13997 */
-  "\xd8\xb3\0" /* offset 14000 */
-  "\xd8\xb4\0" /* offset 14003 */
-  "\xd8\xb5\0" /* offset 14006 */
-  "\xd8\xb6\0" /* offset 14009 */
-  "\xd8\xb7\0" /* offset 14012 */
-  "\xd8\xb8\0" /* offset 14015 */
-  "\xd8\xb9\0" /* offset 14018 */
-  "\xd8\xba\0" /* offset 14021 */
-  "\xd9\x81\0" /* offset 14024 */
-  "\xd9\x82\0" /* offset 14027 */
-  "\xd9\x83\0" /* offset 14030 */
-  "\xd9\x84\0" /* offset 14033 */
-  "\xd9\x85\0" /* offset 14036 */
-  "\xd9\x86\0" /* offset 14039 */
-  "\xd9\x87\0" /* offset 14042 */
-  "\xd9\x88\0" /* offset 14045 */
-  "\xd9\x8a\0" /* offset 14048 */
-  "\xd9\x84\xd8\xa7\xd9\x93\0" /* offset 14051 */
-  "\xd9\x84\xd8\xa7\xd9\x94\0" /* offset 14058 */
-  "\xd9\x84\xd8\xa7\xd9\x95\0" /* offset 14065 */
-  "\xd9\x84\xd8\xa7\0" /* offset 14072 */
-  "\x22\0" /* offset 14077 */
-  "\x27\0" /* offset 14079 */
-  "\x2f\0" /* offset 14081 */
-  "\x5b\0" /* offset 14083 */
-  "\x5d\0" /* offset 14085 */
-  "\x5e\0" /* offset 14087 */
-  "\x7c\0" /* offset 14089 */
-  "\x7e\0" /* offset 14091 */
-  "\xe2\xa6\x85\0" /* offset 14093 */
-  "\xe2\xa6\x86\0" /* offset 14097 */
-  "\xe3\x80\x82\0" /* offset 14101 */
-  "\xe3\x83\xbb\0" /* offset 14105 */
-  "\xe3\x82\xa1\0" /* offset 14109 */
-  "\xe3\x82\xa3\0" /* offset 14113 */
-  "\xe3\x82\xa5\0" /* offset 14117 */
-  "\xe3\x82\xa7\0" /* offset 14121 */
-  "\xe3\x82\xa9\0" /* offset 14125 */
-  "\xe3\x83\xa3\0" /* offset 14129 */
-  "\xe3\x83\xa5\0" /* offset 14133 */
-  "\xe3\x83\xa7\0" /* offset 14137 */
-  "\xe3\x83\x83\0" /* offset 14141 */
-  "\xe3\x83\xbc\0" /* offset 14145 */
-  "\xe3\x83\xb3\0" /* offset 14149 */
-  "\xe3\x82\x99\0" /* offset 14153 */
-  "\xe3\x82\x9a\0" /* offset 14157 */
-  "\xc2\xa2\0" /* offset 14161 */
-  "\xc2\xa3\0" /* offset 14164 */
-  "\xc2\xac\0" /* offset 14167 */
-  "\xc2\xa6\0" /* offset 14170 */
-  "\xc2\xa5\0" /* offset 14173 */
-  "\xe2\x82\xa9\0" /* offset 14176 */
-  "\xe2\x94\x82\0" /* offset 14180 */
-  "\xe2\x86\x90\0" /* offset 14184 */
-  "\xe2\x86\x91\0" /* offset 14188 */
-  "\xe2\x86\x92\0" /* offset 14192 */
-  "\xe2\x86\x93\0" /* offset 14196 */
-  "\xe2\x96\xa0\0" /* offset 14200 */
-  "\xe2\x97\x8b\0" /* offset 14204 */
-  "\xf0\x9d\x85\x97\xf0\x9d\x85\xa5\0" /* offset 14208 */
-  "\xf0\x9d\x85\x98\xf0\x9d\x85\xa5\0" /* offset 14217 */
-  "\xf0\x9d\x85\x98\xf0\x9d\x85\xa5\xf0\x9d\x85\xae\0" /* offset 14226 */
-  "\xf0\x9d\x85\x98\xf0\x9d\x85\xa5\xf0\x9d\x85\xaf\0" /* offset 14239 */
-  "\xf0\x9d\x85\x98\xf0\x9d\x85\xa5\xf0\x9d\x85\xb0\0" /* offset 14252 */
-  "\xf0\x9d\x85\x98\xf0\x9d\x85\xa5\xf0\x9d\x85\xb1\0" /* offset 14265 */
-  "\xf0\x9d\x85\x98\xf0\x9d\x85\xa5\xf0\x9d\x85\xb2\0" /* offset 14278 */
-  "\xf0\x9d\x86\xb9\xf0\x9d\x85\xa5\0" /* offset 14291 */
-  "\xf0\x9d\x86\xba\xf0\x9d\x85\xa5\0" /* offset 14300 */
-  "\xf0\x9d\x86\xb9\xf0\x9d\x85\xa5\xf0\x9d\x85\xae\0" /* offset 14309 */
-  "\xf0\x9d\x86\xba\xf0\x9d\x85\xa5\xf0\x9d\x85\xae\0" /* offset 14322 */
-  "\xf0\x9d\x86\xb9\xf0\x9d\x85\xa5\xf0\x9d\x85\xaf\0" /* offset 14335 */
-  "\xf0\x9d\x86\xba\xf0\x9d\x85\xa5\xf0\x9d\x85\xaf\0" /* offset 14348 */
-  "\xce\x91\0" /* offset 14361 */
-  "\xce\x92\0" /* offset 14364 */
-  "\xce\x94\0" /* offset 14367 */
-  "\xce\x95\0" /* offset 14370 */
-  "\xce\x96\0" /* offset 14373 */
-  "\xce\x97\0" /* offset 14376 */
-  "\xce\x99\0" /* offset 14379 */
-  "\xce\x9a\0" /* offset 14382 */
-  "\xce\x9b\0" /* offset 14385 */
-  "\xce\x9c\0" /* offset 14388 */
-  "\xce\x9d\0" /* offset 14391 */
-  "\xce\x9e\0" /* offset 14394 */
-  "\xce\x9f\0" /* offset 14397 */
-  "\xce\xa1\0" /* offset 14400 */
-  "\xce\xa3\0" /* offset 14403 */
-  "\xce\xa4\0" /* offset 14406 */
-  "\xce\xa6\0" /* offset 14409 */
-  "\xce\xa7\0" /* offset 14412 */
-  "\xce\xa8\0" /* offset 14415 */
-  "\xe2\x88\x87\0" /* offset 14418 */
-  "\xce\xb1\0" /* offset 14422 */
-  "\xce\xb4\0" /* offset 14425 */
-  "\xce\xb6\0" /* offset 14428 */
-  "\xce\xb7\0" /* offset 14431 */
-  "\xce\xbb\0" /* offset 14434 */
-  "\xce\xbd\0" /* offset 14437 */
-  "\xce\xbe\0" /* offset 14440 */
-  "\xce\xbf\0" /* offset 14443 */
-  "\xcf\x83\0" /* offset 14446 */
-  "\xcf\x84\0" /* offset 14449 */
-  "\xcf\x85\0" /* offset 14452 */
-  "\xcf\x87\0" /* offset 14455 */
-  "\xcf\x88\0" /* offset 14458 */
-  "\xcf\x89\0" /* offset 14461 */
-  "\xe2\x88\x82\0" /* offset 14464 */
-  "\xe4\xb8\xbd\0" /* offset 14468 */
-  "\xe4\xb8\xb8\0" /* offset 14472 */
-  "\xe4\xb9\x81\0" /* offset 14476 */
-  "\xf0\xa0\x84\xa2\0" /* offset 14480 */
-  "\xe4\xbd\xa0\0" /* offset 14485 */
-  "\xe4\xbe\xbb\0" /* offset 14489 */
-  "\xe5\x80\x82\0" /* offset 14493 */
-  "\xe5\x81\xba\0" /* offset 14497 */
-  "\xe5\x82\x99\0" /* offset 14501 */
-  "\xe5\x83\x8f\0" /* offset 14505 */
-  "\xe3\x92\x9e\0" /* offset 14509 */
-  "\xf0\xa0\x98\xba\0" /* offset 14513 */
-  "\xe5\x85\x94\0" /* offset 14518 */
-  "\xe5\x85\xa4\0" /* offset 14522 */
-  "\xe5\x85\xb7\0" /* offset 14526 */
-  "\xf0\xa0\x94\x9c\0" /* offset 14530 */
-  "\xe3\x92\xb9\0" /* offset 14535 */
-  "\xe5\x85\xa7\0" /* offset 14539 */
-  "\xe5\x86\x8d\0" /* offset 14543 */
-  "\xf0\xa0\x95\x8b\0" /* offset 14547 */
-  "\xe5\x86\x97\0" /* offset 14552 */
-  "\xe5\x86\xa4\0" /* offset 14556 */
-  "\xe4\xbb\x8c\0" /* offset 14560 */
-  "\xe5\x86\xac\0" /* offset 14564 */
-  "\xe5\x86\xb5\0" /* offset 14568 */
-  "\xf0\xa9\x87\x9f\0" /* offset 14572 */
-  "\xe5\x88\x83\0" /* offset 14577 */
-  "\xe3\x93\x9f\0" /* offset 14581 */
-  "\xe5\x88\xbb\0" /* offset 14585 */
-  "\xe5\x89\x86\0" /* offset 14589 */
-  "\xe5\x89\xb2\0" /* offset 14593 */
-  "\xe5\x89\xb7\0" /* offset 14597 */
-  "\xe3\x94\x95\0" /* offset 14601 */
-  "\xe5\x8b\x87\0" /* offset 14605 */
-  "\xe5\x8b\xba\0" /* offset 14609 */
-  "\xe5\x8c\x85\0" /* offset 14613 */
-  "\xe5\x8c\x86\0" /* offset 14617 */
-  "\xe5\x8d\x89\0" /* offset 14621 */
-  "\xe5\x8d\x9a\0" /* offset 14625 */
-  "\xe5\x8d\xb3\0" /* offset 14629 */
-  "\xe5\x8d\xbd\0" /* offset 14633 */
-  "\xe5\x8d\xbf\0" /* offset 14637 */
-  "\xf0\xa0\xa8\xac\0" /* offset 14641 */
-  "\xe7\x81\xb0\0" /* offset 14646 */
-  "\xe5\x8f\x8a\0" /* offset 14650 */
-  "\xe5\x8f\x9f\0" /* offset 14654 */
-  "\xf0\xa0\xad\xa3\0" /* offset 14658 */
-  "\xe5\x8f\xab\0" /* offset 14663 */
-  "\xe5\x8f\xb1\0" /* offset 14667 */
-  "\xe5\x90\x86\0" /* offset 14671 */
-  "\xe5\x92\x9e\0" /* offset 14675 */
-  "\xe5\x90\xb8\0" /* offset 14679 */
-  "\xe5\x91\x88\0" /* offset 14683 */
-  "\xe5\x91\xa8\0" /* offset 14687 */
-  "\xe5\x92\xa2\0" /* offset 14691 */
-  "\xe5\x93\xb6\0" /* offset 14695 */
-  "\xe5\x94\x90\0" /* offset 14699 */
-  "\xe5\x95\x93\0" /* offset 14703 */
-  "\xe5\x95\xa3\0" /* offset 14707 */
-  "\xe5\x96\x84\0" /* offset 14711 */
-  "\xe5\x96\x99\0" /* offset 14715 */
-  "\xe5\x96\xab\0" /* offset 14719 */
-  "\xe5\x96\xb3\0" /* offset 14723 */
-  "\xe5\x97\x82\0" /* offset 14727 */
-  "\xe5\x9c\x96\0" /* offset 14731 */
-  "\xe5\x9c\x97\0" /* offset 14735 */
-  "\xe5\x99\x91\0" /* offset 14739 */
-  "\xe5\x99\xb4\0" /* offset 14743 */
-  "\xe5\xa3\xae\0" /* offset 14747 */
-  "\xe5\x9f\x8e\0" /* offset 14751 */
-  "\xe5\x9f\xb4\0" /* offset 14755 */
-  "\xe5\xa0\x8d\0" /* offset 14759 */
-  "\xe5\x9e\x8b\0" /* offset 14763 */
-  "\xe5\xa0\xb2\0" /* offset 14767 */
-  "\xe5\xa0\xb1\0" /* offset 14771 */
-  "\xe5\xa2\xac\0" /* offset 14775 */
-  "\xf0\xa1\x93\xa4\0" /* offset 14779 */
-  "\xe5\xa3\xb2\0" /* offset 14784 */
-  "\xe5\xa3\xb7\0" /* offset 14788 */
-  "\xe5\xa4\x86\0" /* offset 14792 */
-  "\xe5\xa4\x9a\0" /* offset 14796 */
-  "\xe5\xa4\xa2\0" /* offset 14800 */
-  "\xe5\xa5\xa2\0" /* offset 14804 */
-  "\xf0\xa1\x9a\xa8\0" /* offset 14808 */
-  "\xf0\xa1\x9b\xaa\0" /* offset 14813 */
-  "\xe5\xa7\xac\0" /* offset 14818 */
-  "\xe5\xa8\x9b\0" /* offset 14822 */
-  "\xe5\xa8\xa7\0" /* offset 14826 */
-  "\xe5\xa7\x98\0" /* offset 14830 */
-  "\xe5\xa9\xa6\0" /* offset 14834 */
-  "\xe3\x9b\xae\0" /* offset 14838 */
-  "\xf0\xa1\x8d\xaa\0" /* offset 14842 */
-  "\xe5\xac\x88\0" /* offset 14847 */
-  "\xe5\xac\xbe\0" /* offset 14851 */
-  "\xf0\xa1\xa7\x88\0" /* offset 14855 */
-  "\xe5\xaf\x83\0" /* offset 14860 */
-  "\xe5\xaf\x98\0" /* offset 14864 */
-  "\xe5\xaf\xb3\0" /* offset 14868 */
-  "\xf0\xa1\xac\x98\0" /* offset 14872 */
-  "\xe5\xaf\xbf\0" /* offset 14877 */
-  "\xe5\xb0\x86\0" /* offset 14881 */
-  "\xe5\xbc\xb3\0" /* offset 14885 */
-  "\xe3\x9e\x81\0" /* offset 14889 */
-  "\xe5\xb1\xa0\0" /* offset 14893 */
-  "\xe5\xb3\x80\0" /* offset 14897 */
-  "\xe5\xb2\x8d\0" /* offset 14901 */
-  "\xf0\xa1\xb7\xa4\0" /* offset 14905 */
-  "\xe5\xb5\x83\0" /* offset 14910 */
-  "\xf0\xa1\xb7\xa6\0" /* offset 14914 */
-  "\xe5\xb5\xae\0" /* offset 14919 */
-  "\xe5\xb5\xab\0" /* offset 14923 */
-  "\xe5\xb5\xbc\0" /* offset 14927 */
-  "\xe5\xb7\xa1\0" /* offset 14931 */
-  "\xe5\xb7\xa2\0" /* offset 14935 */
-  "\xe3\xa0\xaf\0" /* offset 14939 */
-  "\xe5\xb7\xbd\0" /* offset 14943 */
-  "\xe5\xb8\xa8\0" /* offset 14947 */
-  "\xe5\xb8\xbd\0" /* offset 14951 */
-  "\xe5\xb9\xa9\0" /* offset 14955 */
-  "\xe3\xa1\xa2\0" /* offset 14959 */
-  "\xf0\xa2\x86\x83\0" /* offset 14963 */
-  "\xe3\xa1\xbc\0" /* offset 14968 */
-  "\xe5\xba\xb0\0" /* offset 14972 */
-  "\xe5\xba\xb3\0" /* offset 14976 */
-  "\xe5\xba\xb6\0" /* offset 14980 */
-  "\xf0\xaa\x8e\x92\0" /* offset 14984 */
-  "\xf0\xa2\x8c\xb1\0" /* offset 14989 */
-  "\xe8\x88\x81\0" /* offset 14994 */
-  "\xe5\xbc\xa2\0" /* offset 14998 */
-  "\xe3\xa3\x87\0" /* offset 15002 */
-  "\xf0\xa3\x8a\xb8\0" /* offset 15006 */
-  "\xf0\xa6\x87\x9a\0" /* offset 15011 */
-  "\xe5\xbd\xa2\0" /* offset 15016 */
-  "\xe5\xbd\xab\0" /* offset 15020 */
-  "\xe3\xa3\xa3\0" /* offset 15024 */
-  "\xe5\xbe\x9a\0" /* offset 15028 */
-  "\xe5\xbf\x8d\0" /* offset 15032 */
-  "\xe5\xbf\x97\0" /* offset 15036 */
-  "\xe5\xbf\xb9\0" /* offset 15040 */
-  "\xe6\x82\x81\0" /* offset 15044 */
-  "\xe3\xa4\xba\0" /* offset 15048 */
-  "\xe3\xa4\x9c\0" /* offset 15052 */
-  "\xf0\xa2\x9b\x94\0" /* offset 15056 */
-  "\xe6\x83\x87\0" /* offset 15061 */
-  "\xe6\x85\x88\0" /* offset 15065 */
-  "\xe6\x85\x8c\0" /* offset 15069 */
-  "\xe6\x85\x8e\0" /* offset 15073 */
-  "\xe6\x85\xba\0" /* offset 15077 */
-  "\xe6\x86\xb2\0" /* offset 15081 */
-  "\xe6\x86\xa4\0" /* offset 15085 */
-  "\xe6\x86\xaf\0" /* offset 15089 */
-  "\xe6\x87\x9e\0" /* offset 15093 */
-  "\xe6\x88\x90\0" /* offset 15097 */
-  "\xe6\x88\x9b\0" /* offset 15101 */
-  "\xe6\x89\x9d\0" /* offset 15105 */
-  "\xe6\x8a\xb1\0" /* offset 15109 */
-  "\xe6\x8b\x94\0" /* offset 15113 */
-  "\xe6\x8d\x90\0" /* offset 15117 */
-  "\xf0\xa2\xac\x8c\0" /* offset 15121 */
-  "\xe6\x8c\xbd\0" /* offset 15126 */
-  "\xe6\x8b\xbc\0" /* offset 15130 */
-  "\xe6\x8d\xa8\0" /* offset 15134 */
-  "\xe6\x8e\x83\0" /* offset 15138 */
-  "\xe6\x8f\xa4\0" /* offset 15142 */
-  "\xf0\xa2\xaf\xb1\0" /* offset 15146 */
-  "\xe6\x90\xa2\0" /* offset 15151 */
-  "\xe6\x8f\x85\0" /* offset 15155 */
-  "\xe6\x8e\xa9\0" /* offset 15159 */
-  "\xe3\xa8\xae\0" /* offset 15163 */
-  "\xe6\x91\xa9\0" /* offset 15167 */
-  "\xe6\x91\xbe\0" /* offset 15171 */
-  "\xe6\x92\x9d\0" /* offset 15175 */
-  "\xe6\x91\xb7\0" /* offset 15179 */
-  "\xe3\xa9\xac\0" /* offset 15183 */
-  "\xe6\x95\xac\0" /* offset 15187 */
-  "\xf0\xa3\x80\x8a\0" /* offset 15191 */
-  "\xe6\x97\xa3\0" /* offset 15196 */
-  "\xe6\x9b\xb8\0" /* offset 15200 */
-  "\xe6\x99\x89\0" /* offset 15204 */
-  "\xe3\xac\x99\0" /* offset 15208 */
-  "\xe3\xac\x88\0" /* offset 15212 */
-  "\xe3\xab\xa4\0" /* offset 15216 */
-  "\xe5\x86\x92\0" /* offset 15220 */
-  "\xe5\x86\x95\0" /* offset 15224 */
-  "\xe6\x9c\x80\0" /* offset 15228 */
-  "\xe6\x9a\x9c\0" /* offset 15232 */
-  "\xe8\x82\xad\0" /* offset 15236 */
-  "\xe4\x8f\x99\0" /* offset 15240 */
-  "\xe6\x9c\x9b\0" /* offset 15244 */
-  "\xe6\x9c\xa1\0" /* offset 15248 */
-  "\xe6\x9d\x9e\0" /* offset 15252 */
-  "\xe6\x9d\x93\0" /* offset 15256 */
-  "\xf0\xa3\x8f\x83\0" /* offset 15260 */
-  "\xe3\xad\x89\0" /* offset 15265 */
-  "\xe6\x9f\xba\0" /* offset 15269 */
-  "\xe6\x9e\x85\0" /* offset 15273 */
-  "\xe6\xa1\x92\0" /* offset 15277 */
-  "\xf0\xa3\x91\xad\0" /* offset 15281 */
-  "\xe6\xa2\x8e\0" /* offset 15286 */
-  "\xe6\xa0\x9f\0" /* offset 15290 */
-  "\xe6\xa4\x94\0" /* offset 15294 */
-  "\xe3\xae\x9d\0" /* offset 15298 */
-  "\xe6\xa5\x82\0" /* offset 15302 */
-  "\xe6\xa6\xa3\0" /* offset 15306 */
-  "\xe6\xa7\xaa\0" /* offset 15310 */
-  "\xe6\xaa\xa8\0" /* offset 15314 */
-  "\xf0\xa3\x9a\xa3\0" /* offset 15318 */
-  "\xe6\xab\x9b\0" /* offset 15323 */
-  "\xe3\xb0\x98\0" /* offset 15327 */
-  "\xe6\xac\xa1\0" /* offset 15331 */
-  "\xf0\xa3\xa2\xa7\0" /* offset 15335 */
-  "\xe6\xad\x94\0" /* offset 15340 */
-  "\xe3\xb1\x8e\0" /* offset 15344 */
-  "\xe6\xad\xb2\0" /* offset 15348 */
-  "\xe6\xae\x9f\0" /* offset 15352 */
-  "\xe6\xae\xbb\0" /* offset 15356 */
-  "\xf0\xa3\xaa\x8d\0" /* offset 15360 */
-  "\xf0\xa1\xb4\x8b\0" /* offset 15365 */
-  "\xf0\xa3\xab\xba\0" /* offset 15370 */
-  "\xe6\xb1\x8e\0" /* offset 15375 */
-  "\xf0\xa3\xb2\xbc\0" /* offset 15379 */
-  "\xe6\xb2\xbf\0" /* offset 15384 */
-  "\xe6\xb3\x8d\0" /* offset 15388 */
-  "\xe6\xb1\xa7\0" /* offset 15392 */
-  "\xe6\xb4\x96\0" /* offset 15396 */
-  "\xe6\xb4\xbe\0" /* offset 15400 */
-  "\xe6\xb5\xa9\0" /* offset 15404 */
-  "\xe6\xb5\xb8\0" /* offset 15408 */
-  "\xe6\xb6\x85\0" /* offset 15412 */
-  "\xf0\xa3\xb4\x9e\0" /* offset 15416 */
-  "\xe6\xb4\xb4\0" /* offset 15421 */
-  "\xe6\xb8\xaf\0" /* offset 15425 */
-  "\xe6\xb9\xae\0" /* offset 15429 */
-  "\xe3\xb4\xb3\0" /* offset 15433 */
-  "\xe6\xbb\x8b\0" /* offset 15437 */
-  "\xe6\xbb\x87\0" /* offset 15441 */
-  "\xf0\xa3\xbb\x91\0" /* offset 15445 */
-  "\xe6\xb7\xb9\0" /* offset 15450 */
-  "\xe6\xbd\xae\0" /* offset 15454 */
-  "\xf0\xa3\xbd\x9e\0" /* offset 15458 */
-  "\xf0\xa3\xbe\x8e\0" /* offset 15463 */
-  "\xe6\xbf\x86\0" /* offset 15468 */
-  "\xe7\x80\xb9\0" /* offset 15472 */
-  "\xe7\x80\x9e\0" /* offset 15476 */
-  "\xe7\x80\x9b\0" /* offset 15480 */
-  "\xe3\xb6\x96\0" /* offset 15484 */
-  "\xe7\x81\x8a\0" /* offset 15488 */
-  "\xe7\x81\xbd\0" /* offset 15492 */
-  "\xe7\x81\xb7\0" /* offset 15496 */
-  "\xe7\x82\xad\0" /* offset 15500 */
-  "\xf0\xa0\x94\xa5\0" /* offset 15504 */
-  "\xe7\x85\x85\0" /* offset 15509 */
-  "\xf0\xa4\x89\xa3\0" /* offset 15513 */
-  "\xe7\x86\x9c\0" /* offset 15518 */
-  "\xe4\x8e\xab\0" /* offset 15522 */
-  "\xe7\x88\xa8\0" /* offset 15526 */
-  "\xe7\x88\xb5\0" /* offset 15530 */
-  "\xe7\x89\x90\0" /* offset 15534 */
-  "\xf0\xa4\x98\x88\0" /* offset 15538 */
-  "\xe7\x8a\x80\0" /* offset 15543 */
-  "\xe7\x8a\x95\0" /* offset 15547 */
-  "\xf0\xa4\x9c\xb5\0" /* offset 15551 */
-  "\xf0\xa4\xa0\x94\0" /* offset 15556 */
-  "\xe7\x8d\xba\0" /* offset 15561 */
-  "\xe7\x8e\x8b\0" /* offset 15565 */
-  "\xe3\xba\xac\0" /* offset 15569 */
-  "\xe7\x8e\xa5\0" /* offset 15573 */
-  "\xe3\xba\xb8\0" /* offset 15577 */
-  "\xe7\x91\x87\0" /* offset 15581 */
-  "\xe7\x91\x9c\0" /* offset 15585 */
-  "\xe7\x91\xb1\0" /* offset 15589 */
-  "\xe7\x92\x85\0" /* offset 15593 */
-  "\xe7\x93\x8a\0" /* offset 15597 */
-  "\xe3\xbc\x9b\0" /* offset 15601 */
-  "\xe7\x94\xa4\0" /* offset 15605 */
-  "\xf0\xa4\xb0\xb6\0" /* offset 15609 */
-  "\xe7\x94\xbe\0" /* offset 15614 */
-  "\xf0\xa4\xb2\x92\0" /* offset 15618 */
-  "\xf0\xa2\x86\x9f\0" /* offset 15623 */
-  "\xe7\x98\x90\0" /* offset 15628 */
-  "\xf0\xa4\xbe\xa1\0" /* offset 15632 */
-  "\xf0\xa4\xbe\xb8\0" /* offset 15637 */
-  "\xf0\xa5\x81\x84\0" /* offset 15642 */
-  "\xe3\xbf\xbc\0" /* offset 15647 */
-  "\xe4\x80\x88\0" /* offset 15651 */
-  "\xe7\x9b\xb4\0" /* offset 15655 */
-  "\xf0\xa5\x83\xb3\0" /* offset 15659 */
-  "\xf0\xa5\x83\xb2\0" /* offset 15664 */
-  "\xf0\xa5\x84\x99\0" /* offset 15669 */
-  "\xf0\xa5\x84\xb3\0" /* offset 15674 */
-  "\xe7\x9c\x9e\0" /* offset 15679 */
-  "\xe7\x9c\x9f\0" /* offset 15683 */
-  "\xe7\x9d\x8a\0" /* offset 15687 */
-  "\xe4\x80\xb9\0" /* offset 15691 */
-  "\xe7\x9e\x8b\0" /* offset 15695 */
-  "\xe4\x81\x86\0" /* offset 15699 */
-  "\xe4\x82\x96\0" /* offset 15703 */
-  "\xf0\xa5\x90\x9d\0" /* offset 15707 */
-  "\xe7\xa1\x8e\0" /* offset 15712 */
-  "\xe7\xa3\x8c\0" /* offset 15716 */
-  "\xe4\x83\xa3\0" /* offset 15720 */
-  "\xf0\xa5\x98\xa6\0" /* offset 15724 */
-  "\xf0\xa5\x9a\x9a\0" /* offset 15729 */
-  "\xf0\xa5\x9b\x85\0" /* offset 15734 */
-  "\xe7\xa7\xab\0" /* offset 15739 */
-  "\xe4\x84\xaf\0" /* offset 15743 */
-  "\xe7\xa9\x8a\0" /* offset 15747 */
-  "\xe7\xa9\x8f\0" /* offset 15751 */
-  "\xf0\xa5\xa5\xbc\0" /* offset 15755 */
-  "\xf0\xa5\xaa\xa7\0" /* offset 15760 */
-  "\xe7\xaa\xae\0" /* offset 15765 */
-  "\xe4\x88\x82\0" /* offset 15769 */
-  "\xf0\xa5\xae\xab\0" /* offset 15773 */
-  "\xe7\xaf\x86\0" /* offset 15778 */
-  "\xe7\xaf\x89\0" /* offset 15782 */
-  "\xe4\x88\xa7\0" /* offset 15786 */
-  "\xf0\xa5\xb2\x80\0" /* offset 15790 */
-  "\xe7\xb3\x92\0" /* offset 15795 */
-  "\xe4\x8a\xa0\0" /* offset 15799 */
-  "\xe7\xb3\xa8\0" /* offset 15803 */
-  "\xe7\xb3\xa3\0" /* offset 15807 */
-  "\xe7\xb4\x80\0" /* offset 15811 */
-  "\xf0\xa5\xbe\x86\0" /* offset 15815 */
-  "\xe7\xb5\xa3\0" /* offset 15820 */
-  "\xe4\x8c\x81\0" /* offset 15824 */
-  "\xe7\xb7\x87\0" /* offset 15828 */
-  "\xe7\xb8\x82\0" /* offset 15832 */
-  "\xe7\xb9\x85\0" /* offset 15836 */
-  "\xe4\x8c\xb4\0" /* offset 15840 */
-  "\xf0\xa6\x88\xa8\0" /* offset 15844 */
-  "\xf0\xa6\x89\x87\0" /* offset 15849 */
-  "\xe4\x8d\x99\0" /* offset 15854 */
-  "\xf0\xa6\x8b\x99\0" /* offset 15858 */
-  "\xe7\xbd\xba\0" /* offset 15863 */
-  "\xf0\xa6\x8c\xbe\0" /* offset 15867 */
-  "\xe7\xbe\x95\0" /* offset 15872 */
-  "\xe7\xbf\xba\0" /* offset 15876 */
-  "\xf0\xa6\x93\x9a\0" /* offset 15880 */
-  "\xf0\xa6\x94\xa3\0" /* offset 15885 */
-  "\xe8\x81\xa0\0" /* offset 15890 */
-  "\xf0\xa6\x96\xa8\0" /* offset 15894 */
-  "\xe8\x81\xb0\0" /* offset 15899 */
-  "\xf0\xa3\x8d\x9f\0" /* offset 15903 */
-  "\xe4\x8f\x95\0" /* offset 15908 */
-  "\xe8\x82\xb2\0" /* offset 15912 */
-  "\xe8\x84\x83\0" /* offset 15916 */
-  "\xe4\x90\x8b\0" /* offset 15920 */
-  "\xe8\x84\xbe\0" /* offset 15924 */
-  "\xe5\xaa\xb5\0" /* offset 15928 */
-  "\xf0\xa6\x9e\xa7\0" /* offset 15932 */
-  "\xf0\xa6\x9e\xb5\0" /* offset 15937 */
-  "\xf0\xa3\x8e\x93\0" /* offset 15942 */
-  "\xf0\xa3\x8e\x9c\0" /* offset 15947 */
-  "\xe8\x88\x84\0" /* offset 15952 */
-  "\xe8\xbe\x9e\0" /* offset 15956 */
-  "\xe4\x91\xab\0" /* offset 15960 */
-  "\xe8\x8a\x91\0" /* offset 15964 */
-  "\xe8\x8a\x8b\0" /* offset 15968 */
-  "\xe8\x8a\x9d\0" /* offset 15972 */
-  "\xe5\x8a\xb3\0" /* offset 15976 */
-  "\xe8\x8a\xb1\0" /* offset 15980 */
-  "\xe8\x8a\xb3\0" /* offset 15984 */
-  "\xe8\x8a\xbd\0" /* offset 15988 */
-  "\xe8\x8b\xa6\0" /* offset 15992 */
-  "\xf0\xa6\xac\xbc\0" /* offset 15996 */
-  "\xe8\x8c\x9d\0" /* offset 16001 */
-  "\xe8\x8d\xa3\0" /* offset 16005 */
-  "\xe8\x8e\xad\0" /* offset 16009 */
-  "\xe8\x8c\xa3\0" /* offset 16013 */
-  "\xe8\x8e\xbd\0" /* offset 16017 */
-  "\xe8\x8f\xa7\0" /* offset 16021 */
-  "\xe8\x8d\x93\0" /* offset 16025 */
-  "\xe8\x8f\x8a\0" /* offset 16029 */
-  "\xe8\x8f\x8c\0" /* offset 16033 */
-  "\xe8\x8f\x9c\0" /* offset 16037 */
-  "\xf0\xa6\xb0\xb6\0" /* offset 16041 */
-  "\xf0\xa6\xb5\xab\0" /* offset 16046 */
-  "\xf0\xa6\xb3\x95\0" /* offset 16051 */
-  "\xe4\x94\xab\0" /* offset 16056 */
-  "\xe8\x93\xb1\0" /* offset 16060 */
-  "\xe8\x93\xb3\0" /* offset 16064 */
-  "\xe8\x94\x96\0" /* offset 16068 */
-  "\xf0\xa7\x8f\x8a\0" /* offset 16072 */
-  "\xe8\x95\xa4\0" /* offset 16077 */
-  "\xf0\xa6\xbc\xac\0" /* offset 16081 */
-  "\xe4\x95\x9d\0" /* offset 16086 */
-  "\xe4\x95\xa1\0" /* offset 16090 */
-  "\xf0\xa6\xbe\xb1\0" /* offset 16094 */
-  "\xf0\xa7\x83\x92\0" /* offset 16099 */
-  "\xe4\x95\xab\0" /* offset 16104 */
-  "\xe8\x99\x90\0" /* offset 16108 */
-  "\xe8\x99\xa7\0" /* offset 16112 */
-  "\xe8\x99\xa9\0" /* offset 16116 */
-  "\xe8\x9a\xa9\0" /* offset 16120 */
-  "\xe8\x9a\x88\0" /* offset 16124 */
-  "\xe8\x9c\x8e\0" /* offset 16128 */
-  "\xe8\x9b\xa2\0" /* offset 16132 */
-  "\xe8\x9d\xb9\0" /* offset 16136 */
-  "\xe8\x9c\xa8\0" /* offset 16140 */
-  "\xe8\x9d\xab\0" /* offset 16144 */
-  "\xe8\x9e\x86\0" /* offset 16148 */
-  "\xe4\xb5\x97\0" /* offset 16152 */
-  "\xe8\x9f\xa1\0" /* offset 16156 */
-  "\xe8\xa0\x81\0" /* offset 16160 */
-  "\xe4\x97\xb9\0" /* offset 16164 */
-  "\xe8\xa1\xa0\0" /* offset 16168 */
-  "\xf0\xa7\x99\xa7\0" /* offset 16172 */
-  "\xe8\xa3\x97\0" /* offset 16177 */
-  "\xe8\xa3\x9e\0" /* offset 16181 */
-  "\xe4\x98\xb5\0" /* offset 16185 */
-  "\xe8\xa3\xba\0" /* offset 16189 */
-  "\xe3\x92\xbb\0" /* offset 16193 */
-  "\xf0\xa7\xa2\xae\0" /* offset 16197 */
-  "\xf0\xa7\xa5\xa6\0" /* offset 16202 */
-  "\xe4\x9a\xbe\0" /* offset 16207 */
-  "\xe4\x9b\x87\0" /* offset 16211 */
-  "\xe8\xaa\xa0\0" /* offset 16215 */
-  "\xe8\xab\xad\0" /* offset 16219 */
-  "\xe8\xae\x8a\0" /* offset 16223 */
-  "\xf0\xa7\xb2\xa8\0" /* offset 16227 */
-  "\xe8\xb2\xab\0" /* offset 16232 */
-  "\xe8\xb3\x81\0" /* offset 16236 */
-  "\xe8\xb4\x9b\0" /* offset 16240 */
-  "\xe8\xb5\xb7\0" /* offset 16244 */
-  "\xf0\xa7\xbc\xaf\0" /* offset 16248 */
-  "\xf0\xa0\xa0\x84\0" /* offset 16253 */
-  "\xe8\xb7\x8b\0" /* offset 16258 */
-  "\xe8\xb6\xbc\0" /* offset 16262 */
-  "\xe8\xb7\xb0\0" /* offset 16266 */
-  "\xf0\xa0\xa3\x9e\0" /* offset 16270 */
-  "\xe8\xbb\x94\0" /* offset 16275 */
-  "\xe8\xbc\xb8\0" /* offset 16279 */
-  "\xf0\xa8\x97\x92\0" /* offset 16283 */
-  "\xf0\xa8\x97\xad\0" /* offset 16288 */
-  "\xe9\x82\x94\0" /* offset 16293 */
-  "\xe9\x83\xb1\0" /* offset 16297 */
-  "\xe9\x84\x91\0" /* offset 16301 */
-  "\xf0\xa8\x9c\xae\0" /* offset 16305 */
-  "\xe9\x84\x9b\0" /* offset 16310 */
-  "\xe9\x88\xb8\0" /* offset 16314 */
-  "\xe9\x8b\x97\0" /* offset 16318 */
-  "\xe9\x8b\x98\0" /* offset 16322 */
-  "\xe9\x89\xbc\0" /* offset 16326 */
-  "\xe9\x8f\xb9\0" /* offset 16330 */
-  "\xe9\x90\x95\0" /* offset 16334 */
-  "\xf0\xa8\xaf\xba\0" /* offset 16338 */
-  "\xe9\x96\x8b\0" /* offset 16343 */
-  "\xe4\xa6\x95\0" /* offset 16347 */
-  "\xe9\x96\xb7\0" /* offset 16351 */
-  "\xf0\xa8\xb5\xb7\0" /* offset 16355 */
-  "\xe4\xa7\xa6\0" /* offset 16360 */
-  "\xe9\x9b\x83\0" /* offset 16364 */
-  "\xe5\xb6\xb2\0" /* offset 16368 */
-  "\xe9\x9c\xa3\0" /* offset 16372 */
-  "\xf0\xa9\x85\x85\0" /* offset 16376 */
-  "\xf0\xa9\x88\x9a\0" /* offset 16381 */
-  "\xe4\xa9\xae\0" /* offset 16386 */
-  "\xe4\xa9\xb6\0" /* offset 16390 */
-  "\xe9\x9f\xa0\0" /* offset 16394 */
-  "\xf0\xa9\x90\x8a\0" /* offset 16398 */
-  "\xe4\xaa\xb2\0" /* offset 16403 */
-  "\xf0\xa9\x92\x96\0" /* offset 16407 */
-  "\xe9\xa0\x8b\0" /* offset 16412 */
-  "\xe9\xa0\xa9\0" /* offset 16416 */
-  "\xf0\xa9\x96\xb6\0" /* offset 16420 */
-  "\xe9\xa3\xa2\0" /* offset 16425 */
-  "\xe4\xac\xb3\0" /* offset 16429 */
-  "\xe9\xa4\xa9\0" /* offset 16433 */
-  "\xe9\xa6\xa7\0" /* offset 16437 */
-  "\xe9\xa7\x82\0" /* offset 16441 */
-  "\xe9\xa7\xbe\0" /* offset 16445 */
-  "\xe4\xaf\x8e\0" /* offset 16449 */
-  "\xf0\xa9\xac\xb0\0" /* offset 16453 */
-  "\xe9\xac\x92\0" /* offset 16458 */
-  "\xe9\xb1\x80\0" /* offset 16462 */
-  "\xe9\xb3\xbd\0" /* offset 16466 */
-  "\xe4\xb3\x8e\0" /* offset 16470 */
-  "\xe4\xb3\xad\0" /* offset 16474 */
-  "\xe9\xb5\xa7\0" /* offset 16478 */
-  "\xf0\xaa\x83\x8e\0" /* offset 16482 */
-  "\xe4\xb3\xb8\0" /* offset 16487 */
-  "\xf0\xaa\x84\x85\0" /* offset 16491 */
-  "\xf0\xaa\x88\x8e\0" /* offset 16496 */
-  "\xf0\xaa\x8a\x91\0" /* offset 16501 */
-  "\xe4\xb5\x96\0" /* offset 16506 */
-  "\xe9\xbb\xbe\0" /* offset 16510 */
-  "\xe9\xbc\x85\0" /* offset 16514 */
-  "\xe9\xbc\x8f\0" /* offset 16518 */
-  "\xe9\xbc\x96\0" /* offset 16522 */
-  "\xf0\xaa\x98\x80\0" /* offset 16526 */;
-
-#endif /* DECOMP_H */
diff --git a/lib/contrib/nfkc.c b/lib/contrib/nfkc.c
deleted file mode 100644 (file)
index e5eb4d0..0000000
+++ /dev/null
@@ -1,1054 +0,0 @@
-/* nfkc.c      Unicode normalization utilities.
- * Copyright (C) 2002, 2003, 2004, 2005  Simon Josefsson
- *
- * This file is part of GNU Libidn.
- *
- * GNU Libidn is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * GNU Libidn 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
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with GNU Libidn; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- *
- */
-
-#include <stdlib.h>
-#include <string.h>
-
-#include "stringprep.h"
-
-/* This file contains functions from GLIB, including gutf8.c and
- * gunidecomp.c, all licensed under LGPL and copyright hold by:
- *
- *  Copyright (C) 1999, 2000 Tom Tromey
- *  Copyright 2000 Red Hat, Inc.
- */
-
-/* Hacks to make syncing with GLIB code easier. */
-#define gboolean int
-#define gchar char
-#define guchar unsigned char
-#define glong long
-#define gint int
-#define guint unsigned int
-#define gushort unsigned short
-#define gint16 int16_t
-#define guint16 uint16_t
-#define gunichar uint32_t
-#define gsize size_t
-#define gssize ssize_t
-#define g_malloc malloc
-#define g_free free
-#define GError void
-#define g_set_error(a,b,c,d) ((void) 0)
-#define g_new(struct_type, n_structs)                                  \
-  ((struct_type *) g_malloc (((gsize) sizeof (struct_type)) * ((gsize) (n_structs))))
-#  if defined (__GNUC__) && !defined (__STRICT_ANSI__) && !defined (__cplusplus)
-#    define G_STMT_START       (void)(
-#    define G_STMT_END         )
-#  else
-#    if (defined (sun) || defined (__sun__))
-#      define G_STMT_START     if (1)
-#      define G_STMT_END       else (void)0
-#    else
-#      define G_STMT_START     do
-#      define G_STMT_END       while (0)
-#    endif
-#  endif
-#define g_return_val_if_fail(expr,val)         G_STMT_START{ (void)0; }G_STMT_END
-#define G_N_ELEMENTS(arr)              (sizeof (arr) / sizeof ((arr)[0]))
-#define TRUE 1
-#define FALSE 0
-
-/* Code from GLIB gunicode.h starts here. */
-
-typedef enum
-{
-  G_NORMALIZE_DEFAULT,
-  G_NORMALIZE_NFD = G_NORMALIZE_DEFAULT,
-  G_NORMALIZE_DEFAULT_COMPOSE,
-  G_NORMALIZE_NFC = G_NORMALIZE_DEFAULT_COMPOSE,
-  G_NORMALIZE_ALL,
-  G_NORMALIZE_NFKD = G_NORMALIZE_ALL,
-  G_NORMALIZE_ALL_COMPOSE,
-  G_NORMALIZE_NFKC = G_NORMALIZE_ALL_COMPOSE
-}
-GNormalizeMode;
-
-/* Code from GLIB gutf8.c starts here. */
-
-#define UTF8_COMPUTE(Char, Mask, Len)          \
-  if (Char < 128)                              \
-    {                                          \
-      Len = 1;                                 \
-      Mask = 0x7f;                             \
-    }                                          \
-  else if ((Char & 0xe0) == 0xc0)              \
-    {                                          \
-      Len = 2;                                 \
-      Mask = 0x1f;                             \
-    }                                          \
-  else if ((Char & 0xf0) == 0xe0)              \
-    {                                          \
-      Len = 3;                                 \
-      Mask = 0x0f;                             \
-    }                                          \
-  else if ((Char & 0xf8) == 0xf0)              \
-    {                                          \
-      Len = 4;                                 \
-      Mask = 0x07;                             \
-    }                                          \
-  else if ((Char & 0xfc) == 0xf8)              \
-    {                                          \
-      Len = 5;                                 \
-      Mask = 0x03;                             \
-    }                                          \
-  else if ((Char & 0xfe) == 0xfc)              \
-    {                                          \
-      Len = 6;                                 \
-      Mask = 0x01;                             \
-    }                                          \
-  else                                         \
-    Len = -1;
-
-#define UTF8_LENGTH(Char)                      \
-  ((Char) < 0x80 ? 1 :                         \
-   ((Char) < 0x800 ? 2 :                       \
-    ((Char) < 0x10000 ? 3 :                    \
-     ((Char) < 0x200000 ? 4 :                  \
-      ((Char) < 0x4000000 ? 5 : 6)))))
-
-
-#define UTF8_GET(Result, Chars, Count, Mask, Len)      \
-  (Result) = (Chars)[0] & (Mask);                      \
-  for ((Count) = 1; (Count) < (Len); ++(Count))                \
-    {                                                  \
-      if (((Chars)[(Count)] & 0xc0) != 0x80)           \
-       {                                               \
-         (Result) = -1;                                \
-         break;                                        \
-       }                                               \
-      (Result) <<= 6;                                  \
-      (Result) |= ((Chars)[(Count)] & 0x3f);           \
-    }
-
-#define UNICODE_VALID(Char)                    \
-  ((Char) < 0x110000 &&                                \
-   (((Char) & 0xFFFFF800) != 0xD800) &&                \
-   ((Char) < 0xFDD0 || (Char) > 0xFDEF) &&     \
-   ((Char) & 0xFFFE) != 0xFFFE)
-
-
-static const gchar utf8_skip_data[256] = {
-  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
-  1, 1, 1, 1, 1, 1, 1,
-  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
-  1, 1, 1, 1, 1, 1, 1,
-  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
-  1, 1, 1, 1, 1, 1, 1,
-  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
-  1, 1, 1, 1, 1, 1, 1,
-  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
-  1, 1, 1, 1, 1, 1, 1,
-  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
-  1, 1, 1, 1, 1, 1, 1,
-  2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
-  2, 2, 2, 2, 2, 2, 2,
-  3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 5,
-  5, 5, 5, 6, 6, 1, 1
-};
-
-static const gchar *const g_utf8_skip = utf8_skip_data;
-
-#define g_utf8_next_char(p) (char *)((p) + g_utf8_skip[*(guchar *)(p)])
-
-/*
- * g_utf8_strlen:
- * @p: pointer to the start of a UTF-8 encoded string.
- * @max: the maximum number of bytes to examine. If @max
- *       is less than 0, then the string is assumed to be
- *       nul-terminated. If @max is 0, @p will not be examined and
- *       may be %NULL.
- *
- * Returns the length of the string in characters.
- *
- * Return value: the length of the string in characters
- **/
-static glong
-g_utf8_strlen (const gchar * p, gssize max)
-{
-  glong len = 0;
-  const gchar *start = p;
-  g_return_val_if_fail (p != NULL || max == 0, 0);
-
-  if (max < 0)
-    {
-      while (*p)
-       {
-         p = g_utf8_next_char (p);
-         ++len;
-       }
-    }
-  else
-    {
-      if (max == 0 || !*p)
-       return 0;
-
-      p = g_utf8_next_char (p);
-
-      while (p - start < max && *p)
-       {
-         ++len;
-         p = g_utf8_next_char (p);
-       }
-
-      /* only do the last len increment if we got a complete
-       * char (don't count partial chars)
-       */
-      if (p - start == max)
-       ++len;
-    }
-
-  return len;
-}
-
-/*
- * g_utf8_get_char:
- * @p: a pointer to Unicode character encoded as UTF-8
- *
- * Converts a sequence of bytes encoded as UTF-8 to a Unicode character.
- * If @p does not point to a valid UTF-8 encoded character, results are
- * undefined. If you are not sure that the bytes are complete
- * valid Unicode characters, you should use g_utf8_get_char_validated()
- * instead.
- *
- * Return value: the resulting character
- **/
-static gunichar
-g_utf8_get_char (const gchar * p)
-{
-  int i, mask = 0, len;
-  gunichar result;
-  unsigned char c = (unsigned char) *p;
-
-  UTF8_COMPUTE (c, mask, len);
-  if (len == -1)
-    return (gunichar) - 1;
-  UTF8_GET (result, p, i, mask, len);
-
-  return result;
-}
-
-/*
- * g_unichar_to_utf8:
- * @c: a ISO10646 character code
- * @outbuf: output buffer, must have at least 6 bytes of space.
- *       If %NULL, the length will be computed and returned
- *       and nothing will be written to @outbuf.
- *
- * Converts a single character to UTF-8.
- *
- * Return value: number of bytes written
- **/
-static int
-g_unichar_to_utf8 (gunichar c, gchar * outbuf)
-{
-  guint len = 0;
-  int first;
-  int i;
-
-  if (c < 0x80)
-    {
-      first = 0;
-      len = 1;
-    }
-  else if (c < 0x800)
-    {
-      first = 0xc0;
-      len = 2;
-    }
-  else if (c < 0x10000)
-    {
-      first = 0xe0;
-      len = 3;
-    }
-  else if (c < 0x200000)
-    {
-      first = 0xf0;
-      len = 4;
-    }
-  else if (c < 0x4000000)
-    {
-      first = 0xf8;
-      len = 5;
-    }
-  else
-    {
-      first = 0xfc;
-      len = 6;
-    }
-
-  if (outbuf)
-    {
-      for (i = len - 1; i > 0; --i)
-       {
-         outbuf[i] = (c & 0x3f) | 0x80;
-         c >>= 6;
-       }
-      outbuf[0] = c | first;
-    }
-
-  return len;
-}
-
-/*
- * g_utf8_to_ucs4_fast:
- * @str: a UTF-8 encoded string
- * @len: the maximum length of @str to use. If @len < 0, then
- *       the string is nul-terminated.
- * @items_written: location to store the number of characters in the
- *                 result, or %NULL.
- *
- * Convert a string from UTF-8 to a 32-bit fixed width
- * representation as UCS-4, assuming valid UTF-8 input.
- * This function is roughly twice as fast as g_utf8_to_ucs4()
- * but does no error checking on the input.
- *
- * Return value: a pointer to a newly allocated UCS-4 string.
- *               This value must be freed with g_free().
- **/
-static gunichar *
-g_utf8_to_ucs4_fast (const gchar * str, glong len, glong * items_written)
-{
-  gint j, charlen;
-  gunichar *result;
-  gint n_chars, i;
-  const gchar *p;
-
-  g_return_val_if_fail (str != NULL, NULL);
-
-  p = str;
-  n_chars = 0;
-  if (len < 0)
-    {
-      while (*p)
-       {
-         p = g_utf8_next_char (p);
-         ++n_chars;
-       }
-    }
-  else
-    {
-      while (p < str + len && *p)
-       {
-         p = g_utf8_next_char (p);
-         ++n_chars;
-       }
-    }
-
-  result = g_new (gunichar, n_chars + 1);
-  if (!result)
-    return NULL;
-
-  p = str;
-  for (i = 0; i < n_chars; i++)
-    {
-      gunichar wc = ((unsigned char *) p)[0];
-
-      if (wc < 0x80)
-       {
-         result[i] = wc;
-         p++;
-       }
-      else
-       {
-         if (wc < 0xe0)
-           {
-             charlen = 2;
-             wc &= 0x1f;
-           }
-         else if (wc < 0xf0)
-           {
-             charlen = 3;
-             wc &= 0x0f;
-           }
-         else if (wc < 0xf8)
-           {
-             charlen = 4;
-             wc &= 0x07;
-           }
-         else if (wc < 0xfc)
-           {
-             charlen = 5;
-             wc &= 0x03;
-           }
-         else
-           {
-             charlen = 6;
-             wc &= 0x01;
-           }
-
-         for (j = 1; j < charlen; j++)
-           {
-             wc <<= 6;
-             wc |= ((unsigned char *) p)[j] & 0x3f;
-           }
-
-         result[i] = wc;
-         p += charlen;
-       }
-    }
-  result[i] = 0;
-
-  if (items_written)
-    *items_written = i;
-
-  return result;
-}
-
-/*
- * g_ucs4_to_utf8:
- * @str: a UCS-4 encoded string
- * @len: the maximum length of @str to use. If @len < 0, then
- *       the string is terminated with a 0 character.
- * @items_read: location to store number of characters read read, or %NULL.
- * @items_written: location to store number of bytes written or %NULL.
- *                 The value here stored does not include the trailing 0
- *                 byte.
- * @error: location to store the error occuring, or %NULL to ignore
- *         errors. Any of the errors in #GConvertError other than
- *         %G_CONVERT_ERROR_NO_CONVERSION may occur.
- *
- * Convert a string from a 32-bit fixed width representation as UCS-4.
- * to UTF-8. The result will be terminated with a 0 byte.
- *
- * Return value: a pointer to a newly allocated UTF-8 string.
- *               This value must be freed with g_free(). If an
- *               error occurs, %NULL will be returned and
- *               @error set.
- **/
-static gchar *
-g_ucs4_to_utf8 (const gunichar * str,
-               glong len,
-               glong * items_read, glong * items_written, GError ** error)
-{
-  gint result_length;
-  gchar *result = NULL;
-  gchar *p;
-  gint i;
-
-  result_length = 0;
-  for (i = 0; len < 0 || i < len; i++)
-    {
-      if (!str[i])
-       break;
-
-      if (str[i] >= 0x80000000)
-       {
-         if (items_read)
-           *items_read = i;
-
-         g_set_error (error, G_CONVERT_ERROR,
-                      G_CONVERT_ERROR_ILLEGAL_SEQUENCE,
-                      _("Character out of range for UTF-8"));
-         goto err_out;
-       }
-
-      result_length += UTF8_LENGTH (str[i]);
-    }
-
-  result = g_malloc (result_length + 1);
-  if (!result)
-    return NULL;
-  p = result;
-
-  i = 0;
-  while (p < result + result_length)
-    p += g_unichar_to_utf8 (str[i++], p);
-
-  *p = '\0';
-
-  if (items_written)
-    *items_written = p - result;
-
-err_out:
-  if (items_read)
-    *items_read = i;
-
-  return result;
-}
-
-/* Code from GLIB gunidecomp.c starts here. */
-
-#include "gunidecomp.h"
-#include "gunicomp.h"
-
-#define CC_PART1(Page, Char) \
-  ((combining_class_table_part1[Page] >= G_UNICODE_MAX_TABLE_INDEX) \
-   ? (combining_class_table_part1[Page] - G_UNICODE_MAX_TABLE_INDEX) \
-   : (cclass_data[combining_class_table_part1[Page]][Char]))
-
-#define CC_PART2(Page, Char) \
-  ((combining_class_table_part2[Page] >= G_UNICODE_MAX_TABLE_INDEX) \
-   ? (combining_class_table_part2[Page] - G_UNICODE_MAX_TABLE_INDEX) \
-   : (cclass_data[combining_class_table_part2[Page]][Char]))
-
-#define COMBINING_CLASS(Char) \
-  (((Char) <= G_UNICODE_LAST_CHAR_PART1) \
-   ? CC_PART1 ((Char) >> 8, (Char) & 0xff) \
-   : (((Char) >= 0xe0000 && (Char) <= G_UNICODE_LAST_CHAR) \
-      ? CC_PART2 (((Char) - 0xe0000) >> 8, (Char) & 0xff) \
-      : 0))
-
-/* constants for hangul syllable [de]composition */
-#define SBase 0xAC00
-#define LBase 0x1100
-#define VBase 0x1161
-#define TBase 0x11A7
-#define LCount 19
-#define VCount 21
-#define TCount 28
-#define NCount (VCount * TCount)
-#define SCount (LCount * NCount)
-
-/*
- * g_unicode_canonical_ordering:
- * @string: a UCS-4 encoded string.
- * @len: the maximum length of @string to use.
- *
- * Computes the canonical ordering of a string in-place.
- * This rearranges decomposed characters in the string
- * according to their combining classes.  See the Unicode
- * manual for more information.
- **/
-static void
-g_unicode_canonical_ordering (gunichar * string, gsize len)
-{
-  gsize i;
-  int swap = 1;
-
-  while (swap)
-    {
-      int last;
-      swap = 0;
-      last = COMBINING_CLASS (string[0]);
-      for (i = 0; i < len - 1; ++i)
-       {
-         int next = COMBINING_CLASS (string[i + 1]);
-         if (next != 0 && last > next)
-           {
-             gsize j;
-             /* Percolate item leftward through string.  */
-             for (j = i + 1; j > 0; --j)
-               {
-                 gunichar t;
-                 if (COMBINING_CLASS (string[j - 1]) <= next)
-                   break;
-                 t = string[j];
-                 string[j] = string[j - 1];
-                 string[j - 1] = t;
-                 swap = 1;
-               }
-             /* We're re-entering the loop looking at the old
-                character again.  */
-             next = last;
-           }
-         last = next;
-       }
-    }
-}
-
-/* http://www.unicode.org/unicode/reports/tr15/#Hangul
- * r should be null or have sufficient space. Calling with r == NULL will
- * only calculate the result_len; however, a buffer with space for three
- * characters will always be big enough. */
-static void
-decompose_hangul (gunichar s, gunichar * r, gsize * result_len)
-{
-  gint SIndex = s - SBase;
-
-  /* not a hangul syllable */
-  if (SIndex < 0 || SIndex >= SCount)
-    {
-      if (r)
-       r[0] = s;
-      *result_len = 1;
-    }
-  else
-    {
-      gunichar L = LBase + SIndex / NCount;
-      gunichar V = VBase + (SIndex % NCount) / TCount;
-      gunichar T = TBase + SIndex % TCount;
-
-      if (r)
-       {
-         r[0] = L;
-         r[1] = V;
-       }
-
-      if (T != TBase)
-       {
-         if (r)
-           r[2] = T;
-         *result_len = 3;
-       }
-      else
-       *result_len = 2;
-    }
-}
-
-/* returns a pointer to a null-terminated UTF-8 string */
-static const gchar *
-find_decomposition (gunichar ch, gboolean compat)
-{
-  int start = 0;
-  int end = G_N_ELEMENTS (decomp_table);
-
-  if (ch >= decomp_table[start].ch && ch <= decomp_table[end - 1].ch)
-    {
-      while (TRUE)
-       {
-         int half = (start + end) / 2;
-         if (ch == decomp_table[half].ch)
-           {
-             int offset;
-
-             if (compat)
-               {
-                 offset = decomp_table[half].compat_offset;
-                 if (offset == G_UNICODE_NOT_PRESENT_OFFSET)
-                   offset = decomp_table[half].canon_offset;
-               }
-             else
-               {
-                 offset = decomp_table[half].canon_offset;
-                 if (offset == G_UNICODE_NOT_PRESENT_OFFSET)
-                   return NULL;
-               }
-
-             return &(decomp_expansion_string[offset]);
-           }
-         else if (half == start)
-           break;
-         else if (ch > decomp_table[half].ch)
-           start = half;
-         else
-           end = half;
-       }
-    }
-
-  return NULL;
-}
-
-/* L,V => LV and LV,T => LVT  */
-static gboolean
-combine_hangul (gunichar a, gunichar b, gunichar * result)
-{
-  gint LIndex = a - LBase;
-  gint SIndex = a - SBase;
-
-  gint VIndex = b - VBase;
-  gint TIndex = b - TBase;
-
-  if (0 <= LIndex && LIndex < LCount && 0 <= VIndex && VIndex < VCount)
-    {
-      *result = SBase + (LIndex * VCount + VIndex) * TCount;
-      return TRUE;
-    }
-  else if (0 <= SIndex && SIndex < SCount && (SIndex % TCount) == 0
-          && 0 <= TIndex && TIndex <= TCount)
-    {
-      *result = a + TIndex;
-      return TRUE;
-    }
-
-  return FALSE;
-}
-
-#define CI(Page, Char) \
-  ((compose_table[Page] >= G_UNICODE_MAX_TABLE_INDEX) \
-   ? (compose_table[Page] - G_UNICODE_MAX_TABLE_INDEX) \
-   : (compose_data[compose_table[Page]][Char]))
-
-#define COMPOSE_INDEX(Char) \
-     ((((Char) >> 8) > (COMPOSE_TABLE_LAST)) ? 0 : CI((Char) >> 8, (Char) & 0xff))
-
-static gboolean
-combine (gunichar a, gunichar b, gunichar * result)
-{
-  gushort index_a, index_b;
-
-  if (combine_hangul (a, b, result))
-    return TRUE;
-
-  index_a = COMPOSE_INDEX (a);
-
-  if (index_a >= COMPOSE_FIRST_SINGLE_START && index_a < COMPOSE_SECOND_START)
-    {
-      if (b == compose_first_single[index_a - COMPOSE_FIRST_SINGLE_START][0])
-       {
-         *result =
-           compose_first_single[index_a - COMPOSE_FIRST_SINGLE_START][1];
-         return TRUE;
-       }
-      else
-       return FALSE;
-    }
-
-  index_b = COMPOSE_INDEX (b);
-
-  if (index_b >= COMPOSE_SECOND_SINGLE_START)
-    {
-      if (a ==
-         compose_second_single[index_b - COMPOSE_SECOND_SINGLE_START][0])
-       {
-         *result =
-           compose_second_single[index_b - COMPOSE_SECOND_SINGLE_START][1];
-         return TRUE;
-       }
-      else
-       return FALSE;
-    }
-
-  if (index_a >= COMPOSE_FIRST_START && index_a < COMPOSE_FIRST_SINGLE_START
-      && index_b >= COMPOSE_SECOND_START
-      && index_b < COMPOSE_SECOND_SINGLE_START)
-    {
-      gunichar res =
-       compose_array[index_a - COMPOSE_FIRST_START][index_b -
-                                                    COMPOSE_SECOND_START];
-
-      if (res)
-       {
-         *result = res;
-         return TRUE;
-       }
-    }
-
-  return FALSE;
-}
-
-static gunichar *
-_g_utf8_normalize_wc (const gchar * str, gssize max_len, GNormalizeMode mode)
-{
-  gsize n_wc;
-  gunichar *wc_buffer;
-  const char *p;
-  gsize last_start;
-  gboolean do_compat = (mode == G_NORMALIZE_NFKC || mode == G_NORMALIZE_NFKD);
-  gboolean do_compose = (mode == G_NORMALIZE_NFC || mode == G_NORMALIZE_NFKC);
-
-  n_wc = 0;
-  p = str;
-  while ((max_len < 0 || p < str + max_len) && *p)
-    {
-      const gchar *decomp;
-      gunichar wc = g_utf8_get_char (p);
-
-      if (wc >= 0xac00 && wc <= 0xd7af)
-       {
-         gsize result_len;
-         decompose_hangul (wc, NULL, &result_len);
-         n_wc += result_len;
-       }
-      else
-       {
-         decomp = find_decomposition (wc, do_compat);
-
-         if (decomp)
-           n_wc += g_utf8_strlen (decomp, -1);
-         else
-           n_wc++;
-       }
-
-      p = g_utf8_next_char (p);
-    }
-
-  wc_buffer = g_new (gunichar, n_wc + 1);
-  if (!wc_buffer)
-    return NULL;
-
-  last_start = 0;
-  n_wc = 0;
-  p = str;
-  while ((max_len < 0 || p < str + max_len) && *p)
-    {
-      gunichar wc = g_utf8_get_char (p);
-      const gchar *decomp;
-      int cc;
-      gsize old_n_wc = n_wc;
-
-      if (wc >= 0xac00 && wc <= 0xd7af)
-       {
-         gsize result_len;
-         decompose_hangul (wc, wc_buffer + n_wc, &result_len);
-         n_wc += result_len;
-       }
-      else
-       {
-         decomp = find_decomposition (wc, do_compat);
-
-         if (decomp)
-           {
-             const char *pd;
-             for (pd = decomp; *pd != '\0'; pd = g_utf8_next_char (pd))
-               wc_buffer[n_wc++] = g_utf8_get_char (pd);
-           }
-         else
-           wc_buffer[n_wc++] = wc;
-       }
-
-      if (n_wc > 0)
-       {
-         cc = COMBINING_CLASS (wc_buffer[old_n_wc]);
-
-         if (cc == 0)
-           {
-             g_unicode_canonical_ordering (wc_buffer + last_start,
-                                           n_wc - last_start);
-             last_start = old_n_wc;
-           }
-       }
-
-      p = g_utf8_next_char (p);
-    }
-
-  if (n_wc > 0)
-    {
-      g_unicode_canonical_ordering (wc_buffer + last_start,
-                                   n_wc - last_start);
-      last_start = n_wc;
-    }
-
-  wc_buffer[n_wc] = 0;
-
-  /* All decomposed and reordered */
-
-  if (do_compose && n_wc > 0)
-    {
-      gsize i, j;
-      int last_cc = 0;
-      last_start = 0;
-
-      for (i = 0; i < n_wc; i++)
-       {
-         int cc = COMBINING_CLASS (wc_buffer[i]);
-
-         if (i > 0 &&
-             (last_cc == 0 || last_cc != cc) &&
-             combine (wc_buffer[last_start], wc_buffer[i],
-                      &wc_buffer[last_start]))
-           {
-             for (j = i + 1; j < n_wc; j++)
-               wc_buffer[j - 1] = wc_buffer[j];
-             n_wc--;
-             i--;
-
-             if (i == last_start)
-               last_cc = 0;
-             else
-               last_cc = COMBINING_CLASS (wc_buffer[i - 1]);
-
-             continue;
-           }
-
-         if (cc == 0)
-           last_start = i;
-
-         last_cc = cc;
-       }
-    }
-
-  wc_buffer[n_wc] = 0;
-
-  return wc_buffer;
-}
-
-/*
- * g_utf8_normalize:
- * @str: a UTF-8 encoded string.
- * @len: length of @str, in bytes, or -1 if @str is nul-terminated.
- * @mode: the type of normalization to perform.
- *
- * Converts a string into canonical form, standardizing
- * such issues as whether a character with an accent
- * is represented as a base character and combining
- * accent or as a single precomposed character. You
- * should generally call g_utf8_normalize() before
- * comparing two Unicode strings.
- *
- * The normalization mode %G_NORMALIZE_DEFAULT only
- * standardizes differences that do not affect the
- * text content, such as the above-mentioned accent
- * representation. %G_NORMALIZE_ALL also standardizes
- * the "compatibility" characters in Unicode, such
- * as SUPERSCRIPT THREE to the standard forms
- * (in this case DIGIT THREE). Formatting information
- * may be lost but for most text operations such
- * characters should be considered the same.
- * For example, g_utf8_collate() normalizes
- * with %G_NORMALIZE_ALL as its first step.
- *
- * %G_NORMALIZE_DEFAULT_COMPOSE and %G_NORMALIZE_ALL_COMPOSE
- * are like %G_NORMALIZE_DEFAULT and %G_NORMALIZE_ALL,
- * but returned a result with composed forms rather
- * than a maximally decomposed form. This is often
- * useful if you intend to convert the string to
- * a legacy encoding or pass it to a system with
- * less capable Unicode handling.
- *
- * Return value: a newly allocated string, that is the
- *   normalized form of @str.
- **/
-static gchar *
-g_utf8_normalize (const gchar * str, gssize len, GNormalizeMode mode)
-{
-  gunichar *result_wc = _g_utf8_normalize_wc (str, len, mode);
-  gchar *result;
-
-  result = g_ucs4_to_utf8 (result_wc, -1, NULL, NULL, NULL);
-  g_free (result_wc);
-
-  return result;
-}
-
-/* Public Libidn API starts here. */
-
-/**
- * stringprep_utf8_to_unichar:
- * @p: a pointer to Unicode character encoded as UTF-8
- *
- * Converts a sequence of bytes encoded as UTF-8 to a Unicode character.
- * If @p does not point to a valid UTF-8 encoded character, results are
- * undefined.
- *
- * Return value: the resulting character.
- **/
-uint32_t
-stringprep_utf8_to_unichar (const char *p)
-{
-  return g_utf8_get_char (p);
-}
-
-/**
- * stringprep_unichar_to_utf8:
- * @c: a ISO10646 character code
- * @outbuf: output buffer, must have at least 6 bytes of space.
- *       If %NULL, the length will be computed and returned
- *       and nothing will be written to @outbuf.
- *
- * Converts a single character to UTF-8.
- *
- * Return value: number of bytes written.
- **/
-int
-stringprep_unichar_to_utf8 (uint32_t c, char *outbuf)
-{
-  return g_unichar_to_utf8 (c, outbuf);
-}
-
-/**
- * stringprep_utf8_to_ucs4:
- * @str: a UTF-8 encoded string
- * @len: the maximum length of @str to use. If @len < 0, then
- *       the string is nul-terminated.
- * @items_written: location to store the number of characters in the
- *                 result, or %NULL.
- *
- * Convert a string from UTF-8 to a 32-bit fixed width
- * representation as UCS-4, assuming valid UTF-8 input.
- * This function does no error checking on the input.
- *
- * Return value: a pointer to a newly allocated UCS-4 string.
- *               This value must be freed with free().
- **/
-uint32_t *
-stringprep_utf8_to_ucs4 (const char *str, ssize_t len, size_t * items_written)
-{
-  return g_utf8_to_ucs4_fast (str, (glong) len, (glong *) items_written);
-}
-
-/**
- * stringprep_ucs4_to_utf8:
- * @str: a UCS-4 encoded string
- * @len: the maximum length of @str to use. If @len < 0, then
- *       the string is terminated with a 0 character.
- * @items_read: location to store number of characters read read, or %NULL.
- * @items_written: location to store number of bytes written or %NULL.
- *                 The value here stored does not include the trailing 0
- *                 byte.
- *
- * Convert a string from a 32-bit fixed width representation as UCS-4.
- * to UTF-8. The result will be terminated with a 0 byte.
- *
- * Return value: a pointer to a newly allocated UTF-8 string.
- *               This value must be freed with free(). If an
- *               error occurs, %NULL will be returned and
- *               @error set.
- **/
-char *
-stringprep_ucs4_to_utf8 (const uint32_t * str, ssize_t len,
-                        size_t * items_read, size_t * items_written)
-{
-  return g_ucs4_to_utf8 (str, len, (glong *) items_read,
-                        (glong *) items_written, NULL);
-}
-
-/**
- * stringprep_utf8_nfkc_normalize:
- * @str: a UTF-8 encoded string.
- * @len: length of @str, in bytes, or -1 if @str is nul-terminated.
- *
- * Converts a string into canonical form, standardizing
- * such issues as whether a character with an accent
- * is represented as a base character and combining
- * accent or as a single precomposed character.
- *
- * The normalization mode is NFKC (ALL COMPOSE).  It standardizes
- * differences that do not affect the text content, such as the
- * above-mentioned accent representation. It standardizes the
- * "compatibility" characters in Unicode, such as SUPERSCRIPT THREE to
- * the standard forms (in this case DIGIT THREE). Formatting
- * information may be lost but for most text operations such
- * characters should be considered the same. It returns a result with
- * composed forms rather than a maximally decomposed form.
- *
- * Return value: a newly allocated string, that is the
- *   NFKC normalized form of @str.
- **/
-char *
-stringprep_utf8_nfkc_normalize (const char *str, ssize_t len)
-{
-  return g_utf8_normalize (str, len, G_NORMALIZE_NFKC);
-}
-
-/**
- * stringprep_ucs4_nfkc_normalize:
- * @str: a Unicode string.
- * @len: length of @str array, or -1 if @str is nul-terminated.
- *
- * Converts UCS4 string into UTF-8 and runs
- * stringprep_utf8_nfkc_normalize().
- *
- * Return value: a newly allocated Unicode string, that is the NFKC
- *   normalized form of @str.
- **/
-uint32_t *
-stringprep_ucs4_nfkc_normalize (uint32_t * str, ssize_t len)
-{
-  char *p;
-  uint32_t *result_wc;
-
-  p = stringprep_ucs4_to_utf8 (str, len, 0, 0);
-  result_wc = _g_utf8_normalize_wc (p, -1, G_NORMALIZE_NFKC);
-  free (p);
-
-  return result_wc;
-}
diff --git a/lib/contrib/regexpr.c b/lib/contrib/regexpr.c
deleted file mode 100644 (file)
index 65917bc..0000000
+++ /dev/null
@@ -1,1722 +0,0 @@
-/*
-
-regexpr.c
-
-Author: Tatu Ylonen <ylo@ngs.fi>
-
-Copyright (c) 1991 Tatu Ylonen, Espoo, Finland
-
-Permission to use, copy, modify, distribute, and sell this software
-and its documentation is hereby granted without fee, provided that the
-above copyright notice appears in all source code copies, the name of
-Tatu Ylonen is not used to advertise products containing this software
-or a derivation thereof, and all modified versions are clearly marked
-as such.
-
-This software is provided "as is" without express or implied warranty.
-
-Created: Thu Sep 26 17:14:05 1991 ylo
-Last modified: Sun Mar 29 16:47:31 1992 ylo
-
-This code draws many ideas from the regular expression packages by
-Henry Spencer of the University of Toronto and Richard Stallman of the
-Free Software Foundation.
-
-Emacs-specific code and syntax table code is almost directly borrowed
-from GNU regexp.
-
-$Id$
-
-*/
-
-#include "silc.h"
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <stdarg.h>
-#include <ctype.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <time.h>
-
-#include <stdio.h>
-#include <assert.h>
-#include "regexpr.h"
-
-#define MACRO_BEGIN do {
-#define MACRO_END } while (0)
-
-enum regexp_compiled_ops /* opcodes for compiled regexp */
-{
-  Cend,                        /* end of pattern reached */
-  Cbol,                        /* beginning of line */
-  Ceol,                        /* end of line */
-  Cset,                        /* character set.  Followed by 32 bytes of set. */
-  Cexact,              /* followed by a byte to match */
-  Canychar,            /* matches any character except newline */
-  Cstart_memory,       /* set register start addr (followed by reg number) */
-  Cend_memory,         /* set register end addr (followed by reg number) */
-  Cmatch_memory,       /* match a duplicate of reg contents (regnum follows)*/
-  Cjump,               /* followed by two bytes (lsb,msb) of displacement. */
-  Cstar_jump,          /* will change to jump/update_failure_jump at runtime */
-  Cfailure_jump,       /* jump to addr on failure */
-  Cupdate_failure_jump,        /* update topmost failure point and jump */
-  Cdummy_failure_jump, /* push a dummy failure point and jump */
-  Cbegbuf,             /* match at beginning of buffer */
-  Cendbuf,             /* match at end of buffer */
-  Cwordbeg,            /* match at beginning of word */
-  Cwordend,            /* match at end of word */
-  Cwordbound,          /* match if at word boundary */
-  Cnotwordbound,       /* match if not at word boundary */
-#ifdef emacs
-  Cemacs_at_dot,       /* emacs only: matches at dot */
-#endif /* emacs */
-  Csyntaxspec,         /* matches syntax code (1 byte follows) */
-  Cnotsyntaxspec       /* matches if syntax code does not match (1 byte foll)*/
-};
-
-enum regexp_syntax_op  /* syntax codes for plain and quoted characters */
-{
-  Rend,                        /* special code for end of regexp */
-  Rnormal,             /* normal character */
-  Ranychar,            /* any character except newline */
-  Rquote,              /* the quote character */
-  Rbol,                        /* match beginning of line */
-  Reol,                        /* match end of line */
-  Roptional,           /* match preceding expression optionally */
-  Rstar,               /* match preceding expr zero or more times */
-  Rplus,               /* match preceding expr one or more times */
-  Ror,                 /* match either of alternatives */
-  Ropenpar,            /* opening parenthesis */
-  Rclosepar,           /* closing parenthesis */
-  Rmemory,             /* match memory register */
-  Rextended_memory,    /* \vnn to match registers 10-99 */
-  Ropenset,            /* open set.  Internal syntax hard-coded below. */
-  /* the following are gnu extensions to "normal" regexp syntax */
-  Rbegbuf,             /* beginning of buffer */
-  Rendbuf,             /* end of buffer */
-  Rwordchar,           /* word character */
-  Rnotwordchar,                /* not word character */
-  Rwordbeg,            /* beginning of word */
-  Rwordend,            /* end of word */
-  Rwordbound,          /* word bound */
-  Rnotwordbound,       /* not word bound */
-#ifdef emacs
-  Remacs_at_dot,       /* emacs: at dot */
-  Remacs_syntaxspec,   /* syntaxspec */
-  Remacs_notsyntaxspec,        /* notsyntaxspec */
-#endif /* emacs */
-  Rnum_ops
-};
-
-static int re_compile_initialized = 0;
-static int regexp_syntax = 0;
-static unsigned char regexp_plain_ops[256];
-static unsigned char regexp_quoted_ops[256];
-static unsigned char regexp_precedences[Rnum_ops];
-static int regexp_context_indep_ops;
-static int regexp_ansi_sequences;
-
-#define NUM_LEVELS  5    /* number of precedence levels in use */
-#define MAX_NESTING 100  /* max nesting level of operators */
-
-#ifdef emacs
-
-/* This code is for emacs compatibility only. */
-
-#include "config.h"
-#include "lisp.h"
-#include "buffer.h"
-#include "syntax.h"
-
-/* emacs defines NULL in some strange way? */
-#undef NULL
-#define NULL 0
-
-#else /* emacs */
-
-#define SYNTAX(ch) re_syntax_table[(unsigned char)(ch)]
-#define Sword 1
-
-#ifdef SYNTAX_TABLE
-char *re_syntax_table;
-#else
-static char re_syntax_table[256];
-#endif /* SYNTAX_TABLE */
-
-#endif /* emacs */
-
-static void re_compile_initialize()
-{
-  int a;
-  
-#if !defined(emacs) && !defined(SYNTAX_TABLE)
-  static int syntax_table_inited = 0;
-  
-  if (!syntax_table_inited)
-    {
-      syntax_table_inited = 1;
-      memset(re_syntax_table, 0, 256);
-      for (a = 'a'; a <= 'z'; a++)
-       re_syntax_table[a] = Sword;
-      for (a = 'A'; a <= 'Z'; a++)
-       re_syntax_table[a] = Sword;
-      for (a = '0'; a <= '9'; a++)
-       re_syntax_table[a] = Sword;
-    }
-#endif /* !emacs && !SYNTAX_TABLE */
-  re_compile_initialized = 1;
-  for (a = 0; a < 256; a++)
-    {
-      regexp_plain_ops[a] = Rnormal;
-      regexp_quoted_ops[a] = Rnormal;
-    }
-  for (a = '0'; a <= '9'; a++)
-    regexp_quoted_ops[a] = Rmemory;
-  regexp_plain_ops['\134'] = Rquote;
-  if (regexp_syntax & RE_NO_BK_PARENS)
-    {
-      regexp_plain_ops['('] = Ropenpar;
-      regexp_plain_ops[')'] = Rclosepar;
-    }
-  else
-    {
-      regexp_quoted_ops['('] = Ropenpar;
-      regexp_quoted_ops[')'] = Rclosepar;
-    }
-  if (regexp_syntax & RE_NO_BK_VBAR)
-    regexp_plain_ops['\174'] = Ror;
-  else
-    regexp_quoted_ops['\174'] = Ror;
-  regexp_plain_ops['*'] = Rstar;
-  if (regexp_syntax & RE_BK_PLUS_QM)
-    {
-      regexp_quoted_ops['+'] = Rplus;
-      regexp_quoted_ops['?'] = Roptional;
-    }
-  else
-    {
-      regexp_plain_ops['+'] = Rplus;
-      regexp_plain_ops['?'] = Roptional;
-    }
-  if (regexp_syntax & RE_NEWLINE_OR)
-    regexp_plain_ops['\n'] = Ror;
-  regexp_plain_ops['\133'] = Ropenset;
-  regexp_plain_ops['\136'] = Rbol;
-  regexp_plain_ops['$'] = Reol;
-  regexp_plain_ops['.'] = Ranychar;
-  if (!(regexp_syntax & RE_NO_GNU_EXTENSIONS))
-    {
-#ifdef emacs
-      regexp_quoted_ops['='] = Remacs_at_dot;
-      regexp_quoted_ops['s'] = Remacs_syntaxspec;
-      regexp_quoted_ops['S'] = Remacs_notsyntaxspec;
-#endif /* emacs */
-      regexp_quoted_ops['w'] = Rwordchar;
-      regexp_quoted_ops['W'] = Rnotwordchar;
-      regexp_quoted_ops['<'] = Rwordbeg;
-      regexp_quoted_ops['>'] = Rwordend;
-      regexp_quoted_ops['b'] = Rwordbound;
-      regexp_quoted_ops['B'] = Rnotwordbound;
-      regexp_quoted_ops['`'] = Rbegbuf;
-      regexp_quoted_ops['\''] = Rendbuf;
-    }
-  if (regexp_syntax & RE_ANSI_HEX)
-    regexp_quoted_ops['v'] = Rextended_memory;
-  for (a = 0; a < Rnum_ops; a++)
-    regexp_precedences[a] = 4;
-  if (regexp_syntax & RE_TIGHT_VBAR)
-    {
-      regexp_precedences[Ror] = 3;
-      regexp_precedences[Rbol] = 2;
-      regexp_precedences[Reol] = 2;
-    }
-  else
-    {
-      regexp_precedences[Ror] = 2;
-      regexp_precedences[Rbol] = 3;
-      regexp_precedences[Reol] = 3;
-    }
-  regexp_precedences[Rclosepar] = 1;
-  regexp_precedences[Rend] = 0;
-  regexp_context_indep_ops = (regexp_syntax & RE_CONTEXT_INDEP_OPS) != 0;
-  regexp_ansi_sequences = (regexp_syntax & RE_ANSI_HEX) != 0;
-}
-
-int re_set_syntax(syntax)
-int syntax;
-{
-  int ret;
-
-  ret = regexp_syntax;
-  regexp_syntax = syntax;
-  re_compile_initialize();
-  return ret;
-}
-
-static int hex_char_to_decimal(ch)
-int ch;
-{
-  if (ch >= '0' && ch <= '9')
-    return ch - '0';
-  if (ch >= 'a' && ch <= 'f')
-    return ch - 'a' + 10;
-  if (ch >= 'A' && ch <= 'F')
-    return ch - 'A' + 10;
-  return 16;
-}
-
-char *re_compile_pattern(regex, size, bufp)
-char *regex;
-int size;
-regexp_t bufp;
-{
-  int a, pos, op, current_level, level, opcode;
-  int pattern_offset = 0, alloc;
-  int starts[NUM_LEVELS * MAX_NESTING], starts_base;
-  int future_jumps[MAX_NESTING], num_jumps;
-  unsigned char ch = 0;
-  char *pattern, *translate;
-  int next_register, paren_depth, num_open_registers, open_registers[RE_NREGS];
-  int beginning_context;
-
-#define NEXTCHAR(var)                  \
-  MACRO_BEGIN                          \
-    if (pos >= size)                   \
-      goto ends_prematurely;           \
-    (var) = regex[pos];                        \
-    pos++;                             \
-  MACRO_END
-
-#define ALLOC(amount)                          \
-  MACRO_BEGIN                                  \
-    if (pattern_offset+(amount) > alloc)       \
-      {                                                \
-       alloc += 256 + (amount);                \
-       pattern = realloc(pattern, alloc);      \
-       if (!pattern)                           \
-         goto out_of_memory;                   \
-      }                                                \
-  MACRO_END
-
-#define STORE(ch) pattern[pattern_offset++] = (ch)
-
-#define CURRENT_LEVEL_START (starts[starts_base + current_level])
-
-#define SET_LEVEL_START starts[starts_base + current_level] = pattern_offset
-
-#define PUSH_LEVEL_STARTS if (starts_base < (MAX_NESTING-1)*NUM_LEVELS) \
-                           starts_base += NUM_LEVELS;                  \
-                          else                                         \
-                           goto too_complex
-
-#define POP_LEVEL_STARTS starts_base -= NUM_LEVELS
-
-#define PUT_ADDR(offset,addr)                          \
-  MACRO_BEGIN                                          \
-    int disp = (addr) - (offset) - 2;                  \
-    pattern[(offset)] = disp & 0xff;                   \
-    pattern[(offset)+1] = (disp>>8) & 0xff;            \
-  MACRO_END
-
-#define INSERT_JUMP(pos,type,addr)                     \
-  MACRO_BEGIN                                          \
-    int a, p = (pos), t = (type), ad = (addr);         \
-    for (a = pattern_offset - 1; a >= p; a--)          \
-      pattern[a + 3] = pattern[a];                     \
-    pattern[p] = t;                                    \
-    PUT_ADDR(p+1,ad);                                  \
-    pattern_offset += 3;                               \
-  MACRO_END
-
-#define SETBIT(buf,offset,bit) (buf)[(offset)+(bit)/8] |= (1<<((bit) & 7))
-
-#define SET_FIELDS                             \
-  MACRO_BEGIN                                  \
-    bufp->allocated = alloc;                   \
-    bufp->buffer = pattern;                    \
-    bufp->used = pattern_offset;               \
-  MACRO_END
-    
-#define GETHEX(var)                                            \
-  MACRO_BEGIN                                                  \
-    char gethex_ch, gethex_value;                              \
-    NEXTCHAR(gethex_ch);                                       \
-    gethex_value = hex_char_to_decimal(gethex_ch);             \
-    if (gethex_value == 16)                                    \
-      goto hex_error;                                          \
-    NEXTCHAR(gethex_ch);                                       \
-    gethex_ch = hex_char_to_decimal(gethex_ch);                        \
-    if (gethex_ch == 16)                                       \
-      goto hex_error;                                          \
-    (var) = gethex_value * 16 + gethex_ch;                     \
-  MACRO_END
-
-#define ANSI_TRANSLATE(ch)                             \
-  MACRO_BEGIN                                          \
-    switch (ch)                                                \
-      {                                                        \
-      case 'a':                                                \
-      case 'A':                                                \
-       ch = 7; /* audible bell */                      \
-       break;                                          \
-      case 'b':                                                \
-      case 'B':                                                \
-       ch = 8; /* backspace */                         \
-       break;                                          \
-      case 'f':                                                \
-      case 'F':                                                \
-       ch = 12; /* form feed */                        \
-       break;                                          \
-      case 'n':                                                \
-      case 'N':                                                \
-       ch = 10; /* line feed */                        \
-       break;                                          \
-      case 'r':                                                \
-      case 'R':                                                \
-       ch = 13; /* carriage return */                  \
-       break;                                          \
-      case 't':                                                \
-      case 'T':                                                \
-       ch = 9; /* tab */                               \
-       break;                                          \
-      case 'v':                                                \
-      case 'V':                                                \
-       ch = 11; /* vertical tab */                     \
-       break;                                          \
-      case 'x': /* hex code */                         \
-      case 'X':                                                \
-       GETHEX(ch);                                     \
-       break;                                          \
-      default:                                         \
-       /* other characters passed through */           \
-       if (translate)                                  \
-         ch = translate[(unsigned char)ch];            \
-       break;                                          \
-      }                                                        \
-  MACRO_END
-
-  if (!re_compile_initialized)
-    re_compile_initialize();
-  bufp->used = 0;
-  bufp->fastmap_accurate = 0;
-  bufp->uses_registers = 0;
-  translate = bufp->translate;
-  pattern = bufp->buffer;
-  alloc = bufp->allocated;
-  if (alloc == 0 || pattern == NULL)
-    {
-      alloc = 256;
-      pattern = malloc(alloc);
-      if (!pattern)
-       goto out_of_memory;
-    }
-  pattern_offset = 0;
-  starts_base = 0;
-  num_jumps = 0;
-  current_level = 0;
-  SET_LEVEL_START;
-  num_open_registers = 0;
-  next_register = 1;
-  paren_depth = 0;
-  beginning_context = 1;
-  op = -1;
-  /* we use Rend dummy to ensure that pending jumps are updated (due to
-     low priority of Rend) before exiting the loop. */
-  pos = 0;
-  while (op != Rend)
-    {
-      if (pos >= size)
-       op = Rend;
-      else
-       {
-         NEXTCHAR(ch);
-         if (translate)
-           ch = translate[(unsigned char)ch];
-         op = regexp_plain_ops[(unsigned char)ch];
-         if (op == Rquote)
-           {
-             NEXTCHAR(ch);
-             op = regexp_quoted_ops[(unsigned char)ch];
-             if (op == Rnormal && regexp_ansi_sequences)
-               ANSI_TRANSLATE(ch);
-           }
-       }
-      level = regexp_precedences[op];
-      /* printf("ch='%c' op=%d level=%d current_level=%d curlevstart=%d\n",
-            ch, op, level, current_level, CURRENT_LEVEL_START); */
-      if (level > current_level)
-       {
-         for (current_level++; current_level < level; current_level++)
-           SET_LEVEL_START;
-         SET_LEVEL_START;
-       }
-      else
-       if (level < current_level)
-         {
-           current_level = level;
-           for (;num_jumps > 0 &&
-                future_jumps[num_jumps-1] >= CURRENT_LEVEL_START;
-                num_jumps--)
-             PUT_ADDR(future_jumps[num_jumps-1], pattern_offset);
-         }
-      switch (op)
-       {
-       case Rend:
-         break;
-       case Rnormal:
-       normal_char:
-         opcode = Cexact;
-       store_opcode_and_arg: /* opcode & ch must be set */
-         SET_LEVEL_START;
-         ALLOC(2);
-         STORE(opcode);
-         STORE(ch);
-         break;
-       case Ranychar:
-         opcode = Canychar;
-       store_opcode:
-         SET_LEVEL_START;
-         ALLOC(1);
-         STORE(opcode);
-         break;
-       case Rquote:
-         abort();
-         /*NOTREACHED*/
-       case Rbol:
-         if (!beginning_context) {
-           if (regexp_context_indep_ops)
-             goto op_error;
-           else
-             goto normal_char;
-         }
-         opcode = Cbol;
-         goto store_opcode;
-       case Reol:
-         if (!((pos >= size) ||
-               ((regexp_syntax & RE_NO_BK_VBAR) ?
-                (regex[pos] == '\174') :
-                (pos+1 < size && regex[pos] == '\134' &&
-                 regex[pos+1] == '\174')) ||
-               ((regexp_syntax & RE_NO_BK_PARENS)?
-                (regex[pos] == ')'):
-                (pos+1 < size && regex[pos] == '\134' &&
-                 regex[pos+1] == ')')))) {
-           if (regexp_context_indep_ops)
-             goto op_error;
-           else
-             goto normal_char;
-         }
-         opcode = Ceol;
-         goto store_opcode;
-         break;
-       case Roptional:
-         if (beginning_context) {
-           if (regexp_context_indep_ops)
-             goto op_error;
-           else
-             goto normal_char;
-         }
-         if (CURRENT_LEVEL_START == pattern_offset)
-           break; /* ignore empty patterns for ? */
-         ALLOC(3);
-         INSERT_JUMP(CURRENT_LEVEL_START, Cfailure_jump,
-                     pattern_offset + 3);
-         break;
-       case Rstar:
-       case Rplus:
-         if (beginning_context) {
-           if (regexp_context_indep_ops)
-             goto op_error;
-           else
-             goto normal_char;
-         }
-         if (CURRENT_LEVEL_START == pattern_offset)
-           break; /* ignore empty patterns for + and * */
-         ALLOC(9);
-         INSERT_JUMP(CURRENT_LEVEL_START, Cfailure_jump,
-                     pattern_offset + 6);
-         INSERT_JUMP(pattern_offset, Cstar_jump, CURRENT_LEVEL_START);
-         if (op == Rplus)  /* jump over initial failure_jump */
-           INSERT_JUMP(CURRENT_LEVEL_START, Cdummy_failure_jump,
-                       CURRENT_LEVEL_START + 6);
-         break;
-       case Ror:
-         ALLOC(6);
-         INSERT_JUMP(CURRENT_LEVEL_START, Cfailure_jump,
-                     pattern_offset + 6);
-         if (num_jumps >= MAX_NESTING)
-           goto too_complex;
-         STORE(Cjump);
-         future_jumps[num_jumps++] = pattern_offset;
-         STORE(0);
-         STORE(0);
-         SET_LEVEL_START;
-         break;
-       case Ropenpar:
-         SET_LEVEL_START;
-         if (next_register < RE_NREGS)
-           {
-             bufp->uses_registers = 1;
-             ALLOC(2);
-             STORE(Cstart_memory);
-             STORE(next_register);
-             open_registers[num_open_registers++] = next_register;
-             next_register++;
-           }
-         paren_depth++;
-         PUSH_LEVEL_STARTS;
-         current_level = 0;
-         SET_LEVEL_START;
-         break;
-       case Rclosepar:
-         if (paren_depth <= 0)
-           goto parenthesis_error;
-         POP_LEVEL_STARTS;
-         current_level = regexp_precedences[Ropenpar];
-         paren_depth--;
-         if (paren_depth < num_open_registers)
-           {
-             bufp->uses_registers = 1;
-             ALLOC(2);
-             STORE(Cend_memory);
-             num_open_registers--;
-             STORE(open_registers[num_open_registers]);
-           }
-         break;
-       case Rmemory:
-         if (ch == '0')
-           goto bad_match_register;
-         assert(ch >= '0' && ch <= '9');
-         bufp->uses_registers = 1;
-         opcode = Cmatch_memory;
-         ch -= '0';
-         goto store_opcode_and_arg;
-       case Rextended_memory:
-         NEXTCHAR(ch);
-         if (ch < '0' || ch > '9')
-           goto bad_match_register;
-         NEXTCHAR(a);
-         if (a < '0' || a > '9')
-           goto bad_match_register;
-         ch = 10 * (a - '0') + ch - '0';
-         if (ch <= 0 || ch >= RE_NREGS)
-           goto bad_match_register;
-         bufp->uses_registers = 1;
-         opcode = Cmatch_memory;
-         goto store_opcode_and_arg;
-       case Ropenset:
-         {
-           int complement,prev,offset,range,firstchar;
-           
-           SET_LEVEL_START;
-           ALLOC(1+256/8);
-           STORE(Cset);
-           offset = pattern_offset;
-           for (a = 0; a < 256/8; a++)
-             STORE(0);
-           NEXTCHAR(ch);
-           if (translate)
-             ch = translate[(unsigned char)ch];
-           if (ch == '\136')
-             {
-               complement = 1;
-               NEXTCHAR(ch);
-               if (translate)
-                 ch = translate[(unsigned char)ch];
-             }
-           else
-             complement = 0;
-           prev = -1;
-           range = 0;
-           firstchar = 1;
-           while (ch != '\135' || firstchar)
-             {
-               firstchar = 0;
-               if (regexp_ansi_sequences && ch == '\134')
-                 {
-                   NEXTCHAR(ch);
-                   ANSI_TRANSLATE(ch);
-                 }
-               if (range)
-                 {
-                   for (a = prev; a <= ch; a++)
-                     SETBIT(pattern, offset, a);
-                   prev = -1;
-                   range = 0;
-                 }
-               else
-                 if (prev != -1 && ch == '-')
-                   range = 1;
-                 else
-                   {
-                     SETBIT(pattern, offset, ch);
-                     prev = ch;
-                   }
-               NEXTCHAR(ch);
-               if (translate)
-                 ch = translate[(unsigned char)ch];
-             }
-           if (range)
-             SETBIT(pattern, offset, '-');
-           if (complement)
-             {
-               for (a = 0; a < 256/8; a++)
-                 pattern[offset+a] ^= 0xff;
-             }
-           break;
-         }
-       case Rbegbuf:
-         opcode = Cbegbuf;
-         goto store_opcode;
-       case Rendbuf:
-         opcode = Cendbuf;
-         goto store_opcode;
-       case Rwordchar:
-         opcode = Csyntaxspec;
-         ch = Sword;
-         goto store_opcode_and_arg;
-       case Rnotwordchar:
-         opcode = Cnotsyntaxspec;
-         ch = Sword;
-         goto store_opcode_and_arg;
-       case Rwordbeg:
-         opcode = Cwordbeg;
-         goto store_opcode;
-       case Rwordend:
-         opcode = Cwordend;
-         goto store_opcode;
-       case Rwordbound:
-         opcode = Cwordbound;
-         goto store_opcode;
-       case Rnotwordbound:
-         opcode = Cnotwordbound;
-         goto store_opcode;
-#ifdef emacs
-       case Remacs_at_dot:
-         opcode = Cemacs_at_dot;
-         goto store_opcode;
-       case Remacs_syntaxspec:
-         NEXTCHAR(ch);
-         if (translate)
-           ch = translate[(unsigned char)ch];
-         opcode = Csyntaxspec;
-         ch = syntax_spec_code[(unsigned char)ch];
-         goto store_opcode_and_arg;
-       case Remacs_notsyntaxspec:
-         NEXTCHAR(ch);
-         if (translate)
-           ch = translate[(unsigned char)ch];
-         opcode = Cnotsyntaxspec;
-         ch = syntax_spec_code[(unsigned char)ch];
-         goto store_opcode_and_arg;
-#endif /* emacs */
-       default:
-         abort();
-       }
-      beginning_context = (op == Ropenpar || op == Ror);
-    }
-  if (starts_base != 0)
-    goto parenthesis_error;
-  assert(num_jumps == 0);
-  ALLOC(1);
-  STORE(Cend);
-  SET_FIELDS;
-  return NULL;
-
- op_error:
-  SET_FIELDS;
-  return "Badly placed special character";
-
- bad_match_register:
-  SET_FIELDS;
-  return "Bad match register number";
-
- hex_error:
-  SET_FIELDS;
-  return "Bad hexadecimal number";
-
- parenthesis_error:
-  SET_FIELDS;
-  return "Badly placed parenthesis";
-
- out_of_memory:
-  SET_FIELDS;
-  return "Out of memory";
-
- ends_prematurely:
-  SET_FIELDS;
-  return "Regular expression ends prematurely";
-
- too_complex:
-  SET_FIELDS;
-  return "Regular expression too complex";
-}
-#undef CHARAT
-#undef NEXTCHAR
-#undef GETHEX
-#undef ALLOC
-#undef STORE
-#undef CURRENT_LEVEL_START
-#undef SET_LEVEL_START
-#undef PUSH_LEVEL_STARTS
-#undef POP_LEVEL_STARTS
-#undef PUT_ADDR
-#undef INSERT_JUMP
-#undef SETBIT
-#undef SET_FIELDS
-
-static void re_compile_fastmap_aux(code, pos, visited, can_be_null, fastmap)
-char *code, *visited, *can_be_null, *fastmap;
-int pos;
-{
-  int a, b, syntaxcode;
-
-  if (visited[pos])
-    return;  /* we have already been here */
-  visited[pos] = 1;
-  for (;;)
-    switch (code[pos++])
-      {
-      case Cend:
-       *can_be_null = 1;
-       return;
-      case Cbol:
-      case Cbegbuf:
-      case Cendbuf:
-      case Cwordbeg:
-      case Cwordend:
-      case Cwordbound:
-      case Cnotwordbound:
-#ifdef emacs
-      case Cemacs_at_dot:
-#endif /* emacs */
-       break;
-      case Csyntaxspec:
-       syntaxcode = code[pos++];
-       for (a = 0; a < 256; a++)
-         if (SYNTAX(a) == syntaxcode)
-           fastmap[a] = 1;
-       return;
-      case Cnotsyntaxspec:
-       syntaxcode = code[pos++];
-       for (a = 0; a < 256; a++)
-         if (SYNTAX(a) != syntaxcode)
-           fastmap[a] = 1;
-       return;
-      case Ceol:
-       fastmap['\n'] = 1;
-       if (*can_be_null == 0)
-         *can_be_null = 2;  /* can match null, but only at end of buffer*/
-       return;
-      case Cset:
-       for (a = 0; a < 256/8; a++)
-         if (code[pos + a] != 0)
-           for (b = 0; b < 8; b++)
-             if (code[pos + a] & (1 << b))
-               fastmap[(a << 3) + b] = 1;
-       pos += 256/8;
-       return;
-      case Cexact:
-       fastmap[(unsigned char)code[pos]] = 1;
-       return;
-      case Canychar:
-       for (a = 0; a < 256; a++)
-         if (a != '\n')
-           fastmap[a] = 1;
-       return;
-      case Cstart_memory:
-      case Cend_memory:
-       pos++;
-       break;
-      case Cmatch_memory:
-       for (a = 0; a < 256; a++)
-         fastmap[a] = 1;
-       *can_be_null = 1;
-       return;
-      case Cjump:
-      case Cdummy_failure_jump:
-      case Cupdate_failure_jump:
-      case Cstar_jump:
-       a = (unsigned char)code[pos++];
-       a |= (unsigned char)code[pos++] << 8;
-       pos += (int)(short)a;
-       if (visited[pos])
-         {
-           /* argh... the regexp contains empty loops.  This is not
-              good, as this may cause a failure stack overflow when
-              matching.  Oh well. */
-           /* this path leads nowhere; pursue other paths. */
-           return;
-         }
-       visited[pos] = 1;
-       break;
-      case Cfailure_jump:
-       a = (unsigned char)code[pos++];
-       a |= (unsigned char)code[pos++] << 8;
-       a = pos + (int)(short)a;
-       re_compile_fastmap_aux(code, a, visited, can_be_null, fastmap);
-       break;
-      default:
-       abort();  /* probably some opcode is missing from this switch */
-       /*NOTREACHED*/
-      }
-}
-
-static int re_do_compile_fastmap(buffer, used, pos, can_be_null, fastmap)
-char *buffer, *fastmap, *can_be_null;
-int used, pos;
-{
-  char small_visited[512], *visited;
-
-  if (used <= sizeof(small_visited))
-    visited = small_visited;
-  else
-    {
-      visited = malloc(used);
-      if (!visited)
-       return 0;
-    }
-  *can_be_null = 0;
-  memset(fastmap, 0, 256);
-  memset(visited, 0, used);
-  re_compile_fastmap_aux(buffer, pos, visited, can_be_null, fastmap);
-  if (visited != small_visited)
-    free(visited);
-  return 1;
-}
-
-void re_compile_fastmap(bufp)
-regexp_t bufp;
-{
-  if (!bufp->fastmap || bufp->fastmap_accurate)
-    return;
-  assert(bufp->used > 0);
-  if (!re_do_compile_fastmap(bufp->buffer, bufp->used, 0, &bufp->can_be_null,
-                            bufp->fastmap))
-    return;
-  if (bufp->buffer[0] == Cbol)
-    bufp->anchor = 1;   /* begline */
-  else
-    if (bufp->buffer[0] == Cbegbuf)
-      bufp->anchor = 2; /* begbuf */
-    else
-      bufp->anchor = 0; /* none */
-  bufp->fastmap_accurate = 1;
-}
-
-#define INITIAL_FAILURES  128  /* initial # failure points to allocate */
-#define MAX_FAILURES     4100  /* max # of failure points before failing */
-
-int re_match_2(bufp, string1, size1, string2, size2, pos, regs, mstop)
-regexp_t bufp;
-char *string1, *string2;
-int size1, size2, pos, mstop;
-regexp_registers_t regs;
-{
-  struct failure_point { char *text, *partend, *code; }
-    *failure_stack_start, *failure_sp, *failure_stack_end,
-    initial_failure_stack[INITIAL_FAILURES];
-  char *code, *translate, *text, *textend, *partend, *part_2_end;
-  char *regstart_text[RE_NREGS], *regstart_partend[RE_NREGS];
-  char *regend_text[RE_NREGS], *regend_partend[RE_NREGS];
-  int a, b, ch, reg, regch, match_end;
-  char *regtext, *regpartend, *regtextend;
-
-#define PREFETCH                                       \
-  MACRO_BEGIN                                          \
-    if (text == partend)                               \
-      {                                                        \
-       if (text == textend)                            \
-         goto fail;                                    \
-       text = string2;                                 \
-       partend = part_2_end;                           \
-      }                                                        \
-  MACRO_END
-
-#define NEXTCHAR(var)                          \
-  MACRO_BEGIN                                  \
-    PREFETCH;                                  \
-    (var) = (unsigned char)*text++;            \
-    if (translate)                             \
-      (var) = (unsigned char)translate[(var)]; \
-  MACRO_END
-
-  assert(pos >= 0 && size1 >= 0 && size2 >= 0 && mstop >= 0);
-  assert(mstop <= size1 + size2);
-  assert(pos <= mstop);
-
-  if (pos <= size1)
-    {
-      text = string1 + pos;
-      if (mstop <= size1)
-       {
-         partend = string1 + mstop;
-         textend = partend;
-       }
-      else
-       {
-         partend = string1 + size1;
-         textend = string2 + mstop - size1;
-       }
-      part_2_end = string2 + mstop - size1;
-    }
-  else
-    {
-      text = string2 + pos - size1;
-      partend = string2 + mstop - size1;
-      textend = partend;
-      part_2_end = partend;
-    }
-
-  if (bufp->uses_registers && regs != NULL)
-    for (a = 0; a < RE_NREGS; a++)
-      regend_text[a] = NULL;
-
-  code = bufp->buffer;
-  translate = bufp->translate;
-  failure_stack_start = failure_sp = initial_failure_stack;
-  failure_stack_end = initial_failure_stack + INITIAL_FAILURES;
-
-#if 0
-  /* re_search_2 has already done this, and otherwise we get little benefit
-     from this.  So I'll leave this out. */
-  if (bufp->fastmap_accurate && !bufp->can_be_null &&
-      text != textend &&
-      !bufp->fastmap[translate ?
-                    (unsigned char)translate[(unsigned char)*text] :
-                    (unsigned char)*text])
-    return -1;  /* it can't possibly match */
-#endif
-
- continue_matching:
-  for (;;)
-    {
-      switch (*code++)
-       {
-       case Cend:
-         if (partend != part_2_end)
-           match_end = text - string1;
-         else
-           match_end = text - string2 + size1;
-         if (regs)
-           {
-             regs->start[0] = pos;
-             regs->end[0] = match_end;
-             if (!bufp->uses_registers)
-               {
-                 for (a = 1; a < RE_NREGS; a++)
-                   {
-                     regs->start[a] = -1;
-                     regs->end[a] = -1;
-                   }
-               }
-             else
-               {
-                 for (a = 1; a < RE_NREGS; a++)
-                   {
-                     if (regend_text[a] == NULL)
-                       {
-                         regs->start[a] = -1;
-                         regs->end[a] = -1;
-                         continue;
-                       }
-                     if (regstart_partend[a] != part_2_end)
-                       regs->start[a] = regstart_text[a] - string1;
-                     else
-                       regs->start[a] = regstart_text[a] - string2 + size1;
-                     if (regend_partend[a] != part_2_end)
-                       regs->end[a] = regend_text[a] - string1;
-                     else
-                       regs->end[a] = regend_text[a] - string2 + size1;
-                   }
-               }
-           }
-         if (failure_stack_start != initial_failure_stack)
-           free((char *)failure_stack_start);
-         return match_end - pos;
-       case Cbol:
-         if (text == string1 || text[-1] == '\n') /* text[-1] always valid */
-           break;
-         goto fail;
-       case Ceol:
-         if (text == string2 + size2 ||
-             (text == string1 + size1 ?
-              (size2 == 0 || *string2 == '\n') :
-              *text == '\n'))
-           break;
-         goto fail;
-       case Cset:
-         NEXTCHAR(ch);
-         if (code[ch/8] & (1<<(ch & 7)))
-           {
-             code += 256/8;
-             break;
-           }
-         goto fail;
-       case Cexact:
-         NEXTCHAR(ch);
-         if (ch != (unsigned char)*code++)
-           goto fail;
-         break;
-       case Canychar:
-         NEXTCHAR(ch);
-         if (ch == '\n')
-           goto fail;
-         break;
-       case Cstart_memory:
-         reg = *code++;
-         regstart_text[reg] = text;
-         regstart_partend[reg] = partend;
-         break;
-       case Cend_memory:
-         reg = *code++;
-         regend_text[reg] = text;
-         regend_partend[reg] = partend;
-         break;
-       case Cmatch_memory:
-         reg = *code++;
-         if (regend_text[reg] == NULL)
-           goto fail;  /* or should we just match nothing? */
-         regtext = regstart_text[reg];
-         regtextend = regend_text[reg];
-         if (regstart_partend[reg] == regend_partend[reg])
-           regpartend = regtextend;
-         else
-           regpartend = string1 + size1;
-         
-         for (;regtext != regtextend;)
-           {
-             NEXTCHAR(ch);
-             if (regtext == regpartend)
-               regtext = string2;
-             regch = (unsigned char)*regtext++;
-             if (translate)
-               regch = (unsigned char)translate[regch];
-             if (regch != ch)
-               goto fail;
-           }
-         break;
-       case Cstar_jump:
-         /* star is coded as:
-              1: failure_jump 2
-                 ... code for operand of star
-                 star_jump 1
-              2: ... code after star
-            We change the star_jump to update_failure_jump if we can determine
-            that it is safe to do so; otherwise we change it to an ordinary
-            jump.
-            plus is coded as
-                 jump 2
-              1: failure_jump 3
-              2: ... code for operand of plus
-                 star_jump 1
-              3: ... code after plus
-            For star_jump considerations this is processed identically
-            to star. */
-         a = (unsigned char)*code++;
-         a |= (unsigned char)*code++ << 8;
-         a = (int)(short)a;
-         {
-           char map[256], can_be_null;
-           char *p1, *p2;
-
-           p1 = code + a + 3; /* skip the failure_jump */
-           assert(p1[-3] == Cfailure_jump);
-           p2 = code;
-           /* p1 points inside loop, p2 points to after loop */
-           if (!re_do_compile_fastmap(bufp->buffer, bufp->used,
-                                      p2 - bufp->buffer, &can_be_null, map))
-             goto make_normal_jump;
-           /* If we might introduce a new update point inside the loop,
-              we can't optimize because then update_jump would update a
-              wrong failure point.  Thus we have to be quite careful here. */
-         loop_p1:
-           /* loop until we find something that consumes a character */
-           switch (*p1++)
-             {
-              case Cbol:
-              case Ceol:
-              case Cbegbuf:
-              case Cendbuf:
-              case Cwordbeg:
-              case Cwordend:
-              case Cwordbound:
-              case Cnotwordbound:
-#ifdef emacs
-              case Cemacs_at_dot:
-#endif /* emacs */
-                goto loop_p1;
-              case Cstart_memory:
-              case Cend_memory:
-                p1++;
-                goto loop_p1;
-             case Cexact:
-               ch = (unsigned char)*p1++;
-               if (map[ch])
-                 goto make_normal_jump;
-               break;
-             case Canychar:
-               for (b = 0; b < 256; b++)
-                 if (b != '\n' && map[b])
-                   goto make_normal_jump;
-               break;
-             case Cset:
-               for (b = 0; b < 256; b++)
-                 if ((p1[b >> 3] & (1 << (b & 7))) && map[b])
-                   goto make_normal_jump;
-               p1 += 256/8;
-               break;
-             default:
-               goto make_normal_jump;
-             }
-           /* now we know that we can't backtrack. */
-           while (p1 != p2 - 3)
-             {
-               switch (*p1++)
-                 {
-                 case Cend:
-                   abort();  /* we certainly shouldn't get this inside loop */
-                   /*NOTREACHED*/
-                 case Cbol:
-                 case Ceol:
-                 case Canychar:
-                 case Cbegbuf:
-                 case Cendbuf:
-                 case Cwordbeg:
-                 case Cwordend:
-                 case Cwordbound:
-                 case Cnotwordbound:
-#ifdef emacs
-                 case Cemacs_at_dot:
-#endif /* emacs */
-                   break;
-                 case Cset:
-                   p1 += 256/8;
-                   break;
-                 case Cexact:
-                 case Cstart_memory:
-                 case Cend_memory:
-                 case Cmatch_memory:
-                 case Csyntaxspec:
-                 case Cnotsyntaxspec:
-                   p1++;
-                   break;
-                 case Cjump:
-                 case Cstar_jump:
-                 case Cfailure_jump:
-                 case Cupdate_failure_jump:
-                 case Cdummy_failure_jump:
-                   goto make_normal_jump;
-                 default:
-                   printf("regexpr.c: processing star_jump: unknown op %d\n", p1[-1]);
-                   break;
-                 }
-             }
-           goto make_update_jump;
-         }
-       make_normal_jump:
-         /* printf("changing to normal jump\n"); */
-         code -= 3;
-         *code = Cjump;
-         break;
-       make_update_jump:
-         /* printf("changing to update jump\n"); */
-         code -= 2;
-         a += 3;  /* jump to after the Cfailure_jump */
-         code[-1] = Cupdate_failure_jump;
-         code[0] = a & 0xff;
-         code[1] = a >> 8;
-         /* fall to next case */
-       case Cupdate_failure_jump:
-         failure_sp[-1].text = text;
-         failure_sp[-1].partend = partend;
-         /* fall to next case */
-       case Cjump:
-         a = (unsigned char)*code++;
-         a |= (unsigned char)*code++ << 8;
-         code += (int)(short)a;
-         break;
-       case Cdummy_failure_jump:
-       case Cfailure_jump:
-         if (failure_sp == failure_stack_end)
-           {
-             if (failure_stack_start != initial_failure_stack)
-               goto error;
-             failure_stack_start = (struct failure_point *)
-               malloc(MAX_FAILURES * sizeof(*failure_stack_start));
-             failure_stack_end = failure_stack_start + MAX_FAILURES;
-             memcpy((char *)failure_stack_start, (char *)initial_failure_stack,
-                    INITIAL_FAILURES * sizeof(*failure_stack_start));
-             failure_sp = failure_stack_start + INITIAL_FAILURES;
-           }
-         a = (unsigned char)*code++;
-         a |= (unsigned char)*code++ << 8;
-         a = (int)(short)a;
-         if (code[-3] == Cdummy_failure_jump)
-           { /* this is only used in plus */
-             assert(*code == Cfailure_jump);
-             b = (unsigned char)code[1];
-             b |= (unsigned char)code[2] << 8;
-             failure_sp->code = code + (int)(short)b + 3;
-             failure_sp->text = NULL;
-             code += a;
-           }
-         else
-           {
-             failure_sp->code = code + a;
-             failure_sp->text = text;
-             failure_sp->partend = partend;
-           }
-         failure_sp++;
-         break;
-       case Cbegbuf:
-         if (text == string1)
-           break;
-         goto fail;
-       case Cendbuf:
-         if (size2 == 0 ? text == string1 + size1 : text == string2 + size2)
-           break;
-         goto fail;
-       case Cwordbeg:
-         if (text == string2 + size2)
-           goto fail;
-         if (size2 == 0 && text == string1 + size1)
-           goto fail;
-         if (SYNTAX(text == string1 + size1 ? *string1 : *text) != Sword)
-           goto fail;
-         if (text == string1)
-           break;
-         if (SYNTAX(text[-1]) != Sword)
-           break;
-         goto fail;
-       case Cwordend:
-         if (text == string1)
-           goto fail;
-         if (SYNTAX(text[-1]) != Sword)
-           goto fail;
-         if (text == string2 + size2)
-           break;
-         if (size2 == 0 && text == string1 + size1)
-           break;
-         if (SYNTAX(*text) == Sword)
-           goto fail;
-         break;
-       case Cwordbound:
-         /* Note: as in gnu regexp, this also matches at the beginning
-            and end of buffer. */
-         if (text == string1 || text == string2 + size2 ||
-             (size2 == 0 && text == string1 + size1))
-           break;
-         if ((SYNTAX(text[-1]) == Sword) ^
-             (SYNTAX(text == string1 + size1 ? *string2 : *text) == Sword))
-           break;
-         goto fail;
-       case Cnotwordbound:
-         /* Note: as in gnu regexp, this never matches at the beginning
-            and end of buffer. */
-         if (text == string1 || text == string2 + size2 ||
-             (size2 == 0 && text == string1 + size1))
-           goto fail;
-         if (!((SYNTAX(text[-1]) == Sword) ^
-               (SYNTAX(text == string1 + size1 ? *string2 : *text) == Sword)))
-           goto fail;
-         break;
-       case Csyntaxspec:
-         NEXTCHAR(ch);
-         if (SYNTAX(ch) != (unsigned char)*code++)
-           goto fail;
-         break;
-       case Cnotsyntaxspec:
-         NEXTCHAR(ch);
-         if (SYNTAX(ch) != (unsigned char)*code++)
-           break;
-         goto fail;
-#ifdef emacs
-       case Cemacs_at_dot:
-         if (PTR_CHAR_POS((unsigned char *)text) + 1 != point)
-           goto fail;
-         break;
-#endif /* emacs */
-       default:
-         abort();
-         /*NOTREACHED*/
-       }
-    }
-  abort();
-  /*NOTREACHED*/
-
- fail:
-  if (failure_sp != failure_stack_start)
-    {
-      failure_sp--;
-      text = failure_sp->text;
-      if (text == NULL)
-       goto fail;
-      partend = failure_sp->partend;
-      code = failure_sp->code;
-      goto continue_matching;
-    }
-  if (failure_stack_start != initial_failure_stack)
-    free((char *)failure_stack_start);
-  return -1;
-
- error:
-  if (failure_stack_start != initial_failure_stack)
-    free((char *)failure_stack_start);
-  return -2;
-}
-
-#undef PREFETCH
-#undef NEXTCHAR
-#undef PUSH_FAILURE
-
-int re_match(bufp, string, size, pos, regs)
-regexp_t bufp;
-char *string;
-int size, pos;
-regexp_registers_t regs;
-{
-  return re_match_2(bufp, string, size, (char *)NULL, 0, pos, regs, size);
-}
-
-int re_search_2(bufp, string1, size1, string2, size2, pos, range, regs,
-               mstop)
-regexp_t bufp;
-char *string1, *string2;
-int size1, size2, pos, range, mstop;
-regexp_registers_t regs;
-{
-  char *fastmap, *translate, *text, *partstart, *partend;
-  int dir, ret;
-  char anchor;
-  
-  assert(size1 >= 0 && size2 >= 0 && pos >= 0 && mstop >= 0);
-  assert(pos + range >= 0 && pos + range <= size1 + size2);
-  assert(pos <= mstop);
-  
-  fastmap = bufp->fastmap;
-  translate = bufp->translate;
-  if (fastmap && !bufp->fastmap_accurate)
-    re_compile_fastmap(bufp);
-  anchor = bufp->anchor;
-  if (bufp->can_be_null == 1) /* can_be_null == 2: can match null at eob */
-    fastmap = NULL;
-  if (range < 0)
-    {
-      dir = -1;
-      range = -range;
-    }
-  else
-    dir = 1;
-  if (anchor == 2) {
-    if (pos != 0)
-      return -1;
-    else
-      range = 0;
-  }
-  for (; range >= 0; range--, pos += dir)
-    {
-      if (fastmap)
-       {
-         if (dir == 1)
-           { /* searching forwards */
-             if (pos < size1)
-               {
-                 text = string1 + pos;
-                 if (pos + range > size1)
-                   partend = string1 + size1;
-                 else
-                   partend = string1 + pos + range;
-               }
-             else
-               {
-                 text = string2 + pos - size1;
-                 partend = string2 + pos + range - size1;
-               }
-             partstart = text;
-             if (translate)
-               while (text != partend &&
-                      !fastmap[(unsigned char)
-                               translate[(unsigned char)*text]])
-                 text++;
-             else
-               while (text != partend && !fastmap[(unsigned char)*text])
-                 text++;
-             pos += text - partstart;
-             range -= text - partstart;
-             if (pos == size1 + size2 && bufp->can_be_null == 0)
-               return -1;
-           }
-         else
-           { /* searching backwards */
-             if (pos <= size1)
-               {
-                 text = string1 + pos;
-                 partstart = string1 + pos - range;
-               }
-             else
-               {
-                 text = string2 + pos - size1;
-                 if (range < pos - size1)
-                   partstart = string2 + pos - size1 - range;
-                 else
-                   partstart = string2;
-               }
-             partend = text;
-             if (translate)
-               while (text != partstart &&
-                      !fastmap[(unsigned char)
-                               translate[(unsigned char)*text]])
-                 text--;
-             else
-               while (text != partstart &&
-                      !fastmap[(unsigned char)*text])
-                 text--;
-             pos -= partend - text;
-             range -= partend - text;
-           }
-       }
-      if (anchor == 1)
-       { /* anchored to begline */
-         if (pos > 0 &&
-             (pos <= size1 ? string1[pos - 1] :
-              string2[pos - size1 - 1]) != '\n')
-           continue;
-       }
-      assert(pos >= 0 && pos <= size1 + size2);
-      ret = re_match_2(bufp, string1, size1, string2, size2, pos, regs, mstop);
-      if (ret >= 0)
-       return pos;
-      if (ret == -2)
-       return -2;
-    }
-  return -1;
-}
-
-int re_search(bufp, string, size, startpos, range, regs)
-regexp_t bufp;
-char *string;
-int size, startpos, range;
-regexp_registers_t regs;
-{
-  return re_search_2(bufp, string, size, (char *)NULL, 0,
-                    startpos, range, regs, size);
-}
-
-static struct re_pattern_buffer re_comp_buf;
-
-char *re_comp(s)
-char *s;
-{
-  if (s == NULL)
-    {
-      if (!re_comp_buf.buffer)
-       return "Out of memory";
-      return NULL;
-    }
-  if (!re_comp_buf.buffer)
-    {
-      /* the buffer will be allocated automatically */
-      re_comp_buf.fastmap = malloc(256);
-      re_comp_buf.translate = NULL;
-    }
-  return re_compile_pattern(s, strlen(s), &re_comp_buf);
-}
-
-int re_exec(s)
-char *s;
-{
-  int len = strlen(s);
-  
-  return re_search(&re_comp_buf, s, len, 0, len, (regexp_registers_t)NULL) >= 0;
-}
-
-/* POSIX Compatibility */
-
-int regcomp(regex_t *preg, const char *regex, int cflags)
-{
-  int syntax = 0;
-  memset(preg, 0, sizeof(*preg));
-  if (cflags & REG_EXTENDED)
-    syntax |= (RE_CONTEXT_INDEP_OPS | RE_NO_BK_PARENS | RE_NO_BK_VBAR);
-  re_set_syntax(syntax);
-  if (re_compile_pattern((char *)regex, strlen(regex), preg) == NULL)
-    return 0;
-  return -1;
-}
-
-int regexec(const regex_t *preg, const char *string, size_t nmatch,
-            regmatch_t pmatch[], int eflags)
-{
-  int len = strlen(string);
-  int ret;
-  
-  ret = re_search((regex_t *)preg, (char *)string, len, 0, len, (regexp_registers_t)NULL);
-  if (ret >= 0)
-    return 0;
-
-  return ret;
-}
-
-size_t regerror(int errcode, const regex_t *preg, char *errbuf,
-                size_t errbuf_size)
-{
-  return -1;
-}
-
-void regfree(regex_t *preg)
-{
-  free(preg->buffer);
-}
-
-#ifdef TEST_REGEXP
-
-int main()
-{
-  char buf[500];
-  char *cp;
-  struct re_pattern_buffer exp;
-  struct re_registers regs;
-  int a,pos;
-  char fastmap[256];
-
-  exp.allocated = 0;
-  exp.buffer = 0;
-  exp.translate = NULL;
-  exp.fastmap = fastmap;
-
-  /* re_set_syntax(RE_NO_BK_PARENS|RE_NO_BK_VBAR|RE_ANSI_HEX); */
-
-  while (1)
-    {
-      printf("Enter regexp:\n");
-      gets(buf);
-      cp=re_compile_pattern(buf, strlen(buf), &exp);
-      if (cp)
-       {
-         printf("Error: %s\n", cp);
-         continue;
-       }
-      re_compile_fastmap(&exp);
-      printf("dump:\n");
-      for (pos = 0; pos < exp.used;)
-       {
-         printf("%d: ", pos);
-         switch (exp.buffer[pos++])
-           {
-           case Cend:
-             strcpy(buf, "end");
-             break;
-           case Cbol:
-             strcpy(buf, "bol");
-             break;
-           case Ceol:
-             strcpy(buf, "eol");
-             break;
-           case Cset:
-             strcpy(buf, "set ");
-             for (a = 0; a < 256/8; a++)
-               sprintf(buf+strlen(buf)," %02x",
-                       (unsigned char)exp.buffer[pos++]);
-             break;
-           case Cexact:
-             sprintf(buf, "exact '%c' 0x%x", exp.buffer[pos],
-                     (unsigned char)exp.buffer[pos]);
-             pos++;
-             break;
-           case Canychar:
-             strcpy(buf, "anychar");
-             break;
-           case Cstart_memory:
-             sprintf(buf, "start_memory %d", exp.buffer[pos++]);
-             break;
-           case Cend_memory:
-             sprintf(buf, "end_memory %d", exp.buffer[pos++]);
-             break;
-           case Cmatch_memory:
-             sprintf(buf, "match_memory %d", exp.buffer[pos++]);
-             break;
-           case Cjump:
-           case Cdummy_failure_jump:
-           case Cstar_jump:
-           case Cfailure_jump:
-           case Cupdate_failure_jump:
-             a = (unsigned char)exp.buffer[pos++];
-             a += (unsigned char)exp.buffer[pos++] << 8;
-             a = (int)(short)a;
-             switch (exp.buffer[pos-3])
-               {
-               case Cjump:
-                 cp = "jump";
-                 break;
-               case Cstar_jump:
-                 cp = "star_jump";
-                 break;
-               case Cfailure_jump:
-                 cp = "failure_jump";
-                 break;
-               case Cupdate_failure_jump:
-                 cp = "update_failure_jump";
-                 break;
-               case Cdummy_failure_jump:
-                 cp = "dummy_failure_jump";
-                 break;
-               default:
-                 cp = "unknown jump";
-                 break;
-               }
-             sprintf(buf, "%s %d", cp, a + pos);
-             break;
-           case Cbegbuf:
-             strcpy(buf,"begbuf");
-             break;
-           case Cendbuf:
-             strcpy(buf,"endbuf");
-             break;
-           case Cwordbeg:
-             strcpy(buf,"wordbeg");
-             break;
-           case Cwordend:
-             strcpy(buf,"wordend");
-             break;
-           case Cwordbound:
-             strcpy(buf,"wordbound");
-             break;
-           case Cnotwordbound:
-             strcpy(buf,"notwordbound");
-             break;
-           default:
-             sprintf(buf, "unknown code %d",
-                     (unsigned char)exp.buffer[pos - 1]);
-             break;
-           }
-         printf("%s\n", buf);
-       }
-      printf("can_be_null = %d uses_registers = %d anchor = %d\n",
-            exp.can_be_null, exp.uses_registers, exp.anchor);
-      
-      printf("fastmap:");
-      for (a = 0; a < 256; a++)
-       if (exp.fastmap[a])
-         printf(" %d", a);
-      printf("\n");
-      printf("Enter strings.  An empty line terminates.\n");
-      while (fgets(buf, sizeof(buf), stdin))
-       {
-         if (buf[0] == '\n')
-           break;
-         a = re_search(&exp, buf, strlen(buf), 0, strlen(buf), &regs);
-         printf("search returns %d\n", a);
-         if (a != -1)
-           {
-             for (a = 0; a < RE_NREGS; a++)
-               {
-                 printf("buf %d: %d to %d\n", a, regs.start[a], regs.end[a]);
-               }
-           }
-       }
-    }
-}
-
-#endif /* TEST_REGEXP */
diff --git a/lib/contrib/regexpr.h b/lib/contrib/regexpr.h
deleted file mode 100644 (file)
index b692735..0000000
+++ /dev/null
@@ -1,139 +0,0 @@
-/*
-
-regexpr.h
-
-Author: Tatu Ylonen <ylo@ngs.fi>
-
-Copyright (c) 1991 Tatu Ylonen, Espoo, Finland
-
-Permission to use, copy, modify, distribute, and sell this software
-and its documentation is hereby granted without fee, provided that the
-above copyright notice appears in all source code copies, the name of
-Tatu Ylonen is not used to advertise products containing this software
-or a derivation thereof, and all modified versions are clearly marked
-as such.
-
-This software is provided "as is" without express or implied warranty.
-
-Created: Thu Sep 26 17:15:36 1991 ylo
-Last modified: Fri Jan  3 12:05:45 1992 ylo
-
-*/
-
-/* $Id$ */
-
-#ifndef REGEXPR_H
-#define REGEXPR_H
-
-#define RE_NREGS       10  /* number of registers available */
-
-typedef struct re_pattern_buffer
-{
-  char *buffer;         /* compiled pattern */
-  int allocated;        /* allocated size of compiled pattern */
-  int used;             /* actual length of compiled pattern */
-  char *fastmap;        /* fastmap[ch] is true if ch can start pattern */
-  char *translate;      /* translation to apply during compilation/matching */
-  char fastmap_accurate; /* true if fastmap is valid */
-  char can_be_null;     /* true if can match empty string */
-  char uses_registers;  /* registers are used and need to be initialized */
-  char anchor;          /* anchor: 0=none 1=begline 2=begbuf */
-} *regexp_t;
-
-typedef struct re_registers
-{
-  int start[RE_NREGS];  /* start offset of region */
-  int end[RE_NREGS];    /* end offset of region */
-} *regexp_registers_t;
-
-/* bit definitions for syntax */
-#define RE_NO_BK_PARENS                1    /* no quoting for parentheses */
-#define RE_NO_BK_VBAR          2    /* no quoting for vertical bar */
-#define RE_BK_PLUS_QM          4    /* quoting needed for + and ? */
-#define RE_TIGHT_VBAR          8    /* | binds tighter than ^ and $ */
-#define RE_NEWLINE_OR          16   /* treat newline as or */
-#define RE_CONTEXT_INDEP_OPS   32   /* ^$?*+ are special in all contexts */
-#define RE_ANSI_HEX            64   /* ansi sequences (\n etc) and \xhh */
-#define RE_NO_GNU_EXTENSIONS   128   /* no gnu extensions */
-
-/* definitions for some common regexp styles */
-#define RE_SYNTAX_AWK  (RE_NO_BK_PARENS|RE_NO_BK_VBAR|RE_CONTEXT_INDEP_OPS)
-#define RE_SYNTAX_EGREP        (RE_SYNTAX_AWK|RE_NEWLINE_OR)
-#define RE_SYNTAX_GREP (RE_BK_PLUS_QM|RE_NEWLINE_OR)
-#define RE_SYNTAX_EMACS        0
-
-int re_set_syntax(int syntax);
-/* This sets the syntax to use and returns the previous syntax.  The
-   syntax is specified by a bit mask of the above defined bits. */
-
-char *re_compile_pattern(char *regex, int regex_size, regexp_t compiled);
-/* This compiles the regexp (given in regex and length in regex_size).
-   This returns NULL if the regexp compiled successfully, and an error
-   message if an error was encountered.  The buffer field must be
-   initialized to a memory area allocated by malloc (or to NULL) before
-   use, and the allocated field must be set to its length (or 0 if buffer is
-   NULL).  Also, the translate field must be set to point to a valid
-   translation table, or NULL if it is not used. */
-
-int re_match(regexp_t compiled, char *string, int size, int pos,
-            regexp_registers_t regs);
-/* This tries to match the regexp against the string.  This returns the
-   length of the matched portion, or -1 if the pattern could not be
-   matched and -2 if an error (such as failure stack overflow) is
-   encountered. */
-
-int re_match_2(regexp_t compiled, char *string1, int size1,
-             char *string2, int size2, int pos, regexp_registers_t regs,
-              int mstop);
-/* This tries to match the regexp to the concatenation of string1 and
-   string2.  This returns the length of the matched portion, or -1 if the
-   pattern could not be matched and -2 if an error (such as failure stack
-   overflow) is encountered. */
-
-int re_search(regexp_t compiled, char *string, int size, int startpos,
-             int range, regexp_registers_t regs);
-/* This rearches for a substring matching the regexp.  This returns the first
-   index at which a match is found.  range specifies at how many positions to
-   try matching; positive values indicate searching forwards, and negative
-   values indicate searching backwards.  mstop specifies the offset beyond
-   which a match must not go.  This returns -1 if no match is found, and
-   -2 if an error (such as failure stack overflow) is encountered. */
-
-int re_search_2(regexp_t compiled, char *string1, int size1,
-               char *string2, int size2, int startpos, int range,
-               regexp_registers_t regs, int mstop);
-/* This is like re_search, but search from the concatenation of string1 and
-   string2.  */
-
-void re_compile_fastmap(regexp_t compiled);
-/* This computes the fastmap for the regexp.  For this to have any effect,
-   the calling program must have initialized the fastmap field to point
-   to an array of 256 characters. */
-
-char *re_comp(char *s);
-/* BSD 4.2 regex library routine re_comp.  This compiles the regexp into
-   an internal buffer.  This returns NULL if the regexp was compiled
-   successfully, and an error message if there was an error. */
-
-int re_exec(char *s);
-/* BSD 4.2 regexp library routine re_exec.  This returns true if the string
-   matches the regular expression (that is, a matching part is found
-   anywhere in the string). */
-
-/* POSIX Compatibility */
-#define regex_t struct re_pattern_buffer
-#define regmatch_t struct re_registers
-#define REG_EXTENDED 1
-#define REG_ICASE (REG_EXTENDED << 1)
-#define REG_NEWLINE (REG_ICASE << 1)
-#define REG_NOSUB (REG_NEWLINE << 1)
-#define REG_NOTBOL 1
-#define REG_NOTEOL (REG_NOTBOL << 1)
-int regcomp(regex_t *preg, const char *regex, int cflags);
-int regexec(const regex_t *preg, const char *string, size_t nmatch,
-           regmatch_t pmatch[], int eflags);
-size_t regerror(int errcode, const regex_t *preg, char *errbuf,
-               size_t errbuf_size);
-void regfree(regex_t *preg);
-
-#endif /* REGEXPR_H */
diff --git a/lib/contrib/rfc3454.c b/lib/contrib/rfc3454.c
deleted file mode 100644 (file)
index 99d1677..0000000
+++ /dev/null
@@ -1,3544 +0,0 @@
-/* This file is automatically generated.  DO NOT EDIT!
-   Instead, edit gen-stringprep-tables.pl and re-run.  */
-
-#include "stringprep.h"
-
-/*
- * A.1 Unassigned code points in Unicode 3.2
- * 
- */
-
-const Stringprep_table_element stringprep_rfc3454_A_1[] = {
-  { 0x000221           },                                            /* 0221 */
-  { 0x000234, 0x00024F },                                       /* 0234-024F */
-  { 0x0002AE, 0x0002AF },                                       /* 02AE-02AF */
-  { 0x0002EF, 0x0002FF },                                       /* 02EF-02FF */
-  { 0x000350, 0x00035F },                                       /* 0350-035F */
-  { 0x000370, 0x000373 },                                       /* 0370-0373 */
-  { 0x000376, 0x000379 },                                       /* 0376-0379 */
-  { 0x00037B, 0x00037D },                                       /* 037B-037D */
-  { 0x00037F, 0x000383 },                                       /* 037F-0383 */
-  { 0x00038B           },                                            /* 038B */
-  { 0x00038D           },                                            /* 038D */
-  { 0x0003A2           },                                            /* 03A2 */
-  { 0x0003CF           },                                            /* 03CF */
-  { 0x0003F7, 0x0003FF },                                       /* 03F7-03FF */
-  { 0x000487           },                                            /* 0487 */
-  { 0x0004CF           },                                            /* 04CF */
-  { 0x0004F6, 0x0004F7 },                                       /* 04F6-04F7 */
-  { 0x0004FA, 0x0004FF },                                       /* 04FA-04FF */
-  { 0x000510, 0x000530 },                                       /* 0510-0530 */
-  { 0x000557, 0x000558 },                                       /* 0557-0558 */
-  { 0x000560           },                                            /* 0560 */
-  { 0x000588           },                                            /* 0588 */
-  { 0x00058B, 0x000590 },                                       /* 058B-0590 */
-  { 0x0005A2           },                                            /* 05A2 */
-  { 0x0005BA           },                                            /* 05BA */
-  { 0x0005C5, 0x0005CF },                                       /* 05C5-05CF */
-  { 0x0005EB, 0x0005EF },                                       /* 05EB-05EF */
-  { 0x0005F5, 0x00060B },                                       /* 05F5-060B */
-  { 0x00060D, 0x00061A },                                       /* 060D-061A */
-  { 0x00061C, 0x00061E },                                       /* 061C-061E */
-  { 0x000620           },                                            /* 0620 */
-  { 0x00063B, 0x00063F },                                       /* 063B-063F */
-  { 0x000656, 0x00065F },                                       /* 0656-065F */
-  { 0x0006EE, 0x0006EF },                                       /* 06EE-06EF */
-  { 0x0006FF           },                                            /* 06FF */
-  { 0x00070E           },                                            /* 070E */
-  { 0x00072D, 0x00072F },                                       /* 072D-072F */
-  { 0x00074B, 0x00077F },                                       /* 074B-077F */
-  { 0x0007B2, 0x000900 },                                       /* 07B2-0900 */
-  { 0x000904           },                                            /* 0904 */
-  { 0x00093A, 0x00093B },                                       /* 093A-093B */
-  { 0x00094E, 0x00094F },                                       /* 094E-094F */
-  { 0x000955, 0x000957 },                                       /* 0955-0957 */
-  { 0x000971, 0x000980 },                                       /* 0971-0980 */
-  { 0x000984           },                                            /* 0984 */
-  { 0x00098D, 0x00098E },                                       /* 098D-098E */
-  { 0x000991, 0x000992 },                                       /* 0991-0992 */
-  { 0x0009A9           },                                            /* 09A9 */
-  { 0x0009B1           },                                            /* 09B1 */
-  { 0x0009B3, 0x0009B5 },                                       /* 09B3-09B5 */
-  { 0x0009BA, 0x0009BB },                                       /* 09BA-09BB */
-  { 0x0009BD           },                                            /* 09BD */
-  { 0x0009C5, 0x0009C6 },                                       /* 09C5-09C6 */
-  { 0x0009C9, 0x0009CA },                                       /* 09C9-09CA */
-  { 0x0009CE, 0x0009D6 },                                       /* 09CE-09D6 */
-  { 0x0009D8, 0x0009DB },                                       /* 09D8-09DB */
-  { 0x0009DE           },                                            /* 09DE */
-  { 0x0009E4, 0x0009E5 },                                       /* 09E4-09E5 */
-  { 0x0009FB, 0x000A01 },                                       /* 09FB-0A01 */
-  { 0x000A03, 0x000A04 },                                       /* 0A03-0A04 */
-  { 0x000A0B, 0x000A0E },                                       /* 0A0B-0A0E */
-  { 0x000A11, 0x000A12 },                                       /* 0A11-0A12 */
-  { 0x000A29           },                                            /* 0A29 */
-  { 0x000A31           },                                            /* 0A31 */
-  { 0x000A34           },                                            /* 0A34 */
-  { 0x000A37           },                                            /* 0A37 */
-  { 0x000A3A, 0x000A3B },                                       /* 0A3A-0A3B */
-  { 0x000A3D           },                                            /* 0A3D */
-  { 0x000A43, 0x000A46 },                                       /* 0A43-0A46 */
-  { 0x000A49, 0x000A4A },                                       /* 0A49-0A4A */
-  { 0x000A4E, 0x000A58 },                                       /* 0A4E-0A58 */
-  { 0x000A5D           },                                            /* 0A5D */
-  { 0x000A5F, 0x000A65 },                                       /* 0A5F-0A65 */
-  { 0x000A75, 0x000A80 },                                       /* 0A75-0A80 */
-  { 0x000A84           },                                            /* 0A84 */
-  { 0x000A8C           },                                            /* 0A8C */
-  { 0x000A8E           },                                            /* 0A8E */
-  { 0x000A92           },                                            /* 0A92 */
-  { 0x000AA9           },                                            /* 0AA9 */
-  { 0x000AB1           },                                            /* 0AB1 */
-  { 0x000AB4           },                                            /* 0AB4 */
-  { 0x000ABA, 0x000ABB },                                       /* 0ABA-0ABB */
-  { 0x000AC6           },                                            /* 0AC6 */
-  { 0x000ACA           },                                            /* 0ACA */
-  { 0x000ACE, 0x000ACF },                                       /* 0ACE-0ACF */
-  { 0x000AD1, 0x000ADF },                                       /* 0AD1-0ADF */
-  { 0x000AE1, 0x000AE5 },                                       /* 0AE1-0AE5 */
-  { 0x000AF0, 0x000B00 },                                       /* 0AF0-0B00 */
-  { 0x000B04           },                                            /* 0B04 */
-  { 0x000B0D, 0x000B0E },                                       /* 0B0D-0B0E */
-  { 0x000B11, 0x000B12 },                                       /* 0B11-0B12 */
-  { 0x000B29           },                                            /* 0B29 */
-  { 0x000B31           },                                            /* 0B31 */
-  { 0x000B34, 0x000B35 },                                       /* 0B34-0B35 */
-  { 0x000B3A, 0x000B3B },                                       /* 0B3A-0B3B */
-  { 0x000B44, 0x000B46 },                                       /* 0B44-0B46 */
-  { 0x000B49, 0x000B4A },                                       /* 0B49-0B4A */
-  { 0x000B4E, 0x000B55 },                                       /* 0B4E-0B55 */
-  { 0x000B58, 0x000B5B },                                       /* 0B58-0B5B */
-  { 0x000B5E           },                                            /* 0B5E */
-  { 0x000B62, 0x000B65 },                                       /* 0B62-0B65 */
-  { 0x000B71, 0x000B81 },                                       /* 0B71-0B81 */
-  { 0x000B84           },                                            /* 0B84 */
-  { 0x000B8B, 0x000B8D },                                       /* 0B8B-0B8D */
-  { 0x000B91           },                                            /* 0B91 */
-  { 0x000B96, 0x000B98 },                                       /* 0B96-0B98 */
-  { 0x000B9B           },                                            /* 0B9B */
-  { 0x000B9D           },                                            /* 0B9D */
-  { 0x000BA0, 0x000BA2 },                                       /* 0BA0-0BA2 */
-  { 0x000BA5, 0x000BA7 },                                       /* 0BA5-0BA7 */
-  { 0x000BAB, 0x000BAD },                                       /* 0BAB-0BAD */
-  { 0x000BB6           },                                            /* 0BB6 */
-  { 0x000BBA, 0x000BBD },                                       /* 0BBA-0BBD */
-  { 0x000BC3, 0x000BC5 },                                       /* 0BC3-0BC5 */
-  { 0x000BC9           },                                            /* 0BC9 */
-  { 0x000BCE, 0x000BD6 },                                       /* 0BCE-0BD6 */
-  { 0x000BD8, 0x000BE6 },                                       /* 0BD8-0BE6 */
-  { 0x000BF3, 0x000C00 },                                       /* 0BF3-0C00 */
-  { 0x000C04           },                                            /* 0C04 */
-  { 0x000C0D           },                                            /* 0C0D */
-  { 0x000C11           },                                            /* 0C11 */
-  { 0x000C29           },                                            /* 0C29 */
-  { 0x000C34           },                                            /* 0C34 */
-  { 0x000C3A, 0x000C3D },                                       /* 0C3A-0C3D */
-  { 0x000C45           },                                            /* 0C45 */
-  { 0x000C49           },                                            /* 0C49 */
-  { 0x000C4E, 0x000C54 },                                       /* 0C4E-0C54 */
-  { 0x000C57, 0x000C5F },                                       /* 0C57-0C5F */
-  { 0x000C62, 0x000C65 },                                       /* 0C62-0C65 */
-  { 0x000C70, 0x000C81 },                                       /* 0C70-0C81 */
-  { 0x000C84           },                                            /* 0C84 */
-  { 0x000C8D           },                                            /* 0C8D */
-  { 0x000C91           },                                            /* 0C91 */
-  { 0x000CA9           },                                            /* 0CA9 */
-  { 0x000CB4           },                                            /* 0CB4 */
-  { 0x000CBA, 0x000CBD },                                       /* 0CBA-0CBD */
-  { 0x000CC5           },                                            /* 0CC5 */
-  { 0x000CC9           },                                            /* 0CC9 */
-  { 0x000CCE, 0x000CD4 },                                       /* 0CCE-0CD4 */
-  { 0x000CD7, 0x000CDD },                                       /* 0CD7-0CDD */
-  { 0x000CDF           },                                            /* 0CDF */
-  { 0x000CE2, 0x000CE5 },                                       /* 0CE2-0CE5 */
-  { 0x000CF0, 0x000D01 },                                       /* 0CF0-0D01 */
-  { 0x000D04           },                                            /* 0D04 */
-  { 0x000D0D           },                                            /* 0D0D */
-  { 0x000D11           },                                            /* 0D11 */
-  { 0x000D29           },                                            /* 0D29 */
-  { 0x000D3A, 0x000D3D },                                       /* 0D3A-0D3D */
-  { 0x000D44, 0x000D45 },                                       /* 0D44-0D45 */
-  { 0x000D49           },                                            /* 0D49 */
-  { 0x000D4E, 0x000D56 },                                       /* 0D4E-0D56 */
-  { 0x000D58, 0x000D5F },                                       /* 0D58-0D5F */
-  { 0x000D62, 0x000D65 },                                       /* 0D62-0D65 */
-  { 0x000D70, 0x000D81 },                                       /* 0D70-0D81 */
-  { 0x000D84           },                                            /* 0D84 */
-  { 0x000D97, 0x000D99 },                                       /* 0D97-0D99 */
-  { 0x000DB2           },                                            /* 0DB2 */
-  { 0x000DBC           },                                            /* 0DBC */
-  { 0x000DBE, 0x000DBF },                                       /* 0DBE-0DBF */
-  { 0x000DC7, 0x000DC9 },                                       /* 0DC7-0DC9 */
-  { 0x000DCB, 0x000DCE },                                       /* 0DCB-0DCE */
-  { 0x000DD5           },                                            /* 0DD5 */
-  { 0x000DD7           },                                            /* 0DD7 */
-  { 0x000DE0, 0x000DF1 },                                       /* 0DE0-0DF1 */
-  { 0x000DF5, 0x000E00 },                                       /* 0DF5-0E00 */
-  { 0x000E3B, 0x000E3E },                                       /* 0E3B-0E3E */
-  { 0x000E5C, 0x000E80 },                                       /* 0E5C-0E80 */
-  { 0x000E83           },                                            /* 0E83 */
-  { 0x000E85, 0x000E86 },                                       /* 0E85-0E86 */
-  { 0x000E89           },                                            /* 0E89 */
-  { 0x000E8B, 0x000E8C },                                       /* 0E8B-0E8C */
-  { 0x000E8E, 0x000E93 },                                       /* 0E8E-0E93 */
-  { 0x000E98           },                                            /* 0E98 */
-  { 0x000EA0           },                                            /* 0EA0 */
-  { 0x000EA4           },                                            /* 0EA4 */
-  { 0x000EA6           },                                            /* 0EA6 */
-  { 0x000EA8, 0x000EA9 },                                       /* 0EA8-0EA9 */
-  { 0x000EAC           },                                            /* 0EAC */
-  { 0x000EBA           },                                            /* 0EBA */
-  { 0x000EBE, 0x000EBF },                                       /* 0EBE-0EBF */
-  { 0x000EC5           },                                            /* 0EC5 */
-  { 0x000EC7           },                                            /* 0EC7 */
-  { 0x000ECE, 0x000ECF },                                       /* 0ECE-0ECF */
-  { 0x000EDA, 0x000EDB },                                       /* 0EDA-0EDB */
-  { 0x000EDE, 0x000EFF },                                       /* 0EDE-0EFF */
-  { 0x000F48           },                                            /* 0F48 */
-  { 0x000F6B, 0x000F70 },                                       /* 0F6B-0F70 */
-  { 0x000F8C, 0x000F8F },                                       /* 0F8C-0F8F */
-  { 0x000F98           },                                            /* 0F98 */
-  { 0x000FBD           },                                            /* 0FBD */
-  { 0x000FCD, 0x000FCE },                                       /* 0FCD-0FCE */
-  { 0x000FD0, 0x000FFF },                                       /* 0FD0-0FFF */
-  { 0x001022           },                                            /* 1022 */
-  { 0x001028           },                                            /* 1028 */
-  { 0x00102B           },                                            /* 102B */
-  { 0x001033, 0x001035 },                                       /* 1033-1035 */
-  { 0x00103A, 0x00103F },                                       /* 103A-103F */
-  { 0x00105A, 0x00109F },                                       /* 105A-109F */
-  { 0x0010C6, 0x0010CF },                                       /* 10C6-10CF */
-  { 0x0010F9, 0x0010FA },                                       /* 10F9-10FA */
-  { 0x0010FC, 0x0010FF },                                       /* 10FC-10FF */
-  { 0x00115A, 0x00115E },                                       /* 115A-115E */
-  { 0x0011A3, 0x0011A7 },                                       /* 11A3-11A7 */
-  { 0x0011FA, 0x0011FF },                                       /* 11FA-11FF */
-  { 0x001207           },                                            /* 1207 */
-  { 0x001247           },                                            /* 1247 */
-  { 0x001249           },                                            /* 1249 */
-  { 0x00124E, 0x00124F },                                       /* 124E-124F */
-  { 0x001257           },                                            /* 1257 */
-  { 0x001259           },                                            /* 1259 */
-  { 0x00125E, 0x00125F },                                       /* 125E-125F */
-  { 0x001287           },                                            /* 1287 */
-  { 0x001289           },                                            /* 1289 */
-  { 0x00128E, 0x00128F },                                       /* 128E-128F */
-  { 0x0012AF           },                                            /* 12AF */
-  { 0x0012B1           },                                            /* 12B1 */
-  { 0x0012B6, 0x0012B7 },                                       /* 12B6-12B7 */
-  { 0x0012BF           },                                            /* 12BF */
-  { 0x0012C1           },                                            /* 12C1 */
-  { 0x0012C6, 0x0012C7 },                                       /* 12C6-12C7 */
-  { 0x0012CF           },                                            /* 12CF */
-  { 0x0012D7           },                                            /* 12D7 */
-  { 0x0012EF           },                                            /* 12EF */
-  { 0x00130F           },                                            /* 130F */
-  { 0x001311           },                                            /* 1311 */
-  { 0x001316, 0x001317 },                                       /* 1316-1317 */
-  { 0x00131F           },                                            /* 131F */
-  { 0x001347           },                                            /* 1347 */
-  { 0x00135B, 0x001360 },                                       /* 135B-1360 */
-  { 0x00137D, 0x00139F },                                       /* 137D-139F */
-  { 0x0013F5, 0x001400 },                                       /* 13F5-1400 */
-  { 0x001677, 0x00167F },                                       /* 1677-167F */
-  { 0x00169D, 0x00169F },                                       /* 169D-169F */
-  { 0x0016F1, 0x0016FF },                                       /* 16F1-16FF */
-  { 0x00170D           },                                            /* 170D */
-  { 0x001715, 0x00171F },                                       /* 1715-171F */
-  { 0x001737, 0x00173F },                                       /* 1737-173F */
-  { 0x001754, 0x00175F },                                       /* 1754-175F */
-  { 0x00176D           },                                            /* 176D */
-  { 0x001771           },                                            /* 1771 */
-  { 0x001774, 0x00177F },                                       /* 1774-177F */
-  { 0x0017DD, 0x0017DF },                                       /* 17DD-17DF */
-  { 0x0017EA, 0x0017FF },                                       /* 17EA-17FF */
-  { 0x00180F           },                                            /* 180F */
-  { 0x00181A, 0x00181F },                                       /* 181A-181F */
-  { 0x001878, 0x00187F },                                       /* 1878-187F */
-  { 0x0018AA, 0x001DFF },                                       /* 18AA-1DFF */
-  { 0x001E9C, 0x001E9F },                                       /* 1E9C-1E9F */
-  { 0x001EFA, 0x001EFF },                                       /* 1EFA-1EFF */
-  { 0x001F16, 0x001F17 },                                       /* 1F16-1F17 */
-  { 0x001F1E, 0x001F1F },                                       /* 1F1E-1F1F */
-  { 0x001F46, 0x001F47 },                                       /* 1F46-1F47 */
-  { 0x001F4E, 0x001F4F },                                       /* 1F4E-1F4F */
-  { 0x001F58           },                                            /* 1F58 */
-  { 0x001F5A           },                                            /* 1F5A */
-  { 0x001F5C           },                                            /* 1F5C */
-  { 0x001F5E           },                                            /* 1F5E */
-  { 0x001F7E, 0x001F7F },                                       /* 1F7E-1F7F */
-  { 0x001FB5           },                                            /* 1FB5 */
-  { 0x001FC5           },                                            /* 1FC5 */
-  { 0x001FD4, 0x001FD5 },                                       /* 1FD4-1FD5 */
-  { 0x001FDC           },                                            /* 1FDC */
-  { 0x001FF0, 0x001FF1 },                                       /* 1FF0-1FF1 */
-  { 0x001FF5           },                                            /* 1FF5 */
-  { 0x001FFF           },                                            /* 1FFF */
-  { 0x002053, 0x002056 },                                       /* 2053-2056 */
-  { 0x002058, 0x00205E },                                       /* 2058-205E */
-  { 0x002064, 0x002069 },                                       /* 2064-2069 */
-  { 0x002072, 0x002073 },                                       /* 2072-2073 */
-  { 0x00208F, 0x00209F },                                       /* 208F-209F */
-  { 0x0020B2, 0x0020CF },                                       /* 20B2-20CF */
-  { 0x0020EB, 0x0020FF },                                       /* 20EB-20FF */
-  { 0x00213B, 0x00213C },                                       /* 213B-213C */
-  { 0x00214C, 0x002152 },                                       /* 214C-2152 */
-  { 0x002184, 0x00218F },                                       /* 2184-218F */
-  { 0x0023CF, 0x0023FF },                                       /* 23CF-23FF */
-  { 0x002427, 0x00243F },                                       /* 2427-243F */
-  { 0x00244B, 0x00245F },                                       /* 244B-245F */
-  { 0x0024FF           },                                            /* 24FF */
-  { 0x002614, 0x002615 },                                       /* 2614-2615 */
-  { 0x002618           },                                            /* 2618 */
-  { 0x00267E, 0x00267F },                                       /* 267E-267F */
-  { 0x00268A, 0x002700 },                                       /* 268A-2700 */
-  { 0x002705           },                                            /* 2705 */
-  { 0x00270A, 0x00270B },                                       /* 270A-270B */
-  { 0x002728           },                                            /* 2728 */
-  { 0x00274C           },                                            /* 274C */
-  { 0x00274E           },                                            /* 274E */
-  { 0x002753, 0x002755 },                                       /* 2753-2755 */
-  { 0x002757           },                                            /* 2757 */
-  { 0x00275F, 0x002760 },                                       /* 275F-2760 */
-  { 0x002795, 0x002797 },                                       /* 2795-2797 */
-  { 0x0027B0           },                                            /* 27B0 */
-  { 0x0027BF, 0x0027CF },                                       /* 27BF-27CF */
-  { 0x0027EC, 0x0027EF },                                       /* 27EC-27EF */
-  { 0x002B00, 0x002E7F },                                       /* 2B00-2E7F */
-  { 0x002E9A           },                                            /* 2E9A */
-  { 0x002EF4, 0x002EFF },                                       /* 2EF4-2EFF */
-  { 0x002FD6, 0x002FEF },                                       /* 2FD6-2FEF */
-  { 0x002FFC, 0x002FFF },                                       /* 2FFC-2FFF */
-  { 0x003040           },                                            /* 3040 */
-  { 0x003097, 0x003098 },                                       /* 3097-3098 */
-  { 0x003100, 0x003104 },                                       /* 3100-3104 */
-  { 0x00312D, 0x003130 },                                       /* 312D-3130 */
-  { 0x00318F           },                                            /* 318F */
-  { 0x0031B8, 0x0031EF },                                       /* 31B8-31EF */
-  { 0x00321D, 0x00321F },                                       /* 321D-321F */
-  { 0x003244, 0x003250 },                                       /* 3244-3250 */
-  { 0x00327C, 0x00327E },                                       /* 327C-327E */
-  { 0x0032CC, 0x0032CF },                                       /* 32CC-32CF */
-  { 0x0032FF           },                                            /* 32FF */
-  { 0x003377, 0x00337A },                                       /* 3377-337A */
-  { 0x0033DE, 0x0033DF },                                       /* 33DE-33DF */
-  { 0x0033FF           },                                            /* 33FF */
-  { 0x004DB6, 0x004DFF },                                       /* 4DB6-4DFF */
-  { 0x009FA6, 0x009FFF },                                       /* 9FA6-9FFF */
-  { 0x00A48D, 0x00A48F },                                       /* A48D-A48F */
-  { 0x00A4C7, 0x00ABFF },                                       /* A4C7-ABFF */
-  { 0x00D7A4, 0x00D7FF },                                       /* D7A4-D7FF */
-  { 0x00FA2E, 0x00FA2F },                                       /* FA2E-FA2F */
-  { 0x00FA6B, 0x00FAFF },                                       /* FA6B-FAFF */
-  { 0x00FB07, 0x00FB12 },                                       /* FB07-FB12 */
-  { 0x00FB18, 0x00FB1C },                                       /* FB18-FB1C */
-  { 0x00FB37           },                                            /* FB37 */
-  { 0x00FB3D           },                                            /* FB3D */
-  { 0x00FB3F           },                                            /* FB3F */
-  { 0x00FB42           },                                            /* FB42 */
-  { 0x00FB45           },                                            /* FB45 */
-  { 0x00FBB2, 0x00FBD2 },                                       /* FBB2-FBD2 */
-  { 0x00FD40, 0x00FD4F },                                       /* FD40-FD4F */
-  { 0x00FD90, 0x00FD91 },                                       /* FD90-FD91 */
-  { 0x00FDC8, 0x00FDCF },                                       /* FDC8-FDCF */
-  { 0x00FDFD, 0x00FDFF },                                       /* FDFD-FDFF */
-  { 0x00FE10, 0x00FE1F },                                       /* FE10-FE1F */
-  { 0x00FE24, 0x00FE2F },                                       /* FE24-FE2F */
-  { 0x00FE47, 0x00FE48 },                                       /* FE47-FE48 */
-  { 0x00FE53           },                                            /* FE53 */
-  { 0x00FE67           },                                            /* FE67 */
-  { 0x00FE6C, 0x00FE6F },                                       /* FE6C-FE6F */
-  { 0x00FE75           },                                            /* FE75 */
-  { 0x00FEFD, 0x00FEFE },                                       /* FEFD-FEFE */
-  { 0x00FF00           },                                            /* FF00 */
-  { 0x00FFBF, 0x00FFC1 },                                       /* FFBF-FFC1 */
-  { 0x00FFC8, 0x00FFC9 },                                       /* FFC8-FFC9 */
-  { 0x00FFD0, 0x00FFD1 },                                       /* FFD0-FFD1 */
-  { 0x00FFD8, 0x00FFD9 },                                       /* FFD8-FFD9 */
-  { 0x00FFDD, 0x00FFDF },                                       /* FFDD-FFDF */
-  { 0x00FFE7           },                                            /* FFE7 */
-  { 0x00FFEF, 0x00FFF8 },                                       /* FFEF-FFF8 */
-  { 0x010000, 0x0102FF },                                     /* 10000-102FF */
-  { 0x01031F           },                                           /* 1031F */
-  { 0x010324, 0x01032F },                                     /* 10324-1032F */
-  { 0x01034B, 0x0103FF },                                     /* 1034B-103FF */
-  { 0x010426, 0x010427 },                                     /* 10426-10427 */
-  { 0x01044E, 0x01CFFF },                                     /* 1044E-1CFFF */
-  { 0x01D0F6, 0x01D0FF },                                     /* 1D0F6-1D0FF */
-  { 0x01D127, 0x01D129 },                                     /* 1D127-1D129 */
-  { 0x01D1DE, 0x01D3FF },                                     /* 1D1DE-1D3FF */
-  { 0x01D455           },                                           /* 1D455 */
-  { 0x01D49D           },                                           /* 1D49D */
-  { 0x01D4A0, 0x01D4A1 },                                     /* 1D4A0-1D4A1 */
-  { 0x01D4A3, 0x01D4A4 },                                     /* 1D4A3-1D4A4 */
-  { 0x01D4A7, 0x01D4A8 },                                     /* 1D4A7-1D4A8 */
-  { 0x01D4AD           },                                           /* 1D4AD */
-  { 0x01D4BA           },                                           /* 1D4BA */
-  { 0x01D4BC           },                                           /* 1D4BC */
-  { 0x01D4C1           },                                           /* 1D4C1 */
-  { 0x01D4C4           },                                           /* 1D4C4 */
-  { 0x01D506           },                                           /* 1D506 */
-  { 0x01D50B, 0x01D50C },                                     /* 1D50B-1D50C */
-  { 0x01D515           },                                           /* 1D515 */
-  { 0x01D51D           },                                           /* 1D51D */
-  { 0x01D53A           },                                           /* 1D53A */
-  { 0x01D53F           },                                           /* 1D53F */
-  { 0x01D545           },                                           /* 1D545 */
-  { 0x01D547, 0x01D549 },                                     /* 1D547-1D549 */
-  { 0x01D551           },                                           /* 1D551 */
-  { 0x01D6A4, 0x01D6A7 },                                     /* 1D6A4-1D6A7 */
-  { 0x01D7CA, 0x01D7CD },                                     /* 1D7CA-1D7CD */
-  { 0x01D800, 0x01FFFD },                                     /* 1D800-1FFFD */
-  { 0x02A6D7, 0x02F7FF },                                     /* 2A6D7-2F7FF */
-  { 0x02FA1E, 0x02FFFD },                                     /* 2FA1E-2FFFD */
-  { 0x030000, 0x03FFFD },                                     /* 30000-3FFFD */
-  { 0x040000, 0x04FFFD },                                     /* 40000-4FFFD */
-  { 0x050000, 0x05FFFD },                                     /* 50000-5FFFD */
-  { 0x060000, 0x06FFFD },                                     /* 60000-6FFFD */
-  { 0x070000, 0x07FFFD },                                     /* 70000-7FFFD */
-  { 0x080000, 0x08FFFD },                                     /* 80000-8FFFD */
-  { 0x090000, 0x09FFFD },                                     /* 90000-9FFFD */
-  { 0x0A0000, 0x0AFFFD },                                     /* A0000-AFFFD */
-  { 0x0B0000, 0x0BFFFD },                                     /* B0000-BFFFD */
-  { 0x0C0000, 0x0CFFFD },                                     /* C0000-CFFFD */
-  { 0x0D0000, 0x0DFFFD },                                     /* D0000-DFFFD */
-  { 0x0E0000           },                                           /* E0000 */
-  { 0x0E0002, 0x0E001F },                                     /* E0002-E001F */
-  { 0x0E0080, 0x0EFFFD },                                     /* E0080-EFFFD */
-  { 0 },
-};
-
-
-/*
- * B.1 Commonly mapped to nothing
- * 
- */
-
-const Stringprep_table_element stringprep_rfc3454_B_1[] = {
-  { 0x0000AD           },                          /* 00AD; ; Map to nothing */
-  { 0x00034F           },                          /* 034F; ; Map to nothing */
-  { 0x001806           },                          /* 1806; ; Map to nothing */
-  { 0x00180B           },                          /* 180B; ; Map to nothing */
-  { 0x00180C           },                          /* 180C; ; Map to nothing */
-  { 0x00180D           },                          /* 180D; ; Map to nothing */
-  { 0x00200B           },                          /* 200B; ; Map to nothing */
-  { 0x00200C           },                          /* 200C; ; Map to nothing */
-  { 0x00200D           },                          /* 200D; ; Map to nothing */
-  { 0x002060           },                          /* 2060; ; Map to nothing */
-  { 0x00FE00           },                          /* FE00; ; Map to nothing */
-  { 0x00FE01           },                          /* FE01; ; Map to nothing */
-  { 0x00FE02           },                          /* FE02; ; Map to nothing */
-  { 0x00FE03           },                          /* FE03; ; Map to nothing */
-  { 0x00FE04           },                          /* FE04; ; Map to nothing */
-  { 0x00FE05           },                          /* FE05; ; Map to nothing */
-  { 0x00FE06           },                          /* FE06; ; Map to nothing */
-  { 0x00FE07           },                          /* FE07; ; Map to nothing */
-  { 0x00FE08           },                          /* FE08; ; Map to nothing */
-  { 0x00FE09           },                          /* FE09; ; Map to nothing */
-  { 0x00FE0A           },                          /* FE0A; ; Map to nothing */
-  { 0x00FE0B           },                          /* FE0B; ; Map to nothing */
-  { 0x00FE0C           },                          /* FE0C; ; Map to nothing */
-  { 0x00FE0D           },                          /* FE0D; ; Map to nothing */
-  { 0x00FE0E           },                          /* FE0E; ; Map to nothing */
-  { 0x00FE0F           },                          /* FE0F; ; Map to nothing */
-  { 0x00FEFF           },                          /* FEFF; ; Map to nothing */
-  { 0 },
-};
-
-
-/*
- * B.2 Mapping for case-folding used with NFKC
- * 
- */
-
-const Stringprep_table_element stringprep_rfc3454_B_2[] = {
-  { 0x000041, 0, { 0x000061 }},                      /* 0041; 0061; Case map */
-  { 0x000042, 0, { 0x000062 }},                      /* 0042; 0062; Case map */
-  { 0x000043, 0, { 0x000063 }},                      /* 0043; 0063; Case map */
-  { 0x000044, 0, { 0x000064 }},                      /* 0044; 0064; Case map */
-  { 0x000045, 0, { 0x000065 }},                      /* 0045; 0065; Case map */
-  { 0x000046, 0, { 0x000066 }},                      /* 0046; 0066; Case map */
-  { 0x000047, 0, { 0x000067 }},                      /* 0047; 0067; Case map */
-  { 0x000048, 0, { 0x000068 }},                      /* 0048; 0068; Case map */
-  { 0x000049, 0, { 0x000069 }},                      /* 0049; 0069; Case map */
-  { 0x00004A, 0, { 0x00006A }},                      /* 004A; 006A; Case map */
-  { 0x00004B, 0, { 0x00006B }},                      /* 004B; 006B; Case map */
-  { 0x00004C, 0, { 0x00006C }},                      /* 004C; 006C; Case map */
-  { 0x00004D, 0, { 0x00006D }},                      /* 004D; 006D; Case map */
-  { 0x00004E, 0, { 0x00006E }},                      /* 004E; 006E; Case map */
-  { 0x00004F, 0, { 0x00006F }},                      /* 004F; 006F; Case map */
-  { 0x000050, 0, { 0x000070 }},                      /* 0050; 0070; Case map */
-  { 0x000051, 0, { 0x000071 }},                      /* 0051; 0071; Case map */
-  { 0x000052, 0, { 0x000072 }},                      /* 0052; 0072; Case map */
-  { 0x000053, 0, { 0x000073 }},                      /* 0053; 0073; Case map */
-  { 0x000054, 0, { 0x000074 }},                      /* 0054; 0074; Case map */
-  { 0x000055, 0, { 0x000075 }},                      /* 0055; 0075; Case map */
-  { 0x000056, 0, { 0x000076 }},                      /* 0056; 0076; Case map */
-  { 0x000057, 0, { 0x000077 }},                      /* 0057; 0077; Case map */
-  { 0x000058, 0, { 0x000078 }},                      /* 0058; 0078; Case map */
-  { 0x000059, 0, { 0x000079 }},                      /* 0059; 0079; Case map */
-  { 0x00005A, 0, { 0x00007A }},                      /* 005A; 007A; Case map */
-  { 0x0000B5, 0, { 0x0003BC }},                      /* 00B5; 03BC; Case map */
-  { 0x0000C0, 0, { 0x0000E0 }},                      /* 00C0; 00E0; Case map */
-  { 0x0000C1, 0, { 0x0000E1 }},                      /* 00C1; 00E1; Case map */
-  { 0x0000C2, 0, { 0x0000E2 }},                      /* 00C2; 00E2; Case map */
-  { 0x0000C3, 0, { 0x0000E3 }},                      /* 00C3; 00E3; Case map */
-  { 0x0000C4, 0, { 0x0000E4 }},                      /* 00C4; 00E4; Case map */
-  { 0x0000C5, 0, { 0x0000E5 }},                      /* 00C5; 00E5; Case map */
-  { 0x0000C6, 0, { 0x0000E6 }},                      /* 00C6; 00E6; Case map */
-  { 0x0000C7, 0, { 0x0000E7 }},                      /* 00C7; 00E7; Case map */
-  { 0x0000C8, 0, { 0x0000E8 }},                      /* 00C8; 00E8; Case map */
-  { 0x0000C9, 0, { 0x0000E9 }},                      /* 00C9; 00E9; Case map */
-  { 0x0000CA, 0, { 0x0000EA }},                      /* 00CA; 00EA; Case map */
-  { 0x0000CB, 0, { 0x0000EB }},                      /* 00CB; 00EB; Case map */
-  { 0x0000CC, 0, { 0x0000EC }},                      /* 00CC; 00EC; Case map */
-  { 0x0000CD, 0, { 0x0000ED }},                      /* 00CD; 00ED; Case map */
-  { 0x0000CE, 0, { 0x0000EE }},                      /* 00CE; 00EE; Case map */
-  { 0x0000CF, 0, { 0x0000EF }},                      /* 00CF; 00EF; Case map */
-  { 0x0000D0, 0, { 0x0000F0 }},                      /* 00D0; 00F0; Case map */
-  { 0x0000D1, 0, { 0x0000F1 }},                      /* 00D1; 00F1; Case map */
-  { 0x0000D2, 0, { 0x0000F2 }},                      /* 00D2; 00F2; Case map */
-  { 0x0000D3, 0, { 0x0000F3 }},                      /* 00D3; 00F3; Case map */
-  { 0x0000D4, 0, { 0x0000F4 }},                      /* 00D4; 00F4; Case map */
-  { 0x0000D5, 0, { 0x0000F5 }},                      /* 00D5; 00F5; Case map */
-  { 0x0000D6, 0, { 0x0000F6 }},                      /* 00D6; 00F6; Case map */
-  { 0x0000D8, 0, { 0x0000F8 }},                      /* 00D8; 00F8; Case map */
-  { 0x0000D9, 0, { 0x0000F9 }},                      /* 00D9; 00F9; Case map */
-  { 0x0000DA, 0, { 0x0000FA }},                      /* 00DA; 00FA; Case map */
-  { 0x0000DB, 0, { 0x0000FB }},                      /* 00DB; 00FB; Case map */
-  { 0x0000DC, 0, { 0x0000FC }},                      /* 00DC; 00FC; Case map */
-  { 0x0000DD, 0, { 0x0000FD }},                      /* 00DD; 00FD; Case map */
-  { 0x0000DE, 0, { 0x0000FE }},                      /* 00DE; 00FE; Case map */
-  { 0x0000DF, 0, { 0x000073,                    /* 00DF; 0073 0073; Case map */
-                   0x000073 }},
-  { 0x000100, 0, { 0x000101 }},                      /* 0100; 0101; Case map */
-  { 0x000102, 0, { 0x000103 }},                      /* 0102; 0103; Case map */
-  { 0x000104, 0, { 0x000105 }},                      /* 0104; 0105; Case map */
-  { 0x000106, 0, { 0x000107 }},                      /* 0106; 0107; Case map */
-  { 0x000108, 0, { 0x000109 }},                      /* 0108; 0109; Case map */
-  { 0x00010A, 0, { 0x00010B }},                      /* 010A; 010B; Case map */
-  { 0x00010C, 0, { 0x00010D }},                      /* 010C; 010D; Case map */
-  { 0x00010E, 0, { 0x00010F }},                      /* 010E; 010F; Case map */
-  { 0x000110, 0, { 0x000111 }},                      /* 0110; 0111; Case map */
-  { 0x000112, 0, { 0x000113 }},                      /* 0112; 0113; Case map */
-  { 0x000114, 0, { 0x000115 }},                      /* 0114; 0115; Case map */
-  { 0x000116, 0, { 0x000117 }},                      /* 0116; 0117; Case map */
-  { 0x000118, 0, { 0x000119 }},                      /* 0118; 0119; Case map */
-  { 0x00011A, 0, { 0x00011B }},                      /* 011A; 011B; Case map */
-  { 0x00011C, 0, { 0x00011D }},                      /* 011C; 011D; Case map */
-  { 0x00011E, 0, { 0x00011F }},                      /* 011E; 011F; Case map */
-  { 0x000120, 0, { 0x000121 }},                      /* 0120; 0121; Case map */
-  { 0x000122, 0, { 0x000123 }},                      /* 0122; 0123; Case map */
-  { 0x000124, 0, { 0x000125 }},                      /* 0124; 0125; Case map */
-  { 0x000126, 0, { 0x000127 }},                      /* 0126; 0127; Case map */
-  { 0x000128, 0, { 0x000129 }},                      /* 0128; 0129; Case map */
-  { 0x00012A, 0, { 0x00012B }},                      /* 012A; 012B; Case map */
-  { 0x00012C, 0, { 0x00012D }},                      /* 012C; 012D; Case map */
-  { 0x00012E, 0, { 0x00012F }},                      /* 012E; 012F; Case map */
-  { 0x000130, 0, { 0x000069,                    /* 0130; 0069 0307; Case map */
-                   0x000307 }},
-  { 0x000132, 0, { 0x000133 }},                      /* 0132; 0133; Case map */
-  { 0x000134, 0, { 0x000135 }},                      /* 0134; 0135; Case map */
-  { 0x000136, 0, { 0x000137 }},                      /* 0136; 0137; Case map */
-  { 0x000139, 0, { 0x00013A }},                      /* 0139; 013A; Case map */
-  { 0x00013B, 0, { 0x00013C }},                      /* 013B; 013C; Case map */
-  { 0x00013D, 0, { 0x00013E }},                      /* 013D; 013E; Case map */
-  { 0x00013F, 0, { 0x000140 }},                      /* 013F; 0140; Case map */
-  { 0x000141, 0, { 0x000142 }},                      /* 0141; 0142; Case map */
-  { 0x000143, 0, { 0x000144 }},                      /* 0143; 0144; Case map */
-  { 0x000145, 0, { 0x000146 }},                      /* 0145; 0146; Case map */
-  { 0x000147, 0, { 0x000148 }},                      /* 0147; 0148; Case map */
-  { 0x000149, 0, { 0x0002BC,                    /* 0149; 02BC 006E; Case map */
-                   0x00006E }},
-  { 0x00014A, 0, { 0x00014B }},                      /* 014A; 014B; Case map */
-  { 0x00014C, 0, { 0x00014D }},                      /* 014C; 014D; Case map */
-  { 0x00014E, 0, { 0x00014F }},                      /* 014E; 014F; Case map */
-  { 0x000150, 0, { 0x000151 }},                      /* 0150; 0151; Case map */
-  { 0x000152, 0, { 0x000153 }},                      /* 0152; 0153; Case map */
-  { 0x000154, 0, { 0x000155 }},                      /* 0154; 0155; Case map */
-  { 0x000156, 0, { 0x000157 }},                      /* 0156; 0157; Case map */
-  { 0x000158, 0, { 0x000159 }},                      /* 0158; 0159; Case map */
-  { 0x00015A, 0, { 0x00015B }},                      /* 015A; 015B; Case map */
-  { 0x00015C, 0, { 0x00015D }},                      /* 015C; 015D; Case map */
-  { 0x00015E, 0, { 0x00015F }},                      /* 015E; 015F; Case map */
-  { 0x000160, 0, { 0x000161 }},                      /* 0160; 0161; Case map */
-  { 0x000162, 0, { 0x000163 }},                      /* 0162; 0163; Case map */
-  { 0x000164, 0, { 0x000165 }},                      /* 0164; 0165; Case map */
-  { 0x000166, 0, { 0x000167 }},                      /* 0166; 0167; Case map */
-  { 0x000168, 0, { 0x000169 }},                      /* 0168; 0169; Case map */
-  { 0x00016A, 0, { 0x00016B }},                      /* 016A; 016B; Case map */
-  { 0x00016C, 0, { 0x00016D }},                      /* 016C; 016D; Case map */
-  { 0x00016E, 0, { 0x00016F }},                      /* 016E; 016F; Case map */
-  { 0x000170, 0, { 0x000171 }},                      /* 0170; 0171; Case map */
-  { 0x000172, 0, { 0x000173 }},                      /* 0172; 0173; Case map */
-  { 0x000174, 0, { 0x000175 }},                      /* 0174; 0175; Case map */
-  { 0x000176, 0, { 0x000177 }},                      /* 0176; 0177; Case map */
-  { 0x000178, 0, { 0x0000FF }},                      /* 0178; 00FF; Case map */
-  { 0x000179, 0, { 0x00017A }},                      /* 0179; 017A; Case map */
-  { 0x00017B, 0, { 0x00017C }},                      /* 017B; 017C; Case map */
-  { 0x00017D, 0, { 0x00017E }},                      /* 017D; 017E; Case map */
-  { 0x00017F, 0, { 0x000073 }},                      /* 017F; 0073; Case map */
-  { 0x000181, 0, { 0x000253 }},                      /* 0181; 0253; Case map */
-  { 0x000182, 0, { 0x000183 }},                      /* 0182; 0183; Case map */
-  { 0x000184, 0, { 0x000185 }},                      /* 0184; 0185; Case map */
-  { 0x000186, 0, { 0x000254 }},                      /* 0186; 0254; Case map */
-  { 0x000187, 0, { 0x000188 }},                      /* 0187; 0188; Case map */
-  { 0x000189, 0, { 0x000256 }},                      /* 0189; 0256; Case map */
-  { 0x00018A, 0, { 0x000257 }},                      /* 018A; 0257; Case map */
-  { 0x00018B, 0, { 0x00018C }},                      /* 018B; 018C; Case map */
-  { 0x00018E, 0, { 0x0001DD }},                      /* 018E; 01DD; Case map */
-  { 0x00018F, 0, { 0x000259 }},                      /* 018F; 0259; Case map */
-  { 0x000190, 0, { 0x00025B }},                      /* 0190; 025B; Case map */
-  { 0x000191, 0, { 0x000192 }},                      /* 0191; 0192; Case map */
-  { 0x000193, 0, { 0x000260 }},                      /* 0193; 0260; Case map */
-  { 0x000194, 0, { 0x000263 }},                      /* 0194; 0263; Case map */
-  { 0x000196, 0, { 0x000269 }},                      /* 0196; 0269; Case map */
-  { 0x000197, 0, { 0x000268 }},                      /* 0197; 0268; Case map */
-  { 0x000198, 0, { 0x000199 }},                      /* 0198; 0199; Case map */
-  { 0x00019C, 0, { 0x00026F }},                      /* 019C; 026F; Case map */
-  { 0x00019D, 0, { 0x000272 }},                      /* 019D; 0272; Case map */
-  { 0x00019F, 0, { 0x000275 }},                      /* 019F; 0275; Case map */
-  { 0x0001A0, 0, { 0x0001A1 }},                      /* 01A0; 01A1; Case map */
-  { 0x0001A2, 0, { 0x0001A3 }},                      /* 01A2; 01A3; Case map */
-  { 0x0001A4, 0, { 0x0001A5 }},                      /* 01A4; 01A5; Case map */
-  { 0x0001A6, 0, { 0x000280 }},                      /* 01A6; 0280; Case map */
-  { 0x0001A7, 0, { 0x0001A8 }},                      /* 01A7; 01A8; Case map */
-  { 0x0001A9, 0, { 0x000283 }},                      /* 01A9; 0283; Case map */
-  { 0x0001AC, 0, { 0x0001AD }},                      /* 01AC; 01AD; Case map */
-  { 0x0001AE, 0, { 0x000288 }},                      /* 01AE; 0288; Case map */
-  { 0x0001AF, 0, { 0x0001B0 }},                      /* 01AF; 01B0; Case map */
-  { 0x0001B1, 0, { 0x00028A }},                      /* 01B1; 028A; Case map */
-  { 0x0001B2, 0, { 0x00028B }},                      /* 01B2; 028B; Case map */
-  { 0x0001B3, 0, { 0x0001B4 }},                      /* 01B3; 01B4; Case map */
-  { 0x0001B5, 0, { 0x0001B6 }},                      /* 01B5; 01B6; Case map */
-  { 0x0001B7, 0, { 0x000292 }},                      /* 01B7; 0292; Case map */
-  { 0x0001B8, 0, { 0x0001B9 }},                      /* 01B8; 01B9; Case map */
-  { 0x0001BC, 0, { 0x0001BD }},                      /* 01BC; 01BD; Case map */
-  { 0x0001C4, 0, { 0x0001C6 }},                      /* 01C4; 01C6; Case map */
-  { 0x0001C5, 0, { 0x0001C6 }},                      /* 01C5; 01C6; Case map */
-  { 0x0001C7, 0, { 0x0001C9 }},                      /* 01C7; 01C9; Case map */
-  { 0x0001C8, 0, { 0x0001C9 }},                      /* 01C8; 01C9; Case map */
-  { 0x0001CA, 0, { 0x0001CC }},                      /* 01CA; 01CC; Case map */
-  { 0x0001CB, 0, { 0x0001CC }},                      /* 01CB; 01CC; Case map */
-  { 0x0001CD, 0, { 0x0001CE }},                      /* 01CD; 01CE; Case map */
-  { 0x0001CF, 0, { 0x0001D0 }},                      /* 01CF; 01D0; Case map */
-  { 0x0001D1, 0, { 0x0001D2 }},                      /* 01D1; 01D2; Case map */
-  { 0x0001D3, 0, { 0x0001D4 }},                      /* 01D3; 01D4; Case map */
-  { 0x0001D5, 0, { 0x0001D6 }},                      /* 01D5; 01D6; Case map */
-  { 0x0001D7, 0, { 0x0001D8 }},                      /* 01D7; 01D8; Case map */
-  { 0x0001D9, 0, { 0x0001DA }},                      /* 01D9; 01DA; Case map */
-  { 0x0001DB, 0, { 0x0001DC }},                      /* 01DB; 01DC; Case map */
-  { 0x0001DE, 0, { 0x0001DF }},                      /* 01DE; 01DF; Case map */
-  { 0x0001E0, 0, { 0x0001E1 }},                      /* 01E0; 01E1; Case map */
-  { 0x0001E2, 0, { 0x0001E3 }},                      /* 01E2; 01E3; Case map */
-  { 0x0001E4, 0, { 0x0001E5 }},                      /* 01E4; 01E5; Case map */
-  { 0x0001E6, 0, { 0x0001E7 }},                      /* 01E6; 01E7; Case map */
-  { 0x0001E8, 0, { 0x0001E9 }},                      /* 01E8; 01E9; Case map */
-  { 0x0001EA, 0, { 0x0001EB }},                      /* 01EA; 01EB; Case map */
-  { 0x0001EC, 0, { 0x0001ED }},                      /* 01EC; 01ED; Case map */
-  { 0x0001EE, 0, { 0x0001EF }},                      /* 01EE; 01EF; Case map */
-  { 0x0001F0, 0, { 0x00006A,                    /* 01F0; 006A 030C; Case map */
-                   0x00030C }},
-  { 0x0001F1, 0, { 0x0001F3 }},                      /* 01F1; 01F3; Case map */
-  { 0x0001F2, 0, { 0x0001F3 }},                      /* 01F2; 01F3; Case map */
-  { 0x0001F4, 0, { 0x0001F5 }},                      /* 01F4; 01F5; Case map */
-  { 0x0001F6, 0, { 0x000195 }},                      /* 01F6; 0195; Case map */
-  { 0x0001F7, 0, { 0x0001BF }},                      /* 01F7; 01BF; Case map */
-  { 0x0001F8, 0, { 0x0001F9 }},                      /* 01F8; 01F9; Case map */
-  { 0x0001FA, 0, { 0x0001FB }},                      /* 01FA; 01FB; Case map */
-  { 0x0001FC, 0, { 0x0001FD }},                      /* 01FC; 01FD; Case map */
-  { 0x0001FE, 0, { 0x0001FF }},                      /* 01FE; 01FF; Case map */
-  { 0x000200, 0, { 0x000201 }},                      /* 0200; 0201; Case map */
-  { 0x000202, 0, { 0x000203 }},                      /* 0202; 0203; Case map */
-  { 0x000204, 0, { 0x000205 }},                      /* 0204; 0205; Case map */
-  { 0x000206, 0, { 0x000207 }},                      /* 0206; 0207; Case map */
-  { 0x000208, 0, { 0x000209 }},                      /* 0208; 0209; Case map */
-  { 0x00020A, 0, { 0x00020B }},                      /* 020A; 020B; Case map */
-  { 0x00020C, 0, { 0x00020D }},                      /* 020C; 020D; Case map */
-  { 0x00020E, 0, { 0x00020F }},                      /* 020E; 020F; Case map */
-  { 0x000210, 0, { 0x000211 }},                      /* 0210; 0211; Case map */
-  { 0x000212, 0, { 0x000213 }},                      /* 0212; 0213; Case map */
-  { 0x000214, 0, { 0x000215 }},                      /* 0214; 0215; Case map */
-  { 0x000216, 0, { 0x000217 }},                      /* 0216; 0217; Case map */
-  { 0x000218, 0, { 0x000219 }},                      /* 0218; 0219; Case map */
-  { 0x00021A, 0, { 0x00021B }},                      /* 021A; 021B; Case map */
-  { 0x00021C, 0, { 0x00021D }},                      /* 021C; 021D; Case map */
-  { 0x00021E, 0, { 0x00021F }},                      /* 021E; 021F; Case map */
-  { 0x000220, 0, { 0x00019E }},                      /* 0220; 019E; Case map */
-  { 0x000222, 0, { 0x000223 }},                      /* 0222; 0223; Case map */
-  { 0x000224, 0, { 0x000225 }},                      /* 0224; 0225; Case map */
-  { 0x000226, 0, { 0x000227 }},                      /* 0226; 0227; Case map */
-  { 0x000228, 0, { 0x000229 }},                      /* 0228; 0229; Case map */
-  { 0x00022A, 0, { 0x00022B }},                      /* 022A; 022B; Case map */
-  { 0x00022C, 0, { 0x00022D }},                      /* 022C; 022D; Case map */
-  { 0x00022E, 0, { 0x00022F }},                      /* 022E; 022F; Case map */
-  { 0x000230, 0, { 0x000231 }},                      /* 0230; 0231; Case map */
-  { 0x000232, 0, { 0x000233 }},                      /* 0232; 0233; Case map */
-  { 0x000345, 0, { 0x0003B9 }},                      /* 0345; 03B9; Case map */
-  { 0x00037A, 0, { 0x000020,          /* 037A; 0020 03B9; Additional folding */
-                   0x0003B9 }},
-  { 0x000386, 0, { 0x0003AC }},                      /* 0386; 03AC; Case map */
-  { 0x000388, 0, { 0x0003AD }},                      /* 0388; 03AD; Case map */
-  { 0x000389, 0, { 0x0003AE }},                      /* 0389; 03AE; Case map */
-  { 0x00038A, 0, { 0x0003AF }},                      /* 038A; 03AF; Case map */
-  { 0x00038C, 0, { 0x0003CC }},                      /* 038C; 03CC; Case map */
-  { 0x00038E, 0, { 0x0003CD }},                      /* 038E; 03CD; Case map */
-  { 0x00038F, 0, { 0x0003CE }},                      /* 038F; 03CE; Case map */
-  { 0x000390, 0, { 0x0003B9,               /* 0390; 03B9 0308 0301; Case map */
-                   0x000308, 0x000301 }},
-  { 0x000391, 0, { 0x0003B1 }},                      /* 0391; 03B1; Case map */
-  { 0x000392, 0, { 0x0003B2 }},                      /* 0392; 03B2; Case map */
-  { 0x000393, 0, { 0x0003B3 }},                      /* 0393; 03B3; Case map */
-  { 0x000394, 0, { 0x0003B4 }},                      /* 0394; 03B4; Case map */
-  { 0x000395, 0, { 0x0003B5 }},                      /* 0395; 03B5; Case map */
-  { 0x000396, 0, { 0x0003B6 }},                      /* 0396; 03B6; Case map */
-  { 0x000397, 0, { 0x0003B7 }},                      /* 0397; 03B7; Case map */
-  { 0x000398, 0, { 0x0003B8 }},                      /* 0398; 03B8; Case map */
-  { 0x000399, 0, { 0x0003B9 }},                      /* 0399; 03B9; Case map */
-  { 0x00039A, 0, { 0x0003BA }},                      /* 039A; 03BA; Case map */
-  { 0x00039B, 0, { 0x0003BB }},                      /* 039B; 03BB; Case map */
-  { 0x00039C, 0, { 0x0003BC }},                      /* 039C; 03BC; Case map */
-  { 0x00039D, 0, { 0x0003BD }},                      /* 039D; 03BD; Case map */
-  { 0x00039E, 0, { 0x0003BE }},                      /* 039E; 03BE; Case map */
-  { 0x00039F, 0, { 0x0003BF }},                      /* 039F; 03BF; Case map */
-  { 0x0003A0, 0, { 0x0003C0 }},                      /* 03A0; 03C0; Case map */
-  { 0x0003A1, 0, { 0x0003C1 }},                      /* 03A1; 03C1; Case map */
-  { 0x0003A3, 0, { 0x0003C3 }},                      /* 03A3; 03C3; Case map */
-  { 0x0003A4, 0, { 0x0003C4 }},                      /* 03A4; 03C4; Case map */
-  { 0x0003A5, 0, { 0x0003C5 }},                      /* 03A5; 03C5; Case map */
-  { 0x0003A6, 0, { 0x0003C6 }},                      /* 03A6; 03C6; Case map */
-  { 0x0003A7, 0, { 0x0003C7 }},                      /* 03A7; 03C7; Case map */
-  { 0x0003A8, 0, { 0x0003C8 }},                      /* 03A8; 03C8; Case map */
-  { 0x0003A9, 0, { 0x0003C9 }},                      /* 03A9; 03C9; Case map */
-  { 0x0003AA, 0, { 0x0003CA }},                      /* 03AA; 03CA; Case map */
-  { 0x0003AB, 0, { 0x0003CB }},                      /* 03AB; 03CB; Case map */
-  { 0x0003B0, 0, { 0x0003C5,               /* 03B0; 03C5 0308 0301; Case map */
-                   0x000308, 0x000301 }},
-  { 0x0003C2, 0, { 0x0003C3 }},                      /* 03C2; 03C3; Case map */
-  { 0x0003D0, 0, { 0x0003B2 }},                      /* 03D0; 03B2; Case map */
-  { 0x0003D1, 0, { 0x0003B8 }},                      /* 03D1; 03B8; Case map */
-  { 0x0003D2, 0, { 0x0003C5 }},            /* 03D2; 03C5; Additional folding */
-  { 0x0003D3, 0, { 0x0003CD }},            /* 03D3; 03CD; Additional folding */
-  { 0x0003D4, 0, { 0x0003CB }},            /* 03D4; 03CB; Additional folding */
-  { 0x0003D5, 0, { 0x0003C6 }},                      /* 03D5; 03C6; Case map */
-  { 0x0003D6, 0, { 0x0003C0 }},                      /* 03D6; 03C0; Case map */
-  { 0x0003D8, 0, { 0x0003D9 }},                      /* 03D8; 03D9; Case map */
-  { 0x0003DA, 0, { 0x0003DB }},                      /* 03DA; 03DB; Case map */
-  { 0x0003DC, 0, { 0x0003DD }},                      /* 03DC; 03DD; Case map */
-  { 0x0003DE, 0, { 0x0003DF }},                      /* 03DE; 03DF; Case map */
-  { 0x0003E0, 0, { 0x0003E1 }},                      /* 03E0; 03E1; Case map */
-  { 0x0003E2, 0, { 0x0003E3 }},                      /* 03E2; 03E3; Case map */
-  { 0x0003E4, 0, { 0x0003E5 }},                      /* 03E4; 03E5; Case map */
-  { 0x0003E6, 0, { 0x0003E7 }},                      /* 03E6; 03E7; Case map */
-  { 0x0003E8, 0, { 0x0003E9 }},                      /* 03E8; 03E9; Case map */
-  { 0x0003EA, 0, { 0x0003EB }},                      /* 03EA; 03EB; Case map */
-  { 0x0003EC, 0, { 0x0003ED }},                      /* 03EC; 03ED; Case map */
-  { 0x0003EE, 0, { 0x0003EF }},                      /* 03EE; 03EF; Case map */
-  { 0x0003F0, 0, { 0x0003BA }},                      /* 03F0; 03BA; Case map */
-  { 0x0003F1, 0, { 0x0003C1 }},                      /* 03F1; 03C1; Case map */
-  { 0x0003F2, 0, { 0x0003C3 }},                      /* 03F2; 03C3; Case map */
-  { 0x0003F4, 0, { 0x0003B8 }},                      /* 03F4; 03B8; Case map */
-  { 0x0003F5, 0, { 0x0003B5 }},                      /* 03F5; 03B5; Case map */
-  { 0x000400, 0, { 0x000450 }},                      /* 0400; 0450; Case map */
-  { 0x000401, 0, { 0x000451 }},                      /* 0401; 0451; Case map */
-  { 0x000402, 0, { 0x000452 }},                      /* 0402; 0452; Case map */
-  { 0x000403, 0, { 0x000453 }},                      /* 0403; 0453; Case map */
-  { 0x000404, 0, { 0x000454 }},                      /* 0404; 0454; Case map */
-  { 0x000405, 0, { 0x000455 }},                      /* 0405; 0455; Case map */
-  { 0x000406, 0, { 0x000456 }},                      /* 0406; 0456; Case map */
-  { 0x000407, 0, { 0x000457 }},                      /* 0407; 0457; Case map */
-  { 0x000408, 0, { 0x000458 }},                      /* 0408; 0458; Case map */
-  { 0x000409, 0, { 0x000459 }},                      /* 0409; 0459; Case map */
-  { 0x00040A, 0, { 0x00045A }},                      /* 040A; 045A; Case map */
-  { 0x00040B, 0, { 0x00045B }},                      /* 040B; 045B; Case map */
-  { 0x00040C, 0, { 0x00045C }},                      /* 040C; 045C; Case map */
-  { 0x00040D, 0, { 0x00045D }},                      /* 040D; 045D; Case map */
-  { 0x00040E, 0, { 0x00045E }},                      /* 040E; 045E; Case map */
-  { 0x00040F, 0, { 0x00045F }},                      /* 040F; 045F; Case map */
-  { 0x000410, 0, { 0x000430 }},                      /* 0410; 0430; Case map */
-  { 0x000411, 0, { 0x000431 }},                      /* 0411; 0431; Case map */
-  { 0x000412, 0, { 0x000432 }},                      /* 0412; 0432; Case map */
-  { 0x000413, 0, { 0x000433 }},                      /* 0413; 0433; Case map */
-  { 0x000414, 0, { 0x000434 }},                      /* 0414; 0434; Case map */
-  { 0x000415, 0, { 0x000435 }},                      /* 0415; 0435; Case map */
-  { 0x000416, 0, { 0x000436 }},                      /* 0416; 0436; Case map */
-  { 0x000417, 0, { 0x000437 }},                      /* 0417; 0437; Case map */
-  { 0x000418, 0, { 0x000438 }},                      /* 0418; 0438; Case map */
-  { 0x000419, 0, { 0x000439 }},                      /* 0419; 0439; Case map */
-  { 0x00041A, 0, { 0x00043A }},                      /* 041A; 043A; Case map */
-  { 0x00041B, 0, { 0x00043B }},                      /* 041B; 043B; Case map */
-  { 0x00041C, 0, { 0x00043C }},                      /* 041C; 043C; Case map */
-  { 0x00041D, 0, { 0x00043D }},                      /* 041D; 043D; Case map */
-  { 0x00041E, 0, { 0x00043E }},                      /* 041E; 043E; Case map */
-  { 0x00041F, 0, { 0x00043F }},                      /* 041F; 043F; Case map */
-  { 0x000420, 0, { 0x000440 }},                      /* 0420; 0440; Case map */
-  { 0x000421, 0, { 0x000441 }},                      /* 0421; 0441; Case map */
-  { 0x000422, 0, { 0x000442 }},                      /* 0422; 0442; Case map */
-  { 0x000423, 0, { 0x000443 }},                      /* 0423; 0443; Case map */
-  { 0x000424, 0, { 0x000444 }},                      /* 0424; 0444; Case map */
-  { 0x000425, 0, { 0x000445 }},                      /* 0425; 0445; Case map */
-  { 0x000426, 0, { 0x000446 }},                      /* 0426; 0446; Case map */
-  { 0x000427, 0, { 0x000447 }},                      /* 0427; 0447; Case map */
-  { 0x000428, 0, { 0x000448 }},                      /* 0428; 0448; Case map */
-  { 0x000429, 0, { 0x000449 }},                      /* 0429; 0449; Case map */
-  { 0x00042A, 0, { 0x00044A }},                      /* 042A; 044A; Case map */
-  { 0x00042B, 0, { 0x00044B }},                      /* 042B; 044B; Case map */
-  { 0x00042C, 0, { 0x00044C }},                      /* 042C; 044C; Case map */
-  { 0x00042D, 0, { 0x00044D }},                      /* 042D; 044D; Case map */
-  { 0x00042E, 0, { 0x00044E }},                      /* 042E; 044E; Case map */
-  { 0x00042F, 0, { 0x00044F }},                      /* 042F; 044F; Case map */
-  { 0x000460, 0, { 0x000461 }},                      /* 0460; 0461; Case map */
-  { 0x000462, 0, { 0x000463 }},                      /* 0462; 0463; Case map */
-  { 0x000464, 0, { 0x000465 }},                      /* 0464; 0465; Case map */
-  { 0x000466, 0, { 0x000467 }},                      /* 0466; 0467; Case map */
-  { 0x000468, 0, { 0x000469 }},                      /* 0468; 0469; Case map */
-  { 0x00046A, 0, { 0x00046B }},                      /* 046A; 046B; Case map */
-  { 0x00046C, 0, { 0x00046D }},                      /* 046C; 046D; Case map */
-  { 0x00046E, 0, { 0x00046F }},                      /* 046E; 046F; Case map */
-  { 0x000470, 0, { 0x000471 }},                      /* 0470; 0471; Case map */
-  { 0x000472, 0, { 0x000473 }},                      /* 0472; 0473; Case map */
-  { 0x000474, 0, { 0x000475 }},                      /* 0474; 0475; Case map */
-  { 0x000476, 0, { 0x000477 }},                      /* 0476; 0477; Case map */
-  { 0x000478, 0, { 0x000479 }},                      /* 0478; 0479; Case map */
-  { 0x00047A, 0, { 0x00047B }},                      /* 047A; 047B; Case map */
-  { 0x00047C, 0, { 0x00047D }},                      /* 047C; 047D; Case map */
-  { 0x00047E, 0, { 0x00047F }},                      /* 047E; 047F; Case map */
-  { 0x000480, 0, { 0x000481 }},                      /* 0480; 0481; Case map */
-  { 0x00048A, 0, { 0x00048B }},                      /* 048A; 048B; Case map */
-  { 0x00048C, 0, { 0x00048D }},                      /* 048C; 048D; Case map */
-  { 0x00048E, 0, { 0x00048F }},                      /* 048E; 048F; Case map */
-  { 0x000490, 0, { 0x000491 }},                      /* 0490; 0491; Case map */
-  { 0x000492, 0, { 0x000493 }},                      /* 0492; 0493; Case map */
-  { 0x000494, 0, { 0x000495 }},                      /* 0494; 0495; Case map */
-  { 0x000496, 0, { 0x000497 }},                      /* 0496; 0497; Case map */
-  { 0x000498, 0, { 0x000499 }},                      /* 0498; 0499; Case map */
-  { 0x00049A, 0, { 0x00049B }},                      /* 049A; 049B; Case map */
-  { 0x00049C, 0, { 0x00049D }},                      /* 049C; 049D; Case map */
-  { 0x00049E, 0, { 0x00049F }},                      /* 049E; 049F; Case map */
-  { 0x0004A0, 0, { 0x0004A1 }},                      /* 04A0; 04A1; Case map */
-  { 0x0004A2, 0, { 0x0004A3 }},                      /* 04A2; 04A3; Case map */
-  { 0x0004A4, 0, { 0x0004A5 }},                      /* 04A4; 04A5; Case map */
-  { 0x0004A6, 0, { 0x0004A7 }},                      /* 04A6; 04A7; Case map */
-  { 0x0004A8, 0, { 0x0004A9 }},                      /* 04A8; 04A9; Case map */
-  { 0x0004AA, 0, { 0x0004AB }},                      /* 04AA; 04AB; Case map */
-  { 0x0004AC, 0, { 0x0004AD }},                      /* 04AC; 04AD; Case map */
-  { 0x0004AE, 0, { 0x0004AF }},                      /* 04AE; 04AF; Case map */
-  { 0x0004B0, 0, { 0x0004B1 }},                      /* 04B0; 04B1; Case map */
-  { 0x0004B2, 0, { 0x0004B3 }},                      /* 04B2; 04B3; Case map */
-  { 0x0004B4, 0, { 0x0004B5 }},                      /* 04B4; 04B5; Case map */
-  { 0x0004B6, 0, { 0x0004B7 }},                      /* 04B6; 04B7; Case map */
-  { 0x0004B8, 0, { 0x0004B9 }},                      /* 04B8; 04B9; Case map */
-  { 0x0004BA, 0, { 0x0004BB }},                      /* 04BA; 04BB; Case map */
-  { 0x0004BC, 0, { 0x0004BD }},                      /* 04BC; 04BD; Case map */
-  { 0x0004BE, 0, { 0x0004BF }},                      /* 04BE; 04BF; Case map */
-  { 0x0004C1, 0, { 0x0004C2 }},                      /* 04C1; 04C2; Case map */
-  { 0x0004C3, 0, { 0x0004C4 }},                      /* 04C3; 04C4; Case map */
-  { 0x0004C5, 0, { 0x0004C6 }},                      /* 04C5; 04C6; Case map */
-  { 0x0004C7, 0, { 0x0004C8 }},                      /* 04C7; 04C8; Case map */
-  { 0x0004C9, 0, { 0x0004CA }},                      /* 04C9; 04CA; Case map */
-  { 0x0004CB, 0, { 0x0004CC }},                      /* 04CB; 04CC; Case map */
-  { 0x0004CD, 0, { 0x0004CE }},                      /* 04CD; 04CE; Case map */
-  { 0x0004D0, 0, { 0x0004D1 }},                      /* 04D0; 04D1; Case map */
-  { 0x0004D2, 0, { 0x0004D3 }},                      /* 04D2; 04D3; Case map */
-  { 0x0004D4, 0, { 0x0004D5 }},                      /* 04D4; 04D5; Case map */
-  { 0x0004D6, 0, { 0x0004D7 }},                      /* 04D6; 04D7; Case map */
-  { 0x0004D8, 0, { 0x0004D9 }},                      /* 04D8; 04D9; Case map */
-  { 0x0004DA, 0, { 0x0004DB }},                      /* 04DA; 04DB; Case map */
-  { 0x0004DC, 0, { 0x0004DD }},                      /* 04DC; 04DD; Case map */
-  { 0x0004DE, 0, { 0x0004DF }},                      /* 04DE; 04DF; Case map */
-  { 0x0004E0, 0, { 0x0004E1 }},                      /* 04E0; 04E1; Case map */
-  { 0x0004E2, 0, { 0x0004E3 }},                      /* 04E2; 04E3; Case map */
-  { 0x0004E4, 0, { 0x0004E5 }},                      /* 04E4; 04E5; Case map */
-  { 0x0004E6, 0, { 0x0004E7 }},                      /* 04E6; 04E7; Case map */
-  { 0x0004E8, 0, { 0x0004E9 }},                      /* 04E8; 04E9; Case map */
-  { 0x0004EA, 0, { 0x0004EB }},                      /* 04EA; 04EB; Case map */
-  { 0x0004EC, 0, { 0x0004ED }},                      /* 04EC; 04ED; Case map */
-  { 0x0004EE, 0, { 0x0004EF }},                      /* 04EE; 04EF; Case map */
-  { 0x0004F0, 0, { 0x0004F1 }},                      /* 04F0; 04F1; Case map */
-  { 0x0004F2, 0, { 0x0004F3 }},                      /* 04F2; 04F3; Case map */
-  { 0x0004F4, 0, { 0x0004F5 }},                      /* 04F4; 04F5; Case map */
-  { 0x0004F8, 0, { 0x0004F9 }},                      /* 04F8; 04F9; Case map */
-  { 0x000500, 0, { 0x000501 }},                      /* 0500; 0501; Case map */
-  { 0x000502, 0, { 0x000503 }},                      /* 0502; 0503; Case map */
-  { 0x000504, 0, { 0x000505 }},                      /* 0504; 0505; Case map */
-  { 0x000506, 0, { 0x000507 }},                      /* 0506; 0507; Case map */
-  { 0x000508, 0, { 0x000509 }},                      /* 0508; 0509; Case map */
-  { 0x00050A, 0, { 0x00050B }},                      /* 050A; 050B; Case map */
-  { 0x00050C, 0, { 0x00050D }},                      /* 050C; 050D; Case map */
-  { 0x00050E, 0, { 0x00050F }},                      /* 050E; 050F; Case map */
-  { 0x000531, 0, { 0x000561 }},                      /* 0531; 0561; Case map */
-  { 0x000532, 0, { 0x000562 }},                      /* 0532; 0562; Case map */
-  { 0x000533, 0, { 0x000563 }},                      /* 0533; 0563; Case map */
-  { 0x000534, 0, { 0x000564 }},                      /* 0534; 0564; Case map */
-  { 0x000535, 0, { 0x000565 }},                      /* 0535; 0565; Case map */
-  { 0x000536, 0, { 0x000566 }},                      /* 0536; 0566; Case map */
-  { 0x000537, 0, { 0x000567 }},                      /* 0537; 0567; Case map */
-  { 0x000538, 0, { 0x000568 }},                      /* 0538; 0568; Case map */
-  { 0x000539, 0, { 0x000569 }},                      /* 0539; 0569; Case map */
-  { 0x00053A, 0, { 0x00056A }},                      /* 053A; 056A; Case map */
-  { 0x00053B, 0, { 0x00056B }},                      /* 053B; 056B; Case map */
-  { 0x00053C, 0, { 0x00056C }},                      /* 053C; 056C; Case map */
-  { 0x00053D, 0, { 0x00056D }},                      /* 053D; 056D; Case map */
-  { 0x00053E, 0, { 0x00056E }},                      /* 053E; 056E; Case map */
-  { 0x00053F, 0, { 0x00056F }},                      /* 053F; 056F; Case map */
-  { 0x000540, 0, { 0x000570 }},                      /* 0540; 0570; Case map */
-  { 0x000541, 0, { 0x000571 }},                      /* 0541; 0571; Case map */
-  { 0x000542, 0, { 0x000572 }},                      /* 0542; 0572; Case map */
-  { 0x000543, 0, { 0x000573 }},                      /* 0543; 0573; Case map */
-  { 0x000544, 0, { 0x000574 }},                      /* 0544; 0574; Case map */
-  { 0x000545, 0, { 0x000575 }},                      /* 0545; 0575; Case map */
-  { 0x000546, 0, { 0x000576 }},                      /* 0546; 0576; Case map */
-  { 0x000547, 0, { 0x000577 }},                      /* 0547; 0577; Case map */
-  { 0x000548, 0, { 0x000578 }},                      /* 0548; 0578; Case map */
-  { 0x000549, 0, { 0x000579 }},                      /* 0549; 0579; Case map */
-  { 0x00054A, 0, { 0x00057A }},                      /* 054A; 057A; Case map */
-  { 0x00054B, 0, { 0x00057B }},                      /* 054B; 057B; Case map */
-  { 0x00054C, 0, { 0x00057C }},                      /* 054C; 057C; Case map */
-  { 0x00054D, 0, { 0x00057D }},                      /* 054D; 057D; Case map */
-  { 0x00054E, 0, { 0x00057E }},                      /* 054E; 057E; Case map */
-  { 0x00054F, 0, { 0x00057F }},                      /* 054F; 057F; Case map */
-  { 0x000550, 0, { 0x000580 }},                      /* 0550; 0580; Case map */
-  { 0x000551, 0, { 0x000581 }},                      /* 0551; 0581; Case map */
-  { 0x000552, 0, { 0x000582 }},                      /* 0552; 0582; Case map */
-  { 0x000553, 0, { 0x000583 }},                      /* 0553; 0583; Case map */
-  { 0x000554, 0, { 0x000584 }},                      /* 0554; 0584; Case map */
-  { 0x000555, 0, { 0x000585 }},                      /* 0555; 0585; Case map */
-  { 0x000556, 0, { 0x000586 }},                      /* 0556; 0586; Case map */
-  { 0x000587, 0, { 0x000565,                    /* 0587; 0565 0582; Case map */
-                   0x000582 }},
-  { 0x001E00, 0, { 0x001E01 }},                      /* 1E00; 1E01; Case map */
-  { 0x001E02, 0, { 0x001E03 }},                      /* 1E02; 1E03; Case map */
-  { 0x001E04, 0, { 0x001E05 }},                      /* 1E04; 1E05; Case map */
-  { 0x001E06, 0, { 0x001E07 }},                      /* 1E06; 1E07; Case map */
-  { 0x001E08, 0, { 0x001E09 }},                      /* 1E08; 1E09; Case map */
-  { 0x001E0A, 0, { 0x001E0B }},                      /* 1E0A; 1E0B; Case map */
-  { 0x001E0C, 0, { 0x001E0D }},                      /* 1E0C; 1E0D; Case map */
-  { 0x001E0E, 0, { 0x001E0F }},                      /* 1E0E; 1E0F; Case map */
-  { 0x001E10, 0, { 0x001E11 }},                      /* 1E10; 1E11; Case map */
-  { 0x001E12, 0, { 0x001E13 }},                      /* 1E12; 1E13; Case map */
-  { 0x001E14, 0, { 0x001E15 }},                      /* 1E14; 1E15; Case map */
-  { 0x001E16, 0, { 0x001E17 }},                      /* 1E16; 1E17; Case map */
-  { 0x001E18, 0, { 0x001E19 }},                      /* 1E18; 1E19; Case map */
-  { 0x001E1A, 0, { 0x001E1B }},                      /* 1E1A; 1E1B; Case map */
-  { 0x001E1C, 0, { 0x001E1D }},                      /* 1E1C; 1E1D; Case map */
-  { 0x001E1E, 0, { 0x001E1F }},                      /* 1E1E; 1E1F; Case map */
-  { 0x001E20, 0, { 0x001E21 }},                      /* 1E20; 1E21; Case map */
-  { 0x001E22, 0, { 0x001E23 }},                      /* 1E22; 1E23; Case map */
-  { 0x001E24, 0, { 0x001E25 }},                      /* 1E24; 1E25; Case map */
-  { 0x001E26, 0, { 0x001E27 }},                      /* 1E26; 1E27; Case map */
-  { 0x001E28, 0, { 0x001E29 }},                      /* 1E28; 1E29; Case map */
-  { 0x001E2A, 0, { 0x001E2B }},                      /* 1E2A; 1E2B; Case map */
-  { 0x001E2C, 0, { 0x001E2D }},                      /* 1E2C; 1E2D; Case map */
-  { 0x001E2E, 0, { 0x001E2F }},                      /* 1E2E; 1E2F; Case map */
-  { 0x001E30, 0, { 0x001E31 }},                      /* 1E30; 1E31; Case map */
-  { 0x001E32, 0, { 0x001E33 }},                      /* 1E32; 1E33; Case map */
-  { 0x001E34, 0, { 0x001E35 }},                      /* 1E34; 1E35; Case map */
-  { 0x001E36, 0, { 0x001E37 }},                      /* 1E36; 1E37; Case map */
-  { 0x001E38, 0, { 0x001E39 }},                      /* 1E38; 1E39; Case map */
-  { 0x001E3A, 0, { 0x001E3B }},                      /* 1E3A; 1E3B; Case map */
-  { 0x001E3C, 0, { 0x001E3D }},                      /* 1E3C; 1E3D; Case map */
-  { 0x001E3E, 0, { 0x001E3F }},                      /* 1E3E; 1E3F; Case map */
-  { 0x001E40, 0, { 0x001E41 }},                      /* 1E40; 1E41; Case map */
-  { 0x001E42, 0, { 0x001E43 }},                      /* 1E42; 1E43; Case map */
-  { 0x001E44, 0, { 0x001E45 }},                      /* 1E44; 1E45; Case map */
-  { 0x001E46, 0, { 0x001E47 }},                      /* 1E46; 1E47; Case map */
-  { 0x001E48, 0, { 0x001E49 }},                      /* 1E48; 1E49; Case map */
-  { 0x001E4A, 0, { 0x001E4B }},                      /* 1E4A; 1E4B; Case map */
-  { 0x001E4C, 0, { 0x001E4D }},                      /* 1E4C; 1E4D; Case map */
-  { 0x001E4E, 0, { 0x001E4F }},                      /* 1E4E; 1E4F; Case map */
-  { 0x001E50, 0, { 0x001E51 }},                      /* 1E50; 1E51; Case map */
-  { 0x001E52, 0, { 0x001E53 }},                      /* 1E52; 1E53; Case map */
-  { 0x001E54, 0, { 0x001E55 }},                      /* 1E54; 1E55; Case map */
-  { 0x001E56, 0, { 0x001E57 }},                      /* 1E56; 1E57; Case map */
-  { 0x001E58, 0, { 0x001E59 }},                      /* 1E58; 1E59; Case map */
-  { 0x001E5A, 0, { 0x001E5B }},                      /* 1E5A; 1E5B; Case map */
-  { 0x001E5C, 0, { 0x001E5D }},                      /* 1E5C; 1E5D; Case map */
-  { 0x001E5E, 0, { 0x001E5F }},                      /* 1E5E; 1E5F; Case map */
-  { 0x001E60, 0, { 0x001E61 }},                      /* 1E60; 1E61; Case map */
-  { 0x001E62, 0, { 0x001E63 }},                      /* 1E62; 1E63; Case map */
-  { 0x001E64, 0, { 0x001E65 }},                      /* 1E64; 1E65; Case map */
-  { 0x001E66, 0, { 0x001E67 }},                      /* 1E66; 1E67; Case map */
-  { 0x001E68, 0, { 0x001E69 }},                      /* 1E68; 1E69; Case map */
-  { 0x001E6A, 0, { 0x001E6B }},                      /* 1E6A; 1E6B; Case map */
-  { 0x001E6C, 0, { 0x001E6D }},                      /* 1E6C; 1E6D; Case map */
-  { 0x001E6E, 0, { 0x001E6F }},                      /* 1E6E; 1E6F; Case map */
-  { 0x001E70, 0, { 0x001E71 }},                      /* 1E70; 1E71; Case map */
-  { 0x001E72, 0, { 0x001E73 }},                      /* 1E72; 1E73; Case map */
-  { 0x001E74, 0, { 0x001E75 }},                      /* 1E74; 1E75; Case map */
-  { 0x001E76, 0, { 0x001E77 }},                      /* 1E76; 1E77; Case map */
-  { 0x001E78, 0, { 0x001E79 }},                      /* 1E78; 1E79; Case map */
-  { 0x001E7A, 0, { 0x001E7B }},                      /* 1E7A; 1E7B; Case map */
-  { 0x001E7C, 0, { 0x001E7D }},                      /* 1E7C; 1E7D; Case map */
-  { 0x001E7E, 0, { 0x001E7F }},                      /* 1E7E; 1E7F; Case map */
-  { 0x001E80, 0, { 0x001E81 }},                      /* 1E80; 1E81; Case map */
-  { 0x001E82, 0, { 0x001E83 }},                      /* 1E82; 1E83; Case map */
-  { 0x001E84, 0, { 0x001E85 }},                      /* 1E84; 1E85; Case map */
-  { 0x001E86, 0, { 0x001E87 }},                      /* 1E86; 1E87; Case map */
-  { 0x001E88, 0, { 0x001E89 }},                      /* 1E88; 1E89; Case map */
-  { 0x001E8A, 0, { 0x001E8B }},                      /* 1E8A; 1E8B; Case map */
-  { 0x001E8C, 0, { 0x001E8D }},                      /* 1E8C; 1E8D; Case map */
-  { 0x001E8E, 0, { 0x001E8F }},                      /* 1E8E; 1E8F; Case map */
-  { 0x001E90, 0, { 0x001E91 }},                      /* 1E90; 1E91; Case map */
-  { 0x001E92, 0, { 0x001E93 }},                      /* 1E92; 1E93; Case map */
-  { 0x001E94, 0, { 0x001E95 }},                      /* 1E94; 1E95; Case map */
-  { 0x001E96, 0, { 0x000068,                    /* 1E96; 0068 0331; Case map */
-                   0x000331 }},
-  { 0x001E97, 0, { 0x000074,                    /* 1E97; 0074 0308; Case map */
-                   0x000308 }},
-  { 0x001E98, 0, { 0x000077,                    /* 1E98; 0077 030A; Case map */
-                   0x00030A }},
-  { 0x001E99, 0, { 0x000079,                    /* 1E99; 0079 030A; Case map */
-                   0x00030A }},
-  { 0x001E9A, 0, { 0x000061,                    /* 1E9A; 0061 02BE; Case map */
-                   0x0002BE }},
-  { 0x001E9B, 0, { 0x001E61 }},                      /* 1E9B; 1E61; Case map */
-  { 0x001EA0, 0, { 0x001EA1 }},                      /* 1EA0; 1EA1; Case map */
-  { 0x001EA2, 0, { 0x001EA3 }},                      /* 1EA2; 1EA3; Case map */
-  { 0x001EA4, 0, { 0x001EA5 }},                      /* 1EA4; 1EA5; Case map */
-  { 0x001EA6, 0, { 0x001EA7 }},                      /* 1EA6; 1EA7; Case map */
-  { 0x001EA8, 0, { 0x001EA9 }},                      /* 1EA8; 1EA9; Case map */
-  { 0x001EAA, 0, { 0x001EAB }},                      /* 1EAA; 1EAB; Case map */
-  { 0x001EAC, 0, { 0x001EAD }},                      /* 1EAC; 1EAD; Case map */
-  { 0x001EAE, 0, { 0x001EAF }},                      /* 1EAE; 1EAF; Case map */
-  { 0x001EB0, 0, { 0x001EB1 }},                      /* 1EB0; 1EB1; Case map */
-  { 0x001EB2, 0, { 0x001EB3 }},                      /* 1EB2; 1EB3; Case map */
-  { 0x001EB4, 0, { 0x001EB5 }},                      /* 1EB4; 1EB5; Case map */
-  { 0x001EB6, 0, { 0x001EB7 }},                      /* 1EB6; 1EB7; Case map */
-  { 0x001EB8, 0, { 0x001EB9 }},                      /* 1EB8; 1EB9; Case map */
-  { 0x001EBA, 0, { 0x001EBB }},                      /* 1EBA; 1EBB; Case map */
-  { 0x001EBC, 0, { 0x001EBD }},                      /* 1EBC; 1EBD; Case map */
-  { 0x001EBE, 0, { 0x001EBF }},                      /* 1EBE; 1EBF; Case map */
-  { 0x001EC0, 0, { 0x001EC1 }},                      /* 1EC0; 1EC1; Case map */
-  { 0x001EC2, 0, { 0x001EC3 }},                      /* 1EC2; 1EC3; Case map */
-  { 0x001EC4, 0, { 0x001EC5 }},                      /* 1EC4; 1EC5; Case map */
-  { 0x001EC6, 0, { 0x001EC7 }},                      /* 1EC6; 1EC7; Case map */
-  { 0x001EC8, 0, { 0x001EC9 }},                      /* 1EC8; 1EC9; Case map */
-  { 0x001ECA, 0, { 0x001ECB }},                      /* 1ECA; 1ECB; Case map */
-  { 0x001ECC, 0, { 0x001ECD }},                      /* 1ECC; 1ECD; Case map */
-  { 0x001ECE, 0, { 0x001ECF }},                      /* 1ECE; 1ECF; Case map */
-  { 0x001ED0, 0, { 0x001ED1 }},                      /* 1ED0; 1ED1; Case map */
-  { 0x001ED2, 0, { 0x001ED3 }},                      /* 1ED2; 1ED3; Case map */
-  { 0x001ED4, 0, { 0x001ED5 }},                      /* 1ED4; 1ED5; Case map */
-  { 0x001ED6, 0, { 0x001ED7 }},                      /* 1ED6; 1ED7; Case map */
-  { 0x001ED8, 0, { 0x001ED9 }},                      /* 1ED8; 1ED9; Case map */
-  { 0x001EDA, 0, { 0x001EDB }},                      /* 1EDA; 1EDB; Case map */
-  { 0x001EDC, 0, { 0x001EDD }},                      /* 1EDC; 1EDD; Case map */
-  { 0x001EDE, 0, { 0x001EDF }},                      /* 1EDE; 1EDF; Case map */
-  { 0x001EE0, 0, { 0x001EE1 }},                      /* 1EE0; 1EE1; Case map */
-  { 0x001EE2, 0, { 0x001EE3 }},                      /* 1EE2; 1EE3; Case map */
-  { 0x001EE4, 0, { 0x001EE5 }},                      /* 1EE4; 1EE5; Case map */
-  { 0x001EE6, 0, { 0x001EE7 }},                      /* 1EE6; 1EE7; Case map */
-  { 0x001EE8, 0, { 0x001EE9 }},                      /* 1EE8; 1EE9; Case map */
-  { 0x001EEA, 0, { 0x001EEB }},                      /* 1EEA; 1EEB; Case map */
-  { 0x001EEC, 0, { 0x001EED }},                      /* 1EEC; 1EED; Case map */
-  { 0x001EEE, 0, { 0x001EEF }},                      /* 1EEE; 1EEF; Case map */
-  { 0x001EF0, 0, { 0x001EF1 }},                      /* 1EF0; 1EF1; Case map */
-  { 0x001EF2, 0, { 0x001EF3 }},                      /* 1EF2; 1EF3; Case map */
-  { 0x001EF4, 0, { 0x001EF5 }},                      /* 1EF4; 1EF5; Case map */
-  { 0x001EF6, 0, { 0x001EF7 }},                      /* 1EF6; 1EF7; Case map */
-  { 0x001EF8, 0, { 0x001EF9 }},                      /* 1EF8; 1EF9; Case map */
-  { 0x001F08, 0, { 0x001F00 }},                      /* 1F08; 1F00; Case map */
-  { 0x001F09, 0, { 0x001F01 }},                      /* 1F09; 1F01; Case map */
-  { 0x001F0A, 0, { 0x001F02 }},                      /* 1F0A; 1F02; Case map */
-  { 0x001F0B, 0, { 0x001F03 }},                      /* 1F0B; 1F03; Case map */
-  { 0x001F0C, 0, { 0x001F04 }},                      /* 1F0C; 1F04; Case map */
-  { 0x001F0D, 0, { 0x001F05 }},                      /* 1F0D; 1F05; Case map */
-  { 0x001F0E, 0, { 0x001F06 }},                      /* 1F0E; 1F06; Case map */
-  { 0x001F0F, 0, { 0x001F07 }},                      /* 1F0F; 1F07; Case map */
-  { 0x001F18, 0, { 0x001F10 }},                      /* 1F18; 1F10; Case map */
-  { 0x001F19, 0, { 0x001F11 }},                      /* 1F19; 1F11; Case map */
-  { 0x001F1A, 0, { 0x001F12 }},                      /* 1F1A; 1F12; Case map */
-  { 0x001F1B, 0, { 0x001F13 }},                      /* 1F1B; 1F13; Case map */
-  { 0x001F1C, 0, { 0x001F14 }},                      /* 1F1C; 1F14; Case map */
-  { 0x001F1D, 0, { 0x001F15 }},                      /* 1F1D; 1F15; Case map */
-  { 0x001F28, 0, { 0x001F20 }},                      /* 1F28; 1F20; Case map */
-  { 0x001F29, 0, { 0x001F21 }},                      /* 1F29; 1F21; Case map */
-  { 0x001F2A, 0, { 0x001F22 }},                      /* 1F2A; 1F22; Case map */
-  { 0x001F2B, 0, { 0x001F23 }},                      /* 1F2B; 1F23; Case map */
-  { 0x001F2C, 0, { 0x001F24 }},                      /* 1F2C; 1F24; Case map */
-  { 0x001F2D, 0, { 0x001F25 }},                      /* 1F2D; 1F25; Case map */
-  { 0x001F2E, 0, { 0x001F26 }},                      /* 1F2E; 1F26; Case map */
-  { 0x001F2F, 0, { 0x001F27 }},                      /* 1F2F; 1F27; Case map */
-  { 0x001F38, 0, { 0x001F30 }},                      /* 1F38; 1F30; Case map */
-  { 0x001F39, 0, { 0x001F31 }},                      /* 1F39; 1F31; Case map */
-  { 0x001F3A, 0, { 0x001F32 }},                      /* 1F3A; 1F32; Case map */
-  { 0x001F3B, 0, { 0x001F33 }},                      /* 1F3B; 1F33; Case map */
-  { 0x001F3C, 0, { 0x001F34 }},                      /* 1F3C; 1F34; Case map */
-  { 0x001F3D, 0, { 0x001F35 }},                      /* 1F3D; 1F35; Case map */
-  { 0x001F3E, 0, { 0x001F36 }},                      /* 1F3E; 1F36; Case map */
-  { 0x001F3F, 0, { 0x001F37 }},                      /* 1F3F; 1F37; Case map */
-  { 0x001F48, 0, { 0x001F40 }},                      /* 1F48; 1F40; Case map */
-  { 0x001F49, 0, { 0x001F41 }},                      /* 1F49; 1F41; Case map */
-  { 0x001F4A, 0, { 0x001F42 }},                      /* 1F4A; 1F42; Case map */
-  { 0x001F4B, 0, { 0x001F43 }},                      /* 1F4B; 1F43; Case map */
-  { 0x001F4C, 0, { 0x001F44 }},                      /* 1F4C; 1F44; Case map */
-  { 0x001F4D, 0, { 0x001F45 }},                      /* 1F4D; 1F45; Case map */
-  { 0x001F50, 0, { 0x0003C5,                    /* 1F50; 03C5 0313; Case map */
-                   0x000313 }},
-  { 0x001F52, 0, { 0x0003C5,               /* 1F52; 03C5 0313 0300; Case map */
-                   0x000313, 0x000300 }},
-  { 0x001F54, 0, { 0x0003C5,               /* 1F54; 03C5 0313 0301; Case map */
-                   0x000313, 0x000301 }},
-  { 0x001F56, 0, { 0x0003C5,               /* 1F56; 03C5 0313 0342; Case map */
-                   0x000313, 0x000342 }},
-  { 0x001F59, 0, { 0x001F51 }},                      /* 1F59; 1F51; Case map */
-  { 0x001F5B, 0, { 0x001F53 }},                      /* 1F5B; 1F53; Case map */
-  { 0x001F5D, 0, { 0x001F55 }},                      /* 1F5D; 1F55; Case map */
-  { 0x001F5F, 0, { 0x001F57 }},                      /* 1F5F; 1F57; Case map */
-  { 0x001F68, 0, { 0x001F60 }},                      /* 1F68; 1F60; Case map */
-  { 0x001F69, 0, { 0x001F61 }},                      /* 1F69; 1F61; Case map */
-  { 0x001F6A, 0, { 0x001F62 }},                      /* 1F6A; 1F62; Case map */
-  { 0x001F6B, 0, { 0x001F63 }},                      /* 1F6B; 1F63; Case map */
-  { 0x001F6C, 0, { 0x001F64 }},                      /* 1F6C; 1F64; Case map */
-  { 0x001F6D, 0, { 0x001F65 }},                      /* 1F6D; 1F65; Case map */
-  { 0x001F6E, 0, { 0x001F66 }},                      /* 1F6E; 1F66; Case map */
-  { 0x001F6F, 0, { 0x001F67 }},                      /* 1F6F; 1F67; Case map */
-  { 0x001F80, 0, { 0x001F00,                    /* 1F80; 1F00 03B9; Case map */
-                   0x0003B9 }},
-  { 0x001F81, 0, { 0x001F01,                    /* 1F81; 1F01 03B9; Case map */
-                   0x0003B9 }},
-  { 0x001F82, 0, { 0x001F02,                    /* 1F82; 1F02 03B9; Case map */
-                   0x0003B9 }},
-  { 0x001F83, 0, { 0x001F03,                    /* 1F83; 1F03 03B9; Case map */
-                   0x0003B9 }},
-  { 0x001F84, 0, { 0x001F04,                    /* 1F84; 1F04 03B9; Case map */
-                   0x0003B9 }},
-  { 0x001F85, 0, { 0x001F05,                    /* 1F85; 1F05 03B9; Case map */
-                   0x0003B9 }},
-  { 0x001F86, 0, { 0x001F06,                    /* 1F86; 1F06 03B9; Case map */
-                   0x0003B9 }},
-  { 0x001F87, 0, { 0x001F07,                    /* 1F87; 1F07 03B9; Case map */
-                   0x0003B9 }},
-  { 0x001F88, 0, { 0x001F00,                    /* 1F88; 1F00 03B9; Case map */
-                   0x0003B9 }},
-  { 0x001F89, 0, { 0x001F01,                    /* 1F89; 1F01 03B9; Case map */
-                   0x0003B9 }},
-  { 0x001F8A, 0, { 0x001F02,                    /* 1F8A; 1F02 03B9; Case map */
-                   0x0003B9 }},
-  { 0x001F8B, 0, { 0x001F03,                    /* 1F8B; 1F03 03B9; Case map */
-                   0x0003B9 }},
-  { 0x001F8C, 0, { 0x001F04,                    /* 1F8C; 1F04 03B9; Case map */
-                   0x0003B9 }},
-  { 0x001F8D, 0, { 0x001F05,                    /* 1F8D; 1F05 03B9; Case map */
-                   0x0003B9 }},
-  { 0x001F8E, 0, { 0x001F06,                    /* 1F8E; 1F06 03B9; Case map */
-                   0x0003B9 }},
-  { 0x001F8F, 0, { 0x001F07,                    /* 1F8F; 1F07 03B9; Case map */
-                   0x0003B9 }},
-  { 0x001F90, 0, { 0x001F20,                    /* 1F90; 1F20 03B9; Case map */
-                   0x0003B9 }},
-  { 0x001F91, 0, { 0x001F21,                    /* 1F91; 1F21 03B9; Case map */
-                   0x0003B9 }},
-  { 0x001F92, 0, { 0x001F22,                    /* 1F92; 1F22 03B9; Case map */
-                   0x0003B9 }},
-  { 0x001F93, 0, { 0x001F23,                    /* 1F93; 1F23 03B9; Case map */
-                   0x0003B9 }},
-  { 0x001F94, 0, { 0x001F24,                    /* 1F94; 1F24 03B9; Case map */
-                   0x0003B9 }},
-  { 0x001F95, 0, { 0x001F25,                    /* 1F95; 1F25 03B9; Case map */
-                   0x0003B9 }},
-  { 0x001F96, 0, { 0x001F26,                    /* 1F96; 1F26 03B9; Case map */
-                   0x0003B9 }},
-  { 0x001F97, 0, { 0x001F27,                    /* 1F97; 1F27 03B9; Case map */
-                   0x0003B9 }},
-  { 0x001F98, 0, { 0x001F20,                    /* 1F98; 1F20 03B9; Case map */
-                   0x0003B9 }},
-  { 0x001F99, 0, { 0x001F21,                    /* 1F99; 1F21 03B9; Case map */
-                   0x0003B9 }},
-  { 0x001F9A, 0, { 0x001F22,                    /* 1F9A; 1F22 03B9; Case map */
-                   0x0003B9 }},
-  { 0x001F9B, 0, { 0x001F23,                    /* 1F9B; 1F23 03B9; Case map */
-                   0x0003B9 }},
-  { 0x001F9C, 0, { 0x001F24,                    /* 1F9C; 1F24 03B9; Case map */
-                   0x0003B9 }},
-  { 0x001F9D, 0, { 0x001F25,                    /* 1F9D; 1F25 03B9; Case map */
-                   0x0003B9 }},
-  { 0x001F9E, 0, { 0x001F26,                    /* 1F9E; 1F26 03B9; Case map */
-                   0x0003B9 }},
-  { 0x001F9F, 0, { 0x001F27,                    /* 1F9F; 1F27 03B9; Case map */
-                   0x0003B9 }},
-  { 0x001FA0, 0, { 0x001F60,                    /* 1FA0; 1F60 03B9; Case map */
-                   0x0003B9 }},
-  { 0x001FA1, 0, { 0x001F61,                    /* 1FA1; 1F61 03B9; Case map */
-                   0x0003B9 }},
-  { 0x001FA2, 0, { 0x001F62,                    /* 1FA2; 1F62 03B9; Case map */
-                   0x0003B9 }},
-  { 0x001FA3, 0, { 0x001F63,                    /* 1FA3; 1F63 03B9; Case map */
-                   0x0003B9 }},
-  { 0x001FA4, 0, { 0x001F64,                    /* 1FA4; 1F64 03B9; Case map */
-                   0x0003B9 }},
-  { 0x001FA5, 0, { 0x001F65,                    /* 1FA5; 1F65 03B9; Case map */
-                   0x0003B9 }},
-  { 0x001FA6, 0, { 0x001F66,                    /* 1FA6; 1F66 03B9; Case map */
-                   0x0003B9 }},
-  { 0x001FA7, 0, { 0x001F67,                    /* 1FA7; 1F67 03B9; Case map */
-                   0x0003B9 }},
-  { 0x001FA8, 0, { 0x001F60,                    /* 1FA8; 1F60 03B9; Case map */
-                   0x0003B9 }},
-  { 0x001FA9, 0, { 0x001F61,                    /* 1FA9; 1F61 03B9; Case map */
-                   0x0003B9 }},
-  { 0x001FAA, 0, { 0x001F62,                    /* 1FAA; 1F62 03B9; Case map */
-                   0x0003B9 }},
-  { 0x001FAB, 0, { 0x001F63,                    /* 1FAB; 1F63 03B9; Case map */
-                   0x0003B9 }},
-  { 0x001FAC, 0, { 0x001F64,                    /* 1FAC; 1F64 03B9; Case map */
-                   0x0003B9 }},
-  { 0x001FAD, 0, { 0x001F65,                    /* 1FAD; 1F65 03B9; Case map */
-                   0x0003B9 }},
-  { 0x001FAE, 0, { 0x001F66,                    /* 1FAE; 1F66 03B9; Case map */
-                   0x0003B9 }},
-  { 0x001FAF, 0, { 0x001F67,                    /* 1FAF; 1F67 03B9; Case map */
-                   0x0003B9 }},
-  { 0x001FB2, 0, { 0x001F70,                    /* 1FB2; 1F70 03B9; Case map */
-                   0x0003B9 }},
-  { 0x001FB3, 0, { 0x0003B1,                    /* 1FB3; 03B1 03B9; Case map */
-                   0x0003B9 }},
-  { 0x001FB4, 0, { 0x0003AC,                    /* 1FB4; 03AC 03B9; Case map */
-                   0x0003B9 }},
-  { 0x001FB6, 0, { 0x0003B1,                    /* 1FB6; 03B1 0342; Case map */
-                   0x000342 }},
-  { 0x001FB7, 0, { 0x0003B1,               /* 1FB7; 03B1 0342 03B9; Case map */
-                   0x000342, 0x0003B9 }},
-  { 0x001FB8, 0, { 0x001FB0 }},                      /* 1FB8; 1FB0; Case map */
-  { 0x001FB9, 0, { 0x001FB1 }},                      /* 1FB9; 1FB1; Case map */
-  { 0x001FBA, 0, { 0x001F70 }},                      /* 1FBA; 1F70; Case map */
-  { 0x001FBB, 0, { 0x001F71 }},                      /* 1FBB; 1F71; Case map */
-  { 0x001FBC, 0, { 0x0003B1,                    /* 1FBC; 03B1 03B9; Case map */
-                   0x0003B9 }},
-  { 0x001FBE, 0, { 0x0003B9 }},                      /* 1FBE; 03B9; Case map */
-  { 0x001FC2, 0, { 0x001F74,                    /* 1FC2; 1F74 03B9; Case map */
-                   0x0003B9 }},
-  { 0x001FC3, 0, { 0x0003B7,                    /* 1FC3; 03B7 03B9; Case map */
-                   0x0003B9 }},
-  { 0x001FC4, 0, { 0x0003AE,                    /* 1FC4; 03AE 03B9; Case map */
-                   0x0003B9 }},
-  { 0x001FC6, 0, { 0x0003B7,                    /* 1FC6; 03B7 0342; Case map */
-                   0x000342 }},
-  { 0x001FC7, 0, { 0x0003B7,               /* 1FC7; 03B7 0342 03B9; Case map */
-                   0x000342, 0x0003B9 }},
-  { 0x001FC8, 0, { 0x001F72 }},                      /* 1FC8; 1F72; Case map */
-  { 0x001FC9, 0, { 0x001F73 }},                      /* 1FC9; 1F73; Case map */
-  { 0x001FCA, 0, { 0x001F74 }},                      /* 1FCA; 1F74; Case map */
-  { 0x001FCB, 0, { 0x001F75 }},                      /* 1FCB; 1F75; Case map */
-  { 0x001FCC, 0, { 0x0003B7,                    /* 1FCC; 03B7 03B9; Case map */
-                   0x0003B9 }},
-  { 0x001FD2, 0, { 0x0003B9,               /* 1FD2; 03B9 0308 0300; Case map */
-                   0x000308, 0x000300 }},
-  { 0x001FD3, 0, { 0x0003B9,               /* 1FD3; 03B9 0308 0301; Case map */
-                   0x000308, 0x000301 }},
-  { 0x001FD6, 0, { 0x0003B9,                    /* 1FD6; 03B9 0342; Case map */
-                   0x000342 }},
-  { 0x001FD7, 0, { 0x0003B9,               /* 1FD7; 03B9 0308 0342; Case map */
-                   0x000308, 0x000342 }},
-  { 0x001FD8, 0, { 0x001FD0 }},                      /* 1FD8; 1FD0; Case map */
-  { 0x001FD9, 0, { 0x001FD1 }},                      /* 1FD9; 1FD1; Case map */
-  { 0x001FDA, 0, { 0x001F76 }},                      /* 1FDA; 1F76; Case map */
-  { 0x001FDB, 0, { 0x001F77 }},                      /* 1FDB; 1F77; Case map */
-  { 0x001FE2, 0, { 0x0003C5,               /* 1FE2; 03C5 0308 0300; Case map */
-                   0x000308, 0x000300 }},
-  { 0x001FE3, 0, { 0x0003C5,               /* 1FE3; 03C5 0308 0301; Case map */
-                   0x000308, 0x000301 }},
-  { 0x001FE4, 0, { 0x0003C1,                    /* 1FE4; 03C1 0313; Case map */
-                   0x000313 }},
-  { 0x001FE6, 0, { 0x0003C5,                    /* 1FE6; 03C5 0342; Case map */
-                   0x000342 }},
-  { 0x001FE7, 0, { 0x0003C5,               /* 1FE7; 03C5 0308 0342; Case map */
-                   0x000308, 0x000342 }},
-  { 0x001FE8, 0, { 0x001FE0 }},                      /* 1FE8; 1FE0; Case map */
-  { 0x001FE9, 0, { 0x001FE1 }},                      /* 1FE9; 1FE1; Case map */
-  { 0x001FEA, 0, { 0x001F7A }},                      /* 1FEA; 1F7A; Case map */
-  { 0x001FEB, 0, { 0x001F7B }},                      /* 1FEB; 1F7B; Case map */
-  { 0x001FEC, 0, { 0x001FE5 }},                      /* 1FEC; 1FE5; Case map */
-  { 0x001FF2, 0, { 0x001F7C,                    /* 1FF2; 1F7C 03B9; Case map */
-                   0x0003B9 }},
-  { 0x001FF3, 0, { 0x0003C9,                    /* 1FF3; 03C9 03B9; Case map */
-                   0x0003B9 }},
-  { 0x001FF4, 0, { 0x0003CE,                    /* 1FF4; 03CE 03B9; Case map */
-                   0x0003B9 }},
-  { 0x001FF6, 0, { 0x0003C9,                    /* 1FF6; 03C9 0342; Case map */
-                   0x000342 }},
-  { 0x001FF7, 0, { 0x0003C9,               /* 1FF7; 03C9 0342 03B9; Case map */
-                   0x000342, 0x0003B9 }},
-  { 0x001FF8, 0, { 0x001F78 }},                      /* 1FF8; 1F78; Case map */
-  { 0x001FF9, 0, { 0x001F79 }},                      /* 1FF9; 1F79; Case map */
-  { 0x001FFA, 0, { 0x001F7C }},                      /* 1FFA; 1F7C; Case map */
-  { 0x001FFB, 0, { 0x001F7D }},                      /* 1FFB; 1F7D; Case map */
-  { 0x001FFC, 0, { 0x0003C9,                    /* 1FFC; 03C9 03B9; Case map */
-                   0x0003B9 }},
-  { 0x0020A8, 0, { 0x000072,          /* 20A8; 0072 0073; Additional folding */
-                   0x000073 }},
-  { 0x002102, 0, { 0x000063 }},            /* 2102; 0063; Additional folding */
-  { 0x002103, 0, { 0x0000B0,          /* 2103; 00B0 0063; Additional folding */
-                   0x000063 }},
-  { 0x002107, 0, { 0x00025B }},            /* 2107; 025B; Additional folding */
-  { 0x002109, 0, { 0x0000B0,          /* 2109; 00B0 0066; Additional folding */
-                   0x000066 }},
-  { 0x00210B, 0, { 0x000068 }},            /* 210B; 0068; Additional folding */
-  { 0x00210C, 0, { 0x000068 }},            /* 210C; 0068; Additional folding */
-  { 0x00210D, 0, { 0x000068 }},            /* 210D; 0068; Additional folding */
-  { 0x002110, 0, { 0x000069 }},            /* 2110; 0069; Additional folding */
-  { 0x002111, 0, { 0x000069 }},            /* 2111; 0069; Additional folding */
-  { 0x002112, 0, { 0x00006C }},            /* 2112; 006C; Additional folding */
-  { 0x002115, 0, { 0x00006E }},            /* 2115; 006E; Additional folding */
-  { 0x002116, 0, { 0x00006E,          /* 2116; 006E 006F; Additional folding */
-                   0x00006F }},
-  { 0x002119, 0, { 0x000070 }},            /* 2119; 0070; Additional folding */
-  { 0x00211A, 0, { 0x000071 }},            /* 211A; 0071; Additional folding */
-  { 0x00211B, 0, { 0x000072 }},            /* 211B; 0072; Additional folding */
-  { 0x00211C, 0, { 0x000072 }},            /* 211C; 0072; Additional folding */
-  { 0x00211D, 0, { 0x000072 }},            /* 211D; 0072; Additional folding */
-  { 0x002120, 0, { 0x000073,          /* 2120; 0073 006D; Additional folding */
-                   0x00006D }},
-  { 0x002121, 0, { 0x000074,     /* 2121; 0074 0065 006C; Additional folding */
-                   0x000065, 0x00006C }},
-  { 0x002122, 0, { 0x000074,          /* 2122; 0074 006D; Additional folding */
-                   0x00006D }},
-  { 0x002124, 0, { 0x00007A }},            /* 2124; 007A; Additional folding */
-  { 0x002126, 0, { 0x0003C9 }},                      /* 2126; 03C9; Case map */
-  { 0x002128, 0, { 0x00007A }},            /* 2128; 007A; Additional folding */
-  { 0x00212A, 0, { 0x00006B }},                      /* 212A; 006B; Case map */
-  { 0x00212B, 0, { 0x0000E5 }},                      /* 212B; 00E5; Case map */
-  { 0x00212C, 0, { 0x000062 }},            /* 212C; 0062; Additional folding */
-  { 0x00212D, 0, { 0x000063 }},            /* 212D; 0063; Additional folding */
-  { 0x002130, 0, { 0x000065 }},            /* 2130; 0065; Additional folding */
-  { 0x002131, 0, { 0x000066 }},            /* 2131; 0066; Additional folding */
-  { 0x002133, 0, { 0x00006D }},            /* 2133; 006D; Additional folding */
-  { 0x00213E, 0, { 0x0003B3 }},            /* 213E; 03B3; Additional folding */
-  { 0x00213F, 0, { 0x0003C0 }},            /* 213F; 03C0; Additional folding */
-  { 0x002145, 0, { 0x000064 }},            /* 2145; 0064; Additional folding */
-  { 0x002160, 0, { 0x002170 }},                      /* 2160; 2170; Case map */
-  { 0x002161, 0, { 0x002171 }},                      /* 2161; 2171; Case map */
-  { 0x002162, 0, { 0x002172 }},                      /* 2162; 2172; Case map */
-  { 0x002163, 0, { 0x002173 }},                      /* 2163; 2173; Case map */
-  { 0x002164, 0, { 0x002174 }},                      /* 2164; 2174; Case map */
-  { 0x002165, 0, { 0x002175 }},                      /* 2165; 2175; Case map */
-  { 0x002166, 0, { 0x002176 }},                      /* 2166; 2176; Case map */
-  { 0x002167, 0, { 0x002177 }},                      /* 2167; 2177; Case map */
-  { 0x002168, 0, { 0x002178 }},                      /* 2168; 2178; Case map */
-  { 0x002169, 0, { 0x002179 }},                      /* 2169; 2179; Case map */
-  { 0x00216A, 0, { 0x00217A }},                      /* 216A; 217A; Case map */
-  { 0x00216B, 0, { 0x00217B }},                      /* 216B; 217B; Case map */
-  { 0x00216C, 0, { 0x00217C }},                      /* 216C; 217C; Case map */
-  { 0x00216D, 0, { 0x00217D }},                      /* 216D; 217D; Case map */
-  { 0x00216E, 0, { 0x00217E }},                      /* 216E; 217E; Case map */
-  { 0x00216F, 0, { 0x00217F }},                      /* 216F; 217F; Case map */
-  { 0x0024B6, 0, { 0x0024D0 }},                      /* 24B6; 24D0; Case map */
-  { 0x0024B7, 0, { 0x0024D1 }},                      /* 24B7; 24D1; Case map */
-  { 0x0024B8, 0, { 0x0024D2 }},                      /* 24B8; 24D2; Case map */
-  { 0x0024B9, 0, { 0x0024D3 }},                      /* 24B9; 24D3; Case map */
-  { 0x0024BA, 0, { 0x0024D4 }},                      /* 24BA; 24D4; Case map */
-  { 0x0024BB, 0, { 0x0024D5 }},                      /* 24BB; 24D5; Case map */
-  { 0x0024BC, 0, { 0x0024D6 }},                      /* 24BC; 24D6; Case map */
-  { 0x0024BD, 0, { 0x0024D7 }},                      /* 24BD; 24D7; Case map */
-  { 0x0024BE, 0, { 0x0024D8 }},                      /* 24BE; 24D8; Case map */
-  { 0x0024BF, 0, { 0x0024D9 }},                      /* 24BF; 24D9; Case map */
-  { 0x0024C0, 0, { 0x0024DA }},                      /* 24C0; 24DA; Case map */
-  { 0x0024C1, 0, { 0x0024DB }},                      /* 24C1; 24DB; Case map */
-  { 0x0024C2, 0, { 0x0024DC }},                      /* 24C2; 24DC; Case map */
-  { 0x0024C3, 0, { 0x0024DD }},                      /* 24C3; 24DD; Case map */
-  { 0x0024C4, 0, { 0x0024DE }},                      /* 24C4; 24DE; Case map */
-  { 0x0024C5, 0, { 0x0024DF }},                      /* 24C5; 24DF; Case map */
-  { 0x0024C6, 0, { 0x0024E0 }},                      /* 24C6; 24E0; Case map */
-  { 0x0024C7, 0, { 0x0024E1 }},                      /* 24C7; 24E1; Case map */
-  { 0x0024C8, 0, { 0x0024E2 }},                      /* 24C8; 24E2; Case map */
-  { 0x0024C9, 0, { 0x0024E3 }},                      /* 24C9; 24E3; Case map */
-  { 0x0024CA, 0, { 0x0024E4 }},                      /* 24CA; 24E4; Case map */
-  { 0x0024CB, 0, { 0x0024E5 }},                      /* 24CB; 24E5; Case map */
-  { 0x0024CC, 0, { 0x0024E6 }},                      /* 24CC; 24E6; Case map */
-  { 0x0024CD, 0, { 0x0024E7 }},                      /* 24CD; 24E7; Case map */
-  { 0x0024CE, 0, { 0x0024E8 }},                      /* 24CE; 24E8; Case map */
-  { 0x0024CF, 0, { 0x0024E9 }},                      /* 24CF; 24E9; Case map */
-  { 0x003371, 0, { 0x000068,     /* 3371; 0068 0070 0061; Additional folding */
-                   0x000070, 0x000061 }},
-  { 0x003373, 0, { 0x000061,          /* 3373; 0061 0075; Additional folding */
-                   0x000075 }},
-  { 0x003375, 0, { 0x00006F,          /* 3375; 006F 0076; Additional folding */
-                   0x000076 }},
-  { 0x003380, 0, { 0x000070,          /* 3380; 0070 0061; Additional folding */
-                   0x000061 }},
-  { 0x003381, 0, { 0x00006E,          /* 3381; 006E 0061; Additional folding */
-                   0x000061 }},
-  { 0x003382, 0, { 0x0003BC,          /* 3382; 03BC 0061; Additional folding */
-                   0x000061 }},
-  { 0x003383, 0, { 0x00006D,          /* 3383; 006D 0061; Additional folding */
-                   0x000061 }},
-  { 0x003384, 0, { 0x00006B,          /* 3384; 006B 0061; Additional folding */
-                   0x000061 }},
-  { 0x003385, 0, { 0x00006B,          /* 3385; 006B 0062; Additional folding */
-                   0x000062 }},
-  { 0x003386, 0, { 0x00006D,          /* 3386; 006D 0062; Additional folding */
-                   0x000062 }},
-  { 0x003387, 0, { 0x000067,          /* 3387; 0067 0062; Additional folding */
-                   0x000062 }},
-  { 0x00338A, 0, { 0x000070,          /* 338A; 0070 0066; Additional folding */
-                   0x000066 }},
-  { 0x00338B, 0, { 0x00006E,          /* 338B; 006E 0066; Additional folding */
-                   0x000066 }},
-  { 0x00338C, 0, { 0x0003BC,          /* 338C; 03BC 0066; Additional folding */
-                   0x000066 }},
-  { 0x003390, 0, { 0x000068,          /* 3390; 0068 007A; Additional folding */
-                   0x00007A }},
-  { 0x003391, 0, { 0x00006B,     /* 3391; 006B 0068 007A; Additional folding */
-                   0x000068, 0x00007A }},
-  { 0x003392, 0, { 0x00006D,     /* 3392; 006D 0068 007A; Additional folding */
-                   0x000068, 0x00007A }},
-  { 0x003393, 0, { 0x000067,     /* 3393; 0067 0068 007A; Additional folding */
-                   0x000068, 0x00007A }},
-  { 0x003394, 0, { 0x000074,     /* 3394; 0074 0068 007A; Additional folding */
-                   0x000068, 0x00007A }},
-  { 0x0033A9, 0, { 0x000070,          /* 33A9; 0070 0061; Additional folding */
-                   0x000061 }},
-  { 0x0033AA, 0, { 0x00006B,     /* 33AA; 006B 0070 0061; Additional folding */
-                   0x000070, 0x000061 }},
-  { 0x0033AB, 0, { 0x00006D,     /* 33AB; 006D 0070 0061; Additional folding */
-                   0x000070, 0x000061 }},
-  { 0x0033AC, 0, { 0x000067,     /* 33AC; 0067 0070 0061; Additional folding */
-                   0x000070, 0x000061 }},
-  { 0x0033B4, 0, { 0x000070,          /* 33B4; 0070 0076; Additional folding */
-                   0x000076 }},
-  { 0x0033B5, 0, { 0x00006E,          /* 33B5; 006E 0076; Additional folding */
-                   0x000076 }},
-  { 0x0033B6, 0, { 0x0003BC,          /* 33B6; 03BC 0076; Additional folding */
-                   0x000076 }},
-  { 0x0033B7, 0, { 0x00006D,          /* 33B7; 006D 0076; Additional folding */
-                   0x000076 }},
-  { 0x0033B8, 0, { 0x00006B,          /* 33B8; 006B 0076; Additional folding */
-                   0x000076 }},
-  { 0x0033B9, 0, { 0x00006D,          /* 33B9; 006D 0076; Additional folding */
-                   0x000076 }},
-  { 0x0033BA, 0, { 0x000070,          /* 33BA; 0070 0077; Additional folding */
-                   0x000077 }},
-  { 0x0033BB, 0, { 0x00006E,          /* 33BB; 006E 0077; Additional folding */
-                   0x000077 }},
-  { 0x0033BC, 0, { 0x0003BC,          /* 33BC; 03BC 0077; Additional folding */
-                   0x000077 }},
-  { 0x0033BD, 0, { 0x00006D,          /* 33BD; 006D 0077; Additional folding */
-                   0x000077 }},
-  { 0x0033BE, 0, { 0x00006B,          /* 33BE; 006B 0077; Additional folding */
-                   0x000077 }},
-  { 0x0033BF, 0, { 0x00006D,          /* 33BF; 006D 0077; Additional folding */
-                   0x000077 }},
-  { 0x0033C0, 0, { 0x00006B,          /* 33C0; 006B 03C9; Additional folding */
-                   0x0003C9 }},
-  { 0x0033C1, 0, { 0x00006D,          /* 33C1; 006D 03C9; Additional folding */
-                   0x0003C9 }},
-  { 0x0033C3, 0, { 0x000062,          /* 33C3; 0062 0071; Additional folding */
-                   0x000071 }},
-  { 0x0033C6, 0, { 0x000063, /* 33C6; 0063 2215 006B 0067; Additional folding */
-                   0x002215, 0x00006B, 0x000067 }},
-  { 0x0033C7, 0, { 0x000063,     /* 33C7; 0063 006F 002E; Additional folding */
-                   0x00006F, 0x00002E }},
-  { 0x0033C8, 0, { 0x000064,          /* 33C8; 0064 0062; Additional folding */
-                   0x000062 }},
-  { 0x0033C9, 0, { 0x000067,          /* 33C9; 0067 0079; Additional folding */
-                   0x000079 }},
-  { 0x0033CB, 0, { 0x000068,          /* 33CB; 0068 0070; Additional folding */
-                   0x000070 }},
-  { 0x0033CD, 0, { 0x00006B,          /* 33CD; 006B 006B; Additional folding */
-                   0x00006B }},
-  { 0x0033CE, 0, { 0x00006B,          /* 33CE; 006B 006D; Additional folding */
-                   0x00006D }},
-  { 0x0033D7, 0, { 0x000070,          /* 33D7; 0070 0068; Additional folding */
-                   0x000068 }},
-  { 0x0033D9, 0, { 0x000070,     /* 33D9; 0070 0070 006D; Additional folding */
-                   0x000070, 0x00006D }},
-  { 0x0033DA, 0, { 0x000070,          /* 33DA; 0070 0072; Additional folding */
-                   0x000072 }},
-  { 0x0033DC, 0, { 0x000073,          /* 33DC; 0073 0076; Additional folding */
-                   0x000076 }},
-  { 0x0033DD, 0, { 0x000077,          /* 33DD; 0077 0062; Additional folding */
-                   0x000062 }},
-  { 0x00FB00, 0, { 0x000066,                    /* FB00; 0066 0066; Case map */
-                   0x000066 }},
-  { 0x00FB01, 0, { 0x000066,                    /* FB01; 0066 0069; Case map */
-                   0x000069 }},
-  { 0x00FB02, 0, { 0x000066,                    /* FB02; 0066 006C; Case map */
-                   0x00006C }},
-  { 0x00FB03, 0, { 0x000066,               /* FB03; 0066 0066 0069; Case map */
-                   0x000066, 0x000069 }},
-  { 0x00FB04, 0, { 0x000066,               /* FB04; 0066 0066 006C; Case map */
-                   0x000066, 0x00006C }},
-  { 0x00FB05, 0, { 0x000073,                    /* FB05; 0073 0074; Case map */
-                   0x000074 }},
-  { 0x00FB06, 0, { 0x000073,                    /* FB06; 0073 0074; Case map */
-                   0x000074 }},
-  { 0x00FB13, 0, { 0x000574,                    /* FB13; 0574 0576; Case map */
-                   0x000576 }},
-  { 0x00FB14, 0, { 0x000574,                    /* FB14; 0574 0565; Case map */
-                   0x000565 }},
-  { 0x00FB15, 0, { 0x000574,                    /* FB15; 0574 056B; Case map */
-                   0x00056B }},
-  { 0x00FB16, 0, { 0x00057E,                    /* FB16; 057E 0576; Case map */
-                   0x000576 }},
-  { 0x00FB17, 0, { 0x000574,                    /* FB17; 0574 056D; Case map */
-                   0x00056D }},
-  { 0x00FF21, 0, { 0x00FF41 }},                      /* FF21; FF41; Case map */
-  { 0x00FF22, 0, { 0x00FF42 }},                      /* FF22; FF42; Case map */
-  { 0x00FF23, 0, { 0x00FF43 }},                      /* FF23; FF43; Case map */
-  { 0x00FF24, 0, { 0x00FF44 }},                      /* FF24; FF44; Case map */
-  { 0x00FF25, 0, { 0x00FF45 }},                      /* FF25; FF45; Case map */
-  { 0x00FF26, 0, { 0x00FF46 }},                      /* FF26; FF46; Case map */
-  { 0x00FF27, 0, { 0x00FF47 }},                      /* FF27; FF47; Case map */
-  { 0x00FF28, 0, { 0x00FF48 }},                      /* FF28; FF48; Case map */
-  { 0x00FF29, 0, { 0x00FF49 }},                      /* FF29; FF49; Case map */
-  { 0x00FF2A, 0, { 0x00FF4A }},                      /* FF2A; FF4A; Case map */
-  { 0x00FF2B, 0, { 0x00FF4B }},                      /* FF2B; FF4B; Case map */
-  { 0x00FF2C, 0, { 0x00FF4C }},                      /* FF2C; FF4C; Case map */
-  { 0x00FF2D, 0, { 0x00FF4D }},                      /* FF2D; FF4D; Case map */
-  { 0x00FF2E, 0, { 0x00FF4E }},                      /* FF2E; FF4E; Case map */
-  { 0x00FF2F, 0, { 0x00FF4F }},                      /* FF2F; FF4F; Case map */
-  { 0x00FF30, 0, { 0x00FF50 }},                      /* FF30; FF50; Case map */
-  { 0x00FF31, 0, { 0x00FF51 }},                      /* FF31; FF51; Case map */
-  { 0x00FF32, 0, { 0x00FF52 }},                      /* FF32; FF52; Case map */
-  { 0x00FF33, 0, { 0x00FF53 }},                      /* FF33; FF53; Case map */
-  { 0x00FF34, 0, { 0x00FF54 }},                      /* FF34; FF54; Case map */
-  { 0x00FF35, 0, { 0x00FF55 }},                      /* FF35; FF55; Case map */
-  { 0x00FF36, 0, { 0x00FF56 }},                      /* FF36; FF56; Case map */
-  { 0x00FF37, 0, { 0x00FF57 }},                      /* FF37; FF57; Case map */
-  { 0x00FF38, 0, { 0x00FF58 }},                      /* FF38; FF58; Case map */
-  { 0x00FF39, 0, { 0x00FF59 }},                      /* FF39; FF59; Case map */
-  { 0x00FF3A, 0, { 0x00FF5A }},                      /* FF3A; FF5A; Case map */
-  { 0x010400, 0, { 0x010428 }},                    /* 10400; 10428; Case map */
-  { 0x010401, 0, { 0x010429 }},                    /* 10401; 10429; Case map */
-  { 0x010402, 0, { 0x01042A }},                    /* 10402; 1042A; Case map */
-  { 0x010403, 0, { 0x01042B }},                    /* 10403; 1042B; Case map */
-  { 0x010404, 0, { 0x01042C }},                    /* 10404; 1042C; Case map */
-  { 0x010405, 0, { 0x01042D }},                    /* 10405; 1042D; Case map */
-  { 0x010406, 0, { 0x01042E }},                    /* 10406; 1042E; Case map */
-  { 0x010407, 0, { 0x01042F }},                    /* 10407; 1042F; Case map */
-  { 0x010408, 0, { 0x010430 }},                    /* 10408; 10430; Case map */
-  { 0x010409, 0, { 0x010431 }},                    /* 10409; 10431; Case map */
-  { 0x01040A, 0, { 0x010432 }},                    /* 1040A; 10432; Case map */
-  { 0x01040B, 0, { 0x010433 }},                    /* 1040B; 10433; Case map */
-  { 0x01040C, 0, { 0x010434 }},                    /* 1040C; 10434; Case map */
-  { 0x01040D, 0, { 0x010435 }},                    /* 1040D; 10435; Case map */
-  { 0x01040E, 0, { 0x010436 }},                    /* 1040E; 10436; Case map */
-  { 0x01040F, 0, { 0x010437 }},                    /* 1040F; 10437; Case map */
-  { 0x010410, 0, { 0x010438 }},                    /* 10410; 10438; Case map */
-  { 0x010411, 0, { 0x010439 }},                    /* 10411; 10439; Case map */
-  { 0x010412, 0, { 0x01043A }},                    /* 10412; 1043A; Case map */
-  { 0x010413, 0, { 0x01043B }},                    /* 10413; 1043B; Case map */
-  { 0x010414, 0, { 0x01043C }},                    /* 10414; 1043C; Case map */
-  { 0x010415, 0, { 0x01043D }},                    /* 10415; 1043D; Case map */
-  { 0x010416, 0, { 0x01043E }},                    /* 10416; 1043E; Case map */
-  { 0x010417, 0, { 0x01043F }},                    /* 10417; 1043F; Case map */
-  { 0x010418, 0, { 0x010440 }},                    /* 10418; 10440; Case map */
-  { 0x010419, 0, { 0x010441 }},                    /* 10419; 10441; Case map */
-  { 0x01041A, 0, { 0x010442 }},                    /* 1041A; 10442; Case map */
-  { 0x01041B, 0, { 0x010443 }},                    /* 1041B; 10443; Case map */
-  { 0x01041C, 0, { 0x010444 }},                    /* 1041C; 10444; Case map */
-  { 0x01041D, 0, { 0x010445 }},                    /* 1041D; 10445; Case map */
-  { 0x01041E, 0, { 0x010446 }},                    /* 1041E; 10446; Case map */
-  { 0x01041F, 0, { 0x010447 }},                    /* 1041F; 10447; Case map */
-  { 0x010420, 0, { 0x010448 }},                    /* 10420; 10448; Case map */
-  { 0x010421, 0, { 0x010449 }},                    /* 10421; 10449; Case map */
-  { 0x010422, 0, { 0x01044A }},                    /* 10422; 1044A; Case map */
-  { 0x010423, 0, { 0x01044B }},                    /* 10423; 1044B; Case map */
-  { 0x010424, 0, { 0x01044C }},                    /* 10424; 1044C; Case map */
-  { 0x010425, 0, { 0x01044D }},                    /* 10425; 1044D; Case map */
-  { 0x01D400, 0, { 0x000061 }},           /* 1D400; 0061; Additional folding */
-  { 0x01D401, 0, { 0x000062 }},           /* 1D401; 0062; Additional folding */
-  { 0x01D402, 0, { 0x000063 }},           /* 1D402; 0063; Additional folding */
-  { 0x01D403, 0, { 0x000064 }},           /* 1D403; 0064; Additional folding */
-  { 0x01D404, 0, { 0x000065 }},           /* 1D404; 0065; Additional folding */
-  { 0x01D405, 0, { 0x000066 }},           /* 1D405; 0066; Additional folding */
-  { 0x01D406, 0, { 0x000067 }},           /* 1D406; 0067; Additional folding */
-  { 0x01D407, 0, { 0x000068 }},           /* 1D407; 0068; Additional folding */
-  { 0x01D408, 0, { 0x000069 }},           /* 1D408; 0069; Additional folding */
-  { 0x01D409, 0, { 0x00006A }},           /* 1D409; 006A; Additional folding */
-  { 0x01D40A, 0, { 0x00006B }},           /* 1D40A; 006B; Additional folding */
-  { 0x01D40B, 0, { 0x00006C }},           /* 1D40B; 006C; Additional folding */
-  { 0x01D40C, 0, { 0x00006D }},           /* 1D40C; 006D; Additional folding */
-  { 0x01D40D, 0, { 0x00006E }},           /* 1D40D; 006E; Additional folding */
-  { 0x01D40E, 0, { 0x00006F }},           /* 1D40E; 006F; Additional folding */
-  { 0x01D40F, 0, { 0x000070 }},           /* 1D40F; 0070; Additional folding */
-  { 0x01D410, 0, { 0x000071 }},           /* 1D410; 0071; Additional folding */
-  { 0x01D411, 0, { 0x000072 }},           /* 1D411; 0072; Additional folding */
-  { 0x01D412, 0, { 0x000073 }},           /* 1D412; 0073; Additional folding */
-  { 0x01D413, 0, { 0x000074 }},           /* 1D413; 0074; Additional folding */
-  { 0x01D414, 0, { 0x000075 }},           /* 1D414; 0075; Additional folding */
-  { 0x01D415, 0, { 0x000076 }},           /* 1D415; 0076; Additional folding */
-  { 0x01D416, 0, { 0x000077 }},           /* 1D416; 0077; Additional folding */
-  { 0x01D417, 0, { 0x000078 }},           /* 1D417; 0078; Additional folding */
-  { 0x01D418, 0, { 0x000079 }},           /* 1D418; 0079; Additional folding */
-  { 0x01D419, 0, { 0x00007A }},           /* 1D419; 007A; Additional folding */
-  { 0x01D434, 0, { 0x000061 }},           /* 1D434; 0061; Additional folding */
-  { 0x01D435, 0, { 0x000062 }},           /* 1D435; 0062; Additional folding */
-  { 0x01D436, 0, { 0x000063 }},           /* 1D436; 0063; Additional folding */
-  { 0x01D437, 0, { 0x000064 }},           /* 1D437; 0064; Additional folding */
-  { 0x01D438, 0, { 0x000065 }},           /* 1D438; 0065; Additional folding */
-  { 0x01D439, 0, { 0x000066 }},           /* 1D439; 0066; Additional folding */
-  { 0x01D43A, 0, { 0x000067 }},           /* 1D43A; 0067; Additional folding */
-  { 0x01D43B, 0, { 0x000068 }},           /* 1D43B; 0068; Additional folding */
-  { 0x01D43C, 0, { 0x000069 }},           /* 1D43C; 0069; Additional folding */
-  { 0x01D43D, 0, { 0x00006A }},           /* 1D43D; 006A; Additional folding */
-  { 0x01D43E, 0, { 0x00006B }},           /* 1D43E; 006B; Additional folding */
-  { 0x01D43F, 0, { 0x00006C }},           /* 1D43F; 006C; Additional folding */
-  { 0x01D440, 0, { 0x00006D }},           /* 1D440; 006D; Additional folding */
-  { 0x01D441, 0, { 0x00006E }},           /* 1D441; 006E; Additional folding */
-  { 0x01D442, 0, { 0x00006F }},           /* 1D442; 006F; Additional folding */
-  { 0x01D443, 0, { 0x000070 }},           /* 1D443; 0070; Additional folding */
-  { 0x01D444, 0, { 0x000071 }},           /* 1D444; 0071; Additional folding */
-  { 0x01D445, 0, { 0x000072 }},           /* 1D445; 0072; Additional folding */
-  { 0x01D446, 0, { 0x000073 }},           /* 1D446; 0073; Additional folding */
-  { 0x01D447, 0, { 0x000074 }},           /* 1D447; 0074; Additional folding */
-  { 0x01D448, 0, { 0x000075 }},           /* 1D448; 0075; Additional folding */
-  { 0x01D449, 0, { 0x000076 }},           /* 1D449; 0076; Additional folding */
-  { 0x01D44A, 0, { 0x000077 }},           /* 1D44A; 0077; Additional folding */
-  { 0x01D44B, 0, { 0x000078 }},           /* 1D44B; 0078; Additional folding */
-  { 0x01D44C, 0, { 0x000079 }},           /* 1D44C; 0079; Additional folding */
-  { 0x01D44D, 0, { 0x00007A }},           /* 1D44D; 007A; Additional folding */
-  { 0x01D468, 0, { 0x000061 }},           /* 1D468; 0061; Additional folding */
-  { 0x01D469, 0, { 0x000062 }},           /* 1D469; 0062; Additional folding */
-  { 0x01D46A, 0, { 0x000063 }},           /* 1D46A; 0063; Additional folding */
-  { 0x01D46B, 0, { 0x000064 }},           /* 1D46B; 0064; Additional folding */
-  { 0x01D46C, 0, { 0x000065 }},           /* 1D46C; 0065; Additional folding */
-  { 0x01D46D, 0, { 0x000066 }},           /* 1D46D; 0066; Additional folding */
-  { 0x01D46E, 0, { 0x000067 }},           /* 1D46E; 0067; Additional folding */
-  { 0x01D46F, 0, { 0x000068 }},           /* 1D46F; 0068; Additional folding */
-  { 0x01D470, 0, { 0x000069 }},           /* 1D470; 0069; Additional folding */
-  { 0x01D471, 0, { 0x00006A }},           /* 1D471; 006A; Additional folding */
-  { 0x01D472, 0, { 0x00006B }},           /* 1D472; 006B; Additional folding */
-  { 0x01D473, 0, { 0x00006C }},           /* 1D473; 006C; Additional folding */
-  { 0x01D474, 0, { 0x00006D }},           /* 1D474; 006D; Additional folding */
-  { 0x01D475, 0, { 0x00006E }},           /* 1D475; 006E; Additional folding */
-  { 0x01D476, 0, { 0x00006F }},           /* 1D476; 006F; Additional folding */
-  { 0x01D477, 0, { 0x000070 }},           /* 1D477; 0070; Additional folding */
-  { 0x01D478, 0, { 0x000071 }},           /* 1D478; 0071; Additional folding */
-  { 0x01D479, 0, { 0x000072 }},           /* 1D479; 0072; Additional folding */
-  { 0x01D47A, 0, { 0x000073 }},           /* 1D47A; 0073; Additional folding */
-  { 0x01D47B, 0, { 0x000074 }},           /* 1D47B; 0074; Additional folding */
-  { 0x01D47C, 0, { 0x000075 }},           /* 1D47C; 0075; Additional folding */
-  { 0x01D47D, 0, { 0x000076 }},           /* 1D47D; 0076; Additional folding */
-  { 0x01D47E, 0, { 0x000077 }},           /* 1D47E; 0077; Additional folding */
-  { 0x01D47F, 0, { 0x000078 }},           /* 1D47F; 0078; Additional folding */
-  { 0x01D480, 0, { 0x000079 }},           /* 1D480; 0079; Additional folding */
-  { 0x01D481, 0, { 0x00007A }},           /* 1D481; 007A; Additional folding */
-  { 0x01D49C, 0, { 0x000061 }},           /* 1D49C; 0061; Additional folding */
-  { 0x01D49E, 0, { 0x000063 }},           /* 1D49E; 0063; Additional folding */
-  { 0x01D49F, 0, { 0x000064 }},           /* 1D49F; 0064; Additional folding */
-  { 0x01D4A2, 0, { 0x000067 }},           /* 1D4A2; 0067; Additional folding */
-  { 0x01D4A5, 0, { 0x00006A }},           /* 1D4A5; 006A; Additional folding */
-  { 0x01D4A6, 0, { 0x00006B }},           /* 1D4A6; 006B; Additional folding */
-  { 0x01D4A9, 0, { 0x00006E }},           /* 1D4A9; 006E; Additional folding */
-  { 0x01D4AA, 0, { 0x00006F }},           /* 1D4AA; 006F; Additional folding */
-  { 0x01D4AB, 0, { 0x000070 }},           /* 1D4AB; 0070; Additional folding */
-  { 0x01D4AC, 0, { 0x000071 }},           /* 1D4AC; 0071; Additional folding */
-  { 0x01D4AE, 0, { 0x000073 }},           /* 1D4AE; 0073; Additional folding */
-  { 0x01D4AF, 0, { 0x000074 }},           /* 1D4AF; 0074; Additional folding */
-  { 0x01D4B0, 0, { 0x000075 }},           /* 1D4B0; 0075; Additional folding */
-  { 0x01D4B1, 0, { 0x000076 }},           /* 1D4B1; 0076; Additional folding */
-  { 0x01D4B2, 0, { 0x000077 }},           /* 1D4B2; 0077; Additional folding */
-  { 0x01D4B3, 0, { 0x000078 }},           /* 1D4B3; 0078; Additional folding */
-  { 0x01D4B4, 0, { 0x000079 }},           /* 1D4B4; 0079; Additional folding */
-  { 0x01D4B5, 0, { 0x00007A }},           /* 1D4B5; 007A; Additional folding */
-  { 0x01D4D0, 0, { 0x000061 }},           /* 1D4D0; 0061; Additional folding */
-  { 0x01D4D1, 0, { 0x000062 }},           /* 1D4D1; 0062; Additional folding */
-  { 0x01D4D2, 0, { 0x000063 }},           /* 1D4D2; 0063; Additional folding */
-  { 0x01D4D3, 0, { 0x000064 }},           /* 1D4D3; 0064; Additional folding */
-  { 0x01D4D4, 0, { 0x000065 }},           /* 1D4D4; 0065; Additional folding */
-  { 0x01D4D5, 0, { 0x000066 }},           /* 1D4D5; 0066; Additional folding */
-  { 0x01D4D6, 0, { 0x000067 }},           /* 1D4D6; 0067; Additional folding */
-  { 0x01D4D7, 0, { 0x000068 }},           /* 1D4D7; 0068; Additional folding */
-  { 0x01D4D8, 0, { 0x000069 }},           /* 1D4D8; 0069; Additional folding */
-  { 0x01D4D9, 0, { 0x00006A }},           /* 1D4D9; 006A; Additional folding */
-  { 0x01D4DA, 0, { 0x00006B }},           /* 1D4DA; 006B; Additional folding */
-  { 0x01D4DB, 0, { 0x00006C }},           /* 1D4DB; 006C; Additional folding */
-  { 0x01D4DC, 0, { 0x00006D }},           /* 1D4DC; 006D; Additional folding */
-  { 0x01D4DD, 0, { 0x00006E }},           /* 1D4DD; 006E; Additional folding */
-  { 0x01D4DE, 0, { 0x00006F }},           /* 1D4DE; 006F; Additional folding */
-  { 0x01D4DF, 0, { 0x000070 }},           /* 1D4DF; 0070; Additional folding */
-  { 0x01D4E0, 0, { 0x000071 }},           /* 1D4E0; 0071; Additional folding */
-  { 0x01D4E1, 0, { 0x000072 }},           /* 1D4E1; 0072; Additional folding */
-  { 0x01D4E2, 0, { 0x000073 }},           /* 1D4E2; 0073; Additional folding */
-  { 0x01D4E3, 0, { 0x000074 }},           /* 1D4E3; 0074; Additional folding */
-  { 0x01D4E4, 0, { 0x000075 }},           /* 1D4E4; 0075; Additional folding */
-  { 0x01D4E5, 0, { 0x000076 }},           /* 1D4E5; 0076; Additional folding */
-  { 0x01D4E6, 0, { 0x000077 }},           /* 1D4E6; 0077; Additional folding */
-  { 0x01D4E7, 0, { 0x000078 }},           /* 1D4E7; 0078; Additional folding */
-  { 0x01D4E8, 0, { 0x000079 }},           /* 1D4E8; 0079; Additional folding */
-  { 0x01D4E9, 0, { 0x00007A }},           /* 1D4E9; 007A; Additional folding */
-  { 0x01D504, 0, { 0x000061 }},           /* 1D504; 0061; Additional folding */
-  { 0x01D505, 0, { 0x000062 }},           /* 1D505; 0062; Additional folding */
-  { 0x01D507, 0, { 0x000064 }},           /* 1D507; 0064; Additional folding */
-  { 0x01D508, 0, { 0x000065 }},           /* 1D508; 0065; Additional folding */
-  { 0x01D509, 0, { 0x000066 }},           /* 1D509; 0066; Additional folding */
-  { 0x01D50A, 0, { 0x000067 }},           /* 1D50A; 0067; Additional folding */
-  { 0x01D50D, 0, { 0x00006A }},           /* 1D50D; 006A; Additional folding */
-  { 0x01D50E, 0, { 0x00006B }},           /* 1D50E; 006B; Additional folding */
-  { 0x01D50F, 0, { 0x00006C }},           /* 1D50F; 006C; Additional folding */
-  { 0x01D510, 0, { 0x00006D }},           /* 1D510; 006D; Additional folding */
-  { 0x01D511, 0, { 0x00006E }},           /* 1D511; 006E; Additional folding */
-  { 0x01D512, 0, { 0x00006F }},           /* 1D512; 006F; Additional folding */
-  { 0x01D513, 0, { 0x000070 }},           /* 1D513; 0070; Additional folding */
-  { 0x01D514, 0, { 0x000071 }},           /* 1D514; 0071; Additional folding */
-  { 0x01D516, 0, { 0x000073 }},           /* 1D516; 0073; Additional folding */
-  { 0x01D517, 0, { 0x000074 }},           /* 1D517; 0074; Additional folding */
-  { 0x01D518, 0, { 0x000075 }},           /* 1D518; 0075; Additional folding */
-  { 0x01D519, 0, { 0x000076 }},           /* 1D519; 0076; Additional folding */
-  { 0x01D51A, 0, { 0x000077 }},           /* 1D51A; 0077; Additional folding */
-  { 0x01D51B, 0, { 0x000078 }},           /* 1D51B; 0078; Additional folding */
-  { 0x01D51C, 0, { 0x000079 }},           /* 1D51C; 0079; Additional folding */
-  { 0x01D538, 0, { 0x000061 }},           /* 1D538; 0061; Additional folding */
-  { 0x01D539, 0, { 0x000062 }},           /* 1D539; 0062; Additional folding */
-  { 0x01D53B, 0, { 0x000064 }},           /* 1D53B; 0064; Additional folding */
-  { 0x01D53C, 0, { 0x000065 }},           /* 1D53C; 0065; Additional folding */
-  { 0x01D53D, 0, { 0x000066 }},           /* 1D53D; 0066; Additional folding */
-  { 0x01D53E, 0, { 0x000067 }},           /* 1D53E; 0067; Additional folding */
-  { 0x01D540, 0, { 0x000069 }},           /* 1D540; 0069; Additional folding */
-  { 0x01D541, 0, { 0x00006A }},           /* 1D541; 006A; Additional folding */
-  { 0x01D542, 0, { 0x00006B }},           /* 1D542; 006B; Additional folding */
-  { 0x01D543, 0, { 0x00006C }},           /* 1D543; 006C; Additional folding */
-  { 0x01D544, 0, { 0x00006D }},           /* 1D544; 006D; Additional folding */
-  { 0x01D546, 0, { 0x00006F }},           /* 1D546; 006F; Additional folding */
-  { 0x01D54A, 0, { 0x000073 }},           /* 1D54A; 0073; Additional folding */
-  { 0x01D54B, 0, { 0x000074 }},           /* 1D54B; 0074; Additional folding */
-  { 0x01D54C, 0, { 0x000075 }},           /* 1D54C; 0075; Additional folding */
-  { 0x01D54D, 0, { 0x000076 }},           /* 1D54D; 0076; Additional folding */
-  { 0x01D54E, 0, { 0x000077 }},           /* 1D54E; 0077; Additional folding */
-  { 0x01D54F, 0, { 0x000078 }},           /* 1D54F; 0078; Additional folding */
-  { 0x01D550, 0, { 0x000079 }},           /* 1D550; 0079; Additional folding */
-  { 0x01D56C, 0, { 0x000061 }},           /* 1D56C; 0061; Additional folding */
-  { 0x01D56D, 0, { 0x000062 }},           /* 1D56D; 0062; Additional folding */
-  { 0x01D56E, 0, { 0x000063 }},           /* 1D56E; 0063; Additional folding */
-  { 0x01D56F, 0, { 0x000064 }},           /* 1D56F; 0064; Additional folding */
-  { 0x01D570, 0, { 0x000065 }},           /* 1D570; 0065; Additional folding */
-  { 0x01D571, 0, { 0x000066 }},           /* 1D571; 0066; Additional folding */
-  { 0x01D572, 0, { 0x000067 }},           /* 1D572; 0067; Additional folding */
-  { 0x01D573, 0, { 0x000068 }},           /* 1D573; 0068; Additional folding */
-  { 0x01D574, 0, { 0x000069 }},           /* 1D574; 0069; Additional folding */
-  { 0x01D575, 0, { 0x00006A }},           /* 1D575; 006A; Additional folding */
-  { 0x01D576, 0, { 0x00006B }},           /* 1D576; 006B; Additional folding */
-  { 0x01D577, 0, { 0x00006C }},           /* 1D577; 006C; Additional folding */
-  { 0x01D578, 0, { 0x00006D }},           /* 1D578; 006D; Additional folding */
-  { 0x01D579, 0, { 0x00006E }},           /* 1D579; 006E; Additional folding */
-  { 0x01D57A, 0, { 0x00006F }},           /* 1D57A; 006F; Additional folding */
-  { 0x01D57B, 0, { 0x000070 }},           /* 1D57B; 0070; Additional folding */
-  { 0x01D57C, 0, { 0x000071 }},           /* 1D57C; 0071; Additional folding */
-  { 0x01D57D, 0, { 0x000072 }},           /* 1D57D; 0072; Additional folding */
-  { 0x01D57E, 0, { 0x000073 }},           /* 1D57E; 0073; Additional folding */
-  { 0x01D57F, 0, { 0x000074 }},           /* 1D57F; 0074; Additional folding */
-  { 0x01D580, 0, { 0x000075 }},           /* 1D580; 0075; Additional folding */
-  { 0x01D581, 0, { 0x000076 }},           /* 1D581; 0076; Additional folding */
-  { 0x01D582, 0, { 0x000077 }},           /* 1D582; 0077; Additional folding */
-  { 0x01D583, 0, { 0x000078 }},           /* 1D583; 0078; Additional folding */
-  { 0x01D584, 0, { 0x000079 }},           /* 1D584; 0079; Additional folding */
-  { 0x01D585, 0, { 0x00007A }},           /* 1D585; 007A; Additional folding */
-  { 0x01D5A0, 0, { 0x000061 }},           /* 1D5A0; 0061; Additional folding */
-  { 0x01D5A1, 0, { 0x000062 }},           /* 1D5A1; 0062; Additional folding */
-  { 0x01D5A2, 0, { 0x000063 }},           /* 1D5A2; 0063; Additional folding */
-  { 0x01D5A3, 0, { 0x000064 }},           /* 1D5A3; 0064; Additional folding */
-  { 0x01D5A4, 0, { 0x000065 }},           /* 1D5A4; 0065; Additional folding */
-  { 0x01D5A5, 0, { 0x000066 }},           /* 1D5A5; 0066; Additional folding */
-  { 0x01D5A6, 0, { 0x000067 }},           /* 1D5A6; 0067; Additional folding */
-  { 0x01D5A7, 0, { 0x000068 }},           /* 1D5A7; 0068; Additional folding */
-  { 0x01D5A8, 0, { 0x000069 }},           /* 1D5A8; 0069; Additional folding */
-  { 0x01D5A9, 0, { 0x00006A }},           /* 1D5A9; 006A; Additional folding */
-  { 0x01D5AA, 0, { 0x00006B }},           /* 1D5AA; 006B; Additional folding */
-  { 0x01D5AB, 0, { 0x00006C }},           /* 1D5AB; 006C; Additional folding */
-  { 0x01D5AC, 0, { 0x00006D }},           /* 1D5AC; 006D; Additional folding */
-  { 0x01D5AD, 0, { 0x00006E }},           /* 1D5AD; 006E; Additional folding */
-  { 0x01D5AE, 0, { 0x00006F }},           /* 1D5AE; 006F; Additional folding */
-  { 0x01D5AF, 0, { 0x000070 }},           /* 1D5AF; 0070; Additional folding */
-  { 0x01D5B0, 0, { 0x000071 }},           /* 1D5B0; 0071; Additional folding */
-  { 0x01D5B1, 0, { 0x000072 }},           /* 1D5B1; 0072; Additional folding */
-  { 0x01D5B2, 0, { 0x000073 }},           /* 1D5B2; 0073; Additional folding */
-  { 0x01D5B3, 0, { 0x000074 }},           /* 1D5B3; 0074; Additional folding */
-  { 0x01D5B4, 0, { 0x000075 }},           /* 1D5B4; 0075; Additional folding */
-  { 0x01D5B5, 0, { 0x000076 }},           /* 1D5B5; 0076; Additional folding */
-  { 0x01D5B6, 0, { 0x000077 }},           /* 1D5B6; 0077; Additional folding */
-  { 0x01D5B7, 0, { 0x000078 }},           /* 1D5B7; 0078; Additional folding */
-  { 0x01D5B8, 0, { 0x000079 }},           /* 1D5B8; 0079; Additional folding */
-  { 0x01D5B9, 0, { 0x00007A }},           /* 1D5B9; 007A; Additional folding */
-  { 0x01D5D4, 0, { 0x000061 }},           /* 1D5D4; 0061; Additional folding */
-  { 0x01D5D5, 0, { 0x000062 }},           /* 1D5D5; 0062; Additional folding */
-  { 0x01D5D6, 0, { 0x000063 }},           /* 1D5D6; 0063; Additional folding */
-  { 0x01D5D7, 0, { 0x000064 }},           /* 1D5D7; 0064; Additional folding */
-  { 0x01D5D8, 0, { 0x000065 }},           /* 1D5D8; 0065; Additional folding */
-  { 0x01D5D9, 0, { 0x000066 }},           /* 1D5D9; 0066; Additional folding */
-  { 0x01D5DA, 0, { 0x000067 }},           /* 1D5DA; 0067; Additional folding */
-  { 0x01D5DB, 0, { 0x000068 }},           /* 1D5DB; 0068; Additional folding */
-  { 0x01D5DC, 0, { 0x000069 }},           /* 1D5DC; 0069; Additional folding */
-  { 0x01D5DD, 0, { 0x00006A }},           /* 1D5DD; 006A; Additional folding */
-  { 0x01D5DE, 0, { 0x00006B }},           /* 1D5DE; 006B; Additional folding */
-  { 0x01D5DF, 0, { 0x00006C }},           /* 1D5DF; 006C; Additional folding */
-  { 0x01D5E0, 0, { 0x00006D }},           /* 1D5E0; 006D; Additional folding */
-  { 0x01D5E1, 0, { 0x00006E }},           /* 1D5E1; 006E; Additional folding */
-  { 0x01D5E2, 0, { 0x00006F }},           /* 1D5E2; 006F; Additional folding */
-  { 0x01D5E3, 0, { 0x000070 }},           /* 1D5E3; 0070; Additional folding */
-  { 0x01D5E4, 0, { 0x000071 }},           /* 1D5E4; 0071; Additional folding */
-  { 0x01D5E5, 0, { 0x000072 }},           /* 1D5E5; 0072; Additional folding */
-  { 0x01D5E6, 0, { 0x000073 }},           /* 1D5E6; 0073; Additional folding */
-  { 0x01D5E7, 0, { 0x000074 }},           /* 1D5E7; 0074; Additional folding */
-  { 0x01D5E8, 0, { 0x000075 }},           /* 1D5E8; 0075; Additional folding */
-  { 0x01D5E9, 0, { 0x000076 }},           /* 1D5E9; 0076; Additional folding */
-  { 0x01D5EA, 0, { 0x000077 }},           /* 1D5EA; 0077; Additional folding */
-  { 0x01D5EB, 0, { 0x000078 }},           /* 1D5EB; 0078; Additional folding */
-  { 0x01D5EC, 0, { 0x000079 }},           /* 1D5EC; 0079; Additional folding */
-  { 0x01D5ED, 0, { 0x00007A }},           /* 1D5ED; 007A; Additional folding */
-  { 0x01D608, 0, { 0x000061 }},           /* 1D608; 0061; Additional folding */
-  { 0x01D609, 0, { 0x000062 }},           /* 1D609; 0062; Additional folding */
-  { 0x01D60A, 0, { 0x000063 }},           /* 1D60A; 0063; Additional folding */
-  { 0x01D60B, 0, { 0x000064 }},           /* 1D60B; 0064; Additional folding */
-  { 0x01D60C, 0, { 0x000065 }},           /* 1D60C; 0065; Additional folding */
-  { 0x01D60D, 0, { 0x000066 }},           /* 1D60D; 0066; Additional folding */
-  { 0x01D60E, 0, { 0x000067 }},           /* 1D60E; 0067; Additional folding */
-  { 0x01D60F, 0, { 0x000068 }},           /* 1D60F; 0068; Additional folding */
-  { 0x01D610, 0, { 0x000069 }},           /* 1D610; 0069; Additional folding */
-  { 0x01D611, 0, { 0x00006A }},           /* 1D611; 006A; Additional folding */
-  { 0x01D612, 0, { 0x00006B }},           /* 1D612; 006B; Additional folding */
-  { 0x01D613, 0, { 0x00006C }},           /* 1D613; 006C; Additional folding */
-  { 0x01D614, 0, { 0x00006D }},           /* 1D614; 006D; Additional folding */
-  { 0x01D615, 0, { 0x00006E }},           /* 1D615; 006E; Additional folding */
-  { 0x01D616, 0, { 0x00006F }},           /* 1D616; 006F; Additional folding */
-  { 0x01D617, 0, { 0x000070 }},           /* 1D617; 0070; Additional folding */
-  { 0x01D618, 0, { 0x000071 }},           /* 1D618; 0071; Additional folding */
-  { 0x01D619, 0, { 0x000072 }},           /* 1D619; 0072; Additional folding */
-  { 0x01D61A, 0, { 0x000073 }},           /* 1D61A; 0073; Additional folding */
-  { 0x01D61B, 0, { 0x000074 }},           /* 1D61B; 0074; Additional folding */
-  { 0x01D61C, 0, { 0x000075 }},           /* 1D61C; 0075; Additional folding */
-  { 0x01D61D, 0, { 0x000076 }},           /* 1D61D; 0076; Additional folding */
-  { 0x01D61E, 0, { 0x000077 }},           /* 1D61E; 0077; Additional folding */
-  { 0x01D61F, 0, { 0x000078 }},           /* 1D61F; 0078; Additional folding */
-  { 0x01D620, 0, { 0x000079 }},           /* 1D620; 0079; Additional folding */
-  { 0x01D621, 0, { 0x00007A }},           /* 1D621; 007A; Additional folding */
-  { 0x01D63C, 0, { 0x000061 }},           /* 1D63C; 0061; Additional folding */
-  { 0x01D63D, 0, { 0x000062 }},           /* 1D63D; 0062; Additional folding */
-  { 0x01D63E, 0, { 0x000063 }},           /* 1D63E; 0063; Additional folding */
-  { 0x01D63F, 0, { 0x000064 }},           /* 1D63F; 0064; Additional folding */
-  { 0x01D640, 0, { 0x000065 }},           /* 1D640; 0065; Additional folding */
-  { 0x01D641, 0, { 0x000066 }},           /* 1D641; 0066; Additional folding */
-  { 0x01D642, 0, { 0x000067 }},           /* 1D642; 0067; Additional folding */
-  { 0x01D643, 0, { 0x000068 }},           /* 1D643; 0068; Additional folding */
-  { 0x01D644, 0, { 0x000069 }},           /* 1D644; 0069; Additional folding */
-  { 0x01D645, 0, { 0x00006A }},           /* 1D645; 006A; Additional folding */
-  { 0x01D646, 0, { 0x00006B }},           /* 1D646; 006B; Additional folding */
-  { 0x01D647, 0, { 0x00006C }},           /* 1D647; 006C; Additional folding */
-  { 0x01D648, 0, { 0x00006D }},           /* 1D648; 006D; Additional folding */
-  { 0x01D649, 0, { 0x00006E }},           /* 1D649; 006E; Additional folding */
-  { 0x01D64A, 0, { 0x00006F }},           /* 1D64A; 006F; Additional folding */
-  { 0x01D64B, 0, { 0x000070 }},           /* 1D64B; 0070; Additional folding */
-  { 0x01D64C, 0, { 0x000071 }},           /* 1D64C; 0071; Additional folding */
-  { 0x01D64D, 0, { 0x000072 }},           /* 1D64D; 0072; Additional folding */
-  { 0x01D64E, 0, { 0x000073 }},           /* 1D64E; 0073; Additional folding */
-  { 0x01D64F, 0, { 0x000074 }},           /* 1D64F; 0074; Additional folding */
-  { 0x01D650, 0, { 0x000075 }},           /* 1D650; 0075; Additional folding */
-  { 0x01D651, 0, { 0x000076 }},           /* 1D651; 0076; Additional folding */
-  { 0x01D652, 0, { 0x000077 }},           /* 1D652; 0077; Additional folding */
-  { 0x01D653, 0, { 0x000078 }},           /* 1D653; 0078; Additional folding */
-  { 0x01D654, 0, { 0x000079 }},           /* 1D654; 0079; Additional folding */
-  { 0x01D655, 0, { 0x00007A }},           /* 1D655; 007A; Additional folding */
-  { 0x01D670, 0, { 0x000061 }},           /* 1D670; 0061; Additional folding */
-  { 0x01D671, 0, { 0x000062 }},           /* 1D671; 0062; Additional folding */
-  { 0x01D672, 0, { 0x000063 }},           /* 1D672; 0063; Additional folding */
-  { 0x01D673, 0, { 0x000064 }},           /* 1D673; 0064; Additional folding */
-  { 0x01D674, 0, { 0x000065 }},           /* 1D674; 0065; Additional folding */
-  { 0x01D675, 0, { 0x000066 }},           /* 1D675; 0066; Additional folding */
-  { 0x01D676, 0, { 0x000067 }},           /* 1D676; 0067; Additional folding */
-  { 0x01D677, 0, { 0x000068 }},           /* 1D677; 0068; Additional folding */
-  { 0x01D678, 0, { 0x000069 }},           /* 1D678; 0069; Additional folding */
-  { 0x01D679, 0, { 0x00006A }},           /* 1D679; 006A; Additional folding */
-  { 0x01D67A, 0, { 0x00006B }},           /* 1D67A; 006B; Additional folding */
-  { 0x01D67B, 0, { 0x00006C }},           /* 1D67B; 006C; Additional folding */
-  { 0x01D67C, 0, { 0x00006D }},           /* 1D67C; 006D; Additional folding */
-  { 0x01D67D, 0, { 0x00006E }},           /* 1D67D; 006E; Additional folding */
-  { 0x01D67E, 0, { 0x00006F }},           /* 1D67E; 006F; Additional folding */
-  { 0x01D67F, 0, { 0x000070 }},           /* 1D67F; 0070; Additional folding */
-  { 0x01D680, 0, { 0x000071 }},           /* 1D680; 0071; Additional folding */
-  { 0x01D681, 0, { 0x000072 }},           /* 1D681; 0072; Additional folding */
-  { 0x01D682, 0, { 0x000073 }},           /* 1D682; 0073; Additional folding */
-  { 0x01D683, 0, { 0x000074 }},           /* 1D683; 0074; Additional folding */
-  { 0x01D684, 0, { 0x000075 }},           /* 1D684; 0075; Additional folding */
-  { 0x01D685, 0, { 0x000076 }},           /* 1D685; 0076; Additional folding */
-  { 0x01D686, 0, { 0x000077 }},           /* 1D686; 0077; Additional folding */
-  { 0x01D687, 0, { 0x000078 }},           /* 1D687; 0078; Additional folding */
-  { 0x01D688, 0, { 0x000079 }},           /* 1D688; 0079; Additional folding */
-  { 0x01D689, 0, { 0x00007A }},           /* 1D689; 007A; Additional folding */
-  { 0x01D6A8, 0, { 0x0003B1 }},           /* 1D6A8; 03B1; Additional folding */
-  { 0x01D6A9, 0, { 0x0003B2 }},           /* 1D6A9; 03B2; Additional folding */
-  { 0x01D6AA, 0, { 0x0003B3 }},           /* 1D6AA; 03B3; Additional folding */
-  { 0x01D6AB, 0, { 0x0003B4 }},           /* 1D6AB; 03B4; Additional folding */
-  { 0x01D6AC, 0, { 0x0003B5 }},           /* 1D6AC; 03B5; Additional folding */
-  { 0x01D6AD, 0, { 0x0003B6 }},           /* 1D6AD; 03B6; Additional folding */
-  { 0x01D6AE, 0, { 0x0003B7 }},           /* 1D6AE; 03B7; Additional folding */
-  { 0x01D6AF, 0, { 0x0003B8 }},           /* 1D6AF; 03B8; Additional folding */
-  { 0x01D6B0, 0, { 0x0003B9 }},           /* 1D6B0; 03B9; Additional folding */
-  { 0x01D6B1, 0, { 0x0003BA }},           /* 1D6B1; 03BA; Additional folding */
-  { 0x01D6B2, 0, { 0x0003BB }},           /* 1D6B2; 03BB; Additional folding */
-  { 0x01D6B3, 0, { 0x0003BC }},           /* 1D6B3; 03BC; Additional folding */
-  { 0x01D6B4, 0, { 0x0003BD }},           /* 1D6B4; 03BD; Additional folding */
-  { 0x01D6B5, 0, { 0x0003BE }},           /* 1D6B5; 03BE; Additional folding */
-  { 0x01D6B6, 0, { 0x0003BF }},           /* 1D6B6; 03BF; Additional folding */
-  { 0x01D6B7, 0, { 0x0003C0 }},           /* 1D6B7; 03C0; Additional folding */
-  { 0x01D6B8, 0, { 0x0003C1 }},           /* 1D6B8; 03C1; Additional folding */
-  { 0x01D6B9, 0, { 0x0003B8 }},           /* 1D6B9; 03B8; Additional folding */
-  { 0x01D6BA, 0, { 0x0003C3 }},           /* 1D6BA; 03C3; Additional folding */
-  { 0x01D6BB, 0, { 0x0003C4 }},           /* 1D6BB; 03C4; Additional folding */
-  { 0x01D6BC, 0, { 0x0003C5 }},           /* 1D6BC; 03C5; Additional folding */
-  { 0x01D6BD, 0, { 0x0003C6 }},           /* 1D6BD; 03C6; Additional folding */
-  { 0x01D6BE, 0, { 0x0003C7 }},           /* 1D6BE; 03C7; Additional folding */
-  { 0x01D6BF, 0, { 0x0003C8 }},           /* 1D6BF; 03C8; Additional folding */
-  { 0x01D6C0, 0, { 0x0003C9 }},           /* 1D6C0; 03C9; Additional folding */
-  { 0x01D6D3, 0, { 0x0003C3 }},           /* 1D6D3; 03C3; Additional folding */
-  { 0x01D6E2, 0, { 0x0003B1 }},           /* 1D6E2; 03B1; Additional folding */
-  { 0x01D6E3, 0, { 0x0003B2 }},           /* 1D6E3; 03B2; Additional folding */
-  { 0x01D6E4, 0, { 0x0003B3 }},           /* 1D6E4; 03B3; Additional folding */
-  { 0x01D6E5, 0, { 0x0003B4 }},           /* 1D6E5; 03B4; Additional folding */
-  { 0x01D6E6, 0, { 0x0003B5 }},           /* 1D6E6; 03B5; Additional folding */
-  { 0x01D6E7, 0, { 0x0003B6 }},           /* 1D6E7; 03B6; Additional folding */
-  { 0x01D6E8, 0, { 0x0003B7 }},           /* 1D6E8; 03B7; Additional folding */
-  { 0x01D6E9, 0, { 0x0003B8 }},           /* 1D6E9; 03B8; Additional folding */
-  { 0x01D6EA, 0, { 0x0003B9 }},           /* 1D6EA; 03B9; Additional folding */
-  { 0x01D6EB, 0, { 0x0003BA }},           /* 1D6EB; 03BA; Additional folding */
-  { 0x01D6EC, 0, { 0x0003BB }},           /* 1D6EC; 03BB; Additional folding */
-  { 0x01D6ED, 0, { 0x0003BC }},           /* 1D6ED; 03BC; Additional folding */
-  { 0x01D6EE, 0, { 0x0003BD }},           /* 1D6EE; 03BD; Additional folding */
-  { 0x01D6EF, 0, { 0x0003BE }},           /* 1D6EF; 03BE; Additional folding */
-  { 0x01D6F0, 0, { 0x0003BF }},           /* 1D6F0; 03BF; Additional folding */
-  { 0x01D6F1, 0, { 0x0003C0 }},           /* 1D6F1; 03C0; Additional folding */
-  { 0x01D6F2, 0, { 0x0003C1 }},           /* 1D6F2; 03C1; Additional folding */
-  { 0x01D6F3, 0, { 0x0003B8 }},           /* 1D6F3; 03B8; Additional folding */
-  { 0x01D6F4, 0, { 0x0003C3 }},           /* 1D6F4; 03C3; Additional folding */
-  { 0x01D6F5, 0, { 0x0003C4 }},           /* 1D6F5; 03C4; Additional folding */
-  { 0x01D6F6, 0, { 0x0003C5 }},           /* 1D6F6; 03C5; Additional folding */
-  { 0x01D6F7, 0, { 0x0003C6 }},           /* 1D6F7; 03C6; Additional folding */
-  { 0x01D6F8, 0, { 0x0003C7 }},           /* 1D6F8; 03C7; Additional folding */
-  { 0x01D6F9, 0, { 0x0003C8 }},           /* 1D6F9; 03C8; Additional folding */
-  { 0x01D6FA, 0, { 0x0003C9 }},           /* 1D6FA; 03C9; Additional folding */
-  { 0x01D70D, 0, { 0x0003C3 }},           /* 1D70D; 03C3; Additional folding */
-  { 0x01D71C, 0, { 0x0003B1 }},           /* 1D71C; 03B1; Additional folding */
-  { 0x01D71D, 0, { 0x0003B2 }},           /* 1D71D; 03B2; Additional folding */
-  { 0x01D71E, 0, { 0x0003B3 }},           /* 1D71E; 03B3; Additional folding */
-  { 0x01D71F, 0, { 0x0003B4 }},           /* 1D71F; 03B4; Additional folding */
-  { 0x01D720, 0, { 0x0003B5 }},           /* 1D720; 03B5; Additional folding */
-  { 0x01D721, 0, { 0x0003B6 }},           /* 1D721; 03B6; Additional folding */
-  { 0x01D722, 0, { 0x0003B7 }},           /* 1D722; 03B7; Additional folding */
-  { 0x01D723, 0, { 0x0003B8 }},           /* 1D723; 03B8; Additional folding */
-  { 0x01D724, 0, { 0x0003B9 }},           /* 1D724; 03B9; Additional folding */
-  { 0x01D725, 0, { 0x0003BA }},           /* 1D725; 03BA; Additional folding */
-  { 0x01D726, 0, { 0x0003BB }},           /* 1D726; 03BB; Additional folding */
-  { 0x01D727, 0, { 0x0003BC }},           /* 1D727; 03BC; Additional folding */
-  { 0x01D728, 0, { 0x0003BD }},           /* 1D728; 03BD; Additional folding */
-  { 0x01D729, 0, { 0x0003BE }},           /* 1D729; 03BE; Additional folding */
-  { 0x01D72A, 0, { 0x0003BF }},           /* 1D72A; 03BF; Additional folding */
-  { 0x01D72B, 0, { 0x0003C0 }},           /* 1D72B; 03C0; Additional folding */
-  { 0x01D72C, 0, { 0x0003C1 }},           /* 1D72C; 03C1; Additional folding */
-  { 0x01D72D, 0, { 0x0003B8 }},           /* 1D72D; 03B8; Additional folding */
-  { 0x01D72E, 0, { 0x0003C3 }},           /* 1D72E; 03C3; Additional folding */
-  { 0x01D72F, 0, { 0x0003C4 }},           /* 1D72F; 03C4; Additional folding */
-  { 0x01D730, 0, { 0x0003C5 }},           /* 1D730; 03C5; Additional folding */
-  { 0x01D731, 0, { 0x0003C6 }},           /* 1D731; 03C6; Additional folding */
-  { 0x01D732, 0, { 0x0003C7 }},           /* 1D732; 03C7; Additional folding */
-  { 0x01D733, 0, { 0x0003C8 }},           /* 1D733; 03C8; Additional folding */
-  { 0x01D734, 0, { 0x0003C9 }},           /* 1D734; 03C9; Additional folding */
-  { 0x01D747, 0, { 0x0003C3 }},           /* 1D747; 03C3; Additional folding */
-  { 0x01D756, 0, { 0x0003B1 }},           /* 1D756; 03B1; Additional folding */
-  { 0x01D757, 0, { 0x0003B2 }},           /* 1D757; 03B2; Additional folding */
-  { 0x01D758, 0, { 0x0003B3 }},           /* 1D758; 03B3; Additional folding */
-  { 0x01D759, 0, { 0x0003B4 }},           /* 1D759; 03B4; Additional folding */
-  { 0x01D75A, 0, { 0x0003B5 }},           /* 1D75A; 03B5; Additional folding */
-  { 0x01D75B, 0, { 0x0003B6 }},           /* 1D75B; 03B6; Additional folding */
-  { 0x01D75C, 0, { 0x0003B7 }},           /* 1D75C; 03B7; Additional folding */
-  { 0x01D75D, 0, { 0x0003B8 }},           /* 1D75D; 03B8; Additional folding */
-  { 0x01D75E, 0, { 0x0003B9 }},           /* 1D75E; 03B9; Additional folding */
-  { 0x01D75F, 0, { 0x0003BA }},           /* 1D75F; 03BA; Additional folding */
-  { 0x01D760, 0, { 0x0003BB }},           /* 1D760; 03BB; Additional folding */
-  { 0x01D761, 0, { 0x0003BC }},           /* 1D761; 03BC; Additional folding */
-  { 0x01D762, 0, { 0x0003BD }},           /* 1D762; 03BD; Additional folding */
-  { 0x01D763, 0, { 0x0003BE }},           /* 1D763; 03BE; Additional folding */
-  { 0x01D764, 0, { 0x0003BF }},           /* 1D764; 03BF; Additional folding */
-  { 0x01D765, 0, { 0x0003C0 }},           /* 1D765; 03C0; Additional folding */
-  { 0x01D766, 0, { 0x0003C1 }},           /* 1D766; 03C1; Additional folding */
-  { 0x01D767, 0, { 0x0003B8 }},           /* 1D767; 03B8; Additional folding */
-  { 0x01D768, 0, { 0x0003C3 }},           /* 1D768; 03C3; Additional folding */
-  { 0x01D769, 0, { 0x0003C4 }},           /* 1D769; 03C4; Additional folding */
-  { 0x01D76A, 0, { 0x0003C5 }},           /* 1D76A; 03C5; Additional folding */
-  { 0x01D76B, 0, { 0x0003C6 }},           /* 1D76B; 03C6; Additional folding */
-  { 0x01D76C, 0, { 0x0003C7 }},           /* 1D76C; 03C7; Additional folding */
-  { 0x01D76D, 0, { 0x0003C8 }},           /* 1D76D; 03C8; Additional folding */
-  { 0x01D76E, 0, { 0x0003C9 }},           /* 1D76E; 03C9; Additional folding */
-  { 0x01D781, 0, { 0x0003C3 }},           /* 1D781; 03C3; Additional folding */
-  { 0x01D790, 0, { 0x0003B1 }},           /* 1D790; 03B1; Additional folding */
-  { 0x01D791, 0, { 0x0003B2 }},           /* 1D791; 03B2; Additional folding */
-  { 0x01D792, 0, { 0x0003B3 }},           /* 1D792; 03B3; Additional folding */
-  { 0x01D793, 0, { 0x0003B4 }},           /* 1D793; 03B4; Additional folding */
-  { 0x01D794, 0, { 0x0003B5 }},           /* 1D794; 03B5; Additional folding */
-  { 0x01D795, 0, { 0x0003B6 }},           /* 1D795; 03B6; Additional folding */
-  { 0x01D796, 0, { 0x0003B7 }},           /* 1D796; 03B7; Additional folding */
-  { 0x01D797, 0, { 0x0003B8 }},           /* 1D797; 03B8; Additional folding */
-  { 0x01D798, 0, { 0x0003B9 }},           /* 1D798; 03B9; Additional folding */
-  { 0x01D799, 0, { 0x0003BA }},           /* 1D799; 03BA; Additional folding */
-  { 0x01D79A, 0, { 0x0003BB }},           /* 1D79A; 03BB; Additional folding */
-  { 0x01D79B, 0, { 0x0003BC }},           /* 1D79B; 03BC; Additional folding */
-  { 0x01D79C, 0, { 0x0003BD }},           /* 1D79C; 03BD; Additional folding */
-  { 0x01D79D, 0, { 0x0003BE }},           /* 1D79D; 03BE; Additional folding */
-  { 0x01D79E, 0, { 0x0003BF }},           /* 1D79E; 03BF; Additional folding */
-  { 0x01D79F, 0, { 0x0003C0 }},           /* 1D79F; 03C0; Additional folding */
-  { 0x01D7A0, 0, { 0x0003C1 }},           /* 1D7A0; 03C1; Additional folding */
-  { 0x01D7A1, 0, { 0x0003B8 }},           /* 1D7A1; 03B8; Additional folding */
-  { 0x01D7A2, 0, { 0x0003C3 }},           /* 1D7A2; 03C3; Additional folding */
-  { 0x01D7A3, 0, { 0x0003C4 }},           /* 1D7A3; 03C4; Additional folding */
-  { 0x01D7A4, 0, { 0x0003C5 }},           /* 1D7A4; 03C5; Additional folding */
-  { 0x01D7A5, 0, { 0x0003C6 }},           /* 1D7A5; 03C6; Additional folding */
-  { 0x01D7A6, 0, { 0x0003C7 }},           /* 1D7A6; 03C7; Additional folding */
-  { 0x01D7A7, 0, { 0x0003C8 }},           /* 1D7A7; 03C8; Additional folding */
-  { 0x01D7A8, 0, { 0x0003C9 }},           /* 1D7A8; 03C9; Additional folding */
-  { 0x01D7BB, 0, { 0x0003C3 }},           /* 1D7BB; 03C3; Additional folding */
-  { 0 },
-};
-
-
-/*
- * B.3 Mapping for case-folding used with no normalization
- * 
- */
-
-const Stringprep_table_element stringprep_rfc3454_B_3[] = {
-  { 0x000041, 0, { 0x000061 }},                      /* 0041; 0061; Case map */
-  { 0x000042, 0, { 0x000062 }},                      /* 0042; 0062; Case map */
-  { 0x000043, 0, { 0x000063 }},                      /* 0043; 0063; Case map */
-  { 0x000044, 0, { 0x000064 }},                      /* 0044; 0064; Case map */
-  { 0x000045, 0, { 0x000065 }},                      /* 0045; 0065; Case map */
-  { 0x000046, 0, { 0x000066 }},                      /* 0046; 0066; Case map */
-  { 0x000047, 0, { 0x000067 }},                      /* 0047; 0067; Case map */
-  { 0x000048, 0, { 0x000068 }},                      /* 0048; 0068; Case map */
-  { 0x000049, 0, { 0x000069 }},                      /* 0049; 0069; Case map */
-  { 0x00004A, 0, { 0x00006A }},                      /* 004A; 006A; Case map */
-  { 0x00004B, 0, { 0x00006B }},                      /* 004B; 006B; Case map */
-  { 0x00004C, 0, { 0x00006C }},                      /* 004C; 006C; Case map */
-  { 0x00004D, 0, { 0x00006D }},                      /* 004D; 006D; Case map */
-  { 0x00004E, 0, { 0x00006E }},                      /* 004E; 006E; Case map */
-  { 0x00004F, 0, { 0x00006F }},                      /* 004F; 006F; Case map */
-  { 0x000050, 0, { 0x000070 }},                      /* 0050; 0070; Case map */
-  { 0x000051, 0, { 0x000071 }},                      /* 0051; 0071; Case map */
-  { 0x000052, 0, { 0x000072 }},                      /* 0052; 0072; Case map */
-  { 0x000053, 0, { 0x000073 }},                      /* 0053; 0073; Case map */
-  { 0x000054, 0, { 0x000074 }},                      /* 0054; 0074; Case map */
-  { 0x000055, 0, { 0x000075 }},                      /* 0055; 0075; Case map */
-  { 0x000056, 0, { 0x000076 }},                      /* 0056; 0076; Case map */
-  { 0x000057, 0, { 0x000077 }},                      /* 0057; 0077; Case map */
-  { 0x000058, 0, { 0x000078 }},                      /* 0058; 0078; Case map */
-  { 0x000059, 0, { 0x000079 }},                      /* 0059; 0079; Case map */
-  { 0x00005A, 0, { 0x00007A }},                      /* 005A; 007A; Case map */
-  { 0x0000B5, 0, { 0x0003BC }},                      /* 00B5; 03BC; Case map */
-  { 0x0000C0, 0, { 0x0000E0 }},                      /* 00C0; 00E0; Case map */
-  { 0x0000C1, 0, { 0x0000E1 }},                      /* 00C1; 00E1; Case map */
-  { 0x0000C2, 0, { 0x0000E2 }},                      /* 00C2; 00E2; Case map */
-  { 0x0000C3, 0, { 0x0000E3 }},                      /* 00C3; 00E3; Case map */
-  { 0x0000C4, 0, { 0x0000E4 }},                      /* 00C4; 00E4; Case map */
-  { 0x0000C5, 0, { 0x0000E5 }},                      /* 00C5; 00E5; Case map */
-  { 0x0000C6, 0, { 0x0000E6 }},                      /* 00C6; 00E6; Case map */
-  { 0x0000C7, 0, { 0x0000E7 }},                      /* 00C7; 00E7; Case map */
-  { 0x0000C8, 0, { 0x0000E8 }},                      /* 00C8; 00E8; Case map */
-  { 0x0000C9, 0, { 0x0000E9 }},                      /* 00C9; 00E9; Case map */
-  { 0x0000CA, 0, { 0x0000EA }},                      /* 00CA; 00EA; Case map */
-  { 0x0000CB, 0, { 0x0000EB }},                      /* 00CB; 00EB; Case map */
-  { 0x0000CC, 0, { 0x0000EC }},                      /* 00CC; 00EC; Case map */
-  { 0x0000CD, 0, { 0x0000ED }},                      /* 00CD; 00ED; Case map */
-  { 0x0000CE, 0, { 0x0000EE }},                      /* 00CE; 00EE; Case map */
-  { 0x0000CF, 0, { 0x0000EF }},                      /* 00CF; 00EF; Case map */
-  { 0x0000D0, 0, { 0x0000F0 }},                      /* 00D0; 00F0; Case map */
-  { 0x0000D1, 0, { 0x0000F1 }},                      /* 00D1; 00F1; Case map */
-  { 0x0000D2, 0, { 0x0000F2 }},                      /* 00D2; 00F2; Case map */
-  { 0x0000D3, 0, { 0x0000F3 }},                      /* 00D3; 00F3; Case map */
-  { 0x0000D4, 0, { 0x0000F4 }},                      /* 00D4; 00F4; Case map */
-  { 0x0000D5, 0, { 0x0000F5 }},                      /* 00D5; 00F5; Case map */
-  { 0x0000D6, 0, { 0x0000F6 }},                      /* 00D6; 00F6; Case map */
-  { 0x0000D8, 0, { 0x0000F8 }},                      /* 00D8; 00F8; Case map */
-  { 0x0000D9, 0, { 0x0000F9 }},                      /* 00D9; 00F9; Case map */
-  { 0x0000DA, 0, { 0x0000FA }},                      /* 00DA; 00FA; Case map */
-  { 0x0000DB, 0, { 0x0000FB }},                      /* 00DB; 00FB; Case map */
-  { 0x0000DC, 0, { 0x0000FC }},                      /* 00DC; 00FC; Case map */
-  { 0x0000DD, 0, { 0x0000FD }},                      /* 00DD; 00FD; Case map */
-  { 0x0000DE, 0, { 0x0000FE }},                      /* 00DE; 00FE; Case map */
-  { 0x0000DF, 0, { 0x000073,                    /* 00DF; 0073 0073; Case map */
-                   0x000073 }},
-  { 0x000100, 0, { 0x000101 }},                      /* 0100; 0101; Case map */
-  { 0x000102, 0, { 0x000103 }},                      /* 0102; 0103; Case map */
-  { 0x000104, 0, { 0x000105 }},                      /* 0104; 0105; Case map */
-  { 0x000106, 0, { 0x000107 }},                      /* 0106; 0107; Case map */
-  { 0x000108, 0, { 0x000109 }},                      /* 0108; 0109; Case map */
-  { 0x00010A, 0, { 0x00010B }},                      /* 010A; 010B; Case map */
-  { 0x00010C, 0, { 0x00010D }},                      /* 010C; 010D; Case map */
-  { 0x00010E, 0, { 0x00010F }},                      /* 010E; 010F; Case map */
-  { 0x000110, 0, { 0x000111 }},                      /* 0110; 0111; Case map */
-  { 0x000112, 0, { 0x000113 }},                      /* 0112; 0113; Case map */
-  { 0x000114, 0, { 0x000115 }},                      /* 0114; 0115; Case map */
-  { 0x000116, 0, { 0x000117 }},                      /* 0116; 0117; Case map */
-  { 0x000118, 0, { 0x000119 }},                      /* 0118; 0119; Case map */
-  { 0x00011A, 0, { 0x00011B }},                      /* 011A; 011B; Case map */
-  { 0x00011C, 0, { 0x00011D }},                      /* 011C; 011D; Case map */
-  { 0x00011E, 0, { 0x00011F }},                      /* 011E; 011F; Case map */
-  { 0x000120, 0, { 0x000121 }},                      /* 0120; 0121; Case map */
-  { 0x000122, 0, { 0x000123 }},                      /* 0122; 0123; Case map */
-  { 0x000124, 0, { 0x000125 }},                      /* 0124; 0125; Case map */
-  { 0x000126, 0, { 0x000127 }},                      /* 0126; 0127; Case map */
-  { 0x000128, 0, { 0x000129 }},                      /* 0128; 0129; Case map */
-  { 0x00012A, 0, { 0x00012B }},                      /* 012A; 012B; Case map */
-  { 0x00012C, 0, { 0x00012D }},                      /* 012C; 012D; Case map */
-  { 0x00012E, 0, { 0x00012F }},                      /* 012E; 012F; Case map */
-  { 0x000130, 0, { 0x000069,                    /* 0130; 0069 0307; Case map */
-                   0x000307 }},
-  { 0x000132, 0, { 0x000133 }},                      /* 0132; 0133; Case map */
-  { 0x000134, 0, { 0x000135 }},                      /* 0134; 0135; Case map */
-  { 0x000136, 0, { 0x000137 }},                      /* 0136; 0137; Case map */
-  { 0x000139, 0, { 0x00013A }},                      /* 0139; 013A; Case map */
-  { 0x00013B, 0, { 0x00013C }},                      /* 013B; 013C; Case map */
-  { 0x00013D, 0, { 0x00013E }},                      /* 013D; 013E; Case map */
-  { 0x00013F, 0, { 0x000140 }},                      /* 013F; 0140; Case map */
-  { 0x000141, 0, { 0x000142 }},                      /* 0141; 0142; Case map */
-  { 0x000143, 0, { 0x000144 }},                      /* 0143; 0144; Case map */
-  { 0x000145, 0, { 0x000146 }},                      /* 0145; 0146; Case map */
-  { 0x000147, 0, { 0x000148 }},                      /* 0147; 0148; Case map */
-  { 0x000149, 0, { 0x0002BC,                    /* 0149; 02BC 006E; Case map */
-                   0x00006E }},
-  { 0x00014A, 0, { 0x00014B }},                      /* 014A; 014B; Case map */
-  { 0x00014C, 0, { 0x00014D }},                      /* 014C; 014D; Case map */
-  { 0x00014E, 0, { 0x00014F }},                      /* 014E; 014F; Case map */
-  { 0x000150, 0, { 0x000151 }},                      /* 0150; 0151; Case map */
-  { 0x000152, 0, { 0x000153 }},                      /* 0152; 0153; Case map */
-  { 0x000154, 0, { 0x000155 }},                      /* 0154; 0155; Case map */
-  { 0x000156, 0, { 0x000157 }},                      /* 0156; 0157; Case map */
-  { 0x000158, 0, { 0x000159 }},                      /* 0158; 0159; Case map */
-  { 0x00015A, 0, { 0x00015B }},                      /* 015A; 015B; Case map */
-  { 0x00015C, 0, { 0x00015D }},                      /* 015C; 015D; Case map */
-  { 0x00015E, 0, { 0x00015F }},                      /* 015E; 015F; Case map */
-  { 0x000160, 0, { 0x000161 }},                      /* 0160; 0161; Case map */
-  { 0x000162, 0, { 0x000163 }},                      /* 0162; 0163; Case map */
-  { 0x000164, 0, { 0x000165 }},                      /* 0164; 0165; Case map */
-  { 0x000166, 0, { 0x000167 }},                      /* 0166; 0167; Case map */
-  { 0x000168, 0, { 0x000169 }},                      /* 0168; 0169; Case map */
-  { 0x00016A, 0, { 0x00016B }},                      /* 016A; 016B; Case map */
-  { 0x00016C, 0, { 0x00016D }},                      /* 016C; 016D; Case map */
-  { 0x00016E, 0, { 0x00016F }},                      /* 016E; 016F; Case map */
-  { 0x000170, 0, { 0x000171 }},                      /* 0170; 0171; Case map */
-  { 0x000172, 0, { 0x000173 }},                      /* 0172; 0173; Case map */
-  { 0x000174, 0, { 0x000175 }},                      /* 0174; 0175; Case map */
-  { 0x000176, 0, { 0x000177 }},                      /* 0176; 0177; Case map */
-  { 0x000178, 0, { 0x0000FF }},                      /* 0178; 00FF; Case map */
-  { 0x000179, 0, { 0x00017A }},                      /* 0179; 017A; Case map */
-  { 0x00017B, 0, { 0x00017C }},                      /* 017B; 017C; Case map */
-  { 0x00017D, 0, { 0x00017E }},                      /* 017D; 017E; Case map */
-  { 0x00017F, 0, { 0x000073 }},                      /* 017F; 0073; Case map */
-  { 0x000181, 0, { 0x000253 }},                      /* 0181; 0253; Case map */
-  { 0x000182, 0, { 0x000183 }},                      /* 0182; 0183; Case map */
-  { 0x000184, 0, { 0x000185 }},                      /* 0184; 0185; Case map */
-  { 0x000186, 0, { 0x000254 }},                      /* 0186; 0254; Case map */
-  { 0x000187, 0, { 0x000188 }},                      /* 0187; 0188; Case map */
-  { 0x000189, 0, { 0x000256 }},                      /* 0189; 0256; Case map */
-  { 0x00018A, 0, { 0x000257 }},                      /* 018A; 0257; Case map */
-  { 0x00018B, 0, { 0x00018C }},                      /* 018B; 018C; Case map */
-  { 0x00018E, 0, { 0x0001DD }},                      /* 018E; 01DD; Case map */
-  { 0x00018F, 0, { 0x000259 }},                      /* 018F; 0259; Case map */
-  { 0x000190, 0, { 0x00025B }},                      /* 0190; 025B; Case map */
-  { 0x000191, 0, { 0x000192 }},                      /* 0191; 0192; Case map */
-  { 0x000193, 0, { 0x000260 }},                      /* 0193; 0260; Case map */
-  { 0x000194, 0, { 0x000263 }},                      /* 0194; 0263; Case map */
-  { 0x000196, 0, { 0x000269 }},                      /* 0196; 0269; Case map */
-  { 0x000197, 0, { 0x000268 }},                      /* 0197; 0268; Case map */
-  { 0x000198, 0, { 0x000199 }},                      /* 0198; 0199; Case map */
-  { 0x00019C, 0, { 0x00026F }},                      /* 019C; 026F; Case map */
-  { 0x00019D, 0, { 0x000272 }},                      /* 019D; 0272; Case map */
-  { 0x00019F, 0, { 0x000275 }},                      /* 019F; 0275; Case map */
-  { 0x0001A0, 0, { 0x0001A1 }},                      /* 01A0; 01A1; Case map */
-  { 0x0001A2, 0, { 0x0001A3 }},                      /* 01A2; 01A3; Case map */
-  { 0x0001A4, 0, { 0x0001A5 }},                      /* 01A4; 01A5; Case map */
-  { 0x0001A6, 0, { 0x000280 }},                      /* 01A6; 0280; Case map */
-  { 0x0001A7, 0, { 0x0001A8 }},                      /* 01A7; 01A8; Case map */
-  { 0x0001A9, 0, { 0x000283 }},                      /* 01A9; 0283; Case map */
-  { 0x0001AC, 0, { 0x0001AD }},                      /* 01AC; 01AD; Case map */
-  { 0x0001AE, 0, { 0x000288 }},                      /* 01AE; 0288; Case map */
-  { 0x0001AF, 0, { 0x0001B0 }},                      /* 01AF; 01B0; Case map */
-  { 0x0001B1, 0, { 0x00028A }},                      /* 01B1; 028A; Case map */
-  { 0x0001B2, 0, { 0x00028B }},                      /* 01B2; 028B; Case map */
-  { 0x0001B3, 0, { 0x0001B4 }},                      /* 01B3; 01B4; Case map */
-  { 0x0001B5, 0, { 0x0001B6 }},                      /* 01B5; 01B6; Case map */
-  { 0x0001B7, 0, { 0x000292 }},                      /* 01B7; 0292; Case map */
-  { 0x0001B8, 0, { 0x0001B9 }},                      /* 01B8; 01B9; Case map */
-  { 0x0001BC, 0, { 0x0001BD }},                      /* 01BC; 01BD; Case map */
-  { 0x0001C4, 0, { 0x0001C6 }},                      /* 01C4; 01C6; Case map */
-  { 0x0001C5, 0, { 0x0001C6 }},                      /* 01C5; 01C6; Case map */
-  { 0x0001C7, 0, { 0x0001C9 }},                      /* 01C7; 01C9; Case map */
-  { 0x0001C8, 0, { 0x0001C9 }},                      /* 01C8; 01C9; Case map */
-  { 0x0001CA, 0, { 0x0001CC }},                      /* 01CA; 01CC; Case map */
-  { 0x0001CB, 0, { 0x0001CC }},                      /* 01CB; 01CC; Case map */
-  { 0x0001CD, 0, { 0x0001CE }},                      /* 01CD; 01CE; Case map */
-  { 0x0001CF, 0, { 0x0001D0 }},                      /* 01CF; 01D0; Case map */
-  { 0x0001D1, 0, { 0x0001D2 }},                      /* 01D1; 01D2; Case map */
-  { 0x0001D3, 0, { 0x0001D4 }},                      /* 01D3; 01D4; Case map */
-  { 0x0001D5, 0, { 0x0001D6 }},                      /* 01D5; 01D6; Case map */
-  { 0x0001D7, 0, { 0x0001D8 }},                      /* 01D7; 01D8; Case map */
-  { 0x0001D9, 0, { 0x0001DA }},                      /* 01D9; 01DA; Case map */
-  { 0x0001DB, 0, { 0x0001DC }},                      /* 01DB; 01DC; Case map */
-  { 0x0001DE, 0, { 0x0001DF }},                      /* 01DE; 01DF; Case map */
-  { 0x0001E0, 0, { 0x0001E1 }},                      /* 01E0; 01E1; Case map */
-  { 0x0001E2, 0, { 0x0001E3 }},                      /* 01E2; 01E3; Case map */
-  { 0x0001E4, 0, { 0x0001E5 }},                      /* 01E4; 01E5; Case map */
-  { 0x0001E6, 0, { 0x0001E7 }},                      /* 01E6; 01E7; Case map */
-  { 0x0001E8, 0, { 0x0001E9 }},                      /* 01E8; 01E9; Case map */
-  { 0x0001EA, 0, { 0x0001EB }},                      /* 01EA; 01EB; Case map */
-  { 0x0001EC, 0, { 0x0001ED }},                      /* 01EC; 01ED; Case map */
-  { 0x0001EE, 0, { 0x0001EF }},                      /* 01EE; 01EF; Case map */
-  { 0x0001F0, 0, { 0x00006A,                    /* 01F0; 006A 030C; Case map */
-                   0x00030C }},
-  { 0x0001F1, 0, { 0x0001F3 }},                      /* 01F1; 01F3; Case map */
-  { 0x0001F2, 0, { 0x0001F3 }},                      /* 01F2; 01F3; Case map */
-  { 0x0001F4, 0, { 0x0001F5 }},                      /* 01F4; 01F5; Case map */
-  { 0x0001F6, 0, { 0x000195 }},                      /* 01F6; 0195; Case map */
-  { 0x0001F7, 0, { 0x0001BF }},                      /* 01F7; 01BF; Case map */
-  { 0x0001F8, 0, { 0x0001F9 }},                      /* 01F8; 01F9; Case map */
-  { 0x0001FA, 0, { 0x0001FB }},                      /* 01FA; 01FB; Case map */
-  { 0x0001FC, 0, { 0x0001FD }},                      /* 01FC; 01FD; Case map */
-  { 0x0001FE, 0, { 0x0001FF }},                      /* 01FE; 01FF; Case map */
-  { 0x000200, 0, { 0x000201 }},                      /* 0200; 0201; Case map */
-  { 0x000202, 0, { 0x000203 }},                      /* 0202; 0203; Case map */
-  { 0x000204, 0, { 0x000205 }},                      /* 0204; 0205; Case map */
-  { 0x000206, 0, { 0x000207 }},                      /* 0206; 0207; Case map */
-  { 0x000208, 0, { 0x000209 }},                      /* 0208; 0209; Case map */
-  { 0x00020A, 0, { 0x00020B }},                      /* 020A; 020B; Case map */
-  { 0x00020C, 0, { 0x00020D }},                      /* 020C; 020D; Case map */
-  { 0x00020E, 0, { 0x00020F }},                      /* 020E; 020F; Case map */
-  { 0x000210, 0, { 0x000211 }},                      /* 0210; 0211; Case map */
-  { 0x000212, 0, { 0x000213 }},                      /* 0212; 0213; Case map */
-  { 0x000214, 0, { 0x000215 }},                      /* 0214; 0215; Case map */
-  { 0x000216, 0, { 0x000217 }},                      /* 0216; 0217; Case map */
-  { 0x000218, 0, { 0x000219 }},                      /* 0218; 0219; Case map */
-  { 0x00021A, 0, { 0x00021B }},                      /* 021A; 021B; Case map */
-  { 0x00021C, 0, { 0x00021D }},                      /* 021C; 021D; Case map */
-  { 0x00021E, 0, { 0x00021F }},                      /* 021E; 021F; Case map */
-  { 0x000220, 0, { 0x00019E }},                      /* 0220; 019E; Case map */
-  { 0x000222, 0, { 0x000223 }},                      /* 0222; 0223; Case map */
-  { 0x000224, 0, { 0x000225 }},                      /* 0224; 0225; Case map */
-  { 0x000226, 0, { 0x000227 }},                      /* 0226; 0227; Case map */
-  { 0x000228, 0, { 0x000229 }},                      /* 0228; 0229; Case map */
-  { 0x00022A, 0, { 0x00022B }},                      /* 022A; 022B; Case map */
-  { 0x00022C, 0, { 0x00022D }},                      /* 022C; 022D; Case map */
-  { 0x00022E, 0, { 0x00022F }},                      /* 022E; 022F; Case map */
-  { 0x000230, 0, { 0x000231 }},                      /* 0230; 0231; Case map */
-  { 0x000232, 0, { 0x000233 }},                      /* 0232; 0233; Case map */
-  { 0x000345, 0, { 0x0003B9 }},                      /* 0345; 03B9; Case map */
-  { 0x000386, 0, { 0x0003AC }},                      /* 0386; 03AC; Case map */
-  { 0x000388, 0, { 0x0003AD }},                      /* 0388; 03AD; Case map */
-  { 0x000389, 0, { 0x0003AE }},                      /* 0389; 03AE; Case map */
-  { 0x00038A, 0, { 0x0003AF }},                      /* 038A; 03AF; Case map */
-  { 0x00038C, 0, { 0x0003CC }},                      /* 038C; 03CC; Case map */
-  { 0x00038E, 0, { 0x0003CD }},                      /* 038E; 03CD; Case map */
-  { 0x00038F, 0, { 0x0003CE }},                      /* 038F; 03CE; Case map */
-  { 0x000390, 0, { 0x0003B9,               /* 0390; 03B9 0308 0301; Case map */
-                   0x000308, 0x000301 }},
-  { 0x000391, 0, { 0x0003B1 }},                      /* 0391; 03B1; Case map */
-  { 0x000392, 0, { 0x0003B2 }},                      /* 0392; 03B2; Case map */
-  { 0x000393, 0, { 0x0003B3 }},                      /* 0393; 03B3; Case map */
-  { 0x000394, 0, { 0x0003B4 }},                      /* 0394; 03B4; Case map */
-  { 0x000395, 0, { 0x0003B5 }},                      /* 0395; 03B5; Case map */
-  { 0x000396, 0, { 0x0003B6 }},                      /* 0396; 03B6; Case map */
-  { 0x000397, 0, { 0x0003B7 }},                      /* 0397; 03B7; Case map */
-  { 0x000398, 0, { 0x0003B8 }},                      /* 0398; 03B8; Case map */
-  { 0x000399, 0, { 0x0003B9 }},                      /* 0399; 03B9; Case map */
-  { 0x00039A, 0, { 0x0003BA }},                      /* 039A; 03BA; Case map */
-  { 0x00039B, 0, { 0x0003BB }},                      /* 039B; 03BB; Case map */
-  { 0x00039C, 0, { 0x0003BC }},                      /* 039C; 03BC; Case map */
-  { 0x00039D, 0, { 0x0003BD }},                      /* 039D; 03BD; Case map */
-  { 0x00039E, 0, { 0x0003BE }},                      /* 039E; 03BE; Case map */
-  { 0x00039F, 0, { 0x0003BF }},                      /* 039F; 03BF; Case map */
-  { 0x0003A0, 0, { 0x0003C0 }},                      /* 03A0; 03C0; Case map */
-  { 0x0003A1, 0, { 0x0003C1 }},                      /* 03A1; 03C1; Case map */
-  { 0x0003A3, 0, { 0x0003C3 }},                      /* 03A3; 03C3; Case map */
-  { 0x0003A4, 0, { 0x0003C4 }},                      /* 03A4; 03C4; Case map */
-  { 0x0003A5, 0, { 0x0003C5 }},                      /* 03A5; 03C5; Case map */
-  { 0x0003A6, 0, { 0x0003C6 }},                      /* 03A6; 03C6; Case map */
-  { 0x0003A7, 0, { 0x0003C7 }},                      /* 03A7; 03C7; Case map */
-  { 0x0003A8, 0, { 0x0003C8 }},                      /* 03A8; 03C8; Case map */
-  { 0x0003A9, 0, { 0x0003C9 }},                      /* 03A9; 03C9; Case map */
-  { 0x0003AA, 0, { 0x0003CA }},                      /* 03AA; 03CA; Case map */
-  { 0x0003AB, 0, { 0x0003CB }},                      /* 03AB; 03CB; Case map */
-  { 0x0003B0, 0, { 0x0003C5,               /* 03B0; 03C5 0308 0301; Case map */
-                   0x000308, 0x000301 }},
-  { 0x0003C2, 0, { 0x0003C3 }},                      /* 03C2; 03C3; Case map */
-  { 0x0003D0, 0, { 0x0003B2 }},                      /* 03D0; 03B2; Case map */
-  { 0x0003D1, 0, { 0x0003B8 }},                      /* 03D1; 03B8; Case map */
-  { 0x0003D5, 0, { 0x0003C6 }},                      /* 03D5; 03C6; Case map */
-  { 0x0003D6, 0, { 0x0003C0 }},                      /* 03D6; 03C0; Case map */
-  { 0x0003D8, 0, { 0x0003D9 }},                      /* 03D8; 03D9; Case map */
-  { 0x0003DA, 0, { 0x0003DB }},                      /* 03DA; 03DB; Case map */
-  { 0x0003DC, 0, { 0x0003DD }},                      /* 03DC; 03DD; Case map */
-  { 0x0003DE, 0, { 0x0003DF }},                      /* 03DE; 03DF; Case map */
-  { 0x0003E0, 0, { 0x0003E1 }},                      /* 03E0; 03E1; Case map */
-  { 0x0003E2, 0, { 0x0003E3 }},                      /* 03E2; 03E3; Case map */
-  { 0x0003E4, 0, { 0x0003E5 }},                      /* 03E4; 03E5; Case map */
-  { 0x0003E6, 0, { 0x0003E7 }},                      /* 03E6; 03E7; Case map */
-  { 0x0003E8, 0, { 0x0003E9 }},                      /* 03E8; 03E9; Case map */
-  { 0x0003EA, 0, { 0x0003EB }},                      /* 03EA; 03EB; Case map */
-  { 0x0003EC, 0, { 0x0003ED }},                      /* 03EC; 03ED; Case map */
-  { 0x0003EE, 0, { 0x0003EF }},                      /* 03EE; 03EF; Case map */
-  { 0x0003F0, 0, { 0x0003BA }},                      /* 03F0; 03BA; Case map */
-  { 0x0003F1, 0, { 0x0003C1 }},                      /* 03F1; 03C1; Case map */
-  { 0x0003F2, 0, { 0x0003C3 }},                      /* 03F2; 03C3; Case map */
-  { 0x0003F4, 0, { 0x0003B8 }},                      /* 03F4; 03B8; Case map */
-  { 0x0003F5, 0, { 0x0003B5 }},                      /* 03F5; 03B5; Case map */
-  { 0x000400, 0, { 0x000450 }},                      /* 0400; 0450; Case map */
-  { 0x000401, 0, { 0x000451 }},                      /* 0401; 0451; Case map */
-  { 0x000402, 0, { 0x000452 }},                      /* 0402; 0452; Case map */
-  { 0x000403, 0, { 0x000453 }},                      /* 0403; 0453; Case map */
-  { 0x000404, 0, { 0x000454 }},                      /* 0404; 0454; Case map */
-  { 0x000405, 0, { 0x000455 }},                      /* 0405; 0455; Case map */
-  { 0x000406, 0, { 0x000456 }},                      /* 0406; 0456; Case map */
-  { 0x000407, 0, { 0x000457 }},                      /* 0407; 0457; Case map */
-  { 0x000408, 0, { 0x000458 }},                      /* 0408; 0458; Case map */
-  { 0x000409, 0, { 0x000459 }},                      /* 0409; 0459; Case map */
-  { 0x00040A, 0, { 0x00045A }},                      /* 040A; 045A; Case map */
-  { 0x00040B, 0, { 0x00045B }},                      /* 040B; 045B; Case map */
-  { 0x00040C, 0, { 0x00045C }},                      /* 040C; 045C; Case map */
-  { 0x00040D, 0, { 0x00045D }},                      /* 040D; 045D; Case map */
-  { 0x00040E, 0, { 0x00045E }},                      /* 040E; 045E; Case map */
-  { 0x00040F, 0, { 0x00045F }},                      /* 040F; 045F; Case map */
-  { 0x000410, 0, { 0x000430 }},                      /* 0410; 0430; Case map */
-  { 0x000411, 0, { 0x000431 }},                      /* 0411; 0431; Case map */
-  { 0x000412, 0, { 0x000432 }},                      /* 0412; 0432; Case map */
-  { 0x000413, 0, { 0x000433 }},                      /* 0413; 0433; Case map */
-  { 0x000414, 0, { 0x000434 }},                      /* 0414; 0434; Case map */
-  { 0x000415, 0, { 0x000435 }},                      /* 0415; 0435; Case map */
-  { 0x000416, 0, { 0x000436 }},                      /* 0416; 0436; Case map */
-  { 0x000417, 0, { 0x000437 }},                      /* 0417; 0437; Case map */
-  { 0x000418, 0, { 0x000438 }},                      /* 0418; 0438; Case map */
-  { 0x000419, 0, { 0x000439 }},                      /* 0419; 0439; Case map */
-  { 0x00041A, 0, { 0x00043A }},                      /* 041A; 043A; Case map */
-  { 0x00041B, 0, { 0x00043B }},                      /* 041B; 043B; Case map */
-  { 0x00041C, 0, { 0x00043C }},                      /* 041C; 043C; Case map */
-  { 0x00041D, 0, { 0x00043D }},                      /* 041D; 043D; Case map */
-  { 0x00041E, 0, { 0x00043E }},                      /* 041E; 043E; Case map */
-  { 0x00041F, 0, { 0x00043F }},                      /* 041F; 043F; Case map */
-  { 0x000420, 0, { 0x000440 }},                      /* 0420; 0440; Case map */
-  { 0x000421, 0, { 0x000441 }},                      /* 0421; 0441; Case map */
-  { 0x000422, 0, { 0x000442 }},                      /* 0422; 0442; Case map */
-  { 0x000423, 0, { 0x000443 }},                      /* 0423; 0443; Case map */
-  { 0x000424, 0, { 0x000444 }},                      /* 0424; 0444; Case map */
-  { 0x000425, 0, { 0x000445 }},                      /* 0425; 0445; Case map */
-  { 0x000426, 0, { 0x000446 }},                      /* 0426; 0446; Case map */
-  { 0x000427, 0, { 0x000447 }},                      /* 0427; 0447; Case map */
-  { 0x000428, 0, { 0x000448 }},                      /* 0428; 0448; Case map */
-  { 0x000429, 0, { 0x000449 }},                      /* 0429; 0449; Case map */
-  { 0x00042A, 0, { 0x00044A }},                      /* 042A; 044A; Case map */
-  { 0x00042B, 0, { 0x00044B }},                      /* 042B; 044B; Case map */
-  { 0x00042C, 0, { 0x00044C }},                      /* 042C; 044C; Case map */
-  { 0x00042D, 0, { 0x00044D }},                      /* 042D; 044D; Case map */
-  { 0x00042E, 0, { 0x00044E }},                      /* 042E; 044E; Case map */
-  { 0x00042F, 0, { 0x00044F }},                      /* 042F; 044F; Case map */
-  { 0x000460, 0, { 0x000461 }},                      /* 0460; 0461; Case map */
-  { 0x000462, 0, { 0x000463 }},                      /* 0462; 0463; Case map */
-  { 0x000464, 0, { 0x000465 }},                      /* 0464; 0465; Case map */
-  { 0x000466, 0, { 0x000467 }},                      /* 0466; 0467; Case map */
-  { 0x000468, 0, { 0x000469 }},                      /* 0468; 0469; Case map */
-  { 0x00046A, 0, { 0x00046B }},                      /* 046A; 046B; Case map */
-  { 0x00046C, 0, { 0x00046D }},                      /* 046C; 046D; Case map */
-  { 0x00046E, 0, { 0x00046F }},                      /* 046E; 046F; Case map */
-  { 0x000470, 0, { 0x000471 }},                      /* 0470; 0471; Case map */
-  { 0x000472, 0, { 0x000473 }},                      /* 0472; 0473; Case map */
-  { 0x000474, 0, { 0x000475 }},                      /* 0474; 0475; Case map */
-  { 0x000476, 0, { 0x000477 }},                      /* 0476; 0477; Case map */
-  { 0x000478, 0, { 0x000479 }},                      /* 0478; 0479; Case map */
-  { 0x00047A, 0, { 0x00047B }},                      /* 047A; 047B; Case map */
-  { 0x00047C, 0, { 0x00047D }},                      /* 047C; 047D; Case map */
-  { 0x00047E, 0, { 0x00047F }},                      /* 047E; 047F; Case map */
-  { 0x000480, 0, { 0x000481 }},                      /* 0480; 0481; Case map */
-  { 0x00048A, 0, { 0x00048B }},                      /* 048A; 048B; Case map */
-  { 0x00048C, 0, { 0x00048D }},                      /* 048C; 048D; Case map */
-  { 0x00048E, 0, { 0x00048F }},                      /* 048E; 048F; Case map */
-  { 0x000490, 0, { 0x000491 }},                      /* 0490; 0491; Case map */
-  { 0x000492, 0, { 0x000493 }},                      /* 0492; 0493; Case map */
-  { 0x000494, 0, { 0x000495 }},                      /* 0494; 0495; Case map */
-  { 0x000496, 0, { 0x000497 }},                      /* 0496; 0497; Case map */
-  { 0x000498, 0, { 0x000499 }},                      /* 0498; 0499; Case map */
-  { 0x00049A, 0, { 0x00049B }},                      /* 049A; 049B; Case map */
-  { 0x00049C, 0, { 0x00049D }},                      /* 049C; 049D; Case map */
-  { 0x00049E, 0, { 0x00049F }},                      /* 049E; 049F; Case map */
-  { 0x0004A0, 0, { 0x0004A1 }},                      /* 04A0; 04A1; Case map */
-  { 0x0004A2, 0, { 0x0004A3 }},                      /* 04A2; 04A3; Case map */
-  { 0x0004A4, 0, { 0x0004A5 }},                      /* 04A4; 04A5; Case map */
-  { 0x0004A6, 0, { 0x0004A7 }},                      /* 04A6; 04A7; Case map */
-  { 0x0004A8, 0, { 0x0004A9 }},                      /* 04A8; 04A9; Case map */
-  { 0x0004AA, 0, { 0x0004AB }},                      /* 04AA; 04AB; Case map */
-  { 0x0004AC, 0, { 0x0004AD }},                      /* 04AC; 04AD; Case map */
-  { 0x0004AE, 0, { 0x0004AF }},                      /* 04AE; 04AF; Case map */
-  { 0x0004B0, 0, { 0x0004B1 }},                      /* 04B0; 04B1; Case map */
-  { 0x0004B2, 0, { 0x0004B3 }},                      /* 04B2; 04B3; Case map */
-  { 0x0004B4, 0, { 0x0004B5 }},                      /* 04B4; 04B5; Case map */
-  { 0x0004B6, 0, { 0x0004B7 }},                      /* 04B6; 04B7; Case map */
-  { 0x0004B8, 0, { 0x0004B9 }},                      /* 04B8; 04B9; Case map */
-  { 0x0004BA, 0, { 0x0004BB }},                      /* 04BA; 04BB; Case map */
-  { 0x0004BC, 0, { 0x0004BD }},                      /* 04BC; 04BD; Case map */
-  { 0x0004BE, 0, { 0x0004BF }},                      /* 04BE; 04BF; Case map */
-  { 0x0004C1, 0, { 0x0004C2 }},                      /* 04C1; 04C2; Case map */
-  { 0x0004C3, 0, { 0x0004C4 }},                      /* 04C3; 04C4; Case map */
-  { 0x0004C5, 0, { 0x0004C6 }},                      /* 04C5; 04C6; Case map */
-  { 0x0004C7, 0, { 0x0004C8 }},                      /* 04C7; 04C8; Case map */
-  { 0x0004C9, 0, { 0x0004CA }},                      /* 04C9; 04CA; Case map */
-  { 0x0004CB, 0, { 0x0004CC }},                      /* 04CB; 04CC; Case map */
-  { 0x0004CD, 0, { 0x0004CE }},                      /* 04CD; 04CE; Case map */
-  { 0x0004D0, 0, { 0x0004D1 }},                      /* 04D0; 04D1; Case map */
-  { 0x0004D2, 0, { 0x0004D3 }},                      /* 04D2; 04D3; Case map */
-  { 0x0004D4, 0, { 0x0004D5 }},                      /* 04D4; 04D5; Case map */
-  { 0x0004D6, 0, { 0x0004D7 }},                      /* 04D6; 04D7; Case map */
-  { 0x0004D8, 0, { 0x0004D9 }},                      /* 04D8; 04D9; Case map */
-  { 0x0004DA, 0, { 0x0004DB }},                      /* 04DA; 04DB; Case map */
-  { 0x0004DC, 0, { 0x0004DD }},                      /* 04DC; 04DD; Case map */
-  { 0x0004DE, 0, { 0x0004DF }},                      /* 04DE; 04DF; Case map */
-  { 0x0004E0, 0, { 0x0004E1 }},                      /* 04E0; 04E1; Case map */
-  { 0x0004E2, 0, { 0x0004E3 }},                      /* 04E2; 04E3; Case map */
-  { 0x0004E4, 0, { 0x0004E5 }},                      /* 04E4; 04E5; Case map */
-  { 0x0004E6, 0, { 0x0004E7 }},                      /* 04E6; 04E7; Case map */
-  { 0x0004E8, 0, { 0x0004E9 }},                      /* 04E8; 04E9; Case map */
-  { 0x0004EA, 0, { 0x0004EB }},                      /* 04EA; 04EB; Case map */
-  { 0x0004EC, 0, { 0x0004ED }},                      /* 04EC; 04ED; Case map */
-  { 0x0004EE, 0, { 0x0004EF }},                      /* 04EE; 04EF; Case map */
-  { 0x0004F0, 0, { 0x0004F1 }},                      /* 04F0; 04F1; Case map */
-  { 0x0004F2, 0, { 0x0004F3 }},                      /* 04F2; 04F3; Case map */
-  { 0x0004F4, 0, { 0x0004F5 }},                      /* 04F4; 04F5; Case map */
-  { 0x0004F8, 0, { 0x0004F9 }},                      /* 04F8; 04F9; Case map */
-  { 0x000500, 0, { 0x000501 }},                      /* 0500; 0501; Case map */
-  { 0x000502, 0, { 0x000503 }},                      /* 0502; 0503; Case map */
-  { 0x000504, 0, { 0x000505 }},                      /* 0504; 0505; Case map */
-  { 0x000506, 0, { 0x000507 }},                      /* 0506; 0507; Case map */
-  { 0x000508, 0, { 0x000509 }},                      /* 0508; 0509; Case map */
-  { 0x00050A, 0, { 0x00050B }},                      /* 050A; 050B; Case map */
-  { 0x00050C, 0, { 0x00050D }},                      /* 050C; 050D; Case map */
-  { 0x00050E, 0, { 0x00050F }},                      /* 050E; 050F; Case map */
-  { 0x000531, 0, { 0x000561 }},                      /* 0531; 0561; Case map */
-  { 0x000532, 0, { 0x000562 }},                      /* 0532; 0562; Case map */
-  { 0x000533, 0, { 0x000563 }},                      /* 0533; 0563; Case map */
-  { 0x000534, 0, { 0x000564 }},                      /* 0534; 0564; Case map */
-  { 0x000535, 0, { 0x000565 }},                      /* 0535; 0565; Case map */
-  { 0x000536, 0, { 0x000566 }},                      /* 0536; 0566; Case map */
-  { 0x000537, 0, { 0x000567 }},                      /* 0537; 0567; Case map */
-  { 0x000538, 0, { 0x000568 }},                      /* 0538; 0568; Case map */
-  { 0x000539, 0, { 0x000569 }},                      /* 0539; 0569; Case map */
-  { 0x00053A, 0, { 0x00056A }},                      /* 053A; 056A; Case map */
-  { 0x00053B, 0, { 0x00056B }},                      /* 053B; 056B; Case map */
-  { 0x00053C, 0, { 0x00056C }},                      /* 053C; 056C; Case map */
-  { 0x00053D, 0, { 0x00056D }},                      /* 053D; 056D; Case map */
-  { 0x00053E, 0, { 0x00056E }},                      /* 053E; 056E; Case map */
-  { 0x00053F, 0, { 0x00056F }},                      /* 053F; 056F; Case map */
-  { 0x000540, 0, { 0x000570 }},                      /* 0540; 0570; Case map */
-  { 0x000541, 0, { 0x000571 }},                      /* 0541; 0571; Case map */
-  { 0x000542, 0, { 0x000572 }},                      /* 0542; 0572; Case map */
-  { 0x000543, 0, { 0x000573 }},                      /* 0543; 0573; Case map */
-  { 0x000544, 0, { 0x000574 }},                      /* 0544; 0574; Case map */
-  { 0x000545, 0, { 0x000575 }},                      /* 0545; 0575; Case map */
-  { 0x000546, 0, { 0x000576 }},                      /* 0546; 0576; Case map */
-  { 0x000547, 0, { 0x000577 }},                      /* 0547; 0577; Case map */
-  { 0x000548, 0, { 0x000578 }},                      /* 0548; 0578; Case map */
-  { 0x000549, 0, { 0x000579 }},                      /* 0549; 0579; Case map */
-  { 0x00054A, 0, { 0x00057A }},                      /* 054A; 057A; Case map */
-  { 0x00054B, 0, { 0x00057B }},                      /* 054B; 057B; Case map */
-  { 0x00054C, 0, { 0x00057C }},                      /* 054C; 057C; Case map */
-  { 0x00054D, 0, { 0x00057D }},                      /* 054D; 057D; Case map */
-  { 0x00054E, 0, { 0x00057E }},                      /* 054E; 057E; Case map */
-  { 0x00054F, 0, { 0x00057F }},                      /* 054F; 057F; Case map */
-  { 0x000550, 0, { 0x000580 }},                      /* 0550; 0580; Case map */
-  { 0x000551, 0, { 0x000581 }},                      /* 0551; 0581; Case map */
-  { 0x000552, 0, { 0x000582 }},                      /* 0552; 0582; Case map */
-  { 0x000553, 0, { 0x000583 }},                      /* 0553; 0583; Case map */
-  { 0x000554, 0, { 0x000584 }},                      /* 0554; 0584; Case map */
-  { 0x000555, 0, { 0x000585 }},                      /* 0555; 0585; Case map */
-  { 0x000556, 0, { 0x000586 }},                      /* 0556; 0586; Case map */
-  { 0x000587, 0, { 0x000565,                    /* 0587; 0565 0582; Case map */
-                   0x000582 }},
-  { 0x001E00, 0, { 0x001E01 }},                      /* 1E00; 1E01; Case map */
-  { 0x001E02, 0, { 0x001E03 }},                      /* 1E02; 1E03; Case map */
-  { 0x001E04, 0, { 0x001E05 }},                      /* 1E04; 1E05; Case map */
-  { 0x001E06, 0, { 0x001E07 }},                      /* 1E06; 1E07; Case map */
-  { 0x001E08, 0, { 0x001E09 }},                      /* 1E08; 1E09; Case map */
-  { 0x001E0A, 0, { 0x001E0B }},                      /* 1E0A; 1E0B; Case map */
-  { 0x001E0C, 0, { 0x001E0D }},                      /* 1E0C; 1E0D; Case map */
-  { 0x001E0E, 0, { 0x001E0F }},                      /* 1E0E; 1E0F; Case map */
-  { 0x001E10, 0, { 0x001E11 }},                      /* 1E10; 1E11; Case map */
-  { 0x001E12, 0, { 0x001E13 }},                      /* 1E12; 1E13; Case map */
-  { 0x001E14, 0, { 0x001E15 }},                      /* 1E14; 1E15; Case map */
-  { 0x001E16, 0, { 0x001E17 }},                      /* 1E16; 1E17; Case map */
-  { 0x001E18, 0, { 0x001E19 }},                      /* 1E18; 1E19; Case map */
-  { 0x001E1A, 0, { 0x001E1B }},                      /* 1E1A; 1E1B; Case map */
-  { 0x001E1C, 0, { 0x001E1D }},                      /* 1E1C; 1E1D; Case map */
-  { 0x001E1E, 0, { 0x001E1F }},                      /* 1E1E; 1E1F; Case map */
-  { 0x001E20, 0, { 0x001E21 }},                      /* 1E20; 1E21; Case map */
-  { 0x001E22, 0, { 0x001E23 }},                      /* 1E22; 1E23; Case map */
-  { 0x001E24, 0, { 0x001E25 }},                      /* 1E24; 1E25; Case map */
-  { 0x001E26, 0, { 0x001E27 }},                      /* 1E26; 1E27; Case map */
-  { 0x001E28, 0, { 0x001E29 }},                      /* 1E28; 1E29; Case map */
-  { 0x001E2A, 0, { 0x001E2B }},                      /* 1E2A; 1E2B; Case map */
-  { 0x001E2C, 0, { 0x001E2D }},                      /* 1E2C; 1E2D; Case map */
-  { 0x001E2E, 0, { 0x001E2F }},                      /* 1E2E; 1E2F; Case map */
-  { 0x001E30, 0, { 0x001E31 }},                      /* 1E30; 1E31; Case map */
-  { 0x001E32, 0, { 0x001E33 }},                      /* 1E32; 1E33; Case map */
-  { 0x001E34, 0, { 0x001E35 }},                      /* 1E34; 1E35; Case map */
-  { 0x001E36, 0, { 0x001E37 }},                      /* 1E36; 1E37; Case map */
-  { 0x001E38, 0, { 0x001E39 }},                      /* 1E38; 1E39; Case map */
-  { 0x001E3A, 0, { 0x001E3B }},                      /* 1E3A; 1E3B; Case map */
-  { 0x001E3C, 0, { 0x001E3D }},                      /* 1E3C; 1E3D; Case map */
-  { 0x001E3E, 0, { 0x001E3F }},                      /* 1E3E; 1E3F; Case map */
-  { 0x001E40, 0, { 0x001E41 }},                      /* 1E40; 1E41; Case map */
-  { 0x001E42, 0, { 0x001E43 }},                      /* 1E42; 1E43; Case map */
-  { 0x001E44, 0, { 0x001E45 }},                      /* 1E44; 1E45; Case map */
-  { 0x001E46, 0, { 0x001E47 }},                      /* 1E46; 1E47; Case map */
-  { 0x001E48, 0, { 0x001E49 }},                      /* 1E48; 1E49; Case map */
-  { 0x001E4A, 0, { 0x001E4B }},                      /* 1E4A; 1E4B; Case map */
-  { 0x001E4C, 0, { 0x001E4D }},                      /* 1E4C; 1E4D; Case map */
-  { 0x001E4E, 0, { 0x001E4F }},                      /* 1E4E; 1E4F; Case map */
-  { 0x001E50, 0, { 0x001E51 }},                      /* 1E50; 1E51; Case map */
-  { 0x001E52, 0, { 0x001E53 }},                      /* 1E52; 1E53; Case map */
-  { 0x001E54, 0, { 0x001E55 }},                      /* 1E54; 1E55; Case map */
-  { 0x001E56, 0, { 0x001E57 }},                      /* 1E56; 1E57; Case map */
-  { 0x001E58, 0, { 0x001E59 }},                      /* 1E58; 1E59; Case map */
-  { 0x001E5A, 0, { 0x001E5B }},                      /* 1E5A; 1E5B; Case map */
-  { 0x001E5C, 0, { 0x001E5D }},                      /* 1E5C; 1E5D; Case map */
-  { 0x001E5E, 0, { 0x001E5F }},                      /* 1E5E; 1E5F; Case map */
-  { 0x001E60, 0, { 0x001E61 }},                      /* 1E60; 1E61; Case map */
-  { 0x001E62, 0, { 0x001E63 }},                      /* 1E62; 1E63; Case map */
-  { 0x001E64, 0, { 0x001E65 }},                      /* 1E64; 1E65; Case map */
-  { 0x001E66, 0, { 0x001E67 }},                      /* 1E66; 1E67; Case map */
-  { 0x001E68, 0, { 0x001E69 }},                      /* 1E68; 1E69; Case map */
-  { 0x001E6A, 0, { 0x001E6B }},                      /* 1E6A; 1E6B; Case map */
-  { 0x001E6C, 0, { 0x001E6D }},                      /* 1E6C; 1E6D; Case map */
-  { 0x001E6E, 0, { 0x001E6F }},                      /* 1E6E; 1E6F; Case map */
-  { 0x001E70, 0, { 0x001E71 }},                      /* 1E70; 1E71; Case map */
-  { 0x001E72, 0, { 0x001E73 }},                      /* 1E72; 1E73; Case map */
-  { 0x001E74, 0, { 0x001E75 }},                      /* 1E74; 1E75; Case map */
-  { 0x001E76, 0, { 0x001E77 }},                      /* 1E76; 1E77; Case map */
-  { 0x001E78, 0, { 0x001E79 }},                      /* 1E78; 1E79; Case map */
-  { 0x001E7A, 0, { 0x001E7B }},                      /* 1E7A; 1E7B; Case map */
-  { 0x001E7C, 0, { 0x001E7D }},                      /* 1E7C; 1E7D; Case map */
-  { 0x001E7E, 0, { 0x001E7F }},                      /* 1E7E; 1E7F; Case map */
-  { 0x001E80, 0, { 0x001E81 }},                      /* 1E80; 1E81; Case map */
-  { 0x001E82, 0, { 0x001E83 }},                      /* 1E82; 1E83; Case map */
-  { 0x001E84, 0, { 0x001E85 }},                      /* 1E84; 1E85; Case map */
-  { 0x001E86, 0, { 0x001E87 }},                      /* 1E86; 1E87; Case map */
-  { 0x001E88, 0, { 0x001E89 }},                      /* 1E88; 1E89; Case map */
-  { 0x001E8A, 0, { 0x001E8B }},                      /* 1E8A; 1E8B; Case map */
-  { 0x001E8C, 0, { 0x001E8D }},                      /* 1E8C; 1E8D; Case map */
-  { 0x001E8E, 0, { 0x001E8F }},                      /* 1E8E; 1E8F; Case map */
-  { 0x001E90, 0, { 0x001E91 }},                      /* 1E90; 1E91; Case map */
-  { 0x001E92, 0, { 0x001E93 }},                      /* 1E92; 1E93; Case map */
-  { 0x001E94, 0, { 0x001E95 }},                      /* 1E94; 1E95; Case map */
-  { 0x001E96, 0, { 0x000068,                    /* 1E96; 0068 0331; Case map */
-                   0x000331 }},
-  { 0x001E97, 0, { 0x000074,                    /* 1E97; 0074 0308; Case map */
-                   0x000308 }},
-  { 0x001E98, 0, { 0x000077,                    /* 1E98; 0077 030A; Case map */
-                   0x00030A }},
-  { 0x001E99, 0, { 0x000079,                    /* 1E99; 0079 030A; Case map */
-                   0x00030A }},
-  { 0x001E9A, 0, { 0x000061,                    /* 1E9A; 0061 02BE; Case map */
-                   0x0002BE }},
-  { 0x001E9B, 0, { 0x001E61 }},                      /* 1E9B; 1E61; Case map */
-  { 0x001EA0, 0, { 0x001EA1 }},                      /* 1EA0; 1EA1; Case map */
-  { 0x001EA2, 0, { 0x001EA3 }},                      /* 1EA2; 1EA3; Case map */
-  { 0x001EA4, 0, { 0x001EA5 }},                      /* 1EA4; 1EA5; Case map */
-  { 0x001EA6, 0, { 0x001EA7 }},                      /* 1EA6; 1EA7; Case map */
-  { 0x001EA8, 0, { 0x001EA9 }},                      /* 1EA8; 1EA9; Case map */
-  { 0x001EAA, 0, { 0x001EAB }},                      /* 1EAA; 1EAB; Case map */
-  { 0x001EAC, 0, { 0x001EAD }},                      /* 1EAC; 1EAD; Case map */
-  { 0x001EAE, 0, { 0x001EAF }},                      /* 1EAE; 1EAF; Case map */
-  { 0x001EB0, 0, { 0x001EB1 }},                      /* 1EB0; 1EB1; Case map */
-  { 0x001EB2, 0, { 0x001EB3 }},                      /* 1EB2; 1EB3; Case map */
-  { 0x001EB4, 0, { 0x001EB5 }},                      /* 1EB4; 1EB5; Case map */
-  { 0x001EB6, 0, { 0x001EB7 }},                      /* 1EB6; 1EB7; Case map */
-  { 0x001EB8, 0, { 0x001EB9 }},                      /* 1EB8; 1EB9; Case map */
-  { 0x001EBA, 0, { 0x001EBB }},                      /* 1EBA; 1EBB; Case map */
-  { 0x001EBC, 0, { 0x001EBD }},                      /* 1EBC; 1EBD; Case map */
-  { 0x001EBE, 0, { 0x001EBF }},                      /* 1EBE; 1EBF; Case map */
-  { 0x001EC0, 0, { 0x001EC1 }},                      /* 1EC0; 1EC1; Case map */
-  { 0x001EC2, 0, { 0x001EC3 }},                      /* 1EC2; 1EC3; Case map */
-  { 0x001EC4, 0, { 0x001EC5 }},                      /* 1EC4; 1EC5; Case map */
-  { 0x001EC6, 0, { 0x001EC7 }},                      /* 1EC6; 1EC7; Case map */
-  { 0x001EC8, 0, { 0x001EC9 }},                      /* 1EC8; 1EC9; Case map */
-  { 0x001ECA, 0, { 0x001ECB }},                      /* 1ECA; 1ECB; Case map */
-  { 0x001ECC, 0, { 0x001ECD }},                      /* 1ECC; 1ECD; Case map */
-  { 0x001ECE, 0, { 0x001ECF }},                      /* 1ECE; 1ECF; Case map */
-  { 0x001ED0, 0, { 0x001ED1 }},                      /* 1ED0; 1ED1; Case map */
-  { 0x001ED2, 0, { 0x001ED3 }},                      /* 1ED2; 1ED3; Case map */
-  { 0x001ED4, 0, { 0x001ED5 }},                      /* 1ED4; 1ED5; Case map */
-  { 0x001ED6, 0, { 0x001ED7 }},                      /* 1ED6; 1ED7; Case map */
-  { 0x001ED8, 0, { 0x001ED9 }},                      /* 1ED8; 1ED9; Case map */
-  { 0x001EDA, 0, { 0x001EDB }},                      /* 1EDA; 1EDB; Case map */
-  { 0x001EDC, 0, { 0x001EDD }},                      /* 1EDC; 1EDD; Case map */
-  { 0x001EDE, 0, { 0x001EDF }},                      /* 1EDE; 1EDF; Case map */
-  { 0x001EE0, 0, { 0x001EE1 }},                      /* 1EE0; 1EE1; Case map */
-  { 0x001EE2, 0, { 0x001EE3 }},                      /* 1EE2; 1EE3; Case map */
-  { 0x001EE4, 0, { 0x001EE5 }},                      /* 1EE4; 1EE5; Case map */
-  { 0x001EE6, 0, { 0x001EE7 }},                      /* 1EE6; 1EE7; Case map */
-  { 0x001EE8, 0, { 0x001EE9 }},                      /* 1EE8; 1EE9; Case map */
-  { 0x001EEA, 0, { 0x001EEB }},                      /* 1EEA; 1EEB; Case map */
-  { 0x001EEC, 0, { 0x001EED }},                      /* 1EEC; 1EED; Case map */
-  { 0x001EEE, 0, { 0x001EEF }},                      /* 1EEE; 1EEF; Case map */
-  { 0x001EF0, 0, { 0x001EF1 }},                      /* 1EF0; 1EF1; Case map */
-  { 0x001EF2, 0, { 0x001EF3 }},                      /* 1EF2; 1EF3; Case map */
-  { 0x001EF4, 0, { 0x001EF5 }},                      /* 1EF4; 1EF5; Case map */
-  { 0x001EF6, 0, { 0x001EF7 }},                      /* 1EF6; 1EF7; Case map */
-  { 0x001EF8, 0, { 0x001EF9 }},                      /* 1EF8; 1EF9; Case map */
-  { 0x001F08, 0, { 0x001F00 }},                      /* 1F08; 1F00; Case map */
-  { 0x001F09, 0, { 0x001F01 }},                      /* 1F09; 1F01; Case map */
-  { 0x001F0A, 0, { 0x001F02 }},                      /* 1F0A; 1F02; Case map */
-  { 0x001F0B, 0, { 0x001F03 }},                      /* 1F0B; 1F03; Case map */
-  { 0x001F0C, 0, { 0x001F04 }},                      /* 1F0C; 1F04; Case map */
-  { 0x001F0D, 0, { 0x001F05 }},                      /* 1F0D; 1F05; Case map */
-  { 0x001F0E, 0, { 0x001F06 }},                      /* 1F0E; 1F06; Case map */
-  { 0x001F0F, 0, { 0x001F07 }},                      /* 1F0F; 1F07; Case map */
-  { 0x001F18, 0, { 0x001F10 }},                      /* 1F18; 1F10; Case map */
-  { 0x001F19, 0, { 0x001F11 }},                      /* 1F19; 1F11; Case map */
-  { 0x001F1A, 0, { 0x001F12 }},                      /* 1F1A; 1F12; Case map */
-  { 0x001F1B, 0, { 0x001F13 }},                      /* 1F1B; 1F13; Case map */
-  { 0x001F1C, 0, { 0x001F14 }},                      /* 1F1C; 1F14; Case map */
-  { 0x001F1D, 0, { 0x001F15 }},                      /* 1F1D; 1F15; Case map */
-  { 0x001F28, 0, { 0x001F20 }},                      /* 1F28; 1F20; Case map */
-  { 0x001F29, 0, { 0x001F21 }},                      /* 1F29; 1F21; Case map */
-  { 0x001F2A, 0, { 0x001F22 }},                      /* 1F2A; 1F22; Case map */
-  { 0x001F2B, 0, { 0x001F23 }},                      /* 1F2B; 1F23; Case map */
-  { 0x001F2C, 0, { 0x001F24 }},                      /* 1F2C; 1F24; Case map */
-  { 0x001F2D, 0, { 0x001F25 }},                      /* 1F2D; 1F25; Case map */
-  { 0x001F2E, 0, { 0x001F26 }},                      /* 1F2E; 1F26; Case map */
-  { 0x001F2F, 0, { 0x001F27 }},                      /* 1F2F; 1F27; Case map */
-  { 0x001F38, 0, { 0x001F30 }},                      /* 1F38; 1F30; Case map */
-  { 0x001F39, 0, { 0x001F31 }},                      /* 1F39; 1F31; Case map */
-  { 0x001F3A, 0, { 0x001F32 }},                      /* 1F3A; 1F32; Case map */
-  { 0x001F3B, 0, { 0x001F33 }},                      /* 1F3B; 1F33; Case map */
-  { 0x001F3C, 0, { 0x001F34 }},                      /* 1F3C; 1F34; Case map */
-  { 0x001F3D, 0, { 0x001F35 }},                      /* 1F3D; 1F35; Case map */
-  { 0x001F3E, 0, { 0x001F36 }},                      /* 1F3E; 1F36; Case map */
-  { 0x001F3F, 0, { 0x001F37 }},                      /* 1F3F; 1F37; Case map */
-  { 0x001F48, 0, { 0x001F40 }},                      /* 1F48; 1F40; Case map */
-  { 0x001F49, 0, { 0x001F41 }},                      /* 1F49; 1F41; Case map */
-  { 0x001F4A, 0, { 0x001F42 }},                      /* 1F4A; 1F42; Case map */
-  { 0x001F4B, 0, { 0x001F43 }},                      /* 1F4B; 1F43; Case map */
-  { 0x001F4C, 0, { 0x001F44 }},                      /* 1F4C; 1F44; Case map */
-  { 0x001F4D, 0, { 0x001F45 }},                      /* 1F4D; 1F45; Case map */
-  { 0x001F50, 0, { 0x0003C5,                    /* 1F50; 03C5 0313; Case map */
-                   0x000313 }},
-  { 0x001F52, 0, { 0x0003C5,               /* 1F52; 03C5 0313 0300; Case map */
-                   0x000313, 0x000300 }},
-  { 0x001F54, 0, { 0x0003C5,               /* 1F54; 03C5 0313 0301; Case map */
-                   0x000313, 0x000301 }},
-  { 0x001F56, 0, { 0x0003C5,               /* 1F56; 03C5 0313 0342; Case map */
-                   0x000313, 0x000342 }},
-  { 0x001F59, 0, { 0x001F51 }},                      /* 1F59; 1F51; Case map */
-  { 0x001F5B, 0, { 0x001F53 }},                      /* 1F5B; 1F53; Case map */
-  { 0x001F5D, 0, { 0x001F55 }},                      /* 1F5D; 1F55; Case map */
-  { 0x001F5F, 0, { 0x001F57 }},                      /* 1F5F; 1F57; Case map */
-  { 0x001F68, 0, { 0x001F60 }},                      /* 1F68; 1F60; Case map */
-  { 0x001F69, 0, { 0x001F61 }},                      /* 1F69; 1F61; Case map */
-  { 0x001F6A, 0, { 0x001F62 }},                      /* 1F6A; 1F62; Case map */
-  { 0x001F6B, 0, { 0x001F63 }},                      /* 1F6B; 1F63; Case map */
-  { 0x001F6C, 0, { 0x001F64 }},                      /* 1F6C; 1F64; Case map */
-  { 0x001F6D, 0, { 0x001F65 }},                      /* 1F6D; 1F65; Case map */
-  { 0x001F6E, 0, { 0x001F66 }},                      /* 1F6E; 1F66; Case map */
-  { 0x001F6F, 0, { 0x001F67 }},                      /* 1F6F; 1F67; Case map */
-  { 0x001F80, 0, { 0x001F00,                    /* 1F80; 1F00 03B9; Case map */
-                   0x0003B9 }},
-  { 0x001F81, 0, { 0x001F01,                    /* 1F81; 1F01 03B9; Case map */
-                   0x0003B9 }},
-  { 0x001F82, 0, { 0x001F02,                    /* 1F82; 1F02 03B9; Case map */
-                   0x0003B9 }},
-  { 0x001F83, 0, { 0x001F03,                    /* 1F83; 1F03 03B9; Case map */
-                   0x0003B9 }},
-  { 0x001F84, 0, { 0x001F04,                    /* 1F84; 1F04 03B9; Case map */
-                   0x0003B9 }},
-  { 0x001F85, 0, { 0x001F05,                    /* 1F85; 1F05 03B9; Case map */
-                   0x0003B9 }},
-  { 0x001F86, 0, { 0x001F06,                    /* 1F86; 1F06 03B9; Case map */
-                   0x0003B9 }},
-  { 0x001F87, 0, { 0x001F07,                    /* 1F87; 1F07 03B9; Case map */
-                   0x0003B9 }},
-  { 0x001F88, 0, { 0x001F00,                    /* 1F88; 1F00 03B9; Case map */
-                   0x0003B9 }},
-  { 0x001F89, 0, { 0x001F01,                    /* 1F89; 1F01 03B9; Case map */
-                   0x0003B9 }},
-  { 0x001F8A, 0, { 0x001F02,                    /* 1F8A; 1F02 03B9; Case map */
-                   0x0003B9 }},
-  { 0x001F8B, 0, { 0x001F03,                    /* 1F8B; 1F03 03B9; Case map */
-                   0x0003B9 }},
-  { 0x001F8C, 0, { 0x001F04,                    /* 1F8C; 1F04 03B9; Case map */
-                   0x0003B9 }},
-  { 0x001F8D, 0, { 0x001F05,                    /* 1F8D; 1F05 03B9; Case map */
-                   0x0003B9 }},
-  { 0x001F8E, 0, { 0x001F06,                    /* 1F8E; 1F06 03B9; Case map */
-                   0x0003B9 }},
-  { 0x001F8F, 0, { 0x001F07,                    /* 1F8F; 1F07 03B9; Case map */
-                   0x0003B9 }},
-  { 0x001F90, 0, { 0x001F20,                    /* 1F90; 1F20 03B9; Case map */
-                   0x0003B9 }},
-  { 0x001F91, 0, { 0x001F21,                    /* 1F91; 1F21 03B9; Case map */
-                   0x0003B9 }},
-  { 0x001F92, 0, { 0x001F22,                    /* 1F92; 1F22 03B9; Case map */
-                   0x0003B9 }},
-  { 0x001F93, 0, { 0x001F23,                    /* 1F93; 1F23 03B9; Case map */
-                   0x0003B9 }},
-  { 0x001F94, 0, { 0x001F24,                    /* 1F94; 1F24 03B9; Case map */
-                   0x0003B9 }},
-  { 0x001F95, 0, { 0x001F25,                    /* 1F95; 1F25 03B9; Case map */
-                   0x0003B9 }},
-  { 0x001F96, 0, { 0x001F26,                    /* 1F96; 1F26 03B9; Case map */
-                   0x0003B9 }},
-  { 0x001F97, 0, { 0x001F27,                    /* 1F97; 1F27 03B9; Case map */
-                   0x0003B9 }},
-  { 0x001F98, 0, { 0x001F20,                    /* 1F98; 1F20 03B9; Case map */
-                   0x0003B9 }},
-  { 0x001F99, 0, { 0x001F21,                    /* 1F99; 1F21 03B9; Case map */
-                   0x0003B9 }},
-  { 0x001F9A, 0, { 0x001F22,                    /* 1F9A; 1F22 03B9; Case map */
-                   0x0003B9 }},
-  { 0x001F9B, 0, { 0x001F23,                    /* 1F9B; 1F23 03B9; Case map */
-                   0x0003B9 }},
-  { 0x001F9C, 0, { 0x001F24,                    /* 1F9C; 1F24 03B9; Case map */
-                   0x0003B9 }},
-  { 0x001F9D, 0, { 0x001F25,                    /* 1F9D; 1F25 03B9; Case map */
-                   0x0003B9 }},
-  { 0x001F9E, 0, { 0x001F26,                    /* 1F9E; 1F26 03B9; Case map */
-                   0x0003B9 }},
-  { 0x001F9F, 0, { 0x001F27,                    /* 1F9F; 1F27 03B9; Case map */
-                   0x0003B9 }},
-  { 0x001FA0, 0, { 0x001F60,                    /* 1FA0; 1F60 03B9; Case map */
-                   0x0003B9 }},
-  { 0x001FA1, 0, { 0x001F61,                    /* 1FA1; 1F61 03B9; Case map */
-                   0x0003B9 }},
-  { 0x001FA2, 0, { 0x001F62,                    /* 1FA2; 1F62 03B9; Case map */
-                   0x0003B9 }},
-  { 0x001FA3, 0, { 0x001F63,                    /* 1FA3; 1F63 03B9; Case map */
-                   0x0003B9 }},
-  { 0x001FA4, 0, { 0x001F64,                    /* 1FA4; 1F64 03B9; Case map */
-                   0x0003B9 }},
-  { 0x001FA5, 0, { 0x001F65,                    /* 1FA5; 1F65 03B9; Case map */
-                   0x0003B9 }},
-  { 0x001FA6, 0, { 0x001F66,                    /* 1FA6; 1F66 03B9; Case map */
-                   0x0003B9 }},
-  { 0x001FA7, 0, { 0x001F67,                    /* 1FA7; 1F67 03B9; Case map */
-                   0x0003B9 }},
-  { 0x001FA8, 0, { 0x001F60,                    /* 1FA8; 1F60 03B9; Case map */
-                   0x0003B9 }},
-  { 0x001FA9, 0, { 0x001F61,                    /* 1FA9; 1F61 03B9; Case map */
-                   0x0003B9 }},
-  { 0x001FAA, 0, { 0x001F62,                    /* 1FAA; 1F62 03B9; Case map */
-                   0x0003B9 }},
-  { 0x001FAB, 0, { 0x001F63,                    /* 1FAB; 1F63 03B9; Case map */
-                   0x0003B9 }},
-  { 0x001FAC, 0, { 0x001F64,                    /* 1FAC; 1F64 03B9; Case map */
-                   0x0003B9 }},
-  { 0x001FAD, 0, { 0x001F65,                    /* 1FAD; 1F65 03B9; Case map */
-                   0x0003B9 }},
-  { 0x001FAE, 0, { 0x001F66,                    /* 1FAE; 1F66 03B9; Case map */
-                   0x0003B9 }},
-  { 0x001FAF, 0, { 0x001F67,                    /* 1FAF; 1F67 03B9; Case map */
-                   0x0003B9 }},
-  { 0x001FB2, 0, { 0x001F70,                    /* 1FB2; 1F70 03B9; Case map */
-                   0x0003B9 }},
-  { 0x001FB3, 0, { 0x0003B1,                    /* 1FB3; 03B1 03B9; Case map */
-                   0x0003B9 }},
-  { 0x001FB4, 0, { 0x0003AC,                    /* 1FB4; 03AC 03B9; Case map */
-                   0x0003B9 }},
-  { 0x001FB6, 0, { 0x0003B1,                    /* 1FB6; 03B1 0342; Case map */
-                   0x000342 }},
-  { 0x001FB7, 0, { 0x0003B1,               /* 1FB7; 03B1 0342 03B9; Case map */
-                   0x000342, 0x0003B9 }},
-  { 0x001FB8, 0, { 0x001FB0 }},                      /* 1FB8; 1FB0; Case map */
-  { 0x001FB9, 0, { 0x001FB1 }},                      /* 1FB9; 1FB1; Case map */
-  { 0x001FBA, 0, { 0x001F70 }},                      /* 1FBA; 1F70; Case map */
-  { 0x001FBB, 0, { 0x001F71 }},                      /* 1FBB; 1F71; Case map */
-  { 0x001FBC, 0, { 0x0003B1,                    /* 1FBC; 03B1 03B9; Case map */
-                   0x0003B9 }},
-  { 0x001FBE, 0, { 0x0003B9 }},                      /* 1FBE; 03B9; Case map */
-  { 0x001FC2, 0, { 0x001F74,                    /* 1FC2; 1F74 03B9; Case map */
-                   0x0003B9 }},
-  { 0x001FC3, 0, { 0x0003B7,                    /* 1FC3; 03B7 03B9; Case map */
-                   0x0003B9 }},
-  { 0x001FC4, 0, { 0x0003AE,                    /* 1FC4; 03AE 03B9; Case map */
-                   0x0003B9 }},
-  { 0x001FC6, 0, { 0x0003B7,                    /* 1FC6; 03B7 0342; Case map */
-                   0x000342 }},
-  { 0x001FC7, 0, { 0x0003B7,               /* 1FC7; 03B7 0342 03B9; Case map */
-                   0x000342, 0x0003B9 }},
-  { 0x001FC8, 0, { 0x001F72 }},                      /* 1FC8; 1F72; Case map */
-  { 0x001FC9, 0, { 0x001F73 }},                      /* 1FC9; 1F73; Case map */
-  { 0x001FCA, 0, { 0x001F74 }},                      /* 1FCA; 1F74; Case map */
-  { 0x001FCB, 0, { 0x001F75 }},                      /* 1FCB; 1F75; Case map */
-  { 0x001FCC, 0, { 0x0003B7,                    /* 1FCC; 03B7 03B9; Case map */
-                   0x0003B9 }},
-  { 0x001FD2, 0, { 0x0003B9,               /* 1FD2; 03B9 0308 0300; Case map */
-                   0x000308, 0x000300 }},
-  { 0x001FD3, 0, { 0x0003B9,               /* 1FD3; 03B9 0308 0301; Case map */
-                   0x000308, 0x000301 }},
-  { 0x001FD6, 0, { 0x0003B9,                    /* 1FD6; 03B9 0342; Case map */
-                   0x000342 }},
-  { 0x001FD7, 0, { 0x0003B9,               /* 1FD7; 03B9 0308 0342; Case map */
-                   0x000308, 0x000342 }},
-  { 0x001FD8, 0, { 0x001FD0 }},                      /* 1FD8; 1FD0; Case map */
-  { 0x001FD9, 0, { 0x001FD1 }},                      /* 1FD9; 1FD1; Case map */
-  { 0x001FDA, 0, { 0x001F76 }},                      /* 1FDA; 1F76; Case map */
-  { 0x001FDB, 0, { 0x001F77 }},                      /* 1FDB; 1F77; Case map */
-  { 0x001FE2, 0, { 0x0003C5,               /* 1FE2; 03C5 0308 0300; Case map */
-                   0x000308, 0x000300 }},
-  { 0x001FE3, 0, { 0x0003C5,               /* 1FE3; 03C5 0308 0301; Case map */
-                   0x000308, 0x000301 }},
-  { 0x001FE4, 0, { 0x0003C1,                    /* 1FE4; 03C1 0313; Case map */
-                   0x000313 }},
-  { 0x001FE6, 0, { 0x0003C5,                    /* 1FE6; 03C5 0342; Case map */
-                   0x000342 }},
-  { 0x001FE7, 0, { 0x0003C5,               /* 1FE7; 03C5 0308 0342; Case map */
-                   0x000308, 0x000342 }},
-  { 0x001FE8, 0, { 0x001FE0 }},                      /* 1FE8; 1FE0; Case map */
-  { 0x001FE9, 0, { 0x001FE1 }},                      /* 1FE9; 1FE1; Case map */
-  { 0x001FEA, 0, { 0x001F7A }},                      /* 1FEA; 1F7A; Case map */
-  { 0x001FEB, 0, { 0x001F7B }},                      /* 1FEB; 1F7B; Case map */
-  { 0x001FEC, 0, { 0x001FE5 }},                      /* 1FEC; 1FE5; Case map */
-  { 0x001FF2, 0, { 0x001F7C,                    /* 1FF2; 1F7C 03B9; Case map */
-                   0x0003B9 }},
-  { 0x001FF3, 0, { 0x0003C9,                    /* 1FF3; 03C9 03B9; Case map */
-                   0x0003B9 }},
-  { 0x001FF4, 0, { 0x0003CE,                    /* 1FF4; 03CE 03B9; Case map */
-                   0x0003B9 }},
-  { 0x001FF6, 0, { 0x0003C9,                    /* 1FF6; 03C9 0342; Case map */
-                   0x000342 }},
-  { 0x001FF7, 0, { 0x0003C9,               /* 1FF7; 03C9 0342 03B9; Case map */
-                   0x000342, 0x0003B9 }},
-  { 0x001FF8, 0, { 0x001F78 }},                      /* 1FF8; 1F78; Case map */
-  { 0x001FF9, 0, { 0x001F79 }},                      /* 1FF9; 1F79; Case map */
-  { 0x001FFA, 0, { 0x001F7C }},                      /* 1FFA; 1F7C; Case map */
-  { 0x001FFB, 0, { 0x001F7D }},                      /* 1FFB; 1F7D; Case map */
-  { 0x001FFC, 0, { 0x0003C9,                    /* 1FFC; 03C9 03B9; Case map */
-                   0x0003B9 }},
-  { 0x002126, 0, { 0x0003C9 }},                      /* 2126; 03C9; Case map */
-  { 0x00212A, 0, { 0x00006B }},                      /* 212A; 006B; Case map */
-  { 0x00212B, 0, { 0x0000E5 }},                      /* 212B; 00E5; Case map */
-  { 0x002160, 0, { 0x002170 }},                      /* 2160; 2170; Case map */
-  { 0x002161, 0, { 0x002171 }},                      /* 2161; 2171; Case map */
-  { 0x002162, 0, { 0x002172 }},                      /* 2162; 2172; Case map */
-  { 0x002163, 0, { 0x002173 }},                      /* 2163; 2173; Case map */
-  { 0x002164, 0, { 0x002174 }},                      /* 2164; 2174; Case map */
-  { 0x002165, 0, { 0x002175 }},                      /* 2165; 2175; Case map */
-  { 0x002166, 0, { 0x002176 }},                      /* 2166; 2176; Case map */
-  { 0x002167, 0, { 0x002177 }},                      /* 2167; 2177; Case map */
-  { 0x002168, 0, { 0x002178 }},                      /* 2168; 2178; Case map */
-  { 0x002169, 0, { 0x002179 }},                      /* 2169; 2179; Case map */
-  { 0x00216A, 0, { 0x00217A }},                      /* 216A; 217A; Case map */
-  { 0x00216B, 0, { 0x00217B }},                      /* 216B; 217B; Case map */
-  { 0x00216C, 0, { 0x00217C }},                      /* 216C; 217C; Case map */
-  { 0x00216D, 0, { 0x00217D }},                      /* 216D; 217D; Case map */
-  { 0x00216E, 0, { 0x00217E }},                      /* 216E; 217E; Case map */
-  { 0x00216F, 0, { 0x00217F }},                      /* 216F; 217F; Case map */
-  { 0x0024B6, 0, { 0x0024D0 }},                      /* 24B6; 24D0; Case map */
-  { 0x0024B7, 0, { 0x0024D1 }},                      /* 24B7; 24D1; Case map */
-  { 0x0024B8, 0, { 0x0024D2 }},                      /* 24B8; 24D2; Case map */
-  { 0x0024B9, 0, { 0x0024D3 }},                      /* 24B9; 24D3; Case map */
-  { 0x0024BA, 0, { 0x0024D4 }},                      /* 24BA; 24D4; Case map */
-  { 0x0024BB, 0, { 0x0024D5 }},                      /* 24BB; 24D5; Case map */
-  { 0x0024BC, 0, { 0x0024D6 }},                      /* 24BC; 24D6; Case map */
-  { 0x0024BD, 0, { 0x0024D7 }},                      /* 24BD; 24D7; Case map */
-  { 0x0024BE, 0, { 0x0024D8 }},                      /* 24BE; 24D8; Case map */
-  { 0x0024BF, 0, { 0x0024D9 }},                      /* 24BF; 24D9; Case map */
-  { 0x0024C0, 0, { 0x0024DA }},                      /* 24C0; 24DA; Case map */
-  { 0x0024C1, 0, { 0x0024DB }},                      /* 24C1; 24DB; Case map */
-  { 0x0024C2, 0, { 0x0024DC }},                      /* 24C2; 24DC; Case map */
-  { 0x0024C3, 0, { 0x0024DD }},                      /* 24C3; 24DD; Case map */
-  { 0x0024C4, 0, { 0x0024DE }},                      /* 24C4; 24DE; Case map */
-  { 0x0024C5, 0, { 0x0024DF }},                      /* 24C5; 24DF; Case map */
-  { 0x0024C6, 0, { 0x0024E0 }},                      /* 24C6; 24E0; Case map */
-  { 0x0024C7, 0, { 0x0024E1 }},                      /* 24C7; 24E1; Case map */
-  { 0x0024C8, 0, { 0x0024E2 }},                      /* 24C8; 24E2; Case map */
-  { 0x0024C9, 0, { 0x0024E3 }},                      /* 24C9; 24E3; Case map */
-  { 0x0024CA, 0, { 0x0024E4 }},                      /* 24CA; 24E4; Case map */
-  { 0x0024CB, 0, { 0x0024E5 }},                      /* 24CB; 24E5; Case map */
-  { 0x0024CC, 0, { 0x0024E6 }},                      /* 24CC; 24E6; Case map */
-  { 0x0024CD, 0, { 0x0024E7 }},                      /* 24CD; 24E7; Case map */
-  { 0x0024CE, 0, { 0x0024E8 }},                      /* 24CE; 24E8; Case map */
-  { 0x0024CF, 0, { 0x0024E9 }},                      /* 24CF; 24E9; Case map */
-  { 0x00FB00, 0, { 0x000066,                    /* FB00; 0066 0066; Case map */
-                   0x000066 }},
-  { 0x00FB01, 0, { 0x000066,                    /* FB01; 0066 0069; Case map */
-                   0x000069 }},
-  { 0x00FB02, 0, { 0x000066,                    /* FB02; 0066 006C; Case map */
-                   0x00006C }},
-  { 0x00FB03, 0, { 0x000066,               /* FB03; 0066 0066 0069; Case map */
-                   0x000066, 0x000069 }},
-  { 0x00FB04, 0, { 0x000066,               /* FB04; 0066 0066 006C; Case map */
-                   0x000066, 0x00006C }},
-  { 0x00FB05, 0, { 0x000073,                    /* FB05; 0073 0074; Case map */
-                   0x000074 }},
-  { 0x00FB06, 0, { 0x000073,                    /* FB06; 0073 0074; Case map */
-                   0x000074 }},
-  { 0x00FB13, 0, { 0x000574,                    /* FB13; 0574 0576; Case map */
-                   0x000576 }},
-  { 0x00FB14, 0, { 0x000574,                    /* FB14; 0574 0565; Case map */
-                   0x000565 }},
-  { 0x00FB15, 0, { 0x000574,                    /* FB15; 0574 056B; Case map */
-                   0x00056B }},
-  { 0x00FB16, 0, { 0x00057E,                    /* FB16; 057E 0576; Case map */
-                   0x000576 }},
-  { 0x00FB17, 0, { 0x000574,                    /* FB17; 0574 056D; Case map */
-                   0x00056D }},
-  { 0x00FF21, 0, { 0x00FF41 }},                      /* FF21; FF41; Case map */
-  { 0x00FF22, 0, { 0x00FF42 }},                      /* FF22; FF42; Case map */
-  { 0x00FF23, 0, { 0x00FF43 }},                      /* FF23; FF43; Case map */
-  { 0x00FF24, 0, { 0x00FF44 }},                      /* FF24; FF44; Case map */
-  { 0x00FF25, 0, { 0x00FF45 }},                      /* FF25; FF45; Case map */
-  { 0x00FF26, 0, { 0x00FF46 }},                      /* FF26; FF46; Case map */
-  { 0x00FF27, 0, { 0x00FF47 }},                      /* FF27; FF47; Case map */
-  { 0x00FF28, 0, { 0x00FF48 }},                      /* FF28; FF48; Case map */
-  { 0x00FF29, 0, { 0x00FF49 }},                      /* FF29; FF49; Case map */
-  { 0x00FF2A, 0, { 0x00FF4A }},                      /* FF2A; FF4A; Case map */
-  { 0x00FF2B, 0, { 0x00FF4B }},                      /* FF2B; FF4B; Case map */
-  { 0x00FF2C, 0, { 0x00FF4C }},                      /* FF2C; FF4C; Case map */
-  { 0x00FF2D, 0, { 0x00FF4D }},                      /* FF2D; FF4D; Case map */
-  { 0x00FF2E, 0, { 0x00FF4E }},                      /* FF2E; FF4E; Case map */
-  { 0x00FF2F, 0, { 0x00FF4F }},                      /* FF2F; FF4F; Case map */
-  { 0x00FF30, 0, { 0x00FF50 }},                      /* FF30; FF50; Case map */
-  { 0x00FF31, 0, { 0x00FF51 }},                      /* FF31; FF51; Case map */
-  { 0x00FF32, 0, { 0x00FF52 }},                      /* FF32; FF52; Case map */
-  { 0x00FF33, 0, { 0x00FF53 }},                      /* FF33; FF53; Case map */
-  { 0x00FF34, 0, { 0x00FF54 }},                      /* FF34; FF54; Case map */
-  { 0x00FF35, 0, { 0x00FF55 }},                      /* FF35; FF55; Case map */
-  { 0x00FF36, 0, { 0x00FF56 }},                      /* FF36; FF56; Case map */
-  { 0x00FF37, 0, { 0x00FF57 }},                      /* FF37; FF57; Case map */
-  { 0x00FF38, 0, { 0x00FF58 }},                      /* FF38; FF58; Case map */
-  { 0x00FF39, 0, { 0x00FF59 }},                      /* FF39; FF59; Case map */
-  { 0x00FF3A, 0, { 0x00FF5A }},                      /* FF3A; FF5A; Case map */
-  { 0x010400, 0, { 0x010428 }},                    /* 10400; 10428; Case map */
-  { 0x010401, 0, { 0x010429 }},                    /* 10401; 10429; Case map */
-  { 0x010402, 0, { 0x01042A }},                    /* 10402; 1042A; Case map */
-  { 0x010403, 0, { 0x01042B }},                    /* 10403; 1042B; Case map */
-  { 0x010404, 0, { 0x01042C }},                    /* 10404; 1042C; Case map */
-  { 0x010405, 0, { 0x01042D }},                    /* 10405; 1042D; Case map */
-  { 0x010406, 0, { 0x01042E }},                    /* 10406; 1042E; Case map */
-  { 0x010407, 0, { 0x01042F }},                    /* 10407; 1042F; Case map */
-  { 0x010408, 0, { 0x010430 }},                    /* 10408; 10430; Case map */
-  { 0x010409, 0, { 0x010431 }},                    /* 10409; 10431; Case map */
-  { 0x01040A, 0, { 0x010432 }},                    /* 1040A; 10432; Case map */
-  { 0x01040B, 0, { 0x010433 }},                    /* 1040B; 10433; Case map */
-  { 0x01040C, 0, { 0x010434 }},                    /* 1040C; 10434; Case map */
-  { 0x01040D, 0, { 0x010435 }},                    /* 1040D; 10435; Case map */
-  { 0x01040E, 0, { 0x010436 }},                    /* 1040E; 10436; Case map */
-  { 0x01040F, 0, { 0x010437 }},                    /* 1040F; 10437; Case map */
-  { 0x010410, 0, { 0x010438 }},                    /* 10410; 10438; Case map */
-  { 0x010411, 0, { 0x010439 }},                    /* 10411; 10439; Case map */
-  { 0x010412, 0, { 0x01043A }},                    /* 10412; 1043A; Case map */
-  { 0x010413, 0, { 0x01043B }},                    /* 10413; 1043B; Case map */
-  { 0x010414, 0, { 0x01043C }},                    /* 10414; 1043C; Case map */
-  { 0x010415, 0, { 0x01043D }},                    /* 10415; 1043D; Case map */
-  { 0x010416, 0, { 0x01043E }},                    /* 10416; 1043E; Case map */
-  { 0x010417, 0, { 0x01043F }},                    /* 10417; 1043F; Case map */
-  { 0x010418, 0, { 0x010440 }},                    /* 10418; 10440; Case map */
-  { 0x010419, 0, { 0x010441 }},                    /* 10419; 10441; Case map */
-  { 0x01041A, 0, { 0x010442 }},                    /* 1041A; 10442; Case map */
-  { 0x01041B, 0, { 0x010443 }},                    /* 1041B; 10443; Case map */
-  { 0x01041C, 0, { 0x010444 }},                    /* 1041C; 10444; Case map */
-  { 0x01041D, 0, { 0x010445 }},                    /* 1041D; 10445; Case map */
-  { 0x01041E, 0, { 0x010446 }},                    /* 1041E; 10446; Case map */
-  { 0x01041F, 0, { 0x010447 }},                    /* 1041F; 10447; Case map */
-  { 0x010420, 0, { 0x010448 }},                    /* 10420; 10448; Case map */
-  { 0x010421, 0, { 0x010449 }},                    /* 10421; 10449; Case map */
-  { 0x010422, 0, { 0x01044A }},                    /* 10422; 1044A; Case map */
-  { 0x010423, 0, { 0x01044B }},                    /* 10423; 1044B; Case map */
-  { 0x010424, 0, { 0x01044C }},                    /* 10424; 1044C; Case map */
-  { 0x010425, 0, { 0x01044D }},                    /* 10425; 1044D; Case map */
-  { 0 },
-};
-
-
-/*
- * C.1.1 ASCII space characters
- * 
- */
-
-const Stringprep_table_element stringprep_rfc3454_C_1_1[] = {
-  { 0x000020           },                                     /* 0020; SPACE */
-  { 0 },
-};
-
-
-/*
- * C.1.2 Non-ASCII space characters
- *  */
-
-const Stringprep_table_element stringprep_rfc3454_C_1_2[] = {
-  { 0x0000A0           },                            /* 00A0; NO-BREAK SPACE */
-  { 0x001680           },                          /* 1680; OGHAM SPACE MARK */
-  { 0x002000           },                                   /* 2000; EN QUAD */
-  { 0x002001           },                                   /* 2001; EM QUAD */
-  { 0x002002           },                                  /* 2002; EN SPACE */
-  { 0x002003           },                                  /* 2003; EM SPACE */
-  { 0x002004           },                        /* 2004; THREE-PER-EM SPACE */
-  { 0x002005           },                         /* 2005; FOUR-PER-EM SPACE */
-  { 0x002006           },                          /* 2006; SIX-PER-EM SPACE */
-  { 0x002007           },                              /* 2007; FIGURE SPACE */
-  { 0x002008           },                         /* 2008; PUNCTUATION SPACE */
-  { 0x002009           },                                /* 2009; THIN SPACE */
-  { 0x00200A           },                                /* 200A; HAIR SPACE */
-  { 0x00200B           },                          /* 200B; ZERO WIDTH SPACE */
-  { 0x00202F           },                     /* 202F; NARROW NO-BREAK SPACE */
-  { 0x00205F           },                 /* 205F; MEDIUM MATHEMATICAL SPACE */
-  { 0x003000           },                         /* 3000; IDEOGRAPHIC SPACE */
-  { 0 },
-};
-
-
-/*
- * C.2.1 ASCII control characters
- * 
- */
-
-const Stringprep_table_element stringprep_rfc3454_C_2_1[] = {
-  { 0x000000, 0x00001F },                 /* 0000-001F; [CONTROL CHARACTERS] */
-  { 0x00007F           },                                    /* 007F; DELETE */
-  { 0 },
-};
-
-
-/*
- * C.2.2 Non-ASCII control characters
- * 
- */
-
-const Stringprep_table_element stringprep_rfc3454_C_2_2[] = {
-  { 0x000080, 0x00009F },                 /* 0080-009F; [CONTROL CHARACTERS] */
-  { 0x0006DD           },                        /* 06DD; ARABIC END OF AYAH */
-  { 0x00070F           },                  /* 070F; SYRIAC ABBREVIATION MARK */
-  { 0x00180E           },                 /* 180E; MONGOLIAN VOWEL SEPARATOR */
-  { 0x00200C           },                     /* 200C; ZERO WIDTH NON-JOINER */
-  { 0x00200D           },                         /* 200D; ZERO WIDTH JOINER */
-  { 0x002028           },                            /* 2028; LINE SEPARATOR */
-  { 0x002029           },                       /* 2029; PARAGRAPH SEPARATOR */
-  { 0x002060           },                               /* 2060; WORD JOINER */
-  { 0x002061           },                      /* 2061; FUNCTION APPLICATION */
-  { 0x002062           },                           /* 2062; INVISIBLE TIMES */
-  { 0x002063           },                       /* 2063; INVISIBLE SEPARATOR */
-  { 0x00206A, 0x00206F },                 /* 206A-206F; [CONTROL CHARACTERS] */
-  { 0x00FEFF           },                 /* FEFF; ZERO WIDTH NO-BREAK SPACE */
-  { 0x00FFF9, 0x00FFFC },                 /* FFF9-FFFC; [CONTROL CHARACTERS] */
-  { 0x01D173, 0x01D17A },       /* 1D173-1D17A; [MUSICAL CONTROL CHARACTERS] */
-  { 0 },
-};
-
-
-/*
- * C.3 Private use
- * 
- */
-
-const Stringprep_table_element stringprep_rfc3454_C_3[] = {
-  { 0x00E000, 0x00F8FF },               /* E000-F8FF; [PRIVATE USE, PLANE 0] */
-  { 0x0F0000, 0x0FFFFD },            /* F0000-FFFFD; [PRIVATE USE, PLANE 15] */
-  { 0x100000, 0x10FFFD },          /* 100000-10FFFD; [PRIVATE USE, PLANE 16] */
-  { 0 },
-};
-
-
-/*
- * C.4 Non-character code points
- * 
- */
-
-const Stringprep_table_element stringprep_rfc3454_C_4[] = {
-  { 0x00FDD0, 0x00FDEF },           /* FDD0-FDEF; [NONCHARACTER CODE POINTS] */
-  { 0x00FFFE, 0x00FFFF },           /* FFFE-FFFF; [NONCHARACTER CODE POINTS] */
-  { 0x01FFFE, 0x01FFFF },         /* 1FFFE-1FFFF; [NONCHARACTER CODE POINTS] */
-  { 0x02FFFE, 0x02FFFF },         /* 2FFFE-2FFFF; [NONCHARACTER CODE POINTS] */
-  { 0x03FFFE, 0x03FFFF },         /* 3FFFE-3FFFF; [NONCHARACTER CODE POINTS] */
-  { 0x04FFFE, 0x04FFFF },         /* 4FFFE-4FFFF; [NONCHARACTER CODE POINTS] */
-  { 0x05FFFE, 0x05FFFF },         /* 5FFFE-5FFFF; [NONCHARACTER CODE POINTS] */
-  { 0x06FFFE, 0x06FFFF },         /* 6FFFE-6FFFF; [NONCHARACTER CODE POINTS] */
-  { 0x07FFFE, 0x07FFFF },         /* 7FFFE-7FFFF; [NONCHARACTER CODE POINTS] */
-  { 0x08FFFE, 0x08FFFF },         /* 8FFFE-8FFFF; [NONCHARACTER CODE POINTS] */
-  { 0x09FFFE, 0x09FFFF },         /* 9FFFE-9FFFF; [NONCHARACTER CODE POINTS] */
-  { 0x0AFFFE, 0x0AFFFF },         /* AFFFE-AFFFF; [NONCHARACTER CODE POINTS] */
-  { 0x0BFFFE, 0x0BFFFF },         /* BFFFE-BFFFF; [NONCHARACTER CODE POINTS] */
-  { 0x0CFFFE, 0x0CFFFF },         /* CFFFE-CFFFF; [NONCHARACTER CODE POINTS] */
-  { 0x0DFFFE, 0x0DFFFF },         /* DFFFE-DFFFF; [NONCHARACTER CODE POINTS] */
-  { 0x0EFFFE, 0x0EFFFF },         /* EFFFE-EFFFF; [NONCHARACTER CODE POINTS] */
-  { 0x0FFFFE, 0x0FFFFF },         /* FFFFE-FFFFF; [NONCHARACTER CODE POINTS] */
-  { 0x10FFFE, 0x10FFFF },       /* 10FFFE-10FFFF; [NONCHARACTER CODE POINTS] */
-  { 0 },
-};
-
-
-/*
- * C.5 Surrogate codes
- * 
- */
-
-const Stringprep_table_element stringprep_rfc3454_C_5[] = {
-  { 0x00D800, 0x00DFFF },                    /* D800-DFFF; [SURROGATE CODES] */
-  { 0 },
-};
-
-
-/*
- * C.6 Inappropriate for plain text
- * 
- */
-
-const Stringprep_table_element stringprep_rfc3454_C_6[] = {
-  { 0x00FFF9           },             /* FFF9; INTERLINEAR ANNOTATION ANCHOR */
-  { 0x00FFFA           },          /* FFFA; INTERLINEAR ANNOTATION SEPARATOR */
-  { 0x00FFFB           },         /* FFFB; INTERLINEAR ANNOTATION TERMINATOR */
-  { 0x00FFFC           },              /* FFFC; OBJECT REPLACEMENT CHARACTER */
-  { 0x00FFFD           },                     /* FFFD; REPLACEMENT CHARACTER */
-  { 0 },
-};
-
-
-/*
- * C.7 Inappropriate for canonical representation
- * 
- */
-
-const Stringprep_table_element stringprep_rfc3454_C_7[] = {
-  { 0x002FF0, 0x002FFB }, /* 2FF0-2FFB; [IDEOGRAPHIC DESCRIPTION CHARACTERS] */
-  { 0 },
-};
-
-
-/*
- * C.8 Change display properties or are deprecated
- * 
- */
-
-const Stringprep_table_element stringprep_rfc3454_C_8[] = {
-  { 0x000340           },                 /* 0340; COMBINING GRAVE TONE MARK */
-  { 0x000341           },                 /* 0341; COMBINING ACUTE TONE MARK */
-  { 0x00200E           },                        /* 200E; LEFT-TO-RIGHT MARK */
-  { 0x00200F           },                        /* 200F; RIGHT-TO-LEFT MARK */
-  { 0x00202A           },                   /* 202A; LEFT-TO-RIGHT EMBEDDING */
-  { 0x00202B           },                   /* 202B; RIGHT-TO-LEFT EMBEDDING */
-  { 0x00202C           },                /* 202C; POP DIRECTIONAL FORMATTING */
-  { 0x00202D           },                    /* 202D; LEFT-TO-RIGHT OVERRIDE */
-  { 0x00202E           },                    /* 202E; RIGHT-TO-LEFT OVERRIDE */
-  { 0x00206A           },                /* 206A; INHIBIT SYMMETRIC SWAPPING */
-  { 0x00206B           },               /* 206B; ACTIVATE SYMMETRIC SWAPPING */
-  { 0x00206C           },               /* 206C; INHIBIT ARABIC FORM SHAPING */
-  { 0x00206D           },              /* 206D; ACTIVATE ARABIC FORM SHAPING */
-  { 0x00206E           },                     /* 206E; NATIONAL DIGIT SHAPES */
-  { 0x00206F           },                      /* 206F; NOMINAL DIGIT SHAPES */
-  { 0 },
-};
-
-
-/*
- * C.9 Tagging characters
- * 
- */
-
-const Stringprep_table_element stringprep_rfc3454_C_9[] = {
-  { 0x0E0001           },                             /* E0001; LANGUAGE TAG */
-  { 0x0E0020, 0x0E007F },               /* E0020-E007F; [TAGGING CHARACTERS] */
-  { 0 },
-};
-
-
-/*
- * D.1 Characters with bidirectional property "R" or "AL"
- * 
- */
-
-const Stringprep_table_element stringprep_rfc3454_D_1[] = {
-  { 0x0005BE           },                                            /* 05BE */
-  { 0x0005C0           },                                            /* 05C0 */
-  { 0x0005C3           },                                            /* 05C3 */
-  { 0x0005D0, 0x0005EA },                                       /* 05D0-05EA */
-  { 0x0005F0, 0x0005F4 },                                       /* 05F0-05F4 */
-  { 0x00061B           },                                            /* 061B */
-  { 0x00061F           },                                            /* 061F */
-  { 0x000621, 0x00063A },                                       /* 0621-063A */
-  { 0x000640, 0x00064A },                                       /* 0640-064A */
-  { 0x00066D, 0x00066F },                                       /* 066D-066F */
-  { 0x000671, 0x0006D5 },                                       /* 0671-06D5 */
-  { 0x0006DD           },                                            /* 06DD */
-  { 0x0006E5, 0x0006E6 },                                       /* 06E5-06E6 */
-  { 0x0006FA, 0x0006FE },                                       /* 06FA-06FE */
-  { 0x000700, 0x00070D },                                       /* 0700-070D */
-  { 0x000710           },                                            /* 0710 */
-  { 0x000712, 0x00072C },                                       /* 0712-072C */
-  { 0x000780, 0x0007A5 },                                       /* 0780-07A5 */
-  { 0x0007B1           },                                            /* 07B1 */
-  { 0x00200F           },                                            /* 200F */
-  { 0x00FB1D           },                                            /* FB1D */
-  { 0x00FB1F, 0x00FB28 },                                       /* FB1F-FB28 */
-  { 0x00FB2A, 0x00FB36 },                                       /* FB2A-FB36 */
-  { 0x00FB38, 0x00FB3C },                                       /* FB38-FB3C */
-  { 0x00FB3E           },                                            /* FB3E */
-  { 0x00FB40, 0x00FB41 },                                       /* FB40-FB41 */
-  { 0x00FB43, 0x00FB44 },                                       /* FB43-FB44 */
-  { 0x00FB46, 0x00FBB1 },                                       /* FB46-FBB1 */
-  { 0x00FBD3, 0x00FD3D },                                       /* FBD3-FD3D */
-  { 0x00FD50, 0x00FD8F },                                       /* FD50-FD8F */
-  { 0x00FD92, 0x00FDC7 },                                       /* FD92-FDC7 */
-  { 0x00FDF0, 0x00FDFC },                                       /* FDF0-FDFC */
-  { 0x00FE70, 0x00FE74 },                                       /* FE70-FE74 */
-  { 0x00FE76, 0x00FEFC },                                       /* FE76-FEFC */
-  { 0 },
-};
-
-
-/*
- * D.2 Characters with bidirectional property "L"
- * 
- */
-
-const Stringprep_table_element stringprep_rfc3454_D_2[] = {
-  { 0x000041, 0x00005A },                                       /* 0041-005A */
-  { 0x000061, 0x00007A },                                       /* 0061-007A */
-  { 0x0000AA           },                                            /* 00AA */
-  { 0x0000B5           },                                            /* 00B5 */
-  { 0x0000BA           },                                            /* 00BA */
-  { 0x0000C0, 0x0000D6 },                                       /* 00C0-00D6 */
-  { 0x0000D8, 0x0000F6 },                                       /* 00D8-00F6 */
-  { 0x0000F8, 0x000220 },                                       /* 00F8-0220 */
-  { 0x000222, 0x000233 },                                       /* 0222-0233 */
-  { 0x000250, 0x0002AD },                                       /* 0250-02AD */
-  { 0x0002B0, 0x0002B8 },                                       /* 02B0-02B8 */
-  { 0x0002BB, 0x0002C1 },                                       /* 02BB-02C1 */
-  { 0x0002D0, 0x0002D1 },                                       /* 02D0-02D1 */
-  { 0x0002E0, 0x0002E4 },                                       /* 02E0-02E4 */
-  { 0x0002EE           },                                            /* 02EE */
-  { 0x00037A           },                                            /* 037A */
-  { 0x000386           },                                            /* 0386 */
-  { 0x000388, 0x00038A },                                       /* 0388-038A */
-  { 0x00038C           },                                            /* 038C */
-  { 0x00038E, 0x0003A1 },                                       /* 038E-03A1 */
-  { 0x0003A3, 0x0003CE },                                       /* 03A3-03CE */
-  { 0x0003D0, 0x0003F5 },                                       /* 03D0-03F5 */
-  { 0x000400, 0x000482 },                                       /* 0400-0482 */
-  { 0x00048A, 0x0004CE },                                       /* 048A-04CE */
-  { 0x0004D0, 0x0004F5 },                                       /* 04D0-04F5 */
-  { 0x0004F8, 0x0004F9 },                                       /* 04F8-04F9 */
-  { 0x000500, 0x00050F },                                       /* 0500-050F */
-  { 0x000531, 0x000556 },                                       /* 0531-0556 */
-  { 0x000559, 0x00055F },                                       /* 0559-055F */
-  { 0x000561, 0x000587 },                                       /* 0561-0587 */
-  { 0x000589           },                                            /* 0589 */
-  { 0x000903           },                                            /* 0903 */
-  { 0x000905, 0x000939 },                                       /* 0905-0939 */
-  { 0x00093D, 0x000940 },                                       /* 093D-0940 */
-  { 0x000949, 0x00094C },                                       /* 0949-094C */
-  { 0x000950           },                                            /* 0950 */
-  { 0x000958, 0x000961 },                                       /* 0958-0961 */
-  { 0x000964, 0x000970 },                                       /* 0964-0970 */
-  { 0x000982, 0x000983 },                                       /* 0982-0983 */
-  { 0x000985, 0x00098C },                                       /* 0985-098C */
-  { 0x00098F, 0x000990 },                                       /* 098F-0990 */
-  { 0x000993, 0x0009A8 },                                       /* 0993-09A8 */
-  { 0x0009AA, 0x0009B0 },                                       /* 09AA-09B0 */
-  { 0x0009B2           },                                            /* 09B2 */
-  { 0x0009B6, 0x0009B9 },                                       /* 09B6-09B9 */
-  { 0x0009BE, 0x0009C0 },                                       /* 09BE-09C0 */
-  { 0x0009C7, 0x0009C8 },                                       /* 09C7-09C8 */
-  { 0x0009CB, 0x0009CC },                                       /* 09CB-09CC */
-  { 0x0009D7           },                                            /* 09D7 */
-  { 0x0009DC, 0x0009DD },                                       /* 09DC-09DD */
-  { 0x0009DF, 0x0009E1 },                                       /* 09DF-09E1 */
-  { 0x0009E6, 0x0009F1 },                                       /* 09E6-09F1 */
-  { 0x0009F4, 0x0009FA },                                       /* 09F4-09FA */
-  { 0x000A05, 0x000A0A },                                       /* 0A05-0A0A */
-  { 0x000A0F, 0x000A10 },                                       /* 0A0F-0A10 */
-  { 0x000A13, 0x000A28 },                                       /* 0A13-0A28 */
-  { 0x000A2A, 0x000A30 },                                       /* 0A2A-0A30 */
-  { 0x000A32, 0x000A33 },                                       /* 0A32-0A33 */
-  { 0x000A35, 0x000A36 },                                       /* 0A35-0A36 */
-  { 0x000A38, 0x000A39 },                                       /* 0A38-0A39 */
-  { 0x000A3E, 0x000A40 },                                       /* 0A3E-0A40 */
-  { 0x000A59, 0x000A5C },                                       /* 0A59-0A5C */
-  { 0x000A5E           },                                            /* 0A5E */
-  { 0x000A66, 0x000A6F },                                       /* 0A66-0A6F */
-  { 0x000A72, 0x000A74 },                                       /* 0A72-0A74 */
-  { 0x000A83           },                                            /* 0A83 */
-  { 0x000A85, 0x000A8B },                                       /* 0A85-0A8B */
-  { 0x000A8D           },                                            /* 0A8D */
-  { 0x000A8F, 0x000A91 },                                       /* 0A8F-0A91 */
-  { 0x000A93, 0x000AA8 },                                       /* 0A93-0AA8 */
-  { 0x000AAA, 0x000AB0 },                                       /* 0AAA-0AB0 */
-  { 0x000AB2, 0x000AB3 },                                       /* 0AB2-0AB3 */
-  { 0x000AB5, 0x000AB9 },                                       /* 0AB5-0AB9 */
-  { 0x000ABD, 0x000AC0 },                                       /* 0ABD-0AC0 */
-  { 0x000AC9           },                                            /* 0AC9 */
-  { 0x000ACB, 0x000ACC },                                       /* 0ACB-0ACC */
-  { 0x000AD0           },                                            /* 0AD0 */
-  { 0x000AE0           },                                            /* 0AE0 */
-  { 0x000AE6, 0x000AEF },                                       /* 0AE6-0AEF */
-  { 0x000B02, 0x000B03 },                                       /* 0B02-0B03 */
-  { 0x000B05, 0x000B0C },                                       /* 0B05-0B0C */
-  { 0x000B0F, 0x000B10 },                                       /* 0B0F-0B10 */
-  { 0x000B13, 0x000B28 },                                       /* 0B13-0B28 */
-  { 0x000B2A, 0x000B30 },                                       /* 0B2A-0B30 */
-  { 0x000B32, 0x000B33 },                                       /* 0B32-0B33 */
-  { 0x000B36, 0x000B39 },                                       /* 0B36-0B39 */
-  { 0x000B3D, 0x000B3E },                                       /* 0B3D-0B3E */
-  { 0x000B40           },                                            /* 0B40 */
-  { 0x000B47, 0x000B48 },                                       /* 0B47-0B48 */
-  { 0x000B4B, 0x000B4C },                                       /* 0B4B-0B4C */
-  { 0x000B57           },                                            /* 0B57 */
-  { 0x000B5C, 0x000B5D },                                       /* 0B5C-0B5D */
-  { 0x000B5F, 0x000B61 },                                       /* 0B5F-0B61 */
-  { 0x000B66, 0x000B70 },                                       /* 0B66-0B70 */
-  { 0x000B83           },                                            /* 0B83 */
-  { 0x000B85, 0x000B8A },                                       /* 0B85-0B8A */
-  { 0x000B8E, 0x000B90 },                                       /* 0B8E-0B90 */
-  { 0x000B92, 0x000B95 },                                       /* 0B92-0B95 */
-  { 0x000B99, 0x000B9A },                                       /* 0B99-0B9A */
-  { 0x000B9C           },                                            /* 0B9C */
-  { 0x000B9E, 0x000B9F },                                       /* 0B9E-0B9F */
-  { 0x000BA3, 0x000BA4 },                                       /* 0BA3-0BA4 */
-  { 0x000BA8, 0x000BAA },                                       /* 0BA8-0BAA */
-  { 0x000BAE, 0x000BB5 },                                       /* 0BAE-0BB5 */
-  { 0x000BB7, 0x000BB9 },                                       /* 0BB7-0BB9 */
-  { 0x000BBE, 0x000BBF },                                       /* 0BBE-0BBF */
-  { 0x000BC1, 0x000BC2 },                                       /* 0BC1-0BC2 */
-  { 0x000BC6, 0x000BC8 },                                       /* 0BC6-0BC8 */
-  { 0x000BCA, 0x000BCC },                                       /* 0BCA-0BCC */
-  { 0x000BD7           },                                            /* 0BD7 */
-  { 0x000BE7, 0x000BF2 },                                       /* 0BE7-0BF2 */
-  { 0x000C01, 0x000C03 },                                       /* 0C01-0C03 */
-  { 0x000C05, 0x000C0C },                                       /* 0C05-0C0C */
-  { 0x000C0E, 0x000C10 },                                       /* 0C0E-0C10 */
-  { 0x000C12, 0x000C28 },                                       /* 0C12-0C28 */
-  { 0x000C2A, 0x000C33 },                                       /* 0C2A-0C33 */
-  { 0x000C35, 0x000C39 },                                       /* 0C35-0C39 */
-  { 0x000C41, 0x000C44 },                                       /* 0C41-0C44 */
-  { 0x000C60, 0x000C61 },                                       /* 0C60-0C61 */
-  { 0x000C66, 0x000C6F },                                       /* 0C66-0C6F */
-  { 0x000C82, 0x000C83 },                                       /* 0C82-0C83 */
-  { 0x000C85, 0x000C8C },                                       /* 0C85-0C8C */
-  { 0x000C8E, 0x000C90 },                                       /* 0C8E-0C90 */
-  { 0x000C92, 0x000CA8 },                                       /* 0C92-0CA8 */
-  { 0x000CAA, 0x000CB3 },                                       /* 0CAA-0CB3 */
-  { 0x000CB5, 0x000CB9 },                                       /* 0CB5-0CB9 */
-  { 0x000CBE           },                                            /* 0CBE */
-  { 0x000CC0, 0x000CC4 },                                       /* 0CC0-0CC4 */
-  { 0x000CC7, 0x000CC8 },                                       /* 0CC7-0CC8 */
-  { 0x000CCA, 0x000CCB },                                       /* 0CCA-0CCB */
-  { 0x000CD5, 0x000CD6 },                                       /* 0CD5-0CD6 */
-  { 0x000CDE           },                                            /* 0CDE */
-  { 0x000CE0, 0x000CE1 },                                       /* 0CE0-0CE1 */
-  { 0x000CE6, 0x000CEF },                                       /* 0CE6-0CEF */
-  { 0x000D02, 0x000D03 },                                       /* 0D02-0D03 */
-  { 0x000D05, 0x000D0C },                                       /* 0D05-0D0C */
-  { 0x000D0E, 0x000D10 },                                       /* 0D0E-0D10 */
-  { 0x000D12, 0x000D28 },                                       /* 0D12-0D28 */
-  { 0x000D2A, 0x000D39 },                                       /* 0D2A-0D39 */
-  { 0x000D3E, 0x000D40 },                                       /* 0D3E-0D40 */
-  { 0x000D46, 0x000D48 },                                       /* 0D46-0D48 */
-  { 0x000D4A, 0x000D4C },                                       /* 0D4A-0D4C */
-  { 0x000D57           },                                            /* 0D57 */
-  { 0x000D60, 0x000D61 },                                       /* 0D60-0D61 */
-  { 0x000D66, 0x000D6F },                                       /* 0D66-0D6F */
-  { 0x000D82, 0x000D83 },                                       /* 0D82-0D83 */
-  { 0x000D85, 0x000D96 },                                       /* 0D85-0D96 */
-  { 0x000D9A, 0x000DB1 },                                       /* 0D9A-0DB1 */
-  { 0x000DB3, 0x000DBB },                                       /* 0DB3-0DBB */
-  { 0x000DBD           },                                            /* 0DBD */
-  { 0x000DC0, 0x000DC6 },                                       /* 0DC0-0DC6 */
-  { 0x000DCF, 0x000DD1 },                                       /* 0DCF-0DD1 */
-  { 0x000DD8, 0x000DDF },                                       /* 0DD8-0DDF */
-  { 0x000DF2, 0x000DF4 },                                       /* 0DF2-0DF4 */
-  { 0x000E01, 0x000E30 },                                       /* 0E01-0E30 */
-  { 0x000E32, 0x000E33 },                                       /* 0E32-0E33 */
-  { 0x000E40, 0x000E46 },                                       /* 0E40-0E46 */
-  { 0x000E4F, 0x000E5B },                                       /* 0E4F-0E5B */
-  { 0x000E81, 0x000E82 },                                       /* 0E81-0E82 */
-  { 0x000E84           },                                            /* 0E84 */
-  { 0x000E87, 0x000E88 },                                       /* 0E87-0E88 */
-  { 0x000E8A           },                                            /* 0E8A */
-  { 0x000E8D           },                                            /* 0E8D */
-  { 0x000E94, 0x000E97 },                                       /* 0E94-0E97 */
-  { 0x000E99, 0x000E9F },                                       /* 0E99-0E9F */
-  { 0x000EA1, 0x000EA3 },                                       /* 0EA1-0EA3 */
-  { 0x000EA5           },                                            /* 0EA5 */
-  { 0x000EA7           },                                            /* 0EA7 */
-  { 0x000EAA, 0x000EAB },                                       /* 0EAA-0EAB */
-  { 0x000EAD, 0x000EB0 },                                       /* 0EAD-0EB0 */
-  { 0x000EB2, 0x000EB3 },                                       /* 0EB2-0EB3 */
-  { 0x000EBD           },                                            /* 0EBD */
-  { 0x000EC0, 0x000EC4 },                                       /* 0EC0-0EC4 */
-  { 0x000EC6           },                                            /* 0EC6 */
-  { 0x000ED0, 0x000ED9 },                                       /* 0ED0-0ED9 */
-  { 0x000EDC, 0x000EDD },                                       /* 0EDC-0EDD */
-  { 0x000F00, 0x000F17 },                                       /* 0F00-0F17 */
-  { 0x000F1A, 0x000F34 },                                       /* 0F1A-0F34 */
-  { 0x000F36           },                                            /* 0F36 */
-  { 0x000F38           },                                            /* 0F38 */
-  { 0x000F3E, 0x000F47 },                                       /* 0F3E-0F47 */
-  { 0x000F49, 0x000F6A },                                       /* 0F49-0F6A */
-  { 0x000F7F           },                                            /* 0F7F */
-  { 0x000F85           },                                            /* 0F85 */
-  { 0x000F88, 0x000F8B },                                       /* 0F88-0F8B */
-  { 0x000FBE, 0x000FC5 },                                       /* 0FBE-0FC5 */
-  { 0x000FC7, 0x000FCC },                                       /* 0FC7-0FCC */
-  { 0x000FCF           },                                            /* 0FCF */
-  { 0x001000, 0x001021 },                                       /* 1000-1021 */
-  { 0x001023, 0x001027 },                                       /* 1023-1027 */
-  { 0x001029, 0x00102A },                                       /* 1029-102A */
-  { 0x00102C           },                                            /* 102C */
-  { 0x001031           },                                            /* 1031 */
-  { 0x001038           },                                            /* 1038 */
-  { 0x001040, 0x001057 },                                       /* 1040-1057 */
-  { 0x0010A0, 0x0010C5 },                                       /* 10A0-10C5 */
-  { 0x0010D0, 0x0010F8 },                                       /* 10D0-10F8 */
-  { 0x0010FB           },                                            /* 10FB */
-  { 0x001100, 0x001159 },                                       /* 1100-1159 */
-  { 0x00115F, 0x0011A2 },                                       /* 115F-11A2 */
-  { 0x0011A8, 0x0011F9 },                                       /* 11A8-11F9 */
-  { 0x001200, 0x001206 },                                       /* 1200-1206 */
-  { 0x001208, 0x001246 },                                       /* 1208-1246 */
-  { 0x001248           },                                            /* 1248 */
-  { 0x00124A, 0x00124D },                                       /* 124A-124D */
-  { 0x001250, 0x001256 },                                       /* 1250-1256 */
-  { 0x001258           },                                            /* 1258 */
-  { 0x00125A, 0x00125D },                                       /* 125A-125D */
-  { 0x001260, 0x001286 },                                       /* 1260-1286 */
-  { 0x001288           },                                            /* 1288 */
-  { 0x00128A, 0x00128D },                                       /* 128A-128D */
-  { 0x001290, 0x0012AE },                                       /* 1290-12AE */
-  { 0x0012B0           },                                            /* 12B0 */
-  { 0x0012B2, 0x0012B5 },                                       /* 12B2-12B5 */
-  { 0x0012B8, 0x0012BE },                                       /* 12B8-12BE */
-  { 0x0012C0           },                                            /* 12C0 */
-  { 0x0012C2, 0x0012C5 },                                       /* 12C2-12C5 */
-  { 0x0012C8, 0x0012CE },                                       /* 12C8-12CE */
-  { 0x0012D0, 0x0012D6 },                                       /* 12D0-12D6 */
-  { 0x0012D8, 0x0012EE },                                       /* 12D8-12EE */
-  { 0x0012F0, 0x00130E },                                       /* 12F0-130E */
-  { 0x001310           },                                            /* 1310 */
-  { 0x001312, 0x001315 },                                       /* 1312-1315 */
-  { 0x001318, 0x00131E },                                       /* 1318-131E */
-  { 0x001320, 0x001346 },                                       /* 1320-1346 */
-  { 0x001348, 0x00135A },                                       /* 1348-135A */
-  { 0x001361, 0x00137C },                                       /* 1361-137C */
-  { 0x0013A0, 0x0013F4 },                                       /* 13A0-13F4 */
-  { 0x001401, 0x001676 },                                       /* 1401-1676 */
-  { 0x001681, 0x00169A },                                       /* 1681-169A */
-  { 0x0016A0, 0x0016F0 },                                       /* 16A0-16F0 */
-  { 0x001700, 0x00170C },                                       /* 1700-170C */
-  { 0x00170E, 0x001711 },                                       /* 170E-1711 */
-  { 0x001720, 0x001731 },                                       /* 1720-1731 */
-  { 0x001735, 0x001736 },                                       /* 1735-1736 */
-  { 0x001740, 0x001751 },                                       /* 1740-1751 */
-  { 0x001760, 0x00176C },                                       /* 1760-176C */
-  { 0x00176E, 0x001770 },                                       /* 176E-1770 */
-  { 0x001780, 0x0017B6 },                                       /* 1780-17B6 */
-  { 0x0017BE, 0x0017C5 },                                       /* 17BE-17C5 */
-  { 0x0017C7, 0x0017C8 },                                       /* 17C7-17C8 */
-  { 0x0017D4, 0x0017DA },                                       /* 17D4-17DA */
-  { 0x0017DC           },                                            /* 17DC */
-  { 0x0017E0, 0x0017E9 },                                       /* 17E0-17E9 */
-  { 0x001810, 0x001819 },                                       /* 1810-1819 */
-  { 0x001820, 0x001877 },                                       /* 1820-1877 */
-  { 0x001880, 0x0018A8 },                                       /* 1880-18A8 */
-  { 0x001E00, 0x001E9B },                                       /* 1E00-1E9B */
-  { 0x001EA0, 0x001EF9 },                                       /* 1EA0-1EF9 */
-  { 0x001F00, 0x001F15 },                                       /* 1F00-1F15 */
-  { 0x001F18, 0x001F1D },                                       /* 1F18-1F1D */
-  { 0x001F20, 0x001F45 },                                       /* 1F20-1F45 */
-  { 0x001F48, 0x001F4D },                                       /* 1F48-1F4D */
-  { 0x001F50, 0x001F57 },                                       /* 1F50-1F57 */
-  { 0x001F59           },                                            /* 1F59 */
-  { 0x001F5B           },                                            /* 1F5B */
-  { 0x001F5D           },                                            /* 1F5D */
-  { 0x001F5F, 0x001F7D },                                       /* 1F5F-1F7D */
-  { 0x001F80, 0x001FB4 },                                       /* 1F80-1FB4 */
-  { 0x001FB6, 0x001FBC },                                       /* 1FB6-1FBC */
-  { 0x001FBE           },                                            /* 1FBE */
-  { 0x001FC2, 0x001FC4 },                                       /* 1FC2-1FC4 */
-  { 0x001FC6, 0x001FCC },                                       /* 1FC6-1FCC */
-  { 0x001FD0, 0x001FD3 },                                       /* 1FD0-1FD3 */
-  { 0x001FD6, 0x001FDB },                                       /* 1FD6-1FDB */
-  { 0x001FE0, 0x001FEC },                                       /* 1FE0-1FEC */
-  { 0x001FF2, 0x001FF4 },                                       /* 1FF2-1FF4 */
-  { 0x001FF6, 0x001FFC },                                       /* 1FF6-1FFC */
-  { 0x00200E           },                                            /* 200E */
-  { 0x002071           },                                            /* 2071 */
-  { 0x00207F           },                                            /* 207F */
-  { 0x002102           },                                            /* 2102 */
-  { 0x002107           },                                            /* 2107 */
-  { 0x00210A, 0x002113 },                                       /* 210A-2113 */
-  { 0x002115           },                                            /* 2115 */
-  { 0x002119, 0x00211D },                                       /* 2119-211D */
-  { 0x002124           },                                            /* 2124 */
-  { 0x002126           },                                            /* 2126 */
-  { 0x002128           },                                            /* 2128 */
-  { 0x00212A, 0x00212D },                                       /* 212A-212D */
-  { 0x00212F, 0x002131 },                                       /* 212F-2131 */
-  { 0x002133, 0x002139 },                                       /* 2133-2139 */
-  { 0x00213D, 0x00213F },                                       /* 213D-213F */
-  { 0x002145, 0x002149 },                                       /* 2145-2149 */
-  { 0x002160, 0x002183 },                                       /* 2160-2183 */
-  { 0x002336, 0x00237A },                                       /* 2336-237A */
-  { 0x002395           },                                            /* 2395 */
-  { 0x00249C, 0x0024E9 },                                       /* 249C-24E9 */
-  { 0x003005, 0x003007 },                                       /* 3005-3007 */
-  { 0x003021, 0x003029 },                                       /* 3021-3029 */
-  { 0x003031, 0x003035 },                                       /* 3031-3035 */
-  { 0x003038, 0x00303C },                                       /* 3038-303C */
-  { 0x003041, 0x003096 },                                       /* 3041-3096 */
-  { 0x00309D, 0x00309F },                                       /* 309D-309F */
-  { 0x0030A1, 0x0030FA },                                       /* 30A1-30FA */
-  { 0x0030FC, 0x0030FF },                                       /* 30FC-30FF */
-  { 0x003105, 0x00312C },                                       /* 3105-312C */
-  { 0x003131, 0x00318E },                                       /* 3131-318E */
-  { 0x003190, 0x0031B7 },                                       /* 3190-31B7 */
-  { 0x0031F0, 0x00321C },                                       /* 31F0-321C */
-  { 0x003220, 0x003243 },                                       /* 3220-3243 */
-  { 0x003260, 0x00327B },                                       /* 3260-327B */
-  { 0x00327F, 0x0032B0 },                                       /* 327F-32B0 */
-  { 0x0032C0, 0x0032CB },                                       /* 32C0-32CB */
-  { 0x0032D0, 0x0032FE },                                       /* 32D0-32FE */
-  { 0x003300, 0x003376 },                                       /* 3300-3376 */
-  { 0x00337B, 0x0033DD },                                       /* 337B-33DD */
-  { 0x0033E0, 0x0033FE },                                       /* 33E0-33FE */
-  { 0x003400, 0x004DB5 },                                       /* 3400-4DB5 */
-  { 0x004E00, 0x009FA5 },                                       /* 4E00-9FA5 */
-  { 0x00A000, 0x00A48C },                                       /* A000-A48C */
-  { 0x00AC00, 0x00D7A3 },                                       /* AC00-D7A3 */
-  { 0x00D800, 0x00FA2D },                                       /* D800-FA2D */
-  { 0x00FA30, 0x00FA6A },                                       /* FA30-FA6A */
-  { 0x00FB00, 0x00FB06 },                                       /* FB00-FB06 */
-  { 0x00FB13, 0x00FB17 },                                       /* FB13-FB17 */
-  { 0x00FF21, 0x00FF3A },                                       /* FF21-FF3A */
-  { 0x00FF41, 0x00FF5A },                                       /* FF41-FF5A */
-  { 0x00FF66, 0x00FFBE },                                       /* FF66-FFBE */
-  { 0x00FFC2, 0x00FFC7 },                                       /* FFC2-FFC7 */
-  { 0x00FFCA, 0x00FFCF },                                       /* FFCA-FFCF */
-  { 0x00FFD2, 0x00FFD7 },                                       /* FFD2-FFD7 */
-  { 0x00FFDA, 0x00FFDC },                                       /* FFDA-FFDC */
-  { 0x010300, 0x01031E },                                     /* 10300-1031E */
-  { 0x010320, 0x010323 },                                     /* 10320-10323 */
-  { 0x010330, 0x01034A },                                     /* 10330-1034A */
-  { 0x010400, 0x010425 },                                     /* 10400-10425 */
-  { 0x010428, 0x01044D },                                     /* 10428-1044D */
-  { 0x01D000, 0x01D0F5 },                                     /* 1D000-1D0F5 */
-  { 0x01D100, 0x01D126 },                                     /* 1D100-1D126 */
-  { 0x01D12A, 0x01D166 },                                     /* 1D12A-1D166 */
-  { 0x01D16A, 0x01D172 },                                     /* 1D16A-1D172 */
-  { 0x01D183, 0x01D184 },                                     /* 1D183-1D184 */
-  { 0x01D18C, 0x01D1A9 },                                     /* 1D18C-1D1A9 */
-  { 0x01D1AE, 0x01D1DD },                                     /* 1D1AE-1D1DD */
-  { 0x01D400, 0x01D454 },                                     /* 1D400-1D454 */
-  { 0x01D456, 0x01D49C },                                     /* 1D456-1D49C */
-  { 0x01D49E, 0x01D49F },                                     /* 1D49E-1D49F */
-  { 0x01D4A2           },                                           /* 1D4A2 */
-  { 0x01D4A5, 0x01D4A6 },                                     /* 1D4A5-1D4A6 */
-  { 0x01D4A9, 0x01D4AC },                                     /* 1D4A9-1D4AC */
-  { 0x01D4AE, 0x01D4B9 },                                     /* 1D4AE-1D4B9 */
-  { 0x01D4BB           },                                           /* 1D4BB */
-  { 0x01D4BD, 0x01D4C0 },                                     /* 1D4BD-1D4C0 */
-  { 0x01D4C2, 0x01D4C3 },                                     /* 1D4C2-1D4C3 */
-  { 0x01D4C5, 0x01D505 },                                     /* 1D4C5-1D505 */
-  { 0x01D507, 0x01D50A },                                     /* 1D507-1D50A */
-  { 0x01D50D, 0x01D514 },                                     /* 1D50D-1D514 */
-  { 0x01D516, 0x01D51C },                                     /* 1D516-1D51C */
-  { 0x01D51E, 0x01D539 },                                     /* 1D51E-1D539 */
-  { 0x01D53B, 0x01D53E },                                     /* 1D53B-1D53E */
-  { 0x01D540, 0x01D544 },                                     /* 1D540-1D544 */
-  { 0x01D546           },                                           /* 1D546 */
-  { 0x01D54A, 0x01D550 },                                     /* 1D54A-1D550 */
-  { 0x01D552, 0x01D6A3 },                                     /* 1D552-1D6A3 */
-  { 0x01D6A8, 0x01D7C9 },                                     /* 1D6A8-1D7C9 */
-  { 0x020000, 0x02A6D6 },                                     /* 20000-2A6D6 */
-  { 0x02F800, 0x02FA1D },                                     /* 2F800-2FA1D */
-  { 0x0F0000, 0x0FFFFD },                                     /* F0000-FFFFD */
-  { 0x100000, 0x10FFFD },                                   /* 100000-10FFFD */
-  { 0 },
-};
-
diff --git a/lib/contrib/stringprep.c b/lib/contrib/stringprep.c
deleted file mode 100644 (file)
index 497b5bf..0000000
+++ /dev/null
@@ -1,675 +0,0 @@
-/* stringprep.c --- Core stringprep implementation.
- * Copyright (C) 2002, 2003, 2004, 2005  Simon Josefsson
- *
- * This file is part of GNU Libidn.
- *
- * GNU Libidn is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * GNU Libidn 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
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with GNU Libidn; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- *
- */
-
-#include <stdlib.h>
-#include <string.h>
-
-#include "stringprep.h"
-
-const Stringprep_profiles stringprep_profiles[] = {
-  {NULL, NULL}
-};
-
-static ssize_t
-stringprep_find_character_in_table (uint32_t ucs4,
-                                   const Stringprep_table_element * table)
-{
-  ssize_t i;
-
-  /* This is where typical uses of Libidn spends very close to all CPU
-     time and causes most cache misses.  One could easily do a binary
-     search instead.  Before rewriting this, I want hard evidence this
-     slowness is at all relevant in typical applications.  (I don't
-     dispute optimization may improve matters significantly, I'm
-     mostly interested in having someone give real-world benchmark on
-     the impact of libidn.) */
-
-  for (i = 0; table[i].start || table[i].end; i++)
-    if (ucs4 >= table[i].start &&
-       ucs4 <= (table[i].end ? table[i].end : table[i].start))
-      return i;
-
-  return -1;
-}
-
-static ssize_t
-stringprep_find_string_in_table (uint32_t * ucs4,
-                                size_t ucs4len,
-                                size_t * tablepos,
-                                const Stringprep_table_element * table)
-{
-  size_t j;
-  ssize_t pos;
-
-  for (j = 0; j < ucs4len; j++)
-    if ((pos = stringprep_find_character_in_table (ucs4[j], table)) != -1)
-      {
-       if (tablepos)
-         *tablepos = pos;
-       return j;
-      }
-
-  return -1;
-}
-
-static int
-stringprep_apply_table_to_string (uint32_t * ucs4,
-                                 size_t * ucs4len,
-                                 size_t maxucs4len,
-                                 const Stringprep_table_element * table)
-{
-  ssize_t pos;
-  size_t i, maplen;
-
-  while ((pos = stringprep_find_string_in_table (ucs4, *ucs4len,
-                                                &i, table)) != -1)
-    {
-      for (maplen = STRINGPREP_MAX_MAP_CHARS;
-          maplen > 0 && table[i].map[maplen - 1] == 0; maplen--)
-       ;
-
-      if (*ucs4len - 1 + maplen >= maxucs4len)
-       return STRINGPREP_TOO_SMALL_BUFFER;
-
-      memmove (&ucs4[pos + maplen], &ucs4[pos + 1],
-              sizeof (uint32_t) * (*ucs4len - pos - 1));
-      memcpy (&ucs4[pos], table[i].map, sizeof (uint32_t) * maplen);
-      *ucs4len = *ucs4len - 1 + maplen;
-    }
-
-  return STRINGPREP_OK;
-}
-
-#define INVERTED(x) ((x) & ((~0UL) >> 1))
-#define UNAPPLICAPLEFLAGS(flags, profileflags) \
-  ((!INVERTED(profileflags) && !(profileflags & flags) && profileflags) || \
-   ( INVERTED(profileflags) && (profileflags & flags)))
-
-/**
- * stringprep_4i:
- * @ucs4: input/output array with string to prepare.
- * @len: on input, length of input array with Unicode code points,
- *   on exit, length of output array with Unicode code points.
- * @maxucs4len: maximum length of input/output array.
- * @flags: a #Stringprep_profile_flags value, or 0.
- * @profile: pointer to #Stringprep_profile to use.
- *
- * Prepare the input UCS-4 string according to the stringprep profile,
- * and write back the result to the input string.
- *
- * The input is not required to be zero terminated (@ucs4[@len] = 0).
- * The output will not be zero terminated unless @ucs4[@len] = 0.
- * Instead, see stringprep_4zi() if your input is zero terminated or
- * if you want the output to be.
- *
- * Since the stringprep operation can expand the string, @maxucs4len
- * indicate how large the buffer holding the string is.  This function
- * will not read or write to code points outside that size.
- *
- * The @flags are one of #Stringprep_profile_flags values, or 0.
- *
- * The @profile contain the #Stringprep_profile instructions to
- * perform.  Your application can define new profiles, possibly
- * re-using the generic stringprep tables that always will be part of
- * the library, or use one of the currently supported profiles.
- *
- * Return value: Returns %STRINGPREP_OK iff successful, or an
- *   #Stringprep_rc error code.
- **/
-int
-stringprep_4i (uint32_t * ucs4, size_t * len, size_t maxucs4len,
-              Stringprep_profile_flags flags,
-              const Stringprep_profile * profile)
-{
-  size_t i, j;
-  ssize_t k;
-  size_t ucs4len = *len;
-  int rc;
-
-  for (i = 0; profile[i].operation; i++)
-    {
-      switch (profile[i].operation)
-       {
-       case STRINGPREP_NFKC:
-         {
-           uint32_t *q = 0;
-
-           if (UNAPPLICAPLEFLAGS (flags, profile[i].flags))
-             break;
-
-           if (flags & STRINGPREP_NO_NFKC && !profile[i].flags)
-             /* Profile requires NFKC, but callee asked for no NFKC. */
-             return STRINGPREP_FLAG_ERROR;
-
-           q = stringprep_ucs4_nfkc_normalize (ucs4, ucs4len);
-           if (!q)
-             return STRINGPREP_NFKC_FAILED;
-
-           for (ucs4len = 0; q[ucs4len]; ucs4len++)
-             ;
-
-           if (ucs4len >= maxucs4len)
-             {
-               free (q);
-               return STRINGPREP_TOO_SMALL_BUFFER;
-             }
-
-           memcpy (ucs4, q, ucs4len * sizeof (ucs4[0]));
-
-           free (q);
-         }
-         break;
-
-       case STRINGPREP_PROHIBIT_TABLE:
-         k = stringprep_find_string_in_table (ucs4, ucs4len,
-                                              NULL, profile[i].table);
-         if (k != -1)
-           return STRINGPREP_CONTAINS_PROHIBITED;
-         break;
-
-       case STRINGPREP_UNASSIGNED_TABLE:
-         if (UNAPPLICAPLEFLAGS (flags, profile[i].flags))
-           break;
-         if (flags & STRINGPREP_NO_UNASSIGNED)
-           {
-             k = stringprep_find_string_in_table
-               (ucs4, ucs4len, NULL, profile[i].table);
-             if (k != -1)
-               return STRINGPREP_CONTAINS_UNASSIGNED;
-           }
-         break;
-
-       case STRINGPREP_MAP_TABLE:
-         if (UNAPPLICAPLEFLAGS (flags, profile[i].flags))
-           break;
-         rc = stringprep_apply_table_to_string
-           (ucs4, &ucs4len, maxucs4len, profile[i].table);
-         if (rc != STRINGPREP_OK)
-           return rc;
-         break;
-
-       case STRINGPREP_BIDI_PROHIBIT_TABLE:
-       case STRINGPREP_BIDI_RAL_TABLE:
-       case STRINGPREP_BIDI_L_TABLE:
-         break;
-
-       case STRINGPREP_BIDI:
-         {
-           int done_prohibited = 0;
-           int done_ral = 0;
-           int done_l = 0;
-           int contains_ral = -1;
-           int contains_l = -1;
-
-           for (j = 0; profile[j].operation; j++)
-             if (profile[j].operation == STRINGPREP_BIDI_PROHIBIT_TABLE)
-               {
-                 done_prohibited = 1;
-                 k = stringprep_find_string_in_table (ucs4, ucs4len,
-                                                      NULL,
-                                                      profile[j].table);
-                 if (k != -1)
-                   return STRINGPREP_BIDI_CONTAINS_PROHIBITED;
-               }
-             else if (profile[j].operation == STRINGPREP_BIDI_RAL_TABLE)
-               {
-                 done_ral = 1;
-                 if (stringprep_find_string_in_table
-                     (ucs4, ucs4len, NULL, profile[j].table) != -1)
-                   contains_ral = j;
-               }
-             else if (profile[j].operation == STRINGPREP_BIDI_L_TABLE)
-               {
-                 done_l = 1;
-                 if (stringprep_find_string_in_table
-                     (ucs4, ucs4len, NULL, profile[j].table) != -1)
-                   contains_l = j;
-               }
-
-           if (!done_prohibited || !done_ral || !done_l)
-             return STRINGPREP_PROFILE_ERROR;
-
-           if (contains_ral != -1 && contains_l != -1)
-             return STRINGPREP_BIDI_BOTH_L_AND_RAL;
-
-           if (contains_ral != -1)
-             {
-               if (!(stringprep_find_character_in_table
-                     (ucs4[0], profile[contains_ral].table) != -1 &&
-                     stringprep_find_character_in_table
-                     (ucs4[ucs4len - 1], profile[contains_ral].table) != -1))
-                 return STRINGPREP_BIDI_LEADTRAIL_NOT_RAL;
-             }
-         }
-         break;
-
-       default:
-         return STRINGPREP_PROFILE_ERROR;
-         break;
-       }
-    }
-
-  *len = ucs4len;
-
-  return STRINGPREP_OK;
-}
-
-static int
-stringprep_4zi_1 (uint32_t * ucs4, size_t ucs4len, size_t maxucs4len,
-                 Stringprep_profile_flags flags,
-                 const Stringprep_profile * profile)
-{
-  int rc;
-
-  rc = stringprep_4i (ucs4, &ucs4len, maxucs4len, flags, profile);
-  if (rc != STRINGPREP_OK)
-    return rc;
-
-  if (ucs4len >= maxucs4len)
-    return STRINGPREP_TOO_SMALL_BUFFER;
-
-  ucs4[ucs4len] = 0;
-
-  return STRINGPREP_OK;
-}
-
-/**
- * stringprep_4zi:
- * @ucs4: input/output array with zero terminated string to prepare.
- * @maxucs4len: maximum length of input/output array.
- * @flags: a #Stringprep_profile_flags value, or 0.
- * @profile: pointer to #Stringprep_profile to use.
- *
- * Prepare the input zero terminated UCS-4 string according to the
- * stringprep profile, and write back the result to the input string.
- *
- * Since the stringprep operation can expand the string, @maxucs4len
- * indicate how large the buffer holding the string is.  This function
- * will not read or write to code points outside that size.
- *
- * The @flags are one of #Stringprep_profile_flags values, or 0.
- *
- * The @profile contain the #Stringprep_profile instructions to
- * perform.  Your application can define new profiles, possibly
- * re-using the generic stringprep tables that always will be part of
- * the library, or use one of the currently supported profiles.
- *
- * Return value: Returns %STRINGPREP_OK iff successful, or an
- *   #Stringprep_rc error code.
- **/
-int
-stringprep_4zi (uint32_t * ucs4, size_t maxucs4len,
-               Stringprep_profile_flags flags,
-               const Stringprep_profile * profile)
-{
-  size_t ucs4len;
-
-  for (ucs4len = 0; ucs4len < maxucs4len && ucs4[ucs4len] != 0; ucs4len++)
-    ;
-
-  return stringprep_4zi_1 (ucs4, ucs4len, maxucs4len, flags, profile);
-}
-
-/**
- * stringprep:
- * @in: input/ouput array with string to prepare.
- * @maxlen: maximum length of input/output array.
- * @flags: a #Stringprep_profile_flags value, or 0.
- * @profile: pointer to #Stringprep_profile to use.
- *
- * Prepare the input zero terminated UTF-8 string according to the
- * stringprep profile, and write back the result to the input string.
- *
- * Note that you must convert strings entered in the systems locale
- * into UTF-8 before using this function, see
- * stringprep_locale_to_utf8().
- *
- * Since the stringprep operation can expand the string, @maxlen
- * indicate how large the buffer holding the string is.  This function
- * will not read or write to characters outside that size.
- *
- * The @flags are one of #Stringprep_profile_flags values, or 0.
- *
- * The @profile contain the #Stringprep_profile instructions to
- * perform.  Your application can define new profiles, possibly
- * re-using the generic stringprep tables that always will be part of
- * the library, or use one of the currently supported profiles.
- *
- * Return value: Returns %STRINGPREP_OK iff successful, or an error code.
- **/
-int
-stringprep (char *in,
-           size_t maxlen,
-           Stringprep_profile_flags flags,
-           const Stringprep_profile * profile)
-{
-  int rc;
-  char *utf8 = NULL;
-  uint32_t *ucs4 = NULL;
-  size_t ucs4len, maxucs4len, adducs4len = 50;
-
-  do
-    {
-      uint32_t *newp;
-
-      if (ucs4)
-       free (ucs4);
-      ucs4 = stringprep_utf8_to_ucs4 (in, -1, &ucs4len);
-      maxucs4len = ucs4len + adducs4len;
-      newp = realloc (ucs4, maxucs4len * sizeof (uint32_t));
-      if (!newp)
-       {
-         free (ucs4);
-         return STRINGPREP_MALLOC_ERROR;
-       }
-      ucs4 = newp;
-
-      rc = stringprep_4i (ucs4, &ucs4len, maxucs4len, flags, profile);
-      adducs4len += 50;
-    }
-  while (rc == STRINGPREP_TOO_SMALL_BUFFER);
-  if (rc != STRINGPREP_OK)
-    {
-      free (ucs4);
-      return rc;
-    }
-
-  utf8 = stringprep_ucs4_to_utf8 (ucs4, ucs4len, 0, 0);
-  free (ucs4);
-  if (!utf8)
-    return STRINGPREP_MALLOC_ERROR;
-
-  if (strlen (utf8) >= maxlen)
-    {
-      free (utf8);
-      return STRINGPREP_TOO_SMALL_BUFFER;
-    }
-
-  strcpy (in, utf8);           /* flawfinder: ignore */
-
-  free (utf8);
-
-  return STRINGPREP_OK;
-}
-
-/**
- * stringprep_profile:
- * @in: input array with UTF-8 string to prepare.
- * @out: output variable with pointer to newly allocate string.
- * @profile: name of stringprep profile to use.
- * @flags: a #Stringprep_profile_flags value, or 0.
- *
- * Prepare the input zero terminated UTF-8 string according to the
- * stringprep profile, and return the result in a newly allocated
- * variable.
- *
- * Note that you must convert strings entered in the systems locale
- * into UTF-8 before using this function, see
- * stringprep_locale_to_utf8().
- *
- * The output @out variable must be deallocated by the caller.
- *
- * The @flags are one of #Stringprep_profile_flags values, or 0.
- *
- * The @profile specifies the name of the stringprep profile to use.
- * It must be one of the internally supported stringprep profiles.
- *
- * Return value: Returns %STRINGPREP_OK iff successful, or an error code.
- **/
-int
-stringprep_profile (const char *in,
-                   char **out,
-                   const char *profile, Stringprep_profile_flags flags)
-{
-  const Stringprep_profiles *p;
-  char *str = NULL;
-  size_t len = strlen (in) + 1;
-  int rc;
-
-  for (p = &stringprep_profiles[0]; p->name; p++)
-    if (strcmp (p->name, profile) == 0)
-      break;
-
-  if (!p || !p->name || !p->tables)
-    return STRINGPREP_UNKNOWN_PROFILE;
-
-  do
-    {
-      if (str)
-       free (str);
-      str = (char *) malloc (len);
-      if (str == NULL)
-       return STRINGPREP_MALLOC_ERROR;
-
-      strcpy (str, in);
-
-      rc = stringprep (str, len, flags, p->tables);
-      len += 50;
-    }
-  while (rc == STRINGPREP_TOO_SMALL_BUFFER);
-
-  if (rc == STRINGPREP_OK)
-    *out = str;
-  else
-    free (str);
-
-  return rc;
-}
-
-/*! \mainpage GNU Internationalized Domain Name Library
- *
- * \section intro Introduction
- *
- * GNU Libidn is an implementation of the Stringprep, Punycode and IDNA
- * specifications defined by the IETF Internationalized Domain Names
- * (IDN) working group, used for internationalized domain names.  The
- * package is available under the GNU Lesser General Public License.
- *
- * The library contains a generic Stringprep implementation that does
- * Unicode 3.2 NFKC normalization, mapping and prohibitation of
- * characters, and bidirectional character handling.  Profiles for
- * Nameprep, iSCSI, SASL and XMPP are included.  Punycode and ASCII
- * Compatible Encoding (ACE) via IDNA are supported.  A mechanism to
- * define Top-Level Domain (TLD) specific validation tables, and to
- * compare strings against those tables, is included.  Default tables
- * for some TLDs are also included.
- *
- * The Stringprep API consists of two main functions, one for
- * converting data from the system's native representation into UTF-8,
- * and one function to perform the Stringprep processing.  Adding a
- * new Stringprep profile for your application within the API is
- * straightforward.  The Punycode API consists of one encoding
- * function and one decoding function.  The IDNA API consists of the
- * ToASCII and ToUnicode functions, as well as an high-level interface
- * for converting entire domain names to and from the ACE encoded
- * form.  The TLD API consists of one set of functions to extract the
- * TLD name from a domain string, one set of functions to locate the
- * proper TLD table to use based on the TLD name, and core functions
- * to validate a string against a TLD table, and some utility wrappers
- * to perform all the steps in one call.
- *
- * The library is used by, e.g., GNU SASL and Shishi to process user
- * names and passwords.  Libidn can be built into GNU Libc to enable a
- * new system-wide getaddrinfo() flag for IDN processing.
- *
- * Libidn is developed for the GNU/Linux system, but runs on over 20 Unix
- * platforms (including Solaris, IRIX, AIX, and Tru64) and Windows.
- * Libidn is written in C and (parts of) the API is accessible from C,
- * C++, Emacs Lisp, Python and Java.
- *
- * The project web page:\n
- * http://www.gnu.org/software/libidn/
- *
- * The software archive:\n
- * ftp://alpha.gnu.org/pub/gnu/libidn/
- *
- * For more information see:\n
- * http://www.ietf.org/html.charters/idn-charter.html\n
- * http://www.ietf.org/rfc/rfc3454.txt (stringprep specification)\n
- * http://www.ietf.org/rfc/rfc3490.txt (idna specification)\n
- * http://www.ietf.org/rfc/rfc3491.txt (nameprep specification)\n
- * http://www.ietf.org/rfc/rfc3492.txt (punycode specification)\n
- * http://www.ietf.org/internet-drafts/draft-ietf-ips-iscsi-string-prep-04.txt\n
- * http://www.ietf.org/internet-drafts/draft-ietf-krb-wg-utf8-profile-01.txt\n
- * http://www.ietf.org/internet-drafts/draft-ietf-sasl-anon-00.txt\n
- * http://www.ietf.org/internet-drafts/draft-ietf-sasl-saslprep-00.txt\n
- * http://www.ietf.org/internet-drafts/draft-ietf-xmpp-nodeprep-01.txt\n
- * http://www.ietf.org/internet-drafts/draft-ietf-xmpp-resourceprep-01.txt\n
- *
- * Further information and paid contract development:\n
- * Simon Josefsson <simon@josefsson.org>
- *
- * \section examples Examples
- *
- * \include example.c
- * \include example3.c
- * \include example4.c
- * \include example5.c
- */
-
-/**
- * STRINGPREP_VERSION
- *
- * String defined via CPP denoting the header file version number.
- * Used together with stringprep_check_version() to verify header file
- * and run-time library consistency.
- */
-
-/**
- * STRINGPREP_MAX_MAP_CHARS
- *
- * Maximum number of code points that can replace a single code point,
- * during stringprep mapping.
- */
-
-/**
- * Stringprep_rc:
- * @STRINGPREP_OK: Successful operation.  This value is guaranteed to
- *   always be zero, the remaining ones are only guaranteed to hold
- *   non-zero values, for logical comparison purposes.
- * @STRINGPREP_CONTAINS_UNASSIGNED: String contain unassigned Unicode
- *   code points, which is forbidden by the profile.
- * @STRINGPREP_CONTAINS_PROHIBITED: String contain code points
- *   prohibited by the profile.
- * @STRINGPREP_BIDI_BOTH_L_AND_RAL: String contain code points with
- *   conflicting bidirection category.
- * @STRINGPREP_BIDI_LEADTRAIL_NOT_RAL: Leading and trailing character
- *   in string not of proper bidirectional category.
- * @STRINGPREP_BIDI_CONTAINS_PROHIBITED: Contains prohibited code
- *   points detected by bidirectional code.
- * @STRINGPREP_TOO_SMALL_BUFFER: Buffer handed to function was too
- *   small.  This usually indicate a problem in the calling
- *   application.
- * @STRINGPREP_PROFILE_ERROR: The stringprep profile was inconsistent.
- *   This usually indicate an internal error in the library.
- * @STRINGPREP_FLAG_ERROR: The supplied flag conflicted with profile.
- *   This usually indicate a problem in the calling application.
- * @STRINGPREP_UNKNOWN_PROFILE: The supplied profile name was not
- *   known to the library.
- * @STRINGPREP_NFKC_FAILED: The Unicode NFKC operation failed.  This
- *   usually indicate an internal error in the library.
- * @STRINGPREP_MALLOC_ERROR: The malloc() was out of memory.  This is
- *   usually a fatal error.
- *
- * Enumerated return codes of stringprep(), stringprep_profile()
- * functions (and macros using those functions).  The value 0 is
- * guaranteed to always correspond to success.
- */
-
-/**
- * Stringprep_profile_flags:
- * @STRINGPREP_NO_NFKC: Disable the NFKC normalization, as well as
- *   selecting the non-NFKC case folding tables.  Usually the profile
- *   specifies BIDI and NFKC settings, and applications should not
- *   override it unless in special situations.
- * @STRINGPREP_NO_BIDI: Disable the BIDI step.  Usually the profile
- *   specifies BIDI and NFKC settings, and applications should not
- *   override it unless in special situations.
- * @STRINGPREP_NO_UNASSIGNED: Make the library return with an error if
- *   string contains unassigned characters according to profile.
- *
- * Stringprep profile flags.
- */
-
-/**
- * Stringprep_profile_steps:
- *
- * Various steps in the stringprep algorithm.  You really want to
- * study the source code to understand this one.  Only useful if you
- * want to add another profile.
- */
-
-/**
- * stringprep_nameprep:
- * @in: input/ouput array with string to prepare.
- * @maxlen: maximum length of input/output array.
- *
- * Prepare the input UTF-8 string according to the nameprep profile.
- * The AllowUnassigned flag is true, use
- * stringprep_nameprep_no_unassigned() if you want a false
- * AllowUnassigned.  Returns 0 iff successful, or an error code.
- **/
-
-/**
- * stringprep_nameprep_no_unassigned:
- * @in: input/ouput array with string to prepare.
- * @maxlen: maximum length of input/output array.
- *
- * Prepare the input UTF-8 string according to the nameprep profile.
- * The AllowUnassigned flag is false, use stringprep_nameprep() for
- * true AllowUnassigned.  Returns 0 iff successful, or an error code.
- **/
-
-/**
- * stringprep_iscsi:
- * @in: input/ouput array with string to prepare.
- * @maxlen: maximum length of input/output array.
- *
- * Prepare the input UTF-8 string according to the draft iSCSI
- * stringprep profile.  Returns 0 iff successful, or an error code.
- **/
-
-/**
- * stringprep_plain:
- * @in: input/ouput array with string to prepare.
- * @maxlen: maximum length of input/output array.
- *
- * Prepare the input UTF-8 string according to the draft SASL
- * ANONYMOUS profile.  Returns 0 iff successful, or an error code.
- **/
-
-/**
- * stringprep_xmpp_nodeprep:
- * @in: input/ouput array with string to prepare.
- * @maxlen: maximum length of input/output array.
- *
- * Prepare the input UTF-8 string according to the draft XMPP node
- * identifier profile.  Returns 0 iff successful, or an error code.
- **/
-
-/**
- * stringprep_xmpp_resourceprep:
- * @in: input/ouput array with string to prepare.
- * @maxlen: maximum length of input/output array.
- *
- * Prepare the input UTF-8 string according to the draft XMPP resource
- * identifier profile.  Returns 0 iff successful, or an error code.
- **/
diff --git a/lib/contrib/stringprep.h b/lib/contrib/stringprep.h
deleted file mode 100644 (file)
index 84349ca..0000000
+++ /dev/null
@@ -1,181 +0,0 @@
-/* stringprep.h --- Header file for stringprep functions.             -*- c -*-
- * Copyright (C) 2002, 2003, 2004, 2005  Simon Josefsson
- *
- * This file is part of GNU Libidn.
- *
- * GNU Libidn is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * GNU Libidn 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
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with GNU Libidn; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- *
- */
-
-#ifndef _STRINGPREP_H
-#define _STRINGPREP_H
-
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-
-#include <stddef.h>            /* size_t */
-#include <stdlib.h>
-
-#include "silc.h"
-
-#ifndef uint32_t
-#define uint32_t SilcUInt32
-#endif
-#ifndef ssize_t
-#define ssize_t int
-#endif
-#ifndef uint16_t
-#define uint16_t SilcUInt16
-#endif
-#ifndef int16_t
-#define int16_t SilcInt16
-#endif
-
-#define STRINGPREP_VERSION "0.5.9"
-
-/* Error codes. */
-  typedef enum
-  {
-    STRINGPREP_OK = 0,
-    /* Stringprep errors. */
-    STRINGPREP_CONTAINS_UNASSIGNED = 1,
-    STRINGPREP_CONTAINS_PROHIBITED = 2,
-    STRINGPREP_BIDI_BOTH_L_AND_RAL = 3,
-    STRINGPREP_BIDI_LEADTRAIL_NOT_RAL = 4,
-    STRINGPREP_BIDI_CONTAINS_PROHIBITED = 5,
-    /* Error in calling application. */
-    STRINGPREP_TOO_SMALL_BUFFER = 100,
-    STRINGPREP_PROFILE_ERROR = 101,
-    STRINGPREP_FLAG_ERROR = 102,
-    STRINGPREP_UNKNOWN_PROFILE = 103,
-    /* Internal errors. */
-    STRINGPREP_NFKC_FAILED = 200,
-    STRINGPREP_MALLOC_ERROR = 201
-  } Stringprep_rc;
-
-/* Flags used when calling stringprep(). */
-  typedef enum
-  {
-    STRINGPREP_NO_NFKC = 1,
-    STRINGPREP_NO_BIDI = 2,
-    STRINGPREP_NO_UNASSIGNED = 4
-  } Stringprep_profile_flags;
-
-/* Steps in a stringprep profile. */
-  typedef enum
-  {
-    STRINGPREP_NFKC = 1,
-    STRINGPREP_BIDI = 2,
-    STRINGPREP_MAP_TABLE = 3,
-    STRINGPREP_UNASSIGNED_TABLE = 4,
-    STRINGPREP_PROHIBIT_TABLE = 5,
-    STRINGPREP_BIDI_PROHIBIT_TABLE = 6,
-    STRINGPREP_BIDI_RAL_TABLE = 7,
-    STRINGPREP_BIDI_L_TABLE = 8
-  } Stringprep_profile_steps;
-
-#define STRINGPREP_MAX_MAP_CHARS 4
-
-  struct Stringprep_table_element
-  {
-    uint32_t start;
-    uint32_t end;              /* 0 if only one character */
-    uint32_t map[STRINGPREP_MAX_MAP_CHARS];    /* NULL if end is not 0 */
-  };
-  typedef struct Stringprep_table_element Stringprep_table_element;
-
-  struct Stringprep_table
-  {
-    Stringprep_profile_steps operation;
-    Stringprep_profile_flags flags;
-    const Stringprep_table_element *table;
-  };
-  typedef struct Stringprep_table Stringprep_profile;
-
-  struct Stringprep_profiles
-  {
-    const char *name;
-    const Stringprep_profile *tables;
-  };
-  typedef struct Stringprep_profiles Stringprep_profiles;
-
-  extern const Stringprep_profiles stringprep_profiles[];
-
-/* Profiles */
-  extern const Stringprep_table_element stringprep_rfc3454_A_1[];
-  extern const Stringprep_table_element stringprep_rfc3454_B_1[];
-  extern const Stringprep_table_element stringprep_rfc3454_B_2[];
-  extern const Stringprep_table_element stringprep_rfc3454_B_3[];
-  extern const Stringprep_table_element stringprep_rfc3454_C_1_1[];
-  extern const Stringprep_table_element stringprep_rfc3454_C_1_2[];
-  extern const Stringprep_table_element stringprep_rfc3454_C_2_1[];
-  extern const Stringprep_table_element stringprep_rfc3454_C_2_2[];
-  extern const Stringprep_table_element stringprep_rfc3454_C_3[];
-  extern const Stringprep_table_element stringprep_rfc3454_C_4[];
-  extern const Stringprep_table_element stringprep_rfc3454_C_5[];
-  extern const Stringprep_table_element stringprep_rfc3454_C_6[];
-  extern const Stringprep_table_element stringprep_rfc3454_C_7[];
-  extern const Stringprep_table_element stringprep_rfc3454_C_8[];
-  extern const Stringprep_table_element stringprep_rfc3454_C_9[];
-  extern const Stringprep_table_element stringprep_rfc3454_D_1[];
-  extern const Stringprep_table_element stringprep_rfc3454_D_2[];
-
-  extern int stringprep_4i (uint32_t * ucs4, size_t * len, size_t maxucs4len,
-                           Stringprep_profile_flags flags,
-                           const Stringprep_profile * profile);
-  extern int stringprep_4zi (uint32_t * ucs4, size_t maxucs4len,
-                            Stringprep_profile_flags flags,
-                            const Stringprep_profile * profile);
-  extern int stringprep (char *in, size_t maxlen,
-                        Stringprep_profile_flags flags,
-                        const Stringprep_profile * profile);
-
-  extern int stringprep_profile (const char *in,
-                                char **out,
-                                const char *profile,
-                                Stringprep_profile_flags flags);
-
-  extern const char *stringprep_strerror (Stringprep_rc rc);
-
-  extern const char *stringprep_check_version (const char *req_version);
-
-/* Utility */
-
-  extern int stringprep_unichar_to_utf8 (uint32_t c, char *outbuf);
-  extern uint32_t stringprep_utf8_to_unichar (const char *p);
-
-  extern uint32_t *stringprep_utf8_to_ucs4 (const char *str, int len,
-                                           size_t * items_written);
-  extern char *stringprep_ucs4_to_utf8 (const uint32_t * str, int len,
-                                       size_t * items_read,
-                                       size_t * items_written);
-
-  extern char *stringprep_utf8_nfkc_normalize (const char *str, int len);
-  extern uint32_t *stringprep_ucs4_nfkc_normalize (uint32_t * str,
-                                                  int len);
-
-  extern const char *stringprep_locale_charset (void);
-  extern char *stringprep_convert (const char *str,
-                                  const char *to_codeset,
-                                  const char *from_codeset);
-  extern char *stringprep_locale_to_utf8 (const char *str);
-  extern char *stringprep_utf8_to_locale (const char *str);
-
-#ifdef __cplusplus
-}
-#endif
-#endif                         /* _STRINGPREP_H */
index 723593c5c1e6123287f8b94bcc6a5acd098d2086..49b79d6a1bacda08f744a19ef8b252d816aef559 100644 (file)
@@ -293,7 +293,10 @@ founder's public key when it was set.  It may also return the channel
 public key list when the list was altered.  The 'founder_key' and
 'channel_pubkeys' arguments may be NULL.  The 'channel_pubkeys' is a list
 of SilcArgumentDecodedList contexts which each contain one channel public
-key.  The library will automatically free the list.
+key.  The library will automatically free the list.  If the `founder_key'
+was present it will be updated to `channel' entry by the library after
+calling the command_reply callback.  Application may check if the `founder_key'
+is different from the key in `channel' entry to detect if it was changed.
 </td>
 <td width="50%"><small>SilcChannelEntry channel, SilcUInt32 mode,
 SilcPublicKey founder_key, SilcDList channel_pubkeys, SilcUint32 user_limit
index b33be0329e2836cab0881c2afe8739c50368c68e..d029df2df49ed64cba0abd285363aa09b20cd5b0 100644 (file)
@@ -21,16 +21,12 @@ noinst_LTLIBRARIES = libsilcapputil.la
 
 libsilcapputil_la_SOURCES =    \
        silcapputil.c           \
-#ifdef SILC_DIST_IDCACHE
        silcidcache.c
-#endif SILC_DIST_IDCACHE
 
 #ifdef SILC_DIST_TOOLKIT
 include_HEADERS =              \
        silcapputil.h           \
-#ifdef SILC_DIST_IDCACHE
        silcidcache.h
-#endif SILC_DIST_IDCACHE
 
 SILC_EXTRA_DIST = 
 #endif SILC_DIST_TOOLKIT
index 833f40e29b4d230eeb1d1b24120b43d2fb746b13..573d4585e17a9f0ba439658351165effe749702f 100644 (file)
@@ -31,18 +31,22 @@ static char *silc_create_pk_identifier(void)
 
   /* Get hostname */
   hostname = silc_net_localhost();
-  if (!hostname)
+  if (!hostname) {
+    fprintf(stderr, "Could not resolve local hostname/IP address");
     return NULL;
+  }
 
   /* Get username (mandatory) */
   username = silc_get_username();
-  if (!username)
+  if (!username) {
+    fprintf(stderr, "Could not determine username");
     return NULL;
+  }
 
   /* Create default email address, whether it is right or not */
   silc_snprintf(email, sizeof(email), "%s@%s", username, hostname);
 
-  ident = silc_pkcs_silc_encode_identifier(username, hostname, realname,
+  ident = silc_pkcs_silc_encode_identifier(NULL, username, hostname, realname,
                                           email, NULL, NULL, NULL);
   if (realname)
     silc_free(realname);
@@ -136,8 +140,7 @@ New pair of keys will be created.  Please, answer to following questions.\n\
       }
     } else {
       if (!def) {
-       fprintf(stderr, "Could not create public key identifier: %s\n",
-               strerror(errno));
+       fprintf(stderr, "Could not create public key identifier\n");
        return FALSE;
       }
       identifier = strdup(def);
@@ -257,7 +260,8 @@ SilcBool silc_load_key_pair(const char *pub_filename,
 
   SILC_LOG_DEBUG(("Loading public and private keys"));
 
-  if (!silc_pkcs_load_public_key(pub_filename, return_public_key)) {
+  if (!silc_pkcs_load_public_key(pub_filename,
+                                SILC_PKCS_ANY, return_public_key)) {
     if (pass)
       memset(pass, 0, strlen(pass));
     silc_free(pass);
@@ -272,6 +276,7 @@ SilcBool silc_load_key_pair(const char *pub_filename,
 
   if (!silc_pkcs_load_private_key(prv_filename,
                                  (const unsigned char *)pass, strlen(pass),
+                                 SILC_PKCS_ANY,
                                  return_private_key)) {
     silc_pkcs_public_key_free(*return_public_key);
     *return_public_key = NULL;
@@ -296,13 +301,13 @@ SilcBool silc_show_public_key(SilcPublicKey public_key)
   SilcUInt32 pk_len;
   SilcUInt32 key_len = 0;
 
-  silc_pubkey = silc_pkcs_get_context(SILC_PKCS_SILC, public_key);
+  silc_pubkey = silc_pkcs_public_key_get_pkcs(SILC_PKCS_SILC, public_key);
   if (!silc_pubkey)
     return FALSE;
 
   ident = &silc_pubkey->identifier;
   key_len = silc_pkcs_public_key_get_len(public_key);
-  pk = silc_pkcs_public_key_encode(public_key, &pk_len);
+  pk = silc_pkcs_public_key_encode(NULL, public_key, &pk_len);
   if (!pk)
     return FALSE;
   fingerprint = silc_hash_fingerprint(NULL, pk, pk_len);
@@ -344,7 +349,8 @@ SilcBool silc_show_public_key_file(const char *pub_filename)
   SilcPublicKey public_key;
   SilcBool ret;
 
-  if (!silc_pkcs_load_public_key((char *)pub_filename, &public_key)) {
+  if (!silc_pkcs_load_public_key((char *)pub_filename,
+                                SILC_PKCS_ANY, &public_key)) {
     fprintf(stderr, "Could not load public key file `%s'\n", pub_filename);
     return FALSE;
   }
@@ -375,6 +381,7 @@ SilcBool silc_change_private_key_passphrase(const char *prv_filename,
 
   if (!silc_pkcs_load_private_key(prv_filename,
                                  (const unsigned char *)pass, strlen(pass),
+                                 SILC_PKCS_ANY,
                                  &private_key)) {
     memset(pass, 0, strlen(pass));
     silc_free(pass);
@@ -977,33 +984,19 @@ char *silc_id_render(void *id, SilcIdType id_type)
 {
   char tmp[100];
   unsigned char tmps[2];
-  char *cp;
 
   memset(rid, 0, sizeof(rid));
   switch(id_type) {
   case SILC_ID_SERVER:
     {
       SilcServerID *server_id = (SilcServerID *)id;
-      if (server_id->ip.data_len > 4) {
-#ifdef HAVE_IPV6
-       struct sockaddr_in6 ipv6;
-       memset(&ipv6, 0, sizeof(ipv6));
-       ipv6.sin6_family = AF_INET6;
-       memmove(&ipv6.sin6_addr, server_id->ip.data, sizeof(ipv6.sin6_addr));
-       if (!getnameinfo((struct sockaddr *)&ipv6, sizeof(ipv6),
-                        tmp, sizeof(tmp) - 1, NULL, 0, NI_NUMERICHOST))
-         _PUT_STRING(rid, tmp);
-#endif
-      } else {
-       struct in_addr ipv4;
-       memmove(&ipv4.s_addr, server_id->ip.data, 4);
-       cp = inet_ntoa(ipv4);
-       if (cp)
-         _PUT_STRING(rid, cp);
-      }
+
+      if (!silc_net_bin2addr(server_id->ip.data, server_id->ip.data_len,
+                            tmp, sizeof(tmp)))
+       return NULL;
 
       memset(tmp, 0, sizeof(tmp));
-      silc_snprintf(tmp, sizeof(tmp) - 1, ",%d,", ntohs(server_id->port));
+      silc_snprintf(tmp, sizeof(tmp) - 1, ",%d,", silc_ntohs(server_id->port));
       _PUT_STRING(rid, tmp);
       SILC_PUT16_MSB(server_id->rnd, tmps);
       memset(tmp, 0, sizeof(tmp));
@@ -1014,23 +1007,10 @@ char *silc_id_render(void *id, SilcIdType id_type)
   case SILC_ID_CLIENT:
     {
       SilcClientID *client_id = (SilcClientID *)id;
-      if (client_id->ip.data_len > 4) {
-#ifdef HAVE_IPV6
-       struct sockaddr_in6 ipv6;
-       memset(&ipv6, 0, sizeof(ipv6));
-       ipv6.sin6_family = AF_INET6;
-       memmove(&ipv6.sin6_addr, client_id->ip.data, sizeof(ipv6.sin6_addr));
-       if (!getnameinfo((struct sockaddr *)&ipv6, sizeof(ipv6),
-                        tmp, sizeof(tmp) - 1, NULL, 0, NI_NUMERICHOST))
-         _PUT_STRING(rid, tmp);
-#endif
-      } else {
-       struct in_addr ipv4;
-       memmove(&ipv4.s_addr, client_id->ip.data, 4);
-       cp = inet_ntoa(ipv4);
-       if (cp)
-         _PUT_STRING(rid, cp);
-      }
+
+      if (!silc_net_bin2addr(client_id->ip.data, client_id->ip.data_len,
+                            tmp, sizeof(tmp)))
+       return NULL;
 
       memset(tmp, 0, sizeof(tmp));
       silc_snprintf(tmp, sizeof(tmp) - 1, ",%02x,", client_id->rnd);
@@ -1045,26 +1025,14 @@ char *silc_id_render(void *id, SilcIdType id_type)
   case SILC_ID_CHANNEL:
     {
       SilcChannelID *channel_id = (SilcChannelID *)id;
-      if (channel_id->ip.data_len > 4) {
-#ifdef HAVE_IPV6
-       struct sockaddr_in6 ipv6;
-       memset(&ipv6, 0, sizeof(ipv6));
-       ipv6.sin6_family = AF_INET6;
-       memmove(&ipv6.sin6_addr, channel_id->ip.data, sizeof(ipv6.sin6_addr));
-       if (!getnameinfo((struct sockaddr *)&ipv6, sizeof(ipv6),
-                        tmp, sizeof(tmp) - 1, NULL, 0, NI_NUMERICHOST))
-         _PUT_STRING(rid, tmp);
-#endif
-      } else {
-       struct in_addr ipv4;
-       memmove(&ipv4.s_addr, channel_id->ip.data, 4);
-       cp = inet_ntoa(ipv4);
-       if (cp)
-         _PUT_STRING(rid, cp);
-      }
+
+      if (!silc_net_bin2addr(channel_id->ip.data, channel_id->ip.data_len,
+                            tmp, sizeof(tmp)))
+       return NULL;
 
       memset(tmp, 0, sizeof(tmp));
-      silc_snprintf(tmp, sizeof(tmp) - 1, ",%d,", ntohs(channel_id->port));
+      silc_snprintf(tmp, sizeof(tmp) - 1, ",%d,",
+                   silc_ntohs(channel_id->port));
       _PUT_STRING(rid, tmp);
       SILC_PUT16_MSB(channel_id->rnd, tmps);
       memset(tmp, 0, sizeof(tmp));
index 831970d5dd940e3b298795f8863e2fbbe91b396a..f549b770b4a3a007efb24e3a02a1af4c090eb6e5 100644 (file)
@@ -4,7 +4,7 @@
 
   Author: Pekka Riikonen <priikone@silcnet.org>
 
-  Copyright (C) 2000 - 2007 Pekka Riikonen
+  Copyright (C) 2000 - 2008 Pekka Riikonen
 
   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
@@ -78,15 +78,15 @@ SilcIDCache silc_idcache_alloc(SilcUInt32 count, SilcIdType id_type,
   if (!cache)
     return NULL;
 
-  cache->id_table = silc_hash_table_alloc(count, silc_hash_id,
+  cache->id_table = silc_hash_table_alloc(NULL, count, silc_hash_id,
                                          SILC_32_TO_PTR(id_type),
                                          silc_hash_id_compare,
                                          SILC_32_TO_PTR(id_type),
                                          NULL, NULL, TRUE);
-  cache->name_table = silc_hash_table_alloc(count, silc_hash_utf8_string, NULL,
-                                           silc_hash_utf8_compare, NULL,
+  cache->name_table = silc_hash_table_alloc(NULL, count, silc_hash_utf8_string,
+                                           NULL, silc_hash_utf8_compare, NULL,
                                            NULL, NULL, TRUE);
-  cache->context_table = silc_hash_table_alloc(count, silc_hash_ptr, NULL,
+  cache->context_table = silc_hash_table_alloc(NULL, count, silc_hash_ptr, NULL,
                                               NULL, NULL, NULL, NULL, TRUE);
   cache->destructor = destructor;
   cache->context = destructor_context;
diff --git a/lib/silcasn1/DIRECTORY b/lib/silcasn1/DIRECTORY
deleted file mode 100644 (file)
index 9cc7168..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-<!--
-@LIBRARY=SILC ASN.1 Library
-@FILENAME=silcasn1lib.html
-@LINK=silcasn1.html:SILC ASN.1 Interface
-@LINK=silcber.html:SILC BER interface
--->
-
-<big><b>SILC ASN.1 Library</b></big>
-<br />
-<small>Directory: lib/silcasn1/</small>
-<br />
-<small>Library: libsilc.a, libsilc.lib</small>
-<br /><br />
-<b>Introduction</b>
-
-<br /><br />
-SILC Abstract Syntax Notation One (ASN.1) Library provides interface for
-efficient ASN.1 encoder and decoder.  The library also provides BER/DER
-encoder and decoder.
-
-<br /><br />
-@LINKS@
diff --git a/lib/silcasn1/Makefile.ad b/lib/silcasn1/Makefile.ad
deleted file mode 100644 (file)
index d266c85..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-#
-#  Makefile.ad
-#
-#  Author: Pekka Riikonen <priikone@silcnet.org>
-#
-#  Copyright (C) 2003 - 2005 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.
-#
-
-AUTOMAKE_OPTIONS = 1.0 no-dependencies foreign
-
-noinst_LTLIBRARIES = libsilcasn1.la
-
-libsilcasn1_la_SOURCES =       \
-       silcber.c               \
-       silcasn1.c              \
-       silcasn1_decode.c       \
-       silcasn1_encode.c
-
-#ifdef SILC_DIST_TOOLKIT
-include_HEADERS =      \
-       silcber.h       \
-       silcasn1.h      \
-       silcasn1_i.h
-
-SILC_EXTRA_DIST = tests
-#endif SILC_DIST_TOOLKIT
-
-EXTRA_DIST = *.h $(SILC_EXTRA_DIST)
-
-include $(top_srcdir)/Makefile.defines.in
diff --git a/lib/silcasn1/silcasn1.c b/lib/silcasn1/silcasn1.c
deleted file mode 100644 (file)
index 2e43b49..0000000
+++ /dev/null
@@ -1,195 +0,0 @@
-/*
-
-  silcasn1.c
-
-  Author: Pekka Riikonen <priikone@silcnet.org>
-
-  Copyright (C) 2003 - 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.
-
-*/
-
-#include "silc.h"
-#include "silcasn1.h"
-#include "silcber.h"
-
-/* Allocate ASN.1 context. */
-
-SilcAsn1 silc_asn1_alloc(void)
-{
-  SilcAsn1 asn1 = silc_calloc(1, sizeof(*asn1));
-  if (!asn1)
-    return NULL;
-
-  if (!silc_asn1_init(asn1))
-    return NULL;
-
-  return asn1;
-}
-
-/* Free ASN.1 context */
-
-void silc_asn1_free(SilcAsn1 asn1)
-{
-  silc_asn1_uninit(asn1);
-  silc_free(asn1);
-}
-
-/* Init pre-allocated ASN.1 context */
-
-SilcBool silc_asn1_init(SilcAsn1 asn1)
-{
-  asn1->stack1 = silc_stack_alloc(768);
-  if (!asn1->stack1)
-    return FALSE;
-
-  asn1->stack2 = silc_stack_alloc(768);
-  if (!asn1->stack2) {
-    silc_stack_free(asn1->stack1);
-    return FALSE;
-  }
-
-  asn1->accumul = 0;
-
-  return TRUE;
-}
-
-/* Uninit ASN.1 context */
-
-void silc_asn1_uninit(SilcAsn1 asn1)
-{
-  silc_stack_free(asn1->stack1);
-  silc_stack_free(asn1->stack2);
-}
-
-#if defined(SILC_DEBUG)
-/* Returns string representation of a tag */
-
-const char *silc_asn1_tag_name(SilcAsn1Tag tag)
-{
-  switch (tag) {
-  case SILC_ASN1_END:
-    return "END";
-  case SILC_ASN1_TAG_OPTS:
-    return "";
-  case SILC_ASN1_TAG_CHOICE:
-    return "choice";
-  case SILC_ASN1_TAG_ANY:
-    return "any";
-  case SILC_ASN1_TAG_ANY_PRIMITIVE:
-    return "any primitive";
-  case SILC_ASN1_TAG_SEQUENCE_OF:
-    return "sequence of";
-  case SILC_ASN1_TAG_SEQUENCE:
-    return "sequence";
-  case SILC_ASN1_TAG_SET:
-    return "set";
-  case SILC_ASN1_TAG_INTEGER:
-    return "integer";
-  case SILC_ASN1_TAG_SHORT_INTEGER:
-    return "short integer";
-  case SILC_ASN1_TAG_OID:
-    return "oid";
-  case SILC_ASN1_TAG_BOOLEAN:
-    return "boolean";
-  case SILC_ASN1_TAG_OCTET_STRING:
-    return "octet-string";
-  case SILC_ASN1_TAG_BIT_STRING:
-    return "bit-string";
-  case SILC_ASN1_TAG_NULL:
-    return "null";
-  case SILC_ASN1_TAG_ENUM:
-    return "enum";
-  case SILC_ASN1_TAG_UTC_TIME:
-    return "utc-time";
-  case SILC_ASN1_TAG_GENERALIZED_TIME:
-    return "generalized-time";
-  case SILC_ASN1_TAG_UTF8_STRING:
-    return "utf8-string";
-  case SILC_ASN1_TAG_NUMERIC_STRING:
-    return "numeric-string";
-  case SILC_ASN1_TAG_PRINTABLE_STRING:
-    return "printable-string";
-  case SILC_ASN1_TAG_IA5_STRING:
-    return "ia5-string";
-  case SILC_ASN1_TAG_VISIBLE_STRING:
-    return "visible-string";
-  case SILC_ASN1_TAG_UNIVERSAL_STRING:
-    return "universal-string";
-  case SILC_ASN1_TAG_UNRESTRICTED_STRING:
-    return "unrestricted-string";
-  case SILC_ASN1_TAG_BMP_STRING:
-    return "bmp-string";
-  case SILC_ASN1_TAG_ODE:
-    return "ode";
-  case SILC_ASN1_TAG_ETI:
-    return "eti";
-  case SILC_ASN1_TAG_REAL:
-    return "real";
-  case SILC_ASN1_TAG_EMBEDDED:
-    return "embedded";
-  case SILC_ASN1_TAG_ROI:
-    return "roi";
-  case SILC_ASN1_TAG_TELETEX_STRING:
-    return "teletex-string";
-  case SILC_ASN1_TAG_VIDEOTEX_STRING:
-    return "videotex-string";
-  case SILC_ASN1_TAG_GRAPHIC_STRING:
-    return "graphic-string";
-  case SILC_ASN1_TAG_GENERAL_STRING:
-    return "general-string";
-  default:
-    break;
-  }
-  return "unknown";
-}
-#endif /* SILC_DEBUG */
-
-#ifdef SILC_DIST_TOOLKIT
-#ifdef SILC_DEBUG
-/* Dumps the ASN.1 data block into standard output (stdout). */
-
-SilcBool silc_asn1_dump(SilcAsn1 asn1, SilcBuffer src)
-{
-  SilcBool ret = FALSE;
-  SilcBerEncoding renc;
-  SilcUInt32 rtag;
-  const unsigned char *rdata;
-  SilcUInt32 rdata_len, len = 0;
-  SilcBool rindef;
-
-  SILC_LOG_DEBUG(("Dumping ASN.1"));
-
-  while (silc_buffer_len(src)) {
-    /* Decode the BER block */
-    ret = silc_ber_decode(src, NULL, &renc, &rtag, &rdata,
-                         &rdata_len, &rindef, &len);
-    if (!ret) {
-      SILC_LOG_DEBUG(("Error parsing BER block, malformed ASN.1 data"));
-      return FALSE;
-    }
-
-    fprintf(stdout, "Type %s [%d]\n",
-           silc_asn1_tag_name(rtag), rtag);
-
-    if (renc == SILC_BER_ENC_PRIMITIVE)
-      len = len + rdata_len;
-    else
-      len = len;
-
-    if (len)
-      silc_buffer_pull(src, len);
-  }
-
-  return TRUE;
-}
-#endif /* SILC_DEBUG */
-#endif /* SILC_DIST_TOOLKIT */
diff --git a/lib/silcasn1/silcasn1.h b/lib/silcasn1/silcasn1.h
deleted file mode 100644 (file)
index df5bde1..0000000
+++ /dev/null
@@ -1,1194 +0,0 @@
-/*
-
-  silcasn1.h
-
-  Author: Pekka Riikonen <priikone@silcnet.org>
-
-  Copyright (C) 2003 - 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.
-
-*/
-
-/****h* silcasn1/ASN.1 Interface
- *
- * DESCRIPTION
- *
- * Efficient Abstract Syntax Notation One (ASN.1) implementation.  This
- * interface provides simple and efficient ASN.1 encoder and decoder.
- * The encoder directly encodes BER encoded data blocks from variable
- * argument list of ASN.1 types.  Multiple trees can be encoded at once
- * and multiple nodes can be encoded into the tree at once.  By default
- * encoder does not allocate any memory during encoding but a pre-allocated
- * SilcStack is used as memory.
- *
- * The decoder directly decodes BER encoded data blocks into the correct
- * types dictated by the variable argument list of ASN.1 types.  By
- * default decoder does not allocate any memory during decoding but a
- * pre-allocated SilcStack is used as memory.
- *
- * The encoding and decoding interface is simple.  silc_asn1_encode is used
- * to encode and silc_asn1_decode to decode.  The actual ASN.1 is defined
- * as variable argument list to the function.  Various macros can be used
- * to encode and decode different ASN.1 types.  All types may also be used
- * to encode and decode with various options (such as implicit and explicit
- * tagging and defining specific class option).
- *
- * The implementation supports all the common ASN.1 types.  This
- * implementation does not support advanced ASN.1 features like macros.
- *
- * References: ITU-T X.680 - X.693
- * http://www.itu.int/ITU-T/studygroups/com17/languages/
- *
- ***/
-
-#ifndef SILCASN1_H
-#define SILCASN1_H
-
-/****s* silcasn1/SilcASN1API/SilcAsn1
- *
- * NAME
- *
- *    typedef struct SilcAsn1Object *SilcAsn1;
- *
- * DESCRIPTION
- *
- *    This context is the actual ASN.1 encoder/decoder and is allocated
- *    by silc_asn1_alloc and given as argument to all silc_asn1_*
- *    functions.  It is freed by the silc_asn1_free function.  It is
- *    also possible to use pre-allocated ASN.1 context by using the
- *    SilcAsn1Struct instead of SilcAsn1.
- *
- ***/
-typedef struct SilcAsn1Object *SilcAsn1;
-
-/****s* silcasn1/SilcASN1API/SilcAsn1Struct
- *
- * NAME
- *
- *    typedef struct SilcAsn1Object SilcAsn1Struct;
- *
- * DESCRIPTION
- *
- *    This context is the actual ASN.1 encoder/decoder and can be
- *    used as pre-allocated ASN.1 context instead of SilcAsn1 context.
- *    This context is initialized with silc_asn1_init and uninitialized
- *    with silc_asn1_uninit.
- *
- ***/
-typedef struct SilcAsn1Object SilcAsn1Struct;
-
-/****d* silcasn1/SilcASN1API/SilcAsn1Options
- *
- * NAME
- *
- *    typedef enum { ... } SilcAsn1Options;
- *
- * DESCRIPTION
- *
- *    Options for ASN.1 encoder and decoder.  The ASN.1 options can be
- *    given to the SILC_ASN1_*_T macros and/or SILC_ASN1_OPTS macro.
- *
- * NOTES
- *
- *    The SILC_ASN1_ALLOC and SILC_ASN1_ACCUMUL flags can be given only
- *    with SILC_ASN1_OPTS macro.  Other options can be given with various
- *    SILC_ASN1_*_T macros.
- *
- * EXAMPLE
- *
- *    // Encodes boolean value with explicit tag and private class, and
- *    // the result is allocated into `dest'.
- *    silc_asn1_encode(asn1, &dest,
- *                     SILC_ASN1_OPTS(SILC_ASN1_ALLOC),
- *                     SILC_ASN1_BOOLEAN_T(SILC_ASN1_PRIVATE |
- *                                         SILC_ASN1_EXPLICIT, 100, boolval),
- *                     SILC_ASN1_END);
- *
- * SOURCE
- */
-typedef enum {
-  /* Default. If only this is set then defaults are implied. */
-  SILC_ASN1_DEFAULT      = 0x0000,
-
-  /* Class options.  User does not need to set these unless specificly
-     wanted to do so.  If SILC_ASN1_DEFAULT is set the SILC_ASN1_CONTEXT is
-     implied if any of the tag options are set.  Otherwise SILC_ASN1_UNIVERSAL
-     is implied. Only one of these can bet set at once. */
-  SILC_ASN1_UNIVERSAL    = 0x0001,       /* Universal class (default) */
-  SILC_ASN1_APP          = 0x0002,      /* Application specific class */
-  SILC_ASN1_CONTEXT      = 0x0003,      /* Context specific class */
-  SILC_ASN1_PRIVATE      = 0x0004,      /* Private class */
-
-  /* Tag options (bitmask) */
-  SILC_ASN1_IMPLICIT     = 0x0010,       /* Tag is implicit (default) */
-  SILC_ASN1_EXPLICIT     = 0x0020,      /* Tag is explicit */
-  SILC_ASN1_DEFINITE     = 0x0040,       /* Length is definite (default) */
-  SILC_ASN1_INDEFINITE   = 0x0080,      /* Length is indefinite */
-
-  /* Decoding options (bitmask) */
-  SILC_ASN1_OPTIONAL     = 0x0100,      /* Zero or more may be found.  The
-                                           argument must be pointer to the
-                                           type pointer so that NULL can be
-                                           returned if type is not found. */
-
-  /* ASN.1 encoder/decoder options (bitmask).  These can be given
-     only with SILC_ASN1_OPTS macro at the start of encoding/decoding. */
-  SILC_ASN1_ALLOC        = 0x0400,       /* Dynamically allocate results */
-  SILC_ASN1_ACCUMUL      = 0x0800,       /* Accumulate memory for results,
-                                           next call to silc_asn1_decode
-                                           will not cancel old results. */
-} SilcAsn1Options;
-/***/
-
-/****d* silcasn1/SilcASN1API/SilcAsn1Tag
- *
- * NAME
- *
- *    typedef enum { ... } SilcAsn1Tag;
- *
- * DESCRIPTION
- *
- *    Universal ASN.1 tags.  Usually these tags are given automatically
- *    to the silc_asn1_encode and silc_asn1_decode by using the various
- *    macros (such as SILC_ASN1_BOOLEAN).  Some macros may take the tag
- *    as additional argument.
- *
- * SOURCE
- */
-typedef enum {
-  SILC_ASN1_TAG_BOOLEAN               = 1,  /* SILC_ASN1_BOOLEAN */
-  SILC_ASN1_TAG_INTEGER               = 2,  /* SILC_ASN1_INT */
-  SILC_ASN1_TAG_BIT_STRING            = 3,  /* SILC_ASN1_BIT_STRING */
-  SILC_ASN1_TAG_OCTET_STRING          = 4,  /* SILC_ASN1_OCTET_STRING */
-  SILC_ASN1_TAG_NULL                  = 5,  /* SILC_ASN1_NULL */
-  SILC_ASN1_TAG_OID                   = 6,  /* SILC_ASN1_OID */
-  SILC_ASN1_TAG_ODE                   = 7,  /* not supported */
-  SILC_ASN1_TAG_ETI                   = 8,  /* not supported */
-  SILC_ASN1_TAG_REAL                  = 9,  /* not supported */
-  SILC_ASN1_TAG_ENUM                  = 10, /* SILC_ASN1_ENUM */
-  SILC_ASN1_TAG_EMBEDDED              = 11, /* not supported */
-  SILC_ASN1_TAG_UTF8_STRING           = 12, /* SILC_ASN1_UTF8_STRING */
-  SILC_ASN1_TAG_ROI                   = 13, /* not supported */
-  SILC_ASN1_TAG_SEQUENCE              = 16, /* SILC_ASN1_SEQUENCE */
-  SILC_ASN1_TAG_SET                   = 17, /* SILC_ASN1_SET */
-  SILC_ASN1_TAG_NUMERIC_STRING        = 18, /* SILC_ASN1_NUMERIC_STRING */
-  SILC_ASN1_TAG_PRINTABLE_STRING      = 19, /* SILC_ASN1_PRINTABLE_STRING */
-  SILC_ASN1_TAG_TELETEX_STRING        = 20, /* SILC_ASN1_TELETEX_STRING */
-  SILC_ASN1_TAG_VIDEOTEX_STRING       = 21, /* not supported */
-  SILC_ASN1_TAG_IA5_STRING            = 22, /* SILC_ASN1_IA5_STRING */
-  SILC_ASN1_TAG_UTC_TIME              = 23, /* SILC_ASN1_UTC_TIME */
-  SILC_ASN1_TAG_GENERALIZED_TIME      = 24, /* SILC_ASN1_GENERAL_STRING */
-  SILC_ASN1_TAG_GRAPHIC_STRING        = 25, /* not supported */
-  SILC_ASN1_TAG_VISIBLE_STRING        = 26, /* SILC_ASN1_VISIBLE_STRING */
-  SILC_ASN1_TAG_GENERAL_STRING        = 27, /* SILC_ASN1_GENERAL_STRING */
-  SILC_ASN1_TAG_UNIVERSAL_STRING      = 28, /* SILC_ASN1_UNIVERSAL_STRING */
-  SILC_ASN1_TAG_UNRESTRICTED_STRING   = 29, /* SILC_ASN1_UNRESTRICTED_STRING */
-  SILC_ASN1_TAG_BMP_STRING            = 30, /* SILC_ASN1_BMP_STRING */
-} SilcAsn1Tag;
-/***/
-
-#include "silcasn1_i.h"
-
-/****f* silcasn1/SilcASN1API/silc_asn1_alloc
- *
- * SYNOPSIS
- *
- *    SilcAsn1 silc_asn1_alloc(void);
- *
- * DESCRIPTION
- *
- *    Allocates and initializes ASN.1 encoder/decoder and returns SilcAsn1
- *    context or NULL on error.  This context can be used with both
- *    silc_asn1_encode and silc_asn1_decode functions.
- *
- *    Usually SilcAsn1 is allocated when encoder or decoder is needed,
- *    however it is also possible to allocate long-lasting SilcAsn1 and
- *    use that every time ASN.1 routines are needed.  Application could
- *    for example allocate one SilcAsn1 and use that for all ASN.1 encoding
- *    and decoding.
- *
- *    When this context is freed with silc_asn1_free all memory will be
- *    freed, and all encoded ASN.1 buffers becomes invalid.  Also all
- *    data that is returned by silc_asn1_decode function becomes invalid.
- *
- ***/
-SilcAsn1 silc_asn1_alloc(void);
-
-/****f* silcasn1/SilcASN1API/silc_asn1_free
- *
- * SYNOPSIS
- *
- *    void silc_asn1_free(SilcAsn1 asn1);
- *
- * DESCRIPTION
- *
- *    Frees the SilcAsn1 context and all allocated memory.  All encoded
- *    buffers and all decoded buffers with this context becomes invalid
- *    after this call.
- *
- ***/
-void silc_asn1_free(SilcAsn1 asn1);
-
-/****f* silcasn1/SilcASN1API/silc_asn1_init
- *
- * SYNOPSIS
- *
- *    SilcBool silc_asn1_init(SilcAsn1 asn1);
- *
- * DESCRIPTION
- *
- *    Initializes a pre-allocated SilcAsn1 context.  This call is
- *    equivalent to silc_asn1_alloc except that this takes the pre-allocated
- *    context as argument.
- *
- * EXAMPLE
- *
- *    SilcAsn1Struct asn1;
- *    if (!silc_asn1_init(&asn1))
- *      error;
- *
- ***/
-SilcBool silc_asn1_init(SilcAsn1 asn1);
-
-/****f* silcasn1/SilcASN1API/silc_asn1_uninit
- *
- * SYNOPSIS
- *
- *    void silc_asn1_uninit(SilcAsn1 asn1);
- *
- * DESCRIPTION
- *
- *    Uninitializes a pre-allocated SilcAsn1 context.  Use this function
- *    instead of silc_asn1_free if you used silc_asn1_init.
- *
- ***/
-void silc_asn1_uninit(SilcAsn1 asn1);
-
-/****f* silcasn1/SilcASN1API/silc_asn1_encode
- *
- * SYNOPSIS
- *
- *    SilcBool silc_asn1_encode(SilcAsn1 asn1, SilcBuffer dest, ...);
- *
- * DESCRIPTION
- *
- *    Encodes ASN.1 encoded buffer into `dest', from variable argument
- *    list of ASN.1 types.  The variable argument list forms the ASN.1
- *    trees and nodes that are encoded into the `dest'.  By default, the
- *    memory for `dest' is allocated from the `asn1', and the buffer becomes
- *    invalid either by calling silc_asn1_free, silc_asn1_uninit, or when
- *    silc_asn1_encode is called for the next time.
- *
- *    If the SILC_ASN1_OPTS macro with SILC_ASN1_ALLOC option is given then
- *    the `dest' is dynamically allocated and caller must free it by itself.
- *    Alternatively if SILC_ASN1_ACCUMUL is given then memory is accumulated
- *    from `asn1' for `dest' and it is freed only when silc_asn1_free or
- *    silc_asn1_uninit is called.  Next call to silc_asn1_encode will not
- *    cancel the previous result, but will accumulate more memory for new
- *    result.
- *
- *    The variable argument list is constructed by using various
- *    macros, for example SILC_ASN1_SEQUENCE, etc.  The variable argument
- *    list must always be ended with SILC_ASN1_END type.
- *
- *    If encoding is successful this returns TRUE, FALSE on error.
- *
- * EXAMPLE
- *
- *    silc_asn1_encode(asn1, buf,
- *                     SILC_ASN1_SEQUENCE,
- *                       SILC_ASN1_BOOLEAN(bool_val),
- *                       SILC_ASN1_OCTET_STRING(string, string_len),
- *                       SILC_ASN1_SEQUENCE_T(0, 2),
- *                         SILC_ASN1_BOOLEAN_T(SILC_ASN1_EXPLICIT, 100, foo),
- *                       SILC_ASN1_END,
- *                       SILC_ASN1_OCTET_STRING_T(0, 1, string2, string2_len),
- *                     SILC_ASN1_END, SILC_ASN1_END);
- *
- *    Creates ASN.1 tree that looks something like:
- *
- *    buf ::= SEQUENCE {
- *      bool_val      BOOLEAN,
- *      string        OCTET-STRING,
- *               [2]  SEQUENCE {
- *                      foo   [100] EXPLICIT BOOLEAN }
- *      string2  [1]  OCTET-STRING }
- *
- ***/
-SilcBool silc_asn1_encode(SilcAsn1 asn1, SilcBuffer dest, ...);
-
-/****f* silcasn1/SilcASN1API/silc_asn1_decode
- *
- * SYNOPSIS
- *
- *    SilcBool silc_asn1_decode(SilcAsn1 asn1, SilcBuffer src, ...);
- *
- * DESCRIPTION
- *
- *    Decodes the ASN.1 encoded buffer `src' by the ASN.1 types sent
- *    as argument.  The ASN.1 types sent as argument must be found from
- *    the `src' for this function to decode successfully.
- *
- *    The memory allocated for the results are allocated from `asn1' and
- *    they become invalid if `asn1' becomes invalid.  Next (second) call
- *    to this function does NOT invalidate the previous results.  However,
- *    third call to this function does invalidate the results of the first
- *    call but not second.  On the other hand, fourth call invalidates
- *    the results of the second call but not third, fifth call invalidates
- *    the results of the third call but not fourth, and so on.  This allows
- *    efficient decoding, when silc_asn1_decode must be called multiple times
- *    to decode all data, without new memory allocations.  However, caller
- *    must be cautios and understand that the every second call invalidates
- *    the results of every second previous results.
- *
- *    If the SILC_ASN1_OPTS macro with SILC_ASN1_ALLOC option is given then
- *    all results are dynamically allocated and caller must free them by
- *    itself. Alternatively if SILC_ASN1_ACCUMUL is given then memory is
- *    accumulated from `asn1' for results and they are freed only when the
- *    silc_asn1_free or silc_asn1_uninit is called.  Next calls to the
- *    silc_asn1_decode will NOT invalidate the old results, but will
- *    accumulate more memory for new results.  If the SILC_ASN1_OPTS is not
- *    given at all then the default allocation method (decribed above)
- *    applies.
- *
- *    If caller needs to store the results even after `asn1' becomes invalid
- *    then call must either use SILC_ASN1_ALLOC option or duplicate the
- *    results by itself.
- *
- * EXAMPLE
- *
- *    SilcBool bool_val, foo;
- *    unsigned char *string, string2;
- *    SilcUInt32 string_len, string2_len;
- *
- *    silc_asn1_decode(asn1, tree,
- *                     SILC_ASN1_SEQUENCE,
- *                       SILC_ASN1_BOOLEAN(&bool_val),
- *                       SILC_ASN1_OCTET_STRING(&string, &string_len),
- *                       SILC_ASN1_SEQUENCE_T(0, 2),
- *                         SILC_ASN1_BOOLEAN_T(SILC_ASN1_EXPLICIT, 100, &foo),
- *                       SILC_ASN1_END,
- *                       SILC_ASN1_OCTET_STRING_T(0, 1, &str2, &str2_len),
- *                     SILC_ASN1_END, SILC_ASN1_END);
- *
- ***/
-SilcBool silc_asn1_decode(SilcAsn1 asn1, SilcBuffer src, ...);
-
-/****f* silcasn1/SilcASN1API/SILC_ASN1_OPTS
- *
- * SYNOPSIS
- *
- *    SILC_ASN1_OPTS(opts)
- *
- * DESCRIPTION
- *
- *    The `opts' is SilcAsn1Options.  This macro can be used to set
- *    options for silc_asn1_encode and silc_asn1_decode functions.
- *
- * NOTES
- *
- *    Only the SILC_ASN1_ALLOC and SILC_ASN1_ACCUMUL flags may be
- *    set with this macro.
- *
- *    This macro must be the first macro in the variable argument list
- *    in the function.
- *
- * EXAMPLE
- *
- *    silc_asn1_decode(asn1, tree,
- *                     SILC_ASN1_OPTS(SILC_ASN1_ALLOC),
- *                     SILC_ASN1_SEQUENCE,
- *                       SILC_ASN1_BOOLEAN(&bool_val),
- *                       SILC_ASN1_OCTET_STRING(&string, &string_len),
- *                     SILC_ASN1_END, SILC_ASN1_END);
- *
- ***/
-#define SILC_ASN1_OPTS(opts) SILC_ASN1_TAG_OPTS, (opts)
-
-/****f* silcasn1/SilcASN1API/SILC_ASN1_ANY
- *
- * SYNOPSIS
- *
- *    Encoding:
- *    SILC_ASN1_ANY(buffer)
- *    SILC_ASN1_ANY_T(opts, tag, buffer)
- *
- *    Decoding:
- *    SILC_ASN1_ANY(&buffer)
- *    SILC_ASN1_ANY_T(opts, tag, buffer)
- *
- * DESCRIPTION
- *
- *    Macro used to encode or decode another ASN.1 node.  The buffer type
- *    is SilcBuffer.  This macro can be used for example to split large
- *    tree into multiple nodes, and then decoding the nodes separately from
- *    the buffers.
- *
- *    The `opts' is SilcAsn1Options.  The `tag' is a tag number.
- *
- * EXAMPLE
- *
- *    // Encode node of two boolean values
- *    silc_asn1_encode(asn1, node,
- *                     SILC_ASN1_BOOLEAN(val1),
- *                     SILC_ASN1_BOOLEAN(val2),
- *                     SILC_ASN1_END);
- *
- *    // Encode tree with the node
- *    silc_asn1_encode(asn1, tree,
- *                     SILC_ASN1_SEQUENCE_T(SILC_ASN1_PRIVATE, 101),
- *                       SILC_ASN1_ANY(node),
- *                       SILC_ASN1_BOOLEAN(boolval),
- *                     SILC_ASN1_END, SILC_ASN1_END);
- *
- ***/
-#define SILC_ASN1_ANY(x) SILC_ASN1_U1(ANY, x)
-#define SILC_ASN1_ANY_T(o, t, x) SILC_ASN1_T1(ANY, o, t, x)
-
-/****f* silcasn1/SilcASN1API/SILC_ASN1_ANY_PRIMITIVE
- *
- * SYNOPSIS
- *
- *    Encoding:
- *    SILC_ASN1_ANY_PRIMITIVE(tag, buffer)
- *    SILC_ASN1_ANY_PRIMITIVE_T(opts, tag, buffer)
- *
- *    Decoding:
- *    SILC_ASN1_ANY_PRIMITIVE(tag, &buffer)
- *    SILC_ASN1_ANY_PRIMITIVE_T(opts, tag, buffer)
- *
- * DESCRIPTION
- *
- *    Special macro used to encode pre-encoded primitive data blob.  The data
- *    can be any primitive type that is already encoded in correct format.
- *    The caller is responsible of making sure the data is formatted
- *    correctly.  When decoding this returns the raw data blob and the caller
- *    must know of what type and format it is.  The buffer type is SilcBuffer.
- *
- *    This macro can be used in cases when the data to be encoded is already
- *    in encoded format, and it only needs to be added to ASN.1 tree.  The
- *    SILC_ASN1_ANY cannot be used with primitives when tagging implicitly,
- *    in these cases this macro can be used.
- *
- *    The `opts' is SilcAsn1Options.  The `tag' is a tag number.
- *
- * EXAMPLE
- *
- *    // Get MP integer in encoded format
- *    mpbuf = mp_get_octet_string(mp);
- *
- *    // Encode the MP integer data to the tree
- *    silc_asn1_encode(asn1, tree,
- *                     SILC_ASN1_ANY_PRIMITIVE(SILC_ASN1_TAG_INTEGER, mpbuf),
- *                     SILC_ASN1_END);
- *
- *    // Decode the MP integer data from the tree
- *    silc_asn1_decode(asn1, tree,
- *                     SILC_ASN1_ANY_PRIMITIVE(SILC_ASN1_TAG_INTEGER, &buffer),
- *                     SILC_ASN1_END);
- *
- ***/
-#define SILC_ASN1_ANY_PRIMITIVE(t, x) SILC_ASN1_T1(ANY_PRIMITIVE, 0, t, x)
-#define SILC_ASN1_ANY_PRIMITIVE_T(o, t, x) SILC_ASN1_T1(ANY_PRIMITIVE, o, t, x)
-
-/****f* silcasn1/SilcASN1API/SILC_ASN1_SEQUENCE
- *
- * SYNOPSIS
- *
- *    Encoding:
- *    SILC_ASN1_SEQUENCE
- *    SILC_ASN1_SEQUENCE_T(opts, tag)
- *
- *    Decoding:
- *    SILC_ASN1_SEQUENCE
- *    SILC_ASN1_SEQUENCE_T(opts, tag)
- *
- * DESCRIPTION
- *
- *    Macro used to encode or decode sequence.  The sequence must be
- *    terminated with SILC_ASN1_END.
- *
- *    The `opts' is SilcAsn1Options.  The `tag' is a tag number.
- *
- * EXAMPLE
- *
- *    silc_asn1_encode(asn1, tree,
- *                     SILC_ASN1_SEQUENCE,
- *                       SILC_ASN1_ANY(node),
- *                       SILC_ASN1_BOOLEAN(boolval),
- *                     SILC_ASN1_END, SILC_ASN1_END);
- *
- ***/
-#define SILC_ASN1_SEQUENCE SILC_ASN1_U0(SEQUENCE)
-#define SILC_ASN1_SEQUENCE_T(o, t) SILC_ASN1_T0(SEQUENCE, o, t)
-
-/****f* silcasn1/SilcASN1API/SILC_ASN1_SET
- *
- * SYNOPSIS
- *
- *    Encoding:
- *    SILC_ASN1_SET
- *    SILC_ASN1_SET_T(opts, tag)
- *
- *    Decoding:
- *    SILC_ASN1_SET
- *    SILC_ASN1_SET_T(opts, tag)
- *
- * DESCRIPTION
- *
- *    Macro used to encode or decode set.  The set must be terminated
- *    with SILC_ASN1_END.
- *
- *    The `opts' is SilcAsn1Options.  The `tag' is a tag number.
- *
- * EXAMPLE
- *
- *    silc_asn1_encode(asn1, tree,
- *                     SILC_ASN1_SET_T(SILC_ASN1_EXPLICIT, 0),
- *                       SILC_ASN1_BOOLEAN(boolval),
- *                     SILC_ASN1_END, SILC_ASN1_END);
- *
- ***/
-#define SILC_ASN1_SET SILC_ASN1_U0(SET)
-#define SILC_ASN1_SET_T(o, t) SILC_ASN1_T0(SET, o, t)
-
-/****f* silcasn1/SilcASN1API/SILC_ASN1_SEQUENCE_OF
- *
- * SYNOPSIS
- *
- *    Decoding:
- *    SILC_ASN1_SEQUENCE_OF(bufarray, numbufs)
- *
- * DESCRIPTION
- *
- *    Macro used to decode sequence of specified type.  This returns
- *    an array of SilcBuffers and number of buffers in the array.  The
- *    SILC_ASN1_CHOICE macro may also be used with this macro.
- *
- * NOTES
- *
- *    This macro must be used either with SILC_ASN1_ALLOC or SILC_ASN1_ACCUMUL
- *    flags.  Do not use this macro without flags.
- *
- * EXAMPLE
- *
- *     SilcBuffer bufs;
- *     SilcUInt32 count;
- *
- *     // Decode sequence of sequences.  Each returned buffer in the array
- *     // is a sequence.
- *     silc_asn1_decode(asn1, exts,
- *                      SILC_ASN1_OPTS(SILC_ASN1_ACCUMUL),
- *                      SILC_ASN1_SEQUENCE_OF(&bufs, &count),
- *                        SILC_ASN1_TAG_SEQUENCE,
- *                      SILC_ASN1_END, SILC_ASN1_END);
- *
- ***/
-#define SILC_ASN1_SEQUENCE_OF(x, c) SILC_ASN1_U2(SEQUENCE_OF, x, c)
-
-/****f* silcasn1/SilcASN1API/SILC_ASN1_SET_OF
- *
- * SYNOPSIS
- *
- *    Decoding:
- *    SILC_ASN1_SET_OF(bufarray, numbufs)
- *
- * DESCRIPTION
- *
- *    Macro used to decode set of specified type.  This returns
- *    an array of SilcBuffers and number of buffers in the array.  The
- *    SILC_ASN1_CHOICE macro may also be used with this macro.
- *
- * NOTES
- *
- *    This macro must be used either with SILC_ASN1_ALLOC or SILC_ASN1_ACCUMUL
- *    flags.  Do not use this macro without flags.
- *
- * EXAMPLE
- *
- *     // Decode set of sequences.  Each returned buffer in the array
- *     // is a sequence.
- *     silc_asn1_decode(asn1, exts,
- *                      SILC_ASN1_OPTS(SILC_ASN1_ALLOC),
- *                      SILC_ASN1_SET_OF(&bufs, &count),
- *                        SILC_ASN1_TAG_SEQUENCE,
- *                      SILC_ASN1_END, SILC_ASN1_END);
- *
- ***/
-#define SILC_ASN1_SET_OF(x, c) SILC_ASN1_U2(SEQUENCE_OF, x, c)
-
-/****f* silcasn1/SilcASN1API/SILC_ASN1_CHOICE
- *
- * SYNOPSIS
- *
- *    Decoding:
- *    SILC_ASN1_CHOICE
- *
- * DESCRIPTION
- *
- *    Macro used to specify choices in decoding.  The choice list must
- *    be terminated with SILC_ASN1_END.  There is no limit how many choices
- *    can be specified in the list.
- *
- * EXAMPLE
- *
- *    // Decode timeval that is either UTC or generalized time
- *    silc_asn1_decode(asn1, tree,
- *                     SILC_ASN1_SEQUENCE,
- *                       SILC_ASN1_CHOICE,
- *                         SILC_ASN1_UTC_TIME(&timeval),
- *                         SILC_ASN1_GEN_TIME(&timeval),
- *                       SILC_ASN1_END,
- *                     SILC_ASN1_END, SILC_ASN1_END);
- *
- ***/
-#define SILC_ASN1_CHOICE SILC_ASN1_U0(CHOICE)
-
-/****f* silcasn1/SilcASN1API/SILC_ASN1_BOOLEAN
- *
- * SYNOPSIS
- *
- *    Encoding:
- *    SILC_ASN1_BOOLEAN(boolval)
- *    SILC_ASN1_BOOLEAN_T(opts, tag, boolval)
- *
- *    Decoding:
- *    SILC_ASN1_BOOLEAN(&boolval)
- *    SILC_ASN1_BOOLEAN_T(opts, tag, &boolval)
- *
- * DESCRIPTION
- *
- *    Macro used to encode or decode boolean value.  The boolean type
- *    is SilcBool.
- *
- *    The `opts' is SilcAsn1Options.  The `tag' is a tag number.
- *
- ***/
-#define SILC_ASN1_BOOLEAN(x) SILC_ASN1_U1(BOOLEAN, x)
-#define SILC_ASN1_BOOLEAN_T(o, t, x) SILC_ASN1_T1(BOOLEAN, o, t, x)
-
-/****f* silcasn1/SilcASN1API/SILC_ASN1_INT
- *
- * SYNOPSIS
- *
- *    Encoding:
- *    SILC_ASN1_INT(integer)
- *    SILC_ASN1_INT_T(opts, tag, &integer)
- *
- *    Decoding:
- *    SILC_ASN1_INT(&integer)
- *    SILC_ASN1_INT_T(opts, tag, &integer);
- *
- * DESCRIPTION
- *
- *    Macro used to encode or decode multiple precision integer.  The
- *    integer type is SilcMPInt.
- *
- *    The `opts' is SilcAsn1Options.  The `tag' is a tag number.
- *
- ***/
-#define SILC_ASN1_INT(x) SILC_ASN1_U1(INTEGER, x)
-#define SILC_ASN1_INT_T(o, t, x) SILC_ASN1_T1(INTEGER, o, t, x)
-
-/****f* silcasn1/SilcASN1API/SILC_ASN1_SHORT_INT
- *
- * SYNOPSIS
- *
- *    Encoding:
- *    SILC_ASN1_SHORT_INT(integer)
- *    SILC_ASN1_SHORT_INT_T(opts, tag, &integer)
- *
- *    Decoding:
- *    SILC_ASN1_SHORT_INT(&integer)
- *    SILC_ASN1_SHORT_INT_T(opts, tag, &integer);
- *
- * DESCRIPTION
- *
- *    Macro used to encode or decode short integer (32 bits).  The
- *    integer type is SilcUInt32.
- *
- *    The `opts' is SilcAsn1Options.  The `tag' is a tag number.
- *
- ***/
-#define SILC_ASN1_SHORT_INT(x) SILC_ASN1_U1(SHORT_INTEGER, x)
-#define SILC_ASN1_SHORT_INT_T(o, t, x) SILC_ASN1_T1(SHORT_INTEGER, o, t, x)
-
-/****f* silcasn1/SilcASN1API/SILC_ASN1_ENUM
- *
- * SYNOPSIS
- *
- *    Encoding:
- *    SILC_ASN1_ENUM(enum)
- *    SILC_ASN1_ENUM_T(opts, tag, &enum)
- *
- *    Decoding:
- *    SILC_ASN1_ENUM(&enum)
- *    SILC_ASN1_ENUM_T(opts, tag, &enum);
- *
- * DESCRIPTION
- *
- *    Macro used to encode or decode enumeration value.  The enumeration
- *    type is SilcMPInt.
- *
- *    The `opts' is SilcAsn1Options.  The `tag' is a tag number.
- *
- ***/
-#define SILC_ASN1_ENUM(x) SILC_ASN1_U1(ENUM, x)
-#define SILC_ASN1_ENUM_T(o, t, x) SILC_ASN1_T1(ENUM, o, t, x)
-
-/****f* silcasn1/SilcASN1API/SILC_ASN1_BIT_STRING
- *
- * SYNOPSIS
- *
- *    Encoding:
- *    SILC_ASN1_BIT_STRING(str, str_len)
- *    SILC_ASN1_BIT_STRING_T(opts, tag, str, str_len)
- *
- *    Decoding:
- *    SILC_ASN1_BIT_STRING(&str, &str_len)
- *    SILC_ASN1_BIT_STRING_T(opts, tag, &str, &str_len)
- *
- * DESCRIPTION
- *
- *    Macro used to encode or decode bit string.  The string length in
- *    encoding must be in bits (bytes * 8).  The decoded length is in
- *    bits as well.  The string type is unsigned char and string length
- *    SilcUInt32.
- *
- *    The `opts' is SilcAsn1Options.  The `tag' is a tag number.
- *
- ***/
-#define SILC_ASN1_BIT_STRING(x, xl) SILC_ASN1_U2(BIT_STRING, x, xl)
-#define SILC_ASN1_BIT_STRING_T(o, t, x, xl) SILC_ASN1_T2(BIT_STRING, o, t, x, xl)
-
-/****f* silcasn1/SilcASN1API/SILC_ASN1_NULL
- *
- * SYNOPSIS
- *
- *    Encoding:
- *    SILC_ASN1_NULL
- *    SILC_ASN1_NULL_T(opts, tag)
- *
- *    Decoding:
- *    SILC_ASN1_NULL
- *    SILC_ASN1_NULL_T(opts, tag)
- *
- * DESCRIPTION
- *
- *    Macro used to encode or decode null value.
- *
- *    The `opts' is SilcAsn1Options.  The `tag' is a tag number.
- *
- ***/
-#define SILC_ASN1_NULL SILC_ASN1_U0(NULL)
-#define SILC_ASN1_NULL_T(o, t) SILC_ASN1_T0(NULL, 0, t)
-
-/****f* silcasn1/SilcASN1API/SILC_ASN1_OID
- *
- * SYNOPSIS
- *
- *    Encoding:
- *    SILC_ASN1_OID(oid)
- *    SILC_ASN1_OID_T(opts, tag, oid)
- *
- *    Decoding:
- *    SILC_ASN1_OID(&oid)
- *    SILC_ASN1_OID_T(opts, tag, &oid)
- *
- * DESCRIPTION
- *
- *    Macro used to encode or decode OID string.  The OID string type
- *    is NULL terminated char.  Its length can be determinted with strlen().
- *
- *    The `opts' is SilcAsn1Options.  The `tag' is a tag number.
- *
- ***/
-#define SILC_ASN1_OID(x) SILC_ASN1_U1(OID, x)
-#define SILC_ASN1_OID_T(o, t, x) SILC_ASN1_UT(OID, o, t, x)
-
-/****f* silcasn1/SilcASN1API/SILC_ASN1_OCTET_STRING
- *
- * SYNOPSIS
- *
- *    Encoding:
- *    SILC_ASN1_OCTET_STRING(str, str_len)
- *    SILC_ASN1_OCTET_STRING_T(opts, tag, str, str_len)
- *
- *    Decoding:
- *    SILC_ASN1_OCTET_STRING(&str, &str_len)
- *    SILC_ASN1_OCTET_STRING_T(opts, tag, &str, &str_len)
- *
- * DESCRIPTION
- *
- *    Macro used to encode or decode octet string.  The string type is
- *    unsigned char and string length SilcUInt32.  Octet string is
- *    considered to be 8-bit unsigned binary data.
- *
- *    The `opts' is SilcAsn1Options.  The `tag' is a tag number.
- *
- ***/
-#define SILC_ASN1_OCTET_STRING(x, xl) SILC_ASN1_U2(OCTET_STRING, x, xl)
-#define SILC_ASN1_OCTET_STRING_T(o, t, x, xl) SILC_ASN1_T2(OCTET_STRING, o, t, x, xl)
-
-/****f* silcasn1/SilcASN1API/SILC_ASN1_UTF8_STRING
- *
- * SYNOPSIS
- *
- *    Encoding:
- *    SILC_ASN1_UTF8_STRING(str, str_len)
- *    SILC_ASN1_UTF8_STRING_T(opts, tag, str, str_len)
- *
- *    Decoding:
- *    SILC_ASN1_UTF8_STRING(&str, &str_len)
- *    SILC_ASN1_UTF8_STRING_T(opts, tag, &str, &str_len)
- *
- * DESCRIPTION
- *
- *    Macro used to encode or decode UTF-8 string.  The string type is
- *    unsigned char and string length SilcUInt32.
- *
- *    The `opts' is SilcAsn1Options.  The `tag' is a tag number.
- *
- * NOTES
- *
- *    The string must be in UTF-8 encoding when encoding.  The decoded
- *    string will be in UTF-8 encoding.  The data is also encoded to
- *    or decoded from UTF-8.
- *
- ***/
-#define SILC_ASN1_UTF8_STRING(x, xl) SILC_ASN1_U2(UTF8_STRING, x, xl)
-#define SILC_ASN1_UTF8_STRING_T(o, t, x, xl) SILC_ASN1_T2(UTF8_STRING, o, t, x, xl)
-
-/****f* silcasn1/SilcASN1API/SILC_ASN1_NUMERIC_STRING
- *
- * SYNOPSIS
- *
- *    Encoding:
- *    SILC_ASN1_NUMERIC_STRING(str, str_len)
- *    SILC_ASN1_NUMERIC_STRING_T(opts, tag, str, str_len)
- *
- *    Decoding:
- *    SILC_ASN1_NUMERIC_STRING(&str, &str_len)
- *    SILC_ASN1_NUMERIC_STRING_T(opts, tag, &str, &str_len)
- *
- * DESCRIPTION
- *
- *    Macro used to encode or decode numerical string.  The string type is
- *    unsigned char and string length SilcUInt32.
- *
- *    The `opts' is SilcAsn1Options.  The `tag' is a tag number.
- *
- * NOTES
- *
- *    The string must be in UTF-8 encoding when encoding.  The decoded
- *    string will be in UTF-8 encoding.  The actual data is encoded to
- *    or decoded from numerical.
- *
- ***/
-#define SILC_ASN1_NUMERIC_STRING(x, xl) SILC_ASN1_U2(NUMERIC_STRING, x, xl)
-#define SILC_ASN1_NUMERIC_STRING_T(o, t, x, xl) SILC_ASN1_T2(NUMERIC_STRING, o, t, x, xl)
-
-/****f* silcasn1/SilcASN1API/SILC_ASN1_PRINTABLE_STRING
- *
- * SYNOPSIS
- *
- *    Encoding:
- *    SILC_ASN1_PRINTABLE_STRING(str, str_len)
- *    SILC_ASN1_PRINTABLE_STRING_T(opts, tag, str, str_len)
- *
- *    Decoding:
- *    SILC_ASN1_PRINTABLE_STRING(&str, &str_len)
- *    SILC_ASN1_PRINTABLE_STRING_T(opts, tag, &str, &str_len)
- *
- * DESCRIPTION
- *
- *    Macro used to encode or decode printable string.  The string type is
- *    unsigned char and string length SilcUInt32.
- *
- *    The `opts' is SilcAsn1Options.  The `tag' is a tag number.
- *
- * NOTES
- *
- *    The string must be in UTF-8 encoding when encoding.  The decoded
- *    string will be in UTF-8 encoding.  The actual data is encoded to
- *    or decoded from printable.
- *
- ***/
-#define SILC_ASN1_PRINTABLE_STRING(x, xl) SILC_ASN1_U2(PRINTABLE_STRING, x, xl)
-#define SILC_ASN1_PRINTABLE_STRING_T(o, t, x, xl) SILC_ASN1_T2(PRINTABLE_STRING, o, t, x, xl)
-
-/****f* silcasn1/SilcASN1API/SILC_ASN1_TELETEX_STRING
- *
- * SYNOPSIS
- *
- *    Encoding:
- *    SILC_ASN1_TELETEX_STRING(str, str_len)
- *    SILC_ASN1_TELETEX_STRING_T(opts, tag, str, str_len)
- *
- *    Decoding:
- *    SILC_ASN1_TELETEX_STRING(&str, &str_len)
- *    SILC_ASN1_TELETEX_STRING_T(opts, tag, &str, &str_len)
- *
- * DESCRIPTION
- *
- *    Macro used to encode or decode teletex (T61) string.  The string type is
- *    unsigned char and string length SilcUInt32.
- *
- *    The `opts' is SilcAsn1Options.  The `tag' is a tag number.
- *
- * NOTES
- *
- *    The string must be in UTF-8 encoding when encoding.  The decoded
- *    string will be in UTF-8 encoding.  The actual data is encoded to
- *    or decoded from teletex (T61).
- *
- ***/
-#define SILC_ASN1_TELETEX_STRING(x, xl) SILC_ASN1_U2(TELETEX_STRING, x, xl)
-#define SILC_ASN1_TELETEX_STRING_T(o, t, x, xl) SILC_ASN1_T2(TELETEX_STRING, o, t, x, xl)
-
-/****f* silcasn1/SilcASN1API/SILC_ASN1_IA5_STRING
- *
- * SYNOPSIS
- *
- *    Encoding:
- *    SILC_ASN1_IA5_STRING(str, str_len)
- *    SILC_ASN1_IA5_STRING_T(opts, tag, str, str_len)
- *
- *    Decoding:
- *    SILC_ASN1_IA5_STRING(&str, &str_len)
- *    SILC_ASN1_IA5_STRING_T(opts, tag, &str, &str_len)
- *
- * DESCRIPTION
- *
- *    Macro used to encode or decode US ASCII (IA5) string.  The string type
- *    is unsigned char and string length SilcUInt32.
- *
- *    The `opts' is SilcAsn1Options.  The `tag' is a tag number.
- *
- * NOTES
- *
- *    The string must be in UTF-8 encoding when encoding.  The decoded
- *    string will be in UTF-8 encoding.  The actual data is encoded to
- *    or decoded from US ASCII (IA5).
- *
- ***/
-#define SILC_ASN1_IA5_STRING(x, xl) SILC_ASN1_U2(IA5_STRING, x, xl)
-#define SILC_ASN1_IA5_STRING_T(o, t, x, xl) SILC_ASN1_T2(IA5_STRING, o, t, x, xl)
-
-/****f* silcasn1/SilcASN1API/SILC_ASN1_VISIBLE_STRING
- *
- * SYNOPSIS
- *
- *    Encoding:
- *    SILC_ASN1_VISIBLE_STRING(str, str_len)
- *    SILC_ASN1_VISIBLE_STRING_T(opts, tag, str, str_len)
- *
- *    Decoding:
- *    SILC_ASN1_VISIBLE_STRING(&str, &str_len)
- *    SILC_ASN1_VISIBLE_STRING_T(opts, tag, &str, &str_len)
- *
- * DESCRIPTION
- *
- *    Macro used to encode or decode visible string.  The string type is
- *    unsigned char and string length SilcUInt32.
- *
- *    The `opts' is SilcAsn1Options.  The `tag' is a tag number.
- *
- * NOTES
- *
- *    The string must be in UTF-8 encoding when encoding.  The decoded
- *    string will be in UTF-8 encoding.  The actual data is encoded to
- *    or decoded from visible.
- *
- ***/
-#define SILC_ASN1_VISIBLE_STRING(x, xl) SILC_ASN1_U2(VISIBLE_STRING, x, xl)
-#define SILC_ASN1_VISIBLE_STRING_T(o, t, x, xl) SILC_ASN1_T2(VISIBLE_STRING, o, t, x, xl)
-
-/****f* silcasn1/SilcASN1API/SILC_ASN1_UNIVERSAL_STRING
- *
- * SYNOPSIS
- *
- *    Encoding:
- *    SILC_ASN1_UNIVERSAL_STRING(str, str_len)
- *    SILC_ASN1_UNIVERSAL_STRING_T(opts, tag, str, str_len)
- *
- *    Decoding:
- *    SILC_ASN1_UNIVERSAL_STRING(&str, &str_len)
- *    SILC_ASN1_UNIVERSAL_STRING_T(opts, tag, &str, &str_len)
- *
- * DESCRIPTION
- *
- *    Macro used to encode or decode universal (UCS-4) string.  The string
- *    type is unsigned char and string length SilcUInt32.
- *
- *    The `opts' is SilcAsn1Options.  The `tag' is a tag number.
- *
- * NOTES
- *
- *    The string must be in UTF-8 encoding when encoding.  The decoded
- *    string will be in UTF-8 encoding.  The actual data is encoded to
- *    or decoded from universal (UCS-4).
- *
- ***/
-#define SILC_ASN1_UNIVERSAL_STRING(x, xl) SILC_ASN1_U2(UNIVERSAL_STRING, x, xl)
-#define SILC_ASN1_UNIVERSAL_STRING_T(o, t, x, xl) SILC_ASN1_T2(UNIVERSAL_STRING, o, t, x, xl)
-
-/****f* silcasn1/SilcASN1API/SILC_ASN1_BMP_STRING
- *
- * SYNOPSIS
- *
- *    Encoding:
- *    SILC_ASN1_BMP_STRING(str, str_len)
- *    SILC_ASN1_BMP_STRING_T(opts, tag, str, str_len)
- *
- *    Decoding:
- *    SILC_ASN1_BMP_STRING(&str, &str_len)
- *    SILC_ASN1_BMP_STRING_T(opts, tag, &str, &str_len)
- *
- * DESCRIPTION
- *
- *    Macro used to encode or decode BMP (UCS-2) string.  The string type is
- *    unsigned char and string length SilcUInt32.
- *
- *    The `opts' is SilcAsn1Options.  The `tag' is a tag number.
- *
- * NOTES
- *
- *    The string must be in UTF-8 encoding when encoding.  The decoded
- *    string will be in UTF-8 encoding.  The actual data is encoded to
- *    or decoded from BMP (UCS-2)
- *
- ***/
-#define SILC_ASN1_BMP_STRING(x, xl) SILC_ASN1_U2(BMP_STRING, x, xl)
-#define SILC_ASN1_BMP_STRING_T(o, t, x, xl) SILC_ASN1_T2(BMP_STRING, o, t, x, xl)
-
-/****f* silcasn1/SilcASN1API/SILC_ASN1_UNRESTRICTED_STRING
- *
- * SYNOPSIS
- *
- *    Encoding:
- *    SILC_ASN1_UNRESTRICTED_STRING(str, str_len)
- *    SILC_ASN1_UNRESTRICTED_STRING_T(opts, tag, str, str_len)
- *
- *    Decoding:
- *    SILC_ASN1_UNRESTRICTED_STRING(&str, &str_len)
- *    SILC_ASN1_UNRESTRICTED_STRING_T(opts, tag, &str, &str_len)
- *
- * DESCRIPTION
- *
- *    Macro used to encode or decode unrestricted string.  The string type is
- *    unsigned char and string length SilcUInt32.
- *
- *    The `opts' is SilcAsn1Options.  The `tag' is a tag number.
- *
- * NOTES
- *
- *    The string must be in UTF-8 encoding when encoding.  The decoded
- *    string will be in UTF-8 encoding.  The actual data is encoded to
- *    or decoded from unrestricted.  NOTE: this implementation use 8-bit ASCII.
- *
- ***/
-#define SILC_ASN1_UNRESTRICTED_STRING(x, xl) SILC_ASN1_U2(UNRESTRICTED_STRING, x, xl)
-#define SILC_ASN1_UNRESTRICTED_STRING_T(o, t, x, xl) SILC_ASN1_T2(UNRESTRICTED_STRING, o, t, x, xl)
-
-/****f* silcasn1/SilcASN1API/SILC_ASN1_GENERAL_STRING
- *
- * SYNOPSIS
- *
- *    Encoding:
- *    SILC_ASN1_GENERAL_STRING(str, str_len)
- *    SILC_ASN1_GENERAL_STRING_T(opts, tag, str, str_len)
- *
- *    Decoding:
- *    SILC_ASN1_GENERAL_STRING(&str, &str_len)
- *    SILC_ASN1_GENERAL_STRING_T(opts, tag, &str, &str_len)
- *
- * DESCRIPTION
- *
- *    Macro used to encode or decode general string.  The string type is
- *    unsigned char and string length SilcUInt32.
- *
- *    The `opts' is SilcAsn1Options.  The `tag' is a tag number.
- *
- * NOTES
- *
- *    The string must be in UTF-8 encoding when encoding.  The decoded
- *    string will be in UTF-8 encoding.  The actual data is encoded to
- *    or decoded from general.  NOTE: this implementation use 8-bit ASCII.
- *
- ***/
-#define SILC_ASN1_GENERAL_STRING(x, xl) SILC_ASN1_U2(GENERAL_STRING, x, xl)
-#define SILC_ASN1_GENERAL_STRING_T(o, t, x, xl) SILC_ASN1_T2(GENERAL_STRING, o, t, x, xl)
-
-/****f* silcasn1/SilcASN1API/SILC_ASN1_UTC_TIME
- *
- * SYNOPSIS
- *
- *    Encoding:
- *    SILC_ASN1_UTC_TIME(timeval)
- *    SILC_ASN1_UTC_TIME_T(opts, tag, timeval)
- *
- *    Decoding:
- *    SILC_ASN1_UTC_TIME(&str, &timeval)
- *    SILC_ASN1_UTC_TIME_T(opts, tag, timeval)
- *
- * DESCRIPTION
- *
- *    Macro used to encode or decode universal (UTC) time value.  The
- *    time value type is SilcTime.
- *
- *    The `opts' is SilcAsn1Options.  The `tag' is a tag number.
- *
- ***/
-#define SILC_ASN1_UTC_TIME(x) SILC_ASN1_U1(UTC_TIME, x)
-#define SILC_ASN1_UTC_TIME_T(o, t, x) SILC_ASN1_T1(UTC_TIME, o, t, x)
-
-/****f* silcasn1/SilcASN1API/SILC_ASN1_GEN_TIME
- *
- * SYNOPSIS
- *
- *    Encoding:
- *    SILC_ASN1_GEN_TIME(timeval)
- *    SILC_ASN1_GEN_TIME_T(opts, tag, timeval)
- *
- *    Decoding:
- *    SILC_ASN1_GEN_TIME(&str, &timeval)
- *    SILC_ASN1_GEN_TIME_T(opts, tag, timeval)
- *
- * DESCRIPTION
- *
- *    Macro used to encode or decode generalized time value.  The
- *    time value type is SilcTime.
- *
- *    The `opts' is SilcAsn1Options.  The `tag' is a tag number.
- *
- ***/
-#define SILC_ASN1_GEN_TIME(x) SILC_ASN1_U1(GENERALIZED_TIME, x)
-#define SILC_ASN1_GEN_TIME_T(o, t, x) SILC_ASN1_T1(GENERALIZED_TIME, o, t, x)
-
-/****f* silcasn1/SilcASN1API/SILC_ASN1_END
- *
- * SYNOPSIS
- *
- *    SILC_ASN1_END
- *
- * DESCRIPTION
- *
- *    The SILC_ASN1_END is used to terminate the variable argument list in
- *    silc_asn1_encode and silc_asn1_decode functions.  It is also used to
- *    terminate SILC_ASN1_SEQUENCE, SILC_ASN1_SEQUENCE_T, SILC_ASN1_SET,
- *    SILC_ASN1_SET_T, SILC_ASN1_SEQUENCE_OF, SILC_ASN1_SET_OF and
- *    SILC_ASN1_CHOICE macros.
- *
- ***/
-#define SILC_ASN1_END 0
-
-#endif /* SILCASN1_H */
diff --git a/lib/silcasn1/silcasn1_decode.c b/lib/silcasn1/silcasn1_decode.c
deleted file mode 100644 (file)
index 3030d07..0000000
+++ /dev/null
@@ -1,922 +0,0 @@
-/*
-
-  silcasn1_decode.c
-
-  Author: Pekka Riikonen <priikone@silcnet.org>
-
-  Copyright (C) 2003 - 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.
-
-*/
-
-#include "silc.h"
-#include "silcasn1.h"
-#include "silcber.h"
-
-/************************** ASN.1 Decoder routines **************************/
-
-/* Internal SEQUENCE OF and SET OF decoder.  This is used only when decoding
-   these two special tags.  Other normal ASN.1 decoding is done in the
-   silc_asn1_decoder function.  This parses the sequence of types and returns
-   them as raw BER buffers in an array of SilcBuffers. */
-
-static SilcBool silc_asn1_decoder_sof(SilcAsn1 asn1, SilcBuffer src)
-{
-  SilcBool ret = FALSE;
-  SilcList types;
-  SilcAsn1Tag type;
-  SilcBuffer *retb;
-  SilcUInt32 *retc, rtag;
-  const unsigned char *rdata;
-  SilcUInt32 rdata_len, len = 0;
-  SilcBool found = FALSE, rindef;
-
-  struct SilcAsn1SofStruct {
-    SilcAsn1Tag type;
-    struct SilcAsn1SofStruct *next;
-  } *t = NULL;
-
-  SILC_LOG_DEBUG(("Decoding sequence of types"));
-
-  silc_list_init(types, struct SilcAsn1SofStruct, next);
-
-  /* Take the return arguments */
-  retb = va_arg(asn1->ap, SilcBuffer *);
-  retc = va_arg(asn1->ap, SilcUInt32 *);
-  *retb = NULL;
-  *retc = 0;
-
-  /* Get the sequence type(s).  If the type is CHOICE tag then the sequence
-     may include multiple different types.  All types are considered
-     separately.  If CHOICE is not given then only single type is expected. */
-  type = va_arg(asn1->ap, SilcUInt32);
-  assert(type != SILC_ASN1_END);
-
-  if (type == SILC_ASN1_TAG_CHOICE) {
-    /* The sequence may consist of the following types. */
-    type = va_arg(asn1->ap, SilcUInt32);
-    assert(type != SILC_ASN1_END);
-    while (type != SILC_ASN1_END) {
-      t = silc_smalloc(asn1->stack1, sizeof(*t));
-      if (!t)
-       goto out;
-      t->type = type;
-      silc_list_add(types, t);
-
-      SILC_LOG_DEBUG(("Looking for %s [%d] from sequence of types",
-                     silc_asn1_tag_name(type), type));
-
-      type = va_arg(asn1->ap, SilcUInt32);
-    }
-  } else {
-    /* The sequence consists of this type. */
-    t = silc_smalloc(asn1->stack1, sizeof(*t));
-    if (!t)
-      goto out;
-    t->type = type;
-    silc_list_add(types, t);
-
-    SILC_LOG_DEBUG(("Looking for %s [%d] from sequence of types",
-                   silc_asn1_tag_name(type), type));
-  }
-
-  /* END marker for the sequence */
-  type = va_arg(asn1->ap, SilcUInt32);
-  assert(type == SILC_ASN1_END);
-
-  /* Decode the SEQUENCE or SET */
-  ret = silc_ber_decode(src, NULL, NULL, &rtag, &rdata,
-                       &rdata_len, &rindef, &len);
-  if (!ret) {
-    SILC_LOG_DEBUG(("Error parsing BER block, malformed ASN.1 data"));
-    goto out;
-  }
-  if (rtag != SILC_ASN1_TAG_SEQUENCE && rtag != SILC_ASN1_TAG_SET) {
-    SILC_LOG_DEBUG(("Invalid sequence of/set of"));
-    goto out;
-  }
-  silc_buffer_pull(src, len);
-
-  while (silc_buffer_len(src)) {
-    /* Decode the BER data. */
-    ret = silc_ber_decode(src, NULL, NULL, &rtag, &rdata,
-                         &rdata_len, &rindef, &len);
-    if (!ret) {
-      SILC_LOG_DEBUG(("Error parsing BER block, malformed ASN.1 data"));
-      goto out;
-    }
-
-    /* Now check the type(s) that it is supposed to be */
-    found = FALSE;
-    silc_list_start(types);
-    while ((t = silc_list_get(types)) != SILC_LIST_END) {
-      if (t->type != rtag)
-       continue;
-
-      *retb = silc_srealloc(asn1->stack1, sizeof(**retb) * (*retc), *retb,
-                           sizeof(**retb) * (*retc + 1));
-      if (*retb == NULL)
-       goto out;
-
-      SILC_LOG_DEBUG(("Decode %s [%d] from sequence of types",
-                     silc_asn1_tag_name(rtag), rtag));
-
-      /* Data is duplicated only if SILC_ASN1_ALLOC flag is set */
-      if (!asn1->stack1)
-       rdata = silc_memdup(rdata - len, rdata_len + len);
-      else
-       rdata = rdata - len;
-      rdata_len += len;
-
-      /* Save the data */
-      silc_buffer_set(&(*retb)[*retc], (unsigned char *)rdata, rdata_len);
-      (*retc)++;
-      found = TRUE;
-      break;
-    }
-
-    /* If type was not found we consider it the end of the sequence */
-    if (found == FALSE)
-      break;
-
-    if (rdata_len)
-      silc_buffer_pull(src, rdata_len);
-  }
-
-  SILC_LOG_DEBUG(("Decoded %d types", *retc));
-  ret = TRUE;
-
- out:
-  if (!asn1->stack1) {
-    silc_list_start(types);
-    while ((t = silc_list_get(types)) != SILC_LIST_END)
-      silc_free(t);
-  }
-
-  return ret;
-}
-
-/* Macro for decoder to get argument for a type.  If OPTIONAL option is
-   set then the argument is a pointer to the type pointer.  The `type'
-   must be a non-pointer type, eg. int, SilcBufferStruct. */
-#define SILC_ASN1_VAD(asn1, opts, type, name)                  \
-  type **name;                                                 \
-  if ((opts) & SILC_ASN1_OPTIONAL && !choice) {                        \
-    name = va_arg(asn1->ap, type **);                          \
-    if (!found) {                                              \
-      if (name)                                                        \
-        *name = NULL;                                          \
-      break;                                                   \
-    }                                                          \
-    if (name == NULL)                                          \
-      break;                                                   \
-    *name = silc_scalloc(asn1->stack1, 1, sizeof(**name));             \
-    if (*name == NULL)                                         \
-      break;                                                   \
-  } else {                                                     \
-    type *name ## tmp = va_arg(asn1->ap, type *);              \
-    if (choice && found && !len)                               \
-      break;                                                   \
-    if (name ## tmp == NULL)                                   \
-      break;                                                   \
-    name = &name ## tmp;                                       \
-  }
-
-/* Same as SILC_ASN1_VAD but for unsigned char and SilcUInt32 */
-#define SILC_ASN1_VAD_UCHAR(asn1, opts, type, name, namelen)   \
-  type **name = va_arg(asn1->ap, type **);                     \
-  SilcUInt32 *namelen = va_arg(asn1->ap, SilcUInt32 *);                \
-  if (choice && found && !len)                                 \
-    break;                                                     \
-  if (!found) {                                                        \
-    if (name)                                                  \
-      *name = NULL;                                            \
-    break;                                                     \
-  }                                                            \
-  if (name == NULL)                                            \
-    break;
-
-/* Same as SILC_ASN1_VAD but for char only */
-#define SILC_ASN1_VAD_CHAR(asn1, opts, type, name)     \
-  type **name = va_arg(asn1->ap, type **);             \
-  if (choice && found && !len)                         \
-    break;                                             \
-  if (!found) {                                                \
-    if (name)                                          \
-      *name = NULL;                                    \
-    break;                                             \
-  }                                                    \
-  if (name == NULL)                                    \
-    break;
-
-#define SILC_ASN1_VA_FREE(opts, name)          \
-  if ((opts) & SILC_ASN1_OPTIONAL)             \
-    silc_free(*name);
-
-/* Decodes string to UTF-8 string which is our internal representation
-   of any string. */
-#define SILC_ASN1_DECODE_STRING(enc, s, s_len)                 \
-  *s_len = silc_utf8_encoded_len(rdata, rdata_len, (enc));     \
-  if (*s_len == 0) {                                           \
-    SILC_LOG_DEBUG(("Malformed %d string value", (enc)));      \
-    ret = FALSE;                                               \
-    goto fail;                                                 \
-  }                                                            \
-  *s = silc_smalloc(stack1, *s_len + 1);                       \
-  if (*s) {                                                    \
-    silc_utf8_encode(rdata, rdata_len, (enc), *s, *s_len);     \
-    (*s)[*s_len] = '\0';                                       \
-  }
-
-
-/* Internal ASN.1 decoder.  The `type', `tag' and `opts' are the first
-   arguments (either very first or first for recursion) for a type.
-   The `depth' includes the current depth of recursion. */
-
-static SilcBool
-silc_asn1_decoder(SilcAsn1 asn1, SilcStack stack1, SilcAsn1Tag type,
-                 SilcAsn1Tag tag, SilcBerClass ber_class,
-                 SilcAsn1Options opts, SilcBuffer src, SilcUInt32 depth,
-                 SilcBool primitive)
-{
-  unsigned char *ptr = src->data;
-  SilcAsn1Tag rtype;
-  SilcAsn1Options ropts;
-  SilcBerClass rclass;
-  SilcBerEncoding renc;
-  SilcUInt32 len = 0, rtag;
-  SilcBool ret, indef, rindef, found = FALSE, choice = FALSE;
-  const unsigned char *rdata;
-  SilcUInt32 rdata_len;
-  int i;
-
-#ifdef SILC_DEBUG
-  char sp[SILC_ASN1_RECURSION_DEPTH + 1];
-  memset(sp, 0, sizeof(sp));
-  if (depth)
-    memset(sp, 32, depth);
-#endif /* SILC_DEBUG */
-
-  if (depth >= SILC_ASN1_RECURSION_DEPTH) {
-    SILC_LOG_DEBUG(("Maximum recursion depth reached"));
-    return FALSE;
-  }
-
-  while (1) {
-
-    /* If requested type is SEQUENCE OF or SET OF then we decode the sequence
-       of types separately in an own decoder which returns array of buffers. */
-    if (type == SILC_ASN1_TAG_SEQUENCE_OF) {
-      /* Decode the sequence */
-      if (!silc_asn1_decoder_sof(asn1, src)) {
-       SILC_LOG_DEBUG(("Error decoding SEQUENCE OF"));
-       ret = FALSE;
-       goto fail;
-      }
-
-      /* Continue with rest of the decodings if any */
-      SILC_ASN1_ARGS(asn1, type, tag, ber_class, opts);
-      if (type == SILC_ASN1_END) {
-       ret = TRUE;
-       goto ok;
-      }
-    }
-
-    /* Get length encoding */
-    indef = (opts & SILC_ASN1_INDEFINITE ? TRUE : FALSE);
-
-    /* By default UNIVERSAL is implied unless the following conditions
-       are met when CONTEXT will apply.  For SILC_ASN1_TAG_ANY_PRIMITIVE
-       the class is changed only if flags dictate it. */
-    if (ber_class == SILC_BER_CLASS_UNIVERSAL) {
-      if (type == SILC_ASN1_TAG_ANY_PRIMITIVE) {
-       if (opts & SILC_ASN1_IMPLICIT ||
-           opts & SILC_ASN1_EXPLICIT)
-         ber_class = SILC_BER_CLASS_CONTEXT;
-      } else {
-       if (tag != type ||
-           opts & SILC_ASN1_IMPLICIT ||
-           opts & SILC_ASN1_EXPLICIT)
-         ber_class = SILC_BER_CLASS_CONTEXT;
-      }
-    }
-
-    /* Short integer is actually big integer in the BER data, so handle
-       it correctly */
-    if (type == SILC_ASN1_TAG_SHORT_INTEGER && type == tag)
-      tag = SILC_ASN1_TAG_INTEGER;
-
-    /* Now decode a BER encoded block from the source buffer.  It must be
-       exactly the same user is expecting. */
-    ret = silc_ber_decode(src, &rclass, &renc, &rtag, &rdata,
-                         &rdata_len, &rindef, &len);
-    if (!ret) {
-      SILC_LOG_DEBUG(("Error parsing BER block, malformed ASN.1 data"));
-      return FALSE;
-    }
-
-    /* Now verify that the decoded BER is the one user wanted to get.  If
-       requested type is OPTIONAL, then ignore all the sanity tests.  The
-       while() loop is for re-considering OPTIONAL types without parsing
-       new BER object.  For CHOICE (tag) all the choice considerations are
-       also done within the while(). */
-    while (1) {
-
-      /* If type is CHOICE then at least one type must match before next
-        SILC_ASN1_END is reached.  The considerations act interally as
-        having OPTIONAL flag set, except that at the end one must have
-        been found. */
-      if (type == SILC_ASN1_TAG_CHOICE) {
-       choice = TRUE;
-       SILC_ASN1_ARGS(asn1, type, tag, ber_class, opts);
-       opts |= SILC_ASN1_OPTIONAL;
-       found = FALSE;
-      }
-
-#ifdef SILC_DEBUG
-      SILC_LOG_DEBUG(
-        ("%04d: %sDecode %s [%d] %s %s %s %s", depth, sp[0] ? sp : "",
-        silc_asn1_tag_name(type), rtag,
-        rclass == SILC_BER_CLASS_UNIVERSAL   ? "univ" :
-        rclass == SILC_BER_CLASS_APPLICATION ? "appl" :
-        rclass == SILC_BER_CLASS_CONTEXT     ? "cont" : "priv",
-        renc == SILC_BER_ENC_PRIMITIVE ? "primit" : "constr",
-        rindef ? "indef" : "defin",
-        choice ? "choice" : opts & SILC_ASN1_OPTIONAL ? "option" : ""));
-#endif /* SILC_DEBUG */
-
-      if (type != SILC_ASN1_TAG_ANY && tag != rtag) {
-       if (!(opts & SILC_ASN1_OPTIONAL)) {
-         SILC_LOG_DEBUG(("Invalid ASN.1 tag %u, expected %u", rtag, tag));
-         return FALSE;
-       }
-       if (!choice)
-         found = FALSE;
-
-      } else if (ber_class != rclass) {
-       if (!(opts & SILC_ASN1_OPTIONAL)) {
-         SILC_LOG_DEBUG(("Invalid ASN.1 class %d, expected %d",
-                         rclass, ber_class));
-         return FALSE;
-       }
-       if (!choice)
-         found = FALSE;
-
-      } else if (!(opts & SILC_ASN1_EXPLICIT) && indef != rindef) {
-       SILC_LOG_DEBUG(("Invalid ASN.1 length encoding %s, expected %s",
-                       rindef ? "indefinite" : "definite",
-                       indef ? "indefinite" : "definite"));
-       return FALSE;
-
-      } else if (rindef && renc == SILC_BER_ENC_PRIMITIVE) {
-       SILC_LOG_DEBUG(("Invalid length encoding for primitive type"));
-       return FALSE;
-
-      } else {
-       found = TRUE;
-      }
-
-      /* If tagging is explicit we have additional sequence we need to decode
-        before we decode the actual underlaying type. */
-      if (opts & SILC_ASN1_EXPLICIT) {
-       silc_buffer_pull(src, len);
-       len = 0;
-
-       primitive = (type != SILC_ASN1_TAG_SEQUENCE &&
-                    type != SILC_ASN1_TAG_SET &&
-                    type != SILC_ASN1_TAG_ANY);
-       opts &= ~SILC_ASN1_EXPLICIT;
-
-       ret = silc_asn1_decoder(asn1, stack1, type, type,
-                               SILC_BER_CLASS_UNIVERSAL, opts, src,
-                               depth + 1, primitive);
-       if (!ret)
-         goto fail;
-       if (primitive) {
-         primitive = FALSE;
-         goto cont;
-       }
-       goto ok;
-      }
-
-      /* Decode by the type user expects the data to be. */
-      switch (type) {
-
-      case SILC_ASN1_TAG_ANY:
-       {
-         /* ANY is another ASN.1 node.  We return the raw BER buffer as
-            the node */
-         SILC_ASN1_VAD(asn1, opts, SilcBufferStruct, node);
-
-         *node = silc_buffer_srealloc_size(stack1, *node, len + rdata_len);
-         silc_buffer_put(*node, rdata - len, rdata_len + len);
-         break;
-       }
-
-      case SILC_ASN1_TAG_ANY_PRIMITIVE:
-       {
-         /* ANY_PRIMITIVE returns the raw data blob of any primitive type. */
-         SILC_ASN1_VAD(asn1, opts, SilcBufferStruct, prim);
-
-         *prim = silc_buffer_srealloc_size(stack1, *prim, rdata_len);
-         silc_buffer_put(*prim, rdata, rdata_len);
-         break;
-       }
-
-      case SILC_ASN1_TAG_SEQUENCE:
-      case SILC_ASN1_TAG_SET:
-       {
-         /* SEQUENCE/SET is a sequence of types. */
-         silc_buffer_pull(src, len);
-         len = 0;
-
-         /* Get type, tag and options for the first argument in recursion */
-         SILC_ASN1_ARGS(asn1, rtype, rtag, rclass, ropts);
-
-         /* Decode the sequence recursively */
-         ret = silc_asn1_decoder(asn1, stack1, rtype, rtag, rclass,
-                                 ropts, src, depth + 1, FALSE);
-         if (!ret)
-           goto fail;
-         break;
-       }
-
-      case SILC_ASN1_TAG_INTEGER:
-      case SILC_ASN1_TAG_ENUM:
-       {
-         /* Integer/enum value. */
-         SilcMPInt z;
-         SILC_ASN1_VAD(asn1, opts, SilcMPInt, intval);
-
-         if (rdata_len < 1) {
-           SILC_LOG_DEBUG(("Malformed integer value"));
-           SILC_ASN1_VA_FREE(opts, intval);
-           ret = FALSE;
-           goto fail;
-         }
-
-         silc_mp_sinit(asn1->stack1, *intval);
-
-         /* Check whether the integer is positive or negative */
-         if (rdata[0] & 0x80) {
-           /* Negative integer stored in 1s complement.*/
-           for (i = 0; i < rdata_len; i++) {
-             silc_mp_mul_2exp(*intval, *intval, 8);
-             silc_mp_add_ui(*intval, *intval, ~rdata[i] & 0xff);
-           }
-
-           /* 2s complement and change sign */
-           silc_mp_init(&z);
-           silc_mp_set_ui(&z, 0);
-           silc_mp_add_ui(*intval, *intval, 1);
-           silc_mp_sub(*intval, &z, *intval);
-           silc_mp_uninit(&z);
-         } else {
-           /* Positive */
-           silc_mp_bin2mp((unsigned char *)rdata, rdata_len, *intval);
-         }
-
-         break;
-       }
-
-      case SILC_ASN1_TAG_SHORT_INTEGER:
-       {
-         /* Short Integer */
-         SilcMPInt z;
-         SILC_ASN1_VAD(asn1, opts, SilcUInt32, intval);
-
-         if (rdata_len < 1) {
-           SILC_LOG_DEBUG(("Malformed integer value"));
-           SILC_ASN1_VA_FREE(opts, intval);
-           ret = FALSE;
-           goto fail;
-         }
-
-         silc_stack_push(asn1->stack1, NULL);
-         silc_mp_sinit(asn1->stack1, &z);
-         silc_mp_bin2mp((unsigned char *)rdata, rdata_len, &z);
-         *(*intval) = silc_mp_get_ui(&z);
-         silc_mp_uninit(&z);
-         silc_stack_pop(asn1->stack1);
-         break;
-       }
-
-      case SILC_ASN1_TAG_OID:
-       {
-         /* Object identifier */
-         SilcBufferStruct tmpb;
-         char tmpstr[24];
-         SilcUInt32 oid;
-         SILC_ASN1_VAD_CHAR(asn1, opts, char, oidstr);
-
-         if (rdata_len < 1) {
-           SILC_LOG_DEBUG(("Malformed object identifier value"));
-           SILC_ASN1_VA_FREE(opts, oidstr);
-           ret = FALSE;
-           goto fail;
-         }
-
-         /* Set two OID values */
-         memset(&tmpb, 0, sizeof(tmpb));
-         memset(tmpstr, 0, sizeof(tmpstr));
-         silc_snprintf(tmpstr, sizeof(tmpstr) - 1, "%lu.%lu",
-                  (unsigned long)(rdata[0] & 0xff) / 40,
-                  (unsigned long)(rdata[0] & 0xff) % 40);
-         silc_buffer_sstrformat(asn1->stack1, &tmpb, tmpstr, SILC_STR_END);
-
-         /* Set rest of the OID values, each octet having 7 bits of the
-            OID value with bit 8 set.  An octet not having bit 8 set
-            means end of that OID value. */
-         for (i = 1; i < rdata_len; i++) {
-           oid = 0;
-           while (rdata[i] & 0x80) {
-             oid <<= 7;
-             oid |= rdata[i++] & 0x7f;
-             if (i >= rdata_len) {
-               SILC_LOG_DEBUG(("Malformed object identifier value"));
-               break;
-             }
-           }
-           oid <<= 7;
-           oid |= rdata[i];
-
-           memset(tmpstr, 0, sizeof(tmpstr));
-           silc_snprintf(tmpstr, sizeof(tmpstr) - 1, ".%lu", (unsigned long)oid);
-           silc_buffer_sstrformat(asn1->stack1, &tmpb, tmpstr, SILC_STR_END);
-         }
-         *oidstr = tmpb.head;
-
-         break;
-       }
-
-      case SILC_ASN1_TAG_BOOLEAN:
-       {
-         /* Decode boolean (TRUE/FALSE) value */
-         SILC_ASN1_VAD(asn1, opts, SilcBool, val);
-
-         if (rdata_len != 1) {
-           SILC_LOG_DEBUG(("Malformed boolean value"));
-           SILC_ASN1_VA_FREE(opts, val);
-           ret = FALSE;
-           goto fail;
-         }
-
-         *(*val) = (rdata[0] == 0xff ? TRUE : FALSE);
-         break;
-       }
-
-      case SILC_ASN1_TAG_BIT_STRING:
-       {
-         /* Bit string contains data with exact bit length of the data */
-         SILC_ASN1_VAD_UCHAR(asn1, opts, unsigned char, d, d_len);
-
-         if (rdata_len < 2) {
-           SILC_LOG_DEBUG(("Malformed bit string value"));
-           SILC_ASN1_VA_FREE(opts, d);
-           ret = FALSE;
-           goto fail;
-         }
-
-         *d = silc_smemdup(stack1, rdata + 1, rdata_len - 1);
-         *d_len = (rdata_len - 1) * 8;
-         break;
-       }
-
-      case SILC_ASN1_TAG_NULL:
-       {
-         /* Decode empty BER block */
-         if (rdata_len != 0) {
-           SILC_LOG_DEBUG(("Malformed null value"));
-           goto fail;
-         }
-         break;
-       }
-
-      case SILC_ASN1_TAG_UTC_TIME:
-       {
-         /* Universal encoded time string */
-         SILC_ASN1_VAD(asn1, opts, SilcTimeStruct, t);
-
-         if (rdata_len < 1) {
-           SILC_LOG_DEBUG(("Malformed UTC time value"));
-           SILC_ASN1_VA_FREE(opts, t);
-           ret = FALSE;
-           goto fail;
-         }
-
-         /* Parse the time string */
-         if (!silc_time_universal(rdata, *t)) {
-           SILC_LOG_DEBUG(("Malformed UTC time value"));
-           ret = FALSE;
-           goto fail;
-         }
-
-         break;
-       }
-
-      case SILC_ASN1_TAG_GENERALIZED_TIME:
-       {
-         /* Generalized encoded time string */
-         SILC_ASN1_VAD(asn1, opts, SilcTimeStruct, t);
-
-         if (rdata_len < 1) {
-           SILC_LOG_DEBUG(("Malformed generalized time value"));
-           SILC_ASN1_VA_FREE(opts, t);
-           ret = FALSE;
-           goto fail;
-         }
-
-         /* Parse the time string */
-         if (!silc_time_generalized(rdata, *t)) {
-           SILC_LOG_DEBUG(("Malformed generalized time value"));
-           SILC_ASN1_VA_FREE(opts, t);
-           ret = FALSE;
-           goto fail;
-         }
-
-         break;
-       }
-
-      case SILC_ASN1_TAG_UTF8_STRING:
-       {
-         /* UTF-8 encoded string */
-         SILC_ASN1_VAD_UCHAR(asn1, opts, unsigned char, s, s_len);
-
-         if (!silc_utf8_valid(rdata, rdata_len)) {
-           SILC_LOG_DEBUG(("Malformed UTF-8 string value"));
-           SILC_ASN1_VA_FREE(opts, s);
-           ret = FALSE;
-           goto fail;
-         }
-
-         *s = silc_smemdup(stack1, rdata, rdata_len);
-         *s_len = rdata_len;
-         break;
-       }
-
-      case SILC_ASN1_TAG_OCTET_STRING:
-       {
-         /* Octet string.  Take data as is. */
-         SILC_ASN1_VAD_UCHAR(asn1, opts, unsigned char, s, s_len);
-         *s = silc_smemdup(stack1, rdata, rdata_len);
-         *s_len = rdata_len;
-         break;
-       }
-
-      case SILC_ASN1_TAG_NUMERIC_STRING:
-       {
-         /* Numerical (digit) string */
-         SILC_ASN1_VAD_UCHAR(asn1, opts, unsigned char, s, s_len);
-         SILC_ASN1_DECODE_STRING(SILC_STRING_NUMERICAL, s, s_len);
-         break;
-       }
-
-      case SILC_ASN1_TAG_PRINTABLE_STRING:
-       {
-         /* Printable string */
-         SILC_ASN1_VAD_UCHAR(asn1, opts, unsigned char, s, s_len);
-         SILC_ASN1_DECODE_STRING(SILC_STRING_PRINTABLE, s, s_len);
-         break;
-       }
-
-      case SILC_ASN1_TAG_TELETEX_STRING:
-       {
-         /* Teletex (T61) string */
-         SILC_ASN1_VAD_UCHAR(asn1, opts, unsigned char, s, s_len);
-         SILC_ASN1_DECODE_STRING(SILC_STRING_TELETEX, s, s_len);
-         break;
-       }
-
-      case SILC_ASN1_TAG_IA5_STRING:
-       {
-         /* US ASCII string */
-         SILC_ASN1_VAD_UCHAR(asn1, opts, unsigned char, s, s_len);
-         SILC_ASN1_DECODE_STRING(SILC_STRING_ASCII, s, s_len);
-         break;
-       }
-
-      case SILC_ASN1_TAG_VISIBLE_STRING:
-       {
-         /* Visible string */
-         SILC_ASN1_VAD_UCHAR(asn1, opts, unsigned char, s, s_len);
-         SILC_ASN1_DECODE_STRING(SILC_STRING_VISIBLE, s, s_len);
-         break;
-       }
-
-      case SILC_ASN1_TAG_UNIVERSAL_STRING:
-       {
-         /* Universal (UCS-4) string */
-         SILC_ASN1_VAD_UCHAR(asn1, opts, unsigned char, s, s_len);
-         SILC_ASN1_DECODE_STRING(SILC_STRING_UNIVERSAL, s, s_len);
-         break;
-       }
-
-      case SILC_ASN1_TAG_UNRESTRICTED_STRING:
-      case SILC_ASN1_TAG_GENERAL_STRING:
-       {
-         /* Handle now unrestricted and general as 8-bit ascii, which
-            probably isn't correct. */
-         SILC_ASN1_VAD_UCHAR(asn1, opts, unsigned char, s, s_len);
-         SILC_ASN1_DECODE_STRING(SILC_STRING_ASCII, s, s_len);
-         break;
-       }
-
-      case SILC_ASN1_TAG_BMP_STRING:
-       {
-         /* BMP (UCS-2) string */
-         SILC_ASN1_VAD_UCHAR(asn1, opts, unsigned char, s, s_len);
-         SILC_ASN1_DECODE_STRING(SILC_STRING_BMP, s, s_len);
-         break;
-       }
-
-      case SILC_ASN1_TAG_ODE:
-      case SILC_ASN1_TAG_ETI:
-      case SILC_ASN1_TAG_REAL:
-      case SILC_ASN1_TAG_EMBEDDED:
-      case SILC_ASN1_TAG_ROI:
-      case SILC_ASN1_TAG_VIDEOTEX_STRING:
-      case SILC_ASN1_TAG_GRAPHIC_STRING:
-       {
-         SILC_NOT_IMPLEMENTED("Unsupported ASN.1 tag");
-         ret = FALSE;
-         goto fail;
-         break;
-       }
-
-      default:
-       SILC_LOG_DEBUG(("Invalid ASN.1 tag `%d'. Cannot decode ASN.1.",
-                       type));
-       ret = FALSE;
-       goto fail;
-       break;
-      }
-
-    cont:
-      /* Pull the current data from source which reveals next BER object */
-      if (found && len + rdata_len)
-       silc_buffer_pull(src, len + rdata_len);
-      if (primitive) {
-       ret = TRUE;
-       goto ok;
-      }
-
-      /* Get next type, tag and options */
-      rtype = type;
-      SILC_ASN1_ARGS(asn1, type, tag, ber_class, opts);
-      if (type == SILC_ASN1_END) {
-       if (choice) {
-         if (!found) {
-           /* No choices were found, error */
-           SILC_LOG_DEBUG(("Invalid ASN.1 choice: no choices present"));
-           ret = FALSE;
-           goto fail;
-         }
-
-         /* Take next type and new BER object, choices are over */
-         choice = FALSE;
-         SILC_ASN1_ARGS(asn1, type, tag, ber_class, opts);
-         if (type == SILC_ASN1_END) {
-           ret = TRUE;
-           goto ok;
-         }
-         break;
-       }
-
-       /* SEQUENCE/SET end */
-       ret = TRUE;
-       goto ok;
-      }
-
-      if (choice) {
-       /* Even if the choice was found we must go through rest of
-          the choices. */
-       if (found && len) {
-         SILC_LOG_DEBUG(("Found choice %s type", silc_asn1_tag_name(rtype)));
-         rdata_len = len = 0;
-       }
-       opts |= SILC_ASN1_OPTIONAL;
-       continue;
-      }
-
-      /* Optional type not present, check next one for match */
-      if (!found)
-       continue;
-
-      break;
-    }
-  }
-
- fail:
-  SILC_LOG_DEBUG(("Error decoding type %d (depth %d)", type, depth));
-
- ok:
-  if (ptr)
-    len = src->data - ptr;
-  else
-    len = src->data - src->head;
-  silc_buffer_push(src, len);
-
-  return ret;
-}
-
-SilcBool silc_asn1_decode(SilcAsn1 asn1, SilcBuffer src, ...)
-{
-  SilcAsn1Tag type, tag;
-  SilcAsn1Options opts;
-  SilcBerClass ber_class;
-  SilcStackFrame frame1, frame2;
-  SilcStack stack1 = NULL, stack2 = NULL;
-  SilcBool ret;
-
-  if (!asn1)
-    return FALSE;
-
-  va_start(asn1->ap, src);
-
-  /* Get the first arguments and call the decoder. */
-  SILC_ASN1_ARGS(asn1, type, tag, ber_class, opts);
-  if (!type) {
-    va_end(asn1->ap);
-    return FALSE;
-  }
-
-  /* Handle internal options for decoder. */
-  if (type == SILC_ASN1_TAG_OPTS) {
-    SilcUInt32 o = va_arg(asn1->ap, SilcUInt32);
-
-    if (o & SILC_ASN1_ALLOC) {
-      /* User wants to alloate everything.  Set the stacks to NULL so
-        that stack aware calls revert to normal allocation routines. */
-      stack1 = asn1->stack1;
-      stack2 = asn1->stack2;
-      asn1->stack1 = NULL;
-      asn1->stack2 = NULL;
-    }
-
-    if (o & SILC_ASN1_ACCUMUL) {
-      /* If accumul flag is not set yet, then push the stacks. */
-      if (!asn1->accumul) {
-       silc_stack_push(asn1->stack1, NULL);
-       silc_stack_push(asn1->stack2, NULL);
-       asn1->accumul = 1;
-      }
-    }
-
-    /* Take again the arguments */
-    SILC_ASN1_ARGS(asn1, type, tag, ber_class, opts);
-  } else {
-    /* No flags set, all flags will be reset. */
-
-    /* If accumul flag is set now pop the stack so that all accumulated
-       memory becomes free again. */
-    if (asn1->accumul) {
-      silc_stack_pop(asn1->stack1);
-      silc_stack_pop(asn1->stack2);
-      asn1->accumul = 0;
-    }
-  }
-
-  /* Push stacks for normal allocation from stack */
-  if (!asn1->accumul) {
-    silc_stack_push(asn1->stack1, &frame1);
-    silc_stack_push(asn1->stack2, &frame2);
-  }
-
-  /* Start decoding */
-  ret = silc_asn1_decoder(asn1, asn1->stack1, type, tag, ber_class,
-                         opts, src, 0, FALSE);
-
-  /* Pop stacks to free normal allocations from stack. They remain valid
-     for every second call to this function. */
-  if (!asn1->accumul) {
-    silc_stack_pop(asn1->stack1);
-    silc_stack_pop(asn1->stack2);
-
-    /* Switch the asn1->stack1 and asn1->stack2.  This way next call to
-       this function does not invalidate these results.  Every second call
-       invalidates the results of every second previous results. */
-    if (asn1->stack1 && asn1->stack2) {
-      stack1 = asn1->stack1;
-      asn1->stack1 = asn1->stack2;
-      asn1->stack2 = stack1;
-    }
-  }
-
-  if (stack1 && stack2 && !asn1->stack1 && !asn1->stack2) {
-    /* SILC_ASN1_ALLOC flag was set, restore the stacks. */
-    asn1->stack1 = stack1;
-    asn1->stack2 = stack2;
-  }
-
-  va_end(asn1->ap);
-
-  return ret;
-}
diff --git a/lib/silcasn1/silcasn1_encode.c b/lib/silcasn1/silcasn1_encode.c
deleted file mode 100644 (file)
index 986909c..0000000
+++ /dev/null
@@ -1,764 +0,0 @@
-/*
-
-  silcasn1_encode.c
-
-  Author: Pekka Riikonen <priikone@silcnet.org>
-
-  Copyright (C) 2003 - 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.
-
-*/
-
-#include "silc.h"
-#include "silcasn1.h"
-#include "silcber.h"
-
-#define SILC_ASN1_BUFFER_FREE(b, stack) if (!stack) silc_buffer_purge(b);
-
-/************************** ASN.1 Encoder routines **************************/
-
-/* Encode string from UTF-8 string to other string encodings.  Encodes
-   diretly to BER blob. */
-#define SILC_ASN1_ENCODE_STRING(enc)                                   \
-  unsigned char *s, *d = va_arg(asn1->ap, unsigned char *);            \
-  SilcUInt32 s_len, d_len = va_arg(asn1->ap, SilcUInt32);              \
-  if (!d)                                                              \
-    break;                                                             \
-  s_len = silc_utf8_decoded_len(d, d_len, (enc));                      \
-  if (s_len == 0) {                                                    \
-    SILC_LOG_DEBUG(("Malformed %d string value", (enc)));              \
-    goto fail;                                                         \
-  }                                                                    \
-  silc_stack_push(asn1->stack2, &frame);                               \
-  s = silc_smalloc(stack2, s_len + 1);                                 \
-  if (s) {                                                             \
-    silc_utf8_decode(d, d_len, (enc), s, s_len);                       \
-    s[s_len] = '\0';                                                   \
-  }                                                                    \
-  len = silc_ber_encoded_len(tag, s_len, indef);                       \
-  dest = silc_buffer_srealloc_size(stack1, dest,                       \
-                                  silc_buffer_truelen(dest) + len);    \
-  ret = silc_ber_encode(dest, ber_class, SILC_BER_ENC_PRIMITIVE,       \
-                       tag, s, s_len, indef);                          \
-  silc_stack_pop(asn1->stack2);                                                \
-  if (!ret)                                                            \
-    goto fail;
-
-/* The internal ASN.1 encoder.  The `type', `tag' and `opts' are the
-   first arguments (either very first or first for recursion) for a type.
-   The `depth' includes the current depth of recursion.  The `primitive'
-   is TRUE if this encoder receives one primitive type as argument.  If
-   it is a constructed type it must be FALSE value. */
-
-static SilcBool
-silc_asn1_encoder(SilcAsn1 asn1, SilcStack stack1, SilcStack stack2,
-                 SilcAsn1Tag type, SilcAsn1Tag tag, SilcBerClass ber_class,
-                 SilcAsn1Options opts, SilcBuffer dest, SilcUInt32 depth,
-                 SilcBool primitive)
-{
-  unsigned char *ptr = dest->data;
-  SilcAsn1Tag rtype, rtag;
-  SilcAsn1Options ropts;
-  SilcBerClass rclass;
-  SilcUInt32 len = 0;
-  SilcBool ret = FALSE, indef;
-  SilcBufferStruct buf;
-  SilcStackFrame frame;
-
-#ifdef SILC_DEBUG
-  char sp[SILC_ASN1_RECURSION_DEPTH + 1];
-  memset(sp, 0, sizeof(sp));
-  if (depth)
-    memset(sp, 32, depth);
-#endif /* SILC_DEBUG */
-
-  if (depth >= SILC_ASN1_RECURSION_DEPTH) {
-    SILC_LOG_DEBUG(("Maximum recursion depth reached"));
-    return FALSE;
-  }
-
-  while (1) {
-    /* These options cannot be used in encoding */
-    opts &= ~SILC_ASN1_OPTIONAL;
-
-    /* Get length encoding */
-    indef = (opts & SILC_ASN1_INDEFINITE ? TRUE : FALSE);
-
-    /* By default UNIVERSAL is implied unless the following conditions
-       are met when CONTEXT will apply.  For SILC_ASN1_TAG_ANY_PRIMITIVE
-       the class is changed only if flags dictate it. */
-    if (ber_class == SILC_BER_CLASS_UNIVERSAL) {
-      if (type == SILC_ASN1_TAG_ANY_PRIMITIVE) {
-       if (opts & SILC_ASN1_IMPLICIT ||
-           opts & SILC_ASN1_EXPLICIT)
-         ber_class = SILC_BER_CLASS_CONTEXT;
-      } else {
-       if (tag != type ||
-           opts & SILC_ASN1_IMPLICIT ||
-           opts & SILC_ASN1_EXPLICIT)
-         ber_class = SILC_BER_CLASS_CONTEXT;
-      }
-    }
-
-#ifdef SILC_DEBUG
-    SILC_LOG_DEBUG(
-      ("%04d: %sEncode %s [%d] %s %s %s %s", depth, sp[0] ? sp : "",
-       silc_asn1_tag_name(type), tag,
-       ber_class == SILC_BER_CLASS_UNIVERSAL   ? "univ" :
-       ber_class == SILC_BER_CLASS_APPLICATION ? "appl" :
-       ber_class == SILC_BER_CLASS_CONTEXT     ? "cont" : "priv",
-       (type != SILC_ASN1_TAG_SEQUENCE && type != SILC_ASN1_TAG_SET) ?
-       opts & SILC_ASN1_EXPLICIT ? "constr" :
-       type == SILC_ASN1_TAG_ANY &&
-       !(opts & SILC_ASN1_EXPLICIT) ? "constr" : "primit" : "constr",
-       indef ? opts & SILC_ASN1_EXPLICIT ? "defin" : "indef" : "defin",
-       opts & SILC_ASN1_IMPLICIT ? "implicit" :
-       opts & SILC_ASN1_EXPLICIT ? "explicit" : ""));
-#endif /* SILC_DEBUG */
-
-    /* If tagging is explicit we add constructed type before the underlaying
-       types.  The underlaying types are encoded recursively with this
-       encoder. */
-    if (opts & SILC_ASN1_EXPLICIT) {
-      memset(&buf, 0, sizeof(buf));
-
-      primitive = (type != SILC_ASN1_TAG_SEQUENCE &&
-                  type != SILC_ASN1_TAG_SET);
-      opts &= ~SILC_ASN1_EXPLICIT;
-
-      silc_stack_push(stack2, &frame);
-      ret = silc_asn1_encoder(asn1, stack2, stack1, type, type,
-                             SILC_BER_CLASS_UNIVERSAL, opts,
-                             &buf, depth + 1, primitive);
-
-      if (!ret) {
-       SILC_LOG_DEBUG(("Error encoding explicit tag"));
-       silc_stack_pop(stack2);
-       goto fail;
-      }
-
-      /* Encode the explicit tag */
-      len = silc_ber_encoded_len(tag, silc_buffer_len(&buf), FALSE);
-      dest = silc_buffer_srealloc_size(stack1, dest,
-                                      silc_buffer_truelen(dest) + len);
-      ret = silc_ber_encode(dest, ber_class, SILC_BER_ENC_CONSTRUCTED,
-                           tag, buf.data, silc_buffer_len(&buf), FALSE);
-      SILC_ASN1_BUFFER_FREE(&buf, stack2);
-      silc_stack_pop(stack2);
-      if (!ret)
-       goto fail;
-      if (primitive) {
-       primitive = FALSE;
-       goto cont;
-      }
-      goto ok;
-    }
-
-    /* Encode by the type */
-    switch (type) {
-
-    case SILC_ASN1_TAG_ANY:
-      {
-       /* ANY is another ASN.1 node which is added to this tree */
-       SilcBuffer node = va_arg(asn1->ap, SilcBuffer);
-       if (!node)
-         break;
-
-       /* Encode ASN.1 node into the tree. */
-       if (opts & SILC_ASN1_IMPLICIT || type != tag) {
-         /* We are tagging implicitly so we need to change the identifier
-            of the underlaying type.  Only constructed type is allowed with
-            ANY when tagging implicitly. */
-         const unsigned char *d;
-         SilcUInt32 d_len;
-         SilcBerEncoding enc;
-
-         /* Get the underlaying data */
-         ret = silc_ber_decode(node, NULL, &enc, NULL, &d, &d_len,
-                               NULL, NULL);
-         if (!ret) {
-           SILC_LOG_DEBUG(("Error decoding underlaying node for ANY"));
-           goto fail;
-         }
-         assert(enc == SILC_BER_ENC_CONSTRUCTED);
-
-         /* Now encode with implicit tagging */
-         len = silc_ber_encoded_len(tag, d_len, FALSE);
-         dest = silc_buffer_srealloc_size(stack1, dest,
-                                          silc_buffer_truelen(dest) + len);
-         ret = silc_ber_encode(dest, ber_class, SILC_BER_ENC_CONSTRUCTED,
-                               tag, d, d_len, FALSE);
-         if (!ret)
-           goto fail;
-       } else {
-         /* Copy the data directly into the tree. */
-         len = silc_buffer_len(node);
-         dest = silc_buffer_srealloc_size(stack1, dest,
-                                          silc_buffer_truelen(dest) + len);
-         if (!dest)
-           goto fail;
-         silc_buffer_put(dest, node->data, len);
-       }
-       break;
-      }
-
-    case SILC_ASN1_TAG_ANY_PRIMITIVE:
-      {
-       /* ANY_PRIMITIVE is any primitive in encoded format. */
-       SilcBuffer prim = va_arg(asn1->ap, SilcBuffer);
-       if (!prim)
-         break;
-
-       /* Encode the primitive data */
-       len = silc_ber_encoded_len(tag, silc_buffer_len(prim), FALSE);
-       dest = silc_buffer_srealloc_size(stack1, dest,
-                                        silc_buffer_truelen(dest) + len);
-       ret = silc_ber_encode(dest, ber_class, SILC_BER_ENC_PRIMITIVE,
-                             tag, prim->data, silc_buffer_len(prim), FALSE);
-       if (!ret)
-         goto fail;
-       break;
-      }
-
-    case SILC_ASN1_TAG_SEQUENCE:
-    case SILC_ASN1_TAG_SET:
-      {
-       /* SEQUENCE/SET is a sequence of types. Sequences are opened and
-          encoded recursively by calling this same encoder. */
-       memset(&buf, 0, sizeof(buf));
-
-       /* Get type, tag and options for the first argument in recursion */
-       SILC_ASN1_ARGS(asn1, rtype, rtag, rclass, ropts);
-
-       silc_stack_push(stack2, &frame);
-       ret = silc_asn1_encoder(asn1, stack2, stack1, rtype, rtag, rclass,
-                               ropts, &buf, depth + 1, FALSE);
-       if (!ret) {
-         SILC_LOG_DEBUG(("Error traversing a SEQUENCE/SET"));
-         silc_stack_pop(stack2);
-         goto fail;
-       }
-
-       /* Encode the sequence */
-       len = silc_ber_encoded_len(tag, silc_buffer_len(&buf), indef);
-       dest = silc_buffer_srealloc_size(stack1, dest,
-                                        silc_buffer_truelen(dest) + len);
-       ret = silc_ber_encode(dest, ber_class, SILC_BER_ENC_CONSTRUCTED,
-                             tag, buf.data, silc_buffer_len(&buf), indef);
-       SILC_ASN1_BUFFER_FREE(&buf, stack2);
-       silc_stack_pop(stack2);
-       if (!ret)
-         goto fail;
-       break;
-      }
-
-    case SILC_ASN1_TAG_INTEGER:
-    case SILC_ASN1_TAG_ENUM:
-      {
-       /* Integer */
-       SilcMPInt *mpint = va_arg(asn1->ap, SilcMPInt *);
-       if (!mpint)
-         break;
-
-       memset(&buf, 0, sizeof(buf));
-       if (silc_mp_cmp_ui(mpint, 0) < 0) {
-         /* XXX TODO, negative integer.  Take 2s complement, then store
-            bytes in 1s complement */
-       } else {
-         /* Positive */
-         len = silc_mp_sizeinbase(mpint, 2);
-         if (!(len & 7))
-           len = ((len + 7) / 8) + 1;
-         else
-           len = (len + 7) / 8;
-         silc_stack_push(stack2, &frame);
-         silc_buffer_srealloc_size(stack2, &buf,
-                                   silc_buffer_truelen(&buf) + len);
-         buf.data[0] = 0x00;
-         silc_mp_mp2bin_noalloc(mpint, buf.data, silc_buffer_len(&buf));
-       }
-
-       /* Encode the integer */
-       len = silc_ber_encoded_len(tag, len, indef);
-       dest = silc_buffer_srealloc_size(stack1, dest,
-                                        silc_buffer_truelen(dest) + len);
-       ret = silc_ber_encode(dest, ber_class, SILC_BER_ENC_PRIMITIVE,
-                             tag, buf.data, silc_buffer_len(&buf), FALSE);
-       SILC_ASN1_BUFFER_FREE(&buf, stack2);
-       silc_stack_pop(stack2);
-       if (!ret)
-         goto fail;
-       break;
-      }
-
-    case SILC_ASN1_TAG_SHORT_INTEGER:
-      {
-       /* Short Integer */
-       SilcUInt32 sint = va_arg(asn1->ap, SilcUInt32);
-       SilcMPInt z;
-
-       if (tag == SILC_ASN1_TAG_SHORT_INTEGER)
-         tag = SILC_ASN1_TAG_INTEGER;
-
-       memset(&buf, 0, sizeof(buf));
-
-       silc_stack_push(stack2, &frame);
-       silc_mp_sinit(stack2, &z);
-       silc_mp_set_ui(&z, sint);
-
-       len = silc_mp_sizeinbase(&z, 2);
-       if (!(len & 7))
-         len = ((len + 7) / 8) + 1;
-       else
-         len = (len + 7) / 8;
-       silc_buffer_srealloc_size(stack2, &buf,
-                                 silc_buffer_truelen(&buf) + len);
-       buf.data[0] = 0x00;
-       silc_mp_mp2bin_noalloc(&z, buf.data, silc_buffer_len(&buf));
-       silc_mp_uninit(&z);
-
-       /* Encode the integer */
-       len = silc_ber_encoded_len(tag, len, indef);
-       dest = silc_buffer_srealloc_size(stack1, dest,
-                                        silc_buffer_truelen(dest) + len);
-       ret = silc_ber_encode(dest, ber_class, SILC_BER_ENC_PRIMITIVE,
-                             tag, buf.data, silc_buffer_len(&buf), FALSE);
-       SILC_ASN1_BUFFER_FREE(&buf, stack2);
-       silc_stack_pop(stack2);
-       if (!ret)
-         goto fail;
-       break;
-      }
-      break;
-
-    case SILC_ASN1_TAG_OID:
-      {
-       /* Object identifier */
-       char *cp, *oidstr = va_arg(asn1->ap, char *);
-       SilcUInt32 words[24], oid, mask;
-       int i, k, c = 0;
-       if (!oidstr)
-         break;
-
-       /* Get OID words from the string */
-       cp = strchr(oidstr, '.');
-       while (cp) {
-         if (sscanf(oidstr, "%u", &oid) != 1) {
-           SILC_LOG_DEBUG(("Malformed OID string"));
-           goto fail;
-         }
-         if (c + 1 > sizeof(words) / sizeof(words[0]))
-           goto fail;
-         words[c++] = oid;
-         oidstr = cp + 1;
-         cp = strchr(oidstr, '.');
-
-         if (!cp) {
-           if (sscanf(oidstr, "%u", &oid) != 1) {
-             SILC_LOG_DEBUG(("Malformed OID string"));
-             goto fail;
-           }
-           if (c + 1 > sizeof(words) / sizeof(words[0]))
-             goto fail;
-           words[c++] = oid;
-           break;
-         }
-       }
-       if (c < 2) {
-         SILC_LOG_DEBUG(("Malfromed OID string"));
-         goto fail;
-       }
-
-       /* Get OID data length */
-       for (i = 2, len = 1; i < c; i++) {
-         if (words[i]) {
-           for (oid = words[i]; oid; oid >>= 7)
-             len++;
-           continue;
-         }
-         len++;
-       }
-
-       /* Encode the OID */
-       memset(&buf, 0, sizeof(buf));
-       silc_stack_push(stack2, &frame);
-       silc_buffer_srealloc_size(stack2, &buf,
-                                 silc_buffer_truelen(&buf) + len);
-       buf.data[0] = words[0] * 40 + words[1];
-       for (i = 2, len = 1; i < c; i++) {
-         oid = words[i];
-         if (oid) {
-           k = len;
-           mask = 0;
-           while (oid) {
-             buf.data[len++] = (oid & 0x7f) | mask;
-             oid >>= 7;
-             mask |= 0x80;
-           }
-           mask = len - 1;
-           while (k < mask) {
-             oid = buf.data[k];
-             buf.data[k] = buf.data[mask];
-             buf.data[mask] = oid;
-             k++;
-             mask--;
-           }
-
-           continue;
-         }
-         buf.data[len++] = 0x00;
-       }
-
-       len = silc_ber_encoded_len(tag, silc_buffer_len(&buf), indef);
-       dest = silc_buffer_srealloc_size(stack1, dest,
-                                        silc_buffer_truelen(dest) + len);
-       ret = silc_ber_encode(dest, ber_class, SILC_BER_ENC_PRIMITIVE,
-                             tag, buf.data, silc_buffer_len(&buf), FALSE);
-       SILC_ASN1_BUFFER_FREE(&buf, stack2);
-       silc_stack_pop(stack2);
-       if (!ret)
-         goto fail;
-       break;
-      }
-
-    case SILC_ASN1_TAG_BOOLEAN:
-      {
-       /* Encodes boolean (TRUE/FALSE) value */
-       unsigned char val[1];
-       val[0] = (va_arg(asn1->ap, SilcUInt32) ? 0xff : 0x00);
-
-       assert(indef == FALSE);
-       len = silc_ber_encoded_len(tag, 1, FALSE);
-       dest = silc_buffer_srealloc_size(stack1, dest,
-                                        silc_buffer_truelen(dest) + len);
-       ret = silc_ber_encode(dest, ber_class, SILC_BER_ENC_PRIMITIVE,
-                             tag, val, 1, FALSE);
-       if (!ret)
-         goto fail;
-       break;
-      }
-
-    case SILC_ASN1_TAG_BIT_STRING:
-      {
-       /* Encode the data as is, with the bit padding. d_len is in bits. */
-       unsigned char *d = va_arg(asn1->ap, unsigned char *);
-       SilcUInt32 d_len = va_arg(asn1->ap, SilcUInt32);
-       unsigned char pad[1];
-       if (!d)
-         break;
-
-       pad[0] = (8 - (d_len & 7)) & 7;
-       d_len = ((d_len + 7) / 8) + 1;
-
-       memset(&buf, 0, sizeof(buf));
-       silc_stack_push(stack2, &frame);
-       silc_buffer_srealloc_size(stack2, &buf,
-                                 silc_buffer_truelen(&buf) + d_len);
-       silc_buffer_put(&buf, pad, 1);
-       silc_buffer_pull(&buf, 1);
-       silc_buffer_put(&buf, d, d_len - 1);
-       silc_buffer_push(&buf, 1);
-
-       len = silc_ber_encoded_len(tag, silc_buffer_len(&buf), indef);
-       dest = silc_buffer_srealloc_size(stack1, dest,
-                                        silc_buffer_truelen(dest) + len);
-       ret = silc_ber_encode(dest, ber_class, SILC_BER_ENC_PRIMITIVE,
-                             tag, buf.data, silc_buffer_len(&buf), indef);
-       SILC_ASN1_BUFFER_FREE(&buf, stack2);
-       silc_stack_pop(stack2);
-       if (!ret)
-         goto fail;
-       break;
-      }
-
-    case SILC_ASN1_TAG_NULL:
-      {
-       /* Encode empty BER block */
-       assert(indef == FALSE);
-       len = silc_ber_encoded_len(tag, 0, FALSE);
-       dest = silc_buffer_srealloc_size(stack1, dest,
-                                        silc_buffer_truelen(dest) + len);
-       ret = silc_ber_encode(dest, ber_class, SILC_BER_ENC_PRIMITIVE,
-                             tag, NULL, 0, FALSE);
-       if (!ret)
-         goto fail;
-       break;
-      }
-
-    case SILC_ASN1_TAG_UTC_TIME:
-      {
-       /* Universal encoded time string */
-       SilcTime timeval = va_arg(asn1->ap, SilcTime);
-       char timestr[32];
-       if (!timeval)
-         break;
-
-       if (!silc_time_universal_string(timeval, timestr, sizeof(timestr))) {
-         SILC_LOG_DEBUG(("Could not encode universal time string"));
-         goto fail;
-       }
-
-       len = silc_ber_encoded_len(tag, strlen(timestr), indef);
-       dest = silc_buffer_srealloc_size(stack1, dest,
-                                        silc_buffer_truelen(dest) + len);
-       ret = silc_ber_encode(dest, ber_class, SILC_BER_ENC_PRIMITIVE,
-                             tag, timestr, strlen(timestr), indef);
-       if (!ret)
-         goto fail;
-       break;
-      }
-
-    case SILC_ASN1_TAG_GENERALIZED_TIME:
-      {
-       /* Generalized encoded time string */
-       SilcTime timeval = va_arg(asn1->ap, SilcTime);
-       char timestr[32];
-       if (!timeval)
-         break;
-
-       if (!silc_time_generalized_string(timeval, timestr, sizeof(timestr))) {
-         SILC_LOG_DEBUG(("Could not encode generalized time string"));
-         goto fail;
-       }
-
-       len = silc_ber_encoded_len(tag, strlen(timestr), indef);
-       dest = silc_buffer_srealloc_size(stack1, dest,
-                                        silc_buffer_truelen(dest) + len);
-       ret = silc_ber_encode(dest, ber_class, SILC_BER_ENC_PRIMITIVE,
-                             tag, timestr, strlen(timestr), indef);
-       if (!ret)
-         goto fail;
-       break;
-      }
-
-    case SILC_ASN1_TAG_UTF8_STRING:
-      {
-       /* UTF-8 string */
-       unsigned char *d = va_arg(asn1->ap, unsigned char *);
-       SilcUInt32 d_len = va_arg(asn1->ap, SilcUInt32);
-       if (!d)
-         break;
-
-       /* By default all strings that get here should already be UTF-8 */
-       if (!silc_utf8_valid(d, d_len)) {
-         SILC_LOG_DEBUG(("Malformed UTF-8 string"));
-         goto fail;
-       }
-
-       len = silc_ber_encoded_len(tag, d_len, indef);
-       dest = silc_buffer_srealloc_size(stack1, dest,
-                                        silc_buffer_truelen(dest) + len);
-       ret = silc_ber_encode(dest, ber_class, SILC_BER_ENC_PRIMITIVE,
-                             tag, d, d_len, indef);
-       if (!ret)
-         goto fail;
-       break;
-      }
-
-    case SILC_ASN1_TAG_OCTET_STRING:
-      {
-       /* Octet string.  Put data as is. */
-       unsigned char *d = va_arg(asn1->ap, unsigned char *);
-       SilcUInt32 d_len = va_arg(asn1->ap, SilcUInt32);
-
-       len = silc_ber_encoded_len(tag, d_len, indef);
-       dest = silc_buffer_srealloc_size(stack1, dest,
-                                        silc_buffer_truelen(dest) + len);
-       ret = silc_ber_encode(dest, ber_class, SILC_BER_ENC_PRIMITIVE,
-                             tag, d, d_len, indef);
-       if (!ret)
-         goto fail;
-       break;
-      }
-
-    case SILC_ASN1_TAG_NUMERIC_STRING:
-      {
-       /* Numerical (digit) string */
-       SILC_ASN1_ENCODE_STRING(SILC_STRING_NUMERICAL);
-       break;
-      }
-
-    case SILC_ASN1_TAG_PRINTABLE_STRING:
-      {
-       /* Printable string */
-       SILC_ASN1_ENCODE_STRING(SILC_STRING_PRINTABLE);
-       break;
-      }
-
-    case SILC_ASN1_TAG_TELETEX_STRING:
-      {
-       /* Teletex (T61) string */
-       SILC_ASN1_ENCODE_STRING(SILC_STRING_TELETEX);
-       break;
-      }
-
-    case SILC_ASN1_TAG_IA5_STRING:
-      {
-       /* US ASCII string */
-       SILC_ASN1_ENCODE_STRING(SILC_STRING_ASCII);
-       break;
-      }
-
-    case SILC_ASN1_TAG_VISIBLE_STRING:
-      {
-       /* Visible string */
-       SILC_ASN1_ENCODE_STRING(SILC_STRING_VISIBLE);
-       break;
-      }
-
-    case SILC_ASN1_TAG_UNIVERSAL_STRING:
-      {
-       /* Universal (UCS-4) string */
-       SILC_ASN1_ENCODE_STRING(SILC_STRING_UNIVERSAL);
-       break;
-      }
-
-    case SILC_ASN1_TAG_UNRESTRICTED_STRING:
-    case SILC_ASN1_TAG_GENERAL_STRING:
-      {
-       /* Handle now unrestricted and general as 8-bit ascii, which
-          probably isn't correct. */
-       SILC_ASN1_ENCODE_STRING(SILC_STRING_ASCII);
-       break;
-      }
-
-    case SILC_ASN1_TAG_BMP_STRING:
-      {
-       /* BMP (UCS-2) string */
-       SILC_ASN1_ENCODE_STRING(SILC_STRING_UNIVERSAL);
-       break;
-      }
-
-    case SILC_ASN1_TAG_ODE:
-    case SILC_ASN1_TAG_ETI:
-    case SILC_ASN1_TAG_REAL:
-    case SILC_ASN1_TAG_EMBEDDED:
-    case SILC_ASN1_TAG_ROI:
-    case SILC_ASN1_TAG_VIDEOTEX_STRING:
-    case SILC_ASN1_TAG_GRAPHIC_STRING:
-      {
-       SILC_NOT_IMPLEMENTED("Unsupported ASN.1 tag");
-       ret = FALSE;
-       goto fail;
-       break;
-      }
-
-    default:
-      SILC_LOG_DEBUG(("Invalid ASN.1 tag `%d'. Cannot encode ASN.1.", type));
-      ret = FALSE;
-      goto fail;
-      break;
-    }
-
-  cont:
-    if (len)
-      silc_buffer_pull(dest, len);
-    if (primitive) {
-      ret = TRUE;
-      goto ok;
-    }
-
-    /* Get next type, tag and options */
-    SILC_ASN1_ARGS(asn1, type, tag, ber_class, opts);
-    if (type == SILC_ASN1_END) {
-      ret = TRUE;
-      goto ok;
-    }
-  }
-
- fail:
-  SILC_LOG_DEBUG(("Error encoding type %d (depth %d)", type, depth));
-
- ok:
-  if (ptr)
-    len = dest->data - ptr;
-  else
-    len = dest->data - dest->head;
-  silc_buffer_push(dest, len);
-
-  return ret;
-}
-
-SilcBool silc_asn1_encode(SilcAsn1 asn1, SilcBuffer dest, ...)
-{
-  SilcAsn1Tag type, tag;
-  SilcAsn1Options opts;
-  SilcBerClass ber_class;
-  SilcStackFrame frame1, frame2;
-  SilcStack stack1 = NULL;
-  SilcBool ret;
-
-  if (!asn1)
-    return FALSE;
-
-  va_start(asn1->ap, dest);
-
-  /* Get the first arguments and call the encoder. */
-  SILC_ASN1_ARGS(asn1, type, tag, ber_class, opts);
-  if (!type) {
-    va_end(asn1->ap);
-    return FALSE;
-  }
-
-  /* Handle internal options for encoder. */
-  if (type == SILC_ASN1_TAG_OPTS) {
-    SilcUInt32 o = va_arg(asn1->ap, SilcUInt32);
-
-    if (o & SILC_ASN1_ALLOC) {
-      /* User wants to alloate everything.  Set the stack to NULL so
-        that stack aware calls revert to normal allocation routines. */
-      stack1 = asn1->stack1;
-      asn1->stack1 = NULL;
-    }
-
-    if (o & SILC_ASN1_ACCUMUL) {
-      /* If accumul flag is not set yet, then push the stack. */
-      if (!asn1->accumul) {
-       silc_stack_push(asn1->stack1, NULL);
-       asn1->accumul = 1;
-      }
-    }
-
-    /* Take again the arguments */
-    SILC_ASN1_ARGS(asn1, type, tag, ber_class, opts);
-  } else {
-    /* No flags set, all flags will be reset. */
-
-    /* If accumul flag is set now pop the stack so that all accumulated
-       memory becomes free again. */
-    if (asn1->accumul) {
-      silc_stack_pop(asn1->stack1);
-      asn1->accumul = 0;
-    }
-  }
-
-  /* Push the stack for normal allocation from stack. */
-  if (!asn1->accumul)
-    silc_stack_push(asn1->stack1, &frame1);
-
-  /* Start encoding */
-  silc_stack_push(asn1->stack2, &frame2);
-  ret = silc_asn1_encoder(asn1, asn1->stack1, asn1->stack2,
-                         type, tag, ber_class, opts, dest, 0, FALSE);
-  silc_stack_pop(asn1->stack2);
-
-  /* Pop the stack to free normal allocations from stack. */
-  if (!asn1->accumul)
-    silc_stack_pop(asn1->stack1);
-
-  /* If SILC_ASN1_ALLOC flag was set, restore the stack. */
-  if (stack1 && !asn1->stack1)
-    asn1->stack1 = stack1;
-
-  va_end(asn1->ap);
-
-  return ret;
-}
diff --git a/lib/silcasn1/silcasn1_i.h b/lib/silcasn1/silcasn1_i.h
deleted file mode 100644 (file)
index bec2cd4..0000000
+++ /dev/null
@@ -1,115 +0,0 @@
-/*
-
-  silcasn1_i.h
-
-  Author: Pekka Riikonen <priikone@silcnet.org>
-
-  Copyright (C) 2003 - 2006 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 SILCASN1_I_H
-#define SILCASN1_I_H
-
-#ifndef SILCASN1_H
-#error "Do not include this header directly"
-#endif
-
-/* ASN.1 context */
-struct SilcAsn1Object {
-  va_list ap;                  /* List of ASN.1 types given as argument */
-  SilcStack stack1;            /* Stack for encoder */
-  SilcStack stack2;            /* Internal stack for encoding/decoding */
-  unsigned int accumul  : 1;   /* Accumulate memory from stack for result */
-};
-
-/* The maximum depth for recursion in encoder and decoder. */
-#define SILC_ASN1_RECURSION_DEPTH 512
-
-/* Implementation specific special tags.  Range is 0x7000 - 0x7fff. */
-#define SILC_ASN1_TAG_ANY           0x7000  /* SILC_ASN1_ANY given  */
-#define SILC_ASN1_TAG_FUNC          0x7001  /* Callback encoder/decoder */
-#define SILC_ASN1_TAG_OPTS          0x7002  /* SILC_ASN1_OPTS given */
-#define SILC_ASN1_TAG_CHOICE        0x7003  /* SILC_ASN1_CHOICE given */
-#define SILC_ASN1_TAG_SEQUENCE_OF   0x7004  /* SILC_ASN1_SEQUENCE_OF given */
-#define SILC_ASN1_TAG_ANY_PRIMITIVE 0x7005  /* Pre-encoded primitive data */
-#define SILC_ASN1_TAG_SHORT_INTEGER 0x7006  /* Short integer */
-
-/* Helper macros for adding the arguments to encoder and decoder. */
-
-/* The arguments to silc_asn1_encode and silc_asn1_decode are constructed
-   as follows:
-
-   The first argument for type is a 32 bit integer where first 15-bits are
-   reserved for the type.  If the bit 16 is set then type and tag are same
-   and next argument is NOT the tag number.  If bit 16 is not set then
-   next argument is a 32 bit tag number.  This then also means that the type
-   is either implicitly or explicitly tagged.  The second 16-bits of the
-   first 32-bits argument is reserved for options.
-
-   Any argument that follow the type and optional tag number argument are
-   type specific arguments.
-
-   The SILC_ASN1_Ux macros set the bit 16, since the type and tag are same,
-   and also options are set to zero (0).
-
-   The SILC_ASN1_Tx macros does not set bit 16, but separate tag argument is
-   provided.  Options may or may not be zero, and they are put at the high
-   16-bits part of the first 32-bit argument.
-*/
-
-#define SILC_ASN1_U0(type) \
-  SILC_ASN1_TAG_ ## type | 0x8000
-#define SILC_ASN1_U1(type, x) \
-  SILC_ASN1_TAG_ ## type | 0x8000, (x)
-#define SILC_ASN1_U2(type, x, xl) \
-  SILC_ASN1_TAG_ ## type | 0x8000, (x), (xl)
-
-#define SILC_ASN1_T0(type, o, t) \
-  SILC_ASN1_TAG_ ## type | (o) << 16, (t)
-#define SILC_ASN1_T1(type, o, t, x) \
-  SILC_ASN1_TAG_ ## type | (o) << 16, (t), (x)
-#define SILC_ASN1_T2(type, o, t, x, xl) \
-  SILC_ASN1_TAG_ ## type | (o) << 16, (t), (x), (xl)
-
-/* Macro to retreive type, options and tag.  The ret_type will include
-   the actual type, ret_class the BER class from options, ret_opts the
-   options (without the class), and ret_tag the tag. */
-#define SILC_ASN1_ARGS(asn1, ret_type, ret_tag, ret_class, ret_opts)   \
-  ret_type = va_arg(asn1->ap, SilcUInt32);                             \
-  ret_tag = ret_class = ret_opts = 0;                                  \
-  if (ret_type != SILC_ASN1_END &&                                     \
-      ret_type != SILC_ASN1_TAG_OPTS) {                                        \
-    if (ret_type & 0x8000)                                             \
-      ret_tag = (ret_type & 0xffff) & ~0x8000;                         \
-    else                                                               \
-      ret_tag = va_arg(asn1->ap, SilcUInt32);                          \
-    ret_class = ret_type >> 16 & 0xf;                                  \
-    ret_opts = ret_type >> 16 & ~0xf;                                  \
-    if (ret_class)                                                     \
-      ret_class--;                                                     \
-    ret_type = (ret_type & 0xffff) & ~0x8000;                          \
-  }
-
-/* Internal functions */
-
-#if defined(SILC_DEBUG)
-/* Returns string representation of a tag */
-const char *silc_asn1_tag_name(SilcAsn1Tag tag);
-#endif /* SILC_DEBUG */
-
-#ifdef SILC_DIST_INPLACE
-/* Dumps the ASN.1 data block into standard output (stdout). */
-SilcBool silc_asn1_dump(SilcAsn1 asn1, SilcBuffer src);
-#endif /* SILC_DIST_INPLACE */
-
-#endif /* SILCASN1_I_H */
diff --git a/lib/silcasn1/silcber.c b/lib/silcasn1/silcber.c
deleted file mode 100644 (file)
index e6f2de3..0000000
+++ /dev/null
@@ -1,269 +0,0 @@
-/*
-
-  silcber.c
-
-  Author: Pekka Riikonen <priikone@silcnet.org>
-
-  Copyright (C) 2003 - 2005 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.
-
-*/
-/* Basic Encoding Rules (BER) encoder and decoder. */
-
-#include "silc.h"
-#include "silcber.h"
-
-/* Encodes a BER data block into the `ber', which must already have
-   sufficient space allocated.  Caller can use silc_ber_encoded_len
-   function to determine how much to allocate space before calling this
-   function.  If the `indefinite' is TRUE then the BER block will not
-   include the length of the data in the BER block. */
-
-SilcBool silc_ber_encode(SilcBuffer ber, SilcBerClass ber_class,
-                        SilcBerEncoding encoding, SilcUInt32 tag,
-                        const unsigned char *data, SilcUInt32 data_len,
-                        SilcBool indefinite)
-{
-  int i = 0, c;
-  SilcUInt32 tmp;
-
-  if (!ber)
-    return FALSE;
-
-  /* Check that buffer is of correct size */
-  if (silc_buffer_len(ber) < silc_ber_encoded_len(tag, data_len, indefinite))
-    return FALSE;
-
-  /* Put the class and encoding */
-  ber->data[i] = (ber_class << 6) | (encoding << 5);
-
-  /* Put the tag */
-  if (tag < 0x1f) {
-    /* Short tag */
-    ber->data[i++] |= tag;
-  } else {
-    /* Long tag */
-    ber->data[i++] |= 0x1f;
-
-    /* Save the tag in multiple octets where 7-bits in the octet is the tag
-       value and bit 8 is set, except for the last octet. */
-    tmp = tag;
-    c = 0;
-    while (tmp) {
-      c++;
-      tmp >>= 7;
-    }
-    while (c > 1)
-      ber->data[i++] = 0x80 | ((tag >> (--c * 7)) & 0x7f);
-    ber->data[i++] = tag & 0x7f;
-  }
-
-  /* Put the length of data */
-  if (!indefinite) {
-    if (data_len < 0x80) {
-      /* Use short form for less than 128 bytes */
-      ber->data[i++] = data_len;
-    } else {
-      /* Long form */
-
-      /* Calculate the number of octets for the length field */
-      tmp = data_len;
-      c = 0;
-      while (tmp) {
-       c++;
-       tmp >>= 8;
-      }
-      ber->data[i++] = 0x80 | c;
-
-      /* Put the actual length field octets, 8-bits per octet. */
-      while (c > 1)
-       ber->data[i++] = (data_len >> (--c * 8)) & 0xff;
-      ber->data[i++] = data_len & 0xff;
-    }
-  } else {
-    /* In indefinite form the length of data is not present in the BER */
-    ber->data[i++] = 0x80;
-  }
-
-  /* Put the data */
-  if (data)
-    memcpy(&ber->data[i], data, data_len);
-
-  /* Put end-of-content octets if length is indefinite */
-  if (indefinite)
-    ber->data[i + data_len] = ber->data[i + data_len + 1] = 0x00;
-
-  return TRUE;
-}
-
-/* Decodesa a BER data from the buffer `ber'.  Returns the class,
-   encoding and the tag number for the BER data into `ber_class',
-   `encoding' and `tag'.  A pointer to the start of the data area is
-   returned into `data'.  If the length of the data is available from
-   the BER data the length is returned into `data_len'.  If the
-   `indefinite' is TRUE then the length found in `data_len' was found
-   by finding end-of-contents octets from the data.  The
-   `identifier_len' is the length of the BER header, and the length
-   of the entire BER object is `identifier_len' + `data_len'. */
-
-SilcBool silc_ber_decode(SilcBuffer ber, SilcBerClass *ber_class,
-                        SilcBerEncoding *encoding, SilcUInt32 *tag,
-                        const unsigned char **data, SilcUInt32 *data_len,
-                        SilcBool *indefinite, SilcUInt32 *identifier_len)
-{
-  int i = 0, c;
-  SilcUInt32 t;
-
-  if (!ber || silc_buffer_len(ber) == 0) {
-    SILC_LOG_DEBUG(("Invalid data buffer"));
-    return FALSE;
-  }
-
-  /* Get class */
-  if (ber_class)
-    *ber_class = (ber->data[0] >> 6) & 0x03;
-
-  /* Get encoding */
-  if (encoding)
-    *encoding = (ber->data[0] >> 5) & 0x01;
-
-  /* Get the tag.  Assume short tag, the most common case */
-  t = ber->data[i++] & 0x1f;
-
-  /* If the tag is over 31 then take it from next octets */
-  if (t >= 0x1f) {
-    if (i >= silc_buffer_len(ber)) {
-      SILC_LOG_DEBUG(("Malformed BER: Not enough bytes"));
-      return FALSE;
-    }
-
-    /* The tag is in next octets in 7-bits parts, parse them out.  All
-       octets except the last one has bit 8 set. */
-    t = 0;
-    while (ber->data[i] & 0x80) {
-      t <<= 7;
-      t |= ber->data[i++] & 0x7f;
-
-      if (i >= silc_buffer_len(ber)) {
-       SILC_LOG_DEBUG(("Malformed BER: Not enough bytes"));
-       return FALSE;
-      }
-    }
-
-    /* Last 7-bits part */
-    t <<= 7;
-    t |= ber->data[i++] & 0x7f;
-  }
-  if (tag)
-    *tag = t;
-
-  if (i >= silc_buffer_len(ber)) {
-    SILC_LOG_DEBUG(("Malformed BER: Not enough bytes"));
-    return FALSE;
-  }
-
-  /* Get the data length and the actual data */
-  if (data && data_len) {
-    /* Assume short format for length */
-    *data_len = ber->data[i++];
-    if (indefinite)
-      *indefinite = FALSE;
-
-    /* The bit 8 is set if the length is in long format */
-    if (*data_len & 0x80) {
-      /* If the format is definite then this octet includes the number
-        of length octets.  If indefinite it is zero and data is ended
-        with end-of-contents octets (two zero bytes). */
-      c = *data_len & 0x7f;
-      if (c) {
-       if (i >= silc_buffer_len(ber)) {
-         SILC_LOG_DEBUG(("Malformed BER: Not enough bytes"));
-         return FALSE;
-       }
-
-       /* Get the length from c many octects (8-bits per octet) */
-       *data_len = 0;
-       while (c > 0) {
-         *data_len <<= 8;
-         *data_len |= ber->data[i++] & 0xff;
-
-         if (i >= silc_buffer_len(ber)) {
-           SILC_LOG_DEBUG(("Malformed BER: Length is too long"));
-           return FALSE;
-         }
-         c--;
-       }
-      } else {
-       /* It is indefinite and we attempt to find out the length by
-          finding the end-of-contents octets. */
-       if (indefinite)
-         *indefinite = TRUE;
-       c = i;
-       while (c + 1 < silc_buffer_len(ber)) {
-         if (ber->data[c] == 0x00 && ber->data[c + 1] == 0x00)
-           break;
-         c += 2;
-       }
-       if (c >= silc_buffer_len(ber)) {
-         SILC_LOG_DEBUG(("Malformed BER: could not find end-of-content"));
-         return FALSE;
-       }
-       *data_len = c - i;
-      }
-    }
-
-    if (*data_len > silc_buffer_len(ber) - i) {
-      SILC_LOG_DEBUG(("Malformed BER: Length is too long"));
-      return FALSE;
-    }
-
-    /* Pointer to data area */
-    *data = (const unsigned char *)ber->data + i;
-  }
-
-  if (identifier_len)
-    *identifier_len = i;
-
-  return TRUE;
-}
-
-/* Calculates the length of the encoded BER data object.  This utility
-   function can be used to calculate how much to allocate space before
-   encoding with silc_ber_encode. */
-
-SilcUInt32 silc_ber_encoded_len(SilcUInt32 tag, SilcUInt32 data_len,
-                               SilcBool indefinite)
-{
-  SilcUInt32 len, tmp;
-
-  len = 1;
-  if (tag >= 0x1f) {
-    while (tag) {
-      len++;
-      tag >>= 7;
-    }
-  }
-
-  len++;
-  if (!indefinite) {
-    if (data_len >= 0x80) {
-      tmp = data_len;
-      while (tmp) {
-       len++;
-       tmp >>= 8;
-      }
-    }
-  } else {
-    len += 2;
-  }
-
-  return len + data_len;
-}
diff --git a/lib/silcasn1/silcber.h b/lib/silcasn1/silcber.h
deleted file mode 100644 (file)
index 8c0ec69..0000000
+++ /dev/null
@@ -1,143 +0,0 @@
-/*
-
-  silcber.h
-
-  Author: Pekka Riikonen <priikone@silcnet.org>
-
-  Copyright (C) 2003 - 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.
-
-*/
-
-/****h* silcasn1/BER Interface
- *
- * DESCRIPTION
- *
- * The Basic Encoding Rules (BER) is the data encoding format for the
- * ASN.1.  This interface provides routines for encoding and decoding
- * arbitraty BER data blocks.  Naturally, this interface can be used
- * to encode and decode DER blocks as well.  These routines does not
- * allocate any memory and have been optimized for general ASN.1 usage.
- *
- * References: ITU-T X.690
- * http://www.itu.int/ITU-T/studygroups/com17/languages/X690_0702.pdf
- *
- ***/
-
-#ifndef SILCBER_H
-#define SILCBER_H
-
-/****d* silcasn1/SilcBerAPI/SilcBerClass
- *
- * NAME
- *
- *    typedef enum { ... } SilcBerClass;
- *
- * DESCRIPTION
- *
- *    Defines the BER classes.
- *
- ***/
-typedef enum {
-  SILC_BER_CLASS_UNIVERSAL       = 0x00,   /* Universal */
-  SILC_BER_CLASS_APPLICATION     = 0x01,   /* Application */
-  SILC_BER_CLASS_CONTEXT         = 0x02,   /* Context-specific */
-  SILC_BER_CLASS_PRIVATE         = 0x03,   /* Private */
-} SilcBerClass;
-/***/
-
-/****d* silcasn1/SilcBerAPI/SilcBerEncoding
- *
- * NAME
- *
- *    typedef enum { ... } SilcBerEncoding;
- *
- * DESCRIPTION
- *
- *    Defines the BER encoding type.
- *
- ***/
-typedef enum {
-  SILC_BER_ENC_PRIMITIVE         = 0x00,
-  SILC_BER_ENC_CONSTRUCTED       = 0x01,
-} SilcBerEncoding;
-/***/
-
-/****f* silcasn1/SilcBerAPI/silc_ber_encode
- *
- * SYNOPSIS
- *
- *    SilcBool
- *    silc_ber_encode(SilcBuffer ber, SilcBerClass ber_class,
- *                    SilcBerEncoding encoding, SilcUInt32 tag,
- *                    const unsigned char *data, SilcUInt32 data_len,
- *                    SilcBool indefinite);
- *
- * DESCRIPTION
- *
- *    Encodes a BER data block into the `ber', which must already have
- *    sufficient space allocated.  Caller can use silc_ber_encoded_len
- *    function to determine how much to allocate space before calling this
- *    function.  If the `indefinite' is TRUE then the BER block will not
- *    include the length of the data in the BER block.
- *
- ***/
-SilcBool silc_ber_encode(SilcBuffer ber, SilcBerClass ber_class,
-                        SilcBerEncoding encoding, SilcUInt32 tag,
-                        const unsigned char *data, SilcUInt32 data_len,
-                        SilcBool indefinite);
-
-/****f* silcasn1/SilcBerAPI/silc_ber_decode
- *
- * SYNOPSIS
- *
- *    SilcBool
- *    silc_ber_decode(SilcBuffer ber, SilcBerClass *ber_class,
- *                    SilcBerEncoding *encoding, SilcUInt32 *tag,
- *                    const unsigned char **data, SilcUInt32 *data_len,
- *                    SilcBool *indefinite, SilcUInt32 *identifier_len);
- *
- * DESCRIPTION
- *
- *    Decodesa a BER data from the buffer `ber'.  Returns the class,
- *    encoding and the tag number for the BER data into `ber_class',
- *    `encoding' and `tag'.  A pointer to the start of the data area is
- *    returned into `data'.  If the length of the data is available from
- *    the BER data the length is returned into `data_len'.  If the
- *    `indefinite' is TRUE then the length found in `data_len' was found
- *    by finding end-of-contents octets from the BER data.  The
- *    `identifier_len' is the length of the BER header, and the length
- *    of the entire BER object is `identifier_len' + `data_len'.
- *
- ***/
-SilcBool silc_ber_decode(SilcBuffer ber, SilcBerClass *ber_class,
-                        SilcBerEncoding *encoding, SilcUInt32 *tag,
-                        const unsigned char **data, SilcUInt32 *data_len,
-                        SilcBool *indefinite, SilcUInt32 *identifier_len);
-
-/****f* silcasn1/SilcBerAPI/silc_ber_encoded_len
- *
- * SYNOPSIS
- *
- *    SilcUInt32 silc_ber_encoded_len(SilcUInt32 tag, SilcUInt32 data_len,
- *                                    SilcBool indefinite);
- *
- * DESCRIPTION
- *
- *    Calculates the length of the encoded BER data object.  This utility
- *    function can be used to calculate how much to allocate space before
- *    encoding with silc_ber_encode.
- *
- ***/
-SilcUInt32 silc_ber_encoded_len(SilcUInt32 tag, SilcUInt32 data_len,
-                               SilcBool indefinite);
-
-#endif /* SILCBER_H */
diff --git a/lib/silcasn1/tests/Makefile.am b/lib/silcasn1/tests/Makefile.am
deleted file mode 100644 (file)
index e7e5dae..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-#
-#  Makefile.am
-#
-#  Author: Pekka Riikonen <priikone@silcnet.org>
-#
-#  Copyright (C) 2003 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.
-#
-
-AUTOMAKE_OPTIONS = 1.0 no-dependencies foreign
-
-bin_PROGRAMS = test_silcasn1
-
-test_silcasn1_SOURCES = test_silcasn1.c
-
-LIBS = $(SILC_COMMON_LIBS)
-LDADD = -L.. -L../.. -lsilc -lsilcasn1
-
-include $(top_srcdir)/Makefile.defines.in
diff --git a/lib/silcasn1/tests/test_silcasn1.c b/lib/silcasn1/tests/test_silcasn1.c
deleted file mode 100644 (file)
index 74bd8c8..0000000
+++ /dev/null
@@ -1,754 +0,0 @@
-#include "silc.h"
-
-/*
-silc_asn1_encode(asn1, node,
-                SILC_ASN1_BOOLEAN(SilcBool),
-                SILC_ASN1_END);
-silc_asn1_encode(asn1, dest,
-                SILC_ASN1_SEQUENCE_T(SILC_ASN1_PRIVATE, 101),
-                  SILC_ASN1_SEQUENCE_T(0, 9),
-                    SILC_ASN1_SEQUENCE,
-                      SILC_ASN1_ANY_T(0, 33, node),
-                      SILC_ASN1_BOOLEAN_T(0, 4, boolv),
-                      SILC_ASN1_BOOLEAN(SilcBool),
-                    SILC_ASN1_END,
-                  SILC_ASN1_END,
-                SILC_ASN1_END);
-
-  FATAL ERROR: Adding primitive node with implicit tagging is not possible.
-  The node either must be constructed (SEQUENCE or SET), or the tagging
-  must be explicit (in which case end result is same).
-*/
-
-
-/*
-silc_asn1_encode(asn1, node,
-                SILC_ASN1_BOOLEAN(SilcBool),
-                SILC_ASN1_END);
-silc_asn1_encode(asn1, dest,
-                SILC_ASN1_SEQUENCE_T(SILC_ASN1_PRIVATE, 101),
-                  SILC_ASN1_SEQUENCE_T(0, 9),
-                    SILC_ASN1_SEQUENCE,
-                      SILC_ASN1_ANY_T(SILC_ASN1_EXPLICIT, 33, node),
-                      SILC_ASN1_BOOLEAN_T(0, 4, boolv),
-                      SILC_ASN1_BOOLEAN(SilcBool),
-                    SILC_ASN1_END,
-                  SILC_ASN1_END,
-                SILC_ASN1_END);
-
-  CORRECT: the tagging is now explicit.  Also note that tagging primitive
-  node explicitly is analougous of having a constructed node and tagging
-  that implicitly: the end result is same.
-
-*/
-
-
-int main(int argc, char **argv)
-{
-  SilcBufferStruct node, node2;
-  SilcAsn1 asn1;
-  SilcBool success = FALSE;
-  SilcBool val = TRUE;
-  int i;
-  unsigned char *str;
-  SilcUInt32 str_len, tmpint;
-  char tmp[32];
-  SilcRng rng;
-  SilcMPInt mpint, mpint2;
-
-  memset(&node, 0, sizeof(node));
-  memset(&node2, 0, sizeof(node2));
-
-  if (argc > 1 && !strcmp(argv[1], "-d")) {
-    silc_log_debug(TRUE);
-    silc_log_debug_hexdump(TRUE);
-    silc_log_set_debug_string("*asn1*,*ber*");
-  }
-
-  silc_hash_register_default();
-  rng = silc_rng_alloc();
-  silc_rng_init(rng);
-
-  SILC_LOG_DEBUG(("Allocating ASN.1 context"));
-  asn1 = silc_asn1_alloc();
-  if (!asn1)
-    goto out;
-
-  SILC_LOG_DEBUG(("Encoding ASN.1 tree 1"));
-  val = 1;
-  success =
-    silc_asn1_encode(asn1, &node,
-                    SILC_ASN1_SEQUENCE,
-                      SILC_ASN1_SEQUENCE_T(SILC_ASN1_EXPLICIT, 9),
-                        SILC_ASN1_SEQUENCE_T(SILC_ASN1_EXPLICIT |
-                                             SILC_ASN1_INDEFINITE, 0),
-                          SILC_ASN1_BOOLEAN_T(0, 4, val),
-                          SILC_ASN1_BOOLEAN(val),
-                        SILC_ASN1_END,
-                      SILC_ASN1_END,
-                    SILC_ASN1_END, SILC_ASN1_END);
-  if (!success) {
-    SILC_LOG_DEBUG(("Encoding failed"));
-    goto out;
-  }
-  SILC_LOG_DEBUG(("Encoding success"));
-  SILC_LOG_HEXDUMP(("ASN.1 tree"), node.data, silc_buffer_len(&node));
-  SILC_LOG_DEBUG(("Decoding ASN.1 tree 1"));
-  success =
-    silc_asn1_decode(asn1, &node,
-                    SILC_ASN1_SEQUENCE,
-                      SILC_ASN1_SEQUENCE_T(SILC_ASN1_EXPLICIT, 9),
-                        SILC_ASN1_SEQUENCE_T(SILC_ASN1_EXPLICIT |
-                                             SILC_ASN1_INDEFINITE, 0),
-                          SILC_ASN1_BOOLEAN_T(0, 4, &val),
-                          SILC_ASN1_BOOLEAN(&val),
-                        SILC_ASN1_END,
-                      SILC_ASN1_END,
-                    SILC_ASN1_END, SILC_ASN1_END);
-  if (!success) {
-    SILC_LOG_DEBUG(("Decoding failed"));
-    goto out;
-  }
-  SILC_LOG_DEBUG(("Decoding success"));
-  SILC_LOG_DEBUG(("Boolean val %d", val));
-
-#if 1
-  memset(&node, 0, sizeof(node));
-  SILC_LOG_DEBUG(("Encoding ASN.1 tree 1"));
-  val = 0;
-  success =
-    silc_asn1_encode(asn1, &node,
-                    SILC_ASN1_SEQUENCE,
-                      SILC_ASN1_SEQUENCE_T(SILC_ASN1_EXPLICIT, 9),
-                        SILC_ASN1_SEQUENCE_T(SILC_ASN1_EXPLICIT |
-                                             SILC_ASN1_INDEFINITE, 0),
-                          SILC_ASN1_BOOLEAN_T(0, 4, val),
-                          SILC_ASN1_BOOLEAN(val),
-                        SILC_ASN1_END,
-                      SILC_ASN1_END,
-                    SILC_ASN1_END, SILC_ASN1_END);
-  if (!success) {
-    SILC_LOG_DEBUG(("Encoding failed"));
-    goto out;
-  }
-  SILC_LOG_DEBUG(("Encoding success"));
-  SILC_LOG_HEXDUMP(("ASN.1 tree"), node.data, silc_buffer_len(&node));
-  SILC_LOG_DEBUG(("Decoding ASN.1 tree 1"));
-  success =
-    silc_asn1_decode(asn1, &node,
-                    SILC_ASN1_SEQUENCE,
-                      SILC_ASN1_SEQUENCE_T(SILC_ASN1_EXPLICIT, 9),
-                        SILC_ASN1_SEQUENCE_T(SILC_ASN1_EXPLICIT |
-                                             SILC_ASN1_INDEFINITE, 0),
-                          SILC_ASN1_BOOLEAN_T(0, 4, &val),
-                          SILC_ASN1_BOOLEAN(&val),
-                        SILC_ASN1_END,
-                      SILC_ASN1_END,
-                    SILC_ASN1_END, SILC_ASN1_END);
-  if (!success) {
-    SILC_LOG_DEBUG(("Decoding failed"));
-    goto out;
-  }
-  SILC_LOG_DEBUG(("Decoding success"));
-  SILC_LOG_DEBUG(("Boolean val %d", val));
-  printf("\n");
-
-
-  memset(&node, 0, sizeof(node));
-  SILC_LOG_DEBUG(("Encoding ASN.1 tree 2"));
-  val = 1;
-  success =
-    silc_asn1_encode(asn1, &node,
-                    SILC_ASN1_SEQUENCE,
-                      SILC_ASN1_SEQUENCE_T(SILC_ASN1_EXPLICIT, 9),
-                        SILC_ASN1_SEQUENCE_T(SILC_ASN1_INDEFINITE, 0),
-                          SILC_ASN1_BOOLEAN_T(0, 4, val),
-                          SILC_ASN1_BOOLEAN(val),
-                        SILC_ASN1_END,
-                      SILC_ASN1_END,
-                    SILC_ASN1_END, SILC_ASN1_END);
-  if (!success) {
-    SILC_LOG_DEBUG(("Encoding failed"));
-    goto out;
-  }
-  SILC_LOG_DEBUG(("Encoding success"));
-  SILC_LOG_HEXDUMP(("ASN.1 tree"), node.data, silc_buffer_len(&node));
-  SILC_LOG_DEBUG(("Decoding ASN.1 tree 2"));
-  success =
-    silc_asn1_decode(asn1, &node,
-                    SILC_ASN1_SEQUENCE,
-                      SILC_ASN1_SEQUENCE_T(SILC_ASN1_EXPLICIT, 9),
-                        SILC_ASN1_SEQUENCE_T(SILC_ASN1_INDEFINITE, 0),
-                          SILC_ASN1_BOOLEAN_T(0, 4, &val),
-                          SILC_ASN1_BOOLEAN(&val),
-                        SILC_ASN1_END,
-                      SILC_ASN1_END,
-                    SILC_ASN1_END, SILC_ASN1_END);
-  if (!success) {
-    SILC_LOG_DEBUG(("Decoding failed"));
-    goto out;
-  }
-  SILC_LOG_DEBUG(("Decoding success"));
-  SILC_LOG_DEBUG(("Boolean val %d", val));
-  printf("\n");
-
-
-  memset(&node, 0, sizeof(node));
-  SILC_LOG_DEBUG(("Encoding ASN.1 tree 3"));
-  val = 0;
-  success =
-    silc_asn1_encode(asn1, &node,
-                    SILC_ASN1_SEQUENCE,
-                      SILC_ASN1_SEQUENCE_T(0, 9),
-                        SILC_ASN1_SEQUENCE,
-                          SILC_ASN1_BOOLEAN_T(0, 4, val),
-                          SILC_ASN1_BOOLEAN(val),
-                        SILC_ASN1_END,
-                      SILC_ASN1_END,
-                    SILC_ASN1_END, SILC_ASN1_END);
-  if (!success) {
-    SILC_LOG_DEBUG(("Encoding failed"));
-    goto out;
-  }
-  SILC_LOG_DEBUG(("Encoding success"));
-  SILC_LOG_HEXDUMP(("ASN.1 tree"), node.data, silc_buffer_len(&node));
-  SILC_LOG_DEBUG(("Decoding ASN.1 tree 3"));
-  success =
-    silc_asn1_decode(asn1, &node,
-                    SILC_ASN1_SEQUENCE,
-                      SILC_ASN1_SEQUENCE_T(0, 9),
-                        SILC_ASN1_SEQUENCE,
-                          SILC_ASN1_BOOLEAN_T(0, 4, &val),
-                          SILC_ASN1_BOOLEAN(&val),
-                        SILC_ASN1_END,
-                      SILC_ASN1_END,
-                    SILC_ASN1_END, SILC_ASN1_END);
-  if (!success) {
-    SILC_LOG_DEBUG(("Decoding failed"));
-    goto out;
-  }
-  SILC_LOG_DEBUG(("Decoding success"));
-  SILC_LOG_DEBUG(("Boolean val %d", val));
-  printf("\n");
-
-
-  memset(&node, 0, sizeof(node));
-  SILC_LOG_DEBUG(("Encoding ASN.1 tree 4"));
-  val = 1;
-  success =
-    silc_asn1_encode(asn1, &node,
-                    SILC_ASN1_SEQUENCE_T(SILC_ASN1_PRIVATE |
-                                         SILC_ASN1_EXPLICIT, 101),
-                      SILC_ASN1_SEQUENCE_T(0, 9),
-                        SILC_ASN1_SEQUENCE,
-                          SILC_ASN1_BOOLEAN_T(0, 4, val),
-                          SILC_ASN1_BOOLEAN(val),
-                        SILC_ASN1_END,
-                      SILC_ASN1_END,
-                    SILC_ASN1_END, SILC_ASN1_END);
-  if (!success) {
-    SILC_LOG_DEBUG(("Encoding failed"));
-    goto out;
-  }
-  SILC_LOG_DEBUG(("Encoding success"));
-  SILC_LOG_HEXDUMP(("ASN.1 tree"), node.data, silc_buffer_len(&node));
-  SILC_LOG_DEBUG(("Decoding ASN.1 tree 4"));
-  success =
-    silc_asn1_decode(asn1, &node,
-                    SILC_ASN1_SEQUENCE_T(SILC_ASN1_PRIVATE |
-                                         SILC_ASN1_EXPLICIT, 101),
-                      SILC_ASN1_SEQUENCE_T(0, 9),
-                        SILC_ASN1_SEQUENCE,
-                          SILC_ASN1_BOOLEAN_T(0, 4, &val),
-                          SILC_ASN1_BOOLEAN(&val),
-                        SILC_ASN1_END,
-                      SILC_ASN1_END,
-                    SILC_ASN1_END, SILC_ASN1_END);
-  if (!success) {
-    SILC_LOG_DEBUG(("Decoding failed"));
-    goto out;
-  }
-  SILC_LOG_DEBUG(("Decoding success"));
-  SILC_LOG_DEBUG(("Boolean val %d", val));
-  printf("\n");
-
-
-  memset(&node, 0, sizeof(node));
-  SILC_LOG_DEBUG(("Encoding ASN.1 tree 5"));
-  success =
-    silc_asn1_encode(asn1, &node2,
-                    SILC_ASN1_BOOLEAN(val),
-                    SILC_ASN1_END);
-  SILC_LOG_DEBUG(("Encoding success"));
-  success =
-    silc_asn1_encode(asn1, &node,
-                    SILC_ASN1_SEQUENCE_T(SILC_ASN1_PRIVATE, 101),
-                      SILC_ASN1_SEQUENCE_T(0, 9),
-                        SILC_ASN1_SEQUENCE,
-                          SILC_ASN1_ANY(&node2),
-                          SILC_ASN1_BOOLEAN_T(0, 4, val),
-                          SILC_ASN1_BOOLEAN(val),
-                        SILC_ASN1_END,
-                      SILC_ASN1_END,
-                    SILC_ASN1_END, SILC_ASN1_END);
-  if (!success) {
-    SILC_LOG_DEBUG(("Encoding failed"));
-    goto out;
-  }
-  SILC_LOG_DEBUG(("Encoding success"));
-  SILC_LOG_HEXDUMP(("ASN.1 tree"), node.data, silc_buffer_len(&node));
-  memset(&node2, 0, sizeof(node2));
-  SILC_LOG_DEBUG(("Decoding ASN.1 tree 5"));
-  success =
-    silc_asn1_decode(asn1, &node,
-                    SILC_ASN1_SEQUENCE_T(SILC_ASN1_PRIVATE, 101),
-                      SILC_ASN1_SEQUENCE_T(0, 9),
-                        SILC_ASN1_SEQUENCE,
-                          SILC_ASN1_ANY(&node2),
-                          SILC_ASN1_BOOLEAN_T(0, 4, &val),
-                          SILC_ASN1_BOOLEAN(&val),
-                        SILC_ASN1_END,
-                      SILC_ASN1_END,
-                    SILC_ASN1_END, SILC_ASN1_END);
-  if (!success) {
-    SILC_LOG_DEBUG(("Decoding failed"));
-    goto out;
-  }
-  SILC_LOG_DEBUG(("Decoding success"));
-  SILC_LOG_DEBUG(("Boolean val %d", val));
-  success =
-    silc_asn1_decode(asn1, &node2,
-                    SILC_ASN1_BOOLEAN(&val),
-                    SILC_ASN1_END);
-  if (!success) {
-    SILC_LOG_DEBUG(("Decoding failed"));
-    goto out;
-  }
-  SILC_LOG_DEBUG(("Decoding success"));
-  SILC_LOG_DEBUG(("Boolean val %d", val));
-  memset(&node2, 0, sizeof(node2));
-  printf("\n");
-
-
-  memset(&node, 0, sizeof(node));
-  SILC_LOG_DEBUG(("Encoding ASN.1 tree (ANY_PRIMITIVE)"));
-  memset(tmp, 0, sizeof(tmp));
-  tmp[0] = 0xff;
-  silc_buffer_set(&node2, tmp, 1);
-  SILC_LOG_DEBUG(("Encoding success"));
-  success =
-    silc_asn1_encode(asn1, &node,
-                    SILC_ASN1_SEQUENCE,
-                      SILC_ASN1_ANY_PRIMITIVE(SILC_ASN1_TAG_BOOLEAN,
-                                              &node2),
-                    SILC_ASN1_END, SILC_ASN1_END);
-  if (!success) {
-    SILC_LOG_DEBUG(("Encoding failed"));
-    goto out;
-  }
-  SILC_LOG_DEBUG(("Encoding success"));
-  SILC_LOG_HEXDUMP(("ASN.1 tree"), node.data, silc_buffer_len(&node));
-  memset(&node2, 0, sizeof(node2));
-  SILC_LOG_DEBUG(("Decoding ASN.1 tree (ANY_PRIMITIVE)"));
-  success =
-    silc_asn1_decode(asn1, &node,
-                    SILC_ASN1_SEQUENCE,
-                      SILC_ASN1_ANY_PRIMITIVE(SILC_ASN1_TAG_BOOLEAN,
-                                              &node2),
-                    SILC_ASN1_END, SILC_ASN1_END);
-  if (!success) {
-    SILC_LOG_DEBUG(("Decoding failed"));
-    goto out;
-  }
-  SILC_LOG_DEBUG(("Boolean val %d", node2.data[0]));
-  if (node2.data[0] != 0xff) {
-    SILC_LOG_DEBUG(("Decoding failed"));
-    goto out;
-  }
-  SILC_LOG_DEBUG(("Decoding success"));
-  memset(&node, 0, sizeof(node));
-  SILC_LOG_DEBUG(("Encoding ASN.1 tree (ANY_PRIMITIVE)"));
-  memset(tmp, 0, sizeof(tmp));
-  tmp[0] = 0xff;
-  silc_buffer_set(&node2, tmp, 1);
-  SILC_LOG_DEBUG(("Encoding success"));
-  success =
-    silc_asn1_encode(asn1, &node,
-                    SILC_ASN1_SEQUENCE,
-                      SILC_ASN1_ANY_PRIMITIVE(SILC_ASN1_TAG_BOOLEAN,
-                                              &node2),
-                    SILC_ASN1_END, SILC_ASN1_END);
-  if (!success) {
-    SILC_LOG_DEBUG(("Encoding failed"));
-    goto out;
-  }
-  SILC_LOG_DEBUG(("Encoding success"));
-  SILC_LOG_HEXDUMP(("ASN.1 tree"), node.data, silc_buffer_len(&node));
-  memset(&node2, 0, sizeof(node2));
-  SILC_LOG_DEBUG(("Decoding ASN.1 tree (ANY_PRIMITIVE)"));
-  success =
-    silc_asn1_decode(asn1, &node,
-                    SILC_ASN1_SEQUENCE,
-                      SILC_ASN1_BOOLEAN(&val),
-                    SILC_ASN1_END, SILC_ASN1_END);
-  if (!success) {
-    SILC_LOG_DEBUG(("Decoding failed"));
-    goto out;
-  }
-  SILC_LOG_DEBUG(("Decoding success"));
-  SILC_LOG_DEBUG(("Boolean val %d", val));
-  memset(&node, 0, sizeof(node));
-  SILC_LOG_DEBUG(("Encoding ASN.1 tree (ANY_PRIMITIVE)"));
-  memset(tmp, 0, sizeof(tmp));
-  tmp[0] = 0xff;
-  silc_buffer_set(&node2, tmp, 1);
-  SILC_LOG_DEBUG(("Encoding success"));
-  success =
-    silc_asn1_encode(asn1, &node,
-                    SILC_ASN1_SEQUENCE,
-                      SILC_ASN1_BOOLEAN(val),
-                    SILC_ASN1_END, SILC_ASN1_END);
-  if (!success) {
-    SILC_LOG_DEBUG(("Encoding failed"));
-    goto out;
-  }
-  SILC_LOG_DEBUG(("Encoding success"));
-  SILC_LOG_HEXDUMP(("ASN.1 tree"), node.data, silc_buffer_len(&node));
-  memset(&node2, 0, sizeof(node2));
-  SILC_LOG_DEBUG(("Decoding ASN.1 tree (ANY_PRIMITIVE)"));
-  success =
-    silc_asn1_decode(asn1, &node,
-                    SILC_ASN1_SEQUENCE,
-                      SILC_ASN1_ANY_PRIMITIVE(SILC_ASN1_TAG_BOOLEAN,
-                                              &node2),
-                    SILC_ASN1_END, SILC_ASN1_END);
-  if (!success) {
-    SILC_LOG_DEBUG(("Decoding failed"));
-    goto out;
-  }
-  SILC_LOG_DEBUG(("Boolean val %d", node2.data[0]));
-  if (node2.data[0] != 0xff) {
-    SILC_LOG_DEBUG(("Decoding failed"));
-    goto out;
-  }
-  SILC_LOG_DEBUG(("Decoding success"));
-  memset(&node2, 0, sizeof(node2));
-  printf("\n");
-
-
-  memset(&node, 0, sizeof(node));
-  SILC_LOG_DEBUG(("Encoding ASN.1 tree 6"));
-  success =
-    silc_asn1_encode(asn1, &node2,
-                    SILC_ASN1_BOOLEAN(val),
-                    SILC_ASN1_END);
-  SILC_LOG_DEBUG(("Encoding success"));
-  success =
-    silc_asn1_encode(asn1, &node,
-                    SILC_ASN1_SEQUENCE_T(SILC_ASN1_PRIVATE, 101),
-                      SILC_ASN1_SEQUENCE_T(0, 9),
-                        SILC_ASN1_SEQUENCE,
-                          SILC_ASN1_ANY_T(SILC_ASN1_EXPLICIT, 33, &node2),
-                          SILC_ASN1_BOOLEAN_T(0, 4, val),
-                          SILC_ASN1_BOOLEAN(val),
-                        SILC_ASN1_END,
-                      SILC_ASN1_END,
-                    SILC_ASN1_END, SILC_ASN1_END);
-  if (!success) {
-    SILC_LOG_DEBUG(("Encoding failed"));
-    goto out;
-  }
-  SILC_LOG_DEBUG(("Encoding success"));
-  SILC_LOG_HEXDUMP(("ASN.1 tree"), node.data, silc_buffer_len(&node));
-  memset(&node2, 0, sizeof(node2));
-  SILC_LOG_DEBUG(("Decoding ASN.1 tree 6"));
-  success =
-    silc_asn1_decode(asn1, &node,
-                    SILC_ASN1_SEQUENCE_T(SILC_ASN1_PRIVATE, 101),
-                      SILC_ASN1_SEQUENCE_T(0, 9),
-                        SILC_ASN1_SEQUENCE,
-                          SILC_ASN1_ANY_T(SILC_ASN1_EXPLICIT, 33, &node2),
-                          SILC_ASN1_BOOLEAN_T(0, 4, &val),
-                          SILC_ASN1_BOOLEAN(&val),
-                        SILC_ASN1_END,
-                      SILC_ASN1_END,
-                    SILC_ASN1_END, SILC_ASN1_END);
-  if (!success) {
-    SILC_LOG_DEBUG(("Decoding failed"));
-    goto out;
-  }
-  SILC_LOG_DEBUG(("Decoding success"));
-  SILC_LOG_DEBUG(("Boolean val %d", val));
-  success =
-    silc_asn1_decode(asn1, &node2,
-                    SILC_ASN1_BOOLEAN(&val),
-                    SILC_ASN1_END);
-  if (!success) {
-    SILC_LOG_DEBUG(("Decoding failed"));
-    goto out;
-  }
-  SILC_LOG_DEBUG(("Decoding success"));
-  SILC_LOG_DEBUG(("Boolean val %d", val));
-  memset(&node2, 0, sizeof(node2));
-  printf("\n");
-
-
-  memset(&node, 0, sizeof(node));
-  SILC_LOG_DEBUG(("Encoding ASN.1 tree 7"));
-  val = 0;
-  success =
-    silc_asn1_encode(asn1, &node2,
-                    SILC_ASN1_SEQUENCE,
-                      SILC_ASN1_BOOLEAN(val),
-                      SILC_ASN1_BOOLEAN(val),
-                      SILC_ASN1_BOOLEAN(val),
-                      SILC_ASN1_BOOLEAN(val),
-                    SILC_ASN1_END, SILC_ASN1_END);
-  SILC_LOG_DEBUG(("Encoding success"));
-  val = 1;
-  success =
-    silc_asn1_encode(asn1, &node,
-                    SILC_ASN1_SEQUENCE_T(SILC_ASN1_PRIVATE, 101),
-                      SILC_ASN1_SEQUENCE_T(0, 9),
-                        SILC_ASN1_SEQUENCE,
-                          SILC_ASN1_ANY_T(0, 11, &node2),
-                          SILC_ASN1_BOOLEAN_T(0, 4, val),
-                          SILC_ASN1_BOOLEAN(val),
-                        SILC_ASN1_END,
-                      SILC_ASN1_END,
-                    SILC_ASN1_END, SILC_ASN1_END);
-  if (!success) {
-    SILC_LOG_DEBUG(("Encoding failed"));
-    goto out;
-  }
-  SILC_LOG_DEBUG(("Encoding success"));
-  SILC_LOG_HEXDUMP(("ASN.1 tree"), node.data, silc_buffer_len(&node));
-  memset(&node2, 0, sizeof(node2));
-  SILC_LOG_DEBUG(("Decoding ASN.1 tree 7"));
-  success =
-    silc_asn1_decode(asn1, &node,
-                    SILC_ASN1_SEQUENCE_T(SILC_ASN1_PRIVATE, 101),
-                      SILC_ASN1_SEQUENCE_T(0, 9),
-                        SILC_ASN1_SEQUENCE,
-                          SILC_ASN1_ANY_T(0, 11, &node2), /* NOTE: tag */
-                          SILC_ASN1_BOOLEAN_T(0, 4, &val),
-                          SILC_ASN1_BOOLEAN(&val),
-                        SILC_ASN1_END,
-                      SILC_ASN1_END,
-                    SILC_ASN1_END, SILC_ASN1_END);
-  if (!success) {
-    SILC_LOG_DEBUG(("Decoding failed"));
-    goto out;
-  }
-  SILC_LOG_DEBUG(("Decoding success"));
-  SILC_LOG_DEBUG(("Boolean val %d", val));
-  success =
-    silc_asn1_decode(asn1, &node2,
-                    SILC_ASN1_SEQUENCE_T(0, 11), /* NOTE: using implicit
-                                                    tag! */
-                      SILC_ASN1_BOOLEAN(&val),
-                      SILC_ASN1_BOOLEAN(&val),
-                      SILC_ASN1_BOOLEAN(&val),
-                      SILC_ASN1_BOOLEAN(&val),
-                    SILC_ASN1_END, SILC_ASN1_END);
-  if (!success) {
-    SILC_LOG_DEBUG(("Decoding failed"));
-    goto out;
-  }
-  SILC_LOG_DEBUG(("Decoding success"));
-  SILC_LOG_DEBUG(("Boolean val %d", val));
-  memset(&node2, 0, sizeof(node2));
-  printf("\n");
-
-
-  memset(&node, 0, sizeof(node));
-  SILC_LOG_DEBUG(("Encoding ASN.1 tree 8"));
-  success =
-    silc_asn1_encode(asn1, &node,
-                    SILC_ASN1_SEQUENCE,
-                      SILC_ASN1_BOOLEAN_T(SILC_ASN1_IMPLICIT, 9999, val),
-                    SILC_ASN1_END, SILC_ASN1_END);
-  if (!success) {
-    SILC_LOG_DEBUG(("Encoding failed"));
-    goto out;
-  }
-  SILC_LOG_DEBUG(("Encoding success"));
-  SILC_LOG_HEXDUMP(("ASN.1 tree"), node.data, silc_buffer_len(&node));
-  SILC_LOG_DEBUG(("Decoding ASN.1 tree 8"));
-  success =
-    silc_asn1_decode(asn1, &node,
-                    SILC_ASN1_SEQUENCE,
-                      SILC_ASN1_BOOLEAN_T(0, 9999, &val),
-                    SILC_ASN1_END, SILC_ASN1_END);
-  if (!success) {
-    SILC_LOG_DEBUG(("Decoding failed"));
-    goto out;
-  }
-  SILC_LOG_DEBUG(("Decoding success"));
-  SILC_LOG_DEBUG(("Boolean val %d", val));
-  memset(&node, 0, sizeof(node));
-  printf("\n");
-
-
-  memset(&node, 0, sizeof(node));
-  SILC_LOG_DEBUG(("Encoding ASN.1 tree 9"));
-  success =
-    silc_asn1_encode(asn1, &node,
-                    SILC_ASN1_SEQUENCE,
-                      SILC_ASN1_SEQUENCE_T(0, 9),
-                        SILC_ASN1_SEQUENCE,
-                          SILC_ASN1_BOOLEAN_T(0, 4, val),
-                          SILC_ASN1_BOOLEAN(val),
-                        SILC_ASN1_END,
-                        SILC_ASN1_BOOLEAN_T(SILC_ASN1_EXPLICIT, 99, val),
-                        SILC_ASN1_BOOLEAN_T(0, 100, val),
-                      SILC_ASN1_END,
-                      SILC_ASN1_SEQUENCE,
-                        SILC_ASN1_NULL,
-                        SILC_ASN1_BOOLEAN_T(SILC_ASN1_EXPLICIT, 0, val),
-                        SILC_ASN1_OCTET_STRING("foobar", 6),
-                        SILC_ASN1_BOOLEAN_T(SILC_ASN1_PRIVATE, 43, val),
-                        SILC_ASN1_BOOLEAN_T(SILC_ASN1_APP |
-                                            SILC_ASN1_EXPLICIT, 1, val),
-                      SILC_ASN1_END,
-                    SILC_ASN1_END, SILC_ASN1_END);
-  if (!success) {
-    SILC_LOG_DEBUG(("Encoding failed"));
-    goto out;
-  }
-  SILC_LOG_DEBUG(("Encoding success"));
-  SILC_LOG_HEXDUMP(("ASN.1 tree"), node.data, silc_buffer_len(&node));
-  SILC_LOG_DEBUG(("Decoding ASN.1 tree 9"));
-  success =
-    silc_asn1_decode(asn1, &node,
-                    SILC_ASN1_SEQUENCE,
-                      SILC_ASN1_SEQUENCE_T(0, 9),
-                        SILC_ASN1_SEQUENCE,
-                          SILC_ASN1_BOOLEAN_T(0, 4, &val),
-                          SILC_ASN1_BOOLEAN(&val),
-                        SILC_ASN1_END,
-                        SILC_ASN1_BOOLEAN_T(SILC_ASN1_EXPLICIT, 99, &val),
-                        SILC_ASN1_BOOLEAN_T(0, 100, &val),
-                      SILC_ASN1_END,
-                      SILC_ASN1_SEQUENCE,
-                        SILC_ASN1_NULL,
-                        SILC_ASN1_BOOLEAN_T(SILC_ASN1_EXPLICIT, 0, &val),
-                        SILC_ASN1_OCTET_STRING(&str, &str_len),
-                        SILC_ASN1_BOOLEAN_T(SILC_ASN1_PRIVATE, 43, &val),
-                        SILC_ASN1_BOOLEAN_T(SILC_ASN1_APP |
-                                            SILC_ASN1_EXPLICIT, 1, &val),
-                      SILC_ASN1_END,
-                    SILC_ASN1_END, SILC_ASN1_END);
-  if (!success) {
-    SILC_LOG_DEBUG(("Decoding failed"));
-    goto out;
-  }
-  SILC_LOG_DEBUG(("Decoding success"));
-  SILC_LOG_DEBUG(("Boolean val %d", val));
-  SILC_LOG_DEBUG(("Ooctet-string %s, len %d", str, str_len));
-  printf("\n");
-
-
-  memset(&node, 0, sizeof(node));
-  SILC_LOG_DEBUG(("Encoding ASN.1 tree 10 (INTEGER)"));
-  str = silc_rng_get_rn_data(rng, 256);
-  silc_mp_init(&mpint);
-  silc_mp_init(&mpint2);
-  silc_mp_bin2mp(str, 256, &mpint);
-  success =
-    silc_asn1_encode(asn1, &node,
-                    SILC_ASN1_INT(&mpint),
-                    SILC_ASN1_END);
-  if (!success) {
-    SILC_LOG_DEBUG(("Encoding failed"));
-    goto out;
-  }
-  SILC_LOG_DEBUG(("Encoding success"));
-  SILC_LOG_HEXDUMP(("ASN.1 tree"), node.data, silc_buffer_len(&node));
-  SILC_LOG_DEBUG(("Decoding ASN.1 tree 10 (INTEGER)"));
-  success =
-    silc_asn1_decode(asn1, &node,
-                    SILC_ASN1_INT(&mpint2),
-                    SILC_ASN1_END);
-  if (silc_mp_cmp(&mpint, &mpint2) != 0) {
-    SILC_LOG_DEBUG(("INTEGER MISMATCH"));
-    goto out;
-  }
-  if (!success) {
-    SILC_LOG_DEBUG(("Decoding failed"));
-    goto out;
-  }
-  SILC_LOG_DEBUG(("Decoding success"));
-  printf("\n");
-
-
-  memset(&node, 0, sizeof(node));
-  SILC_LOG_DEBUG(("Encoding ASN.1 tree 11 (OID)"));
-  success =
-    silc_asn1_encode(asn1, &node,
-                    SILC_ASN1_OPTS(SILC_ASN1_ACCUMUL),
-                    SILC_ASN1_OID("1.2.840.113549"),
-                    SILC_ASN1_END);
-  if (!success) {
-    SILC_LOG_DEBUG(("Encoding failed"));
-    goto out;
-  }
-  SILC_LOG_DEBUG(("Encoding success"));
-  SILC_LOG_HEXDUMP(("ASN.1 tree"), node.data, silc_buffer_len(&node));
-  SILC_LOG_DEBUG(("Decoding ASN.1 tree 11 (OID)"));
-  success =
-    silc_asn1_decode(asn1, &node,
-                    SILC_ASN1_OPTS(SILC_ASN1_ACCUMUL),
-                    SILC_ASN1_OID(&str),
-                    SILC_ASN1_END);
-  if (!success) {
-    SILC_LOG_DEBUG(("Decoding failed"));
-    goto out;
-  }
-  SILC_LOG_DEBUG(("Decoding success"));
-  SILC_LOG_DEBUG(("OID %s", str));
-  printf("\n");
-
-
-  memset(&node, 0, sizeof(node));
-  SILC_LOG_DEBUG(("Encoding ASN.1 tree 12 (SHORT INTEGER)"));
-  str_len = 198761;
-  tmpint = 0;
-  SILC_LOG_DEBUG(("Short integer: %d", str_len));
-  SILC_LOG_DEBUG(("Short integer: %d", tmpint));
-  success =
-    silc_asn1_encode(asn1, &node,
-                    SILC_ASN1_SHORT_INT(str_len),
-                    SILC_ASN1_SHORT_INT_T(SILC_ASN1_IMPLICIT, 100, tmpint),
-                    SILC_ASN1_END);
-  if (!success) {
-    SILC_LOG_DEBUG(("Encoding failed"));
-    goto out;
-  }
-  SILC_LOG_DEBUG(("Encoding success"));
-  SILC_LOG_HEXDUMP(("ASN.1 tree"), node.data, silc_buffer_len(&node));
-  SILC_LOG_DEBUG(("Decoding ASN.1 tree 12 (SHORT INTEGER)"));
-  success =
-    silc_asn1_decode(asn1, &node,
-                    SILC_ASN1_SHORT_INT(&str_len),
-                    SILC_ASN1_SHORT_INT_T(SILC_ASN1_IMPLICIT, 100, &tmpint),
-                    SILC_ASN1_END);
-  if (!success) {
-    SILC_LOG_DEBUG(("Decoding failed"));
-    goto out;
-  }
-  SILC_LOG_DEBUG(("Short integer: %d", str_len));
-  SILC_LOG_DEBUG(("Short integer: %d", tmpint));
-  SILC_LOG_DEBUG(("Decoding success"));
-  printf("\n");
-
-#endif /* 1 */
-  silc_asn1_free(asn1);
-
-  success = TRUE;
- out:
-  SILC_LOG_DEBUG(("Testing was %s", success ? "SUCCESS" : "FAILURE"));
-  fprintf(stderr, "Testing was %s\n", success ? "SUCCESS" : "FAILURE");
-
-  return success;
-}
diff --git a/lib/silcclient/.cvsignore b/lib/silcclient/.cvsignore
deleted file mode 100644 (file)
index 282522d..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-Makefile
-Makefile.in
index 3ab7ba17b4aa96fc872496dce38c17ae078227d7..449fc375ce152b33bca4e0c3bbd06ce53870766d 100644 (file)
@@ -4,7 +4,7 @@
 
   Author: Pekka Riikonen <priikone@silcnet.org>
 
-  Copyright (C) 1997 - 2007 Pekka Riikonen
+  Copyright (C) 1997 - 2008 Pekka Riikonen
 
   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
@@ -16,7 +16,6 @@
   GNU General Public License for more details.
 
 */
-/* $Id$ */
 
 #include "silc.h"
 #include "silcclient.h"
@@ -149,7 +148,15 @@ static void silc_client_packet_error(SilcPacketEngine engine,
                                     void *callback_context,
                                     void *stream_context)
 {
-  /* Nothing */
+  SilcClient client = callback_context;
+  SilcClientConnection conn = stream_context;
+
+  /* Read and write errors are silent */
+  if (error == SILC_PACKET_ERR_READ || error == SILC_PACKET_ERR_WRITE)
+    return;
+
+  client->internal->ops->say(client, conn, SILC_CLIENT_MESSAGE_ERROR,
+                            (char *)silc_packet_error_string(error));
 }
 
 /* Packet stream callbacks */
@@ -953,12 +960,8 @@ void silc_client_free(SilcClient client)
   if (client->rng)
     silc_rng_free(client->rng);
 
-  if (!client->internal->params->dont_register_crypto_library) {
-    silc_cipher_unregister_all();
-    silc_pkcs_unregister_all();
-    silc_hash_unregister_all();
-    silc_hmac_unregister_all();
-  }
+  if (!client->internal->params->dont_register_crypto_library)
+    silc_crypto_uninit();
 
   if (client->internal->packet_engine)
     silc_packet_engine_stop(client->internal->packet_engine);
@@ -1027,15 +1030,10 @@ SilcBool silc_client_init(SilcClient client, const char *username,
   if (!client->internal->ftp_sessions)
     return FALSE;
 
-  if (!client->internal->params->dont_register_crypto_library) {
+  if (!client->internal->params->dont_register_crypto_library)
     /* Initialize the crypto library.  If application has done this already
-       this has no effect.  Also, we will not be overriding something
-       application might have registered earlier. */
-    silc_cipher_register_default();
-    silc_pkcs_register_default();
-    silc_hash_register_default();
-    silc_hmac_register_default();
-  }
+       this has no effect. */
+    silc_crypto_init(NULL);
 
   /* Initialize random number generator */
   client->rng = silc_rng_alloc();
@@ -1045,7 +1043,7 @@ SilcBool silc_client_init(SilcClient client, const char *username,
   silc_rng_global_init(client->rng);
 
   /* Initialize the scheduler */
-  client->schedule = silc_schedule_init(0, client);
+  client->schedule = silc_schedule_init(0, client, NULL, NULL);
   if (!client->schedule)
     return FALSE;
 
index a7825270e4e450cd242f64b53def19c311a6d008..1947c1fb3e5d7592f892ef40f6953a88f0d64400 100644 (file)
 #include "silcclient.h"
 #include "client_internal.h"
 
+typedef struct {
+  SilcBuffer buffer;
+  SilcPKCSSignCb sign_cb;
+  void *context;
+} *SilcAttrSign;
+
 typedef struct {
   SilcBuffer buffer;
 } SilcAttrForeach;
@@ -72,19 +78,49 @@ static void silc_client_attributes_process_foreach(void *key, void *context,
                                                 data, data_len);
 }
 
+/* Attribute signature callback */
+
+static void
+silc_client_attributes_process_signed(SilcBool success,
+                                     const unsigned char *signature,
+                                     SilcUInt32 signature_len,
+                                     void *context)
+{
+  SilcAttrSign s = context;
+  SilcAttributeObjPk pk;
+
+  if (success) {
+    pk.type = NULL;
+    pk.data = (unsigned char *)signature;
+    pk.data_len = signature_len;
+    s->buffer =
+      silc_attribute_payload_encode(s->buffer,
+                                   SILC_ATTRIBUTE_USER_DIGITAL_SIGNATURE,
+                                   SILC_ATTRIBUTE_FLAG_VALID,
+                                   &pk, sizeof(pk));
+  }
+
+  s->sign_cb(TRUE, silc_buffer_data(s->buffer), silc_buffer_len(s->buffer),
+            s->context);
+
+  silc_buffer_free(s->buffer);
+  silc_free(s);
+}
+
 /* Process list of attributes.  Returns reply to the requested attributes. */
 
-SilcBuffer silc_client_attributes_process(SilcClient client,
-                                         SilcClientConnection conn,
-                                         SilcDList attrs)
+void silc_client_attributes_process(SilcClient client,
+                                   SilcClientConnection conn,
+                                   SilcDList attrs,
+                                   SilcPKCSSignCb sign_cb,
+                                   void *context)
 {
+  SilcAttrSign s;
   SilcBuffer buffer = NULL;
   SilcAttrForeach f;
   SilcAttribute attribute;
   SilcAttributePayload attr;
   SilcAttributeObjPk pk;
-  unsigned char sign[2048 + 1];
-  SilcUInt32 sign_len;
 
   SILC_LOG_DEBUG(("Process Requested Attributes"));
 
@@ -92,12 +128,13 @@ SilcBuffer silc_client_attributes_process(SilcClient client,
      attributes, ignore the request. */
   if (!conn->internal->attrs) {
     SILC_LOG_DEBUG(("User has not set any attributes"));
-    return NULL;
+    sign_cb(FALSE, NULL, 0, context);
+    return;
   }
 
   /* Always put our public key. */
   pk.type = "silc-rsa";
-  pk.data = silc_pkcs_public_key_encode(conn->public_key, &pk.data_len);
+  pk.data = silc_pkcs_public_key_encode(NULL, conn->public_key, &pk.data_len);
   buffer = silc_attribute_payload_encode(buffer,
                                         SILC_ATTRIBUTE_USER_PUBLIC_KEY,
                                         pk.data ? SILC_ATTRIBUTE_FLAG_VALID :
@@ -123,21 +160,19 @@ SilcBuffer silc_client_attributes_process(SilcClient client,
   }
   buffer = f.buffer;
 
-  /* Finally compute the digital signature of all the data we provided. */
-  if (silc_pkcs_sign(conn->private_key, silc_buffer_data(buffer),
-                    silc_buffer_len(buffer), sign, sizeof(sign), &sign_len,
-                    TRUE, conn->internal->sha1hash)) {
-    pk.type = NULL;
-    pk.data = sign;
-    pk.data_len = sign_len;
-    buffer =
-      silc_attribute_payload_encode(buffer,
-                                   SILC_ATTRIBUTE_USER_DIGITAL_SIGNATURE,
-                                   SILC_ATTRIBUTE_FLAG_VALID,
-                                   &pk, sizeof(pk));
+  s = silc_calloc(1, sizeof(*s));
+  if (!s) {
+    sign_cb(FALSE, NULL, 0, context);
+    return;
   }
+  s->sign_cb = sign_cb;
+  s->context = context;
+  s->buffer = buffer;
 
-  return buffer;
+  /* Finally compute the digital signature of all the data we provided. */
+  silc_pkcs_sign_async(conn->private_key, silc_buffer_data(buffer),
+                      silc_buffer_len(buffer), TRUE, NULL,
+                      client->rng, silc_client_attributes_process_signed, s);
 }
 
 static void silc_client_attribute_destruct(void *key, void *context,
@@ -163,7 +198,7 @@ SilcAttributePayload silc_client_attribute_add(SilcClient client,
 
   if (!conn->internal->attrs)
     conn->internal->attrs =
-      silc_hash_table_alloc(0, silc_hash_ptr, NULL, NULL,
+      silc_hash_table_alloc(NULL, 0, silc_hash_ptr, NULL, NULL,
                            NULL, silc_client_attribute_destruct,
                            NULL, TRUE);
   silc_hash_table_add(conn->internal->attrs,
index 4120695d76af08286853fa5fc5bdf31f0f767220..7dd4f0a6ad59a23572262fb48970de4decda3616 100644 (file)
 
 /************************** Channel Message Send ****************************/
 
+typedef struct {
+  SilcClient client;
+  SilcClientConnection conn;
+  SilcChannelEntry channel;
+} *SilcClientChannelMessageContext;
+
+/* Message payload encoding callback */
+
+static void silc_client_send_channel_message_final(SilcBuffer message,
+                                                  void *context)
+{
+  SilcClientChannelMessageContext c = context;
+
+  /* Send the channel message */
+  if (message)
+    silc_packet_send_ext(c->conn->stream, SILC_PACKET_CHANNEL_MESSAGE, 0,
+                        0, NULL, SILC_ID_CHANNEL, &c->channel->id,
+                        silc_buffer_datalen(message), NULL, NULL);
+
+  silc_client_unref_channel(c->client, c->conn, c->channel);
+  silc_free(c);
+}
+
 /* Sends channel message to `channel'. */
 
 SilcBool silc_client_send_channel_message(SilcClient client,
@@ -35,19 +58,21 @@ SilcBool silc_client_send_channel_message(SilcClient client,
                                          unsigned char *data,
                                          SilcUInt32 data_len)
 {
+  SilcClientChannelMessageContext c;
   SilcChannelUser chu;
-  SilcBuffer buffer;
   SilcCipher cipher;
   SilcHmac hmac;
-  SilcBool ret;
   SilcID sid, rid;
 
   SILC_LOG_DEBUG(("Sending channel message"));
 
   if (silc_unlikely(!client || !conn || !channel))
     return FALSE;
-  if (silc_unlikely(flags & SILC_MESSAGE_FLAG_SIGNED && !hash))
+  if (silc_unlikely(flags & SILC_MESSAGE_FLAG_SIGNED && !hash)) {
+    SILC_LOG_ERROR(("Cannot send signed message without hash, missing "
+                   "arguments"));
     return FALSE;
+  }
   if (silc_unlikely(conn->internal->disconnected))
     return FALSE;
 
@@ -109,27 +134,26 @@ SilcBool silc_client_send_channel_message(SilcClient client,
     return FALSE;
   }
 
-  /* Encode the message payload. This also encrypts the message payload. */
+  c = silc_calloc(1, sizeof(*c));
+  if (!c)
+    return FALSE;
+
+  c->client = client;
+  c->conn = conn;
+  c->channel = silc_client_ref_channel(client, conn, channel);
+
   sid.type = SILC_ID_CLIENT;
   sid.u.client_id = chu->client->id;
   rid.type = SILC_ID_CHANNEL;
   rid.u.channel_id = chu->channel->id;
-  buffer = silc_message_payload_encode(flags, data, data_len, TRUE, FALSE,
-                                      cipher, hmac, client->rng, NULL,
-                                      conn->private_key, hash, &sid, &rid,
-                                      NULL);
-  if (silc_unlikely(!buffer)) {
-    SILC_LOG_ERROR(("Error encoding channel message"));
-    return FALSE;
-  }
 
-  /* Send the channel message */
-  ret = silc_packet_send_ext(conn->stream, SILC_PACKET_CHANNEL_MESSAGE, 0,
-                            0, NULL, SILC_ID_CHANNEL, &channel->id,
-                            silc_buffer_datalen(buffer), NULL, NULL);
+  /* Encode the message payload. This also encrypts the message payload. */
+  silc_message_payload_encode(flags, data, data_len, TRUE, FALSE,
+                             cipher, hmac, client->rng, NULL,
+                             conn->private_key, hash, &sid, &rid, NULL,
+                             silc_client_send_channel_message_final, c);
 
-  silc_buffer_free(buffer);
-  return ret;
+  return TRUE;
 }
 
 /************************* Channel Message Receive **************************/
index de87143f047ff3f9dc6be0eb51df4c66b2743fd9..9d74e0b317124323dd399e99428cf37db422248a 100644 (file)
@@ -4,7 +4,7 @@
 
   Author: Pekka Riikonen <priikone@silcnet.org>
 
-  Copyright (C) 2006 - 2007 Pekka Riikonen
+  Copyright (C) 2006 - 2008 Pekka Riikonen
 
   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
@@ -25,7 +25,7 @@
 
 /* Callback called after connected to remote host */
 
-static void silc_client_connect_callback(SilcNetStatus status,
+static void silc_client_connect_callback(SilcResult status,
                                         SilcStream stream, void *context)
 {
   SilcFSMThread fsm = context;
@@ -35,33 +35,33 @@ static void silc_client_connect_callback(SilcNetStatus status,
   conn->internal->op = NULL;
   if (conn->internal->verbose) {
     switch (status) {
-    case SILC_NET_OK:
+    case SILC_OK:
       break;
-    case SILC_NET_UNKNOWN_IP:
+    case SILC_ERR_UNKNOWN_IP:
       client->internal->ops->say(
                   client, conn, SILC_CLIENT_MESSAGE_ERROR,
                   "Could not connect to host %s: unknown IP address",
                   conn->remote_host);
       break;
-    case SILC_NET_UNKNOWN_HOST:
+    case SILC_ERR_UNKNOWN_HOST:
       client->internal->ops->say(
                   client, conn, SILC_CLIENT_MESSAGE_ERROR,
                   "Could not connect to host %s: unknown host name",
                   conn->remote_host);
       break;
-    case SILC_NET_HOST_UNREACHABLE:
+    case SILC_ERR_UNREACHABLE:
       client->internal->ops->say(
                   client, conn, SILC_CLIENT_MESSAGE_ERROR,
                   "Could not connect to host %s: network unreachable",
                   conn->remote_host);
       break;
-    case SILC_NET_CONNECTION_REFUSED:
+    case SILC_ERR_REFUSED:
       client->internal->ops->say(
                   client, conn, SILC_CLIENT_MESSAGE_ERROR,
                   "Could not connect to host %s: connection refused",
                   conn->remote_host);
       break;
-    case SILC_NET_CONNECTION_TIMEOUT:
+    case SILC_ERR_TIMEOUT:
       client->internal->ops->say(
                   client, conn, SILC_CLIENT_MESSAGE_ERROR,
                   "Could not connect to host %s: connection timeout",
@@ -76,7 +76,7 @@ static void silc_client_connect_callback(SilcNetStatus status,
     }
   }
 
-  if (status != SILC_NET_OK) {
+  if (status != SILC_OK) {
     /* Notify application of failure */
     SILC_LOG_DEBUG(("Connecting failed"));
     conn->internal->status = SILC_CLIENT_CONN_ERROR;
@@ -414,8 +414,8 @@ SILC_FSM_STATE(silc_client_st_connect)
                                  conn->remote_host, conn->remote_port,
                                  conn->internal->schedule);
 
-    SILC_FSM_CALL(silc_client_connect_callback(stream ? SILC_NET_OK :
-                                              SILC_NET_HOST_UNREACHABLE,
+    SILC_FSM_CALL(silc_client_connect_callback(stream ? SILC_OK :
+                                              SILC_ERR_UNREACHABLE,
                                               stream, fsm));
   } else {
     /* Connect (TCP) */
@@ -454,6 +454,11 @@ SILC_FSM_STATE(silc_client_st_connect_set_stream)
 
   silc_packet_set_context(conn->stream, conn);
 
+  /* Save socket stream and socket into connection context */
+  conn->socket_stream = silc_packet_stream_get_stream(conn->stream);
+  silc_socket_stream_get_info(conn->socket_stream, &conn->sock, NULL,
+                             NULL, NULL);
+
   /** Start key exchange */
   silc_fsm_next(fsm, silc_client_st_connect_key_exchange);
   return SILC_FSM_CONTINUE;
@@ -551,6 +556,9 @@ SILC_FSM_STATE(silc_client_st_connect_setup_udp)
   /* Set the new stream to packet stream */
   old = silc_packet_stream_get_stream(conn->stream);
   silc_packet_stream_set_stream(conn->stream, stream);
+  conn->socket_stream = stream;
+  silc_socket_stream_get_info(conn->socket_stream, &conn->sock, NULL,
+                             NULL, NULL);
   silc_packet_stream_set_iv_included(conn->stream);
   silc_packet_set_sid(conn->stream, 0);
 
index 4664dbaa75f770446b457b8b7d830b67cab2d524..017f8f8a7aebed168f14779bff0149df5d0b944b 100644 (file)
@@ -85,13 +85,8 @@ SilcDList silc_client_get_clients_local_ext(SilcClient client,
   if (!silc_client_nickname_parse(client, conn, (char *)nick, &parsed))
     return NULL;
 
-  if (!get_all && parsed)
+  if (!get_all)
     format = (char *)nick;
-  if (!parsed) {
-    parsed = silc_memdup(nick, strlen(nick));
-    if (!parsed)
-      return NULL;
-  }
 
   SILC_LOG_DEBUG(("Find clients by nickname %s", parsed));
 
@@ -124,7 +119,7 @@ SilcDList silc_client_get_clients_local_ext(SilcClient client,
   }
   silc_list_start(list);
 
-  if (!format && get_all) {
+  if (get_all) {
     /* Take all without any further checking */
     while ((id_cache = silc_list_get(list))) {
       entry = id_cache->context;
@@ -517,7 +512,6 @@ SilcUInt16 silc_client_get_clients_by_list(SilcClient client,
   SilcUInt32 *res_argv_lens = NULL, *res_argv_types = NULL, res_argc = 0;
   SilcUInt16 idp_len, cmd_ident;
   SilcID id;
-  va_list tmp;
   int i;
 
   SILC_LOG_DEBUG(("Resolve clients from Client ID list"));
@@ -585,7 +579,7 @@ SilcUInt16 silc_client_get_clients_by_list(SilcClient client,
 
   /* We have the clients in cache, get them and call the completion */
   silc_client_get_clients_list_cb(client, conn, SILC_COMMAND_WHOIS,
-                                 SILC_STATUS_OK, SILC_STATUS_OK, in, tmp);
+                                 SILC_STATUS_OK, SILC_STATUS_OK, in, NULL);
   return 0;
 
  err:
@@ -811,8 +805,8 @@ SilcClientEntry silc_client_add_client(SilcClient client,
                      client_entry->hostname,
                      sizeof(client_entry->hostname));
 
-  client_entry->channels = silc_hash_table_alloc(1, silc_hash_ptr, NULL, NULL,
-                                                NULL, NULL, NULL, TRUE);
+  client_entry->channels = silc_hash_table_alloc(NULL, 1, silc_hash_ptr, NULL,
+                                                NULL, NULL, NULL, NULL, TRUE);
   if (!client_entry->channels) {
     silc_free(client_entry->realname);
     silc_free(client_entry);
@@ -1311,7 +1305,7 @@ SilcBool silc_client_nickname_parse(SilcClient client,
   int len;
 
   if (!client->internal->params->nickname_format[0]) {
-    *ret_nick = NULL;
+    *ret_nick = silc_strdup(nickname);
     return TRUE;
   }
 
@@ -1656,7 +1650,7 @@ SilcChannelEntry silc_client_add_channel(SilcClient client,
     return NULL;
   }
 
-  channel->user_list = silc_hash_table_alloc(1, silc_hash_ptr, NULL, NULL,
+  channel->user_list = silc_hash_table_alloc(NULL, 1, silc_hash_ptr, NULL, NULL,
                                             NULL, NULL, NULL, TRUE);
   if (!channel->user_list) {
     silc_rwlock_free(channel->internal.lock);
@@ -1706,14 +1700,17 @@ SilcChannelEntry silc_client_add_channel(SilcClient client,
 SilcBool silc_client_del_channel(SilcClient client, SilcClientConnection conn,
                                 SilcChannelEntry channel)
 {
+
   if (!channel)
     return FALSE;
 
   SILC_LOG_DEBUG(("Marking channel entry %p deleted"));
 
+
   if (silc_atomic_sub_int32(&channel->internal.deleted, 1) != 0) {
     SILC_LOG_DEBUG(("Channel entry %p already marked deleted"));
     return FALSE;
+  silc_client_del_channel_private_keys(client, conn, channel);
   }
 
   silc_client_unref_channel(client, conn, channel);
index a38d03c009873b315aea103310d6d94e9335213b..b4e8d46ec2724c77da6af638777fb44f5820fc55 100644 (file)
@@ -4,7 +4,7 @@
 
   Author: Pekka Riikonen <priikone@silcnet.org>
 
-  Copyright (C) 2001 - 2007 Pekka Riikonen
+  Copyright (C) 2001 - 2008 Pekka Riikonen
 
   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
@@ -16,7 +16,6 @@
   GNU General Public License for more details.
 
 */
-/* $Id$ */
 
 #include "silc.h"
 #include "silcclient.h"
@@ -193,7 +192,7 @@ static void silc_client_ftp_open_handle(SilcSFTP sftp,
                                        SILC_CLIENT_MESSAGE_ERROR,
                                        "File `%s' open failed: %s",
                                        session->filepath,
-                                       strerror(errno));
+                                       silc_errno_string(silc_errno));
 
     if (session->monitor)
       (*session->monitor)(session->client, session->conn,
@@ -738,7 +737,8 @@ silc_client_file_send(SilcClient client,
     if (!session->listener) {
       client->internal->ops->say(client, conn, SILC_CLIENT_MESSAGE_ERROR,
                                 "Cannot create listener for file transfer: "
-                                "%s", strerror(errno));
+                                "%s", silc_errno_string(silc_errno));
+
       silc_free(session);
       return SILC_CLIENT_FILE_NO_MEMORY;
     }
@@ -871,7 +871,8 @@ silc_client_file_receive(SilcClient client,
     if (!session->listener) {
       client->internal->ops->say(client, conn, SILC_CLIENT_MESSAGE_ERROR,
                                 "Cannot create listener for file transfer: "
-                                "%s", strerror(errno));
+                                "%s", silc_errno_string(silc_errno));
+
       silc_free(session);
       return SILC_CLIENT_FILE_NO_MEMORY;
     }
index 54582e20e3af80fb0b1143397209fb85c8dc5f63..a297182024c827335a6caf89aa4e7ac4de015e22 100644 (file)
@@ -185,8 +185,10 @@ silc_client_add_connection(SilcClient client,
                           char *remote_host, int port,
                           SilcClientConnectCallback callback,
                           void *context);
-SilcBuffer silc_client_attributes_process(SilcClient client,
-                                          SilcClientConnection conn,
-                                          SilcDList attrs);
+void silc_client_attributes_process(SilcClient client,
+                                   SilcClientConnection conn,
+                                   SilcDList attrs,
+                                   SilcPKCSSignCb sign_cb,
+                                   void *context);
 
 #endif /* CLIENT_INTERNAL_H */
index d6af269f65df0f19ff3fe6aaaf274e52b9d2f5fa..76db6af75a6d5cf5c5e39215a0b2a40000de8714 100644 (file)
@@ -4,7 +4,7 @@
 
   Author: Pekka Riikonen <priikone@silcnet.org>
 
-  Copyright (C) 2007 Pekka Riikonen
+  Copyright (C) 2007 - 2008 Pekka Riikonen
 
   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
@@ -181,6 +181,9 @@ silc_client_listener_new_connection(SilcClientListener listener,
     return;
   }
   conn->stream = stream;
+  conn->socket_stream = silc_packet_stream_get_stream(stream);
+  silc_socket_stream_get_info(conn->socket_stream, &conn->sock, NULL,
+                             NULL, NULL);
   conn->internal->schedule = listener->schedule;
   silc_packet_set_context(conn->stream, conn);
 
@@ -219,7 +222,7 @@ silc_client_listener_new_connection(SilcClientListener listener,
 /* TCP network listener callback.  Accepts new key agreement connection.
    Responder function. */
 
-static void silc_client_listener_tcp_accept(SilcNetStatus status,
+static void silc_client_listener_tcp_accept(SilcResult status,
                                            SilcStream stream,
                                            void *context)
 {
@@ -334,7 +337,8 @@ silc_client_listener_add(SilcClient client,
                     client, NULL, SILC_CLIENT_MESSAGE_ERROR,
                     "Cannot create UDP listener on %s on port %d: %s",
                     params->bind_ip ? params->bind_ip :
-                    params->local_ip, params->local_port, strerror(errno));
+                    params->local_ip, params->local_port,
+                    silc_errno_string(silc_errno));
       silc_client_listener_free(listener);
       if (stream)
        silc_stream_destroy(stream);
@@ -364,7 +368,8 @@ silc_client_listener_add(SilcClient client,
                     client, NULL, SILC_CLIENT_MESSAGE_ERROR,
                     "Cannot create listener on %s on port %d: %s",
                     params->bind_ip ? params->bind_ip :
-                    params->local_ip, params->local_port, strerror(errno));
+                    params->local_ip, params->local_port,
+                    silc_errno_string(silc_errno));
 
       silc_client_listener_free(listener);
       return NULL;
index 2242fd34d28a54ad812b5885c6133e09c21fd2dc..1f7eaf019d90a79dc514eee760b5bdbdf977cad4 100644 (file)
 
 /************************** Private Message Send ****************************/
 
+typedef struct {
+  SilcClient client;
+  SilcClientConnection conn;
+  SilcClientEntry client_entry;
+} *SilcClientPrvmsgContext;
+
+/* Message payload encoding callback */
+
+static void silc_client_send_private_message_final(SilcBuffer message,
+                                                  void *context)
+{
+  SilcClientPrvmsgContext p = context;
+
+  /* Send the private message packet */
+  if (message)
+    silc_packet_send_ext(p->conn->stream, SILC_PACKET_PRIVATE_MESSAGE,
+                        p->client_entry->internal.send_key ?
+                        SILC_PACKET_FLAG_PRIVMSG_KEY : 0,
+                        0, NULL, SILC_ID_CLIENT, &p->client_entry->id,
+                        silc_buffer_datalen(message), NULL, NULL);
+
+  silc_client_unref_client(p->client, p->conn, p->client_entry);
+  silc_free(p);
+}
+
 /* Sends private message to remote client. */
 
 SilcBool silc_client_send_private_message(SilcClient client,
@@ -34,14 +59,16 @@ SilcBool silc_client_send_private_message(SilcClient client,
                                          unsigned char *data,
                                          SilcUInt32 data_len)
 {
-  SilcBuffer buffer;
-  SilcBool ret;
+  SilcClientPrvmsgContext p;
   SilcID sid, rid;
 
   if (silc_unlikely(!client || !conn || !client_entry))
     return FALSE;
-  if (silc_unlikely(flags & SILC_MESSAGE_FLAG_SIGNED && !hash))
+  if (silc_unlikely(flags & SILC_MESSAGE_FLAG_SIGNED && !hash)) {
+    SILC_LOG_ERROR(("Cannot send signed message without hash, missing "
+                   "arguments"));
     return FALSE;
+  }
   if (silc_unlikely(conn->internal->disconnected))
     return FALSE;
 
@@ -52,29 +79,25 @@ SilcBool silc_client_send_private_message(SilcClient client,
   rid.type = SILC_ID_CLIENT;
   rid.u.client_id = client_entry->id;
 
-  /* Encode private message payload */
-  buffer =
-    silc_message_payload_encode(flags, data, data_len,
-                               (!client_entry->internal.send_key ? FALSE :
-                                !client_entry->internal.generated),
-                               TRUE, client_entry->internal.send_key,
-                               client_entry->internal.hmac_send,
-                               client->rng, NULL, conn->private_key,
-                               hash, &sid, &rid, NULL);
-  if (silc_unlikely(!buffer)) {
-    SILC_LOG_ERROR(("Error encoding private message"));
+  p = silc_calloc(1, sizeof(*p));
+  if (!p)
     return FALSE;
-  }
 
-  /* Send the private message packet */
-  ret = silc_packet_send_ext(conn->stream, SILC_PACKET_PRIVATE_MESSAGE,
-                            client_entry->internal.send_key ?
-                            SILC_PACKET_FLAG_PRIVMSG_KEY : 0,
-                            0, NULL, SILC_ID_CLIENT, &client_entry->id,
-                            silc_buffer_datalen(buffer), NULL, NULL);
+  p->client = client;
+  p->conn = conn;
+  p->client_entry = silc_client_ref_client(client, conn, client_entry);
 
-  silc_buffer_free(buffer);
-  return ret;
+  /* Encode private message payload */
+  silc_message_payload_encode(flags, data, data_len,
+                             (!client_entry->internal.send_key ? FALSE :
+                              !client_entry->internal.generated),
+                             TRUE, client_entry->internal.send_key,
+                             client_entry->internal.hmac_send,
+                             client->rng, NULL, conn->private_key,
+                             hash, &sid, &rid, NULL,
+                             silc_client_send_private_message_final, p);
+
+  return TRUE;
 }
 
 /************************* Private Message Receive **************************/
index a3cafe478b9697cf9bb6f153b4a5cf7e924af764..efbeaa24d9cae4534d01d65ad53e221b9ec83fb7 100644 (file)
@@ -28,7 +28,10 @@ typedef struct {
   SilcClient client;
   SilcClientConnection conn;
   SilcBufferStruct detach;
+  SilcBuffer auth;
   char *nickname;
+  unsigned char *id;
+  SilcUInt32 id_len;
   SilcUInt32 channel_count;
 } *SilcClientResumeSession;
 
@@ -68,6 +71,23 @@ silc_client_resume_command_callback(SilcClient client,
   va_end(ap);
 }
 
+/* Resume authentication data generation callback */
+
+static void silc_client_resume_auth_generated(const SilcBuffer data,
+                                             void *context)
+{
+  SilcClientConnection conn = context;
+  SilcClientResumeSession resume =
+    silc_fsm_get_state_context(&conn->internal->event_thread);
+
+  if (!data)
+    silc_fsm_next(&conn->internal->event_thread, silc_client_st_resume_error);
+  else
+    resume->auth = silc_buffer_copy(data);
+
+  SILC_FSM_CALL_CONTINUE_SYNC(&conn->internal->event_thread);
+}
+
 
 /****************************** NEW_ID packet *******************************/
 
@@ -279,7 +299,6 @@ SILC_FSM_STATE(silc_client_st_resume)
   SilcClientConnection conn = fsm_context;
   SilcClient client = conn->client;
   SilcClientResumeSession resume;
-  SilcBuffer auth;
   unsigned char *id;
   SilcUInt16 id_len;
   SilcClientID client_id;
@@ -323,25 +342,34 @@ SILC_FSM_STATE(silc_client_st_resume)
     silc_fsm_next(fsm, silc_client_st_resume_error);
     return SILC_FSM_CONTINUE;
   }
+  resume->id = id;
+  resume->id_len = id_len;
 
   /* Generate authentication data that server will verify */
-  auth = silc_auth_public_key_auth_generate(conn->public_key,
-                                           conn->private_key,
-                                           client->rng,
-                                           conn->internal->hash,
-                                           &client_id, SILC_ID_CLIENT);
-  if (!auth) {
-    /** Out of memory */
-    silc_fsm_next(fsm, silc_client_st_resume_error);
-    return SILC_FSM_CONTINUE;
-  }
+  silc_fsm_next(fsm, silc_client_st_resume_send);
+  SILC_FSM_CALL(silc_auth_public_key_auth_generate(
+                                conn->public_key, conn->private_key,
+                                client->rng, conn->internal->hash,
+                                &client_id, SILC_ID_CLIENT,
+                                silc_client_resume_auth_generated, conn));
+  /* NOT REACHED */
+}
+
+/* Send RESUME_CLIENT packet */
+
+SILC_FSM_STATE(silc_client_st_resume_send)
+{
+  SilcClientConnection conn = fsm_context;
+  SilcClientResumeSession resume = state_context;
+
+  SILC_LOG_DEBUG(("Send RESUME_CLIENT packet"));
 
   /* Send RESUME_CLIENT packet to resume to network */
   if (!silc_packet_send_va(conn->stream, SILC_PACKET_RESUME_CLIENT, 0,
-                          SILC_STR_UI_SHORT(id_len),
-                          SILC_STR_DATA(id, id_len),
-                          SILC_STR_DATA(silc_buffer_data(auth),
-                                        silc_buffer_len(auth)),
+                          SILC_STR_UI_SHORT(resume->id_len),
+                          SILC_STR_DATA(resume->id, resume->id_len),
+                          SILC_STR_DATA(silc_buffer_data(resume->auth),
+                                        silc_buffer_len(resume->auth)),
                           SILC_STR_END)) {
     /** Error sending packet */
     SILC_LOG_DEBUG(("Error sending packet"));
index 37a8c7c8a54d4fbdc5f933dceddc821939110297..e8e2db6238bfb7b6ee313d014ed9276985549aa4 100644 (file)
@@ -4,7 +4,7 @@
 
   Author: Pekka Riikonen <priikone@silcnet.org>
 
-  Copyright (C) 2006 Pekka Riikonen
+  Copyright (C) 2006 - 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
@@ -25,6 +25,7 @@ SILC_FSM_STATE(silc_client_st_register);
 SILC_FSM_STATE(silc_client_st_register_complete);
 SILC_FSM_STATE(silc_client_st_register_error);
 SILC_FSM_STATE(silc_client_st_resume);
+SILC_FSM_STATE(silc_client_st_resume_send);
 SILC_FSM_STATE(silc_client_st_resume_resolve_channels);
 SILC_FSM_STATE(silc_client_st_resume_resolve_cmodes);
 SILC_FSM_STATE(silc_client_st_resume_completed);
index 0e72368ded59126cb750a12bb3413d47c57a6ee3..b5827f22819405d28285b296fdb10e15997d93c9 100644 (file)
@@ -697,7 +697,7 @@ SILC_FSM_STATE(silc_client_command_whois)
     SilcAttributeObjPk obj;
     SilcPublicKey pk;
 
-    if (!silc_pkcs_load_public_key(pubkey, &pk)) {
+    if (!silc_pkcs_load_public_key(pubkey, SILC_PKCS_ANY, &pk)) {
       SAY(client, conn, SILC_CLIENT_MESSAGE_COMMAND_ERROR,
          "Could not load public key %s, check the filename",
          pubkey);
@@ -722,7 +722,7 @@ SILC_FSM_STATE(silc_client_command_whois)
       goto out;
       break;
     }
-    obj.data = silc_pkcs_public_key_encode(pk, &obj.data_len);
+    obj.data = silc_pkcs_public_key_encode(NULL, pk, &obj.data_len);
 
     attrs = silc_attribute_payload_encode(attrs,
                                           SILC_ATTRIBUTE_USER_PUBLIC_KEY,
@@ -732,9 +732,8 @@ SILC_FSM_STATE(silc_client_command_whois)
   }
 
   if (nick) {
-    silc_client_nickname_parse(client, conn, cmd->argv[1], &nickname);
-    if (!nickname)
-      nickname = strdup(cmd->argv[1]);
+    if (!silc_client_nickname_parse(client, conn, cmd->argv[1], &nickname))
+      goto out;
   }
 
   /* Send command */
@@ -1052,7 +1051,10 @@ SILC_FSM_STATE(silc_client_command_invite)
   /* Parse the typed nickname. */
   if (cmd->argc == 3) {
     if (cmd->argv[2][0] != '+' && cmd->argv[2][0] != '-') {
-      silc_client_nickname_parse(client, conn, cmd->argv[2], &nickname);
+      if (!silc_client_nickname_parse(client, conn, cmd->argv[2], &nickname)) {
+       silc_client_unref_channel(client, conn, channel);
+       goto out;
+      }
 
       /* Find client entry */
       clients = silc_client_get_clients_local(client, conn, cmd->argv[2],
@@ -1072,7 +1074,7 @@ SILC_FSM_STATE(silc_client_command_invite)
        action[0] = 0x01;
 
       /* Check if it is public key file to be added to invite list */
-      silc_pkcs_load_public_key(cmd->argv[2] + 1, &pubkey);
+      silc_pkcs_load_public_key(cmd->argv[2] + 1, SILC_PKCS_ANY, &pubkey);
       invite = cmd->argv[2];
       if (!pubkey)
        invite++;
@@ -1085,7 +1087,7 @@ SILC_FSM_STATE(silc_client_command_invite)
                       SILC_STR_UI_SHORT(1),
                       SILC_STR_END);
     if (pubkey) {
-      chidp = silc_public_key_payload_encode(pubkey);
+      chidp = silc_public_key_payload_encode(NULL, pubkey);
       args = silc_argument_payload_encode_one(args, silc_buffer_data(chidp),
                                              silc_buffer_len(chidp), 2);
       silc_buffer_free(chidp);
@@ -1177,6 +1179,55 @@ SILC_FSM_STATE(silc_client_command_quit)
 
 /********************************** KILL ************************************/
 
+/* Signature callback */
+
+static void silc_client_command_kill_signed(const SilcBuffer buffer,
+                                           void *context)
+{
+  SilcClientCommandContext cmd = context;
+
+  if (!buffer) {
+    silc_fsm_finish(&cmd->thread);
+    return;
+  }
+
+  silc_fsm_set_state_context(&cmd->thread, buffer);
+  SILC_FSM_CALL_CONTINUE_SYNC(&cmd->thread);
+}
+
+/* Send KILL command */
+
+SILC_FSM_STATE(silc_client_command_kill_send)
+{
+  SilcClientCommandContext cmd = fsm_context;
+  SilcClientConnection conn = cmd->conn;
+  SilcClient client = conn->client;
+  SilcBuffer idp, auth = state_context;
+  SilcClientEntry target = cmd->context;
+  char *comment = NULL;
+
+  if (cmd->argc >= 3)
+    if (strcasecmp(cmd->argv[2], "-pubkey"))
+      comment = cmd->argv[2];
+
+  /* Send the KILL command to the server */
+  idp = silc_id_payload_encode(&target->id, SILC_ID_CLIENT);
+  silc_client_command_send_va(conn, cmd, cmd->cmd, NULL, NULL, 3,
+                             1, silc_buffer_datalen(idp),
+                             2, comment, comment ? strlen(comment) : 0,
+                             3, silc_buffer_datalen(auth));
+
+  silc_buffer_free(idp);
+  silc_client_unref_client(client, conn, target);
+
+  /* Notify application */
+  COMMAND(SILC_STATUS_OK);
+
+  /** Wait for command reply */
+  silc_fsm_next(fsm, silc_client_command_reply_wait);
+  return SILC_FSM_CONTINUE;
+}
+
 /* Command KILL. Router operator can use this command to remove an client
    fromthe SILC Network. */
 
@@ -1185,10 +1236,9 @@ SILC_FSM_STATE(silc_client_command_kill)
   SilcClientCommandContext cmd = fsm_context;
   SilcClientConnection conn = cmd->conn;
   SilcClient client = conn->client;
-  SilcBuffer idp, auth = NULL;
   SilcClientEntry target;
   SilcDList clients;
-  char *nickname = NULL, *comment = NULL;
+  char *nickname = NULL;
 
   if (cmd->argc < 2) {
     SAY(conn->client, conn, SILC_CLIENT_MESSAGE_INFO,
@@ -1210,38 +1260,30 @@ SILC_FSM_STATE(silc_client_command_kill)
                                          cmd));
 
   target = silc_dlist_get(clients);
+  cmd->context = silc_client_ref_client(client, conn, target);
 
-  if (cmd->argc >= 3) {
-    if (strcasecmp(cmd->argv[2], "-pubkey"))
-      comment = cmd->argv[2];
+  silc_free(nickname);
+  silc_client_list_free(client, conn, clients);
+
+  /** Send KILL */
+  silc_fsm_next(fsm, silc_client_command_kill_send);
 
+  if (cmd->argc >= 3) {
     if (!strcasecmp(cmd->argv[2], "-pubkey") ||
        (cmd->argc >= 4 && !strcasecmp(cmd->argv[3], "-pubkey"))) {
       /* Encode the public key authentication payload */
-      auth = silc_auth_public_key_auth_generate(conn->public_key,
-                                               conn->private_key,
-                                               conn->client->rng,
-                                               conn->internal->sha1hash,
-                                               &target->id, SILC_ID_CLIENT);
+      SILC_FSM_CALL(silc_auth_public_key_auth_generate(
+                                        conn->public_key,
+                                        conn->private_key,
+                                        conn->client->rng,
+                                        conn->internal->sha1hash,
+                                        &target->id, SILC_ID_CLIENT,
+                                        silc_client_command_kill_signed,
+                                        cmd));
+      /* NOT REACHED */
     }
   }
 
-  /* Send the KILL command to the server */
-  idp = silc_id_payload_encode(&target->id, SILC_ID_CLIENT);
-  silc_client_command_send_va(conn, cmd, cmd->cmd, NULL, NULL, 3,
-                             1, silc_buffer_datalen(idp),
-                             2, comment, comment ? strlen(comment) : 0,
-                             3, silc_buffer_datalen(auth));
-  silc_buffer_free(idp);
-  silc_buffer_free(auth);
-  silc_free(nickname);
-  silc_client_list_free(client, conn, clients);
-
-  /* Notify application */
-  COMMAND(SILC_STATUS_OK);
-
-  /** Wait for command reply */
-  silc_fsm_next(fsm, silc_client_command_reply_wait);
   return SILC_FSM_CONTINUE;
 }
 
@@ -1324,6 +1366,33 @@ SILC_FSM_STATE(silc_client_command_ping)
 
 /********************************** JOIN ************************************/
 
+typedef struct {
+  int type;
+  SilcBuffer auth;
+  SilcBuffer cauth;
+} *SilcClientJoinContext;
+
+/* Signature callback */
+
+static void silc_client_command_join_signed(const SilcBuffer buffer,
+                                           void *context)
+{
+  SilcClientCommandContext cmd = context;
+  SilcClientJoinContext j = cmd->context;
+
+  if (!buffer) {
+    silc_fsm_finish(&cmd->thread);
+    return;
+  }
+
+  if (!j->type)
+    j->auth = silc_buffer_copy(buffer);
+  else
+    j->cauth = silc_buffer_copy(buffer);
+
+  SILC_FSM_CALL_CONTINUE(&cmd->thread);
+}
+
 /* Command JOIN. Joins to a channel. */
 
 SILC_FSM_STATE(silc_client_command_join)
@@ -1332,6 +1401,7 @@ SILC_FSM_STATE(silc_client_command_join)
   SilcClientConnection conn = cmd->conn;
   SilcClient client = conn->client;
   SilcChannelEntry channel = NULL;
+  SilcClientJoinContext j = cmd->context;
   SilcBuffer auth = NULL, cauth = NULL;
   char *name, *passphrase = NULL, *pu8, *cipher = NULL, *hmac = NULL;
   int i, passphrase_len = 0;
@@ -1370,46 +1440,77 @@ SILC_FSM_STATE(silc_client_command_join)
     } else if (!strcasecmp(cmd->argv[i], "-hmac") && cmd->argc > i + 1) {
       hmac = cmd->argv[++i];
     } else if (!strcasecmp(cmd->argv[i], "-founder")) {
-      auth = silc_auth_public_key_auth_generate(conn->public_key,
-                                               conn->private_key,
-                                               conn->client->rng,
-                                               conn->internal->sha1hash,
-                                               conn->local_id,
-                                               SILC_ID_CLIENT);
+      if (!j || !j->auth) {
+       if (!j) {
+         j = silc_calloc(1, sizeof(*j));
+         if (!j)
+           goto out;
+         cmd->context = j;
+       }
+       j->type = 0;
+       silc_free(passphrase);
+       silc_client_unref_channel(client, conn, channel);
+       SILC_FSM_CALL(silc_auth_public_key_auth_generate(
+                                          conn->public_key,
+                                          conn->private_key,
+                                          conn->client->rng,
+                                          conn->internal->sha1hash,
+                                          conn->local_id,
+                                          SILC_ID_CLIENT,
+                                          silc_client_command_join_signed,
+                                          cmd));
+       /* NOT REACHED */
+      }
     } else if (!strcasecmp(cmd->argv[i], "-auth")) {
       SilcPublicKey pubkey = conn->public_key;
       SilcPrivateKey privkey = conn->private_key;
-      unsigned char *pk, pkhash[SILC_HASH_MAXLEN], *pubdata;
+      unsigned char *pk, pkhash[SILC_HASH_MAXLEN], pubdata[128];
       SilcUInt32 pk_len;
 
-      if (cmd->argc >= i + 3) {
-       char *pass = "";
-       if (cmd->argc >= i + 4) {
-         pass = cmd->argv[i + 3];
-         i++;
+      if (!j || !j->cauth) {
+       if (!j) {
+         j = silc_calloc(1, sizeof(*j));
+         if (!j)
+           goto out;
+         cmd->context = j;
        }
-       if (!silc_load_key_pair(cmd->argv[i + 1], cmd->argv[i + 2], pass,
-                               &pubkey, &privkey)) {
-         SAY(conn->client, conn, SILC_CLIENT_MESSAGE_COMMAND_ERROR,
-             "Could not load key pair, check your arguments");
-         COMMAND_ERROR(SILC_STATUS_ERR_NOT_ENOUGH_PARAMS);
-         goto out;
+
+       if (cmd->argc >= i + 3) {
+         char *pass = "";
+         if (cmd->argc >= i + 4) {
+           pass = cmd->argv[i + 3];
+           i++;
+         }
+         if (!silc_load_key_pair(cmd->argv[i + 1], cmd->argv[i + 2], pass,
+                                 &pubkey, &privkey)) {
+           SAY(conn->client, conn, SILC_CLIENT_MESSAGE_COMMAND_ERROR,
+               "Could not load key pair, check your arguments");
+           COMMAND_ERROR(SILC_STATUS_ERR_NOT_ENOUGH_PARAMS);
+           goto out;
+         }
+         i += 2;
        }
-       i += 2;
-      }
 
-      pk = silc_pkcs_public_key_encode(pubkey, &pk_len);
-      silc_hash_make(conn->internal->sha1hash, pk, pk_len, pkhash);
-      silc_free(pk);
-      pubdata = silc_rng_get_rn_data(conn->client->rng, 128);
-      memcpy(pubdata, pkhash, 20);
-      cauth = silc_auth_public_key_auth_generate_wpub(pubkey, privkey,
-                                                     pubdata, 128,
-                                                     conn->internal->sha1hash,
-                                                     conn->local_id,
-                                                     SILC_ID_CLIENT);
-      memset(pubdata, 0, 128);
-      silc_free(pubdata);
+       j->type = 1;
+       pk = silc_pkcs_public_key_encode(NULL, pubkey, &pk_len);
+       silc_hash_make(conn->internal->sha1hash, pk, pk_len, pkhash);
+       silc_free(pk);
+       silc_rng_get_rn_data(conn->client->rng, sizeof(pubdata), pubdata,
+                            sizeof(pubdata));
+       memcpy(pubdata, pkhash, 20);
+       silc_free(passphrase);
+       silc_client_unref_channel(client, conn, channel);
+       SILC_FSM_CALL(silc_auth_public_key_auth_generate_wpub(
+                                          pubkey, privkey,
+                                          pubdata, sizeof(pubdata),
+                                          conn->internal->sha1hash,
+                                          client->rng,
+                                          conn->local_id,
+                                          SILC_ID_CLIENT,
+                                          silc_client_command_join_signed,
+                                          cmd));
+       /* NOT REACHED */
+      }
     } else {
       /* Passphrases must be UTF-8 encoded, so encode if it is not */
       if (!silc_utf8_valid(cmd->argv[i], cmd->argv_lens[i])) {
@@ -1437,12 +1538,15 @@ SILC_FSM_STATE(silc_client_command_join)
                              6, silc_buffer_datalen(auth),
                              7, silc_buffer_datalen(cauth));
 
-  silc_buffer_free(auth);
-  silc_buffer_free(cauth);
   if (passphrase)
     memset(passphrase, 0, strlen(passphrase));
   silc_free(passphrase);
   silc_client_unref_channel(client, conn, channel);
+  if (j) {
+    silc_buffer_free(j->auth);
+    silc_buffer_free(j->cauth);
+    silc_free(j);
+  }
 
   /* Notify application */
   COMMAND(SILC_STATUS_OK);
@@ -1631,6 +1735,22 @@ SILC_FSM_STATE(silc_client_command_umode)
 
 /********************************** CMODE ***********************************/
 
+/* Signature callback */
+
+static void silc_client_command_cmode_signed(const SilcBuffer buffer,
+                                            void *context)
+{
+  SilcClientCommandContext cmd = context;
+
+  if (!buffer) {
+    silc_fsm_finish(&cmd->thread);
+    return;
+  }
+
+  silc_fsm_set_state_context(&cmd->thread, buffer);
+  SILC_FSM_CALL_CONTINUE_SYNC(&cmd->thread);
+}
+
 /* CMODE command. Sets channel mode. Modes that does not require any arguments
    can be set several at once. Those modes that require argument must be set
    separately (unless set with modes that does not require arguments). */
@@ -1640,8 +1760,9 @@ SILC_FSM_STATE(silc_client_command_cmode)
   SilcClientCommandContext cmd = fsm_context;
   SilcClientConnection conn = cmd->conn;
   SilcClient client = conn->client;
+  SilcBuffer auth = state_context;
   SilcChannelEntry channel = NULL;
-  SilcBuffer chidp, auth = NULL, pk = NULL;
+  SilcBuffer chidp, pk = NULL;
   unsigned char *name, *cp, modebuf[4], tmp[4], *arg = NULL;
   SilcUInt32 mode, add, type, len, arg_len = 0;
   int i;
@@ -1798,31 +1919,38 @@ SILC_FSM_STATE(silc_client_command_cmode)
       break;
     case 'f':
       if (add) {
-       SilcPublicKey pubkey = conn->public_key;
-       SilcPrivateKey privkey = conn->private_key;
-
-       mode |= SILC_CHANNEL_MODE_FOUNDER_AUTH;
-       type = 7;
-
-       if (cmd->argc >= 5) {
-         char *pass = "";
-         if (cmd->argc >= 6)
-           pass = cmd->argv[5];
-         if (!silc_load_key_pair(cmd->argv[3], cmd->argv[4], pass,
-                                 &pubkey, &privkey)) {
-           SAY(client, conn, SILC_CLIENT_MESSAGE_COMMAND_ERROR,
-               "Could not load key pair, check your arguments");
-           COMMAND_ERROR(SILC_STATUS_ERR_NOT_ENOUGH_PARAMS);
-           goto out;
+       if (!auth) {
+         SilcPublicKey pubkey = conn->public_key;
+         SilcPrivateKey privkey = conn->private_key;
+
+         mode |= SILC_CHANNEL_MODE_FOUNDER_AUTH;
+         type = 7;
+
+         if (cmd->argc >= 5) {
+           char *pass = "";
+           if (cmd->argc >= 6)
+             pass = cmd->argv[5];
+           if (!silc_load_key_pair(cmd->argv[3], cmd->argv[4], pass,
+                                   &pubkey, &privkey)) {
+             SAY(client, conn, SILC_CLIENT_MESSAGE_COMMAND_ERROR,
+                 "Could not load key pair, check your arguments");
+             COMMAND_ERROR(SILC_STATUS_ERR_NOT_ENOUGH_PARAMS);
+             goto out;
+           }
          }
-       }
 
-       pk = silc_public_key_payload_encode(pubkey);
-       auth = silc_auth_public_key_auth_generate(pubkey, privkey,
-                                                 conn->client->rng,
-                                                 conn->internal->sha1hash,
-                                                 conn->local_id,
-                                                 SILC_ID_CLIENT);
+         pk = silc_public_key_payload_encode(NULL, pubkey);
+         silc_client_unref_channel(client, conn, channel);
+         SILC_FSM_CALL(silc_auth_public_key_auth_generate(
+                                            pubkey, privkey,
+                                            conn->client->rng,
+                                            conn->internal->sha1hash,
+                                            conn->local_id,
+                                            SILC_ID_CLIENT,
+                                            silc_client_command_cmode_signed,
+                                            cmd));
+         /* NOT REACHED */
+       }
        arg = silc_buffer_data(auth);
        arg_len = silc_buffer_len(auth);
       } else {
@@ -1865,7 +1993,8 @@ SILC_FSM_STATE(silc_client_command_cmode)
        for (k = 3; k < cmd->argc; k++) {
          if (cmd->argv[k][0] == '+')
            chadd = TRUE;
-         if (!silc_pkcs_load_public_key(cmd->argv[k] + 1, &chpk)) {
+         if (!silc_pkcs_load_public_key(cmd->argv[k] + 1, SILC_PKCS_ANY,
+                                        &chpk)) {
            SAY(conn->client, conn, SILC_CLIENT_MESSAGE_COMMAND_ERROR,
                "Could not load public key %s, check the filename",
                cmd->argv[k]);
@@ -1875,7 +2004,7 @@ SILC_FSM_STATE(silc_client_command_cmode)
          }
 
          if (chpk) {
-           pk = silc_public_key_payload_encode(chpk);
+           pk = silc_public_key_payload_encode(NULL, chpk);
            auth = silc_argument_payload_encode_one(auth,
                                                    silc_buffer_datalen(pk),
                                                    chadd ? 0x00 : 0x01);
@@ -1934,6 +2063,22 @@ SILC_FSM_STATE(silc_client_command_cmode)
 
 /********************************* CUMODE ***********************************/
 
+/* Signature callback */
+
+static void silc_client_command_cumode_signed(const SilcBuffer buffer,
+                                             void *context)
+{
+  SilcClientCommandContext cmd = context;
+
+  if (!buffer) {
+    silc_fsm_finish(&cmd->thread);
+    return;
+  }
+
+  silc_fsm_set_state_context(&cmd->thread, buffer);
+  SILC_FSM_CALL_CONTINUE_SYNC(&cmd->thread);
+}
+
 /* CUMODE command. Changes client's mode on a channel. */
 
 SILC_FSM_STATE(silc_client_command_cumode)
@@ -1941,10 +2086,11 @@ SILC_FSM_STATE(silc_client_command_cumode)
   SilcClientCommandContext cmd = fsm_context;
   SilcClientConnection conn = cmd->conn;
   SilcClient client = conn->client;
+  SilcBuffer auth = state_context;
   SilcChannelEntry channel = NULL;
   SilcChannelUser chu;
   SilcClientEntry client_entry;
-  SilcBuffer clidp, chidp, auth = NULL;
+  SilcBuffer clidp, chidp;
   SilcDList clients = NULL;
   unsigned char *name, *cp, modebuf[4];
   SilcUInt32 mode = 0, add, len;
@@ -1977,7 +2123,8 @@ SILC_FSM_STATE(silc_client_command_cumode)
   }
 
   /* Parse the typed nickname. */
-  silc_client_nickname_parse(client, conn, cmd->argv[3], &nickname);
+  if (!silc_client_nickname_parse(client, conn, cmd->argv[3], &nickname))
+    goto out;
 
   /* Find client entry */
   clients = silc_client_get_clients_local(client, conn, cmd->argv[3], FALSE);
@@ -2018,27 +2165,38 @@ SILC_FSM_STATE(silc_client_command_cumode)
       break;
     case 'f':
       if (add) {
-       SilcPublicKey pubkey = conn->public_key;
-       SilcPrivateKey privkey = conn->private_key;
-
-       if (cmd->argc >= 6) {
-         char *pass = "";
-         if (cmd->argc >= 7)
-           pass = cmd->argv[6];
-         if (!silc_load_key_pair(cmd->argv[4], cmd->argv[5], pass,
-                                 &pubkey, &privkey)) {
-           SAY(conn->client, conn, SILC_CLIENT_MESSAGE_COMMAND_ERROR,
-               "Could not load key pair, check your arguments");
-           COMMAND_ERROR(SILC_STATUS_ERR_NOT_ENOUGH_PARAMS);
-           goto out;
+       if (!auth) {
+         SilcPublicKey pubkey = conn->public_key;
+         SilcPrivateKey privkey = conn->private_key;
+
+         if (cmd->argc >= 6) {
+           char *pass = "";
+           if (cmd->argc >= 7)
+             pass = cmd->argv[6];
+           if (!silc_load_key_pair(cmd->argv[4], cmd->argv[5], pass,
+                                   &pubkey, &privkey)) {
+             SAY(conn->client, conn, SILC_CLIENT_MESSAGE_COMMAND_ERROR,
+                 "Could not load key pair, check your arguments");
+             COMMAND_ERROR(SILC_STATUS_ERR_NOT_ENOUGH_PARAMS);
+             goto out;
+           }
          }
+
+         silc_free(nickname);
+         silc_client_list_free(client, conn, clients);
+         silc_client_unref_channel(client, conn, channel);
+
+         SILC_FSM_CALL(silc_auth_public_key_auth_generate(
+                                            pubkey, privkey,
+                                            conn->client->rng,
+                                            conn->internal->sha1hash,
+                                            conn->local_id,
+                                            SILC_ID_CLIENT,
+                                            silc_client_command_cumode_signed,
+                                            cmd));
+         /* NOT REACHED */
        }
 
-       auth = silc_auth_public_key_auth_generate(pubkey, privkey,
-                                                 conn->client->rng,
-                                                 conn->internal->sha1hash,
-                                                 conn->local_id,
-                                                 SILC_ID_CLIENT);
        mode |= SILC_CHANNEL_UMODE_CHANFO;
       } else {
        mode &= ~SILC_CHANNEL_UMODE_CHANFO;
@@ -2212,6 +2370,7 @@ SILC_FSM_STATE(silc_client_command_kick)
 typedef struct {
   unsigned char *passphrase;
   SilcUInt32 passphrase_len;
+  SilcBuffer auth;
 } *SilcClientCommandOper;
 
 /* Ask passphrase callback */
@@ -2230,6 +2389,19 @@ static void silc_client_command_oper_cb(const unsigned char *data,
   SILC_FSM_CALL_CONTINUE(&cmd->thread);
 }
 
+static void silc_client_command_oper_sign_cb(const SilcBuffer data,
+                                            void *context)
+{
+  SilcClientCommandContext cmd = context;
+  SilcClientCommandOper oper = cmd->context;
+
+  if (data)
+    oper->auth = silc_buffer_copy(data);
+
+  /* Continue */
+  SILC_FSM_CALL_CONTINUE(&cmd->thread);
+}
+
 /* Send OPER/SILCOPER command */
 
 SILC_FSM_STATE(silc_client_command_oper_send)
@@ -2237,21 +2409,7 @@ SILC_FSM_STATE(silc_client_command_oper_send)
   SilcClientCommandContext cmd = fsm_context;
   SilcClientConnection conn = cmd->conn;
   SilcClientCommandOper oper = cmd->context;
-  SilcBuffer auth;
-
-  if (!oper || !oper->passphrase) {
-    /* Encode the public key authentication payload */
-    auth = silc_auth_public_key_auth_generate(conn->public_key,
-                                             conn->private_key,
-                                             conn->client->rng,
-                                             conn->internal->hash,
-                                             conn->local_id,
-                                             SILC_ID_CLIENT);
-  } else {
-    /* Encode the password authentication payload */
-    auth = silc_auth_payload_encode(SILC_AUTH_PASSWORD, NULL, 0,
-                                   oper->passphrase, oper->passphrase_len);
-  }
+  SilcBuffer auth = oper ? oper->auth : NULL;
 
   silc_client_command_send_va(conn, cmd, cmd->cmd, NULL, NULL, 2,
                              1, cmd->argv[1], strlen(cmd->argv[1]),
@@ -2272,6 +2430,36 @@ SILC_FSM_STATE(silc_client_command_oper_send)
   return SILC_FSM_CONTINUE;
 }
 
+/* Get authentication data */
+
+SILC_FSM_STATE(silc_client_command_oper_get_auth)
+{
+  SilcClientCommandContext cmd = fsm_context;
+  SilcClientConnection conn = cmd->conn;
+  SilcClientCommandOper oper = cmd->context;
+
+  silc_fsm_next(fsm, silc_client_command_oper_send);
+
+  if (!oper || !oper->passphrase) {
+    /* Encode the public key authentication payload */
+    SILC_FSM_CALL(silc_auth_public_key_auth_generate(
+                                      conn->public_key,
+                                      conn->private_key,
+                                      conn->client->rng,
+                                      conn->internal->hash,
+                                      conn->local_id, SILC_ID_CLIENT,
+                                      silc_client_command_oper_sign_cb,
+                                      oper));
+    /* NOT REACHED */
+  }
+
+  /* Encode the password authentication payload */
+  oper->auth = silc_auth_payload_encode(NULL, SILC_AUTH_PASSWORD, NULL, 0,
+                                       oper->passphrase, oper->passphrase_len);
+
+  return SILC_FSM_CONTINUE;
+}
+
 /* OPER command. Used to obtain server operator privileges. */
 
 SILC_FSM_STATE(silc_client_command_oper)
@@ -2287,7 +2475,7 @@ SILC_FSM_STATE(silc_client_command_oper)
     return SILC_FSM_FINISH;
   }
 
-  silc_fsm_next(fsm, silc_client_command_oper_send);
+  silc_fsm_next(fsm, silc_client_command_oper_get_auth);
 
   /* Get passphrase */
   if (cmd->argc < 3) {
@@ -2382,7 +2570,7 @@ SILC_FSM_STATE(silc_client_command_ban)
       action[0] = 0x01;
 
     /* Check if it is public key file to be added to invite list */
-    silc_pkcs_load_public_key(cmd->argv[2] + 1, &pubkey);
+    silc_pkcs_load_public_key(cmd->argv[2] + 1, SILC_PKCS_ANY, &pubkey);
     ban = cmd->argv[2];
     if (!pubkey)
       ban++;
@@ -2394,7 +2582,7 @@ SILC_FSM_STATE(silc_client_command_ban)
                       SILC_STR_UI_SHORT(1),
                       SILC_STR_END);
     if (pubkey) {
-      chidp = silc_public_key_payload_encode(pubkey);
+      chidp = silc_public_key_payload_encode(NULL, pubkey);
       args = silc_argument_payload_encode_one(args,
                                              silc_buffer_datalen(chidp), 2);
       silc_buffer_free(chidp);
@@ -2482,7 +2670,7 @@ SILC_FSM_STATE(silc_client_command_watch)
     SilcPublicKey pk;
     SilcBuffer buffer;
 
-    if (!silc_pkcs_load_public_key(pubkey, &pk)) {
+    if (!silc_pkcs_load_public_key(pubkey, SILC_PKCS_ANY, &pk)) {
       SAY(conn->client, conn, SILC_CLIENT_MESSAGE_COMMAND_ERROR,
          "Could not load public key %s, check the filename", pubkey);
       COMMAND_ERROR(SILC_STATUS_ERR_NOT_ENOUGH_PARAMS);
@@ -2493,7 +2681,7 @@ SILC_FSM_STATE(silc_client_command_watch)
     silc_buffer_format(args,
                       SILC_STR_UI_SHORT(1),
                       SILC_STR_END);
-    buffer = silc_public_key_payload_encode(pk);
+    buffer = silc_public_key_payload_encode(NULL, pk);
     args = silc_argument_payload_encode_one(args, silc_buffer_datalen(buffer),
                                            pubkey_add ? 0x00 : 0x01);
     silc_buffer_free(buffer);
@@ -2828,17 +3016,60 @@ void silc_client_commands_unregister(SilcClient client)
 
 /****************** Client Side Incoming Command Handling *******************/
 
-/* Reply to WHOIS command from server */
+typedef struct {
+  SilcClientConnection conn;
+  SilcUInt16 cmd_ident;
+} *SilcClientProcessWhois;
+
+/* Send reply to WHOIS from server */
+
+static void
+silc_client_command_process_whois_send(SilcBool success,
+                                      const unsigned char *data,
+                                      SilcUInt32 data_len, void *context)
+{
+  SilcClientProcessWhois w = context;
+  SilcBufferStruct buffer;
+  SilcBuffer packet;
+
+  if (!data) {
+    silc_free(w);
+    return;
+  }
+
+  silc_buffer_set(&buffer, (unsigned char *)data, data_len);
+
+  /* Send the attributes back in COMMAND_REPLY packet */
+  packet =
+    silc_command_reply_payload_encode_va(SILC_COMMAND_WHOIS,
+                                        SILC_STATUS_OK, 0, w->cmd_ident,
+                                        1, 11, buffer.data,
+                                        silc_buffer_len(&buffer));
+  if (!packet) {
+    silc_free(w);
+    return;
+  }
+
+  SILC_LOG_DEBUG(("Sending back requested WHOIS attributes"));
+
+  silc_packet_send(w->conn->stream, SILC_PACKET_COMMAND_REPLY, 0,
+                  silc_buffer_datalen(packet));
+
+  silc_buffer_free(packet);
+  silc_free(w);
+}
+
+/* Process WHOIS command from server */
 
 static void silc_client_command_process_whois(SilcClient client,
                                              SilcClientConnection conn,
                                              SilcCommandPayload payload,
                                              SilcArgumentPayload args)
 {
+  SilcClientProcessWhois w;
   SilcDList attrs;
   unsigned char *tmp;
   SilcUInt32 tmp_len;
-  SilcBuffer buffer, packet;
 
   SILC_LOG_DEBUG(("Received WHOIS command"));
 
@@ -2851,32 +3082,18 @@ static void silc_client_command_process_whois(SilcClient client,
   if (!attrs)
     return;
 
-  /* Process requested attributes */
-  buffer = silc_client_attributes_process(client, conn, attrs);
-  if (!buffer) {
+  w = silc_calloc(1, sizeof(*w));
+  if (!w) {
     silc_attribute_payload_list_free(attrs);
     return;
   }
+  w->conn = conn;
+  w->cmd_ident = silc_command_get_ident(payload);
 
-  /* Send the attributes back in COMMAND_REPLY packet */
-  packet =
-    silc_command_reply_payload_encode_va(SILC_COMMAND_WHOIS,
-                                        SILC_STATUS_OK, 0,
-                                        silc_command_get_ident(payload),
-                                        1, 11, buffer->data,
-                                        silc_buffer_len(buffer));
-  if (!packet) {
-    silc_buffer_free(buffer);
-    return;
-  }
-
-  SILC_LOG_DEBUG(("Sending back requested WHOIS attributes"));
-
-  silc_packet_send(conn->stream, SILC_PACKET_COMMAND_REPLY, 0,
-                  silc_buffer_datalen(packet));
-
-  silc_buffer_free(packet);
-  silc_buffer_free(buffer);
+  /* Process requested attributes */
+  silc_client_attributes_process(client, conn, attrs,
+                                silc_client_command_process_whois_send, w);
+  silc_attribute_payload_list_free(attrs);
 }
 
 /* Client is able to receive some command packets even though they are
index 29e05e73fe086b419299d922f1e196da594b2cfa..ede887535fdcdc97b6219d0c8d73f11b45867021 100644 (file)
@@ -1113,6 +1113,29 @@ silc_client_command_reply_join_resolved(SilcClient client,
 {
   SilcClientCommandContext cmd = context;
   SilcChannelEntry channel = cmd->context;
+  SilcCommandPayload payload = silc_fsm_get_state_context(&cmd->thread);
+  SilcArgumentPayload args = silc_command_get_args(payload);
+  SilcUInt32 list_count;
+  unsigned char *tmp;
+  char msg[512];
+
+  if (!clients) {
+    silc_snprintf(msg, sizeof(msg), "Error resolving channel %s user list",
+                 channel->channel_name);
+    SAY(client, conn, SILC_CLIENT_MESSAGE_COMMAND_ERROR, msg);
+  } else {
+    tmp = silc_argument_get_arg_type(args, 12, NULL);
+    if (tmp) {
+      SILC_GET32_MSB(list_count, tmp);
+      if (list_count - silc_dlist_count(clients) > 5) {
+       silc_snprintf(msg, sizeof(msg),
+                     "Channel %s user list was not fully resolved. "
+                     "The channel may not be fully synced.",
+                     channel->channel_name);
+       SAY(client, conn, SILC_CLIENT_MESSAGE_WARNING, msg);
+      }
+    }
+  }
 
   channel->internal.resolve_cmd_ident = 0;
   silc_client_unref_channel(client, conn, channel);
@@ -1174,7 +1197,7 @@ SILC_FSM_STATE(silc_client_command_reply_join)
 
   /* Get the list count */
   tmp = silc_argument_get_arg_type(args, 12, &len);
-  if (!tmp) {
+  if (!tmp || len != 4) {
     ERROR_CALLBACK(SILC_STATUS_ERR_NOT_ENOUGH_PARAMS);
     goto out;
   }
@@ -1212,7 +1235,6 @@ SILC_FSM_STATE(silc_client_command_reply_join)
   /* Add clients we received in the reply to the channel */
   for (i = 0; i < list_count; i++) {
     SilcUInt16 idp_len;
-    SilcUInt32 mode;
     SilcID id;
     SilcClientEntry client_entry;
 
@@ -1489,6 +1511,20 @@ SILC_FSM_STATE(silc_client_command_reply_cmode)
   silc_client_command_callback(cmd, channel, mode, public_key,
                               channel->channel_pubkeys, channel->user_limit);
 
+  silc_rwlock_wrlock(channel->internal.lock);
+
+  /* If founder key changed, update it */
+  if (public_key &&
+      (!channel->founder_key ||
+       !silc_pkcs_public_key_compare(public_key, channel->founder_key))) {
+    if (channel->founder_key)
+      silc_pkcs_public_key_free(channel->founder_key);
+    channel->founder_key = public_key;
+    public_key = NULL;
+  }
+
+  silc_rwlock_unlock(channel->internal.lock);
+
  out:
   silc_client_unref_channel(client, conn, channel);
   if (public_key)
index 898204a18f46663a571c0c38202d924fb9d3f089..23f1aabcc863ab3988a3049d9f8942f17e2a902b 100644 (file)
@@ -4,7 +4,7 @@
 
   Author: Pekka Riikonen <priikone@silcnet.org>
 
-  Copyright (C) 2000 - 2007 Pekka Riikonen
+  Copyright (C) 2000 - 2008 Pekka Riikonen
 
   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
@@ -227,6 +227,8 @@ struct SilcClientConnectionStruct {
   SilcPublicKey public_key;           /* Public key used in this connection */
   SilcPrivateKey private_key;         /* Private key */
   SilcPacketStream stream;            /* Connection to remote host */
+  SilcStream socket_stream;           /* Socket stream from 'stream' */
+  SilcSocket sock;                    /* The socket from 'socket_stream' */
   SilcConnectionType type;            /* Connection type */
   SilcClientConnectCallback callback;  /* Connection callback */
   void *callback_context;             /* Connection context */
@@ -701,9 +703,9 @@ typedef struct SilcClientParamsStruct {
      not all SILC server versions return such channel name strings. */
   SilcBool full_channel_names;
 
-  /* If this is set to TRUE, the silcclient library will not register and
-     deregister the cipher, pkcs, hash and hmac algorithms. The application
-     itself will need to handle that. */
+  /* If this is set to TRUE, the silcclient library will not initialize
+     or uninitialize the SILC Crypto Toolkit.  The application will have
+     to do that itself by calling silc_crypto_init and silc_crypto_uninit. */
   SilcBool dont_register_crypto_library;
 
 } SilcClientParams;
@@ -1083,11 +1085,11 @@ silc_client_connect_to_client(SilcClient client,
  *                                  stream_create_cb, app);
  *
  *    // Stream callback delivers our new SilcStream context
- *    void stream_create_cb(SilcSocketStreamStatus status, SilcStream stream,
+ *    void stream_create_cb(SilcResult status, SilcStream stream,
  *                          void *context)
  *    {
  *      ...
- *      if (status != SILC_SOCKET_OK)
+ *      if (status != SILC_OK)
  *        error(status);
  *
  *      // Start key exchange
@@ -1391,7 +1393,7 @@ SilcUInt16 silc_client_command_call(SilcClient client,
  *
  *    If FALSE is returned in this function this callback will not be called
  *    again for `command' even if there are more comand replies.  By returning
- *    FALSE the caller my stop the command reply handling when needed.
+ *    FALSE the caller may stop the command reply handling when needed.
  *
  ***/
 typedef SilcBool (*SilcClientCommandReply)(SilcClient client,
diff --git a/lib/silccore/.cvsignore b/lib/silccore/.cvsignore
deleted file mode 100644 (file)
index 282522d..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-Makefile
-Makefile.in
index da2a502fe210c9c43e31a16c49aa464aa14abbcb..f2c73f0ece9fad49a5081d464595d561760068db 100644 (file)
 
 /* Authentication Payload structure */
 struct SilcAuthPayloadStruct {
+  SilcStack stack;
+  unsigned char *random_data;
+  unsigned char *auth_data;
+  SilcUInt16 auth_len;
   SilcUInt16 len;
   SilcUInt16 auth_method;
   SilcUInt16 random_len;
-  unsigned char *random_data;
-  SilcUInt16 auth_len;
-  unsigned char *auth_data;
 };
 
 /* Parses and returns Authentication Payload */
 
-SilcAuthPayload silc_auth_payload_parse(const unsigned char *data,
+SilcAuthPayload silc_auth_payload_parse(SilcStack stack,
+                                       const unsigned char *data,
                                        SilcUInt32 data_len)
 {
   SilcBufferStruct buffer;
@@ -49,21 +51,29 @@ SilcAuthPayload silc_auth_payload_parse(const unsigned char *data,
   SILC_LOG_DEBUG(("Parsing Authentication Payload"));
 
   silc_buffer_set(&buffer, (unsigned char *)data, data_len);
-  newp = silc_calloc(1, sizeof(*newp));
-  if (!newp)
+
+  if (stack)
+    stack = silc_stack_alloc(0, stack);
+
+  newp = silc_scalloc(stack, 1, sizeof(*newp));
+  if (!newp) {
+    silc_stack_free(stack);
     return NULL;
+  }
+  newp->stack = stack;
 
   /* Parse the payload */
-  ret = silc_buffer_unformat(&buffer,
-                            SILC_STR_UI_SHORT(&newp->len),
-                            SILC_STR_UI_SHORT(&newp->auth_method),
-                            SILC_STR_UI16_NSTRING_ALLOC(&newp->random_data,
-                                                        &newp->random_len),
-                            SILC_STR_UI16_NSTRING_ALLOC(&newp->auth_data,
-                                                        &newp->auth_len),
-                            SILC_STR_END);
+  ret = silc_buffer_sunformat(stack, &buffer,
+                             SILC_STR_UI_SHORT(&newp->len),
+                             SILC_STR_UI_SHORT(&newp->auth_method),
+                             SILC_STR_UI16_NSTRING_ALLOC(&newp->random_data,
+                                                         &newp->random_len),
+                             SILC_STR_UI16_NSTRING_ALLOC(&newp->auth_data,
+                                                         &newp->auth_len),
+                             SILC_STR_END);
   if (ret == -1) {
-    silc_free(newp);
+    silc_sfree(stack, newp);
+    silc_stack_free(stack);
     return NULL;
   }
 
@@ -96,7 +106,8 @@ SilcAuthPayload silc_auth_payload_parse(const unsigned char *data,
 
 /* Encodes authentication payload into buffer and returns it */
 
-SilcBuffer silc_auth_payload_encode(SilcAuthMethod method,
+SilcBuffer silc_auth_payload_encode(SilcStack stack,
+                                   SilcAuthMethod method,
                                    const unsigned char *random_data,
                                    SilcUInt16 random_len,
                                    const unsigned char *auth_data,
@@ -114,28 +125,28 @@ SilcBuffer silc_auth_payload_encode(SilcAuthMethod method,
     autf8_len = silc_utf8_encoded_len(auth_data, auth_len, 0);
     if (!autf8_len)
       return NULL;
-    autf8 = silc_calloc(autf8_len, sizeof(*autf8));
+    autf8 = silc_scalloc(stack, autf8_len, sizeof(*autf8));
     auth_len = silc_utf8_encode(auth_data, auth_len, 0, autf8, autf8_len);
     auth_data = (const unsigned char *)autf8;
   }
 
   len = 2 + 2 + 2 + random_len + 2 + auth_len;
-  buffer = silc_buffer_alloc_size(len);
+  buffer = silc_buffer_salloc_size(stack, len);
   if (!buffer) {
-    silc_free(autf8);
+    silc_sfree(stack, autf8);
     return NULL;
   }
 
-  silc_buffer_format(buffer,
-                    SILC_STR_UI_SHORT(len),
-                    SILC_STR_UI_SHORT(method),
-                    SILC_STR_UI_SHORT(random_len),
-                    SILC_STR_UI_XNSTRING(random_data, random_len),
-                    SILC_STR_UI_SHORT(auth_len),
-                    SILC_STR_UI_XNSTRING(auth_data, auth_len),
-                    SILC_STR_END);
+  silc_buffer_sformat(stack, buffer,
+                     SILC_STR_UI_SHORT(len),
+                     SILC_STR_UI_SHORT(method),
+                     SILC_STR_UI_SHORT(random_len),
+                     SILC_STR_UI_XNSTRING(random_data, random_len),
+                     SILC_STR_UI_SHORT(auth_len),
+                     SILC_STR_UI_XNSTRING(auth_data, auth_len),
+                     SILC_STR_END);
 
-  silc_free(autf8);
+  silc_sfree(stack, autf8);
   return buffer;
 }
 
@@ -144,15 +155,19 @@ SilcBuffer silc_auth_payload_encode(SilcAuthMethod method,
 void silc_auth_payload_free(SilcAuthPayload payload)
 {
   if (payload) {
+    SilcStack stack = payload->stack;
+
     if (payload->random_data) {
       memset(payload->random_data, 0, payload->random_len);
-      silc_free(payload->random_data);
+      silc_sfree(stack, payload->random_data);
     }
     if (payload->auth_data) {
       memset(payload->auth_data, 0, payload->auth_len);
-      silc_free(payload->auth_data);
+      silc_sfree(stack, payload->auth_data);
     }
-    silc_free(payload);
+
+    silc_sfree(stack, payload);
+    silc_stack_free(stack);
   }
 }
 
@@ -195,7 +210,8 @@ unsigned char *silc_auth_get_data(SilcAuthPayload payload,
    dictates. */
 
 static unsigned char *
-silc_auth_public_key_encode_data(SilcPublicKey public_key,
+silc_auth_public_key_encode_data(SilcStack stack,
+                                SilcPublicKey public_key,
                                 const unsigned char *randomdata,
                                 SilcUInt32 random_len, const void *id,
                                 SilcIdType type, SilcUInt32 *ret_len)
@@ -204,7 +220,7 @@ silc_auth_public_key_encode_data(SilcPublicKey public_key,
   unsigned char *pk, id_data[32], *ret;
   SilcUInt32 pk_len, id_len;
 
-  pk = silc_pkcs_public_key_encode(public_key, &pk_len);
+  pk = silc_pkcs_public_key_encode(stack, public_key, &pk_len);
   if (!pk)
     return NULL;
 
@@ -213,163 +229,224 @@ silc_auth_public_key_encode_data(SilcPublicKey public_key,
     return NULL;
   }
 
-  buf = silc_buffer_alloc_size(random_len + id_len + pk_len);
+  buf = silc_buffer_salloc_size(stack, random_len + id_len + pk_len);
   if (!buf) {
     silc_free(pk);
     return NULL;
   }
-  silc_buffer_format(buf,
-                    SILC_STR_UI_XNSTRING(randomdata, random_len),
-                    SILC_STR_UI_XNSTRING(id_data, id_len),
-                    SILC_STR_UI_XNSTRING(pk, pk_len),
-                    SILC_STR_END);
+  silc_buffer_sformat(stack, buf,
+                     SILC_STR_UI_XNSTRING(randomdata, random_len),
+                     SILC_STR_UI_XNSTRING(id_data, id_len),
+                     SILC_STR_UI_XNSTRING(pk, pk_len),
+                     SILC_STR_END);
 
   ret = silc_buffer_steal(buf, ret_len);
 
-  silc_buffer_free(buf);
-  silc_free(pk);
+  silc_buffer_sfree(stack, buf);
+  silc_sfree(stack, pk);
 
   return ret;
 }
 
+typedef struct {
+  SilcStack stack;
+  unsigned char *pubdata;
+  SilcUInt32 pubdata_len;
+  SilcAuthGenerated generated;
+  void *context;
+} *SilcAuthGenerateContext;
+
+/* Signature callback */
+
+static void
+silc_auth_public_key_auth_generate_cb(SilcBool success,
+                                     const unsigned char *signature,
+                                     SilcUInt32 signature_len,
+                                     void *context)
+{
+  SilcAuthGenerateContext a = context;
+  SilcStack stack = a->stack;
+  SilcBuffer buf;
+
+  if (!success) {
+    a->generated(NULL, context);
+    silc_sfree(stack, a->pubdata);
+    silc_sfree(stack, a);
+    silc_stack_free(stack);
+    return;
+  }
+
+  /* Encode Authentication Payload */
+  buf = silc_auth_payload_encode(stack, SILC_AUTH_PUBLIC_KEY, a->pubdata,
+                                a->pubdata_len, signature, signature_len);
+
+  a->generated(buf, context);
+
+  silc_buffer_sfree(stack, buf);
+  silc_sfree(stack, a->pubdata);
+  silc_sfree(stack, a);
+  silc_stack_free(stack);
+}
+
 /* Generates Authentication Payload with authentication data. This is used
    to do public key based authentication. This generates the random data
    and the actual authentication data. Returns NULL on error. */
 
-SilcBuffer silc_auth_public_key_auth_generate(SilcPublicKey public_key,
-                                             SilcPrivateKey private_key,
-                                             SilcRng rng, SilcHash hash,
-                                             const void *id, SilcIdType type)
+SilcAsyncOperation
+silc_auth_public_key_auth_generate(SilcPublicKey public_key,
+                                  SilcPrivateKey private_key,
+                                  SilcRng rng, SilcHash hash,
+                                  const void *id, SilcIdType type,
+                                  SilcAuthGenerated generated,
+                                  void *context)
 {
-  unsigned char *randomdata;
-  SilcBuffer buf;
+  unsigned char randomdata[256];
 
-  /* Get 256 bytes of random data */
+  /* Get random data */
   if (rng)
-    randomdata = silc_rng_get_rn_data(rng, 256);
+    silc_rng_get_rn_data(rng, sizeof(randomdata), randomdata,
+                        sizeof(randomdata));
   else
-    randomdata = silc_rng_global_get_rn_data(256);
-  if (!randomdata)
-    return NULL;
-
-  buf = silc_auth_public_key_auth_generate_wpub(public_key, private_key,
-                                               randomdata, 256, hash,
-                                               id, type);
-
-  memset(randomdata, 0, 256);
-  silc_free(randomdata);
+    silc_rng_global_get_rn_data(rng, sizeof(randomdata), randomdata,
+                               sizeof(randomdata));
 
-  return buf;
+  return silc_auth_public_key_auth_generate_wpub(public_key, private_key,
+                                                randomdata, sizeof(randomdata),
+                                                hash, rng, id, type, generated,
+                                                context);
 }
 
 /* Generates Authentication Payload with authentication data. This is used
    to do public key based authentication. This generates the random data
    and the actual authentication data. Returns NULL on error. */
 
-SilcBuffer
+SilcAsyncOperation
 silc_auth_public_key_auth_generate_wpub(SilcPublicKey public_key,
                                        SilcPrivateKey private_key,
                                        const unsigned char *pubdata,
                                        SilcUInt32 pubdata_len,
                                        SilcHash hash,
-                                       const void *id, SilcIdType type)
+                                       SilcRng rng,
+                                       const void *id, SilcIdType type,
+                                       SilcAuthGenerated generated,
+                                       void *context)
 {
-  unsigned char auth_data[2048 + 1];
-  SilcUInt32 auth_len;
+  SilcAuthGenerateContext a;
+  SilcAsyncOperation op;
   unsigned char *tmp;
   SilcUInt32 tmp_len;
-  SilcBuffer buf;
+  SilcStack stack;
 
   SILC_LOG_DEBUG(("Generating Authentication Payload with data"));
 
+  /* We use the Crypto Toolkit's stack since we're doing crypto */
+  stack = silc_stack_alloc(2048, silc_crypto_stack());
+
+  a = silc_scalloc(stack, 1, sizeof(*a));
+  if (!a) {
+    generated(NULL, context);
+    return NULL;
+  }
+  a->stack = stack;
+
   /* Encode the auth data */
-  tmp = silc_auth_public_key_encode_data(public_key, pubdata, pubdata_len, id,
-                                        type, &tmp_len);
-  if (!tmp)
+  tmp = silc_auth_public_key_encode_data(stack, public_key, pubdata,
+                                        pubdata_len, id, type, &tmp_len);
+  if (!tmp) {
+    silc_sfree(stack, a);
+    silc_stack_free(stack);
+    generated(NULL, context);
     return NULL;
+  }
 
-  /* Compute the hash and the signature. */
-  if (!silc_pkcs_sign(private_key, tmp, tmp_len, auth_data,
-                     sizeof(auth_data) - 1, &auth_len, TRUE, hash)) {
+  a->pubdata = silc_smemdup(stack, pubdata, pubdata_len);
+  if (!a->pubdata) {
     memset(tmp, 0, tmp_len);
-    silc_free(tmp);
+    silc_sfree(stack, tmp);
+    silc_sfree(stack, a);
+    silc_stack_free(stack);
+    generated(NULL, context);
     return NULL;
   }
 
-  /* Encode Authentication Payload */
-  buf = silc_auth_payload_encode(SILC_AUTH_PUBLIC_KEY, pubdata, pubdata_len,
-                                auth_data, auth_len);
+  /* Compute the hash and the signature. */
+  op = silc_pkcs_sign_async(private_key, tmp, tmp_len, TRUE, hash, rng,
+                           silc_auth_public_key_auth_generate_cb, a);
 
   memset(tmp, 0, tmp_len);
-  memset(auth_data, 0, sizeof(auth_data));
-  silc_free(tmp);
+  silc_sfree(stack, tmp);
 
-  return buf;
+  return op;
 }
 
-/* Verifies the authentication data. Returns TRUE if authentication was
-   successful. */
+/* Verifies the authentication data. */
 
-SilcBool silc_auth_public_key_auth_verify(SilcAuthPayload payload,
-                                         SilcPublicKey public_key,
-                                         SilcHash hash,
-                                         const void *id, SilcIdType type)
+SilcAsyncOperation
+silc_auth_public_key_auth_verify(SilcAuthPayload payload,
+                                SilcPublicKey public_key,
+                                SilcHash hash,
+                                const void *id,
+                                SilcIdType type,
+                                SilcAuthResultCb result,
+                                void *context)
 {
+  SilcAsyncOperation op;
   unsigned char *tmp;
   SilcUInt32 tmp_len;
 
   SILC_LOG_DEBUG(("Verifying authentication data"));
 
   /* Encode auth data */
-  tmp = silc_auth_public_key_encode_data(public_key, payload->random_data,
+  tmp = silc_auth_public_key_encode_data(payload->stack,
+                                        public_key, payload->random_data,
                                         payload->random_len,
                                         id, type, &tmp_len);
   if (!tmp) {
     SILC_LOG_DEBUG(("Authentication failed"));
-    return FALSE;
+    result(FALSE, context);
+    return NULL;
   }
 
   /* Verify the authentication data */
-  if (!silc_pkcs_verify(public_key, payload->auth_data,
-                       payload->auth_len, tmp, tmp_len, hash)) {
-
-    memset(tmp, 0, tmp_len);
-    silc_free(tmp);
-    SILC_LOG_DEBUG(("Authentication failed"));
-    return FALSE;
-  }
+  op = silc_pkcs_verify_async(public_key, payload->auth_data,
+                             payload->auth_len, tmp, tmp_len, TRUE, hash,
+                             result, context);
 
   memset(tmp, 0, tmp_len);
-  silc_free(tmp);
+  silc_sfree(payload->stack, tmp);
 
-  SILC_LOG_DEBUG(("Authentication successful"));
-
-  return TRUE;
+  return op;
 }
 
 /* Same as above but the payload is not parsed yet. This will parse it. */
 
-SilcBool silc_auth_public_key_auth_verify_data(const unsigned char *payload,
-                                              SilcUInt32 payload_len,
-                                              SilcPublicKey public_key,
-                                              SilcHash hash,
-                                              const void *id, SilcIdType type)
+SilcAsyncOperation
+silc_auth_public_key_auth_verify_data(const unsigned char *payload,
+                                     SilcUInt32 payload_len,
+                                     SilcPublicKey public_key,
+                                     SilcHash hash,
+                                     const void *id,
+                                     SilcIdType type,
+                                     SilcAuthResultCb result,
+                                     void *context)
 {
+  SilcAsyncOperation op;
   SilcAuthPayload auth_payload;
-  int ret;
 
-  auth_payload = silc_auth_payload_parse(payload, payload_len);
+  auth_payload = silc_auth_payload_parse(silc_crypto_stack(), payload,
+                                        payload_len);
   if (!auth_payload) {
     SILC_LOG_DEBUG(("Authentication failed"));
-    return FALSE;
+    result(FALSE, context);
+    return NULL;
   }
 
-  ret = silc_auth_public_key_auth_verify(auth_payload, public_key, hash,
-                                        id, type);
+  op = silc_auth_public_key_auth_verify(auth_payload, public_key, hash,
+                                       id, type, result, context);
 
   silc_auth_payload_free(auth_payload);
 
-  return ret;
+  return op;
 }
 
 /* Verifies the authentication data directly from the Authentication
@@ -379,20 +456,25 @@ SilcBool silc_auth_public_key_auth_verify_data(const unsigned char *payload,
    authentication then the `auth_data' is the SilcPublicKey and the
    `auth_data_len' is ignored. */
 
-SilcBool silc_auth_verify(SilcAuthPayload payload, SilcAuthMethod auth_method,
-                         const void *auth_data, SilcUInt32 auth_data_len,
-                         SilcHash hash, const void *id, SilcIdType type)
+SilcAsyncOperation
+silc_auth_verify(SilcAuthPayload payload, SilcAuthMethod auth_method,
+                const void *auth_data, SilcUInt32 auth_data_len,
+                SilcHash hash, const void *id, SilcIdType type,
+                SilcAuthResultCb result, void *context)
 {
   SILC_LOG_DEBUG(("Verifying authentication"));
 
-  if (!payload || auth_method != payload->auth_method)
-    return FALSE;
+  if (!payload || auth_method != payload->auth_method) {
+    result(FALSE, context);
+    return NULL;
+  }
 
   switch (payload->auth_method) {
   case SILC_AUTH_NONE:
     /* No authentication */
     SILC_LOG_DEBUG(("No authentication required"));
-    return TRUE;
+    result(TRUE, context);
+    return NULL;
 
   case SILC_AUTH_PASSWORD:
     /* Passphrase based authentication. The `pkcs', `hash', `id' and `type'
@@ -405,14 +487,15 @@ SilcBool silc_auth_verify(SilcAuthPayload payload, SilcAuthMethod auth_method,
 
     if (!memcmp(payload->auth_data, auth_data, auth_data_len)) {
       SILC_LOG_DEBUG(("Passphrase Authentication successful"));
-      return TRUE;
+      result(TRUE, context);
+      return NULL;
     }
     break;
 
   case SILC_AUTH_PUBLIC_KEY:
     /* Public key based authentication */
     return silc_auth_public_key_auth_verify(payload, (SilcPublicKey)auth_data,
-                                           hash, id, type);
+                                           hash, id, type, result, context);
     break;
 
   default:
@@ -420,32 +503,38 @@ SilcBool silc_auth_verify(SilcAuthPayload payload, SilcAuthMethod auth_method,
   }
 
   SILC_LOG_DEBUG(("Authentication failed"));
+  result(FALSE, context);
 
-  return FALSE;
+  return NULL;
 }
 
 /* Same as above but parses the authentication payload before verify. */
 
-SilcBool silc_auth_verify_data(const unsigned char *payload,
-                              SilcUInt32 payload_len,
-                              SilcAuthMethod auth_method,
-                              const void *auth_data,
-                              SilcUInt32 auth_data_len, SilcHash hash,
-                              const void *id, SilcIdType type)
+SilcAsyncOperation
+silc_auth_verify_data(const unsigned char *payload,
+                     SilcUInt32 payload_len,
+                     SilcAuthMethod auth_method,
+                     const void *auth_data,
+                     SilcUInt32 auth_data_len, SilcHash hash,
+                     const void *id, SilcIdType type,
+                     SilcAuthResultCb result, void *context)
 {
+  SilcAsyncOperation op;
   SilcAuthPayload auth_payload;
-  SilcBool ret;
 
-  auth_payload = silc_auth_payload_parse(payload, payload_len);
-  if (!auth_payload || (auth_payload->auth_len == 0))
-    return FALSE;
+  auth_payload = silc_auth_payload_parse(silc_crypto_stack(), payload,
+                                        payload_len);
+  if (!auth_payload || (auth_payload->auth_len == 0)) {
+    result(FALSE, context);
+    return NULL;
+  }
 
-  ret = silc_auth_verify(auth_payload, auth_method, auth_data, auth_data_len,
-                        hash, id, type);
+  op = silc_auth_verify(auth_payload, auth_method, auth_data, auth_data_len,
+                        hash, id, type, result, context);
 
   silc_auth_payload_free(auth_payload);
 
-  return ret;
+  return op;
 }
 
 /******************************************************************************
index 39b7c328631e42c27342e3362f745b35a2c31491..a8d4512a04d1d6710219ac2da7f83fd26048ba8d 100644 (file)
@@ -4,7 +4,7 @@
 
   Author: Pekka Riikonen <priikone@silcnet.org>
 
-  Copyright (C) 2001 - 2007 Pekka Riikonen
+  Copyright (C) 2001 - 2008 Pekka Riikonen
 
   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
 #ifndef SILCAUTH_H
 #define SILCAUTH_H
 
+#define SILC_DEFAULT_HMAC "hmac-sha1-96"
+#define SILC_DEFAULT_HASH "sha1"
+#define SILC_DEFAULT_PKCS "rsa"
+#define SILC_DEFAULT_CIPHER "aes-256-cbc"
+
 /****d* silccore/SilcAuthAPI/SilcAuthMethod
  *
  * NAME
@@ -97,23 +102,27 @@ typedef struct SilcAuthPayloadStruct *SilcAuthPayload;
  *
  * SYNOPSIS
  *
- *    SilcAuthPayload silc_auth_payload_parse(const unsigned char *data,
+ *    SilcAuthPayload silc_auth_payload_parse(SilcStack stack,
+ *                                            const unsigned char *data,
  *                                            SilcUInt32 data_len);
  *
  * DESCRIPTION
  *
  *    Parses and returns Authentication Payload.  The `data' and the
- *    `data_len' are the raw payload buffer.
+ *    `data_len' are the raw payload buffer.  If `stack' is non-NULL the
+ *    memory is allcoated from `stack'.
  *
  ***/
-SilcAuthPayload silc_auth_payload_parse(const unsigned char *data,
+SilcAuthPayload silc_auth_payload_parse(SilcStack stack,
+                                       const unsigned char *data,
                                        SilcUInt32 data_len);
 
 /****f* silccore/SilcAuthAPI/silc_auth_payload_encode
  *
  * SYNOPSIS
  *
- *    SilcBuffer silc_auth_payload_encode(SilcAuthMethod method,
+ *    SilcBuffer silc_auth_payload_encode(SilcStack stack,
+ *                                        SilcAuthMethod method,
  *                                        const unsigned char *random_data,
  *                                        SilcUInt16 random_len,
  *                                        const unsigned char *auth_data,
@@ -128,8 +137,13 @@ SilcAuthPayload silc_auth_payload_parse(const unsigned char *data,
  *    argument SHOULD be UTF-8 encoded, if not library will attempt to
  *    encode it.
  *
+ *    If `stack' is non-NULL the returned buffer is allocated from `stack'.
+ *    This call consumes the `stack' so caller should push the stack before
+ *    calling this function and then later pop it.
+ *
  ***/
-SilcBuffer silc_auth_payload_encode(SilcAuthMethod method,
+SilcBuffer silc_auth_payload_encode(SilcStack stack,
+                                   SilcAuthMethod method,
                                    const unsigned char *random_data,
                                    SilcUInt16 random_len,
                                    const unsigned char *auth_data,
@@ -194,23 +208,41 @@ unsigned char *silc_auth_get_public_data(SilcAuthPayload payload,
 unsigned char *silc_auth_get_data(SilcAuthPayload payload,
                                  SilcUInt32 *auth_len);
 
+/****f* silccore/SilcAuthAPI/SilcAuthGenerated
+ *
+ * SYNOPSIS
+ *
+ *    typedef void (*SilcAuthGenerated)(const SilcBuffer data, void *context);
+ *
+ * DESCRIPTION
+ *
+ *    Callback of this type is given as argument to
+ *    silc_auth_public_key_auth_generate and
+ *    silc_auth_public_key_auth_generate_wpub to deliver the generated
+ *    Authentication Payload.  If `data' is NULL the generating failed.
+ *
+ ***/
+typedef void (*SilcAuthGenerated)(const SilcBuffer data, void *context);
+
 /****f* silccore/SilcAuthAPI/silc_auth_public_key_auth_generate
  *
  * SYNOPSIS
  *
- *    SilcBuffer silc_auth_public_key_auth_generate(SilcPublicKey public_key,
- *                                                  SilcPrivateKey private_key,
- *                                                  SilcRng rng,
- *                                                  SilcHash hash,
- *                                                  const void *id,
- *                                                  SilcIdType type);
+ *    SilcAsyncOperation
+ *    silc_auth_public_key_auth_generate(SilcPublicKey public_key,
+ *                                       SilcPrivateKey private_key,
+ *                                       SilcRng rng,
+ *                                       SilcHash hash,
+ *                                       const void *id,
+ *                                       SilcIdType type,
+ *                                       SilcAuthGenerated generated,
+ *                                       void *context);
  *
  * DESCRIPTION
  *
  *    Generates Authentication Payload with authentication data. This is used
  *    to do public key based authentication. This generates the random data
- *    and the actual authentication data. Returns NULL on error and the
- *    encoded Authentication Payload on success.
+ *    and the actual authentication data.
  *
  *    The `private_key' is used to sign the payload.  The `public_key', the
  *    and the `id' is encoded in the payload and signed.  If the `rng' is
@@ -218,24 +250,33 @@ unsigned char *silc_auth_get_data(SilcAuthPayload payload,
  *    random number generator.  Also random number is encoded in the
  *    payload before signing it with `private_key'.
  *
+ *    The `generated' is called to deliver the generated Authentication
+ *    Payload.
+ *
  ***/
-SilcBuffer silc_auth_public_key_auth_generate(SilcPublicKey public_key,
-                                             SilcPrivateKey private_key,
-                                             SilcRng rng, SilcHash hash,
-                                             const void *id, SilcIdType type);
+SilcAsyncOperation
+silc_auth_public_key_auth_generate(SilcPublicKey public_key,
+                                  SilcPrivateKey private_key,
+                                  SilcRng rng, SilcHash hash,
+                                  const void *id, SilcIdType type,
+                                  SilcAuthGenerated generated,
+                                  void *context);
 
 /****f* silccore/SilcAuthAPI/silc_auth_public_key_auth_generate_wpub
  *
  * SYNOPSIS
  *
- *    SilcBuffer
+ *    SilcAsyncOperation
  *    silc_auth_public_key_auth_generate_wpub(SilcPublicKey public_key,
  *                                            SilcPrivateKey private_key,
  *                                            const unsigned char *pubdata,
  *                                            SilcUInt32 pubdata_len,
  *                                            SilcHash hash,
+ *                                            SilcRng rng,
  *                                            const void *id,
- *                                            SilcIdType type);
+ *                                            SilcIdType type,
+ *                                            SilcAuthGenerated generated,
+ *                                            void *context);
  *
  * DESCRIPTION
  *
@@ -244,69 +285,109 @@ SilcBuffer silc_auth_public_key_auth_generate(SilcPublicKey public_key,
  *    the public data must be something else than purely random or its
  *    structure mut be set before signing.
  *
+ *    The `generated' is called to deliver the generated Authentication
+ *    Payload.
+ *
  ***/
-SilcBuffer
+SilcAsyncOperation
 silc_auth_public_key_auth_generate_wpub(SilcPublicKey public_key,
                                        SilcPrivateKey private_key,
                                        const unsigned char *pubdata,
                                        SilcUInt32 pubdata_len,
                                        SilcHash hash,
-                                       const void *id, SilcIdType type);
+                                       SilcRng rng,
+                                       const void *id, SilcIdType type,
+                                       SilcAuthGenerated generated,
+                                       void *context);
+
+/****f* silccore/SilcAuthAPI/SilcAuthResult
+ *
+ * SYNOPSIS
+ *
+ *    typedef void (*SilcAuthResult)(SilcBool success, void *context);
+ *
+ * DESCRIPTION
+ *
+ *    Callback of this type is given as argument to silc_auth_verify,
+ *    silc_auth_verify_data, silc_auth_public_key_auth_verify and
+ *    silc_auth_public_key_auth_verify_data to deliver the result of
+ *    the authentication verification.  If `success' is FALSE the
+ *    authentication failed.
+ *
+ ***/
+typedef void (*SilcAuthResultCb)(SilcBool success, void *context);
 
 /****f* silccore/SilcAuthAPI/silc_auth_public_key_auth_verify
  *
  * SYNOPSIS
  *
- *    SilcBool silc_auth_public_key_auth_verify(SilcAuthPayload payload,
- *                                          SilcPublicKey public_key,
- *                                          SilcHash hash,
- *                                          const void *id, SilcIdType type);
+ *    SilcAsyncOperation
+ *   silc_auth_public_key_auth_verify(SilcAuthPayload payload,
+ *                                    SilcPublicKey public_key,
+ *                                    SilcHash hash,
+ *                                    const void *id,
+ *                                    SilcIdType type,
+ *                                    SilcAuthResult result,
+ *                                    void *context);
  *
  * DESCRIPTION
  *
- *    Verifies the authentication data. Returns TRUE if authentication was
- *    successful.
+ *    Verifies the authentication data.  Calls the `result' to deliver
+ *    the result of the verification.
  *
  ***/
-SilcBool silc_auth_public_key_auth_verify(SilcAuthPayload payload,
-                                         SilcPublicKey public_key,
-                                         SilcHash hash,
-                                         const void *id,
-                                         SilcIdType type);
+SilcAsyncOperation
+silc_auth_public_key_auth_verify(SilcAuthPayload payload,
+                                SilcPublicKey public_key,
+                                SilcHash hash,
+                                const void *id,
+                                SilcIdType type,
+                                SilcAuthResultCb result,
+                                void *context);
 
 /****f* silccore/SilcAuthAPI/silc_auth_public_key_auth_verify_data
  *
  * SYNOPSIS
  *
- *    SilcBool silc_auth_public_key_auth_verify_data(const unsigned char *payload,
- *                                               SilcUInt32 payload_len,
- *                                               SilcPublicKey public_key,
- *                                               SilcHash hash,
- *                                               const void *id,
- *                                               SilcIdType type);
+ *    SilcAsyncOperation
+ *    silc_auth_public_key_auth_verify_data(const unsigned char *payload,
+ *                                          SilcUInt32 payload_len,
+ *                                          SilcPublicKey public_key,
+ *                                          SilcHash hash,
+ *                                          const void *id,
+ *                                          SilcIdType type,
+ *                                          SilcAuthResult result,
+ *                                          void *context);
  *
  * DESCRIPTION
  *
  *    Same as silc_auth_public_key_auth_verify but the payload has not
- *    been parsed yet.  This will parse it.  Returns TRUE if authentication
- *    was successful.
+ *    been parsed yet.  This will parse it.  Calls the `result' to deliver
+ *    the result of the verification.
  *
  ***/
-SilcBool silc_auth_public_key_auth_verify_data(const unsigned char *payload,
-                                              SilcUInt32 payload_len,
-                                              SilcPublicKey public_key,
-                                              SilcHash hash,
-                                              const void *id,
-                                              SilcIdType type);
+SilcAsyncOperation
+silc_auth_public_key_auth_verify_data(const unsigned char *payload,
+                                     SilcUInt32 payload_len,
+                                     SilcPublicKey public_key,
+                                     SilcHash hash,
+                                     const void *id,
+                                     SilcIdType type,
+                                     SilcAuthResultCb result,
+                                     void *context);
 
 /****f* silccore/SilcAuthAPI/silc_auth_verify
  *
  * SYNOPSIS
  *
- *    SilcBool silc_auth_verify(SilcAuthPayload payload,
- *                          SilcAuthMethod auth_method,
- *                          const void *auth_data, SilcUInt32 auth_data_len,
- *                          SilcHash hash, const void *id, SilcIdType type);
+ *    SilcAsyncOperation
+ *    silc_auth_verify(SilcAuthPayload payload,
+ *                     SilcAuthMethod auth_method,
+ *                     const void *auth_data,
+ *                     SilcUInt32 auth_data_len,
+ *                     SilcHash hash,
+ *                     const void *id, SilcIdType type,
+ *                     SilcAuthResult result, void *context);
  *
  * DESCRIPTION
  *
@@ -316,22 +397,27 @@ SilcBool silc_auth_public_key_auth_verify_data(const unsigned char *payload,
  *    are the passphrase and its length.  The passphrase MUST be UTF-8
  *    encoded.  If the method is public key authentication then the
  *    `auth_data' is the SilcPublicKey and the `auth_data_len' is ignored.
+ *    Calls the `result' to deliver the result of the verification.
  *
  ***/
-SilcBool silc_auth_verify(SilcAuthPayload payload, SilcAuthMethod auth_method,
-                         const void *auth_data, SilcUInt32 auth_data_len,
-                         SilcHash hash, const void *id, SilcIdType type);
+SilcAsyncOperation
+silc_auth_verify(SilcAuthPayload payload, SilcAuthMethod auth_method,
+                const void *auth_data, SilcUInt32 auth_data_len,
+                SilcHash hash, const void *id, SilcIdType type,
+                SilcAuthResultCb result, void *context);
 
 /****f* silccore/SilcAuthAPI/silc_auth_verify_data
  *
  * SYNOPSIS
  *
- *    SilcBool silc_auth_verify_data(const unsigned char *payload,
- *                               SilcUInt32 payload_len,
- *                               SilcAuthMethod auth_method,
- *                               const void *auth_data,
- *                               SilcUInt32 auth_data_len, SilcHash hash,
- *                               const void *id, SilcIdType type);
+ *    SilcAsyncOperation
+ *    silc_auth_verify_data(const unsigned char *payload,
+ *                          SilcUInt32 payload_len,
+ *                          SilcAuthMethod auth_method,
+ *                          const void *auth_data,
+ *                          SilcUInt32 auth_data_len, SilcHash hash,
+ *                          const void *id, SilcIdType type,
+ *                          SilcAuthResult result, void *context);
  *
  * DESCRIPTION
  *
@@ -342,14 +428,17 @@ SilcBool silc_auth_verify(SilcAuthPayload payload, SilcAuthMethod auth_method,
  *    are the passphrase and its length.  The passphrase MUST be UTF-8
  *    encoded.  If the method is public key authentication then the
  *    `auth_data' is the SilcPublicKey and the `auth_data_len' is ignored.
+ *    Calls the `result' to deliver the result of the verification.
  *
  ***/
-SilcBool silc_auth_verify_data(const unsigned char *payload,
-                              SilcUInt32 payload_len,
-                              SilcAuthMethod auth_method,
-                              const void *auth_data,
-                              SilcUInt32 auth_data_len, SilcHash hash,
-                              const void *id, SilcIdType type);
+SilcAsyncOperation
+silc_auth_verify_data(const unsigned char *payload,
+                     SilcUInt32 payload_len,
+                     SilcAuthMethod auth_method,
+                     const void *auth_data,
+                     SilcUInt32 auth_data_len, SilcHash hash,
+                     const void *id, SilcIdType type,
+                     SilcAuthResultCb result, void *context);
 
 /****s* silccore/SilcAuthAPI/SilcKeyAgreementPayload
  *
index eb0d176efce4540e4abd95160149d390be4d24b6..059797e5bc5d03c95beb5dc299490f94d19b6b66 100644 (file)
@@ -4,7 +4,7 @@
 
   Author: Pekka Riikonen <priikone@silcnet.org>
 
-  Copyright (C) 1997 - 2006 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
 #ifndef SILCCOMMAND_H
 #define SILCCOMMAND_H
 
-/****f* silccore/SilcCommandAPI/SilcCommandCb
- *
- * SYNOPSIS
- *
- *    typedef void (*SilcCommandCb)(void *context, void *context2);
- *
- * DESCRIPTION
- *
- *    Command function callback. The actual command function pointer.
- *    This is generic command callback that the application may choose to
- *    use with its command routines.  However, none of the generic
- *    routines depend on this callback so application may freely define
- *    their own command callback if desired.
- *
- ***/
-typedef void (*SilcCommandCb)(void *context, void *context2);
-
 /****s* silccore/SilcCommandAPI/SilcCommandPayload
  *
  * NAME
index cfdc6f66ecb8665ae07e8093a312bf31522ea9fa..609814bddfd7f549412f359403a9f9c4aa27b288 100644 (file)
@@ -4,7 +4,7 @@
 
   Author: Pekka Riikonen <priikone@silcnet.org>
 
-  Copyright (C) 1997 - 2007 Pekka Riikonen
+  Copyright (C) 1997 - 2008 Pekka Riikonen
 
   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
@@ -425,3 +425,101 @@ void *silc_id_dup(const void *id, SilcIdType type)
 
   return NULL;
 }
+
+/**************************** Utility functions *****************************/
+
+/* Hash a ID. The `user_context' is the ID type. */
+
+SilcUInt32 silc_hash_id(void *key, void *user_context)
+{
+  SilcIdType id_type = (SilcIdType)SILC_PTR_TO_32(user_context);
+  SilcUInt32 h = 0;
+  int i;
+
+  switch (id_type) {
+  case SILC_ID_CLIENT:
+    {
+      SilcClientID *id = (SilcClientID *)key;
+
+      /* The client ID is hashed by hashing the hash of the ID
+        (which is a truncated MD5 hash of the nickname) so that we
+        can access the entry from the cache with both Client ID but
+        with just a hash from the ID as well. */
+      return silc_hash_client_id_hash(id->hash, NULL);
+    }
+    break;
+  case SILC_ID_SERVER:
+    {
+      SilcServerID *id = (SilcServerID *)key;
+
+      h = id->port * id->rnd;
+      for (i = 0; i < id->ip.data_len; i++)
+       h ^= id->ip.data[i];
+
+      return h;
+    }
+    break;
+  case SILC_ID_CHANNEL:
+    {
+      SilcChannelID *id = (SilcChannelID *)key;
+
+      h = id->port * id->rnd;
+      for (i = 0; i < id->ip.data_len; i++)
+       h ^= id->ip.data[i];
+
+      return h;
+    }
+    break;
+  default:
+    break;
+  }
+
+  return h;
+}
+
+/* Hash Client ID's hash. */
+
+SilcUInt32 silc_hash_client_id_hash(void *key, void *user_context)
+{
+  int i;
+  unsigned char *hash = key;
+  SilcUInt32 h = 0, g;
+
+  for (i = 0; i < CLIENTID_HASH_LEN; i++) {
+    h = (h << 4) + hash[i];
+    if ((g = h & 0xf0000000)) {
+      h = h ^ (g >> 24);
+      h = h ^ g;
+    }
+  }
+
+  return h;
+}
+
+/* Compares two ID's. May be used as SilcHashTable comparison function.
+   The Client ID's compares only the hash of the Client ID not any other
+   part of the Client ID. Other ID's are fully compared. */
+
+SilcBool silc_hash_id_compare(void *key1, void *key2, void *user_context)
+{
+  SilcIdType id_type = (SilcIdType)SILC_PTR_TO_32(user_context);
+  return (id_type == SILC_ID_CLIENT ?
+         SILC_ID_COMPARE_HASH((SilcClientID *)key1, (SilcClientID *)key2) :
+         SILC_ID_COMPARE_TYPE(key1, key2, id_type));
+}
+
+/* Compares two ID's. Compares full IDs. */
+
+SilcBool silc_hash_id_compare_full(void *key1, void *key2, void *user_context)
+{
+  SilcIdType id_type = (SilcIdType)SILC_PTR_TO_32(user_context);
+  return SILC_ID_COMPARE_TYPE(key1, key2, id_type);
+}
+
+/* Compare two Client ID's entirely and not just the hash from the ID. */
+
+SilcBool silc_hash_client_id_compare(void *key1, void *key2,
+                                    void *user_context)
+{
+  return SILC_ID_COMPARE_TYPE(key1, key2, SILC_ID_CLIENT);
+}
index 4cab7b75354947305c52ea3813049e18943335f9..9f8c84e7dcb278484276968430248a3da91836ce 100644 (file)
@@ -4,7 +4,7 @@
 
   Author: Pekka Riikonen <priikone@silcnet.org>
 
-  Copyright (C) 1997 - 2007 Pekka Riikonen
+  Copyright (C) 1997 - 2008 Pekka Riikonen
 
   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
@@ -535,4 +535,81 @@ SilcUInt32 silc_id_get_len(const void *id, SilcIdType type);
  ***/
 void *silc_id_dup(const void *id, SilcIdType type);
 
+/****f* silccore/SilcIDAPI/silc_hash_id
+ *
+ * SYNOPSIS
+ *
+ *    SilcUInt32 silc_hash_id(void *key, void *user_context);
+ *
+ * DESCRIPTION
+ *
+ *    Hash a ID. The `user_context' is the ID type.  Can be used with
+ *    SilcHashTable.
+ *
+ ***/
+SilcUInt32 silc_hash_id(void *key, void *user_context);
+
+/****f* silccore/SilcIDAPI/silc_hash_client_id_hash
+ *
+ * SYNOPSIS
+ *
+ *    SilcUInt32 silc_hash_client_id_hash(void *key, void *user_context)
+ *
+ * DESCRIPTION
+ *
+ *    Hash Client ID's hash.  Can be used with SilcHashTable.
+ *
+ ***/
+SilcUInt32 silc_hash_client_id_hash(void *key, void *user_context);
+
+/****f* silccore/SilcIDAPI/silc_hash_id_compare
+ *
+ * SYNOPSIS
+ *
+ *    SilcBool silc_hash_id_compare(void *key1, void *key2,
+ *                                  void *user_context);
+ *
+ * DESCRIPTION
+ *
+ *    Compares two ID's. May be used as SilcHashTable comparison function.
+ *    The Client ID's compares only the hash of the Client ID not any other
+ *    part of the Client ID. Other ID's are fully compared.  Can be
+ *    used with SilcHashTable.
+ *
+ ***/
+SilcBool silc_hash_id_compare(void *key1, void *key2, void *user_context);
+
+/****f* silccore/SilcIDAPI/silc_hash_id_compare_full
+ *
+ * SYNOPSIS
+ *
+ *    SilcBool silc_hash_id_compare_full(void *key1, void *key2,
+ *                                       void *user_context)
+ *
+ * DESCRIPTION
+ *
+ *    Compares two ID's. May be used as SilcHashTable comparison function.
+ *    To compare full ID's instead of only partial, like the
+ *    silc_hash_id_compare does, use this function.  Can be used with
+ *    SilcHashTable.
+ *
+ ***/
+SilcBool silc_hash_id_compare_full(void *key1, void *key2, void *user_context);
+
+/****f* silccore/SilcIDAPI/silc_hash_client_id_compare
+ *
+ * SYNOPSIS
+ *
+ *    SilcBool silc_hash_client_id_compare(void *key1, void *key2,
+ *                                         void *user_context);
+ *
+ * DESCRIPTION
+ *
+ *    Compare two Client ID's entirely and not just the hash from the ID.
+ *    Can be used with SilcHashTable.
+ *
+ ***/
+SilcBool silc_hash_client_id_compare(void *key1, void *key2,
+                                    void *user_context);
+
 #endif
index d1b43ee581bc03c7d0610ff431b13a79930129d5..b1e3894d9179ac104e253f0c1851803eb8dd78e4 100644 (file)
 
 /* Payload encoding context */
 typedef struct {
+  SilcBuffer buffer;
+  SilcBuffer sign;
+  SilcStack stack;
+  SilcMessagePayloadEncoded encoded;
+  void *context;
   SilcMessageFlags flags;
   SilcPublicKey public_key;
   SilcPrivateKey private_key;
+  SilcRng rng;
   SilcHash hash;
   SilcCipher cipher;
   SilcHmac hmac;
   unsigned char *iv;
+  unsigned char *pk;
+  SilcUInt16 pk_len;
+  SilcUInt16 iv_len;
   SilcUInt16 payload_len;
-  SilcID *sid;
-  SilcID *rid;
+  SilcID sid;
+  SilcID rid;
 } SilcMessageEncode;
 
 
 /************************* Static utility functions *************************/
 
+static void
+silc_message_payload_encode_final(SilcBuffer buffer,
+                                 SilcMessageFlags flags,
+                                 SilcCipher cipher,
+                                 SilcHmac hmac,
+                                 unsigned char *iv,
+                                 SilcUInt32 iv_len,
+                                 SilcUInt32 payload_len,
+                                 SilcID *sender_id,
+                                 SilcID *receiver_id,
+                                 SilcStack stack,
+                                 SilcBuffer signature,
+                                 SilcMessagePayloadEncoded encoded,
+                                 void *context);
+
 /* Returns the data length that fits to the packet.  If data length is too
    big it will be truncated to fit to the payload. */
 
@@ -140,126 +164,184 @@ silc_message_signed_payload_parse(const unsigned char *data,
 /* Encodes the data to be signed to SILC_MESSAGE_FLAG_SIGNED Payload */
 
 static SilcBuffer
-silc_message_signed_encode_data(const unsigned char *message_payload,
+silc_message_signed_encode_data(SilcStack stack,
+                               const unsigned char *message_payload,
                                SilcUInt32 message_payload_len,
                                unsigned char *pk,
                                SilcUInt32 pk_len, SilcUInt32 pk_type)
 {
   SilcBuffer sign;
 
-  sign = silc_buffer_alloc_size(message_payload_len + 4 + pk_len);
+  sign = silc_buffer_salloc_size(stack, message_payload_len + 4 + pk_len);
   if (!sign)
     return NULL;
 
-  silc_buffer_format(sign,
-                    SILC_STR_UI_XNSTRING(message_payload,
-                                         message_payload_len),
-                    SILC_STR_UI_SHORT(pk_len),
-                    SILC_STR_UI_SHORT(pk_type),
-                    SILC_STR_END);
+  silc_buffer_sformat(stack, sign,
+                     SILC_STR_DATA(message_payload, message_payload_len),
+                     SILC_STR_UI_SHORT(pk_len),
+                     SILC_STR_UI_SHORT(pk_type),
+                     SILC_STR_END);
 
   if (pk && pk_len) {
     silc_buffer_pull(sign, message_payload_len + 4);
-    silc_buffer_format(sign,
-                      SILC_STR_UI_XNSTRING(pk, pk_len),
-                      SILC_STR_END);
+    silc_buffer_sformat(stack, sign,
+                       SILC_STR_UI_XNSTRING(pk, pk_len),
+                       SILC_STR_END);
     silc_buffer_push(sign, message_payload_len + 4);
   }
 
   return sign;
 }
 
+/* Signature callback */
+
+void silc_message_signed_payload_encode_cb(SilcBool success,
+                                          const unsigned char *signature,
+                                          SilcUInt32 signature_len,
+                                          void *context)
+{
+  SilcMessageEncode *e = context;
+  SilcPKCSType pk_type;
+  SilcStack stack = e->stack;
+  SilcBuffer buffer, payload;
+  SilcMessageFlags flags;
+  SilcCipher cipher;
+  SilcHmac hmac;
+  unsigned char *iv;
+  SilcUInt32 iv_len, payload_len;
+  SilcID *sid, *rid;
+  SilcMessagePayloadEncoded encoded;
+  void *encoded_context;
+
+  if (!success) {
+    e->encoded(NULL, e->context);
+    silc_buffer_sfree(stack, e->sign);
+    silc_sfree(stack, e->pk);
+    silc_sfree(stack, e);
+    silc_stack_free(stack);
+    return;
+  }
+
+  pk_type = silc_pkcs_get_type(e->private_key);
+
+  /* Encode the SILC_MESSAGE_FLAG_SIGNED Payload */
+  buffer = silc_buffer_salloc_size(stack, 4 + e->pk_len + 2 + signature_len);
+  if (!buffer) {
+    e->encoded(NULL, e->context);
+    silc_buffer_sfree(stack, e->sign);
+    silc_sfree(stack, e->pk);
+    silc_sfree(stack, e);
+    silc_stack_free(stack);
+    return;
+  }
+
+  silc_buffer_sformat(stack, buffer,
+                     SILC_STR_UI_SHORT(e->pk_len),
+                     SILC_STR_UI_SHORT(pk_type),
+                     SILC_STR_END);
+
+  if (e->pk_len && e->pk) {
+    silc_buffer_pull(buffer, 4);
+    silc_buffer_sformat(stack, buffer,
+                       SILC_STR_DATA(e->pk, e->pk_len),
+                       SILC_STR_END);
+    silc_buffer_push(buffer, 4);
+  }
+
+  silc_buffer_pull(buffer, 4 + e->pk_len);
+  silc_buffer_sformat(stack, buffer,
+                     SILC_STR_UI_SHORT(signature_len),
+                     SILC_STR_DATA(signature, signature_len),
+                     SILC_STR_END);
+  silc_buffer_push(buffer, 4 + e->pk_len);
+
+  SILC_LOG_HEXDUMP(("SIG payload"), buffer->data, silc_buffer_len(buffer));
+
+  payload = e->buffer;
+  flags = e->flags;
+  cipher = e->cipher;
+  hmac = e->hmac;
+  iv = e->iv;
+  iv_len = e->iv_len;
+  payload_len = e->payload_len;
+  sid = &e->sid;
+  rid = &e->rid;
+  encoded = e->encoded;
+  encoded_context = e->context;
+
+  silc_sfree(stack, e->pk);
+  silc_buffer_sfree(stack, e->sign);
+  silc_sfree(stack, e);
+
+  /* Finalize message payload encoding */
+  silc_message_payload_encode_final(payload, flags, cipher, hmac,
+                                   iv, iv_len, payload_len,
+                                   sid, rid, stack, buffer,
+                                   encoded, encoded_context);
+}
+
 /* Encodes the SILC_MESSAGE_FLAG_SIGNED Payload and computes the digital
    signature. */
 
-static SilcBuffer
-silc_message_signed_payload_encode(const unsigned char *message_payload,
-                                  SilcUInt32 message_payload_len,
-                                  SilcPublicKey public_key,
-                                  SilcPrivateKey private_key,
-                                  SilcHash hash)
+static SilcAsyncOperation
+silc_message_signed_payload_encode(SilcBuffer payload,
+                                  SilcMessageEncode *e)
 {
-  SilcBuffer buffer, sign;
-  unsigned char auth_data[2048 + 1];
-  SilcUInt32 auth_len;
+  SilcAsyncOperation op;
+  SilcBuffer sign;
   unsigned char *pk = NULL;
   SilcUInt32 pk_len = 0;
   SilcUInt16 pk_type;
-
-  if (!message_payload || !message_payload_len || !private_key || !hash)
+  SilcStack stack = e->stack;
+  SilcRng rng = e->rng;
+  SilcHash hash = e->hash;
+  SilcPublicKey public_key = e->public_key;
+  SilcPrivateKey private_key = e->private_key;
+  unsigned char *message_payload;
+  SilcUInt16 message_payload_len;
+
+  message_payload = payload->head;
+  message_payload_len = silc_buffer_headlen(payload);
+
+  if (!message_payload || !message_payload_len || !private_key || !hash) {
+    e->encoded(NULL, e->context);
+    silc_sfree(stack, e);
+    silc_stack_free(stack);
     return NULL;
+  }
 
   if (public_key) {
-    pk = silc_pkcs_public_key_encode(public_key, &pk_len);
-    if (!pk)
+    e->pk = pk = silc_pkcs_public_key_encode(stack, public_key, &pk_len);
+    if (!pk) {
+      e->encoded(NULL, e->context);
+      silc_sfree(stack, e);
+      silc_stack_free(stack);
       return NULL;
+    }
+    e->pk_len = pk_len;
   }
   pk_type = silc_pkcs_get_type(private_key);
 
   /* Encode the data to be signed */
-  sign = silc_message_signed_encode_data(message_payload,
-                                        message_payload_len,
-                                        pk, pk_len, pk_type);
+  e->sign = sign = silc_message_signed_encode_data(stack, message_payload,
+                                                  message_payload_len,
+                                                  pk, pk_len, pk_type);
   if (!sign) {
-    silc_free(pk);
-    return NULL;
-  }
-
-  /* Sign the buffer */
-
-  /* Compute the hash and the signature. */
-  if (!silc_pkcs_sign(private_key, sign->data, silc_buffer_len(sign),
-                     auth_data, sizeof(auth_data) - 1, &auth_len,
-                     TRUE, hash)) {
-    SILC_LOG_ERROR(("Could not compute signature"));
-    silc_buffer_clear(sign);
-    silc_buffer_free(sign);
-    silc_free(pk);
-    return NULL;
-  }
-
-  /* Encode the SILC_MESSAGE_FLAG_SIGNED Payload */
-
-  buffer = silc_buffer_alloc_size(4 + pk_len + 2 + auth_len);
-  if (!buffer) {
-    silc_buffer_clear(sign);
-    silc_buffer_free(sign);
-    memset(auth_data, 0, sizeof(auth_data));
-    silc_free(pk);
+    e->encoded(NULL, e->context);
+    silc_sfree(stack, pk);
+    silc_sfree(stack, e);
+    silc_stack_free(stack);
     return NULL;
   }
 
-  silc_buffer_format(buffer,
-                    SILC_STR_UI_SHORT(pk_len),
-                    SILC_STR_UI_SHORT(pk_type),
-                    SILC_STR_END);
-
-  if (pk_len && pk) {
-    silc_buffer_pull(buffer, 4);
-    silc_buffer_format(buffer,
-                      SILC_STR_UI_XNSTRING(pk, pk_len),
-                      SILC_STR_END);
-    silc_buffer_push(buffer, 4);
-  }
-
-  silc_buffer_pull(buffer, 4 + pk_len);
-  silc_buffer_format(buffer,
-                    SILC_STR_UI_SHORT(auth_len),
-                    SILC_STR_UI_XNSTRING(auth_data, auth_len),
-                    SILC_STR_END);
-  silc_buffer_push(buffer, 4 + pk_len);
-
-  SILC_LOG_HEXDUMP(("sig payload"), buffer->data, silc_buffer_len(buffer));
-
-  memset(auth_data, 0, sizeof(auth_data));
-  silc_buffer_clear(sign);
-  silc_buffer_free(sign);
-  silc_free(pk);
+  /* Compute signature */
+  op = silc_pkcs_sign_async(private_key, sign->data, silc_buffer_len(sign),
+                           TRUE, hash, rng,
+                           silc_message_signed_payload_encode_cb, e);
 
-  return buffer;
+  return op;
 }
 
-
 /***************************** Payload parsing ******************************/
 
 /* Decrypts the Message Payload. The `data' is the actual Message Payload. */
@@ -300,17 +382,13 @@ SilcBool silc_message_payload_decrypt(unsigned char *data,
     silc_hmac_update(hmac, receiver_id, receiver_id_len);
     silc_hmac_final(hmac, mac, &mac_len);
     if (silc_unlikely(memcmp(data + (data_len - mac_len), mac, mac_len))) {
-#if 0
-      SILC_LOG_DEBUG(("Message MAC does not match"));
-      return FALSE;
-#else
-      /* Check for old style message MAC.  Remove this check at some point. */
+      /* Check for old style (version 1.2) message MAC.  Remove this check
+        at some point. */
       silc_hmac_init(hmac);
       silc_hmac_update(hmac, data, data_len - mac_len);
       silc_hmac_final(hmac, mac, &mac_len);
       if (silc_unlikely(memcmp(data + (data_len - mac_len), mac, mac_len))) {
        SILC_LOG_DEBUG(("Message MAC does not match"));
-#endif
        return FALSE;
       }
     }
@@ -477,16 +555,13 @@ SilcBool silc_message_payload_encrypt(unsigned char *data,
                                      SilcCipher cipher,
                                      SilcHmac hmac)
 {
-#if 0
   unsigned char sid[32], rid[32];
   SilcUInt32 sid_len = 0, rid_len = 0;
-#endif /* 0 */
 
   /* Encrypt payload of the packet */
   if (silc_unlikely(!silc_cipher_encrypt(cipher, data, data, data_len, iv)))
     return FALSE;
 
-#if 0 /* For now this is disabled.  Enable at 1.1.x or 1.2 at the latest. */
   /* Encode IDs */
   silc_id_id2str(&sender_id->u.client_id, SILC_ID_CLIENT, sid, sizeof(sid),
                 &sid_len);
@@ -496,15 +571,12 @@ SilcBool silc_message_payload_encrypt(unsigned char *data,
   else if (receiver_id->type == SILC_ID_CHANNEL)
     silc_id_id2str(&receiver_id->u.channel_id, SILC_ID_CHANNEL, rid,
                   sizeof(rid), &rid_len);
-#endif /* 0 */
 
   /* Compute the MAC of the encrypted message data */
   silc_hmac_init(hmac);
   silc_hmac_update(hmac, data, true_len);
-#if 0
   silc_hmac_update(hmac, sid, sid_len);
   silc_hmac_update(hmac, rid, rid_len);
-#endif /* 0 */
   silc_hmac_final(hmac, data + true_len, NULL);
 
   return TRUE;
@@ -512,7 +584,8 @@ SilcBool silc_message_payload_encrypt(unsigned char *data,
 
 /* Encrypt message payload */
 
-static int silc_message_payload_encode_encrypt(SilcBuffer buffer,
+static int silc_message_payload_encode_encrypt(SilcStack stack,
+                                              SilcBuffer buffer,
                                               void *value, void *context)
 {
   SilcMessageEncode *e = context;
@@ -528,81 +601,108 @@ static int silc_message_payload_encode_encrypt(SilcBuffer buffer,
   if (silc_unlikely(!silc_message_payload_encrypt(buffer->head,
                                                  e->payload_len,
                                                  silc_buffer_headlen(buffer),
-                                                 e->iv, e->sid, e->rid,
+                                                 e->iv, &e->sid, &e->rid,
                                                  e->cipher, e->hmac)))
     return -1;
 
   return mac_len;
 }
 
-/* Compute message signature */
-
-static int silc_message_payload_encode_sig(SilcBuffer buffer,
-                                          void *value, void *context)
+/* Finalize message payload encoding */
+
+static void
+silc_message_payload_encode_final(SilcBuffer buffer,
+                                 SilcMessageFlags flags,
+                                 SilcCipher cipher,
+                                 SilcHmac hmac,
+                                 unsigned char *iv,
+                                 SilcUInt32 iv_len,
+                                 SilcUInt32 payload_len,
+                                 SilcID *sender_id,
+                                 SilcID *receiver_id,
+                                 SilcStack stack,
+                                 SilcBuffer signature,
+                                 SilcMessagePayloadEncoded encoded,
+                                 void *context)
 {
-  SilcMessageEncode *e = context;
-  SilcBuffer sig;
-  int len;
-
-  if (!(e->flags & SILC_MESSAGE_FLAG_SIGNED))
-    return 0;
+  SilcMessageEncode e;
 
-  sig = silc_message_signed_payload_encode(buffer->head,
-                                          silc_buffer_headlen(buffer),
-                                          e->public_key, e->private_key,
-                                          e->hash);
-  if (silc_unlikely(!sig))
-    return -1;
+  e.flags = flags;
+  e.cipher = cipher;
+  e.hmac = hmac;
+  e.sid = *sender_id;
+  e.rid = *receiver_id;
+  e.iv = iv;
+  e.payload_len = payload_len;
 
-  len = silc_buffer_format(buffer,
-                          SILC_STR_DATA(silc_buffer_data(sig),
-                                        silc_buffer_len(sig)),
-                          SILC_STR_END);
-  if (silc_unlikely(len < 0)) {
-    silc_buffer_free(sig);
-    return -1;
+  /* Encrypt */
+  if (silc_buffer_format(buffer,
+                        SILC_STR_DATA(signature ?
+                                      silc_buffer_data(signature) : NULL,
+                                      signature ?
+                                      silc_buffer_len(signature) : 0),
+                        SILC_STR_DATA(iv, iv_len),
+                        SILC_STR_FUNC(silc_message_payload_encode_encrypt,
+                                      NULL, &e),
+                        SILC_STR_END) < 0) {
+    silc_buffer_sfree(stack, buffer);
+    encoded(NULL, context);
+    return;
   }
 
-  silc_buffer_free(sig);
-  return len;
+  /* Deliver message payload */
+  silc_buffer_start(buffer);
+  encoded(buffer, context);
+
+  silc_buffer_sfree(stack, buffer);
+  silc_buffer_sfree(stack, signature);
+  silc_stack_free(stack);
 }
 
 /* Encodes Message Payload into a buffer and returns it. */
 
-SilcBuffer silc_message_payload_encode(SilcMessageFlags flags,
-                                      const unsigned char *data,
-                                      SilcUInt32 data_len,
-                                      SilcBool generate_iv,
-                                      SilcBool private_message,
-                                      SilcCipher cipher,
-                                      SilcHmac hmac,
-                                      SilcRng rng,
-                                      SilcPublicKey public_key,
-                                      SilcPrivateKey private_key,
-                                      SilcHash hash,
-                                      SilcID *sender_id,
-                                      SilcID *receiver_id,
-                                      SilcBuffer buffer)
+SilcAsyncOperation
+silc_message_payload_encode(SilcMessageFlags flags,
+                           const unsigned char *data,
+                           SilcUInt32 data_len,
+                           SilcBool generate_iv,
+                           SilcBool private_message,
+                           SilcCipher cipher,
+                           SilcHmac hmac,
+                           SilcRng rng,
+                           SilcPublicKey public_key,
+                           SilcPrivateKey private_key,
+                           SilcHash hash,
+                           SilcID *sender_id,
+                           SilcID *receiver_id,
+                           SilcStack stack,
+                           SilcMessagePayloadEncoded encoded,
+                           void *context)
 {
   SilcUInt32 pad_len = 0, mac_len = 0, iv_len = 0;
   unsigned char pad[16], iv[SILC_CIPHER_MAX_IV_SIZE];
-  SilcBuffer buf = NULL;
-  SilcMessageEncode e;
+  SilcBuffer buffer;
   int i;
 
   SILC_LOG_DEBUG(("Encoding Message Payload"));
 
-  if (silc_unlikely(!data_len))
+  if (silc_unlikely(!data_len)) {
+    encoded(NULL, context);
     return NULL;
-  if (silc_unlikely(!private_message && (!cipher || !hmac)))
+  }
+  if (silc_unlikely(!private_message && (!cipher || !hmac))) {
+    encoded(NULL, context);
     return NULL;
+  }
 
-  if (!buffer) {
-    buf = buffer = silc_buffer_alloc(0);
-    if (silc_unlikely(!buf))
-      return NULL;
+  stack = silc_stack_alloc(0, stack ? stack : silc_crypto_stack());
+
+  buffer = silc_buffer_salloc(stack, 0);
+  if (silc_unlikely(!buffer)) {
+    encoded(NULL, context);
+    silc_stack_free(stack);
+    return NULL;
   }
-  silc_buffer_reset(buffer);
 
   /* For channel messages IV is always generated */
   if (!private_message && !generate_iv)
@@ -636,35 +736,58 @@ SilcBuffer silc_message_payload_encode(SilcMessageFlags flags,
     }
   }
 
-  e.flags = flags;
-  e.public_key = public_key;
-  e.private_key = private_key;
-  e.hash = hash;
-  e.cipher = cipher;
-  e.hmac = hmac;
-  e.sid = sender_id;
-  e.rid = receiver_id;
-  e.iv = iv_len ? iv : NULL;
-  e.payload_len = 6 + data_len + pad_len;
-
   /* Encode the Message Payload */
   if (silc_buffer_format(buffer,
+                        SILC_STR_ADVANCE,
                         SILC_STR_UI_SHORT(flags),
                         SILC_STR_UI_SHORT(data_len),
                         SILC_STR_DATA(data, data_len),
                         SILC_STR_UI_SHORT(pad_len),
                         SILC_STR_DATA(pad, pad_len),
-                        SILC_STR_FUNC(silc_message_payload_encode_sig,
-                                      NULL, &e),
-                        SILC_STR_DATA(iv, iv_len),
-                        SILC_STR_FUNC(silc_message_payload_encode_encrypt,
-                                      NULL, &e),
                         SILC_STR_END) < 0) {
-    silc_buffer_free(buf);
+    silc_buffer_sfree(stack, buffer);
+    encoded(NULL, context);
+    silc_stack_free(stack);
     return NULL;
   }
 
-  return buffer;
+  if (flags & SILC_MESSAGE_FLAG_SIGNED) {
+    SilcMessageEncode *e = silc_scalloc(stack, 1, sizeof(*e));
+    if (!e) {
+      silc_buffer_sfree(stack, buffer);
+      encoded(NULL, context);
+      silc_stack_free(stack);
+      return NULL;
+    }
+
+    e->stack = stack;
+    e->buffer = buffer;
+    e->flags = flags;
+    e->public_key = public_key;
+    e->private_key = private_key;
+    e->rng = rng;
+    e->hash = hash;
+    e->cipher = cipher;
+    e->hmac = hmac;
+    e->sid = *sender_id;
+    e->rid = *receiver_id;
+    e->iv = iv_len ? iv : NULL;
+    e->iv_len = iv_len;
+    e->payload_len = 6 + data_len + pad_len;
+    e->encoded = encoded;
+    e->context = context;
+
+    /* Compute signature */
+    return silc_message_signed_payload_encode(buffer, e);
+  }
+
+  /* Finalize */
+  silc_message_payload_encode_final(buffer, flags, cipher, hmac,
+                                   iv_len ? iv : NULL, iv_len,
+                                   6 + data_len + pad_len,
+                                   sender_id, receiver_id, stack, NULL,
+                                   encoded, context);
+  return NULL;
 }
 
 /* Free's Message Payload */
@@ -709,53 +832,60 @@ unsigned char *silc_message_get_mac(SilcMessagePayload payload)
 
 /* Verify the signature in SILC_MESSAGE_FLAG_SIGNED Payload */
 
-SilcAuthResult silc_message_signed_verify(SilcMessagePayload message,
-                                         SilcPublicKey remote_public_key,
-                                         SilcHash hash)
+SilcAsyncOperation
+silc_message_signed_verify(SilcMessagePayload message,
+                          SilcPublicKey remote_public_key,
+                          SilcHash hash,
+                          SilcAuthResultCb result,
+                          void *context)
 {
-  int ret = SILC_AUTH_FAILED;
+  SilcAsyncOperation op;
   SilcBuffer sign, tmp;
+  SilcStack stack = NULL;
   SilcMessageSignedPayload sig = &message->sig;
 
   if (!(message->flags & SILC_MESSAGE_FLAG_SIGNED) ||
-      !sig->sign_len || !remote_public_key || !hash)
-    return ret;
+      !sig->sign_len || !remote_public_key || !hash) {
+    result(FALSE, context);
+    return NULL;
+  }
+
+  if (silc_crypto_stack())
+    stack = silc_stack_alloc(0, silc_crypto_stack());
 
   /* Generate the signature verification data, the Message Payload */
-  tmp = silc_buffer_alloc_size(6 + message->data_len + message->pad_len);
-  silc_buffer_format(tmp,
-                    SILC_STR_UI_SHORT(message->flags),
-                    SILC_STR_UI_SHORT(message->data_len),
-                    SILC_STR_UI_XNSTRING(message->data, message->data_len),
-                    SILC_STR_UI_SHORT(message->pad_len),
-                    SILC_STR_UI_XNSTRING(message->pad, message->pad_len),
-                    SILC_STR_END);
-  sign = silc_message_signed_encode_data(tmp->data, silc_buffer_len(tmp),
+  tmp = silc_buffer_salloc_size(stack,
+                               6 + message->data_len + message->pad_len);
+  silc_buffer_sformat(stack, tmp,
+                     SILC_STR_UI_SHORT(message->flags),
+                     SILC_STR_UI_SHORT(message->data_len),
+                     SILC_STR_DATA(message->data, message->data_len),
+                     SILC_STR_UI_SHORT(message->pad_len),
+                     SILC_STR_DATA(message->pad, message->pad_len),
+                     SILC_STR_END);
+  sign = silc_message_signed_encode_data(stack, tmp->data, silc_buffer_len(tmp),
                                         sig->pk_data, sig->pk_len,
                                         sig->pk_type);
   silc_buffer_clear(tmp);
-  silc_buffer_free(tmp);
-
-  if (!sign)
-    return ret;
+  silc_buffer_sfree(stack, tmp);
 
-  /* Verify the authentication data */
-  if (!silc_pkcs_verify(remote_public_key, sig->sign_data, sig->sign_len,
-                       silc_buffer_data(sign), silc_buffer_len(sign), hash)) {
-    silc_buffer_clear(sign);
-    silc_buffer_free(sign);
-    SILC_LOG_DEBUG(("Signature verification failed"));
-    return ret;
+  if (!sign) {
+    result(FALSE, context);
+    silc_stack_free(stack);
+    return NULL;
   }
 
-  ret = SILC_AUTH_OK;
+  /* Verify the authentication data */
+  op = silc_pkcs_verify_async(remote_public_key, sig->sign_data,
+                             sig->sign_len,
+                             silc_buffer_data(sign), silc_buffer_len(sign),
+                             TRUE, hash, result, context);
 
   silc_buffer_clear(sign);
-  silc_buffer_free(sign);
-
-  SILC_LOG_DEBUG(("Signature verification successful"));
+  silc_buffer_sfree(stack, sign);
+  silc_stack_free(stack);
 
-  return ret;
+  return op;
 }
 
 /* Return the public key from the payload */
index 99e9d988d94aedfcffbc6790938e396df602a298..ef6ed3a8af6778147fe470cef49fd99c15c74ce0 100644 (file)
@@ -231,34 +231,54 @@ SilcBool silc_message_payload_encrypt(unsigned char *data,
                                      SilcCipher cipher,
                                      SilcHmac hmac);
 
+/****f* silccore/SilcMessageAPI/SilcMessagePayloadEncoded
+ *
+ * SYNOPSIS
+ *
+ *    typedef void (*SilcMessagePayloadEncoded)(const SilcBuffer message,
+ *                                              void *context);
+ *
+ * DESCRIPTION
+ *
+ *    This callback is given as arugment to silc_message_payload_encode
+ *    and will be called when the message payload has been encoded.  If
+ *    `message' is NULL, encoding failed.
+ *
+ ***/
+typedef void (*SilcMessagePayloadEncoded)(SilcBuffer message,
+                                         void *context);
+
 /****f* silccore/SilcMessageAPI/silc_message_payload_encode
  *
  * SYNOPSIS
  *
- *    SilcBuffer silc_message_payload_encode(SilcMessageFlags flags,
- *                                           const unsigned char *data,
- *                                           SilcUInt32 data_len,
- *                                           SilcBool generate_iv,
- *                                           SilcBool private_message,
- *                                           SilcCipher cipher,
- *                                           SilcHmac hmac,
- *                                           SilcRng rng,
- *                                           SilcPublicKey public_key,
- *                                           SilcPrivateKey private_key,
- *                                           SilcHash hash,
- *                                           SilcID *sender_id,
- *                                           SilcID *receiver_id,
- *                                           SilcBuffer buffer);
+ *    SilcAsyncOperation
+ *    silc_message_payload_encode(SilcMessageFlags flags,
+ *                                const unsigned char *data,
+ *                                SilcUInt32 data_len,
+ *                                SilcBool generate_iv,
+ *                                SilcBool private_message,
+ *                                SilcCipher cipher,
+ *                                SilcHmac hmac,
+ *                                SilcRng rng,
+ *                                SilcPublicKey public_key,
+ *                                SilcPrivateKey private_key,
+ *                                SilcHash hash,
+ *                                SilcID *sender_id,
+ *                                SilcID *receiver_id,
+ *                                SilcStack stack,
+ *                                SilcMessagePayloadEncoded encoded,
+ *                                void *context);
  *
  * DESCRIPTION
  *
- *    Encodes a Message Payload into a buffer and returns it.  This is
- *    used to encode channel messages and private messages into a packet.
- *    If `private_message' is FALSE then this encodes channel message, if
- *    it is TRUE this encodes private message.  If `private_message' is
- *    TRUE then `generate_iv' MUST be FALSE if the private message key
- *    `cipher' is not static key (pre-shared key).  If it is static key
- *    then protocol dictates that IV must be present in the Message Payload
+ *    Encodes a Message Payload into a buffer and returns it to the `encoded'
+ *    callback.  This is used to encode channel messages and private messages
+ *    into a packet.  If `private_message' is FALSE then this encodes channel
+ *    message, if it is TRUE this encodes private message.  If
+ *    `private_message' is TRUE then `generate_iv' MUST be FALSE if the private
+ *    message key `cipher' is not static key (pre-shared key).  If it is static
+ *    key then protocol dictates that IV must be present in the Message Payload
  *    and `generate_iv' must be TRUE.  The caller must know whether the key
  *    is static or not for private messages.  If the key was generated with
  *    Key Agreement protocol then `generate_iv' is always FALSE.  For
@@ -281,26 +301,28 @@ SilcBool silc_message_payload_encrypt(unsigned char *data,
  *    The `sender_id' is the ID message sender and `receiver_id' is ID of
  *    message receiver.
  *
- *    If the `buffer' is non-NULL then the payload will be encoded into
- *    that buffer.  The same buffer is returned.  Otherwise new buffer is
- *    allocated and returned.  The `buffer' will be automatically enlarged
- *    if the payload does not fit to it.
+ *    If `stack' is non-NULL the message payload is allocated from stack.
+ *    The memory will be returned back to `stack' after the `encoded' has
+ *    been called.
  *
  ***/
-SilcBuffer silc_message_payload_encode(SilcMessageFlags flags,
-                                      const unsigned char *data,
-                                      SilcUInt32 data_len,
-                                      SilcBool generate_iv,
-                                      SilcBool private_message,
-                                      SilcCipher cipher,
-                                      SilcHmac hmac,
-                                      SilcRng rng,
-                                      SilcPublicKey public_key,
-                                      SilcPrivateKey private_key,
-                                      SilcHash hash,
-                                      SilcID *sender_id,
-                                      SilcID *receiver_id,
-                                      SilcBuffer buffer);
+SilcAsyncOperation
+silc_message_payload_encode(SilcMessageFlags flags,
+                           const unsigned char *data,
+                           SilcUInt32 data_len,
+                           SilcBool generate_iv,
+                           SilcBool private_message,
+                           SilcCipher cipher,
+                           SilcHmac hmac,
+                           SilcRng rng,
+                           SilcPublicKey public_key,
+                           SilcPrivateKey private_key,
+                           SilcHash hash,
+                           SilcID *sender_id,
+                           SilcID *receiver_id,
+                           SilcStack stack,
+                           SilcMessagePayloadEncoded encoded,
+                           void *context);
 
 /****f* silccore/SilcMessageAPI/silc_message_payload_free
  *
@@ -364,22 +386,27 @@ unsigned char *silc_message_get_mac(SilcMessagePayload payload);
  *
  * SYNOPSIS
  *
- *    SilcAuthResult
+ *    SilcAsyncOperation
  *    silc_message_signed_verify(SilcMessagePayload message,
  *                               SilcPublicKey remote_public_key,
- *                               SilcHash hash);
+ *                               SilcHash hash,
+ *                               SilcAuthResultCb result,
+ *                               void *context);
+ *
  *
  * DESCRIPTION
  *
  *    This routine can be used to verify the digital signature from the
  *    message indicated by `message'.  The signature is present only if
- *    the SILC_MESSAGE_FLAG_SIGNED is set in the message flags.  This
- *    returns SILC_AUTH_OK if the signature verification was successful.
+ *    the SILC_MESSAGE_FLAG_SIGNED is set in the message flags.  The
+ *    result of the verification is returned to `result' callback.
  *
  ***/
-SilcAuthResult silc_message_signed_verify(SilcMessagePayload message,
-                                         SilcPublicKey remote_public_key,
-                                         SilcHash hash);
+SilcAsyncOperation silc_message_signed_verify(SilcMessagePayload message,
+                                             SilcPublicKey remote_public_key,
+                                             SilcHash hash,
+                                             SilcAuthResultCb result,
+                                             void *context);
 
 /****f* silccore/SilcMessageAPI/silc_message_signed_get_public_key
  *
index f552ca6d1741aebf31648e1c694d34c302792ac3..26f721f56f0d34448725a4c7a1e43673702e1429 100644 (file)
@@ -559,7 +559,8 @@ silc_packet_engine_start(SilcRng rng, SilcBool router,
   if (!engine)
     return NULL;
 
-  engine->contexts = silc_hash_table_alloc(0, silc_hash_ptr, NULL, NULL, NULL,
+  engine->contexts = silc_hash_table_alloc(NULL, 0, silc_hash_ptr,
+                                          NULL, NULL, NULL,
                                           silc_packet_engine_context_destr,
                                           engine, TRUE);
   if (!engine->contexts) {
@@ -768,10 +769,10 @@ SilcPacketStream silc_packet_stream_create(SilcPacketEngine engine,
 
   /* If this is UDP stream, allocate UDP remote stream hash table */
   if (!engine->udp_remote && silc_socket_stream_is_udp(stream, NULL))
-    engine->udp_remote = silc_hash_table_alloc(0, silc_hash_string, NULL,
-                                              silc_hash_string_compare, NULL,
-                                              silc_packet_engine_hash_destr,
-                                              NULL, TRUE);
+    engine->udp_remote =
+      silc_hash_table_alloc(NULL, 0, silc_hash_string_case, NULL,
+                           silc_hash_string_case_compare, NULL,
+                           silc_packet_engine_hash_destr, NULL, TRUE);
 
   silc_mutex_unlock(engine->lock);
 
@@ -1494,7 +1495,7 @@ static inline void silc_packet_send_ctr_increment(SilcPacketStream stream,
 
     SILC_LOG_HEXDUMP(("IV"), ret_iv, 8);
 
-    /* Set new nonce to counter block */
+    /* Set new IV to counter block */
     memcpy(iv + 4, ret_iv, 8);
   } else {
     /* Increment 64-bit packet counter */
@@ -1509,7 +1510,7 @@ static inline void silc_packet_send_ctr_increment(SilcPacketStream stream,
   SILC_LOG_HEXDUMP(("Counter Block"), iv, 16);
 }
 
-/* Internal routine to assemble outgoing packet.  Assembles and encryptes
+/* Internal routine to assemble outgoing packet.  Assembles and encrypts
    the packet.  The silc_packet_stream_write needs to be called to send it
    after this returns TRUE. */
 
@@ -1618,6 +1619,12 @@ static inline SilcBool silc_packet_send_raw(SilcPacketStream stream,
 
   silc_mutex_lock(stream->lock);
 
+  if (silc_unlikely(stream->destroyed)) {
+    SILC_LOG_DEBUG(("Stream %p is destroyed, cannot send packet", stream));
+    silc_mutex_unlock(stream->lock);
+    return FALSE;
+  }
+
   /* Get packet pointer from the outgoing buffer */
   if (silc_unlikely(!silc_packet_send_prepare(stream, truelen + padlen + ivlen
                                              + psnlen, hmac, &packet))) {
index f0e20e2e558dff358caeb83cf7b4c1052b95e149..8a880e7001c58e5ba725f920b69b4d899bc4c8e2 100644 (file)
@@ -4,7 +4,7 @@
 
   Author: Pekka Riikonen <priikone@silcnet.org>
 
-  Copyright (C) 2005 Pekka Riikonen
+  Copyright (C) 2005 - 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
@@ -21,7 +21,8 @@
 
 /* Encodes Public Key Payload for transmitting public keys and certificates. */
 
-SilcBuffer silc_public_key_payload_encode(SilcPublicKey public_key)
+SilcBuffer silc_public_key_payload_encode(SilcStack stack,
+                                         SilcPublicKey public_key)
 {
   SilcBuffer buffer;
   unsigned char *pk;
@@ -32,27 +33,27 @@ SilcBuffer silc_public_key_payload_encode(SilcPublicKey public_key)
     return NULL;
 
   type = silc_pkcs_get_type(public_key);
-  pk = silc_pkcs_public_key_encode(public_key, &pk_len);
+  pk = silc_pkcs_public_key_encode(stack, public_key, &pk_len);
   if (!pk)
     return NULL;
 
-  buffer = silc_buffer_alloc_size(4 + pk_len);
+  buffer = silc_buffer_salloc_size(stack, 4 + pk_len);
   if (!buffer) {
-    silc_free(pk);
+    silc_sfree(stack, pk);
     return NULL;
   }
 
-  if (silc_buffer_format(buffer,
-                        SILC_STR_UI_SHORT(pk_len),
-                        SILC_STR_UI_SHORT(type),
-                        SILC_STR_DATA(pk, pk_len),
-                        SILC_STR_END) < 0) {
-    silc_buffer_free(buffer);
-    silc_free(pk);
+  if (silc_buffer_sformat(stack, buffer,
+                         SILC_STR_UI_SHORT(pk_len),
+                         SILC_STR_UI_SHORT(type),
+                         SILC_STR_DATA(pk, pk_len),
+                         SILC_STR_END) < 0) {
+    silc_buffer_sfree(stack, buffer);
+    silc_sfree(stack, pk);
     return NULL;
   }
 
-  silc_free(pk);
+  silc_sfree(stack, pk);
   return buffer;
 }
 
index 4bf004b9c7469e97ef52bd0a8eccff11ff0bd2db..510c04726335721695d7830be62cc989b4b56c22 100644 (file)
@@ -4,7 +4,7 @@
 
   Author: Pekka Riikonen <priikone@silcnet.org>
 
-  Copyright (C) 2005 Pekka Riikonen
+  Copyright (C) 2005 - 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
@@ -34,7 +34,8 @@
  *
  * SYNOPSIS
  *
- *    SilcBool silc_public_key_payload_encode(SilcPublicKey public_key);
+ *    SilcBuffer silc_public_key_payload_encode(SilcStack stack,
+ *                                              SilcPublicKey public_key);
  *
  * DESCRIPTION
  *
  *    `public_key'.  Returns the allocated and encoded payload buffer,
  *    or NULL on error.
  *
+ *    If `stack' is non-NULL the returned buffer is allocated from `stack'.
+ *    This call will consume the `stack' so caller should push the stack
+ *    before calling and then later pop it.
+ *
  ***/
-SilcBuffer silc_public_key_payload_encode(SilcPublicKey public_key);
+SilcBuffer silc_public_key_payload_encode(SilcStack stack,
+                                         SilcPublicKey public_key);
 
 /****f* silccore/SilcPubKeyAPI/silc_public_key_payload_decode
  *
diff --git a/lib/silccrypt/.cvsignore b/lib/silccrypt/.cvsignore
deleted file mode 100644 (file)
index 282522d..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-Makefile
-Makefile.in
diff --git a/lib/silccrypt/DIRECTORY b/lib/silccrypt/DIRECTORY
deleted file mode 100644 (file)
index 4a777cd..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-<!--
-@LIBRARY=SILC Crypto Library
-@FILENAME=silccryptlib.html
-@LINK=silcrng_intro.html:Introduction to SILC RNG
-@LINK=silcrng.html:SILC RNG Interface
-@LINK=silccipher.html:SILC Cipher API
-@LINK=silcpkcs.html:SILC PKCS API
-@LINK=silcpk.html:SILC Public Key API
-@LINK=silcpkcs1.html:SILC PKCS #1 API
-@LINK=silchash.html:SILC Hash Interface
-@LINK=silchmac.html:SILC HMAC Interface
--->
-
-<big><b>SILC Crypto Library</b></big>
-<br />
-<small>Directory: lib/silccrypt/</small>
-<br />
-<small>Library: libsilc.a, libsilc.lib</small>
-<br /><br />
-<b>Introduction</b>
-
-<br /><br />
-SILC Crypto Library provides cryptographic routines for applications.  It
-provides interfaces for ciphers, hash functions, HMACs and public key
-cryptosystems.  In addition is also provides interfaces for cryptographically
-strong random number generator.
-
-<br /><br />
-@LINKS@
diff --git a/lib/silccrypt/Makefile.ad b/lib/silccrypt/Makefile.ad
deleted file mode 100644 (file)
index 1903166..0000000
+++ /dev/null
@@ -1,86 +0,0 @@
-#
-#  Makefile.ad
-#
-#  Author: Pekka Riikonen <priikone@silcnet.org>
-#
-#  Copyright (C) 2000 - 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.
-#
-
-AUTOMAKE_OPTIONS = 1.0 no-dependencies foreign
-
-noinst_LTLIBRARIES = libsilccrypt.la
-
-if SILC_AES_ASM
-if SILC_I486
-SILC_AES_S = aes_x86.asm aes.c
-endif
-if SILC_X86_64
-SILC_AES_S = aes_x86_64.asm aes.c
-endif
-else
-SILC_AES_S = aes.c
-endif
-
-libsilccrypt_la_SOURCES =      \
-       none.c                  \
-       md5.c                   \
-       $(SILC_AES_S)           \
-       rsa.c                   \
-       sha1.c                  \
-       sha256.c                \
-       twofish.c               \
-       blowfish.c              \
-       silccipher.c            \
-       silchash.c              \
-       silchmac.c              \
-       silcrng.c               \
-       silcpkcs.c              \
-       silcpkcs1.c             \
-       silcpk.c
-
-if SILC_LIBTOOLFIX
-# Tell libtool to compile silccrypt as shared since silcsim will need it.
-LTFLAGS = --libtool-enable-shared
-else
-LTFLAGS =
-endif
-
-CFLAGS = $(LTFLAGS) @SILC_CRYPTO_CFLAGS@
-
-#ifdef SILC_DIST_TOOLKIT
-include_HEADERS =              \
-       silccipher.h            \
-       silchash.h              \
-       silchmac.h              \
-       silcpkcs.h              \
-       silcrng.h               \
-       silcpkcs1.h             \
-       silcpk.h
-
-SILC_EXTRA_DIST = tests
-#endif SILC_DIST_TOOLKIT
-
-SUFFIXES = .asm
-
-.asm.lo:
-       $(LIBTOOL) --tag=CC --mode=compile @SILC_ASSEMBLER@ $<
-
-EXTRA_DIST = *.h *.asm $(SILC_EXTRA_DIST)
-
-include $(top_srcdir)/Makefile.defines.in
-
-# Workaround a bug in GCC 2.x which causes memory exhaustion
-# when compiling sha1 with optimizations on UltraSPARC.
-#
-@FIX_SHA1@sha1.lo:
-@FIX_SHA1@     $(LTCOMPILE) -O0 -c -o $@ `test -f 'sha1.c' || echo '$(srcdir)/'`sha1.c
-@FIX_SHA1@
diff --git a/lib/silccrypt/aes.c b/lib/silccrypt/aes.c
deleted file mode 100644 (file)
index f41a61d..0000000
+++ /dev/null
@@ -1,653 +0,0 @@
-/* Modified for SILC -Pekka */
-/* Includes key scheduling in C always, and encryption and decryption in C
-   when assembler optimized version cannot be used. */
-/*
- ---------------------------------------------------------------------------
- Copyright (c) 1998-2006, Brian Gladman, Worcester, UK. All rights reserved.
-
- LICENSE TERMS
-
- The free distribution and use of this software in both source and binary
- form is allowed (with or without changes) provided that:
-
-   1. distributions of this source code include the above copyright
-      notice, this list of conditions and the following disclaimer;
-
-   2. distributions in binary form include the above copyright
-      notice, this list of conditions and the following disclaimer
-      in the documentation and/or other associated materials;
-
-   3. the copyright holder's name is not used to endorse products
-      built using this software without specific written permission.
-
- ALTERNATIVELY, provided that this notice is retained in full, this product
- may be distributed under the terms of the GNU General Public License (GPL),
- in which case the provisions of the GPL apply INSTEAD OF those given above.
-
- DISCLAIMER
-
- This software is provided 'as is' with no explicit or implied warranties
- in respect of its properties, including, but not limited to, correctness
- and/or fitness for purpose.
- ---------------------------------------------------------------------------
- Issue 09/09/2006
-*/
-
-#include "silc.h"
-#include "rijndael_internal.h"
-#include "aes.h"
-
-/*
- * SILC Crypto API for AES
- */
-
-/* CBC mode */
-
-/* Sets the key for the cipher. */
-
-SILC_CIPHER_API_SET_KEY(aes_cbc)
-{
-  if (encryption)
-    aes_encrypt_key(key, keylen, &((AesContext *)context)->u.enc);
-  else
-    aes_decrypt_key(key, keylen, &((AesContext *)context)->u.dec);
-  return TRUE;
-}
-
-/* Sets IV for the cipher. */
-
-SILC_CIPHER_API_SET_IV(aes_cbc)
-{
-
-}
-
-/* Returns the size of the cipher context. */
-
-SILC_CIPHER_API_CONTEXT_LEN(aes_cbc)
-{
-  return sizeof(AesContext);
-}
-
-/* Encrypts with the cipher in CBC mode. Source and destination buffers
-   maybe one and same. */
-
-SILC_CIPHER_API_ENCRYPT(aes_cbc)
-{
-  int nb = len >> 4;
-  SilcUInt32 tmp[4], tmp2[4];
-
-  SILC_ASSERT((len & (16 - 1)) == 0);
-  if (len & (16 - 1))
-    return FALSE;
-
-  while(nb--) {
-    SILC_GET32_MSB(tmp[0], &iv[0]);
-    SILC_GET32_MSB(tmp[1], &iv[4]);
-    SILC_GET32_MSB(tmp[2], &iv[8]);
-    SILC_GET32_MSB(tmp[3], &iv[12]);
-
-    SILC_GET32_MSB(tmp2[0], &src[0]);
-    SILC_GET32_MSB(tmp2[1], &src[4]);
-    SILC_GET32_MSB(tmp2[2], &src[8]);
-    SILC_GET32_MSB(tmp2[3], &src[12]);
-
-    tmp[0] = tmp[0] ^ tmp2[0];
-    tmp[1] = tmp[1] ^ tmp2[1];
-    tmp[2] = tmp[2] ^ tmp2[2];
-    tmp[3] = tmp[3] ^ tmp2[3];
-
-    SILC_PUT32_MSB(tmp[0], &iv[0]);
-    SILC_PUT32_MSB(tmp[1], &iv[4]);
-    SILC_PUT32_MSB(tmp[2], &iv[8]);
-    SILC_PUT32_MSB(tmp[3], &iv[12]);
-
-    aes_encrypt(iv, iv, &((AesContext *)context)->u.enc);
-
-    memcpy(dst, iv, 16);
-    src += 16;
-    dst += 16;
-  }
-
-  return TRUE;
-}
-
-/* Decrypts with the cipher in CBC mode. Source and destination buffers
-   maybe one and same. */
-
-SILC_CIPHER_API_DECRYPT(aes_cbc)
-{
-  unsigned char tmp[16];
-  int nb = len >> 4;
-  SilcUInt32 tmp2[4], tmp3[4];
-
-  if (len & (16 - 1))
-    return FALSE;
-
-  while(nb--) {
-    memcpy(tmp, src, 16);
-    aes_decrypt(src, dst, &((AesContext *)context)->u.dec);
-
-    SILC_GET32_MSB(tmp2[0], &iv[0]);
-    SILC_GET32_MSB(tmp2[1], &iv[4]);
-    SILC_GET32_MSB(tmp2[2], &iv[8]);
-    SILC_GET32_MSB(tmp2[3], &iv[12]);
-
-    SILC_GET32_MSB(tmp3[0], &dst[0]);
-    SILC_GET32_MSB(tmp3[1], &dst[4]);
-    SILC_GET32_MSB(tmp3[2], &dst[8]);
-    SILC_GET32_MSB(tmp3[3], &dst[12]);
-
-    tmp2[0] = tmp3[0] ^ tmp2[0];
-    tmp2[1] = tmp3[1] ^ tmp2[1];
-    tmp2[2] = tmp3[2] ^ tmp2[2];
-    tmp2[3] = tmp3[3] ^ tmp2[3];
-
-    SILC_PUT32_MSB(tmp2[0], &dst[0]);
-    SILC_PUT32_MSB(tmp2[1], &dst[4]);
-    SILC_PUT32_MSB(tmp2[2], &dst[8]);
-    SILC_PUT32_MSB(tmp2[3], &dst[12]);
-
-    memcpy(iv, tmp, 16);
-    src += 16;
-    dst += 16;
-  }
-
-  return TRUE;
-}
-
-/* CTR mode */
-
-/* Sets the key for the cipher. */
-
-SILC_CIPHER_API_SET_KEY(aes_ctr)
-{
-  AesContext *aes = context;
-  memset(&aes->u.enc, 0, sizeof(aes->u.enc));
-  aes_encrypt_key(key, keylen, &aes->u.enc);
-  return TRUE;
-}
-
-/* Sets IV for the cipher. */
-
-SILC_CIPHER_API_SET_IV(aes_ctr)
-{
-  AesContext *aes = context;
-
-  /* Starts new block. */
-  aes->u.enc.inf.b[2] = 0;
-}
-
-/* Returns the size of the cipher context. */
-
-SILC_CIPHER_API_CONTEXT_LEN(aes_ctr)
-{
-  return sizeof(AesContext);
-}
-
-/* Encrypts with the cipher in CTR mode. Source and destination buffers
-   may be one and same.  Assumes MSB first ordered counter. */
-
-SILC_CIPHER_API_ENCRYPT(aes_ctr)
-{
-  AesContext *aes = context;
-  int i, k;
-
-  i = aes->u.enc.inf.b[2];
-  if (!i)
-    i = 16;
-
-  while (len-- > 0) {
-    if (i == 16) {
-      for (k = 15; k >= 0; k--)
-       if (++iv[k])
-         break;
-
-      aes_encrypt(iv, aes->u.enc.pad, &aes->u.enc);
-      i = 0;
-    }
-    *dst++ = *src++ ^ aes->u.enc.pad[i++];
-  }
-  aes->u.enc.inf.b[2] = i;
-
-  return TRUE;
-}
-
-/* Decrypts with the cipher in CTR mode. Source and destination buffers
-   maybe one and same. */
-
-SILC_CIPHER_API_DECRYPT(aes_ctr)
-{
-  return silc_aes_ctr_encrypt(context, src, dst, len, iv);
-}
-
-/****************************************************************************/
-
-#if defined(__cplusplus)
-extern "C"
-{
-#endif
-
-#if defined( __WATCOMC__ ) && ( __WATCOMC__ >= 1100 )
-#  define XP_DIR __cdecl
-#else
-#  define XP_DIR
-#endif
-
-#define d_1(t,n,b,e)       ALIGN const XP_DIR t n[256]    =   b(e)
-#define d_4(t,n,b,e,f,g,h) ALIGN const XP_DIR t n[4][256] = { b(e), b(f), b(g), b(h) }
-ALIGN const uint_32t t_dec(r,c)[RC_LENGTH] = rc_data(w0);
-
-#ifdef SILC_AES_ASM
-d_1(uint_8t, t_dec(i,box), isb_data, h0);
-#endif /* SILC_AES_ASM */
-d_4(uint_32t, t_dec(f,n), sb_data, u0, u1, u2, u3);
-d_4(uint_32t, t_dec(f,l), sb_data, w0, w1, w2, w3);
-d_4(uint_32t, t_dec(i,n), isb_data, v0, v1, v2, v3);
-d_4(uint_32t, t_dec(i,l), isb_data, w0, w1, w2, w3);
-d_4(uint_32t, t_dec(i,m), mm_data, v0, v1, v2, v3);
-
-#define ke4(k,i) \
-{   k[4*(i)+4] = ss[0] ^= ls_box(ss[3],3) ^ t_use(r,c)[i]; \
-    k[4*(i)+5] = ss[1] ^= ss[0]; \
-    k[4*(i)+6] = ss[2] ^= ss[1]; \
-    k[4*(i)+7] = ss[3] ^= ss[2]; \
-}
-
-AES_RETURN aes_encrypt_key128(const unsigned char *key, aes_encrypt_ctx cx[1])
-{   uint_32t    ss[4];
-
-    cx->ks[0] = ss[0] = word_in(key, 0);
-    cx->ks[1] = ss[1] = word_in(key, 1);
-    cx->ks[2] = ss[2] = word_in(key, 2);
-    cx->ks[3] = ss[3] = word_in(key, 3);
-
-    ke4(cx->ks, 0);  ke4(cx->ks, 1);
-    ke4(cx->ks, 2);  ke4(cx->ks, 3);
-    ke4(cx->ks, 4);  ke4(cx->ks, 5);
-    ke4(cx->ks, 6);  ke4(cx->ks, 7);
-    ke4(cx->ks, 8);
-    ke4(cx->ks, 9);
-    cx->inf.l = 0;
-    cx->inf.b[0] = 10 * 16;
-}
-
-#define kef6(k,i) \
-{   k[6*(i)+ 6] = ss[0] ^= ls_box(ss[5],3) ^ t_use(r,c)[i]; \
-    k[6*(i)+ 7] = ss[1] ^= ss[0]; \
-    k[6*(i)+ 8] = ss[2] ^= ss[1]; \
-    k[6*(i)+ 9] = ss[3] ^= ss[2]; \
-}
-
-#define ke6(k,i) \
-{   kef6(k,i); \
-    k[6*(i)+10] = ss[4] ^= ss[3]; \
-    k[6*(i)+11] = ss[5] ^= ss[4]; \
-}
-
-AES_RETURN aes_encrypt_key192(const unsigned char *key, aes_encrypt_ctx cx[1])
-{   uint_32t    ss[6];
-
-    cx->ks[0] = ss[0] = word_in(key, 0);
-    cx->ks[1] = ss[1] = word_in(key, 1);
-    cx->ks[2] = ss[2] = word_in(key, 2);
-    cx->ks[3] = ss[3] = word_in(key, 3);
-    cx->ks[4] = ss[4] = word_in(key, 4);
-    cx->ks[5] = ss[5] = word_in(key, 5);
-
-    ke6(cx->ks, 0);  ke6(cx->ks, 1);
-    ke6(cx->ks, 2);  ke6(cx->ks, 3);
-    ke6(cx->ks, 4);  ke6(cx->ks, 5);
-    ke6(cx->ks, 6);
-    kef6(cx->ks, 7);
-    cx->inf.l = 0;
-    cx->inf.b[0] = 12 * 16;
-}
-
-#define kef8(k,i) \
-{   k[8*(i)+ 8] = ss[0] ^= ls_box(ss[7],3) ^ t_use(r,c)[i]; \
-    k[8*(i)+ 9] = ss[1] ^= ss[0]; \
-    k[8*(i)+10] = ss[2] ^= ss[1]; \
-    k[8*(i)+11] = ss[3] ^= ss[2]; \
-}
-
-#define ke8(k,i) \
-{   kef8(k,i); \
-    k[8*(i)+12] = ss[4] ^= ls_box(ss[3],0); \
-    k[8*(i)+13] = ss[5] ^= ss[4]; \
-    k[8*(i)+14] = ss[6] ^= ss[5]; \
-    k[8*(i)+15] = ss[7] ^= ss[6]; \
-}
-
-AES_RETURN aes_encrypt_key256(const unsigned char *key, aes_encrypt_ctx cx[1])
-{   uint_32t    ss[8];
-
-    cx->ks[0] = ss[0] = word_in(key, 0);
-    cx->ks[1] = ss[1] = word_in(key, 1);
-    cx->ks[2] = ss[2] = word_in(key, 2);
-    cx->ks[3] = ss[3] = word_in(key, 3);
-    cx->ks[4] = ss[4] = word_in(key, 4);
-    cx->ks[5] = ss[5] = word_in(key, 5);
-    cx->ks[6] = ss[6] = word_in(key, 6);
-    cx->ks[7] = ss[7] = word_in(key, 7);
-
-    ke8(cx->ks, 0); ke8(cx->ks, 1);
-    ke8(cx->ks, 2); ke8(cx->ks, 3);
-    ke8(cx->ks, 4); ke8(cx->ks, 5);
-    kef8(cx->ks, 6);
-    cx->inf.l = 0;
-    cx->inf.b[0] = 14 * 16;
-}
-
-AES_RETURN aes_encrypt_key(const unsigned char *key, int key_len, aes_encrypt_ctx cx[1])
-{
-    switch(key_len)
-    {
-    case 16: case 128: aes_encrypt_key128(key, cx); return;
-    case 24: case 192: aes_encrypt_key192(key, cx); return;
-    case 32: case 256: aes_encrypt_key256(key, cx); return;
-    }
-}
-
-#define v(n,i)  ((n) - (i) + 2 * ((i) & 3))
-#define k4e(k,i) \
-{   k[v(40,(4*(i))+4)] = ss[0] ^= ls_box(ss[3],3) ^ t_use(r,c)[i]; \
-    k[v(40,(4*(i))+5)] = ss[1] ^= ss[0]; \
-    k[v(40,(4*(i))+6)] = ss[2] ^= ss[1]; \
-    k[v(40,(4*(i))+7)] = ss[3] ^= ss[2]; \
-}
-
-#define kdf4(k,i) \
-{   ss[0] = ss[0] ^ ss[2] ^ ss[1] ^ ss[3]; \
-    ss[1] = ss[1] ^ ss[3]; \
-    ss[2] = ss[2] ^ ss[3]; \
-    ss[4] = ls_box(ss[(i+3) % 4], 3) ^ t_use(r,c)[i]; \
-    ss[i % 4] ^= ss[4]; \
-    ss[4] ^= k[v(40,(4*(i)))];   k[v(40,(4*(i))+4)] = ff(ss[4]); \
-    ss[4] ^= k[v(40,(4*(i))+1)]; k[v(40,(4*(i))+5)] = ff(ss[4]); \
-    ss[4] ^= k[v(40,(4*(i))+2)]; k[v(40,(4*(i))+6)] = ff(ss[4]); \
-    ss[4] ^= k[v(40,(4*(i))+3)]; k[v(40,(4*(i))+7)] = ff(ss[4]); \
-}
-
-#define kd4(k,i) \
-{   ss[4] = ls_box(ss[(i+3) % 4], 3) ^ t_use(r,c)[i]; \
-    ss[i % 4] ^= ss[4]; ss[4] = ff(ss[4]); \
-    k[v(40,(4*(i))+4)] = ss[4] ^= k[v(40,(4*(i)))]; \
-    k[v(40,(4*(i))+5)] = ss[4] ^= k[v(40,(4*(i))+1)]; \
-    k[v(40,(4*(i))+6)] = ss[4] ^= k[v(40,(4*(i))+2)]; \
-    k[v(40,(4*(i))+7)] = ss[4] ^= k[v(40,(4*(i))+3)]; \
-}
-
-#define kdl4(k,i) \
-{   ss[4] = ls_box(ss[(i+3) % 4], 3) ^ t_use(r,c)[i]; ss[i % 4] ^= ss[4]; \
-    k[v(40,(4*(i))+4)] = (ss[0] ^= ss[1]) ^ ss[2] ^ ss[3]; \
-    k[v(40,(4*(i))+5)] = ss[1] ^ ss[3]; \
-    k[v(40,(4*(i))+6)] = ss[0]; \
-    k[v(40,(4*(i))+7)] = ss[1]; \
-}
-
-AES_RETURN aes_decrypt_key128(const unsigned char *key, aes_decrypt_ctx cx[1])
-{   uint_32t    ss[5];
-#if defined( d_vars )
-        d_vars;
-#endif
-    cx->ks[v(40,(0))] = ss[0] = word_in(key, 0);
-    cx->ks[v(40,(1))] = ss[1] = word_in(key, 1);
-    cx->ks[v(40,(2))] = ss[2] = word_in(key, 2);
-    cx->ks[v(40,(3))] = ss[3] = word_in(key, 3);
-
-    kdf4(cx->ks, 0);  kd4(cx->ks, 1);
-     kd4(cx->ks, 2);  kd4(cx->ks, 3);
-     kd4(cx->ks, 4);  kd4(cx->ks, 5);
-     kd4(cx->ks, 6);  kd4(cx->ks, 7);
-     kd4(cx->ks, 8); kdl4(cx->ks, 9);
-    cx->inf.l = 0;
-    cx->inf.b[0] = 10 * 16;
-}
-
-#define k6ef(k,i) \
-{   k[v(48,(6*(i))+ 6)] = ss[0] ^= ls_box(ss[5],3) ^ t_use(r,c)[i]; \
-    k[v(48,(6*(i))+ 7)] = ss[1] ^= ss[0]; \
-    k[v(48,(6*(i))+ 8)] = ss[2] ^= ss[1]; \
-    k[v(48,(6*(i))+ 9)] = ss[3] ^= ss[2]; \
-}
-
-#define k6e(k,i) \
-{   k6ef(k,i); \
-    k[v(48,(6*(i))+10)] = ss[4] ^= ss[3]; \
-    k[v(48,(6*(i))+11)] = ss[5] ^= ss[4]; \
-}
-
-#define kdf6(k,i) \
-{   ss[0] ^= ls_box(ss[5],3) ^ t_use(r,c)[i]; k[v(48,(6*(i))+ 6)] = ff(ss[0]); \
-    ss[1] ^= ss[0]; k[v(48,(6*(i))+ 7)] = ff(ss[1]); \
-    ss[2] ^= ss[1]; k[v(48,(6*(i))+ 8)] = ff(ss[2]); \
-    ss[3] ^= ss[2]; k[v(48,(6*(i))+ 9)] = ff(ss[3]); \
-    ss[4] ^= ss[3]; k[v(48,(6*(i))+10)] = ff(ss[4]); \
-    ss[5] ^= ss[4]; k[v(48,(6*(i))+11)] = ff(ss[5]); \
-}
-
-#define kd6(k,i) \
-{   ss[6] = ls_box(ss[5],3) ^ t_use(r,c)[i]; \
-    ss[0] ^= ss[6]; ss[6] = ff(ss[6]); k[v(48,(6*(i))+ 6)] = ss[6] ^= k[v(48,(6*(i)))]; \
-    ss[1] ^= ss[0]; k[v(48,(6*(i))+ 7)] = ss[6] ^= k[v(48,(6*(i))+ 1)]; \
-    ss[2] ^= ss[1]; k[v(48,(6*(i))+ 8)] = ss[6] ^= k[v(48,(6*(i))+ 2)]; \
-    ss[3] ^= ss[2]; k[v(48,(6*(i))+ 9)] = ss[6] ^= k[v(48,(6*(i))+ 3)]; \
-    ss[4] ^= ss[3]; k[v(48,(6*(i))+10)] = ss[6] ^= k[v(48,(6*(i))+ 4)]; \
-    ss[5] ^= ss[4]; k[v(48,(6*(i))+11)] = ss[6] ^= k[v(48,(6*(i))+ 5)]; \
-}
-
-#define kdl6(k,i) \
-{   ss[0] ^= ls_box(ss[5],3) ^ t_use(r,c)[i]; k[v(48,(6*(i))+ 6)] = ss[0]; \
-    ss[1] ^= ss[0]; k[v(48,(6*(i))+ 7)] = ss[1]; \
-    ss[2] ^= ss[1]; k[v(48,(6*(i))+ 8)] = ss[2]; \
-    ss[3] ^= ss[2]; k[v(48,(6*(i))+ 9)] = ss[3]; \
-}
-
-AES_RETURN aes_decrypt_key192(const unsigned char *key, aes_decrypt_ctx cx[1])
-{   uint_32t    ss[7];
-#if defined( d_vars )
-        d_vars;
-#endif
-    cx->ks[v(48,(0))] = ss[0] = word_in(key, 0);
-    cx->ks[v(48,(1))] = ss[1] = word_in(key, 1);
-    cx->ks[v(48,(2))] = ss[2] = word_in(key, 2);
-    cx->ks[v(48,(3))] = ss[3] = word_in(key, 3);
-
-    cx->ks[v(48,(4))] = ff(ss[4] = word_in(key, 4));
-    cx->ks[v(48,(5))] = ff(ss[5] = word_in(key, 5));
-    kdf6(cx->ks, 0); kd6(cx->ks, 1);
-    kd6(cx->ks, 2);  kd6(cx->ks, 3);
-    kd6(cx->ks, 4);  kd6(cx->ks, 5);
-    kd6(cx->ks, 6); kdl6(cx->ks, 7);
-    cx->inf.l = 0;
-    cx->inf.b[0] = 12 * 16;
-}
-
-#define k8ef(k,i) \
-{   k[v(56,(8*(i))+ 8)] = ss[0] ^= ls_box(ss[7],3) ^ t_use(r,c)[i]; \
-    k[v(56,(8*(i))+ 9)] = ss[1] ^= ss[0]; \
-    k[v(56,(8*(i))+10)] = ss[2] ^= ss[1]; \
-    k[v(56,(8*(i))+11)] = ss[3] ^= ss[2]; \
-}
-
-#define k8e(k,i) \
-{   k8ef(k,i); \
-    k[v(56,(8*(i))+12)] = ss[4] ^= ls_box(ss[3],0); \
-    k[v(56,(8*(i))+13)] = ss[5] ^= ss[4]; \
-    k[v(56,(8*(i))+14)] = ss[6] ^= ss[5]; \
-    k[v(56,(8*(i))+15)] = ss[7] ^= ss[6]; \
-}
-
-#define kdf8(k,i) \
-{   ss[0] ^= ls_box(ss[7],3) ^ t_use(r,c)[i]; k[v(56,(8*(i))+ 8)] = ff(ss[0]); \
-    ss[1] ^= ss[0]; k[v(56,(8*(i))+ 9)] = ff(ss[1]); \
-    ss[2] ^= ss[1]; k[v(56,(8*(i))+10)] = ff(ss[2]); \
-    ss[3] ^= ss[2]; k[v(56,(8*(i))+11)] = ff(ss[3]); \
-    ss[4] ^= ls_box(ss[3],0); k[v(56,(8*(i))+12)] = ff(ss[4]); \
-    ss[5] ^= ss[4]; k[v(56,(8*(i))+13)] = ff(ss[5]); \
-    ss[6] ^= ss[5]; k[v(56,(8*(i))+14)] = ff(ss[6]); \
-    ss[7] ^= ss[6]; k[v(56,(8*(i))+15)] = ff(ss[7]); \
-}
-
-#define kd8(k,i) \
-{   ss[8] = ls_box(ss[7],3) ^ t_use(r,c)[i]; \
-    ss[0] ^= ss[8]; ss[8] = ff(ss[8]); k[v(56,(8*(i))+ 8)] = ss[8] ^= k[v(56,(8*(i)))]; \
-    ss[1] ^= ss[0]; k[v(56,(8*(i))+ 9)] = ss[8] ^= k[v(56,(8*(i))+ 1)]; \
-    ss[2] ^= ss[1]; k[v(56,(8*(i))+10)] = ss[8] ^= k[v(56,(8*(i))+ 2)]; \
-    ss[3] ^= ss[2]; k[v(56,(8*(i))+11)] = ss[8] ^= k[v(56,(8*(i))+ 3)]; \
-    ss[8] = ls_box(ss[3],0); \
-    ss[4] ^= ss[8]; ss[8] = ff(ss[8]); k[v(56,(8*(i))+12)] = ss[8] ^= k[v(56,(8*(i))+ 4)]; \
-    ss[5] ^= ss[4]; k[v(56,(8*(i))+13)] = ss[8] ^= k[v(56,(8*(i))+ 5)]; \
-    ss[6] ^= ss[5]; k[v(56,(8*(i))+14)] = ss[8] ^= k[v(56,(8*(i))+ 6)]; \
-    ss[7] ^= ss[6]; k[v(56,(8*(i))+15)] = ss[8] ^= k[v(56,(8*(i))+ 7)]; \
-}
-
-#define kdl8(k,i) \
-{   ss[0] ^= ls_box(ss[7],3) ^ t_use(r,c)[i]; k[v(56,(8*(i))+ 8)] = ss[0]; \
-    ss[1] ^= ss[0]; k[v(56,(8*(i))+ 9)] = ss[1]; \
-    ss[2] ^= ss[1]; k[v(56,(8*(i))+10)] = ss[2]; \
-    ss[3] ^= ss[2]; k[v(56,(8*(i))+11)] = ss[3]; \
-}
-
-AES_RETURN aes_decrypt_key256(const unsigned char *key, aes_decrypt_ctx cx[1])
-{   uint_32t    ss[9];
-#if defined( d_vars )
-        d_vars;
-#endif
-    cx->ks[v(56,(0))] = ss[0] = word_in(key, 0);
-    cx->ks[v(56,(1))] = ss[1] = word_in(key, 1);
-    cx->ks[v(56,(2))] = ss[2] = word_in(key, 2);
-    cx->ks[v(56,(3))] = ss[3] = word_in(key, 3);
-
-    cx->ks[v(56,(4))] = ff(ss[4] = word_in(key, 4));
-    cx->ks[v(56,(5))] = ff(ss[5] = word_in(key, 5));
-    cx->ks[v(56,(6))] = ff(ss[6] = word_in(key, 6));
-    cx->ks[v(56,(7))] = ff(ss[7] = word_in(key, 7));
-    kdf8(cx->ks, 0); kd8(cx->ks, 1);
-    kd8(cx->ks, 2);  kd8(cx->ks, 3);
-    kd8(cx->ks, 4);  kd8(cx->ks, 5);
-    kdl8(cx->ks, 6);
-    cx->inf.l = 0;
-    cx->inf.b[0] = 14 * 16;
-}
-
-AES_RETURN aes_decrypt_key(const unsigned char *key, int key_len, aes_decrypt_ctx cx[1])
-{
-    switch(key_len)
-    {
-    case 16: case 128: aes_decrypt_key128(key, cx); return;
-    case 24: case 192: aes_decrypt_key192(key, cx); return;
-    case 32: case 256: aes_decrypt_key256(key, cx); return;
-    }
-}
-
-#ifndef SILC_AES_ASM
-/* C version of AES */
-
-#define si(y,x,k,c) (s(y,c) = word_in(x, c) ^ (k)[c])
-#define so(y,x,c)   word_out(y, c, s(x,c))
-#define locals(y,x)     x[4],y[4]
-#define l_copy(y, x)    s(y,0) = s(x,0); s(y,1) = s(x,1); \
-                        s(y,2) = s(x,2); s(y,3) = s(x,3);
-#define state_in(y,x,k) si(y,x,k,0); si(y,x,k,1); si(y,x,k,2); si(y,x,k,3)
-#define state_out(y,x)  so(y,x,0); so(y,x,1); so(y,x,2); so(y,x,3)
-#define round(rm,y,x,k) rm(y,x,k,0); rm(y,x,k,1); rm(y,x,k,2); rm(y,x,k,3)
-
-/* Visual C++ .Net v7.1 provides the fastest encryption code when using
-   Pentium optimiation with small code but this is poor for decryption
-   so we need to control this with the following VC++ pragmas
-*/
-
-#if defined( _MSC_VER ) && !defined( _WIN64 )
-#pragma optimize( "s", on )
-#endif
-
-#define fwd_var(x,r,c)\
- ( r == 0 ? ( c == 0 ? s(x,0) : c == 1 ? s(x,1) : c == 2 ? s(x,2) : s(x,3))\
- : r == 1 ? ( c == 0 ? s(x,1) : c == 1 ? s(x,2) : c == 2 ? s(x,3) : s(x,0))\
- : r == 2 ? ( c == 0 ? s(x,2) : c == 1 ? s(x,3) : c == 2 ? s(x,0) : s(x,1))\
- :          ( c == 0 ? s(x,3) : c == 1 ? s(x,0) : c == 2 ? s(x,1) : s(x,2)))
-#define fwd_rnd(y,x,k,c)    (s(y,c) = (k)[c] ^ four_tables(x,t_use(f,n),fwd_var,rf1,c))
-#define fwd_lrnd(y,x,k,c)   (s(y,c) = (k)[c] ^ four_tables(x,t_use(f,l),fwd_var,rf1,c))
-
-AES_RETURN aes_encrypt(const unsigned char *in, unsigned char *out, const aes_encrypt_ctx cx[1])
-{   uint_32t         locals(b0, b1);
-    const uint_32t   *kp;
-
-    kp = cx->ks;
-    state_in(b0, in, kp);
-
-    switch(cx->inf.b[0])
-    {
-    case 14 * 16:
-        round(fwd_rnd,  b1, b0, kp + 1 * N_COLS);
-        round(fwd_rnd,  b0, b1, kp + 2 * N_COLS);
-        kp += 2 * N_COLS;
-    case 12 * 16:
-        round(fwd_rnd,  b1, b0, kp + 1 * N_COLS);
-        round(fwd_rnd,  b0, b1, kp + 2 * N_COLS);
-        kp += 2 * N_COLS;
-    case 10 * 16:
-        round(fwd_rnd,  b1, b0, kp + 1 * N_COLS);
-        round(fwd_rnd,  b0, b1, kp + 2 * N_COLS);
-        round(fwd_rnd,  b1, b0, kp + 3 * N_COLS);
-        round(fwd_rnd,  b0, b1, kp + 4 * N_COLS);
-        round(fwd_rnd,  b1, b0, kp + 5 * N_COLS);
-        round(fwd_rnd,  b0, b1, kp + 6 * N_COLS);
-        round(fwd_rnd,  b1, b0, kp + 7 * N_COLS);
-        round(fwd_rnd,  b0, b1, kp + 8 * N_COLS);
-        round(fwd_rnd,  b1, b0, kp + 9 * N_COLS);
-        round(fwd_lrnd, b0, b1, kp +10 * N_COLS);
-    }
-
-    state_out(out, b0);
-}
-
-#define inv_var(x,r,c)\
- ( r == 0 ? ( c == 0 ? s(x,0) : c == 1 ? s(x,1) : c == 2 ? s(x,2) : s(x,3))\
- : r == 1 ? ( c == 0 ? s(x,3) : c == 1 ? s(x,0) : c == 2 ? s(x,1) : s(x,2))\
- : r == 2 ? ( c == 0 ? s(x,2) : c == 1 ? s(x,3) : c == 2 ? s(x,0) : s(x,1))\
- :          ( c == 0 ? s(x,1) : c == 1 ? s(x,2) : c == 2 ? s(x,3) : s(x,0)))
-
-#define inv_rnd(y,x,k,c)    (s(y,c) = (k)[c] ^ four_tables(x,t_use(i,n),inv_var,rf1,c))
-#define inv_lrnd(y,x,k,c)   (s(y,c) = (k)[c] ^ four_tables(x,t_use(i,l),inv_var,rf1,c))
-#define key_ofs     0
-#define rnd_key(n)  (kp + n * N_COLS)
-
-AES_RETURN aes_decrypt(const unsigned char *in, unsigned char *out, const aes_decrypt_ctx cx[1])
-{   uint_32t        locals(b0, b1);
-    const uint_32t *kp;
-
-    kp = cx->ks + (key_ofs ? (cx->inf.b[0] >> 2) : 0);
-    state_in(b0, in, kp);
-
-    kp = cx->ks + (key_ofs ? 0 : (cx->inf.b[0] >> 2));
-    switch(cx->inf.b[0])
-    {
-    case 14 * 16:
-        round(inv_rnd,  b1, b0, rnd_key(-13));
-        round(inv_rnd,  b0, b1, rnd_key(-12));
-    case 12 * 16:
-        round(inv_rnd,  b1, b0, rnd_key(-11));
-        round(inv_rnd,  b0, b1, rnd_key(-10));
-    case 10 * 16:
-        round(inv_rnd,  b1, b0, rnd_key(-9));
-        round(inv_rnd,  b0, b1, rnd_key(-8));
-        round(inv_rnd,  b1, b0, rnd_key(-7));
-        round(inv_rnd,  b0, b1, rnd_key(-6));
-        round(inv_rnd,  b1, b0, rnd_key(-5));
-        round(inv_rnd,  b0, b1, rnd_key(-4));
-        round(inv_rnd,  b1, b0, rnd_key(-3));
-        round(inv_rnd,  b0, b1, rnd_key(-2));
-        round(inv_rnd,  b1, b0, rnd_key(-1));
-        round(inv_lrnd, b0, b1, rnd_key( 0));
-    }
-
-    state_out(out, b0);
-}
-
-#if defined(__cplusplus)
-}
-#endif
-
-#endif /* SILC_AES_ASM */
diff --git a/lib/silccrypt/aes.h b/lib/silccrypt/aes.h
deleted file mode 100644 (file)
index 9711c3f..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
-
-  aes.h
-
-  Author: Pekka Riikonen <priikone@silcnet.org>
-
-  Copyright (C) 1997 - 2007 Pekka Riikonen
-
-  This program is free software; you can redistribute it and/or modify
-  it under the terms of the GNU General Public License as published by
-  the Free Software Foundation; version 2 of the License.
-
-  This program is distributed in the hope that it will be useful,
-  but WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-  GNU General Public License for more details.
-
-*/
-
-#ifndef AES_H
-#define AES_H
-
-/*
- * SILC Crypto API for AES
- */
-
-SILC_CIPHER_API_SET_KEY(aes_cbc);
-SILC_CIPHER_API_SET_IV(aes_cbc);
-SILC_CIPHER_API_ENCRYPT(aes_cbc);
-SILC_CIPHER_API_DECRYPT(aes_cbc);
-SILC_CIPHER_API_CONTEXT_LEN(aes_cbc);
-SILC_CIPHER_API_SET_KEY(aes_ctr);
-SILC_CIPHER_API_SET_IV(aes_ctr);
-SILC_CIPHER_API_ENCRYPT(aes_ctr);
-SILC_CIPHER_API_DECRYPT(aes_ctr);
-SILC_CIPHER_API_CONTEXT_LEN(aes_ctr);
-
-#endif
diff --git a/lib/silccrypt/aes_x86.asm b/lib/silccrypt/aes_x86.asm
deleted file mode 100644 (file)
index 2742c1c..0000000
+++ /dev/null
@@ -1,601 +0,0 @@
-
-; ---------------------------------------------------------------------------
-; Copyright (c) 2002, Dr Brian Gladman, Worcester, UK.   All rights reserved.
-;
-; LICENSE TERMS
-;
-; The free distribution and use of this software in both source and binary
-; form is allowed (with or without changes) provided that:
-;
-;   1. distributions of this source code include the above copyright
-;      notice, this list of conditions and the following disclaimer;
-;
-;   2. distributions in binary form include the above copyright
-;      notice, this list of conditions and the following disclaimer
-;      in the documentation and/or other associated materials;
-;
-;   3. the copyright holder's name is not used to endorse products
-;      built using this software without specific written permission.
-;
-; ALTERNATIVELY, provided that this notice is retained in full, this product
-; may be distributed under the terms of the GNU General Public License (GPL),
-; in which case the provisions of the GPL apply INSTEAD OF those given above.
-;
-; DISCLAIMER
-;
-; This software is provided 'as is' with no explicit or implied warranties
-; in respect of its properties, including, but not limited to, correctness
-; and/or fitness for purpose.
-; ---------------------------------------------------------------------------
-; Issue 09/09/2006
-
-; An AES implementation for x86 processors using the YASM (or NASM) assembler.
-; This is an assembler implementation that covers encryption and decryption
-; only and is intended as a replacement of the C file aescrypt.c. It hence
-; requires the file aeskey.c for keying and aestab.c for the AES tables. It
-; employs full tables rather than compressed tables.
-
-; This code provides the standard AES block size (128 bits, 16 bytes) and the
-; three standard AES key sizes (128, 192 and 256 bits). It has the same call
-; interface as my C implementation. The ebx, esi, edi and ebp registers are
-; preserved across calls but eax, ecx and edx and the artihmetic status flags
-; are not.  It is also important that the defines below match those used in the
-; C code.  This code uses the VC++ register saving conentions; if it is used
-; with another compiler, conventions for using and saving registers may need to
-; be checked (and calling conventions).  The YASM command line for the VC++
-; custom build step is:
-;
-;    yasm -Xvc -f win32 -o "$(TargetDir)\$(InputName).obj" "$(InputPath)"
-;
-;  The calling intefaces are:
-;
-;     AES_RETURN aes_encrypt(const unsigned char in_blk[],
-;                   unsigned char out_blk[], const aes_encrypt_ctx cx[1]);
-;
-;     AES_RETURN aes_decrypt(const unsigned char in_blk[],
-;                   unsigned char out_blk[], const aes_decrypt_ctx cx[1]);
-;
-;     AES_RETURN aes_encrypt_key<NNN>(const unsigned char key[],
-;                                            const aes_encrypt_ctx cx[1]);
-;
-;     AES_RETURN aes_decrypt_key<NNN>(const unsigned char key[],
-;                                            const aes_decrypt_ctx cx[1]);
-;
-;     AES_RETURN aes_encrypt_key(const unsigned char key[],
-;                           unsigned int len, const aes_decrypt_ctx cx[1]);
-;
-;     AES_RETURN aes_decrypt_key(const unsigned char key[],
-;                           unsigned int len, const aes_decrypt_ctx cx[1]);
-;
-; where <NNN> is 128, 102 or 256.  In the last two calls the length can be in
-; either bits or bytes.
-;
-; Comment in/out the following lines to obtain the desired subroutines. These
-; selections MUST match those in the C header file aes.h
-
-%define AES_128                 ; define if AES with 128 bit keys is needed
-%define AES_192                 ; define if AES with 192 bit keys is needed
-%define AES_256                 ; define if AES with 256 bit keys is needed
-%define AES_VAR                 ; define if a variable key size is needed
-%define ENCRYPTION              ; define if encryption is needed
-%define DECRYPTION              ; define if decryption is needed
-%define AES_REV_DKS             ; define if key decryption schedule is reversed
-%define LAST_ROUND_TABLES       ; define if tables are to be used for last round
-
-; offsets to parameters
-
-in_blk  equ     4   ; input byte array address parameter
-out_blk equ     8   ; output byte array address parameter
-ctx     equ    12   ; AES context structure
-stk_spc equ    20   ; stack space
-%define parms  12   ; parameter space on stack
-
-; The encryption key schedule has the following in memory layout where N is the
-; number of rounds (10, 12 or 14):
-;
-; lo: | input key (round 0)  |  ; each round is four 32-bit words
-;     | encryption round 1   |
-;     | encryption round 2   |
-;     ....
-;     | encryption round N-1 |
-; hi: | encryption round N   |
-;
-; The decryption key schedule is normally set up so that it has the same
-; layout as above by actually reversing the order of the encryption key
-; schedule in memory (this happens when AES_REV_DKS is set):
-;
-; lo: | decryption round 0   | =              | encryption round N   |
-;     | decryption round 1   | = INV_MIX_COL[ | encryption round N-1 | ]
-;     | decryption round 2   | = INV_MIX_COL[ | encryption round N-2 | ]
-;     ....                       ....
-;     | decryption round N-1 | = INV_MIX_COL[ | encryption round 1   | ]
-; hi: | decryption round N   | =              | input key (round 0)  |
-;
-; with rounds except the first and last modified using inv_mix_column()
-; But if AES_REV_DKS is NOT set the order of keys is left as it is for
-; encryption so that it has to be accessed in reverse when used for
-; decryption (although the inverse mix column modifications are done)
-;
-; lo: | decryption round 0   | =              | input key (round 0)  |
-;     | decryption round 1   | = INV_MIX_COL[ | encryption round 1   | ]
-;     | decryption round 2   | = INV_MIX_COL[ | encryption round 2   | ]
-;     ....                       ....
-;     | decryption round N-1 | = INV_MIX_COL[ | encryption round N-1 | ]
-; hi: | decryption round N   | =              | encryption round N   |
-;
-; This layout is faster when the assembler key scheduling provided here
-; is used.
-;
-; The DLL interface must use the _stdcall convention in which the number
-; of bytes of parameter space is added after an @ to the sutine's name.
-; We must also remove our parameters from the stack before return (see
-; the do_exit macro). Define DLL_EXPORT for the Dynamic Link Library version.
-
-;%define DLL_EXPORT
-
-; End of user defines
-
-%ifdef AES_VAR
-%ifndef AES_128
-%define AES_128
-%endif
-%ifndef AES_192
-%define AES_192
-%endif
-%ifndef AES_256
-%define AES_256
-%endif
-%endif
-
-%ifdef AES_VAR
-%define KS_LENGTH       60
-%elifdef AES_256
-%define KS_LENGTH       60
-%elifdef AES_192
-%define KS_LENGTH       52
-%else
-%define KS_LENGTH       44
-%endif
-
-; These macros implement stack based local variables
-
-%macro  save 2
-    mov     [esp+4*%1],%2
-%endmacro
-
-%macro  restore 2
-    mov     %1,[esp+4*%2]
-%endmacro
-
-; the DLL has to implement the _stdcall calling interface on return
-; In this case we have to take our parameters (3 4-byte pointers)
-; off the stack
-
-%macro  do_name 1-2 parms
-%ifndef DLL_EXPORT
-    align 32
-    global  %1
-%1:
-%else
-    align 32
-    global  %1@%2
-    export  %1@%2
-%1@%2:
-%endif
-%endmacro
-
-%macro  do_call 1-2 parms
-%ifndef DLL_EXPORT
-    call    %1
-    add     esp,%2
-%else
-    call    %1@%2
-%endif
-%endmacro
-
-%macro  do_exit  0-1 parms
-%ifdef DLL_EXPORT
-    ret %1
-%else
-    ret
-%endif
-%endmacro
-
-%ifdef  ENCRYPTION
-
-    extern  t_fn
-
-%define etab_0(x)   [t_fn+4*x]
-%define etab_1(x)   [t_fn+1024+4*x]
-%define etab_2(x)   [t_fn+2048+4*x]
-%define etab_3(x)   [t_fn+3072+4*x]
-
-%ifdef LAST_ROUND_TABLES
-
-    extern  t_fl
-
-%define eltab_0(x)  [t_fl+4*x]
-%define eltab_1(x)  [t_fl+1024+4*x]
-%define eltab_2(x)  [t_fl+2048+4*x]
-%define eltab_3(x)  [t_fl+3072+4*x]
-
-%endif
-
-; ROUND FUNCTION.  Build column[2] on ESI and column[3] on EDI that have the
-; round keys pre-loaded. Build column[0] in EBP and column[1] in EBX.
-;
-; Input:
-;
-;   EAX     column[0]
-;   EBX     column[1]
-;   ECX     column[2]
-;   EDX     column[3]
-;   ESI     column key[round][2]
-;   EDI     column key[round][3]
-;   EBP     scratch
-;
-; Output:
-;
-;   EBP     column[0]   unkeyed
-;   EBX     column[1]   unkeyed
-;   ESI     column[2]   keyed
-;   EDI     column[3]   keyed
-;   EAX     scratch
-;   ECX     scratch
-;   EDX     scratch
-
-%macro rnd_fun 2
-
-    rol     ebx,16
-    %1      esi, cl, 0, ebp
-    %1      esi, dh, 1, ebp
-    %1      esi, bh, 3, ebp
-    %1      edi, dl, 0, ebp
-    %1      edi, ah, 1, ebp
-    %1      edi, bl, 2, ebp
-    %2      ebp, al, 0, ebp
-    shr     ebx,16
-    and     eax,0xffff0000
-    or      eax,ebx
-    shr     edx,16
-    %1      ebp, ah, 1, ebx
-    %1      ebp, dh, 3, ebx
-    %2      ebx, dl, 2, ebx
-    %1      ebx, ch, 1, edx
-    %1      ebx, al, 0, edx
-    shr     eax,16
-    shr     ecx,16
-    %1      ebp, cl, 2, edx
-    %1      edi, ch, 3, edx
-    %1      esi, al, 2, edx
-    %1      ebx, ah, 3, edx
-
-%endmacro
-
-; Basic MOV and XOR Operations for normal rounds
-
-%macro  nr_xor  4
-    movzx   %4,%2
-    xor     %1,etab_%3(%4)
-%endmacro
-
-%macro  nr_mov  4
-    movzx   %4,%2
-    mov     %1,etab_%3(%4)
-%endmacro
-
-; Basic MOV and XOR Operations for last round
-
-%ifdef LAST_ROUND_TABLES
-
-    %macro  lr_xor  4
-        movzx   %4,%2
-        xor     %1,eltab_%3(%4)
-    %endmacro
-
-    %macro  lr_mov  4
-        movzx   %4,%2
-        mov     %1,eltab_%3(%4)
-    %endmacro
-
-%endif
-
-%macro enc_round 0
-
-    add     ebp,16
-    save    0,ebp
-    mov     esi,[ebp+8]
-    mov     edi,[ebp+12]
-
-    rnd_fun nr_xor, nr_mov
-
-    mov     eax,ebp
-    mov     ecx,esi
-    mov     edx,edi
-    restore ebp,0
-    xor     eax,[ebp]
-    xor     ebx,[ebp+4]
-
-%endmacro
-
-%macro enc_last_round 0
-
-    add     ebp,16
-    save    0,ebp
-    mov     esi,[ebp+8]
-    mov     edi,[ebp+12]
-
-    rnd_fun lr_xor, lr_mov
-
-    mov     eax,ebp
-    restore ebp,0
-    xor     eax,[ebp]
-    xor     ebx,[ebp+4]
-
-%endmacro
-
-    section .text align=32
-
-; AES Encryption Subroutine
-
-    do_name aes_encrypt
-
-    sub     esp,stk_spc
-    mov     [esp+16],ebp
-    mov     [esp+12],ebx
-    mov     [esp+ 8],esi
-    mov     [esp+ 4],edi
-
-    mov     esi,[esp+in_blk+stk_spc] ; input pointer
-    mov     eax,[esi   ]
-    mov     ebx,[esi+ 4]
-    mov     ecx,[esi+ 8]
-    mov     edx,[esi+12]
-
-    mov     ebp,[esp+ctx+stk_spc]    ; key pointer
-    movzx   edi,byte [ebp+4*KS_LENGTH]
-    xor     eax,[ebp   ]
-    xor     ebx,[ebp+ 4]
-    xor     ecx,[ebp+ 8]
-    xor     edx,[ebp+12]
-
-; determine the number of rounds
-
-    cmp     edi,10*16
-    je      .3
-    cmp     edi,12*16
-    je      .2
-    cmp     edi,14*16
-    je      .1
-    mov     eax,-1
-    jmp     .5
-
-.1: enc_round
-    enc_round
-.2: enc_round
-    enc_round
-.3: enc_round
-    enc_round
-    enc_round
-    enc_round
-    enc_round
-    enc_round
-    enc_round
-    enc_round
-    enc_round
-    enc_last_round
-
-    mov     edx,[esp+out_blk+stk_spc]
-    mov     [edx],eax
-    mov     [edx+4],ebx
-    mov     [edx+8],esi
-    mov     [edx+12],edi
-    xor     eax,eax
-
-.5: mov     ebp,[esp+16]
-    mov     ebx,[esp+12]
-    mov     esi,[esp+ 8]
-    mov     edi,[esp+ 4]
-    add     esp,stk_spc
-    do_exit
-
-%endif
-
-%ifdef  DECRYPTION
-
-    extern  t_in
-
-%define dtab_0(x)   [t_in+4*x]
-%define dtab_1(x)   [t_in+1024+4*x]
-%define dtab_2(x)   [t_in+2048+4*x]
-%define dtab_3(x)   [t_in+3072+4*x]
-
-%ifdef LAST_ROUND_TABLES
-
-    extern  t_il
-
-%define dltab_0(x)  [t_il+4*x]
-%define dltab_1(x)  [t_il+1024+4*x]
-%define dltab_2(x)  [t_il+2048+4*x]
-%define dltab_3(x)  [t_il+3072+4*x]
-
-%endif
-
-%macro irn_fun 2
-
-    rol eax,16
-    %1      esi, cl, 0, ebp
-    %1      esi, bh, 1, ebp
-    %1      esi, al, 2, ebp
-    %1      edi, dl, 0, ebp
-    %1      edi, ch, 1, ebp
-    %1      edi, ah, 3, ebp
-    %2      ebp, bl, 0, ebp
-    shr     eax,16
-    and     ebx,0xffff0000
-    or      ebx,eax
-    shr     ecx,16
-    %1      ebp, bh, 1, eax
-    %1      ebp, ch, 3, eax
-    %2      eax, cl, 2, ecx
-    %1      eax, bl, 0, ecx
-    %1      eax, dh, 1, ecx
-    shr     ebx,16
-    shr     edx,16
-    %1      esi, dh, 3, ecx
-    %1      ebp, dl, 2, ecx
-    %1      eax, bh, 3, ecx
-    %1      edi, bl, 2, ecx
-
-%endmacro
-
-; Basic MOV and XOR Operations for normal rounds
-
-%macro  ni_xor  4
-    movzx   %4,%2
-    xor     %1,dtab_%3(%4)
-%endmacro
-
-%macro  ni_mov  4
-    movzx   %4,%2
-    mov     %1,dtab_%3(%4)
-%endmacro
-
-; Basic MOV and XOR Operations for last round
-
-%ifdef LAST_ROUND_TABLES
-
-%macro  li_xor  4
-    movzx   %4,%2
-    xor     %1,dltab_%3(%4)
-%endmacro
-
-%macro  li_mov  4
-    movzx   %4,%2
-    mov     %1,dltab_%3(%4)
-%endmacro
-
-%endif
-
-%macro dec_round 0
-
-%ifdef AES_REV_DKS
-    add     ebp,16
-%else
-    sub     ebp,16
-%endif
-    save    0,ebp
-    mov     esi,[ebp+8]
-    mov     edi,[ebp+12]
-
-    irn_fun ni_xor, ni_mov
-
-    mov     ebx,ebp
-    mov     ecx,esi
-    mov     edx,edi
-    restore ebp,0
-    xor     eax,[ebp]
-    xor     ebx,[ebp+4]
-
-%endmacro
-
-%macro dec_last_round 0
-
-%ifdef AES_REV_DKS
-    add     ebp,16
-%else
-    sub     ebp,16
-%endif
-    save    0,ebp
-    mov     esi,[ebp+8]
-    mov     edi,[ebp+12]
-
-    irn_fun li_xor, li_mov
-
-    mov     ebx,ebp
-    restore ebp,0
-    xor     eax,[ebp]
-    xor     ebx,[ebp+4]
-
-%endmacro
-
-    section .text align=32
-
-; AES Decryption Subroutine
-
-    do_name aes_decrypt
-
-    sub     esp,stk_spc
-    mov     [esp+16],ebp
-    mov     [esp+12],ebx
-    mov     [esp+ 8],esi
-    mov     [esp+ 4],edi
-
-; input four columns and xor in first round key
-
-    mov     esi,[esp+in_blk+stk_spc] ; input pointer
-    mov     eax,[esi   ]
-    mov     ebx,[esi+ 4]
-    mov     ecx,[esi+ 8]
-    mov     edx,[esi+12]
-    lea     esi,[esi+16]
-
-    mov     ebp,[esp+ctx+stk_spc]    ; key pointer
-    movzx   edi,byte[ebp+4*KS_LENGTH]
-%ifndef  AES_REV_DKS        ; if decryption key schedule is not reversed
-    lea     ebp,[ebp+edi]   ; we have to access it from the top down
-%endif
-    xor     eax,[ebp   ]    ; key schedule
-    xor     ebx,[ebp+ 4]
-    xor     ecx,[ebp+ 8]
-    xor     edx,[ebp+12]
-
-; determine the number of rounds
-
-    cmp     edi,10*16
-    je      .3
-    cmp     edi,12*16
-    je      .2
-    cmp     edi,14*16
-    je      .1
-    mov     eax,-1
-    jmp     .5
-
-.1: dec_round
-    dec_round
-.2: dec_round
-    dec_round
-.3: dec_round
-    dec_round
-    dec_round
-    dec_round
-    dec_round
-    dec_round
-    dec_round
-    dec_round
-    dec_round
-    dec_last_round
-
-; move final values to the output array.
-
-    mov     ebp,[esp+out_blk+stk_spc]
-    mov     [ebp],eax
-    mov     [ebp+4],ebx
-    mov     [ebp+8],esi
-    mov     [ebp+12],edi
-    xor     eax,eax
-
-.5: mov     ebp,[esp+16]
-    mov     ebx,[esp+12]
-    mov     esi,[esp+ 8]
-    mov     edi,[esp+ 4]
-    add     esp,stk_spc
-    do_exit
-
-%endif
-
-    end
-
-%ifidn __OUTPUT_FORMAT__,elf
-section .note.GNU-stack noalloc noexec nowrite progbits
-%endif
diff --git a/lib/silccrypt/aes_x86_64.asm b/lib/silccrypt/aes_x86_64.asm
deleted file mode 100644 (file)
index d6ac1eb..0000000
+++ /dev/null
@@ -1,870 +0,0 @@
-\r
-; ---------------------------------------------------------------------------\r
-; Copyright (c) 2002, Dr Brian Gladman, Worcester, UK.   All rights reserved.\r
-;\r
-; LICENSE TERMS\r
-;\r
-; The free distribution and use of this software in both source and binary\r
-; form is allowed (with or without changes) provided that:\r
-;\r
-;   1. distributions of this source code include the above copyright\r
-;      notice, this list of conditions and the following disclaimer;\r
-;\r
-;   2. distributions in binary form include the above copyright\r
-;      notice, this list of conditions and the following disclaimer\r
-;      in the documentation and/or other associated materials;\r
-;\r
-;   3. the copyright holder's name is not used to endorse products\r
-;      built using this software without specific written permission.\r
-;\r
-; ALTERNATIVELY, provided that this notice is retained in full, this product\r
-; may be distributed under the terms of the GNU General Public License (GPL),\r
-; in which case the provisions of the GPL apply INSTEAD OF those given above.\r
-;\r
-; DISCLAIMER\r
-;\r
-; This software is provided 'as is' with no explicit or implied warranties\r
-; in respect of its properties, including, but not limited to, correctness\r
-; and/or fitness for purpose.\r
-; ---------------------------------------------------------------------------\r
-; Issue 09/09/2006\r
-\r
-; I am grateful to Dag Arne Osvik for many discussions of the techniques that\r
-; can be used to optimise AES assembler code on AMD64/EM64T architectures.\r
-; Some of the techniques used in this implementation are the result of\r
-; suggestions made by him for which I am most grateful.\r
-\r
-; An AES implementation for AMD64 processors using the YASM assembler.  This\r
-; implemetation provides only encryption, decryption and hence requires key\r
-; scheduling support in C. It uses 8k bytes of tables but its encryption and\r
-; decryption performance is very close to that obtained using large tables.\r
-; It can use either Windows or Gnu/Linux calling conventions, which are as\r
-; follows:\r
-;               windows  gnu/linux\r
-;\r
-;   in_blk          rcx     rdi\r
-;   out_blk         rdx     rsi\r
-;   context (cx)     r8     rdx\r
-;\r
-;   preserved       rsi      -    + rbx, rbp, rsp, r12, r13, r14 & r15\r
-;   registers       rdi      -      on both\r
-;\r
-;   destroyed        -      rsi   + rax, rcx, rdx, r8, r9, r10 & r11\r
-;   registers        -      rdi     on both\r
-;\r
-; The default convention is that for windows, the gnu/linux convention being\r
-; used if __GNUC__ is defined.\r
-;\r
-; This code provides the standard AES block size (128 bits, 16 bytes) and the\r
-; three standard AES key sizes (128, 192 and 256 bits). It has the same call\r
-; interface as my C implementation.  It uses the Microsoft C AMD64 calling\r
-; conventions in which the three parameters are placed in  rcx, rdx and r8\r
-; respectively.  The rbx, rsi, rdi, rbp and r12..r15 registers are preserved.\r
-;\r
-;     AES_RETURN aes_encrypt(const unsigned char in_blk[],\r
-;                   unsigned char out_blk[], const aes_encrypt_ctx cx[1]);\r
-;\r
-;     AES_RETURN aes_decrypt(const unsigned char in_blk[],\r
-;                   unsigned char out_blk[], const aes_decrypt_ctx cx[1]);\r
-;\r
-;     AES_RETURN aes_encrypt_key<NNN>(const unsigned char key[],\r
-;                                            const aes_encrypt_ctx cx[1]);\r
-;\r
-;     AES_RETURN aes_decrypt_key<NNN>(const unsigned char key[],\r
-;                                            const aes_decrypt_ctx cx[1]);\r
-;\r
-;     AES_RETURN aes_encrypt_key(const unsigned char key[],\r
-;                           unsigned int len, const aes_decrypt_ctx cx[1]);\r
-;\r
-;     AES_RETURN aes_decrypt_key(const unsigned char key[],\r
-;                           unsigned int len, const aes_decrypt_ctx cx[1]);\r
-;\r
-; where <NNN> is 128, 102 or 256.  In the last two calls the length can be in\r
-; either bits or bytes.\r
-;\r
-; Comment in/out the following lines to obtain the desired subroutines. These\r
-; selections MUST match those in the C header file aes.h\r
-\r
-%define AES_128                 ; define if AES with 128 bit keys is needed\r
-%define AES_192                 ; define if AES with 192 bit keys is needed\r
-%define AES_256                 ; define if AES with 256 bit keys is needed\r
-%define AES_VAR                 ; define if a variable key size is needed\r
-%define ENCRYPTION              ; define if encryption is needed\r
-%define DECRYPTION              ; define if decryption is needed\r
-%define AES_REV_DKS             ; define if key decryption schedule is reversed\r
-%define LAST_ROUND_TABLES       ; define for the faster version using extra tables\r
-\r
-; The encryption key schedule has the following in memory layout where N is the\r
-; number of rounds (10, 12 or 14):\r
-;\r
-; lo: | input key (round 0)  |  ; each round is four 32-bit words\r
-;     | encryption round 1   |\r
-;     | encryption round 2   |\r
-;     ....\r
-;     | encryption round N-1 |\r
-; hi: | encryption round N   |\r
-;\r
-; The decryption key schedule is normally set up so that it has the same\r
-; layout as above by actually reversing the order of the encryption key\r
-; schedule in memory (this happens when AES_REV_DKS is set):\r
-;\r
-; lo: | decryption round 0   | =              | encryption round N   |\r
-;     | decryption round 1   | = INV_MIX_COL[ | encryption round N-1 | ]\r
-;     | decryption round 2   | = INV_MIX_COL[ | encryption round N-2 | ]\r
-;     ....                       ....\r
-;     | decryption round N-1 | = INV_MIX_COL[ | encryption round 1   | ]\r
-; hi: | decryption round N   | =              | input key (round 0)  |\r
-;\r
-; with rounds except the first and last modified using inv_mix_column()\r
-; But if AES_REV_DKS is NOT set the order of keys is left as it is for\r
-; encryption so that it has to be accessed in reverse when used for\r
-; decryption (although the inverse mix column modifications are done)\r
-;\r
-; lo: | decryption round 0   | =              | input key (round 0)  |\r
-;     | decryption round 1   | = INV_MIX_COL[ | encryption round 1   | ]\r
-;     | decryption round 2   | = INV_MIX_COL[ | encryption round 2   | ]\r
-;     ....                       ....\r
-;     | decryption round N-1 | = INV_MIX_COL[ | encryption round N-1 | ]\r
-; hi: | decryption round N   | =              | encryption round N   |\r
-;\r
-; This layout is faster when the assembler key scheduling provided here\r
-; is used.\r
-;\r
-; The DLL interface must use the _stdcall convention in which the number\r
-; of bytes of parameter space is added after an @ to the sutine's name.\r
-; We must also remove our parameters from the stack before return (see\r
-; the do_exit macro). Define DLL_EXPORT for the Dynamic Link Library version.\r
-\r
-;%define DLL_EXPORT\r
-\r
-; End of user defines\r
-\r
-%ifdef AES_VAR\r
-%ifndef AES_128\r
-%define AES_128\r
-%endif\r
-%ifndef AES_192\r
-%define AES_192\r
-%endif\r
-%ifndef AES_256\r
-%define AES_256\r
-%endif\r
-%endif\r
-\r
-%ifdef AES_VAR\r
-%define KS_LENGTH       60\r
-%elifdef AES_256\r
-%define KS_LENGTH       60\r
-%elifdef AES_192\r
-%define KS_LENGTH       52\r
-%else\r
-%define KS_LENGTH       44\r
-%endif\r
-\r
-%define     r0  rax\r
-%define     r1  rdx\r
-%define     r2  rcx\r
-%define     r3  rbx\r
-%define     r4  rsi\r
-%define     r5  rdi\r
-%define     r6  rbp\r
-%define     r7  rsp\r
-\r
-%define     raxd    eax\r
-%define     rdxd    edx\r
-%define     rcxd    ecx\r
-%define     rbxd    ebx\r
-%define     rsid    esi\r
-%define     rdid    edi\r
-%define     rbpd    ebp\r
-%define     rspd    esp\r
-\r
-%define     raxb    al\r
-%define     rdxb    dl\r
-%define     rcxb    cl\r
-%define     rbxb    bl\r
-%define     rsib    sil\r
-%define     rdib    dil\r
-%define     rbpb    bpl\r
-%define     rspb    spl\r
-\r
-%define     r0h ah\r
-%define     r1h dh\r
-%define     r2h ch\r
-%define     r3h bh\r
-\r
-%define     r0d eax\r
-%define     r1d edx\r
-%define     r2d ecx\r
-%define     r3d ebx\r
-\r
-; finite field multiplies by {02}, {04} and {08}\r
-\r
-%define f2(x)   ((x<<1)^(((x>>7)&1)*0x11b))\r
-%define f4(x)   ((x<<2)^(((x>>6)&1)*0x11b)^(((x>>6)&2)*0x11b))\r
-%define f8(x)   ((x<<3)^(((x>>5)&1)*0x11b)^(((x>>5)&2)*0x11b)^(((x>>5)&4)*0x11b))\r
-\r
-; finite field multiplies required in table generation\r
-\r
-%define f3(x)   (f2(x) ^ x)\r
-%define f9(x)   (f8(x) ^ x)\r
-%define fb(x)   (f8(x) ^ f2(x) ^ x)\r
-%define fd(x)   (f8(x) ^ f4(x) ^ x)\r
-%define fe(x)   (f8(x) ^ f4(x) ^ f2(x))\r
-\r
-; macro for expanding S-box data\r
-\r
-%macro enc_vals 1\r
-    db  %1(0x63),%1(0x7c),%1(0x77),%1(0x7b),%1(0xf2),%1(0x6b),%1(0x6f),%1(0xc5)\r
-    db  %1(0x30),%1(0x01),%1(0x67),%1(0x2b),%1(0xfe),%1(0xd7),%1(0xab),%1(0x76)\r
-    db  %1(0xca),%1(0x82),%1(0xc9),%1(0x7d),%1(0xfa),%1(0x59),%1(0x47),%1(0xf0)\r
-    db  %1(0xad),%1(0xd4),%1(0xa2),%1(0xaf),%1(0x9c),%1(0xa4),%1(0x72),%1(0xc0)\r
-    db  %1(0xb7),%1(0xfd),%1(0x93),%1(0x26),%1(0x36),%1(0x3f),%1(0xf7),%1(0xcc)\r
-    db  %1(0x34),%1(0xa5),%1(0xe5),%1(0xf1),%1(0x71),%1(0xd8),%1(0x31),%1(0x15)\r
-    db  %1(0x04),%1(0xc7),%1(0x23),%1(0xc3),%1(0x18),%1(0x96),%1(0x05),%1(0x9a)\r
-    db  %1(0x07),%1(0x12),%1(0x80),%1(0xe2),%1(0xeb),%1(0x27),%1(0xb2),%1(0x75)\r
-    db  %1(0x09),%1(0x83),%1(0x2c),%1(0x1a),%1(0x1b),%1(0x6e),%1(0x5a),%1(0xa0)\r
-    db  %1(0x52),%1(0x3b),%1(0xd6),%1(0xb3),%1(0x29),%1(0xe3),%1(0x2f),%1(0x84)\r
-    db  %1(0x53),%1(0xd1),%1(0x00),%1(0xed),%1(0x20),%1(0xfc),%1(0xb1),%1(0x5b)\r
-    db  %1(0x6a),%1(0xcb),%1(0xbe),%1(0x39),%1(0x4a),%1(0x4c),%1(0x58),%1(0xcf)\r
-    db  %1(0xd0),%1(0xef),%1(0xaa),%1(0xfb),%1(0x43),%1(0x4d),%1(0x33),%1(0x85)\r
-    db  %1(0x45),%1(0xf9),%1(0x02),%1(0x7f),%1(0x50),%1(0x3c),%1(0x9f),%1(0xa8)\r
-    db  %1(0x51),%1(0xa3),%1(0x40),%1(0x8f),%1(0x92),%1(0x9d),%1(0x38),%1(0xf5)\r
-    db  %1(0xbc),%1(0xb6),%1(0xda),%1(0x21),%1(0x10),%1(0xff),%1(0xf3),%1(0xd2)\r
-    db  %1(0xcd),%1(0x0c),%1(0x13),%1(0xec),%1(0x5f),%1(0x97),%1(0x44),%1(0x17)\r
-    db  %1(0xc4),%1(0xa7),%1(0x7e),%1(0x3d),%1(0x64),%1(0x5d),%1(0x19),%1(0x73)\r
-    db  %1(0x60),%1(0x81),%1(0x4f),%1(0xdc),%1(0x22),%1(0x2a),%1(0x90),%1(0x88)\r
-    db  %1(0x46),%1(0xee),%1(0xb8),%1(0x14),%1(0xde),%1(0x5e),%1(0x0b),%1(0xdb)\r
-    db  %1(0xe0),%1(0x32),%1(0x3a),%1(0x0a),%1(0x49),%1(0x06),%1(0x24),%1(0x5c)\r
-    db  %1(0xc2),%1(0xd3),%1(0xac),%1(0x62),%1(0x91),%1(0x95),%1(0xe4),%1(0x79)\r
-    db  %1(0xe7),%1(0xc8),%1(0x37),%1(0x6d),%1(0x8d),%1(0xd5),%1(0x4e),%1(0xa9)\r
-    db  %1(0x6c),%1(0x56),%1(0xf4),%1(0xea),%1(0x65),%1(0x7a),%1(0xae),%1(0x08)\r
-    db  %1(0xba),%1(0x78),%1(0x25),%1(0x2e),%1(0x1c),%1(0xa6),%1(0xb4),%1(0xc6)\r
-    db  %1(0xe8),%1(0xdd),%1(0x74),%1(0x1f),%1(0x4b),%1(0xbd),%1(0x8b),%1(0x8a)\r
-    db  %1(0x70),%1(0x3e),%1(0xb5),%1(0x66),%1(0x48),%1(0x03),%1(0xf6),%1(0x0e)\r
-    db  %1(0x61),%1(0x35),%1(0x57),%1(0xb9),%1(0x86),%1(0xc1),%1(0x1d),%1(0x9e)\r
-    db  %1(0xe1),%1(0xf8),%1(0x98),%1(0x11),%1(0x69),%1(0xd9),%1(0x8e),%1(0x94)\r
-    db  %1(0x9b),%1(0x1e),%1(0x87),%1(0xe9),%1(0xce),%1(0x55),%1(0x28),%1(0xdf)\r
-    db  %1(0x8c),%1(0xa1),%1(0x89),%1(0x0d),%1(0xbf),%1(0xe6),%1(0x42),%1(0x68)\r
-    db  %1(0x41),%1(0x99),%1(0x2d),%1(0x0f),%1(0xb0),%1(0x54),%1(0xbb),%1(0x16)\r
-%endmacro\r
-\r
-%macro dec_vals 1\r
-    db  %1(0x52),%1(0x09),%1(0x6a),%1(0xd5),%1(0x30),%1(0x36),%1(0xa5),%1(0x38)\r
-    db  %1(0xbf),%1(0x40),%1(0xa3),%1(0x9e),%1(0x81),%1(0xf3),%1(0xd7),%1(0xfb)\r
-    db  %1(0x7c),%1(0xe3),%1(0x39),%1(0x82),%1(0x9b),%1(0x2f),%1(0xff),%1(0x87)\r
-    db  %1(0x34),%1(0x8e),%1(0x43),%1(0x44),%1(0xc4),%1(0xde),%1(0xe9),%1(0xcb)\r
-    db  %1(0x54),%1(0x7b),%1(0x94),%1(0x32),%1(0xa6),%1(0xc2),%1(0x23),%1(0x3d)\r
-    db  %1(0xee),%1(0x4c),%1(0x95),%1(0x0b),%1(0x42),%1(0xfa),%1(0xc3),%1(0x4e)\r
-    db  %1(0x08),%1(0x2e),%1(0xa1),%1(0x66),%1(0x28),%1(0xd9),%1(0x24),%1(0xb2)\r
-    db  %1(0x76),%1(0x5b),%1(0xa2),%1(0x49),%1(0x6d),%1(0x8b),%1(0xd1),%1(0x25)\r
-    db  %1(0x72),%1(0xf8),%1(0xf6),%1(0x64),%1(0x86),%1(0x68),%1(0x98),%1(0x16)\r
-    db  %1(0xd4),%1(0xa4),%1(0x5c),%1(0xcc),%1(0x5d),%1(0x65),%1(0xb6),%1(0x92)\r
-    db  %1(0x6c),%1(0x70),%1(0x48),%1(0x50),%1(0xfd),%1(0xed),%1(0xb9),%1(0xda)\r
-    db  %1(0x5e),%1(0x15),%1(0x46),%1(0x57),%1(0xa7),%1(0x8d),%1(0x9d),%1(0x84)\r
-    db  %1(0x90),%1(0xd8),%1(0xab),%1(0x00),%1(0x8c),%1(0xbc),%1(0xd3),%1(0x0a)\r
-    db  %1(0xf7),%1(0xe4),%1(0x58),%1(0x05),%1(0xb8),%1(0xb3),%1(0x45),%1(0x06)\r
-    db  %1(0xd0),%1(0x2c),%1(0x1e),%1(0x8f),%1(0xca),%1(0x3f),%1(0x0f),%1(0x02)\r
-    db  %1(0xc1),%1(0xaf),%1(0xbd),%1(0x03),%1(0x01),%1(0x13),%1(0x8a),%1(0x6b)\r
-    db  %1(0x3a),%1(0x91),%1(0x11),%1(0x41),%1(0x4f),%1(0x67),%1(0xdc),%1(0xea)\r
-    db  %1(0x97),%1(0xf2),%1(0xcf),%1(0xce),%1(0xf0),%1(0xb4),%1(0xe6),%1(0x73)\r
-    db  %1(0x96),%1(0xac),%1(0x74),%1(0x22),%1(0xe7),%1(0xad),%1(0x35),%1(0x85)\r
-    db  %1(0xe2),%1(0xf9),%1(0x37),%1(0xe8),%1(0x1c),%1(0x75),%1(0xdf),%1(0x6e)\r
-    db  %1(0x47),%1(0xf1),%1(0x1a),%1(0x71),%1(0x1d),%1(0x29),%1(0xc5),%1(0x89)\r
-    db  %1(0x6f),%1(0xb7),%1(0x62),%1(0x0e),%1(0xaa),%1(0x18),%1(0xbe),%1(0x1b)\r
-    db  %1(0xfc),%1(0x56),%1(0x3e),%1(0x4b),%1(0xc6),%1(0xd2),%1(0x79),%1(0x20)\r
-    db  %1(0x9a),%1(0xdb),%1(0xc0),%1(0xfe),%1(0x78),%1(0xcd),%1(0x5a),%1(0xf4)\r
-    db  %1(0x1f),%1(0xdd),%1(0xa8),%1(0x33),%1(0x88),%1(0x07),%1(0xc7),%1(0x31)\r
-    db  %1(0xb1),%1(0x12),%1(0x10),%1(0x59),%1(0x27),%1(0x80),%1(0xec),%1(0x5f)\r
-    db  %1(0x60),%1(0x51),%1(0x7f),%1(0xa9),%1(0x19),%1(0xb5),%1(0x4a),%1(0x0d)\r
-    db  %1(0x2d),%1(0xe5),%1(0x7a),%1(0x9f),%1(0x93),%1(0xc9),%1(0x9c),%1(0xef)\r
-    db  %1(0xa0),%1(0xe0),%1(0x3b),%1(0x4d),%1(0xae),%1(0x2a),%1(0xf5),%1(0xb0)\r
-    db  %1(0xc8),%1(0xeb),%1(0xbb),%1(0x3c),%1(0x83),%1(0x53),%1(0x99),%1(0x61)\r
-    db  %1(0x17),%1(0x2b),%1(0x04),%1(0x7e),%1(0xba),%1(0x77),%1(0xd6),%1(0x26)\r
-    db  %1(0xe1),%1(0x69),%1(0x14),%1(0x63),%1(0x55),%1(0x21),%1(0x0c),%1(0x7d)\r
-%endmacro\r
-\r
-%define u8(x)   f2(x), x, x, f3(x), f2(x), x, x, f3(x)\r
-%define v8(x)   fe(x), f9(x), fd(x), fb(x), fe(x), f9(x), fd(x), x\r
-%define w8(x)   x, 0, 0, 0, x, 0, 0, 0\r
-\r
-%define tptr    rbp     ; table pointer\r
-%define kptr    r8      ; key schedule pointer\r
-%define fofs    128     ; adjust offset in key schedule to keep |disp| < 128\r
-%define fk_ref(x,y) [kptr-16*x+fofs+4*y]\r
-%ifdef  AES_REV_DKS\r
-%define rofs    128\r
-%define ik_ref(x,y) [kptr-16*x+rofs+4*y]\r
-%else\r
-%define rofs    -128\r
-%define ik_ref(x,y) [kptr+16*x+rofs+4*y]\r
-%endif\r
-\r
-%define tab_0(x)   [tptr+8*x]\r
-%define tab_1(x)   [tptr+8*x+3]\r
-%define tab_2(x)   [tptr+8*x+2]\r
-%define tab_3(x)   [tptr+8*x+1]\r
-%define tab_f(x)   byte [tptr+8*x+1]\r
-%define tab_i(x)   byte [tptr+8*x+7]\r
-%define t_ref(x,r) tab_ %+ x(r)\r
-\r
-%macro ff_rnd 5                 ; normal forward round\r
-    mov     %1d, fk_ref(%5,0)\r
-    mov     %2d, fk_ref(%5,1)\r
-    mov     %3d, fk_ref(%5,2)\r
-    mov     %4d, fk_ref(%5,3)\r
-\r
-    movzx   esi, al\r
-    movzx   edi, ah\r
-    shr     eax, 16\r
-    xor     %1d, t_ref(0,rsi)\r
-    xor     %4d, t_ref(1,rdi)\r
-    movzx   esi, al\r
-    movzx   edi, ah\r
-    xor     %3d, t_ref(2,rsi)\r
-    xor     %2d, t_ref(3,rdi)\r
-\r
-    movzx   esi, bl\r
-    movzx   edi, bh\r
-    shr     ebx, 16\r
-    xor     %2d, t_ref(0,rsi)\r
-    xor     %1d, t_ref(1,rdi)\r
-    movzx   esi, bl\r
-    movzx   edi, bh\r
-    xor     %4d, t_ref(2,rsi)\r
-    xor     %3d, t_ref(3,rdi)\r
-\r
-    movzx   esi, cl\r
-    movzx   edi, ch\r
-    shr     ecx, 16\r
-    xor     %3d, t_ref(0,rsi)\r
-    xor     %2d, t_ref(1,rdi)\r
-    movzx   esi, cl\r
-    movzx   edi, ch\r
-    xor     %1d, t_ref(2,rsi)\r
-    xor     %4d, t_ref(3,rdi)\r
-\r
-    movzx   esi, dl\r
-    movzx   edi, dh\r
-    shr     edx, 16\r
-    xor     %4d, t_ref(0,rsi)\r
-    xor     %3d, t_ref(1,rdi)\r
-    movzx   esi, dl\r
-    movzx   edi, dh\r
-    xor     %2d, t_ref(2,rsi)\r
-    xor     %1d, t_ref(3,rdi)\r
-\r
-    mov     eax,%1d\r
-    mov     ebx,%2d\r
-    mov     ecx,%3d\r
-    mov     edx,%4d\r
-%endmacro\r
-\r
-%ifdef LAST_ROUND_TABLES\r
-\r
-%macro fl_rnd 5                 ; last forward round\r
-    add     tptr, 2048\r
-    mov     %1d, fk_ref(%5,0)\r
-    mov     %2d, fk_ref(%5,1)\r
-    mov     %3d, fk_ref(%5,2)\r
-    mov     %4d, fk_ref(%5,3)\r
-\r
-    movzx   esi, al\r
-    movzx   edi, ah\r
-    shr     eax, 16\r
-    xor     %1d, t_ref(0,rsi)\r
-    xor     %4d, t_ref(1,rdi)\r
-    movzx   esi, al\r
-    movzx   edi, ah\r
-    xor     %3d, t_ref(2,rsi)\r
-    xor     %2d, t_ref(3,rdi)\r
-\r
-    movzx   esi, bl\r
-    movzx   edi, bh\r
-    shr     ebx, 16\r
-    xor     %2d, t_ref(0,rsi)\r
-    xor     %1d, t_ref(1,rdi)\r
-    movzx   esi, bl\r
-    movzx   edi, bh\r
-    xor     %4d, t_ref(2,rsi)\r
-    xor     %3d, t_ref(3,rdi)\r
-\r
-    movzx   esi, cl\r
-    movzx   edi, ch\r
-    shr     ecx, 16\r
-    xor     %3d, t_ref(0,rsi)\r
-    xor     %2d, t_ref(1,rdi)\r
-    movzx   esi, cl\r
-    movzx   edi, ch\r
-    xor     %1d, t_ref(2,rsi)\r
-    xor     %4d, t_ref(3,rdi)\r
-\r
-    movzx   esi, dl\r
-    movzx   edi, dh\r
-    shr     edx, 16\r
-    xor     %4d, t_ref(0,rsi)\r
-    xor     %3d, t_ref(1,rdi)\r
-    movzx   esi, dl\r
-    movzx   edi, dh\r
-    xor     %2d, t_ref(2,rsi)\r
-    xor     %1d, t_ref(3,rdi)\r
-%endmacro\r
-\r
-%else\r
-\r
-%macro fl_rnd 5                 ; last forward round\r
-    mov     %1d, fk_ref(%5,0)\r
-    mov     %2d, fk_ref(%5,1)\r
-    mov     %3d, fk_ref(%5,2)\r
-    mov     %4d, fk_ref(%5,3)\r
-\r
-    movzx   esi, al\r
-    movzx   edi, ah\r
-    shr     eax, 16\r
-    movzx   esi, t_ref(f,rsi)\r
-    movzx   edi, t_ref(f,rdi)\r
-    xor     %1d, esi\r
-    rol     edi, 8\r
-    xor     %4d, edi\r
-    movzx   esi, al\r
-    movzx   edi, ah\r
-    movzx   esi, t_ref(f,rsi)\r
-    movzx   edi, t_ref(f,rdi)\r
-    rol     esi, 16\r
-    rol     edi, 24\r
-    xor     %3d, esi\r
-    xor     %2d, edi\r
-\r
-    movzx   esi, bl\r
-    movzx   edi, bh\r
-    shr     ebx, 16\r
-    movzx   esi, t_ref(f,rsi)\r
-    movzx   edi, t_ref(f,rdi)\r
-    xor     %2d, esi\r
-    rol     edi, 8\r
-    xor     %1d, edi\r
-    movzx   esi, bl\r
-    movzx   edi, bh\r
-    movzx   esi, t_ref(f,rsi)\r
-    movzx   edi, t_ref(f,rdi)\r
-    rol     esi, 16\r
-    rol     edi, 24\r
-    xor     %4d, esi\r
-    xor     %3d, edi\r
-\r
-    movzx   esi, cl\r
-    movzx   edi, ch\r
-    movzx   esi, t_ref(f,rsi)\r
-    movzx   edi, t_ref(f,rdi)\r
-    shr     ecx, 16\r
-    xor     %3d, esi\r
-    rol     edi, 8\r
-    xor     %2d, edi\r
-    movzx   esi, cl\r
-    movzx   edi, ch\r
-    movzx   esi, t_ref(f,rsi)\r
-    movzx   edi, t_ref(f,rdi)\r
-    rol     esi, 16\r
-    rol     edi, 24\r
-    xor     %1d, esi\r
-    xor     %4d, edi\r
-\r
-    movzx   esi, dl\r
-    movzx   edi, dh\r
-    movzx   esi, t_ref(f,rsi)\r
-    movzx   edi, t_ref(f,rdi)\r
-    shr     edx, 16\r
-    xor     %4d, esi\r
-    rol     edi, 8\r
-    xor     %3d, edi\r
-    movzx   esi, dl\r
-    movzx   edi, dh\r
-    movzx   esi, t_ref(f,rsi)\r
-    movzx   edi, t_ref(f,rdi)\r
-    rol     esi, 16\r
-    rol     edi, 24\r
-    xor     %2d, esi\r
-    xor     %1d, edi\r
-%endmacro\r
-\r
-%endif\r
-\r
-%macro ii_rnd 5                 ; normal inverse round\r
-    mov     %1d, ik_ref(%5,0)\r
-    mov     %2d, ik_ref(%5,1)\r
-    mov     %3d, ik_ref(%5,2)\r
-    mov     %4d, ik_ref(%5,3)\r
-\r
-    movzx   esi, al\r
-    movzx   edi, ah\r
-    shr     eax, 16\r
-    xor     %1d, t_ref(0,rsi)\r
-    xor     %2d, t_ref(1,rdi)\r
-    movzx   esi, al\r
-    movzx   edi, ah\r
-    xor     %3d, t_ref(2,rsi)\r
-    xor     %4d, t_ref(3,rdi)\r
-\r
-    movzx   esi, bl\r
-    movzx   edi, bh\r
-    shr     ebx, 16\r
-    xor     %2d, t_ref(0,rsi)\r
-    xor     %3d, t_ref(1,rdi)\r
-    movzx   esi, bl\r
-    movzx   edi, bh\r
-    xor     %4d, t_ref(2,rsi)\r
-    xor     %1d, t_ref(3,rdi)\r
-\r
-    movzx   esi, cl\r
-    movzx   edi, ch\r
-    shr     ecx, 16\r
-    xor     %3d, t_ref(0,rsi)\r
-    xor     %4d, t_ref(1,rdi)\r
-    movzx   esi, cl\r
-    movzx   edi, ch\r
-    xor     %1d, t_ref(2,rsi)\r
-    xor     %2d, t_ref(3,rdi)\r
-\r
-    movzx   esi, dl\r
-    movzx   edi, dh\r
-    shr     edx, 16\r
-    xor     %4d, t_ref(0,rsi)\r
-    xor     %1d, t_ref(1,rdi)\r
-    movzx   esi, dl\r
-    movzx   edi, dh\r
-    xor     %2d, t_ref(2,rsi)\r
-    xor     %3d, t_ref(3,rdi)\r
-\r
-    mov     eax,%1d\r
-    mov     ebx,%2d\r
-    mov     ecx,%3d\r
-    mov     edx,%4d\r
-%endmacro\r
-\r
-%ifdef LAST_ROUND_TABLES\r
-\r
-%macro il_rnd 5                 ; last inverse round\r
-    add     tptr, 2048\r
-    mov     %1d, ik_ref(%5,0)\r
-    mov     %2d, ik_ref(%5,1)\r
-    mov     %3d, ik_ref(%5,2)\r
-    mov     %4d, ik_ref(%5,3)\r
-\r
-    movzx   esi, al\r
-    movzx   edi, ah\r
-    shr     eax, 16\r
-    xor     %1d, t_ref(0,rsi)\r
-    xor     %2d, t_ref(1,rdi)\r
-    movzx   esi, al\r
-    movzx   edi, ah\r
-    xor     %3d, t_ref(2,rsi)\r
-    xor     %4d, t_ref(3,rdi)\r
-\r
-    movzx   esi, bl\r
-    movzx   edi, bh\r
-    shr     ebx, 16\r
-    xor     %2d, t_ref(0,rsi)\r
-    xor     %3d, t_ref(1,rdi)\r
-    movzx   esi, bl\r
-    movzx   edi, bh\r
-    xor     %4d, t_ref(2,rsi)\r
-    xor     %1d, t_ref(3,rdi)\r
-\r
-    movzx   esi, cl\r
-    movzx   edi, ch\r
-    shr     ecx, 16\r
-    xor     %3d, t_ref(0,rsi)\r
-    xor     %4d, t_ref(1,rdi)\r
-    movzx   esi, cl\r
-    movzx   edi, ch\r
-    xor     %1d, t_ref(2,rsi)\r
-    xor     %2d, t_ref(3,rdi)\r
-\r
-    movzx   esi, dl\r
-    movzx   edi, dh\r
-    shr     edx, 16\r
-    xor     %4d, t_ref(0,rsi)\r
-    xor     %1d, t_ref(1,rdi)\r
-    movzx   esi, dl\r
-    movzx   edi, dh\r
-    xor     %2d, t_ref(2,rsi)\r
-    xor     %3d, t_ref(3,rdi)\r
-%endmacro\r
-\r
-%else\r
-\r
-%macro il_rnd 5                 ; last inverse round\r
-    mov     %1d, ik_ref(%5,0)\r
-    mov     %2d, ik_ref(%5,1)\r
-    mov     %3d, ik_ref(%5,2)\r
-    mov     %4d, ik_ref(%5,3)\r
-\r
-    movzx   esi, al\r
-    movzx   edi, ah\r
-    movzx   esi, t_ref(i,rsi)\r
-    movzx   edi, t_ref(i,rdi)\r
-    shr     eax, 16\r
-    xor     %1d, esi\r
-    rol     edi, 8\r
-    xor     %2d, edi\r
-    movzx   esi, al\r
-    movzx   edi, ah\r
-    movzx   esi, t_ref(i,rsi)\r
-    movzx   edi, t_ref(i,rdi)\r
-    rol     esi, 16\r
-    rol     edi, 24\r
-    xor     %3d, esi\r
-    xor     %4d, edi\r
-\r
-    movzx   esi, bl\r
-    movzx   edi, bh\r
-    movzx   esi, t_ref(i,rsi)\r
-    movzx   edi, t_ref(i,rdi)\r
-    shr     ebx, 16\r
-    xor     %2d, esi\r
-    rol     edi, 8\r
-    xor     %3d, edi\r
-    movzx   esi, bl\r
-    movzx   edi, bh\r
-    movzx   esi, t_ref(i,rsi)\r
-    movzx   edi, t_ref(i,rdi)\r
-    rol     esi, 16\r
-    rol     edi, 24\r
-    xor     %4d, esi\r
-    xor     %1d, edi\r
-\r
-    movzx   esi, cl\r
-    movzx   edi, ch\r
-    movzx   esi, t_ref(i,rsi)\r
-    movzx   edi, t_ref(i,rdi)\r
-    shr     ecx, 16\r
-    xor     %3d, esi\r
-    rol     edi, 8\r
-    xor     %4d, edi\r
-    movzx   esi, cl\r
-    movzx   edi, ch\r
-    movzx   esi, t_ref(i,rsi)\r
-    movzx   edi, t_ref(i,rdi)\r
-    rol     esi, 16\r
-    rol     edi, 24\r
-    xor     %1d, esi\r
-    xor     %2d, edi\r
-\r
-    movzx   esi, dl\r
-    movzx   edi, dh\r
-    movzx   esi, t_ref(i,rsi)\r
-    movzx   edi, t_ref(i,rdi)\r
-    shr     edx, 16\r
-    xor     %4d, esi\r
-    rol     edi, 8\r
-    xor     %1d, edi\r
-    movzx   esi, dl\r
-    movzx   edi, dh\r
-    movzx   esi, t_ref(i,rsi)\r
-    movzx   edi, t_ref(i,rdi)\r
-    rol     esi, 16\r
-    rol     edi, 24\r
-    xor     %2d, esi\r
-    xor     %3d, edi\r
-%endmacro\r
-\r
-%endif\r
-\r
-%ifdef ENCRYPTION\r
-\r
-    global  aes_encrypt\r
-%ifdef DLL_EXPORT\r
-    export  aes_encrypt\r
-%endif\r
-\r
-    section .data align=64\r
-    align   64\r
-enc_tab:\r
-    enc_vals u8\r
-%ifdef LAST_ROUND_TABLES\r
-    enc_vals w8\r
-%endif\r
-\r
-    section .text align=16\r
-    align   16\r
-aes_encrypt:\r
-\r
-%ifndef WIN32\r
-    sub     rsp, 4*8        ; gnu/linux binary interface\r
-    mov     [rsp+0*8], rsi  ; output pointer\r
-    mov     r8, rdx         ; context\r
-%else\r
-    sub     rsp, 6*8        ; windows binary interface\r
-    mov     [rsp+4*8], rsi\r
-    mov     [rsp+5*8], rdi\r
-    mov     [rsp+0*8], rdx  ; output pointer\r
-    mov     rdi, rcx        ; input pointer\r
-%endif\r
-    mov     [rsp+1*8], rbx  ; input pointer in rdi\r
-    mov     [rsp+2*8], rbp  ; output pointer in [rsp]\r
-    mov     [rsp+3*8], r12  ; context in r8\r
-\r
-    movzx   esi, byte [kptr+4*KS_LENGTH]\r
-    lea     tptr,[enc_tab wrt rip]\r
-    sub     kptr, fofs\r
-\r
-    mov     eax, [rdi+0*4]\r
-    mov     ebx, [rdi+1*4]\r
-    mov     ecx, [rdi+2*4]\r
-    mov     edx, [rdi+3*4]\r
-\r
-    xor     eax, [kptr+fofs]\r
-    xor     ebx, [kptr+fofs+4]\r
-    xor     ecx, [kptr+fofs+8]\r
-    xor     edx, [kptr+fofs+12]\r
-\r
-    lea     kptr,[kptr+rsi]\r
-    cmp     esi, 10*16\r
-    je      .3\r
-    cmp     esi, 12*16\r
-    je      .2\r
-    cmp     esi, 14*16\r
-    je      .1\r
-    mov     rax, -1\r
-    jmp     .4\r
-\r
-.1: ff_rnd  r9, r10, r11, r12, 13\r
-    ff_rnd  r9, r10, r11, r12, 12\r
-.2: ff_rnd  r9, r10, r11, r12, 11\r
-    ff_rnd  r9, r10, r11, r12, 10\r
-.3: ff_rnd  r9, r10, r11, r12, 9\r
-    ff_rnd  r9, r10, r11, r12, 8\r
-    ff_rnd  r9, r10, r11, r12, 7\r
-    ff_rnd  r9, r10, r11, r12, 6\r
-    ff_rnd  r9, r10, r11, r12, 5\r
-    ff_rnd  r9, r10, r11, r12, 4\r
-    ff_rnd  r9, r10, r11, r12, 3\r
-    ff_rnd  r9, r10, r11, r12, 2\r
-    ff_rnd  r9, r10, r11, r12, 1\r
-    fl_rnd  r9, r10, r11, r12, 0\r
-\r
-    mov     rbx, [rsp]\r
-    mov     [rbx], r9d\r
-    mov     [rbx+4], r10d\r
-    mov     [rbx+8], r11d\r
-    mov     [rbx+12], r12d\r
-    xor     rax, rax\r
-.4:\r
-    mov     rbx, [rsp+1*8]\r
-    mov     rbp, [rsp+2*8]\r
-    mov     r12, [rsp+3*8]\r
-%ifndef WIN32\r
-    add     rsp, 4*8\r
-%else\r
-    mov     rsi, [rsp+4*8]\r
-    mov     rdi, [rsp+5*8]\r
-    add     rsp, 6*8\r
-%endif\r
-    ret\r
-\r
-%endif\r
-\r
-%ifdef DECRYPTION\r
-\r
-    global  aes_decrypt\r
-%ifdef DLL_EXPORT\r
-    export  aes_decrypt\r
-%endif\r
-\r
-    section .data align=64\r
-    align   64\r
-dec_tab:\r
-    dec_vals v8\r
-%ifdef LAST_ROUND_TABLES\r
-    dec_vals w8\r
-%endif\r
-\r
-    section .text align=16\r
-    align   16\r
-aes_decrypt:\r
-\r
-%ifndef WIN32\r
-    sub     rsp, 4*8        ; gnu/linux binary interface\r
-    mov     [rsp+0*8], rsi  ; output pointer\r
-    mov     r8, rdx         ; context\r
-%else\r
-    sub     rsp, 6*8        ; windows binary interface\r
-    mov     [rsp+4*8], rsi\r
-    mov     [rsp+5*8], rdi\r
-    mov     [rsp+0*8], rdx  ; output pointer\r
-    mov     rdi, rcx        ; input pointer\r
-%endif\r
-    mov     [rsp+1*8], rbx  ; input pointer in rdi\r
-    mov     [rsp+2*8], rbp  ; output pointer in [rsp]\r
-    mov     [rsp+3*8], r12  ; context in r8\r
-\r
-    movzx   esi,byte[kptr+4*KS_LENGTH]\r
-    lea     tptr,[dec_tab wrt rip]\r
-    sub     kptr, rofs\r
-\r
-    mov     eax, [rdi+0*4]\r
-    mov     ebx, [rdi+1*4]\r
-    mov     ecx, [rdi+2*4]\r
-    mov     edx, [rdi+3*4]\r
-\r
-%ifdef      AES_REV_DKS\r
-    mov     rdi, kptr\r
-    lea     kptr,[kptr+rsi]\r
-%else\r
-    lea     rdi,[kptr+rsi]\r
-%endif\r
-\r
-    xor     eax, [rdi+rofs]\r
-    xor     ebx, [rdi+rofs+4]\r
-    xor     ecx, [rdi+rofs+8]\r
-    xor     edx, [rdi+rofs+12]\r
-\r
-    cmp     esi, 10*16\r
-    je      .3\r
-    cmp     esi, 12*16\r
-    je      .2\r
-    cmp     esi, 14*16\r
-    je      .1\r
-    mov     rax, -1\r
-    jmp     .4\r
-\r
-.1: ii_rnd  r9, r10, r11, r12, 13\r
-    ii_rnd  r9, r10, r11, r12, 12\r
-.2: ii_rnd  r9, r10, r11, r12, 11\r
-    ii_rnd  r9, r10, r11, r12, 10\r
-.3: ii_rnd  r9, r10, r11, r12, 9\r
-    ii_rnd  r9, r10, r11, r12, 8\r
-    ii_rnd  r9, r10, r11, r12, 7\r
-    ii_rnd  r9, r10, r11, r12, 6\r
-    ii_rnd  r9, r10, r11, r12, 5\r
-    ii_rnd  r9, r10, r11, r12, 4\r
-    ii_rnd  r9, r10, r11, r12, 3\r
-    ii_rnd  r9, r10, r11, r12, 2\r
-    ii_rnd  r9, r10, r11, r12, 1\r
-    il_rnd  r9, r10, r11, r12, 0\r
-\r
-    mov     rbx, [rsp]\r
-    mov     [rbx], r9d\r
-    mov     [rbx+4], r10d\r
-    mov     [rbx+8], r11d\r
-    mov     [rbx+12], r12d\r
-    xor     rax, rax\r
-.4: mov     rbx, [rsp+1*8]\r
-    mov     rbp, [rsp+2*8]\r
-    mov     r12, [rsp+3*8]\r
-%ifndef WIN32\r
-    add     rsp, 4*8\r
-%else\r
-    mov     rsi, [rsp+4*8]\r
-    mov     rdi, [rsp+5*8]\r
-    add     rsp, 6*8\r
-%endif\r
-    ret\r
-\r
-%endif\r
-\r
-    end\r
-\r
-%ifidn __OUTPUT_FORMAT__,elf\r
-section .note.GNU-stack noalloc noexec nowrite progbits\r
-%endif\r
diff --git a/lib/silccrypt/blowfish.c b/lib/silccrypt/blowfish.c
deleted file mode 100644 (file)
index c1b11b2..0000000
+++ /dev/null
@@ -1,544 +0,0 @@
-/*
- * This implementation was taken from the International Kernel (kerneli)
- * patch for Linux kernel. The author is unknown to me. This
- * implementation is under the same license as it is in the kerneli patch.
- * I've modified it a bit to fit to SILC. -Pekka
- */
-/*
- * blowfish.c
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish, dis-
- * tribute, sublicense, and/or sell copies of the Software, and to permit
- * persons to whom the Software is furnished to do so, subject to the fol-
- * lowing conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL-
- * ITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT
- * SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABIL-
- * ITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
- * IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name of the authors shall
- * not be used in advertising or otherwise to promote the sale, use or
- * other dealings in this Software without prior written authorization from
- * the authors.
- *
- */
-
-#include "silc.h"
-#include "blowfish_internal.h"
-#include "blowfish.h"
-
-/*
- * SILC Crypto API for Blowfish
- */
-
-/* Sets the key for the cipher. */
-
-SILC_CIPHER_API_SET_KEY(blowfish_cbc)
-{
-  blowfish_set_key((BlowfishContext *)context, (unsigned char *)key, keylen);
-  return TRUE;
-}
-
-/* Sets IV for the cipher. */
-
-SILC_CIPHER_API_SET_IV(blowfish_cbc)
-{
-
-}
-
-/* Returns the size of the cipher context. */
-
-SILC_CIPHER_API_CONTEXT_LEN(blowfish_cbc)
-{
-  return sizeof(BlowfishContext);
-}
-
-/* Encrypts with the cipher in CBC mode. Source and destination buffers
-   maybe one and same. */
-
-SILC_CIPHER_API_ENCRYPT(blowfish_cbc)
-{
-  SilcUInt32 tiv[4];
-  int i;
-
-  SILC_CBC_GET_IV(tiv, iv);
-
-  SILC_CBC_ENC_PRE(tiv, src);
-  blowfish_encrypt((BlowfishContext *)context, tiv, tiv, 16);
-  SILC_CBC_ENC_POST(tiv, dst, src);
-
-  for (i = 16; i < len; i += 16) {
-    SILC_CBC_ENC_PRE(tiv, src);
-    blowfish_encrypt((BlowfishContext *)context, tiv, tiv, 16);
-    SILC_CBC_ENC_POST(tiv, dst, src);
-  }
-
-  SILC_CBC_PUT_IV(tiv, iv);
-
-  return TRUE;
-}
-
-/* Decrypts with the cipher in CBC mode. Source and destination buffers
-   maybe one and same. */
-
-SILC_CIPHER_API_DECRYPT(blowfish_cbc)
-{
-  SilcUInt32 tmp[4], tmp2[4], tiv[4];
-  int i;
-
-  SILC_CBC_GET_IV(tiv, iv);
-
-  SILC_CBC_DEC_PRE(tmp, src);
-  blowfish_decrypt((BlowfishContext *)context, tmp, tmp2, 16);
-  SILC_CBC_DEC_POST(tmp2, dst, src, tmp, tiv);
-
-  for (i = 16; i < len; i += 16) {
-    SILC_CBC_DEC_PRE(tmp, src);
-    blowfish_decrypt((BlowfishContext *)context, tmp, tmp2, 16);
-    SILC_CBC_DEC_POST(tmp2, dst, src, tmp, tiv);
-  }
-
-  SILC_CBC_PUT_IV(tiv, iv);
-
-  return TRUE;
-}
-
-static u32 bf_pbox[16 + 2] =
-{
-    0x243f6a88, 0x85a308d3, 0x13198a2e, 0x03707344,
-    0xa4093822, 0x299f31d0, 0x082efa98, 0xec4e6c89,
-    0x452821e6, 0x38d01377, 0xbe5466cf, 0x34e90c6c,
-    0xc0ac29b7, 0xc97c50dd, 0x3f84d5b5, 0xb5470917,
-    0x9216d5d9, 0x8979fb1b,
-};
-
-static u32 bf_sbox[256 * 4] =
-{
-    0xd1310ba6, 0x98dfb5ac, 0x2ffd72db, 0xd01adfb7,
-    0xb8e1afed, 0x6a267e96, 0xba7c9045, 0xf12c7f99,
-    0x24a19947, 0xb3916cf7, 0x0801f2e2, 0x858efc16,
-    0x636920d8, 0x71574e69, 0xa458fea3, 0xf4933d7e,
-    0x0d95748f, 0x728eb658, 0x718bcd58, 0x82154aee,
-    0x7b54a41d, 0xc25a59b5, 0x9c30d539, 0x2af26013,
-    0xc5d1b023, 0x286085f0, 0xca417918, 0xb8db38ef,
-    0x8e79dcb0, 0x603a180e, 0x6c9e0e8b, 0xb01e8a3e,
-    0xd71577c1, 0xbd314b27, 0x78af2fda, 0x55605c60,
-    0xe65525f3, 0xaa55ab94, 0x57489862, 0x63e81440,
-    0x55ca396a, 0x2aab10b6, 0xb4cc5c34, 0x1141e8ce,
-    0xa15486af, 0x7c72e993, 0xb3ee1411, 0x636fbc2a,
-    0x2ba9c55d, 0x741831f6, 0xce5c3e16, 0x9b87931e,
-    0xafd6ba33, 0x6c24cf5c, 0x7a325381, 0x28958677,
-    0x3b8f4898, 0x6b4bb9af, 0xc4bfe81b, 0x66282193,
-    0x61d809cc, 0xfb21a991, 0x487cac60, 0x5dec8032,
-    0xef845d5d, 0xe98575b1, 0xdc262302, 0xeb651b88,
-    0x23893e81, 0xd396acc5, 0x0f6d6ff3, 0x83f44239,
-    0x2e0b4482, 0xa4842004, 0x69c8f04a, 0x9e1f9b5e,
-    0x21c66842, 0xf6e96c9a, 0x670c9c61, 0xabd388f0,
-    0x6a51a0d2, 0xd8542f68, 0x960fa728, 0xab5133a3,
-    0x6eef0b6c, 0x137a3be4, 0xba3bf050, 0x7efb2a98,
-    0xa1f1651d, 0x39af0176, 0x66ca593e, 0x82430e88,
-    0x8cee8619, 0x456f9fb4, 0x7d84a5c3, 0x3b8b5ebe,
-    0xe06f75d8, 0x85c12073, 0x401a449f, 0x56c16aa6,
-    0x4ed3aa62, 0x363f7706, 0x1bfedf72, 0x429b023d,
-    0x37d0d724, 0xd00a1248, 0xdb0fead3, 0x49f1c09b,
-    0x075372c9, 0x80991b7b, 0x25d479d8, 0xf6e8def7,
-    0xe3fe501a, 0xb6794c3b, 0x976ce0bd, 0x04c006ba,
-    0xc1a94fb6, 0x409f60c4, 0x5e5c9ec2, 0x196a2463,
-    0x68fb6faf, 0x3e6c53b5, 0x1339b2eb, 0x3b52ec6f,
-    0x6dfc511f, 0x9b30952c, 0xcc814544, 0xaf5ebd09,
-    0xbee3d004, 0xde334afd, 0x660f2807, 0x192e4bb3,
-    0xc0cba857, 0x45c8740f, 0xd20b5f39, 0xb9d3fbdb,
-    0x5579c0bd, 0x1a60320a, 0xd6a100c6, 0x402c7279,
-    0x679f25fe, 0xfb1fa3cc, 0x8ea5e9f8, 0xdb3222f8,
-    0x3c7516df, 0xfd616b15, 0x2f501ec8, 0xad0552ab,
-    0x323db5fa, 0xfd238760, 0x53317b48, 0x3e00df82,
-    0x9e5c57bb, 0xca6f8ca0, 0x1a87562e, 0xdf1769db,
-    0xd542a8f6, 0x287effc3, 0xac6732c6, 0x8c4f5573,
-    0x695b27b0, 0xbbca58c8, 0xe1ffa35d, 0xb8f011a0,
-    0x10fa3d98, 0xfd2183b8, 0x4afcb56c, 0x2dd1d35b,
-    0x9a53e479, 0xb6f84565, 0xd28e49bc, 0x4bfb9790,
-    0xe1ddf2da, 0xa4cb7e33, 0x62fb1341, 0xcee4c6e8,
-    0xef20cada, 0x36774c01, 0xd07e9efe, 0x2bf11fb4,
-    0x95dbda4d, 0xae909198, 0xeaad8e71, 0x6b93d5a0,
-    0xd08ed1d0, 0xafc725e0, 0x8e3c5b2f, 0x8e7594b7,
-    0x8ff6e2fb, 0xf2122b64, 0x8888b812, 0x900df01c,
-    0x4fad5ea0, 0x688fc31c, 0xd1cff191, 0xb3a8c1ad,
-    0x2f2f2218, 0xbe0e1777, 0xea752dfe, 0x8b021fa1,
-    0xe5a0cc0f, 0xb56f74e8, 0x18acf3d6, 0xce89e299,
-    0xb4a84fe0, 0xfd13e0b7, 0x7cc43b81, 0xd2ada8d9,
-    0x165fa266, 0x80957705, 0x93cc7314, 0x211a1477,
-    0xe6ad2065, 0x77b5fa86, 0xc75442f5, 0xfb9d35cf,
-    0xebcdaf0c, 0x7b3e89a0, 0xd6411bd3, 0xae1e7e49,
-    0x00250e2d, 0x2071b35e, 0x226800bb, 0x57b8e0af,
-    0x2464369b, 0xf009b91e, 0x5563911d, 0x59dfa6aa,
-    0x78c14389, 0xd95a537f, 0x207d5ba2, 0x02e5b9c5,
-    0x83260376, 0x6295cfa9, 0x11c81968, 0x4e734a41,
-    0xb3472dca, 0x7b14a94a, 0x1b510052, 0x9a532915,
-    0xd60f573f, 0xbc9bc6e4, 0x2b60a476, 0x81e67400,
-    0x08ba6fb5, 0x571be91f, 0xf296ec6b, 0x2a0dd915,
-    0xb6636521, 0xe7b9f9b6, 0xff34052e, 0xc5855664,
-    0x53b02d5d, 0xa99f8fa1, 0x08ba4799, 0x6e85076a,
-    0x4b7a70e9, 0xb5b32944, 0xdb75092e, 0xc4192623,
-    0xad6ea6b0, 0x49a7df7d, 0x9cee60b8, 0x8fedb266,
-    0xecaa8c71, 0x699a17ff, 0x5664526c, 0xc2b19ee1,
-    0x193602a5, 0x75094c29, 0xa0591340, 0xe4183a3e,
-    0x3f54989a, 0x5b429d65, 0x6b8fe4d6, 0x99f73fd6,
-    0xa1d29c07, 0xefe830f5, 0x4d2d38e6, 0xf0255dc1,
-    0x4cdd2086, 0x8470eb26, 0x6382e9c6, 0x021ecc5e,
-    0x09686b3f, 0x3ebaefc9, 0x3c971814, 0x6b6a70a1,
-    0x687f3584, 0x52a0e286, 0xb79c5305, 0xaa500737,
-    0x3e07841c, 0x7fdeae5c, 0x8e7d44ec, 0x5716f2b8,
-    0xb03ada37, 0xf0500c0d, 0xf01c1f04, 0x0200b3ff,
-    0xae0cf51a, 0x3cb574b2, 0x25837a58, 0xdc0921bd,
-    0xd19113f9, 0x7ca92ff6, 0x94324773, 0x22f54701,
-    0x3ae5e581, 0x37c2dadc, 0xc8b57634, 0x9af3dda7,
-    0xa9446146, 0x0fd0030e, 0xecc8c73e, 0xa4751e41,
-    0xe238cd99, 0x3bea0e2f, 0x3280bba1, 0x183eb331,
-    0x4e548b38, 0x4f6db908, 0x6f420d03, 0xf60a04bf,
-    0x2cb81290, 0x24977c79, 0x5679b072, 0xbcaf89af,
-    0xde9a771f, 0xd9930810, 0xb38bae12, 0xdccf3f2e,
-    0x5512721f, 0x2e6b7124, 0x501adde6, 0x9f84cd87,
-    0x7a584718, 0x7408da17, 0xbc9f9abc, 0xe94b7d8c,
-    0xec7aec3a, 0xdb851dfa, 0x63094366, 0xc464c3d2,
-    0xef1c1847, 0x3215d908, 0xdd433b37, 0x24c2ba16,
-    0x12a14d43, 0x2a65c451, 0x50940002, 0x133ae4dd,
-    0x71dff89e, 0x10314e55, 0x81ac77d6, 0x5f11199b,
-    0x043556f1, 0xd7a3c76b, 0x3c11183b, 0x5924a509,
-    0xf28fe6ed, 0x97f1fbfa, 0x9ebabf2c, 0x1e153c6e,
-    0x86e34570, 0xeae96fb1, 0x860e5e0a, 0x5a3e2ab3,
-    0x771fe71c, 0x4e3d06fa, 0x2965dcb9, 0x99e71d0f,
-    0x803e89d6, 0x5266c825, 0x2e4cc978, 0x9c10b36a,
-    0xc6150eba, 0x94e2ea78, 0xa5fc3c53, 0x1e0a2df4,
-    0xf2f74ea7, 0x361d2b3d, 0x1939260f, 0x19c27960,
-    0x5223a708, 0xf71312b6, 0xebadfe6e, 0xeac31f66,
-    0xe3bc4595, 0xa67bc883, 0xb17f37d1, 0x018cff28,
-    0xc332ddef, 0xbe6c5aa5, 0x65582185, 0x68ab9802,
-    0xeecea50f, 0xdb2f953b, 0x2aef7dad, 0x5b6e2f84,
-    0x1521b628, 0x29076170, 0xecdd4775, 0x619f1510,
-    0x13cca830, 0xeb61bd96, 0x0334fe1e, 0xaa0363cf,
-    0xb5735c90, 0x4c70a239, 0xd59e9e0b, 0xcbaade14,
-    0xeecc86bc, 0x60622ca7, 0x9cab5cab, 0xb2f3846e,
-    0x648b1eaf, 0x19bdf0ca, 0xa02369b9, 0x655abb50,
-    0x40685a32, 0x3c2ab4b3, 0x319ee9d5, 0xc021b8f7,
-    0x9b540b19, 0x875fa099, 0x95f7997e, 0x623d7da8,
-    0xf837889a, 0x97e32d77, 0x11ed935f, 0x16681281,
-    0x0e358829, 0xc7e61fd6, 0x96dedfa1, 0x7858ba99,
-    0x57f584a5, 0x1b227263, 0x9b83c3ff, 0x1ac24696,
-    0xcdb30aeb, 0x532e3054, 0x8fd948e4, 0x6dbc3128,
-    0x58ebf2ef, 0x34c6ffea, 0xfe28ed61, 0xee7c3c73,
-    0x5d4a14d9, 0xe864b7e3, 0x42105d14, 0x203e13e0,
-    0x45eee2b6, 0xa3aaabea, 0xdb6c4f15, 0xfacb4fd0,
-    0xc742f442, 0xef6abbb5, 0x654f3b1d, 0x41cd2105,
-    0xd81e799e, 0x86854dc7, 0xe44b476a, 0x3d816250,
-    0xcf62a1f2, 0x5b8d2646, 0xfc8883a0, 0xc1c7b6a3,
-    0x7f1524c3, 0x69cb7492, 0x47848a0b, 0x5692b285,
-    0x095bbf00, 0xad19489d, 0x1462b174, 0x23820e00,
-    0x58428d2a, 0x0c55f5ea, 0x1dadf43e, 0x233f7061,
-    0x3372f092, 0x8d937e41, 0xd65fecf1, 0x6c223bdb,
-    0x7cde3759, 0xcbee7460, 0x4085f2a7, 0xce77326e,
-    0xa6078084, 0x19f8509e, 0xe8efd855, 0x61d99735,
-    0xa969a7aa, 0xc50c06c2, 0x5a04abfc, 0x800bcadc,
-    0x9e447a2e, 0xc3453484, 0xfdd56705, 0x0e1e9ec9,
-    0xdb73dbd3, 0x105588cd, 0x675fda79, 0xe3674340,
-    0xc5c43465, 0x713e38d8, 0x3d28f89e, 0xf16dff20,
-    0x153e21e7, 0x8fb03d4a, 0xe6e39f2b, 0xdb83adf7,
-    0xe93d5a68, 0x948140f7, 0xf64c261c, 0x94692934,
-    0x411520f7, 0x7602d4f7, 0xbcf46b2e, 0xd4a20068,
-    0xd4082471, 0x3320f46a, 0x43b7d4b7, 0x500061af,
-    0x1e39f62e, 0x97244546, 0x14214f74, 0xbf8b8840,
-    0x4d95fc1d, 0x96b591af, 0x70f4ddd3, 0x66a02f45,
-    0xbfbc09ec, 0x03bd9785, 0x7fac6dd0, 0x31cb8504,
-    0x96eb27b3, 0x55fd3941, 0xda2547e6, 0xabca0a9a,
-    0x28507825, 0x530429f4, 0x0a2c86da, 0xe9b66dfb,
-    0x68dc1462, 0xd7486900, 0x680ec0a4, 0x27a18dee,
-    0x4f3ffea2, 0xe887ad8c, 0xb58ce006, 0x7af4d6b6,
-    0xaace1e7c, 0xd3375fec, 0xce78a399, 0x406b2a42,
-    0x20fe9e35, 0xd9f385b9, 0xee39d7ab, 0x3b124e8b,
-    0x1dc9faf7, 0x4b6d1856, 0x26a36631, 0xeae397b2,
-    0x3a6efa74, 0xdd5b4332, 0x6841e7f7, 0xca7820fb,
-    0xfb0af54e, 0xd8feb397, 0x454056ac, 0xba489527,
-    0x55533a3a, 0x20838d87, 0xfe6ba9b7, 0xd096954b,
-    0x55a867bc, 0xa1159a58, 0xcca92963, 0x99e1db33,
-    0xa62a4a56, 0x3f3125f9, 0x5ef47e1c, 0x9029317c,
-    0xfdf8e802, 0x04272f70, 0x80bb155c, 0x05282ce3,
-    0x95c11548, 0xe4c66d22, 0x48c1133f, 0xc70f86dc,
-    0x07f9c9ee, 0x41041f0f, 0x404779a4, 0x5d886e17,
-    0x325f51eb, 0xd59bc0d1, 0xf2bcc18f, 0x41113564,
-    0x257b7834, 0x602a9c60, 0xdff8e8a3, 0x1f636c1b,
-    0x0e12b4c2, 0x02e1329e, 0xaf664fd1, 0xcad18115,
-    0x6b2395e0, 0x333e92e1, 0x3b240b62, 0xeebeb922,
-    0x85b2a20e, 0xe6ba0d99, 0xde720c8c, 0x2da2f728,
-    0xd0127845, 0x95b794fd, 0x647d0862, 0xe7ccf5f0,
-    0x5449a36f, 0x877d48fa, 0xc39dfd27, 0xf33e8d1e,
-    0x0a476341, 0x992eff74, 0x3a6f6eab, 0xf4f8fd37,
-    0xa812dc60, 0xa1ebddf8, 0x991be14c, 0xdb6e6b0d,
-    0xc67b5510, 0x6d672c37, 0x2765d43b, 0xdcd0e804,
-    0xf1290dc7, 0xcc00ffa3, 0xb5390f92, 0x690fed0b,
-    0x667b9ffb, 0xcedb7d9c, 0xa091cf0b, 0xd9155ea3,
-    0xbb132f88, 0x515bad24, 0x7b9479bf, 0x763bd6eb,
-    0x37392eb3, 0xcc115979, 0x8026e297, 0xf42e312d,
-    0x6842ada7, 0xc66a2b3b, 0x12754ccc, 0x782ef11c,
-    0x6a124237, 0xb79251e7, 0x06a1bbe6, 0x4bfb6350,
-    0x1a6b1018, 0x11caedfa, 0x3d25bdd8, 0xe2e1c3c9,
-    0x44421659, 0x0a121386, 0xd90cec6e, 0xd5abea2a,
-    0x64af674e, 0xda86a85f, 0xbebfe988, 0x64e4c3fe,
-    0x9dbc8057, 0xf0f7c086, 0x60787bf8, 0x6003604d,
-    0xd1fd8346, 0xf6381fb0, 0x7745ae04, 0xd736fccc,
-    0x83426b33, 0xf01eab71, 0xb0804187, 0x3c005e5f,
-    0x77a057be, 0xbde8ae24, 0x55464299, 0xbf582e61,
-    0x4e58f48f, 0xf2ddfda2, 0xf474ef38, 0x8789bdc2,
-    0x5366f9c3, 0xc8b38e74, 0xb475f255, 0x46fcd9b9,
-    0x7aeb2661, 0x8b1ddf84, 0x846a0e79, 0x915f95e2,
-    0x466e598e, 0x20b45770, 0x8cd55591, 0xc902de4c,
-    0xb90bace1, 0xbb8205d0, 0x11a86248, 0x7574a99e,
-    0xb77f19b6, 0xe0a9dc09, 0x662d09a1, 0xc4324633,
-    0xe85a1f02, 0x09f0be8c, 0x4a99a025, 0x1d6efe10,
-    0x1ab93d1d, 0x0ba5a4df, 0xa186f20f, 0x2868f169,
-    0xdcb7da83, 0x573906fe, 0xa1e2ce9b, 0x4fcd7f52,
-    0x50115e01, 0xa70683fa, 0xa002b5c4, 0x0de6d027,
-    0x9af88c27, 0x773f8641, 0xc3604c06, 0x61a806b5,
-    0xf0177a28, 0xc0f586e0, 0x006058aa, 0x30dc7d62,
-    0x11e69ed7, 0x2338ea63, 0x53c2dd94, 0xc2c21634,
-    0xbbcbee56, 0x90bcb6de, 0xebfc7da1, 0xce591d76,
-    0x6f05e409, 0x4b7c0188, 0x39720a3d, 0x7c927c24,
-    0x86e3725f, 0x724d9db9, 0x1ac15bb4, 0xd39eb8fc,
-    0xed545578, 0x08fca5b5, 0xd83d7cd3, 0x4dad0fc4,
-    0x1e50ef5e, 0xb161e6f8, 0xa28514d9, 0x6c51133c,
-    0x6fd5c7e7, 0x56e14ec4, 0x362abfce, 0xddc6c837,
-    0xd79a3234, 0x92638212, 0x670efa8e, 0x406000e0,
-    0x3a39ce37, 0xd3faf5cf, 0xabc27737, 0x5ac52d1b,
-    0x5cb0679e, 0x4fa33742, 0xd3822740, 0x99bc9bbe,
-    0xd5118e9d, 0xbf0f7315, 0xd62d1c7e, 0xc700c47b,
-    0xb78c1b6b, 0x21a19045, 0xb26eb1be, 0x6a366eb4,
-    0x5748ab2f, 0xbc946e79, 0xc6a376d2, 0x6549c2c8,
-    0x530ff8ee, 0x468dde7d, 0xd5730a1d, 0x4cd04dc6,
-    0x2939bbdb, 0xa9ba4650, 0xac9526e8, 0xbe5ee304,
-    0xa1fad5f0, 0x6a2d519a, 0x63ef8ce2, 0x9a86ee22,
-    0xc089c2b8, 0x43242ef6, 0xa51e03aa, 0x9cf2d0a4,
-    0x83c061ba, 0x9be96a4d, 0x8fe51550, 0xba645bd6,
-    0x2826a2f9, 0xa73a3ae1, 0x4ba99586, 0xef5562e9,
-    0xc72fefd3, 0xf752f7da, 0x3f046f69, 0x77fa0a59,
-    0x80e4a915, 0x87b08601, 0x9b09e6ad, 0x3b3ee593,
-    0xe990fd5a, 0x9e34d797, 0x2cf0b7d9, 0x022b8b51,
-    0x96d5ac3a, 0x017da67d, 0xd1cf3ed6, 0x7c7d2d28,
-    0x1f9f25cf, 0xadf2b89b, 0x5ad6b472, 0x5a88f54c,
-    0xe029ac71, 0xe019a5e6, 0x47b0acfd, 0xed93fa9b,
-    0xe8d3c48d, 0x283b57cc, 0xf8d56629, 0x79132e28,
-    0x785f0191, 0xed756055, 0xf7960e44, 0xe3d35e8c,
-    0x15056dd4, 0x88f46dba, 0x03a16125, 0x0564f0bd,
-    0xc3eb9e15, 0x3c9057a2, 0x97271aec, 0xa93a072a,
-    0x1b3f6d9b, 0x1e6321f5, 0xf59c66fb, 0x26dcf319,
-    0x7533d928, 0xb155fdf5, 0x03563482, 0x8aba3cbb,
-    0x28517711, 0xc20ad9f8, 0xabcc5167, 0xccad925f,
-    0x4de81751, 0x3830dc8e, 0x379d5862, 0x9320f991,
-    0xea7a90c2, 0xfb3e7bce, 0x5121ce64, 0x774fbe32,
-    0xa8b6e37e, 0xc3293d46, 0x48de5369, 0x6413e680,
-    0xa2ae0810, 0xdd6db224, 0x69852dfd, 0x09072166,
-    0xb39a460a, 0x6445c0dd, 0x586cdecf, 0x1c20c8ae,
-    0x5bbef7dd, 0x1b588d40, 0xccd2017f, 0x6bb4e3bb,
-    0xdda26a7e, 0x3a59ff45, 0x3e350a44, 0xbcb4cdd5,
-    0x72eacea8, 0xfa6484bb, 0x8d6612ae, 0xbf3c6f47,
-    0xd29be463, 0x542f5d9e, 0xaec2771b, 0xf64e6370,
-    0x740e0d8d, 0xe75b1357, 0xf8721671, 0xaf537d5d,
-    0x4040cb08, 0x4eb4e2cc, 0x34d2466a, 0x0115af84,
-    0xe1b00428, 0x95983a1d, 0x06b89fb4, 0xce6ea048,
-    0x6f3f3b82, 0x3520ab82, 0x011a1d4b, 0x277227f8,
-    0x611560b1, 0xe7933fdc, 0xbb3a792b, 0x344525bd,
-    0xa08839e1, 0x51ce794b, 0x2f32c9b7, 0xa01fbac9,
-    0xe01cc87e, 0xbcc7d1f6, 0xcf0111c3, 0xa1e8aac7,
-    0x1a908749, 0xd44fbd9a, 0xd0dadecb, 0xd50ada38,
-    0x0339c32a, 0xc6913667, 0x8df9317c, 0xe0b12b4f,
-    0xf79e59b7, 0x43f5bb3a, 0xf2d519ff, 0x27d9459c,
-    0xbf97222c, 0x15e6fc2a, 0x0f91fc71, 0x9b941525,
-    0xfae59361, 0xceb69ceb, 0xc2a86459, 0x12baa8d1,
-    0xb6c1075e, 0xe3056a0c, 0x10d25065, 0xcb03a442,
-    0xe0ec6e0e, 0x1698db3b, 0x4c98a0be, 0x3278e964,
-    0x9f1f9532, 0xe0d392df, 0xd3a0342b, 0x8971f21e,
-    0x1b0a7441, 0x4ba3348c, 0xc5be7120, 0xc37632d8,
-    0xdf359f8d, 0x9b992f2e, 0xe60b6f47, 0x0fe3f11d,
-    0xe54cda54, 0x1edad891, 0xce6279cf, 0xcd3e7e6f,
-    0x1618b166, 0xfd2c1d05, 0x848fd2c5, 0xf6fb2299,
-    0xf523f357, 0xa6327623, 0x93a83531, 0x56cccd02,
-    0xacf08162, 0x5a75ebb5, 0x6e163697, 0x88d273cc,
-    0xde966292, 0x81b949d0, 0x4c50901b, 0x71c65614,
-    0xe6c6c7bd, 0x327a140a, 0x45e1d006, 0xc3f27b9a,
-    0xc9aa53fd, 0x62a80f00, 0xbb25bfe2, 0x35bdd2f6,
-    0x71126905, 0xb2040222, 0xb6cbcf7c, 0xcd769c2b,
-    0x53113ec0, 0x1640e3d3, 0x38abbd60, 0x2547adf0,
-    0xba38209c, 0xf746ce76, 0x77afa1c5, 0x20756060,
-    0x85cbfe4e, 0x8ae88dd8, 0x7aaaf9b0, 0x4cf9aa7e,
-    0x1948c25c, 0x02fb8a8c, 0x01c36ae4, 0xd6ebe1f9,
-    0x90d4f869, 0xa65cdea0, 0x3f09252d, 0xc208e69f,
-    0xb74e6132, 0xce77e25b, 0x578fdfe3, 0x3ac372e6,
-};
-
-/*
- * Round loop unrolling macros, S is a pointer to a S-Box array
- * organized in 4 SilcUInt32s at a row.
- */
-
-#define GET32_3(x) (((x) & 0xff))
-#define GET32_2(x) (((x) >> (8)) & (0xff))
-#define GET32_1(x) (((x) >> (16)) & (0xff))
-#define GET32_0(x) (((x) >> (24)) & (0xff))
-
-#define bf_F(x) (((S[GET32_0(x)] + S[256 + GET32_1(x)]) ^ \
-          S[512 + GET32_2(x)]) + S[768 + GET32_3(x)])
-
-#define ROUND(a, b, n) b^=P[n];a ^= bf_F(b)
-
-/*
- * The blowfish encipher, processes 64-bit blocks.
- * NOTE: This function MUSTN'T respect endianess
- */
-
-int blowfish_encrypt(BlowfishContext *ctx,
-                    u32 *in_blk, u32 *out_blk, int size)
-{
-    u32 yl,yr;
-
-    u32 *P = ctx->P;
-    u32 *S = ctx->S;
-
-    for (; size >= 8; size -= 8) {
-        yl = *(in_blk++);
-        yr = *(in_blk++);
-
-        ROUND(yr, yl, 0);
-        ROUND(yl, yr, 1);
-        ROUND(yr, yl, 2);
-        ROUND(yl, yr, 3);
-        ROUND(yr, yl, 4);
-        ROUND(yl, yr, 5);
-        ROUND(yr, yl, 6);
-        ROUND(yl, yr, 7);
-        ROUND(yr, yl, 8);
-        ROUND(yl, yr, 9);
-        ROUND(yr, yl, 10);
-        ROUND(yl, yr, 11);
-        ROUND(yr, yl, 12);
-        ROUND(yl, yr, 13);
-        ROUND(yr, yl, 14);
-        ROUND(yl, yr, 15);
-
-       /* yl and yr are switched */
-       yl ^= P[16];
-       yr ^= P[17];
-
-        *(out_blk++) = yr;
-        *(out_blk++) = yl;
-    }
-
-    return 0;
-}
-
-int blowfish_decrypt(BlowfishContext *ctx,
-                    u32 *in_blk, u32 *out_blk, int size)
-{
-    u32 yl,yr;
-
-    u32 *P = ctx->P;
-    u32 *S = ctx->S;
-
-    for (; size >= 8; size -= 8) {
-        yl = *(in_blk++);
-        yr = *(in_blk++);
-
-        ROUND(yr, yl, 17);
-        ROUND(yl, yr, 16);
-        ROUND(yr, yl, 15);
-        ROUND(yl, yr, 14);
-        ROUND(yr, yl, 13);
-        ROUND(yl, yr, 12);
-        ROUND(yr, yl, 11);
-        ROUND(yl, yr, 10);
-        ROUND(yr, yl, 9);
-        ROUND(yl, yr, 8);
-        ROUND(yr, yl, 7);
-        ROUND(yl, yr, 6);
-        ROUND(yr, yl, 5);
-        ROUND(yl, yr, 4);
-        ROUND(yr, yl, 3);
-        ROUND(yl, yr, 2);
-
-       /* yl and yr are switched */
-       yl ^= P[1];
-       yr ^= P[0];
-
-        *(out_blk++) = yr;
-        *(out_blk++) = yl;
-    }
-
-    return 0;
-}
-
-/* Sets the blowfish S and P boxes for encryption and decryption. */
-
-int blowfish_set_key(BlowfishContext *ctx,
-                    unsigned char *key, int keybytes)
-{
-    short i;
-    short j;
-    short count;
-    u32 data[2];
-    u32 temp;
-    u32 *P = ctx->P;
-    u32 *S = ctx->S;
-
-    /* Copy the initialization s-boxes */
-
-    for (i = 0, count = 0; i < 256; i++)
-        for (j = 0; j < 4; j++, count++)
-            S[count] = bf_sbox[count];
-
-    /* Set the p-boxes */
-
-    for (i = 0; i < 16 + 2; i++)
-        P[i] = bf_pbox[i];
-
-    /* Actual subkey generation */
-
-    for (j = 0, i = 0; i < 16 + 2; i++)
-    {
-        temp = (((u32) key[j] << 24) |
-                ((u32) key[(j + 1) % keybytes] << 16) |
-                ((u32) key[(j + 2) % keybytes] << 8) |
-                ((u32) key[(j + 3) % keybytes] ));
-
-        P[i] = P[i] ^ temp;
-        j = (j + 4) % keybytes;
-    }
-
-    data[0] = 0x00000000;
-    data[1] = 0x00000000;
-
-    for (i = 0; i < 16 + 2; i += 2)
-    {
-        blowfish_encrypt(ctx, data, data, 8);
-
-        P[i] = data[0];
-        P[i + 1] = data[1];
-    }
-
-    for (i = 0; i < 4; i++)
-    {
-        for (j = 0, count = i * 256; j < 256; j += 2, count += 2)
-        {
-            blowfish_encrypt(ctx, data, data, 8);
-
-            S[count] = data[0];
-            S[count + 1] = data[1];
-        }
-    }
-    return 0;
-}
diff --git a/lib/silccrypt/blowfish.h b/lib/silccrypt/blowfish.h
deleted file mode 100644 (file)
index 996f7fe..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
-
-  blowfish.h
-
-  Author: Pekka Riikonen <priikone@silcnet.org>
-
-  Copyright (C) 1997 - 2006 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 BLOWFISH_H
-#define BLOWFISH_H
-
-/*
- * SILC Crypto API for Blowfish
- */
-
-SILC_CIPHER_API_SET_KEY(blowfish_cbc);
-SILC_CIPHER_API_SET_IV(blowfish_cbc);
-SILC_CIPHER_API_CONTEXT_LEN(blowfish_cbc);
-SILC_CIPHER_API_ENCRYPT(blowfish_cbc);
-SILC_CIPHER_API_DECRYPT(blowfish_cbc);
-
-#endif
diff --git a/lib/silccrypt/blowfish_internal.h b/lib/silccrypt/blowfish_internal.h
deleted file mode 100644 (file)
index 980036f..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
-
-  blowfish_internal.h
-
-  Author: Pekka Riikonen <priikone@silcnet.org>
-
-  Copyright (C) 1997 - 2000 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 BLOWFISH_INTERNAL_H
-#define BLOWFISH_INTERNAL_H
-
-#include "ciphers_def.h"
-
-/* Cipher's context */
-typedef struct blow_key
-{
-    u32 P[18];
-    u32 S[1024];
-} BlowfishContext;
-
-/* Prototypes */
-int blowfish_encrypt(BlowfishContext *ctx, 
-                    u32 *in_blk, u32 *out_blk, int size);
-int blowfish_decrypt(BlowfishContext *ctx, 
-                    u32 *in_blk, u32 *out_blk, int size);
-int blowfish_set_key(BlowfishContext *ctx,
-                    unsigned char *key, int keybytes);
-
-#endif
diff --git a/lib/silccrypt/cast.c b/lib/silccrypt/cast.c
deleted file mode 100644 (file)
index 65b9f1d..0000000
+++ /dev/null
@@ -1,470 +0,0 @@
-/* Modified for SILC. -Pekka */
-
-/* This is an independent implementation of the encryption algorithm:   */
-/*                                                                      */
-/*         CAST-256 by Carlisle Adams of Entrust Tecnhologies           */
-/*                                                                      */
-/* which is a candidate algorithm in the Advanced Encryption Standard   */
-/* programme of the US National Institute of Standards and Technology.  */
-/*                                                                      */
-/* Copyright in this implementation is held by Dr B R Gladman but I     */
-/* hereby give permission for its free direct or derivative use subject */
-/* to acknowledgment of its origin and compliance with any conditions   */
-/* that the originators of the algorithm place on its exploitation.     */
-/*                                                                      */
-/* Dr Brian Gladman (gladman@seven77.demon.co.uk) 14th January 1999     */
-
-/* Timing data for CAST-256 (cast.c)
-
-Core timing without I/O endian conversion:
-
-128 bit key:
-Key Setup:    4333 cycles
-Encrypt:       633 cycles =    40.4 mbits/sec
-Decrypt:       634 cycles =    40.4 mbits/sec
-Mean:          634 cycles =    40.4 mbits/sec
-
-192 bit key:
-Key Setup:    4342 cycles
-Encrypt:       633 cycles =    40.4 mbits/sec
-Decrypt:       633 cycles =    40.4 mbits/sec
-Mean:          633 cycles =    40.4 mbits/sec
-
-256 bit key:
-Key Setup:    4325 cycles
-Encrypt:       639 cycles =    40.1 mbits/sec
-Decrypt:       638 cycles =    40.1 mbits/sec
-Mean:          639 cycles =    40.1 mbits/sec
-
-Full timing with I/O endian conversion:
-
-128 bit key:
-Key Setup:    4294 cycles
-Encrypt:       678 cycles =    37.8 mbits/sec
-Decrypt:       669 cycles =    38.3 mbits/sec
-Mean:          674 cycles =    38.0 mbits/sec
-
-192 bit key:
-Key Setup:    4314 cycles
-Encrypt:       678 cycles =    37.8 mbits/sec
-Decrypt:       670 cycles =    38.2 mbits/sec
-Mean:          674 cycles =    38.0 mbits/sec
-
-256 bit key:
-Key Setup:    4313 cycles
-Encrypt:       678 cycles =    37.8 mbits/sec
-Decrypt:       669 cycles =    38.3 mbits/sec
-Mean:          674 cycles =    38.0 mbits/sec
-
-*/
-
-#include "silc.h"
-#include "cast_internal.h"
-#include "cast.h"
-
-#define io_swap
-
-/*
- * SILC Crypto API for Cast-256
- */
-
-/* Sets the key for the cipher. */
-
-SILC_CIPHER_API_SET_KEY(cast_cbc)
-{
-  SilcUInt32 k[8];
-
-  SILC_GET_WORD_KEY(key, k, keylen);
-  cast_set_key((CastContext *)context, k, keylen);
-
-  return TRUE;
-}
-
-/* Sets IV for the cipher. */
-
-SILC_CIPHER_API_SET_IV(cast_cbc)
-{
-
-}
-
-/* Returns the size of the cipher context. */
-
-SILC_CIPHER_API_CONTEXT_LEN(cast_cbc)
-{
-  return sizeof(CastContext);
-}
-
-/* Encrypts with the cipher in CBC mode. Source and destination buffers
-   maybe one and same. */
-
-SILC_CIPHER_API_ENCRYPT(cast_cbc)
-{
-  SilcUInt32 tiv[4];
-  int i;
-
-  SILC_ASSERT((len & (16 - 1)) == 0);
-  if (len & (16 - 1))
-    return FALSE;
-
-  SILC_CBC_GET_IV(tiv, iv);
-
-  SILC_CBC_ENC_PRE(tiv, src);
-  cast_encrypt((CastContext *)context, tiv, tiv);
-  SILC_CBC_ENC_POST(tiv, dst, src);
-
-  for (i = 16; i < len; i += 16) {
-    SILC_CBC_ENC_PRE(tiv, src);
-    cast_encrypt((CastContext *)context, tiv, tiv);
-    SILC_CBC_ENC_POST(tiv, dst, src);
-  }
-
-  SILC_CBC_PUT_IV(tiv, iv);
-
-  return TRUE;
-}
-
-/* Decrypts with the cipher in CBC mode. Source and destination buffers
-   maybe one and same. */
-
-SILC_CIPHER_API_DECRYPT(cast_cbc)
-{
-  SilcUInt32 tmp[4], tmp2[4], tiv[4];
-  int i;
-
-  if (len & (16 - 1))
-    return FALSE;
-
-  SILC_CBC_GET_IV(tiv, iv);
-
-  SILC_CBC_DEC_PRE(tmp, src);
-  cast_decrypt((CastContext *)context, tmp, tmp2);
-  SILC_CBC_DEC_POST(tmp2, dst, src, tmp, tiv);
-
-  for (i = 16; i < len; i += 16) {
-    SILC_CBC_DEC_PRE(tmp, src);
-    cast_decrypt((CastContext *)context, tmp, tmp2);
-    SILC_CBC_DEC_POST(tmp2, dst, src, tmp, tiv);
-  }
-
-  SILC_CBC_PUT_IV(tiv, iv);
-
-  return TRUE;
-}
-
-u4byte s_box[4][256] =
-{ {
-    0x30fb40d4, 0x9fa0ff0b, 0x6beccd2f, 0x3f258c7a, 0x1e213f2f, 0x9C004dd3,
-    0x6003e540, 0xcf9fc949, 0xbfd4af27, 0x88bbbdb5, 0xe2034090, 0x98d09675,
-    0x6e63a0e0, 0x15c361d2, 0xc2e7661d, 0x22d4ff8e, 0x28683b6f, 0xc07fd059,
-    0xff2379c8, 0x775f50e2, 0x43c340d3, 0xdf2f8656, 0x887ca41a, 0xa2d2bd2d,
-    0xa1c9e0d6, 0x346c4819, 0x61b76d87, 0x22540f2f, 0x2abe32e1, 0xaa54166b,
-    0x22568e3a, 0xa2d341d0, 0x66db40c8, 0xa784392f, 0x004dff2f, 0x2db9d2de,
-    0x97943fac, 0x4a97c1d8, 0x527644b7, 0xb5f437a7, 0xb82cbaef, 0xd751d159,
-    0x6ff7f0ed, 0x5a097a1f, 0x827b68d0, 0x90ecf52e, 0x22b0c054, 0xbc8e5935,
-    0x4b6d2f7f, 0x50bb64a2, 0xd2664910, 0xbee5812d, 0xb7332290, 0xe93b159f,
-    0xb48ee411, 0x4bff345d, 0xfd45c240, 0xad31973f, 0xc4f6d02e, 0x55fc8165,
-    0xd5b1caad, 0xa1ac2dae, 0xa2d4b76d, 0xc19b0C50, 0x882240f2, 0x0c6e4f38,
-    0xa4e4bfd7, 0x4f5ba272, 0x564c1d2f, 0xc59c5319, 0xb949e354, 0xb04669fe,
-    0xb1b6ab8a, 0xc71358dd, 0x6385c545, 0x110f935d, 0x57538ad5, 0x6a390493,
-    0xe63d37e0, 0x2a54f6b3, 0x3a787d5f, 0x6276a0b5, 0x19a6fcdf, 0x7a42206a,
-    0x29f9d4d5, 0xf61b1891, 0xbb72275e, 0xaa508167, 0x38901091, 0xc6b505eb,
-    0x84c7cb8c, 0x2ad75a0f, 0x874a1427, 0xa2d1936b, 0x2ad286af, 0xaa56d291,
-    0xd7894360, 0x425c750d, 0x93b39e26, 0x187184c9, 0x6c00b32d, 0x73e2bb14,
-    0xa0bebc3c, 0x54623779, 0x64459eab, 0x3f328b82, 0x7718cf82, 0x59a2cea6,
-    0x04ee002e, 0x89fe78e6, 0x3fab0950, 0x325ff6C2, 0x81383f05, 0x6963c5c8,
-    0x76cb5ad6, 0xd49974c9, 0xca180dcf, 0x380782d5, 0xc7fa5cf6, 0x8ac31511,
-    0x35e79e13, 0x47da91d0, 0xf40f9086, 0xa7e2419e, 0x31366241, 0x051ef495,
-    0xaa573b04, 0x4a805d8d, 0x548300d0, 0x00322a3c, 0xbf64cddf, 0xba57a68e,
-    0x75c6372b, 0x50afd341, 0xa7c13275, 0x915a0bf5, 0x6b54bfab, 0x2b0b1426,
-    0xab4cc9d7, 0x449ccd82, 0xf7fbf265, 0xab85c5f3, 0x1b55db94, 0xaad4e324,
-    0xcfa4bd3f, 0x2deaa3e2, 0x9e204d02, 0xc8bd25ac, 0xeadf55b3, 0xd5bd9e98,
-    0xe31231b2, 0x2ad5ad6c, 0x954329de, 0xadbe4528, 0xd8710f69, 0xaa51c90f,
-    0xaa786bf6, 0x22513f1e, 0xaa51a79b, 0x2ad344cc, 0x7b5a41f0, 0xd37cfbad,
-    0x1b069505, 0x41ece491, 0xb4c332e6, 0x032268d4, 0xc9600acc, 0xce387e6d,
-    0xbf6bb16c, 0x6a70fb78, 0x0d03d9c9, 0xd4df39de, 0xe01063da, 0x4736f464,
-    0x5ad328d8, 0xb347cc96, 0x75bb0fc3, 0x98511bfb, 0x4ffbcc35, 0xb58bcf6a,
-    0xe11f0abc, 0xbfc5fe4a, 0xa70aec10, 0xac39570a, 0x3f04442f, 0x6188b153,
-    0xe0397a2e, 0x5727cb79, 0x9ceb418f, 0x1cacd68d, 0x2ad37c96, 0x0175cb9d,
-    0xc69dff09, 0xc75b65f0, 0xd9db40d8, 0xec0e7779, 0x4744ead4, 0xb11c3274,
-    0xdd24cb9e, 0x7e1c54bd, 0xf01144f9, 0xd2240eb1, 0x9675b3fd, 0xa3ac3755,
-    0xd47c27af, 0x51c85f4d, 0x56907596, 0xa5bb15e6, 0x580304f0, 0xca042cf1,
-    0x011a37ea, 0x8dbfaadb, 0x35ba3e4a, 0x3526ffa0, 0xc37b4d09, 0xbc306ed9,
-    0x98a52666, 0x5648f725, 0xff5e569d, 0x0ced63d0, 0x7c63b2cf, 0x700b45e1,
-    0xd5ea50f1, 0x85a92872, 0xaf1fbda7, 0xd4234870, 0xa7870bf3, 0x2d3b4d79,
-    0x42e04198, 0x0cd0ede7, 0x26470db8, 0xf881814C, 0x474d6ad7, 0x7c0c5e5c,
-    0xd1231959, 0x381b7298, 0xf5d2f4db, 0xab838653, 0x6e2f1e23, 0x83719c9e,
-    0xbd91e046, 0x9a56456e, 0xdc39200c, 0x20c8c571, 0x962bda1c, 0xe1e696ff,
-    0xb141ab08, 0x7cca89b9, 0x1a69e783, 0x02cc4843, 0xa2f7c579, 0x429ef47d,
-    0x427b169c, 0x5ac9f049, 0xdd8f0f00, 0x5c8165bf
-  },
-  {
-    0x1f201094, 0xef0ba75b, 0x69e3cf7e, 0x393f4380, 0xfe61cf7a, 0xeec5207a,
-    0x55889c94, 0x72fc0651, 0xada7ef79, 0x4e1d7235, 0xd55a63ce, 0xde0436ba,
-    0x99c430ef, 0x5f0c0794, 0x18dcdb7d, 0xa1d6eff3, 0xa0b52f7b, 0x59e83605,
-    0xee15b094, 0xe9ffd909, 0xdc440086, 0xef944459, 0xba83ccb3, 0xe0c3cdfb,
-    0xd1da4181, 0x3b092ab1, 0xf997f1c1, 0xa5e6cf7b, 0x01420ddb, 0xe4e7ef5b,
-    0x25a1ff41, 0xe180f806, 0x1fc41080, 0x179bee7a, 0xd37ac6a9, 0xfe5830a4,
-    0x98de8b7f, 0x77e83f4e, 0x79929269, 0x24fa9f7b, 0xe113c85b, 0xacc40083,
-    0xd7503525, 0xf7ea615f, 0x62143154, 0x0d554b63, 0x5d681121, 0xc866c359,
-    0x3d63cf73, 0xcee234c0, 0xd4d87e87, 0x5c672b21, 0x071f6181, 0x39f7627f,
-    0x361e3084, 0xe4eb573b, 0x602f64a4, 0xd63acd9c, 0x1bbc4635, 0x9e81032d,
-    0x2701f50c, 0x99847ab4, 0xa0e3df79, 0xba6cf38c, 0x10843094, 0x2537a95e,
-    0xf46f6ffe, 0xa1ff3b1f, 0x208cfb6a, 0x8f458c74, 0xd9e0a227, 0x4ec73a34,
-    0xfc884f69, 0x3e4de8df, 0xef0e0088, 0x3559648d, 0x8a45388c, 0x1d804366,
-    0x721d9bfd, 0xa58684bb, 0xe8256333, 0x844e8212, 0x128d8098, 0xfed33fb4,
-    0xce280ae1, 0x27e19ba5, 0xd5a6c252, 0xe49754bd, 0xc5d655dd, 0xeb667064,
-    0x77840b4d, 0xa1b6a801, 0x84db26a9, 0xe0b56714, 0x21f043b7, 0xe5d05860,
-    0x54f03084, 0x066ff472, 0xa31aa153, 0xdadc4755, 0xb5625dbf, 0x68561be6,
-    0x83ca6b94, 0x2d6ed23b, 0xeccf01db, 0xa6d3d0ba, 0xb6803d5c, 0xaf77a709,
-    0x33b4a34c, 0x397bc8d6, 0x5ee22b95, 0x5f0e5304, 0x81ed6f61, 0x20e74364,
-    0xb45e1378, 0xde18639b, 0x881ca122, 0xb96726d1, 0x8049a7e8, 0x22b7da7b,
-    0x5e552d25, 0x5272d237, 0x79d2951c, 0xc60d894c, 0x488cb402, 0x1ba4fe5b,
-    0xa4b09f6b, 0x1ca815cf, 0xa20c3005, 0x8871df63, 0xb9de2fcb, 0x0cc6c9e9,
-    0x0beeff53, 0xe3214517, 0xb4542835, 0x9f63293c, 0xee41e729, 0x6e1d2d7c,
-    0x50045286, 0x1e6685f3, 0xf33401c6, 0x30a22c95, 0x31a70850, 0x60930f13,
-    0x73f98417, 0xa1269859, 0xec645c44, 0x52c877a9, 0xcdff33a6, 0xa02b1741,
-    0x7cbad9a2, 0x2180036f, 0x50d99c08, 0xcb3f4861, 0xc26bd765, 0x64a3f6ab,
-    0x80342676, 0x25a75e7b, 0xe4e6d1fc, 0x20c710e6, 0xcdf0b680, 0x17844d3b,
-    0x31eef84d, 0x7e0824e4, 0x2ccb49eb, 0x846a3bae, 0x8ff77888, 0xee5d60f6,
-    0x7af75673, 0x2fdd5cdb, 0xa11631c1, 0x30f66f43, 0xb3faec54, 0x157fd7fa,
-    0xef8579cc, 0xd152de58, 0xdb2ffd5e, 0x8f32ce19, 0x306af97a, 0x02f03ef8,
-    0x99319ad5, 0xc242fa0f, 0xa7e3ebb0, 0xc68e4906, 0xb8da230c, 0x80823028,
-    0xdcdef3c8, 0xd35fb171, 0x088a1bc8, 0xbec0c560, 0x61a3c9e8, 0xbca8f54d,
-    0xc72feffa, 0x22822e99, 0x82c570b4, 0xd8d94e89, 0x8b1c34bc, 0x301e16e6,
-    0x273be979, 0xb0ffeaa6, 0x61d9b8c6, 0x00b24869, 0xb7ffce3f, 0x08dc283b,
-    0x43daf65a, 0xf7e19798, 0x7619b72f, 0x8f1c9ba4, 0xdc8637a0, 0x16a7d3b1,
-    0x9fc393b7, 0xa7136eeb, 0xc6bcc63e, 0x1a513742, 0xef6828bc, 0x520365d6,
-    0x2d6a77ab, 0x3527ed4b, 0x821fd216, 0x095c6e2e, 0xdb92f2fb, 0x5eea29cb,
-    0x145892f5, 0x91584f7f, 0x5483697b, 0x2667a8cc, 0x85196048, 0x8c4bacea,
-    0x833860d4, 0x0d23e0f9, 0x6c387e8a, 0x0ae6d249, 0xb284600c, 0xd835731d,
-    0xdcb1c647, 0xac4c56ea, 0x3ebd81b3, 0x230eabb0, 0x6438bc87, 0xf0b5b1fa,
-    0x8f5ea2b3, 0xfc184642, 0x0a036b7a, 0x4fb089bd, 0x649da589, 0xa345415e,
-    0x5c038323, 0x3e5d3bb9, 0x43d79572, 0x7e6dd07c, 0x06dfdf1e, 0x6c6cc4ef,
-    0x7160a539, 0x73bfbe70, 0x83877605, 0x4523ecf1
-  },
-  {
-    0x8defc240, 0x25fa5d9f, 0xeb903dbf, 0xe810c907, 0x47607fff, 0x369fe44b,
-    0x8c1fc644, 0xaececa90, 0xbeb1f9bf, 0xeefbcaea, 0xe8cf1950, 0x51df07ae,
-    0x920e8806, 0xf0ad0548, 0xe13c8d83, 0x927010d5, 0x11107d9f, 0x07647db9,
-    0xb2e3e4d4, 0x3d4f285e, 0xb9afa820, 0xfade82e0, 0xa067268b, 0x8272792e,
-    0x553fb2c0, 0x489ae22b, 0xd4ef9794, 0x125e3fbc, 0x21fffcee, 0x825b1bfd,
-    0x9255c5ed, 0x1257a240, 0x4e1a8302, 0xbae07fff, 0x528246e7, 0x8e57140e,
-    0x3373f7bf, 0x8c9f8188, 0xa6fc4ee8, 0xc982b5a5, 0xa8c01db7, 0x579fc264,
-    0x67094f31, 0xf2bd3f5f, 0x40fff7c1, 0x1fb78dfc, 0x8e6bd2c1, 0x437be59b,
-    0x99b03dbf, 0xb5dbc64b, 0x638dc0e6, 0x55819d99, 0xa197c81c, 0x4a012d6e,
-    0xc5884a28, 0xccc36f71, 0xb843c213, 0x6c0743f1, 0x8309893c, 0x0feddd5f,
-    0x2f7fe850, 0xd7c07f7e, 0x02507fbf, 0x5afb9a04, 0xa747d2d0, 0x1651192e,
-    0xaf70bf3e, 0x58c31380, 0x5f98302e, 0x727cc3c4, 0x0a0fb402, 0x0f7fef82,
-    0x8c96fdad, 0x5d2c2aae, 0x8ee99a49, 0x50da88b8, 0x8427f4a0, 0x1eac5790,
-    0x796fb449, 0x8252dc15, 0xefbd7d9b, 0xa672597d, 0xada840d8, 0x45f54504,
-    0xfa5d7403, 0xe83ec305, 0x4f91751a, 0x925669c2, 0x23efe941, 0xa903f12e,
-    0x60270df2, 0x0276e4b6, 0x94fd6574, 0x927985b2, 0x8276dbcb, 0x02778176,
-    0xf8af918d, 0x4e48f79e, 0x8f616ddf, 0xe29d840e, 0x842f7d83, 0x340ce5c8,
-    0x96bbb682, 0x93b4b148, 0xef303cab, 0x984faf28, 0x779faf9b, 0x92dc560d,
-    0x224d1e20, 0x8437aa88, 0x7d29dc96, 0x2756d3dc, 0x8b907cee, 0xb51fd240,
-    0xe7c07ce3, 0xe566b4a1, 0xc3e9615e, 0x3cf8209d, 0x6094d1e3, 0xcd9ca341,
-    0x5c76460e, 0x00ea983b, 0xd4d67881, 0xfd47572c, 0xf76cedd9, 0xbda8229c,
-    0x127dadaa, 0x438a074e, 0x1f97c090, 0x081bdb8a, 0x93a07ebe, 0xb938ca15,
-    0x97b03cff, 0x3dc2c0f8, 0x8d1ab2ec, 0x64380e51, 0x68cc7bfb, 0xd90f2788,
-    0x12490181, 0x5de5ffd4, 0xdd7ef86a, 0x76a2e214, 0xb9a40368, 0x925d958f,
-    0x4b39fffa, 0xba39aee9, 0xa4ffd30b, 0xfaf7933b, 0x6d498623, 0x193cbcfa,
-    0x27627545, 0x825cf47a, 0x61bd8ba0, 0xd11e42d1, 0xcead04f4, 0x127ea392,
-    0x10428db7, 0x8272a972, 0x9270c4a8, 0x127de50b, 0x285ba1c8, 0x3c62f44f,
-    0x35c0eaa5, 0xe805d231, 0x428929fb, 0xb4fcdf82, 0x4fb66a53, 0x0e7dc15b,
-    0x1f081fab, 0x108618ae, 0xfcfd086d, 0xf9ff2889, 0x694bcc11, 0x236a5cae,
-    0x12deca4d, 0x2c3f8cc5, 0xd2d02dfe, 0xf8ef5896, 0xe4cf52da, 0x95155b67,
-    0x494a488c, 0xb9b6a80c, 0x5c8f82bc, 0x89d36b45, 0x3a609437, 0xec00c9a9,
-    0x44715253, 0x0a874b49, 0xd773bc40, 0x7c34671c, 0x02717ef6, 0x4feb5536,
-    0xa2d02fff, 0xd2bf60c4, 0xd43f03c0, 0x50b4ef6d, 0x07478cd1, 0x006e1888,
-    0xa2e53f55, 0xb9e6d4bc, 0xa2048016, 0x97573833, 0xd7207d67, 0xde0f8f3d,
-    0x72f87b33, 0xabcc4f33, 0x7688c55d, 0x7b00a6b0, 0x947b0001, 0x570075d2,
-    0xf9bb88f8, 0x8942019e, 0x4264a5ff, 0x856302e0, 0x72dbd92b, 0xee971b69,
-    0x6ea22fde, 0x5f08ae2b, 0xaf7a616d, 0xe5c98767, 0xcf1febd2, 0x61efc8c2,
-    0xf1ac2571, 0xcc8239c2, 0x67214cb8, 0xb1e583d1, 0xb7dc3e62, 0x7f10bdce,
-    0xf90a5c38, 0x0ff0443d, 0x606e6dc6, 0x60543a49, 0x5727c148, 0x2be98a1d,
-    0x8ab41738, 0x20e1be24, 0xaf96da0f, 0x68458425, 0x99833be5, 0x600d457d,
-    0x282f9350, 0x8334b362, 0xd91d1120, 0x2b6d8da0, 0x642b1e31, 0x9c305a00,
-    0x52bce688, 0x1b03588a, 0xf7baefd5, 0x4142ed9c, 0xa4315c11, 0x83323ec5,
-    0xdfef4636, 0xa133c501, 0xe9d3531c, 0xee353783
-  },
-  {
-    0x9db30420, 0x1fb6e9de, 0xa7be7bef, 0xd273a298, 0x4a4f7bdb, 0x64ad8c57,
-    0x85510443, 0xfa020ed1, 0x7e287aff, 0xe60fb663, 0x095f35a1, 0x79ebf120,
-    0xfd059d43, 0x6497b7b1, 0xf3641f63, 0x241e4adf, 0x28147f5f, 0x4fa2b8cd,
-    0xc9430040, 0x0cc32220, 0xfdd30b30, 0xc0a5374f, 0x1d2d00d9, 0x24147b15,
-    0xee4d111a, 0x0fca5167, 0x71ff904c, 0x2d195ffe, 0x1a05645f, 0x0c13fefe,
-    0x081b08ca, 0x05170121, 0x80530100, 0xe83e5efe, 0xac9af4f8, 0x7fe72701,
-    0xd2b8ee5f, 0x06df4261, 0xbb9e9b8a, 0x7293ea25, 0xce84ffdf, 0xf5718801,
-    0x3dd64b04, 0xa26f263b, 0x7ed48400, 0x547eebe6, 0x446d4ca0, 0x6cf3d6f5,
-    0x2649abdf, 0xaea0c7f5, 0x36338cc1, 0x503f7e93, 0xd3772061, 0x11b638e1,
-    0x72500e03, 0xf80eb2bb, 0xabe0502e, 0xec8d77de, 0x57971e81, 0xe14f6746,
-    0xc9335400, 0x6920318f, 0x081dbb99, 0xffc304a5, 0x4d351805, 0x7f3d5ce3,
-    0xa6c866c6, 0x5d5bcca9, 0xdaec6fea, 0x9f926f91, 0x9f46222f, 0x3991467d,
-    0xa5bf6d8e, 0x1143c44f, 0x43958302, 0xd0214eeb, 0x022083b8, 0x3fb6180c,
-    0x18f8931e, 0x281658e6, 0x26486e3e, 0x8bd78a70, 0x7477e4c1, 0xb506e07c,
-    0xf32d0a25, 0x79098b02, 0xe4eabb81, 0x28123b23, 0x69dead38, 0x1574ca16,
-    0xdf871b62, 0x211c40b7, 0xa51a9ef9, 0x0014377b, 0x041e8ac8, 0x09114003,
-    0xbd59e4d2, 0xe3d156d5, 0x4fe876d5, 0x2f91a340, 0x557be8de, 0x00eae4a7,
-    0x0ce5c2ec, 0x4db4bba6, 0xe756bdff, 0xdd3369ac, 0xec17b035, 0x06572327,
-    0x99afc8b0, 0x56c8c391, 0x6b65811c, 0x5e146119, 0x6e85cb75, 0xbe07c002,
-    0xc2325577, 0x893ff4ec, 0x5bbfc92d, 0xd0ec3b25, 0xb7801ab7, 0x8d6d3b24,
-    0x20c763ef, 0xc366a5fc, 0x9c382880, 0x0ace3205, 0xaac9548a, 0xeca1d7c7,
-    0x041afa32, 0x1d16625a, 0x6701902c, 0x9b757a54, 0x31d477f7, 0x9126b031,
-    0x36cc6fdb, 0xc70b8b46, 0xd9e66a48, 0x56e55a79, 0x026a4ceb, 0x52437eff,
-    0x2f8f76b4, 0x0df980a5, 0x8674cde3, 0xedda04eb, 0x17a9be04, 0x2c18f4df,
-    0xb7747f9d, 0xab2af7b4, 0xefc34d20, 0x2e096b7c, 0x1741a254, 0xe5b6a035,
-    0x213d42f6, 0x2c1c7c26, 0x61c2f50f, 0x6552daf9, 0xd2c231f8, 0x25130f69,
-    0xd8167fa2, 0x0418f2c8, 0x001a96a6, 0x0d1526ab, 0x63315c21, 0x5e0a72ec,
-    0x49bafefd, 0x187908d9, 0x8d0dbd86, 0x311170a7, 0x3e9b640c, 0xcc3e10d7,
-    0xd5cad3b6, 0x0caec388, 0xf73001e1, 0x6c728aff, 0x71eae2a1, 0x1f9af36e,
-    0xcfcbd12f, 0xc1de8417, 0xac07be6b, 0xcb44a1d8, 0x8b9b0f56, 0x013988c3,
-    0xb1c52fca, 0xb4be31cd, 0xd8782806, 0x12a3a4e2, 0x6f7de532, 0x58fd7eb6,
-    0xd01ee900, 0x24adffc2, 0xf4990fc5, 0x9711aac5, 0x001d7b95, 0x82e5e7d2,
-    0x109873f6, 0x00613096, 0xc32d9521, 0xada121ff, 0x29908415, 0x7fbb977f,
-    0xaf9eb3db, 0x29c9ed2a, 0x5ce2a465, 0xa730f32c, 0xd0aa3fe8, 0x8a5cc091,
-    0xd49e2ce7, 0x0ce454a9, 0xd60acd86, 0x015f1919, 0x77079103, 0xdea03af6,
-    0x78a8565e, 0xdee356df, 0x21f05cbe, 0x8b75e387, 0xb3c50651, 0xb8a5c3ef,
-    0xd8eeb6d2, 0xe523be77, 0xc2154529, 0x2f69efdf, 0xafe67afb, 0xf470c4b2,
-    0xf3e0eb5b, 0xd6cc9876, 0x39e4460c, 0x1fda8538, 0x1987832f, 0xca007367,
-    0xa99144f8, 0x296b299e, 0x492fc295, 0x9266beab, 0xb5676e69, 0x9bd3ddda,
-    0xdf7e052f, 0xdb25701c, 0x1b5e51ee, 0xf65324e6, 0x6afce36c, 0x0316cc04,
-    0x8644213e, 0xb7dc59d0, 0x7965291f, 0xccd6fd43, 0x41823979, 0x932bcdf6,
-    0xb657c34d, 0x4edfd282, 0x7ae5290c, 0x3cb9536b, 0x851e20fe, 0x9833557e,
-    0x13ecf0b0, 0xd3ffb372, 0x3f85c5c1, 0x0aef7ed2
-  }
-};
-
-#define f1(y,x,kr,km)                          \
-    t  = rotl(km + x, kr);                     \
-    u  = s_box[0][byte(t,3)];                  \
-    u ^= s_box[1][byte(t,2)];                  \
-    u -= s_box[2][byte(t,1)];                  \
-    u += s_box[3][byte(t,0)];                  \
-    y ^= u;
-
-#define f2(y,x,kr,km)                          \
-    t  = rotl(km ^ x, kr);                     \
-    u  = s_box[0][byte(t,3)];                  \
-    u -= s_box[1][byte(t,2)];                  \
-    u += s_box[2][byte(t,1)];                  \
-    u ^= s_box[3][byte(t,0)];                  \
-    y ^= u;
-
-#define f3(y,x,kr,km)                          \
-    t  = rotl(km - x, kr);                     \
-    u  = s_box[0][byte(t,3)];                  \
-    u += s_box[1][byte(t,2)];                  \
-    u ^= s_box[2][byte(t,1)];                  \
-    u -= s_box[3][byte(t,0)];                  \
-    y ^= u;
-
-#define f_rnd(x,n)                             \
-    f1(x[2],x[3],l_key[n],    l_key[n + 4]);   \
-    f2(x[1],x[2],l_key[n + 1],l_key[n + 5]);   \
-    f3(x[0],x[1],l_key[n + 2],l_key[n + 6]);   \
-    f1(x[3],x[0],l_key[n + 3],l_key[n + 7]);
-
-#define i_rnd(x, n)                            \
-    f1(x[3],x[0],l_key[n + 3],l_key[n + 7]);   \
-    f3(x[0],x[1],l_key[n + 2],l_key[n + 6]);   \
-    f2(x[1],x[2],l_key[n + 1],l_key[n + 5]);   \
-    f1(x[2],x[3],l_key[n],    l_key[n + 4]);
-
-#define k_rnd(k,tr,tm)                         \
-    f1(k[6],k[7],tr[0],tm[0]);                 \
-    f2(k[5],k[6],tr[1],tm[1]);                 \
-    f3(k[4],k[5],tr[2],tm[2]);                 \
-    f1(k[3],k[4],tr[3],tm[3]);                 \
-    f2(k[2],k[3],tr[4],tm[4]);                 \
-    f3(k[1],k[2],tr[5],tm[5]);                 \
-    f1(k[0],k[1],tr[6],tm[6]);                 \
-    f2(k[7],k[0],tr[7],tm[7]);
-
-/* initialise the key schedule from the user supplied key   */
-
-u4byte *cast_set_key(CastContext *ctx,
-                    const u4byte in_key[], const u4byte key_len)
-{
-    u4byte  i, j, t, u, cm, cr, lk[8], tm[8], tr[8];
-    u4byte *l_key = ctx->l_key;
-
-    for(i = 0; i < key_len / 32; ++i)
-
-        lk[i] = io_swap(in_key[i]);
-
-    for(; i < 8; ++i)
-
-        lk[i] = 0;
-
-    cm = 0x5a827999; cr = 19;
-
-    for(i = 0; i < 96; i += 8)
-    {
-        for(j = 0; j < 8; ++j)
-        {
-            tm[j] = cm; cm += 0x6ed9eba1;
-            tr[j] = cr; cr += 17;
-        }
-
-        k_rnd(lk, tr, tm);
-
-        for(j = 0; j < 8; ++j)
-        {
-            tm[j] = cm; cm += 0x6ed9eba1;
-            tr[j] = cr; cr += 17;
-        }
-
-        k_rnd(lk, tr, tm);
-
-        l_key[i + 0] = lk[0]; l_key[i + 1] = lk[2];
-        l_key[i + 2] = lk[4]; l_key[i + 3] = lk[6];
-        l_key[i + 4] = lk[7]; l_key[i + 5] = lk[5];
-        l_key[i + 6] = lk[3]; l_key[i + 7] = lk[1];
-    }
-
-    return l_key;
-}
-
-/* encrypt a block of text  */
-
-void cast_encrypt(CastContext *ctx,
-                 const u4byte in_blk[4], u4byte out_blk[])
-{
-    u4byte  t, u, blk[4];
-    u4byte *l_key = ctx->l_key;
-
-    blk[0] = io_swap(in_blk[0]); blk[1] = io_swap(in_blk[1]);
-    blk[2] = io_swap(in_blk[2]); blk[3] = io_swap(in_blk[3]);
-
-    f_rnd(blk,  0); f_rnd(blk,  8);
-    f_rnd(blk, 16); f_rnd(blk, 24);
-    f_rnd(blk, 32); f_rnd(blk, 40);
-    i_rnd(blk, 48); i_rnd(blk, 56);
-    i_rnd(blk, 64); i_rnd(blk, 72);
-    i_rnd(blk, 80); i_rnd(blk, 88);
-
-    out_blk[0] = io_swap(blk[0]); out_blk[1] = io_swap(blk[1]);
-    out_blk[2] = io_swap(blk[2]); out_blk[3] = io_swap(blk[3]);
-}
-
-/* decrypt a block of text  */
-
-void cast_decrypt(CastContext *ctx,
-                 const u4byte in_blk[4], u4byte out_blk[4])
-{
-    u4byte  t, u, blk[4];
-    u4byte *l_key = ctx->l_key;
-
-    blk[0] = io_swap(in_blk[0]); blk[1] = io_swap(in_blk[1]);
-    blk[2] = io_swap(in_blk[2]); blk[3] = io_swap(in_blk[3]);
-
-    f_rnd(blk, 88); f_rnd(blk, 80);
-    f_rnd(blk, 72); f_rnd(blk, 64);
-    f_rnd(blk, 56); f_rnd(blk, 48);
-    i_rnd(blk, 40); i_rnd(blk, 32);
-    i_rnd(blk, 24); i_rnd(blk, 16);
-    i_rnd(blk,  8); i_rnd(blk,  0);
-
-    out_blk[0] = io_swap(blk[0]); out_blk[1] = io_swap(blk[1]);
-    out_blk[2] = io_swap(blk[2]); out_blk[3] = io_swap(blk[3]);
-}
diff --git a/lib/silccrypt/cast.h b/lib/silccrypt/cast.h
deleted file mode 100644 (file)
index 383b9fd..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
-
-  cast.h
-
-  Author: Pekka Riikonen <priikone@silcnet.org>
-
-  Copyright (C) 1999 - 2000, 2006, 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 CAST_H
-#define CAST_H
-
-/*
- * SILC Crypto API for Cast-256
- */
-
-SILC_CIPHER_API_SET_KEY(cast_cbc);
-SILC_CIPHER_API_SET_IV(cast_cbc);
-SILC_CIPHER_API_CONTEXT_LEN(cast_cbc);
-SILC_CIPHER_API_ENCRYPT(cast_cbc);
-SILC_CIPHER_API_DECRYPT(cast_cbc);
-
-#endif
diff --git a/lib/silccrypt/cast_internal.h b/lib/silccrypt/cast_internal.h
deleted file mode 100644 (file)
index a70c95d..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
-
-  cast_internal.h
-
-  Author: Pekka Riikonen <priikone@silcnet.org>
-
-  Copyright (C) 1999 - 2000 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 CAST_INTERNAL_H
-#define CAST_INTERNAL_H
-
-#include "ciphers_def.h"
-
-/* Cipher's context */
-typedef struct {
-  u4byte l_key[96];
-} CastContext;
-
-/* Prototypes */
-u4byte *cast_set_key(CastContext *ctx,
-                    const u4byte in_key[], const u4byte key_len);
-void cast_encrypt(CastContext *ctx,
-                 const u4byte in_blk[4], u4byte out_blk[]);
-void cast_decrypt(CastContext *ctx,
-                 const u4byte in_blk[4], u4byte out_blk[4]);
-
-#endif
diff --git a/lib/silccrypt/ciphers.h b/lib/silccrypt/ciphers.h
deleted file mode 100644 (file)
index 27eadf2..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
-
-  ciphers.h
-
-  Author: Pekka Riikonen <priikone@silcnet.org>
-
-  Copyright (C) 1997 - 2007 Pekka Riikonen
-
-  This program is free software; you can redistribute it and/or modify
-  it under the terms of the GNU General Public License as published by
-  the Free Software Foundation; version 2 of the License.
-
-  This program is distributed in the hope that it will be useful,
-  but WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-  GNU General Public License for more details.
-
-*/
-
-#ifndef CIPHERS_H
-#define CIPHERS_H
-
-#include "none.h"
-#include "twofish.h"
-#include "aes.h"
-#include "blowfish.h"
-
-#endif
diff --git a/lib/silccrypt/ciphers_def.h b/lib/silccrypt/ciphers_def.h
deleted file mode 100644 (file)
index 34f30e8..0000000
+++ /dev/null
@@ -1,108 +0,0 @@
-/*
-
-  ciphers_def.h
-
-  Author: Pekka Riikonen <priikone@silcnet.org>
-
-  Copyright (C) 1999 - 2006 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 CIPHERS_DEF_H
-#define CIPHERS_DEF_H
-
-/* General definitions for algorithms */
-typedef unsigned char u1byte;
-typedef SilcUInt32 u4byte;
-typedef SilcUInt32 u32;
-typedef SilcUInt32 uint_32t;
-typedef SilcUInt8 uint_8t;
-
-#define rotr(x, nr) (((x) >> ((int)(nr))) | ((x) << (32 - (int)(nr))))
-#define rotl(x, nr) (((x) << ((int)(nr))) | ((x) >> (32 - (int)(nr))))
-#define byte(x, nr) ((x) >> (nr * 8) & 255)
-
-/* Byte key to words */
-#define SILC_GET_WORD_KEY(s, d, len)           \
-do {                                           \
-  int _i;                                      \
-  for (_i = 0; _i < (len / 8) / 4; _i++)       \
-    SILC_GET32_LSB(d[_i], s + (_i * 4));       \
-} while(0);
-
-/* CBC mode macros. */
-
-#define SILC_CBC_GET_IV(d, s)                  \
-do {                                           \
-  SILC_GET32_LSB(d[0], &s[0]);                 \
-  SILC_GET32_LSB(d[1], &s[4]);                 \
-  SILC_GET32_LSB(d[2], &s[8]);                 \
-  SILC_GET32_LSB(d[3], &s[12]);                        \
-} while(0);
-
-#define SILC_CBC_PUT_IV(s, d)                  \
-do {                                           \
-  SILC_PUT32_LSB(s[0], &d[0]);                 \
-  SILC_PUT32_LSB(s[1], &d[4]);                 \
-  SILC_PUT32_LSB(s[2], &d[8]);                 \
-  SILC_PUT32_LSB(s[3], &d[12]);                        \
-} while(0);
-
-#define SILC_CBC_ENC_PRE(d, s)                 \
-do {                                           \
-  SILC_GET32_X_LSB(d[0], &s[0]);               \
-  SILC_GET32_X_LSB(d[1], &s[4]);               \
-  SILC_GET32_X_LSB(d[2], &s[8]);               \
-  SILC_GET32_X_LSB(d[3], &s[12]);              \
-} while(0);
-
-#define SILC_CBC_ENC_POST(s, d, t)             \
-do {                                           \
-  SILC_PUT32_LSB(s[0], &d[0]);                 \
-  SILC_PUT32_LSB(s[1], &d[4]);                 \
-  SILC_PUT32_LSB(s[2], &d[8]);                 \
-  SILC_PUT32_LSB(s[3], &d[12]);                        \
-                                               \
-  d += 16;                                     \
-  t += 16;                                     \
-} while(0);
-
-#define SILC_CBC_DEC_PRE(d, s)                 \
-do {                                           \
-  SILC_GET32_LSB(d[0], &s[0]);                 \
-  SILC_GET32_LSB(d[1], &s[4]);                 \
-  SILC_GET32_LSB(d[2], &s[8]);                 \
-  SILC_GET32_LSB(d[3], &s[12]);                        \
-} while(0);
-
-#define SILC_CBC_DEC_POST(s, d, p, t, siv)     \
-do {                                           \
-  s[0] ^= siv[0];                              \
-  s[1] ^= siv[1];                              \
-  s[2] ^= siv[2];                              \
-  s[3] ^= siv[3];                              \
-                                               \
-  SILC_PUT32_LSB(s[0], &d[0]);                 \
-  SILC_PUT32_LSB(s[1], &d[4]);                 \
-  SILC_PUT32_LSB(s[2], &d[8]);                 \
-  SILC_PUT32_LSB(s[3], &d[12]);                        \
-                                               \
-  siv[0] = t[0];                               \
-  siv[1] = t[1];                               \
-  siv[2] = t[2];                               \
-  siv[3] = t[3];                               \
-                                               \
-  d += 16;                                     \
-  p += 16;                                     \
-} while(0);
-
-#endif
diff --git a/lib/silccrypt/configure.ad b/lib/silccrypt/configure.ad
deleted file mode 100644 (file)
index dbc58ab..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
-#ifdef SILC_DIST_CRYPTO
-#
-#  lib/silccrypt/configure.ad
-#
-#  Author: Pekka Riikonen <priikone@silcnet.org>
-#
-#  Copyright (C) 2006 - 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.
-#
-
-if test x$compile_libs = xtrue; then
-
-AC_MSG_NOTICE([configuring crypto library])
-SILC_CRYPTO_CFLAGS=
-
-aes_asm=false
-
-if test "${pic_mode:-default}" != "yes" ; then
-case "$host_cpu" in
-  i?86)
-    # Don't enable ASM AES with shared libs as the code doesn't support PIC.
-    if test x$have_assembler = xtrue -a "$enable_shared" != "yes"; then
-      aes_asm=true
-      AC_DEFINE([SILC_AES_ASM], [], [SILC_AES_ASM])
-    fi
-    ;;
-  x86_64)
-    if test x$have_assembler = xtrue -a "$enable_shared" != "yes"; then
-      aes_asm=true
-      AC_DEFINE([SILC_AES_ASM], [], [SILC_AES_ASM])
-    fi
-    ;;
-  default)
-    aes_asm=false
-    ;;
-esac
-fi
-
-SILC_ADD_CC_FLAGS(SILC_CRYPTO, -fno-regmove)
-if test x$summary_debug = xno -a x$want_cc_optimizations = xtrue; then
-  SILC_ADD_CC_FLAGS(SILC_CRYPTO, -fomit-frame-pointer -O3)
-fi
-
-AC_SUBST(SILC_CRYPTO_CFLAGS)
-
-AC_CONFIG_FILES(
-lib/silccrypt/Makefile
-#ifdef SILC_DIST_INPLACE
-lib/silccrypt/tests/Makefile
-#endif SILC_DIST_INPLACE
-)
-
-fi     # compile_libs
-
-# AM_CONDITIONAL is so bad that it itself cannot be defined in conditional
-AM_CONDITIONAL(SILC_AES_ASM, test x$aes_asm = xtrue)
-
-#endif SILC_DIST_CRYPTO
diff --git a/lib/silccrypt/md5.c b/lib/silccrypt/md5.c
deleted file mode 100644 (file)
index 58d71a2..0000000
+++ /dev/null
@@ -1,267 +0,0 @@
-/* File ripped from noiz-0.5 */
-/* Modified by Pekka Riikonen (priikone@poseidon.pspt.fi) */
-
-/*
- * This code implements the MD5 message-digest algorithm.
- * The algorithm is due to Ron Rivest.  This code was
- * written by Colin Plumb in 1993, no copyright is claimed.
- * This code is in the public domain; do with it what you wish.
- *
- * Equivalent code is available from RSA Data Security, Inc.
- * This code has been tested against that, and is equivalent,
- * except that you don't need to include two pages of legalese
- * with every copy.
- *
- * To compute the message digest of a chunk of bytes, declare an
- * MD5Context structure, pass it to MD5Init, call MD5Update as
- * needed on buffers full of bytes, and then call MD5Final, which
- * will fill a supplied 16-byte array with the digest.
- */
-
-#include "silc.h"
-#include "md5_internal.h"
-#include "md5.h"
-
-/* 
- * SILC Hash API for MD5
- */
-
-SILC_HASH_API_INIT(md5)
-{
-  MD5Init((struct MD5Context *)context);
-}
-
-SILC_HASH_API_UPDATE(md5)
-{
-  MD5Update((struct MD5Context *)context, data, len);
-}
-
-SILC_HASH_API_FINAL(md5)
-{
-  MD5Final(digest, (struct MD5Context *)context);
-}
-
-SILC_HASH_API_TRANSFORM(md5)
-{
-  MD5Transform(state, buffer);
-}
-
-SILC_HASH_API_CONTEXT_LEN(md5)
-{
-  return sizeof(struct MD5Context);
-}
-
-/*
- * Start MD5 accumulation.  Set bit count to 0 and buffer to mysterious
- * initialization constants.
- */
-void
-MD5Init(struct MD5Context *ctx)
-{
-  ctx->buf[0] = 0x67452301;
-  ctx->buf[1] = 0xefcdab89;
-  ctx->buf[2] = 0x98badcfe;
-  ctx->buf[3] = 0x10325476;
-  
-  ctx->bits[0] = 0;
-  ctx->bits[1] = 0;
-}
-
-/*
- * Update context to reflect the concatenation of another buffer full
- * of bytes.
- */
-void
-MD5Update(struct MD5Context *ctx, unsigned char const *buf, unsigned len)
-{
-  SilcUInt32 t;
-
-  /* Update bitcount */
-
-  t = ctx->bits[0];
-  if ((ctx->bits[0] = (t + ((SilcUInt32)len << 3)) & 0xffffffffL) < t)
-    ctx->bits[1]++;    /* Carry from low to high */
-  ctx->bits[1] += (SilcUInt32)len >> 29;
-
-  t = (t >> 3) & 0x3f; /* Bytes already in shsInfo->data */
-
-  /* Handle any leading odd-sized chunks */
-  if ( t ) {
-    unsigned char *p = (unsigned char *)ctx->in + t;
-
-    t = 64-t;
-    if (len < t) {
-      memcpy(p, buf, len);
-      return;
-    }
-    memcpy(p, buf, t);
-    MD5Transform(ctx->buf, ctx->in);
-    buf += t;
-    len -= t;
-  }
-
-  /* Process data in 64-byte chunks */
-  while (len >= 64) {
-    memcpy(ctx->in, buf, 64);
-    MD5Transform(ctx->buf, ctx->in);
-    buf += 64;
-    len -= 64;
-  }
-
-  /* Handle any remaining bytes of data. */
-  memcpy(ctx->in, buf, len);
-}
-
-/*
- * Final wrapup - pad to 64-byte boundary with the bit pattern 
- * 1 0* (64-bit count of bits processed, MSB-first)
- */
-void
-MD5Final(unsigned char digest[16], struct MD5Context *ctx)
-{
-  unsigned count;
-  unsigned char *p;
-
-  /* Compute number of bytes mod 64 */
-  count = (ctx->bits[0] >> 3) & 0x3F;
-
-  /* Set the first char of padding to 0x80.  This is safe since there is
-     always at least one byte free */
-  p = ctx->in + count;
-  *p++ = 0x80;
-
-  /* Bytes of padding needed to make 64 bytes */
-  count = 64 - 1 - count;
-
-  /* Pad out to 56 mod 64 */
-  if (count < 8) {
-    /* Two lots of padding:  Pad the first block to 64 bytes */
-    memset(p, 0, count);
-    MD5Transform(ctx->buf, ctx->in);
-
-    /* Now fill the next block with 56 bytes */
-    memset(ctx->in, 0, 56);
-  } else {
-    /* Pad block to 56 bytes */
-    memset(p, 0, count-8);
-  }
-
-  /* Append length in bits and transform */
-  SILC_PUT32_LSB(ctx->bits[0], ctx->in + 56);
-  SILC_PUT32_LSB(ctx->bits[1], ctx->in + 60);
-  MD5Transform(ctx->buf, ctx->in);
-  SILC_PUT32_LSB(ctx->buf[0], digest);
-  SILC_PUT32_LSB(ctx->buf[1], digest + 4);
-  SILC_PUT32_LSB(ctx->buf[2], digest + 8);
-  SILC_PUT32_LSB(ctx->buf[3], digest + 12);
-  memset(ctx, 0, sizeof(ctx)); /* In case it's sensitive */
-}
-
-#ifndef ASM_MD5
-
-/* The four core functions - F1 is optimized somewhat */
-
-/* #define F1(x, y, z) (x & y | ~x & z) */
-#define F1(x, y, z) (z ^ (x & (y ^ z)))
-#define F2(x, y, z) F1(z, x, y)
-#define F3(x, y, z) (x ^ y ^ z)
-#define F4(x, y, z) (y ^ (x | ~z))
-
-/* This is the central step in the MD5 algorithm. */
-#define MD5STEP(f, w, x, y, z, data, s) \
-       ( w += f(x, y, z) + data,  w = (w<<s | w>>(32-s)) & 0xffffffff, \
-        w += x )
-
-/*
- * The core of the MD5 algorithm, this alters an existing MD5 hash to
- * reflect the addition of 16 longwords of new data.  MD5Update blocks
- * the data and converts bytes into longwords for this routine.
- */
-void
-MD5Transform(SilcUInt32 buf[4], const unsigned char kbuf[64])
-{
-  register SilcUInt32 a, b, c, d, i;
-  SilcUInt32 in[16];
-
-  for (i = 0; i < 16; i++)
-    SILC_GET32_LSB(in[i], kbuf + 4 * i);
-
-  a = buf[0];
-  b = buf[1];
-  c = buf[2];
-  d = buf[3];
-
-  MD5STEP(F1, a, b, c, d, in[ 0]+0xd76aa478,  7);
-  MD5STEP(F1, d, a, b, c, in[ 1]+0xe8c7b756, 12);
-  MD5STEP(F1, c, d, a, b, in[ 2]+0x242070db, 17);
-  MD5STEP(F1, b, c, d, a, in[ 3]+0xc1bdceee, 22);
-  MD5STEP(F1, a, b, c, d, in[ 4]+0xf57c0faf,  7);
-  MD5STEP(F1, d, a, b, c, in[ 5]+0x4787c62a, 12);
-  MD5STEP(F1, c, d, a, b, in[ 6]+0xa8304613, 17);
-  MD5STEP(F1, b, c, d, a, in[ 7]+0xfd469501, 22);
-  MD5STEP(F1, a, b, c, d, in[ 8]+0x698098d8,  7);
-  MD5STEP(F1, d, a, b, c, in[ 9]+0x8b44f7af, 12);
-  MD5STEP(F1, c, d, a, b, in[10]+0xffff5bb1, 17);
-  MD5STEP(F1, b, c, d, a, in[11]+0x895cd7be, 22);
-  MD5STEP(F1, a, b, c, d, in[12]+0x6b901122,  7);
-  MD5STEP(F1, d, a, b, c, in[13]+0xfd987193, 12);
-  MD5STEP(F1, c, d, a, b, in[14]+0xa679438e, 17);
-  MD5STEP(F1, b, c, d, a, in[15]+0x49b40821, 22);
-  
-  MD5STEP(F2, a, b, c, d, in[ 1]+0xf61e2562,  5);
-  MD5STEP(F2, d, a, b, c, in[ 6]+0xc040b340,  9);
-  MD5STEP(F2, c, d, a, b, in[11]+0x265e5a51, 14);
-  MD5STEP(F2, b, c, d, a, in[ 0]+0xe9b6c7aa, 20);
-  MD5STEP(F2, a, b, c, d, in[ 5]+0xd62f105d,  5);
-  MD5STEP(F2, d, a, b, c, in[10]+0x02441453,  9);
-  MD5STEP(F2, c, d, a, b, in[15]+0xd8a1e681, 14);
-  MD5STEP(F2, b, c, d, a, in[ 4]+0xe7d3fbc8, 20);
-  MD5STEP(F2, a, b, c, d, in[ 9]+0x21e1cde6,  5);
-  MD5STEP(F2, d, a, b, c, in[14]+0xc33707d6,  9);
-  MD5STEP(F2, c, d, a, b, in[ 3]+0xf4d50d87, 14);
-  MD5STEP(F2, b, c, d, a, in[ 8]+0x455a14ed, 20);
-  MD5STEP(F2, a, b, c, d, in[13]+0xa9e3e905,  5);
-  MD5STEP(F2, d, a, b, c, in[ 2]+0xfcefa3f8,  9);
-  MD5STEP(F2, c, d, a, b, in[ 7]+0x676f02d9, 14);
-  MD5STEP(F2, b, c, d, a, in[12]+0x8d2a4c8a, 20);
-  
-  MD5STEP(F3, a, b, c, d, in[ 5]+0xfffa3942,  4);
-  MD5STEP(F3, d, a, b, c, in[ 8]+0x8771f681, 11);
-  MD5STEP(F3, c, d, a, b, in[11]+0x6d9d6122, 16);
-  MD5STEP(F3, b, c, d, a, in[14]+0xfde5380c, 23);
-  MD5STEP(F3, a, b, c, d, in[ 1]+0xa4beea44,  4);
-  MD5STEP(F3, d, a, b, c, in[ 4]+0x4bdecfa9, 11);
-  MD5STEP(F3, c, d, a, b, in[ 7]+0xf6bb4b60, 16);
-  MD5STEP(F3, b, c, d, a, in[10]+0xbebfbc70, 23);
-  MD5STEP(F3, a, b, c, d, in[13]+0x289b7ec6,  4);
-  MD5STEP(F3, d, a, b, c, in[ 0]+0xeaa127fa, 11);
-  MD5STEP(F3, c, d, a, b, in[ 3]+0xd4ef3085, 16);
-  MD5STEP(F3, b, c, d, a, in[ 6]+0x04881d05, 23);
-  MD5STEP(F3, a, b, c, d, in[ 9]+0xd9d4d039,  4);
-  MD5STEP(F3, d, a, b, c, in[12]+0xe6db99e5, 11);
-  MD5STEP(F3, c, d, a, b, in[15]+0x1fa27cf8, 16);
-  MD5STEP(F3, b, c, d, a, in[ 2]+0xc4ac5665, 23);
-  
-  MD5STEP(F4, a, b, c, d, in[ 0]+0xf4292244,  6);
-  MD5STEP(F4, d, a, b, c, in[ 7]+0x432aff97, 10);
-  MD5STEP(F4, c, d, a, b, in[14]+0xab9423a7, 15);
-  MD5STEP(F4, b, c, d, a, in[ 5]+0xfc93a039, 21);
-  MD5STEP(F4, a, b, c, d, in[12]+0x655b59c3,  6);
-  MD5STEP(F4, d, a, b, c, in[ 3]+0x8f0ccc92, 10);
-  MD5STEP(F4, c, d, a, b, in[10]+0xffeff47d, 15);
-  MD5STEP(F4, b, c, d, a, in[ 1]+0x85845dd1, 21);
-  MD5STEP(F4, a, b, c, d, in[ 8]+0x6fa87e4f,  6);
-  MD5STEP(F4, d, a, b, c, in[15]+0xfe2ce6e0, 10);
-  MD5STEP(F4, c, d, a, b, in[ 6]+0xa3014314, 15);
-  MD5STEP(F4, b, c, d, a, in[13]+0x4e0811a1, 21);
-  MD5STEP(F4, a, b, c, d, in[ 4]+0xf7537e82,  6);
-  MD5STEP(F4, d, a, b, c, in[11]+0xbd3af235, 10);
-  MD5STEP(F4, c, d, a, b, in[ 2]+0x2ad7d2bb, 15);
-  MD5STEP(F4, b, c, d, a, in[ 9]+0xeb86d391, 21);
-  
-  buf[0] += a;
-  buf[1] += b;
-  buf[2] += c;
-  buf[3] += d;
-}
-#endif
diff --git a/lib/silccrypt/md5.h b/lib/silccrypt/md5.h
deleted file mode 100644 (file)
index 455f66d..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
-
-  md5.h
-
-  Author: Pekka Riikonen <priikone@silcnet.org>
-
-  Copyright (C) 1997 - 2000 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 MD5_H
-#define MD5_H
-
-/* 
- * SILC Hash API for MD5
- */
-
-SILC_HASH_API_INIT(md5);
-SILC_HASH_API_UPDATE(md5);
-SILC_HASH_API_FINAL(md5);
-SILC_HASH_API_TRANSFORM(md5);
-SILC_HASH_API_CONTEXT_LEN(md5);
-
-#endif
diff --git a/lib/silccrypt/md5_internal.h b/lib/silccrypt/md5_internal.h
deleted file mode 100644 (file)
index 66ec97b..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-/* file ripped from noiz-0.5. -Pekka.  Public domain. */
-
-#ifndef MD5_INTERNAL_H
-#define MD5_INTERNAL_H
-
-struct MD5Context {
-  SilcUInt32 buf[4];
-  SilcUInt32 bits[2];
-  unsigned char in[64];
-};
-
-void MD5Init(struct MD5Context *context);
-void MD5Update(struct MD5Context *context, unsigned char const *buf, unsigned len);
-void MD5Final(unsigned char digest[16], struct MD5Context *context);
-void MD5Transform(SilcUInt32 buf[4], const unsigned char kbuf[64]);
-
-/*
- * This is needed to make RSAREF happy on some MS-DOS compilers.
- */
-typedef struct MD5Context MD5_CTX;
-
-#endif
diff --git a/lib/silccrypt/none.c b/lib/silccrypt/none.c
deleted file mode 100644 (file)
index d35a85e..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
-
-  none.c
-
-  Author: Pekka Riikonen <priikone@silcnet.org>
-
-  Copyright (C) 1997 - 2007 Pekka Riikonen
-
-  This program is free software; you can redistribute it and/or modify
-  it under the terms of the GNU General Public License as published by
-  the Free Software Foundation; version 2 of the License.
-
-  This program is distributed in the hope that it will be useful,
-  but WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-  GNU General Public License for more details.
-
-*/
-
-#include "silc.h"
-#include "none.h"
-
-/*
- * SILC Crypto API for None cipher (ie. no cipher) :)
- */
-
-SILC_CIPHER_API_SET_KEY(none)
-{
-  return TRUE;
-}
-
-SILC_CIPHER_API_SET_IV(none)
-{
-
-}
-
-SILC_CIPHER_API_CONTEXT_LEN(none)
-{
-  return 1;
-}
-
-SILC_CIPHER_API_ENCRYPT(none)
-{
-  memmove(dst, src, len);
-  return TRUE;
-}
-
-SILC_CIPHER_API_DECRYPT(none)
-{
-  memmove(dst, src, len);
-  return TRUE;
-}
diff --git a/lib/silccrypt/none.h b/lib/silccrypt/none.h
deleted file mode 100644 (file)
index 555ffa2..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
-
-  none.h
-
-  Author: Pekka Riikonen <priikone@silcnet.org>
-
-  Copyright (C) 1997 - 2000 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 NONE_H
-#define NONE_H
-
-/*
- * SILC Crypto API for None cipher (ie. no cipher) :)
- */
-
-SILC_CIPHER_API_SET_KEY(none);
-SILC_CIPHER_API_SET_IV(none);
-SILC_CIPHER_API_CONTEXT_LEN(none);
-SILC_CIPHER_API_ENCRYPT(none);
-SILC_CIPHER_API_DECRYPT(none);
-
-#endif
diff --git a/lib/silccrypt/rc5.c b/lib/silccrypt/rc5.c
deleted file mode 100644 (file)
index 290d311..0000000
+++ /dev/null
@@ -1,221 +0,0 @@
-/*
- * rc5.c                               RC5-32/16/b
- *
- * Copyright (c) 1999 Pekka Riikonen <priikone@poseidon.pspt.fi>
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish, dis-
- * tribute, sublicense, and/or sell copies of the Software, and to permit
- * persons to whom the Software is furnished to do so, subject to the fol-
- * lowing conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL-
- * ITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT
- * SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABIL-
- * ITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
- * IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name of the authors shall
- * not be used in advertising or otherwise to promote the sale, use or
- * other dealings in this Software without prior written authorization from
- * the authors.
- *
- */
-
-/*
- * Based on RC5 reference code and on description of Bruce Schneier's
- * Applied Cryptography.
- *
- * This implementation has a word size of 32 bits, a rounds of 16 and
- * variable key length from 128 and 192 up to 256 bits.
- *
- */
-
-#include "silc.h"
-#include "rc5_internal.h"
-#include "rc5.h"
-
-/*
- * SILC Crypto API for RC5
- */
-
-/* Sets the key for the cipher. */
-
-SILC_CIPHER_API_SET_KEY(rc5_cbc)
-{
-  SilcUInt32 k[8];
-
-  SILC_GET_WORD_KEY(key, k, keylen);
-  rc5_set_key((RC5Context *)context, k, keylen);
-
-  return TRUE;
-}
-
-/* Sets IV for the cipher. */
-
-SILC_CIPHER_API_SET_IV(rc5_cbc)
-{
-
-}
-
-/* Returns the size of the cipher context. */
-
-SILC_CIPHER_API_CONTEXT_LEN(rc5_cbc)
-{
-  return sizeof(RC5Context);
-}
-
-/* Encrypts with the cipher in CBC mode. Source and destination buffers
-   maybe one and same. */
-
-SILC_CIPHER_API_ENCRYPT(rc5_cbc)
-{
-  SilcUInt32 tiv[4];
-  int i;
-
-  SILC_CBC_GET_IV(tiv, iv);
-
-  SILC_CBC_ENC_PRE(tiv, src);
-  rc5_encrypt((RC5Context *)context, tiv, tiv);
-  SILC_CBC_ENC_POST(tiv, dst, src);
-
-  for (i = 16; i < len; i += 16) {
-    SILC_CBC_ENC_PRE(tiv, src);
-    rc5_encrypt((RC5Context *)context, tiv, tiv);
-    SILC_CBC_ENC_POST(tiv, dst, src);
-  }
-
-  SILC_CBC_PUT_IV(tiv, iv);
-
-  return TRUE;
-}
-
-/* Decrypts with the cipher in CBC mode. Source and destination buffers
-   maybe one and same. */
-
-SILC_CIPHER_API_DECRYPT(rc5_cbc)
-{
-  SilcUInt32 tmp[4], tmp2[4], tiv[4];
-  int i;
-
-  SILC_CBC_GET_IV(tiv, iv);
-
-  SILC_CBC_DEC_PRE(tmp, src);
-  rc5_decrypt((RC5Context *)context, tmp, tmp2);
-  SILC_CBC_DEC_POST(tmp2, dst, src, tmp, tiv);
-
-  for (i = 16; i < len; i += 16) {
-    SILC_CBC_DEC_PRE(tmp, src);
-    rc5_decrypt((RC5Context *)context, tmp, tmp2);
-    SILC_CBC_DEC_POST(tmp2, dst, src, tmp, tiv);
-  }
-
-  SILC_CBC_PUT_IV(tiv, iv);
-
-  return TRUE;
-}
-
-/* RC5 encryption */
-#define RC5E(i, A, B)                          \
-               A = A ^ B;                      \
-               A = rotl(A, B) + S[i];          \
-               B = B ^ A;                      \
-               B = rotl(B, A) + S[i + 1];
-
-/* RC5 decryption */
-#define RC5D(i, A, B)                          \
-               B = B - S[i + 1];               \
-               B = rotr(B, A) ^ A;             \
-               A = A - S[i];                   \
-               A = rotr(A, B) ^ B;
-
-/* Sets RC5 key */
-
-int rc5_set_key(RC5Context *ctx, const SilcUInt32 in_key[], int key_len)
-{
-       u32 i, j, k, A, B, L[c];
-       u32 *out_key = ctx->out_key;
-
-       if (key_len < b || key_len > (2 * b))
-               return -1;
-
-       /* init L */
-       for (i = 0; i < key_len / w; i++)
-               L[i] = in_key[i];
-
-       /* init key array (S) */
-       out_key[0] = 0xb7e15163;
-       for (i = 1; i < t; i++)
-               out_key[i] = out_key[i - 1] + 0x9e3779b9;
-
-       /* mix L and key array (S) */
-       A = B = 0;
-       for (k = i = j = 0; k < (3 * t); k++) {
-               A = rotl(out_key[i] + (A + B), 3);
-               B += A;
-               B = rotl(L[j] + B, B);
-               out_key[i] = A;
-               L[j] = B;
-               i = (i + 1) % t;
-               j = (j + 1) % c;
-       }
-
-       return 0;
-}
-
-/* Encrypts *one* block at a time. */
-
-int rc5_encrypt(RC5Context *ctx, u32 *in, u32 *out)
-{
-       u32 A, B;
-       u32 *S = ctx->out_key;
-
-       A = in[0] + S[0];
-       B = in[1] + S[1];
-
-       RC5E(2, A, B); RC5E(4, A, B);
-       RC5E(6, A, B); RC5E(8, A, B);
-       RC5E(10, A, B); RC5E(12, A, B);
-       RC5E(14, A, B); RC5E(16, A, B);
-       RC5E(18, A, B); RC5E(20, A, B);
-       RC5E(22, A, B); RC5E(24, A, B);
-       RC5E(26, A, B); RC5E(28, A, B);
-       RC5E(30, A, B); RC5E(32, A, B);
-
-       out[0] = A;
-       out[1] = B;
-
-       return 0;
-}
-
-/* Decrypts *one* block at a time. */
-
-int rc5_decrypt(RC5Context *ctx, u32 *in, u32 *out)
-{
-       u32 A, B;
-       u32 *S = ctx->out_key;
-
-       A = in[0];
-       B = in[1];
-
-       RC5D(32, A, B); RC5D(30, A, B);
-       RC5D(28, A, B); RC5D(26, A, B);
-       RC5D(24, A, B); RC5D(22, A, B);
-       RC5D(20, A, B); RC5D(18, A, B);
-       RC5D(16, A, B); RC5D(14, A, B);
-       RC5D(12, A, B); RC5D(10, A, B);
-       RC5D(8, A, B); RC5D(6, A, B);
-       RC5D(4, A, B); RC5D(2, A, B);
-
-       out[0] = A - S[0];
-       out[1] = B - S[1];
-
-       return 0;
-}
diff --git a/lib/silccrypt/rc5.h b/lib/silccrypt/rc5.h
deleted file mode 100644 (file)
index 3adbee4..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
-
-  rc5.h
-
-  Author: Pekka Riikonen <priikone@silcnet.org>
-
-  Copyright (C) 1997 - 2000 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 RC5_H
-#define RC5_H
-
-/*
- * SILC Crypto API for RC5
- */
-
-SILC_CIPHER_API_SET_KEY(rc5_cbc);
-SILC_CIPHER_API_SET_IV(rc5_cbc);
-SILC_CIPHER_API_CONTEXT_LEN(rc5_cbc);
-SILC_CIPHER_API_ENCRYPT(rc5_cbc);
-SILC_CIPHER_API_DECRYPT(rc5_cbc);
-
-#endif
diff --git a/lib/silccrypt/rc5_internal.h b/lib/silccrypt/rc5_internal.h
deleted file mode 100644 (file)
index 8f84c05..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
-
-  rc5_internal.h
-
-  Author: Pekka Riikonen <priikone@silcnet.org>
-
-  Copyright (C) 1997 - 2000 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 RC5_INTERNAL_H
-#define RC5_INTERNAL_H
-
-#include "ciphers_def.h"
-
-/* RC5 definitions */
-#define w      32      /* word size, in bits */
-#define r      16      /* rounds */
-#define b      16      /* minimum key size in bytes */
-#define c      8       /* same for 128,  192 and 256 bits key */
-#define t      34      /* size of table S, t = 2 * (r + 1) */
-
-/* Cipher's context */
-typedef struct {
-  u32 out_key[t];
-} RC5Context;
-
-/* Prototypes */
-int rc5_set_key(RC5Context *ctx, const SilcUInt32 in_key[], int key_len);
-int rc5_encrypt(RC5Context *ctx, u32 *in, u32 *out);
-int rc5_decrypt(RC5Context *ctx, u32 *in, u32 *out);
-
-#endif
diff --git a/lib/silccrypt/rijndael_internal.h b/lib/silccrypt/rijndael_internal.h
deleted file mode 100644 (file)
index 83a01f3..0000000
+++ /dev/null
@@ -1,291 +0,0 @@
-/* ---------------------------------------------------------------------------
- Copyright (c) 1998-2006, Brian Gladman, Worcester, UK. All rights reserved.
-
- LICENSE TERMS
-
- The free distribution and use of this software in both source and binary
- form is allowed (with or without changes) provided that:
-
-   1. distributions of this source code include the above copyright
-      notice, this list of conditions and the following disclaimer;
-
-   2. distributions in binary form include the above copyright
-      notice, this list of conditions and the following disclaimer
-      in the documentation and/or other associated materials;
-
-   3. the copyright holder's name is not used to endorse products
-      built using this software without specific written permission.
-
- ALTERNATIVELY, provided that this notice is retained in full, this product
- may be distributed under the terms of the GNU General Public License (GPL),
- in which case the provisions of the GPL apply INSTEAD OF those given above.
-
- DISCLAIMER
-
- This software is provided 'as is' with no explicit or implied warranties
- in respect of its properties, including, but not limited to, correctness
- and/or fitness for purpose.
- ---------------------------------------------------------------------------
- Issue 09/09/2006
-*/
-
-#ifndef RIJNDAEL_INTERNAL_H
-#define RIJNDAEL_INTERNAL_H
-
-#include "ciphers_def.h"
-
-#define KS_LENGTH       60
-
-typedef union {
-  uint_32t l;
-  uint_8t b[4];
-} aes_inf;
-
-typedef struct {
-  uint_32t ks[KS_LENGTH];
-  aes_inf inf;
-  unsigned char pad[16];
-} aes_encrypt_ctx;
-
-typedef struct {
-  uint_32t ks[KS_LENGTH];
-  aes_inf inf;
-} aes_decrypt_ctx;
-
-typedef struct {
-  union {
-    aes_encrypt_ctx enc;
-    aes_decrypt_ctx dec;
-  } u;
-} AesContext;
-
-#define AES_RETURN void
-#define AES_REV_DKS /* define to reverse decryption key schedule    */
-#define AES_BLOCK_SIZE  16  /* the AES block size in bytes          */
-#define N_COLS           4  /* the number of columns in the state   */
-#define RC_LENGTH   (5 * (AES_BLOCK_SIZE / 4 - 2))
-#define WPOLY   0x011b
-#define BPOLY     0x1b
-#define m1  0x80808080
-#define m2  0x7f7f7f7f
-#define gf_mulx(x)  ((((x) & m2) << 1) ^ ((((x) & m1) >> 7) * BPOLY))
-#define s(x,c) x[c]
-#define lp32(x)         ((uint_32t*)(x))
-
-#if defined( _MSC_VER ) && ( _MSC_VER >= 1300 )
-#define TABLE_ALIGN 32
-#endif
-
-#if defined( bswap32 )
-#define aes_sw32    bswap32
-#elif defined( bswap_32 )
-#define aes_sw32    bswap_32
-#else
-#define brot(x,n)   (((uint_32t)(x) <<  n) | ((uint_32t)(x) >> (32 - n)))
-#define aes_sw32(x) ((brot((x),8) & 0x00ff00ff) | (brot((x),24) & 0xff00ff00))
-#endif
-
-#ifdef WORDS_BIGENDIAN
-#define upr(x,n)        (((uint_32t)(x) >> (8 * (n))) |                \
-                        ((uint_32t)(x) << (32 - 8 * (n))))
-#define ups(x,n)        ((uint_32t) (x) >> (8 * (n)))
-#define bval(x,n)       ((uint_8t)((x) >> (24 - 8 * (n))))
-#define bytes2word(b0, b1, b2, b3)  (((uint_32t)(b0) << 24) |  \
-                                    ((uint_32t)(b1) << 16) |   \
-                                    ((uint_32t)(b2) << 8) | (b3))
-#else
-#define upr(x,n)        (((uint_32t)(x) << (8 * (n))) | \
-                        ((uint_32t)(x) >> (32 - 8 * (n))))
-#define ups(x,n)        ((uint_32t) (x) << (8 * (n)))
-#define bval(x,n)       ((uint_8t)((x) >> (8 * (n))))
-#define bytes2word(b0, b1, b2, b3)   (((uint_32t)(b3) << 24) | \
-                                     ((uint_32t)(b2) << 16) |  \
-                                     ((uint_32t)(b1) << 8) | (b0))
-#endif /* WORDS_BIGENDIAN */
-
-#define word_in(x,c)    bytes2word(((const uint_8t*)(x)+4*c)[0],       \
-                                  ((const uint_8t*)(x)+4*c)[1],        \
-                                   ((const uint_8t*)(x)+4*c)[2],       \
-                                  ((const uint_8t*)(x)+4*c)[3])
-#define word_out(x,c,v) {                                              \
-    ((uint_8t*)(x)+4*c)[0] = bval(v,0);                                        \
-    ((uint_8t*)(x)+4*c)[1] = bval(v,1);                                        \
-    ((uint_8t*)(x)+4*c)[2] = bval(v,2);                                        \
-    ((uint_8t*)(x)+4*c)[3] = bval(v,3);                                        \
-}
-
-#define four_tables(x,tab,vf,rf,c) \
- (  tab[0][bval(vf(x,0,c),rf(0,c))] \
-  ^ tab[1][bval(vf(x,1,c),rf(1,c))] \
-  ^ tab[2][bval(vf(x,2,c),rf(2,c))] \
-  ^ tab[3][bval(vf(x,3,c),rf(3,c))])
-
-#define vf1(x,r,c)  (x)
-#define rf1(r,c)    (r)
-#define rf2(r,c)    ((8+r-c)&3)
-
-#define dec_fmvars        uint_32t g2
-#define fwd_mcol(x)       (g2 = gf_mulx(x), g2 ^ upr((x) ^ g2, 3) ^ upr((x), 2) ^ upr((x), 1))
-#define inv_mcol(x)       four_tables(x,t_use(i,m),vf1,rf1,0)
-#define ls_box(x,c)       four_tables(x,t_use(f,l),vf1,rf2,c)
-
-#define ff(x)   inv_mcol(x)
-#if defined( dec_imvars )
-#define d_vars  dec_imvars
-#endif
-
-#define sb_data(w) {\
-    w(0x63), w(0x7c), w(0x77), w(0x7b), w(0xf2), w(0x6b), w(0x6f), w(0xc5),\
-    w(0x30), w(0x01), w(0x67), w(0x2b), w(0xfe), w(0xd7), w(0xab), w(0x76),\
-    w(0xca), w(0x82), w(0xc9), w(0x7d), w(0xfa), w(0x59), w(0x47), w(0xf0),\
-    w(0xad), w(0xd4), w(0xa2), w(0xaf), w(0x9c), w(0xa4), w(0x72), w(0xc0),\
-    w(0xb7), w(0xfd), w(0x93), w(0x26), w(0x36), w(0x3f), w(0xf7), w(0xcc),\
-    w(0x34), w(0xa5), w(0xe5), w(0xf1), w(0x71), w(0xd8), w(0x31), w(0x15),\
-    w(0x04), w(0xc7), w(0x23), w(0xc3), w(0x18), w(0x96), w(0x05), w(0x9a),\
-    w(0x07), w(0x12), w(0x80), w(0xe2), w(0xeb), w(0x27), w(0xb2), w(0x75),\
-    w(0x09), w(0x83), w(0x2c), w(0x1a), w(0x1b), w(0x6e), w(0x5a), w(0xa0),\
-    w(0x52), w(0x3b), w(0xd6), w(0xb3), w(0x29), w(0xe3), w(0x2f), w(0x84),\
-    w(0x53), w(0xd1), w(0x00), w(0xed), w(0x20), w(0xfc), w(0xb1), w(0x5b),\
-    w(0x6a), w(0xcb), w(0xbe), w(0x39), w(0x4a), w(0x4c), w(0x58), w(0xcf),\
-    w(0xd0), w(0xef), w(0xaa), w(0xfb), w(0x43), w(0x4d), w(0x33), w(0x85),\
-    w(0x45), w(0xf9), w(0x02), w(0x7f), w(0x50), w(0x3c), w(0x9f), w(0xa8),\
-    w(0x51), w(0xa3), w(0x40), w(0x8f), w(0x92), w(0x9d), w(0x38), w(0xf5),\
-    w(0xbc), w(0xb6), w(0xda), w(0x21), w(0x10), w(0xff), w(0xf3), w(0xd2),\
-    w(0xcd), w(0x0c), w(0x13), w(0xec), w(0x5f), w(0x97), w(0x44), w(0x17),\
-    w(0xc4), w(0xa7), w(0x7e), w(0x3d), w(0x64), w(0x5d), w(0x19), w(0x73),\
-    w(0x60), w(0x81), w(0x4f), w(0xdc), w(0x22), w(0x2a), w(0x90), w(0x88),\
-    w(0x46), w(0xee), w(0xb8), w(0x14), w(0xde), w(0x5e), w(0x0b), w(0xdb),\
-    w(0xe0), w(0x32), w(0x3a), w(0x0a), w(0x49), w(0x06), w(0x24), w(0x5c),\
-    w(0xc2), w(0xd3), w(0xac), w(0x62), w(0x91), w(0x95), w(0xe4), w(0x79),\
-    w(0xe7), w(0xc8), w(0x37), w(0x6d), w(0x8d), w(0xd5), w(0x4e), w(0xa9),\
-    w(0x6c), w(0x56), w(0xf4), w(0xea), w(0x65), w(0x7a), w(0xae), w(0x08),\
-    w(0xba), w(0x78), w(0x25), w(0x2e), w(0x1c), w(0xa6), w(0xb4), w(0xc6),\
-    w(0xe8), w(0xdd), w(0x74), w(0x1f), w(0x4b), w(0xbd), w(0x8b), w(0x8a),\
-    w(0x70), w(0x3e), w(0xb5), w(0x66), w(0x48), w(0x03), w(0xf6), w(0x0e),\
-    w(0x61), w(0x35), w(0x57), w(0xb9), w(0x86), w(0xc1), w(0x1d), w(0x9e),\
-    w(0xe1), w(0xf8), w(0x98), w(0x11), w(0x69), w(0xd9), w(0x8e), w(0x94),\
-    w(0x9b), w(0x1e), w(0x87), w(0xe9), w(0xce), w(0x55), w(0x28), w(0xdf),\
-    w(0x8c), w(0xa1), w(0x89), w(0x0d), w(0xbf), w(0xe6), w(0x42), w(0x68),\
-    w(0x41), w(0x99), w(0x2d), w(0x0f), w(0xb0), w(0x54), w(0xbb), w(0x16) }
-
-#define isb_data(w) {\
-    w(0x52), w(0x09), w(0x6a), w(0xd5), w(0x30), w(0x36), w(0xa5), w(0x38),\
-    w(0xbf), w(0x40), w(0xa3), w(0x9e), w(0x81), w(0xf3), w(0xd7), w(0xfb),\
-    w(0x7c), w(0xe3), w(0x39), w(0x82), w(0x9b), w(0x2f), w(0xff), w(0x87),\
-    w(0x34), w(0x8e), w(0x43), w(0x44), w(0xc4), w(0xde), w(0xe9), w(0xcb),\
-    w(0x54), w(0x7b), w(0x94), w(0x32), w(0xa6), w(0xc2), w(0x23), w(0x3d),\
-    w(0xee), w(0x4c), w(0x95), w(0x0b), w(0x42), w(0xfa), w(0xc3), w(0x4e),\
-    w(0x08), w(0x2e), w(0xa1), w(0x66), w(0x28), w(0xd9), w(0x24), w(0xb2),\
-    w(0x76), w(0x5b), w(0xa2), w(0x49), w(0x6d), w(0x8b), w(0xd1), w(0x25),\
-    w(0x72), w(0xf8), w(0xf6), w(0x64), w(0x86), w(0x68), w(0x98), w(0x16),\
-    w(0xd4), w(0xa4), w(0x5c), w(0xcc), w(0x5d), w(0x65), w(0xb6), w(0x92),\
-    w(0x6c), w(0x70), w(0x48), w(0x50), w(0xfd), w(0xed), w(0xb9), w(0xda),\
-    w(0x5e), w(0x15), w(0x46), w(0x57), w(0xa7), w(0x8d), w(0x9d), w(0x84),\
-    w(0x90), w(0xd8), w(0xab), w(0x00), w(0x8c), w(0xbc), w(0xd3), w(0x0a),\
-    w(0xf7), w(0xe4), w(0x58), w(0x05), w(0xb8), w(0xb3), w(0x45), w(0x06),\
-    w(0xd0), w(0x2c), w(0x1e), w(0x8f), w(0xca), w(0x3f), w(0x0f), w(0x02),\
-    w(0xc1), w(0xaf), w(0xbd), w(0x03), w(0x01), w(0x13), w(0x8a), w(0x6b),\
-    w(0x3a), w(0x91), w(0x11), w(0x41), w(0x4f), w(0x67), w(0xdc), w(0xea),\
-    w(0x97), w(0xf2), w(0xcf), w(0xce), w(0xf0), w(0xb4), w(0xe6), w(0x73),\
-    w(0x96), w(0xac), w(0x74), w(0x22), w(0xe7), w(0xad), w(0x35), w(0x85),\
-    w(0xe2), w(0xf9), w(0x37), w(0xe8), w(0x1c), w(0x75), w(0xdf), w(0x6e),\
-    w(0x47), w(0xf1), w(0x1a), w(0x71), w(0x1d), w(0x29), w(0xc5), w(0x89),\
-    w(0x6f), w(0xb7), w(0x62), w(0x0e), w(0xaa), w(0x18), w(0xbe), w(0x1b),\
-    w(0xfc), w(0x56), w(0x3e), w(0x4b), w(0xc6), w(0xd2), w(0x79), w(0x20),\
-    w(0x9a), w(0xdb), w(0xc0), w(0xfe), w(0x78), w(0xcd), w(0x5a), w(0xf4),\
-    w(0x1f), w(0xdd), w(0xa8), w(0x33), w(0x88), w(0x07), w(0xc7), w(0x31),\
-    w(0xb1), w(0x12), w(0x10), w(0x59), w(0x27), w(0x80), w(0xec), w(0x5f),\
-    w(0x60), w(0x51), w(0x7f), w(0xa9), w(0x19), w(0xb5), w(0x4a), w(0x0d),\
-    w(0x2d), w(0xe5), w(0x7a), w(0x9f), w(0x93), w(0xc9), w(0x9c), w(0xef),\
-    w(0xa0), w(0xe0), w(0x3b), w(0x4d), w(0xae), w(0x2a), w(0xf5), w(0xb0),\
-    w(0xc8), w(0xeb), w(0xbb), w(0x3c), w(0x83), w(0x53), w(0x99), w(0x61),\
-    w(0x17), w(0x2b), w(0x04), w(0x7e), w(0xba), w(0x77), w(0xd6), w(0x26),\
-    w(0xe1), w(0x69), w(0x14), w(0x63), w(0x55), w(0x21), w(0x0c), w(0x7d) }
-
-#define mm_data(w) {\
-    w(0x00), w(0x01), w(0x02), w(0x03), w(0x04), w(0x05), w(0x06), w(0x07),\
-    w(0x08), w(0x09), w(0x0a), w(0x0b), w(0x0c), w(0x0d), w(0x0e), w(0x0f),\
-    w(0x10), w(0x11), w(0x12), w(0x13), w(0x14), w(0x15), w(0x16), w(0x17),\
-    w(0x18), w(0x19), w(0x1a), w(0x1b), w(0x1c), w(0x1d), w(0x1e), w(0x1f),\
-    w(0x20), w(0x21), w(0x22), w(0x23), w(0x24), w(0x25), w(0x26), w(0x27),\
-    w(0x28), w(0x29), w(0x2a), w(0x2b), w(0x2c), w(0x2d), w(0x2e), w(0x2f),\
-    w(0x30), w(0x31), w(0x32), w(0x33), w(0x34), w(0x35), w(0x36), w(0x37),\
-    w(0x38), w(0x39), w(0x3a), w(0x3b), w(0x3c), w(0x3d), w(0x3e), w(0x3f),\
-    w(0x40), w(0x41), w(0x42), w(0x43), w(0x44), w(0x45), w(0x46), w(0x47),\
-    w(0x48), w(0x49), w(0x4a), w(0x4b), w(0x4c), w(0x4d), w(0x4e), w(0x4f),\
-    w(0x50), w(0x51), w(0x52), w(0x53), w(0x54), w(0x55), w(0x56), w(0x57),\
-    w(0x58), w(0x59), w(0x5a), w(0x5b), w(0x5c), w(0x5d), w(0x5e), w(0x5f),\
-    w(0x60), w(0x61), w(0x62), w(0x63), w(0x64), w(0x65), w(0x66), w(0x67),\
-    w(0x68), w(0x69), w(0x6a), w(0x6b), w(0x6c), w(0x6d), w(0x6e), w(0x6f),\
-    w(0x70), w(0x71), w(0x72), w(0x73), w(0x74), w(0x75), w(0x76), w(0x77),\
-    w(0x78), w(0x79), w(0x7a), w(0x7b), w(0x7c), w(0x7d), w(0x7e), w(0x7f),\
-    w(0x80), w(0x81), w(0x82), w(0x83), w(0x84), w(0x85), w(0x86), w(0x87),\
-    w(0x88), w(0x89), w(0x8a), w(0x8b), w(0x8c), w(0x8d), w(0x8e), w(0x8f),\
-    w(0x90), w(0x91), w(0x92), w(0x93), w(0x94), w(0x95), w(0x96), w(0x97),\
-    w(0x98), w(0x99), w(0x9a), w(0x9b), w(0x9c), w(0x9d), w(0x9e), w(0x9f),\
-    w(0xa0), w(0xa1), w(0xa2), w(0xa3), w(0xa4), w(0xa5), w(0xa6), w(0xa7),\
-    w(0xa8), w(0xa9), w(0xaa), w(0xab), w(0xac), w(0xad), w(0xae), w(0xaf),\
-    w(0xb0), w(0xb1), w(0xb2), w(0xb3), w(0xb4), w(0xb5), w(0xb6), w(0xb7),\
-    w(0xb8), w(0xb9), w(0xba), w(0xbb), w(0xbc), w(0xbd), w(0xbe), w(0xbf),\
-    w(0xc0), w(0xc1), w(0xc2), w(0xc3), w(0xc4), w(0xc5), w(0xc6), w(0xc7),\
-    w(0xc8), w(0xc9), w(0xca), w(0xcb), w(0xcc), w(0xcd), w(0xce), w(0xcf),\
-    w(0xd0), w(0xd1), w(0xd2), w(0xd3), w(0xd4), w(0xd5), w(0xd6), w(0xd7),\
-    w(0xd8), w(0xd9), w(0xda), w(0xdb), w(0xdc), w(0xdd), w(0xde), w(0xdf),\
-    w(0xe0), w(0xe1), w(0xe2), w(0xe3), w(0xe4), w(0xe5), w(0xe6), w(0xe7),\
-    w(0xe8), w(0xe9), w(0xea), w(0xeb), w(0xec), w(0xed), w(0xee), w(0xef),\
-    w(0xf0), w(0xf1), w(0xf2), w(0xf3), w(0xf4), w(0xf5), w(0xf6), w(0xf7),\
-    w(0xf8), w(0xf9), w(0xfa), w(0xfb), w(0xfc), w(0xfd), w(0xfe), w(0xff) }
-
-#define rc_data(w) {\
-    w(0x01), w(0x02), w(0x04), w(0x08), w(0x10),w(0x20), w(0x40), w(0x80),\
-    w(0x1b), w(0x36) }
-
-#define h0(x)   (x)
-
-#define w0(p)   bytes2word(p, 0, 0, 0)
-#define w1(p)   bytes2word(0, p, 0, 0)
-#define w2(p)   bytes2word(0, 0, p, 0)
-#define w3(p)   bytes2word(0, 0, 0, p)
-
-#define u0(p)   bytes2word(f2(p), p, p, f3(p))
-#define u1(p)   bytes2word(f3(p), f2(p), p, p)
-#define u2(p)   bytes2word(p, f3(p), f2(p), p)
-#define u3(p)   bytes2word(p, p, f3(p), f2(p))
-
-#define v0(p)   bytes2word(fe(p), f9(p), fd(p), fb(p))
-#define v1(p)   bytes2word(fb(p), fe(p), f9(p), fd(p))
-#define v2(p)   bytes2word(fd(p), fb(p), fe(p), f9(p))
-#define v3(p)   bytes2word(f9(p), fd(p), fb(p), fe(p))
-
-#define f2(x)   ((x<<1) ^ (((x>>7) & 1) * WPOLY))
-#define f4(x)   ((x<<2) ^ (((x>>6) & 1) * WPOLY) ^ (((x>>6) & 2) * WPOLY))
-#define f8(x)   ((x<<3) ^ (((x>>5) & 1) * WPOLY) ^ (((x>>5) & 2) * WPOLY) \
-                        ^ (((x>>5) & 4) * WPOLY))
-#define f3(x)   (f2(x) ^ x)
-#define f9(x)   (f8(x) ^ x)
-#define fb(x)   (f8(x) ^ f2(x) ^ x)
-#define fd(x)   (f8(x) ^ f4(x) ^ x)
-#define fe(x)   (f8(x) ^ f4(x) ^ f2(x))
-
-#define t_dec(m,n) t_##m##n
-#define t_set(m,n) t_##m##n
-#define t_use(m,n) t_##m##n
-
-#if defined(_MSC_VER) && defined(TABLE_ALIGN)
-#define ALIGN __declspec(align(TABLE_ALIGN))
-#else
-#define ALIGN
-#endif
-
-AES_RETURN aes_encrypt_key128(const unsigned char *key, aes_encrypt_ctx cx[1]);
-AES_RETURN aes_encrypt_key192(const unsigned char *key, aes_encrypt_ctx cx[1]);
-AES_RETURN aes_encrypt_key256(const unsigned char *key, aes_encrypt_ctx cx[1]);
-AES_RETURN aes_encrypt_key(const unsigned char *key, int key_len, aes_encrypt_ctx cx[1]);
-AES_RETURN aes_encrypt(const unsigned char *in, unsigned char *out, const aes_encrypt_ctx cx[1]);
-AES_RETURN aes_decrypt_key128(const unsigned char *key, aes_decrypt_ctx cx[1]);
-AES_RETURN aes_decrypt_key192(const unsigned char *key, aes_decrypt_ctx cx[1]);
-AES_RETURN aes_decrypt_key256(const unsigned char *key, aes_decrypt_ctx cx[1]);
-AES_RETURN aes_decrypt_key(const unsigned char *key, int key_len, aes_decrypt_ctx cx[1]);
-AES_RETURN aes_decrypt(const unsigned char *in, unsigned char *out, const aes_decrypt_ctx cx[1]);
-
-#endif /* RIJNGDAEL_INTERNAL */
diff --git a/lib/silccrypt/rsa.c b/lib/silccrypt/rsa.c
deleted file mode 100644 (file)
index 96fbf1e..0000000
+++ /dev/null
@@ -1,205 +0,0 @@
-/*
-
-  rsa.c        RSA Public and Private key generation functions,
-               RSA encrypt and decrypt functions.
-
-  Author: Pekka Riikonen <priikone@silcnet.org>
-
-  Copyright (C) 1997 - 2007 Pekka Riikonen
-
-  This program is free software; you can redistribute it and/or modify
-  it under the terms of the GNU General Public License as published by
-  the Free Software Foundation; version 2 of the License.
-
-  This program is distributed in the hope that it will be useful,
-  but WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-  GNU General Public License for more details.
-
-  Created: Sat Mar  1 13:26:45 1997 pekka
-
-  RSA public key cryptographic algorithm used in this distribution is:
-
-       Key generation:
-       p, q            primes
-       p != q
-       n = p * q       modulus
-
-       Public key exponent:
-       e   relatively prime to (p-1) * (q-1)
-       Private key exponent:
-       d = e ^ -1 mod lcm(((p-1) * (q-1)))
-
-       Encryption:
-       c = m ^ e mod n
-       Decryption:
-       m = c ^ d mod n
-
-  Supports CRT (Chinese Remainder Theorem) for private key operations.
-
-  The SSH's (Secure Shell), PGP's (Pretty Good Privacy) and RSAREF
-  Toolkit were used as reference when coding this implementation. They
-  all were a big help for me.
-
-  I also suggest reading Bruce Schneier's; Applied Cryptography, Second
-  Edition, John Wiley & Sons, Inc. 1996. This book deals about RSA and
-  everything else too about cryptography.
-
-*/
-/* $Id$ */
-
-/*
-   ChangeLog
-
-   o Mon Feb 12 11:20:32 EET 2001  Pekka
-
-     Changed RSA private exponent generation to what PKCS #1 suggests.  We
-     try to find the smallest possible d by doing modinv(e, lcm(phi)) instead
-     of modinv(e, phi).  Note: this is not security fix but optimization.
-
-   o Tue Feb 20 13:58:58 EET 2001  Pekka
-
-     Set key->bits in rsa_generate_key.  It is the modulus length in bits.
-     The `tmplen' in encrypt, decrypt, sign and verify PKCS API functions
-     is now calculated by (key->bits + 7) / 8.  It is the length of one block.
-
-   o Sat Mar 16 18:27:19 EET 2002  Pekka
-
-     Use the SilcRng sent as argument to SILC_PKCS_API_INIT in prime
-     generation.
-
-   o Sat Sep 26 19:59:48 EEST 2002  Pekka
-
-     Fixed double free in public key setting.  Use a bit larger e as
-     starting point in key generation.
-*/
-
-#include "silc.h"
-#include "rsa.h"
-
-/* Generates RSA public and private keys. Primes p and q that are used
-   to compute the modulus n has to be generated before calling this. They
-   are then sent as argument for the function. */
-
-SilcBool silc_rsa_generate_keys(SilcUInt32 bits, SilcMPInt *p, SilcMPInt *q,
-                               void **ret_public_key, void **ret_private_key)
-{
-  RsaPublicKey *pubkey;
-  RsaPrivateKey *privkey;
-  SilcMPInt phi, hlp;
-  SilcMPInt div, lcm;
-  SilcMPInt pm1, qm1;
-
-  *ret_public_key = pubkey = silc_calloc(1, sizeof(*pubkey));
-  if (!pubkey)
-    return FALSE;
-
-  *ret_private_key = privkey = silc_calloc(1, sizeof(*privkey));
-  if (!privkey)
-    return FALSE;
-
-  /* Initialize variables */
-  silc_mp_init(&privkey->n);
-  silc_mp_init(&privkey->e);
-  silc_mp_init(&privkey->d);
-  silc_mp_init(&privkey->dP);
-  silc_mp_init(&privkey->dQ);
-  silc_mp_init(&privkey->qP);
-  silc_mp_init(&phi);
-  silc_mp_init(&hlp);
-  silc_mp_init(&div);
-  silc_mp_init(&lcm);
-  silc_mp_init(&pm1);
-  silc_mp_init(&qm1);
-
-  /* Set modulus length */
-  privkey->bits = bits;
-
-  /* Compute modulus, n = p * q */
-  silc_mp_mul(&privkey->n, p, q);
-
-  /* phi = (p - 1) * (q - 1) */
-  silc_mp_sub_ui(&pm1, p, 1);
-  silc_mp_sub_ui(&qm1, q, 1);
-  silc_mp_mul(&phi, &pm1, &qm1);
-
-  /* Set e, the public exponent. We try to use same public exponent
-     for all keys. Also, to make encryption faster we use small
-     number. */
-  silc_mp_set_ui(&privkey->e, 65533);
- retry_e:
-  /* See if e is relatively prime to phi. gcd == greates common divisor,
-     if gcd equals 1 they are relatively prime. */
-  silc_mp_gcd(&hlp, &privkey->e, &phi);
-  if ((silc_mp_cmp_ui(&hlp, 1)) > 0) {
-    silc_mp_add_ui(&privkey->e, &privkey->e, 2);
-    goto retry_e;
-  }
-
-  /* Find d, the private exponent, e ^ -1 mod lcm(phi). */
-  silc_mp_gcd(&div, &pm1, &qm1);
-  silc_mp_div(&lcm, &phi, &div);
-  silc_mp_modinv(&privkey->d, &privkey->e, &lcm);
-
-  /* Optimize d with CRT. */
-  silc_mp_mod(&privkey->dP, &privkey->d, &pm1);
-  silc_mp_mod(&privkey->dQ, &privkey->d, &qm1);
-  silc_mp_modinv(&privkey->qP, q, p);
-  silc_mp_set(&privkey->p, p);
-  silc_mp_set(&privkey->q, q);
-
-  silc_mp_uninit(&phi);
-  silc_mp_uninit(&hlp);
-  silc_mp_uninit(&div);
-  silc_mp_uninit(&lcm);
-  silc_mp_uninit(&pm1);
-  silc_mp_uninit(&qm1);
-
-  /* Set public key */
-  silc_mp_init(&pubkey->n);
-  silc_mp_init(&pubkey->e);
-  pubkey->bits = privkey->bits;
-  silc_mp_set(&pubkey->n, &privkey->n);
-  silc_mp_set(&pubkey->e, &privkey->e);
-
-  return TRUE;
-}
-
-/* RSA public key operation */
-
-SilcBool silc_rsa_public_operation(RsaPublicKey *key, SilcMPInt *src,
-                                  SilcMPInt *dst)
-{
-  /* dst = src ^ e mod n */
-  silc_mp_pow_mod(dst, src, &key->e, &key->n);
-  return TRUE;
-}
-
-/* RSA private key operation */
-
-SilcBool silc_rsa_private_operation(RsaPrivateKey *key, SilcMPInt *src,
-                                   SilcMPInt *dst)
-{
-  SilcMPInt tmp;
-
-  silc_mp_init(&tmp);
-
-  /* dst = (src ^ dP mod p) */
-  silc_mp_pow_mod(dst, src, &key->dP, &key->p);
-
-  /* tmp = (src ^ dQ mod q) */
-  silc_mp_pow_mod(&tmp, src, &key->dQ, &key->q);
-
-  /* dst = (dst - tmp) * qP mod p */
-  silc_mp_sub(dst, dst, &tmp);
-  silc_mp_mul(dst, dst, &key->qP);
-  silc_mp_mod(dst, dst, &key->p);
-
-  /* dst = (q * dst) + tmp */
-  silc_mp_mul(dst, dst, &key->q);
-  silc_mp_add(dst, dst, &tmp);
-
-  silc_mp_uninit(&tmp);
-
-  return TRUE;
-}
diff --git a/lib/silccrypt/rsa.h b/lib/silccrypt/rsa.h
deleted file mode 100644 (file)
index 81247b0..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
-
-  rsa.h
-
-  Author: Pekka Riikonen <priikone@silcnet.org>
-
-  Copyright (C) 1997 - 2007 Pekka Riikonen
-
-  This program is free software; you can redistribute it and/or modify
-  it under the terms of the GNU General Public License as published by
-  the Free Software Foundation; version 2 of the License.
-
-  This program is distributed in the hope that it will be useful,
-  but WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-  GNU General Public License for more details.
-
-*/
-
-#ifndef RSA_H
-#define RSA_H
-
-/* RSA Public Key */
-typedef struct {
-  int bits;                    /* bits in key */
-  SilcMPInt n;                 /* modulus */
-  SilcMPInt e;                 /* public exponent */
-} RsaPublicKey;
-
-/* RSA Private Key */
-typedef struct {
-  int bits;                    /* bits in key */
-  SilcMPInt n;                 /* modulus */
-  SilcMPInt e;                 /* public exponent */
-  SilcMPInt d;                 /* private exponent */
-  SilcMPInt p;                 /* CRT, p */
-  SilcMPInt q;                 /* CRT, q */
-  SilcMPInt dP;                        /* CRT, d mod p - 1 */
-  SilcMPInt dQ;                        /* CRT, d mod q - 1 */
-  SilcMPInt qP;                        /* CRT, q ^ -1 mod p (aka u, aka qInv) */
-} RsaPrivateKey;
-
-SilcBool silc_rsa_generate_keys(SilcUInt32 bits, SilcMPInt *p, SilcMPInt *q,
-                               void **ret_public_key, void **ret_private_key);
-SilcBool silc_rsa_public_operation(RsaPublicKey *key, SilcMPInt *src,
-                                  SilcMPInt *dst);
-SilcBool silc_rsa_private_operation(RsaPrivateKey *key, SilcMPInt *src,
-                                   SilcMPInt *dst);
-
-#endif /* RSA_H */
diff --git a/lib/silccrypt/sha1.c b/lib/silccrypt/sha1.c
deleted file mode 100644 (file)
index 6943734..0000000
+++ /dev/null
@@ -1,169 +0,0 @@
-/* Modified to work on various platforms. -Pekka */
-/*
-SHA-1 in C
-By Steve Reid <steve@edmweb.com>
-100% Public Domain
-*/
-
-#include "silc.h"
-#include "sha1_internal.h"
-#include "sha1.h"
-
-/* 
- * SILC Hash API for SHA1
- */
-
-SILC_HASH_API_INIT(sha1)
-{
-  SHA1Init((SHA1_CTX *)context);
-}
-
-SILC_HASH_API_UPDATE(sha1)
-{
-  SHA1Update((SHA1_CTX *)context, (unsigned char *)data, len);
-}
-
-SILC_HASH_API_FINAL(sha1)
-{
-  SHA1Final(digest, (SHA1_CTX *)context);
-}
-
-SILC_HASH_API_TRANSFORM(sha1)
-{
-  SHA1Transform(state, buffer);
-}
-
-SILC_HASH_API_CONTEXT_LEN(sha1)
-{
-  return sizeof(SHA1_CTX);
-}
-
-void SHA1Init(SHA1_CTX* context)
-{
-  /* SHA1 initialization constants */
-  context->state[0] = 0x67452301L;
-  context->state[1] = 0xEFCDAB89L;
-  context->state[2] = 0x98BADCFEL;
-  context->state[3] = 0x10325476L;
-  context->state[4] = 0xC3D2E1F0L;
-  context->count[0] = context->count[1] = 0;
-}
-
-#define rol(x, nr) (((x) << ((SilcUInt32)(nr))) | ((x) >> (32 - (SilcUInt32)(nr))))
-
-#define GET_WORD(cp) ((SilcUInt32)(SilcUInt8)(cp)[0]) << 24    \
-                   | ((SilcUInt32)(SilcUInt8)(cp)[1] << 16)    \
-                   | ((SilcUInt32)(SilcUInt8)(cp)[2] << 8)     \
-                   | ((SilcUInt32)(SilcUInt8)(cp)[3])
-
-#define blk0(i) (W[i] = GET_WORD(data))
-#define blk1(i) (W[i&15] = rol(W[(i+13)&15]^W[(i+8)&15]^W[(i+2)&15]^W[i&15],1))
-
-#define f1(x,y,z) (z^(x&(y^z)))
-#define f2(x,y,z) (x^y^z)
-#define f3(x,y,z) ((x&y)|(z&(x|y)))
-#define f4(x,y,z) (x^y^z)
-
-/* (R0+R1), R2, R3, R4 are the different operations used in SHA1 */
-#define R0(v,w,x,y,z,i) z+=f1(w,x,y)+blk0(i)+0x5A827999+rol(v,5);w=rol(w,30);data+=4;
-#define R1(v,w,x,y,z,i) z+=f1(w,x,y)+blk1(i)+0x5A827999+rol(v,5);w=rol(w,30);
-#define R2(v,w,x,y,z,i) z+=f2(w,x,y)+blk1(i)+0x6ED9EBA1+rol(v,5);w=rol(w,30);
-#define R3(v,w,x,y,z,i) z+=f3(w,x,y)+blk1(i)+0x8F1BBCDC+rol(v,5);w=rol(w,30);
-#define R4(v,w,x,y,z,i) z+=f4(w,x,y)+blk1(i)+0xCA62C1D6+rol(v,5);w=rol(w,30);
-
-void SHA1Transform(SilcUInt32 *state, const unsigned char *data)
-{
-  SilcUInt32 W[16];
-  
-  /* Copy context->state[] to working vars */
-  SilcUInt32 a = state[0];
-  SilcUInt32 b = state[1];
-  SilcUInt32 c = state[2];
-  SilcUInt32 d = state[3];
-  SilcUInt32 e = state[4];
-  
-  /* 4 rounds of 20 operations each. Loop unrolled. */
-  R0(a,b,c,d,e, 0); R0(e,a,b,c,d, 1); R0(d,e,a,b,c, 2); R0(c,d,e,a,b, 3);
-  R0(b,c,d,e,a, 4); R0(a,b,c,d,e, 5); R0(e,a,b,c,d, 6); R0(d,e,a,b,c, 7);
-  R0(c,d,e,a,b, 8); R0(b,c,d,e,a, 9); R0(a,b,c,d,e,10); R0(e,a,b,c,d,11);
-  R0(d,e,a,b,c,12); R0(c,d,e,a,b,13); R0(b,c,d,e,a,14); R0(a,b,c,d,e,15);
-  R1(e,a,b,c,d,16); R1(d,e,a,b,c,17); R1(c,d,e,a,b,18); R1(b,c,d,e,a,19);
-  R2(a,b,c,d,e,20); R2(e,a,b,c,d,21); R2(d,e,a,b,c,22); R2(c,d,e,a,b,23);
-  R2(b,c,d,e,a,24); R2(a,b,c,d,e,25); R2(e,a,b,c,d,26); R2(d,e,a,b,c,27);
-  R2(c,d,e,a,b,28); R2(b,c,d,e,a,29); R2(a,b,c,d,e,30); R2(e,a,b,c,d,31);
-  R2(d,e,a,b,c,32); R2(c,d,e,a,b,33); R2(b,c,d,e,a,34); R2(a,b,c,d,e,35);
-  R2(e,a,b,c,d,36); R2(d,e,a,b,c,37); R2(c,d,e,a,b,38); R2(b,c,d,e,a,39);
-  R3(a,b,c,d,e,40); R3(e,a,b,c,d,41); R3(d,e,a,b,c,42); R3(c,d,e,a,b,43);
-  R3(b,c,d,e,a,44); R3(a,b,c,d,e,45); R3(e,a,b,c,d,46); R3(d,e,a,b,c,47);
-  R3(c,d,e,a,b,48); R3(b,c,d,e,a,49); R3(a,b,c,d,e,50); R3(e,a,b,c,d,51);
-  R3(d,e,a,b,c,52); R3(c,d,e,a,b,53); R3(b,c,d,e,a,54); R3(a,b,c,d,e,55);
-  R3(e,a,b,c,d,56); R3(d,e,a,b,c,57); R3(c,d,e,a,b,58); R3(b,c,d,e,a,59);
-  R4(a,b,c,d,e,60); R4(e,a,b,c,d,61); R4(d,e,a,b,c,62); R4(c,d,e,a,b,63);
-  R4(b,c,d,e,a,64); R4(a,b,c,d,e,65); R4(e,a,b,c,d,66); R4(d,e,a,b,c,67);
-  R4(c,d,e,a,b,68); R4(b,c,d,e,a,69); R4(a,b,c,d,e,70); R4(e,a,b,c,d,71);
-  R4(d,e,a,b,c,72); R4(c,d,e,a,b,73); R4(b,c,d,e,a,74); R4(a,b,c,d,e,75);
-  R4(e,a,b,c,d,76); R4(d,e,a,b,c,77); R4(c,d,e,a,b,78); R4(b,c,d,e,a,79);
-  
-  /* Add the working vars back into context.state[] */
-  state[0] += a;
-  state[1] += b;
-  state[2] += c;
-  state[3] += d;
-  state[4] += e;
-  
-  /* Wipe variables */
-  a = b = c = d = e = 0;
-  memset(W, 0, sizeof(W));
-}
-
-/* Run your data through this. */
-
-void SHA1Update(SHA1_CTX* context, unsigned char* data, SilcUInt32 len)
-{
-  SilcUInt32 i, j;
-
-  j = (context->count[0] >> 3) & 63;
-  if ((context->count[0] += len << 3) < (len << 3)) context->count[1]++;
-  context->count[1] += (len >> 29);
-  if ((j + len) > 63) {
-    memcpy(&context->buffer[j], data, (i = 64-j));
-    SHA1Transform(context->state, context->buffer);
-    for ( ; i + 63 < len; i += 64) {
-      SHA1Transform(context->state, &data[i]);
-    }
-    j = 0;
-  }
-  else i = 0;
-  memcpy(&context->buffer[j], &data[i], len - i);
-}
-
-/* Add padding and return the message digest. */
-
-void SHA1Final(unsigned char digest[20], SHA1_CTX* context)
-{
-  SilcUInt32 i, j;
-  unsigned char finalcount[8];
-  
-  for (i = 0; i < 8; i++) {
-    finalcount[i] = (unsigned char)((context->count[(i >= 4 ? 0 : 1)] 
-                                    >> ((3 - (i & 3)) * 8)) & 255);
-  }
-  SHA1Update(context, (unsigned char *)"\200", 1);
-  while ((context->count[0] & 504) != 448) {
-    SHA1Update(context, (unsigned char *)"\0", 1);
-  }
-  
-  SHA1Update(context, finalcount, 8);  /* Should cause a SHA1Transform() */
-  for (i = 0; i < 20; i++) {
-    digest[i] = (unsigned char)
-      ((context->state[i>>2] >> ((3 - (i & 3)) * 8)) & 255);
-  }
-  
-  /* Wipe variables */
-  i = j = 0;
-  memset(context->buffer, 0, 64);
-  memset(context->state, 0, 20);
-  memset(context->count, 0, 8);
-  memset(finalcount, 0, 8);
-  SHA1Transform(context->state, context->buffer);
-}
diff --git a/lib/silccrypt/sha1.h b/lib/silccrypt/sha1.h
deleted file mode 100644 (file)
index ac52d62..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
-
-  sha1.h
-
-  Author: Pekka Riikonen <priikone@poseidon.pspt.fi>
-
-  Copyright (C) 1997 - 2000 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; either version 2 of the License, or
-  (at your option) any later version.
-  
-  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 SHA1_H
-#define SHA1_H
-
-/* 
- * SILC Hash API for SHA1
- */
-
-SILC_HASH_API_INIT(sha1);
-SILC_HASH_API_UPDATE(sha1);
-SILC_HASH_API_FINAL(sha1);
-SILC_HASH_API_TRANSFORM(sha1);
-SILC_HASH_API_CONTEXT_LEN(sha1);
-
-#endif
diff --git a/lib/silccrypt/sha1_internal.h b/lib/silccrypt/sha1_internal.h
deleted file mode 100644 (file)
index 62b9789..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
-SHA-1 in C
-By Steve Reid <steve@edmweb.com>
-100% Public Domain
-*/
-/* Header portion split from main code for convenience (AYB 3/02/98) */
-
-#ifndef SHA1_INTERNAL_H
-#define SHA1_INTERNAL_H
-
-/*
-Test Vectors (from FIPS PUB 180-1)
-"abc"
-  A9993E36 4706816A BA3E2571 7850C26C 9CD0D89D
-"abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq"
-  84983E44 1C3BD26E BAAE4AA1 F95129E5 E54670F1
-A million repetitions of "a"
-  34AA973C D4C4DAA4 F61EEB2B DBAD2731 6534016F
-*/
-
-/* Context declaration */
-typedef struct {
-    SilcUInt32 state[5];
-    SilcUInt32 count[2];
-    unsigned char buffer[64];
-} SHA1_CTX;
-
-/* Function forward declerations */
-void SHA1Transform(SilcUInt32 *state, const unsigned char *data);
-void SHA1Init(SHA1_CTX* context);
-void SHA1Update(SHA1_CTX* context, unsigned char* data, SilcUInt32 len);
-void SHA1Final(unsigned char digest[20], SHA1_CTX* context);
-
-#endif
diff --git a/lib/silccrypt/sha256.c b/lib/silccrypt/sha256.c
deleted file mode 100644 (file)
index 089aa87..0000000
+++ /dev/null
@@ -1,284 +0,0 @@
-/* Modified for SILC -Pekka */
-
-/* LibTomCrypt, modular cryptographic library -- Tom St Denis
- *
- * LibTomCrypt is a library that provides various cryptographic
- * algorithms in a highly modular and flexible manner.
- *
- * The library is free for all purposes without any express
- * guarantee it works.
- *
- * Tom St Denis, tomstdenis@gmail.com, http://libtomcrypt.org
- */
-#include "silc.h"
-#include "sha256_internal.h"
-#include "sha256.h"
-
-/*
- * SILC Hash API for SHA256
- */
-
-SILC_HASH_API_INIT(sha256)
-{
-  sha256_init(context);
-}
-
-SILC_HASH_API_UPDATE(sha256)
-{
-  sha256_process(context, (unsigned char *)data, len);
-}
-
-SILC_HASH_API_FINAL(sha256)
-{
-  sha256_done(context, digest);
-}
-
-SILC_HASH_API_TRANSFORM(sha256)
-{
-  sha256_compress(state, (unsigned char *)buffer);
-}
-
-SILC_HASH_API_CONTEXT_LEN(sha256)
-{
-  return sizeof(sha256_state);
-}
-
-#if defined(_MSC_VER)
-#pragma intrinsic(_lrotr,_lrotl)
-#define RORc(x,n) _lrotr(x,n)
-
-#elif defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__)) && !defined(INTEL_CC)
-
-static inline unsigned RORc(unsigned word, int i)
-{
-   asm ("rorl %%cl,%0"
-      :"=r" (word)
-      :"0" (word),"c" (i));
-   return word;
-}
-
-#else
-#define RORc(x, y) ( ((((unsigned long)(x)&0xFFFFFFFFUL)>>(unsigned long)((y)&31)) | ((unsigned long)(x)<<(unsigned long)(32-((y)&31)))) &0xFFFFFFFFUL)
-#endif /* _MSC_VER */
-
-/* Various logical functions */
-#define Ch(x,y,z)       (z ^ (x & (y ^ z)))
-#define Maj(x,y,z)      (((x | y) & z) | (x & y))
-#define S(x, n)         RORc((x),(n))
-#define R(x, n)         (((x)&0xFFFFFFFFUL)>>(n))
-#define Sigma0(x)       (S(x, 2) ^ S(x, 13) ^ S(x, 22))
-#define Sigma1(x)       (S(x, 6) ^ S(x, 11) ^ S(x, 25))
-#define Gamma0(x)       (S(x, 7) ^ S(x, 18) ^ R(x, 3))
-#define Gamma1(x)       (S(x, 17) ^ S(x, 19) ^ R(x, 10))
-
-/* compress 512-bits */
-int  sha256_compress(SilcUInt32 *state, unsigned char *buf)
-{
-    SilcUInt32 S[8], W[64], t0, t1;
-    int i;
-
-    /* copy state into S */
-    for (i = 0; i < 8; i++) {
-        S[i] = state[i];
-    }
-
-    /* copy the state into 512-bits into W[0..15] */
-    for (i = 0; i < 16; i++)
-       SILC_GET32_MSB(W[i], buf + (4 * i));
-
-    /* fill W[16..63] */
-    for (i = 16; i < 64; i++) {
-        W[i] = Gamma1(W[i - 2]) + W[i - 7] + Gamma0(W[i - 15]) + W[i - 16];
-    }
-
-    /* Compress */
-#define RND(a,b,c,d,e,f,g,h,i,ki)                   \
-     t0 = h + Sigma1(e) + Ch(e, f, g) + ki + W[i];   \
-     t1 = Sigma0(a) + Maj(a, b, c);                  \
-     d += t0;                                        \
-     h  = t0 + t1;
-
-    RND(S[0],S[1],S[2],S[3],S[4],S[5],S[6],S[7],0,0x428a2f98);
-    RND(S[7],S[0],S[1],S[2],S[3],S[4],S[5],S[6],1,0x71374491);
-    RND(S[6],S[7],S[0],S[1],S[2],S[3],S[4],S[5],2,0xb5c0fbcf);
-    RND(S[5],S[6],S[7],S[0],S[1],S[2],S[3],S[4],3,0xe9b5dba5);
-    RND(S[4],S[5],S[6],S[7],S[0],S[1],S[2],S[3],4,0x3956c25b);
-    RND(S[3],S[4],S[5],S[6],S[7],S[0],S[1],S[2],5,0x59f111f1);
-    RND(S[2],S[3],S[4],S[5],S[6],S[7],S[0],S[1],6,0x923f82a4);
-    RND(S[1],S[2],S[3],S[4],S[5],S[6],S[7],S[0],7,0xab1c5ed5);
-    RND(S[0],S[1],S[2],S[3],S[4],S[5],S[6],S[7],8,0xd807aa98);
-    RND(S[7],S[0],S[1],S[2],S[3],S[4],S[5],S[6],9,0x12835b01);
-    RND(S[6],S[7],S[0],S[1],S[2],S[3],S[4],S[5],10,0x243185be);
-    RND(S[5],S[6],S[7],S[0],S[1],S[2],S[3],S[4],11,0x550c7dc3);
-    RND(S[4],S[5],S[6],S[7],S[0],S[1],S[2],S[3],12,0x72be5d74);
-    RND(S[3],S[4],S[5],S[6],S[7],S[0],S[1],S[2],13,0x80deb1fe);
-    RND(S[2],S[3],S[4],S[5],S[6],S[7],S[0],S[1],14,0x9bdc06a7);
-    RND(S[1],S[2],S[3],S[4],S[5],S[6],S[7],S[0],15,0xc19bf174);
-    RND(S[0],S[1],S[2],S[3],S[4],S[5],S[6],S[7],16,0xe49b69c1);
-    RND(S[7],S[0],S[1],S[2],S[3],S[4],S[5],S[6],17,0xefbe4786);
-    RND(S[6],S[7],S[0],S[1],S[2],S[3],S[4],S[5],18,0x0fc19dc6);
-    RND(S[5],S[6],S[7],S[0],S[1],S[2],S[3],S[4],19,0x240ca1cc);
-    RND(S[4],S[5],S[6],S[7],S[0],S[1],S[2],S[3],20,0x2de92c6f);
-    RND(S[3],S[4],S[5],S[6],S[7],S[0],S[1],S[2],21,0x4a7484aa);
-    RND(S[2],S[3],S[4],S[5],S[6],S[7],S[0],S[1],22,0x5cb0a9dc);
-    RND(S[1],S[2],S[3],S[4],S[5],S[6],S[7],S[0],23,0x76f988da);
-    RND(S[0],S[1],S[2],S[3],S[4],S[5],S[6],S[7],24,0x983e5152);
-    RND(S[7],S[0],S[1],S[2],S[3],S[4],S[5],S[6],25,0xa831c66d);
-    RND(S[6],S[7],S[0],S[1],S[2],S[3],S[4],S[5],26,0xb00327c8);
-    RND(S[5],S[6],S[7],S[0],S[1],S[2],S[3],S[4],27,0xbf597fc7);
-    RND(S[4],S[5],S[6],S[7],S[0],S[1],S[2],S[3],28,0xc6e00bf3);
-    RND(S[3],S[4],S[5],S[6],S[7],S[0],S[1],S[2],29,0xd5a79147);
-    RND(S[2],S[3],S[4],S[5],S[6],S[7],S[0],S[1],30,0x06ca6351);
-    RND(S[1],S[2],S[3],S[4],S[5],S[6],S[7],S[0],31,0x14292967);
-    RND(S[0],S[1],S[2],S[3],S[4],S[5],S[6],S[7],32,0x27b70a85);
-    RND(S[7],S[0],S[1],S[2],S[3],S[4],S[5],S[6],33,0x2e1b2138);
-    RND(S[6],S[7],S[0],S[1],S[2],S[3],S[4],S[5],34,0x4d2c6dfc);
-    RND(S[5],S[6],S[7],S[0],S[1],S[2],S[3],S[4],35,0x53380d13);
-    RND(S[4],S[5],S[6],S[7],S[0],S[1],S[2],S[3],36,0x650a7354);
-    RND(S[3],S[4],S[5],S[6],S[7],S[0],S[1],S[2],37,0x766a0abb);
-    RND(S[2],S[3],S[4],S[5],S[6],S[7],S[0],S[1],38,0x81c2c92e);
-    RND(S[1],S[2],S[3],S[4],S[5],S[6],S[7],S[0],39,0x92722c85);
-    RND(S[0],S[1],S[2],S[3],S[4],S[5],S[6],S[7],40,0xa2bfe8a1);
-    RND(S[7],S[0],S[1],S[2],S[3],S[4],S[5],S[6],41,0xa81a664b);
-    RND(S[6],S[7],S[0],S[1],S[2],S[3],S[4],S[5],42,0xc24b8b70);
-    RND(S[5],S[6],S[7],S[0],S[1],S[2],S[3],S[4],43,0xc76c51a3);
-    RND(S[4],S[5],S[6],S[7],S[0],S[1],S[2],S[3],44,0xd192e819);
-    RND(S[3],S[4],S[5],S[6],S[7],S[0],S[1],S[2],45,0xd6990624);
-    RND(S[2],S[3],S[4],S[5],S[6],S[7],S[0],S[1],46,0xf40e3585);
-    RND(S[1],S[2],S[3],S[4],S[5],S[6],S[7],S[0],47,0x106aa070);
-    RND(S[0],S[1],S[2],S[3],S[4],S[5],S[6],S[7],48,0x19a4c116);
-    RND(S[7],S[0],S[1],S[2],S[3],S[4],S[5],S[6],49,0x1e376c08);
-    RND(S[6],S[7],S[0],S[1],S[2],S[3],S[4],S[5],50,0x2748774c);
-    RND(S[5],S[6],S[7],S[0],S[1],S[2],S[3],S[4],51,0x34b0bcb5);
-    RND(S[4],S[5],S[6],S[7],S[0],S[1],S[2],S[3],52,0x391c0cb3);
-    RND(S[3],S[4],S[5],S[6],S[7],S[0],S[1],S[2],53,0x4ed8aa4a);
-    RND(S[2],S[3],S[4],S[5],S[6],S[7],S[0],S[1],54,0x5b9cca4f);
-    RND(S[1],S[2],S[3],S[4],S[5],S[6],S[7],S[0],55,0x682e6ff3);
-    RND(S[0],S[1],S[2],S[3],S[4],S[5],S[6],S[7],56,0x748f82ee);
-    RND(S[7],S[0],S[1],S[2],S[3],S[4],S[5],S[6],57,0x78a5636f);
-    RND(S[6],S[7],S[0],S[1],S[2],S[3],S[4],S[5],58,0x84c87814);
-    RND(S[5],S[6],S[7],S[0],S[1],S[2],S[3],S[4],59,0x8cc70208);
-    RND(S[4],S[5],S[6],S[7],S[0],S[1],S[2],S[3],60,0x90befffa);
-    RND(S[3],S[4],S[5],S[6],S[7],S[0],S[1],S[2],61,0xa4506ceb);
-    RND(S[2],S[3],S[4],S[5],S[6],S[7],S[0],S[1],62,0xbef9a3f7);
-    RND(S[1],S[2],S[3],S[4],S[5],S[6],S[7],S[0],63,0xc67178f2);
-
-#undef RND
-
-    /* feedback */
-    for (i = 0; i < 8; i++) {
-        state[i] = state[i] + S[i];
-    }
-    return TRUE;
-}
-
-/**
-   Initialize the hash state
-   @param md   The hash state you wish to initialize
-   @return CRYPT_OK if successful
-*/
-int sha256_init(sha256_state * md)
-{
-    md->length = 0;
-    md->curlen = 0;
-    md->state[0] = 0x6A09E667UL;
-    md->state[1] = 0xBB67AE85UL;
-    md->state[2] = 0x3C6EF372UL;
-    md->state[3] = 0xA54FF53AUL;
-    md->state[4] = 0x510E527FUL;
-    md->state[5] = 0x9B05688CUL;
-    md->state[6] = 0x1F83D9ABUL;
-    md->state[7] = 0x5BE0CD19UL;
-    return TRUE;
-}
-
-#if !defined(MIN)
-#define MIN(x,y) ((x)<(y)?(x):(y))
-#endif
-
-/**
-   Process a block of memory though the hash
-   @param md     The hash state
-   @param in     The data to hash
-   @param inlen  The length of the data (octets)
-   @return CRYPT_OK if successful
-*/
-int sha256_process(sha256_state * md, const unsigned char *in,
-                  unsigned long inlen)
-{
-    unsigned long n;
-    int err, block_size = sizeof(md->buf);
-
-    if (md->curlen > block_size)
-       return FALSE;
-
-    while (inlen > 0) {
-       if (md->curlen == 0 && inlen >= block_size) {
-           if ((err = sha256_compress(md->state, (unsigned char *)in)) != TRUE)
-               return err;
-           md->length += block_size * 8;
-           in             += block_size;
-           inlen          -= block_size;
-       } else {
-           n = MIN(inlen, (block_size - md->curlen));
-           memcpy(md->buf + md->curlen, in, (size_t)n);
-           md->curlen += n;
-           in             += n;
-           inlen          -= n;
-           if (md->curlen == block_size) {
-               if ((err = sha256_compress(md->state, md->buf)) != TRUE)
-                    return err;
-               md->length += block_size * 8;
-               md->curlen = 0;
-           }
-       }
-    }
-    return TRUE;
-}
-
-/**
-   Terminate the hash to get the digest
-   @param md  The hash state
-   @param out [out] The destination of the hash (32 bytes)
-   @return CRYPT_OK if successful
-*/
-int sha256_done(sha256_state * md, unsigned char *out)
-{
-    int i;
-
-    if (md->curlen >= sizeof(md->buf))
-        return FALSE;
-
-    /* increase the length of the message */
-    md->length += md->curlen * 8;
-
-    /* append the '1' bit */
-    md->buf[md->curlen++] = (unsigned char)0x80;
-
-    /* if the length is currently above 56 bytes we append zeros
-     * then compress.  Then we can fall back to padding zeros and length
-     * encoding like normal.
-     */
-    if (md->curlen > 56) {
-        while (md->curlen < 64) {
-            md->buf[md->curlen++] = (unsigned char)0;
-        }
-        sha256_compress(md->state, md->buf);
-        md->curlen = 0;
-    }
-
-    /* pad upto 56 bytes of zeroes */
-    while (md->curlen < 56) {
-        md->buf[md->curlen++] = (unsigned char)0;
-    }
-
-    /* store length */
-    SILC_PUT64_MSB(md->length, md->buf + 56);
-    sha256_compress(md->state, md->buf);
-
-    /* copy output */
-    for (i = 0; i < 8; i++)
-       SILC_PUT32_MSB(md->state[i], out + (4 * i));
-
-    return TRUE;
-}
diff --git a/lib/silccrypt/sha256.h b/lib/silccrypt/sha256.h
deleted file mode 100644 (file)
index fe847c0..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
-
-  sha256.h
-
-  Author: Pekka Riikonen <priikone@silcnet.org>
-
-  Copyright (C) 2005 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; either version 2 of the License, or
-  (at your option) any later version.
-  
-  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 SHA256_H
-#define SHA256_H
-
-/* 
- * SILC Hash API for SHA256
- */
-
-SILC_HASH_API_INIT(sha256);
-SILC_HASH_API_UPDATE(sha256);
-SILC_HASH_API_FINAL(sha256);
-SILC_HASH_API_TRANSFORM(sha256);
-SILC_HASH_API_CONTEXT_LEN(sha256);
-
-#endif /* SHA256_H */
diff --git a/lib/silccrypt/sha256_internal.h b/lib/silccrypt/sha256_internal.h
deleted file mode 100644 (file)
index 6f61fbb..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
-
-  sha256_internal.h
-
-  Author: Pekka Riikonen <priikone@silcnet.org>
-
-  Copyright (C) 2005 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; either version 2 of the License, or
-  (at your option) any later version.
-  
-  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 SHA256_INTERNAL_H
-#define SHA256_INTERNAL_H
-
-typedef struct {
-    SilcUInt64 length;
-    SilcUInt32 state[8];
-    SilcUInt32 curlen;
-    unsigned char buf[64];
-} sha256_state;
-
-int sha256_init(sha256_state * md);
-int sha256_process(sha256_state * md, const unsigned char *in, 
-                  unsigned long inlen);
-int sha256_done(sha256_state * md, unsigned char *hash);
-int sha256_compress(SilcUInt32 *state, unsigned char *buf);
-
-#endif /* SHA256_INTERNAL_H */
diff --git a/lib/silccrypt/silccipher.c b/lib/silccrypt/silccipher.c
deleted file mode 100644 (file)
index f7f6460..0000000
+++ /dev/null
@@ -1,386 +0,0 @@
-/*
-
-  silccipher.c
-
-  Author: Pekka Riikonen <priikone@silcnet.org>
-
-  Copyright (C) 1997 - 2007 Pekka Riikonen
-
-  This program is free software; you can redistribute it and/or modify
-  it under the terms of the GNU General Public License as published by
-  the Free Software Foundation; version 2 of the License.
-
-  This program is distributed in the hope that it will be useful,
-  but WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-  GNU General Public License for more details.
-
-*/
-/* $Id$ */
-
-#include "silc.h"
-#include "ciphers.h"           /* Includes cipher definitions */
-
-/* The SilcCipher context */
-struct SilcCipherStruct {
-  SilcCipherObject *cipher;
-  void *context;
-  unsigned char iv[SILC_CIPHER_MAX_IV_SIZE];
-};
-
-#ifndef SILC_SYMBIAN
-/* Dynamically registered list of ciphers. */
-SilcDList silc_cipher_list = NULL;
-#endif /* SILC_SYMBIAN */
-
-/* Macro to define cipher to cipher list */
-#define SILC_CIPHER_API_DEF(name, cipher, keylen, blocklen, ivlen, mode) \
-{ name, silc_##cipher##_set_key, silc_##cipher##_set_iv,               \
-  silc_##cipher##_encrypt, silc_##cipher##_decrypt,                    \
-  silc_##cipher##_context_len, keylen, blocklen, ivlen, mode }
-
-/* Static list of ciphers for silc_cipher_register_default(). */
-const SilcCipherObject silc_default_ciphers[] =
-{
-  SILC_CIPHER_API_DEF("aes-256-ctr", aes_ctr, 256, 16, 16,
-                     SILC_CIPHER_MODE_CTR),
-  SILC_CIPHER_API_DEF("aes-192-ctr", aes_ctr, 192, 16, 16,
-                     SILC_CIPHER_MODE_CTR),
-  SILC_CIPHER_API_DEF("aes-128-ctr", aes_ctr, 128, 16, 16,
-                     SILC_CIPHER_MODE_CTR),
-  SILC_CIPHER_API_DEF("aes-256-cbc", aes_cbc, 256, 16, 16,
-                     SILC_CIPHER_MODE_CBC),
-  SILC_CIPHER_API_DEF("aes-192-cbc", aes_cbc, 192, 16, 16,
-                     SILC_CIPHER_MODE_CBC),
-  SILC_CIPHER_API_DEF("aes-128-cbc", aes_cbc, 128, 16, 16,
-                     SILC_CIPHER_MODE_CBC),
-  SILC_CIPHER_API_DEF("twofish-256-cbc", twofish_cbc, 256, 16, 16,
-                     SILC_CIPHER_MODE_CBC),
-  SILC_CIPHER_API_DEF("twofish-192-cbc", twofish_cbc, 192, 16, 16,
-                     SILC_CIPHER_MODE_CBC),
-  SILC_CIPHER_API_DEF("twofish-128-cbc", twofish_cbc, 128, 16, 16,
-                     SILC_CIPHER_MODE_CBC),
-#ifdef SILC_DEBUG
-  SILC_CIPHER_API_DEF("none", none, 0, 0, 0, 0),
-#endif /* SILC_DEBUG */
-  { NULL, NULL, 0, 0, 0, 0 }
-};
-
-/* Register a new cipher into SILC. This is used at the initialization of
-   the SILC. This function allocates a new object for the cipher to be
-   registered. Therefore, if memory has been allocated for the object sent
-   as argument it has to be free'd after this function returns succesfully. */
-
-SilcBool silc_cipher_register(const SilcCipherObject *cipher)
-{
-#ifndef SILC_SYMBIAN
-  SilcCipherObject *new;
-
-  SILC_LOG_DEBUG(("Registering new cipher `%s'", cipher->name));
-
-  /* Check if exists already */
-  if (silc_cipher_list) {
-    SilcCipherObject *entry;
-    silc_dlist_start(silc_cipher_list);
-    while ((entry = silc_dlist_get(silc_cipher_list)) != SILC_LIST_END) {
-      if (!strcmp(entry->name, cipher->name))
-       return FALSE;
-    }
-  }
-
-  new = silc_calloc(1, sizeof(*new));
-  if (!new)
-    return FALSE;
-  new->name = strdup(cipher->name);
-  if (!new->name) {
-    silc_free(new);
-    return FALSE;
-  }
-  new->key_len = cipher->key_len;
-  new->block_len = cipher->block_len;
-  new->iv_len = cipher->iv_len;
-  new->set_key = cipher->set_key;
-  new->set_iv = cipher->set_iv;
-  new->encrypt = cipher->encrypt;
-  new->decrypt = cipher->decrypt;
-  new->context_len = cipher->context_len;
-  new->mode = cipher->mode;
-
-  /* Add to list */
-  if (silc_cipher_list == NULL)
-    silc_cipher_list = silc_dlist_init();
-  silc_dlist_add(silc_cipher_list, new);
-
-#endif /* SILC_SYMBIAN */
-  return TRUE;
-}
-
-/* Unregister a cipher from the SILC. */
-
-SilcBool silc_cipher_unregister(SilcCipherObject *cipher)
-{
-#ifndef SILC_SYMBIAN
-  SilcCipherObject *entry;
-
-  SILC_LOG_DEBUG(("Unregistering cipher"));
-
-  if (!silc_cipher_list)
-    return FALSE;
-
-  silc_dlist_start(silc_cipher_list);
-  while ((entry = silc_dlist_get(silc_cipher_list)) != SILC_LIST_END) {
-    if (cipher == SILC_ALL_CIPHERS || entry == cipher) {
-      silc_dlist_del(silc_cipher_list, entry);
-      silc_free(entry->name);
-      silc_free(entry);
-
-      if (silc_dlist_count(silc_cipher_list) == 0) {
-       silc_dlist_uninit(silc_cipher_list);
-       silc_cipher_list = NULL;
-      }
-
-      return TRUE;
-    }
-  }
-
-#endif /* SILC_SYMBIAN */
-  return FALSE;
-}
-
-/* Function that registers all the default ciphers (all builtin ciphers).
-   The application may use this to register the default ciphers if specific
-   ciphers in any specific order is not wanted. */
-
-SilcBool silc_cipher_register_default(void)
-{
-#ifndef SILC_SYMBIAN
-  int i;
-
-  for (i = 0; silc_default_ciphers[i].name; i++)
-    silc_cipher_register(&(silc_default_ciphers[i]));
-
-#endif /* SILC_SYMBIAN */
-  return TRUE;
-}
-
-SilcBool silc_cipher_unregister_all(void)
-{
-#ifndef SILC_SYMBIAN
-  SilcCipherObject *entry;
-
-  if (!silc_cipher_list)
-    return FALSE;
-
-  silc_dlist_start(silc_cipher_list);
-  while ((entry = silc_dlist_get(silc_cipher_list)) != SILC_LIST_END) {
-    silc_cipher_unregister(entry);
-    if (!silc_cipher_list)
-      break;
-  }
-#endif /* SILC_SYMBIAN */
-  return TRUE;
-}
-
-/* Allocates a new SILC cipher object. Function returns 1 on succes and 0
-   on error. The allocated cipher is returned in new_cipher argument. The
-   caller must set the key to the cipher after this function has returned
-   by calling the ciphers set_key function. */
-
-SilcBool silc_cipher_alloc(const unsigned char *name, SilcCipher *new_cipher)
-{
-  SilcCipherObject *entry = NULL;
-
-  SILC_LOG_DEBUG(("Allocating new cipher object"));
-
-#ifndef SILC_SYMBIAN
-  if (silc_cipher_list) {
-    silc_dlist_start(silc_cipher_list);
-    while ((entry = silc_dlist_get(silc_cipher_list)) != SILC_LIST_END) {
-      if (!strcmp(entry->name, name))
-       break;
-    }
-  }
-#else
-  {
-    /* On EPOC which don't have globals we check our constant cipher list. */
-    int i;
-    for (i = 0; silc_default_ciphers[i].name; i++) {
-      if (!strcmp(silc_default_ciphers[i].name, name)) {
-       entry = (SilcCipherObject *)&(silc_default_ciphers[i]);
-       break;
-      }
-    }
-  }
-#endif /* SILC_SYMBIAN */
-
-  if (entry) {
-    *new_cipher = silc_calloc(1, sizeof(**new_cipher));
-    if (!(*new_cipher))
-      return FALSE;
-    (*new_cipher)->cipher = entry;
-    (*new_cipher)->context = silc_calloc(1, entry->context_len());
-    if (!(*new_cipher)->context) {
-      silc_free(*new_cipher);
-      return FALSE;
-    }
-    return TRUE;
-  }
-
-  return FALSE;
-}
-
-/* Free's the given cipher. */
-
-void silc_cipher_free(SilcCipher cipher)
-{
-  if (cipher) {
-    silc_free(cipher->context);
-    silc_free(cipher);
-  }
-}
-
-/* Returns TRUE if cipher `name' is supported. */
-
-SilcBool silc_cipher_is_supported(const unsigned char *name)
-{
-#ifndef SILC_SYMBIAN
-  SilcCipherObject *entry;
-
-  if (silc_cipher_list) {
-    silc_dlist_start(silc_cipher_list);
-    while ((entry = silc_dlist_get(silc_cipher_list)) != SILC_LIST_END) {
-      if (!strcmp(entry->name, name))
-       return TRUE;
-    }
-  }
-#else
-  {
-    int i;
-    for (i = 0; silc_default_ciphers[i].name; i++)
-      if (!strcmp(silc_default_ciphers[i].name, name))
-       return TRUE;
-  }
-#endif /* SILC_SYMBIAN */
-  return FALSE;
-}
-
-/* Returns comma separated list of supported ciphers. */
-
-char *silc_cipher_get_supported(void)
-{
-  SilcCipherObject *entry;
-  char *list = NULL;
-  int len = 0;
-
-#ifndef SILC_SYMBIAN
-  if (silc_cipher_list) {
-    silc_dlist_start(silc_cipher_list);
-    while ((entry = silc_dlist_get(silc_cipher_list)) != SILC_LIST_END) {
-      len += strlen(entry->name);
-      list = silc_realloc(list, len + 1);
-
-      memcpy(list + (len - strlen(entry->name)),
-            entry->name, strlen(entry->name));
-      memcpy(list + len, ",", 1);
-      len++;
-    }
-  }
-#else
-  {
-    int i;
-    for (i = 0; silc_default_ciphers[i].name; i++) {
-      entry = (SilcCipherObject *)&(silc_default_ciphers[i]);
-      len += strlen(entry->name);
-      list = silc_realloc(list, len + 1);
-
-      memcpy(list + (len - strlen(entry->name)),
-            entry->name, strlen(entry->name));
-      memcpy(list + len, ",", 1);
-      len++;
-    }
-  }
-#endif /* SILC_SYMBIAN */
-
-  list[len - 1] = 0;
-
-  return list;
-}
-
-/* Encrypts */
-
-SilcBool silc_cipher_encrypt(SilcCipher cipher, const unsigned char *src,
-                            unsigned char *dst, SilcUInt32 len,
-                            unsigned char *iv)
-{
-  return cipher->cipher->encrypt(cipher->context, src, dst, len,
-                                iv ? iv : cipher->iv);
-}
-
-/* Decrypts */
-
-SilcBool silc_cipher_decrypt(SilcCipher cipher, const unsigned char *src,
-                            unsigned char *dst, SilcUInt32 len,
-                            unsigned char *iv)
-{
-  return cipher->cipher->decrypt(cipher->context, src, dst, len,
-                                iv ? iv : cipher->iv);
-}
-
-/* Sets the key for the cipher */
-
-SilcBool silc_cipher_set_key(SilcCipher cipher, const unsigned char *key,
-                            SilcUInt32 keylen, SilcBool encryption)
-{
-  return cipher->cipher->set_key(cipher->context, key, keylen, encryption);
-}
-
-/* Sets the IV (initial vector) for the cipher. */
-
-void silc_cipher_set_iv(SilcCipher cipher, const unsigned char *iv)
-{
-  if (iv)
-    memmove(&cipher->iv, iv, cipher->cipher->iv_len);
-  cipher->cipher->set_iv(cipher->context, iv);
-}
-
-/* Returns the IV (initial vector) of the cipher. */
-
-unsigned char *silc_cipher_get_iv(SilcCipher cipher)
-{
-  return cipher->iv;
-}
-
-/* Returns the key length of the cipher. */
-
-SilcUInt32 silc_cipher_get_key_len(SilcCipher cipher)
-{
-  return cipher->cipher->key_len;
-}
-
-/* Returns the block size of the cipher. */
-
-SilcUInt32 silc_cipher_get_block_len(SilcCipher cipher)
-{
-  return cipher->cipher->block_len;
-}
-
-/* Returns the IV length of the cipher. */
-
-SilcUInt32 silc_cipher_get_iv_len(SilcCipher cipher)
-{
-  return cipher->cipher->iv_len;
-}
-
-/* Returns the name of the cipher */
-
-const char *silc_cipher_get_name(SilcCipher cipher)
-{
-  return (const char *)cipher->cipher->name;
-}
-
-/* Returns cipher mode */
-
-SilcCipherMode silc_cipher_get_mode(SilcCipher cipher)
-{
-  return cipher->cipher->mode;
-}
diff --git a/lib/silccrypt/silccipher.h b/lib/silccrypt/silccipher.h
deleted file mode 100644 (file)
index 3afede6..0000000
+++ /dev/null
@@ -1,429 +0,0 @@
-/*
-
-  silccipher.h
-
-  Author: Pekka Riikonen <priikone@silcnet.org>
-
-  Copyright (C) 1997 - 2007 Pekka Riikonen
-
-  This program is free software; you can redistribute it and/or modify
-  it under the terms of the GNU General Public License as published by
-  the Free Software Foundation; version 2 of the License.
-
-  This program is distributed in the hope that it will be useful,
-  but WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-  GNU General Public License for more details.
-
-*/
-
-#ifndef SILCCIPHER_H
-#define SILCCIPHER_H
-
-/****h* silccrypt/SILC Cipher Interface
- *
- * DESCRIPTION
- *
- * This is the interface for cipher functions.  It provides cipher
- * registering and unregistering routines, encryption and decryption
- * routines.
- *
- ***/
-
-/****s* silccrypt/SilcCipherAPI/SilcCipher
- *
- * NAME
- *
- *    typedef struct { ... } SilcCipher;
- *
- * DESCRIPTION
- *
- *    This context is the actual cipher context and is allocated
- *    by silc_cipher_alloc and given as argument usually to all
- *    silc_cipher _* functions.  It is freed by the silc_cipher_free
- *    function.
- *
- ***/
-typedef struct SilcCipherStruct *SilcCipher;
-
-/* The default SILC Cipher object to represent any cipher in SILC. */
-typedef struct {
-  char *name;
-  SilcBool (*set_key)(void *, const unsigned char *, SilcUInt32, SilcBool);
-  void (*set_iv)(void *, const unsigned char *);
-  SilcBool (*encrypt)(void *, const unsigned char *, unsigned char *,
-                     SilcUInt32, unsigned char *);
-  SilcBool (*decrypt)(void *, const unsigned char *, unsigned char *,
-                     SilcUInt32, unsigned char *);
-  SilcUInt32 (*context_len)();
-  unsigned int key_len   : 10;
-  unsigned int block_len : 8;
-  unsigned int iv_len    : 8;
-  unsigned int mode      : 6;
-} SilcCipherObject;
-
-#define SILC_CIPHER_MAX_IV_SIZE 16
-
-/* Marks for all ciphers in silc. This can be used in silc_cipher_unregister
-   to unregister all ciphers at once. */
-#define SILC_ALL_CIPHERS ((SilcCipherObject *)1)
-
-/* Static list of ciphers for silc_cipher_register_default(). */
-extern DLLAPI const SilcCipherObject silc_default_ciphers[];
-
-/* Default cipher in the SILC protocol */
-#define SILC_DEFAULT_CIPHER "aes-256-cbc"
-
-/* Macros */
-
-/* Function names in SILC Crypto modules. The name of the cipher
-   is appended into these names and used to the get correct symbol out
-   of the module. All SILC Crypto API compliant modules must support
-   these function names (use macros below to assure this). */
-#define SILC_CIPHER_SIM_SET_KEY "set_key"
-#define SILC_CIPHER_SIM_ENCRYPT "encrypt"
-#define SILC_CIPHER_SIM_DECRYPT "decrypt"
-#define SILC_CIPHER_SIM_CONTEXT_LEN "context_len"
-
-/* These macros can be used to implement the SILC Crypto API and to avoid
-   errors in the API these macros should be used always. */
-#define SILC_CIPHER_API_SET_KEY(cipher)                                \
-SilcBool silc_##cipher##_set_key(void *context,                        \
-                                const unsigned char *key,      \
-                                SilcUInt32 keylen,             \
-                                SilcBool encryption)
-#define SILC_CIPHER_API_SET_IV(cipher)                         \
-void silc_##cipher##_set_iv(void *context,                     \
-                           const unsigned char *iv)
-#define SILC_CIPHER_API_ENCRYPT(cipher)                                \
-SilcBool silc_##cipher##_encrypt(void *context,                        \
-                                const unsigned char *src,      \
-                                unsigned char *dst,            \
-                                SilcUInt32 len,                \
-                                unsigned char *iv)
-#define SILC_CIPHER_API_DECRYPT(cipher)                                \
-SilcBool silc_##cipher##_decrypt(void *context,                        \
-                                const unsigned char *src,      \
-                                unsigned char *dst,            \
-                                SilcUInt32 len,                \
-                                unsigned char *iv)
-#define SILC_CIPHER_API_CONTEXT_LEN(cipher)    \
-SilcUInt32 silc_##cipher##_context_len()
-
-/****d* silccrypt/SilcCipherAPI/SilcCipherMode
- *
- * NAME
- *
- *    typedef enum { ... } SilcCipherMode;
- *
- * DESCRIPTION
- *
- *    Cipher modes.
- *
- * SOURCE
- */
-typedef enum {
-  SILC_CIPHER_MODE_ECB = 1,    /* ECB mode */
-  SILC_CIPHER_MODE_CBC = 2,    /* CBC mode */
-  SILC_CIPHER_MODE_CTR = 3,    /* CTR mode */
-  SILC_CIPHER_MODE_CFB = 4,    /* CFB mode */
-  SILC_CIPHER_MODE_OFB = 5,    /* OFB mode */
-} SilcCipherMode;
-/***/
-
-/* Prototypes */
-
-/****f* silccrypt/SilcCipherAPI/silc_cipher_register
- *
- * SYNOPSIS
- *
- *    SilcBool silc_cipher_register(const SilcCipherObject *cipher);
- *
- * DESCRIPTION
- *
- *    Register a new cipher into SILC. This is used at the initialization of
- *    the SILC. This function allocates a new object for the cipher to be
- *    registered. Therefore, if memory has been allocated for the object sent
- *    as argument it has to be free'd after this function returns succesfully.
- *
- ***/
-SilcBool silc_cipher_register(const SilcCipherObject *cipher);
-
-/****f* silccrypt/SilcCipherAPI/silc_cipher_unregister
- *
- * SYNOPSIS
- *
- *    SilcBool silc_cipher_unregister(SilcCipherObject *cipher);
- *
- * DESCRIPTION
- *
- *    Unregister a cipher from the SILC.
- *
- ***/
-SilcBool silc_cipher_unregister(SilcCipherObject *cipher);
-
-/****f* silccrypt/SilcCipherAPI/silc_cipher_register_default
- *
- * SYNOPSIS
- *
- *    SilcBool silc_cipher_register_default(void);
- *
- * DESCRIPTION
- *
- *    Function that registers all the default ciphers (all builtin ciphers).
- *    The application may use this to register the default ciphers if specific
- *    ciphers in any specific order is not wanted.
- *
- ***/
-SilcBool silc_cipher_register_default(void);
-
-/****f* silccrypt/SilcCipherAPI/silc_cipher_unregister_all
- *
- * SYNOPSIS
- *
- *    SilcBool silc_cipher_unregister_all(void);
- *
- * DESCRIPTION
- *
- *    Unregisters all ciphers.
- *
- ***/
-SilcBool silc_cipher_unregister_all(void);
-
-/****f* silccrypt/SilcCipherAPI/silc_cipher_alloc
- *
- * SYNOPSIS
- *
- *    SilcBool silc_cipher_alloc(const unsigned char *name,
- *                               SilcCipher *new_cipher);
- *
- * DESCRIPTION
- *
- *    Allocates a new SILC cipher object. Function returns 1 on succes and 0
- *    on error. The allocated cipher is returned in new_cipher argument. The
- *    caller must set the key to the cipher after this function has returned
- *    by calling the ciphers set_key function.
- *
- *    The following ciphers are supported:
- *
- *    aes-256-ctr            AES-256, Counter mode
- *    aes-192-ctr            AES-192, Counter mode
- *    aes-128-ctr            AES,128, Counter mode
- *    aes-256-cbc            AES-256, Cipher block chaining mode
- *    aes-192-cbc            AES-192, Cipher block chaining mode
- *    aes-128-cbc            AES,128, Cipher block chaining mode
- *    twofish-256-cbc        Twofish-256, Cipher block chaining mode
- *    twofish-192-cbc        Twofish-192, Cipher block chaining mode
- *    twofish-128-cbc        Twofish-128, Cipher block chaining mode
- *
- *    Notes about modes:
- *
- *    The CTR is normal counter mode.  The CTR mode does not require the
- *    plaintext length to be multiple by the cipher block size.  If the last
- *    plaintext block is shorter the remaining bits of the key stream are
- *    used next time silc_cipher_encrypt is called.  If silc_cipher_set_iv
- *    is called it will reset the counter for a new block (discarding any
- *    remaining bits from previous key stream).
- *
- *    The CBC is mode is a standard CBC mode.  The plaintext length must be
- *    multiple by the cipher block size.  If it isn't the plaintext must be
- *    padded.
- *
- ***/
-SilcBool silc_cipher_alloc(const unsigned char *name, SilcCipher *new_cipher);
-
-/****f* silccrypt/SilcCipherAPI/silc_cipher_free
- *
- * SYNOPSIS
- *
- *    void silc_cipher_free(SilcCipher cipher);
- *
- * DESCRIPTION
- *
- *    Frees the given cipher.
- *
- ***/
-void silc_cipher_free(SilcCipher cipher);
-
-/****f* silccrypt/SilcCipherAPI/silc_cipher_is_supported
- *
- * SYNOPSIS
- *
- * SilcBool silc_cipher_is_supported(const unsigned char *name);
- *
- * DESCRIPTION
- *
- *    Returns TRUE if cipher `name' is supported.
- *
- ***/
-SilcBool silc_cipher_is_supported(const unsigned char *name);
-
-/****f* silccrypt/SilcCipherAPI/silc_cipher_get_supported
- *
- * SYNOPSIS
- *
- *    char *silc_cipher_get_supported(void);
- *
- * DESCRIPTION
- *
- *    Returns comma separated list of supported ciphers.
- *
- ***/
-char *silc_cipher_get_supported(void);
-
-/****f* silccrypt/SilcCipherAPI/silc_cipher_encrypt
- *
- * SYNOPSIS
- *
- *    SilcBool silc_cipher_encrypt(SilcCipher cipher,
- *                                 const unsigned char *src,
- *                                 unsigned char *dst, SilcUInt32 len,
- *                                 unsigned char *iv);
- *
- * DESCRIPTION
- *
- *    Encrypts data from `src' into `dst' with the specified cipher and
- *    Initial Vector (IV).  If the `iv' is NULL then the cipher's internal
- *    IV is used.  The `src' and `dst' maybe same buffer.
- *
- ***/
-SilcBool silc_cipher_encrypt(SilcCipher cipher, const unsigned char *src,
-                            unsigned char *dst, SilcUInt32 len,
-                            unsigned char *iv);
-
-/****f* silccrypt/SilcCipherAPI/silc_cipher_decrypt
- *
- * SYNOPSIS
- *
- *    SilcBool silc_cipher_decrypt(SilcCipher cipher,
- *                                 const unsigned char *src,
- *                                 unsigned char *dst, SilcUInt32 len,
- *                                 unsigned char *iv);
- *
- * DESCRIPTION
- *
- *    Decrypts data from `src' into `dst' with the specified cipher and
- *    Initial Vector (IV).  If the `iv' is NULL then the cipher's internal
- *    IV is used.  The `src' and `dst' maybe same buffer.
- *
- ***/
-SilcBool silc_cipher_decrypt(SilcCipher cipher, const unsigned char *src,
-                            unsigned char *dst, SilcUInt32 len,
-                            unsigned char *iv);
-
-/****f* silccrypt/SilcCipherAPI/silc_cipher_set_key
- *
- * SYNOPSIS
- *
- *    SilcBool silc_cipher_set_key(SilcCipher cipher, const unsigned char *key,
- *                                 SilcUInt32 keylen, SilcBool encryption);
- *
- * DESCRIPTION
- *
- *    Sets the key for the cipher.  The `keylen' is the key length in
- *    bits.  If the `encryption' is TRUE the key is for encryption, if FALSE
- *    the key is for decryption.
- *
- ***/
-SilcBool silc_cipher_set_key(SilcCipher cipher, const unsigned char *key,
-                            SilcUInt32 keylen, SilcBool encryption);
-
-/****f* silccrypt/SilcCipherAPI/silc_cipher_set_iv
- *
- * SYNOPSIS
- *
- *    void silc_cipher_set_iv(SilcCipher cipher, const unsigned char *iv);
- *
- * DESCRIPTION
- *
- *    Sets the IV (initial vector) for the cipher.  The `iv' must be
- *    the size of the block size of the cipher.  If `iv' is NULL this
- *    does not do anything.
- *
- *    If the encryption mode is CTR (Counter mode) this also resets the
- *    the counter for a new block.  This is done also if `iv' is NULL.
- *
- ***/
-void silc_cipher_set_iv(SilcCipher cipher, const unsigned char *iv);
-
-/****f* silccrypt/SilcCipherAPI/silc_cipher_get_iv
- *
- * SYNOPSIS
- *
- *    unsigned char *silc_cipher_get_iv(SilcCipher cipher);
- *
- * DESCRIPTION
- *
- *    Returns the IV (initial vector) of the cipher.  The returned
- *    pointer must not be freed by the caller.  If the caller modifies
- *    the returned pointer the IV inside cipher is also modified.
- *
- ***/
-unsigned char *silc_cipher_get_iv(SilcCipher cipher);
-
-/****f* silccrypt/SilcCipherAPI/silc_cipher_get_key_len
- *
- * SYNOPSIS
- *
- *    SilcUInt32 silc_cipher_get_key_len(SilcCipher cipher);
- *
- * DESCRIPTION
- *
- *    Returns the key length of the cipher in bits.
- *
- ***/
-SilcUInt32 silc_cipher_get_key_len(SilcCipher cipher);
-
-/****f* silccrypt/SilcCipherAPI/silc_cipher_get_block_len
- *
- * SYNOPSIS
- *
- *    SilcUInt32 silc_cipher_get_block_len(SilcCipher cipher);
- *
- * DESCRIPTION
- *
- *    Returns the block size of the cipher in bytes.
- *
- ***/
-SilcUInt32 silc_cipher_get_block_len(SilcCipher cipher);
-
-/****f* silccrypt/SilcCipherAPI/silc_cipher_get_iv_len
- *
- * SYNOPSIS
- *
- *    SilcUInt32 silc_cipher_get_iv_len(SilcCipher cipher);
- *
- * DESCRIPTION
- *
- *    Returns the IV length of the cipher in bytes.
- *
- ***/
-SilcUInt32 silc_cipher_get_iv_len(SilcCipher cipher);
-
-/****f* silccrypt/SilcCipherAPI/silc_cipher_get_name
- *
- * SYNOPSIS
- *
- *    const char *silc_cipher_get_name(SilcCipher cipher);
- *
- * DESCRIPTION
- *
- *    Returns the name of the cipher.
- *
- ***/
-const char *silc_cipher_get_name(SilcCipher cipher);
-
-/****f* silccrypt/SilcCipherAPI/silc_cipher_get_mode
- *
- * SYNOPSIS
- *
- *    SilcCipherMode silc_cipher_get_mode(SilcCipher cipher);
- *
- * DESCRIPTION
- *
- *    Returns the cipher mode.
- *
- ***/
-SilcCipherMode silc_cipher_get_mode(SilcCipher cipher);
-
-#endif /* SILCCIPHER_H */
diff --git a/lib/silccrypt/silcdh.h b/lib/silccrypt/silcdh.h
deleted file mode 100644 (file)
index e66faa8..0000000
+++ /dev/null
@@ -1,173 +0,0 @@
-/*
-
-  silcdh.h 
-
-  Author: Pekka Riikonen <priikone@silcnet.org>
-
-  Copyright (C) 2001 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.
-
-*/
-
-/****h* silccrypt/SilcDH/silcdh.h
- *
- * DESCRIPTION
- *
- * PKCS #3 compliant Diffie Hellman key agreement protocol implementation.
- * This is used as part of SKE (SILC Key Exchange) protocol.
- *
- ***/
-
-#ifndef SILCDH_H
-#define SILCDH_H
-
-#include "silcmp.h"
-
-/****s* silccrypt/SilcDH/SilcDH
- *
- * NAME
- * 
- *    typedef struct SilcDHStruct *SilcDH;
- *
- * DESCRIPTION
- *
- *    This context is allocated by silc_dh_alloc and is given as argument
- *    to all silc_dh_* functions.  It is freed by silc_dh_free function.
- *
- ***/
-typedef struct SilcDHStruct *SilcDH;
-
-/* XXX Move to source file */
-/* Diffie Hellman context. This includes the DH parameters including the
-   negotiated key material. */
-struct SilcDHStruct {
-  SilcMPInt *g;                     /* Global base (generator) */
-  SilcMPInt *p;                     /* Global prime (modulus, prime) */
-  SilcMPInt *lpf;           /* Largest prime factor (prime) */
-  SilcMPInt *my_x;          /* x, My private value (random) */
-  SilcMPInt *my_y;          /* y, My public value (y = g ^ x mod p) */
-  SilcMPInt *your_y;        /* y', Your public value (y' = g ^ x' mod p) */
-  SilcMPInt *z;                     /* The computed secret key (z = y' ^ x mod p) */
-};
-
-/****f* silccrypt/SilcDH/silc_dh_alloc
- *
- * SYNOPSIS
- *    
- *    SilcDH silc_dh_alloc(SilcMPInt *g, SilcMPInt *p, SilcMPInt *lpf);
- * 
- * DESCRIPTION
- *
- *    Allocate SilcDH context. The `g' is the public base generator used
- *    in the negotiation, the `p' is the public prime used in the
- *    negotiation and the `lpf' is largest prime factor of p defined
- *    publicly as well. The `lpf' is optional and if it is not supplied
- *    then the private values generated satifies 0 < x < p - 1 instead
- *    of 0 < x < lpf. Returns NULL on error or allocated SilcDH context
- *    on success. 
- *
- ***/
-SilcDH silc_dh_alloc(SilcMPInt *g, SilcMPInt *p, SilcMPInt *lpf);
-
-/****f* silccrypt/SilcDH/silc_dh_free
- *
- * SYNOPSIS
- *
- *    void silc_dh_free(SilcDH dh);
- *
- * DESCRIPTION
- *
- *    Free the SilcDH context. Frees all the allocated data inside the 
- *    SilcDH context. 
- *
- ***/
-void silc_dh_free(SilcDH dh);
-
-/****f* silccrypt/SilcDH/silc_dh_generate_private
- *
- * SYNOPSIS
- *
- *    SilcBool silc_dh_generate_private(SilcDH dh, const SilcMPInt **x);
- *
- * DESCRIPTION
- *
- *    Generates random private value `x' such that 0 < x < lpf at most of
- *    length of lpf. Returns FALSE if the random number could not be generated.
- *    Returns the generated value into `x' pointer sent as argument, unless
- *    the `x' is NULL. The returned `x' must not be freed by the caller. 
- *
- ***/
-SilcBool silc_dh_generate_private(SilcDH dh, const SilcMPInt **x);
-
-/****f* silccrypt/SilcDH/silc_dh_compute_public
- *
- * SYNOPSIS
- *
- *    SilcBool silc_dh_compute_public(SilcDH dh, const SilcMPInt **y);
- *
- * DESCRIPTION
- *
- *    Computes the public key y = g ^ x mod p, and returns it to the `y'
- *    pointer sent as argument, unless the `y' is NULL. Returns FALSE if
- *    the computation could not be performed. The returned `y' must not be
- *    freed by the caller. 
- *
- ***/
-SilcBool silc_dh_compute_public(SilcDH dh, const SilcMPInt **y);
-
-/****f* silccrypt/SilcDH/silc_dh_remote_public
- *
- * SYNOPSIS
- *
- *    SilcBool silc_dh_compute_public(SilcDH dh, SilcMPInt *y);
- *
- * DESCRIPTION
- *
- *    Sets the remote end's public value y' into the SilcDH context.
- *    This must be done before computing the secret key. Returns FALSE 
- *    on error. 
- *
- ***/
-SilcBool silc_dh_set_remote_public(SilcDH dh, SilcMPInt *y);
-
-/****f* silccrypt/SilcDH/silc_dh_compute_key
- *
- * SYNOPSIS
- *
- *    SilcBool silc_dh_compute_key(SilcDH dh, const SilcMPInt **z);
- *
- * DESCRIPTION
- *
- *    Computes the secret key z = y' ^ x mod p, and returns the key to the
- *    `z' pointer sent as argument, unless the `z' is NULL. Returns FALSE if
- *    the computation could not be performed. The returned `z' must not be
- *    freed by the caller. 
- *
- ***/
-SilcBool silc_dh_compute_key(SilcDH dh, const SilcMPInt **z);
-
-/****f* silccrypt/SilcDH/silc_dh_remote_public
- *
- * SYNOPSIS
- *
- *    SilcBool silc_dh_compute_key_data(SilcDH dh, unsigned char **z, 
- *                                  SilcUInt32 *z_len);
- *
- * DESCRIPTION
- *
- *    Same as above but returns the computed secret key as octet binary
- *    string.  The caller must free the returned binary string.
- *
- ***/
-SilcBool silc_dh_compute_key_data(SilcDH dh, unsigned char **z, 
-                             SilcUInt32 *z_len);
-
-#endif
diff --git a/lib/silccrypt/silchash.c b/lib/silccrypt/silchash.c
deleted file mode 100644 (file)
index 59cdf7f..0000000
+++ /dev/null
@@ -1,497 +0,0 @@
-/*
-
-  silchash.c
-
-  Author: Pekka Riikonen <priikone@silcnet.org>
-
-  Copyright (C) 1997 - 2007 Pekka Riikonen
-
-  This program is free software; you can redistribute it and/or modify
-  it under the terms of the GNU General Public License as published by
-  the Free Software Foundation; version 2 of the License.
-
-  This program is distributed in the hope that it will be useful,
-  but WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-  GNU General Public License for more details.
-
-*/
-/* $Id$ */
-
-#include "silc.h"
-
-#include "md5.h"
-#include "sha1.h"
-#include "sha256.h"
-
-/* The main SILC hash structure. */
-struct SilcHashStruct {
-  SilcHashObject *hash;
-  void *context;
-};
-
-#ifndef SILC_SYMBIAN
-/* List of dynamically registered hash functions. */
-SilcDList silc_hash_list = NULL;
-#endif /* SILC_SYMBIAN */
-
-/* Default hash functions for silc_hash_register_default(). */
-const SilcHashObject silc_default_hash[] =
-{
-  { "sha256", "2.16.840.1.101.3.4.2.1",
-    32, 64, silc_sha256_init, silc_sha256_update, silc_sha256_final,
-    silc_sha256_transform, silc_sha256_context_len },
-  { "sha1", "1.3.14.3.2.26",
-    20, 64, silc_sha1_init, silc_sha1_update, silc_sha1_final,
-    silc_sha1_transform, silc_sha1_context_len },
-  { "md5", "1.2.840.113549.2.5",
-    16, 64, silc_md5_init, silc_md5_update, silc_md5_final,
-    silc_md5_transform, silc_md5_context_len },
-
-  { NULL, NULL, 0, 0, NULL, NULL, NULL, NULL, NULL }
-};
-
-/* Registers a new hash function into the SILC. This function is used at
-   the initialization of the SILC. */
-
-SilcBool silc_hash_register(const SilcHashObject *hash)
-{
-#ifndef SILC_SYMBIAN
-  SilcHashObject *new;
-
-  SILC_LOG_DEBUG(("Registering new hash function `%s'", hash->name));
-
-  /* Check for existing */
-  if (silc_hash_list) {
-    SilcHashObject *entry;
-    silc_dlist_start(silc_hash_list);
-    while ((entry = silc_dlist_get(silc_hash_list)) != SILC_LIST_END) {
-      if (!strcmp(entry->name, hash->name))
-       return FALSE;
-    }
-  }
-
-  new = silc_calloc(1, sizeof(*new));
-  if (!new)
-    return FALSE;
-  new->name = strdup(hash->name);
-  if (!new->name) {
-    silc_free(new);
-    return FALSE;
-  }
-  new->oid = strdup(hash->oid);
-  if (!new->oid) {
-    silc_free(new);
-    return FALSE;
-  }
-  new->hash_len = hash->hash_len;
-  new->block_len = hash->block_len;
-  new->init = hash->init;
-  new->update = hash->update;
-  new->final = hash->final;
-  new->transform = hash->transform;
-  new->context_len = hash->context_len;
-
-  /* Add to list */
-  if (silc_hash_list == NULL)
-    silc_hash_list = silc_dlist_init();
-  silc_dlist_add(silc_hash_list, new);
-
-#endif /* SILC_SYMBIAN */
-  return TRUE;
-}
-
-/* Unregister a hash function from the SILC. */
-
-SilcBool silc_hash_unregister(SilcHashObject *hash)
-{
-#ifndef SILC_SYMBIAN
-  SilcHashObject *entry;
-
-  SILC_LOG_DEBUG(("Unregistering hash function"));
-
-  if (!silc_hash_list)
-    return FALSE;
-
-  silc_dlist_start(silc_hash_list);
-  while ((entry = silc_dlist_get(silc_hash_list)) != SILC_LIST_END) {
-    if (hash == SILC_ALL_HASH_FUNCTIONS || entry == hash) {
-      silc_dlist_del(silc_hash_list, entry);
-      silc_free(entry->name);
-      silc_free(entry->oid);
-      silc_free(entry);
-
-      if (silc_dlist_count(silc_hash_list) == 0) {
-       silc_dlist_uninit(silc_hash_list);
-       silc_hash_list = NULL;
-      }
-
-      return TRUE;
-    }
-  }
-
-#endif /* SILC_SYMBIAN */
-  return FALSE;
-}
-
-/* Function that registers all the default hash funcs (all builtin ones).
-   The application may use this to register the default hash funcs if
-   specific hash funcs in any specific order is not wanted. */
-
-SilcBool silc_hash_register_default(void)
-{
-#ifndef SILC_SYMBIAN
-  int i;
-
-  for (i = 0; silc_default_hash[i].name; i++)
-    silc_hash_register(&(silc_default_hash[i]));
-
-#endif /* SILC_SYMBIAN */
-  return TRUE;
-}
-
-SilcBool silc_hash_unregister_all(void)
-{
-#ifndef SILC_SYMBIAN
-  SilcHashObject *entry;
-
-  if (!silc_hash_list)
-    return FALSE;
-
-  silc_dlist_start(silc_hash_list);
-  while ((entry = silc_dlist_get(silc_hash_list)) != SILC_LIST_END) {
-    silc_hash_unregister(entry);
-    if (!silc_hash_list)
-      break;
-  }
-#endif /* SILC_SYMBIAN */
-  return TRUE;
-}
-
-/* Allocates a new SilcHash object. New object is returned into new_hash
-   argument. */
-
-SilcBool silc_hash_alloc(const unsigned char *name, SilcHash *new_hash)
-{
-  SilcHashObject *entry = NULL;
-
-  SILC_LOG_DEBUG(("Allocating new hash %s", name));
-
-#ifndef SILC_SYMBIAN
-  if (silc_hash_list) {
-    silc_dlist_start(silc_hash_list);
-    while ((entry = silc_dlist_get(silc_hash_list)) != SILC_LIST_END) {
-      if (!strcmp(entry->name, name))
-       break;
-    }
-  }
-#else
-  {
-    /* On EPOC which don't have globals we check our constant hash list. */
-    int i;
-    for (i = 0; silc_default_hash[i].name; i++) {
-      if (!strcmp(silc_default_hash[i].name, name)) {
-       entry = (SilcHashObject *)&(silc_default_hash[i]);
-       break;
-      }
-    }
-  }
-#endif /* SILC_SYMBIAN */
-
-  if (entry) {
-    *new_hash = silc_calloc(1, sizeof(**new_hash));
-    if (!(*new_hash))
-      return FALSE;
-    (*new_hash)->hash = entry;
-    (*new_hash)->context = silc_calloc(1, entry->context_len());
-    if (!(*new_hash)->context) {
-      silc_free(*new_hash);
-      return FALSE;
-    }
-    return TRUE;
-  }
-
-  return FALSE;
-}
-
-/* Allocate hash by OID string */
-
-SilcBool silc_hash_alloc_by_oid(const char *oid, SilcHash *new_hash)
-{
-  SilcHashObject *entry = NULL;
-
-  SILC_LOG_DEBUG(("Allocating new hash %s", oid));
-
-#ifndef SILC_SYMBIAN
-  if (silc_hash_list) {
-    silc_dlist_start(silc_hash_list);
-    while ((entry = silc_dlist_get(silc_hash_list)) != SILC_LIST_END) {
-      if (!strcmp(entry->oid, oid))
-       break;
-    }
-  }
-#else
-  {
-    /* On EPOC which don't have globals we check our constant hash list. */
-    int i;
-    for (i = 0; silc_default_hash[i].oid; i++) {
-      if (!strcmp(silc_default_hash[i].oid, oid)) {
-       entry = (SilcHashObject *)&(silc_default_hash[i]);
-       break;
-      }
-    }
-  }
-#endif /* SILC_SYMBIAN */
-
-  if (entry) {
-    *new_hash = silc_calloc(1, sizeof(**new_hash));
-    if (!(*new_hash))
-      return FALSE;
-    (*new_hash)->hash = entry;
-    (*new_hash)->context = silc_calloc(1, entry->context_len());
-    if (!(*new_hash)->context) {
-      silc_free(*new_hash);
-      return FALSE;
-    }
-    return TRUE;
-  }
-
-  return FALSE;
-}
-
-/* Free's the SilcHash object */
-
-void silc_hash_free(SilcHash hash)
-{
-  if (hash) {
-    silc_free(hash->context);
-    silc_free(hash);
-  }
-}
-
-/* Returns the length of the hash digest. */
-
-SilcUInt32 silc_hash_len(SilcHash hash)
-{
-  return hash->hash->hash_len;
-}
-
-/* Returns the block lenght of the hash. */
-
-SilcUInt32 silc_hash_block_len(SilcHash hash)
-{
-  return hash->hash->block_len;
-}
-
-/* Returns the name of the hash function */
-
-const char *silc_hash_get_name(SilcHash hash)
-{
-  return hash->hash->name;
-}
-
-/* Returns hash OID string */
-
-const char *silc_hash_get_oid(SilcHash hash)
-{
-  return hash->hash->oid;
-}
-
-/* Returns TRUE if hash algorithm `name' is supported. */
-
-SilcBool silc_hash_is_supported(const unsigned char *name)
-{
-#ifndef SILC_SYMBIAN
-  SilcHashObject *entry;
-
-  if (silc_hash_list) {
-    silc_dlist_start(silc_hash_list);
-    while ((entry = silc_dlist_get(silc_hash_list)) != SILC_LIST_END) {
-      if (!strcmp(entry->name, name))
-       return TRUE;
-    }
-  }
-#else
-  {
-    int i;
-    for (i = 0; silc_default_hash[i].name; i++)
-      if (!strcmp(silc_default_hash[i].name, name))
-       return TRUE;
-  }
-#endif /* SILC_SYMBIAN */
-  return FALSE;
-}
-
-/* Returns comma separated list of supported hash functions. */
-
-char *silc_hash_get_supported(void)
-{
-  SilcHashObject *entry;
-  char *list = NULL;
-  int len = 0;
-
-#ifndef SILC_SYMBIAN
-  if (silc_hash_list) {
-    silc_dlist_start(silc_hash_list);
-    while ((entry = silc_dlist_get(silc_hash_list)) != SILC_LIST_END) {
-      len += strlen(entry->name);
-      list = silc_realloc(list, len + 1);
-
-      memcpy(list + (len - strlen(entry->name)),
-            entry->name, strlen(entry->name));
-      memcpy(list + len, ",", 1);
-      len++;
-    }
-  }
-#else
-  {
-    int i;
-    for (i = 0; silc_default_hash[i].name; i++) {
-      entry = (SilcHashObject *)&(silc_default_hash[i]);
-      len += strlen(entry->name);
-      list = silc_realloc(list, len + 1);
-
-      memcpy(list + (len - strlen(entry->name)),
-            entry->name, strlen(entry->name));
-      memcpy(list + len, ",", 1);
-      len++;
-    }
-  }
-#endif /* SILC_SYMBIAN */
-
-  list[len - 1] = 0;
-
-  return list;
-}
-
-/* Creates the hash value and returns it to the return_hash argument. */
-
-void silc_hash_make(SilcHash hash, const unsigned char *data,
-                   SilcUInt32 len, unsigned char *return_hash)
-{
-  silc_hash_init(hash);
-  silc_hash_update(hash, data, len);
-  silc_hash_final(hash, return_hash);
-}
-
-void silc_hash_init(SilcHash hash)
-{
-  hash->hash->init(hash->context);
-}
-
-void silc_hash_update(SilcHash hash, const unsigned char *data,
-                     SilcUInt32 data_len)
-{
-  hash->hash->update(hash->context, (unsigned char *)data, data_len);
-}
-
-void silc_hash_final(SilcHash hash, unsigned char *return_hash)
-{
-  hash->hash->final(hash->context, return_hash);
-}
-
-void silc_hash_transform(SilcHash hash, SilcUInt32 *state,
-                        const unsigned char *data)
-{
-  hash->hash->transform(state, data);
-}
-
-/* Creates fingerprint of the data. If `hash' is NULL SHA1 is used as
-   default hash function. The returned fingerprint must be freed by the
-   caller. */
-
-char *silc_hash_fingerprint(SilcHash hash, const unsigned char *data,
-                           SilcUInt32 data_len)
-{
-  SilcHash new_hash = NULL;
-  unsigned char h[32];
-  char *ret;
-
-  if (!hash) {
-    if (!silc_hash_alloc("sha1", &new_hash))
-      return NULL;
-    hash = new_hash;
-  }
-
-  silc_hash_make(hash, data, data_len, h);
-  ret = silc_fingerprint(h, hash->hash->hash_len);
-
-  if (new_hash != NULL)
-    silc_hash_free(new_hash);
-  return ret;
-}
-
-static const char vo[]= "aeiouy";
-static const char co[]= "bcdfghklmnprstvzx";
-
-/* Creates a babbleprint (Bubble Babble Encoding, developed by Antti
-   Huima (draft-huima-babble-01.txt)), by first computing real fingerprint
-   using `hash' or if NULL, then using SHA1, and then encoding the
-   fingerprint to the babbleprint. */
-
-char *silc_hash_babbleprint(SilcHash hash, const unsigned char *data,
-                           SilcUInt32 data_len)
-{
-  SilcHash new_hash = NULL;
-  char *babbleprint;
-  unsigned char hval[32];
-  unsigned int a, b, c, d, e, check;
-  int i, k, out_len;
-
-  if (!hash) {
-    if (!silc_hash_alloc("sha1", &new_hash))
-      return NULL;
-    hash = new_hash;
-  }
-
-  /* Take fingerprint */
-  silc_hash_make(hash, data, data_len, hval);
-
-  /* Encode babbleprint */
-  out_len = (((hash->hash->hash_len + 1) / 2) + 1) * 6;
-  babbleprint = silc_calloc(out_len, sizeof(*babbleprint));
-  if (!babbleprint) {
-    silc_hash_free(new_hash);
-    return NULL;
-  }
-  babbleprint[0] = co[16];
-
-  check = 1;
-  for (i = 0, k = 1; i < hash->hash->hash_len - 1; i += 2, k += 6) {
-    a = (((hval[i] >> 6) & 3) + check) % 6;
-    b = (hval[i] >> 2) & 15;
-    c = ((hval[i] & 3) + (check / 6)) % 6;
-    d = (hval[i + 1] >> 4) & 15;
-    e = hval[i + 1] & 15;
-
-    check = ((check * 5) + (hval[i] * 7) + hval[i + 1]) % 36;
-
-    babbleprint[k + 0] = vo[a];
-    babbleprint[k + 1] = co[b];
-    babbleprint[k + 2] = vo[c];
-    babbleprint[k + 3] = co[d];
-    babbleprint[k + 4] = '-';
-    babbleprint[k + 5] = co[e];
-  }
-
-  if ((hash->hash->hash_len % 2) != 0) {
-    a = (((hval[i] >> 6) & 3) + check) % 6;
-    b = (hval[i] >> 2) & 15;
-    c = ((hval[i] & 3) + (check / 6)) % 6;
-    babbleprint[k + 0] = vo[a];
-    babbleprint[k + 1] = co[b];
-    babbleprint[k + 2] = vo[c];
-  } else {
-    a = check % 6;
-    b = 16;
-    c = check / 6;
-    babbleprint[k + 0] = vo[a];
-    babbleprint[k + 1] = co[b];
-    babbleprint[k + 2] = vo[c];
-  }
-  babbleprint[k + 3] = co[16];
-
-  if (new_hash != NULL)
-    silc_hash_free(new_hash);
-  return babbleprint;
-}
diff --git a/lib/silccrypt/silchash.h b/lib/silccrypt/silchash.h
deleted file mode 100644 (file)
index dee139e..0000000
+++ /dev/null
@@ -1,460 +0,0 @@
-/*
-
-  silchash.h
-
-  Author: Pekka Riikonen <priikone@silcnet.org>
-
-  Copyright (C) 1997 - 2007 Pekka Riikonen
-
-  This program is free software; you can redistribute it and/or modify
-  it under the terms of the GNU General Public License as published by
-  the Free Software Foundation; version 2 of the License.
-
-  This program is distributed in the hope that it will be useful,
-  but WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-  GNU General Public License for more details.
-
-*/
-
-#ifndef SILCHASH_H
-#define SILCHASH_H
-
-/****h* silccrypt/SILC Hash Interface
- *
- * DESCRIPTION
- *
- *    This is the interface for hash functions which are used to create
- *    message digests.  The routines are used in various cryptographic
- *    operations.  SILC Hash Interface is used for example by the
- *    SILC HMAC Interface (SilcHmac).
- *
- ***/
-
-/****s* silccrypt/SilcHashAPI/SilcHash
- *
- * NAME
- *
- *    typedef struct SilcHashStruct *SilcHash;
- *
- * DESCRIPTION
- *
- *    This context is the actual hash function context and is allocated
- *    by silc_hash_alloc and given as argument usually to all
- *    silc_hash_* functions.  It is freed by the silc_hash_free
- *    function.
- *
- ***/
-typedef struct SilcHashStruct *SilcHash;
-
-/****s* silccrypt/SilcHashAPI/SilcHashObject
- *
- * NAME
- *
- *    typedef struct { ... } SilcHashObject;
- *
- * DESCRIPTION
- *
- *    This structure represents one hash function.  The hash function's
- *    name, digest length and block length are defined in the structure.
- *    This structure is then given as argument to the silc_hash_register.
- *    That function is used to register all hash functions into SILC.
- *    They can be then allocated by the name found in this structure by
- *    calling the silc_hash_alloc.
- *
- ***/
-typedef struct {
-  char *name;
-  char *oid;
-  SilcUInt16 hash_len;
-  SilcUInt16 block_len;
-
-  void (*init)(void *);
-  void (*update)(void *, const unsigned char *, SilcUInt32);
-  void (*final)(void *, unsigned char *);
-  void (*transform)(SilcUInt32 *, const unsigned char *);
-  SilcUInt32 (*context_len)();
-} SilcHashObject;
-
-/* Marks for all hash functions. This can be used in silc_hash_unregister
-   to unregister all hash function at once. */
-#define SILC_ALL_HASH_FUNCTIONS ((SilcHashObject *)1)
-
-/* Default hash functions for silc_hash_register_default(). */
-extern DLLAPI const SilcHashObject silc_default_hash[];
-
-/* Default HASH function in the SILC protocol */
-#define SILC_DEFAULT_HASH "sha1"
-#define SILC_HASH_MAXLEN 64
-
-/* Macros */
-
-/* Following macros are used to implement the SILC Hash API. These
-   macros should be used instead of declaring functions by hand. */
-
-/* Function names in SILC Hash modules. The name of the hash function
-   is appended into these names and used to the get correct symbol out
-   of the module. All SILC Hash API compliant modules has to support
-   these names as function names (use macros below to assure this). */
-#define SILC_HASH_SIM_INIT "init"
-#define SILC_HASH_SIM_UPDATE "update"
-#define SILC_HASH_SIM_FINAL "final"
-#define SILC_HASH_SIM_TRANSFORM "transform"
-#define SILC_HASH_SIM_CONTEXT_LEN "context_len"
-
-/* Macros that can be used to declare SILC Hash API functions. */
-#define SILC_HASH_API_INIT(hash)                                       \
-void silc_##hash##_init(void *context)
-#define SILC_HASH_API_UPDATE(hash)                                     \
-void silc_##hash##_update(void *context, const unsigned char *data,    \
-                          SilcUInt32 len)
-#define SILC_HASH_API_FINAL(hash)                                      \
-void silc_##hash##_final(void *context, unsigned char *digest)
-#define SILC_HASH_API_TRANSFORM(hash)                                  \
-void silc_##hash##_transform(SilcUInt32 *state,        const unsigned char *buffer)
-#define SILC_HASH_API_CONTEXT_LEN(hash)                                        \
-SilcUInt32 silc_##hash##_context_len()
-
-/* Prototypes */
-
-/****f* silccrypt/SilcHashAPI/silc_hash_register
- *
- * SYNOPSIS
- *
- *    SilcBool silc_hash_register(const SilcHashObject *hash);
- *
- * DESCRIPTION
- *
- *    Registers a new hash function into the SILC.  This function is used
- *    at the initialization of the SILC.  All registered hash functions
- *    should be unregistered with silc_hash_unregister.  The `hash' includes
- *    the name of the hash function, digest length and block length.  Usually
- *    this function is not called directly.  Instead, application can call
- *    the silc_hash_register_default to register all default hash functions
- *    that are builtin the sources.  Returns FALSE on error.
- *
- ***/
-SilcBool silc_hash_register(const SilcHashObject *hash);
-
-/****f* silccrypt/SilcHashAPI/silc_hash_unregister
- *
- * SYNOPSIS
- *
- *    SilcBool silc_hash_unregister(SilcHashObject *hash);
- *
- * DESCRIPTION
- *
- *    Unregister a hash function from SILC by the SilcHashObject `hash'.
- *    This should be called for all registered hash functions.  Returns
- *    FALSE on error.
- *
- ***/
-SilcBool silc_hash_unregister(SilcHashObject *hash);
-
-/****f* silccrypt/SilcHashAPI/silc_hash_register_default
- *
- * SYNOPSIS
- *
- *    SilcBool silc_hash_register_default(void);
- *
- * DESCRIPTION
- *
- *    Registers all default hash functions into the SILC.  These are the
- *    hash functions that are builtin in the sources.  See the list of
- *    default hash functions in the silchash.c source file.  The application
- *    may use this to register default hash functions if specific hash
- *    function in any specific order is not wanted (application's
- *    configuration usually may decide the order of the registration, in
- *    which case this function should not be used).
- *
- ***/
-SilcBool silc_hash_register_default(void);
-
-/****f* silccrypt/SilcHashAPI/silc_hash_unregister_all
- *
- * SYNOPSIS
- *
- *    SilcBool silc_hash_unregister_all(void);
- *
- * DESCRIPTION
- *
- *    Unregisters all registered hash functions.
- *
- ***/
-SilcBool silc_hash_unregister_all(void);
-
-/****f* silccrypt/SilcHashAPI/silc_hash_alloc
- *
- * SYNOPSIS
- *
- *    SilcBool silc_hash_alloc(const unsigned char *name, SilcHash *new_hash);
- *
- * DESCRIPTION
- *
- *    Allocates a new SilcHash object of name of `name'.  The new allocated
- *    hash function is returned into `new_hash' pointer.  This function
- *    returns FALSE if such hash function does not exist.
- *
- ***/
-SilcBool silc_hash_alloc(const unsigned char *name, SilcHash *new_hash);
-
-/****f* silccrypt/SilcHashAPI/silc_hash_alloc_by_oid
- *
- * SYNOPSIS
- *
- *    SilcBool silc_hash_alloc_by_oid(const char *oid, SilcHash *new_hash);
- *
- * DESCRIPTION
- *
- *    Same as silc_hash_alloc but allocates the hash algorithm by the
- *    hash algorithm OID string indicated by `oid'. Returns FALSE if such
- *    hash function does not exist.
- *
- ***/
-SilcBool silc_hash_alloc_by_oid(const char *oid, SilcHash *new_hash);
-
-/****f* silccrypt/SilcHashAPI/silc_hash_free
- *
- * SYNOPSIS
- *
- *    void silc_hash_free(SilcHash hash);
- *
- * DESCRIPTION
- *
- *    Frees the allocated hash function context.
- *
- ***/
-void silc_hash_free(SilcHash hash);
-
-/****f* silccrypt/SilcHashAPI/silc_hash_is_supported
- *
- * SYNOPSIS
- *
- *    SilcBool silc_hash_is_supported(const unsigned char *name);
- *
- * DESCRIPTION
- *
- *    Returns TRUE if the hash function indicated by the `name' exists.
- *
- ***/
-SilcBool silc_hash_is_supported(const unsigned char *name);
-
-/****f* silccrypt/SilcHashAPI/silc_hash_get_supported
- *
- * SYNOPSIS
- *
- *    char *silc_hash_get_supported(void);
- *
- * DESCRIPTION
- *
- *    Returns comma (`,') separated list of registered hash functions  This
- *    is used for example when sending supported hash function list during
- *    the SILC Key Exchange protocol (SKE).  The caller must free the returned
- *    pointer.
- *
- ***/
-char *silc_hash_get_supported(void);
-
-/****f* silccrypt/SilcHashAPI/silc_hash_len
- *
- * SYNOPSIS
- *
- *    SilcUInt32 silc_hash_len(SilcHash hash);
- *
- * DESCRIPTION
- *
- *    Returns the length of the message digest the hash function produce.
- *
- ***/
-SilcUInt32 silc_hash_len(SilcHash hash);
-
-/****f* silccrypt/SilcHashAPI/silc_hash_block_len
- *
- * SYNOPSIS
- *
- *    SilcUInt32 silc_hash_block_len(SilcHash hash);
- *
- * DESCRIPTION
- *
- *    Returns the block length of the hash function.
- *
- ***/
-SilcUInt32 silc_hash_block_len(SilcHash hash);
-
-/****f* silccrypt/SilcHashAPI/silc_hash_get_name
- *
- * SYNOPSIS
- *
- *    const char *silc_hash_get_name(SilcHash hash);
- *
- * DESCRIPTION
- *
- *    Returns the name of the hash function indicated by the `hash' context.
- *
- ***/
-const char *silc_hash_get_name(SilcHash hash);
-
-/****f* silccrypt/SilcHashAPI/silc_hash_get_oid
- *
- * SYNOPSIS
- *
- *    const char *silc_hash_get_name(SilcHash hash);
- *
- * DESCRIPTION
- *
- *    Returns the hash OID string.  Returns NULL if the hash doesn't have
- *    OID string.  Use strlen() to get the OID string length.
- *
- ***/
-const char *silc_hash_get_oid(SilcHash hash);
-
-/****f* silccrypt/SilcHashAPI/silc_hash_make
- *
- * SYNOPSIS
- *
- *    void silc_hash_make(SilcHash hash, const unsigned char *data,
- *                        SilcUInt32 len, unsigned char *return_hash);
- *
- * DESCRIPTION
- *
- *    Computes the message digest (hash) out of the data indicated by
- *    `data' of length of `len' bytes.  Returns the message digest to the
- *    `return_hash' buffer which must be at least of the size of the
- *    message digest the `hash' produces.
- *
- ***/
-void silc_hash_make(SilcHash hash, const unsigned char *data,
-                   SilcUInt32 len, unsigned char *return_hash);
-
-/****f* silccrypt/SilcHashAPI/silc_hash_init
- *
- * SYNOPSIS
- *
- *    void silc_hash_init(SilcHash hash);
- *
- * DESCRIPTION
- *
- *    Sometimes calling the silc_hash_make might not be the most optimal
- *    case of computing digests.  If you have a lot of different data
- *    that you need to put together for computing a digest you may either
- *    put them into a buffer and compute the digest from the buffer by
- *    calling the silc_hash_make, or you can use the silc_hash_init,
- *    silc_hash_update and silc_hash_final to do the digest.  This function
- *    prepares the allocated hash function context for this kind of digest
- *    computation.  To add the data to be used in the digest computation
- *    call the silc_hash_update function.
- *
- ***/
-void silc_hash_init(SilcHash hash);
-
-/****f* silccrypt/SilcHashAPI/silc_hash_update
- *
- * SYNOPSIS
- *
- *    void silc_hash_update(SilcHash hash, const unsigned char *data,
- *                          SilcUInt32 data_len);
- *
- * DESCRIPTION
- *
- *    This function may be called to add data to be used in the digest
- *    computation.  This can be called multiple times to add data from
- *    many sources before actually computing the digest.  Once you've
- *    added all the data you need you can call the silc_hash_final to
- *    actually produce the message digest value.
- *
- * EXAMPLE
- *
- *    unsigned char digest[20];
- *
- *    silc_hash_init(hash);
- *    silc_hash_update(hash, data, data_len);
- *    silc_hash_update(hash, more_data, more_data_len);
- *    silc_hash_final(hash, digest);
- *
- ***/
-void silc_hash_update(SilcHash hash, const unsigned char *data,
-                     SilcUInt32 data_len);
-
-/****f* silccrypt/SilcHashAPI/silc_hash_final
- *
- * SYNOPSIS
- *
- *    void silc_hash_final(SilcHash hash, unsigned char *return_hash);
- *
- * DESCRIPTION
- *
- *    This function is used to produce the final message digest from
- *    the data that has been added to the hash function context by calling
- *    the silc_hash_update function.  The digest is copied in to the
- *    `return_hash' pointer which must be at least the size that
- *    the silc_hash_len returns.
- *
- ***/
-void silc_hash_final(SilcHash hash, unsigned char *return_hash);
-
-/****f* silccrypt/SilcHashAPI/silc_hash_transform
- *
- * SYNOPSIS
- *
- *    void silc_hash_transform(SilcHash hash, SilcUInt32 *state,
- *                             const unsigned char *data);
- *
- * DESCRIPTION
- *
- *    This is special function for calling the hash function's internal
- *    digest generation function.  The size of the `state' array and the
- *    sizeof the `data' buffer is hash function specific and must be
- *    known by the caller.  Usually this function is not needed.
- *
- ***/
-void silc_hash_transform(SilcHash hash, SilcUInt32 *state,
-                        const unsigned char *data);
-
-/****f* silccrypt/SilcHashAPI/silc_hash_fingerprint
- *
- * SYNOPSIS
- *
- *    char *silc_hash_fingerprint(SilcHash hash, const unsigned char *data,
- *                                SilcUInt32 data_len);
- *
- * DESCRIPTION
- *
- *    Utility function which can be used to create a textual fingerprint
- *    out of the data indicated by `data' of length of `data_len' bytes.
- *    If `hash' is NULL then SHA1 hash function is used automatically.
- *    The caller must free the returned string.
- *
- *    Example output could be:
- *      41BF 5C2E 4149 039A 3917  831F 65C4 0A69 F98B 0A4D
- *
- ***/
-char *silc_hash_fingerprint(SilcHash hash, const unsigned char *data,
-                           SilcUInt32 data_len);
-
-/****f* silccrypt/SilcHashAPI/silc_hash_babbleprint
- *
- * SYNOPSIS
- *
- *    char *silc_hash_babbleprint(SilcHash hash, const unsigned char *data,
- *                                SilcUInt32 data_len);
- *
- * DESCRIPTION
- *
- *    Utility function which can be used to create a textual babbleprint
- *    out of the data indicated by `data' of length of `data_len' bytes.
- *    If `hash' is NULL then SHA1 hash function is used automatically.
- *    The caller must free the returned string.
- *
- *    The babbleprint is same as fingerprint but encoded in a form which
- *    makes it easier to pronounce.  When verifying fingerprint for example
- *    over a phone call, the babbleprint makes it easier to read the
- *    fingerprint.
- *
- *    Example output could be:
- *      xiber-zulad-vubug-noban-puvyc-labac-zonos-gedik-novem-rudog-tyxix
- *
- ***/
-char *silc_hash_babbleprint(SilcHash hash, const unsigned char *data,
-                           SilcUInt32 data_len);
-
-#endif
diff --git a/lib/silccrypt/silchmac.c b/lib/silccrypt/silchmac.c
deleted file mode 100644 (file)
index 1e9380d..0000000
+++ /dev/null
@@ -1,479 +0,0 @@
-/*
-
-  silchmac.c
-
-  Author: Pekka Riikonen <priikone@silcnet.org>
-
-  Copyright (C) 1999 - 2006 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.
-
-*/
-/* $Id$ */
-
-#include "silc.h"
-
-/* HMAC context */
-struct SilcHmacStruct {
-  SilcHmacObject *hmac;
-  SilcHash hash;
-  unsigned char inner_pad[64];
-  unsigned char outer_pad[64];
-  unsigned char *key;
-  unsigned int key_len        : 31;
-  unsigned int allocated_hash : 1;   /* TRUE if the hash was allocated */
-};
-
-#ifndef SILC_SYMBIAN
-/* List of dynamically registered HMACs. */
-SilcDList silc_hmac_list = NULL;
-#endif /* SILC_SYMBIAN */
-
-/* Default hmacs for silc_hmac_register_default(). */
-const SilcHmacObject silc_default_hmacs[] =
-{
-  { "hmac-sha256-96", 12 },
-  { "hmac-sha1-96", 12 },
-  { "hmac-md5-96", 12 },
-  { "hmac-sha256", 32 },
-  { "hmac-sha1", 20 },
-  { "hmac-md5", 16 },
-
-  { NULL, 0 }
-};
-
-static void silc_hmac_init_internal(SilcHmac hmac, unsigned char *key,
-                                   SilcUInt32 key_len)
-{
-  SilcHash hash = hmac->hash;
-  SilcUInt32 block_len;
-  unsigned char hvalue[SILC_HASH_MAXLEN];
-  int i;
-
-  memset(hmac->inner_pad, 0, sizeof(hmac->inner_pad));
-  memset(hmac->outer_pad, 0, sizeof(hmac->outer_pad));
-
-  block_len = silc_hash_block_len(hash);
-
-  /* If the key length is more than block size of the hash function, the
-     key is hashed. */
-  if (key_len > block_len) {
-    silc_hash_make(hash, key, key_len, hvalue);
-    key = hvalue;
-    key_len = silc_hash_len(hash);
-  }
-
-  /* Copy the key into the pads */
-  memcpy(hmac->inner_pad, key, key_len);
-  memcpy(hmac->outer_pad, key, key_len);
-
-  /* XOR the key with pads */
-  for (i = 0; i < block_len; i++) {
-    hmac->inner_pad[i] ^= 0x36;
-    hmac->outer_pad[i] ^= 0x5c;
-  }
-}
-
-/* Registers a new HMAC into the SILC. This function is used at the
-   initialization of the SILC. */
-
-SilcBool silc_hmac_register(const SilcHmacObject *hmac)
-{
-#ifndef SILC_SYMBIAN
-  SilcHmacObject *new;
-
-  SILC_LOG_DEBUG(("Registering new HMAC `%s'", hmac->name));
-
-  /* Check for existing */
-  if (silc_hmac_list) {
-    SilcHmacObject *entry;
-    silc_dlist_start(silc_hmac_list);
-    while ((entry = silc_dlist_get(silc_hmac_list)) != SILC_LIST_END) {
-      if (!strcmp(entry->name, hmac->name))
-       return FALSE;
-    }
-  }
-
-  new = silc_calloc(1, sizeof(*new));
-  if (!new)
-    return FALSE;
-  new->name = strdup(hmac->name);
-  new->len = hmac->len;
-
-  /* Add to list */
-  if (silc_hmac_list == NULL)
-    silc_hmac_list = silc_dlist_init();
-  silc_dlist_add(silc_hmac_list, new);
-
-#endif /* SILC_SYMBIAN */
-  return TRUE;
-}
-
-/* Unregister a HMAC from the SILC. */
-
-SilcBool silc_hmac_unregister(SilcHmacObject *hmac)
-{
-#ifndef SILC_SYMBIAN
-  SilcHmacObject *entry;
-
-  SILC_LOG_DEBUG(("Unregistering HMAC"));
-
-  if (!silc_hmac_list)
-    return FALSE;
-
-  silc_dlist_start(silc_hmac_list);
-  while ((entry = silc_dlist_get(silc_hmac_list)) != SILC_LIST_END) {
-    if (hmac == SILC_ALL_HMACS || entry == hmac) {
-      silc_dlist_del(silc_hmac_list, entry);
-      silc_free(entry->name);
-      silc_free(entry);
-
-      if (silc_dlist_count(silc_hmac_list) == 0) {
-       silc_dlist_uninit(silc_hmac_list);
-       silc_hmac_list = NULL;
-      }
-
-      return TRUE;
-    }
-  }
-
-#endif /* SILC_SYMBIAN */
-  return FALSE;
-}
-
-/* Function that registers all the default hmacs (all builtin ones).
-   The application may use this to register the default hmacs if
-   specific hmacs in any specific order is not wanted. */
-
-SilcBool silc_hmac_register_default(void)
-{
-#ifndef SILC_SYMBIAN
-  int i;
-
-  for (i = 0; silc_default_hmacs[i].name; i++)
-    silc_hmac_register(&(silc_default_hmacs[i]));
-
-#endif /* SILC_SYMBIAN */
-  return TRUE;
-}
-
-SilcBool silc_hmac_unregister_all(void)
-{
-#ifndef SILC_SYMBIAN
-  SilcHmacObject *entry;
-
-  if (!silc_hmac_list)
-    return FALSE;
-
-  silc_dlist_start(silc_hmac_list);
-  while ((entry = silc_dlist_get(silc_hmac_list)) != SILC_LIST_END) {
-    silc_hmac_unregister(entry);
-    if (!silc_hmac_list)
-      break;
-  }
-#endif /* SILC_SYMBIAN */
-  return TRUE;
-}
-
-/* Allocates a new SilcHmac object of name of `name'.  The `hash' may
-   be provided as argument.  If provided it is used as the hash function
-   of the HMAC.  If it is NULL then the hash function is allocated and
-   the name of the hash algorithm is derived from the `name'. */
-
-SilcBool silc_hmac_alloc(const char *name, SilcHash hash, SilcHmac *new_hmac)
-{
-  SILC_LOG_DEBUG(("Allocating new HMAC"));
-
-  /* Allocate the new object */
-  *new_hmac = silc_calloc(1, sizeof(**new_hmac));
-  if (!(*new_hmac))
-    return FALSE;
-
-  if (!hash) {
-    char *tmp = strdup(name), *hname;
-
-    hname = tmp;
-    if (strchr(hname, '-'))
-      hname = strchr(hname, '-') + 1;
-    if (strchr(hname, '-'))
-      *strchr(hname, '-') = '\0';
-
-    if (!silc_hash_alloc(hname, &hash)) {
-      silc_free(tmp);
-      silc_free(*new_hmac);
-      *new_hmac = NULL;
-      return FALSE;
-    }
-
-    (*new_hmac)->allocated_hash = TRUE;
-    silc_free(tmp);
-  }
-
-  (*new_hmac)->hash = hash;
-
-#ifndef SILC_SYMBIAN
-  if (silc_hmac_list) {
-    SilcHmacObject *entry;
-    silc_dlist_start(silc_hmac_list);
-    while ((entry = silc_dlist_get(silc_hmac_list)) != SILC_LIST_END) {
-      if (!strcmp(entry->name, name)) {
-       (*new_hmac)->hmac = entry;
-       return TRUE;
-      }
-    }
-  }
-#else
-  {
-    /* On EPOC which don't have globals we check our constant hash list. */
-    int i;
-    for (i = 0; silc_default_hmacs[i].name; i++) {
-      if (!strcmp(silc_default_hmacs[i].name, name)) {
-       (*new_hmac)->hmac = (SilcHmacObject *)&(silc_default_hmacs[i]);
-       return TRUE;
-      }
-    }
-  }
-#endif /* SILC_SYMBIAN */
-
-  silc_free(*new_hmac);
-  *new_hmac = NULL;
-  return FALSE;
-}
-
-/* Free's the SilcHmac object. */
-
-void silc_hmac_free(SilcHmac hmac)
-{
-  if (hmac) {
-    if (hmac->allocated_hash)
-      silc_hash_free(hmac->hash);
-
-    if (hmac->key) {
-      memset(hmac->key, 0, hmac->key_len);
-      silc_free(hmac->key);
-    }
-
-    silc_free(hmac);
-  }
-}
-
-/* Returns the length of the MAC that the HMAC will produce. */
-
-SilcUInt32 silc_hmac_len(SilcHmac hmac)
-{
-  return hmac->hmac->len;
-}
-
-/* Get hash context */
-
-SilcHash silc_hmac_get_hash(SilcHmac hmac)
-{
-  return hmac->hash;
-}
-
-/* Return name of hmac */
-
-const char *silc_hmac_get_name(SilcHmac hmac)
-{
-  return hmac->hmac->name;
-}
-
-/* Returns TRUE if HMAC `name' is supported. */
-
-SilcBool silc_hmac_is_supported(const char *name)
-{
-#ifndef SILC_SYMBIAN
-  SilcHmacObject *entry;
-
-  if (!name)
-    return FALSE;
-
-  if (silc_hmac_list) {
-    silc_dlist_start(silc_hmac_list);
-    while ((entry = silc_dlist_get(silc_hmac_list)) != SILC_LIST_END) {
-      if (!strcmp(entry->name, name))
-       return TRUE;
-    }
-  }
-#else
-  {
-    int i;
-    for (i = 0; silc_default_hmacs[i].name; i++)
-      if (!strcmp(silc_default_hmacs[i].name, name))
-       return TRUE;
-  }
-#endif /* SILC_SYMBIAN */
-  return FALSE;
-}
-
-/* Returns comma separated list of supported HMACs. */
-
-char *silc_hmac_get_supported()
-{
-  SilcHmacObject *entry;
-  char *list = NULL;
-  int len = 0;
-
-#ifndef SILC_SYMBIAN
-  if (silc_hmac_list) {
-    silc_dlist_start(silc_hmac_list);
-    while ((entry = silc_dlist_get(silc_hmac_list)) != SILC_LIST_END) {
-      len += strlen(entry->name);
-      list = silc_realloc(list, len + 1);
-
-      memcpy(list + (len - strlen(entry->name)),
-            entry->name, strlen(entry->name));
-      memcpy(list + len, ",", 1);
-      len++;
-    }
-  }
-#else
-  {
-    int i;
-    for (i = 0; silc_default_hmacs[i].name; i++) {
-      entry = (SilcHmacObject *)&(silc_default_hmacs[i]);
-      len += strlen(entry->name);
-      list = silc_realloc(list, len + 1);
-
-      memcpy(list + (len - strlen(entry->name)),
-            entry->name, strlen(entry->name));
-      memcpy(list + len, ",", 1);
-      len++;
-    }
-  }
-#endif /* SILC_SYMBIAN */
-
-  list[len - 1] = 0;
-
-  return list;
-}
-
-/* Sets the HMAC key used in the HMAC creation */
-
-void silc_hmac_set_key(SilcHmac hmac, const unsigned char *key,
-                      SilcUInt32 key_len)
-{
-  if (hmac->key) {
-    memset(hmac->key, 0, hmac->key_len);
-    silc_free(hmac->key);
-  }
-  hmac->key = silc_malloc(key_len);
-  if (!hmac->key)
-    return;
-  hmac->key_len = key_len;
-  memcpy(hmac->key, key, key_len);
-}
-
-/* Return HMAC key */
-
-const unsigned char *silc_hmac_get_key(SilcHmac hmac, SilcUInt32 *key_len)
-{
-  if (key_len)
-    *key_len = hmac->key_len;
-  return (const unsigned char *)hmac->key;
-}
-
-/* Create the HMAC. This is thee make_hmac function pointer.  This
-   uses the internal key set with silc_hmac_set_key. */
-
-void silc_hmac_make(SilcHmac hmac, unsigned char *data,
-                   SilcUInt32 data_len, unsigned char *return_hash,
-                   SilcUInt32 *return_len)
-{
-  SILC_LOG_DEBUG(("Making HMAC for message"));
-
-  silc_hmac_init(hmac);
-  silc_hmac_update(hmac, data, data_len);
-  silc_hmac_final(hmac, return_hash, return_len);
-}
-
-/* Creates HMAC just as above except that this doesn't use the internal
-   key. The key is sent as argument to the function. */
-
-void silc_hmac_make_with_key(SilcHmac hmac, unsigned char *data,
-                            SilcUInt32 data_len,
-                            unsigned char *key, SilcUInt32 key_len,
-                            unsigned char *return_hash,
-                            SilcUInt32 *return_len)
-{
-  SILC_LOG_DEBUG(("Making HMAC for message"));
-
-  silc_hmac_init_with_key(hmac, key, key_len);
-  silc_hmac_update(hmac, data, data_len);
-  silc_hmac_final(hmac, return_hash, return_len);
-}
-
-/* Creates the HMAC just as above except that the hash value is truncated
-   to the truncated_len sent as argument. NOTE: One should not truncate to
-   less than half of the length of original hash value. However, this
-   routine allows these dangerous truncations. */
-
-void silc_hmac_make_truncated(SilcHmac hmac, unsigned char *data,
-                             SilcUInt32 data_len,
-                             SilcUInt32 truncated_len,
-                             unsigned char *return_hash)
-{
-  unsigned char hvalue[SILC_HASH_MAXLEN];
-
-  SILC_LOG_DEBUG(("Making HMAC for message"));
-
-  silc_hmac_init(hmac);
-  silc_hmac_update(hmac, data, data_len);
-  silc_hmac_final(hmac, return_hash, NULL);
-  memcpy(return_hash, hvalue, truncated_len);
-  memset(hvalue, 0, sizeof(hvalue));
-}
-
-/* Init HMAC for silc_hmac_update and silc_hmac_final. */
-
-void silc_hmac_init(SilcHmac hmac)
-{
-  silc_hmac_init_with_key(hmac, hmac->key, hmac->key_len);
-}
-
-/* Same as above but with specific key */
-
-void silc_hmac_init_with_key(SilcHmac hmac, const unsigned char *key,
-                            SilcUInt32 key_len)
-{
-  SilcHash hash = hmac->hash;
-  silc_hmac_init_internal(hmac, (unsigned char *)key, key_len);
-  silc_hash_init(hash);
-  silc_hash_update(hash, hmac->inner_pad, silc_hash_block_len(hash));
-}
-
-/* Add data to be used in the MAC computation. */
-
-void silc_hmac_update(SilcHmac hmac, const unsigned char *data,
-                     SilcUInt32 data_len)
-{
-  SilcHash hash = hmac->hash;
-  silc_hash_update(hash, data, data_len);
-}
-
-/* Compute the final MAC. */
-
-void silc_hmac_final(SilcHmac hmac, unsigned char *return_hash,
-                    SilcUInt32 *return_len)
-{
-  SilcHash hash = hmac->hash;
-  unsigned char mac[SILC_HASH_MAXLEN];
-
-  silc_hash_final(hash, mac);
-  silc_hash_init(hash);
-  silc_hash_update(hash, hmac->outer_pad, silc_hash_block_len(hash));
-  silc_hash_update(hash, mac, silc_hash_len(hash));
-  silc_hash_final(hash, mac);
-  memcpy(return_hash, mac, hmac->hmac->len);
-  memset(mac, 0, sizeof(mac));
-
-  if (return_len)
-    *return_len = hmac->hmac->len;
-}
diff --git a/lib/silccrypt/silchmac.h b/lib/silccrypt/silchmac.h
deleted file mode 100644 (file)
index 66d8234..0000000
+++ /dev/null
@@ -1,447 +0,0 @@
-/*
-
-  silchmac.h
-
-  Author: Pekka Riikonen <priikone@silcnet.org>
-
-  Copyright (C) 1999 - 2006 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 SILCHMAC_H
-#define SILCHMAC_H
-
-/****h* silccrypt/SILC HMAC Interface
- *
- * DESCRIPTION
- *
- *    This is the interface for HMAC, or the keyed hash values, that are
- *    used for packet and message authentication.  These routines uses
- *    already implemented hash functions from the SilcHashAPI. These
- *    routines were created according to RFC 2104.
- *
- ***/
-
-/****s* silccrypt/SilcHMACAPI/SilcHmac
- *
- * NAME
- *
- *    typedef struct SilcHmacStruct *SilcHmac;
- *
- * DESCRIPTION
- *
- *    This context is the actual HMAC context and is allocated
- *    by silc_hmac_alloc and given as argument usually to all
- *    silc_hmac_* functions.  It is freed by the silc_hmac_free
- *    function.
- *
- ***/
-typedef struct SilcHmacStruct *SilcHmac;
-
-/****s* silccrypt/SilcHMACAPI/SilcHmacObject
- *
- * NAME
- *
- *    typedef struct { ... } SilcHmacObject;
- *
- * DESCRIPTION
- *
- *    This structure represents one HMAC.  The HMAC's name and the
- *    MAC length is defined in the structure.  This structure is
- *    then given as argument to the silc_hmac_register.  That function
- *    is used to register all HMACs into SILC.  They can be then
- *    allocated by the name found in this structure by calling the
- *    silc_hmac_alloc.
- *
- ***/
-typedef struct {
-  char *name;
-  SilcUInt32 len;
-} SilcHmacObject;
-
-/* Marks for all hmacs. This can be used in silc_hmac_unregister
-   to unregister all hmacs at once. */
-#define SILC_ALL_HMACS ((SilcHmacObject *)1)
-
-/* Default hmacs for silc_hmac_register_default(). */
-extern DLLAPI const SilcHmacObject silc_default_hmacs[];
-
-/* Default HMAC in the SILC protocol */
-#define SILC_DEFAULT_HMAC "hmac-sha1-96"
-
-/* Prototypes */
-
-/****f* silccrypt/SilcHMACAPI/silc_hmac_register
- *
- * SYNOPSIS
- *
- *    SilcBool silc_hmac_register(const SilcHmacObject *hmac);
- *
- * DESCRIPTION
- *
- *    Registers a new HMAC into the SILC. This function is used at the
- *    initialization of the SILC.  All registered HMACs should be
- *    unregistered with silc_hmac_unregister.  The `hmac' includes the
- *    name of the HMAC and the length of the MAC.  Usually this
- *    function is not called directly.  Instead, application can call
- *    the silc_hmac_register_default to register all default HMACs
- *    that are builtin the sources.  Returns FALSE on error.
- *
- ***/
-SilcBool silc_hmac_register(const SilcHmacObject *hmac);
-
-/****f* silccrypt/SilcHMACAPI/silc_hmac_unregister
- *
- * SYNOPSIS
- *
- *    SilcBool silc_hmac_unregister(SilcHmacObject *hmac);
- *
- * DESCRIPTION
- *
- *    Unregister a HMAC from SILC by the HMAC structure `hmac'.  This
- *    should be called for all registered HMAC's.  Returns FALSE on
- *    error.
- *
- ***/
-SilcBool silc_hmac_unregister(SilcHmacObject *hmac);
-
-/****f* silccrypt/SilcHMACAPI/silc_hmac_register_default
- *
- * SYNOPSIS
- *
- *    SilcBool silc_hmac_register_default(void);
- *
- * DESCRIPTION
- *
- *    Registers all default HMACs into the SILC.  These are the HMACs
- *    that are builtin in the sources.  See the list of default HMACs
- *    in the silchmac.c source file.  The application may use this
- *    to register default HMACs if specific HMAC in any specific order
- *    is not wanted (application's configuration usually may decide
- *    the order of the registration, in which case this should not be
- *    used).
- *
- ***/
-SilcBool silc_hmac_register_default(void);
-
-/****f* silccrypt/SilcHMACAPI/silc_hmac_unregister_all
- *
- * SYNOPSIS
- *
- *    SilcBool silc_hmac_unregister_all(void);
- *
- * DESCRIPTION
- *
- *    Unregisters all registered HMACs.
- *
- ***/
-SilcBool silc_hmac_unregister_all(void);
-
-/****f* silccrypt/SilcHMACAPI/silc_hmac_alloc
- *
- * SYNOPSIS
- *
- *    SilcBool silc_hmac_alloc(const char *name, SilcHash hash,
- *                         SilcHmac *new_hmac);
- *
- * DESCRIPTION
- *
- *    Allocates a new SilcHmac object of name of `name'.  The `hash' may
- *    be provided as argument.  If provided it is used as the hash function
- *    of the HMAC.  If it is NULL then the hash function is allocated and
- *    the name of the hash algorithm is derived from the `name'.  Returns
- *    FALSE if such HMAC does not exist.
- *
- ***/
-SilcBool silc_hmac_alloc(const char *name, SilcHash hash, SilcHmac *new_hmac);
-
-/****f* silccrypt/SilcHMACAPI/silc_hmac_free
- *
- * SYNOPSIS
- *
- *    void silc_hmac_free(SilcHmac hmac);
- *
- * DESCRIPTION
- *
- *    Frees the allocated HMAC context.  The key that may have been set
- *    with the silc_hmac_set_key is also destroyed.
- *
- ***/
-void silc_hmac_free(SilcHmac hmac);
-
-/****f* silccrypt/SilcHMACAPI/silc_hmac_is_supported
- *
- * SYNOPSIS
- *
- *    SilcBool silc_hmac_is_supported(const char *name);
- *
- * DESCRIPTION
- *
- *    Returns TRUE if the HMAC indicated by the `name' exists.
- *
- ***/
-SilcBool silc_hmac_is_supported(const char *name);
-
-/****f* silccrypt/SilcHMACAPI/silc_hmac_get_supported
- *
- * SYNOPSIS
- *
- *    char *silc_hmac_get_supported(void);
- *
- * DESCRIPTION
- *
- *    Returns comma (`,') separated list of registered HMACs.  This is
- *    used for example when sending supported HMAC list during the SILC
- *    Key Exchange protocol (SKE).  The caller must free the returned
- *    pointer.
- *
- ***/
-char *silc_hmac_get_supported(void);
-
-/****f* silccrypt/SilcHMACAPI/silc_hmac_len
- *
- * SYNOPSIS
- *
- *    SilcUInt32 silc_hmac_len(SilcHmac hmac);
- *
- * DESCRIPTION
- *
- *    Returns the length of the MAC that the HMAC will produce.
- *
- ***/
-SilcUInt32 silc_hmac_len(SilcHmac hmac);
-
-/****f* silccrypt/SilcHMACAPI/silc_hmac_get_hash
- *
- * SYNOPSIS
- *
- *    SilcHash silc_hmac_get_hash(SilcHmac hmac);
- *
- * DESCRIPTION
- *
- *    Returns the SilcHash context that has been associated with the
- *    HMAC context.  The caller must not free the returned context.
- *
- ***/
-SilcHash silc_hmac_get_hash(SilcHmac hmac);
-
-/****f* silccrypt/SilcHMACAPI/silc_hmac_get_name
- *
- * SYNOPSIS
- *
- *    const char *silc_hmac_get_name(SilcHmac hmac);
- *
- * DESCRIPTION
- *
- *    Returns the name of the HMAC context.
- *
- ***/
-const char *silc_hmac_get_name(SilcHmac hmac);
-
-/****f* silccrypt/SilcHMACAPI/silc_hmac_set_key
- *
- * SYNOPSIS
- *
- *    void silc_hmac_set_key(SilcHmac hmac, const unsigned char *key,
- *                           SilcUInt32 key_len);
- *
- * DESCRIPTION
- *
- *    Sets the key to be used in the HMAC operation.  This must be set
- *    before calling silc_hmac_make or silc_hmac_final functions.  If
- *    you do not want to set the key you can still produce a MAC by
- *    calling the silc_hmac_make_with_key where you give the key as
- *    argument.  Usually application still wants to set the key.
- *
- ***/
-void silc_hmac_set_key(SilcHmac hmac, const unsigned char *key,
-                      SilcUInt32 key_len);
-
-/****f* silccrypt/SilcHMACAPI/silc_hmac_get_key
- *
- * SYNOPSIS
- *
- *    const unsigned char *
- *    silc_hmac_get_key(SilcHmac hmac, SilcUInt32 *key_len);
- *
- * DESCRIPTION
- *
- *    Returns the key data from the `hmac' set with silc_hamc_set_key.
- *    The caller must not free the returned pointer.
- *
- ***/
-const unsigned char *silc_hmac_get_key(SilcHmac hmac, SilcUInt32 *key_len);
-
-/****f* silccrypt/SilcHMACAPI/silc_hmac_make
- *
- * SYNOPSIS
- *
- *    void silc_hmac_make(SilcHmac hmac, unsigned char *data,
- *                        SilcUInt32 data_len, unsigned char *return_hash,
- *                        SilcUInt32 *return_len);
- *
- * DESCRIPTION
- *
- *    Computes a MAC from a data buffer indicated by the `data' of the
- *    length of `data_len'.  The returned MAC is copied into the
- *    `return_hash' pointer which must be at least the size of the
- *    value silc_hmac_len returns.  The returned length is still
- *    returned to `return_len'.
- *
- ***/
-void silc_hmac_make(SilcHmac hmac, unsigned char *data,
-                   SilcUInt32 data_len, unsigned char *return_hash,
-                   SilcUInt32 *return_len);
-
-/****f* silccrypt/SilcHMACAPI/silc_hmac_make_with_key
- *
- * SYNOPSIS
- *
- *    void silc_hmac_make_with_key(SilcHmac hmac, unsigned char *data,
- *                                 SilcUInt32 data_len,
- *                                 unsigned char *key, SilcUInt32 key_len,
- *                                 unsigned char *return_hash,
- *                                 SilcUInt32 *return_len);
- *
- * DESCRIPTION
- *
- *    Same as the silc_hmac_make but takes the key for the HMAC as
- *    argument.  If this is used the key that may have been set by calling
- *    silc_hmac_set_key is ignored.
- *
- ***/
-void silc_hmac_make_with_key(SilcHmac hmac, unsigned char *data,
-                            SilcUInt32 data_len,
-                            unsigned char *key, SilcUInt32 key_len,
-                            unsigned char *return_hash,
-                            SilcUInt32 *return_len);
-
-/****f* silccrypt/SilcHMACAPI/silc_hmac_make_truncated
- *
- * SYNOPSIS
- *
- *    void silc_hmac_make_truncated(SilcHmac hmac,
- *                                  unsigned char *data,
- *                                  SilcUInt32 data_len,
- *                                  SilcUInt32 truncated_len,
- *                                  unsigned char *return_hash);
- *
- * DESCRIPTION
- *
- *    Same as the silc_hmac_make except that the returned MAC is
- *    truncated to the length indicated by the `truncated_len'.  Some
- *    special applications may need this function.  The `return_hash'
- *    must be at least the size of `truncated_len'.
- *
- * NOTES
- *
- *    For security reasons, one should not truncate to less than half
- *    of the length of the true MAC lenght.  However, since this routine
- *    may be used to non-critical applications this allows these dangerous
- *    truncations.
- *
- ***/
-void silc_hmac_make_truncated(SilcHmac hmac,
-                             unsigned char *data,
-                             SilcUInt32 data_len,
-                             SilcUInt32 truncated_len,
-                             unsigned char *return_hash);
-
-/****f* silccrypt/SilcHMACAPI/silc_hmac_init
- *
- * SYNOPSIS
- *
- *    void silc_hmac_init(SilcHmac hmac);
- *
- * DESCRIPTION
- *
- *    Sometimes calling the silc_hmac_make might not be the most
- *    optimal case of doing MACs.  If you have a lot of different data
- *    that you need to put together for computing a MAC you may either
- *    put them into a buffer and compute the MAC from the buffer by
- *    calling the silc_hmac_make, or you can use the silc_hmac_init,
- *    silc_hmac_update and silc_hmac_final to do the MAC.  This function
- *    prepares the allocated HMAC context for this kind of MAC
- *    computation.  The caller must have been called the function
- *    silc_hmac_set_key before calling this function.  To add the
- *    data to be used in the MAC computation call the silc_hmac_update
- *    function.
- *
- ***/
-void silc_hmac_init(SilcHmac hmac);
-
-/****f* silccrypt/SilcHMACAPI/silc_hmac_init_with_key
- *
- * SYNOPSIS
- *
- *    void silc_hmac_init_with_key(SilcHmac hmac, const unsigned char *key,
- *                                 SilcUInt32 key_len);
- *
- * DESCRIPTION
- *
- *    Same as silc_hmac_init but initializes with specific key.  The
- *    key that may have been set with silc_hmac_set_key is ignored.
- *
- ***/
-void silc_hmac_init_with_key(SilcHmac hmac, const unsigned char *key,
-                            SilcUInt32 key_len);
-
-/****f* silccrypt/SilcHMACAPI/silc_hmac_update
- *
- * SYNOPSIS
- *
- *    void silc_hmac_update(SilcHmac hmac, const unsigned char *data,
- *                          SilcUInt32 data_len);
- *
- * DESCRIPTION
- *
- *    This function may be called to add data to be used in the MAC
- *    computation.  This can be called multiple times to add data from
- *    many sources before actually performing the HMAC.  Once you've
- *    added all the data you need you can call the silc_hmac_final to
- *    actually produce the MAC.
- *
- * EXAMPLE
- *
- *    unsigned char mac[20];
- *    SilcUInt32 mac_len;
- *
- *    silc_hmac_init(hmac);
- *    silc_hmac_update(hmac, data, data_len);
- *    silc_hmac_update(hmac, more_data, more_data_len);
- *    silc_hmac_final(hmac, mac, &mac_len);
- *
- ***/
-void silc_hmac_update(SilcHmac hmac, const unsigned char *data,
-                     SilcUInt32 data_len);
-
-/****f* silccrypt/SilcHMACAPI/silc_hmac_final
- *
- * SYNOPSIS
- *
- *    void silc_hmac_final(SilcHmac hmac, unsigned char *return_hash,
- *                         SilcUInt32 *return_len);
- *
- * DESCRIPTION
- *
- *    This function is used to produce the final MAC from the data
- *    that has been added to the HMAC context by calling the
- *    silc_hmac_update function.  The MAC is copied in to the
- *    `return_hash' pointer which must be at least the size that
- *    the silc_hmac_len returns.  The length of the MAC is still
- *    returned into `return_len'.
- *
- ***/
-void silc_hmac_final(SilcHmac hmac, unsigned char *return_hash,
-                    SilcUInt32 *return_len);
-
-#endif
diff --git a/lib/silccrypt/silcpk.c b/lib/silccrypt/silcpk.c
deleted file mode 100644 (file)
index e4a0007..0000000
+++ /dev/null
@@ -1,1681 +0,0 @@
-/*
-
-  silcpk.c
-
-  Author: Pekka Riikonen <priikone@silcnet.org>
-
-  Copyright (C) 1997 - 2007 Pekka Riikonen
-
-  This program is free software; you can redistribute it and/or modify
-  it under the terms of the GNU General Public License as published by
-  the Free Software Foundation; version 2 of the License.
-
-  This program is distributed in the hope that it will be useful,
-  but WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-  GNU General Public License for more details.
-
-*/
-
-#include "silc.h"
-#include "silcpk_i.h"
-
-/****************************** Key generation *******************************/
-
-/* Generate new SILC key pair. */
-
-SilcBool silc_pkcs_silc_generate_key(const char *algorithm,
-                                    SilcUInt32 bits_key_len,
-                                    const char *identifier,
-                                    SilcRng rng,
-                                    SilcPublicKey *ret_public_key,
-                                    SilcPrivateKey *ret_private_key)
-{
-  SilcSILCPublicKey pubkey;
-  SilcSILCPrivateKey privkey;
-  const SilcPKCSAlgorithm *alg;
-  const SilcPKCSObject *pkcs;
-  SilcUInt32 version;
-
-  SILC_LOG_DEBUG(("Generating SILC %s key pair with key length %d bits",
-                 algorithm, bits_key_len));
-
-  if (!rng)
-    return FALSE;
-
-  pkcs = silc_pkcs_find_pkcs(SILC_PKCS_SILC);
-  if (!pkcs)
-    return FALSE;
-
-  /* Allocate SILC public key */
-  pubkey = silc_calloc(1, sizeof(*pubkey));
-  if (!pubkey)
-    return FALSE;
-
-  /* Decode identifier */
-  if (!silc_pkcs_silc_decode_identifier(identifier, &pubkey->identifier))
-    return FALSE;
-
-  if (pubkey->identifier.version && atoi(pubkey->identifier.version) >= 2)
-    version = 2;
-  else
-    version = 1;
-
-  /* Allocate algorithm */
-  alg = silc_pkcs_find_algorithm(algorithm, (version == 1 ? "pkcs1-no-oid" :
-                                            "pkcs1"));
-  if (!alg) {
-    silc_free(pubkey);
-    return FALSE;
-  }
-  pubkey->pkcs = alg;
-
-  /* Allocate SILC private key */
-  privkey = silc_calloc(1, sizeof(*privkey));
-  if (!privkey) {
-    silc_free(pubkey);
-    return FALSE;
-  }
-  privkey->pkcs = alg;
-
-  /* Allocate public key */
-  *ret_public_key = silc_calloc(1, sizeof(**ret_public_key));
-  if (!(*ret_public_key)) {
-    silc_free(pubkey);
-    silc_free(privkey);
-    return FALSE;
-  }
-  (*ret_public_key)->pkcs = pkcs;
-  (*ret_public_key)->public_key = pubkey;
-
-  /* Allocate private key */
-  *ret_private_key = silc_calloc(1, sizeof(**ret_private_key));
-  if (!(*ret_private_key)) {
-    silc_free(pubkey);
-    silc_free(privkey);
-    silc_free(*ret_public_key);
-    return FALSE;
-  }
-  (*ret_private_key)->pkcs = pkcs;
-  (*ret_private_key)->private_key = privkey;
-
-  /* Generate the algorithm key pair */
-  if (!alg->generate_key(bits_key_len, rng, &pubkey->public_key,
-                        &privkey->private_key)) {
-    silc_free(pubkey);
-    silc_free(privkey);
-    silc_free(*ret_public_key);
-    silc_free(*ret_private_key);
-    return FALSE;
-  }
-
-  return TRUE;
-}
-
-
-/**************************** Utility functions ******************************/
-
-/* Decodes the provided `identifier' */
-
-SilcBool silc_pkcs_silc_decode_identifier(const char *identifier,
-                                         SilcPublicKeyIdentifier ident)
-{
-  char *cp, *item;
-  int len;
-
-  /* Protocol says that at least UN and HN must be provided as identifier */
-  if (!strstr(identifier, "UN=") || !strstr(identifier, "HN=")) {
-    SILC_LOG_DEBUG(("The public does not have the required UN= and HN= "
-                   "identifiers"));
-    return FALSE;
-  }
-
-  cp = (char *)identifier;
-  while (cp) {
-    len = strcspn(cp, ",");
-    if (len < 1) {
-      cp = NULL;
-      break;
-    }
-    if (len - 1 >= 0 && cp[len - 1] == '\\') {
-      while (cp) {
-       if (len + 1 > strlen(cp)) {
-         cp = NULL;
-         break;
-       }
-       cp += len + 1;
-       len = strcspn(cp, ",") + len;
-       if (len < 1) {
-         cp = NULL;
-         break;
-       }
-       if (len - 1 >= 0 && cp[len - 1] != '\\')
-         break;
-      }
-    }
-
-    if (!cp)
-      break;
-
-    item = silc_calloc(len + 1, sizeof(char));
-    if (!item)
-      return FALSE;
-    if (len > strlen(cp))
-      break;
-    memcpy(item, cp, len);
-
-    if (strstr(item, "UN="))
-      ident->username = strdup(item + strcspn(cp, "=") + 1);
-    else if (strstr(item, "HN="))
-      ident->host = strdup(item + strcspn(cp, "=") + 1);
-    else if (strstr(item, "RN="))
-      ident->realname = strdup(item + strcspn(cp, "=") + 1);
-    else if (strstr(item, "E="))
-      ident->email = strdup(item + strcspn(cp, "=") + 1);
-    else if (strstr(item, "O="))
-      ident->org = strdup(item + strcspn(cp, "=") + 1);
-    else if (strstr(item, "C="))
-      ident->country = strdup(item + strcspn(cp, "=") + 1);
-    else if (strstr(item, "V="))
-      ident->version = strdup(item + strcspn(cp, "=") + 1);
-
-    cp += len;
-    if (strlen(cp) < 1)
-      cp = NULL;
-    else
-      cp += 1;
-
-    if (item)
-      silc_free(item);
-  }
-
-  return TRUE;
-}
-
-/* Encodes and returns SILC public key identifier.  If some of the
-   arguments is NULL those are not encoded into the identifier string.
-   Protocol says that at least username and host must be provided. */
-
-char *silc_pkcs_silc_encode_identifier(char *username, char *host,
-                                      char *realname, char *email,
-                                      char *org, char *country,
-                                      char *version)
-{
-  SilcBufferStruct buf;
-  char *identifier;
-
-  if (!username || !host)
-    return NULL;
-  if (strlen(username) < 1 || strlen(host) < 1)
-    return NULL;
-
-  memset(&buf, 0, sizeof(buf));
-
-  if (username)
-    silc_buffer_format(&buf,
-                      SILC_STR_ADVANCE,
-                      SILC_STR_UI32_STRING("UN="),
-                      SILC_STR_UI32_STRING(username),
-                      SILC_STR_END);
-
-  if (host)
-    silc_buffer_format(&buf,
-                      SILC_STR_ADVANCE,
-                      SILC_STR_UI32_STRING(", "),
-                      SILC_STR_UI32_STRING("HN="),
-                      SILC_STR_UI32_STRING(host),
-                      SILC_STR_END);
-
-  if (realname)
-    silc_buffer_format(&buf,
-                      SILC_STR_ADVANCE,
-                      SILC_STR_UI32_STRING(", "),
-                      SILC_STR_UI32_STRING("RN="),
-                      SILC_STR_UI32_STRING(realname),
-                      SILC_STR_END);
-
-  if (email)
-    silc_buffer_format(&buf,
-                      SILC_STR_ADVANCE,
-                      SILC_STR_UI32_STRING(", "),
-                      SILC_STR_UI32_STRING("E="),
-                      SILC_STR_UI32_STRING(email),
-                      SILC_STR_END);
-
-  if (org)
-    silc_buffer_format(&buf,
-                      SILC_STR_ADVANCE,
-                      SILC_STR_UI32_STRING(", "),
-                      SILC_STR_UI32_STRING("O="),
-                      SILC_STR_UI32_STRING(org),
-                      SILC_STR_END);
-
-  if (country)
-    silc_buffer_format(&buf,
-                      SILC_STR_ADVANCE,
-                      SILC_STR_UI32_STRING(", "),
-                      SILC_STR_UI32_STRING("C="),
-                      SILC_STR_UI32_STRING(country),
-                      SILC_STR_END);
-
-  if (version) {
-    if (strlen(version) > 1 || !isdigit(version[0])) {
-      silc_buffer_purge(&buf);
-      return NULL;
-    }
-    silc_buffer_format(&buf,
-                      SILC_STR_ADVANCE,
-                      SILC_STR_UI32_STRING(", "),
-                      SILC_STR_UI32_STRING("V="),
-                      SILC_STR_UI32_STRING(version),
-                      SILC_STR_END);
-  }
-
-  silc_buffer_format(&buf, SILC_STR_UI_CHAR(0), SILC_STR_END);
-
-  identifier = silc_buffer_steal(&buf, NULL);
-  return identifier;
-}
-
-/* Return SILC public key version */
-
-int silc_pkcs_silc_public_key_version(SilcPublicKey public_key)
-{
-  SilcSILCPublicKey silc_pubkey;
-
-  if (silc_pkcs_get_type(public_key) != SILC_PKCS_SILC)
-    return -1;
-
-  silc_pubkey = public_key->public_key;
-
-  /* If version identifire is not present it is version 1. */
-  if (!silc_pubkey->identifier.version)
-    return 1;
-
-  return atoi(silc_pubkey->identifier.version);
-}
-
-/*************************** Public key routines *****************************/
-
-/* Returns PKCS algorithm context */
-
-const SilcPKCSAlgorithm *silc_pkcs_silc_get_algorithm(void *public_key)
-{
-  SilcSILCPublicKey silc_pubkey = public_key;
-  return silc_pubkey->pkcs;
-}
-
-/* Imports SILC protocol style public key from SILC public key file */
-
-SilcBool silc_pkcs_silc_import_public_key_file(unsigned char *filedata,
-                                              SilcUInt32 filedata_len,
-                                              SilcPKCSFileEncoding encoding,
-                                              void **ret_public_key)
-{
-  SilcUInt32 i, len;
-  unsigned char *data = NULL;
-  int ret;
-
-  SILC_LOG_DEBUG(("Parsing SILC public key file"));
-
-  if (!ret_public_key)
-    return FALSE;
-
-  /* Check start of file and remove header from the data. */
-  len = strlen(SILC_PKCS_PUBLIC_KEYFILE_BEGIN);
-  if (filedata_len < len + strlen(SILC_PKCS_PUBLIC_KEYFILE_END)) {
-    SILC_LOG_ERROR(("Malformed SILC public key header"));
-    return FALSE;
-  }
-  for (i = 0; i < len; i++) {
-    if (*filedata != SILC_PKCS_PUBLIC_KEYFILE_BEGIN[i]) {
-      SILC_LOG_ERROR(("Malformed SILC public key header"));
-      return FALSE;
-    }
-    filedata++;
-  }
-  filedata_len -= (strlen(SILC_PKCS_PUBLIC_KEYFILE_BEGIN) +
-                  strlen(SILC_PKCS_PUBLIC_KEYFILE_END));
-
-  switch (encoding) {
-  case SILC_PKCS_FILE_BIN:
-    break;
-
-  case SILC_PKCS_FILE_BASE64:
-    data = silc_base64_decode(filedata, filedata_len, &filedata_len);
-    if (!data)
-      return FALSE;
-    filedata = data;
-    break;
-  }
-
-  ret = silc_pkcs_silc_import_public_key(filedata, filedata_len,
-                                        ret_public_key);
-  silc_free(data);
-
-  return ret ? TRUE : FALSE;
-}
-
-/* Imports SILC protocol style public key */
-
-int silc_pkcs_silc_import_public_key(unsigned char *key,
-                                    SilcUInt32 key_len,
-                                    void **ret_public_key)
-{
-  const SilcPKCSAlgorithm *pkcs;
-  SilcBufferStruct buf, alg_key;
-  SilcSILCPublicKey silc_pubkey = NULL;
-  SilcAsn1 asn1 = NULL;
-  SilcUInt32 totlen, keydata_len;
-  SilcUInt16 pkcs_len, identifier_len;
-  unsigned char *pkcs_name = NULL, *ident = NULL, *key_data = NULL;
-  int ret;
-
-  SILC_LOG_DEBUG(("Parsing SILC public key"));
-
-  if (!ret_public_key)
-    return 0;
-
-  silc_buffer_set(&buf, key, key_len);
-
-  /* Get length */
-  ret = silc_buffer_unformat(&buf,
-                            SILC_STR_ADVANCE,
-                            SILC_STR_UI_INT(&totlen),
-                            SILC_STR_END);
-  if (ret == -1)
-    goto err;
-
-  /* Backwards compatibility */
-  if (totlen == key_len)
-    totlen -= 4;
-
-  if (totlen + 4 != key_len)
-    goto err;
-
-  /* Get algorithm name and identifier */
-  ret =
-    silc_buffer_unformat(&buf,
-                        SILC_STR_ADVANCE,
-                        SILC_STR_UI16_NSTRING_ALLOC(&pkcs_name, &pkcs_len),
-                        SILC_STR_UI16_NSTRING_ALLOC(&ident, &identifier_len),
-                        SILC_STR_END);
-  if (ret == -1)
-    goto err;
-
-  if (pkcs_len < 1 || identifier_len < 3 ||
-      pkcs_len + identifier_len > totlen)
-    goto err;
-
-  /* Get key data */
-  keydata_len = silc_buffer_len(&buf);
-  ret = silc_buffer_unformat(&buf,
-                            SILC_STR_DATA(&key_data, keydata_len),
-                            SILC_STR_END);
-  if (ret == -1)
-    goto err;
-
-  /* Allocate SILC public key context */
-  silc_pubkey = silc_calloc(1, sizeof(*silc_pubkey));
-  if (!silc_pubkey)
-    goto err;
-
-  /* Decode SILC identifier */
-  if (!silc_pkcs_silc_decode_identifier(ident, &silc_pubkey->identifier))
-    goto err;
-
-  asn1 = silc_asn1_alloc();
-  if (!asn1)
-    goto err;
-
-  SILC_LOG_DEBUG(("Public key version %s",
-                 (!silc_pubkey->identifier.version ? "1" :
-                  silc_pubkey->identifier.version)));
-
-  if (!strcmp(pkcs_name, "rsa")) {
-    /* Parse the SILC RSA public key */
-    SilcUInt32 e_len, n_len;
-    SilcMPInt n, e;
-
-    /* Get PKCS object.  Different PKCS #1 scheme is used with different
-       versions. */
-    if (!silc_pubkey->identifier.version ||
-       atoi(silc_pubkey->identifier.version) <= 1) {
-      /* Version 1 */
-      pkcs = silc_pkcs_find_algorithm(pkcs_name, "pkcs1-no-oid");
-    } else {
-      /* Version 2 and newer */
-      pkcs = silc_pkcs_find_algorithm(pkcs_name, "pkcs1");
-    }
-    if (!pkcs) {
-      SILC_LOG_DEBUG(("Unsupported PKCS algorithm: rsa"));
-      goto err;
-    }
-    silc_pubkey->pkcs = pkcs;
-
-    if (keydata_len < 4)
-      goto err;
-    SILC_GET32_MSB(e_len, key_data);
-    if (!e_len || e_len + 4 > keydata_len)
-      goto err;
-    silc_mp_init(&e);
-    silc_mp_bin2mp(key_data + 4, e_len, &e);
-    if (keydata_len < 4 + e_len + 4) {
-      silc_mp_uninit(&e);
-      goto err;
-    }
-    SILC_GET32_MSB(n_len, key_data + 4 + e_len);
-    if (!n_len || e_len + 4 + n_len + 4 > keydata_len) {
-      silc_mp_uninit(&e);
-      goto err;
-    }
-    silc_mp_init(&n);
-    silc_mp_bin2mp(key_data + 4 + e_len + 4, n_len, &n);
-
-    /* Encode to PKCS #1 format */
-    memset(&alg_key, 0, sizeof(alg_key));
-    if (!silc_asn1_encode(asn1, &alg_key,
-                         SILC_ASN1_SEQUENCE,
-                           SILC_ASN1_INT(&n),
-                           SILC_ASN1_INT(&e),
-                         SILC_ASN1_END, SILC_ASN1_END)) {
-      silc_mp_uninit(&e);
-      silc_mp_uninit(&n);
-      goto err;
-    }
-
-    silc_mp_uninit(&e);
-    silc_mp_uninit(&n);
-
-  } else if (!strcmp(pkcs_name, "dsa")) {
-    SILC_NOT_IMPLEMENTED("DSA SILC Public Key");
-    goto err;
-
-  } else {
-    SILC_LOG_DEBUG(("Unsupported PKCS algorithm"));
-    goto err;
-  }
-
-  /* Import PKCS algorithm public key */
-  if (!pkcs->import_public_key(alg_key.data, silc_buffer_len(&alg_key),
-                              &silc_pubkey->public_key))
-    goto err;
-
-  silc_free(pkcs_name);
-  silc_free(ident);
-  silc_asn1_free(asn1);
-
-  *ret_public_key = silc_pubkey;
-
-  return key_len;
-
- err:
-  silc_free(pkcs_name);
-  silc_free(ident);
-  silc_free(silc_pubkey);
-  if (asn1)
-    silc_asn1_free(asn1);
-  return 0;
-}
-
-/* Exports public key as SILC protocol style public key file */
-
-unsigned char *
-silc_pkcs_silc_export_public_key_file(void *public_key,
-                                     SilcPKCSFileEncoding encoding,
-                                     SilcUInt32 *ret_len)
-{
-  SilcBuffer buf;
-  unsigned char *key, *data;
-  SilcUInt32 key_len;
-
-  SILC_LOG_DEBUG(("Encoding SILC public key file"));
-
-  /* Export key */
-  key = silc_pkcs_silc_export_public_key(public_key, &key_len);
-  if (!key)
-    return NULL;
-
-  switch (encoding) {
-  case SILC_PKCS_FILE_BIN:
-    break;
-
-  case SILC_PKCS_FILE_BASE64:
-    data = silc_base64_encode_file(key, key_len);
-    if (!data)
-      return NULL;
-    silc_free(key);
-    key = data;
-    key_len = strlen(data);
-    break;
-  }
-
-  /* Encode SILC public key file */
-  buf = silc_buffer_alloc_size(key_len +
-                              (strlen(SILC_PKCS_PUBLIC_KEYFILE_BEGIN) +
-                               strlen(SILC_PKCS_PUBLIC_KEYFILE_END)));
-  if (!buf) {
-    silc_free(key);
-    return NULL;
-  }
-
-  if (silc_buffer_format(buf,
-                        SILC_STR_UI32_STRING(SILC_PKCS_PUBLIC_KEYFILE_BEGIN),
-                        SILC_STR_UI_XNSTRING(key, key_len),
-                        SILC_STR_UI32_STRING(SILC_PKCS_PUBLIC_KEYFILE_END),
-                        SILC_STR_END) < 0) {
-    silc_buffer_free(buf);
-    silc_free(key);
-    return NULL;
-  }
-
-  silc_free(key);
-  key = silc_buffer_steal(buf, ret_len);
-  silc_buffer_free(buf);
-
-  return key;
-}
-
-/* Exports public key as SILC protocol style public key */
-
-unsigned char *silc_pkcs_silc_export_public_key(void *public_key,
-                                               SilcUInt32 *ret_len)
-{
-  SilcSILCPublicKey silc_pubkey = public_key;
-  const SilcPKCSAlgorithm *pkcs = silc_pubkey->pkcs;
-  SilcBufferStruct alg_key;
-  SilcBuffer buf = NULL;
-  SilcAsn1 asn1 = NULL;
-  unsigned char *pk = NULL, *key = NULL, *ret;
-  SilcUInt32 pk_len, key_len, totlen;
-  char *identifier;
-
-  SILC_LOG_DEBUG(("Encoding SILC public key"));
-
-  /* Export PKCS algorithm public key */
-  if (pkcs->export_public_key)
-    pk = pkcs->export_public_key(silc_pubkey->public_key, &pk_len);
-  if (!pk) {
-    SILC_LOG_ERROR(("Error exporting PKCS algorithm key"));
-    return NULL;
-  }
-  silc_buffer_set(&alg_key, pk, pk_len);
-
-  /* Encode identifier */
-  identifier =
-    silc_pkcs_silc_encode_identifier(silc_pubkey->identifier.username,
-                                    silc_pubkey->identifier.host,
-                                    silc_pubkey->identifier.realname,
-                                    silc_pubkey->identifier.email,
-                                    silc_pubkey->identifier.org,
-                                    silc_pubkey->identifier.country,
-                                    silc_pubkey->identifier.version);
-  if (!identifier) {
-    SILC_LOG_ERROR(("Error encoding SILC public key identifier"));
-    goto err;
-  }
-
-  asn1 = silc_asn1_alloc();
-  if (!asn1)
-    goto err;
-
-  if (!strcmp(pkcs->name, "rsa")) {
-    /* Parse the PKCS #1 public key */
-    SilcMPInt n, e;
-    SilcUInt32 n_len, e_len;
-    unsigned char *nb, *eb;
-
-    memset(&n, 0, sizeof(n));
-    memset(&e, 0, sizeof(e));
-    if (!silc_asn1_decode(asn1, &alg_key,
-                         SILC_ASN1_SEQUENCE,
-                           SILC_ASN1_INT(&n),
-                           SILC_ASN1_INT(&e),
-                         SILC_ASN1_END, SILC_ASN1_END))
-      goto err;
-
-    /* Encode to SILC RSA public key */
-    eb = silc_mp_mp2bin(&e, 0, &e_len);
-    if (!eb)
-      goto err;
-    nb = silc_mp_mp2bin(&n, 0, &n_len);
-    if (!nb)
-      goto err;
-    key_len = e_len + 4 + n_len + 4;
-    key = silc_calloc(key_len, sizeof(*key));
-    if (!key)
-      goto err;
-
-    /* Put e length and e */
-    SILC_PUT32_MSB(e_len, key);
-    memcpy(key + 4, eb, e_len);
-
-    /* Put n length and n. */
-    SILC_PUT32_MSB(n_len, key + 4 + e_len);
-    memcpy(key + 4 + e_len + 4, nb, n_len);
-
-    silc_free(nb);
-    silc_free(eb);
-
-  } else if (!strcmp(pkcs->name, "dsa")) {
-    SILC_NOT_IMPLEMENTED("SILC DSA Public Key");
-    goto err;
-
-  } else {
-    SILC_LOG_ERROR(("Unsupported PKCS algorithm: %s", pkcs->name));
-    goto err;
-  }
-
-  /* Encode SILC Public Key */
-  totlen = 2 + strlen(pkcs->name) + 2 + strlen(identifier) + key_len;
-  buf = silc_buffer_alloc_size(totlen + 4);
-  if (!buf)
-    goto err;
-  if (silc_buffer_format(buf,
-                        SILC_STR_UI_INT(totlen),
-                        SILC_STR_UI_SHORT(strlen(pkcs->name)),
-                        SILC_STR_UI32_STRING(pkcs->name),
-                        SILC_STR_UI_SHORT(strlen(identifier)),
-                        SILC_STR_UI32_STRING(identifier),
-                        SILC_STR_UI_XNSTRING(key, key_len),
-                        SILC_STR_END) < 0)
-    goto err;
-
-  ret = silc_buffer_steal(buf, ret_len);
-  silc_buffer_free(buf);
-  silc_free(key);
-  silc_free(identifier);
-  silc_buffer_purge(&alg_key);
-  silc_asn1_free(asn1);
-
-  return ret;
-
- err:
-  silc_free(identifier);
-  silc_free(pk);
-  silc_free(key);
-  if (buf)
-    silc_buffer_free(buf);
-  if (asn1)
-    silc_asn1_free(asn1);
-  return NULL;
-}
-
-/* Return key length */
-
-SilcUInt32 silc_pkcs_silc_public_key_bitlen(void *public_key)
-{
-  SilcSILCPublicKey silc_pubkey = public_key;
-  return silc_pubkey->pkcs->public_key_bitlen(silc_pubkey->public_key);
-}
-
-/* Copy public key */
-
-void *silc_pkcs_silc_public_key_copy(void *public_key)
-{
-  SilcSILCPublicKey silc_pubkey = public_key, new_pubkey;
-  SilcPublicKeyIdentifier ident = &silc_pubkey->identifier;
-
-  new_pubkey = silc_calloc(1, sizeof(*new_pubkey));
-  if (!new_pubkey)
-    return NULL;
-  new_pubkey->pkcs = silc_pubkey->pkcs;
-
-  new_pubkey->public_key =
-    silc_pubkey->pkcs->public_key_copy(silc_pubkey->public_key);
-  if (!new_pubkey->public_key) {
-    silc_free(new_pubkey);
-    return NULL;
-  }
-
-  if (ident->username)
-    new_pubkey->identifier.username =
-      silc_memdup(ident->username, strlen(ident->username));
-  if (ident->host)
-    new_pubkey->identifier.host =
-      silc_memdup(ident->host, strlen(ident->host));
-  if (ident->realname)
-    new_pubkey->identifier.realname =
-      silc_memdup(ident->realname, strlen(ident->realname));
-  if (ident->email)
-    new_pubkey->identifier.email =
-      silc_memdup(ident->email, strlen(ident->email));
-  if (ident->org)
-    new_pubkey->identifier.org =
-      silc_memdup(ident->org, strlen(ident->org));
-  if (ident->country)
-    new_pubkey->identifier.country =
-      silc_memdup(ident->country, strlen(ident->country));
-  if (ident->version)
-    new_pubkey->identifier.version =
-      silc_memdup(ident->version, strlen(ident->version));
-
-  return new_pubkey;
-}
-
-/* Compares public keys */
-
-SilcBool silc_pkcs_silc_public_key_compare(void *key1, void *key2)
-{
-  SilcSILCPublicKey k1 = key1, k2 = key2;
-
-  if (strcmp(k1->pkcs->name, k2->pkcs->name))
-    return FALSE;
-
-  if ((k1->identifier.username && !k2->identifier.username) ||
-      (!k1->identifier.username && k2->identifier.username) ||
-      (k1->identifier.username && k2->identifier.username &&
-       strcmp(k1->identifier.username, k2->identifier.username)))
-    return FALSE;
-
-  if ((k1->identifier.host && !k2->identifier.host) ||
-      (!k1->identifier.host && k2->identifier.host) ||
-      (k1->identifier.host && k2->identifier.host &&
-       strcmp(k1->identifier.host, k2->identifier.host)))
-    return FALSE;
-
-  if ((k1->identifier.realname && !k2->identifier.realname) ||
-      (!k1->identifier.realname && k2->identifier.realname) ||
-      (k1->identifier.realname && k2->identifier.realname &&
-       strcmp(k1->identifier.realname, k2->identifier.realname)))
-    return FALSE;
-
-  if ((k1->identifier.email && !k2->identifier.email) ||
-      (!k1->identifier.email && k2->identifier.email) ||
-      (k1->identifier.email && k2->identifier.email &&
-       strcmp(k1->identifier.email, k2->identifier.email)))
-    return FALSE;
-
-  if ((k1->identifier.org && !k2->identifier.org) ||
-      (!k1->identifier.org && k2->identifier.org) ||
-      (k1->identifier.org && k2->identifier.org &&
-       strcmp(k1->identifier.org, k2->identifier.org)))
-    return FALSE;
-
-  if ((k1->identifier.country && !k2->identifier.country) ||
-      (!k1->identifier.country && k2->identifier.country) ||
-      (k1->identifier.country && k2->identifier.country &&
-       strcmp(k1->identifier.country, k2->identifier.country)))
-    return FALSE;
-
-  if ((k1->identifier.version && !k2->identifier.version) ||
-      (!k1->identifier.version && k2->identifier.version) ||
-      (k1->identifier.version && k2->identifier.version &&
-       strcmp(k1->identifier.version, k2->identifier.version)))
-    return FALSE;
-
-  return k1->pkcs->public_key_compare(k1->public_key, k2->public_key);
-}
-
-/* Frees public key */
-
-void silc_pkcs_silc_public_key_free(void *public_key)
-{
-  SilcSILCPublicKey silc_pubkey = public_key;
-
-  silc_pubkey->pkcs->public_key_free(silc_pubkey->public_key);
-
-  silc_free(silc_pubkey->identifier.username);
-  silc_free(silc_pubkey->identifier.host);
-  silc_free(silc_pubkey->identifier.realname);
-  silc_free(silc_pubkey->identifier.email);
-  silc_free(silc_pubkey->identifier.org);
-  silc_free(silc_pubkey->identifier.country);
-  silc_free(silc_pubkey->identifier.version);
-  silc_free(silc_pubkey);
-}
-
-
-/*************************** Private key routines ****************************/
-
-/* Private key file magic */
-#define SILC_PKCS_PRIVATE_KEY_MAGIC 0x738df531
-
-/* Imports SILC implementation style private key file */
-
-SilcBool silc_pkcs_silc_import_private_key_file(unsigned char *filedata,
-                                               SilcUInt32 filedata_len,
-                                               const char *passphrase,
-                                               SilcUInt32 passphrase_len,
-                                               SilcPKCSFileEncoding encoding,
-                                               void **ret_private_key)
-{
-  SilcCipher aes;
-  SilcHash sha1;
-  SilcHmac sha1hmac;
-  SilcUInt32 blocklen;
-  unsigned char tmp[32], keymat[64], *data = NULL;
-  SilcUInt32 i, len, magic, mac_len;
-  int ret;
-
-  SILC_LOG_DEBUG(("Parsing SILC private key file"));
-
-  /* Check start of file and remove header from the data. */
-  len = strlen(SILC_PKCS_PRIVATE_KEYFILE_BEGIN);
-  if (filedata_len < len + strlen(SILC_PKCS_PRIVATE_KEYFILE_END)) {
-    SILC_LOG_ERROR(("Malformed SILC private key header"));
-    return FALSE;
-  }
-  for (i = 0; i < len; i++) {
-    if (*filedata != SILC_PKCS_PRIVATE_KEYFILE_BEGIN[i]) {
-      SILC_LOG_ERROR(("Malformed SILC private key header"));
-      return FALSE;
-    }
-    filedata++;
-  }
-
-  len = filedata_len - (strlen(SILC_PKCS_PRIVATE_KEYFILE_BEGIN) +
-                       strlen(SILC_PKCS_PRIVATE_KEYFILE_END));
-
-  switch (encoding) {
-  case SILC_PKCS_FILE_BIN:
-    break;
-
-  case SILC_PKCS_FILE_BASE64:
-    data = silc_base64_decode(filedata, filedata_len, &len);
-    if (!data)
-      return FALSE;
-    filedata = data;
-    break;
-  }
-
-  memset(tmp, 0, sizeof(tmp));
-  memset(keymat, 0, sizeof(keymat));
-
-  /* Check file magic */
-  SILC_GET32_MSB(magic, filedata);
-  if (magic != SILC_PKCS_PRIVATE_KEY_MAGIC) {
-    SILC_LOG_DEBUG(("Private key does not have correct magic"));
-    return FALSE;
-  }
-
-  /* Allocate the AES cipher */
-  if (!silc_cipher_alloc("aes-256-cbc", &aes)) {
-    SILC_LOG_ERROR(("Could not allocate AES cipher, probably not registered"));
-    return FALSE;
-  }
-  blocklen = silc_cipher_get_block_len(aes);
-  if (blocklen * 2 > sizeof(tmp)) {
-    silc_cipher_free(aes);
-    return FALSE;
-  }
-
-  /* Allocate SHA1 hash */
-  if (!silc_hash_alloc("sha1", &sha1)) {
-    SILC_LOG_ERROR(("Could not allocate SHA1 hash, probably not registered"));
-    silc_cipher_free(aes);
-    return FALSE;
-  }
-
-  /* Allocate HMAC */
-  if (!silc_hmac_alloc("hmac-sha1-96", NULL, &sha1hmac)) {
-    SILC_LOG_ERROR(("Could not allocate SHA1 HMAC, probably not registered"));
-    silc_hash_free(sha1);
-    silc_cipher_free(aes);
-    return FALSE;
-  }
-
-  /* Derive the decryption key from the provided key material.  The key
-     is 256 bits length, and derived by taking hash of the data, then
-     re-hashing the data and the previous digest, and using the first and
-     second digest as the key. */
-  silc_hash_init(sha1);
-  silc_hash_update(sha1, passphrase, passphrase_len);
-  silc_hash_final(sha1, keymat);
-  silc_hash_init(sha1);
-  silc_hash_update(sha1, passphrase, passphrase_len);
-  silc_hash_update(sha1, keymat, 16);
-  silc_hash_final(sha1, keymat + 16);
-
-  /* Set the key to the cipher */
-  silc_cipher_set_key(aes, keymat, 256, FALSE);
-
-  /* First, verify the MAC of the private key data */
-  mac_len = silc_hmac_len(sha1hmac);
-  silc_hmac_init_with_key(sha1hmac, keymat, 16);
-  silc_hmac_update(sha1hmac, filedata, len - mac_len);
-  silc_hmac_final(sha1hmac, tmp, NULL);
-  if (memcmp(tmp, filedata + (len - mac_len), mac_len)) {
-    SILC_LOG_DEBUG(("Integrity check for private key failed"));
-    memset(keymat, 0, sizeof(keymat));
-    memset(tmp, 0, sizeof(tmp));
-    silc_hmac_free(sha1hmac);
-    silc_hash_free(sha1);
-    silc_cipher_free(aes);
-    return FALSE;
-  }
-  filedata += 4;
-  len -= 4;
-
-  /* Decrypt the private key buffer */
-  silc_cipher_decrypt(aes, filedata, filedata, len - mac_len, NULL);
-  SILC_GET32_MSB(i, filedata);
-  if (i > len) {
-    SILC_LOG_DEBUG(("Bad private key length in buffer!"));
-    memset(keymat, 0, sizeof(keymat));
-    memset(tmp, 0, sizeof(tmp));
-    silc_hmac_free(sha1hmac);
-    silc_hash_free(sha1);
-    silc_cipher_free(aes);
-    return FALSE;
-  }
-  filedata += 4;
-  len = i;
-
-  /* Cleanup */
-  memset(keymat, 0, sizeof(keymat));
-  memset(tmp, 0, sizeof(tmp));
-  silc_hmac_free(sha1hmac);
-  silc_hash_free(sha1);
-  silc_cipher_free(aes);
-
-  /* Import the private key */
-  ret = silc_pkcs_silc_import_private_key(filedata, len, ret_private_key);
-
-  silc_free(data);
-
-  return ret ? TRUE : FALSE;
-}
-
-/* Private key version */
-#define SILC_PRIVATE_KEY_VERSION_1 0x82171273
-#define SILC_PRIVATE_KEY_VERSION_2 0xf911a3d1
-
-/* Imports SILC implementation style private key */
-
-int silc_pkcs_silc_import_private_key(unsigned char *key,
-                                     SilcUInt32 key_len,
-                                     void **ret_private_key)
-{
-  SilcBufferStruct buf;
-  const SilcPKCSAlgorithm *pkcs;
-  SilcBufferStruct alg_key;
-  SilcSILCPrivateKey silc_privkey = NULL;
-  SilcAsn1 asn1 = NULL;
-  SilcUInt16 pkcs_len;
-  SilcUInt32 keydata_len;
-  unsigned char *pkcs_name = NULL, *key_data;
-  int ret;
-
-  SILC_LOG_DEBUG(("Parsing SILC private key"));
-
-  if (!ret_private_key)
-    return 0;
-
-  silc_buffer_set(&buf, key, key_len);
-
-  /* Get algorithm name and identifier */
-  ret =
-    silc_buffer_unformat(&buf,
-                        SILC_STR_UI16_NSTRING_ALLOC(&pkcs_name, &pkcs_len),
-                        SILC_STR_END);
-  if (ret == -1) {
-    SILC_LOG_DEBUG(("Cannot decode private key buffer"));
-    goto err;
-  }
-
-  if (pkcs_len < 1 || pkcs_len > silc_buffer_truelen(&buf)) {
-    SILC_LOG_DEBUG(("Malformed private key buffer"));
-    goto err;
-  }
-
-  /* Get key data. We assume that rest of the buffer is key data. */
-  silc_buffer_pull(&buf, 2 + pkcs_len);
-  keydata_len = silc_buffer_len(&buf);
-  ret = silc_buffer_unformat(&buf,
-                            SILC_STR_UI_XNSTRING(&key_data, keydata_len),
-                            SILC_STR_END);
-  if (ret == -1)
-    goto err;
-
-  /* Allocate SILC private key context */
-  silc_privkey = silc_calloc(1, sizeof(*silc_privkey));
-  if (!silc_privkey)
-    goto err;
-
-  asn1 = silc_asn1_alloc();
-  if (!asn1)
-    goto err;
-
-  if (!strcmp(pkcs_name, "rsa")) {
-    /* Parse the RSA SILC private key */
-    SilcBufferStruct k;
-    SilcMPInt n, e, d, dp, dq, qp, p, q;
-    unsigned char *tmp;
-    SilcUInt32 len, ver;
-
-    if (keydata_len < 4)
-      goto err;
-    silc_buffer_set(&k, key_data, keydata_len);
-
-    /* Get version.  Key without the version is old style private key
-       and we need to do some computation to get it to correct format. */
-    if (silc_buffer_unformat(&k,
-                            SILC_STR_UI_INT(&ver),
-                            SILC_STR_END) < 0)
-      goto err;
-    silc_buffer_pull(&k, 4);
-
-    if (ver != SILC_PRIVATE_KEY_VERSION_1 &&
-       ver != SILC_PRIVATE_KEY_VERSION_2) {
-      len = ver;
-      ver = 0;
-    } else {
-      if (silc_buffer_unformat(&k,
-                              SILC_STR_UI_INT(&len),
-                              SILC_STR_END) < 0)
-       goto err;
-      silc_buffer_pull(&k, 4);
-    }
-
-    /* Get PKCS object.  Different PKCS #1 scheme is used with different
-       versions. */
-    if (ver == 0 || ver == SILC_PRIVATE_KEY_VERSION_1) {
-      /* Version 0 and 1 */
-      pkcs = silc_pkcs_find_algorithm(pkcs_name, "pkcs1-no-oid");
-    } else {
-      /* Version 2 and newer */
-      pkcs = silc_pkcs_find_algorithm(pkcs_name, "pkcs1");
-    }
-    if (!pkcs) {
-      SILC_LOG_DEBUG(("Unsupported PKCS algorithm"));
-      goto err;
-    }
-    silc_privkey->pkcs = pkcs;
-
-    SILC_LOG_DEBUG(("Private key version %s",
-                   (ver == SILC_PRIVATE_KEY_VERSION_1 ? "1" :
-                    ver == SILC_PRIVATE_KEY_VERSION_2 ? "2" : "0")));
-
-    /* Get e */
-    if (silc_buffer_unformat(&k,
-                            SILC_STR_DATA(&tmp, len),
-                            SILC_STR_END) < 0)
-      goto err;
-    silc_mp_init(&e);
-    silc_mp_bin2mp(tmp, len, &e);
-    silc_buffer_pull(&k, len);
-
-    /* Get n */
-    if (silc_buffer_unformat(&k,
-                            SILC_STR_UI_INT(&len),
-                            SILC_STR_END) < 0)
-      goto err;
-    silc_buffer_pull(&k, 4);
-    if (silc_buffer_unformat(&k,
-                            SILC_STR_DATA(&tmp, len),
-                            SILC_STR_END) < 0)
-      goto err;
-    silc_mp_init(&n);
-    silc_mp_bin2mp(tmp, len, &n);
-    silc_buffer_pull(&k, len);
-
-    /* Get d */
-    if (silc_buffer_unformat(&k,
-                            SILC_STR_UI_INT(&len),
-                            SILC_STR_END) < 0)
-      goto err;
-    silc_buffer_pull(&k, 4);
-    if (silc_buffer_unformat(&k,
-                            SILC_STR_DATA(&tmp, len),
-                            SILC_STR_END) < 0)
-      goto err;
-    silc_mp_init(&d);
-    silc_mp_bin2mp(tmp, len, &d);
-    silc_buffer_pull(&k, len);
-
-    /* Get dP */
-    if (silc_buffer_unformat(&k,
-                            SILC_STR_UI_INT(&len),
-                            SILC_STR_END) < 0)
-      goto err;
-    silc_buffer_pull(&k, 4);
-    if (silc_buffer_unformat(&k,
-                            SILC_STR_DATA(&tmp, len),
-                            SILC_STR_END) < 0)
-      goto err;
-    silc_mp_init(&dp);
-    silc_mp_bin2mp(tmp, len, &dp);
-    silc_buffer_pull(&k, len);
-
-    /* Get dQ */
-    if (silc_buffer_unformat(&k,
-                            SILC_STR_UI_INT(&len),
-                            SILC_STR_END) < 0)
-      goto err;
-    silc_buffer_pull(&k, 4);
-    if (silc_buffer_unformat(&k,
-                            SILC_STR_DATA(&tmp, len),
-                            SILC_STR_END) < 0)
-      goto err;
-    silc_mp_init(&dq);
-    silc_mp_bin2mp(tmp, len, &dq);
-    silc_buffer_pull(&k, len);
-
-    if (ver == 0) {
-      /* Old version */
-
-      /* Get pQ len */
-      if (silc_buffer_unformat(&k,
-                              SILC_STR_UI_INT(&len),
-                              SILC_STR_END) < 0)
-       goto err;
-      silc_buffer_pull(&k, 4);
-      if (silc_buffer_len(&k) < len)
-       goto err;
-      silc_buffer_pull(&k, len);
-
-      /* Get qP len */
-      if (silc_buffer_unformat(&k,
-                              SILC_STR_UI_INT(&len),
-                              SILC_STR_END) < 0)
-       goto err;
-      silc_buffer_pull(&k, 4);
-      if (silc_buffer_len(&k) < len)
-       goto err;
-      silc_buffer_pull(&k, len);
-    } else {
-      /* New version */
-
-      /* Get qP */
-      if (silc_buffer_unformat(&k,
-                              SILC_STR_UI_INT(&len),
-                              SILC_STR_END) < 0)
-       goto err;
-      silc_buffer_pull(&k, 4);
-      if (silc_buffer_unformat(&k,
-                              SILC_STR_DATA(&tmp, len),
-                              SILC_STR_END) < 0)
-       goto err;
-      silc_mp_init(&qp);
-      silc_mp_bin2mp(tmp, len, &qp);
-      silc_buffer_pull(&k, len);
-    }
-
-    /* Get p */
-    if (silc_buffer_unformat(&k,
-                            SILC_STR_UI_INT(&len),
-                            SILC_STR_END) < 0)
-      goto err;
-    silc_buffer_pull(&k, 4);
-    if (silc_buffer_unformat(&k,
-                            SILC_STR_DATA(&tmp, len),
-                            SILC_STR_END) < 0)
-      goto err;
-    silc_mp_init(&p);
-    silc_mp_bin2mp(tmp, len, &p);
-    silc_buffer_pull(&k, len);
-
-    /* Get q */
-    if (silc_buffer_unformat(&k,
-                            SILC_STR_UI_INT(&len),
-                            SILC_STR_END) < 0)
-      goto err;
-    silc_buffer_pull(&k, 4);
-    if (silc_buffer_unformat(&k,
-                            SILC_STR_DATA(&tmp, len),
-                            SILC_STR_END) < 0)
-      goto err;
-    silc_mp_init(&q);
-    silc_mp_bin2mp(tmp, len, &q);
-    silc_buffer_pull(&k, len);
-
-    if (ver == 0) {
-      /* Old version.  Compute to new version */
-      SILC_LOG_DEBUG(("Old version private key"));
-      silc_mp_init(&qp);
-      silc_mp_modinv(&qp, &q, &p);
-    }
-
-    /* Encode to PKCS #1 format */
-    memset(&alg_key, 0, sizeof(alg_key));
-    if (!silc_asn1_encode(asn1, &alg_key,
-                         SILC_ASN1_SEQUENCE,
-                           SILC_ASN1_SHORT_INT(0),
-                           SILC_ASN1_INT(&n),
-                           SILC_ASN1_INT(&e),
-                           SILC_ASN1_INT(&d),
-                           SILC_ASN1_INT(&p),
-                           SILC_ASN1_INT(&q),
-                           SILC_ASN1_INT(&dp),
-                           SILC_ASN1_INT(&dq),
-                           SILC_ASN1_INT(&qp),
-                         SILC_ASN1_END, SILC_ASN1_END))
-      goto err;
-
-    silc_mp_uninit(&n);
-    silc_mp_uninit(&e);
-    silc_mp_uninit(&e);
-    silc_mp_uninit(&d);
-    silc_mp_uninit(&p);
-    silc_mp_uninit(&q);
-    silc_mp_uninit(&dp);
-    silc_mp_uninit(&dq);
-    silc_mp_uninit(&qp);
-
-  } else if (!strcmp(pkcs_name, "dsa")) {
-    SILC_NOT_IMPLEMENTED("DSA SILC Private Key");
-    goto err;
-
-  } else {
-    SILC_LOG_DEBUG(("Unsupported PKCS algorithm"));
-    goto err;
-  }
-
-  /* Import PKCS algorithm private key */
-  if (!pkcs->import_private_key(alg_key.data, silc_buffer_len(&alg_key),
-                               &silc_privkey->private_key))
-    goto err;
-
-  silc_free(pkcs_name);
-  silc_asn1_free(asn1);
-
-  *ret_private_key = silc_privkey;
-
-  return key_len;
-
- err:
-  silc_free(pkcs_name);
-  silc_free(silc_privkey);
-  if (asn1)
-    silc_asn1_free(asn1);
-  SILC_LOG_ERROR(("Malformed SILC private key "));
-  return 0;
-}
-
-/* Exports private key as SILC implementation style private key file */
-
-unsigned char *
-silc_pkcs_silc_export_private_key_file(void *private_key,
-                                      const char *passphrase,
-                                      SilcUInt32 passphrase_len,
-                                      SilcPKCSFileEncoding encoding,
-                                      SilcRng rng,
-                                      SilcUInt32 *ret_len)
-{
-  SilcCipher aes;
-  SilcHash sha1;
-  SilcHmac sha1hmac;
-  SilcBuffer buf, enc;
-  SilcUInt32 len, blocklen, padlen, key_len;
-  unsigned char *key, *data;
-  unsigned char tmp[32], keymat[64];
-  int i;
-
-  SILC_LOG_DEBUG(("Encoding SILC private key file"));
-
-  /* Export the private key */
-  key = silc_pkcs_silc_export_private_key(private_key, &key_len);
-  if (!key)
-    return NULL;
-
-  memset(tmp, 0, sizeof(tmp));
-  memset(keymat, 0, sizeof(keymat));
-
-  /* Allocate the AES cipher */
-  if (!silc_cipher_alloc("aes-256-cbc", &aes)) {
-    SILC_LOG_ERROR(("Could not allocate AES cipher, probably not registered"));
-    silc_free(key);
-    return NULL;
-  }
-  blocklen = silc_cipher_get_block_len(aes);
-  if (blocklen * 2 > sizeof(tmp)) {
-    silc_cipher_free(aes);
-    silc_free(key);
-    return NULL;
-  }
-
-  /* Allocate SHA1 hash */
-  if (!silc_hash_alloc("sha1", &sha1)) {
-    SILC_LOG_ERROR(("Could not allocate SHA1 hash, probably not registered"));
-    silc_cipher_free(aes);
-    return NULL;
-  }
-
-  /* Allocate HMAC */
-  if (!silc_hmac_alloc("hmac-sha1-96", NULL, &sha1hmac)) {
-    SILC_LOG_ERROR(("Could not allocate SHA1 HMAC, probably not registered"));
-    silc_hash_free(sha1);
-    silc_cipher_free(aes);
-    return NULL;
-  }
-
-  /* Derive the encryption key from the provided key material.  The key
-     is 256 bits length, and derived by taking hash of the data, then
-     re-hashing the data and the previous digest, and using the first and
-     second digest as the key. */
-  silc_hash_init(sha1);
-  silc_hash_update(sha1, passphrase, passphrase_len);
-  silc_hash_final(sha1, keymat);
-  silc_hash_init(sha1);
-  silc_hash_update(sha1, passphrase, passphrase_len);
-  silc_hash_update(sha1, keymat, 16);
-  silc_hash_final(sha1, keymat + 16);
-
-  /* Set the key to the cipher */
-  silc_cipher_set_key(aes, keymat, 256, TRUE);
-
-  /* Encode the buffer to be encrypted.  Add padding to it too, at least
-     block size of the cipher. */
-
-  /* Allocate buffer for encryption */
-  len = silc_hmac_len(sha1hmac);
-  padlen = 16 + (16 - ((key_len + 4) % blocklen));
-  enc = silc_buffer_alloc_size(4 + 4 + key_len + padlen + len);
-  if (!enc) {
-    silc_hmac_free(sha1hmac);
-    silc_hash_free(sha1);
-    silc_cipher_free(aes);
-    return FALSE;
-  }
-
-  /* Generate padding */
-  for (i = 0; i < padlen; i++)
-    tmp[i] = silc_rng_get_byte_fast(rng);
-
-  /* Put magic number */
-  SILC_PUT32_MSB(SILC_PKCS_PRIVATE_KEY_MAGIC, enc->data);
-  silc_buffer_pull(enc, 4);
-
-  /* Encode the buffer */
-  silc_buffer_format(enc,
-                    SILC_STR_UI_INT(key_len),
-                    SILC_STR_UI_XNSTRING(key, key_len),
-                    SILC_STR_UI_XNSTRING(tmp, padlen),
-                    SILC_STR_END);
-  silc_free(key);
-
-  /* Encrypt. */
-  silc_cipher_encrypt(aes, enc->data, enc->data, silc_buffer_len(enc) - len,
-                     silc_cipher_get_iv(aes));
-
-  silc_buffer_push(enc, 4);
-
-  /* Compute HMAC over the encrypted data and append the MAC to data.
-     The key is the first digest of the original key material. */
-  key_len = silc_buffer_len(enc) - len;
-  silc_hmac_init_with_key(sha1hmac, keymat, 16);
-  silc_hmac_update(sha1hmac, enc->data, key_len);
-  silc_buffer_pull(enc, key_len);
-  silc_hmac_final(sha1hmac, enc->data, NULL);
-  silc_buffer_push(enc, key_len);
-
-  /* Cleanup */
-  memset(keymat, 0, sizeof(keymat));
-  memset(tmp, 0, sizeof(tmp));
-  silc_hmac_free(sha1hmac);
-  silc_hash_free(sha1);
-  silc_cipher_free(aes);
-
-  switch (encoding) {
-  case SILC_PKCS_FILE_BIN:
-    break;
-
-  case SILC_PKCS_FILE_BASE64:
-    data = silc_base64_encode_file(enc->data, silc_buffer_len(enc));
-    if (!data) {
-      silc_buffer_clear(enc);
-      silc_buffer_free(enc);
-      return NULL;
-    }
-    silc_free(silc_buffer_steal(enc, NULL));
-    silc_buffer_set(enc, data, strlen(data));
-    break;
-  }
-
-  key = enc->data;
-  key_len = silc_buffer_len(enc);
-
-  /* Encode the data and save to file */
-  len = key_len + (strlen(SILC_PKCS_PRIVATE_KEYFILE_BEGIN) +
-                  strlen(SILC_PKCS_PRIVATE_KEYFILE_END));
-  buf = silc_buffer_alloc_size(len);
-  if (!buf) {
-    silc_buffer_free(enc);
-    return NULL;
-  }
-  silc_buffer_format(buf,
-                    SILC_STR_UI32_STRING(SILC_PKCS_PRIVATE_KEYFILE_BEGIN),
-                    SILC_STR_UI_XNSTRING(key, key_len),
-                    SILC_STR_UI32_STRING(SILC_PKCS_PRIVATE_KEYFILE_END),
-                    SILC_STR_END);
-
-  silc_buffer_free(enc);
-  data = silc_buffer_steal(buf, ret_len);
-  silc_buffer_free(buf);
-
-  return data;
-}
-
-/* Exports private key as SILC implementation style private key */
-
-unsigned char *silc_pkcs_silc_export_private_key(void *private_key,
-                                                SilcUInt32 *ret_len)
-{
-  SilcSILCPrivateKey silc_privkey = private_key;
-  const SilcPKCSAlgorithm *pkcs = silc_privkey->pkcs;
-  SilcBufferStruct alg_key;
-  SilcBuffer buf = NULL;
-  SilcAsn1 asn1 = NULL;
-  unsigned char *prv = NULL, *key = NULL, *ret;
-  SilcUInt32 prv_len, key_len, totlen;
-
-  SILC_LOG_DEBUG(("Encoding SILC private key"));
-
-  /* Export PKCS algorithm private key */
-  if (pkcs->export_private_key)
-    prv = pkcs->export_private_key(silc_privkey->private_key, &prv_len);
-  if (!prv)
-    return NULL;
-  silc_buffer_set(&alg_key, prv, prv_len);
-
-  asn1 = silc_asn1_alloc();
-  if (!asn1)
-    goto err;
-
-  if (!strcmp(pkcs->name, "rsa")) {
-    /* Parse the PKCS #1 private key */
-    SilcMPInt n, e, d, dp, dq, qp, p, q;
-    SilcUInt32 e_len, n_len, d_len, dp_len, dq_len,
-      qp_len, p_len, q_len, len = 0;
-    unsigned char *nb, *eb, *db, *dpb, *dqb, *qpb, *pb, *qb;
-
-    if (!silc_asn1_decode(asn1, &alg_key,
-                         SILC_ASN1_SEQUENCE,
-                           SILC_ASN1_INT(NULL),
-                           SILC_ASN1_INT(&n),
-                           SILC_ASN1_INT(&e),
-                           SILC_ASN1_INT(&d),
-                           SILC_ASN1_INT(&p),
-                           SILC_ASN1_INT(&q),
-                           SILC_ASN1_INT(&dp),
-                           SILC_ASN1_INT(&dq),
-                           SILC_ASN1_INT(&qp),
-                         SILC_ASN1_END, SILC_ASN1_END))
-      goto err;
-
-    /* Encode to SILC RSA private key */
-    eb = silc_mp_mp2bin(&e, 0, &e_len);
-    nb = silc_mp_mp2bin(&n, 0, &n_len);
-    db = silc_mp_mp2bin(&d, 0, &d_len);
-    dpb = silc_mp_mp2bin(&dp, 0, &dp_len);
-    dqb = silc_mp_mp2bin(&dq, 0, &dq_len);
-    qpb = silc_mp_mp2bin(&qp, 0, &qp_len);
-    pb = silc_mp_mp2bin(&p, 0, &p_len);
-    qb = silc_mp_mp2bin(&q, 0, &q_len);
-    len = 4 + e_len + 4 + n_len + 4 + d_len + 4+ dp_len + 4 +
-      dq_len + 4 + qp_len + 4 + p_len + 4 + q_len + 4;
-
-    buf = silc_buffer_alloc_size(len);
-    if (!buf)
-      goto err;
-    if (silc_buffer_format(buf,
-                          SILC_STR_UI_INT(SILC_PRIVATE_KEY_VERSION_1),
-                          SILC_STR_UI_INT(e_len),
-                          SILC_STR_UI_XNSTRING(eb, e_len),
-                          SILC_STR_UI_INT(n_len),
-                          SILC_STR_UI_XNSTRING(nb, n_len),
-                          SILC_STR_UI_INT(d_len),
-                          SILC_STR_UI_XNSTRING(db, d_len),
-                          SILC_STR_UI_INT(dp_len),
-                          SILC_STR_UI_XNSTRING(dpb, dp_len),
-                          SILC_STR_UI_INT(dq_len),
-                          SILC_STR_UI_XNSTRING(dqb, dq_len),
-                          SILC_STR_UI_INT(qp_len),
-                          SILC_STR_UI_XNSTRING(qpb, qp_len),
-                          SILC_STR_UI_INT(p_len),
-                          SILC_STR_UI_XNSTRING(pb, p_len),
-                          SILC_STR_UI_INT(q_len),
-                          SILC_STR_UI_XNSTRING(qb, q_len),
-                          SILC_STR_END) < 0)
-      goto err;
-
-    key = silc_buffer_steal(buf, &key_len);
-    silc_buffer_free(buf);
-    silc_free(nb);
-    silc_free(eb);
-    silc_free(db);
-    silc_free(dpb);
-    silc_free(dqb);
-    silc_free(qpb);
-    silc_free(pb);
-    silc_free(qb);
-
-  } else if (!strcmp(pkcs->name, "dsa")) {
-    SILC_NOT_IMPLEMENTED("SILC DSA Private Key");
-    goto err;
-
-  } else {
-    SILC_LOG_DEBUG(("Unsupported PKCS algorithm"));
-    goto err;
-  }
-
-  /* Encode SILC private key */
-  totlen = 2 + strlen(pkcs->name) + key_len;
-  buf = silc_buffer_alloc_size(totlen);
-  if (!buf)
-    goto err;
-  if (silc_buffer_format(buf,
-                        SILC_STR_UI_SHORT(strlen(pkcs->name)),
-                        SILC_STR_UI32_STRING(pkcs->name),
-                        SILC_STR_UI_XNSTRING(key, key_len),
-                        SILC_STR_END) < 0)
-    goto err;
-
-  ret = silc_buffer_steal(buf, ret_len);
-  silc_buffer_free(buf);
-  silc_free(prv);
-  silc_free(key);
-  silc_asn1_free(asn1);
-
-  return ret;
-
- err:
-  silc_free(prv);
-  silc_free(key);
-  if (buf)
-    silc_buffer_free(buf);
-  return NULL;
-}
-
-/* Return key length */
-
-SilcUInt32 silc_pkcs_silc_private_key_bitlen(void *private_key)
-{
-  SilcSILCPrivateKey silc_privkey = private_key;
-  return silc_privkey->pkcs->private_key_bitlen(silc_privkey->private_key);
-}
-
-/* Frees private key */
-
-void silc_pkcs_silc_private_key_free(void *private_key)
-{
-  SilcSILCPrivateKey silc_privkey = private_key;
-
-  silc_privkey->pkcs->private_key_free(silc_privkey->private_key);
-
-  silc_free(silc_privkey);
-}
-
-
-/***************************** PKCS operations ******************************/
-
-/* Encrypts as specified in SILC protocol specification */
-
-SilcBool silc_pkcs_silc_encrypt(void *public_key,
-                               unsigned char *src,
-                               SilcUInt32 src_len,
-                               unsigned char *dst,
-                               SilcUInt32 dst_size,
-                               SilcUInt32 *ret_dst_len,
-                               SilcRng rng)
-{
-  SilcSILCPublicKey silc_pubkey = public_key;
-
-  if (!silc_pubkey->pkcs->encrypt)
-    return FALSE;
-
-  return silc_pubkey->pkcs->encrypt(silc_pubkey->public_key,
-                                   src, src_len,
-                                   dst, dst_size, ret_dst_len, rng);
-}
-
-/* Decrypts as specified in SILC protocol specification */
-
-SilcBool silc_pkcs_silc_decrypt(void *private_key,
-                               unsigned char *src,
-                               SilcUInt32 src_len,
-                               unsigned char *dst,
-                               SilcUInt32 dst_size,
-                               SilcUInt32 *ret_dst_len)
-{
-  SilcSILCPrivateKey silc_privkey = private_key;
-
-  if (!silc_privkey->pkcs->decrypt)
-    return FALSE;
-
-  return silc_privkey->pkcs->decrypt(silc_privkey->private_key,
-                                    src, src_len,
-                                    dst, dst_size, ret_dst_len);
-}
-
-/* Signs as specified in SILC protocol specification */
-
-SilcBool silc_pkcs_silc_sign(void *private_key,
-                            unsigned char *src,
-                            SilcUInt32 src_len,
-                            unsigned char *signature,
-                            SilcUInt32 signature_size,
-                            SilcUInt32 *ret_signature_len,
-                            SilcBool compute_hash,
-                            SilcHash hash)
-{
-  SilcSILCPrivateKey silc_privkey = private_key;
-
-  if (!silc_privkey->pkcs->sign)
-    return FALSE;
-
-  return silc_privkey->pkcs->sign(silc_privkey->private_key,
-                                 src, src_len,
-                                 signature, signature_size,
-                                 ret_signature_len, compute_hash, hash);
-}
-
-/* Verifies as specified in SILC protocol specification */
-
-SilcBool silc_pkcs_silc_verify(void *public_key,
-                              unsigned char *signature,
-                              SilcUInt32 signature_len,
-                              unsigned char *data,
-                              SilcUInt32 data_len,
-                              SilcHash hash)
-{
-  SilcSILCPublicKey silc_pubkey = public_key;
-
-  if (!silc_pubkey->pkcs->verify)
-    return FALSE;
-
-  return silc_pubkey->pkcs->verify(silc_pubkey->public_key,
-                                  signature, signature_len,
-                                  data, data_len, hash);
-}
diff --git a/lib/silccrypt/silcpk.h b/lib/silccrypt/silcpk.h
deleted file mode 100644 (file)
index f62c628..0000000
+++ /dev/null
@@ -1,183 +0,0 @@
-/*
-
-  silcpk.h
-
-  Author: Pekka Riikonen <priikone@silcnet.org>
-
-  Copyright (C) 1997 - 2007 Pekka Riikonen
-
-  This program is free software; you can redistribute it and/or modify
-  it under the terms of the GNU General Public License as published by
-  the Free Software Foundation; version 2 of the License.
-
-  This program is distributed in the hope that it will be useful,
-  but WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-  GNU General Public License for more details.
-
-*/
-
-/****h* silccrypt/SILC Public Key Interface
- *
- * DESCRIPTION
- *
- * This interface implements the SILC protocol style public key, as defined
- * by the SILC protocol specification.
- *
- ***/
-
-#ifndef SILCPK_H
-#define SILCPK_H
-
-/****s* silccrypt/SilcPubkeyAPI/SilcPublicKeyIdentifier
- *
- * NAME
- *
- *    typedef struct { ... } *SilcPublicKeyIdentifier,
- *                            SilcPublicKeyIdentifierStruct;
- *
- * DESCRIPTION
- *
- *    This structure contains the SILC Public Key identifier.  Note that
- *    some of the fields may be NULL.
- *
- * SOURCE
- */
-typedef struct SilcPublicKeyIdentifierObject {
-  char *username;
-  char *host;
-  char *realname;
-  char *email;
-  char *org;
-  char *country;
-  char *version;
-} *SilcPublicKeyIdentifier, SilcPublicKeyIdentifierStruct;
-/***/
-
-/****s* silccrypt/SilcPubkeyAPI/SilcSILCPublicKey
- *
- * NAME
- *
- *    typedef struct { ... } *SilcSILCPublicKey;
- *
- * DESCRIPTION
- *
- *    This structure defines the SILC protocol style public key.  User
- *    doesn't have to access this structure usually, except when access to
- *    the identifier is required.  The silc_pkcs_get_context for the
- *    PKCS type SILC_PKCS_SILC returns this context.
- *
- * SOURCE
- */
-typedef struct SilcSILCPublicKeyStruct {
-  SilcPublicKeyIdentifierStruct identifier;
-  const SilcPKCSAlgorithm *pkcs;   /* PKCS algorithm */
-  void *public_key;               /* PKCS algorithm specific public key */
-} *SilcSILCPublicKey;
-/***/
-
-/****s* silccrypt/SilcPubkeyAPI/SilcSILCPrivateKey
- *
- * NAME
- *
- *    typedef struct { ... } *SilcSILCPrivateKey;
- *
- * DESCRIPTION
- *
- *    This structure defines the SILC protocol implementation specific
- *    private key.  This structure isn't usually needed by the user.
- *
- * SOURCE
- */
-typedef struct SilcSILCPrivateKeyStruct {
-  const SilcPKCSAlgorithm *pkcs;   /* PKCS algorithm */
-  void *private_key;              /* PKCS algorithm specific private key */
-} *SilcSILCPrivateKey;
-/***/
-
-/****f* silccrypt/SilcPubkeyAPI/silc_pkcs_silc_generate_key
- *
- * SYNOPSIS
- *
- *    SilcBool silc_pkcs_silc_generate_key(const char *algorithm,
- *                                         SilcUInt32 bits_key_len,
- *                                         const char *identifier,
- *                                         SilcRng rng,
- *                                         SilcPublicKey *ret_public_key,
- *                                         SilcPrivateKey *ret_private_key)
- *
- * DESCRIPTION
- *
- *    Generate a new SILC key pair of the algorithm type `algorithm' with
- *    the key length in bits of `bits_key_len'.  The `scheme' may be NULL.
- *    Returns FALSE if key generation failed.
- *
- * EXAMPLE
- *
- *    // Generate RSA key pair with 2048 bit key length
- *    silc_pkcs_silc_generate_key("rsa", 2048, ident_string, rng,
- *                                &public_key, &private_key);
- *
- ***/
-SilcBool silc_pkcs_silc_generate_key(const char *algorithm,
-                                    SilcUInt32 bits_key_len,
-                                    const char *identifier,
-                                    SilcRng rng,
-                                    SilcPublicKey *ret_public_key,
-                                    SilcPrivateKey *ret_private_key);
-
-/****f* silccrypt/SilcPubkeyAPI/silc_pkcs_silc_encode_identifier
- *
- * SYNOPSIS
- *
- *    char *silc_pkcs_silc_encode_identifier(char *username, char *host,
- *                                           char *realname, char *email,
- *                                           char *org, char *country,
- *                                           char *version);
- *
- * DESCRIPTION
- *
- *    Encodes and returns SILC public key identifier.  If some of the
- *    arguments are NULL those are not encoded into the identifier string.
- *    Protocol says that at least username and host must be provided.
- *    Caller must free the returned identifier string.
- *
- ***/
-char *silc_pkcs_silc_encode_identifier(char *username, char *host,
-                                      char *realname, char *email,
-                                      char *org, char *country,
-                                      char *version);
-
-/****f* silccrypt/SilcPubkeyAPI/silc_pkcs_silc_decode_identifier
- *
- * SYNOPSIS
- *
- *    SilcBool silc_pkcs_silc_decode_identifier(const char *identifier,
- *                                              SilcPublicKeyIdentifier ident);
- *
- * DESCRIPTION
- *
- *    Decodes SILC protocol public key identifier `identifier' into the
- *    the `ident' structure.  Returns FALSE if the identifier is not valid
- *    identifier string.
- *
- ***/
-SilcBool silc_pkcs_silc_decode_identifier(const char *identifier,
-                                         SilcPublicKeyIdentifier ident);
-
-/****f* silccrypt/SilcPubkeyAPI/silc_pkcs_silc_public_key_version
- *
- * SYNOPSIS
- *
- *    int silc_pkcs_silc_public_key_version(SilcPublicKey public_key);
- *
- * DESCRIPTION
- *
- *    Returns the verison of the SILC Public Key indicated by `public_key'.
- *    Returns -1 if the `public_key' is not a SILC Public Key and the
- *    version number otherwise.
- *
- ***/
-int silc_pkcs_silc_public_key_version(SilcPublicKey public_key);
-
-#endif /* SILCPK_H */
diff --git a/lib/silccrypt/silcpk_i.h b/lib/silccrypt/silcpk_i.h
deleted file mode 100644 (file)
index e027561..0000000
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
-
-  silcpk_i.h
-
-  Author: Pekka Riikonen <priikone@silcnet.org>
-
-  Copyright (C) 2005, 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 SILCPK_I_H
-#define SILCPK_I_H
-
-/* Public and private key file headers */
-#define SILC_PKCS_PUBLIC_KEYFILE_BEGIN "-----BEGIN SILC PUBLIC KEY-----\n"
-#define SILC_PKCS_PUBLIC_KEYFILE_END "\n-----END SILC PUBLIC KEY-----\n"
-#define SILC_PKCS_PRIVATE_KEYFILE_BEGIN "-----BEGIN SILC PRIVATE KEY-----\n"
-#define SILC_PKCS_PRIVATE_KEYFILE_END "\n-----END SILC PRIVATE KEY-----\n"
-
-const SilcPKCSAlgorithm *silc_pkcs_silc_get_algorithm(void *public_key);
-SilcBool silc_pkcs_silc_import_public_key_file(unsigned char *filedata,
-                                              SilcUInt32 filedata_len,
-                                              SilcPKCSFileEncoding encoding,
-                                              void **ret_public_key);
-int silc_pkcs_silc_import_public_key(unsigned char *key,
-                                    SilcUInt32 key_len,
-                                    void **ret_public_key);
-unsigned char *
-silc_pkcs_silc_export_public_key_file(void *public_key,
-                                     SilcPKCSFileEncoding encoding,
-                                     SilcUInt32 *ret_len);
-unsigned char *silc_pkcs_silc_export_public_key(void *public_key,
-                                               SilcUInt32 *ret_len);
-SilcUInt32 silc_pkcs_silc_public_key_bitlen(void *public_key);
-void *silc_pkcs_silc_public_key_copy(void *public_key);
-SilcBool silc_pkcs_silc_public_key_compare(void *key1, void *key2);
-void silc_pkcs_silc_public_key_free(void *public_key);
-SilcBool silc_pkcs_silc_import_private_key_file(unsigned char *filedata,
-                                               SilcUInt32 filedata_len,
-                                               const char *passphrase,
-                                               SilcUInt32 passphrase_len,
-                                               SilcPKCSFileEncoding encoding,
-                                               void **ret_private_key);
-int silc_pkcs_silc_import_private_key(unsigned char *key,
-                                     SilcUInt32 key_len,
-                                     void **ret_private_key);
-unsigned char *
-silc_pkcs_silc_export_private_key_file(void *private_key,
-                                      const char *passphrase,
-                                      SilcUInt32 passphrase_len,
-                                      SilcPKCSFileEncoding encoding,
-                                      SilcRng rng,
-                                      SilcUInt32 *ret_len);
-unsigned char *silc_pkcs_silc_export_private_key(void *private_key,
-                                                SilcUInt32 *ret_len);
-SilcUInt32 silc_pkcs_silc_private_key_bitlen(void *private_key);
-void silc_pkcs_silc_private_key_free(void *private_key);
-SilcBool silc_pkcs_silc_encrypt(void *public_key,
-                               unsigned char *src,
-                               SilcUInt32 src_len,
-                               unsigned char *dst,
-                               SilcUInt32 dst_size,
-                               SilcUInt32 *ret_dst_len,
-                               SilcRng rng);
-SilcBool silc_pkcs_silc_decrypt(void *private_key,
-                               unsigned char *src,
-                               SilcUInt32 src_len,
-                               unsigned char *dst,
-                               SilcUInt32 dst_size,
-                               SilcUInt32 *ret_dst_len);
-SilcBool silc_pkcs_silc_sign(void *private_key,
-                            unsigned char *src,
-                            SilcUInt32 src_len,
-                            unsigned char *signature,
-                            SilcUInt32 signature_size,
-                            SilcUInt32 *ret_signature_len,
-                            SilcBool compute_hash,
-                            SilcHash hash);
-SilcBool silc_pkcs_silc_verify(void *public_key,
-                              unsigned char *signature,
-                              SilcUInt32 signature_len,
-                              unsigned char *data,
-                              SilcUInt32 data_len,
-                              SilcHash hash);
-
-#endif /* SILCPK_I_H */
diff --git a/lib/silccrypt/silcpkcs.c b/lib/silccrypt/silcpkcs.c
deleted file mode 100644 (file)
index 74fd6f0..0000000
+++ /dev/null
@@ -1,814 +0,0 @@
-/*
-
-  silcpkcs.c
-
-  Author: Pekka Riikonen <priikone@silcnet.org>
-
-  Copyright (C) 1997 - 2007 Pekka Riikonen
-
-  This program is free software; you can redistribute it and/or modify
-  it under the terms of the GNU General Public License as published by
-  the Free Software Foundation; version 2 of the License.
-
-  This program is distributed in the hope that it will be useful,
-  but WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-  GNU General Public License for more details.
-
-*/
-/* $Id$ */
-
-#include "silc.h"
-#include "silcpk_i.h"
-#include "silcpkcs1_i.h"
-
-#ifndef SILC_SYMBIAN
-/* Dynamically registered list of PKCS. */
-SilcDList silc_pkcs_list = NULL;
-SilcDList silc_pkcs_alg_list = NULL;
-#define SILC_PKCS_LIST silc_pkcs_list
-#define SILC_PKCS_ALG_LIST silc_pkcs_alg_list
-#else
-#define SILC_PKCS_LIST TRUE
-#define SILC_PKCS_ALG_LIST TRUE
-#endif /* SILC_SYMBIAN */
-
-/* Static list of PKCS for silc_pkcs_register_default(). */
-const SilcPKCSObject silc_default_pkcs[] =
-{
-  /* SILC PKCS */
-  {
-    SILC_PKCS_SILC,
-    silc_pkcs_silc_get_algorithm,
-    silc_pkcs_silc_import_public_key_file,
-    silc_pkcs_silc_import_public_key,
-    silc_pkcs_silc_export_public_key_file,
-    silc_pkcs_silc_export_public_key,
-    silc_pkcs_silc_public_key_bitlen,
-    silc_pkcs_silc_public_key_copy,
-    silc_pkcs_silc_public_key_compare,
-    silc_pkcs_silc_public_key_free,
-    silc_pkcs_silc_import_private_key_file,
-    silc_pkcs_silc_import_private_key,
-    silc_pkcs_silc_export_private_key_file,
-    silc_pkcs_silc_export_private_key,
-    silc_pkcs_silc_private_key_bitlen,
-    silc_pkcs_silc_private_key_free,
-    silc_pkcs_silc_encrypt,
-    silc_pkcs_silc_decrypt,
-    silc_pkcs_silc_sign,
-    silc_pkcs_silc_verify,
-  },
-
-  {
-    0, NULL, NULL, NULL, NULL, NULL,
-       NULL, NULL, NULL, NULL, NULL
-  }
-};
-
-/* Builtin PKCS algorithms */
-const SilcPKCSAlgorithm silc_default_pkcs_alg[] =
-{
-  /* PKCS #1, Version 1.5 without hash OIDs */
-  {
-    "rsa",
-    "pkcs1-no-oid",
-    "sha1,md5",
-    silc_pkcs1_generate_key,
-    silc_pkcs1_import_public_key,
-    silc_pkcs1_export_public_key,
-    silc_pkcs1_public_key_bitlen,
-    silc_pkcs1_public_key_copy,
-    silc_pkcs1_public_key_compare,
-    silc_pkcs1_public_key_free,
-    silc_pkcs1_import_private_key,
-    silc_pkcs1_export_private_key,
-    silc_pkcs1_private_key_bitlen,
-    silc_pkcs1_private_key_free,
-    silc_pkcs1_encrypt,
-    silc_pkcs1_decrypt,
-    silc_pkcs1_sign_no_oid,
-    silc_pkcs1_verify_no_oid
-  },
-
-  /* PKCS #1, Version 1.5 */
-  {
-    "rsa",
-    "pkcs1",
-    "sha1,md5",
-    silc_pkcs1_generate_key,
-    silc_pkcs1_import_public_key,
-    silc_pkcs1_export_public_key,
-    silc_pkcs1_public_key_bitlen,
-    silc_pkcs1_public_key_copy,
-    silc_pkcs1_public_key_compare,
-    silc_pkcs1_public_key_free,
-    silc_pkcs1_import_private_key,
-    silc_pkcs1_export_private_key,
-    silc_pkcs1_private_key_bitlen,
-    silc_pkcs1_private_key_free,
-    silc_pkcs1_encrypt,
-    silc_pkcs1_decrypt,
-    silc_pkcs1_sign,
-    silc_pkcs1_verify
-  },
-
-  {
-    NULL, NULL, NULL, NULL,
-    NULL, NULL, NULL, NULL,
-    NULL, NULL, NULL, NULL,
-    NULL, NULL
-  }
-};
-
-/* Register a new PKCS into SILC. */
-
-SilcBool silc_pkcs_register(const SilcPKCSObject *pkcs)
-{
-#ifndef SILC_SYMBIAN
-  SilcPKCSObject *newpkcs;
-
-  SILC_LOG_DEBUG(("Registering new PKCS"));
-
-  /* Check if exists already */
-  if (silc_pkcs_list) {
-    SilcPKCSObject *entry;
-    silc_dlist_start(silc_pkcs_list);
-    while ((entry = silc_dlist_get(silc_pkcs_list)) != SILC_LIST_END) {
-      if (entry->type == pkcs->type)
-        return FALSE;
-    }
-  }
-
-  newpkcs = silc_calloc(1, sizeof(*newpkcs));
-  if (!newpkcs)
-    return FALSE;
-  *newpkcs = *pkcs;
-
-  /* Add to list */
-  if (silc_pkcs_list == NULL)
-    silc_pkcs_list = silc_dlist_init();
-  silc_dlist_add(silc_pkcs_list, newpkcs);
-
-#endif /* SILC_SYMBIAN */
-  return TRUE;
-}
-
-/* Unregister a PKCS from the SILC. */
-
-SilcBool silc_pkcs_unregister(SilcPKCSObject *pkcs)
-{
-#ifndef SILC_SYMBIAN
-  SilcPKCSObject *entry;
-
-  SILC_LOG_DEBUG(("Unregistering PKCS"));
-
-  if (!silc_pkcs_list)
-    return FALSE;
-
-  silc_dlist_start(silc_pkcs_list);
-  while ((entry = silc_dlist_get(silc_pkcs_list)) != SILC_LIST_END) {
-    if (pkcs == SILC_ALL_PKCS || entry == pkcs) {
-      silc_dlist_del(silc_pkcs_list, entry);
-      silc_free(entry);
-
-      if (silc_dlist_count(silc_pkcs_list) == 0) {
-       silc_dlist_uninit(silc_pkcs_list);
-       silc_pkcs_list = NULL;
-      }
-
-      return TRUE;
-    }
-  }
-
-#endif /* SILC_SYMBIAN */
-  return FALSE;
-}
-
-/* Register algorithm */
-
-SilcBool silc_pkcs_algorithm_register(const SilcPKCSAlgorithm *pkcs)
-{
-#ifndef SILC_SYMBIAN
-  SilcPKCSAlgorithm *newalg;
-
-  SILC_LOG_DEBUG(("Registering new PKCS algorithm %s",
-                 pkcs->name));
-
-  /* Check if exists already */
-  if (silc_pkcs_alg_list) {
-    SilcPKCSAlgorithm *entry;
-    silc_dlist_start(silc_pkcs_alg_list);
-    while ((entry = silc_dlist_get(silc_pkcs_alg_list)) != SILC_LIST_END) {
-      if (!strcmp(entry->name, pkcs->name) &&
-         entry->scheme && pkcs->scheme &&
-         !strcmp(entry->scheme, pkcs->scheme))
-        return FALSE;
-    }
-  }
-
-  newalg = silc_calloc(1, sizeof(*newalg));
-  if (!newalg)
-    return FALSE;
-
-  *newalg = *pkcs;
-  newalg->name = strdup(pkcs->name);
-  if (!newalg->name)
-    return FALSE;
-  if (pkcs->scheme) {
-    newalg->scheme = strdup(pkcs->scheme);
-    if (!newalg->scheme)
-      return FALSE;
-  }
-  newalg->hash = strdup(pkcs->hash);
-  if (!newalg->hash)
-    return FALSE;
-
-  /* Add to list */
-  if (silc_pkcs_alg_list == NULL)
-    silc_pkcs_alg_list = silc_dlist_init();
-  silc_dlist_add(silc_pkcs_alg_list, newalg);
-
-#endif /* SILC_SYMBIAN */
-  return TRUE;
-}
-
-/* Unregister algorithm */
-
-SilcBool silc_pkcs_algorithm_unregister(SilcPKCSAlgorithm *pkcs)
-{
-#ifndef SILC_SYMBIAN
-  SilcPKCSAlgorithm*entry;
-
-  SILC_LOG_DEBUG(("Unregistering PKCS algorithm"));
-
-  if (!silc_pkcs_alg_list)
-    return FALSE;
-
-  silc_dlist_start(silc_pkcs_alg_list);
-  while ((entry = silc_dlist_get(silc_pkcs_alg_list)) != SILC_LIST_END) {
-    if (pkcs == SILC_ALL_PKCS_ALG || entry == pkcs) {
-      silc_dlist_del(silc_pkcs_alg_list, entry);
-      silc_free(entry->name);
-      silc_free(entry->scheme);
-      silc_free(entry->hash);
-      silc_free(entry);
-
-      if (silc_dlist_count(silc_pkcs_alg_list) == 0) {
-       silc_dlist_uninit(silc_pkcs_alg_list);
-       silc_pkcs_alg_list = NULL;
-      }
-
-      return TRUE;
-    }
-  }
-
-#endif /* SILC_SYMBIAN */
-  return FALSE;
-}
-
-/* Function that registers all the default PKCS and PKCS algorithms. */
-
-SilcBool silc_pkcs_register_default(void)
-{
-#ifndef SILC_SYMBIAN
-  int i;
-
-  for (i = 0; silc_default_pkcs[i].type; i++)
-    silc_pkcs_register(&(silc_default_pkcs[i]));
-
-  for (i = 0; silc_default_pkcs_alg[i].name; i++)
-    silc_pkcs_algorithm_register(&(silc_default_pkcs_alg[i]));
-
-#endif /* SILC_SYMBIAN */
-  return TRUE;
-}
-
-SilcBool silc_pkcs_unregister_all(void)
-{
-#ifndef SILC_SYMBIAN
-  SilcPKCSObject *entry;
-  SilcPKCSAlgorithm *alg;
-
-  if (silc_pkcs_list) {
-    silc_dlist_start(silc_pkcs_list);
-    while ((entry = silc_dlist_get(silc_pkcs_list)) != SILC_LIST_END) {
-      silc_pkcs_unregister(entry);
-      if (!silc_pkcs_list)
-       break;
-    }
-  }
-
-  if (silc_pkcs_alg_list) {
-    silc_dlist_start(silc_pkcs_alg_list);
-    while ((alg = silc_dlist_get(silc_pkcs_alg_list)) != SILC_LIST_END) {
-      silc_pkcs_algorithm_unregister(alg);
-      if (!silc_pkcs_alg_list)
-       break;
-    }
-  }
-
-#endif /* SILC_SYMBIAN */
-  return TRUE;
-}
-
-/* Returns comma separated list of supported PKCS algorithms */
-
-char *silc_pkcs_get_supported(void)
-{
-  SilcPKCSAlgorithm *entry;
-  char *list = NULL;
-  int len = 0;
-
-#ifndef SILC_SYMBIAN
-  if (silc_pkcs_alg_list) {
-    silc_dlist_start(silc_pkcs_alg_list);
-    while ((entry = silc_dlist_get(silc_pkcs_alg_list)) != SILC_LIST_END) {
-      len += strlen(entry->name);
-      list = silc_realloc(list, len + 1);
-      if (!list)
-       return NULL;
-
-      memcpy(list + (len - strlen(entry->name)),
-            entry->name, strlen(entry->name));
-      memcpy(list + len, ",", 1);
-      len++;
-    }
-  }
-#else
-  {
-    int i;
-    for (i = 0; silc_default_pkcs_alg[i].name; i++) {
-      entry = (SilcPKCSAlgorithm *)&(silc_default_pkcs_alg[i]);
-      len += strlen(entry->name);
-      list = silc_realloc(list, len + 1);
-      if (!list)
-       return NULL;
-
-      memcpy(list + (len - strlen(entry->name)),
-            entry->name, strlen(entry->name));
-      memcpy(list + len, ",", 1);
-      len++;
-    }
-  }
-#endif /* SILC_SYMBIAN */
-
-  list[len - 1] = 0;
-
-  return list;
-}
-
-/* Finds PKCS object */
-
-const SilcPKCSObject *silc_pkcs_find_pkcs(SilcPKCSType type)
-{
-  SilcPKCSObject *entry;
-
-#ifndef SILC_SYMBIAN
-  if (silc_pkcs_list) {
-    silc_dlist_start(silc_pkcs_list);
-    while ((entry = silc_dlist_get(silc_pkcs_list)) != SILC_LIST_END) {
-      if (entry->type == type)
-       return (const SilcPKCSObject *)entry;
-    }
-  }
-#else
-  {
-    int i;
-    for (i = 0; silc_default_pkcs[i].type; i++) {
-      entry = (SilcPKCSObject *)&(silc_default_pkcs[i]);
-      if (entry->type == type)
-       return (const SilcPKCSObject *)entry;
-    }
-  }
-#endif /* SILC_SYMBIAN */
-
-  return NULL;
-}
-
-/* Finds PKCS algorithms object */
-
-const SilcPKCSAlgorithm *silc_pkcs_find_algorithm(const char *algorithm,
-                                                 const char *scheme)
-{
-  SilcPKCSAlgorithm *entry;
-
-#ifndef SILC_SYMBIAN
-  if (silc_pkcs_alg_list) {
-    silc_dlist_start(silc_pkcs_alg_list);
-    while ((entry = silc_dlist_get(silc_pkcs_alg_list)) != SILC_LIST_END) {
-      if (!strcmp(entry->name, algorithm) &&
-         (!scheme || !entry->scheme || !strcmp(entry->scheme, scheme)))
-       return (const SilcPKCSAlgorithm *)entry;
-    }
-  }
-#else
-  {
-    int i;
-    for (i = 0; silc_default_pkcs_alg[i].name; i++) {
-      entry = (SilcPKCSAlgorithm *)&(silc_default_pkcs_alg[i]);
-      if (!strcmp(entry->name, algorithm) &&
-         (!scheme || !entry->scheme || !strcmp(entry->scheme, scheme)))
-       return (const SilcPKCSAlgorithm *)entry;
-    }
-  }
-#endif /* SILC_SYMBIAN */
-
-  return NULL;
-}
-
-/* Returns PKCS context */
-
-const SilcPKCSObject *silc_pkcs_get_pkcs(void *key)
-{
-  SilcPublicKey public_key = key;
-  return public_key->pkcs;
-}
-
-/* Returns PKCS algorithm context */
-
-const SilcPKCSAlgorithm *silc_pkcs_get_algorithm(void *key)
-{
-  SilcPublicKey public_key = key;
-  return public_key->pkcs->get_algorithm(public_key->public_key);
-}
-
-/* Return algorithm name */
-
-const char *silc_pkcs_get_name(void *key)
-{
-  const SilcPKCSAlgorithm *pkcs = silc_pkcs_get_algorithm(key);
-  return pkcs->name;
-}
-
-/* Returns PKCS type */
-
-SilcPKCSType silc_pkcs_get_type(void *key)
-{
-  SilcPublicKey public_key = key;
-  return public_key->pkcs->type;
-}
-
-/* Allocates new public key from the key data */
-
-SilcBool silc_pkcs_public_key_alloc(SilcPKCSType type,
-                                   unsigned char *key,
-                                   SilcUInt32 key_len,
-                                   SilcPublicKey *ret_public_key)
-{
-  const SilcPKCSObject *pkcs;
-  SilcPublicKey public_key;
-
-  if (!ret_public_key)
-    return FALSE;
-
-  /* Allocate public key context */
-  public_key = silc_calloc(1, sizeof(*public_key));
-  if (!public_key)
-    return FALSE;
-
-  public_key->pkcs = pkcs = silc_pkcs_find_pkcs(type);
-  if (!public_key->pkcs) {
-    silc_free(public_key);
-    return FALSE;
-  }
-
-  /* Import the PKCS public key */
-  if (!pkcs->import_public_key(key, key_len, &public_key->public_key)) {
-    silc_free(public_key);
-    return FALSE;
-  }
-
-  *ret_public_key = public_key;
-
-  return TRUE;
-}
-
-/* Frees the public key */
-
-void silc_pkcs_public_key_free(SilcPublicKey public_key)
-{
-  public_key->pkcs->public_key_free(public_key->public_key);
-  silc_free(public_key);
-}
-
-/* Exports public key */
-
-unsigned char *silc_pkcs_public_key_encode(SilcPublicKey public_key,
-                                          SilcUInt32 *ret_len)
-{
-  return public_key->pkcs->export_public_key(public_key->public_key,
-                                            ret_len);
-}
-
-/* Return key length */
-
-SilcUInt32 silc_pkcs_public_key_get_len(SilcPublicKey public_key)
-{
-  return public_key->pkcs->public_key_bitlen(public_key->public_key);
-}
-
-/* Returns internal PKCS public key context */
-
-void *silc_pkcs_get_context(SilcPKCSType type, SilcPublicKey public_key)
-{
-  if (public_key->pkcs->type != type)
-    return NULL;
-  return public_key->public_key;
-}
-
-
-/* Allocates new private key from key data */
-
-SilcBool silc_pkcs_private_key_alloc(SilcPKCSType type,
-                                    unsigned char *key,
-                                    SilcUInt32 key_len,
-                                    SilcPrivateKey *ret_private_key)
-{
-  const SilcPKCSObject *pkcs;
-  SilcPrivateKey private_key;
-
-  if (!ret_private_key)
-    return FALSE;
-
-  /* Allocate private key context */
-  private_key = silc_calloc(1, sizeof(*private_key));
-  if (!private_key)
-    return FALSE;
-
-  private_key->pkcs = pkcs = silc_pkcs_find_pkcs(type);
-  if (!private_key->pkcs) {
-    silc_free(private_key);
-    return FALSE;
-  }
-
-  /* Import the PKCS private key */
-  if (!pkcs->import_private_key(key, key_len, &private_key->private_key)) {
-    silc_free(private_key);
-    return FALSE;
-  }
-
-  *ret_private_key = private_key;
-
-  return TRUE;
-}
-
-/* Return key length */
-
-SilcUInt32 silc_pkcs_private_key_get_len(SilcPrivateKey private_key)
-{
-  return private_key->pkcs->private_key_bitlen(private_key->private_key);
-}
-
-/* Frees the private key */
-
-void silc_pkcs_private_key_free(SilcPrivateKey private_key)
-{
-  private_key->pkcs->private_key_free(private_key->private_key);
-  silc_free(private_key);
-}
-
-/* Encrypts */
-
-SilcBool silc_pkcs_encrypt(SilcPublicKey public_key,
-                          unsigned char *src, SilcUInt32 src_len,
-                          unsigned char *dst, SilcUInt32 dst_size,
-                          SilcUInt32 *dst_len, SilcRng rng)
-{
-  return public_key->pkcs->encrypt(public_key->public_key, src, src_len,
-                                  dst, dst_size, dst_len, rng);
-}
-
-/* Decrypts */
-
-SilcBool silc_pkcs_decrypt(SilcPrivateKey private_key,
-                          unsigned char *src, SilcUInt32 src_len,
-                          unsigned char *dst, SilcUInt32 dst_size,
-                          SilcUInt32 *dst_len)
-{
-  return private_key->pkcs->decrypt(private_key->private_key, src, src_len,
-                                   dst, dst_size, dst_len);
-}
-
-/* Generates signature */
-
-SilcBool silc_pkcs_sign(SilcPrivateKey private_key,
-                       unsigned char *src, SilcUInt32 src_len,
-                       unsigned char *dst, SilcUInt32 dst_size,
-                       SilcUInt32 *dst_len, SilcBool compute_hash,
-                       SilcHash hash)
-{
-  return private_key->pkcs->sign(private_key->private_key, src, src_len,
-                                dst, dst_size, dst_len, compute_hash, hash);
-}
-
-/* Verifies signature */
-
-SilcBool silc_pkcs_verify(SilcPublicKey public_key,
-                         unsigned char *signature,
-                         SilcUInt32 signature_len,
-                         unsigned char *data,
-                         SilcUInt32 data_len, SilcHash hash)
-{
-  return public_key->pkcs->verify(public_key->public_key, signature,
-                                 signature_len, data, data_len, hash);
-}
-
-/* Compares two public keys and returns TRUE if they are same key, and
-   FALSE if they are not same. */
-
-SilcBool silc_pkcs_public_key_compare(SilcPublicKey key1, SilcPublicKey key2)
-{
-  if (key1->pkcs->type != key2->pkcs->type)
-    return FALSE;
-
-  return key1->pkcs->public_key_compare(key1->public_key, key2->public_key);
-}
-
-/* Copies the public key indicated by `public_key' and returns new allocated
-   public key which is indentical to the `public_key'. */
-
-SilcPublicKey silc_pkcs_public_key_copy(SilcPublicKey public_key)
-{
-  SilcPublicKey key = silc_calloc(1, sizeof(*key));
-  if (!key)
-    return NULL;
-
-  key->pkcs = public_key->pkcs;
-  key->public_key = public_key->pkcs->public_key_copy(public_key->public_key);
-  if (!key->public_key) {
-    silc_free(key);
-    return NULL;
-  }
-
-  return key;
-}
-
-/* Loads any kind of public key */
-
-SilcBool silc_pkcs_load_public_key(const char *filename,
-                                  SilcPublicKey *ret_public_key)
-{
-  unsigned char *data;
-  SilcUInt32 data_len;
-  SilcPublicKey public_key;
-  SilcPKCSType type;
-
-  SILC_LOG_DEBUG(("Loading public key file '%s'", filename));
-
-  if (!ret_public_key)
-    return FALSE;
-
-  data = silc_file_readfile(filename, &data_len);
-  if (!data)
-    return FALSE;
-
-  /* Allocate public key context */
-  *ret_public_key = public_key = silc_calloc(1, sizeof(*public_key));
-  if (!public_key) {
-    silc_free(data);
-    return FALSE;
-  }
-
-  /* Try loading all types until one succeeds. */
-  for (type = SILC_PKCS_SILC; type <= SILC_PKCS_SPKI; type++) {
-    public_key->pkcs = silc_pkcs_find_pkcs(type);
-    if (!public_key->pkcs)
-      continue;
-
-    if (public_key->pkcs->import_public_key_file(data, data_len,
-                                                SILC_PKCS_FILE_BASE64,
-                                                &public_key->public_key)) {
-      silc_free(data);
-      return TRUE;
-    }
-
-    if (public_key->pkcs->import_public_key_file(data, data_len,
-                                                SILC_PKCS_FILE_BIN,
-                                                &public_key->public_key)) {
-      silc_free(data);
-      return TRUE;
-    }
-  }
-
-  silc_free(data);
-  silc_free(public_key);
-  *ret_public_key = NULL;
-  return FALSE;
-}
-
-/* Saves public key into a file */
-
-SilcBool silc_pkcs_save_public_key(const char *filename,
-                                  SilcPublicKey public_key,
-                                  SilcPKCSFileEncoding encoding)
-{
-  unsigned char *data;
-  SilcUInt32 data_len;
-
-  /* Export the public key file */
-  data = public_key->pkcs->export_public_key_file(public_key->public_key,
-                                                 encoding, &data_len);
-  if (!data)
-    return FALSE;
-
-  /* Write to file */
-  if (silc_file_writefile(filename, data, data_len)) {
-    silc_free(data);
-    return FALSE;
-  }
-
-  silc_free(data);
-  return TRUE;
-}
-
-/* Loads any kind of private key */
-
-SilcBool silc_pkcs_load_private_key(const char *filename,
-                                   const unsigned char *passphrase,
-                                   SilcUInt32 passphrase_len,
-                                   SilcPrivateKey *ret_private_key)
-{
-  unsigned char *data;
-  SilcUInt32 data_len;
-  SilcPrivateKey private_key;
-  SilcPKCSType type;
-
-  SILC_LOG_DEBUG(("Loading private key file '%s'", filename));
-
-  if (!ret_private_key)
-    return FALSE;
-
-  data = silc_file_readfile(filename, &data_len);
-  if (!data)
-    return FALSE;
-
-  /* Allocate private key context */
-  *ret_private_key = private_key = silc_calloc(1, sizeof(*private_key));
-  if (!private_key) {
-    silc_free(data);
-    return FALSE;
-  }
-
-  /* Try loading all types until one succeeds. */
-  for (type = SILC_PKCS_SILC; type <= SILC_PKCS_SPKI; type++) {
-    private_key->pkcs = silc_pkcs_find_pkcs(type);
-    if (!private_key->pkcs)
-      continue;
-
-    if (private_key->pkcs->import_private_key_file(
-                                             data, data_len,
-                                             passphrase,
-                                             passphrase_len,
-                                             SILC_PKCS_FILE_BIN,
-                                             &private_key->private_key)) {
-      silc_free(data);
-      return TRUE;
-    }
-
-    if (private_key->pkcs->import_private_key_file(
-                                             data, data_len,
-                                             passphrase,
-                                             passphrase_len,
-                                             SILC_PKCS_FILE_BASE64,
-                                             &private_key->private_key)) {
-      silc_free(data);
-      return TRUE;
-    }
-  }
-
-  silc_free(data);
-  silc_free(private_key);
-  *ret_private_key = NULL;
-  return FALSE;
-}
-
-/* Saves private key into a file */
-
-SilcBool silc_pkcs_save_private_key(const char *filename,
-                                   SilcPrivateKey private_key,
-                                   const unsigned char *passphrase,
-                                   SilcUInt32 passphrase_len,
-                                   SilcPKCSFileEncoding encoding,
-                                   SilcRng rng)
-{
-  unsigned char *data;
-  SilcUInt32 data_len;
-
-  /* Export the private key file */
-  data = private_key->pkcs->export_private_key_file(private_key->private_key,
-                                                   passphrase,
-                                                   passphrase_len,
-                                                   encoding, rng, &data_len);
-  if (!data)
-    return FALSE;
-
-  /* Write to file */
-  if (silc_file_writefile(filename, data, data_len)) {
-    silc_free(data);
-    return FALSE;
-  }
-
-  silc_free(data);
-  return TRUE;
-}
diff --git a/lib/silccrypt/silcpkcs.h b/lib/silccrypt/silcpkcs.h
deleted file mode 100644 (file)
index 0c746be..0000000
+++ /dev/null
@@ -1,814 +0,0 @@
-/*
-
-  silcpkcs.h
-
-  Author: Pekka Riikonen <priikone@silcnet.org>
-
-  Copyright (C) 1997 - 2007 Pekka Riikonen
-
-  This program is free software; you can redistribute it and/or modify
-  it under the terms of the GNU General Public License as published by
-  the Free Software Foundation; version 2 of the License.
-
-  This program is distributed in the hope that it will be useful,
-  but WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-  GNU General Public License for more details.
-
-*/
-
-/****h* silccrypt/SILC PKCS Interface
- *
- * DESCRIPTION
- *
- * SILC PKCS API provides generic interface for performing various
- * public key cryptography related operations with different types of
- * public and private keys.  Support for loading and saving of different
- * types of public key and private keys are also provided.
- *
- ***/
-
-#ifndef SILCPKCS_H
-#define SILCPKCS_H
-
-/* Forward declarations */
-typedef struct SilcPKCSObjectStruct SilcPKCSObject;
-
-/****d* silccrypt/SilcPKCSAPI/SilcPKCSType
- *
- * NAME
- *
- *    typedef enum { ... } SilcPKCSType;
- *
- * DESCRIPTION
- *
- *    Supported public key cryptosystem types.
- *
- * SOURCE
- */
-typedef enum {
-  SILC_PKCS_SILC    = 1,       /* SILC PKCS */
-  SILC_PKCS_SSH2    = 2,       /* SSH2 PKCS (not supported) */
-  SILC_PKCS_X509V3  = 3,       /* X.509v3 PKCS (not supported) */
-  SILC_PKCS_OPENPGP = 4,       /* OpenPGP PKCS (not supported) */
-  SILC_PKCS_SPKI    = 5,       /* SPKI PKCS (not supported) */
-} SilcPKCSType;
-/***/
-
-/****s* silccrypt/SilcPKCSAPI/SilcPublicKey
- *
- * NAME
- *
- *    typedef struct { ... } *SilcPublicKey;
- *
- * DESCRIPTION
- *
- *    This context represents any kind of PKCS public key.  It can be
- *    allocated by silc_pkcs_public_key_alloc and is freed by the
- *    silc_pkcs_public_key_free.  The PKCS specific public key context
- *    can be retrieved by calling silc_pkcs_get_context.
- *
- * SOURCE
- */
-typedef struct SilcPublicKeyStruct {
-  const SilcPKCSObject *pkcs;  /* PKCS */
-  void *public_key;            /* PKCS specific public key */
-} *SilcPublicKey;
-/***/
-
-/****s* silccrypt/SilcPKCSAPI/SilcPrivateKey
- *
- * NAME
- *
- *    typedef struct { ... } *SilcPrivateKey;
- *
- * DESCRIPTION
- *
- *    This context represents any kind of PKCS private key.
- *
- * SOURCE
- */
-typedef struct SilcPrivateKeyStruct {
-  const SilcPKCSObject *pkcs;  /* PKCS */
-  void *private_key;           /* PKCS specific private key */
-} *SilcPrivateKey;
-/***/
-
-/****d* silccrypt/SilcPKCSAPI/SilcPKCSFileEncoding
- *
- * NAME
- *
- *    typedef enum { ... } SilcPKCSType
- *
- * DESCRIPTION
- *
- *    Public and private key file encoding types.
- *
- * SOURCE
- */
-typedef enum {
-  SILC_PKCS_FILE_BIN,          /* Binary encoding */
-  SILC_PKCS_FILE_BASE64                /* Base64 encoding */
-} SilcPKCSFileEncoding;
-/***/
-
-/* The PKCS Algorithm object to represent any PKCS algorithm. */
-typedef struct {
-  /* Algorithm name and scheme */
-  char *name;
-  char *scheme;
-
-  /* Supported hash functions, comma separated list */
-  char *hash;
-
-  /* Generate new key pair. Returns PKCS algorithm specific public key
-     and private key contexts. */
-  SilcBool (*generate_key)(SilcUInt32 keylen,
-                          SilcRng rng,
-                          void **ret_public_key,
-                          void **ret_private_key);
-
-  /* Public key routines. */
-  int (*import_public_key)(unsigned char *key,
-                          SilcUInt32 key_len,
-                          void **ret_public_key);
-  unsigned char *(*export_public_key)(void *public_key,
-                                     SilcUInt32 *ret_len);
-  SilcUInt32 (*public_key_bitlen)(void *public_key);
-  void *(*public_key_copy)(void *public_key);
-  SilcBool (*public_key_compare)(void *key1, void *key2);
-  void (*public_key_free)(void *public_key);
-
-  /* Private key routines */
-  int (*import_private_key)(unsigned char *key,
-                           SilcUInt32 key_len,
-                           void **ret_private_key);
-  unsigned char *(*export_private_key)(void *private_key,
-                                      SilcUInt32 *ret_len);
-  SilcUInt32 (*private_key_bitlen)(void *public_key);
-  void (*private_key_free)(void *private_key);
-
-  /* Encrypt and decrypt operations */
-  SilcBool (*encrypt)(void *public_key,
-                     unsigned char *src,
-                     SilcUInt32 src_len,
-                     unsigned char *dst,
-                     SilcUInt32 dst_size,
-                     SilcUInt32 *ret_dst_len,
-                     SilcRng rng);
-  SilcBool (*decrypt)(void *private_key,
-                     unsigned char *src,
-                     SilcUInt32 src_len,
-                     unsigned char *dst,
-                     SilcUInt32 dst_size,
-                     SilcUInt32 *ret_dst_len);
-
-  /* Signature and verification operations */
-  SilcBool (*sign)(void *private_key,
-                  unsigned char *src,
-                  SilcUInt32 src_len,
-                  unsigned char *signature,
-                  SilcUInt32 signature_size,
-                  SilcUInt32 *ret_signature_len,
-                  SilcBool compute_hash,
-                  SilcHash hash);
-  SilcBool (*verify)(void *public_key,
-                    unsigned char *signature,
-                    SilcUInt32 signature_len,
-                    unsigned char *data,
-                    SilcUInt32 data_len,
-                    SilcHash hash);
-} SilcPKCSAlgorithm;
-
-/* The PKCS (Public Key Cryptosystem) object to represent any PKCS. */
-struct SilcPKCSObjectStruct {
-  /* PKCS type */
-  SilcPKCSType type;
-
-  /* Public key routines */
-
-  /* Returns PKCS algorithm context from public key */
-  const SilcPKCSAlgorithm *(*get_algorithm)(void *public_key);
-
-  /* Imports from public key file */
-  SilcBool (*import_public_key_file)(unsigned char *filedata,
-                                    SilcUInt32 filedata_len,
-                                    SilcPKCSFileEncoding encoding,
-                                    void **ret_public_key);
-
-  /* Imports from public key binary data.  Returns the amount of bytes
-     imported from `key' or 0 on error. */
-  int (*import_public_key)(unsigned char *key,
-                          SilcUInt32 key_len,
-                          void **ret_public_key);
-
-  /* Exports public key to file */
-  unsigned char *(*export_public_key_file)(void *public_key,
-                                          SilcPKCSFileEncoding encoding,
-                                          SilcUInt32 *ret_len);
-
-  /* Export public key as binary data */
-  unsigned char *(*export_public_key)(void *public_key,
-                                     SilcUInt32 *ret_len);
-
-  /* Returns key length in bits */
-  SilcUInt32 (*public_key_bitlen)(void *public_key);
-
-  /* Copy public key */
-  void *(*public_key_copy)(void *public_key);
-
-  /* Compares public keys */
-  SilcBool (*public_key_compare)(void *key1, void *key2);
-
-  /* Free public key */
-  void (*public_key_free)(void *public_key);
-
-  /* Private key routines */
-
-  /* Imports from private key file */
-  SilcBool (*import_private_key_file)(unsigned char *filedata,
-                                     SilcUInt32 filedata_len,
-                                     const char *passphrase,
-                                     SilcUInt32 passphrase_len,
-                                     SilcPKCSFileEncoding encoding,
-                                     void **ret_private_key);
-
-  /* Imports from private key binary data.  Returns the amount of bytes
-     imported from `key' or 0 on error. */
-  int (*import_private_key)(unsigned char *key,
-                           SilcUInt32 key_len,
-                           void **ret_private_key);
-
-  /* Exports private key to file */
-  unsigned char *(*export_private_key_file)(void *private_key,
-                                           const char *passphrase,
-                                           SilcUInt32 passphrase_len,
-                                           SilcPKCSFileEncoding encoding,
-                                           SilcRng rng,
-                                           SilcUInt32 *ret_len);
-
-  /* Export private key as binary data */
-  unsigned char *(*export_private_key)(void *private_key,
-                                      SilcUInt32 *ret_len);
-
-  /* Returns key length in bits */
-  SilcUInt32 (*private_key_bitlen)(void *private_key);
-
-  /* Free private key */
-  void (*private_key_free)(void *private_key);
-
-  /* Encrypt and decrypt operations */
-  SilcBool (*encrypt)(void *public_key,
-                     unsigned char *src,
-                     SilcUInt32 src_len,
-                     unsigned char *dst,
-                     SilcUInt32 dst_size,
-                     SilcUInt32 *ret_dst_len,
-                     SilcRng rng);
-  SilcBool (*decrypt)(void *private_key,
-                     unsigned char *src,
-                     SilcUInt32 src_len,
-                     unsigned char *dst,
-                     SilcUInt32 dst_size,
-                     SilcUInt32 *ret_dst_len);
-
-  /* Signature and verification operations */
-  SilcBool (*sign)(void *private_key,
-                  unsigned char *src,
-                  SilcUInt32 src_len,
-                  unsigned char *signature,
-                  SilcUInt32 signature_size,
-                  SilcUInt32 *ret_signature_len,
-                  SilcBool compute_hash,
-                  SilcHash hash);
-  SilcBool (*verify)(void *public_key,
-                    unsigned char *signature,
-                    SilcUInt32 signature_len,
-                    unsigned char *data,
-                    SilcUInt32 data_len,
-                    SilcHash hash);
-};
-
-/* Marks for all PKCS in. This can be used in silc_pkcs_unregister to
-   unregister all PKCS at once. */
-#define SILC_ALL_PKCS ((SilcPKCSObject *)1)
-#define SILC_ALL_PKCS_ALG ((SilcPKCSAlgorithm *)1)
-
-/* Static lists of PKCS and PKCS algorithms. */
-extern DLLAPI const SilcPKCSObject silc_default_pkcs[];
-extern DLLAPI const SilcPKCSAlgorithm silc_default_pkcs_alg[];
-
-/* Prototypes */
-
-/****f* silccrypt/SilcPKCSAPI/silc_pkcs_register
- *
- * SYNOPSIS
- *
- *    SilcBool silc_pkcs_register(const SilcPKCSObject *pkcs);
- *
- * DESCRIPTION
- *
- *    Registers a new PKCS into the SILC.  This function is used
- *    at the initialization of the SILC.  All registered PKCSs
- *    should be unregistered with silc_pkcs_unregister.  The `pkcs' includes
- *    the name of the PKCS and member functions for the algorithm.  Usually
- *    this function is not called directly.  Instead, application can call
- *    the silc_pkcs_register_default to register all PKCSs that are
- *    builtin the sources.  Returns FALSE on error.
- *
- ***/
-SilcBool silc_pkcs_register(const SilcPKCSObject *pkcs);
-
-/****f* silccrypt/SilcPKCSAPI/silc_pkcs_unregister
- *
- * SYNOPSIS
- *
- *    SilcBool silc_pkcs_unregister(SilcPKCSObject *pkcs);
- *
- * DESCRIPTION
- *
- *    Unregister a PKCS from the SILC. Returns FALSE on error.
- *
- ***/
-SilcBool silc_pkcs_unregister(SilcPKCSObject *pkcs);
-
-/****f* silccrypt/SilcPKCSAPI/silc_pkcs_algorithm_register
- *
- * SYNOPSIS
- *
- *    SilcBool silc_pkcs_algorithm_register(const SilcPKCSAlgorithm *pkcs);
- *
- * DESCRIPTION
- *
- *    Registers a new PKCS Algorithm into the SILC.  This function is used
- *    at the initialization of the SILC.  All registered PKCS algorithms
- *    should be unregistered with silc_pkcs_unregister.
- *
- ***/
-SilcBool silc_pkcs_algorithm_register(const SilcPKCSAlgorithm *pkcs);
-
-/****f* silccrypt/SilcPKCSAPI/silc_pkcs_algorithm_unregister
- *
- * SYNOPSIS
- *
- *    SilcBool silc_pkcs_algorithm_unregister(SilcPKCSAlgorithm *pkcs);
- *
- * DESCRIPTION
- *
- *    Unregister a PKCS from the SILC. Returns FALSE on error.
- *
- ***/
-SilcBool silc_pkcs_algorithm_unregister(SilcPKCSAlgorithm *pkcs);
-
-/****f* silccrypt/SilcPKCSAPI/silc_pkcs_register_default
- *
- * SYNOPSIS
- *
- *    SilcBool silc_pkcs_register_default(void);
- *
- * DESCRIPTION
- *
- *    Registers all the default PKCS (all builtin PKCS) and PKCS algorithms.
- *    The application may use this to register the default PKCS if specific
- *    PKCS in any specific order is not wanted.  Returns FALSE on error.
- *
- ***/
-SilcBool silc_pkcs_register_default(void);
-
-/****f* silccrypt/SilcPKCSAPI/silc_pkcs_unregister_all
- *
- * SYNOPSIS
- *
- *    SilcBool silc_pkcs_unregister_all(void);
- *
- * DESCRIPTION
- *
- *    Unregister all PKCS and PKCS algorithms. Returns FALSE on error.
- *
- ***/
-SilcBool silc_pkcs_unregister_all(void);
-
-/****f* silccrypt/SilcPKCSAPI/silc_pkcs_get_supported
- *
- * SYNOPSIS
- *
- *    char *silc_pkcs_get_supported(void);
- *
- * DESCRIPTION
- *
- *    Returns comma separated list of supported PKCS algorithms.
- *
- ***/
-char *silc_pkcs_get_supported(void);
-
-/****f* silccrypt/SilcPKCSAPI/silc_pkcs_find_pkcs
- *
- * SYNOPSIS
- *
- *    const SilcPKCSObject *silc_pkcs_get_pkcs(SilcPKCSType type);
- *
- * DESCRIPTION
- *
- *    Finds PKCS context by the PKCS type.
- *
- ***/
-const SilcPKCSObject *silc_pkcs_find_pkcs(SilcPKCSType type);
-
-/****f* silccrypt/SilcPKCSAPI/silc_pkcs_find_algorithm
- *
- * SYNOPSIS
- *
- *    const SilcPKCSAlgorithm *silc_pkcs_find_algorithm(const char *algorithm,
- *                                                      const char *scheme);
- *
- * DESCRIPTION
- *
- *    Finds PKCS algorithm context by the algorithm name `algorithm' and
- *    the algorithm scheme `scheme'.  The `scheme' may be NULL.
- *
- ***/
-const SilcPKCSAlgorithm *silc_pkcs_find_algorithm(const char *algorithm,
-                                                 const char *scheme);
-
-/****f* silccrypt/SilcPKCSAPI/silc_pkcs_get_pkcs
- *
- * SYNOPSIS
- *
- *    const SilcPKCSObject *silc_pkcs_get_pkcs(void *key);
- *
- * DESCRIPTION
- *
- *    Returns the PKCS object from `key', which may be SilcPublicKey or
- *    SilcPrivateKey pointer.
- *
- ***/
-const SilcPKCSObject *silc_pkcs_get_pkcs(void *key);
-
-/****f* silccrypt/SilcPKCSAPI/silc_pkcs_get_algorithm
- *
- * SYNOPSIS
- *
- *    const SilcPKCSAlgorithm *silc_pkcs_get_algorithm(void *key);
- *
- * DESCRIPTION
- *
- *    Returns the PKCS algorithm object from `key', which may be SilcPublicKey
- *    or SilcPrivateKey pointer.
- *
- ***/
-const SilcPKCSAlgorithm *silc_pkcs_get_algorithm(void *key);
-
-/****f* silccrypt/SilcPKCSAPI/silc_pkcs_get_name
- *
- * SYNOPSIS
- *
- *    const char *silc_pkcs_get_name(void *key);
- *
- * DESCRIPTION
- *
- *    Returns PKCS algorithm name from the `key', which may be SilcPublicKey
- *    or SilcPrivateKey pointer.
- *
- ***/
-const char *silc_pkcs_get_name(void *key);
-
-/****f* silccrypt/SilcPKCSAPI/silc_pkcs_get_type
- *
- * SYNOPSIS
- *
- *    SilcPKCSType silc_pkcs_get_type(void *key);
- *
- * DESCRIPTION
- *
- *    Returns PKCS type from the `key', which may be SilcPublicKey or
- *    SilcPrivateKey pointer.
- *
- ***/
-SilcPKCSType silc_pkcs_get_type(void *key);
-
-/****f* silccrypt/SilcPKCSAPI/silc_pkcs_get_context
- *
- * SYNOPSIS
- *
- *    void *silc_pkcs_get_context(SilcPKCSType type, SilcPublicKey public_key);
- *
- * DESCRIPTION
- *
- *    Returns the internal PKCS `type' specific public key context from the
- *    `public_key'.  The caller needs to explicitly type cast it to correct
- *    type.  Returns NULL on error.
- *
- *    For SILC_PKCS_SILC the returned context is SilcSILCPublicKey.
- *
- ***/
-void *silc_pkcs_get_context(SilcPKCSType type, SilcPublicKey public_key);
-
-/****f* silccrypt/SilcPKCSAPI/silc_pkcs_public_key_alloc
- *
- * SYNOPSIS
- *
- *    SilcBool silc_pkcs_public_key_alloc(SilcPKCSType type,
- *                                        unsigned char *key,
- *                                        SilcUInt32 key_len
- *                                        SilcPublicKey *ret_public_key);
- *
- * DESCRIPTION
- *
- *    Allocates SilcPublicKey of the type of `type' from the key data
- *    `key' of length of `key_len' bytes.  Returns FALSE if the `key'
- *    is malformed or unsupported public key type.  This function can be
- *    used to create public key from any kind of PKCS public keys that
- *    the implementation supports.
- *
- ***/
-SilcBool silc_pkcs_public_key_alloc(SilcPKCSType type,
-                                   unsigned char *key,
-                                   SilcUInt32 key_len,
-                                   SilcPublicKey *ret_public_key);
-
-/****f* silccrypt/SilcPKCSAPI/silc_pkcs_public_key_free
- *
- * SYNOPSIS
- *
- *    void silc_pkcs_public_key_free(SilcPublicKey public_key);
- *
- * DESCRIPTION
- *
- *    Frees the public key.
- *
- ***/
-void silc_pkcs_public_key_free(SilcPublicKey public_key);
-
-/****f* silccrypt/SilcPKCSAPI/silc_pkcs_public_key_export
- *
- * SYNOPSIS
- *
- *    unsigned char *silc_pkcs_public_key_encode(SilcPublicKey public_key,
- *                                               SilcUInt32 *ret_len);
- *
- * DESCRIPTION
- *
- *    Encodes the `public_key' into a binary format and returns it.  Returns
- *    NULL on error.  Caller must free the returned buffer.
- *
- ***/
-unsigned char *silc_pkcs_public_key_encode(SilcPublicKey public_key,
-                                          SilcUInt32 *ret_len);
-
-/****f* silccrypt/SilcPKCSAPI/silc_pkcs_public_key_get_len
- *
- * SYNOPSIS
- *
- *    SilcUInt32 silc_pkcs_public_key_get_len(SilcPublicKey public_key);
- *
- * DESCRIPTION
- *
- *    Returns the key length in bits from the public key.
- *
- ***/
-SilcUInt32 silc_pkcs_public_key_get_len(SilcPublicKey public_key);
-
-/****f* silccrypt/SilcPKCSAPI/silc_pkcs_public_key_compare
- *
- * SYNOPSIS
- *
- *    SilcBool silc_pkcs_public_key_compare(SilcPublicKey key1,
- *                                          SilcPublicKey key2);
- *
- * DESCRIPTION
- *
- *    Compares two public keys and returns TRUE if they are same key, and
- *    FALSE if they are not same.
- *
- ***/
-SilcBool silc_pkcs_public_key_compare(SilcPublicKey key1, SilcPublicKey key2);
-
-/****f* silccrypt/SilcPKCSAPI/silc_pkcs_public_key_copy
- *
- * SYNOPSIS
- *
- *    SilcPublicKey silc_pkcs_public_key_copy(SilcPublicKey public_key);
- *
- * DESCRIPTION
- *
- *    Copies the public key indicated by `public_key' and returns new
- *    allocated public key which is indentical to the `public_key'.
- *
- ***/
-SilcPublicKey silc_pkcs_public_key_copy(SilcPublicKey public_key);
-
-/****f* silccrypt/SilcPKCSAPI/silc_pkcs_private_key_alloc
- *
- * SYNOPSIS
- *
- *    SilcBool silc_pkcs_private_key_alloc(SilcPKCSType type,
- *                                         unsigned char *key,
- *                                         SilcUInt32 key_len,
- *                                         SilcPrivateKey *ret_private_key);
- *
- * DESCRIPTION
- *
- *    Allocates SilcPrivateKey of the type of `type' from the key data
- *    `key' of length of `key_len' bytes.  Returns FALSE if the `key'
- *    is malformed or unsupported private key type.
- *
- ***/
-SilcBool silc_pkcs_private_key_alloc(SilcPKCSType type,
-                                    unsigned char *key,
-                                    SilcUInt32 key_len,
-                                    SilcPrivateKey *ret_private_key);
-
-/****f* silccrypt/SilcPKCSAPI/silc_pkcs_private_key_get_len
- *
- * SYNOPSIS
- *
- *    SilcUInt32 silc_pkcs_private_key_get_len(SilcPrivateKey private_key);
- *
- * DESCRIPTION
- *
- *    Returns the key length in bits from the private key.
- *
- ***/
-SilcUInt32 silc_pkcs_private_key_get_len(SilcPrivateKey private_key);
-
-/****f* silccrypt/SilcPKCSAPI/silc_pkcs_private_key_free
- *
- * SYNOPSIS
- *
- *    void silc_pkcs_private_key_free(SilcPrivateKey private_key;
- *
- * DESCRIPTION
- *
- *    Frees the private key.
- *
- ***/
-void silc_pkcs_private_key_free(SilcPrivateKey private_key);
-
-/****f* silccrypt/SilcPKCSAPI/silc_pkcs_encrypt
- *
- * SYNOPSIS
- *
- *    SilcBool silc_pkcs_encrypt(SilcPublicKey public_key,
- *                               unsigned char *src, SilcUInt32 src_len,
- *                               unsigned char *dst, SilcUInt32 dst_size,
- *                               SilcUInt32 *dst_len);
- *
- * DESCRIPTION
- *
- *    Encrypts with the public key. Returns FALSE on error.
- *
- ***/
-SilcBool silc_pkcs_encrypt(SilcPublicKey public_key,
-                          unsigned char *src, SilcUInt32 src_len,
-                          unsigned char *dst, SilcUInt32 dst_size,
-                          SilcUInt32 *dst_len, SilcRng rng);
-
-/****f* silccrypt/SilcPKCSAPI/silc_pkcs_decrypt
- *
- * SYNOPSIS
- *
- *    SilcBool silc_pkcs_decrypt(SilcPrivateKey private_key,
- *                               unsigned char *src, SilcUInt32 src_len,
- *                               unsigned char *dst, SilcUInt32 dst_size,
- *                               SilcUInt32 *dst_len);
- *
- * DESCRIPTION
- *
- *    Decrypts with the private key.  Returns FALSE on error.
- *
- ***/
-SilcBool silc_pkcs_decrypt(SilcPrivateKey private_key,
-                          unsigned char *src, SilcUInt32 src_len,
-                          unsigned char *dst, SilcUInt32 dst_size,
-                          SilcUInt32 *dst_len);
-
-/****f* silccrypt/SilcPKCSAPI/silc_pkcs_sign
- *
- * SYNOPSIS
- *
- *    SilcBool silc_pkcs_sign(SilcPrivateKey private_key,
- *                            unsigned char *src, SilcUInt32 src_len,
- *                            unsigned char *dst, SilcUInt32 dst_size,
- *                            SilcUInt32 *dst_len, SilcBool compute_hash,
- *                            SilcHash hash);
- *
- * DESCRIPTION
- *
- *    Generates signature with the private key.  Returns FALSE on error.
- *    If `compute_hash' is TRUE the `hash' will be used to compute a
- *    digest over the `src'.  The `hash' must always be valid.
- *
- ***/
-SilcBool silc_pkcs_sign(SilcPrivateKey private_key,
-                       unsigned char *src, SilcUInt32 src_len,
-                       unsigned char *dst, SilcUInt32 dst_size,
-                       SilcUInt32 *dst_len, SilcBool compute_hash,
-                       SilcHash hash);
-
-/****f* silccrypt/SilcPKCSAPI/silc_pkcs_verify
- *
- * SYNOPSIS
- *
- *    SilcBool silc_pkcs_verify(SilcPublicKey public_key,
- *                              unsigned char *signature,
- *                              SilcUInt32 signature_len,
- *                              unsigned char *data,
- *                              SilcUInt32 data_len, SilcHash hash);
- *
- * DESCRIPTION
- *
- *    Verifies signature.  Returns FALSE on error.  The 'signature' is
- *    verified against the 'data'.  If the `hash' is non-NULL then the `data'
- *    will hashed before verification.  If the `hash' is NULL, then the
- *    hash algorithm to be used is retrieved from the signature.  If it
- *    isn't present in the signature the verification is done as is without
- *    hashing.
- *
- ***/
-SilcBool silc_pkcs_verify(SilcPublicKey public_key,
-                         unsigned char *signature,
-                         SilcUInt32 signature_len,
-                         unsigned char *data,
-                         SilcUInt32 data_len, SilcHash hash);
-
-/****f* silccrypt/SilcPKCSAPI/silc_pkcs_load_public_key
- *
- * SYNOPSIS
- *
- *    SilcBool silc_pkcs_load_public_key(const char *filename,
- *                                       SilcPublicKey *ret_public_key);
- *
- * DESCRIPTION
- *
- *    Loads public key from file and allocates new public key.  Returns TRUE
- *    if loading was successful.
- *
- ***/
-SilcBool silc_pkcs_load_public_key(const char *filename,
-                                  SilcPublicKey *ret_public_key);
-
-/****f* silccrypt/SilcPKCSAPI/silc_pkcs_save_public_key
- *
- * SYNOPSIS
- *
- *    SilcBool silc_pkcs_save_public_key(const char *filename,
- *                                       SilcPublicKey public_key,
- *                                       SilcPKCSFileEncoding encoding);
- *
- * DESCRIPTION
- *
- *    Saves public key into file with specified encoding.  Returns FALSE
- *    on error.
- *
- ***/
-SilcBool silc_pkcs_save_public_key(const char *filename,
-                                  SilcPublicKey public_key,
-                                  SilcPKCSFileEncoding encoding);
-
-/****f* silccrypt/SilcPKCSAPI/silc_pkcs_load_private_key
- *
- * SYNOPSIS
- *
- *    SilcBool silc_pkcs_load_private_key(const char *filename,
- *                                        const unsigned char *passphrase,
- *                                        SilcUInt32 passphrase_len,
- *                                        SilcPrivateKey *ret_private_key);
- *
- * DESCRIPTION
- *
- *    Loads private key from file and allocates new private key.  Returns TRUE
- *    if loading was successful.  The `passphrase' is used as decryption
- *    key of the private key file, in case it is encrypted.
- *
- ***/
-SilcBool silc_pkcs_load_private_key(const char *filename,
-                                   const unsigned char *passphrase,
-                                   SilcUInt32 passphrase_len,
-                                   SilcPrivateKey *ret_private_key);
-
-/****f* silccrypt/SilcPKCSAPI/silc_pkcs_save_private_key
- *
- * SYNOPSIS
- *
- *    SilcBool silc_pkcs_save_private_key(const char *filename,
- *                                        SilcPrivateKey private_key,
- *                                        const unsigned char *passphrase,
- *                                        SilcUInt32 passphrase_len,
- *                                        SilcPKCSFileEncoding encoding,
- *                                        SilcRng rng);
- *
- * DESCRIPTION
- *
- *    Saves private key into file.  The private key is encrypted into
- *    the file with the `passphrase' as a key, if PKCS supports encrypted
- *    private keys.  Returns FALSE on error.
- *
- ***/
-SilcBool silc_pkcs_save_private_key(const char *filename,
-                                   SilcPrivateKey private_key,
-                                   const unsigned char *passphrase,
-                                   SilcUInt32 passphrase_len,
-                                   SilcPKCSFileEncoding encoding,
-                                   SilcRng rng);
-
-#endif /* !SILCPKCS_H */
diff --git a/lib/silccrypt/silcpkcs1.c b/lib/silccrypt/silcpkcs1.c
deleted file mode 100644 (file)
index 0a75f80..0000000
+++ /dev/null
@@ -1,900 +0,0 @@
-/*
-
-  silcpkcs1.c
-
-  Author: Pekka Riikonen <priikone@silcnet.org>
-
-  Copyright (C) 2003 - 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.
-
-*/
-/* $Id$ */
-
-#include "silc.h"
-#include "rsa.h"
-#include "silcpkcs1_i.h"
-
-/************************** PKCS #1 message format ***************************/
-
-/* Minimum padding in block */
-#define SILC_PKCS1_MIN_PADDING 8
-
-/* Encodes PKCS#1 data block from the `data' according to the block type
-   indicated by `bt'.  When encoding signatures the `bt' must be
-   SILC_PKCS1_BT_PRV1 and when encoding encryption blocks the `bt' must
-   be SILC_PKCS1_BT_PUB.  The encoded data is copied into the `dest_data'
-   buffer which is size of `dest_data_size'.  If the `dest_data' is not
-   able to hold the encoded block this returns FALSE.  The `rng' must be
-   set when `bt' is SILC_PKCS1_BT_PUB.  This function returns TRUE on
-   success. */
-
-SilcBool silc_pkcs1_encode(SilcPkcs1BlockType bt,
-                          const unsigned char *data,
-                          SilcUInt32 data_len,
-                          unsigned char *dest_data,
-                          SilcUInt32 dest_data_size,
-                          SilcRng rng)
-{
-  SilcInt32 padlen;
-  int i;
-
-  SILC_LOG_DEBUG(("PKCS#1 encoding, bt %d", bt));
-
-  if (!data || !dest_data ||
-      dest_data_size < SILC_PKCS1_MIN_PADDING + 3 ||
-      dest_data_size < data_len) {
-    SILC_LOG_DEBUG(("Data to be encoded is too long"));
-    return FALSE;
-  }
-
-  /* Start of block */
-  dest_data[0] = 0x00;
-  dest_data[1] = (unsigned char)bt;
-
-  padlen = (SilcInt32)dest_data_size - (SilcInt32)data_len - 3;
-  if (padlen < SILC_PKCS1_MIN_PADDING) {
-    SILC_LOG_DEBUG(("Data to be encoded is too long"));
-    return FALSE;
-  }
-
-  /* Encode according to block type */
-  switch (bt) {
-  case SILC_PKCS1_BT_PRV0:
-  case SILC_PKCS1_BT_PRV1:
-    /* Signature */
-    memset(dest_data + 2, bt == SILC_PKCS1_BT_PRV1 ? 0xff : 0x00, padlen);
-    break;
-
-  case SILC_PKCS1_BT_PUB:
-    /* Encryption */
-    if (!rng) {
-      SILC_LOG_ERROR(("Cannot encrypt: random number generator not provided"));
-      return FALSE;
-    }
-
-    /* It is guaranteed this routine does not return zero byte. */
-    for (i = 2; i < padlen; i++)
-      dest_data[i] = silc_rng_get_byte_fast(rng);
-
-    break;
-  }
-
-  /* Copy the data */
-  dest_data[padlen + 2] = 0x00;
-  memcpy(dest_data + padlen + 3, data, data_len);
-
-  return TRUE;
-}
-
-/* Decodes the PKCS#1 encoded block according to the block type `bt'.
-   When verifying signatures the `bt' must be SILC_PKCS1_BT_PRV1 and
-   when decrypting it must be SILC_PKCS1_BT_PUB.  This copies the
-   decoded data into `dest_data' which is size of `dest_data_size'.  If
-   the deocded block does not fit to `dest_data' this returns FALSE.
-   Returns TRUE on success. */
-
-SilcBool silc_pkcs1_decode(SilcPkcs1BlockType bt,
-                          const unsigned char *data,
-                          SilcUInt32 data_len,
-                          unsigned char *dest_data,
-                          SilcUInt32 dest_data_size,
-                          SilcUInt32 *dest_len)
-{
-  SilcUInt32 i = 0;
-
-  SILC_LOG_DEBUG(("PKCS#1 decoding, bt %d", bt));
-
-  /* Sanity checks */
-  if (!data || !dest_data || dest_data_size < 3 ||
-      data[0] != 0x00 || data[1] != (unsigned char)bt) {
-    SILC_LOG_DEBUG(("Malformed block"));
-    return FALSE;
-  }
-
-  /* Decode according to block type */
-  switch (bt) {
-  case SILC_PKCS1_BT_PRV0:
-    /* Do nothing */
-    break;
-
-  case SILC_PKCS1_BT_PRV1:
-    /* Verification */
-    for (i = 2; i < data_len; i++)
-      if (data[i] != 0xff)
-       break;
-    break;
-
-  case SILC_PKCS1_BT_PUB:
-    /* Decryption */
-    for (i = 2; i < data_len; i++)
-      if (data[i] == 0x00)
-       break;
-    break;
-  }
-
-  /* Sanity checks */
-  if (i >= data_len) {
-    SILC_LOG_DEBUG(("Malformed block"));
-    return FALSE;
-  }
-  if (i < SILC_PKCS1_MIN_PADDING) {
-    SILC_LOG_DEBUG(("Malformed block"));
-    return FALSE;
-  }
-  if (data[i++] != 0x00) {
-    SILC_LOG_DEBUG(("Malformed block"));
-    return FALSE;
-  }
-  if (i >= data_len) {
-    SILC_LOG_DEBUG(("Malformed block"));
-    return FALSE;
-  }
-  if (dest_data_size < data_len - i) {
-    SILC_LOG_DEBUG(("Destination buffer too small"));
-    return FALSE;
-  }
-
-  /* Copy the data */
-  memcpy(dest_data, data + i, data_len - i);
-
-  /* Return data length */
-  if (dest_len)
-    *dest_len = data_len - i;
-
-  return TRUE;
-}
-
-
-/***************************** PKCS #1 PKCS API ******************************/
-
-/* Generates RSA key pair. */
-
-SilcBool silc_pkcs1_generate_key(SilcUInt32 keylen,
-                                SilcRng rng,
-                                void **ret_public_key,
-                                void **ret_private_key)
-{
-  SilcUInt32 prime_bits = keylen / 2;
-  SilcMPInt p, q;
-  SilcBool found = FALSE;
-
-  if (keylen < 768 || keylen > 16384)
-    return FALSE;
-
-  silc_mp_init(&p);
-  silc_mp_init(&q);
-
-  /* Find p and q */
-  while (!found) {
-    silc_math_gen_prime(&p, prime_bits, FALSE, rng);
-    silc_math_gen_prime(&q, prime_bits, FALSE, rng);
-    if ((silc_mp_cmp(&p, &q)) != 0)
-      found = TRUE;
-  }
-
-  /* If p is smaller than q, switch them */
-  if ((silc_mp_cmp(&p, &q)) > 0) {
-    SilcMPInt hlp;
-    silc_mp_init(&hlp);
-
-    silc_mp_set(&hlp, &p);
-    silc_mp_set(&p, &q);
-    silc_mp_set(&q, &hlp);
-
-    silc_mp_uninit(&hlp);
-  }
-
-  /* Generate the actual keys */
-  if (!silc_rsa_generate_keys(keylen, &p, &q, ret_public_key, ret_private_key))
-    return FALSE;
-
-  silc_mp_uninit(&p);
-  silc_mp_uninit(&q);
-
-  return TRUE;
-}
-
-/* Import PKCS #1 compliant public key */
-
-int silc_pkcs1_import_public_key(unsigned char *key,
-                                SilcUInt32 key_len,
-                                void **ret_public_key)
-{
-  SilcAsn1 asn1 = NULL;
-  SilcBufferStruct alg_key;
-  RsaPublicKey *pubkey;
-
-  if (!ret_public_key)
-    return 0;
-
-  asn1 = silc_asn1_alloc();
-  if (!asn1)
-    return 0;
-
-  /* Allocate RSA public key */
-  *ret_public_key = pubkey = silc_calloc(1, sizeof(*pubkey));
-  if (!pubkey)
-    goto err;
-
-  /* Parse the PKCS #1 public key */
-  silc_buffer_set(&alg_key, key, key_len);
-  if (!silc_asn1_decode(asn1, &alg_key,
-                       SILC_ASN1_OPTS(SILC_ASN1_ALLOC),
-                       SILC_ASN1_SEQUENCE,
-                         SILC_ASN1_INT(&pubkey->n),
-                         SILC_ASN1_INT(&pubkey->e),
-                       SILC_ASN1_END, SILC_ASN1_END))
-    goto err;
-
-  /* Set key length */
-  pubkey->bits = ((silc_mp_sizeinbase(&pubkey->n, 2) + 7) / 8) * 8;
-
-  silc_asn1_free(asn1);
-
-  return key_len;
-
- err:
-  silc_free(pubkey);
-  silc_asn1_free(asn1);
-  return 0;
-}
-
-/* Export PKCS #1 compliant public key */
-
-unsigned char *silc_pkcs1_export_public_key(void *public_key,
-                                           SilcUInt32 *ret_len)
-{
-  RsaPublicKey *key = public_key;
-  SilcAsn1 asn1 = NULL;
-  SilcBufferStruct alg_key;
-  unsigned char *ret;
-
-  asn1 = silc_asn1_alloc();
-  if (!asn1)
-    goto err;
-
-  /* Encode to PKCS #1 public key */
-  memset(&alg_key, 0, sizeof(alg_key));
-  if (!silc_asn1_encode(asn1, &alg_key,
-                       SILC_ASN1_OPTS(SILC_ASN1_ALLOC),
-                       SILC_ASN1_SEQUENCE,
-                         SILC_ASN1_INT(&key->n),
-                         SILC_ASN1_INT(&key->e),
-                       SILC_ASN1_END, SILC_ASN1_END))
-    goto err;
-
-  ret = silc_buffer_steal(&alg_key, ret_len);
-  silc_asn1_free(asn1);
-
-  return ret;
-
- err:
-  if (asn1)
-    silc_asn1_free(asn1);
-  return NULL;
-}
-
-/* Returns key length */
-
-SilcUInt32 silc_pkcs1_public_key_bitlen(void *public_key)
-{
-  RsaPublicKey *key = public_key;
-  return key->bits;
-}
-
-/* Copy public key */
-
-void *silc_pkcs1_public_key_copy(void *public_key)
-{
-  RsaPublicKey *key = public_key, *new_key;
-
-  new_key = silc_calloc(1, sizeof(*new_key));
-  if (!new_key)
-    return NULL;
-
-  silc_mp_init(&new_key->n);
-  silc_mp_init(&new_key->e);
-  silc_mp_set(&new_key->n, &key->n);
-  silc_mp_set(&new_key->e, &key->e);
-  new_key->bits = key->bits;
-
-  return new_key;
-}
-
-/* Compare public keys */
-
-SilcBool silc_pkcs1_public_key_compare(void *key1, void *key2)
-{
-  RsaPublicKey *k1 = key1, *k2 = key2;
-
-  if (k1->bits != k2->bits)
-    return FALSE;
-  if (silc_mp_cmp(&k1->e, &k2->e) != 0)
-    return FALSE;
-  if (silc_mp_cmp(&k1->n, &k2->n) != 0)
-    return FALSE;
-
-  return TRUE;
-}
-
-/* Frees public key */
-
-void silc_pkcs1_public_key_free(void *public_key)
-{
-  RsaPublicKey *key = public_key;
-
-  silc_mp_uninit(&key->n);
-  silc_mp_uninit(&key->e);
-  silc_free(key);
-}
-
-/* Import PKCS #1 compliant private key */
-
-int silc_pkcs1_import_private_key(unsigned char *key,
-                                 SilcUInt32 key_len,
-                                 void **ret_private_key)
-{
-  SilcAsn1 asn1;
-  SilcBufferStruct alg_key;
-  RsaPrivateKey *privkey;
-  SilcUInt32 ver;
-
-  if (!ret_private_key)
-    return 0;
-
-  asn1 = silc_asn1_alloc();
-  if (!asn1)
-    return 0;
-
-  /* Allocate RSA private key */
-  *ret_private_key = privkey = silc_calloc(1, sizeof(*privkey));
-  if (!privkey)
-    goto err;
-
-  /* Parse the PKCS #1 private key */
-  silc_buffer_set(&alg_key, key, key_len);
-  if (!silc_asn1_decode(asn1, &alg_key,
-                       SILC_ASN1_OPTS(SILC_ASN1_ALLOC),
-                       SILC_ASN1_SEQUENCE,
-                         SILC_ASN1_SHORT_INT(&ver),
-                         SILC_ASN1_INT(&privkey->n),
-                         SILC_ASN1_INT(&privkey->e),
-                         SILC_ASN1_INT(&privkey->d),
-                         SILC_ASN1_INT(&privkey->p),
-                         SILC_ASN1_INT(&privkey->q),
-                         SILC_ASN1_INT(&privkey->dP),
-                         SILC_ASN1_INT(&privkey->dQ),
-                         SILC_ASN1_INT(&privkey->qP),
-                       SILC_ASN1_END, SILC_ASN1_END))
-    goto err;
-
-  if (ver != 0)
-    goto err;
-
-  /* Set key length */
-  privkey->bits = ((silc_mp_sizeinbase(&privkey->n, 2) + 7) / 8) * 8;
-
-  silc_asn1_free(asn1);
-
-  return key_len;
-
- err:
-  silc_free(privkey);
-  silc_asn1_free(asn1);
-  return 0;
-}
-
-/* Export PKCS #1 compliant private key */
-
-unsigned char *silc_pkcs1_export_private_key(void *private_key,
-                                            SilcUInt32 *ret_len)
-{
-  RsaPrivateKey *key = private_key;
-  SilcAsn1 asn1;
-  SilcBufferStruct alg_key;
-  unsigned char *ret;
-
-  asn1 = silc_asn1_alloc();
-  if (!asn1)
-    return FALSE;
-
-  /* Encode to PKCS #1 private key */
-  memset(&alg_key, 0, sizeof(alg_key));
-  if (!silc_asn1_encode(asn1, &alg_key,
-                       SILC_ASN1_OPTS(SILC_ASN1_ALLOC),
-                       SILC_ASN1_SEQUENCE,
-                         SILC_ASN1_SHORT_INT(0),
-                         SILC_ASN1_INT(&key->n),
-                         SILC_ASN1_INT(&key->e),
-                         SILC_ASN1_INT(&key->d),
-                         SILC_ASN1_INT(&key->p),
-                         SILC_ASN1_INT(&key->q),
-                         SILC_ASN1_INT(&key->dP),
-                         SILC_ASN1_INT(&key->dQ),
-                         SILC_ASN1_INT(&key->qP),
-                       SILC_ASN1_END, SILC_ASN1_END))
-    goto err;
-
-  ret = silc_buffer_steal(&alg_key, ret_len);
-  silc_asn1_free(asn1);
-
-  return ret;
-
- err:
-  silc_asn1_free(asn1);
-  return NULL;
-}
-
-/* Returns key length */
-
-SilcUInt32 silc_pkcs1_private_key_bitlen(void *private_key)
-{
-  RsaPrivateKey *key = private_key;
-  return key->bits;
-}
-
-/* Frees private key */
-
-void silc_pkcs1_private_key_free(void *private_key)
-{
-  RsaPrivateKey *key = private_key;
-
-  silc_mp_uninit(&key->n);
-  silc_mp_uninit(&key->e);
-  silc_mp_uninit(&key->d);
-  silc_mp_uninit(&key->dP);
-  silc_mp_uninit(&key->dQ);
-  silc_mp_uninit(&key->qP);
-  silc_mp_uninit(&key->p);
-  silc_mp_uninit(&key->q);
-  silc_free(key);
-}
-
-/* PKCS #1 RSA routines */
-
-SilcBool silc_pkcs1_encrypt(void *public_key,
-                           unsigned char *src,
-                           SilcUInt32 src_len,
-                           unsigned char *dst,
-                           SilcUInt32 dst_size,
-                           SilcUInt32 *ret_dst_len,
-                           SilcRng rng)
-{
-  RsaPublicKey *key = public_key;
-  SilcMPInt mp_tmp;
-  SilcMPInt mp_dst;
-  unsigned char padded[2048 + 1];
-  SilcUInt32 len = (key->bits + 7) / 8;
-
-  if (sizeof(padded) < len)
-    return FALSE;
-  if (dst_size < len)
-    return FALSE;
-
-  /* Pad data */
-  if (!silc_pkcs1_encode(SILC_PKCS1_BT_PUB, src, src_len,
-                        padded, len, rng))
-    return FALSE;
-
-  silc_mp_init(&mp_tmp);
-  silc_mp_init(&mp_dst);
-
-  /* Data to MP */
-  silc_mp_bin2mp(padded, len, &mp_tmp);
-
-  /* Encrypt */
-  silc_rsa_public_operation(key, &mp_tmp, &mp_dst);
-
-  /* MP to data */
-  silc_mp_mp2bin_noalloc(&mp_dst, dst, len);
-  *ret_dst_len = len;
-
-  memset(padded, 0, sizeof(padded));
-  silc_mp_uninit(&mp_tmp);
-  silc_mp_uninit(&mp_dst);
-
-  return TRUE;
-}
-
-SilcBool silc_pkcs1_decrypt(void *private_key,
-                           unsigned char *src,
-                           SilcUInt32 src_len,
-                           unsigned char *dst,
-                           SilcUInt32 dst_size,
-                           SilcUInt32 *ret_dst_len)
-{
-  RsaPrivateKey *key = private_key;
-  SilcMPInt mp_tmp;
-  SilcMPInt mp_dst;
-  unsigned char *padded, unpadded[2048 + 1];
-  SilcUInt32 padded_len;
-
-  if (dst_size < (key->bits + 7) / 8)
-    return FALSE;
-
-  silc_mp_init(&mp_tmp);
-  silc_mp_init(&mp_dst);
-
-  /* Data to MP */
-  silc_mp_bin2mp(src, src_len, &mp_tmp);
-
-  /* Decrypt */
-  silc_rsa_private_operation(key, &mp_tmp, &mp_dst);
-
-  /* MP to data */
-  padded = silc_mp_mp2bin(&mp_dst, (key->bits + 7) / 8, &padded_len);
-
-  /* Unpad data */
-  if (!silc_pkcs1_decode(SILC_PKCS1_BT_PUB, padded, padded_len,
-                        unpadded, sizeof(unpadded), ret_dst_len)) {
-    memset(padded, 0, padded_len);
-    silc_free(padded);
-    silc_mp_uninit(&mp_tmp);
-    silc_mp_uninit(&mp_dst);
-    return FALSE;
-  }
-
-  /* Copy to destination */
-  memcpy(dst, unpadded, *ret_dst_len);
-
-  memset(padded, 0, padded_len);
-  memset(unpadded, 0, sizeof(unpadded));
-  silc_free(padded);
-  silc_mp_uninit(&mp_tmp);
-  silc_mp_uninit(&mp_dst);
-
-  return TRUE;
-}
-
-/* PKCS #1 sign with appendix, hash OID included in the signature */
-
-SilcBool silc_pkcs1_sign(void *private_key,
-                        unsigned char *src,
-                        SilcUInt32 src_len,
-                        unsigned char *signature,
-                        SilcUInt32 signature_size,
-                        SilcUInt32 *ret_signature_len,
-                        SilcBool compute_hash,
-                        SilcHash hash)
-{
-  RsaPrivateKey *key = private_key;
-  unsigned char padded[2048 + 1], hashr[SILC_HASH_MAXLEN];
-  SilcMPInt mp_tmp;
-  SilcMPInt mp_dst;
-  SilcBufferStruct di;
-  SilcUInt32 len = (key->bits + 7) / 8;
-  const char *oid;
-  SilcAsn1 asn1;
-
-  SILC_LOG_DEBUG(("Sign"));
-
-  if (sizeof(padded) < len)
-    return FALSE;
-  if (signature_size < len)
-    return FALSE;
-
-  oid = silc_hash_get_oid(hash);
-  if (!oid)
-    return FALSE;
-
-  asn1 = silc_asn1_alloc();
-  if (!asn1)
-    return FALSE;
-
-  /* Compute hash */
-  if (compute_hash) {
-    silc_hash_make(hash, src, src_len, hashr);
-    src = hashr;
-    src_len = silc_hash_len(hash);
-  }
-
-  /* Encode digest info */
-  memset(&di, 0, sizeof(di));
-  if (!silc_asn1_encode(asn1, &di,
-                       SILC_ASN1_SEQUENCE,
-                         SILC_ASN1_SEQUENCE,
-                           SILC_ASN1_OID(oid),
-                           SILC_ASN1_NULL,
-                         SILC_ASN1_END,
-                         SILC_ASN1_OCTET_STRING(src, src_len),
-                       SILC_ASN1_END, SILC_ASN1_END)) {
-    silc_asn1_free(asn1);
-    return FALSE;
-  }
-  SILC_LOG_HEXDUMP(("DigestInfo"), silc_buffer_data(&di),
-                  silc_buffer_len(&di));
-
-  /* Pad data */
-  if (!silc_pkcs1_encode(SILC_PKCS1_BT_PRV1, silc_buffer_data(&di),
-                        silc_buffer_len(&di), padded, len, NULL)) {
-    silc_asn1_free(asn1);
-    return FALSE;
-  }
-
-  silc_mp_init(&mp_tmp);
-  silc_mp_init(&mp_dst);
-
-  /* Data to MP */
-  silc_mp_bin2mp(padded, len, &mp_tmp);
-
-  /* Sign */
-  silc_rsa_private_operation(key, &mp_tmp, &mp_dst);
-
-  /* MP to data */
-  silc_mp_mp2bin_noalloc(&mp_dst, signature, len);
-  *ret_signature_len = len;
-
-  memset(padded, 0, sizeof(padded));
-  silc_mp_uninit(&mp_tmp);
-  silc_mp_uninit(&mp_dst);
-  if (compute_hash)
-    memset(hashr, 0, sizeof(hashr));
-  silc_asn1_free(asn1);
-
-  return TRUE;
-}
-
-/* PKCS #1 verification with appendix. */
-
-SilcBool silc_pkcs1_verify(void *public_key,
-                          unsigned char *signature,
-                          SilcUInt32 signature_len,
-                          unsigned char *data,
-                          SilcUInt32 data_len,
-                          SilcHash hash)
-{
-  RsaPublicKey *key = public_key;
-  SilcBool ret = FALSE;
-  SilcMPInt mp_tmp2;
-  SilcMPInt mp_dst;
-  unsigned char *verify, unpadded[2048 + 1], hashr[SILC_HASH_MAXLEN];
-  SilcUInt32 verify_len, len = (key->bits + 7) / 8;
-  SilcBufferStruct di, ldi;
-  SilcHash ihash = NULL;
-  SilcAsn1 asn1 = NULL;
-  char *oid;
-
-  SILC_LOG_DEBUG(("Verify signature"));
-
-  asn1 = silc_asn1_alloc();
-  if (!asn1)
-    return FALSE;
-
-  silc_mp_init(&mp_tmp2);
-  silc_mp_init(&mp_dst);
-
-  /* Format the signature into MP int */
-  silc_mp_bin2mp(signature, signature_len, &mp_tmp2);
-
-  /* Verify */
-  silc_rsa_public_operation(key, &mp_tmp2, &mp_dst);
-
-  /* MP to data */
-  verify = silc_mp_mp2bin(&mp_dst, len, &verify_len);
-
-  /* Unpad data */
-  if (!silc_pkcs1_decode(SILC_PKCS1_BT_PRV1, verify, verify_len,
-                        unpadded, sizeof(unpadded), &len))
-    goto err;
-  silc_buffer_set(&di, unpadded, len);
-
-  /* If hash isn't given, allocate the one given in digest info */
-  if (!hash) {
-    /* Decode digest info */
-    if (!silc_asn1_decode(asn1, &di,
-                         SILC_ASN1_OPTS(SILC_ASN1_ACCUMUL),
-                         SILC_ASN1_SEQUENCE,
-                           SILC_ASN1_SEQUENCE,
-                             SILC_ASN1_OID(&oid),
-                           SILC_ASN1_END,
-                         SILC_ASN1_END, SILC_ASN1_END))
-      goto err;
-
-    if (!silc_hash_alloc_by_oid(oid, &ihash)) {
-      SILC_LOG_DEBUG(("Unknown OID %s", oid));
-      goto err;
-    }
-    hash = ihash;
-  }
-
-  /* Hash the data */
-  silc_hash_make(hash, data, data_len, hashr);
-  data = hashr;
-  data_len = silc_hash_len(hash);
-  oid = (char *)silc_hash_get_oid(hash);
-
-  /* Encode digest info for comparison */
-  memset(&ldi, 0, sizeof(ldi));
-  if (!silc_asn1_encode(asn1, &ldi,
-                       SILC_ASN1_OPTS(SILC_ASN1_ACCUMUL),
-                       SILC_ASN1_SEQUENCE,
-                         SILC_ASN1_SEQUENCE,
-                           SILC_ASN1_OID(oid),
-                           SILC_ASN1_NULL,
-                         SILC_ASN1_END,
-                         SILC_ASN1_OCTET_STRING(data, data_len),
-                       SILC_ASN1_END, SILC_ASN1_END))
-    goto err;
-
-  SILC_LOG_HEXDUMP(("DigestInfo remote"), silc_buffer_data(&di),
-                  silc_buffer_len(&di));
-  SILC_LOG_HEXDUMP(("DigestInfo local"), silc_buffer_data(&ldi),
-                  silc_buffer_len(&ldi));
-
-  /* Compare */
-  if (silc_buffer_len(&di) == silc_buffer_len(&ldi) &&
-      !memcmp(silc_buffer_data(&di), silc_buffer_data(&ldi),
-             silc_buffer_len(&ldi)))
-    ret = TRUE;
-
-  memset(verify, 0, verify_len);
-  memset(unpadded, 0, sizeof(unpadded));
-  silc_free(verify);
-  silc_mp_uninit(&mp_tmp2);
-  silc_mp_uninit(&mp_dst);
-  if (hash)
-    memset(hashr, 0, sizeof(hashr));
-  if (ihash)
-    silc_hash_free(ihash);
-  silc_asn1_free(asn1);
-
-  return ret;
-
- err:
-  memset(verify, 0, verify_len);
-  silc_free(verify);
-  silc_mp_uninit(&mp_tmp2);
-  silc_mp_uninit(&mp_dst);
-  if (ihash)
-    silc_hash_free(ihash);
-  silc_asn1_free(asn1);
-  return FALSE;
-}
-
-/* PKCS #1 sign without hash oid */
-
-SilcBool silc_pkcs1_sign_no_oid(void *private_key,
-                               unsigned char *src,
-                               SilcUInt32 src_len,
-                               unsigned char *signature,
-                               SilcUInt32 signature_size,
-                               SilcUInt32 *ret_signature_len,
-                               SilcBool compute_hash,
-                               SilcHash hash)
-{
-  RsaPrivateKey *key = private_key;
-  SilcMPInt mp_tmp;
-  SilcMPInt mp_dst;
-  unsigned char padded[2048 + 1], hashr[SILC_HASH_MAXLEN];
-  SilcUInt32 len = (key->bits + 7) / 8;
-
-  SILC_LOG_DEBUG(("Sign"));
-
-  if (sizeof(padded) < len)
-    return FALSE;
-  if (signature_size < len)
-    return FALSE;
-
-  /* Compute hash if requested */
-  if (compute_hash) {
-    silc_hash_make(hash, src, src_len, hashr);
-    src = hashr;
-    src_len = silc_hash_len(hash);
-  }
-
-  /* Pad data */
-  if (!silc_pkcs1_encode(SILC_PKCS1_BT_PRV1, src, src_len,
-                        padded, len, NULL))
-    return FALSE;
-
-  silc_mp_init(&mp_tmp);
-  silc_mp_init(&mp_dst);
-
-  /* Data to MP */
-  silc_mp_bin2mp(padded, len, &mp_tmp);
-
-  /* Sign */
-  silc_rsa_private_operation(key, &mp_tmp, &mp_dst);
-
-  /* MP to data */
-  silc_mp_mp2bin_noalloc(&mp_dst, signature, len);
-  *ret_signature_len = len;
-
-  memset(padded, 0, sizeof(padded));
-  silc_mp_uninit(&mp_tmp);
-  silc_mp_uninit(&mp_dst);
-  if (compute_hash)
-    memset(hashr, 0, sizeof(hashr));
-
-  return TRUE;
-}
-
-/* PKCS #1 verify without hash oid */
-
-SilcBool silc_pkcs1_verify_no_oid(void *public_key,
-                                 unsigned char *signature,
-                                 SilcUInt32 signature_len,
-                                 unsigned char *data,
-                                 SilcUInt32 data_len,
-                                 SilcHash hash)
-{
-  RsaPublicKey *key = public_key;
-  SilcBool ret = FALSE;
-  SilcMPInt mp_tmp2;
-  SilcMPInt mp_dst;
-  unsigned char *verify, unpadded[2048 + 1], hashr[SILC_HASH_MAXLEN];
-  SilcUInt32 verify_len, len = (key->bits + 7) / 8;
-
-  SILC_LOG_DEBUG(("Verify signature"));
-
-  silc_mp_init(&mp_tmp2);
-  silc_mp_init(&mp_dst);
-
-  /* Format the signature into MP int */
-  silc_mp_bin2mp(signature, signature_len, &mp_tmp2);
-
-  /* Verify */
-  silc_rsa_public_operation(key, &mp_tmp2, &mp_dst);
-
-  /* MP to data */
-  verify = silc_mp_mp2bin(&mp_dst, len, &verify_len);
-
-  /* Unpad data */
-  if (!silc_pkcs1_decode(SILC_PKCS1_BT_PRV1, verify, verify_len,
-                        unpadded, sizeof(unpadded), &len)) {
-    memset(verify, 0, verify_len);
-    silc_free(verify);
-    silc_mp_uninit(&mp_tmp2);
-    silc_mp_uninit(&mp_dst);
-    return FALSE;
-  }
-
-  /* Hash data if requested */
-  if (hash) {
-    silc_hash_make(hash, data, data_len, hashr);
-    data = hashr;
-    data_len = silc_hash_len(hash);
-  }
-
-  /* Compare */
-  if (len == data_len && !memcmp(data, unpadded, len))
-    ret = TRUE;
-
-  memset(verify, 0, verify_len);
-  memset(unpadded, 0, sizeof(unpadded));
-  silc_free(verify);
-  silc_mp_uninit(&mp_tmp2);
-  silc_mp_uninit(&mp_dst);
-  if (hash)
-    memset(hashr, 0, sizeof(hashr));
-
-  return ret;
-}
diff --git a/lib/silccrypt/silcpkcs1.h b/lib/silccrypt/silcpkcs1.h
deleted file mode 100644 (file)
index 2218106..0000000
+++ /dev/null
@@ -1,115 +0,0 @@
-/*
-
-  silcpkcs1.h
-
-  Author: Pekka Riikonen <priikone@silcnet.org>
-
-  Copyright (C) 2003 - 2005 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.
-
-*/
-
-/****h* silccrypt/SILC PKCS1 Interface
- *
- * DESCRIPTION
- *
- * This interface implements the PKCS#1 standard block encoding and decoding
- * routines.  It is used as part of RSA implementation to perform PKCS#1
- * RSA operations.  The routines encode and decode the data for RSA operations
- * such as digital signatures and their verification, and encryption and
- * decryption.
- *
- ***/
-
-#ifndef SILCPKCS1_H
-#define SILCPKCS1_H
-
-/****d* silccrypt/SilcPKCS1API/SilcPkcs1BlockType
- *
- * NAME
- *
- *    typedef enum { ... } SilcPkcs1BlockType
- *
- * DESCRIPTION
- *
- *    Defines the PKCS#1 block types that define how the blcok is encoded
- *    for different RSA operations.
- *
- * SOURCE
- */
-typedef enum {
-  SILC_PKCS1_BT_PRV0 = 0x00,   /* Private key BT 0 */
-  SILC_PKCS1_BT_PRV1 = 0x01,   /* Private key BT 1 (use this always) */
-  SILC_PKCS1_BT_PUB  = 0x02,   /* Public key BT */
-} SilcPkcs1BlockType;
-/***/
-
-/****f* silccrypt/SilcPKCS1API/silc_pkcs1_encode
- *
- * SYNOPSIS
- *
- *    SilcBool silc_pkcs1_encode(SilcPkcs1BlockType bt,
- *                               const unsigned char *data,
- *                               SilcUInt32 data_len,
- *                               unsigned char *dest_data,
- *                               SilcUInt32 dest_data_size,
- *                               SilcRng rng);
- *
- * DESCRIPTION
- *
- *    Encodes PKCS#1 data block from the `data' according to the block type
- *    indicated by `bt'.  When encoding signatures the `bt' must be
- *    SILC_PKCS1_BT_PRV1 and when encoding encryption blocks the `bt' must
- *    be SILC_PKCS1_BT_PUB.  The encoded data is copied into the `dest_data'
- *    buffer which is size of `dest_data_size'.  If the `dest_data' is not
- *    able to hold the encoded block this returns FALSE.  Usually the
- *    `dest_data_size' is set to the RSA key length value as it is the
- *    length of one block.  The `rng' should be set when `bt' is set to
- *    SILC_PKCS1_BT_PUB.  If `rng' is NULL global RNG is used.  This
- *    function returns TRUE on success.
- *
- ***/
-SilcBool silc_pkcs1_encode(SilcPkcs1BlockType bt,
-                          const unsigned char *data,
-                          SilcUInt32 data_len,
-                          unsigned char *dest_data,
-                          SilcUInt32 dest_data_size,
-                          SilcRng rng);
-
-/****f* silccrypt/SilcPKCS1API/silc_pkcs1_decode
- *
- * SYNOPSIS
- *
- *    SilcBool silc_pkcs1_decode(SilcPkcs1BlockType bt,
- *                               const unsigned char *data,
- *                               SilcUInt32 data_len,
- *                               unsigned char *dest_data,
- *                               SilcUInt32 dest_data_size,
- *                               SilcUInt32 *dest_len);
- *
- * DESCRIPTION
- *
- *    Decodes the PKCS#1 encoded block according to the block type `bt'.
- *    When verifying signatures the `bt' must be SILC_PKCS1_BT_PRV1 and
- *    when decrypting it must be SILC_PKCS1_BT_PUB.  This copies the
- *    decoded data into `dest_data' which is size of `dest_data_size'.  If
- *    the deocded block does not fit to `dest_data' this returns FALSE.
- *    Returns the decoded length into `dest_len'.
- *
- ***/
-SilcBool silc_pkcs1_decode(SilcPkcs1BlockType bt,
-                          const unsigned char *data,
-                          SilcUInt32 data_len,
-                          unsigned char *dest_data,
-                          SilcUInt32 dest_data_size,
-                          SilcUInt32 *dest_len);
-
-#endif /* SILCPKCS1_H */
diff --git a/lib/silccrypt/silcpkcs1_i.h b/lib/silccrypt/silcpkcs1_i.h
deleted file mode 100644 (file)
index fd5ecb4..0000000
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
-
-  silcpkcs1_i.h
-
-  Author: Pekka Riikonen <priikone@silcnet.org>
-
-  Copyright (C); 2006 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 SILCPKCS1_I_H
-#define SILCPKCS1_I_H
-
-SilcBool silc_pkcs1_generate_key(SilcUInt32 keylen,
-                                SilcRng rng,
-                                void **ret_public_key,
-                                void **ret_private_key);
-int silc_pkcs1_import_public_key(unsigned char *key,
-                                SilcUInt32 key_len,
-                                void **ret_public_key);
-unsigned char *silc_pkcs1_export_public_key(void *public_key,
-                                           SilcUInt32 *ret_len);
-SilcUInt32 silc_pkcs1_public_key_bitlen(void *public_key);
-void *silc_pkcs1_public_key_copy(void *public_key);
-SilcBool silc_pkcs1_public_key_compare(void *key1, void *key2);
-void silc_pkcs1_public_key_free(void *public_key);
-int silc_pkcs1_import_private_key(unsigned char *key,
-                                 SilcUInt32 key_len,
-                                 void **ret_private_key);
-unsigned char *silc_pkcs1_export_private_key(void *private_key,
-                                            SilcUInt32 *ret_len);
-SilcUInt32 silc_pkcs1_private_key_bitlen(void *private_key);
-void silc_pkcs1_private_key_free(void *private_key);
-SilcBool silc_pkcs1_encrypt(void *public_key,
-                           unsigned char *src,
-                           SilcUInt32 src_len,
-                           unsigned char *dst,
-                           SilcUInt32 dst_size,
-                           SilcUInt32 *ret_dst_len,
-                           SilcRng rng);
-SilcBool silc_pkcs1_decrypt(void *private_key,
-                           unsigned char *src,
-                           SilcUInt32 src_len,
-                           unsigned char *dst,
-                           SilcUInt32 dst_size,
-                           SilcUInt32 *ret_dst_len);
-SilcBool silc_pkcs1_sign(void *private_key,
-                        unsigned char *src,
-                        SilcUInt32 src_len,
-                        unsigned char *signature,
-                        SilcUInt32 signature_size,
-                        SilcUInt32 *ret_signature_len,
-                        SilcBool compute_hash,
-                        SilcHash hash);
-SilcBool silc_pkcs1_verify(void *public_key,
-                          unsigned char *signature,
-                          SilcUInt32 signature_len,
-                          unsigned char *data,
-                          SilcUInt32 data_len,
-                          SilcHash hash);
-SilcBool silc_pkcs1_sign_no_oid(void *private_key,
-                               unsigned char *src,
-                               SilcUInt32 src_len,
-                               unsigned char *signature,
-                               SilcUInt32 signature_size,
-                               SilcUInt32 *ret_signature_len,
-                               SilcBool compute_hash,
-                               SilcHash hash);
-SilcBool silc_pkcs1_verify_no_oid(void *public_key,
-                                 unsigned char *signature,
-                                 SilcUInt32 signature_len,
-                                 unsigned char *data,
-                                 SilcUInt32 data_len,
-                                 SilcHash hash);
-
-#endif /* SILCPKCS1_I_H */
diff --git a/lib/silccrypt/silcrng.c b/lib/silccrypt/silcrng.c
deleted file mode 100644 (file)
index 668a64e..0000000
+++ /dev/null
@@ -1,713 +0,0 @@
-/*
-
-  silcrng.c
-
-  Author: Pekka Riikonen <priikone@silcnet.org>
-
-  Copyright (C) 1997 - 2003 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.
-
-*/
-/* $Id$ */
-/*
- * Created: Sun Mar  9 00:09:18 1997
- *
- * The original RNG was based on Secure Shell's random number generator
- * by Tatu Ylönen and was used as reference when programming this RNG.
- * This RNG has been rewritten twice since the creation.
- */
-
-#include "silc.h"
-
-#ifndef WIN32
-#ifdef HAVE_GETSID
-extern pid_t getsid (pid_t __pid);
-#endif
-
-#ifdef HAVE_GETPGID
-extern pid_t getpgid (pid_t __pid);
-#endif
-#endif
-
-#undef SILC_RNG_DEBUG
-/*#define SILC_RNG_DEBUG*/
-
-/* Number of states to fetch data from pool. */
-#define SILC_RNG_STATE_NUM 4
-
-/* Byte size of the random data pool. */
-#define SILC_RNG_POOLSIZE (20 * 48)
-
-static SilcUInt32 silc_rng_get_position(SilcRng rng);
-static void silc_rng_stir_pool(SilcRng rng);
-static void silc_rng_xor(SilcRng rng, SilcUInt32 val, unsigned int pos);
-static void silc_rng_exec_command(SilcRng rng, char *command);
-static void silc_rng_get_hard_noise(SilcRng rng);
-static void silc_rng_get_medium_noise(SilcRng rng);
-static void silc_rng_get_soft_noise(SilcRng rng);
-
-/*
-   SILC SilcRng State context.
-
-   This object is used by the random number generator to provide
-   variable points where the actual random number is fetched from
-   the random pool. This provides that the data is not fetched always
-   from the same point of the pool. Short description of the fields
-   following.
-
-   SilcUInt32 low
-   SilcUInt32 pos
-
-       The index for the random pool buffer. Lowest and current
-       positions.
-
-   SilcRngStateContext *next
-
-       Pointer to the next state. If this is the last state this
-       will point to the first state thus providing circular list.
-
-*/
-typedef struct SilcRngStateContext {
-  SilcUInt32 low;
-  SilcUInt32 pos;
-  struct SilcRngStateContext *next;
-} *SilcRngState;
-
-/*
-   SILC Random Number Generator object.
-
-   This object holds random pool which is used to generate the random
-   numbers used by various routines needing cryptographically strong
-   random numbers. Following short descriptions of the fields.
-
-   unsigned char pool[]
-
-       The random pool. This buffer holds the random data. This is
-       frequently stirred thus providing ever changing randomnes.
-
-   unsigned char key[64]
-
-       Key used in stirring the random pool. The pool is encrypted
-       with SHA1 hash function in CFB (Cipher Feedback) mode.
-
-   SilcSilcRngState state
-
-       State object that is used to get the next position for the
-       random pool. This position is used to fetch data from pool
-       or to save the data to the pool. The state changes everytime
-       SilcRng is used.
-
-   SilcHash sha1
-
-       Hash object (SHA1) used to make the CFB encryption to the
-       random pool. This is allocated when RNG object is allocated and
-       free'd when RNG object is free'd.
-
-   SilcUInt8 threshold
-
-       Threshold to indicate when it is required to acquire more
-       noise from the environment.  More soft noise is acquired after
-       64 bits of output and hard noise every 160 bits of output.
-
-*/
-struct SilcRngStruct {
-  unsigned char pool[SILC_RNG_POOLSIZE];
-  unsigned char key[64];
-  SilcRngState state;
-  SilcHash sha1;
-  SilcUInt8 threshold;
-  char *devrandom;
-  int fd_devurandom;
-};
-
-/* Allocates new RNG object. */
-
-SilcRng silc_rng_alloc(void)
-{
-  SilcRng new;
-
-  SILC_LOG_DEBUG(("Allocating new RNG object"));
-
-  new = silc_calloc(1, sizeof(*new));
-  new->fd_devurandom = -1;
-
-  memset(new->pool, 0, sizeof(new->pool));
-  memset(new->key, 0, sizeof(new->key));
-  new->state = NULL;
-  if (!silc_hash_alloc("sha1", &new->sha1)) {
-    silc_free(new);
-    SILC_LOG_ERROR(("Could not allocate sha1 hash, probably not registered"));
-    return NULL;
-  }
-
-  new->devrandom = strdup("/dev/random");
-
-  return new;
-}
-
-/* Free's RNG object. */
-
-void silc_rng_free(SilcRng rng)
-{
-  if (rng) {
-    SilcRngState t, n;
-
-    memset(rng->pool, 0, sizeof(rng->pool));
-    memset(rng->key, 0, sizeof(rng->key));
-    silc_hash_free(rng->sha1);
-    silc_free(rng->devrandom);
-
-    if (rng->fd_devurandom != -1)
-      close(rng->fd_devurandom);
-
-    for (t = rng->state->next; t != rng->state; ) {
-      n = t->next;
-      silc_free(t);
-      t = n;
-    }
-    silc_free(rng->state);
-
-    silc_free(rng);
-  }
-}
-
-/* Initializes random number generator by getting noise from environment.
-   The environmental noise is our so called seed. One should not call
-   this function more than once. */
-
-void silc_rng_init(SilcRng rng)
-{
-  int i;
-  SilcRngState first, next;
-
-  assert(rng != NULL);
-
-  SILC_LOG_DEBUG(("Initializing RNG object"));
-
-  /* Initialize the states for the RNG. */
-  rng->state = silc_calloc(1, sizeof(*rng->state));
-  rng->state->low = 0;
-  rng->state->pos = 8;
-  rng->state->next = NULL;
-  first = rng->state;
-  for (i = SILC_RNG_STATE_NUM - 1; i >= 1; i--) {
-    next = silc_calloc(1, sizeof(*rng->state));
-    next->low =
-      (i * (sizeof(rng->pool) / SILC_RNG_STATE_NUM));
-    next->pos =
-      (i * (sizeof(rng->pool) / SILC_RNG_STATE_NUM)) + 8;
-    next->next = rng->state;
-    rng->state = next;
-  }
-  first->next = next;
-  rng->state = first;
-
-  memset(rng->pool, 0, sizeof(rng->pool));
-
-  /* Get noise from various environmental sources */
-  silc_rng_get_soft_noise(rng);
-  silc_rng_get_medium_noise(rng);
-  silc_rng_get_hard_noise(rng);
-  silc_rng_get_soft_noise(rng);
-  silc_free(rng->devrandom);
-  rng->devrandom = strdup("/dev/urandom");
-}
-
-/* This function gets 'soft' noise from environment. */
-
-static void silc_rng_get_soft_noise(SilcRng rng)
-{
-#ifndef SILC_WIN32
-  struct tms ptime;
-#endif
-  SilcUInt32 pos;
-#ifdef HAVE_GETRUSAGE
-  struct rusage r;
-#endif
-
-  pos = silc_rng_get_position(rng);
-
-  silc_rng_xor(rng, clock(), 0);
-#ifndef SILC_WIN32
-#ifdef HAVE_GETPID
-  silc_rng_xor(rng, getpid(), 1);
-#ifdef HAVE_GETPGID
-  silc_rng_xor(rng, getpgid(getpid()) << 8, 2);
-  silc_rng_xor(rng, getpgid(getpid()) << 8, 3);
-#endif
-#ifdef HAVE_GETGID
-  silc_rng_xor(rng, getgid(), 4);
-#endif
-#endif
-#ifdef HAVE_GETPGRP
-  silc_rng_xor(rng, getpgrp(), 5);
-#endif
-#ifdef HAVE_GETSID
-  silc_rng_xor(rng, getsid(getpid()) << 16, 6);
-#endif
-#ifndef SILC_SYMBIAN
-  silc_rng_xor(rng, times(&ptime), 7);
-  silc_rng_xor(rng, ptime.tms_utime, 8);
-  silc_rng_xor(rng, (ptime.tms_utime + ptime.tms_stime), pos++);
-  silc_rng_xor(rng, (ptime.tms_stime + ptime.tms_cutime), pos++);
-  silc_rng_xor(rng, (ptime.tms_utime + ptime.tms_stime), pos++);
-  silc_rng_xor(rng, (ptime.tms_cutime ^ ptime.tms_stime), pos++);
-  silc_rng_xor(rng, (ptime.tms_cutime ^ ptime.tms_cstime), pos++);
-  silc_rng_xor(rng, (ptime.tms_utime ^ ptime.tms_stime), pos++);
-  silc_rng_xor(rng, (ptime.tms_stime ^ ptime.tms_cutime), pos++);
-  silc_rng_xor(rng, (ptime.tms_cutime + ptime.tms_stime), pos++);
-  silc_rng_xor(rng, (ptime.tms_stime << 8), pos++);
-#endif /* SILC_SYMBIAN */
-#endif
-  silc_rng_xor(rng, clock() << 4, pos++);
-#ifndef SILC_WIN32
-#ifdef HAVE_GETPGID
-  silc_rng_xor(rng, getpgid(getpid()) << 8, pos++);
-#endif
-#ifdef HAVE_GETPGRP
-  silc_rng_xor(rng, getpgrp(), pos++);
-#endif
-#ifdef HAVE_SETSID
-  silc_rng_xor(rng, getsid(getpid()) << 16, pos++);
-#endif
-#ifndef SILC_SYMBIAN
-  silc_rng_xor(rng, times(&ptime), pos++);
-  silc_rng_xor(rng, ptime.tms_utime, pos++);
-#endif /* SILC_SYMBIAN */
-#ifdef HAVE_GETPGRP
-  silc_rng_xor(rng, getpgrp(), pos++);
-#endif
-#endif
-#ifdef HAVE_GETRUSAGE
-  getrusage(RUSAGE_SELF, &r);
-  silc_rng_xor(rng, (r.ru_utime.tv_sec + r.ru_utime.tv_usec), pos++);
-  silc_rng_xor(rng, (r.ru_utime.tv_sec ^ r.ru_utime.tv_usec), pos++);
-  silc_rng_xor(rng, (r.ru_stime.tv_sec + r.ru_stime.tv_usec), pos++);
-  silc_rng_xor(rng, (r.ru_stime.tv_sec ^ r.ru_stime.tv_usec), pos++);
-#ifndef SILC_SYMBIAN
-  silc_rng_xor(rng, (r.ru_maxrss + r.ru_ixrss), pos++);
-  silc_rng_xor(rng, (r.ru_maxrss ^ r.ru_ixrss), pos++);
-  silc_rng_xor(rng, (r.ru_idrss + r.ru_idrss), pos++);
-  silc_rng_xor(rng, (r.ru_idrss ^ r.ru_idrss), pos++);
-  silc_rng_xor(rng, (r.ru_idrss << 16), pos++);
-  silc_rng_xor(rng, (r.ru_minflt + r.ru_majflt), pos++);
-  silc_rng_xor(rng, (r.ru_minflt ^ r.ru_majflt), pos++);
-  silc_rng_xor(rng, (r.ru_nswap + r.ru_oublock + r.ru_inblock), pos++);
-  silc_rng_xor(rng, (r.ru_nswap << 8), pos++);
-  silc_rng_xor(rng, (r.ru_inblock + r.ru_oublock), pos++);
-  silc_rng_xor(rng, (r.ru_inblock ^ r.ru_oublock), pos++);
-  silc_rng_xor(rng, (r.ru_msgsnd ^ r.ru_msgrcv), pos++);
-  silc_rng_xor(rng, (r.ru_nsignals + r.ru_msgsnd + r.ru_msgrcv), pos++);
-  silc_rng_xor(rng, (r.ru_nsignals << 16), pos++);
-  silc_rng_xor(rng, (r.ru_nvcsw + r.ru_nivcsw), pos++);
-  silc_rng_xor(rng, (r.ru_nvcsw ^ r.ru_nivcsw), pos++);
-#endif /* SILC_SYMBIAN */
-#endif /* HAVE_GETRUSAGE */
-  
-#ifdef SILC_RNG_DEBUG
-  SILC_LOG_HEXDUMP(("pool"), rng->pool, sizeof(rng->pool));
-#endif
-
-  /* Stir random pool */
-  silc_rng_stir_pool(rng);
-}
-
-/* This function gets noise from different commands */
-
-static void silc_rng_get_medium_noise(SilcRng rng)
-{
-  /* If getrusage is available, there is no need for shell commands */
-#ifdef HAVE_GETRUSAGE
-  return;
-#endif
-  silc_rng_exec_command(rng, "ps -leaww 2> /dev/null");
-  silc_rng_exec_command(rng, "ls -afiln ~ 2> /dev/null");
-  silc_rng_exec_command(rng, "ls -afiln /proc 2> /dev/null");
-  silc_rng_exec_command(rng, "ps -axww 2> /dev/null");
-
-#ifdef SILC_RNG_DEBUG
-  SILC_LOG_HEXDUMP(("pool"), rng->pool, sizeof(rng->pool));
-#endif
-}
-
-/* This function gets 'hard' noise from environment. This tries to
-   get the noise from /dev/random if available. */
-
-static void silc_rng_get_hard_noise(SilcRng rng)
-{
-#if defined(SILC_UNIX)
-  unsigned char buf[32];
-  int fd, len, i;
-
-  /* Get noise from /dev/[u]random if available */
-  fd = open(rng->devrandom, O_RDONLY);
-  if (fd < 0)
-    return;
-
-  fcntl(fd, F_SETFL, O_NONBLOCK);
-
-  for (i = 0; i < 2; i++) {
-    len = read(fd, buf, sizeof(buf));
-    if (len <= 0)
-      goto out;
-    silc_rng_add_noise(rng, buf, len);
-  }
-
-#ifdef SILC_RNG_DEBUG
-  SILC_LOG_HEXDUMP(("pool"), rng->pool, sizeof(rng->pool));
-#endif
-
- out:
-  close(fd);
-  memset(buf, 0, sizeof(buf));
-#endif
-}
-
-/* Execs command and gets noise from its output */
-
-static void silc_rng_exec_command(SilcRng rng, char *command)
-{
-#if defined(SILC_UNIX)
-  unsigned char buf[1024];
-  FILE *fd;
-  int i;
-  int c;
-
-  /* Open process */
-  fd = popen(command, "r");
-  if (!fd)
-    return;
-
-  /* Get data as much as we can get into the buffer */
-  for (i = 0; i < sizeof(buf); i++) {
-    c = fgetc(fd);
-    if (c == EOF)
-      break;
-    buf[i] = c;
-  }
-
-  pclose(fd);
-
-  if (i != 0) {
-    /* Add the buffer into random pool */
-    silc_rng_add_noise(rng, buf, i);
-    memset(buf, 0, sizeof(buf));
-  }
-#endif
-}
-
-/* This function adds the contents of the buffer as noise into random
-   pool. After adding the noise the pool is stirred. */
-
-void silc_rng_add_noise(SilcRng rng, unsigned char *buffer, SilcUInt32 len)
-{
-  SilcUInt32 i, pos;
-
-  pos = silc_rng_get_position(rng);
-
-  /* Add the buffer one by one into the pool */
-  for(i = 0; i < len; i++, buffer++) {
-    if(pos >= SILC_RNG_POOLSIZE)
-      break;
-    rng->pool[pos++] ^= *buffer;
-  }
-
-  /* Stir random pool */
-  silc_rng_stir_pool(rng);
-}
-
-/* XOR's data into the pool */
-
-static void silc_rng_xor(SilcRng rng, SilcUInt32 val, unsigned int pos)
-{
-  SilcUInt32 tmp;
-
-  SILC_GET32_MSB(tmp, &rng->pool[pos]);
-  val ^= tmp + val;
-  SILC_PUT32_MSB(val, &rng->pool[pos]);
-}
-
-/* This function stirs the random pool by encrypting buffer in CFB
-   (cipher feedback) mode with SHA1 algorithm. */
-
-static void silc_rng_stir_pool(SilcRng rng)
-{
-  int i;
-  SilcUInt32 iv[5], tmp;
-
-  /* Get the IV */
-  SILC_GET32_MSB(iv[0], &rng->pool[16     ]);
-  SILC_GET32_MSB(iv[1], &rng->pool[16 +  4]);
-  SILC_GET32_MSB(iv[2], &rng->pool[16 +  8]);
-  SILC_GET32_MSB(iv[3], &rng->pool[16 + 12]);
-  SILC_GET32_MSB(iv[4], &rng->pool[16 + 16]);
-
-  /* First CFB pass */
-  for (i = 0; i < SILC_RNG_POOLSIZE; i += 20) {
-    silc_hash_transform(rng->sha1, iv, rng->key);
-
-    SILC_GET32_MSB(tmp, &rng->pool[i]);
-    iv[0] ^= tmp;
-    SILC_PUT32_MSB(iv[0], &rng->pool[i]);
-
-    SILC_GET32_MSB(tmp, &rng->pool[i + 4]);
-    iv[1] ^= tmp;
-    SILC_PUT32_MSB(iv[1], &rng->pool[i + 4]);
-
-    SILC_GET32_MSB(tmp, &rng->pool[i + 8]);
-    iv[2] ^= tmp;
-    SILC_PUT32_MSB(iv[2], &rng->pool[i + 8]);
-
-    SILC_GET32_MSB(tmp, &rng->pool[i + 12]);
-    iv[3] ^= tmp;
-    SILC_PUT32_MSB(iv[3], &rng->pool[i + 12]);
-
-    SILC_GET32_MSB(tmp, &rng->pool[i + 16]);
-    iv[4] ^= tmp;
-    SILC_PUT32_MSB(iv[4], &rng->pool[i + 16]);
-  }
-
-  /* Get new key */
-  memcpy(rng->key, &rng->pool[silc_rng_get_position(rng)], sizeof(rng->key));
-
-  /* Second CFB pass */
-  for (i = 0; i < SILC_RNG_POOLSIZE; i += 20) {
-    silc_hash_transform(rng->sha1, iv, rng->key);
-
-    SILC_GET32_MSB(tmp, &rng->pool[i]);
-    iv[0] ^= tmp;
-    SILC_PUT32_MSB(iv[0], &rng->pool[i]);
-
-    SILC_GET32_MSB(tmp, &rng->pool[i + 4]);
-    iv[1] ^= tmp;
-    SILC_PUT32_MSB(iv[1], &rng->pool[i + 4]);
-
-    SILC_GET32_MSB(tmp, &rng->pool[i + 8]);
-    iv[2] ^= tmp;
-    SILC_PUT32_MSB(iv[2], &rng->pool[i + 8]);
-
-    SILC_GET32_MSB(tmp, &rng->pool[i + 12]);
-    iv[3] ^= tmp;
-    SILC_PUT32_MSB(iv[3], &rng->pool[i + 12]);
-
-    SILC_GET32_MSB(tmp, &rng->pool[i + 16]);
-    iv[4] ^= tmp;
-    SILC_PUT32_MSB(iv[4], &rng->pool[i + 16]);
-  }
-
-  memset(iv, 0, sizeof(iv));
-}
-
-/* Returns next position where data is fetched from the pool or
-   put to the pool. */
-
-static SilcUInt32 silc_rng_get_position(SilcRng rng)
-{
-  SilcRngState next;
-  SilcUInt32 pos;
-
-  next = rng->state->next;
-
-  pos = rng->state->pos++;
-  if ((next->low != 0 && pos >= next->low) || (pos >= SILC_RNG_POOLSIZE))
-    rng->state->pos = rng->state->low;
-
-#ifdef SILC_RNG_DEBUG
-    fprintf(stderr, "state: %p: low: %lu, pos: %lu\n",
-           rng->state, rng->state->low, rng->state->pos);
-#endif
-
-  rng->state = next;
-
-  return pos;
-}
-
-/* Returns random byte. */
-
-SilcUInt8 silc_rng_get_byte(SilcRng rng)
-{
-  SilcUInt8 byte;
-
-  rng->threshold++;
-
-  /* Get more soft noise after 64 bits threshold */
-  if (rng->threshold >= 8)
-    silc_rng_get_soft_noise(rng);
-
-  /* Get hard noise after 160 bits threshold, zero the threshold. */
-  if (rng->threshold >= 20) {
-    rng->threshold = 0;
-    silc_rng_get_hard_noise(rng);
-  }
-
-  do byte = rng->pool[silc_rng_get_position(rng)]; while (byte == 0x00);
-  return byte;
-}
-
-/* Return random byte as fast as possible. Reads from /dev/urandom if
-   available. If not then return from normal RNG (not so fast). */
-
-SilcUInt8 silc_rng_get_byte_fast(SilcRng rng)
-{
-#if defined(SILC_UNIX)
-  unsigned char buf[1];
-
-  if (rng->fd_devurandom == -1) {
-    rng->fd_devurandom = open("/dev/urandom", O_RDONLY);
-    if (rng->fd_devurandom < 0)
-      return silc_rng_get_byte(rng);
-    fcntl(rng->fd_devurandom, F_SETFL, O_NONBLOCK);
-  }
-
-  if (read(rng->fd_devurandom, buf, sizeof(buf)) < 0)
-    return silc_rng_get_byte(rng);
-
-  return buf[0] != 0x00 ? buf[0] : silc_rng_get_byte(rng);
-#else
-  return silc_rng_get_byte(rng);
-#endif
-}
-
-/* Returns 16 bit random number */
-
-SilcUInt16 silc_rng_get_rn16(SilcRng rng)
-{
-  unsigned char rn[2];
-  SilcUInt16 num;
-
-  rn[0] = silc_rng_get_byte(rng);
-  rn[1] = silc_rng_get_byte(rng);
-  SILC_GET16_MSB(num, rn);
-
-  return num;
-}
-
-/* Returns 32 bit random number */
-
-SilcUInt32 silc_rng_get_rn32(SilcRng rng)
-{
-  unsigned char rn[4];
-  SilcUInt32 num;
-
-  rn[0] = silc_rng_get_byte(rng);
-  rn[1] = silc_rng_get_byte(rng);
-  rn[2] = silc_rng_get_byte(rng);
-  rn[3] = silc_rng_get_byte(rng);
-  SILC_GET32_MSB(num, rn);
-
-  return num;
-}
-
-/* Returns non-zero random number string. Returned string is in HEX format. */
-
-unsigned char *silc_rng_get_rn_string(SilcRng rng, SilcUInt32 len)
-{
-  int i;
-  unsigned char *string;
-
-  string = silc_calloc((len * 2 + 1), sizeof(unsigned char));
-
-  for (i = 0; i < len; i++)
-    sprintf(string + 2 * i, "%02x", silc_rng_get_byte(rng));
-
-  return string;
-}
-
-/* Returns non-zero random number binary data. */
-
-unsigned char *silc_rng_get_rn_data(SilcRng rng, SilcUInt32 len)
-{
-  int i;
-  unsigned char *data;
-
-  data = silc_calloc(len + 1, sizeof(*data));
-
-  for (i = 0; i < len; i++)
-    data[i] = silc_rng_get_byte(rng);
-
-  return data;
-}
-
-/* Global RNG. This is global RNG that application can initialize so
-   that any part of code anywhere can use RNG without having to allocate
-   new RNG object everytime.  If this is not initialized then these routines
-   will fail.  Note: currently in SILC applications always initialize this. */
-
-SilcRng global_rng = NULL;
-
-/* Initialize global RNG. If `rng' is provided it is set as the global
-   RNG object (it can be allocated by the application for example). */
-
-SilcBool silc_rng_global_init(SilcRng rng)
-{
-  if (rng) {
-    global_rng = rng;
-    return TRUE;
-  }
-
-  global_rng = silc_rng_alloc();
-  silc_rng_init(global_rng);
-
-  return TRUE;
-}
-
-/* Uninitialize global RNG */
-
-SilcBool silc_rng_global_uninit(void)
-{
-  if (global_rng) {
-    silc_rng_free(global_rng);
-    global_rng = NULL;
-  }
-
-  return TRUE;
-}
-
-/* These are analogous to the functions above. */
-
-SilcUInt8 silc_rng_global_get_byte(void)
-{
-  return global_rng ? silc_rng_get_byte(global_rng) : 0;
-}
-
-/* Return random byte as fast as possible. Reads from /dev/urandom if
-   available. If not then return from normal RNG (not so fast). */
-
-SilcUInt8 silc_rng_global_get_byte_fast(void)
-{
-  return global_rng ? silc_rng_get_byte_fast(global_rng) : 0;
-}
-
-SilcUInt16 silc_rng_global_get_rn16(void)
-{
-  return global_rng ? silc_rng_get_rn16(global_rng) : 0;
-}
-
-SilcUInt32 silc_rng_global_get_rn32(void)
-{
-  return global_rng ? silc_rng_get_rn32(global_rng) : 0;
-}
-
-unsigned char *silc_rng_global_get_rn_string(SilcUInt32 len)
-{
-  return global_rng ? silc_rng_get_rn_string(global_rng, len) : NULL;
-}
-
-unsigned char *silc_rng_global_get_rn_data(SilcUInt32 len)
-{
-  return global_rng ? silc_rng_get_rn_data(global_rng, len) : NULL;
-}
-
-void silc_rng_global_add_noise(unsigned char *buffer, SilcUInt32 len)
-{
-  if (global_rng)
-    silc_rng_add_noise(global_rng, buffer, len);
-}
diff --git a/lib/silccrypt/silcrng.h b/lib/silccrypt/silcrng.h
deleted file mode 100644 (file)
index b4deeb8..0000000
+++ /dev/null
@@ -1,359 +0,0 @@
-/*
-
-  silcrng.h
-
-  Author: Pekka Riikonen <priikone@silcnet.org>
-
-  Copyright (C) 1997 - 2003 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.
-
-*/
-
-/****h* silccrypt/SILC RNG Interface
- *
- * DESCRIPTION
- *
- * SILC Random Number Generator is cryptographically strong pseudo random
- * number generator. It is used to generate all the random numbers needed
- * in the SILC sessions. All key material and other sources needing random
- * numbers use this generator.
- *
- * The interface provides functions for retrieving different size of
- * random number and arbitrary length of random data buffers. The interface
- * also defines Global RNG API which makes it possible to call any
- * RNG API function without specific RNG context.
- *
- ***/
-
-#ifndef SILCRNG_H
-#define SILCRNG_H
-
-/****s* silccrypt/SilcRNGAPI/SilcRng
- *
- * NAME
- *
- *    typedef struct SilcRngStruct *SilcRng;
- *
- * DESCRIPTION
- *
- *    This context is the actual Random Number Generator and is allocated
- *    by silc_rng_alloc and given as argument usually to all silc_rng_*
- *    functions.  It is freed by the silc_rng_free function.  The RNG is
- *    initialized by calling the silc_rng_init function.
- *
- ***/
-typedef struct SilcRngStruct *SilcRng;
-
-/* Prototypes */
-
-/****f* silccrypt/SilcRNGAPI/silc_rng_alloc
- *
- * SYNOPSIS
- *
- *    SilcRng silc_rng_alloc(void);
- *
- * DESCRIPTION
- *
- *    Allocates new SILC random number generator and returns context to
- *    it.  After the RNG is allocated it must be initialized by calling
- *    silc_rng_init before it actually can be used to produce any random
- *    number.  This function returns NULL if RNG could not allocated.
- *
- ***/
-SilcRng silc_rng_alloc(void);
-
-/****f* silccrypt/SilcRNGAPI/silc_rng_free
- *
- * SYNOPSIS
- *
- *    void silc_rng_free(SilcRng rng);
- *
- * DESCRIPTION
- *
- *    Frees the random number generator and destroys the random number
- *    pool.
- *
- ***/
-void silc_rng_free(SilcRng rng);
-
-/****f* silccrypt/SilcRNGAPI/silc_rng_init
- *
- * SYNOPSIS
- *
- *    void silc_rng_init(SilcRng rng);
- *
- * DESCRIPTION
- *
- *    This function is used to initialize the random number generator.
- *    This is the function that must be called after the RNG is allocated
- *    by calling silc_rng_alloc.  RNG cannot be used before this function
- *    is called.
- *
- * NOTES
- *
- *    This function may be slow since it will acquire secret noise from
- *    the environment in an attempt to set the RNG in unguessable state.
- *
- ***/
-void silc_rng_init(SilcRng rng);
-
-/****f* silccrypt/SilcRNGAPI/silc_rng_get_byte
- *
- * SYNOPSIS
- *
- *    SilcUInt8 silc_rng_get_byte(SilcRng rng);
- *
- * DESCRIPTION
- *
- *    Returns one 8-bit random byte from the random number generator.
- *
- ***/
-SilcUInt8 silc_rng_get_byte(SilcRng rng);
-
-/****f* silccrypt/SilcRNGAPI/silc_rng_get_byte_fast
- *
- * SYNOPSIS
- *
- *    SilcUInt8 silc_rng_get_byte_fast(SilcRng rng);
- *
- * DESCRIPTION
- *
- *    Returns one 8-bit random byte from the random number generator as
- *    fast as possible.
- *
- * NOTES
- *
- *    This will read the data from /dev/urandom if it is available in the
- *    operating system, since this may be faster than retrieving a byte
- *    from the SILC RNG.  If /dev/urandom is not available this will take
- *    the byte from SILC RNG and is effectively same as silc_rng_get_byte.
- *
- ***/
-SilcUInt8 silc_rng_get_byte_fast(SilcRng rng);
-
-/****f* silccrypt/SilcRNGAPI/silc_rng_get_rn16
- *
- * SYNOPSIS
- *
- *    SilcUInt16 silc_rng_get_rn16(SilcRng rng);
- *
- * DESCRIPTION
- *
- *    Returns one 16-bit random number from the random number generator.
- *
- ***/
-SilcUInt16 silc_rng_get_rn16(SilcRng rng);
-
-/****f* silccrypt/SilcRNGAPI/silc_rng_get_rn32
- *
- * SYNOPSIS
- *
- *    SilcUInt32 silc_rng_get_rn32(SilcRng rng);
- *
- * DESCRIPTION
- *
- *    Returns one 32-bit random number from the random number generator.
- *
- ***/
-SilcUInt32 silc_rng_get_rn32(SilcRng rng);
-
-/****f* silccrypt/SilcRNGAPI/silc_rng_get_rn_string
- *
- * SYNOPSIS
- *
- *    unsigned char *silc_rng_get_rn_string(SilcRng rng, SilcUInt32 len);
- *
- * DESCRIPTION
- *
- *    Returns random string in HEX form of the length of `len' bytes.
- *    The caller must free returned data buffer.  It is guaranteed the
- *    data string goes not include any zero (0x00) bytes.
- *
- ***/
-unsigned char *silc_rng_get_rn_string(SilcRng rng, SilcUInt32 len);
-
-/****f* silccrypt/SilcRNGAPI/silc_rng_get_rn_data
- *
- * SYNOPSIS
- *
- *    unsigned char *silc_rng_get_rn_data(SilcRng rng, SilcUInt32 len);
- *
- * DESCRIPTION
- *
- *    Returns random binary data of the length of `len' bytes.  The
- *    caller must free returned data buffer.  It is guaranteed the data
- *    buffer does not include any zero (0x00) bytes.
- *
- ***/
-unsigned char *silc_rng_get_rn_data(SilcRng rng, SilcUInt32 len);
-
-/****f* silccrypt/SilcRNGAPI/silc_rng_add_noise
- *
- * SYNOPSIS
- *
- *    void silc_rng_add_noise(SilcRng rng, unsigned char *buffer, SilcUInt32 len);
- *
- * DESCRIPTION
- *
- *    Add the data buffer indicated by `buffer' of length of `len' bytes
- *    as noise to the random number generator.  The random number generator
- *    is restirred (reseeded) when this function is called.
- *
- ***/
-void silc_rng_add_noise(SilcRng rng, unsigned char *buffer, SilcUInt32 len);
-
-/****f* silccrypt/SilcRNGAPI/silc_rng_global_init
- *
- * SYNOPSIS
- *
- *    SilcBool silc_rng_global_init(SilcRng rng);
- *
- * DESCRIPTION
- *
- *    This function sets the `rng' if non-NULL as global RNG context.
- *    When any of the silc_rng_global_* functions is called the `rng' is
- *    used as RNG.  If `rng' is NULL this will allocate new RNG as global
- *    RNG.  The application in this case must free it later by calling
- *    silc_rng_global_uninit.  Returns TRUE after Global RNG is initialized.
- *
- * NOTES
- *
- *    If `rng' was non-NULL, the silc_rng_init must have been called for
- *    the `rng' already.
- *
- *    This function can be used to define the `rng' as global RNG and then
- *    use silc_rng_global_* functions easily without need to provide
- *    the RNG as argument.
- *
- ***/
-SilcBool silc_rng_global_init(SilcRng rng);
-
-/****f* silccrypt/SilcRNGAPI/silc_rng_global_uninit
- *
- * SYNOPSIS
- *
- *    SilcBool silc_rng_global_uninit(void);
- *
- * DESCRIPTION
- *
- *    Uninitialized the Global RNG object and frees it.  This should not
- *    be called if silc_rng_global_init was called with non-NULL RNG.
- *
- ***/
-SilcBool silc_rng_global_uninit(void);
-
-/****f* silccrypt/SilcRNGAPI/silc_rng_global_get_byte
- *
- * SYNOPSIS
- *
- *    SilcUInt8 silc_rng_global_get_byte(void);
- *
- * DESCRIPTION
- *
- *    Returns one 8-bit random byte from the random number generator.
- *
- ***/
-SilcUInt8 silc_rng_global_get_byte(void);
-
-/****f* silccrypt/SilcRNGAPI/silc_rng_global_get_byte_fast
- *
- * SYNOPSIS
- *
- *    SilcUInt8 silc_rng_global_get_byte_fast(void);
- *
- * DESCRIPTION
- *
- *    Returns one 8-bit random byte from the random number generator as
- *    fast as possible.
- *
- * NOTES
- *
- *    This will read the data from /dev/urandom if it is available in the
- *    operating system, since this may be faster than retrieving a byte
- *    from the SILC RNG.  If /dev/urandom is not available this will take
- *    the byte from SILC RNG and is effectively same as silc_rng_get_byte.
- *
- ***/
-SilcUInt8 silc_rng_global_get_byte_fast(void);
-
-/****f* silccrypt/SilcRNGAPI/silc_rng_global_get_rn16
- *
- * SYNOPSIS
- *
- *    SilcUInt16 silc_rng_global_get_rn16(void);
- *
- * DESCRIPTION
- *
- *    Returns one 16-bit random number from the random number generator.
- *
- ***/
-SilcUInt16 silc_rng_global_get_rn16(void);
-
-/****f* silccrypt/SilcRNGAPI/silc_rng_global_get_rn32
- *
- * SYNOPSIS
- *
- *    SilcUInt32 silc_rng_global_get_rn32(void);
- *
- * DESCRIPTION
- *
- *    Returns one 32-bit random number from the random number generator.
- *
- ***/
-SilcUInt32 silc_rng_global_get_rn32(void);
-
-/****f* silccrypt/SilcRNGAPI/silc_rng_global_get_rn_string
- *
- * SYNOPSIS
- *
- *    unsigned char *silc_rng_global_get_rn_string(SilcUInt32 len);
- *
- * DESCRIPTION
- *
- *    Returns random string in HEX form of the length of `len' bytes.
- *    The caller must free returned data buffer.  It is guaranteed the
- *    data string goes not include any zero (0x00) bytes.
- *
- ***/
-unsigned char *silc_rng_global_get_rn_string(SilcUInt32 len);
-
-/****f* silccrypt/SilcRNGAPI/silc_rng_global_get_rn_data
- *
- * SYNOPSIS
- *
- *    unsigned char *silc_rng_global_get_rn_data(SilcUInt32 len);
- *
- * DESCRIPTION
- *
- *    Returns random binary data of the length of `len' bytes.  The
- *    caller must free returned data buffer.  It is guaranteed the data
- *    buffer does not include any zero (0x00) bytes.
- *
- ***/
-unsigned char *silc_rng_global_get_rn_data(SilcUInt32 len);
-
-/****f* silccrypt/SilcRNGAPI/silc_rng_global_add_noise
- *
- * SYNOPSIS
- *
- *    void silc_rng_global_add_noise(unsigned char *buffer, SilcUInt32 len);
- *
- * DESCRIPTION
- *
- *    Add the data buffer indicated by `buffer' of length of `len' bytes
- *    as noise to the random number generator.  The random number generator
- *    is restirred (reseeded) when this function is called.
- *
- ***/
-
-void silc_rng_global_add_noise(unsigned char *buffer, SilcUInt32 len);
-
-#endif
diff --git a/lib/silccrypt/tests/Makefile.am b/lib/silccrypt/tests/Makefile.am
deleted file mode 100644 (file)
index 84e1e02..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-#
-#  Makefile.am
-#
-#  Author: Pekka Riikonen <priikone@silcnet.org>
-#
-#  Copyright (C) 2002 - 2003 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.
-#
-
-AUTOMAKE_OPTIONS = 1.0 no-dependencies foreign
-
-bin_PROGRAMS =         test_sha1       \
-               test_sha256     \
-               test_md5        \
-               test_hmacsha1   \
-               test_hmacsha256 \
-               test_hmacmd5    \
-               test_aes        \
-               test_twofish    \
-               test_silcpkcs
-
-test_sha1_SOURCES = test_sha1.c
-test_sha256_SOURCES = test_sha256.c
-test_md5_SOURCES = test_md5.c
-test_hmacsha1_SOURCES = test_hmacsha1.c
-test_hmacsha256_SOURCES = test_hmacsha256.c
-test_hmacmd5_SOURCES = test_hmacmd5.c
-
-test_aes_SOURCES = test_aes.c
-test_twofish_SOURCES = test_aes.c
-
-test_silcpkcs_SOURCES = test_silcpkcs.c
-
-LIBS = $(SILC_COMMON_LIBS)
-LDADD = -L.. -L../.. -lsilc
-
-include $(top_srcdir)/Makefile.defines.in
diff --git a/lib/silccrypt/tests/test_aes.c b/lib/silccrypt/tests/test_aes.c
deleted file mode 100644 (file)
index 0a10459..0000000
+++ /dev/null
@@ -1,254 +0,0 @@
-
-#include "silc.h"
-
-/* Test vectors from RFC3602. */
-
-/* First test vector, 16 bytes plaintext, 128 bits key */
-const unsigned char key1[] = "\x06\xa9\x21\x40\x36\xb8\xa1\x5b\x51\x2e\x03\xd5\x34\x12\x00\x06";
-int key1_len = 16 * 8;
-const unsigned char iv1[] = "\x3d\xaf\xba\x42\x9d\x9e\xb4\x30\xb4\x22\xda\x80\x2c\x9f\xac\x41";
-const unsigned char p1[] = "Single block msg";
-int p1_len = 16;
-const unsigned char c1[] = "\xe3\x53\x77\x9c\x10\x79\xae\xb8\x27\x08\x94\x2d\xbe\x77\x18\x1a";
-
-/* Second test vector, 32 bytes plaintext, 128 bits key */
-const unsigned char key2[] = "\xc2\x86\x69\x6d\x88\x7c\x9a\xa0\x61\x1b\xbb\x3e\x20\x25\xa4\x5a";
-int key2_len = 16 * 8;
-const unsigned char iv2[] = "\x56\x2e\x17\x99\x6d\x09\x3d\x28\xdd\xb3\xba\x69\x5a\x2e\x6f\x58";
-const unsigned char p2[] = "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f";
-int p2_len = 32;
-const unsigned char c2[] = "\xd2\x96\xcd\x94\xc2\xcc\xcf\x8a\x3a\x86\x30\x28\xb5\xe1\xdc\x0a\x75\x86\x60\x2d\x25\x3c\xff\xf9\x1b\x82\x66\xbe\xa6\xd6\x1a\xb1";
-
-/* CTR test vectors from RFC3686. */
-
-/* 16 bytes plaintext, 128 bits key */
-const unsigned char key3[] = "\xAE\x68\x52\xF8\x12\x10\x67\xCC\x4B\xF7\xA5\x76\x55\x77\xF3\x9E";
-int key3_len = 16 * 8;
-const unsigned char iv3[] = "\x00\x00\x00\x30\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00";
-const unsigned char p3[] = "Single block msg";
-int p3_len = 16;
-const unsigned char c3[] = "\xE4\x09\x5D\x4F\xB7\xA7\xB3\x79\x2D\x61\x75\xA3\x26\x13\x11\xB8";
-
-/* 32 bytes plaintext, 128 bits key */
-const unsigned char key4[] = "\x7E\x24\x06\x78\x17\xFA\xE0\xD7\x43\xD6\xCE\x1F\x32\x53\x91\x63";
-int key4_len = 16 * 8;
-const unsigned char iv4[] = "\x00\x6C\xB6\xDB\xC0\x54\x3B\x59\xDA\x48\xD9\x0B\x00\x00\x00\x00";
-const unsigned char p4[] = "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0A\x0B\x0C\x0D\x0E\x0F\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1A\x1B\x1C\x1D\x1E\x1F";
-int p4_len = 32;
-const unsigned char c4[] = "\x51\x04\xA1\x06\x16\x8A\x72\xD9\x79\x0D\x41\xEE\x8E\xDA\xD3\x88\xEB\x2E\x1E\xFC\x46\xDA\x57\xC8\xFC\xE6\x30\xDF\x91\x41\xBE\x28";
-
-/* 36 bytes plaintext, 256 bits key */
-const unsigned char key5[] = "\xFF\x7A\x61\x7C\xE6\x91\x48\xE4\xF1\x72\x6E\x2F\x43\x58\x1D\xE2\xAA\x62\xD9\xF8\x05\x53\x2E\xDF\xF1\xEE\xD6\x87\xFB\x54\x15\x3D";
-int key5_len = 32 * 8;
-const unsigned char iv5[] = "\x00\x1C\xC5\xB7\x51\xA5\x1D\x70\xA1\xC1\x11\x48\x00\x00\x00\x00";
-const unsigned char p5[] = "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0A\x0B\x0C\x0D\x0E\x0F\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1A\x1B\x1C\x1D\x1E\x1F\x20\x21\x22\x23";
-int p5_len = 36;
-const unsigned char c5[] = "\xEB\x6C\x52\x82\x1D\x0B\xBB\xF7\xCE\x75\x94\x46\x2A\xCA\x4F\xAA\xB4\x07\xDF\x86\x65\x69\xFD\x07\xF4\x8C\xC0\xB5\x83\xD6\x07\x1F\x1E\xC0\xE6\xB8";
-
-int main(int argc, char **argv)
-{
-  SilcBool success = FALSE;
-  SilcCipher cipher, cipher2;
-  unsigned char dst[256], pdst[256];
-  int i;
-
-  if (argc > 1 && !strcmp(argv[1], "-d")) {
-    silc_log_debug(TRUE);
-    silc_log_debug_hexdump(TRUE);
-    silc_log_set_debug_string("*crypt*,*aes*,*cipher*");
-  }
-
-  SILC_LOG_DEBUG(("Registering builtin hash functions"));
-  silc_cipher_register_default();
-
-  SILC_LOG_DEBUG(("Allocating AES-CBC cipher"));
-  if (!silc_cipher_alloc("aes-128-cbc", &cipher)) {
-    SILC_LOG_DEBUG(("Allocating AES-CBC cipher failed"));
-    goto err;
-  }
-  if (!silc_cipher_alloc("aes-128-cbc", &cipher2)) {
-    SILC_LOG_DEBUG(("Allocating AES-CBC cipher failed"));
-    goto err;
-  }
-
-  /* First test vector */
-  SILC_LOG_DEBUG(("First test vector"));
-  memset(dst, 0, sizeof(dst));
-  memset(pdst, 0, sizeof(pdst));
-  silc_cipher_set_iv(cipher, iv1);
-  assert(silc_cipher_set_key(cipher, key1, key1_len, TRUE));
-  assert(silc_cipher_set_key(cipher2, key1, key1_len, FALSE));
-  assert(silc_cipher_encrypt(cipher, p1, dst, p1_len, NULL));
-  SILC_LOG_DEBUG(("block len %d, key len %d, name %s",
-                silc_cipher_get_block_len(cipher),
-                silc_cipher_get_key_len(cipher),
-                silc_cipher_get_name(cipher)));
-  SILC_LOG_HEXDUMP(("Plaintext"), (unsigned char *)p1, p1_len);
-  SILC_LOG_HEXDUMP(("Ciphertext"), (unsigned char *)dst, p1_len);
-  SILC_LOG_HEXDUMP(("Expected ciphertext"), (unsigned char *)c1, p1_len);
-  if (memcmp(dst, c1, p1_len)) {
-    SILC_LOG_DEBUG(("Encrypt failed"));
-    goto err;
-  }
-  SILC_LOG_DEBUG(("Encrypt is successful"));
-  silc_cipher_set_iv(cipher2, iv1);
-  assert(silc_cipher_decrypt(cipher2, dst, pdst, p1_len, NULL));
-  SILC_LOG_HEXDUMP(("Decrypted plaintext"), (unsigned char *)pdst, p1_len);
-  SILC_LOG_HEXDUMP(("Expected plaintext"), (unsigned char *)p1, p1_len);
-  if (memcmp(pdst, p1, p1_len)) {
-    SILC_LOG_DEBUG(("Decrypt failed"));
-    goto err;
-  }
-  SILC_LOG_DEBUG(("Decrypt is successful"));
-
-
-  /* Second test vector */
-  SILC_LOG_DEBUG(("Second test vector"));
-  memset(dst, 0, sizeof(dst));
-  memset(pdst, 0, sizeof(pdst));
-  silc_cipher_set_iv(cipher, iv2);
-  assert(silc_cipher_set_key(cipher, key2, key2_len, TRUE));
-  assert(silc_cipher_set_key(cipher2, key2, key2_len, FALSE));
-  assert(silc_cipher_encrypt(cipher, p2, dst, p2_len, NULL));
-  SILC_LOG_DEBUG(("block len %d, key len %d, name %s",
-                silc_cipher_get_block_len(cipher),
-                silc_cipher_get_key_len(cipher),
-                silc_cipher_get_name(cipher)));
-  SILC_LOG_HEXDUMP(("Plaintext"), (unsigned char *)p2, p2_len);
-  SILC_LOG_HEXDUMP(("Ciphertext"), (unsigned char *)dst, p2_len);
-  SILC_LOG_HEXDUMP(("Expected ciphertext"), (unsigned char *)c2, p2_len);
-  if (memcmp(dst, c2, p2_len)) {
-    SILC_LOG_DEBUG(("Encrypt failed"));
-    goto err;
-  }
-  SILC_LOG_DEBUG(("Encrypt is successful"));
-  silc_cipher_set_iv(cipher2, iv2);
-  assert(silc_cipher_decrypt(cipher2, dst, pdst, p2_len, NULL));
-  SILC_LOG_HEXDUMP(("Decrypted plaintext"), (unsigned char *)pdst, p2_len);
-  SILC_LOG_HEXDUMP(("Expected plaintext"), (unsigned char *)p2, p2_len);
-  if (memcmp(pdst, p2, p2_len)) {
-    SILC_LOG_DEBUG(("Decrypt failed"));
-    goto err;
-  }
-  SILC_LOG_DEBUG(("Decrypt is successful"));
-  silc_cipher_free(cipher);
-  silc_cipher_free(cipher2);
-
-
-  SILC_LOG_DEBUG(("Allocating aes-128-ctr cipher"));
-  if (!silc_cipher_alloc("aes-128-ctr", &cipher)) {
-    SILC_LOG_DEBUG(("Allocating aes-128-ctr cipher failed"));
-    goto err;
-  }
-
-  /* Third test vector */
-  SILC_LOG_DEBUG(("Third test vector"));
-  memset(dst, 0, sizeof(dst));
-  memset(pdst, 0, sizeof(pdst));
-  silc_cipher_set_iv(cipher, iv3);
-  assert(silc_cipher_set_key(cipher, key3, key3_len, TRUE));
-  assert(silc_cipher_encrypt(cipher, p3, dst, p3_len, NULL));
-  SILC_LOG_DEBUG(("block len %d, key len %d, name %s",
-                silc_cipher_get_block_len(cipher),
-                silc_cipher_get_key_len(cipher),
-                silc_cipher_get_name(cipher)));
-  SILC_LOG_HEXDUMP(("Plaintext"), (unsigned char *)p3, p3_len);
-  SILC_LOG_HEXDUMP(("Ciphertext"), (unsigned char *)dst, p3_len);
-  SILC_LOG_HEXDUMP(("Expected ciphertext"), (unsigned char *)c3, p3_len);
-  if (memcmp(dst, c3, p3_len)) {
-    SILC_LOG_DEBUG(("Encrypt failed"));
-    goto err;
-  }
-  SILC_LOG_DEBUG(("Encrypt is successful"));
-  silc_cipher_set_iv(cipher, iv3);
-  assert(silc_cipher_decrypt(cipher, dst, pdst, p3_len, NULL));
-  SILC_LOG_HEXDUMP(("Decrypted plaintext"), (unsigned char *)pdst, p3_len);
-  SILC_LOG_HEXDUMP(("Expected plaintext"), (unsigned char *)p3, p3_len);
-  if (memcmp(pdst, p3, p3_len)) {
-    SILC_LOG_DEBUG(("Decrypt failed"));
-    goto err;
-  }
-  SILC_LOG_DEBUG(("Decrypt is successful"));
-
-
-  /* Fourth test vector */
-  SILC_LOG_DEBUG(("Fourth test vector"));
-  memset(dst, 0, sizeof(dst));
-  memset(pdst, 0, sizeof(pdst));
-  silc_cipher_set_iv(cipher, iv4);
-  assert(silc_cipher_set_key(cipher, key4, key4_len, TRUE));
-  assert(silc_cipher_encrypt(cipher, p4, dst, p4_len, NULL));
-  SILC_LOG_DEBUG(("block len %d, key len %d, name %s",
-                silc_cipher_get_block_len(cipher),
-                silc_cipher_get_key_len(cipher),
-                silc_cipher_get_name(cipher)));
-  SILC_LOG_HEXDUMP(("Plaintext"), (unsigned char *)p4, p4_len);
-  SILC_LOG_HEXDUMP(("Ciphertext"), (unsigned char *)dst, p4_len);
-  SILC_LOG_HEXDUMP(("Expected ciphertext"), (unsigned char *)c4, p4_len);
-  if (memcmp(dst, c4, p4_len)) {
-    SILC_LOG_DEBUG(("Encrypt failed"));
-    goto err;
-  }
-  SILC_LOG_DEBUG(("Encrypt is successful"));
-  silc_cipher_set_iv(cipher, iv4);
-  assert(silc_cipher_decrypt(cipher, dst, pdst, p4_len, NULL));
-  SILC_LOG_HEXDUMP(("Decrypted plaintext"), (unsigned char *)pdst, p4_len);
-  SILC_LOG_HEXDUMP(("Expected plaintext"), (unsigned char *)p4, p4_len);
-  if (memcmp(pdst, p4, p4_len)) {
-    SILC_LOG_DEBUG(("Decrypt failed"));
-    goto err;
-  }
-  SILC_LOG_DEBUG(("Decrypt is successful"));
-  silc_cipher_free(cipher);
-
-  SILC_LOG_DEBUG(("Allocating aes-256-ctr cipher"));
-  if (!silc_cipher_alloc("aes-256-ctr", &cipher)) {
-    SILC_LOG_DEBUG(("Allocating aes-256-ctr cipher failed"));
-    goto err;
-  }
-  if (!silc_cipher_alloc("aes-256-ctr", &cipher2)) {
-    SILC_LOG_DEBUG(("Allocating aes-256-ctr cipher failed"));
-    goto err;
-  }
-
-  /* Fifth test vector */
-  SILC_LOG_DEBUG(("Fifth test vector"));
-  memset(dst, 0, sizeof(dst));
-  memset(pdst, 0, sizeof(pdst));
-  silc_cipher_set_iv(cipher, iv5);
-  assert(silc_cipher_set_key(cipher, key5, key5_len, TRUE));
-  assert(silc_cipher_set_key(cipher2, key5, key5_len, FALSE));
-  assert(silc_cipher_encrypt(cipher, p5, dst, p5_len, NULL));
-  SILC_LOG_DEBUG(("block len %d, key len %d, name %s",
-                silc_cipher_get_block_len(cipher),
-                silc_cipher_get_key_len(cipher),
-                silc_cipher_get_name(cipher)));
-  SILC_LOG_HEXDUMP(("Plaintext"), (unsigned char *)p5, p5_len);
-  SILC_LOG_HEXDUMP(("Ciphertext"), (unsigned char *)dst, p5_len);
-  SILC_LOG_HEXDUMP(("Expected ciphertext"), (unsigned char *)c5, p5_len);
-  if (memcmp(dst, c5, p5_len)) {
-    SILC_LOG_DEBUG(("Encrypt failed"));
-    goto err;
-  }
-  SILC_LOG_DEBUG(("Encrypt is successful"));
-  silc_cipher_set_iv(cipher2, iv5);
-  assert(silc_cipher_decrypt(cipher2, dst, pdst, p5_len, NULL));
-  SILC_LOG_HEXDUMP(("Decrypted plaintext"), (unsigned char *)pdst, p5_len);
-  SILC_LOG_HEXDUMP(("Expected plaintext"), (unsigned char *)p5, p5_len);
-  if (memcmp(pdst, p5, p5_len)) {
-    SILC_LOG_DEBUG(("Decrypt failed"));
-    goto err;
-  }
-  SILC_LOG_DEBUG(("Decrypt is successful"));
-  silc_cipher_free(cipher2);
-
-  success = TRUE;
-
- err:
-  SILC_LOG_DEBUG(("Testing was %s", success ? "SUCCESS" : "FAILURE"));
-  fprintf(stderr, "Testing was %s\n", success ? "SUCCESS" : "FAILURE");
-
-  silc_cipher_free(cipher);
-  silc_cipher_unregister_all();
-  return success;
-}
diff --git a/lib/silccrypt/tests/test_hmacmd5.c b/lib/silccrypt/tests/test_hmacmd5.c
deleted file mode 100644 (file)
index 8b41389..0000000
+++ /dev/null
@@ -1,124 +0,0 @@
-#include "silc.h"
-
-/* Test vectors from RFC 2202 */
-
-/* First test vector */
-const unsigned char key1[] = "\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b";
-int key1_len = 16;
-const unsigned char data1[] = "Hi There";
-const unsigned char data1_digest[] = "\x92\x94\x72\x7a\x36\x38\xbb\x1c\x13\xf4\x8e\xf8\x15\x8b\xfc\x9d";
-
-/* Second test vector */
-const unsigned char key2[] = "Jefe";
-int key2_len = 4;
-const unsigned char data2[] = "what do ya want for nothing?";
-const unsigned char data2_digest[] = "\x75\x0c\x78\x3e\x6a\xb0\xb5\x03\xea\xa8\x6e\x31\x0a\x5d\xb7\x38";
-
-/* Third test vector, data 0xdd repeated 50 times */
-const unsigned char key3[] = "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa";
-int key3_len = 16;
-unsigned char data3[50];
-const unsigned char data3_digest[] = "\x56\xbe\x34\x52\x1d\x14\x4c\x88\xdb\xb8\xc7\x33\xf0\xe8\xb3\xf6";
-
-/* Fourth test vector, key 0xaa 80 times */
-unsigned char key4[80];
-int key4_len = 80;
-const unsigned char data4[] = "Test Using Larger Than Block-Size Key and Larger Than One Block-Size Data";
-const unsigned char data4_digest[] = "\x6f\x63\x0f\xad\x67\xcd\xa0\xee\x1f\xb1\xf5\x62\xdb\x3a\xa5\x3e";
-
-int main(int argc, char **argv)
-{
-  SilcBool success = FALSE;
-  unsigned char digest[16];
-  SilcUInt32 len;
-  SilcHmac hmac;
-  
-  if (argc > 1 && !strcmp(argv[1], "-d")) {
-    silc_log_debug(TRUE);
-    silc_log_debug_hexdump(TRUE);
-    silc_log_set_debug_string("*crypt*,*hash*,*md5*,*hmac*");
-  }
-
-  SILC_LOG_DEBUG(("Registering builtin hash functions"));
-  silc_hash_register_default();
-  silc_hmac_register_default();
-
-  SILC_LOG_DEBUG(("Allocating md5 HMAC"));
-  if (!silc_hmac_alloc("hmac-md5", NULL, &hmac)) {
-    SILC_LOG_DEBUG(("Allocating md5 HMAC failed"));
-    goto err;
-  }
-
-  /* First test vector */
-  SILC_LOG_DEBUG(("First test vector"));
-  silc_hmac_init_with_key(hmac, key1, key1_len);
-  silc_hmac_update(hmac, data1, strlen(data1));
-  silc_hmac_final(hmac, digest, &len);
-  SILC_LOG_HEXDUMP(("Key"), (unsigned char *)key1, key1_len);
-  SILC_LOG_HEXDUMP(("Message"), (unsigned char *)data1, strlen(data1));
-  SILC_LOG_HEXDUMP(("Digest"), digest, len);
-  SILC_LOG_HEXDUMP(("Expected digest"), (unsigned char *)data1_digest, len);
-  if (memcmp(digest, data1_digest, len)) {
-    SILC_LOG_DEBUG(("HMAC failed"));
-    goto err;
-  }
-  SILC_LOG_DEBUG(("HMAC is successful"));
-  
-  /* Second test vector */
-  SILC_LOG_DEBUG(("Second test vector"));
-  silc_hmac_init_with_key(hmac, key2, key2_len);
-  silc_hmac_update(hmac, data2, strlen(data2));
-  silc_hmac_final(hmac, digest, &len);
-  SILC_LOG_HEXDUMP(("Key"), (unsigned char *)key2, key2_len);
-  SILC_LOG_HEXDUMP(("Message"), (unsigned char *)data2, strlen(data2));
-  SILC_LOG_HEXDUMP(("Digest"), digest, len);
-  SILC_LOG_HEXDUMP(("Expected digest"), (unsigned char *)data2_digest, len);
-  if (memcmp(digest, data2_digest, len)) {
-    SILC_LOG_DEBUG(("HMAC failed"));
-    goto err;
-  }
-  SILC_LOG_DEBUG(("HMAC is successful"));
-  
-  /* Third test vector */
-  SILC_LOG_DEBUG(("Third test vector"));
-  silc_hmac_init_with_key(hmac, key3, key3_len);
-  memset(data3, '\xdd', sizeof(data3));
-  silc_hmac_update(hmac, data3, sizeof(data3));
-  silc_hmac_final(hmac, digest, &len);
-  SILC_LOG_HEXDUMP(("Key"), (unsigned char *)key3, key3_len);
-  SILC_LOG_HEXDUMP(("Message"), (unsigned char *)data3, sizeof(data3));
-  SILC_LOG_HEXDUMP(("Digest"), digest, len);
-  SILC_LOG_HEXDUMP(("Expected digest"), (unsigned char *)data3_digest, len);
-  if (memcmp(digest, data3_digest, len)) {
-    SILC_LOG_DEBUG(("HMAC failed"));
-    goto err;
-  }
-  SILC_LOG_DEBUG(("HMAC is successful"));
-  
-  /* Fourth test vector */
-  SILC_LOG_DEBUG(("Fourth test vector"));
-  memset(key4, '\xaa', key4_len);
-  silc_hmac_init_with_key(hmac, key4, key4_len);
-  silc_hmac_update(hmac, data4, strlen(data4));
-  silc_hmac_final(hmac, digest, &len);
-  SILC_LOG_HEXDUMP(("Key"), (unsigned char *)key4, key4_len);
-  SILC_LOG_HEXDUMP(("Message"), (unsigned char *)data4, sizeof(data4));
-  SILC_LOG_HEXDUMP(("Digest"), digest, len);
-  SILC_LOG_HEXDUMP(("Expected digest"), (unsigned char *)data4_digest, len);
-  if (memcmp(digest, data4_digest, len)) {
-    SILC_LOG_DEBUG(("HMAC failed"));
-    goto err;
-  }
-  SILC_LOG_DEBUG(("HMAC is successful"));
-  
-  success = TRUE;
-  
- err:
-  SILC_LOG_DEBUG(("Testing was %s", success ? "SUCCESS" : "FAILURE"));
-  fprintf(stderr, "Testing was %s\n", success ? "SUCCESS" : "FAILURE");
-
-  silc_hmac_free(hmac);
-  silc_hash_unregister_all();
-  silc_hmac_unregister_all();
-  return success;
-}
diff --git a/lib/silccrypt/tests/test_hmacsha1.c b/lib/silccrypt/tests/test_hmacsha1.c
deleted file mode 100644 (file)
index 8874534..0000000
+++ /dev/null
@@ -1,124 +0,0 @@
-#include "silc.h"
-
-/* Test vectors from RFC 2202 */
-
-/* First test vector */
-const unsigned char key1[] = "\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b";
-int key1_len = 20;
-const unsigned char data1[] = "Hi There";
-const unsigned char data1_digest[] = "\xb6\x17\x31\x86\x55\x05\x72\x64\xe2\x8b\xc0\xb6\xfb\x37\x8c\x8e\xf1\x46\xbe\x00";
-
-/* Second test vector */
-const unsigned char key2[] = "Jefe";
-int key2_len = 4;
-const unsigned char data2[] = "what do ya want for nothing?";
-const unsigned char data2_digest[] = "\xef\xfc\xdf\x6a\xe5\xeb\x2f\xa2\xd2\x74\x16\xd5\xf1\x84\xdf\x9c\x25\x9a\x7c\x79";
-
-/* Third test vector, data 0xdd repeated 50 times */
-const unsigned char key3[] = "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa";
-int key3_len = 20;
-unsigned char data3[50];
-const unsigned char data3_digest[] = "\x12\x5d\x73\x42\xb9\xac\x11\xcd\x91\xa3\x9a\xf4\x8a\xa1\x7b\x4f\x63\xf1\x75\xd3";
-
-/* Fourth test vector, key 0xaa 80 times */
-unsigned char key4[80];
-int key4_len = 80;
-const unsigned char data4[] = "Test Using Larger Than Block-Size Key and Larger Than One Block-Size Data";
-const unsigned char data4_digest[] = "\xe8\xe9\x9d\x0f\x45\x23\x7d\x78\x6d\x6b\xba\xa7\x96\x5c\x78\x08\xbb\xff\x1a\x91";
-
-int main(int argc, char **argv)
-{
-  SilcBool success = FALSE;
-  unsigned char digest[20];
-  SilcUInt32 len;
-  SilcHmac hmac;
-  
-  if (argc > 1 && !strcmp(argv[1], "-d")) {
-    silc_log_debug(TRUE);
-    silc_log_debug_hexdump(TRUE);
-    silc_log_set_debug_string("*crypt*,*hash*,*sha1*,*hmac*");
-  }
-
-  SILC_LOG_DEBUG(("Registering builtin hash functions"));
-  silc_hash_register_default();
-  silc_hmac_register_default();
-
-  SILC_LOG_DEBUG(("Allocating sha1 HMAC"));
-  if (!silc_hmac_alloc("hmac-sha1", NULL, &hmac)) {
-    SILC_LOG_DEBUG(("Allocating sha1 HMAC failed"));
-    goto err;
-  }
-
-  /* First test vector */
-  SILC_LOG_DEBUG(("First test vector"));
-  silc_hmac_init_with_key(hmac, key1, key1_len);
-  silc_hmac_update(hmac, data1, strlen(data1));
-  silc_hmac_final(hmac, digest, &len);
-  SILC_LOG_HEXDUMP(("Key"), (unsigned char *)key1, key1_len);
-  SILC_LOG_HEXDUMP(("Message"), (unsigned char *)data1, strlen(data1));
-  SILC_LOG_HEXDUMP(("Digest"), digest, len);
-  SILC_LOG_HEXDUMP(("Expected digest"), (unsigned char *)data1_digest, len);
-  if (memcmp(digest, data1_digest, len)) {
-    SILC_LOG_DEBUG(("HMAC failed"));
-    goto err;
-  }
-  SILC_LOG_DEBUG(("HMAC is successful"));
-  
-  /* Second test vector */
-  SILC_LOG_DEBUG(("Second test vector"));
-  silc_hmac_init_with_key(hmac, key2, key2_len);
-  silc_hmac_update(hmac, data2, strlen(data2));
-  silc_hmac_final(hmac, digest, &len);
-  SILC_LOG_HEXDUMP(("Key"), (unsigned char *)key2, key2_len);
-  SILC_LOG_HEXDUMP(("Message"), (unsigned char *)data2, strlen(data2));
-  SILC_LOG_HEXDUMP(("Digest"), digest, len);
-  SILC_LOG_HEXDUMP(("Expected digest"), (unsigned char *)data2_digest, len);
-  if (memcmp(digest, data2_digest, len)) {
-    SILC_LOG_DEBUG(("HMAC failed"));
-    goto err;
-  }
-  SILC_LOG_DEBUG(("HMAC is successful"));
-  
-  /* Third test vector */
-  SILC_LOG_DEBUG(("Third test vector"));
-  silc_hmac_init_with_key(hmac, key3, key3_len);
-  memset(data3, '\xdd', sizeof(data3));
-  silc_hmac_update(hmac, data3, sizeof(data3));
-  silc_hmac_final(hmac, digest, &len);
-  SILC_LOG_HEXDUMP(("Key"), (unsigned char *)key3, key3_len);
-  SILC_LOG_HEXDUMP(("Message"), (unsigned char *)data3, sizeof(data3));
-  SILC_LOG_HEXDUMP(("Digest"), digest, len);
-  SILC_LOG_HEXDUMP(("Expected digest"), (unsigned char *)data3_digest, len);
-  if (memcmp(digest, data3_digest, len)) {
-    SILC_LOG_DEBUG(("HMAC failed"));
-    goto err;
-  }
-  SILC_LOG_DEBUG(("HMAC is successful"));
-  
-  /* Fourth test vector */
-  SILC_LOG_DEBUG(("Fourth test vector"));
-  memset(key4, '\xaa', key4_len);
-  silc_hmac_init_with_key(hmac, key4, key4_len);
-  silc_hmac_update(hmac, data4, strlen(data4));
-  silc_hmac_final(hmac, digest, &len);
-  SILC_LOG_HEXDUMP(("Key"), (unsigned char *)key4, key4_len);
-  SILC_LOG_HEXDUMP(("Message"), (unsigned char *)data4, sizeof(data4));
-  SILC_LOG_HEXDUMP(("Digest"), digest, len);
-  SILC_LOG_HEXDUMP(("Expected digest"), (unsigned char *)data4_digest, len);
-  if (memcmp(digest, data4_digest, len)) {
-    SILC_LOG_DEBUG(("HMAC failed"));
-    goto err;
-  }
-  SILC_LOG_DEBUG(("HMAC is successful"));
-  
-  success = TRUE;
-  
- err:
-  SILC_LOG_DEBUG(("Testing was %s", success ? "SUCCESS" : "FAILURE"));
-  fprintf(stderr, "Testing was %s\n", success ? "SUCCESS" : "FAILURE");
-
-  silc_hmac_free(hmac);
-  silc_hash_unregister_all();
-  silc_hmac_unregister_all();
-  return success;
-}
diff --git a/lib/silccrypt/tests/test_hmacsha256.c b/lib/silccrypt/tests/test_hmacsha256.c
deleted file mode 100644 (file)
index d9d687a..0000000
+++ /dev/null
@@ -1,123 +0,0 @@
-#include "silc.h"
-
-/* Test vectors from draft-ietf-ipsec-ciph-sha-256-01.txt */
-
-/* First test vector */
-const unsigned char key1[] = "\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f\x20\x00";
-int key1_len = 32;
-const unsigned char data1[] = "abc";
-const unsigned char data1_digest[] = "\xa2\x1b\x1f\x5d\x4c\xf4\xf7\x3a\x4d\xd9\x39\x75\x0f\x7a\x06\x6a\x7f\x98\xcc\x13\x1c\xb1\x6a\x66\x92\x75\x90\x21\xcf\xab\x81\x81";
-
-/* Second test vector */
-const unsigned char key2[] = "\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f\x20\x00";
-int key2_len = 32;
-const unsigned char data2[] = "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq";
-const unsigned char data2_digest[] = "\x10\x4f\xdc\x12\x57\x32\x8f\x08\x18\x4b\xa7\x31\x31\xc5\x3c\xae\xe6\x98\xe3\x61\x19\x42\x11\x49\xea\x8c\x71\x24\x56\x69\x7d\x30";
-
-/* Third test vector */
-const unsigned char key3[] = "Jefe";
-int key3_len = 4;
-unsigned char data3[] = "what do ya want for nothing?";
-const unsigned char data3_digest[] = "\x5b\xdc\xc1\x46\xbf\x60\x75\x4e\x6a\x04\x24\x26\x08\x95\x75\xc7\x5a\x00\x3f\x08\x9d\x27\x39\x83\x9d\xec\x58\xb9\x64\xec\x38\x43";
-
-/* Fourth test vector, key 0xaa 80 times */
-unsigned char key4[80];
-int key4_len = 80;
-const unsigned char data4[] = "Test Using Larger Than Block-Size Key and Larger Than One Block-Size Data";
-const unsigned char data4_digest[] = "\x63\x55\xac\x22\xe8\x90\xd0\xa3\xc8\x48\x1a\x5c\xa4\x82\x5b\xc8\x84\xd3\xe7\xa1\xff\x98\xa2\xfc\x2a\xc7\xd8\xe0\x64\xc3\xb2\xe6";
-
-int main(int argc, char **argv)
-{
-  SilcBool success = FALSE;
-  unsigned char digest[20];
-  SilcUInt32 len;
-  SilcHmac hmac;
-
-  if (argc > 1 && !strcmp(argv[1], "-d")) {
-    silc_log_debug(TRUE);
-    silc_log_debug_hexdump(TRUE);
-    silc_log_set_debug_string("*crypt*,*hash*,*sha256*,*hmac*");
-  }
-
-  SILC_LOG_DEBUG(("Registering builtin hash functions"));
-  silc_hash_register_default();
-  silc_hmac_register_default();
-
-  SILC_LOG_DEBUG(("Allocating sha256 HMAC"));
-  if (!silc_hmac_alloc("hmac-sha256", NULL, &hmac)) {
-    SILC_LOG_DEBUG(("Allocating sha256 HMAC failed"));
-    goto err;
-  }
-
-  /* First test vector */
-  SILC_LOG_DEBUG(("First test vector"));
-  silc_hmac_init_with_key(hmac, key1, key1_len);
-  silc_hmac_update(hmac, data1, strlen(data1));
-  silc_hmac_final(hmac, digest, &len);
-  SILC_LOG_HEXDUMP(("Key"), (unsigned char *)key1, key1_len);
-  SILC_LOG_HEXDUMP(("Message"), (unsigned char *)data1, strlen(data1));
-  SILC_LOG_HEXDUMP(("Digest"), digest, len);
-  SILC_LOG_HEXDUMP(("Expected digest"), (unsigned char *)data1_digest, len);
-  if (memcmp(digest, data1_digest, len)) {
-    SILC_LOG_DEBUG(("HMAC failed"));
-    goto err;
-  }
-  SILC_LOG_DEBUG(("HMAC is successful"));
-
-  /* Second test vector */
-  SILC_LOG_DEBUG(("Second test vector"));
-  silc_hmac_init_with_key(hmac, key2, key2_len);
-  silc_hmac_update(hmac, data2, strlen(data2));
-  silc_hmac_final(hmac, digest, &len);
-  SILC_LOG_HEXDUMP(("Key"), (unsigned char *)key2, key2_len);
-  SILC_LOG_HEXDUMP(("Message"), (unsigned char *)data2, strlen(data2));
-  SILC_LOG_HEXDUMP(("Digest"), digest, len);
-  SILC_LOG_HEXDUMP(("Expected digest"), (unsigned char *)data2_digest, len);
-  if (memcmp(digest, data2_digest, len)) {
-    SILC_LOG_DEBUG(("HMAC failed"));
-    goto err;
-  }
-  SILC_LOG_DEBUG(("HMAC is successful"));
-
-  /* Third test vector */
-  SILC_LOG_DEBUG(("Third test vector"));
-  silc_hmac_init_with_key(hmac, key3, key3_len);
-  silc_hmac_update(hmac, data3, strlen(data3));
-  silc_hmac_final(hmac, digest, &len);
-  SILC_LOG_HEXDUMP(("Key"), (unsigned char *)key3, key3_len);
-  SILC_LOG_HEXDUMP(("Message"), (unsigned char *)data3, strlen(data3));
-  SILC_LOG_HEXDUMP(("Digest"), digest, len);
-  SILC_LOG_HEXDUMP(("Expected digest"), (unsigned char *)data3_digest, len);
-  if (memcmp(digest, data3_digest, len)) {
-    SILC_LOG_DEBUG(("HMAC failed"));
-    goto err;
-  }
-  SILC_LOG_DEBUG(("HMAC is successful"));
-
-  /* Fourth test vector */
-  SILC_LOG_DEBUG(("Fourth test vector"));
-  memset(key4, '\xaa', key4_len);
-  silc_hmac_init_with_key(hmac, key4, key4_len);
-  silc_hmac_update(hmac, data4, strlen(data4));
-  silc_hmac_final(hmac, digest, &len);
-  SILC_LOG_HEXDUMP(("Key"), (unsigned char *)key4, key4_len);
-  SILC_LOG_HEXDUMP(("Message"), (unsigned char *)data4, sizeof(data4));
-  SILC_LOG_HEXDUMP(("Digest"), digest, len);
-  SILC_LOG_HEXDUMP(("Expected digest"), (unsigned char *)data4_digest, len);
-  if (memcmp(digest, data4_digest, len)) {
-    SILC_LOG_DEBUG(("HMAC failed"));
-    goto err;
-  }
-  SILC_LOG_DEBUG(("HMAC is successful"));
-
-  success = TRUE;
-
- err:
-  SILC_LOG_DEBUG(("Testing was %s", success ? "SUCCESS" : "FAILURE"));
-  fprintf(stderr, "Testing was %s\n", success ? "SUCCESS" : "FAILURE");
-
-  silc_hmac_free(hmac);
-  silc_hash_unregister_all();
-  silc_hmac_unregister_all();
-  return success;
-}
diff --git a/lib/silccrypt/tests/test_md5.c b/lib/silccrypt/tests/test_md5.c
deleted file mode 100644 (file)
index 2dac7d3..0000000
+++ /dev/null
@@ -1,92 +0,0 @@
-#include "silc.h"
-
-/* Test vectors from RFC 1321 */
-
-/* First test vector */
-const unsigned char data1[] = "a";
-const unsigned char data1_digest[] = "\x0c\xc1\x75\xb9\xc0\xf1\xb6\xa8\x31\xc3\x99\xe2\x69\x77\x26\x61";
-
-/* Second test vector. */
-const unsigned char data2[] = "message digest";
-const unsigned char data2_digest[] = "\xf9\x6b\x69\x7d\x7c\xb7\x93\x8d\x52\x5a\x2f\x31\xaa\xf1\x61\xd0";
-
-/* Third test vector. */
-const unsigned char data3[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
-const unsigned char data3_digest[] = "\xd1\x74\xab\x98\xd2\x77\xd9\xf5\xa5\x61\x1c\x2c\x9f\x41\x9d\x9f";
-
-int main(int argc, char **argv)
-{
-  SilcBool success = FALSE;
-  unsigned char digest[16];
-  SilcHash md5;
-  
-  if (argc > 1 && !strcmp(argv[1], "-d")) {
-    silc_log_debug(TRUE);
-    silc_log_debug_hexdump(TRUE);
-    silc_log_set_debug_string("*crypt*,*hash*,*md5*");
-  }
-
-  SILC_LOG_DEBUG(("Registering builtin hash functions"));
-  silc_hash_register_default();
-
-  SILC_LOG_DEBUG(("Allocating md5 hash function"));
-  if (!silc_hash_alloc("md5", &md5)) {
-    SILC_LOG_DEBUG(("Allocating md5 hash function failed"));
-    goto err;
-  }
-
-  /* First test vector */
-  SILC_LOG_DEBUG(("First test vector"));
-  silc_hash_init(md5);
-  silc_hash_update(md5, data1, strlen(data1));
-  silc_hash_final(md5, digest);
-  SILC_LOG_HEXDUMP(("Message"), (unsigned char *)data1, strlen(data1));
-  SILC_LOG_HEXDUMP(("Digest"), digest, sizeof(digest));
-  SILC_LOG_HEXDUMP(("Expected digest"), (unsigned char *)data1_digest,
-                  sizeof(digest));
-  if (memcmp(digest, data1_digest, sizeof(digest))) {
-    SILC_LOG_DEBUG(("Hash failed"));
-    goto err;
-  }
-  SILC_LOG_DEBUG(("Hash is successful"));
-  
-  /* Second test vector */
-  SILC_LOG_DEBUG(("Second test vector"));
-  silc_hash_init(md5);
-  silc_hash_update(md5, data2, strlen(data2));
-  silc_hash_final(md5, digest);
-  SILC_LOG_HEXDUMP(("Message"), (unsigned char *)data2, strlen(data2));
-  SILC_LOG_HEXDUMP(("Digest"), digest, sizeof(digest));
-  SILC_LOG_HEXDUMP(("Expected digest"), (unsigned char *)data2_digest,
-                  sizeof(digest));
-  if (memcmp(digest, data2_digest, sizeof(digest))) {
-    SILC_LOG_DEBUG(("Hash failed"));
-    goto err;
-  }
-  SILC_LOG_DEBUG(("Hash is successful"));
-
-  /* Third test vector */
-  SILC_LOG_DEBUG(("Third test vector"));
-  silc_hash_init(md5);
-  silc_hash_update(md5, data3, strlen(data3));
-  silc_hash_final(md5, digest);
-  SILC_LOG_HEXDUMP(("Message"), (unsigned char *)data3, strlen(data3));
-  SILC_LOG_HEXDUMP(("Digest"), digest, sizeof(digest));
-  SILC_LOG_HEXDUMP(("Expected digest"), (unsigned char *)data3_digest,
-                  sizeof(digest));
-  if (memcmp(digest, data3_digest, sizeof(digest))) {
-    SILC_LOG_DEBUG(("Hash failed"));
-    goto err;
-  }
-  SILC_LOG_DEBUG(("Hash is successful"));
-
-  success = TRUE;
-  
- err:
-  SILC_LOG_DEBUG(("Testing was %s", success ? "SUCCESS" : "FAILURE"));
-  fprintf(stderr, "Testing was %s\n", success ? "SUCCESS" : "FAILURE");
-
-  silc_hash_free(md5);
-  silc_hash_unregister_all();
-  return success;
-}
diff --git a/lib/silccrypt/tests/test_sha1.c b/lib/silccrypt/tests/test_sha1.c
deleted file mode 100644 (file)
index 7798c66..0000000
+++ /dev/null
@@ -1,76 +0,0 @@
-#include "silc.h"
-
-/* Test vectors from NIST secure hashing definition for SHA-1 */
-
-/* First test vector */
-const unsigned char data1[] = "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq";
-const unsigned char data1_digest[] = "\x84\x98\x3e\x44\x1c\x3b\xd2\x6e\xba\xae\x4a\xa1\xf9\x51\x29\xe5\xe5\x46\x70\xf1";
-
-/* Second test vector. This will be allocated with 1000000 'a' characters
-   and hashed */
-char *data2 = NULL;
-const unsigned char data2_digest[] = "\x34\xaa\x97\x3c\xd4\xc4\xda\xa4\xf6\x1e\xeb\x2b\xdb\xad\x27\x31\x65\x34\x01\x6f";
-
-int main(int argc, char **argv)
-{
-  SilcBool success = FALSE;
-  unsigned char digest[20];
-  SilcHash sha1;
-  
-  if (argc > 1 && !strcmp(argv[1], "-d")) {
-    silc_log_debug(TRUE);
-    silc_log_debug_hexdump(TRUE);
-    silc_log_set_debug_string("*crypt*,*hash*,*sha1*");
-  }
-
-  SILC_LOG_DEBUG(("Registering builtin hash functions"));
-  silc_hash_register_default();
-
-  SILC_LOG_DEBUG(("Allocating sha1 hash function"));
-  if (!silc_hash_alloc("sha1", &sha1)) {
-    SILC_LOG_DEBUG(("Allocating sha1 hash function failed"));
-    goto err;
-  }
-
-  /* First test vector */
-  SILC_LOG_DEBUG(("First test vector"));
-  silc_hash_init(sha1);
-  silc_hash_update(sha1, data1, strlen(data1));
-  silc_hash_final(sha1, digest);
-  SILC_LOG_HEXDUMP(("Message"), (unsigned char *)data1, strlen(data1));
-  SILC_LOG_HEXDUMP(("Digest"), digest, sizeof(digest));
-  SILC_LOG_HEXDUMP(("Expected digest"), (unsigned char *)data1_digest,
-                  sizeof(digest));
-  if (memcmp(digest, data1_digest, sizeof(digest))) {
-    SILC_LOG_DEBUG(("Hash failed"));
-    goto err;
-  }
-  SILC_LOG_DEBUG(("Hash is successful"));
-  
-  /* First test vector */
-  SILC_LOG_DEBUG(("Second test vector"));
-  data2 = silc_malloc(1000000);
-  memset(data2, 'a', 1000000);
-  silc_hash_init(sha1);
-  silc_hash_update(sha1, data2, 1000000);
-  silc_hash_final(sha1, digest);
-  SILC_LOG_HEXDUMP(("Digest"), digest, sizeof(digest));
-  SILC_LOG_HEXDUMP(("Expected digest"), (unsigned char *)data2_digest,
-                  sizeof(digest));
-  if (memcmp(digest, data2_digest, sizeof(digest))) {
-    SILC_LOG_DEBUG(("Hash failed"));
-    goto err;
-  }
-  SILC_LOG_DEBUG(("Hash is successful"));
-
-  success = TRUE;
-  
- err:
-  SILC_LOG_DEBUG(("Testing was %s", success ? "SUCCESS" : "FAILURE"));
-  fprintf(stderr, "Testing was %s\n", success ? "SUCCESS" : "FAILURE");
-
-  silc_free(data2);
-  silc_hash_free(sha1);
-  silc_hash_unregister_all();
-  return success;
-}
diff --git a/lib/silccrypt/tests/test_sha256.c b/lib/silccrypt/tests/test_sha256.c
deleted file mode 100644 (file)
index ef0945b..0000000
+++ /dev/null
@@ -1,73 +0,0 @@
-#include "silc.h"
-
-/* Test vectors from NIST secure hashing definition for SHA-256 */
-
-/* First test vector */
-const unsigned char data1[] = "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq";
-const unsigned char data1_digest[] = "\x24\x8d\x6a\x61\xd2\x06\x38\xb8\xe5\xc0\x26\x93\x0c\x3e\x60\x39\xa3\x3c\xe4\x59\x64\xff\x21\x67\xf6\xec\xed\xd4\x19\xdb\x06\xc1";
-
-/* Second test vector */
-const unsigned char data2[] = "abc";
-const unsigned char data2_digest[] = "\xba\x78\x16\xbf\x8f\x01\xcf\xea\x41\x41\x40\xde\x5d\xae\x22\x23\xb0\x03\x61\xa3\x96\x17\x7a\x9c\xb4\x10\xff\x61\xf2\x00\x15\xad";
-
-int main(int argc, char **argv)
-{
-  SilcBool success = FALSE;
-  unsigned char digest[20];
-  SilcHash sha256;
-  
-  if (argc > 1 && !strcmp(argv[1], "-d")) {
-    silc_log_debug(TRUE);
-    silc_log_debug_hexdump(TRUE);
-    silc_log_set_debug_string("*crypt*,*hash*,*sha256*");
-  }
-
-  SILC_LOG_DEBUG(("Registering builtin hash functions"));
-  silc_hash_register_default();
-
-  SILC_LOG_DEBUG(("Allocating sha256 hash function"));
-  if (!silc_hash_alloc("sha256", &sha256)) {
-    SILC_LOG_DEBUG(("Allocating sha256 hash function failed"));
-    goto err;
-  }
-
-  /* First test vector */
-  SILC_LOG_DEBUG(("First test vector"));
-  silc_hash_init(sha256);
-  silc_hash_update(sha256, data1, strlen(data1));
-  silc_hash_final(sha256, digest);
-  SILC_LOG_HEXDUMP(("Message"), (unsigned char *)data1, strlen(data1));
-  SILC_LOG_HEXDUMP(("Digest"), digest, sizeof(digest));
-  SILC_LOG_HEXDUMP(("Expected digest"), (unsigned char *)data1_digest,
-                  sizeof(digest));
-  if (memcmp(digest, data1_digest, sizeof(digest))) {
-    SILC_LOG_DEBUG(("Hash failed"));
-    goto err;
-  }
-  SILC_LOG_DEBUG(("Hash is successful"));
-  
-  /* Second test vector */
-  SILC_LOG_DEBUG(("First test vector"));
-  silc_hash_init(sha256);
-  silc_hash_update(sha256, data2, strlen(data2));
-  silc_hash_final(sha256, digest);
-  SILC_LOG_HEXDUMP(("Message"), (unsigned char *)data2, strlen(data2));
-  SILC_LOG_HEXDUMP(("Digest"), digest, sizeof(digest));
-  SILC_LOG_HEXDUMP(("Expected digest"), (unsigned char *)data2_digest,
-                  sizeof(digest));
-  if (memcmp(digest, data2_digest, sizeof(digest))) {
-    SILC_LOG_DEBUG(("Hash failed"));
-    goto err;
-  }
-  SILC_LOG_DEBUG(("Hash is successful"));
-  
-  success = TRUE;
-  
- err:
-  SILC_LOG_DEBUG(("Testing was %s", success ? "SUCCESS" : "FAILURE"));
-  fprintf(stderr, "Testing was %s\n", success ? "SUCCESS" : "FAILURE");
-
-  silc_hash_free(sha256);
-  silc_hash_unregister_all();
-  return success;
-}
diff --git a/lib/silccrypt/tests/test_silcpkcs.c b/lib/silccrypt/tests/test_silcpkcs.c
deleted file mode 100644 (file)
index 2e5f34e..0000000
+++ /dev/null
@@ -1,309 +0,0 @@
-/* Tests API in silcpkcs.h */
-#include "silc.h"
-
-int key_len = 2048;
-const unsigned char p[] = "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f";
-int p_len = 32;
-
-int test()
-{
-  SilcBool success = FALSE;
-  SilcPKCS pkcs;
-  unsigned char *pk, *prv;
-  char *identifier;
-  SilcUInt32 pk_len = 0, prv_len = 0;
-  SilcPublicKey pubkey, pubkey2;
-  SilcPublicKeyIdentifier ident;
-  SilcPrivateKey privkey;
-  SilcBuffer buf;
-  unsigned char d[4096], d2[4096];
-  SilcUInt32 dlen, d2len;
-  SilcHash sha1;
-
-  SILC_LOG_DEBUG(("Registering PKCSs"));
-  if (!silc_pkcs_register_default()) {
-    SILC_LOG_DEBUG(("Registering PKCSs failed"));
-    goto err;
-  }
-  SILC_LOG_DEBUG(("Supported PKCS: %s", silc_pkcs_get_supported()));
-
-
-  SILC_LOG_DEBUG(("Allocate rsa PKCS"));
-  if (!silc_pkcs_is_supported("rsa")) {
-    SILC_LOG_DEBUG(("rsa PKCS not supported"));
-    goto err;
-  }
-  if (!silc_pkcs_alloc("rsa", &pkcs)) {
-    SILC_LOG_DEBUG(("Allocate rsa PKCS failed"));
-    goto err;
-  }
-
-
-  SILC_LOG_DEBUG(("Generating new key pair"));
-  if (!silc_pkcs_generate_key(pkcs, key_len, NULL)) {
-    SILC_LOG_DEBUG(("Generating new key pair failed"));
-    goto err;
-  }
-
-
-  SILC_LOG_DEBUG(("Key length: %d", silc_pkcs_get_key_len(pkcs)));
-  if (silc_pkcs_get_key_len(pkcs) != key_len) {
-    SILC_LOG_DEBUG(("Bad key length: %d != %d",
-                   silc_pkcs_get_key_len(pkcs), key_len));
-    goto err;
-  }
-  SILC_LOG_DEBUG(("PKCS name: %s", silc_pkcs_get_name(pkcs)));
-
-  SILC_LOG_DEBUG(("------"));
-  SILC_LOG_DEBUG(("------ Testing Public Key Routines"));
-  SILC_LOG_DEBUG(("------"));
-
-  SILC_LOG_DEBUG(("Get public key from PKCS"));
-  pk = silc_pkcs_get_public_key(pkcs, &pk_len);
-  if (!pk || !pk_len) {
-    SILC_LOG_DEBUG(("Getting public key failed"));
-    goto err;
-  }
-  SILC_LOG_DEBUG(("Making new public key identifier"));
-  identifier = silc_pkcs_encode_identifier("foo", "bar", "foo bar",
-                                          "foo@bar.com", "bar", "BB");
-  if (!identifier) {
-    SILC_LOG_DEBUG(("Making new public key identifier failed"));
-    goto err;
-  }
-  SILC_LOG_DEBUG(("Decoding public key identifier"));
-  ident = silc_pkcs_decode_identifier(identifier);
-  if (!ident) {
-    SILC_LOG_DEBUG(("Decoding public key identifier failed"));
-    goto err;
-  }
-  SILC_LOG_DEBUG(("Allocating SilcPublicKey"));
-  pubkey = silc_pkcs_public_key_alloc("rsa", identifier, pk, pk_len);
-  if (!pubkey) {
-    SILC_LOG_DEBUG(("Allocating SilcPublicKey failed"));
-    goto err;
-  }
-  silc_free(pk);
-  SILC_LOG_DEBUG(("Encode SilcPublicKey data"));
-  pk = silc_pkcs_public_key_encode(pubkey, &pk_len);
-  if (!pk) {
-    SILC_LOG_DEBUG(("Encode SilcPublicKey data failed"));
-    goto err;
-  }
-  SILC_LOG_DEBUG(("Decode public key to SilcPublicKey"));
-  if (!silc_pkcs_public_key_decode(pk, pk_len, &pubkey)) {
-    SILC_LOG_DEBUG(("Decode public key to SilcPublicKey failed"));
-    goto err;
-  }
-  SILC_LOG_DEBUG(("Save public key to publickey.pub"));
-  unlink("publickey.pub");
-  if (!silc_pkcs_save_public_key("publickey.pub", pubkey,
-                                SILC_PKCS_FILE_PEM)) {
-    SILC_LOG_DEBUG(("Save public key to publickey.pub failed"));
-    goto err;
-  }
-  SILC_LOG_DEBUG(("Copying public key"));
-  pubkey2 = silc_pkcs_public_key_copy(pubkey);
-  if (!pubkey2) {
-    SILC_LOG_DEBUG(("Copying public key failed"));
-    goto err;
-  }
-  silc_pkcs_public_key_free(pubkey);
-  SILC_LOG_DEBUG(("Load public key"));
-  if (!silc_pkcs_load_public_key("publickey.pub", &pubkey,
-                                SILC_PKCS_FILE_PEM)) {
-    SILC_LOG_DEBUG(("Load public key failed"));
-    goto err;
-  }
-  SILC_LOG_DEBUG(("Comparing copied and loaded public keys"));
-  if (!silc_pkcs_public_key_compare(pubkey, pubkey2)) {
-    SILC_LOG_DEBUG(("Comparing copied and loaded public keys failed"));
-    goto err;
-  }
-  SILC_LOG_DEBUG(("Match"));
-  SILC_LOG_DEBUG(("Set public key to PKCS"));
-  if (!silc_pkcs_public_key_set(pkcs, pubkey)) {
-    SILC_LOG_DEBUG(("Set public key to PKCS"));
-    goto err;
-  }
-  SILC_LOG_DEBUG(("Encoding public key payload"));
-  buf = silc_pkcs_public_key_payload_encode(pubkey);
-  if (!buf) {
-    SILC_LOG_DEBUG(("Encoding public key payload failed"));
-    goto err;
-  }
-  silc_pkcs_public_key_free(pubkey2);
-  SILC_LOG_DEBUG(("Decoding public key payload"));
-  if (!silc_pkcs_public_key_payload_decode(buf->data, buf->len, &pubkey2)) {
-    SILC_LOG_DEBUG(("Decoding public key payload failed"));
-    goto err;
-  }
-  SILC_LOG_DEBUG(("Comparing decoded and original public keys"));
-  if (!silc_pkcs_public_key_compare(pubkey2, pubkey)) {
-    SILC_LOG_DEBUG(("Comparing decoded and original public keys failed"));
-    goto err;
-  }
-  SILC_LOG_DEBUG(("Match"));
-  SILC_LOG_DEBUG(("Dumping public key identifier"));
-  silc_show_public_key("publickey.pub");
-  unlink("publickey.pub");
-  silc_free(pk);
-  silc_free(identifier);
-  silc_pkcs_free_identifier(ident);
-  silc_pkcs_public_key_free(pubkey);
-  silc_pkcs_public_key_free(pubkey2);
-
-
-  SILC_LOG_DEBUG(("------"));
-  SILC_LOG_DEBUG(("------ Testing Private Key Routines"));
-  SILC_LOG_DEBUG(("------"));
-
-  SILC_LOG_DEBUG(("Get private key from PKCS"));
-  prv = silc_pkcs_get_private_key(pkcs, &prv_len);
-  if (!prv || !prv_len) {
-    SILC_LOG_DEBUG(("Getting private key failed"));
-    goto err;
-  }
-  SILC_LOG_DEBUG(("Allocating SilcPrivateKey"));
-  privkey = silc_pkcs_private_key_alloc("rsa", prv, prv_len);
-  if (!privkey) {
-    SILC_LOG_DEBUG(("Allocating SilcPrivateKey failed"));
-    goto err;
-  }
-  silc_free(prv);
-  SILC_LOG_DEBUG(("Encode SilcPrivateKey data"));
-  prv = silc_pkcs_private_key_encode(privkey, &prv_len);
-  if (!prv) {
-    SILC_LOG_DEBUG(("Encode SilcPrivateKey data failed"));
-    goto err;
-  }
-  SILC_LOG_DEBUG(("Decode private key to SilcPrivateKey"));
-  if (!silc_pkcs_private_key_decode(prv, prv_len, &privkey)) {
-    SILC_LOG_DEBUG(("Decode private key to SilcPrivateKey failed"));
-    goto err;
-  }
-  SILC_LOG_DEBUG(("Save private key to privkey.prv"));
-  unlink("privkey.prv");
-  if (!silc_pkcs_save_private_key("privkey.prv", privkey,
-                                 "foobar", 6,
-                                 SILC_PKCS_FILE_BIN)) {
-    SILC_LOG_DEBUG(("Save private key to priv.pub failed"));
-    goto err;
-  }
-  silc_pkcs_private_key_free(privkey);
-  SILC_LOG_DEBUG(("Load private key"));
-  if (!silc_pkcs_load_private_key("privkey.prv", &privkey, "foobar", 6,
-                                 SILC_PKCS_FILE_BIN)) {
-    SILC_LOG_DEBUG(("Load private key failed"));
-    goto err;
-  }
-  SILC_LOG_DEBUG(("Set private key to PKCS"));
-  if (!silc_pkcs_private_key_set(pkcs, privkey)) {
-    SILC_LOG_DEBUG(("Set private key to PKCS"));
-    goto err;
-  }
-  unlink("privkey.prv");
-  silc_free(prv);
-  silc_pkcs_private_key_free(privkey);
-
-
-  SILC_LOG_DEBUG(("------"));
-  SILC_LOG_DEBUG(("------ Testing Public Key Cryptography Operations"));
-  SILC_LOG_DEBUG(("------"));
-
-  memset(d, 0, sizeof(d));
-  memset(d2, 0, sizeof(d2));
-
-  SILC_LOG_DEBUG(("Encrypting data"));
-  if (!silc_pkcs_encrypt(pkcs, (unsigned char *)p, p_len, d, &dlen)) {
-    SILC_LOG_DEBUG(("Encrypting data failed"));
-    goto err;
-  }
-  SILC_LOG_DEBUG(("Decrypting data"));
-  if (!silc_pkcs_decrypt(pkcs, d, dlen, d2, &d2len)) {
-    SILC_LOG_DEBUG(("Decrypting data failed"));
-    goto err;
-  }
-  SILC_LOG_HEXDUMP(("Plaintext"), p, p_len);
-  SILC_LOG_HEXDUMP(("Ciphertext"), d, dlen);
-  SILC_LOG_HEXDUMP(("Decrypted"), d2, d2len);
-  if (memcmp(p, d2, p_len)) {
-    SILC_LOG_DEBUG(("Decryption failed"));
-    goto err;
-  }
-  SILC_LOG_DEBUG(("Decryption successful"));
-  memset(d, 0, sizeof(d));
-  memset(d2, 0, sizeof(d2));
-
-  SILC_LOG_DEBUG(("Signing data"));
-  if (!silc_pkcs_sign(pkcs, (unsigned char *)p, p_len, d, &dlen)) {
-    SILC_LOG_DEBUG(("Signing data failed"));
-    goto err;
-  }
-  SILC_LOG_HEXDUMP(("Data"), p, p_len);
-  SILC_LOG_HEXDUMP(("signature"), d, dlen);
-  SILC_LOG_DEBUG(("Verifying data"));
-  if (!silc_pkcs_verify(pkcs, d, dlen, (unsigned char *)p, p_len)) {
-    SILC_LOG_DEBUG(("Verifying data failed"));
-    goto err;
-  }
-  SILC_LOG_DEBUG(("Verification successful"));
-
-  silc_hash_alloc("sha1", &sha1);
-  SILC_LOG_DEBUG(("Signing data with hash"));
-  if (!silc_pkcs_sign_with_hash(pkcs, sha1, (unsigned char *)p, p_len,
-                               d, &dlen)) {
-    SILC_LOG_DEBUG(("Signing data with hash failed"));
-    goto err;
-  }
-  SILC_LOG_HEXDUMP(("Data"), p, p_len);
-  SILC_LOG_HEXDUMP(("signature"), d, dlen);
-  SILC_LOG_DEBUG(("Verifying data with hash"));
-  if (!silc_pkcs_verify_with_hash(pkcs, sha1, d, dlen,
-                                 (unsigned char *)p, p_len)) {
-    SILC_LOG_DEBUG(("Verifying data with hash failed"));
-    goto err;
-  }
-  SILC_LOG_DEBUG(("Verification with hash successful"));
-  silc_hash_free(sha1);
-
-  silc_pkcs_free(pkcs);
-  success = TRUE;
-
- err:
-  SILC_LOG_DEBUG(("Testing was %s", success ? "SUCCESS" : "FAILURE"));
-  fprintf(stderr, "Testing was %s\n", success ? "SUCCESS" : "FAILURE");
-
-  return success;
-}
-
-int main(int argc, char **argv)
-{
-  int success;
-  int i;
-
-  if (argc > 1 && !strcmp(argv[1], "-d")) {
-    silc_log_debug(TRUE);
-    silc_log_debug_hexdump(TRUE);
-    silc_log_set_debug_string("*crypt*,*pkcs*,*rsa*,*primegen*");
-  }
-  silc_hash_register_default();
-  silc_hmac_register_default();
-  silc_cipher_register_default();
-  silc_rng_global_init(NULL);
-
-  success = test();
-
-  for (i = 0; i < 100; i++) {
-    success = test();
-    if (!success)
-      break;
-  }
-
-  silc_pkcs_unregister_all();
-  silc_hash_unregister_all();
-  silc_hmac_unregister_all();
-  silc_cipher_unregister_all();
-
-  return success;
-}
diff --git a/lib/silccrypt/tests/test_speed.c b/lib/silccrypt/tests/test_speed.c
deleted file mode 100644 (file)
index 65c2def..0000000
+++ /dev/null
@@ -1,68 +0,0 @@
-#include <stdio.h>
-#include <stdlib.h>
-#include <sys/types.h>
-#include <sys/time.h>
-//#include "../ciphers.h"
-#include "../serpent.h"
-
-#define timediff(tv2, tv1)  (((tv2)->tv_sec - (tv1)->tv_sec)*1000000 + \
-                             ((tv2)->tv_usec - (tv1)->tv_usec))
-
-int main(int argc, char **argv)
-{
-       int i;
-       unsigned char key[256];
-       unsigned char plain[512];
-       unsigned char plain2[512];
-       unsigned char cipher[512];
-       unsigned char iv[128];
-       struct timeval tv1,tv2;
-
-       memset(&key, 0, sizeof(key));
-       memset(&plain, 0, sizeof(plain));
-       memset(&plain2, 0, sizeof(plain2));
-       memset(&cipher, 0, sizeof(cipher));
-       memset(&iv, 0, sizeof(iv));
-
-       gettimeofday(&tv1, NULL);
-       silc_serpent_init(NULL, key, 128);
-       gettimeofday(&tv2, NULL);
-
-       fprintf(stderr, "\nPlaintext:\n");
-       for (i = 0; i < sizeof(plain) / 2; i += 2) {
-               plain[i] = i;
-               plain[i+1] = i+1;
-               fprintf(stderr, "%02x%02x ", plain[i], plain[i+1]);
-       }
-
-       fprintf(stderr, "\n\nEncrypting\n");
-       gettimeofday(&tv1, NULL);
-       silc_serpent_encrypt_cbc(NULL, plain, cipher, sizeof(plain), iv);
-       gettimeofday(&tv2, NULL);
-
-       fprintf(stderr, "Encrypt %6.3f Mb/s\n", 
-                  1000000.0*8.0/timediff(&tv2,&tv1));
-
-       fprintf(stderr, "Ciphertext:\n");
-       for (i = 0; i < (sizeof(cipher)/2); i += 2) {
-               fprintf(stderr, "%02x", cipher[i]);
-               fprintf(stderr, "%02x ", cipher[i+1]);
-       }
-
-       fprintf(stderr, "\n\nDecrypting\n");
-       gettimeofday(&tv1, NULL);
-       silc_serpent_decrypt_cbc(NULL, cipher, plain2, sizeof(cipher), iv);
-       gettimeofday(&tv2, NULL);
-
-       fprintf(stderr, "Decrypt %6.3f Mb/s\n", 
-                  1000000.0*8.0/timediff(&tv2,&tv1));
-
-       fprintf(stderr, "Decrypted text:\n");
-       for (i = 0; i < (sizeof(plain2)/2); i += 2) {
-               fprintf(stderr, "%02x", plain2[i]);
-               fprintf(stderr, "%02x ", plain2[i+1]);
-       }
-       fprintf(stderr, "\nDone\n");
-
-       return 0;
-}
diff --git a/lib/silccrypt/tests/test_twofish.c b/lib/silccrypt/tests/test_twofish.c
deleted file mode 100644 (file)
index 5cd6848..0000000
+++ /dev/null
@@ -1,62 +0,0 @@
-#include <stdio.h>
-#include <stdlib.h>
-#include "silc.h"
-
-#include "twofish.h"
-
-int main()
-{
-       int i;
-       unsigned char key[256];
-       unsigned char plain[256];
-       unsigned char plain2[256];
-       unsigned char cipher[256];
-       unsigned char iv[256];
-       void *context;
-
-       memset(&key, 0, sizeof(key));
-       memset(&plain, 0, sizeof(plain));
-       memset(&plain2, 0, sizeof(plain2));
-       memset(&cipher, 0, sizeof(cipher));
-       memset(&iv, 0, sizeof(iv));
-
-       context = malloc(silc_twofish_context_len());
-
-       fprintf(stderr, "\nKey:\n");
-       for (i = 0; i < (sizeof(key) / 2); i += 2) {
-               fprintf(stderr, "%02x%02x ", key[i], key[i+1]);
-       }
-
-       fprintf(stderr, "\nSetting key\n");
-       silc_twofish_set_key(context, key, 256);
-
-       fprintf(stderr, "\nPlaintext:\n");
-       for (i = 0; i < (sizeof(plain) / 2); i += 2) {
-               plain[i] = i;
-               plain[i+1] = i+1;
-               fprintf(stderr, "%02x%02x ", plain[i], plain[i+1]);
-       }
-
-       fprintf(stderr, "\n\nEncrypting\n");
-       silc_twofish_encrypt_cbc(context, plain, cipher, 256, iv);
-
-       fprintf(stderr, "Ciphertext:\n");
-       for (i = 0; i < (sizeof(cipher)/2); i += 2) {
-               fprintf(stderr, "%02x", cipher[i]);
-               fprintf(stderr, "%02x ", cipher[i+1]);
-       }
-
-       memset(&iv, 0, sizeof(iv));
-
-       fprintf(stderr, "\n\nDecrypting\n");
-       silc_twofish_decrypt_cbc(context, cipher, plain2, 256, iv);
-
-       fprintf(stderr, "Decryptedtext:\n");
-       for (i = 0; i < (sizeof(plain2)/2); i += 2) {
-               fprintf(stderr, "%02x", plain2[i]);
-               fprintf(stderr, "%02x ", plain2[i+1]);
-       }
-       fprintf(stderr, "\nDone\n");
-
-       return 0;
-}
diff --git a/lib/silccrypt/twofish.c b/lib/silccrypt/twofish.c
deleted file mode 100644 (file)
index e8f3bd4..0000000
+++ /dev/null
@@ -1,563 +0,0 @@
-/* Modified for SILC. -Pekka */
-
-/* This is an independent implementation of the encryption algorithm:   */
-/*                                                                      */
-/*         Twofish by Bruce Schneier and colleagues                     */
-/*                                                                      */
-/* which is a candidate algorithm in the Advanced Encryption Standard   */
-/* programme of the US National Institute of Standards and Technology.  */
-/*                                                                      */
-/* Copyright in this implementation is held by Dr B R Gladman but I     */
-/* hereby give permission for its free direct or derivative use subject */
-/* to acknowledgment of its origin and compliance with any conditions   */
-/* that the originators of t he algorithm place on its exploitation.     */
-/*                                                                      */
-/* My thanks to Doug Whiting and Niels Ferguson for comments that led   */
-/* to improvements in this implementation.                              */
-/*                                                                      */
-/* Dr Brian Gladman (gladman@seven77.demon.co.uk) 14th January 1999     */
-
-/* Timing data for Twofish (twofish.c)
-
-128 bit key:
-Key Setup:    8414 cycles
-Encrypt:       376 cycles =    68.1 mbits/sec
-Decrypt:       374 cycles =    68.4 mbits/sec
-Mean:          375 cycles =    68.3 mbits/sec
-
-192 bit key:
-Key Setup:   11628 cycles
-Encrypt:       376 cycles =    68.1 mbits/sec
-Decrypt:       374 cycles =    68.4 mbits/sec
-Mean:          375 cycles =    68.3 mbits/sec
-
-256 bit key:
-Key Setup:   15457 cycles
-Encrypt:       381 cycles =    67.2 mbits/sec
-Decrypt:       374 cycles =    68.4 mbits/sec
-Mean:          378 cycles =    67.8 mbits/sec
-
-*/
-
-#include "silc.h"
-#include "twofish_internal.h"
-#include "twofish.h"
-
-/*
- * SILC Crypto API for Twofish
- */
-
-/* Sets the key for the cipher. */
-
-SILC_CIPHER_API_SET_KEY(twofish_cbc)
-{
-  SilcUInt32 k[8];
-
-  SILC_GET_WORD_KEY(key, k, keylen);
-  twofish_set_key((TwofishContext *)context, k, keylen);
-
-  return TRUE;
-}
-
-/* Sets IV for the cipher. */
-
-SILC_CIPHER_API_SET_IV(twofish_cbc)
-{
-
-}
-
-/* Returns the size of the cipher context. */
-
-SILC_CIPHER_API_CONTEXT_LEN(twofish_cbc)
-{
-  return sizeof(TwofishContext);
-}
-
-/* Encrypts with the cipher in CBC mode. Source and destination buffers
-   maybe one and same. */
-
-SILC_CIPHER_API_ENCRYPT(twofish_cbc)
-{
-  SilcUInt32 tiv[4];
-  int i;
-
-  SILC_ASSERT((len & (16 - 1)) == 0);
-  if (len & (16 - 1))
-    return FALSE;
-  SILC_CBC_GET_IV(tiv, iv);
-
-  SILC_CBC_ENC_PRE(tiv, src);
-  twofish_encrypt((TwofishContext *)context, tiv, tiv);
-  SILC_CBC_ENC_POST(tiv, dst, src);
-
-  for (i = 16; i < len; i += 16) {
-    SILC_CBC_ENC_PRE(tiv, src);
-    twofish_encrypt((TwofishContext *)context, tiv, tiv);
-    SILC_CBC_ENC_POST(tiv, dst, src);
-  }
-
-  SILC_CBC_PUT_IV(tiv, iv);
-
-  return TRUE;
-}
-
-/* Decrypts with the cipher in CBC mode. Source and destination buffers
-   maybe one and same. */
-
-SILC_CIPHER_API_DECRYPT(twofish_cbc)
-{
-  SilcUInt32 tmp[4], tmp2[4], tiv[4];
-  int i;
-
-  if (len & (16 - 1))
-    return FALSE;
-
-  SILC_CBC_GET_IV(tiv, iv);
-
-  SILC_CBC_DEC_PRE(tmp, src);
-  twofish_decrypt((TwofishContext *)context, tmp, tmp2);
-  SILC_CBC_DEC_POST(tmp2, dst, src, tmp, tiv);
-
-  for (i = 16; i < len; i += 16) {
-    SILC_CBC_DEC_PRE(tmp, src);
-    twofish_decrypt((TwofishContext *)context, tmp, tmp2);
-    SILC_CBC_DEC_POST(tmp2, dst, src, tmp, tiv);
-  }
-
-  SILC_CBC_PUT_IV(tiv, iv);
-
-  return TRUE;
-}
-
-#if 0
-#define Q_TABLES
-#define M_TABLE
-#define MK_TABLE
-#define ONE_STEP
-#endif
-
-/* finite field arithmetic for GF(2**8) with the modular    */
-/* polynomial x^8 + x^6 + x^5 + x^3 + 1 (0x169)             */
-
-#define G_M 0x0169
-
-u1byte  tab_5b[4] = { 0, G_M >> 2, G_M >> 1, (G_M >> 1) ^ (G_M >> 2) };
-u1byte  tab_ef[4] = { 0, (G_M >> 1) ^ (G_M >> 2), G_M >> 1, G_M >> 2 };
-
-#define ffm_01(x)    (x)
-#define ffm_5b(x)   ((x) ^ ((x) >> 2) ^ tab_5b[(x) & 3])
-#define ffm_ef(x)   ((x) ^ ((x) >> 1) ^ ((x) >> 2) ^ tab_ef[(x) & 3])
-
-u1byte ror4[16] = { 0, 8, 1, 9, 2, 10, 3, 11, 4, 12, 5, 13, 6, 14, 7, 15 };
-u1byte ashx[16] = { 0, 9, 2, 11, 4, 13, 6, 15, 8, 1, 10, 3, 12, 5, 14, 7 };
-
-u1byte qt0[2][16] =
-{   { 8, 1, 7, 13, 6, 15, 3, 2, 0, 11, 5, 9, 14, 12, 10, 4 },
-    { 2, 8, 11, 13, 15, 7, 6, 14, 3, 1, 9, 4, 0, 10, 12, 5 }
-};
-
-u1byte qt1[2][16] =
-{   { 14, 12, 11, 8, 1, 2, 3, 5, 15, 4, 10, 6, 7, 0, 9, 13 },
-    { 1, 14, 2, 11, 4, 12, 3, 7, 6, 13, 10, 5, 15, 9, 0, 8 }
-};
-
-u1byte qt2[2][16] =
-{   { 11, 10, 5, 14, 6, 13, 9, 0, 12, 8, 15, 3, 2, 4, 7, 1 },
-    { 4, 12, 7, 5, 1, 6, 9, 10, 0, 14, 13, 8, 2, 11, 3, 15 }
-};
-
-u1byte qt3[2][16] =
-{   { 13, 7, 15, 4, 1, 2, 6, 14, 9, 11, 3, 0, 8, 5, 12, 10 },
-    { 11, 9, 5, 1, 12, 3, 13, 14, 6, 4, 7, 15, 2, 0, 8, 10 }
-};
-
-u1byte qp(const u4byte n, const u1byte x)
-{   u1byte  a0, a1, a2, a3, a4, b0, b1, b2, b3, b4;
-
-    a0 = x >> 4; b0 = x & 15;
-    a1 = a0 ^ b0; b1 = ror4[b0] ^ ashx[a0];
-    a2 = qt0[n][a1]; b2 = qt1[n][b1];
-    a3 = a2 ^ b2; b3 = ror4[b2] ^ ashx[a2];
-    a4 = qt2[n][a3]; b4 = qt3[n][b3];
-    return (b4 << 4) | a4;
-}
-
-#ifdef  Q_TABLES
-
-u4byte  qt_gen = 0;
-u1byte  q_tab[2][256];
-
-#define q(n,x)  q_tab[n][x]
-
-void gen_qtab(void)
-{   u4byte  i;
-
-    for(i = 0; i < 256; ++i)
-    {
-        q(0,i) = qp(0, (u1byte)i);
-        q(1,i) = qp(1, (u1byte)i);
-    }
-}
-
-#else
-
-#define q(n,x)  qp(n, x)
-
-#endif
-
-#ifdef  M_TABLE
-
-u4byte  mt_gen = 0;
-u4byte  m_tab[4][256];
-
-void gen_mtab(void)
-{   u4byte  i, f01, f5b, fef;
-
-    for(i = 0; i < 256; ++i)
-    {
-        f01 = q(1,i); f5b = ffm_5b(f01); fef = ffm_ef(f01);
-        m_tab[0][i] = f01 + (f5b << 8) + (fef << 16) + (fef << 24);
-        m_tab[2][i] = f5b + (fef << 8) + (f01 << 16) + (fef << 24);
-
-        f01 = q(0,i); f5b = ffm_5b(f01); fef = ffm_ef(f01);
-        m_tab[1][i] = fef + (fef << 8) + (f5b << 16) + (f01 << 24);
-        m_tab[3][i] = f5b + (f01 << 8) + (fef << 16) + (f5b << 24);
-    }
-}
-
-#define mds(n,x)    m_tab[n][x]
-
-#else
-
-#define fm_00   ffm_01
-#define fm_10   ffm_5b
-#define fm_20   ffm_ef
-#define fm_30   ffm_ef
-#define q_0(x)  q(1,x)
-
-#define fm_01   ffm_ef
-#define fm_11   ffm_ef
-#define fm_21   ffm_5b
-#define fm_31   ffm_01
-#define q_1(x)  q(0,x)
-
-#define fm_02   ffm_5b
-#define fm_12   ffm_ef
-#define fm_22   ffm_01
-#define fm_32   ffm_ef
-#define q_2(x)  q(1,x)
-
-#define fm_03   ffm_5b
-#define fm_13   ffm_01
-#define fm_23   ffm_ef
-#define fm_33   ffm_5b
-#define q_3(x)  q(0,x)
-
-#define f_0(n,x)    ((u4byte)fm_0##n(x))
-#define f_1(n,x)    ((u4byte)fm_1##n(x) << 8)
-#define f_2(n,x)    ((u4byte)fm_2##n(x) << 16)
-#define f_3(n,x)    ((u4byte)fm_3##n(x) << 24)
-
-#define mds(n,x)    f_0(n,q_##n(x)) ^ f_1(n,q_##n(x)) ^ f_2(n,q_##n(x)) ^ f_3(n,q_##n(x))
-
-#endif
-
-u4byte h_fun(TwofishContext *ctx, const u4byte x, const u4byte key[])
-{   u4byte  b0, b1, b2, b3;
-
-#ifndef M_TABLE
-    u4byte  m5b_b0, m5b_b1, m5b_b2, m5b_b3;
-    u4byte  mef_b0, mef_b1, mef_b2, mef_b3;
-#endif
-
-    b0 = byte(x, 0); b1 = byte(x, 1); b2 = byte(x, 2); b3 = byte(x, 3);
-
-    switch(ctx->k_len)
-    {
-    case 4: b0 = q(1, b0) ^ byte(key[3],0);
-            b1 = q(0, b1) ^ byte(key[3],1);
-            b2 = q(0, b2) ^ byte(key[3],2);
-            b3 = q(1, b3) ^ byte(key[3],3);
-    case 3: b0 = q(1, b0) ^ byte(key[2],0);
-            b1 = q(1, b1) ^ byte(key[2],1);
-            b2 = q(0, b2) ^ byte(key[2],2);
-            b3 = q(0, b3) ^ byte(key[2],3);
-    case 2: b0 = q(0,q(0,b0) ^ byte(key[1],0)) ^ byte(key[0],0);
-            b1 = q(0,q(1,b1) ^ byte(key[1],1)) ^ byte(key[0],1);
-            b2 = q(1,q(0,b2) ^ byte(key[1],2)) ^ byte(key[0],2);
-            b3 = q(1,q(1,b3) ^ byte(key[1],3)) ^ byte(key[0],3);
-    }
-#ifdef  M_TABLE
-
-    return  mds(0, b0) ^ mds(1, b1) ^ mds(2, b2) ^ mds(3, b3);
-
-#else
-
-    b0 = q(1, b0); b1 = q(0, b1); b2 = q(1, b2); b3 = q(0, b3);
-    m5b_b0 = ffm_5b(b0); m5b_b1 = ffm_5b(b1); m5b_b2 = ffm_5b(b2); m5b_b3 = ffm_5b(b3);
-    mef_b0 = ffm_ef(b0); mef_b1 = ffm_ef(b1); mef_b2 = ffm_ef(b2); mef_b3 = ffm_ef(b3);
-    b0 ^= mef_b1 ^ m5b_b2 ^ m5b_b3; b3 ^= m5b_b0 ^ mef_b1 ^ mef_b2;
-    b2 ^= mef_b0 ^ m5b_b1 ^ mef_b3; b1 ^= mef_b0 ^ mef_b2 ^ m5b_b3;
-
-    return b0 | (b3 << 8) | (b2 << 16) | (b1 << 24);
-
-#endif
-}
-
-#ifdef  MK_TABLE
-
-#ifdef  ONE_STEP
-u4byte  mk_tab[4][256];
-#else
-u1byte  sb[4][256];
-#endif
-
-#define q20(x)  q(0,q(0,x) ^ byte(key[1],0)) ^ byte(key[0],0)
-#define q21(x)  q(0,q(1,x) ^ byte(key[1],1)) ^ byte(key[0],1)
-#define q22(x)  q(1,q(0,x) ^ byte(key[1],2)) ^ byte(key[0],2)
-#define q23(x)  q(1,q(1,x) ^ byte(key[1],3)) ^ byte(key[0],3)
-
-#define q30(x)  q(0,q(0,q(1, x) ^ byte(key[2],0)) ^ byte(key[1],0)) ^ byte(key[0],0)
-#define q31(x)  q(0,q(1,q(1, x) ^ byte(key[2],1)) ^ byte(key[1],1)) ^ byte(key[0],1)
-#define q32(x)  q(1,q(0,q(0, x) ^ byte(key[2],2)) ^ byte(key[1],2)) ^ byte(key[0],2)
-#define q33(x)  q(1,q(1,q(0, x) ^ byte(key[2],3)) ^ byte(key[1],3)) ^ byte(key[0],3)
-
-#define q40(x)  q(0,q(0,q(1, q(1, x) ^ byte(key[3],0)) ^ byte(key[2],0)) ^ byte(key[1],0)) ^ byte(key[0],0)
-#define q41(x)  q(0,q(1,q(1, q(0, x) ^ byte(key[3],1)) ^ byte(key[2],1)) ^ byte(key[1],1)) ^ byte(key[0],1)
-#define q42(x)  q(1,q(0,q(0, q(0, x) ^ byte(key[3],2)) ^ byte(key[2],2)) ^ byte(key[1],2)) ^ byte(key[0],2)
-#define q43(x)  q(1,q(1,q(0, q(1, x) ^ byte(key[3],3)) ^ byte(key[2],3)) ^ byte(key[1],3)) ^ byte(key[0],3)
-
-void gen_mk_tab(TwofishContext *ctx, u4byte key[])
-{   u4byte  i;
-    u1byte  by;
-
-    switch(ctx->k_len)
-    {
-    case 2: for(i = 0; i < 256; ++i)
-            {
-                by = (u1byte)i;
-#ifdef ONE_STEP
-                mk_tab[0][i] = mds(0, q20(by)); mk_tab[1][i] = mds(1, q21(by));
-                mk_tab[2][i] = mds(2, q22(by)); mk_tab[3][i] = mds(3, q23(by));
-#else
-                sb[0][i] = q20(by); sb[1][i] = q21(by);
-                sb[2][i] = q22(by); sb[3][i] = q23(by);
-#endif
-            }
-            break;
-
-    case 3: for(i = 0; i < 256; ++i)
-            {
-                by = (u1byte)i;
-#ifdef ONE_STEP
-                mk_tab[0][i] = mds(0, q30(by)); mk_tab[1][i] = mds(1, q31(by));
-                mk_tab[2][i] = mds(2, q32(by)); mk_tab[3][i] = mds(3, q33(by));
-#else
-                sb[0][i] = q30(by); sb[1][i] = q31(by);
-                sb[2][i] = q32(by); sb[3][i] = q33(by);
-#endif
-            }
-            break;
-
-    case 4: for(i = 0; i < 256; ++i)
-            {
-                by = (u1byte)i;
-#ifdef ONE_STEP
-                mk_tab[0][i] = mds(0, q40(by)); mk_tab[1][i] = mds(1, q41(by));
-                mk_tab[2][i] = mds(2, q42(by)); mk_tab[3][i] = mds(3, q43(by));
-#else
-                sb[0][i] = q40(by); sb[1][i] = q41(by);
-                sb[2][i] = q42(by); sb[3][i] = q43(by);
-#endif
-            }
-    }
-}
-
-#  ifdef ONE_STEP
-#    define g0_fun(x) ( mk_tab[0][byte(x,0)] ^ mk_tab[1][byte(x,1)] \
-                      ^ mk_tab[2][byte(x,2)] ^ mk_tab[3][byte(x,3)] )
-#    define g1_fun(x) ( mk_tab[0][byte(x,3)] ^ mk_tab[1][byte(x,0)] \
-                      ^ mk_tab[2][byte(x,1)] ^ mk_tab[3][byte(x,2)] )
-#  else
-#    define g0_fun(x) ( mds(0, sb[0][byte(x,0)]) ^ mds(1, sb[1][byte(x,1)]) \
-                      ^ mds(2, sb[2][byte(x,2)]) ^ mds(3, sb[3][byte(x,3)]) )
-#    define g1_fun(x) ( mds(0, sb[0][byte(x,3)]) ^ mds(1, sb[1][byte(x,0)]) \
-                      ^ mds(2, sb[2][byte(x,1)]) ^ mds(3, sb[3][byte(x,2)]) )
-#  endif
-
-#else
-
-#define g0_fun(x)   h_fun(ctx,x,s_key)
-#define g1_fun(x)   h_fun(ctx,rotl(x,8),s_key)
-
-#endif
-
-/* The (12,8) Reed Soloman code has the generator polynomial
-
-  g(x) = x^4 + (a + 1/a) * x^3 + a * x^2 + (a + 1/a) * x + 1
-
-where the coefficients are in the finite field GF(2^8) with a
-modular polynomial a^8 + a^6 + a^3 + a^2 + 1. To generate the
-remainder we have to start with a 12th order polynomial with our
-eight input bytes as the coefficients of the 4th to 11th terms.
-That is:
-
-  m[7] * x^11 + m[6] * x^10 ... + m[0] * x^4 + 0 * x^3 +... + 0
-
-We then multiply the generator polynomial by m[7] * x^7 and subtract
-it - xor in GF(2^8) - from the above to eliminate the x^7 term (the
-artihmetic on the coefficients is done in GF(2^8). We then multiply
-the generator polynomial by x^6 * coeff(x^10) and use this to remove
-the x^10 term. We carry on in this way until the x^4 term is removed
-so that we are left with:
-
-  r[3] * x^3 + r[2] * x^2 + r[1] 8 x^1 + r[0]
-
-which give the resulting 4 bytes of the remainder. This is equivalent
-to the matrix multiplication in the Twofish description but much faster
-to implement.
-
-*/
-
-#define G_MOD   0x0000014d
-
-u4byte mds_rem(u4byte p0, u4byte p1)
-{   u4byte  i, t, u;
-
-    for(i = 0; i < 8; ++i)
-    {
-        t = p1 >> 24;   /* get most significant coefficient */
-
-        p1 = (p1 << 8) | (p0 >> 24); p0 <<= 8;  /* shift others up */
-
-        /* multiply t by a (the primitive element - i.e. left shift) */
-
-        u = (t << 1);
-
-        if(t & 0x80)            /* subtract modular polynomial on overflow */
-
-            u ^= G_MOD;
-
-        p1 ^= t ^ (u << 16);    /* remove t * (a * x^2 + 1) */
-
-        u ^= (t >> 1);          /* form u = a * t + t / a = t * (a + 1 / a); */
-
-        if(t & 0x01)            /* add the modular polynomial on underflow */
-
-            u ^= G_MOD >> 1;
-
-        p1 ^= (u << 24) | (u << 8); /* remove t * (a + 1/a) * (x^3 + x) */
-    }
-
-    return p1;
-}
-
-/* initialise the key schedule from the user supplied key   */
-
-u4byte *twofish_set_key(TwofishContext *ctx,
-                       const u4byte in_key[], const u4byte key_len)
-{
-    u4byte  i, a, b, me_key[4], mo_key[4];
-    u4byte *l_key = ctx->l_key;
-    u4byte *s_key = ctx->s_key;
-
-#ifdef Q_TABLES
-    if(!qt_gen)
-    {
-        gen_qtab(); qt_gen = 1;
-    }
-#endif
-
-#ifdef M_TABLE
-    if(!mt_gen)
-    {
-        gen_mtab(); mt_gen = 1;
-    }
-#endif
-
-    ctx->k_len = ctx->k_len = key_len / 64;   /* 2, 3 or 4 */
-
-    for(i = 0; i < ctx->k_len; ++i)
-    {
-        a = in_key[i + i];     me_key[i] = a;
-        b = in_key[i + i + 1]; mo_key[i] = b;
-        s_key[ctx->k_len - i - 1] = mds_rem(a, b);
-    }
-
-    for(i = 0; i < 40; i += 2)
-    {
-        a = 0x01010101 * i; b = a + 0x01010101;
-        a = h_fun(ctx,a, me_key);
-        b = rotl(h_fun(ctx,b, mo_key), 8);
-        l_key[i] = a + b;
-        l_key[i + 1] = rotl(a + 2 * b, 9);
-    }
-
-#ifdef MK_TABLE
-    gen_mk_tab(ctx,s_key);
-#endif
-
-    return l_key;
-}
-
-/* encrypt a block of text  */
-
-#define f_rnd(i)                                                    \
-    t1 = g1_fun(blk[1]); t0 = g0_fun(blk[0]);                       \
-    blk[2] = rotr(blk[2] ^ (t0 + t1 + l_key[4 * (i) + 8]), 1);      \
-    blk[3] = rotl(blk[3], 1) ^ (t0 + 2 * t1 + l_key[4 * (i) + 9]);  \
-    t1 = g1_fun(blk[3]); t0 = g0_fun(blk[2]);                       \
-    blk[0] = rotr(blk[0] ^ (t0 + t1 + l_key[4 * (i) + 10]), 1);     \
-    blk[1] = rotl(blk[1], 1) ^ (t0 + 2 * t1 + l_key[4 * (i) + 11])
-
-void twofish_encrypt(TwofishContext *ctx,
-                    const u4byte in_blk[4], u4byte out_blk[])
-{
-    u4byte  t0, t1, blk[4];
-    u4byte *l_key = ctx->l_key;
-    u4byte *s_key = ctx->s_key;
-
-    blk[0] = in_blk[0] ^ l_key[0];
-    blk[1] = in_blk[1] ^ l_key[1];
-    blk[2] = in_blk[2] ^ l_key[2];
-    blk[3] = in_blk[3] ^ l_key[3];
-
-    f_rnd(0); f_rnd(1); f_rnd(2); f_rnd(3);
-    f_rnd(4); f_rnd(5); f_rnd(6); f_rnd(7);
-
-    out_blk[0] = blk[2] ^ l_key[4];
-    out_blk[1] = blk[3] ^ l_key[5];
-    out_blk[2] = blk[0] ^ l_key[6];
-    out_blk[3] = blk[1] ^ l_key[7];
-}
-
-/* decrypt a block of text  */
-
-#define i_rnd(i)                                                        \
-        t1 = g1_fun(blk[1]); t0 = g0_fun(blk[0]);                       \
-        blk[2] = rotl(blk[2], 1) ^ (t0 + t1 + l_key[4 * (i) + 10]);     \
-        blk[3] = rotr(blk[3] ^ (t0 + 2 * t1 + l_key[4 * (i) + 11]), 1); \
-        t1 = g1_fun(blk[3]); t0 = g0_fun(blk[2]);                       \
-        blk[0] = rotl(blk[0], 1) ^ (t0 + t1 + l_key[4 * (i) +  8]);     \
-        blk[1] = rotr(blk[1] ^ (t0 + 2 * t1 + l_key[4 * (i) +  9]), 1)
-
-void twofish_decrypt(TwofishContext *ctx,
-                    const u4byte in_blk[4], u4byte out_blk[4])
-{
-    u4byte  t0, t1, blk[4];
-    u4byte *l_key = ctx->l_key;
-    u4byte *s_key = ctx->s_key;
-
-    blk[0] = in_blk[0] ^ l_key[4];
-    blk[1] = in_blk[1] ^ l_key[5];
-    blk[2] = in_blk[2] ^ l_key[6];
-    blk[3] = in_blk[3] ^ l_key[7];
-
-    i_rnd(7); i_rnd(6); i_rnd(5); i_rnd(4);
-    i_rnd(3); i_rnd(2); i_rnd(1); i_rnd(0);
-
-    out_blk[0] = blk[2] ^ l_key[0];
-    out_blk[1] = blk[3] ^ l_key[1];
-    out_blk[2] = blk[0] ^ l_key[2];
-    out_blk[3] = blk[1] ^ l_key[3];
-}
diff --git a/lib/silccrypt/twofish.h b/lib/silccrypt/twofish.h
deleted file mode 100644 (file)
index afdcecd..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
-
-  twofish.h
-
-  Author: Pekka Riikonen <priikone@silcnet.org>
-
-  Copyright (C) 1997 - 2007 Pekka Riikonen
-
-  This program is free software; you can redistribute it and/or modify
-  it under the terms of the GNU General Public License as published by
-  the Free Software Foundation; version 2 of the License.
-
-  This program is distributed in the hope that it will be useful,
-  but WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-  GNU General Public License for more details.
-
-*/
-
-#ifndef TWOFISH_H
-#define TWOFISH_H
-
-/*
- * SILC Crypto API for Twofish
- */
-
-SILC_CIPHER_API_SET_KEY(twofish_cbc);
-SILC_CIPHER_API_SET_IV(twofish_cbc);
-SILC_CIPHER_API_CONTEXT_LEN(twofish_cbc);
-SILC_CIPHER_API_ENCRYPT(twofish_cbc);
-SILC_CIPHER_API_DECRYPT(twofish_cbc);
-
-#endif
diff --git a/lib/silccrypt/twofish_internal.h b/lib/silccrypt/twofish_internal.h
deleted file mode 100644 (file)
index c0071ac..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
-
-  twofish_internal.h
-
-  Author: Pekka Riikonen <priikone@silcnet.org>
-
-  Copyright (C) 1997 - 2000 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 TWOFISH_INTERNAL_H
-#define TWOFISH_INTERNAL_H
-
-#include "ciphers_def.h"
-
-/* Cipher's context */
-typedef struct {
-  u4byte k_len;
-  u4byte l_key[40];
-  u4byte s_key[4];
-} TwofishContext;
-
-/* Prototypes */
-u4byte *twofish_set_key(TwofishContext *ctx,
-                       const u4byte in_key[], const u4byte key_len);
-void twofish_encrypt(TwofishContext *ctx,
-                    const u4byte in_blk[4], u4byte out_blk[]);
-void twofish_decrypt(TwofishContext *ctx,
-                    const u4byte in_blk[4], u4byte out_blk[4]);
-
-#endif
diff --git a/lib/silchttp/DIRECTORY b/lib/silchttp/DIRECTORY
deleted file mode 100644 (file)
index ff8017e..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-<!--
-@LIBRARY=SILC HTTP Library
-@FILENAME=silchttplib.html
-@LINK=silchttpserver.html:SILC HTTP Server Interface
-@LINK=silchttpphp.html:SILC HTTP PHP Translator
--->
-
-<big><b>SILC HTTP Library</b></big>
-<br />
-<small>Directory: lib/silchttp/</small>
-<br />
-<small>Library: libhttp.a, libhttp.lib</small>
-<br /><br />
-<b>Introduction</b>
-
-<br /><br />
-SILC HTTP Library provides currently interface for very simple HTTP 
-Server.  It also provides support to serve PHP pages through the server.
-
-<br /><br />
-@LINKS@
diff --git a/lib/silchttp/Makefile.ad b/lib/silchttp/Makefile.ad
deleted file mode 100644 (file)
index 030e478..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-#
-#  Makefile.ad
-#
-#  Author: Pekka Riikonen <priikone@silcnet.org>
-#
-#  Copyright (C) 2006 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.
-#
-
-AUTOMAKE_OPTIONS = 1.0 no-dependencies foreign
-
-noinst_LTLIBRARIES = libsilchttp.la
-
-libsilchttp_la_SOURCES =       \
-       silchttpserver.c        \
-       silchttpphp.c
-
-#ifdef SILC_DIST_TOOLKIT
-include_HEADERS =              \
-       silchttpserver.h        \
-       silchttpphp.h
-
-SILC_EXTRA_DIST = tests
-#endif SILC_DIST_TOOLKIT
-
-EXTRA_DIST = *.h $(SILC_EXTRA_DIST)
-
-include $(top_srcdir)/Makefile.defines.in
diff --git a/lib/silchttp/silchttpphp.c b/lib/silchttp/silchttpphp.c
deleted file mode 100644 (file)
index d1cb24e..0000000
+++ /dev/null
@@ -1,121 +0,0 @@
-/*
-
-  silchttpphp.c
-
-  Author: Pekka Riikonen <priikone@silcnet.org>
-
-  Copyright (C) 2006 - 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.
-
-*/
-
-#include "silc.h"
-#include "silchttpphp.h"
-
-/* Executes PHP code and returns result */
-
-SilcBuffer silc_http_php(char *php_data)
-{
-  SilcBuffer ret;
-  char *name, tmp[32];
-
-  /* Write the PHP data to temporary file */
-#ifdef SILC_WIN32
-  name = _mktemp("silchttpphpXXXXXX");
-  if (!name)
-    return NULL;
-#else
-  memset(tmp, 0, sizeof(tmp));
-  silc_snprintf(tmp, sizeof(tmp) - 1, "/tmp/silchttpphpXXXXXX");
-  if (mkstemp(tmp) == -1)
-    return NULL;
-  name = tmp;
-#endif /* SILC_WIN32 */
-
-  silc_file_writefile_mode(name, php_data, strlen(php_data), 0600);
-
-  /* Execute PHP */
-  ret = silc_http_php_file(name);
-
-#ifdef SILC_WIN32
-  _unlink(name);
-#else
-  unlink(name);
-#endif /* SILC_WIN32 */
-
-  return ret;
-}
-
-/* Loads PHP file and executes the PHP code and returns the result */
-
-SilcBuffer silc_http_php_file(const char *filename)
-{
-  SilcBuffer ret = NULL;
-  unsigned char tmp[8192];
-  FILE *fd;
-  int len;
-
-  SILC_LOG_DEBUG(("Executing PHP"));
-
-  memset(tmp, 0, sizeof(tmp));
-  silc_snprintf(tmp, sizeof(tmp) - 1, "php -f %s", filename);
-
-#ifdef SILC_WIN32
-  fd = _popen(tmp, "r");
-#else
-  fd = popen(tmp, "r");
-#endif /* SILC_WIN32 */
-  if (!fd)
-    return NULL;
-
-  /* Read the result */
-  do {
-    len = fread(tmp, 1, sizeof(tmp), fd);
-    if (len < 0) {
-      silc_buffer_free(ret);
-#ifdef SILC_WIN32\r
-      _pclose(fd);
-#else\r
-      pclose(fd);\r
-#endif /* SILC_WIN32 */\r
-      return NULL;
-    }
-
-    if (len) {
-      if (!ret) {
-       ret = silc_buffer_alloc(0);
-       if (!ret) {
-#ifdef SILC_WIN32\r
-      _pclose(fd);\r
-#else\r
-      pclose(fd);\r
-#endif /* SILC_WIN32 */\r
-         return NULL;
-       }
-      }
-
-      silc_buffer_format(ret,
-                        SILC_STR_ADVANCE,
-                        SILC_STR_DATA(tmp, len),
-                        SILC_STR_END);
-    }
-  } while (len);
-
-  if (ret) {
-    silc_buffer_format(ret,
-                      SILC_STR_ADVANCE,
-                      SILC_STR_DATA('\0', 1),
-                      SILC_STR_END);
-    silc_buffer_push(ret, silc_buffer_truelen(ret));
-  }
-
-  return ret;
-}
diff --git a/lib/silchttp/silchttpphp.h b/lib/silchttp/silchttpphp.h
deleted file mode 100644 (file)
index ce3be14..0000000
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
-
-  silchttpphp.h
-
-  Author: Pekka Riikonen <priikone@silcnet.org>
-
-  Copyright (C) 2006 - 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.
-
-*/
-
-/****h* silchttp/SILC HTTP PHP Translator
- *
- * DESCRIPTION
- *
- * PHP translator for SILC HTTP Server, enabling PHP support for the pages
- * served through the SILC HTTP Server interface (silchttpserver.h).
- * The PHP must be installed in the system and must be in the execution
- * path for the interface to work.
- *
- ***/
-
-#ifndef SILCHTTPPHP_H
-#define SILCHTTPPHP_H
-
-/****f* silchttp/SilcHTTPServer/silc_http_php
- *
- * SYNOPSIS
- *
- *    SilcBuffer silc_http_php(char *php_data);
- *
- * DESCRIPTION
- *
- *    Executes the PHP code contained in the buffer `php_data' and returns
- *    the result in the allocated SilcBuffer or NULL on error.  The caller
- *    must free the returned buffer.
- *
- ***/
-SilcBuffer silc_http_php(char *php_data);
-
-/****f* silchttp/SilcHTTPServer/silc_http_php_file
- *
- * SYNOPSIS
- *
- *    SilcBuffer silc_http_php_file(const char *filepath);
- *
- * DESCRIPTION
- *
- *    Reads the PHP contents from the file indicated by the `filepath' and
- *    executes the PHP code and returns the result in the allocated
- *    SilcBuffer or NULL on error.  The caller must free the returned buffer.
- *
- ***/
-SilcBuffer silc_http_php_file(const char *filename);
-
-#endif /* SILCHTTPPHP_H */
diff --git a/lib/silchttp/silchttpserver.c b/lib/silchttp/silchttpserver.c
deleted file mode 100644 (file)
index cd94c40..0000000
+++ /dev/null
@@ -1,637 +0,0 @@
-/*
-
-  silchttpserver.c
-
-  Author: Pekka Riikonen <priikone@silcnet.org>
-
-  Copyright (C) 2006 - 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.
-
-*/
-
-#include "silc.h"
-#include "silchttpserver.h"
-
-/************************** Types and definitions ***************************/
-
-#define SILC_HTTP_SERVER_TIMEOUT  120   /* Connection timeout */
-#define SILC_HTTP_SERVER_CONNS    2    /* Default number of connections */
-#define SILC_HTTP_SERVER_BUFLEN   1024  /* Default data buffer length */
-#define SILC_HTTP_SERVER_HEADER   "HTTP/1.1 200 OK\r\nServer: SILCHTTP/1.0\r\n"
-
-/* HTTP server context */
-struct SilcHttpServerStruct {
-  SilcNetListener listener;        /* Server listener */
-  SilcSchedule schedule;           /* Scheduler */
-  SilcList allconns;               /* All connections */
-  SilcList conns;                  /* Connection free list */
-  SilcHttpServerCallback callback;  /* Requset callback */
-  void *context;                   /* Request callback context */
-};
-
-/* HTTP connection context */
-struct SilcHttpConnectionStruct {
-  struct SilcHttpConnectionStruct *next;
-  struct SilcHttpConnectionStruct *next2;
-  SilcHttpServer httpd;                    /* Server */
-  SilcStream stream;               /* Connection stream */
-  SilcBuffer inbuf;                /* Read data buffer */
-  SilcBuffer outbuf;               /* Write data buffer */
-  SilcInt64 touched;               /* Time last connection was touched */
-  SilcMime curheaders;             /* HTTP request headers */
-  SilcMime headers;                /* HTTP reply headers */
-  unsigned char *hptr;             /* Pointer to start of headers */
-  char *method;                            /* Method */
-  char *uri;                       /* URI */
-  unsigned int keepalive    : 1;    /* Keep alive */
-};
-
-/************************ Static utility functions **************************/
-
-/* Close HTTP connection */
-
-static void silc_http_server_close_connection(SilcHttpConnection conn)
-{
-  if (conn->headers) {
-    silc_mime_free(conn->headers);
-    conn->headers = NULL;
-  }
-  if (conn->curheaders) {
-    silc_mime_free(conn->curheaders);
-    conn->curheaders = NULL;
-  }
-  silc_buffer_clear(conn->inbuf);
-  silc_buffer_clear(conn->outbuf);
-  silc_buffer_reset(conn->inbuf);
-  silc_buffer_reset(conn->outbuf);
-  conn->hptr = conn->method = conn->uri = NULL;
-
-  if (conn->keepalive)
-    return;
-
-  SILC_LOG_DEBUG(("Closing HTTP connection %p", conn));
-
-  silc_schedule_task_del_by_context(conn->httpd->schedule, conn);
-  silc_stream_set_notifier(conn->stream, conn->httpd->schedule, NULL, NULL);
-  silc_stream_destroy(conn->stream);
-  conn->stream = NULL;
-
-  /* Add to free list */
-  silc_list_add(conn->httpd->conns, conn);
-}
-
-/* Parse HTTP data */
-
-static SilcBool silc_http_server_parse(SilcHttpServer httpd,
-                                      SilcHttpConnection conn)
-{
-  SilcUInt32 data_len, cll;
-  unsigned char *data, *tmp;
-  const char *value, *cl;
-  SilcBufferStruct postdata;
-  int i;
-
-  SILC_LOG_DEBUG(("Parsing HTTP data"));
-
-  data = silc_buffer_data(conn->inbuf);
-  data_len = silc_buffer_len(conn->inbuf);
-
-  /* Check for end of headers */
-  for (i = 0; i < data_len ; i++) {
-    if (data_len - i >= 4 &&
-       data[i    ] == '\r' && data[i + 1] == '\n' &&
-       data[i + 2] == '\r' && data[i + 3] == '\n')
-      break;
-  }
-  if (i == data_len)
-    return TRUE;
-
-  SILC_LOG_HEXDUMP(("HTTP data"), silc_buffer_data(conn->inbuf),
-                  silc_buffer_len(conn->inbuf));
-
-  if (!conn->method && !conn->uri) {
-    tmp = memchr(data, '\n', data_len);
-    if (!tmp || tmp[-1] != '\r') {
-      if (data_len < SILC_HTTP_SERVER_BUFLEN)
-       return TRUE;
-      return FALSE;
-    }
-    *tmp = 0;
-
-    /* Get method */
-    if (strchr(data, ' '))
-      *strchr(data, ' ') = 0;
-    conn->method = data;
-    SILC_LOG_DEBUG(("Method: '%s'", conn->method));
-
-    /* Get URI */
-    tmp = memchr(data, '\0', data_len);
-    if (!tmp) {
-      if (data_len < SILC_HTTP_SERVER_BUFLEN)
-       return TRUE;
-      return FALSE;
-    }
-    tmp++;
-    if (strchr(tmp, ' '))
-      *strchr(tmp, ' ') = 0;
-    conn->uri = tmp;
-    SILC_LOG_DEBUG(("URI: '%s'", conn->uri));
-
-    /* Protocol version compatibility */
-    tmp = ((unsigned char *)memchr(tmp, '\0', data_len - (tmp - data))) + 1;
-    SILC_LOG_DEBUG(("Protocol: %s", tmp));
-    if (strstr(tmp, "HTTP/1.0"))
-      conn->keepalive = FALSE;
-    if (strstr(tmp, "HTTP/1.1"))
-      conn->keepalive = TRUE;
-    if (strstr(tmp, "HTTP/1.2"))
-      conn->keepalive = TRUE;
-
-    /* Get HTTP headers */
-    tmp = memchr(tmp, '\0', data_len - (tmp - data));
-    if (!tmp) {
-      if (data_len < SILC_HTTP_SERVER_BUFLEN)
-       return TRUE;
-      return FALSE;
-    }
-    if (data_len - (tmp - data) < 2) {
-      if (data_len < SILC_HTTP_SERVER_BUFLEN)
-       return TRUE;
-      return FALSE;
-    }
-    conn->hptr = ++tmp;
-  }
-
-  /* Parse headers and data area */
-  conn->curheaders = silc_mime_decode(NULL, conn->hptr,
-                                     data_len - (conn->hptr - data));
-  if (!conn->curheaders)
-    return FALSE;
-
-  /* Check for persistent connection */
-  value = silc_mime_get_field(conn->curheaders, "Connection");
-  if (value && !strcasecmp(value, "close"))
-    conn->keepalive = FALSE;
-
-  /* Deliver request to caller */
-  if (!strcasecmp(conn->method, "GET") || !strcasecmp(conn->method, "HEAD")) {
-    httpd->callback(httpd, conn, conn->uri, conn->method,
-                   NULL, httpd->context);
-
-  } else if (!strcasecmp(conn->method, "POST")) {
-    /* Get POST data */
-    tmp = (unsigned char *)silc_mime_get_data(conn->curheaders, &data_len);
-    if (!tmp)
-      return FALSE;
-
-    /* Check we have received all data */
-    cl = silc_mime_get_field(conn->curheaders, "Content-Length");
-    if (cl && sscanf(cl, "%lu", (unsigned long *)&cll) == 1) {
-      if (data_len < cll) {
-       /* More data to come */
-       silc_mime_free(conn->curheaders);
-       conn->curheaders = NULL;
-       return TRUE;
-      }
-    }
-
-    silc_buffer_set(&postdata, tmp, data_len);
-    SILC_LOG_HEXDUMP(("HTTP POST data"), tmp, data_len);
-
-    httpd->callback(httpd, conn, conn->uri, conn->method,
-                   &postdata, httpd->context);
-  } else {
-    /* Send bad request */
-    silc_http_server_send_error(httpd, conn, "400 Bad Request",
-                               "<body><h1>400 Bad Request</h1><body>");
-    return TRUE;
-  }
-
-  return TRUE;
-}
-
-/* Send HTTP data to connection */
-
-static SilcBool silc_http_server_send_internal(SilcHttpServer httpd,
-                                              SilcHttpConnection conn,
-                                              SilcBuffer data,
-                                              SilcBool headers)
-{
-  int ret;
-
-  SILC_LOG_HEXDUMP(("HTTP data"), silc_buffer_data(data),
-                  silc_buffer_len(data));
-
-  /* Write the packet to the stream */
-  while (silc_buffer_len(data) > 0) {
-    ret = silc_stream_write(conn->stream, silc_buffer_data(data),
-                           silc_buffer_len(data));
-    if (ret == 0 || ret == - 2)
-      return FALSE;
-
-    if (ret == -1) {
-      /* Cannot write now, write later. */
-      if (silc_buffer_len(data) - ret >= silc_buffer_taillen(conn->outbuf))
-       if (!silc_buffer_realloc(conn->outbuf,
-                                silc_buffer_truelen(conn->outbuf) +
-                                silc_buffer_len(data) - ret)) {
-         conn->keepalive = FALSE;
-         silc_http_server_close_connection(conn);
-         return FALSE;
-       }
-      silc_buffer_pull_tail(conn->outbuf, silc_buffer_len(data) - ret);
-      silc_buffer_put(conn->outbuf, silc_buffer_data(data) + ret,
-                     silc_buffer_len(data) - ret);
-      return TRUE;
-    }
-
-    /* Wrote data */
-    silc_buffer_pull(data, ret);
-  }
-
-  if (!headers) {
-    /* Data sent, close connection */
-    SILC_LOG_DEBUG(("Data sent %p", conn));
-    silc_http_server_close_connection(conn);
-  }
-
-  return TRUE;
-}
-
-/* Allocate connection context */
-
-static SilcHttpConnection silc_http_server_alloc_connection(void)
-{
-  SilcHttpConnection conn;
-
-  conn = silc_calloc(1, sizeof(*conn));
-  if (!conn)
-    return NULL;
-
-  conn->inbuf = silc_buffer_alloc(SILC_HTTP_SERVER_BUFLEN);
-  if (!conn->inbuf) {
-    silc_free(conn);
-    return NULL;
-  }
-
-  conn->outbuf = silc_buffer_alloc(SILC_HTTP_SERVER_BUFLEN);
-  if (!conn->outbuf) {
-    silc_buffer_free(conn->inbuf);
-    silc_free(conn);
-    return NULL;
-  }
-
-  silc_buffer_reset(conn->inbuf);
-  silc_buffer_reset(conn->outbuf);
-
-  return conn;
-}
-
-/* Check if connection has timedout */
-
-SILC_TASK_CALLBACK(silc_http_server_connection_timeout)
-{
-  SilcHttpConnection conn = context;
-  SilcInt64 curtime = silc_time();
-
-  if (curtime - conn->touched > SILC_HTTP_SERVER_TIMEOUT) {
-    SILC_LOG_DEBUG(("Connection timeout %p", conn));
-    conn->keepalive = FALSE;
-    silc_http_server_close_connection(conn);
-    return;
-  }
-
-  silc_schedule_task_add_timeout(conn->httpd->schedule,
-                                silc_http_server_connection_timeout, conn,
-                                SILC_HTTP_SERVER_TIMEOUT, 0);
-}
-
-/* Data I/O callback */
-
-static void silc_http_server_io(SilcStream stream, SilcStreamStatus status,
-                               void *context)
-{
-  SilcHttpConnection conn = context;
-  SilcHttpServer httpd = conn->httpd;
-  int ret;
-
-  switch (status) {
-  case SILC_STREAM_CAN_READ:
-    SILC_LOG_DEBUG(("Read HTTP data %p", conn));
-
-    conn->touched = silc_time();
-
-    /* Make sure we have fair amount of free space in inbuf */
-    if (silc_buffer_taillen(conn->inbuf) < SILC_HTTP_SERVER_BUFLEN)
-      if (!silc_buffer_realloc(conn->inbuf, silc_buffer_truelen(conn->inbuf) +
-                              SILC_HTTP_SERVER_BUFLEN * 2)) {
-       conn->keepalive = FALSE;
-       silc_http_server_close_connection(conn);
-       return;
-      }
-
-    /* Read data from stream */
-    ret = silc_stream_read(conn->stream, conn->inbuf->tail,
-                          silc_buffer_taillen(conn->inbuf));
-
-    if (ret == 0 || ret == -2) {
-      conn->keepalive = FALSE;
-      silc_http_server_close_connection(conn);
-      return;
-    }
-
-    if (ret == -1) {
-      /* Cannot read now, do it later. */
-      silc_buffer_pull(conn->inbuf, silc_buffer_len(conn->inbuf));
-      return;
-    }
-
-    SILC_LOG_DEBUG(("Read %d bytes data", ret));
-
-    /* Parse the data */
-    silc_buffer_pull_tail(conn->inbuf, ret);
-    if (!silc_http_server_parse(httpd, conn)) {
-      conn->keepalive = FALSE;
-      silc_http_server_close_connection(conn);
-    }
-
-    break;
-
-  case SILC_STREAM_CAN_WRITE:
-    SILC_LOG_DEBUG(("Write HTTP data %p", conn));
-
-    conn->touched = silc_time();
-
-    /* Write pending data to stream */
-    while (silc_buffer_len(conn->outbuf) > 0) {
-      ret = silc_stream_write(conn->stream, silc_buffer_data(conn->outbuf),
-                             silc_buffer_len(conn->outbuf));
-
-      if (ret == 0 || ret == -2) {
-       conn->keepalive = FALSE;
-       silc_http_server_close_connection(conn);
-       return;
-      }
-
-      if (ret == -1)
-       /* Cannot write now, write later. */
-       return;
-
-      /* Wrote data */
-      silc_buffer_pull(conn->outbuf, ret);
-    }
-
-    /* Data sent, close connection */
-    SILC_LOG_DEBUG(("Data sent"));
-    silc_http_server_close_connection(conn);
-    break;
-
-  default:
-    conn->keepalive = FALSE;
-    silc_http_server_close_connection(conn);
-    break;
-  }
-}
-
-/* Accepts new connection */
-
-static void silc_http_server_new_connection(SilcNetStatus status,
-                                           SilcStream stream,
-                                           void *context)
-{
-  SilcHttpServer httpd = context;
-  SilcHttpConnection conn;
-  const char *hostname = NULL, *ip = NULL;
-
-  /* Get free connection */
-  silc_list_start(httpd->conns);
-  conn = silc_list_get(httpd->conns);
-  if (!conn) {
-    /* Add new connection */
-    conn = silc_http_server_alloc_connection();
-    if (!conn) {
-      silc_stream_destroy(stream);
-      return;
-    }
-    silc_list_add(httpd->allconns, conn);
-  }
-  silc_list_del(httpd->conns, conn);
-
-  conn->httpd = httpd;
-  conn->stream = stream;
-
-  silc_socket_stream_get_info(stream, NULL, &hostname, &ip, NULL);
-  SILC_LOG_INFO(("HTTPD: New connection %s (%s)", hostname, ip));
-  SILC_LOG_DEBUG(("New connection %p", conn));
-
-  /* Schedule the connection for data I/O */
-  silc_stream_set_notifier(stream, httpd->schedule, silc_http_server_io, conn);
-
-  /* Add connection timeout check */
-  silc_schedule_task_add_timeout(httpd->schedule,
-                                silc_http_server_connection_timeout, conn,
-                                SILC_HTTP_SERVER_TIMEOUT, 0);
-}
-
-
-/******************************* Public API *********************************/
-
-/* Allocate HTTP server */
-
-SilcHttpServer silc_http_server_alloc(const char *ip, SilcUInt16 port,
-                                     SilcSchedule schedule,
-                                     SilcHttpServerCallback callback,
-                                     void *context)
-{
-  SilcHttpServer httpd;
-  SilcHttpConnection conn;
-  int i;
-
-  SILC_LOG_DEBUG(("Start HTTP server at %s:%d", ip, port));
-
-  if (!ip || !schedule || !callback)
-    return FALSE;
-
-  httpd = silc_calloc(1, sizeof(*httpd));
-  if (!httpd)
-    return NULL;
-
-  /* Create server listener */
-  httpd->listener =
-    silc_net_tcp_create_listener(&ip, 1, port, TRUE, FALSE, schedule,
-                                silc_http_server_new_connection, httpd);
-  if (!httpd->listener) {
-    SILC_LOG_ERROR(("Could not bind HTTP server at %s:%d", ip, port));
-    silc_http_server_free(httpd);
-    return NULL;
-  }
-
-  httpd->schedule = schedule;
-  httpd->callback = callback;
-  httpd->context = context;
-
-  silc_list_init(httpd->conns, struct SilcHttpConnectionStruct, next);
-  silc_list_init(httpd->allconns, struct SilcHttpConnectionStruct, next2);
-
-  /* Allocate connections list */
-  for (i = 0; i < SILC_HTTP_SERVER_CONNS; i++) {
-    conn = silc_http_server_alloc_connection();
-    if (!conn)
-      break;
-    silc_list_add(httpd->conns, conn);
-    silc_list_add(httpd->allconns, conn);
-    conn->httpd = httpd;
-  }
-
-  SILC_LOG_DEBUG(("HTTP Server started"));
-
-  return httpd;
-}
-
-/* Free HTTP server */
-
-void silc_http_server_free(SilcHttpServer httpd)
-{
-  SilcHttpConnection conn;
-
-  silc_list_start(httpd->allconns);
-  while ((conn = silc_list_get(httpd->allconns))) {
-    conn->keepalive = FALSE;
-    if (conn->httpd && conn->stream)
-      silc_http_server_close_connection(conn);
-    silc_buffer_free(conn->inbuf);
-    silc_buffer_free(conn->outbuf);
-    silc_free(conn);
-  }
-
-  if (httpd->listener)
-    silc_net_close_listener(httpd->listener);
-
-  silc_free(httpd);
-}
-
-/* Send HTTP data to connection */
-
-SilcBool silc_http_server_send(SilcHttpServer httpd,
-                              SilcHttpConnection conn,
-                              SilcBuffer data)
-{
-  SilcBufferStruct h;
-  unsigned char *headers, tmp[16];
-  SilcUInt32 headers_len;
-  SilcBool ret;
-
-  SILC_LOG_DEBUG(("Sending HTTP data"));
-
-  conn->touched = silc_time();
-
-  /* Write headers */
-  silc_buffer_set(&h, SILC_HTTP_SERVER_HEADER,
-                 strlen(SILC_HTTP_SERVER_HEADER));
-  ret = silc_http_server_send_internal(httpd, conn, &h, TRUE);
-  if (!ret) {
-    conn->keepalive = FALSE;
-    silc_http_server_close_connection(conn);
-    return FALSE;
-  }
-
-  if (!conn->headers) {
-    conn->headers = silc_mime_alloc();
-    if (!conn->headers) {
-      conn->keepalive = FALSE;
-      silc_http_server_close_connection(conn);
-      return FALSE;
-    }
-  }
-
-  silc_mime_add_field(conn->headers, "Last-Modified",
-                     silc_time_string(conn->touched));
-  silc_snprintf(tmp, sizeof(tmp), "%d", (int)silc_buffer_len(data));
-  silc_mime_add_field(conn->headers, "Content-Length", tmp);
-  if (conn->keepalive) {
-    silc_mime_add_field(conn->headers, "Connection", "keep-alive");
-    silc_snprintf(tmp, sizeof(tmp), "%d", (int)SILC_HTTP_SERVER_TIMEOUT);
-    silc_mime_add_field(conn->headers, "Keep-alive", tmp);
-  }
-
-  headers = silc_mime_encode(conn->headers, &headers_len);
-  if (headers) {
-    silc_buffer_set(&h, headers, headers_len);
-    if (!silc_http_server_send_internal(httpd, conn, &h, TRUE)) {
-      conn->keepalive = FALSE;
-      silc_http_server_close_connection(conn);
-      return FALSE;
-    }
-    silc_free(headers);
-  }
-
-  /* Write the page data */
-  return silc_http_server_send_internal(httpd, conn, data, FALSE);
-}
-
-/* Send error reply */
-
-SilcBool silc_http_server_send_error(SilcHttpServer httpd,
-                                    SilcHttpConnection conn,
-                                    const char *error,
-                                    const char *error_message)
-{
-  SilcBool ret;
-  SilcBufferStruct data;
-
-  memset(&data, 0, sizeof(data));
-  silc_buffer_strformat(&data,
-                       "HTTP/1.1 ", error, "\r\n\r\n", error_message,
-                       SILC_STRFMT_END);
-
-  /* Send the message */
-  ret = silc_http_server_send_internal(httpd, conn, &data, FALSE);
-
-  silc_buffer_purge(&data);
-
-  /* Close connection */
-  conn->keepalive = FALSE;
-  silc_http_server_close_connection(conn);
-
-  return ret;
-}
-
-/* Get field */
-
-const char *silc_http_server_get_header(SilcHttpServer httpd,
-                                       SilcHttpConnection conn,
-                                       const char *field)
-{
-  if (!conn->curheaders)
-    return NULL;
-  return silc_mime_get_field(conn->curheaders, field);
-}
-
-/* Add field */
-
-SilcBool silc_http_server_add_header(SilcHttpServer httpd,
-                                    SilcHttpConnection conn,
-                                    const char *field,
-                                    const char *value)
-{
-  SILC_LOG_DEBUG(("Adding header %s:%s", field, value));
-
-  if (!conn->headers) {
-    conn->headers = silc_mime_alloc();
-    if (!conn->headers) {
-      silc_http_server_close_connection(conn);
-      return FALSE;
-    }
-  }
-
-  silc_mime_add_field(conn->headers, field, value);
-  return TRUE;
-}
diff --git a/lib/silchttp/silchttpserver.h b/lib/silchttp/silchttpserver.h
deleted file mode 100644 (file)
index cfc87c1..0000000
+++ /dev/null
@@ -1,230 +0,0 @@
-/*
-
-  silchttpserver.h
-
-  Author: Pekka Riikonen <priikone@silcnet.org>
-
-  Copyright (C) 2006 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.
-
-*/
-
-/****h* silchttp/SILC HTTP Server Interface
- *
- * DESCRIPTION
- *
- * Very simple HTTP server interface.  This HTTP server supports basic HTTP
- * features.  All pages on the server are dynamically created by the caller
- * of this interface.  The server does not support plugins, modules, cgi-bin,
- * server-side includes or any other special features.  Naturally, the caller
- * of this interface may itself implement such features.
- *
- ***/
-
-#ifndef SILCHTTPSERVER_H
-#define SILCHTTPSERVER_H
-
-/****s* silchttp/SilcHTTPServer/SilcHttpServer
- *
- * NAME
- *
- *    typedef struct SilcHttpServerStruct *SilcHttpServer;
- *
- * DESCRIPTION
- *
- *    The actual HTTP server allocated with silc_http_server_alloc and
- *    freed with silc_http_server_free.
- *
- ***/
-typedef struct SilcHttpServerStruct *SilcHttpServer;
-
-/****s* silchttp/SilcHTTPServer/SilcHttpConnection
- *
- * NAME
- *
- *    typedef struct SilcHttpConnectionStruct *SilcHttpConnection;
- *
- * DESCRIPTION
- *
- *    HTTP connection context.  This is allocated by the library and
- *    delivered to application in SilcHttpServerCallback callbcak function.
- *    It is given as argument to many silc_http_server_* functions.
- *    It is freed automatically by the library.
- *
- ***/
-typedef struct SilcHttpConnectionStruct *SilcHttpConnection;
-
-/****f* silchttp/SilcHTTPServer/SilcHttpServerCallback
- *
- * SYNOPSIS
- *
- *    typedef void (*SilcHttpServerCallback)(SilcHttpServer httpd,
- *                                           SilcHttpConnection conn,
- *                                           const char *uri,
- *                                           const char *method,
- *                                           SilcBuffer data,
- *                                           void *context);
- *
- * DESCRIPTION
- *
- *    The HTTP request callback that is called everytime a new HTTP request
- *    comes from a HTTP client.  The `uri' is the requested URI (web page),
- *    and the `method' is the HTTP request method (GET, POST, etc.).  The
- *    `data' is non-NULL only if the `method' is POST, and it includes the
- *    the POST data.
- *
- *    The requested web page must be returned to the HTTP client from this
- *    callback by calling silc_http_server_send or error is returned by
- *    calling silc_http_server_send_error.
- *
- *    The silc_http_server_get_header may be called to find a specific
- *    HTTP header from this request.  New headers may be added to the
- *    reply by calling silc_http_server_add_header.
- *
- ***/
-typedef void (*SilcHttpServerCallback)(SilcHttpServer httpd,
-                                      SilcHttpConnection conn,
-                                      const char *uri,
-                                      const char *method,
-                                      SilcBuffer data,
-                                      void *context);
-
-/****f* silchttp/SilcHTTPServer/silc_http_server_alloc
- *
- * SYNOPSIS
- *
- *    SilcHttpServer
- *    silc_http_server_alloc(const char *ip, SilcUInt16 port,
- *                           SilcSchedule schedule,
- *                           SilcHttpServerCallback callback, void *context);
- *
- * DESCRIPTION
- *
- *    Allocates HTTP server and binds it to the IP address `ip' on the
- *    `port'.  The `callback' with `context' will be called everytime a new
- *    HTTP request comes to the server from a HTTP client.  In that callback
- *    the caller must then reply with the requested Web page or with error.
- *
- ***/
-SilcHttpServer silc_http_server_alloc(const char *ip, SilcUInt16 port,
-                                     SilcSchedule schedule,
-                                     SilcHttpServerCallback callback,
-                                     void *context);
-
-/****f* silchttp/SilcHTTPServer/silc_http_server_free
- *
- * SYNOPSIS
- *
- *    void silc_http_server_free(SilcHttpServer httpd);
- *
- * DESCRIPTION
- *
- *    Close HTTP server and free all resources.
- *
- ***/
-void silc_http_server_free(SilcHttpServer httpd);
-
-/****f* silchttp/SilcHTTPServer/silc_http_server_send
- *
- * SYNOPSIS
- *
- *    SilcBool silc_http_server_send(SilcHttpServer httpd,
- *                                   SilcHttpConnection conn,
- *                                   SilcBuffer data);
- *
- * DESCRIPTION
- *
- *    Send the HTTP data indicated by `data' buffer into the connection
- *    indicated by `conn'.  Returns TRUE after the data is sent, and FALSE
- *    if error occurred.  Usually the `data' would be the requested web page.
- *
- ***/
-SilcBool silc_http_server_send(SilcHttpServer httpd,
-                              SilcHttpConnection conn,
-                              SilcBuffer data);
-
-/****f* silchttp/SilcHTTPServer/silc_http_server_send_error
- *
- * SYNOPSIS
- *
- *    SilcBool silc_http_server_send_error(SilcHttpServer httpd,
- *                                         SilcHttpConnection conn,
- *                                         const char *error,
- *                                         const char *error_message);
- *
- * DESCRIPTION
- *
- *    Send HTTP error back to the connection indicated by `conn'.  The
- *    `error' is one of the 4xx or 5xx errors defined by the HTTP protocol.
- *    The `error_message' is the optional error message sent to the
- *    connection.  Returns FALSE if the error could not be sent.
- *
- *    Typical errors are: 400 Bad Request
- *                        403 Forbidden
- *                        404 Not Found
- *
- * EXAMPLE
- *
- *    silc_http_server_send_error(httpd, conn, "400 Bad Request",
- *                                "<body><h1>400 Bad Request!!</h1></body>");
- *
- ***/
-SilcBool silc_http_server_send_error(SilcHttpServer httpd,
-                                    SilcHttpConnection conn,
-                                    const char *error,
-                                    const char *error_message);
-
-/****f* silchttp/SilcHTTPServer/silc_http_server_get_header
- *
- * SYNOPSIS
- *
- *    const char *silc_http_server_get_header(SilcHttpServer httpd,
- *                                            SilcHttpConnection conn,
- *                                            const char *field);
- *
- * DESCRIPTION
- *
- *    Finds a header field indicated by `field' from the current HTTP
- *    request sent by the HTTP client.  Returns the field value or NULL
- *    if such header field does not exist.
- *
- ***/
-const char *silc_http_server_get_header(SilcHttpServer httpd,
-                                       SilcHttpConnection conn,
-                                       const char *field);
-
-/****f* silchttp/SilcHTTPServer/silc_http_server_add_header
- *
- * SYNOPSIS
- *
- *    SilcBool silc_http_server_add_header(SilcHttpServer httpd,
- *                                         SilcHttpConnection conn,
- *                                         const char *field,
- *                                         const char *value);
- *
- * DESCRIPTION
- *
- *    Adds a new header to the HTTP headers to be sent back to the
- *    HTTP client.  This may be called to add needed headers to the
- *    HTTP reply.
- *
- * EXAMPLE
- *
- *    silc_http_server_add_header(httpd, conn, "Content-Type", "image/jpeg");
- *    silc_http_server_send(httpd, conn, image_data);
- *
- ***/
-SilcBool silc_http_server_add_header(SilcHttpServer httpd,
-                                    SilcHttpConnection conn,
-                                    const char *field,
-                                    const char *value);
-
-#endif /* SILCHTTPSERVER_H */
diff --git a/lib/silchttp/tests/Makefile.am b/lib/silchttp/tests/Makefile.am
deleted file mode 100644 (file)
index 00067b4..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-#
-#  Makefile.am
-#
-#  Author: Pekka Riikonen <priikone@silcnet.org>
-#
-#  Copyright (C) 2006 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.
-#
-
-AUTOMAKE_OPTIONS = 1.0 no-dependencies foreign
-
-bin_PROGRAMS = test_silchttpserver
-
-test_silchttpserver_SOURCES = test_silchttpserver.c
-
-LIBS = $(SILC_COMMON_LIBS)
-LDADD = -L.. -L../.. -lsilc -lsilchttp
-
-include $(top_srcdir)/Makefile.defines.in
diff --git a/lib/silchttp/tests/test_silchttpserver.c b/lib/silchttp/tests/test_silchttpserver.c
deleted file mode 100644 (file)
index 197e5de..0000000
+++ /dev/null
@@ -1,145 +0,0 @@
-/* SilcHttpServer tests */
-/* Actually this is almost a full-fledged HTTP server.  It can serve HTML
-   and PHP pages pretty well.  In PHP the variables passed in URI with '?'
-   work in PHP script, with this HTTPD of ours, only if $_REQUEST variable
-   is used to fetch them (limitation in PHP command line version).  In other
-   ways '?' in URI is not supported. */
-/* Usage: ./test_silchttpserver [-d] [<htdocsdir>] */
-
-#include "silc.h"
-#include "../silchttpserver.h"
-#include "../silchttpphp.h"
-
-char *htdocs = ".";
-
-/* Add proper content type to reply per URI */
-
-static void http_content_type(SilcHttpServer httpd, SilcHttpConnection conn,
-                             const char *uri)
-{
-  const char *type;
-
-  type = silc_http_server_get_header(httpd, conn, "Content-Type");
-  if (type)
-    silc_http_server_add_header(httpd, conn, "Content-Type", type);
-  else if (strstr(uri, ".jpg"))
-    silc_http_server_add_header(httpd, conn, "Content-Type", "image/jpeg");
-  else if (strstr(uri, ".gif"))
-    silc_http_server_add_header(httpd, conn, "Content-Type", "image/gif");
-  else if (strstr(uri, ".png"))
-    silc_http_server_add_header(httpd, conn, "Content-Type", "image/png");
-  else if (strstr(uri, ".css"))
-    silc_http_server_add_header(httpd, conn, "Content-Type", "text/css");
-  else if (strstr(uri, ".htm"))
-    silc_http_server_add_header(httpd, conn, "Content-Type", "text/html");
-  else if (strstr(uri, ".php"))
-    silc_http_server_add_header(httpd, conn, "Content-Type", "text/html");
-}
-
-/* Serve pages */
-
-static void http_callback_file(SilcHttpServer httpd, SilcHttpConnection conn,
-                              const char *uri, const char *method,
-                              SilcBuffer data, void *context)
-{
-  SilcBufferStruct page;
-  SilcBuffer php;
-  char *filedata, filename[256];
-  SilcUInt32 data_len;
-  SilcBool usephp = FALSE;
-
-  if (!strcasecmp(method, "GET")) {
-    if (strstr(uri, ".php"))
-      usephp = TRUE;
-
-    if (!strcmp(uri, "/"))
-      snprintf(filename, sizeof(filename), "%s/index.html", htdocs);
-    else
-      snprintf(filename, sizeof(filename), "%s%s", htdocs, uri);
-
-    if (strchr(filename, '?'))
-      *strchr(filename, '?') = ' ';
-    while (strchr(filename, '&'))
-      *strchr(filename, '&') = ' ';
-
-    SILC_LOG_DEBUG(("Filename: '%s'", filename));
-
-    if (!usephp) {
-      filedata = silc_file_readfile(filename, &data_len);
-      if (!filedata) {
-       silc_http_server_send_error(httpd, conn, "404 Not Found",
-                                   "<body><h1>404 Not Found</h1><p>The page you are looking for cannot be located</body>");
-       return;
-      }
-
-      http_content_type(httpd, conn, uri);
-
-      /* Send page */
-      silc_buffer_set(&page, filedata, data_len);
-      silc_http_server_send(httpd, conn, &page);
-      silc_buffer_purge(&page);
-    } else {
-      php = silc_http_php_file(filename);
-      if (!php) {
-       silc_http_server_send_error(httpd, conn, "404 Not Found",
-                                   "<body><h1>404 Not Found</h1><p>The page you are looking for cannot be located</body>");
-       return;
-      }
-
-      http_content_type(httpd, conn, uri);
-
-      /* Send page */
-      silc_http_server_send(httpd, conn, php);
-      silc_buffer_free(php);
-    }
-
-    return;
-  }
-
-  silc_http_server_send_error(httpd, conn, "404 Not Found",
-                             "<body><h1>404 Not Found</h1><p>The page you are looking for cannot be located</body>");
-}
-
-int main(int argc, char **argv)
-{
-  SilcBool success = FALSE;
-  SilcSchedule schedule;
-  SilcHttpServer httpd;
-
-  if (argc > 1) {
-    if (!strcmp(argv[1], "-d")) {
-      silc_log_debug(TRUE);
-      silc_log_debug_hexdump(TRUE);
-      silc_log_set_debug_string("*http*,*mime*");
-      if (argc > 2)
-       htdocs = argv[2];
-    } else {
-      htdocs = argv[1];
-    }
-  }
-
-  signal(SIGPIPE, SIG_IGN);
-
-  SILC_LOG_DEBUG(("Allocating scheduler"));
-  schedule = silc_schedule_init(0, NULL);
-  if (!schedule)
-    goto err;
-
-  SILC_LOG_DEBUG(("Allocating HTTP server at 127.0.0.1:5000"));
-  httpd = silc_http_server_alloc("127.0.0.1", 5000, schedule,
-                                http_callback_file, NULL);
-  if (!httpd)
-    goto err;
-
-  silc_schedule(schedule);
-
-  silc_schedule_uninit(schedule);
-
-  success = TRUE;
-
- err:
-  SILC_LOG_DEBUG(("Testing was %s", success ? "SUCCESS" : "FAILURE"));
-  fprintf(stderr, "Testing was %s\n", success ? "SUCCESS" : "FAILURE");
-
-  return success;
-}
diff --git a/lib/silcmath/.cvsignore b/lib/silcmath/.cvsignore
deleted file mode 100644 (file)
index 282522d..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-Makefile
-Makefile.in
diff --git a/lib/silcmath/DIRECTORY b/lib/silcmath/DIRECTORY
deleted file mode 100644 (file)
index 33c6d2f..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-<!--
-@LIBRARY=SILC Math Library
-@FILENAME=silcmathlib.html
-@LINK=silcmp.html:SILC MP Interface
-@LINK=silcmath.html:SILC Math Interface
--->
-
-<big><b>SILC Math Library</b></big>
-<br />
-<small>Directory: lib/silcmath/</small>
-<br />
-<small>Library: libsilc.a, libsilc.lib</small>
-<br /><br />
-<B>Introduction</B>
-
-<br /><br />
-SILC Math Library provides arbitrary precision artichmetic routines for
-public key cryptosystems, prime number generation routines, and other
-math utility functions for applications.
-
-<br /><br />
-@LINKS@
diff --git a/lib/silcmath/Makefile.ad b/lib/silcmath/Makefile.ad
deleted file mode 100644 (file)
index 3afe5f6..0000000
+++ /dev/null
@@ -1,67 +0,0 @@
-#
-#  Makefile.ad
-#
-#  Author: Pekka Riikonen <priikone@silcnet.org>
-#
-#  Copyright (C) 2000 - 2005 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.
-#
-
-AUTOMAKE_OPTIONS = 1.0 no-dependencies foreign
-
-noinst_LTLIBRARIES = libsilcmath.la
-
-if SILC_MP_SILCMATH
-MP_SOURCE = \
-#ifdef SILC_DIST_TMA
-       mp_tma.c \
-       tma.c
-#endif SILC_DIST_TMA
-#ifdef SILC_DIST_TFM
-       mp_tfm.c \
-       tfm.c
-#endif SILC_DIST_TFM
-
-MP_HEADER = \
-#ifdef SILC_DIST_TMA
-       mp_tma.h \
-       tma.h \
-       tma_class.h \
-       tma_superclass.h
-#endif SILC_DIST_TMA
-#ifdef SILC_DIST_TFM
-       mp_tfm.h \
-       tfm.h
-#endif SILC_DIST_TFM
-
-AM_CFLAGS = @MATH_CFLAGS@
-else
-MP_SOURCE = mp_gmp.c
-MP_HEADER =
-endif
-
-libsilcmath_la_SOURCES = \
-       silcprimegen.c \
-       modinv.c \
-       mpbin.c \
-       $(MP_SOURCE)
-
-#ifdef SILC_DIST_TOOLKIT
-include_HEADERS =      \
-       mp_gmp.h        \
-       $(MP_HEADER)    \
-       silcmath.h      \
-       silcmp.h
-#endif SILC_DIST_TOOLKIT
-
-EXTRA_DIST = silcmp.h silcmath.h $(MP_SOURCE) $(MP_HEADER) mp_gmp.c mp_gmp.h
-
-include $(top_srcdir)/Makefile.defines.in
diff --git a/lib/silcmath/configure.ad b/lib/silcmath/configure.ad
deleted file mode 100644 (file)
index 7631711..0000000
+++ /dev/null
@@ -1,138 +0,0 @@
-#ifdef SILC_DIST_MATH
-#
-#  lib/silcmath/configure.ad
-#
-#  Author: Pekka Riikonen <priikone@silcnet.org>
-#
-#  Copyright (C) 2005 - 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.
-#
-
-if test x$compile_libs = xtrue; then
-
-AC_MSG_NOTICE([configuring math library])
-
-#ifdef SILC_DIST_TMA
-if test x$want_cc_optimizations = xtrue; then
-  SILC_ADD_CC_FLAGS(MATH, -O3, SILC_ADD_CC_FLAGS(MATH, -O2))
-  SILC_ADD_CC_FLAGS(MATH, -funroll-all-loops)
-fi
-if test x$enable_stack_trace != xyes; then
-  SILC_ADD_CC_FLAGS(MATH, -fomit-frame-pointer)
-fi
-#endif SILC_DIST_TMA
-
-#ifdef SILC_DIST_TFM
-# Put here any platform specific stuff
-#
-case "$target" in
-
-  alpha*-*-*)
-    if test ! "$GCC"; then
-      SILC_ADD_CC_FLAGS(MATH, -DTFM_NO_ASM)
-      if test x$want_cc_optimizations = xtrue; then
-        SILC_ADD_CC_FLAGS(MATH, -O -Olimit 4000)
-      fi
-      SILC_ADD_CC_FLAGS(MATH, -std1 -DOSF1)
-    fi
-    ;;
-
-  sparcv9-*-* | sparc64-*-*)
-    if test x$want_cc_optimizations = xtrue; then
-      SILC_ADD_CC_FLAGS(MATH, -O3, SILC_ADD_CC_FLAGS(MATH, -O2))
-    fi
-    if test ! "$GCC"; then
-      SILC_ADD_CC_FLAGS(MATH, -DTFM_NO_ASM)
-    fi
-    ;;
-
-  ultrasparc*-*-*)
-    if test x$want_cc_optimizations = xtrue; then
-      SILC_ADD_CC_FLAGS(MATH, -O3, SILC_ADD_CC_FLAGS(MATH, -O2))
-    fi
-    if test ! "$GCC"; then
-      SILC_ADD_CC_FLAGS(MATH, -DTFM_NO_ASM)
-    fi
-    ;;
-
-  hppa2.0w*-*-*)
-    if test ! "$GCC"; then
-      SILC_ADD_CC_FLAGS(MATH, -DTFM_NO_ASM)
-      SILC_ADD_CC_FLAGS(MATH, -O)
-      SILC_ADD_CC_FLAGS(MATH, -Ae)
-      SILC_ADD_CC_FLAGS(MATH, +Z)
-      SILC_ADD_CC_FLAGS(MATH, +e)
-      SILC_ADD_CC_FLAGS(MATH, -z)
-      SILC_ADD_CC_FLAGS(MATH, +DA2.0W)
-      SILC_ADD_CC_FLAGS(MATH, +O3)
-      SILC_ADD_CC_FLAGS(MATH, +DChpux)
-      SILC_ADD_CC_FLAGS(MATH, -DHPUX10 -D_POSIX_C_SOURCE=199506L -DHPUX -Dhppa-D_HPUX_SOURCE -DHPUX11 -DXP_UNIX)
-    fi
-    ;;
-
-  hppa2.0n*-*-*)
-    if test ! "$GCC"; then
-      SILC_ADD_CC_FLAGS(MATH, -DTFM_NO_ASM)
-      SILC_ADD_CC_FLAGS(MATH, -O)
-      SILC_ADD_CC_FLAGS(MATH, -Ae)
-      SILC_ADD_CC_FLAGS(MATH, +Z)
-      SILC_ADD_CC_FLAGS(MATH, +e)
-      SILC_ADD_CC_FLAGS(MATH, -z)
-      SILC_ADD_CC_FLAGS(MATH, +DA2.0)
-      SILC_ADD_CC_FLAGS(MATH, +O3)
-      SILC_ADD_CC_FLAGS(MATH, +DChpux)
-      SILC_ADD_CC_FLAGS(MATH, -DHPUX10 -D_POSIX_C_SOURCE=199506L -DHPUX -Dhppa-D_HPUX_SOURCE -DHPUX11 -DXP_UNIX)
-    fi
-    ;;
-
-  hppa*-*-*)
-    if test ! "$GCC"; then
-      SILC_ADD_CC_FLAGS(MATH, -DTFM_NO_ASM)
-      SILC_ADD_CC_FLAGS(MATH, -O)
-      SILC_ADD_CC_FLAGS(MATH, -Ae)
-      SILC_ADD_CC_FLAGS(MATH, +Z)
-      SILC_ADD_CC_FLAGS(MATH, +DAportable)
-      SILC_ADD_CC_FLAGS(MATH, +DS1.1)
-      SILC_ADD_CC_FLAGS(MATH, -DHPUX10 -D_POSIX_C_SOURCE=199506L -DHPUX -Dhppa-D_HPUX_SOURCE -DHPUX11 -DXP_UNIX)
-      AS="$(CC) $(CFLAGS) $(MPI_CFLAGS) -c"
-    fi
-    ;;
-
-  armv4*-*-*)
-    SILC_ADD_CC_FLAGS(MATH, -DTFM_ARM)
-    ;;
-
-  *)
-    if test x$want_cc_optimizations = xtrue; then
-      SILC_ADD_CC_FLAGS(MATH, -O3, SILC_ADD_CC_FLAGS(MATH, -O2))
-    fi
-    if test x$enable_stack_trace != xyes; then
-      SILC_ADD_CC_FLAGS(MATH, -fomit-frame-pointer)
-    fi
-    ;;
-esac
-
-if test "$GCC"; then
-  SILC_ADD_CC_FLAGS(MATH, -funroll-all-loops)
-fi
-if test x$want_asm = xfalse; then
-  SILC_ADD_CC_FLAGS(MATH, -DTFM_NO_ASM)
-fi
-#endif SILC_DIST_TFM
-
-AC_SUBST(MATH_CFLAGS)
-
-AC_CONFIG_FILES(
-lib/silcmath/Makefile
-)
-
-fi     # compile_libs
-#endif SILC_DIST_MATH
diff --git a/lib/silcmath/modinv.c b/lib/silcmath/modinv.c
deleted file mode 100644 (file)
index dec3032..0000000
+++ /dev/null
@@ -1,100 +0,0 @@
-/*
-
-  modinv.h
-
-  Author: Pekka Riikonen <priikone@silcnet.org>
-
-  Copyright (C) 1997 - 2005 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.
-
-*/
-/* $Id$ */
-
-#include "silc.h"
-
-/* Table for finding multiplicative inverse */
-typedef struct {
-  SilcMPInt x;
-} ModInv;
-
-#define plus1  (i == 2 ? 0 : i + 1)
-#define minus1         (i == 0 ? 2 : i - 1)
-
-/* Find multiplicative inverse using Euclid's extended algorithm.
-   Computes inverse such that a * inv mod n = 1, where 0 < a < n.
-   Algorithm goes like this:
-
-   g(0) = n    v(0) = 0
-   g(1) = a    v(1) = 1
-
-   y = g(i-1) / g(i)
-   g(i+1) = g(i-1) - y * g(i) = g(i)-1 mod g(i)
-   v(i+1) = v(i-1) - y * v(i)
-
-   do until g(i) = 0, then inverse = v(i-1). If inverse is negative then n,
-   is added to inverse making it positive again. (Sometimes the algorithm
-   has a variable u defined too and it behaves just like v, except that
-   initalize values are swapped (i.e. u(0) = 1, u(1) = 0). However, u is
-   not needed by the algorithm so it does not have to be included.)
-*/
-
-void silc_mp_modinv(SilcMPInt *inv, SilcMPInt *a, SilcMPInt *n)
-{
-  int i;
-  SilcMPInt y;
-  SilcMPInt x;
-
-  ModInv g[3];
-  ModInv v[3];
-
-  /* init MP vars */
-  silc_mp_init(&y);
-  silc_mp_init(&x);
-  silc_mp_init(&v[0].x);
-  silc_mp_init(&v[1].x);
-  silc_mp_set_ui(&v[0].x, 0L);         /* v(0) = 0 */
-  silc_mp_set_ui(&v[1].x, 1L);         /* v(1) = 1 */
-  silc_mp_init(&v[2].x);
-  silc_mp_init(&g[0].x);
-  silc_mp_init(&g[1].x);
-  silc_mp_set(&g[0].x, n);                     /* g(0) = n */
-  silc_mp_set(&g[1].x, a);             /* g(1) = a */
-  silc_mp_init(&g[2].x);
-
-  i = 1;
-  while(silc_mp_cmp_ui(&g[i].x, 0) != 0) {
-    silc_mp_div(&y, &g[minus1].x, &g[i].x);            /* y = n / a */
-    silc_mp_mod(&g[plus1].x, &g[minus1].x, &g[i].x); /* remainder */
-    silc_mp_mul(&x, &y, &v[i].x);
-    silc_mp_set(&v[plus1].x, &v[minus1].x);
-    silc_mp_sub(&v[plus1].x, &v[plus1].x, &x);
-    i = plus1;
-  }
-
-  /* set the inverse */
-  silc_mp_set(inv, &v[minus1].x);
-
-  /* if inverse is negative, add n to inverse */
-  if (silc_mp_cmp_ui(inv, 0) < 0)
-    silc_mp_add(inv, inv, n);
-
-  /* clear the vars */
-  memset(&g, 0, sizeof(g));
-  memset(&v, 0, sizeof(v));
-  silc_mp_uninit(&y);
-  silc_mp_uninit(&x);
-  silc_mp_uninit(&g[0].x);
-  silc_mp_uninit(&g[1].x);
-  silc_mp_uninit(&g[2].x);
-  silc_mp_uninit(&v[0].x);
-  silc_mp_uninit(&v[1].x);
-  silc_mp_uninit(&v[2].x);
-}
diff --git a/lib/silcmath/mp_gmp.c b/lib/silcmath/mp_gmp.c
deleted file mode 100644 (file)
index d3f29b6..0000000
+++ /dev/null
@@ -1,236 +0,0 @@
-/*
-
-  mp_gmp.c
-
-  Author: Pekka Riikonen <priikone@silcnet.org>
-
-  Copyright (C) 2001 - 2005 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.
-
-*/
-/* $Id$ */
-
-#include "silc.h"
-#include <gmp.h>
-
-void silc_mp_init(SilcMPInt *mp)
-{
-  mpz_init(mp);
-}
-
-void silc_mp_uninit(SilcMPInt *mp)
-{
-  mpz_clear(mp);
-}
-
-size_t silc_mp_size(SilcMPInt *mp)
-{
-  return mpz_size(mp);
-}
-
-size_t silc_mp_sizeinbase(SilcMPInt *mp, int base)
-{
-  return mpz_sizeinbase(mp, base);
-}
-
-void silc_mp_set(SilcMPInt *dst, SilcMPInt *src)
-{
-  mpz_set(dst, src);
-}
-
-void silc_mp_set_ui(SilcMPInt *dst, SilcUInt32 ui)
-{
-  mpz_set_ui(dst, ui);
-}
-
-void silc_mp_set_si(SilcMPInt *dst, SilcInt32 si)
-{
-  mpz_set_si(dst, si);
-}
-
-void silc_mp_set_str(SilcMPInt *dst, const char *str, int base)
-{
-  mpz_set_str(dst, str, base);
-}
-
-SilcUInt32 silc_mp_get_ui(SilcMPInt *mp)
-{
-  return (SilcUInt32)mpz_get_ui(mp);
-}
-
-char *silc_mp_get_str(char *str, SilcMPInt *mp, int base)
-{
-  return mpz_get_str(str, base, mp);
-}
-
-void silc_mp_add(SilcMPInt *dst, SilcMPInt *mp1, SilcMPInt *mp2)
-{
-  mpz_add(dst, mp1, mp2);
-}
-
-void silc_mp_add_ui(SilcMPInt *dst, SilcMPInt *mp1, SilcUInt32 ui)
-{
-  mpz_add_ui(dst, mp1, ui);
-}
-
-void silc_mp_sub(SilcMPInt *dst, SilcMPInt *mp1, SilcMPInt *mp2)
-{
-  mpz_sub(dst, mp1, mp2);
-}
-
-void silc_mp_sub_ui(SilcMPInt *dst, SilcMPInt *mp1, SilcUInt32 ui)
-{
-  mpz_sub_ui(dst, mp1, ui);
-}
-
-void silc_mp_mul(SilcMPInt *dst, SilcMPInt *mp1, SilcMPInt *mp2)
-{
-  mpz_mul(dst, mp1, mp2);
-}
-
-void silc_mp_mul_ui(SilcMPInt *dst, SilcMPInt *mp1, SilcUInt32 ui)
-{
-  mpz_mul_ui(dst, mp1, ui);
-}
-
-void silc_mp_mul_2exp(SilcMPInt *dst, SilcMPInt *mp1, SilcUInt32 exp)
-{
-  mpz_mul_2exp(dst, mp1, exp);
-}
-
-void silc_mp_sqrt(SilcMPInt *dst, SilcMPInt *src)
-{
-  mpz_sqrt(dst, src);
-}
-
-void silc_mp_div(SilcMPInt *dst, SilcMPInt *mp1, SilcMPInt *mp2)
-{
-  mpz_div(dst, mp1, mp2);
-}
-
-void silc_mp_div_ui(SilcMPInt *dst, SilcMPInt *mp1, SilcUInt32 ui)
-{
-  mpz_div_ui(dst, mp1, ui);
-}
-
-void silc_mp_div_qr(SilcMPInt *q, SilcMPInt *r, SilcMPInt *mp1,
-                   SilcMPInt *mp2)
-{
-  if (q && r)
-    mpz_fdiv_qr(q, r, mp1, mp2);
-  if (q && !r)
-    mpz_div(q, mp1, mp2);
-  if (!q && r)
-    mpz_mod(r, mp1, mp2);
-}
-
-void silc_mp_div_2exp(SilcMPInt *dst, SilcMPInt *mp1, SilcUInt32 exp)
-{
-  mpz_fdiv_q_2exp(dst, mp1, exp);
-}
-
-void silc_mp_div_2exp_qr(SilcMPInt *q, SilcMPInt *r, SilcMPInt *mp1,
-                        SilcUInt32 exp)
-{
-  if (q)
-    mpz_fdiv_q_2exp(q, mp1, exp);
-  if (r)
-    mpz_fdiv_r_2exp(r, mp1, exp);
-}
-
-void silc_mp_mod(SilcMPInt *dst, SilcMPInt *mp1, SilcMPInt *mp2)
-{
-  mpz_mod(dst, mp1, mp2);
-}
-
-void silc_mp_mod_ui(SilcMPInt *dst, SilcMPInt *mp1, SilcUInt32 ui)
-{
-  mpz_mod_ui(dst, mp1, ui);
-}
-
-void silc_mp_mod_2exp(SilcMPInt *dst, SilcMPInt *mp1, SilcUInt32 ui)
-{
-  mpz_mod_2exp(dst, mp1, ui);
-}
-
-void silc_mp_pow(SilcMPInt *dst, SilcMPInt *mp1, SilcMPInt *exp)
-{
-  SilcUInt32 uiexp = mpz_get_ui(exp);
-  mpz_pow_ui(dst, mp1, uiexp);
-}
-
-void silc_mp_pow_ui(SilcMPInt *dst, SilcMPInt *mp1, SilcUInt32 exp)
-{
-  mpz_pow_ui(dst, mp1, exp);
-}
-
-void silc_mp_pow_mod(SilcMPInt *dst, SilcMPInt *mp1, SilcMPInt *exp,
-                    SilcMPInt *mod)
-{
-  mpz_powm(dst, mp1, exp, mod);
-}
-
-void silc_mp_pow_mod_ui(SilcMPInt *dst, SilcMPInt *mp1, SilcUInt32 exp,
-                       SilcMPInt *mod)
-{
-  mpz_powm_ui(dst, mp1, exp, mod);
-}
-
-void silc_mp_gcd(SilcMPInt *dst, SilcMPInt *mp1, SilcMPInt *mp2)
-{
-  mpz_gcd(dst, mp1, mp2);
-}
-
-void silc_mp_gcdext(SilcMPInt *g, SilcMPInt *s, SilcMPInt *t, SilcMPInt *mp1,
-                   SilcMPInt *mp2)
-{
-  mpz_gcdext(g, s, t, mp1, mp2);
-}
-
-int silc_mp_cmp(SilcMPInt *mp1, SilcMPInt *mp2)
-{
-  return mpz_cmp(mp1, mp2);
-}
-
-int silc_mp_cmp_si(SilcMPInt *mp1, SilcInt32 si)
-{
-  return mpz_cmp_si(mp1, si);
-}
-
-int silc_mp_cmp_ui(SilcMPInt *mp1, SilcUInt32 ui)
-{
-  return mpz_cmp_ui(mp1, ui);
-}
-
-void silc_mp_abs(SilcMPInt *dst, SilcMPInt *src)
-{
-  mpz_abs(dst, src);
-}
-
-void silc_mp_neg(SilcMPInt *dst, SilcMPInt *src)
-{
-  mpz_neg(dst, src);
-}
-
-void silc_mp_and(SilcMPInt *dst, SilcMPInt *mp1, SilcMPInt *mp2)
-{
-  mpz_and(dst, mp1, mp2);
-}
-
-void silc_mp_or(SilcMPInt *dst, SilcMPInt *mp1, SilcMPInt *mp2)
-{
-  mpz_ior(dst, mp1, mp2);
-}
-
-void silc_mp_xor(SilcMPInt *dst, SilcMPInt *mp1, SilcMPInt *mp2)
-{
-  mpz_xor(dst, mp1, mp2);
-}
diff --git a/lib/silcmath/mp_gmp.h b/lib/silcmath/mp_gmp.h
deleted file mode 100644 (file)
index 9b4c4d2..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
-
-  mp_gmp.h
-
-  Author: Pekka Riikonen <priikone@silcnet.org>
-
-  Copyright (C) 2001 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 MP_GMP_H
-#define MP_GMP_H
-
-#include <gmp.h>
-
-#define SILC_MP_INT MP_INT
-
-#endif
diff --git a/lib/silcmath/mp_tfm.c b/lib/silcmath/mp_tfm.c
deleted file mode 100644 (file)
index b3b1e73..0000000
+++ /dev/null
@@ -1,246 +0,0 @@
-/*
-
-  mp_tfm.c
-
-  Author: Pekka Riikonen <priikone@silcnet.org>
-
-  Copyright (C) 2005 - 2006 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.
-
-*/
-/* $Id$ */
-
-#include "silc.h"
-#include "mp_tfm.h"
-
-void silc_mp_init(SilcMPInt *mp)
-{
-  fp_init(mp);
-}
-
-void silc_mp_uninit(SilcMPInt *mp)
-{
-  fp_zero(mp);
-}
-
-size_t silc_mp_size(SilcMPInt *mp)
-{
-  return fp_unsigned_bin_size(mp);
-}
-
-size_t silc_mp_sizeinbase(SilcMPInt *mp, int base)
-{
-  int size = 0;
-  fp_radix_size(mp, base, &size);
-  if (size > 1)
-    size--;
-  return size;
-}
-
-void silc_mp_set(SilcMPInt *dst, SilcMPInt *src)
-{
-  fp_copy(src, dst);
-}
-
-void silc_mp_set_ui(SilcMPInt *dst, SilcUInt32 ui)
-{
-  fp_set(dst, ui);
-}
-
-void silc_mp_set_si(SilcMPInt *dst, SilcInt32 si)
-{
-  fp_set(dst, si);
-}
-
-void silc_mp_set_str(SilcMPInt *dst, const char *str, int base)
-{
-  fp_read_radix(dst, str, base);
-}
-
-SilcUInt32 silc_mp_get_ui(SilcMPInt *mp)
-{
-  fp_int *tmp = mp;
-  return tmp->used > 0 ? tmp->dp[0] : 0;
-}
-
-char *silc_mp_get_str(char *str, SilcMPInt *mp, int base)
-{
-  if (fp_toradix(mp, str, base) != MP_OKAY)
-    return NULL;
-  return str;
-}
-
-void silc_mp_add(SilcMPInt *dst, SilcMPInt *mp1, SilcMPInt *mp2)
-{
-  fp_add(mp1, mp2, dst);
-}
-
-void silc_mp_add_ui(SilcMPInt *dst, SilcMPInt *mp1, SilcUInt32 ui)
-{
-  mp_add_d(mp1, (mp_digit)ui, dst);
-}
-
-void silc_mp_sub(SilcMPInt *dst, SilcMPInt *mp1, SilcMPInt *mp2)
-{
-  fp_sub(mp1, mp2, dst);
-}
-
-void silc_mp_sub_ui(SilcMPInt *dst, SilcMPInt *mp1, SilcUInt32 ui)
-{
-  fp_sub_d(mp1, (mp_digit)ui, dst);
-}
-
-void silc_mp_mul(SilcMPInt *dst, SilcMPInt *mp1, SilcMPInt *mp2)
-{
-  fp_mul(mp1, mp2, dst);
-}
-
-void silc_mp_mul_ui(SilcMPInt *dst, SilcMPInt *mp1, SilcUInt32 ui)
-{
-  fp_mul_d(mp1, (mp_digit)ui, dst);
-}
-
-void silc_mp_mul_2exp(SilcMPInt *dst, SilcMPInt *mp1, SilcUInt32 exp)
-{
-  fp_mul_2d(mp1, exp, dst);
-}
-
-void silc_mp_sqrt(SilcMPInt *dst, SilcMPInt *src)
-{
-  fp_sqrt(src, dst);
-}
-
-void silc_mp_div(SilcMPInt *dst, SilcMPInt *mp1, SilcMPInt *mp2)
-{
-  fp_div(mp1, mp2, dst, NULL);
-}
-
-void silc_mp_div_ui(SilcMPInt *dst, SilcMPInt *mp1, SilcUInt32 ui)
-{
-  fp_div_d(mp1, (mp_digit)ui, dst, NULL);
-}
-
-void silc_mp_div_qr(SilcMPInt *q, SilcMPInt *r, SilcMPInt *mp1,
-                   SilcMPInt *mp2)
-{
-  fp_div(mp1, mp2, q, r);
-}
-
-void silc_mp_div_2exp(SilcMPInt *dst, SilcMPInt *mp1, SilcUInt32 exp)
-{
-  fp_div_2d(mp1, exp, dst, NULL);
-}
-
-void silc_mp_div_2exp_qr(SilcMPInt *q, SilcMPInt *r, SilcMPInt *mp1,
-                        SilcUInt32 exp)
-{
-  fp_div_2d(mp1, exp, q, r);
-}
-
-void silc_mp_mod(SilcMPInt *dst, SilcMPInt *mp1, SilcMPInt *mp2)
-{
-  fp_mod(mp1, mp2, dst);
-}
-
-void silc_mp_mod_ui(SilcMPInt *dst, SilcMPInt *mp1, SilcUInt32 ui)
-{
-  fp_digit d;
-  fp_mod_d(mp1, ui, &d);
-  silc_mp_set_ui(dst, d);
-}
-
-void silc_mp_mod_2exp(SilcMPInt *dst, SilcMPInt *mp1, SilcUInt32 ui)
-{
-  fp_mod_2d(mp1, ui, dst);
-}
-
-void silc_mp_pow(SilcMPInt *dst, SilcMPInt *mp1, SilcMPInt *exp)
-{
-  SILC_NOT_IMPLEMENTED("silc_mp_pow");
-  assert(FALSE);
-}
-
-void silc_mp_pow_ui(SilcMPInt *dst, SilcMPInt *mp1, SilcUInt32 exp)
-{
-  SILC_NOT_IMPLEMENTED("silc_mp_pow_ui");
-  assert(FALSE);
-}
-
-void silc_mp_pow_mod(SilcMPInt *dst, SilcMPInt *mp1, SilcMPInt *exp,
-                    SilcMPInt *mod)
-{
-  fp_exptmod(mp1, exp, mod, dst);
-}
-
-void silc_mp_pow_mod_ui(SilcMPInt *dst, SilcMPInt *mp1, SilcUInt32 exp,
-                       SilcMPInt *mod)
-{
-  SilcMPInt tmp;
-  silc_mp_init(&tmp);
-  silc_mp_set_ui(&tmp, exp);
-  silc_mp_pow_mod(dst, mp1, &tmp, mod);
-  silc_mp_uninit(&tmp);
-}
-
-void silc_mp_gcd(SilcMPInt *dst, SilcMPInt *mp1, SilcMPInt *mp2)
-{
-  fp_gcd(mp1, mp2, dst);
-}
-
-void silc_mp_gcdext(SilcMPInt *g, SilcMPInt *s, SilcMPInt *t, SilcMPInt *mp1,
-                   SilcMPInt *mp2)
-{
-  SILC_NOT_IMPLEMENTED("silc_mp_gcdext");
-  assert(FALSE);
-}
-
-int silc_mp_cmp(SilcMPInt *mp1, SilcMPInt *mp2)
-{
-  return fp_cmp(mp1, mp2);
-}
-
-int silc_mp_cmp_si(SilcMPInt *mp1, SilcInt32 si)
-{
-  return fp_cmp_d(mp1, si);
-}
-
-int silc_mp_cmp_ui(SilcMPInt *mp1, SilcUInt32 ui)
-{
-  return fp_cmp_d(mp1, ui);
-}
-
-void silc_mp_abs(SilcMPInt *dst, SilcMPInt *src)
-{
-  fp_abs(src, dst);
-}
-
-void silc_mp_neg(SilcMPInt *dst, SilcMPInt *src)
-{
-  fp_neg(src, dst);
-}
-
-void silc_mp_and(SilcMPInt *dst, SilcMPInt *mp1, SilcMPInt *mp2)
-{
-  SILC_NOT_IMPLEMENTED("silc_mp_and");
-  assert(FALSE);
-}
-
-void silc_mp_or(SilcMPInt *dst, SilcMPInt *mp1, SilcMPInt *mp2)
-{
-  SILC_NOT_IMPLEMENTED("silc_mp_or");
-  assert(FALSE);
-}
-
-void silc_mp_xor(SilcMPInt *dst, SilcMPInt *mp1, SilcMPInt *mp2)
-{
-  SILC_NOT_IMPLEMENTED("silc_mp_xor");
-  assert(FALSE);
-}
diff --git a/lib/silcmath/mp_tfm.h b/lib/silcmath/mp_tfm.h
deleted file mode 100644 (file)
index 176cd1c..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
-
-  mp_tfm.h
-
-  Author: Pekka Riikonen <priikone@silcnet.org>
-
-  Copyright (C) 2005 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 MP_TFM_H
-#define MP_TFM_H
-
-#include "tfm.h"
-
-#define SILC_MP_INT fp_int
-
-#endif /* MP_TFM_H */
diff --git a/lib/silcmath/mp_tma.c b/lib/silcmath/mp_tma.c
deleted file mode 100644 (file)
index e4e123e..0000000
+++ /dev/null
@@ -1,247 +0,0 @@
-/*
-
-  mp_tma.c
-
-  Author: Pekka Riikonen <priikone@silcnet.org>
-
-  Copyright (C) 2005 - 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.
-
-*/
-/* $Id$ */
-
-#include "silc.h"
-#include "mp_tma.h"
-
-void silc_mp_init(SilcMPInt *mp)
-{
-  (void)tma_mp_init(mp);
-}
-
-SilcBool silc_mp_sinit(SilcStack stack, SilcMPInt *mp)
-{
-  /* XXX TODO */
-  tma_mp_init(mp);
-  return TRUE;
-}
-
-void silc_mp_uninit(SilcMPInt *mp)
-{
-  tma_mp_clear(mp);
-}
-
-size_t silc_mp_size(SilcMPInt *mp)
-{
-  return tma_mp_unsigned_bin_size(mp);
-}
-
-size_t silc_mp_sizeinbase(SilcMPInt *mp, int base)
-{
-  int size = 0;
-  tma_mp_radix_size(mp, base, &size);
-  if (size > 1)
-    size--;
-  return size;
-}
-
-void silc_mp_set(SilcMPInt *dst, SilcMPInt *src)
-{
-  (void)tma_mp_copy(src, dst);
-}
-
-void silc_mp_set_ui(SilcMPInt *dst, SilcUInt32 ui)
-{
-  (void)tma_mp_set_int(dst, ui);
-}
-
-void silc_mp_set_si(SilcMPInt *dst, SilcInt32 si)
-{
-  (void)tma_mp_set_int(dst, si);
-}
-
-void silc_mp_set_str(SilcMPInt *dst, const char *str, int base)
-{
-  (void)tma_mp_read_radix(dst, str, base);
-}
-
-SilcUInt32 silc_mp_get_ui(SilcMPInt *mp)
-{
-  return (SilcUInt32)tma_mp_get_int(mp);
-}
-
-char *silc_mp_get_str(char *str, SilcMPInt *mp, int base)
-{
-  if (tma_mp_toradix(mp, str, base) != MP_OKAY)
-    return NULL;
-  return str;
-}
-
-void silc_mp_add(SilcMPInt *dst, SilcMPInt *mp1, SilcMPInt *mp2)
-{
-  (void)tma_mp_add(mp1, mp2, dst);
-}
-
-void silc_mp_add_ui(SilcMPInt *dst, SilcMPInt *mp1, SilcUInt32 ui)
-{
-  tma_mp_add_d(mp1, (tma_mp_digit)ui, dst);
-}
-
-void silc_mp_sub(SilcMPInt *dst, SilcMPInt *mp1, SilcMPInt *mp2)
-{
-  (void)tma_mp_sub(mp1, mp2, dst);
-}
-
-void silc_mp_sub_ui(SilcMPInt *dst, SilcMPInt *mp1, SilcUInt32 ui)
-{
-  (void)tma_mp_sub_d(mp1, (tma_mp_digit)ui, dst);
-}
-
-void silc_mp_mul(SilcMPInt *dst, SilcMPInt *mp1, SilcMPInt *mp2)
-{
-  (void)tma_mp_mul(mp1, mp2, dst);
-}
-
-void silc_mp_mul_ui(SilcMPInt *dst, SilcMPInt *mp1, SilcUInt32 ui)
-{
-  (void)tma_mp_mul_d(mp1, (tma_mp_digit)ui, dst);
-}
-
-void silc_mp_mul_2exp(SilcMPInt *dst, SilcMPInt *mp1, SilcUInt32 exp)
-{
-  (void)tma_mp_mul_2d(mp1, exp, dst);
-}
-
-void silc_mp_sqrt(SilcMPInt *dst, SilcMPInt *src)
-{
-  (void)tma_mp_sqrt(src, dst);
-}
-
-void silc_mp_div(SilcMPInt *dst, SilcMPInt *mp1, SilcMPInt *mp2)
-{
-  (void)tma_mp_div(mp1, mp2, dst, NULL);
-}
-
-void silc_mp_div_ui(SilcMPInt *dst, SilcMPInt *mp1, SilcUInt32 ui)
-{
-  (void)tma_mp_div_d(mp1, (tma_mp_digit)ui, dst, NULL);
-}
-
-void silc_mp_div_qr(SilcMPInt *q, SilcMPInt *r, SilcMPInt *mp1,
-                   SilcMPInt *mp2)
-{
-  (void)tma_mp_div(mp1, mp2, q, r);
-}
-
-void silc_mp_div_2exp(SilcMPInt *dst, SilcMPInt *mp1, SilcUInt32 exp)
-{
-  (void)tma_mp_div_2d(mp1, exp, dst, NULL);
-}
-
-void silc_mp_div_2exp_qr(SilcMPInt *q, SilcMPInt *r, SilcMPInt *mp1,
-                        SilcUInt32 exp)
-{
-  (void)tma_mp_div_2d(mp1, exp, q, r);
-}
-
-void silc_mp_mod(SilcMPInt *dst, SilcMPInt *mp1, SilcMPInt *mp2)
-{
-  (void)tma_mp_mod(mp1, mp2, dst);
-}
-
-void silc_mp_mod_ui(SilcMPInt *dst, SilcMPInt *mp1, SilcUInt32 ui)
-{
-  tma_mp_digit d;
-  (void)tma_mp_mod_d(mp1, ui, &d);
-  silc_mp_set_ui(dst, d);
-}
-
-void silc_mp_mod_2exp(SilcMPInt *dst, SilcMPInt *mp1, SilcUInt32 ui)
-{
-  (void)tma_mp_mod_2d(mp1, ui, dst);
-}
-
-void silc_mp_pow(SilcMPInt *dst, SilcMPInt *mp1, SilcMPInt *exp)
-{
-  SILC_NOT_IMPLEMENTED("silc_mp_pow");
-  assert(FALSE);
-}
-
-void silc_mp_pow_ui(SilcMPInt *dst, SilcMPInt *mp1, SilcUInt32 exp)
-{
-  (void)tma_mp_expt_d(mp1, (tma_mp_digit)exp, dst);
-}
-
-void silc_mp_pow_mod(SilcMPInt *dst, SilcMPInt *mp1, SilcMPInt *exp,
-                    SilcMPInt *mod)
-{
-  (void)tma_mp_exptmod(mp1, exp, mod, dst);
-}
-
-void silc_mp_pow_mod_ui(SilcMPInt *dst, SilcMPInt *mp1, SilcUInt32 exp,
-                       SilcMPInt *mod)
-{
-  SilcMPInt tmp;
-  silc_mp_init(&tmp);
-  silc_mp_set_ui(&tmp, exp);
-  silc_mp_pow_mod(dst, mp1, &tmp, mod);
-  silc_mp_uninit(&tmp);
-}
-
-void silc_mp_gcd(SilcMPInt *dst, SilcMPInt *mp1, SilcMPInt *mp2)
-{
-  (void)tma_mp_gcd(mp1, mp2, dst);
-}
-
-void silc_mp_gcdext(SilcMPInt *g, SilcMPInt *s, SilcMPInt *t, SilcMPInt *mp1,
-                   SilcMPInt *mp2)
-{
-  (void)tma_mp_exteuclid(mp1, mp2, s, t, g);
-}
-
-int silc_mp_cmp(SilcMPInt *mp1, SilcMPInt *mp2)
-{
-  return tma_mp_cmp(mp1, mp2);
-}
-
-int silc_mp_cmp_si(SilcMPInt *mp1, SilcInt32 si)
-{
-  return tma_mp_cmp_d(mp1, si);
-}
-
-int silc_mp_cmp_ui(SilcMPInt *mp1, SilcUInt32 ui)
-{
-  return tma_mp_cmp_d(mp1, ui);
-}
-
-void silc_mp_abs(SilcMPInt *dst, SilcMPInt *src)
-{
-  (void)tma_mp_abs(src, dst);
-}
-
-void silc_mp_neg(SilcMPInt *dst, SilcMPInt *src)
-{
-  (void)tma_mp_neg(src, dst);
-}
-
-void silc_mp_and(SilcMPInt *dst, SilcMPInt *mp1, SilcMPInt *mp2)
-{
-  (void)tma_mp_and(mp1, mp2, dst);
-}
-
-void silc_mp_or(SilcMPInt *dst, SilcMPInt *mp1, SilcMPInt *mp2)
-{
-  (void)tma_mp_or(mp1, mp2, dst);
-}
-
-void silc_mp_xor(SilcMPInt *dst, SilcMPInt *mp1, SilcMPInt *mp2)
-{
-  (void)tma_mp_xor(mp1, mp2, dst);
-}
diff --git a/lib/silcmath/mp_tma.h b/lib/silcmath/mp_tma.h
deleted file mode 100644 (file)
index 12c927e..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
-
-  mp_tma.h
-
-  Author: Pekka Riikonen <priikone@silcnet.org>
-
-  Copyright (C) 2005 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 MP_TMA_H
-#define MP_TMA_H
-
-#include "tma.h"
-
-#define SILC_MP_INT tma_mp_int
-
-#endif
diff --git a/lib/silcmath/mpbin.c b/lib/silcmath/mpbin.c
deleted file mode 100644 (file)
index ea3070e..0000000
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
-
-  mpbin.c
-
-  Author: Pekka Riikonen <priikone@silcnet.org>
-
-  Copyright (C) 2000 - 2005 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.
-
-*/
-/* $Id$ */
-
-#include "silc.h"
-
-/* Encodes MP integer into binary data. Returns allocated data that
-   must be free'd by the caller. If `len' is provided the destination
-   buffer is allocated that large. If zero then the size is approximated. */
-
-unsigned char *silc_mp_mp2bin(SilcMPInt *val, SilcUInt32 len,
-                             SilcUInt32 *ret_len)
-{
-  SilcUInt32 size;
-  unsigned char *ret;
-
-  size = (len ? len : ((silc_mp_sizeinbase(val, 2) + 7) / 8));
-  ret = silc_calloc(size, sizeof(*ret));
-  if (!ret)
-    return NULL;
-
-  silc_mp_mp2bin_noalloc(val, ret, size);
-
-  if (ret_len)
-    *ret_len = size;
-
-  return ret;
-}
-
-/* Samve as above but does not allocate any memory.  The encoded data is
-   returned into `dst' and it's length to the `ret_len'. */
-
-void silc_mp_mp2bin_noalloc(SilcMPInt *val, unsigned char *dst,
-                           SilcUInt32 dst_len)
-{
-  int i;
-  SilcUInt32 size = dst_len;
-  SilcMPInt tmp;
-
-  silc_mp_init(&tmp);
-  silc_mp_set(&tmp, val);
-
-  for (i = size; i > 0; i--) {
-    dst[i - 1] = (unsigned char)(silc_mp_get_ui(&tmp) & 0xff);
-    silc_mp_div_2exp(&tmp, &tmp, 8);
-  }
-
-  silc_mp_uninit(&tmp);
-}
-
-/* Decodes binary data into MP integer. The integer sent as argument
-   must be initialized. */
-
-void silc_mp_bin2mp(unsigned char *data, SilcUInt32 len, SilcMPInt *ret)
-{
-  int i;
-
-  silc_mp_set_ui(ret, 0);
-
-  for (i = 0; i < len; i++) {
-    silc_mp_mul_2exp(ret, ret, 8);
-    silc_mp_add_ui(ret, ret, data[i]);
-  }
-}
diff --git a/lib/silcmath/silcmath.h b/lib/silcmath/silcmath.h
deleted file mode 100644 (file)
index 08a08c0..0000000
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
-
-  silcmath.h
-
-  Author: Pekka Riikonen <priikone@silcnet.org>
-
-  Copyright (C) 1997 - 2005 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.
-
-*/
-
-/****h* silcmath/SILC Math Interface
- *
- * DESCRIPTION
- *
- * SILC Math interface includes various utility functions such as
- * prime generation, and conversion routines. See the silcmp.h for the
- * SILC MP interface.
- *
- ***/
-
-#ifndef SILCMATH_H
-#define SILCMATH_H
-
-#include "silcrng.h"
-
-/****f* silcmath/SilcMathAPI/silc_math_gen_prime
- *
- * SYNOPSIS
- *
- *    SilcBool silc_math_gen_prime(SilcMPInt *prime, SilcUInt32 bits,
- *                                 SilcBool verbose, SilcRng rng);
- *
- * DESCRIPTION
- *
- *    Find appropriate prime. It generates a number by taking random bytes.
- *    It then tests the number that it's not divisible by any of the small
- *    primes and then it performs Fermat's prime test. I thank Rieks Joosten
- *    (r.joosten@pijnenburg.nl) for such a good help with prime tests.
- *
- *    If argument verbose is TRUE this will display some status information
- *    about the progress of generation.  If the `rng' is NULL then global
- *    RNG is used, if non-NULL then `rng' is used to generate the random
- *    number number.
- *
- ***/
-SilcBool silc_math_gen_prime(SilcMPInt *prime, SilcUInt32 bits,
-                            SilcBool verbose, SilcRng rng);
-
-/****f* silcmath/SilcMathAPI/silc_math_prime_test
- *
- * SYNOPSIS
- *
- *    int silc_math_prime_test(SilcMPInt *p);
- *
- * DESCRIPTION
- *
- *    Performs primality testings for given number. Returns TRUE if the
- *    number is probably a prime.
- *
- ***/
-SilcBool silc_math_prime_test(SilcMPInt *p);
-
-#endif
diff --git a/lib/silcmath/silcmp.h b/lib/silcmath/silcmp.h
deleted file mode 100644 (file)
index 313e754..0000000
+++ /dev/null
@@ -1,729 +0,0 @@
-/*
-
-  silcmp.h
-
-  Author: Pekka Riikonen <priikone@silcnet.org>
-
-  Copyright (C) 1997 - 2007 Pekka Riikonen
-
-  This program is free software; you can redistribute it and/or modify
-  it under the terms of the GNU General Public License as published by
-  the Free Software Foundation; version 2 of the License.
-
-  This program is distributed in the hope that it will be useful,
-  but WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-  GNU General Public License for more details.
-
-*/
-
-/****h* silcmath/SILC MP Interface
- *
- * DESCRIPTION
- *
- * SILC MP Library Interface. This interface defines the arbitrary
- * precision arithmetic routines for SILC. The interface is generic but
- * is mainly intended for crypto usage. This interface is used by SILC
- * routines that needs big numbers, such as RSA implementation,
- * Diffie-Hellman implementation etc.
- *
- ***/
-
-#ifndef SILCMP_H
-#define SILCMP_H
-
-#if defined(SILC_MP_GMP)
-#include "mp_gmp.h"            /* SILC_MP_GMP */
-#else
-#ifdef SILC_DIST_TMA
-#include "mp_tma.h"
-#endif /* SILC_DIST_TMA */
-#ifdef SILC_DIST_TFM
-#include "mp_tfm.h"
-#endif /* SILC_DIST_TFM */
-#endif
-
-/****d* silcmath/SilcMPAPI/SilcMPInt
- *
- * NAME
- *
- *    typedef SILC_MP_INT SilcMPInt;
- *
- * DESCRIPTION
- *
- *    The SILC MP Integer definition. This is the actual MP integer.
- *    The type is defined as SILC_MP_INT as it is implementation specific
- *    and is unknown to the application.
- *
- * SOURCE
- */
-typedef SILC_MP_INT SilcMPInt;
-/***/
-
-/****f* silcmath/SilcMPAPI/silc_mp_init
- *
- * SYNOPSIS
- *
- *    void silc_mp_init(SilcMPInt mp);
- *
- * DESCRIPTION
- *
- *    Initializes the SilcMPInt *that is the actual MP Integer.
- *    This must be called before any of the silc_mp_ routines can be
- *    used. The integer is uninitialized with the silc_mp_uninit function.
- *
- ***/
-void silc_mp_init(SilcMPInt *mp);
-
-SilcBool silc_mp_sinit(SilcStack stack, SilcMPInt *mp);
-
-/****f* silcmath/SilcMPAPI/silc_mp_uninit
- *
- * SYNOPSIS
- *
- *    void silc_mp_uninit(SilcMPInt *mp);
- *
- * DESCRIPTION
- *
- *    Uninitializes the MP Integer.
- *
- ***/
-void silc_mp_uninit(SilcMPInt *mp);
-
-/****f* silcmath/SilcMPAPI/silc_mp_size
- *
- * SYNOPSIS
- *
- *    size_t silc_mp_size(SilcMPInt *mp);
- *
- * DESCRIPTION
- *
- *    Return the precision size of the integer `mp'.
- *
- ***/
-size_t silc_mp_size(SilcMPInt *mp);
-
-/****f* silcmath/SilcMPAPI/silc_mp_sizeinbase
- *
- * SYNOPSIS
- *
- *    size_t silc_mp_sizeinbase(SilcMPInt *mp, int base);
- *
- * DESCRIPTION
- *
- *    Return the size of the integer in base `base'.
- *
- * NOTES
- *
- *    For any other base but 2 this function usually returns only an
- *    approximated size in the base.  It is however guaranteed that the
- *    the returned size is always at least the size of the integer or
- *    larger.
- *
- *    For base 2 this returns the exact bit-size of the integer.
- *
- ***/
-size_t silc_mp_sizeinbase(SilcMPInt *mp, int base);
-
-/****f* silcmath/SilcMPAPI/silc_mp_set
- *
- * SYNOPSIS
- *
- *    void silc_mp_set(SilcMPInt *dst, SilcMPInt *src);
- *
- * DESCRIPTION
- *
- *    Set `dst' integer from `src' integer. The `dst' must already be
- *    initialized.
- *
- ***/
-void silc_mp_set(SilcMPInt *dst, SilcMPInt *src);
-
-/****f* silcmath/SilcMPAPI/silc_mp_set_ui
- *
- * SYNOPSIS
- *
- *    void silc_mp_set_ui(SilcMPInt *dst, SilcUInt32 ui);
- *
- * DESCRIPTION
- *
- *    Set `dst' integer from unsigned word `ui'. The `dst' must already be
- *    initialized.
- *
- ***/
-void silc_mp_set_ui(SilcMPInt *dst, SilcUInt32 ui);
-
-/****f* silcmath/SilcMPAPI/silc_mp_set_si
- *
- * SYNOPSIS
- *
- *    void silc_mp_set_si(SilcMPInt *dst, SilcInt32 si);
- *
- * DESCRIPTION
- *
- *    Set `dst' integer from single word `si'. The `dst' must
- *    already be initialized.
- *
- ***/
-void silc_mp_set_si(SilcMPInt *dst, SilcInt32 si);
-
-/****f* silcmath/SilcMPAPI/silc_mp_set_str
- *
- * SYNOPSIS
- *
- *    void silc_mp_set_str(SilcMPInt *dst, const char *str, int base);
- *
- * DESCRIPTION
- *
- *    Set `dst' integer from string `str' of base `base'. The `dst' must
- *    already be initialized.
- *
- * NOTES
- *
- *    For base 2 the string must be in ASCII bit presentation, not in
- *    binary.  Use the silc_mp_bin2mp to decode binary into integer.
- *
- ***/
-void silc_mp_set_str(SilcMPInt *dst, const char *str, int base);
-
-/****f* silcmath/SilcMPAPI/silc_mp_get_ui
- *
- * SYNOPSIS
- *
- *    SilcUInt32 silc_mp_get_ui(SilcMPInt *mp);
- *
- * DESCRIPTION
- *
- *    Returns the least significant unsigned word from `mp'.
- *
- ***/
-SilcUInt32 silc_mp_get_ui(SilcMPInt *mp);
-
-/****f* silcmath/SilcMPAPI/silc_mp_get_str
- *
- * SYNOPSIS
- *
- *    void silc_mp_get_str(char *str, SilcMPInt *mp, int base);
- *
- * DESCRIPTION
- *
- *    Converts integer `mp' into a string of base `base'. The `str'
- *    must already have space allocated. The function returns the same
- *    as `str' or NULL on error.
- *
- * NOTES
- *
- *    For base 2 the returned string is in ASCII bit presentation, not
- *    in binary.  Use the silc_mp_mp2bin to encode integer into binary.
- *
- ***/
-char *silc_mp_get_str(char *str, SilcMPInt *mp, int base);
-
-/****f* silcmath/SilcMPAPI/silc_mp_add
- *
- * SYNOPSIS
- *
- *    void silc_mp_add(SilcMPInt *dst, SilcMPInt *mp1, SilcMPInt *mp2);
- *
- * DESCRIPTION
- *
- *    Add two integers `mp1' and `mp2' and save the result to `dst'.
- *
- ***/
-void silc_mp_add(SilcMPInt *dst, SilcMPInt *mp1, SilcMPInt *mp2);
-
-/****f* silcmath/SilcMPAPI/silc_mp_add_ui
- *
- * SYNOPSIS
- *
- *    void silc_mp_add_ui(SilcMPInt *dst, SilcMPInt *mp1, SilcUInt32 ui);
- *
- * DESCRIPTION
- *
- *    Add two integers `mp1' and unsigned word `ui' and save the result
- *    to `dst'.
- *
- ***/
-void silc_mp_add_ui(SilcMPInt *dst, SilcMPInt *mp1, SilcUInt32 ui);
-
-/****f* silcmath/SilcMPAPI/silc_mp_sub
- *
- * SYNOPSIS
- *
- *    void silc_mp_sub(SilcMPInt *dst, SilcMPInt *mp1, SilcMPInt *mp2);
- *
- * DESCRIPTION
- *
- *    Subtract two integers `mp1' and `mp2' and save the result to `dst'.
- *
- ***/
-void silc_mp_sub(SilcMPInt *dst, SilcMPInt *mp1, SilcMPInt *mp2);
-
-/****f* silcmath/SilcMPAPI/silc_mp_sub_ui
- *
- * SYNOPSIS
- *
- *    void silc_mp_sub_ui(SilcMPInt *dst, SilcMPInt *mp1, SilcUInt32 ui);
- *
- * DESCRIPTION
- *
- *    Subtract integers `mp1' and unsigned word `ui' and save the result
- *    to `dst'.
- *
- ***/
-void silc_mp_sub_ui(SilcMPInt *dst, SilcMPInt *mp1, SilcUInt32 ui);
-
-/****f* silcmath/SilcMPAPI/silc_mp_mul
- *
- * SYNOPSIS
- *
- *    void silc_mp_mul(SilcMPInt *dst, SilcMPInt *mp1, SilcMPInt *mp2);
- *
- * DESCRIPTION
- *
- *    Multiply two integers `mp1' and `mp2' and save the result to `dst'.
- *
- ***/
-void silc_mp_mul(SilcMPInt *dst, SilcMPInt *mp1, SilcMPInt *mp2);
-
-/****f* silcmath/SilcMPAPI/silc_mp_mul_ui
- *
- * SYNOPSIS
- *
- *    void silc_mp_mul_ui(SilcMPInt *dst, SilcMPInt *mp1, SilcUInt32 ui);
- *
- * DESCRIPTION
- *
- *    Multiply integer `mp1' and unsigned word `ui' and save the result
- *    to `dst'.
- *
- ***/
-void silc_mp_mul_ui(SilcMPInt *dst, SilcMPInt *mp1, SilcUInt32 ui);
-
-/****f* silcmath/SilcMPAPI/silc_mp_mul_2exp
- *
- * SYNOPSIS
- *
- *    void silc_mp_mul_2exp(SilcMPInt *dst, SilcMPInt *mp1, SilcUInt32 exp);
- *
- * DESCRIPTION
- *
- *    Multiply integers `mp1' with 2 ** `exp' and save the result to
- *    `dst'. This is equivalent to dst = mp1 * (2 ^ exp).
- *
- ***/
-void silc_mp_mul_2exp(SilcMPInt *dst, SilcMPInt *mp1, SilcUInt32 exp);
-
-/****f* silcmath/SilcMPAPI/silc_mp_sqrt
- *
- * SYNOPSIS
- *
- *    void silc_mp_sqrt(SilcMPInt *dst, SilcMPInt *src);
- *
- * DESCRIPTION
- *
- *    Compute square root of floor(sqrt(src)) and save the result to `dst'.
- *
- ***/
-void silc_mp_sqrt(SilcMPInt *dst, SilcMPInt *src);
-
-/****f* silcmath/SilcMPAPI/silc_mp_div
- *
- * SYNOPSIS
- *
- *    void silc_mp_div(SilcMPInt *dst, SilcMPInt *mp1, SilcMPInt *mp2);
- *
- * DESCRIPTION
- *
- *    Divide the `mp1' and `mp2' and save the result to the `dst'. This
- *    is equivalent to dst = mp1 / mp2;
- *
- ***/
-void silc_mp_div(SilcMPInt *dst, SilcMPInt *mp1, SilcMPInt *mp2);
-
-/****f* silcmath/SilcMPAPI/silc_mp_div_ui
- *
- * SYNOPSIS
- *
- *    void silc_mp_div_ui(SilcMPInt *dst, SilcMPInt *mp1, SilcUInt32 ui);
- *
- * DESCRIPTION
- *
- *    Divide the `mp1' and unsigned word `ui' and save the result to the
- *    `dst'. This is equivalent to dst = mp1 / ui;
- *
- ***/
-void silc_mp_div_ui(SilcMPInt *dst, SilcMPInt *mp1, SilcUInt32 ui);
-
-/****f* silcmath/SilcMPAPI/silc_mp_div_qr
- *
- * SYNOPSIS
- *
- *    void silc_mp_div_qr(SilcMPInt *q, SilcMPInt *r, SilcMPInt *mp1,
- *                        SilcMPInt *mp2);
- *
- * DESCRIPTION
- *
- *    Divide the `mp1' and `mp2' and save the quotient to the `q' and
- *    the remainder to the `r'.  This is equivalent to the q = mp1 / mp2,
- *    r = mp1 mod mp2 (or mp1 = mp2 * q + r). If the `q' or `r' is NULL
- *    then the operation is omitted.
- *
- ***/
-void silc_mp_div_qr(SilcMPInt *q, SilcMPInt *r, SilcMPInt *mp1,
-                   SilcMPInt *mp2);
-
-/****f* silcmath/SilcMPAPI/silc_mp_div_2exp
- *
- * SYNOPSIS
- *
- *    void silc_mp_div_2exp(SilcMPInt *dst, SilcMPInt *mp1, SilcMPInt *mp2);
- *
- * DESCRIPTION
- *
- *    Divide the `mp1' with 2 ** `exp' and save the result to `dst'.
- *    This is equivalent to dst = mp1 / (2 ^ exp).
- *
- ***/
-void silc_mp_div_2exp(SilcMPInt *dst, SilcMPInt *mp1, SilcUInt32 exp);
-
-/****f* silcmath/SilcMPAPI/silc_mp_div_2exp_qr
- *
- * SYNOPSIS
- *
- *    void silc_mp_div_2exp_qr(SilcMPInt *q, SilcMPInt *r, SilcMPInt *mp1,
- *                             SilcUInt32 exp);
- *
- * DESCRIPTION
- *
- *    Divide the `mp1' with 2 ** `exp' and save the quotient to `q' and
- *    the remainder to `r'. This is equivalent to q = mp1 / (2 ^ exp),
- *    r = mp1 mod (2 ^ exp). If the `q' or `r' is NULL then the operation
- *    is omitted.
- *
- ***/
-void silc_mp_div_2exp_qr(SilcMPInt *q, SilcMPInt *r, SilcMPInt *mp1,
-                        SilcUInt32 exp);
-
-/****f* silcmath/SilcMPAPI/silc_mp_mod
- *
- * SYNOPSIS
- *
- *    void silc_mp_mod(SilcMPInt *dst, SilcMPInt *mp1, SilcMPInt *mp2);
- *
- * DESCRIPTION
- *
- *    Mathematical MOD function. Produces the remainder of `mp1' and `mp2'
- *    and saves the result to `dst'. This is equivalent to dst = mp1 mod mp2.
- *    The same result can also be get with silc_mp_div_qr as that function
- *    returns the remainder as well.
- *
- ***/
-void silc_mp_mod(SilcMPInt *dst, SilcMPInt *mp1, SilcMPInt *mp2);
-
-/****f* silcmath/SilcMPAPI/silc_mp_mod_ui
- *
- * SYNOPSIS
- *
- *    void silc_mp_mod_ui(SilcMPInt *dst, SilcMPInt *mp1, SilcUInt32 ui);
- *
- * DESCRIPTION
- *
- *    Mathematical MOD function. Produces the remainder of `mp1' and
- *    unsigned word `ui' and saves the result to `dst'. This is equivalent
- *    to dst = mp1 mod ui.
- *
- ***/
-void silc_mp_mod_ui(SilcMPInt *dst, SilcMPInt *mp1, SilcUInt32 ui);
-
-/****f* silcmath/SilcMPAPI/silc_mp_mod_2exp
- *
- * SYNOPSIS
- *
- *    void silc_mp_mod_2exp(SilcMPInt *dst, SilcMPInt *mp1, SilcMPInt *mp2);
- *
- * DESCRIPTION
- *
- *    Computes the remainder of `mp1' with 2 ** `exp' and saves the
- *    result to `dst'. This is equivalent to dst = mp1 mod (2 ^ exp).
- *    The same result can also be get with silc_mp_div_2exp_qr as that
- *    function returns the remainder as well.
- *
- ***/
-void silc_mp_mod_2exp(SilcMPInt *dst, SilcMPInt *mp1, SilcUInt32 ui);
-
-/****f* silcmath/SilcMPAPI/silc_mp_pow
- *
- * SYNOPSIS
- *
- *    void silc_mp_pow(SilcMPInt *dst, SilcMPInt *mp1, SilcMPInt *exp);
- *
- * DESCRIPTION
- *
- *    Compute `mp1' ** `exp' and save the result to `dst'. This is
- *    equivalent to dst = mp1 ^ exp.
- *
- ***/
-void silc_mp_pow(SilcMPInt *dst, SilcMPInt *mp1, SilcMPInt *exp);
-
-/****f* silcmath/SilcMPAPI/silc_mp_pow_ui
- *
- * SYNOPSIS
- *
- *    void silc_mp_pow_ui(SilcMPInt *dst, SilcMPInt *mp1, SilcUInt32 exp);
- *
- * DESCRIPTION
- *
- *    Compute `mp1' ** `exp' and save the result to `dst'. This is
- *    equivalent to dst = mp1 ^ exp.
- *
- ***/
-void silc_mp_pow_ui(SilcMPInt *dst, SilcMPInt *mp1, SilcUInt32 exp);
-
-/****f* silcmath/SilcMPAPI/silc_mp_pow_mod
- *
- * SYNOPSIS
- *
- *    void silc_mp_pow_mod(SilcMPInt *dst, SilcMPInt *mp1, SilcMPInt *exp,
- *                         SilcMPInt *mod);
- *
- * DESCRIPTION
- *
- *    Compute (`mp1' ** `exp') mod `mod' and save the result to `dst'.
- *    This is equivalent to dst = (mp1 ^ exp) mod mod.
- *
- ***/
-void silc_mp_pow_mod(SilcMPInt *dst, SilcMPInt *mp1, SilcMPInt *exp,
-                    SilcMPInt *mod);
-
-/****f* silcmath/SilcMPAPI/silc_mp_pow_mod_ui
- *
- * SYNOPSIS
- *
- *    void silc_mp_pow_mod_ui(SilcMPInt *dst, SilcMPInt *mp1, SilcUInt32 exp,
- *                            SilcMPInt *mod);
- *
- * DESCRIPTION
- *
- *    Compute (`mp1' ** `exp') mod `mod' and save the result to `dst'.
- *    This is equivalent to dst = (mp1 ^ exp) mod mod.
- *
- ***/
-void silc_mp_pow_mod_ui(SilcMPInt *dst, SilcMPInt *mp1, SilcUInt32 exp,
-                       SilcMPInt *mod);
-
-/****f* silcmath/SilcMPAPI/silc_mp_modinv
- *
- * SYNOPSIS
- *
- *    void silc_mp_modinv(SilcMPInt *inv, SilcMPInt *a, SilcMPInt *n);
- *
- * DESCRIPTION
- *
- *    Find multiplicative inverse using Euclid's extended algorithm.
- *    Computes inverse such that a * inv mod n = 1, where 0 < a < n.
- *    Algorithm goes like this:
- *
- *    g(0) = n    v(0) = 0
- *    g(1) = a    v(1) = 1
- *
- *    y = g(i-1) / g(i)
- *    g(i+1) = g(i-1) - y * g(i) = g(i)-1 mod g(i)
- *    v(i+1) = v(i-1) - y * v(i)
- *
- *    do until g(i) = 0, then inverse = v(i-1). If inverse is negative then n,
- *    is added to inverse making it positive again. (Sometimes the algorithm
- *    has a variable u defined too and it behaves just like v, except that
- *    initalize values are swapped (i.e. u(0) = 1, u(1) = 0). However, u is
- *    not needed by the algorithm so it does not have to be included.)
- *
- ***/
-void silc_mp_modinv(SilcMPInt *inv, SilcMPInt *a, SilcMPInt *n);
-
-/****f* silcmath/SilcMPAPI/silc_mp_gcd
- *
- * SYNOPSIS
- *
- *    void silc_mp_gcd(SilcMPInt *dst, SilcMPInt *mp1, SilcMPInt *mp2);
- *
- * DESCRIPTION
- *
- *    Calculate the greatest common divisor of the integers `mp1' and `mp2'
- *    and save the result to `dst'.
- *
- ***/
-void silc_mp_gcd(SilcMPInt *dst, SilcMPInt *mp1, SilcMPInt *mp2);
-
-/****f* silcmath/SilcMPAPI/silc_mp_gcdext
- *
- * SYNOPSIS
- *
- *    void silc_mp_gcdext(SilcMPInt *g, SilcMPInt *s, SilcMPInt *t,
- *                        SilcMPInt *mp1, SilcMPInt *mp2);
- *
- * DESCRIPTION
- *
- *    Calculate the extended greatest common divisor `g', `s' and `t' such
- *    that g = mp1 * s + mp2 * + t.
- *
- ***/
-void silc_mp_gcdext(SilcMPInt *g, SilcMPInt *s, SilcMPInt *t, SilcMPInt *mp1,
-                   SilcMPInt *mp2);
-
-/****f* silcmath/SilcMPAPI/silc_mp_cmp
- *
- * SYNOPSIS
- *
- *    int silc_mp_cmp(SilcMPInt *mp1, SilcMPInt *mp2);
- *
- * DESCRIPTION
- *
- *    Compare `mp1' and `mp2'. Returns posivite, zero, or negative
- *    if `mp1' > `mp2', `mp1' == `mp2', or `mp1' < `mp2', respectively.
- *
- ***/
-int silc_mp_cmp(SilcMPInt *mp1, SilcMPInt *mp2);
-
-/****f* silcmath/SilcMPAPI/silc_mp_cmp_si
- *
- * SYNOPSIS
- *
- *    int silc_mp_cmp_si(SilcMPInt *mp1, SilcInt32 si);
- *
- * DESCRIPTION
- *
- *    Compare `mp1' and single word `si'. Returns posivite, zero, or negative
- *    if `mp1' > `si', `mp1' == `si', or `mp1' < `si', respectively.
- *
- ***/
-int silc_mp_cmp_si(SilcMPInt *mp1, SilcInt32 si);
-
-/****f* silcmath/SilcMPAPI/silc_mp_cmp_ui
- *
- * SYNOPSIS
- *
- *    int silc_mp_cmp_ui(SilcMPInt *mp1, SilcUInt32 ui);
- *
- * DESCRIPTION
- *
- *    Compare `mp1' and unsigned word `ui'. Returns posivite, zero, or
- *    negative if `mp1' > `ui', `mp1' == `ui', or `mp1' < `ui',
- *    respectively.
- *
- ***/
-int silc_mp_cmp_ui(SilcMPInt *mp1, SilcUInt32 ui);
-
-/****f* silcmath/SilcMPAPI/silc_mp_mp2bin
- *
- * SYNOPSIS
- *
- *    unsigned char *silc_mp_mp2bin(SilcMPInt *val, SilcUInt32 len,
- *                                  SilcUInt32 *ret_len);
- *
- * DESCRIPTION
- *
- *    Encodes MP integer into binary data. Returns allocated data that
- *    must be free'd by the caller. If `len' is provided the destination
- *    buffer is allocated that large. If zero then the size is approximated.
- *
- ***/
-unsigned char *silc_mp_mp2bin(SilcMPInt *val, SilcUInt32 len,
-                             SilcUInt32 *ret_len);
-
-/****f* silcmath/SilcMPAPI/silc_mp_mp2bin_noalloc
- *
- * SYNOPSIS
- *
- *    void silc_mp_mp2bin_noalloc(SilcMPInt *val, unsigned char *dst,
- *                                SilcUInt32 dst_len);
- *
- * DESCRIPTION
- *
- *    Same as silc_mp_mp2bin but does not allocate any memory.  The
- *    encoded data is returned into `dst' of size of `dst_len'.
- *
- ***/
-void silc_mp_mp2bin_noalloc(SilcMPInt *val, unsigned char *dst,
-                           SilcUInt32 dst_len);
-
-/****f* silcmath/SilcMPAPI/silc_mp_bin2mp
- *
- * SYNOPSIS
- *
- *    void silc_mp_bin2mp(unsigned char *data, SilcUInt32 len,
- *                        SilcMPInt *ret);
- *
- * DESCRIPTION
- *
- *    Decodes binary data into MP integer. The integer sent as argument
- *    must be initialized.
- *
- ***/
-void silc_mp_bin2mp(unsigned char *data, SilcUInt32 len, SilcMPInt *ret);
-
-/****f* silcmath/SilcMPAPI/silc_mp_abs
- *
- * SYNOPSIS
- *
- *    void silc_mp_abs(SilcMPInt *src, SilcMPInt *dst);
- *
- * DESCRIPTION
- *
- *    Assign the absolute value of `src' to `dst'.
- *
- ***/
-void silc_mp_abs(SilcMPInt *dst, SilcMPInt *src);
-
-/****f* silcmath/SilcMPAPI/silc_mp_neg
- *
- * SYNOPSIS
- *
- *    void silc_mp_neg(SilcMPInt *dst, SilcMPInt *src);
- *
- * DESCRIPTION
- *
- *    Negate `src' and save the result to `dst'.
- *
- ***/
-void silc_mp_neg(SilcMPInt *dst, SilcMPInt *src);
-
-/****f* silcmath/SilcMPAPI/silc_mp_and
- *
- * SYNOPSIS
- *
- *    void silc_mp_and(SilcMPInt *dst, SilcMPInt *mp1, SilcMPInt *mp2);
- *
- * DESCRIPTION
- *
- *    Logical and operator. The result is saved to `dst'.
- *
- ***/
-void silc_mp_and(SilcMPInt *dst, SilcMPInt *mp1, SilcMPInt *mp2);
-
-/****f* silcmath/SilcMPAPI/silc_mp_or
- *
- * SYNOPSIS
- *
- *    void silc_mp_or(SilcMPInt *dst, SilcMPInt *mp1, SilcMPInt *mp2);
- *
- * DESCRIPTION
- *
- *    Logical inclusive OR operator. The result is saved to `dst'.
- *
- ***/
-void silc_mp_or(SilcMPInt *dst, SilcMPInt *mp1, SilcMPInt *mp2);
-
-/****f* silcmath/SilcMPAPI/silc_mp_xor
- *
- * SYNOPSIS
- *
- *    void silc_mp_xor(SilcMPInt *dst, SilcMPInt *mp1, SilcMPInt *mp2);
- *
- * DESCRIPTION
- *
- *    Logical exclusive OR operator. The result is saved to `dst'.
- *
- ***/
-void silc_mp_xor(SilcMPInt *dst, SilcMPInt *mp1, SilcMPInt *mp2);
-
-#endif
diff --git a/lib/silcmath/silcprimegen.c b/lib/silcmath/silcprimegen.c
deleted file mode 100644 (file)
index ed9b884..0000000
+++ /dev/null
@@ -1,362 +0,0 @@
-/*
-
-  silcprimegen.c
-
-  Author: Pekka Riikonen <priikone@silcnet.org>
-
-  Copyright (C) 1997 - 2005 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.
-
-*/
-/* Created: Mon Dec  8 16:35:37 GMT+0200 1997 */
-/* $Id$ */
-
-#include "silc.h"
-
-/*
-   Fixed primetable for small prime division. We use this primetable to
-   test if possible prime is divisible any of these. Primetable is NULL
-   terminated. This same primetable can be found in SSH and PGP except that
-   SSH don't have prime 2 in the table. This sort of prime table is easily
-   created, for example, using sieve of Erastosthenes.
-
-   Just to include; if somebody is interested about Erastosthenes. Creating a
-   small prime table using sieve of Erastosthenes would go like this: Write
-   down a list of integers in range of 2 to n. Here in example n = 20.
-
-   2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
-
-   Then mark all multiples of 2 (Note: 2 is a prime number):
-
-   2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
-       x   x   x    x     x     x     x     x     x
-
-   Move to the next unmarked number, 3, then mark all multiples of 3.
-
-   2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
-       x   x   x x  x     x     x  x  x     x     x
-
-   And continue doing this, marking all multiples of the next unmarked
-   number until there are now new unmarked numbers. And there you have a
-   prime table. So in this example, primes between 2 - 20 are:
-
-   2 3 5 7 11 13 17 19
-
-*/
-
-static SilcUInt32 primetable[] =
-{
-  2, 3, 5, 7, 11, 13, 17, 19,
-  23, 29, 31, 37, 41, 43, 47, 53,
-  59, 61, 67, 71, 73, 79, 83, 89,
-  97, 101, 103, 107, 109, 113, 127, 131,
-  137, 139, 149, 151, 157, 163, 167, 173,
-  179, 181, 191, 193, 197, 199, 211, 223,
-  227, 229, 233, 239, 241, 251, 257, 263,
-  269, 271, 277, 281, 283, 293, 307, 311,
-  313, 317, 331, 337, 347, 349, 353, 359,
-  367, 373, 379, 383, 389, 397, 401, 409,
-  419, 421, 431, 433, 439, 443, 449, 457,
-  461, 463, 467, 479, 487, 491, 499, 503,
-  509, 521, 523, 541, 547, 557, 563, 569,
-  571, 577, 587, 593, 599, 601, 607, 613,
-  617, 619, 631, 641, 643, 647, 653, 659,
-  661, 673, 677, 683, 691, 701, 709, 719,
-  727, 733, 739, 743, 751, 757, 761, 769,
-  773, 787, 797, 809, 811, 821, 823, 827,
-  829, 839, 853, 857, 859, 863, 877, 881,
-  883, 887, 907, 911, 919, 929, 937, 941,
-  947, 953, 967, 971, 977, 983, 991, 997,
-  1009, 1013, 1019, 1021, 1031, 1033, 1039, 1049,
-  1051, 1061, 1063, 1069, 1087, 1091, 1093, 1097,
-  1103, 1109, 1117, 1123, 1129, 1151, 1153, 1163,
-  1171, 1181, 1187, 1193, 1201, 1213, 1217, 1223,
-  1229, 1231, 1237, 1249, 1259, 1277, 1279, 1283,
-  1289, 1291, 1297, 1301, 1303, 1307, 1319, 1321,
-  1327, 1361, 1367, 1373, 1381, 1399, 1409, 1423,
-  1427, 1429, 1433, 1439, 1447, 1451, 1453, 1459,
-  1471, 1481, 1483, 1487, 1489, 1493, 1499, 1511,
-  1523, 1531, 1543, 1549, 1553, 1559, 1567, 1571,
-  1579, 1583, 1597, 1601, 1607, 1609, 1613, 1619,
-  1621, 1627, 1637, 1657, 1663, 1667, 1669, 1693,
-  1697, 1699, 1709, 1721, 1723, 1733, 1741, 1747,
-  1753, 1759, 1777, 1783, 1787, 1789, 1801, 1811,
-  1823, 1831, 1847, 1861, 1867, 1871, 1873, 1877,
-  1879, 1889, 1901, 1907, 1913, 1931, 1933, 1949,
-  1951, 1973, 1979, 1987, 1993, 1997, 1999, 2003,
-  2011, 2017, 2027, 2029, 2039, 2053, 2063, 2069,
-  2081, 2083, 2087, 2089, 2099, 2111, 2113, 2129,
-  2131, 2137, 2141, 2143, 2153, 2161, 2179, 2203,
-  2207, 2213, 2221, 2237, 2239, 2243, 2251, 2267,
-  2269, 2273, 2281, 2287, 2293, 2297, 2309, 2311,
-  2333, 2339, 2341, 2347, 2351, 2357, 2371, 2377,
-  2381, 2383, 2389, 2393, 2399, 2411, 2417, 2423,
-  2437, 2441, 2447, 2459, 2467, 2473, 2477, 2503,
-  2521, 2531, 2539, 2543, 2549, 2551, 2557, 2579,
-  2591, 2593, 2609, 2617, 2621, 2633, 2647, 2657,
-  2659, 2663, 2671, 2677, 2683, 2687, 2689, 2693,
-  2699, 2707, 2711, 2713, 2719, 2729, 2731, 2741,
-  2749, 2753, 2767, 2777, 2789, 2791, 2797, 2801,
-  2803, 2819, 2833, 2837, 2843, 2851, 2857, 2861,
-  2879, 2887, 2897, 2903, 2909, 2917, 2927, 2939,
-  2953, 2957, 2963, 2969, 2971, 2999, 3001, 3011,
-  3019, 3023, 3037, 3041, 3049, 3061, 3067, 3079,
-  3083, 3089, 3109, 3119, 3121, 3137, 3163, 3167,
-  3169, 3181, 3187, 3191, 3203, 3209, 3217, 3221,
-  3229, 3251, 3253, 3257, 3259, 3271, 3299, 3301,
-  3307, 3313, 3319, 3323, 3329, 3331, 3343, 3347,
-  3359, 3361, 3371, 3373, 3389, 3391, 3407, 3413,
-  3433, 3449, 3457, 3461, 3463, 3467, 3469, 3491,
-  3499, 3511, 3517, 3527, 3529, 3533, 3539, 3541,
-  3547, 3557, 3559, 3571, 3581, 3583, 3593, 3607,
-  3613, 3617, 3623, 3631, 3637, 3643, 3659, 3671,
-  3673, 3677, 3691, 3697, 3701, 3709, 3719, 3727,
-  3733, 3739, 3761, 3767, 3769, 3779, 3793, 3797,
-  3803, 3821, 3823, 3833, 3847, 3851, 3853, 3863,
-  3877, 3881, 3889, 3907, 3911, 3917, 3919, 3923,
-  3929, 3931, 3943, 3947, 3967, 3989, 4001, 4003,
-  4007, 4013, 4019, 4021, 4027, 4049, 4051, 4057,
-  4073, 4079, 4091, 4093, 4099, 4111, 4127, 4129,
-  4133, 4139, 4153, 4157, 4159, 4177, 4201, 4211,
-  4217, 4219, 4229, 4231, 4241, 4243, 4253, 4259,
-  4261, 4271, 4273, 4283, 4289, 4297, 4327, 4337,
-  4339, 4349, 4357, 4363, 4373, 4391, 4397, 4409,
-  4421, 4423, 4441, 4447, 4451, 4457, 4463, 4481,
-  4483, 4493, 4507, 4513, 4517, 4519, 4523, 4547,
-  4549, 4561, 4567, 4583, 4591, 4597, 4603, 4621,
-  4637, 4639, 4643, 4649, 4651, 4657, 4663, 4673,
-  4679, 4691, 4703, 4721, 4723, 4729, 4733, 4751,
-  4759, 4783, 4787, 4789, 4793, 4799, 4801, 4813,
-  4817, 4831, 4861, 4871, 4877, 4889, 4903, 4909,
-  4919, 4931, 4933, 4937, 4943, 4951, 4957, 4967,
-  4969, 4973, 4987, 4993, 4999, 5003, 5009, 5011,
-  5021, 5023, 5039, 5051, 5059, 5077, 5081, 5087,
-  5099, 5101, 5107, 5113, 5119, 5147, 5153, 5167,
-  5171, 5179, 5189, 5197, 5209, 5227, 5231, 5233,
-  5237, 5261, 5273, 5279, 5281, 5297, 5303, 5309,
-  5323, 5333, 5347, 5351, 5381, 5387, 5393, 5399,
-  5407, 5413, 5417, 5419, 5431, 5437, 5441, 5443,
-  5449, 5471, 5477, 5479, 5483, 5501, 5503, 5507,
-  5519, 5521, 5527, 5531, 5557, 5563, 5569, 5573,
-  5581, 5591, 5623, 5639, 5641, 5647, 5651, 5653,
-  5657, 5659, 5669, 5683, 5689, 5693, 5701, 5711,
-  5717, 5737, 5741, 5743, 5749, 5779, 5783, 5791,
-  5801, 5807, 5813, 5821, 5827, 5839, 5843, 5849,
-  5851, 5857, 5861, 5867, 5869, 5879, 5881, 5897,
-  5903, 5923, 5927, 5939, 5953, 5981, 5987, 6007,
-  6011, 6029, 6037, 6043, 6047, 6053, 6067, 6073,
-  6079, 6089, 6091, 6101, 6113, 6121, 6131, 6133,
-  6143, 6151, 6163, 6173, 6197, 6199, 6203, 6211,
-  6217, 6221, 6229, 6247, 6257, 6263, 6269, 6271,
-  6277, 6287, 6299, 6301, 6311, 6317, 6323, 6329,
-  6337, 6343, 6353, 6359, 6361, 6367, 6373, 6379,
-  6389, 6397, 6421, 6427, 6449, 6451, 6469, 6473,
-  6481, 6491, 6521, 6529, 6547, 6551, 6553, 6563,
-  6569, 6571, 6577, 6581, 6599, 6607, 6619, 6637,
-  6653, 6659, 6661, 6673, 6679, 6689, 6691, 6701,
-  6703, 6709, 6719, 6733, 6737, 6761, 6763, 6779,
-  6781, 6791, 6793, 6803, 6823, 6827, 6829, 6833,
-  6841, 6857, 6863, 6869, 6871, 6883, 6899, 6907,
-  6911, 6917, 6947, 6949, 6959, 6961, 6967, 6971,
-  6977, 6983, 6991, 6997, 7001, 7013, 7019, 7027,
-  7039, 7043, 7057, 7069, 7079, 7103, 7109, 7121,
-  7127, 7129, 7151, 7159, 7177, 7187, 7193, 7207,
-  7211, 7213, 7219, 7229, 7237, 7243, 7247, 7253,
-  7283, 7297, 7307, 7309, 7321, 7331, 7333, 7349,
-  7351, 7369, 7393, 7411, 7417, 7433, 7451, 7457,
-  7459, 7477, 7481, 7487, 7489, 7499, 7507, 7517,
-  7523, 7529, 7537, 7541, 7547, 7549, 7559, 7561,
-  7573, 7577, 7583, 7589, 7591, 7603, 7607, 7621,
-  7639, 7643, 7649, 7669, 7673, 7681, 7687, 7691,
-  7699, 7703, 7717, 7723, 7727, 7741, 7753, 7757,
-  7759, 7789, 7793, 7817, 7823, 7829, 7841, 7853,
-  7867, 7873, 7877, 7879, 7883, 7901, 7907, 7919,
-  7927, 7933, 7937, 7949, 7951, 7963, 7993, 8009,
-  8011, 8017, 8039, 8053, 8059, 8069, 8081, 8087,
-  8089, 8093, 8101, 8111, 8117, 8123, 8147, 8161,
-  8167, 8171, 8179, 8191, 0
-};
-
-
-/* Find appropriate prime. It generates a number by taking random bytes.
-   It then tests the number that it's not divisible by any of the small
-   primes and then it performs Fermat's prime test. I thank Rieks Joosten
-   (r.joosten@pijnenburg.nl) for such a good help with prime tests.
-
-   If argument verbose is TRUE this will display some status information
-   about the progress of generation. */
-
-SilcBool silc_math_gen_prime(SilcMPInt *prime, SilcUInt32 bits,
-                            SilcBool verbose, SilcRng rng)
-{
-  unsigned char *numbuf = NULL;
-  SilcUInt32 i, b, k;
-  SilcUInt32 *spmods;
-  SilcMPInt r, base, tmp, tmp2, oprime;
-  SilcBool valid = FALSE;
-
-  silc_mp_init(&r);
-  silc_mp_init(&base);
-  silc_mp_init(&tmp);
-  silc_mp_init(&tmp2);
-  silc_mp_init(&oprime);
-
-  silc_mp_set_ui(&base, 2);
-
-  SILC_LOG_DEBUG(("Generating new prime"));
-
-  while (valid == FALSE) {
-    /* Get random number */
-    if (rng)
-      numbuf = silc_rng_get_rn_data(rng, (bits / 8));
-    else
-      numbuf = silc_rng_global_get_rn_data((bits / 8));
-    if (!numbuf)
-      return FALSE;
-
-    /* Convert into MP and set the size */
-    silc_mp_bin2mp(numbuf, (bits / 8), prime);
-    silc_mp_mod_2exp(prime, prime, bits);
-
-    /* Empty buffer */
-    memset(numbuf, 0, (bits / 8));
-    silc_free(numbuf);
-
-    /* Set highest bit */
-    silc_mp_set_ui(&tmp, 1);
-    silc_mp_mul_2exp(&tmp, &tmp, bits - 1);
-    silc_mp_or(prime, prime, &tmp);
-
-    /* Number could be even number, so we'll make it odd. */
-    silc_mp_set_ui(&tmp, 1);
-    silc_mp_or(prime, prime, &tmp);
-
-    /* Init modulo table with the prime candidate and the primes
-       in the primetable. */
-    spmods = silc_calloc(1, sizeof(primetable) * sizeof(SilcUInt32));
-    for (i = 0; primetable[i] != 0; i++) {
-      silc_mp_mod_ui(&tmp, prime, primetable[i]);
-      spmods[i] = silc_mp_get_ui(&tmp);
-    }
-
-    /* k is added by 2, this way we skip all even numbers (prime is odd). */
-    silc_mp_set(&oprime, prime);
-    for (k = 0;; k += 2) {
-      silc_mp_add_ui(&oprime, prime, k);
-
-      /* See if the prime has a divisor in primetable[].
-       * If it has then it's a composite. We add k to the
-       * original modulo value, k is added by 2 on every roll.
-       * This way we don't have to re-init the whole table if
-       * the number is composite.
-       */
-      for (b = 0; b < i; b++) {
-       silc_mp_set_ui(&tmp2, spmods[b]);
-       silc_mp_add_ui(&tmp2, &tmp2, k);
-       silc_mp_mod_ui(&tmp, &tmp2, primetable[b]);
-
-       /* If mod is 0, the number is composite */
-       if (silc_mp_cmp_ui(&tmp, 0) == 0)
-         break;
-      }
-      if (b < i)
-       continue;
-
-      /* Passed the quick test. */
-
-      /* Does the prime pass the Fermat's prime test.
-       * r = 2 ^ p mod p, if r == 2, then p is probably a prime.
-       */
-      silc_mp_pow_mod(&r, &base, &oprime, &oprime);
-      if (silc_mp_cmp_ui(&r, 2) != 0) {
-       if (verbose) {
-         printf(".");
-         fflush(stdout);
-       }
-       continue;
-      }
-
-      /* Passed the Fermat's test. And I don't think
-       * we have to do more tests. If anyone wants to do more
-       * tests, MP library has probability of prime test:
-       *
-       * if (silc_mp_probab_prime_p(prime, 25))
-       *     break;                          found a probable prime
-       *
-       * However, this is very slow.
-       */
-      /* XXX: this could be done if some argument, say strict_primes, is
-        TRUE when we are willing to spend more time on the prime test and
-        to get, perhaps, better primes. */
-      silc_mp_set(prime, &oprime);
-      break;
-    }
-
-    /* Check highest bit */
-    silc_mp_div_2exp(&tmp, prime, bits - 1);
-    if (silc_mp_get_ui(&tmp) == 1) {
-      valid = TRUE;
-      break;
-    }
-  }
-
-  silc_free(spmods);
-  silc_mp_uninit(&r);
-  silc_mp_uninit(&base);
-  silc_mp_uninit(&tmp);
-  silc_mp_uninit(&tmp2);
-  silc_mp_uninit(&oprime);
-
-  return valid;
-}
-
-/* Performs primality testings for given number. Returns TRUE if the
-   number is probably a prime. */
-
-SilcBool silc_math_prime_test(SilcMPInt *p)
-{
-  SilcMPInt r, base, tmp;
-  int i, ret = 0;
-
-  silc_mp_init(&r);
-  silc_mp_init(&tmp);
-  silc_mp_init(&base);
-  silc_mp_set_ui(&base, 2);
-
-  SILC_LOG_DEBUG(("Testing probability of prime"));
-
-  /* See if the number is divisible by any of the
-     small primes in primetable[]. */
-  for (i = 0; primetable[i] != 0; i++) {
-    silc_mp_mod_ui(&tmp, p, primetable[i]);
-
-    /* If mod is 0, the number is composite */
-    if (silc_mp_cmp_ui(&tmp, 0) == 0)
-      ret = -1;
-  }
-
-  /* Does the prime pass the Fermat's prime test.
-   * r = 2 ^ p mod p, if r == 2, then p is probably a prime.
-   */
-  silc_mp_pow_mod(&r, &base, p, p);
-  if (silc_mp_cmp_ui(&r, 2) != 0)
-    ret = -1;
-
-  silc_mp_uninit(&r);
-  silc_mp_uninit(&tmp);
-  silc_mp_uninit(&base);
-
-  if (ret)
-    return FALSE;
-
-  /* Number is probably a prime */
-  return TRUE;
-}
diff --git a/lib/silcmath/tfm.c b/lib/silcmath/tfm.c
deleted file mode 100644 (file)
index b99a32f..0000000
+++ /dev/null
@@ -1,5481 +0,0 @@
-/* Start: fp_2expt.c */
-/* TomsFastMath, a fast ISO C bignum library.
- *
- * This project is meant to fill in where LibTomMath
- * falls short.  That is speed ;-)
- *
- * This project is public domain and free for all purposes.
- *
- * Tom St Denis, tomstdenis@iahu.ca
- */
-#include <tfm.h>
-
-/* computes a = 2**b */
-void fp_2expt(fp_int *a, int b)
-{
-   int     z;
-
-   /* zero a as per default */
-   fp_zero (a);
-
-   if (b < 0) {
-      return;
-   }
-
-   z = b / DIGIT_BIT;
-   if (z >= FP_SIZE) {
-      return;
-   }
-
-  /* set the used count of where the bit will go */
-  a->used = z + 1;
-
-  /* put the single bit in its place */
-  a->dp[z] = ((fp_digit)1) << (b % DIGIT_BIT);
-}
-
-
-/* End: fp_2expt.c */
-
-/* Start: fp_add.c */
-/* TomsFastMath, a fast ISO C bignum library.
- *
- * This project is meant to fill in where LibTomMath
- * falls short.  That is speed ;-)
- *
- * This project is public domain and free for all purposes.
- *
- * Tom St Denis, tomstdenis@iahu.ca
- */
-#include <tfm.h>
-
-void fp_add(fp_int *a, fp_int *b, fp_int *c)
-{
-  int     sa, sb;
-
-  /* get sign of both inputs */
-  sa = a->sign;
-  sb = b->sign;
-
-  /* handle two cases, not four */
-  if (sa == sb) {
-    /* both positive or both negative */
-    /* add their magnitudes, copy the sign */
-    c->sign = sa;
-    s_fp_add (a, b, c);
-  } else {
-    /* one positive, the other negative */
-    /* subtract the one with the greater magnitude from */
-    /* the one of the lesser magnitude.  The result gets */
-    /* the sign of the one with the greater magnitude. */
-    if (fp_cmp_mag (a, b) == FP_LT) {
-      c->sign = sb;
-      s_fp_sub (b, a, c);
-    } else {
-      c->sign = sa;
-      s_fp_sub (a, b, c);
-    }
-  }
-}
-
-/* End: fp_add.c */
-
-/* Start: fp_add_d.c */
-/* TomsFastMath, a fast ISO C bignum library.
- *
- * This project is meant to fill in where LibTomMath
- * falls short.  That is speed ;-)
- *
- * This project is public domain and free for all purposes.
- *
- * Tom St Denis, tomstdenis@iahu.ca
- */
-#include <tfm.h>
-
-/* c = a + b */
-void fp_add_d(fp_int *a, fp_digit b, fp_int *c)
-{
-   fp_int tmp;
-   fp_set(&tmp, b);
-   fp_add(a,&tmp,c);
-}
-
-/* End: fp_add_d.c */
-
-/* Start: fp_addmod.c */
-/* TomsFastMath, a fast ISO C bignum library.
- *
- * This project is meant to fill in where LibTomMath
- * falls short.  That is speed ;-)
- *
- * This project is public domain and free for all purposes.
- *
- * Tom St Denis, tomstdenis@iahu.ca
- */
-#include <tfm.h>
-
-/* d = a + b (mod c) */
-int fp_addmod(fp_int *a, fp_int *b, fp_int *c, fp_int *d)
-{
-  fp_int tmp;
-  fp_zero(&tmp);
-  fp_add(a, b, &tmp);
-  return fp_mod(&tmp, c, d);
-}
-
-/* End: fp_addmod.c */
-
-/* Start: fp_cmp.c */
-/* TomsFastMath, a fast ISO C bignum library.
- *
- * This project is meant to fill in where LibTomMath
- * falls short.  That is speed ;-)
- *
- * This project is public domain and free for all purposes.
- *
- * Tom St Denis, tomstdenis@iahu.ca
- */
-#include <tfm.h>
-
-int fp_cmp(fp_int *a, fp_int *b)
-{
-   if (a->sign == FP_NEG && b->sign == FP_ZPOS) {
-      return FP_LT;
-   } else if (a->sign == FP_ZPOS && b->sign == FP_NEG) {
-      return FP_GT;
-   } else {
-      /* compare digits */
-      if (a->sign == FP_NEG) {
-         /* if negative compare opposite direction */
-         return fp_cmp_mag(b, a);
-      } else {
-         return fp_cmp_mag(a, b);
-      }
-   }
-}
-
-/* End: fp_cmp.c */
-
-/* Start: fp_cmp_d.c */
-/* TomsFastMath, a fast ISO C bignum library.
- *
- * This project is meant to fill in where LibTomMath
- * falls short.  That is speed ;-)
- *
- * This project is public domain and free for all purposes.
- *
- * Tom St Denis, tomstdenis@iahu.ca
- */
-#include <tfm.h>
-
-/* compare against a single digit */
-int fp_cmp_d(fp_int *a, fp_digit b)
-{
-  /* compare based on sign */
-  if ((b && a->used == 0) || a->sign == FP_NEG) {
-    return FP_LT;
-  }
-
-  /* compare based on magnitude */
-  if (a->used > 1) {
-    return FP_GT;
-  }
-
-  /* compare the only digit of a to b */
-  if (a->dp[0] > b) {
-    return FP_GT;
-  } else if (a->dp[0] < b) {
-    return FP_LT;
-  } else {
-    return FP_EQ;
-  }
-
-}
-
-/* End: fp_cmp_d.c */
-
-/* Start: fp_cmp_mag.c */
-/* TomsFastMath, a fast ISO C bignum library.
- *
- * This project is meant to fill in where LibTomMath
- * falls short.  That is speed ;-)
- *
- * This project is public domain and free for all purposes.
- *
- * Tom St Denis, tomstdenis@iahu.ca
- */
-#include <tfm.h>
-
-int fp_cmp_mag(fp_int *a, fp_int *b)
-{
-   int x;
-
-   if (a->used > b->used) {
-      return FP_GT;
-   } else if (a->used < b->used) {
-      return FP_LT;
-   } else {
-      for (x = a->used - 1; x >= 0; x--) {
-          if (a->dp[x] > b->dp[x]) {
-             return FP_GT;
-          } else if (a->dp[x] < b->dp[x]) {
-             return FP_LT;
-          }
-      }
-   }
-   return FP_EQ;
-}
-
-
-/* End: fp_cmp_mag.c */
-
-/* Start: fp_cnt_lsb.c */
-/* TomsFastMath, a fast ISO C bignum library.
- *
- * This project is meant to fill in where LibTomMath
- * falls short.  That is speed ;-)
- *
- * This project is public domain and free for all purposes.
- *
- * Tom St Denis, tomstdenis@iahu.ca
- */
-#include <tfm.h>
-
-static const int lnz[16] = {
-   4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0
-};
-
-/* Counts the number of lsbs which are zero before the first zero bit */
-int fp_cnt_lsb(fp_int *a)
-{
-   int x;
-   fp_digit q, qq;
-
-   /* easy out */
-   if (fp_iszero(a) == 1) {
-      return 0;
-   }
-
-   /* scan lower digits until non-zero */
-   for (x = 0; x < a->used && a->dp[x] == 0; x++);
-   q = a->dp[x];
-   x *= DIGIT_BIT;
-
-   /* now scan this digit until a 1 is found */
-   if ((q & 1) == 0) {
-      do {
-         qq  = q & 15;
-         x  += lnz[qq];
-         q >>= 4;
-      } while (qq == 0);
-   }
-   return x;
-}
-
-
-/* End: fp_cnt_lsb.c */
-
-/* Start: fp_count_bits.c */
-/* TomsFastMath, a fast ISO C bignum library.
- *
- * This project is meant to fill in where LibTomMath
- * falls short.  That is speed ;-)
- *
- * This project is public domain and free for all purposes.
- *
- * Tom St Denis, tomstdenis@iahu.ca
- */
-#include <tfm.h>
-
-int fp_count_bits (fp_int * a)
-{
-  int     r;
-  fp_digit q;
-
-  /* shortcut */
-  if (a->used == 0) {
-    return 0;
-  }
-
-  /* get number of digits and add that */
-  r = (a->used - 1) * DIGIT_BIT;
-
-  /* take the last digit and count the bits in it */
-  q = a->dp[a->used - 1];
-  while (q > ((fp_digit) 0)) {
-    ++r;
-    q >>= ((fp_digit) 1);
-  }
-  return r;
-}
-
-/* End: fp_count_bits.c */
-
-/* Start: fp_div.c */
-/* TomsFastMath, a fast ISO C bignum library.
- *
- * This project is meant to fill in where LibTomMath
- * falls short.  That is speed ;-)
- *
- * This project is public domain and free for all purposes.
- *
- * Tom St Denis, tomstdenis@iahu.ca
- */
-#include <tfm.h>
-
-/* a/b => cb + d == a */
-int fp_div(fp_int *a, fp_int *b, fp_int *c, fp_int *d)
-{
-  fp_int  q, x, y, t1, t2;
-  int     n, t, i, norm, neg;
-
-  /* is divisor zero ? */
-  if (fp_iszero (b) == 1) {
-    return FP_VAL;
-  }
-
-  /* if a < b then q=0, r = a */
-  if (fp_cmp_mag (a, b) == FP_LT) {
-    if (d != NULL) {
-      fp_copy (a, d);
-    }
-    if (c != NULL) {
-      fp_zero (c);
-    }
-    return FP_OKAY;
-  }
-
-  fp_init(&q);
-  q.used = a->used + 2;
-
-  fp_init(&t1);
-  fp_init(&t2);
-  fp_init_copy(&x, a);
-  fp_init_copy(&y, b);
-
-  /* fix the sign */
-  neg = (a->sign == b->sign) ? FP_ZPOS : FP_NEG;
-  x.sign = y.sign = FP_ZPOS;
-
-  /* normalize both x and y, ensure that y >= b/2, [b == 2**DIGIT_BIT] */
-  norm = fp_count_bits(&y) % DIGIT_BIT;
-  if (norm < (int)(DIGIT_BIT-1)) {
-     norm = (DIGIT_BIT-1) - norm;
-     fp_mul_2d (&x, norm, &x);
-     fp_mul_2d (&y, norm, &y);
-  } else {
-     norm = 0;
-  }
-
-  /* note hac does 0 based, so if used==5 then its 0,1,2,3,4, e.g. use 4 */
-  n = x.used - 1;
-  t = y.used - 1;
-
-  /* while (x >= y*b**n-t) do { q[n-t] += 1; x -= y*b**{n-t} } */
-  fp_lshd (&y, n - t);                                             /* y = y*b**{n-t} */
-
-  while (fp_cmp (&x, &y) != FP_LT) {
-    ++(q.dp[n - t]);
-    fp_sub (&x, &y, &x);
-  }
-
-  /* reset y by shifting it back down */
-  fp_rshd (&y, n - t);
-
-  /* step 3. for i from n down to (t + 1) */
-  for (i = n; i >= (t + 1); i--) {
-    if (i > x.used) {
-      continue;
-    }
-
-    /* step 3.1 if xi == yt then set q{i-t-1} to b-1,
-     * otherwise set q{i-t-1} to (xi*b + x{i-1})/yt */
-    if (x.dp[i] == y.dp[t]) {
-      q.dp[i - t - 1] = ((((fp_word)1) << DIGIT_BIT) - 1);
-    } else {
-      fp_word tmp;
-      tmp = ((fp_word) x.dp[i]) << ((fp_word) DIGIT_BIT);
-      tmp |= ((fp_word) x.dp[i - 1]);
-      tmp /= ((fp_word) y.dp[t]);
-      q.dp[i - t - 1] = (fp_digit) (tmp);
-    }
-
-    /* while (q{i-t-1} * (yt * b + y{t-1})) >
-             xi * b**2 + xi-1 * b + xi-2
-
-       do q{i-t-1} -= 1;
-    */
-    q.dp[i - t - 1] = (q.dp[i - t - 1] + 1);
-    do {
-      q.dp[i - t - 1] = (q.dp[i - t - 1] - 1);
-
-      /* find left hand */
-      fp_zero (&t1);
-      t1.dp[0] = (t - 1 < 0) ? 0 : y.dp[t - 1];
-      t1.dp[1] = y.dp[t];
-      t1.used = 2;
-      fp_mul_d (&t1, q.dp[i - t - 1], &t1);
-
-      /* find right hand */
-      t2.dp[0] = (i - 2 < 0) ? 0 : x.dp[i - 2];
-      t2.dp[1] = (i - 1 < 0) ? 0 : x.dp[i - 1];
-      t2.dp[2] = x.dp[i];
-      t2.used = 3;
-    } while (fp_cmp_mag(&t1, &t2) == FP_GT);
-
-    /* step 3.3 x = x - q{i-t-1} * y * b**{i-t-1} */
-    fp_mul_d (&y, q.dp[i - t - 1], &t1);
-    fp_lshd  (&t1, i - t - 1);
-    fp_sub   (&x, &t1, &x);
-
-    /* if x < 0 then { x = x + y*b**{i-t-1}; q{i-t-1} -= 1; } */
-    if (x.sign == FP_NEG) {
-      fp_copy (&y, &t1);
-      fp_lshd (&t1, i - t - 1);
-      fp_add (&x, &t1, &x);
-      q.dp[i - t - 1] = q.dp[i - t - 1] - 1;
-    }
-  }
-
-  /* now q is the quotient and x is the remainder
-   * [which we have to normalize]
-   */
-
-  /* get sign before writing to c */
-  x.sign = x.used == 0 ? FP_ZPOS : a->sign;
-
-  if (c != NULL) {
-    fp_clamp (&q);
-    fp_copy (&q, c);
-    c->sign = neg;
-  }
-
-  if (d != NULL) {
-    fp_div_2d (&x, norm, &x, NULL);
-
-/* the following is a kludge, essentially we were seeing the right remainder but
-   with excess digits that should have been zero
- */
-    for (i = b->used; i < x.used; i++) {
-        x.dp[i] = 0;
-    }
-    fp_clamp(&x);
-    fp_copy (&x, d);
-  }
-
-  return FP_OKAY;
-}
-
-/* End: fp_div.c */
-
-/* Start: fp_div_2.c */
-/* TomsFastMath, a fast ISO C bignum library.
- *
- * This project is meant to fill in where LibTomMath
- * falls short.  That is speed ;-)
- *
- * This project is public domain and free for all purposes.
- *
- * Tom St Denis, tomstdenis@iahu.ca
- */
-#include <tfm.h>
-
-/* b = a/2 */
-void fp_div_2(fp_int * a, fp_int * b)
-{
-  int     x, oldused;
-
-  oldused = b->used;
-  b->used = a->used;
-  {
-    register fp_digit r, rr, *tmpa, *tmpb;
-
-    /* source alias */
-    tmpa = a->dp + b->used - 1;
-
-    /* dest alias */
-    tmpb = b->dp + b->used - 1;
-
-    /* carry */
-    r = 0;
-    for (x = b->used - 1; x >= 0; x--) {
-      /* get the carry for the next iteration */
-      rr = *tmpa & 1;
-
-      /* shift the current digit, add in carry and store */
-      *tmpb-- = (*tmpa-- >> 1) | (r << (DIGIT_BIT - 1));
-
-      /* forward carry to next iteration */
-      r = rr;
-    }
-
-    /* zero excess digits */
-    tmpb = b->dp + b->used;
-    for (x = b->used; x < oldused; x++) {
-      *tmpb++ = 0;
-    }
-  }
-  b->sign = a->sign;
-  fp_clamp (b);
-}
-
-/* End: fp_div_2.c */
-
-/* Start: fp_div_2d.c */
-/* TomsFastMath, a fast ISO C bignum library.
- *
- * This project is meant to fill in where LibTomMath
- * falls short.  That is speed ;-)
- *
- * This project is public domain and free for all purposes.
- *
- * Tom St Denis, tomstdenis@iahu.ca
- */
-#include <tfm.h>
-
-/* c = a / 2**b */
-void fp_div_2d(fp_int *a, int b, fp_int *c, fp_int *d)
-{
-  fp_digit D, r, rr;
-  int      x;
-  fp_int   t;
-
-  /* if the shift count is <= 0 then we do no work */
-  if (b <= 0) {
-    fp_copy (a, c);
-    if (d != NULL) {
-      fp_zero (d);
-    }
-    return;
-  }
-
-  fp_init(&t);
-
-  /* get the remainder */
-  if (d != NULL) {
-    fp_mod_2d (a, b, &t);
-  }
-
-  /* copy */
-  fp_copy(a, c);
-
-  /* shift by as many digits in the bit count */
-  if (b >= (int)DIGIT_BIT) {
-    fp_rshd (c, b / DIGIT_BIT);
-  }
-
-  /* shift any bit count < DIGIT_BIT */
-  D = (fp_digit) (b % DIGIT_BIT);
-  if (D != 0) {
-    register fp_digit *tmpc, mask, shift;
-
-    /* mask */
-    mask = (((fp_digit)1) << D) - 1;
-
-    /* shift for lsb */
-    shift = DIGIT_BIT - D;
-
-    /* alias */
-    tmpc = c->dp + (c->used - 1);
-
-    /* carry */
-    r = 0;
-    for (x = c->used - 1; x >= 0; x--) {
-      /* get the lower  bits of this word in a temp */
-      rr = *tmpc & mask;
-
-      /* shift the current word and mix in the carry bits from the previous word */
-      *tmpc = (*tmpc >> D) | (r << shift);
-      --tmpc;
-
-      /* set the carry to the carry bits of the current word found above */
-      r = rr;
-    }
-  }
-  fp_clamp (c);
-  if (d != NULL) {
-    fp_copy (&t, d);
-  }
-}
-
-/* End: fp_div_2d.c */
-
-/* Start: fp_div_d.c */
-/* TomsFastMath, a fast ISO C bignum library.
- *
- * This project is meant to fill in where LibTomMath
- * falls short.  That is speed ;-)
- *
- * This project is public domain and free for all purposes.
- *
- * Tom St Denis, tomstdenis@iahu.ca
- */
-#include <tfm.h>
-
-static int s_is_power_of_two(fp_digit b, int *p)
-{
-   int x;
-
-   for (x = 1; x < DIGIT_BIT; x++) {
-      if (b == (((fp_digit)1)<<x)) {
-         *p = x;
-         return 1;
-      }
-   }
-   return 0;
-}
-
-/* a/b => cb + d == a */
-int fp_div_d(fp_int *a, fp_digit b, fp_int *c, fp_digit *d)
-{
-  fp_int   q;
-  fp_word  w;
-  fp_digit t;
-  int      ix;
-
-  /* cannot divide by zero */
-  if (b == 0) {
-     return FP_VAL;
-  }
-
-  /* quick outs */
-  if (b == 1 || fp_iszero(a) == 1) {
-     if (d != NULL) {
-        *d = 0;
-     }
-     if (c != NULL) {
-        fp_copy(a, c);
-     }
-     return FP_OKAY;
-  }
-
-  /* power of two ? */
-  if (s_is_power_of_two(b, &ix) == 1) {
-     if (d != NULL) {
-        *d = a->dp[0] & ((((fp_digit)1)<<ix) - 1);
-     }
-     if (c != NULL) {
-        fp_div_2d(a, ix, c, NULL);
-     }
-     return FP_OKAY;
-  }
-
-  /* no easy answer [c'est la vie].  Just division */
-  fp_init(&q);
-
-  q.used = a->used;
-  q.sign = a->sign;
-  w = 0;
-  for (ix = a->used - 1; ix >= 0; ix--) {
-     w = (w << ((fp_word)DIGIT_BIT)) | ((fp_word)a->dp[ix]);
-
-     if (w >= b) {
-        t = (fp_digit)(w / b);
-        w -= ((fp_word)t) * ((fp_word)b);
-      } else {
-        t = 0;
-      }
-      q.dp[ix] = (fp_digit)t;
-  }
-
-  if (d != NULL) {
-     *d = (fp_digit)w;
-  }
-
-  if (c != NULL) {
-     fp_clamp(&q);
-     fp_copy(&q, c);
-  }
-
-  return FP_OKAY;
-}
-
-
-/* End: fp_div_d.c */
-
-/* Start: fp_exptmod.c */
-/* TomsFastMath, a fast ISO C bignum library.
- *
- * This project is meant to fill in where LibTomMath
- * falls short.  That is speed ;-)
- *
- * This project is public domain and free for all purposes.
- *
- * Tom St Denis, tomstdenis@iahu.ca
- */
-#include <tfm.h>
-
-/* y = g**x (mod b)
- * Some restrictions... x must be positive and < b
- */
-static int _fp_exptmod(fp_int * G, fp_int * X, fp_int * P, fp_int * Y)
-{
-  fp_int   M[64], res;
-  fp_digit buf, mp;
-  int      err, bitbuf, bitcpy, bitcnt, mode, digidx, x, y, winsize;
-
-  /* find window size */
-  x = fp_count_bits (X);
-  if (x <= 7) {
-    winsize = 2;
-  } else if (x <= 36) {
-    winsize = 3;
-  } else if (x <= 140) {
-    winsize = 4;
-  } else if (x <= 450) {
-    winsize = 5;
-  } else {
-    winsize = 6;
-  }
-
-  /* init M array */
-  memset(M, 0, sizeof(M));
-
-  /* now setup montgomery  */
-  if ((err = fp_montgomery_setup (P, &mp)) != FP_OKAY) {
-     return err;
-  }
-
-  /* setup result */
-  fp_init(&res);
-
-  /* create M table
-   *
-   * The M table contains powers of the input base, e.g. M[x] = G^x mod P
-   *
-   * The first half of the table is not computed though accept for M[0] and M[1]
-   */
-
-   /* now we need R mod m */
-   fp_montgomery_calc_normalization (&res, P);
-
-   /* now set M[1] to G * R mod m */
-   if (fp_cmp_mag(P, G) != FP_GT) {
-      /* G > P so we reduce it first */
-      fp_mod(G, P, &M[1]);
-   } else {
-      fp_copy(G, &M[1]);
-   }
-   fp_mulmod (&M[1], &res, P, &M[1]);
-
-  /* compute the value at M[1<<(winsize-1)] by squaring M[1] (winsize-1) times */
-  fp_copy (&M[1], &M[1 << (winsize - 1)]);
-  for (x = 0; x < (winsize - 1); x++) {
-    fp_sqr (&M[1 << (winsize - 1)], &M[1 << (winsize - 1)]);
-    fp_montgomery_reduce (&M[1 << (winsize - 1)], P, mp);
-  }
-
-  /* create upper table */
-  for (x = (1 << (winsize - 1)) + 1; x < (1 << winsize); x++) {
-    fp_mul(&M[x - 1], &M[1], &M[x]);
-    fp_montgomery_reduce(&M[x], P, mp);
-  }
-
-  /* set initial mode and bit cnt */
-  mode   = 0;
-  bitcnt = 1;
-  buf    = 0;
-  digidx = X->used - 1;
-  bitcpy = 0;
-  bitbuf = 0;
-
-  for (;;) {
-    /* grab next digit as required */
-    if (--bitcnt == 0) {
-      /* if digidx == -1 we are out of digits so break */
-      if (digidx == -1) {
-        break;
-      }
-      /* read next digit and reset bitcnt */
-      buf    = X->dp[digidx--];
-      bitcnt = (int)DIGIT_BIT;
-    }
-
-    /* grab the next msb from the exponent */
-    y     = (fp_digit)(buf >> (DIGIT_BIT - 1)) & 1;
-    buf <<= (fp_digit)1;
-
-    /* if the bit is zero and mode == 0 then we ignore it
-     * These represent the leading zero bits before the first 1 bit
-     * in the exponent.  Technically this opt is not required but it
-     * does lower the # of trivial squaring/reductions used
-     */
-    if (mode == 0 && y == 0) {
-      continue;
-    }
-
-    /* if the bit is zero and mode == 1 then we square */
-    if (mode == 1 && y == 0) {
-      fp_sqr(&res, &res);
-      fp_montgomery_reduce(&res, P, mp);
-      continue;
-    }
-
-    /* else we add it to the window */
-    bitbuf |= (y << (winsize - ++bitcpy));
-    mode    = 2;
-
-    if (bitcpy == winsize) {
-      /* ok window is filled so square as required and multiply  */
-      /* square first */
-      for (x = 0; x < winsize; x++) {
-        fp_sqr(&res, &res);
-        fp_montgomery_reduce(&res, P, mp);
-      }
-
-      /* then multiply */
-      fp_mul(&res, &M[bitbuf], &res);
-      fp_montgomery_reduce(&res, P, mp);
-
-      /* empty window and reset */
-      bitcpy = 0;
-      bitbuf = 0;
-      mode   = 1;
-    }
-  }
-
-  /* if bits remain then square/multiply */
-  if (mode == 2 && bitcpy > 0) {
-    /* square then multiply if the bit is set */
-    for (x = 0; x < bitcpy; x++) {
-      fp_sqr(&res, &res);
-      fp_montgomery_reduce(&res, P, mp);
-
-      /* get next bit of the window */
-      bitbuf <<= 1;
-      if ((bitbuf & (1 << winsize)) != 0) {
-        /* then multiply */
-        fp_mul(&res, &M[1], &res);
-        fp_montgomery_reduce(&res, P, mp);
-      }
-    }
-  }
-
-  /* fixup result if Montgomery reduction is used
-   * recall that any value in a Montgomery system is
-   * actually multiplied by R mod n.  So we have
-   * to reduce one more time to cancel out the factor
-   * of R.
-   */
-  fp_montgomery_reduce(&res, P, mp);
-
-  /* swap res with Y */
-  fp_copy (&res, Y);
-  return FP_OKAY;
-}
-
-
-int fp_exptmod(fp_int * G, fp_int * X, fp_int * P, fp_int * Y)
-{
-   fp_int tmp;
-   int    err;
-
-   /* is X negative?  */
-   if (X->sign == FP_NEG) {
-      /* yes, copy G and invmod it */
-      fp_copy(G, &tmp);
-      if ((err = fp_invmod(&tmp, P, &tmp)) != FP_OKAY) {
-         return err;
-      }
-      X->sign = FP_ZPOS;
-      err =  _fp_exptmod(&tmp, X, P, Y);
-      X->sign = FP_NEG;
-      return err;
-   } else {
-      /* Positive exponent so just exptmod */
-      return _fp_exptmod(G, X, P, Y);
-   }
-}
-
-/* End: fp_exptmod.c */
-
-/* Start: fp_gcd.c */
-/* TomsFastMath, a fast ISO C bignum library.
- *
- * This project is meant to fill in where LibTomMath
- * falls short.  That is speed ;-)
- *
- * This project is public domain and free for all purposes.
- *
- * Tom St Denis, tomstdenis@iahu.ca
- */
-#include <tfm.h>
-
-/* c = (a, b) */
-void fp_gcd(fp_int *a, fp_int *b, fp_int *c)
-{
-   fp_int u, v, r;
-
-   /* either zero than gcd is the largest */
-   if (fp_iszero (a) == 1 && fp_iszero (b) == 0) {
-     fp_abs (b, c);
-     return;
-   }
-   if (fp_iszero (a) == 0 && fp_iszero (b) == 1) {
-     fp_abs (a, c);
-     return;
-   }
-
-   /* optimized.  At this point if a == 0 then
-    * b must equal zero too
-    */
-   if (fp_iszero (a) == 1) {
-     fp_zero(c);
-     return;
-   }
-
-   /* sort inputs */
-   if (fp_cmp_mag(a, b) != FP_LT) {
-      fp_init_copy(&u, a);
-      fp_init_copy(&v, b);
-   } else {
-      fp_init_copy(&u, b);
-      fp_init_copy(&v, a);
-   }
-
-   fp_zero(&r);
-   while (fp_iszero(&v) == FP_NO) {
-      fp_mod(&u, &v, &r);
-      fp_copy(&v, &u);
-      fp_copy(&r, &v);
-   }
-   fp_copy(&u, c);
-}
-
-/* End: fp_gcd.c */
-
-/* Start: fp_ident.c */
-#include "tfm.h"
-
-const char *fp_ident(void)
-{
-   static char buf[1024];
-
-   memset(buf, 0, sizeof(buf));
-   snprintf(buf, sizeof(buf)-1,
-"TomsFastMath (%s)\n"
-"\n"
-"Sizeofs\n"
-"\tfp_digit = %u\n"
-"\tfp_word  = %u\n"
-"\n"
-"FP_MAX_SIZE = %u\n"
-"\n"
-"Defines: \n"
-#ifdef __i386__
-" __i386__ "
-#endif
-#ifdef __x86_64__
-" __x86_64__ "
-#endif
-#ifdef TFM_X86
-" TFM_X86 "
-#endif
-#ifdef TFM_X86_64
-" TFM_X86_64 "
-#endif
-#ifdef TFM_SSE2
-" TFM_SSE2 "
-#endif
-#ifdef TFM_ARM
-" TFM_ARM "
-#endif
-#ifdef TFM_NO_ASM
-" TFM_NO_ASM "
-#endif
-#ifdef FP_64BIT
-" FP_64BIT "
-#endif
-#ifdef TFM_LARGE
-" TFM_LARGE "
-#endif
-#ifdef TFM_HUGE
-" TFM_HUGE "
-#endif
-"\n", __DATE__, sizeof(fp_digit), sizeof(fp_word), FP_MAX_SIZE);
-
-   if (sizeof(fp_digit) == sizeof(fp_word)) {
-      strncat(buf, "WARNING: sizeof(fp_digit) == sizeof(fp_word), this build is likely to not work properly.\n",
-              sizeof(buf)-1);
-   }
-   return buf;
-}
-
-#ifdef STANDALONE
-
-int main(void)
-{
-   printf("%s\n", fp_ident());
-   return 0;
-}
-
-#endif
-
-
-/* End: fp_ident.c */
-
-/* Start: fp_invmod.c */
-/* TomsFastMath, a fast ISO C bignum library.
- *
- * This project is meant to fill in where LibTomMath
- * falls short.  That is speed ;-)
- *
- * This project is public domain and free for all purposes.
- *
- * Tom St Denis, tomstdenis@iahu.ca
- */
-#include <tfm.h>
-
-/* c = 1/a (mod b) for odd b only */
-int fp_invmod(fp_int *a, fp_int *b, fp_int *c)
-{
-  fp_int  x, y, u, v, B, D;
-  int     neg;
-
-  /* 2. [modified] b must be odd   */
-  if (fp_iseven (b) == FP_YES) {
-    return FP_VAL;
-  }
-
-  /* init all our temps */
-  fp_init(&x);  fp_init(&y);
-  fp_init(&u);  fp_init(&v);
-  fp_init(&B);  fp_init(&D);
-
-  /* x == modulus, y == value to invert */
-  fp_copy(b, &x);
-
-  /* we need y = |a| */
-  fp_abs(a, &y);
-
-  /* 3. u=x, v=y, A=1, B=0, C=0,D=1 */
-  fp_copy(&x, &u);
-  fp_copy(&y, &v);
-  fp_set (&D, 1);
-
-top:
-  /* 4.  while u is even do */
-  while (fp_iseven (&u) == FP_YES) {
-    /* 4.1 u = u/2 */
-    fp_div_2 (&u, &u);
-
-    /* 4.2 if B is odd then */
-    if (fp_isodd (&B) == FP_YES) {
-      fp_sub (&B, &x, &B);
-    }
-    /* B = B/2 */
-    fp_div_2 (&B, &B);
-  }
-
-  /* 5.  while v is even do */
-  while (fp_iseven (&v) == FP_YES) {
-    /* 5.1 v = v/2 */
-    fp_div_2 (&v, &v);
-
-    /* 5.2 if D is odd then */
-    if (fp_isodd (&D) == FP_YES) {
-      /* D = (D-x)/2 */
-      fp_sub (&D, &x, &D);
-    }
-    /* D = D/2 */
-    fp_div_2 (&D, &D);
-  }
-
-  /* 6.  if u >= v then */
-  if (fp_cmp (&u, &v) != FP_LT) {
-    /* u = u - v, B = B - D */
-    fp_sub (&u, &v, &u);
-    fp_sub (&B, &D, &B);
-  } else {
-    /* v - v - u, D = D - B */
-    fp_sub (&v, &u, &v);
-    fp_sub (&D, &B, &D);
-  }
-
-  /* if not zero goto step 4 */
-  if (fp_iszero (&u) == FP_NO) {
-    goto top;
-  }
-
-  /* now a = C, b = D, gcd == g*v */
-
-  /* if v != 1 then there is no inverse */
-  if (fp_cmp_d (&v, 1) != FP_EQ) {
-    return FP_VAL;
-  }
-
-  /* b is now the inverse */
-  neg = a->sign;
-  while (D.sign == FP_NEG) {
-    fp_add (&D, b, &D);
-  }
-  fp_copy (&D, c);
-  c->sign = neg;
-  return FP_OKAY;
-}
-
-/* End: fp_invmod.c */
-
-/* Start: fp_isprime.c */
-/* TomsFastMath, a fast ISO C bignum library.
- *
- * This project is meant to fill in where LibTomMath
- * falls short.  That is speed ;-)
- *
- * This project is public domain and free for all purposes.
- *
- * Tom St Denis, tomstdenis@iahu.ca
- */
-#include <tfm.h>
-
-/* a few primes */
-static const fp_digit primes[256] = {
-  0x0002, 0x0003, 0x0005, 0x0007, 0x000B, 0x000D, 0x0011, 0x0013,
-  0x0017, 0x001D, 0x001F, 0x0025, 0x0029, 0x002B, 0x002F, 0x0035,
-  0x003B, 0x003D, 0x0043, 0x0047, 0x0049, 0x004F, 0x0053, 0x0059,
-  0x0061, 0x0065, 0x0067, 0x006B, 0x006D, 0x0071, 0x007F, 0x0083,
-  0x0089, 0x008B, 0x0095, 0x0097, 0x009D, 0x00A3, 0x00A7, 0x00AD,
-  0x00B3, 0x00B5, 0x00BF, 0x00C1, 0x00C5, 0x00C7, 0x00D3, 0x00DF,
-  0x00E3, 0x00E5, 0x00E9, 0x00EF, 0x00F1, 0x00FB, 0x0101, 0x0107,
-  0x010D, 0x010F, 0x0115, 0x0119, 0x011B, 0x0125, 0x0133, 0x0137,
-
-  0x0139, 0x013D, 0x014B, 0x0151, 0x015B, 0x015D, 0x0161, 0x0167,
-  0x016F, 0x0175, 0x017B, 0x017F, 0x0185, 0x018D, 0x0191, 0x0199,
-  0x01A3, 0x01A5, 0x01AF, 0x01B1, 0x01B7, 0x01BB, 0x01C1, 0x01C9,
-  0x01CD, 0x01CF, 0x01D3, 0x01DF, 0x01E7, 0x01EB, 0x01F3, 0x01F7,
-  0x01FD, 0x0209, 0x020B, 0x021D, 0x0223, 0x022D, 0x0233, 0x0239,
-  0x023B, 0x0241, 0x024B, 0x0251, 0x0257, 0x0259, 0x025F, 0x0265,
-  0x0269, 0x026B, 0x0277, 0x0281, 0x0283, 0x0287, 0x028D, 0x0293,
-  0x0295, 0x02A1, 0x02A5, 0x02AB, 0x02B3, 0x02BD, 0x02C5, 0x02CF,
-
-  0x02D7, 0x02DD, 0x02E3, 0x02E7, 0x02EF, 0x02F5, 0x02F9, 0x0301,
-  0x0305, 0x0313, 0x031D, 0x0329, 0x032B, 0x0335, 0x0337, 0x033B,
-  0x033D, 0x0347, 0x0355, 0x0359, 0x035B, 0x035F, 0x036D, 0x0371,
-  0x0373, 0x0377, 0x038B, 0x038F, 0x0397, 0x03A1, 0x03A9, 0x03AD,
-  0x03B3, 0x03B9, 0x03C7, 0x03CB, 0x03D1, 0x03D7, 0x03DF, 0x03E5,
-  0x03F1, 0x03F5, 0x03FB, 0x03FD, 0x0407, 0x0409, 0x040F, 0x0419,
-  0x041B, 0x0425, 0x0427, 0x042D, 0x043F, 0x0443, 0x0445, 0x0449,
-  0x044F, 0x0455, 0x045D, 0x0463, 0x0469, 0x047F, 0x0481, 0x048B,
-
-  0x0493, 0x049D, 0x04A3, 0x04A9, 0x04B1, 0x04BD, 0x04C1, 0x04C7,
-  0x04CD, 0x04CF, 0x04D5, 0x04E1, 0x04EB, 0x04FD, 0x04FF, 0x0503,
-  0x0509, 0x050B, 0x0511, 0x0515, 0x0517, 0x051B, 0x0527, 0x0529,
-  0x052F, 0x0551, 0x0557, 0x055D, 0x0565, 0x0577, 0x0581, 0x058F,
-  0x0593, 0x0595, 0x0599, 0x059F, 0x05A7, 0x05AB, 0x05AD, 0x05B3,
-  0x05BF, 0x05C9, 0x05CB, 0x05CF, 0x05D1, 0x05D5, 0x05DB, 0x05E7,
-  0x05F3, 0x05FB, 0x0607, 0x060D, 0x0611, 0x0617, 0x061F, 0x0623,
-  0x062B, 0x062F, 0x063D, 0x0641, 0x0647, 0x0649, 0x064D, 0x0653
-};
-
-int fp_isprime(fp_int *a)
-{
-   fp_int   b;
-   fp_digit d;
-   int      r, res;
-
-   /* do trial division */
-   for (r = 0; r < 256; r++) {
-       fp_mod_d(a, primes[r], &d);
-       if (d == 0) {
-          return FP_NO;
-       }
-   }
-
-   /* now do 8 miller rabins */
-   for (r = 0; r < 8; r++) {
-       fp_set(&b, primes[r]);
-       fp_prime_miller_rabin(a, &b, &res);
-       if (res == FP_NO) {
-          return FP_NO;
-       }
-   }
-   return FP_YES;
-}
-
-/* End: fp_isprime.c */
-
-/* Start: fp_lcm.c */
-/* TomsFastMath, a fast ISO C bignum library.
- *
- * This project is meant to fill in where LibTomMath
- * falls short.  That is speed ;-)
- *
- * This project is public domain and free for all purposes.
- *
- * Tom St Denis, tomstdenis@iahu.ca
- */
-#include <tfm.h>
-
-/* c = [a, b] */
-void fp_lcm(fp_int *a, fp_int *b, fp_int *c)
-{
-   fp_int  t1, t2;
-
-   fp_init(&t1);
-   fp_init(&t2);
-   fp_gcd(a, b, &t1);
-   if (fp_cmp_mag(a, b) == FP_GT) {
-      fp_div(a, &t1, &t2, NULL);
-      fp_mul(b, &t2, c);
-   } else {
-      fp_div(b, &t1, &t2, NULL);
-      fp_mul(a, &t2, c);
-   }
-}
-
-/* End: fp_lcm.c */
-
-/* Start: fp_lshd.c */
-/* TomsFastMath, a fast ISO C bignum library.
- *
- * This project is meant to fill in where LibTomMath
- * falls short.  That is speed ;-)
- *
- * This project is public domain and free for all purposes.
- *
- * Tom St Denis, tomstdenis@iahu.ca
- */
-#include <tfm.h>
-
-void fp_lshd(fp_int *a, int x)
-{
-   int y;
-
-   /* move up and truncate as required */
-   y = MIN(a->used + x - 1, (int)(FP_SIZE-1));
-
-   /* store new size */
-   a->used = y + 1;
-
-   /* move digits */
-   for (; y >= x; y--) {
-       a->dp[y] = a->dp[y-x];
-   }
-
-   /* zero lower digits */
-   for (; y >= 0; y--) {
-       a->dp[y] = 0;
-   }
-
-   /* clamp digits */
-   fp_clamp(a);
-}
-
-/* End: fp_lshd.c */
-
-/* Start: fp_mod.c */
-/* TomsFastMath, a fast ISO C bignum library.
- *
- * This project is meant to fill in where LibTomMath
- * falls short.  That is speed ;-)
- *
- * This project is public domain and free for all purposes.
- *
- * Tom St Denis, tomstdenis@iahu.ca
- */
-#include <tfm.h>
-
-/* c = a mod b, 0 <= c < b  */
-int fp_mod(fp_int *a, fp_int *b, fp_int *c)
-{
-   fp_int t;
-   int    err;
-
-   fp_zero(&t);
-   if ((err = fp_div(a, b, NULL, &t)) != FP_OKAY) {
-      return err;
-   }
-   if (t.sign != b->sign) {
-      fp_add(&t, b, c);
-   } else {
-      fp_copy(&t, c);
-  }
-  return FP_OKAY;
-}
-
-
-
-/* End: fp_mod.c */
-
-/* Start: fp_mod_2d.c */
-/* TomsFastMath, a fast ISO C bignum library.
- *
- * This project is meant to fill in where LibTomMath
- * falls short.  That is speed ;-)
- *
- * This project is public domain and free for all purposes.
- *
- * Tom St Denis, tomstdenis@iahu.ca
- */
-#include <tfm.h>
-
-/* c = a mod 2**d */
-void fp_mod_2d(fp_int *a, int b, fp_int *c)
-{
-   int x;
-
-   /* zero if count less than or equal to zero */
-   if (b <= 0) {
-      fp_zero(c);
-      return;
-   }
-
-   /* get copy of input */
-   fp_copy(a, c);
-
-   /* if 2**d is larger than we just return */
-   if (b >= (DIGIT_BIT * a->used)) {
-      return;
-   }
-
-  /* zero digits above the last digit of the modulus */
-  for (x = (b / DIGIT_BIT) + ((b % DIGIT_BIT) == 0 ? 0 : 1); x < c->used; x++) {
-    c->dp[x] = 0;
-  }
-  /* clear the digit that is not completely outside/inside the modulus */
-  c->dp[b / DIGIT_BIT] &= ~((fp_digit)0) >> (DIGIT_BIT - b);
-  fp_clamp (c);
-}
-
-/* End: fp_mod_2d.c */
-
-/* Start: fp_mod_d.c */
-/* TomsFastMath, a fast ISO C bignum library.
- *
- * This project is meant to fill in where LibTomMath
- * falls short.  That is speed ;-)
- *
- * This project is public domain and free for all purposes.
- *
- * Tom St Denis, tomstdenis@iahu.ca
- */
-#include <tfm.h>
-
-/* c = a mod b, 0 <= c < b  */
-int fp_mod_d(fp_int *a, fp_digit b, fp_digit *c)
-{
-   return fp_div_d(a, b, NULL, c);
-}
-
-/* End: fp_mod_d.c */
-
-/* Start: fp_montgomery_calc_normalization.c */
-/* TomsFastMath, a fast ISO C bignum library.
- *
- * This project is meant to fill in where LibTomMath
- * falls short.  That is speed ;-)
- *
- * This project is public domain and free for all purposes.
- *
- * Tom St Denis, tomstdenis@iahu.ca
- */
-#include <tfm.h>
-
-/* computes a = B**n mod b without division or multiplication useful for
- * normalizing numbers in a Montgomery system.
- */
-void fp_montgomery_calc_normalization(fp_int *a, fp_int *b)
-{
-  int     x, bits;
-
-  /* how many bits of last digit does b use */
-  bits = fp_count_bits (b) % DIGIT_BIT;
-
-  /* compute A = B^(n-1) * 2^(bits-1) */
-  if (b->used > 1) {
-     fp_2expt (a, (b->used - 1) * DIGIT_BIT + bits - 1);
-  } else {
-     fp_set(a, 1);
-     bits = 1;
-  }
-
-  /* now compute C = A * B mod b */
-  for (x = bits - 1; x < (int)DIGIT_BIT; x++) {
-    fp_mul_2 (a, a);
-    if (fp_cmp_mag (a, b) != FP_LT) {
-      s_fp_sub (a, b, a);
-    }
-  }
-}
-
-
-/* End: fp_montgomery_calc_normalization.c */
-
-/* Start: fp_montgomery_reduce.c */
-/* TomsFastMath, a fast ISO C bignum library.
- *
- * This project is meant to fill in where LibTomMath
- * falls short.  That is speed ;-)
- *
- * This project is public domain and free for all purposes.
- *
- * Tom St Denis, tomstdenis@iahu.ca
- */
-#include <tfm.h>
-
-#if defined(TFM_X86)
-
-/* x86-32 code */
-
-#define MONT_START
-
-#define MONT_FINI
-
-#define LOOP_START \
-   mu = c[x] * mp;
-
-#define INNERMUL \
-asm(                                                                                          \
-"movl %7,%%eax                \n\t"                                                           \
-"mull %6                      \n\t"                                                           \
-"addl %%eax,%0                \n\t"                                                           \
-"adcl %%edx,%1                \n\t"                                                           \
-"adcl $0,%2                   \n\t"                                                           \
-:"=g"(_c[OFF0]), "=g"(_c[OFF1]), "=g"(_c[OFF2]):"0"(_c[OFF0]), "1"(_c[OFF1]), "2"(_c[OFF2]),  \
-                                                "g"(mu), "g"(*tmpm++)                          \
-                                               : "%eax", "%edx", "%cc");
-
-#define PROPCARRY \
-asm(                                                                                               \
-"movl %1,%%eax                \n\t"                                                                \
-"addl  %%eax,%6               \n\t"                                                                \
-"movl %2,%%eax                \n\t"                                                                \
-"adcl  %%eax,%7               \n\t"                                                                \
-"adcl $0,%8                   \n\t"                                                                \
-:"=g"(_c[OFF0]), "=g"(_c[OFF1]), "=g"(_c[OFF2]):"0"(_c[OFF0]), "1"(_c[OFF1]), "2"(_c[OFF2]),       \
-                                                "m"(_c[OFF0+1]), "m"(_c[OFF1+1]), "m"(_c[OFF2+1])  \
-: "%eax", "%cc");
-
-#elif defined(TFM_X86_64)
-/* x86-64 code */
-
-#define MONT_START
-
-#define MONT_FINI
-
-#define LOOP_START \
-   mu = c[x] * mp;
-
-#define INNERMUL \
-asm(                                                                                          \
-"movq %7,%%rax                \n\t"                                                           \
-"mulq %6                      \n\t"                                                           \
-"addq %%rax,%0                \n\t"                                                           \
-"adcq %%rdx,%1                \n\t"                                                           \
-"adcq $0,%2                   \n\t"                                                           \
-:"=g"(_c[OFF0]), "=g"(_c[OFF1]), "=g"(_c[OFF2]):"0"(_c[OFF0]), "1"(_c[OFF1]), "2"(_c[OFF2]),  \
-                                                "g"(mu), "g"(*tmpm++)                          \
-                                               : "%rax", "%rdx", "%cc");
-
-#define PROPCARRY \
-asm(                                                                                               \
-"movq %1,%%rax                \n\t"                                                                \
-"movq %2,%%rbx                \n\t"                                                                \
-"addq  %%rax,%6               \n\t"                                                                \
-"adcq  %%rbx,%7               \n\t"                                                                \
-"adcq $0,%8                   \n\t"                                                                \
-:"=g"(_c[OFF0]), "=g"(_c[OFF1]), "=g"(_c[OFF2]):"0"(_c[OFF0]), "1"(_c[OFF1]), "2"(_c[OFF2]),       \
-                                                "m"(_c[OFF0+1]), "m"(_c[OFF1+1]), "m"(_c[OFF2+1])  \
-: "%rax", "%rbx", "%cc");
-
-#elif defined(TFM_SSE2)
-
-/* SSE2 code */
-
-#define MONT_START \
-asm("movd %0,%%mm2"::"g"(mp));
-
-#define MONT_FINI \
-asm("emms");
-
-#define LOOP_START \
-asm(\
-"movd %0,%%mm1                \n\t" \
-"pmuludq %%mm2,%%mm1          \n\t" \
-:: "g"(c[x]));
-
-#define INNERMUL \
-asm(                                                                                          \
-"movd %6,%%mm0                \n\t"                                                           \
-"pmuludq %%mm1,%%mm0          \n\t"                                                           \
-"movd %%mm0,%%eax             \n\t"                                                           \
-"psrlq $32, %%mm0             \n\t"                                                           \
-"addl %%eax,%0                \n\t"                                                           \
-"movd %%mm0,%%eax             \n\t"                                                           \
-"adcl %%eax,%1                \n\t"                                                           \
-"adcl $0,%2                   \n\t"                                                           \
-:"=g"(_c[OFF0]), "=g"(_c[OFF1]), "=g"(_c[OFF2]):"0"(_c[OFF0]), "1"(_c[OFF1]), "2"(_c[OFF2]),  \
-                                                "g"(*tmpm++)                                  \
-                                               : "%eax", "%cc");
-
-#define PROPCARRY \
-asm(                                                                                               \
-"movl %1,%%eax                \n\t"                                                                \
-"addl  %%eax,%6               \n\t"                                                                \
-"movl %2,%%eax                \n\t"                                                                \
-"adcl  %%eax,%7               \n\t"                                                                \
-"adcl $0,%8                   \n\t"                                                                \
-:"=g"(_c[OFF0]), "=g"(_c[OFF1]), "=g"(_c[OFF2]):"0"(_c[OFF0]), "1"(_c[OFF1]), "2"(_c[OFF2]),       \
-                                                "g"(_c[OFF0+1]), "g"(_c[OFF1+1]), "g"(_c[OFF2+1])  \
-: "%eax", "%cc");
-
-#elif defined(TFM_ARM)
-
-/* ISO C code */
-#define MONT_START
-
-#define MONT_FINI
-
-#define LOOP_START \
-   mu = c[x] * mp;
-
-/* NOTE: later write it using two regs instead of three for _c + ... */
-#define INNERMUL \
-asm(                                             \
-"UMULL r0,r1,%0,%1                \n\t"          \
-"LDR   r2,[%2]                    \n\t"          \
-"ADDS  r2,r2,r0                   \n\t"          \
-"STR   r2,[%2]                    \n\t"          \
-"LDR   r2,[%3]                    \n\t"          \
-"ADCS  r2,r2,r1                   \n\t"          \
-"STR   r2,[%3]                    \n\t"          \
-"LDR   r2,[%4]                    \n\t"          \
-"ADC   r2,r2,#0                   \n\t"          \
-"STR   r2,[%4]                    \n\t"          \
-::"r"(mu),"r"(*tmpm++),"r"(_c + OFF0),"r"(_c + OFF1),"r"(_c + OFF2):"r0", "r1", "r2", "%cc");
-
-#define PROPCARRY \
-asm(                                             \
-"LDR   r0,[%1]                    \n\t"          \
-"LDR   r1,[%0,#4]                 \n\t"          \
-"ADDS  r0,r0,r1                   \n\t"          \
-"STR   r0,[%0,#4]                 \n\t"          \
-"LDR   r0,[%2]                    \n\t"          \
-"LDR   r1,[%1,#4]                 \n\t"          \
-"ADCS  r0,r0,r1                   \n\t"          \
-"STR   r0,[%1,#4]                 \n\t"          \
-"LDR   r0,[%2,#4]                 \n\t"          \
-"ADC   r0,r0,#0                   \n\t"          \
-"STR   r0,[%2,#4]                 \n\t"          \
-::"r"(_c + OFF0),"r"(_c + OFF1),"r"(_c + OFF2):"r0", "r1", "%cc");
-
-#else
-
-/* ISO C code */
-#define MONT_START
-
-#define MONT_FINI
-
-#define LOOP_START \
-   mu = c[x] * mp;
-
-#define INNERMUL \
-   do { fp_word t;                                                           \
-   t = (fp_word)_c[OFF0] + ((fp_word)mu) * ((fp_word)*tmpm++); _c[OFF0] = t; \
-   t = (fp_word)_c[OFF1] + (t >> DIGIT_BIT);                   _c[OFF1] = t; \
-   _c[OFF2] += (t >> DIGIT_BIT);                                             \
-   } while (0);
-
-#define PROPCARRY \
-   do { fp_word t;                                                           \
-   t = (fp_word)_c[OFF0+1] + (fp_word)_c[OFF1];                    _c[OFF0+1] = t; \
-   t = (fp_word)_c[OFF1+1] + (t >> DIGIT_BIT) + (fp_word)_c[OFF2]; _c[OFF1+1] = t; \
-   _c[OFF2+1] += (t >> DIGIT_BIT);                                           \
-   } while (0);
-
-#endif
-
-
-#define OFF0  (0)
-#define OFF1  (FP_SIZE)
-#define OFF2  (FP_SIZE+FP_SIZE)
-
-/* computes x/R == x (mod N) via Montgomery Reduction */
-void fp_montgomery_reduce(fp_int *a, fp_int *m, fp_digit mp)
-{
-   fp_digit c[3*FP_SIZE], *_c, *tmpm, mu;
-   int      oldused, x, y, pa;
-
-   /* now zero the buff */
-   pa = m->used;
-   memset(c, 0, sizeof(c));
-
-   /* copy the input */
-   oldused = a->used;
-   for (x = 0; x < oldused; x++) {
-       c[x] = a->dp[x];
-   }
-
-   MONT_START;
-
-   /* now let's get bizz-sy! */
-   for (x = 0; x < pa; x++) {
-       /* get Mu for this round */
-       LOOP_START;
-
-       /* our friendly neighbourhood alias */
-       _c   = c + x;
-       tmpm = m->dp;
-
-       for (y = 0; y < pa; y++) {
-          INNERMUL;
-          ++_c;
-       }
-       /* send carry up man... */
-       _c = c + x;
-       PROPCARRY;
-  }
-
-  /* fix the rest of the carries */
-  _c = c + pa;
-  for (x = pa; x < pa * 2 + 2; x++) {
-     PROPCARRY;
-     ++_c;
-  }
-
-  /* now copy out */
-  _c   = c + pa;
-  tmpm = a->dp;
-  for (x = 0; x < pa+1; x++) {
-     *tmpm++ = *_c++;
-  }
-
-  for (; x < oldused; x++)   {
-     *tmpm++ = 0;
-  }
-
-  MONT_FINI;
-
-  a->used = pa+1;
-  fp_clamp(a);
-
-  /* if A >= m then A = A - m */
-  if (fp_cmp_mag (a, m) != FP_LT) {
-    s_fp_sub (a, m, a);
-  }
-}
-
-/* End: fp_montgomery_reduce.c */
-
-/* Start: fp_montgomery_setup.c */
-/* TomsFastMath, a fast ISO C bignum library.
- *
- * This project is meant to fill in where LibTomMath
- * falls short.  That is speed ;-)
- *
- * This project is public domain and free for all purposes.
- *
- * Tom St Denis, tomstdenis@iahu.ca
- */
-#include <tfm.h>
-
-/* setups the montgomery reduction */
-int fp_montgomery_setup(fp_int *a, fp_digit *rho)
-{
-  fp_digit x, b;
-
-/* fast inversion mod 2**k
- *
- * Based on the fact that
- *
- * XA = 1 (mod 2**n)  =>  (X(2-XA)) A = 1 (mod 2**2n)
- *                    =>  2*X*A - X*X*A*A = 1
- *                    =>  2*(1) - (1)     = 1
- */
-  b = a->dp[0];
-
-  if ((b & 1) == 0) {
-    return FP_VAL;
-  }
-
-  x = (((b + 2) & 4) << 1) + b; /* here x*a==1 mod 2**4 */
-  x *= 2 - b * x;               /* here x*a==1 mod 2**8 */
-  x *= 2 - b * x;               /* here x*a==1 mod 2**16 */
-  x *= 2 - b * x;               /* here x*a==1 mod 2**32 */
-#ifdef FP_64BIT
-  x *= 2 - b * x;               /* here x*a==1 mod 2**64 */
-#endif
-
-  /* rho = -1/m mod b */
-  *rho = (((fp_word) 1 << ((fp_word) DIGIT_BIT)) - ((fp_word)x));
-
-  return FP_OKAY;
-}
-
-
-/* End: fp_montgomery_setup.c */
-
-/* Start: fp_mul.c */
-/* TomsFastMath, a fast ISO C bignum library.
- *
- * This project is meant to fill in where LibTomMath
- * falls short.  That is speed ;-)
- *
- * This project is public domain and free for all purposes.
- *
- * Tom St Denis, tomstdenis@iahu.ca
- */
-#include <tfm.h>
-
-/* c = a * b */
-void fp_mul(fp_int *A, fp_int *B, fp_int *C)
-{
-    int    r, y, yy, s;
-    fp_int ac, bd, comp, amb, cmd, t1, t2;
-
-     y  = MAX(A->used, B->used);
-     yy = MIN(A->used, B->used);
-     if (yy <= 8 || y <= 64) {
-
-    /* pick a comba (unrolled 4/8/16/32 x or rolled) based on the size
-       of the largest input.  We also want to avoid doing excess mults if the
-       inputs are not close to the next power of two.  That is, for example,
-       if say y=17 then we would do (32-17)^2 = 225 unneeded multiplications
-    */
-        if (y <= 4) {
-           fp_mul_comba4(A,B,C);
-        } else if (y <= 8) {
-           fp_mul_comba8(A,B,C);
-#if defined(TFM_LARGE)
-        } else if (y <= 16 && y >= 10) {
-           fp_mul_comba16(A,B,C);
-#endif
-#if defined(TFM_HUGE)
-        } else if (y <= 32 && y >= 24) {
-           fp_mul_comba32(A,B,C);
-#endif
-        } else {
-           fp_mul_comba(A,B,C);
-        }
-    } else {
-        /* do the karatsuba action
-
-           if A = ab and B = cd for ||a|| = r we need to solve
-
-           ac*r^2 + (-(a-b)(c-d) + ac + bd)*r + bd
-
-           So we solve for the three products then we form the final result with careful shifting
-           and addition.
-
-Obvious points of optimization
-
-- "ac" parts can be memcpy'ed with an offset [all you have to do is zero upto the next 8 digits]
-- Similarly the "bd" parts can be memcpy'ed and zeroed to 8
--
-
-        */
-        /* get our value of r */
-        r = yy >> 1;
-
-        /* now solve for ac */
-//        fp_copy(A, &t1); fp_rshd(&t1, r);
-        for (s = 0; s < A->used - r; s++) {
-            t1.dp[s] = A->dp[s+r];
-        }
-        for (; s < FP_SIZE; s++) {
-            t1.dp[s] = 0;
-        }
-        if (A->used >= r) {
-           t1.used = A->used - r;
-        } else {
-           t1.used = 0;
-        }
-        t1.sign = A->sign;
-
-//        fp_copy(B, &t2); fp_rshd(&t2, r);
-        for (s = 0; s < B->used - r; s++) {
-            t2.dp[s] = B->dp[s+r];
-        }
-        for (; s < FP_SIZE; s++) {
-            t2.dp[s] = 0;
-        }
-        if (B->used >= r) {
-           t2.used = B->used - r;
-        } else {
-           t2.used = 0;
-        }
-        t2.sign = B->sign;
-
-        fp_copy(&t1, &amb); fp_copy(&t2, &cmd);
-        fp_zero(&ac);
-        fp_mul(&t1, &t2, &ac);
-
-        /* now solve for bd */
-//        fp_mod_2d(A, r * DIGIT_BIT, &t1);
-//        fp_mod_2d(B, r * DIGIT_BIT, &t2);
-        for (s = 0; s < r; s++) {
-            t1.dp[s] = A->dp[s];
-            t2.dp[s] = B->dp[s];
-        }
-        for (; s < FP_SIZE; s++) {
-            t1.dp[s]   = 0;
-            t2.dp[s] = 0;
-        }
-        t1.used = r;
-        t2.used = r;
-        fp_clamp(&t1);
-        fp_clamp(&t2);
-
-        fp_sub(&amb, &t1, &amb); fp_sub(&cmd, &t2, &cmd);
-        fp_zero(&bd);
-        fp_mul(&t1, &t2, &bd);
-
-        /* now get the (a-b)(c-d) term */
-        fp_zero(&comp);
-        fp_mul(&amb, &cmd, &comp);
-
-        /* now solve the system, do the middle term first */
-        comp.sign ^= 1;
-        fp_add(&comp, &ac, &comp);
-        fp_add(&comp, &bd, &comp);
-        fp_lshd(&comp, r);
-
-        /* leading term */
-        fp_lshd(&ac, r+r);
-
-        /* now sum them together */
-        s = A->sign ^ B->sign;
-        fp_zero(C);
-        fp_add(&ac, &comp, C);
-        fp_add(&bd, C, C);
-        C->sign = C->used ? s : FP_ZPOS;
-    }
-}
-
-
-/* End: fp_mul.c */
-
-/* Start: fp_mul_2.c */
-/* TomsFastMath, a fast ISO C bignum library.
- *
- * This project is meant to fill in where LibTomMath
- * falls short.  That is speed ;-)
- *
- * This project is public domain and free for all purposes.
- *
- * Tom St Denis, tomstdenis@iahu.ca
- */
-#include <tfm.h>
-
-void fp_mul_2(fp_int * a, fp_int * b)
-{
-  int     x, oldused;
-
-  oldused = b->used;
-  b->used = a->used;
-
-  {
-    register fp_digit r, rr, *tmpa, *tmpb;
-
-    /* alias for source */
-    tmpa = a->dp;
-
-    /* alias for dest */
-    tmpb = b->dp;
-
-    /* carry */
-    r = 0;
-    for (x = 0; x < a->used; x++) {
-
-      /* get what will be the *next* carry bit from the
-       * MSB of the current digit
-       */
-      rr = *tmpa >> ((fp_digit)(DIGIT_BIT - 1));
-
-      /* now shift up this digit, add in the carry [from the previous] */
-      *tmpb++ = ((*tmpa++ << ((fp_digit)1)) | r);
-
-      /* copy the carry that would be from the source
-       * digit into the next iteration
-       */
-      r = rr;
-    }
-
-    /* new leading digit? */
-    if (r != 0 && b->used != (FP_SIZE-1)) {
-      /* add a MSB which is always 1 at this point */
-      *tmpb = 1;
-      ++(b->used);
-    }
-
-    /* now zero any excess digits on the destination
-     * that we didn't write to
-     */
-    tmpb = b->dp + b->used;
-    for (x = b->used; x < oldused; x++) {
-      *tmpb++ = 0;
-    }
-  }
-  b->sign = a->sign;
-}
-
-
-/* End: fp_mul_2.c */
-
-/* Start: fp_mul_2d.c */
-/* TomsFastMath, a fast ISO C bignum library.
- *
- * This project is meant to fill in where LibTomMath
- * falls short.  That is speed ;-)
- *
- * This project is public domain and free for all purposes.
- *
- * Tom St Denis, tomstdenis@iahu.ca
- */
-#include <tfm.h>
-
-/* c = a * 2**d */
-void fp_mul_2d(fp_int *a, int b, fp_int *c)
-{
-   fp_digit carry, carrytmp, shift;
-   int x;
-
-   /* copy it */
-   fp_copy(a, c);
-
-   /* handle whole digits */
-   if (b >= DIGIT_BIT) {
-      fp_lshd(c, b/DIGIT_BIT);
-   }
-   b %= DIGIT_BIT;
-
-   /* shift the digits */
-   if (b != 0) {
-      carry = 0;
-      shift = DIGIT_BIT - b;
-      for (x = 0; x < c->used; x++) {
-          carrytmp = c->dp[x] >> shift;
-          c->dp[x] = (c->dp[x] << b) + carry;
-          carry = carrytmp;
-      }
-      /* store last carry if room */
-      if (carry && x < FP_SIZE) {
-         c->dp[c->used++] = carry;
-      }
-   }
-   fp_clamp(c);
-}
-
-
-/* End: fp_mul_2d.c */
-
-/* Start: fp_mul_comba.c */
-/* TomsFastMath, a fast ISO C bignum library.
- *
- * This project is meant to fill in where LibTomMath
- * falls short.  That is speed ;-)
- *
- * This project is public domain and free for all purposes.
- *
- * Tom St Denis, tomstdenis@iahu.ca
- */
-
-/* About this file...
-
-*/
-
-#include <tfm.h>
-
-/* these are the combas.  Worship them. */
-#if defined(TFM_X86)
-/* Generic x86 optimized code */
-
-/* anything you need at the start */
-#define COMBA_START
-
-/* clear the chaining variables */
-#define COMBA_CLEAR \
-   c0 = c1 = c2 = 0;
-
-/* forward the carry to the next digit */
-#define COMBA_FORWARD \
-   do { c0 = c1; c1 = c2; c2 = 0; } while (0);
-
-/* store the first sum */
-#define COMBA_STORE(x) \
-   x = c0;
-
-/* store the second sum [carry] */
-#define COMBA_STORE2(x) \
-   x = c1;
-
-/* anything you need at the end */
-#define COMBA_FINI
-
-/* this should multiply i and j  */
-#define MULADD(i, j)                                      \
-asm (                                                     \
-     "movl  %6,%%eax     \n\t"                            \
-     "mull  %7           \n\t"                            \
-     "addl  %%eax,%0     \n\t"                            \
-     "adcl  %%edx,%1     \n\t"                            \
-     "adcl  $0,%2        \n\t"                            \
-     :"=r"(c0), "=r"(c1), "=r"(c2): "0"(c0), "1"(c1), "2"(c2), "m"(i), "m"(j)  :"%eax","%edx","%cc");
-
-#elif defined(TFM_X86_64)
-/* x86-64 optimized */
-
-/* anything you need at the start */
-#define COMBA_START
-
-/* clear the chaining variables */
-#define COMBA_CLEAR \
-   c0 = c1 = c2 = 0;
-
-/* forward the carry to the next digit */
-#define COMBA_FORWARD \
-   do { c0 = c1; c1 = c2; c2 = 0; } while (0);
-
-/* store the first sum */
-#define COMBA_STORE(x) \
-   x = c0;
-
-/* store the second sum [carry] */
-#define COMBA_STORE2(x) \
-   x = c1;
-
-/* anything you need at the end */
-#define COMBA_FINI
-
-/* this should multiply i and j  */
-#define MULADD(i, j)                                      \
-asm  (                                                    \
-     "movq  %6,%%rax     \n\t"                            \
-     "mulq  %7           \n\t"                            \
-     "addq  %%rax,%0     \n\t"                            \
-     "adcq  %%rdx,%1     \n\t"                            \
-     "adcq  $0,%2        \n\t"                            \
-     :"=r"(c0), "=r"(c1), "=r"(c2): "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j)  :"%rax","%rdx","%cc");
-
-#elif defined(TFM_SSE2)
-/* use SSE2 optimizations */
-
-/* anything you need at the start */
-#define COMBA_START
-
-/* clear the chaining variables */
-#define COMBA_CLEAR \
-   c0 = c1 = c2 = 0;
-
-/* forward the carry to the next digit */
-#define COMBA_FORWARD \
-   do { c0 = c1; c1 = c2; c2 = 0; } while (0);
-
-/* store the first sum */
-#define COMBA_STORE(x) \
-   x = c0;
-
-/* store the second sum [carry] */
-#define COMBA_STORE2(x) \
-   x = c1;
-
-/* anything you need at the end */
-#define COMBA_FINI \
-   asm("emms");
-
-/* this should multiply i and j  */
-   #define MULADD(i, j)                                      \
-   asm volatile (                                            \
-        "movd  %6,%%mm0     \n\t"                            \
-        "movd  %7,%%mm1     \n\t"                            \
-        "pmuludq %%mm1,%%mm0\n\t"                            \
-        "movd  %%mm0,%%eax  \n\t"                            \
-        "psrlq $32,%%mm0    \n\t"                            \
-        "addl  %%eax,%0     \n\t"                            \
-        "movd  %%mm0,%%eax  \n\t"                            \
-        "adcl  %%eax,%1     \n\t"                            \
-        "adcl  $0,%2        \n\t"                            \
-        :"=r"(c0), "=r"(c1), "=r"(c2): "0"(c0), "1"(c1), "2"(c2), "m"(i), "m"(j)  :"%eax","%cc");
-
-#elif defined(TFM_ARM)
-/* ARM code */
-
-#define COMBA_START
-
-#define COMBA_CLEAR \
-   c0 = c1 = c2 = 0;
-
-#define COMBA_FORWARD \
-   do { c0 = c1; c1 = c2; c2 = 0; } while (0);
-
-#define COMBA_STORE(x) \
-   x = c0;
-
-#define COMBA_STORE2(x) \
-   x = c1;
-
-#define COMBA_FINI
-
-#define MULADD(i, j)                                          \
-asm(                                                          \
-"  UMULL  r0,r1,%6,%7           \n\t"                         \
-"  ADDS   %0,%0,r0              \n\t"                         \
-"  ADCS   %1,%1,r1              \n\t"                         \
-"  ADC    %2, %2, #0            \n\t"                         \
-:"=r"(c0), "=r"(c1), "=r"(c2) : "0"(c0), "1"(c1), "2"(c2), "r"(i), "r"(j) : "r0", "r1", "%cc");
-
-#else
-/* ISO C code */
-
-#define COMBA_START
-
-#define COMBA_CLEAR \
-   c0 = c1 = c2 = 0;
-
-#define COMBA_FORWARD \
-   do { c0 = c1; c1 = c2; c2 = 0; } while (0);
-
-#define COMBA_STORE(x) \
-   x = c0;
-
-#define COMBA_STORE2(x) \
-   x = c1;
-
-#define COMBA_FINI
-
-#define MULADD(i, j)                                                              \
-   do { fp_word t;                                                                \
-   t = (fp_word)c0 + ((fp_word)i) * ((fp_word)j); c0 = t;                         \
-   t = (fp_word)c1 + (t >> DIGIT_BIT);            c1 = t; c2 += t >> DIGIT_BIT;   \
-   } while (0);
-
-#endif
-
-
-/* generic PxQ multiplier */
-void fp_mul_comba(fp_int *A, fp_int *B, fp_int *C)
-{
-   int       ix, iy, iz, tx, ty, pa;
-   fp_digit  c0, c1, c2, *tmpx, *tmpy;
-   fp_int    tmp, *dst;
-
-   COMBA_START;
-   COMBA_CLEAR;
-
-   /* get size of output and trim */
-   pa = A->used + B->used;
-   if (pa >= FP_SIZE) {
-      pa = FP_SIZE-1;
-   }
-
-   if (A == C || B == C) {
-      fp_zero(&tmp);
-      dst = &tmp;
-   } else {
-      fp_zero(C);
-      dst = C;
-   }
-
-   for (ix = 0; ix < pa; ix++) {
-      /* get offsets into the two bignums */
-      ty = MIN(ix, B->used-1);
-      tx = ix - ty;
-
-      /* setup temp aliases */
-      tmpx = A->dp + tx;
-      tmpy = B->dp + ty;
-
-      /* this is the number of times the loop will iterrate, essentially its
-         while (tx++ < a->used && ty-- >= 0) { ... }
-       */
-      iy = MIN(A->used-tx, ty+1);
-
-      /* execute loop */
-      COMBA_FORWARD;
-      for (iz = 0; iz < iy; ++iz) {
-          MULADD(*tmpx++, *tmpy--);
-      }
-
-      /* store term */
-      COMBA_STORE(dst->dp[ix]);
-  }
-  /* store final carry */
-  COMBA_STORE2(dst->dp[ix]);
-  COMBA_FINI;
-
-  dst->used = pa;
-  fp_clamp(dst);
-  dst->sign = dst->used ? A->sign ^ B->sign : FP_ZPOS;
-  fp_copy(dst, C);
-}
-
-void fp_mul_comba4(fp_int *A, fp_int *B, fp_int *C)
-{
-   fp_digit c0, c1, c2, at[8];
-
-   memcpy(at, A->dp, 4 * sizeof(fp_digit));
-   memcpy(at+4, B->dp, 4 * sizeof(fp_digit));
-   COMBA_START;
-
-   COMBA_CLEAR;
-   /* 0 */
-   MULADD(at[0], at[4]);
-   COMBA_STORE(C->dp[0]);
-   /* 1 */
-   COMBA_FORWARD;
-   MULADD(at[0], at[5]);    MULADD(at[1], at[4]);
-   COMBA_STORE(C->dp[1]);
-   /* 2 */
-   COMBA_FORWARD;
-   MULADD(at[0], at[6]);    MULADD(at[1], at[5]);    MULADD(at[2], at[4]);
-   COMBA_STORE(C->dp[2]);
-   /* 3 */
-   COMBA_FORWARD;
-   MULADD(at[0], at[7]);    MULADD(at[1], at[6]);    MULADD(at[2], at[5]);    MULADD(at[3], at[4]);
-   COMBA_STORE(C->dp[3]);
-   /* 4 */
-   COMBA_FORWARD;
-   MULADD(at[1], at[7]);    MULADD(at[2], at[6]);    MULADD(at[3], at[5]);
-   COMBA_STORE(C->dp[4]);
-   /* 5 */
-   COMBA_FORWARD;
-   MULADD(at[2], at[7]);    MULADD(at[3], at[6]);
-   COMBA_STORE(C->dp[5]);
-   /* 6 */
-   COMBA_FORWARD;
-   MULADD(at[3], at[7]);
-   COMBA_STORE(C->dp[6]);
-   COMBA_STORE2(C->dp[7]);
-   C->used = 8;
-   C->sign = A->sign ^ B->sign;
-   fp_clamp(C);
-   COMBA_FINI;
-}
-
-
-void fp_mul_comba8(fp_int *A, fp_int *B, fp_int *C)
-{
-   fp_digit c0, c1, c2, at[16];
-
-   memcpy(at, A->dp, 8 * sizeof(fp_digit));
-   memcpy(at+8, B->dp, 8 * sizeof(fp_digit));
-   COMBA_START;
-
-   COMBA_CLEAR;
-   /* 0 */
-   MULADD(at[0], at[8]);
-   COMBA_STORE(C->dp[0]);
-   /* 1 */
-   COMBA_FORWARD;
-   MULADD(at[0], at[9]);    MULADD(at[1], at[8]);
-   COMBA_STORE(C->dp[1]);
-   /* 2 */
-   COMBA_FORWARD;
-   MULADD(at[0], at[10]);    MULADD(at[1], at[9]);    MULADD(at[2], at[8]);
-   COMBA_STORE(C->dp[2]);
-   /* 3 */
-   COMBA_FORWARD;
-   MULADD(at[0], at[11]);    MULADD(at[1], at[10]);    MULADD(at[2], at[9]);    MULADD(at[3], at[8]);
-   COMBA_STORE(C->dp[3]);
-   /* 4 */
-   COMBA_FORWARD;
-   MULADD(at[0], at[12]);    MULADD(at[1], at[11]);    MULADD(at[2], at[10]);    MULADD(at[3], at[9]);    MULADD(at[4], at[8]);
-   COMBA_STORE(C->dp[4]);
-   /* 5 */
-   COMBA_FORWARD;
-   MULADD(at[0], at[13]);    MULADD(at[1], at[12]);    MULADD(at[2], at[11]);    MULADD(at[3], at[10]);    MULADD(at[4], at[9]);    MULADD(at[5], at[8]);
-   COMBA_STORE(C->dp[5]);
-   /* 6 */
-   COMBA_FORWARD;
-   MULADD(at[0], at[14]);    MULADD(at[1], at[13]);    MULADD(at[2], at[12]);    MULADD(at[3], at[11]);    MULADD(at[4], at[10]);    MULADD(at[5], at[9]);    MULADD(at[6], at[8]);
-   COMBA_STORE(C->dp[6]);
-   /* 7 */
-   COMBA_FORWARD;
-   MULADD(at[0], at[15]);    MULADD(at[1], at[14]);    MULADD(at[2], at[13]);    MULADD(at[3], at[12]);    MULADD(at[4], at[11]);    MULADD(at[5], at[10]);    MULADD(at[6], at[9]);    MULADD(at[7], at[8]);
-   COMBA_STORE(C->dp[7]);
-   /* 8 */
-   COMBA_FORWARD;
-   MULADD(at[1], at[15]);    MULADD(at[2], at[14]);    MULADD(at[3], at[13]);    MULADD(at[4], at[12]);    MULADD(at[5], at[11]);    MULADD(at[6], at[10]);    MULADD(at[7], at[9]);
-   COMBA_STORE(C->dp[8]);
-   /* 9 */
-   COMBA_FORWARD;
-   MULADD(at[2], at[15]);    MULADD(at[3], at[14]);    MULADD(at[4], at[13]);    MULADD(at[5], at[12]);    MULADD(at[6], at[11]);    MULADD(at[7], at[10]);
-   COMBA_STORE(C->dp[9]);
-   /* 10 */
-   COMBA_FORWARD;
-   MULADD(at[3], at[15]);    MULADD(at[4], at[14]);    MULADD(at[5], at[13]);    MULADD(at[6], at[12]);    MULADD(at[7], at[11]);
-   COMBA_STORE(C->dp[10]);
-   /* 11 */
-   COMBA_FORWARD;
-   MULADD(at[4], at[15]);    MULADD(at[5], at[14]);    MULADD(at[6], at[13]);    MULADD(at[7], at[12]);
-   COMBA_STORE(C->dp[11]);
-   /* 12 */
-   COMBA_FORWARD;
-   MULADD(at[5], at[15]);    MULADD(at[6], at[14]);    MULADD(at[7], at[13]);
-   COMBA_STORE(C->dp[12]);
-   /* 13 */
-   COMBA_FORWARD;
-   MULADD(at[6], at[15]);    MULADD(at[7], at[14]);
-   COMBA_STORE(C->dp[13]);
-   /* 14 */
-   COMBA_FORWARD;
-   MULADD(at[7], at[15]);
-   COMBA_STORE(C->dp[14]);
-   COMBA_STORE2(C->dp[15]);
-   C->used = 16;
-   C->sign = A->sign ^ B->sign;
-   fp_clamp(C);
-   COMBA_FINI;
-}
-
-#if defined(TFM_LARGE)
-
-void fp_mul_comba16(fp_int *A, fp_int *B, fp_int *C)
-{
-   fp_digit c0, c1, c2, at[32];
-
-   memcpy(at, A->dp, 16 * sizeof(fp_digit));
-   memcpy(at+16, B->dp, 16 * sizeof(fp_digit));
-   COMBA_START;
-
-   COMBA_CLEAR;
-   /* 0 */
-   MULADD(at[0], at[16]);
-   COMBA_STORE(C->dp[0]);
-   /* 1 */
-   COMBA_FORWARD;
-   MULADD(at[0], at[17]);    MULADD(at[1], at[16]);
-   COMBA_STORE(C->dp[1]);
-   /* 2 */
-   COMBA_FORWARD;
-   MULADD(at[0], at[18]);    MULADD(at[1], at[17]);    MULADD(at[2], at[16]);
-   COMBA_STORE(C->dp[2]);
-   /* 3 */
-   COMBA_FORWARD;
-   MULADD(at[0], at[19]);    MULADD(at[1], at[18]);    MULADD(at[2], at[17]);    MULADD(at[3], at[16]);
-   COMBA_STORE(C->dp[3]);
-   /* 4 */
-   COMBA_FORWARD;
-   MULADD(at[0], at[20]);    MULADD(at[1], at[19]);    MULADD(at[2], at[18]);    MULADD(at[3], at[17]);    MULADD(at[4], at[16]);
-   COMBA_STORE(C->dp[4]);
-   /* 5 */
-   COMBA_FORWARD;
-   MULADD(at[0], at[21]);    MULADD(at[1], at[20]);    MULADD(at[2], at[19]);    MULADD(at[3], at[18]);    MULADD(at[4], at[17]);    MULADD(at[5], at[16]);
-   COMBA_STORE(C->dp[5]);
-   /* 6 */
-   COMBA_FORWARD;
-   MULADD(at[0], at[22]);    MULADD(at[1], at[21]);    MULADD(at[2], at[20]);    MULADD(at[3], at[19]);    MULADD(at[4], at[18]);    MULADD(at[5], at[17]);    MULADD(at[6], at[16]);
-   COMBA_STORE(C->dp[6]);
-   /* 7 */
-   COMBA_FORWARD;
-   MULADD(at[0], at[23]);    MULADD(at[1], at[22]);    MULADD(at[2], at[21]);    MULADD(at[3], at[20]);    MULADD(at[4], at[19]);    MULADD(at[5], at[18]);    MULADD(at[6], at[17]);    MULADD(at[7], at[16]);
-   COMBA_STORE(C->dp[7]);
-   /* 8 */
-   COMBA_FORWARD;
-   MULADD(at[0], at[24]);    MULADD(at[1], at[23]);    MULADD(at[2], at[22]);    MULADD(at[3], at[21]);    MULADD(at[4], at[20]);    MULADD(at[5], at[19]);    MULADD(at[6], at[18]);    MULADD(at[7], at[17]);    MULADD(at[8], at[16]);
-   COMBA_STORE(C->dp[8]);
-   /* 9 */
-   COMBA_FORWARD;
-   MULADD(at[0], at[25]);    MULADD(at[1], at[24]);    MULADD(at[2], at[23]);    MULADD(at[3], at[22]);    MULADD(at[4], at[21]);    MULADD(at[5], at[20]);    MULADD(at[6], at[19]);    MULADD(at[7], at[18]);    MULADD(at[8], at[17]);    MULADD(at[9], at[16]);
-   COMBA_STORE(C->dp[9]);
-   /* 10 */
-   COMBA_FORWARD;
-   MULADD(at[0], at[26]);    MULADD(at[1], at[25]);    MULADD(at[2], at[24]);    MULADD(at[3], at[23]);    MULADD(at[4], at[22]);    MULADD(at[5], at[21]);    MULADD(at[6], at[20]);    MULADD(at[7], at[19]);    MULADD(at[8], at[18]);    MULADD(at[9], at[17]);    MULADD(at[10], at[16]);
-   COMBA_STORE(C->dp[10]);
-   /* 11 */
-   COMBA_FORWARD;
-   MULADD(at[0], at[27]);    MULADD(at[1], at[26]);    MULADD(at[2], at[25]);    MULADD(at[3], at[24]);    MULADD(at[4], at[23]);    MULADD(at[5], at[22]);    MULADD(at[6], at[21]);    MULADD(at[7], at[20]);    MULADD(at[8], at[19]);    MULADD(at[9], at[18]);    MULADD(at[10], at[17]);    MULADD(at[11], at[16]);
-   COMBA_STORE(C->dp[11]);
-   /* 12 */
-   COMBA_FORWARD;
-   MULADD(at[0], at[28]);    MULADD(at[1], at[27]);    MULADD(at[2], at[26]);    MULADD(at[3], at[25]);    MULADD(at[4], at[24]);    MULADD(at[5], at[23]);    MULADD(at[6], at[22]);    MULADD(at[7], at[21]);    MULADD(at[8], at[20]);    MULADD(at[9], at[19]);    MULADD(at[10], at[18]);    MULADD(at[11], at[17]);    MULADD(at[12], at[16]);
-   COMBA_STORE(C->dp[12]);
-   /* 13 */
-   COMBA_FORWARD;
-   MULADD(at[0], at[29]);    MULADD(at[1], at[28]);    MULADD(at[2], at[27]);    MULADD(at[3], at[26]);    MULADD(at[4], at[25]);    MULADD(at[5], at[24]);    MULADD(at[6], at[23]);    MULADD(at[7], at[22]);    MULADD(at[8], at[21]);    MULADD(at[9], at[20]);    MULADD(at[10], at[19]);    MULADD(at[11], at[18]);    MULADD(at[12], at[17]);    MULADD(at[13], at[16]);
-   COMBA_STORE(C->dp[13]);
-   /* 14 */
-   COMBA_FORWARD;
-   MULADD(at[0], at[30]);    MULADD(at[1], at[29]);    MULADD(at[2], at[28]);    MULADD(at[3], at[27]);    MULADD(at[4], at[26]);    MULADD(at[5], at[25]);    MULADD(at[6], at[24]);    MULADD(at[7], at[23]);    MULADD(at[8], at[22]);    MULADD(at[9], at[21]);    MULADD(at[10], at[20]);    MULADD(at[11], at[19]);    MULADD(at[12], at[18]);    MULADD(at[13], at[17]);    MULADD(at[14], at[16]);
-   COMBA_STORE(C->dp[14]);
-   /* 15 */
-   COMBA_FORWARD;
-   MULADD(at[0], at[31]);    MULADD(at[1], at[30]);    MULADD(at[2], at[29]);    MULADD(at[3], at[28]);    MULADD(at[4], at[27]);    MULADD(at[5], at[26]);    MULADD(at[6], at[25]);    MULADD(at[7], at[24]);    MULADD(at[8], at[23]);    MULADD(at[9], at[22]);    MULADD(at[10], at[21]);    MULADD(at[11], at[20]);    MULADD(at[12], at[19]);    MULADD(at[13], at[18]);    MULADD(at[14], at[17]);    MULADD(at[15], at[16]);
-   COMBA_STORE(C->dp[15]);
-   /* 16 */
-   COMBA_FORWARD;
-   MULADD(at[1], at[31]);    MULADD(at[2], at[30]);    MULADD(at[3], at[29]);    MULADD(at[4], at[28]);    MULADD(at[5], at[27]);    MULADD(at[6], at[26]);    MULADD(at[7], at[25]);    MULADD(at[8], at[24]);    MULADD(at[9], at[23]);    MULADD(at[10], at[22]);    MULADD(at[11], at[21]);    MULADD(at[12], at[20]);    MULADD(at[13], at[19]);    MULADD(at[14], at[18]);    MULADD(at[15], at[17]);
-   COMBA_STORE(C->dp[16]);
-   /* 17 */
-   COMBA_FORWARD;
-   MULADD(at[2], at[31]);    MULADD(at[3], at[30]);    MULADD(at[4], at[29]);    MULADD(at[5], at[28]);    MULADD(at[6], at[27]);    MULADD(at[7], at[26]);    MULADD(at[8], at[25]);    MULADD(at[9], at[24]);    MULADD(at[10], at[23]);    MULADD(at[11], at[22]);    MULADD(at[12], at[21]);    MULADD(at[13], at[20]);    MULADD(at[14], at[19]);    MULADD(at[15], at[18]);
-   COMBA_STORE(C->dp[17]);
-   /* 18 */
-   COMBA_FORWARD;
-   MULADD(at[3], at[31]);    MULADD(at[4], at[30]);    MULADD(at[5], at[29]);    MULADD(at[6], at[28]);    MULADD(at[7], at[27]);    MULADD(at[8], at[26]);    MULADD(at[9], at[25]);    MULADD(at[10], at[24]);    MULADD(at[11], at[23]);    MULADD(at[12], at[22]);    MULADD(at[13], at[21]);    MULADD(at[14], at[20]);    MULADD(at[15], at[19]);
-   COMBA_STORE(C->dp[18]);
-   /* 19 */
-   COMBA_FORWARD;
-   MULADD(at[4], at[31]);    MULADD(at[5], at[30]);    MULADD(at[6], at[29]);    MULADD(at[7], at[28]);    MULADD(at[8], at[27]);    MULADD(at[9], at[26]);    MULADD(at[10], at[25]);    MULADD(at[11], at[24]);    MULADD(at[12], at[23]);    MULADD(at[13], at[22]);    MULADD(at[14], at[21]);    MULADD(at[15], at[20]);
-   COMBA_STORE(C->dp[19]);
-   /* 20 */
-   COMBA_FORWARD;
-   MULADD(at[5], at[31]);    MULADD(at[6], at[30]);    MULADD(at[7], at[29]);    MULADD(at[8], at[28]);    MULADD(at[9], at[27]);    MULADD(at[10], at[26]);    MULADD(at[11], at[25]);    MULADD(at[12], at[24]);    MULADD(at[13], at[23]);    MULADD(at[14], at[22]);    MULADD(at[15], at[21]);
-   COMBA_STORE(C->dp[20]);
-   /* 21 */
-   COMBA_FORWARD;
-   MULADD(at[6], at[31]);    MULADD(at[7], at[30]);    MULADD(at[8], at[29]);    MULADD(at[9], at[28]);    MULADD(at[10], at[27]);    MULADD(at[11], at[26]);    MULADD(at[12], at[25]);    MULADD(at[13], at[24]);    MULADD(at[14], at[23]);    MULADD(at[15], at[22]);
-   COMBA_STORE(C->dp[21]);
-   /* 22 */
-   COMBA_FORWARD;
-   MULADD(at[7], at[31]);    MULADD(at[8], at[30]);    MULADD(at[9], at[29]);    MULADD(at[10], at[28]);    MULADD(at[11], at[27]);    MULADD(at[12], at[26]);    MULADD(at[13], at[25]);    MULADD(at[14], at[24]);    MULADD(at[15], at[23]);
-   COMBA_STORE(C->dp[22]);
-   /* 23 */
-   COMBA_FORWARD;
-   MULADD(at[8], at[31]);    MULADD(at[9], at[30]);    MULADD(at[10], at[29]);    MULADD(at[11], at[28]);    MULADD(at[12], at[27]);    MULADD(at[13], at[26]);    MULADD(at[14], at[25]);    MULADD(at[15], at[24]);
-   COMBA_STORE(C->dp[23]);
-   /* 24 */
-   COMBA_FORWARD;
-   MULADD(at[9], at[31]);    MULADD(at[10], at[30]);    MULADD(at[11], at[29]);    MULADD(at[12], at[28]);    MULADD(at[13], at[27]);    MULADD(at[14], at[26]);    MULADD(at[15], at[25]);
-   COMBA_STORE(C->dp[24]);
-   /* 25 */
-   COMBA_FORWARD;
-   MULADD(at[10], at[31]);    MULADD(at[11], at[30]);    MULADD(at[12], at[29]);    MULADD(at[13], at[28]);    MULADD(at[14], at[27]);    MULADD(at[15], at[26]);
-   COMBA_STORE(C->dp[25]);
-   /* 26 */
-   COMBA_FORWARD;
-   MULADD(at[11], at[31]);    MULADD(at[12], at[30]);    MULADD(at[13], at[29]);    MULADD(at[14], at[28]);    MULADD(at[15], at[27]);
-   COMBA_STORE(C->dp[26]);
-   /* 27 */
-   COMBA_FORWARD;
-   MULADD(at[12], at[31]);    MULADD(at[13], at[30]);    MULADD(at[14], at[29]);    MULADD(at[15], at[28]);
-   COMBA_STORE(C->dp[27]);
-   /* 28 */
-   COMBA_FORWARD;
-   MULADD(at[13], at[31]);    MULADD(at[14], at[30]);    MULADD(at[15], at[29]);
-   COMBA_STORE(C->dp[28]);
-   /* 29 */
-   COMBA_FORWARD;
-   MULADD(at[14], at[31]);    MULADD(at[15], at[30]);
-   COMBA_STORE(C->dp[29]);
-   /* 30 */
-   COMBA_FORWARD;
-   MULADD(at[15], at[31]);
-   COMBA_STORE(C->dp[30]);
-   COMBA_STORE2(C->dp[31]);
-   C->used = 32;
-   C->sign = A->sign ^ B->sign;
-   fp_clamp(C);
-   COMBA_FINI;
-}
-
-#endif /* TFM_LARGE */
-
-#ifdef TFM_HUGE
-
-void fp_mul_comba32(fp_int *A, fp_int *B, fp_int *C)
-{
-   fp_digit c0, c1, c2, at[64];
-
-   memcpy(at, A->dp, 32 * sizeof(fp_digit));
-   memcpy(at+32, B->dp, 32 * sizeof(fp_digit));
-   COMBA_START;
-
-   COMBA_CLEAR;
-   /* 0 */
-   MULADD(at[0], at[32]);
-   COMBA_STORE(C->dp[0]);
-   /* 1 */
-   COMBA_FORWARD;
-   MULADD(at[0], at[33]);    MULADD(at[1], at[32]);
-   COMBA_STORE(C->dp[1]);
-   /* 2 */
-   COMBA_FORWARD;
-   MULADD(at[0], at[34]);    MULADD(at[1], at[33]);    MULADD(at[2], at[32]);
-   COMBA_STORE(C->dp[2]);
-   /* 3 */
-   COMBA_FORWARD;
-   MULADD(at[0], at[35]);    MULADD(at[1], at[34]);    MULADD(at[2], at[33]);    MULADD(at[3], at[32]);
-   COMBA_STORE(C->dp[3]);
-   /* 4 */
-   COMBA_FORWARD;
-   MULADD(at[0], at[36]);    MULADD(at[1], at[35]);    MULADD(at[2], at[34]);    MULADD(at[3], at[33]);    MULADD(at[4], at[32]);
-   COMBA_STORE(C->dp[4]);
-   /* 5 */
-   COMBA_FORWARD;
-   MULADD(at[0], at[37]);    MULADD(at[1], at[36]);    MULADD(at[2], at[35]);    MULADD(at[3], at[34]);    MULADD(at[4], at[33]);    MULADD(at[5], at[32]);
-   COMBA_STORE(C->dp[5]);
-   /* 6 */
-   COMBA_FORWARD;
-   MULADD(at[0], at[38]);    MULADD(at[1], at[37]);    MULADD(at[2], at[36]);    MULADD(at[3], at[35]);    MULADD(at[4], at[34]);    MULADD(at[5], at[33]);    MULADD(at[6], at[32]);
-   COMBA_STORE(C->dp[6]);
-   /* 7 */
-   COMBA_FORWARD;
-   MULADD(at[0], at[39]);    MULADD(at[1], at[38]);    MULADD(at[2], at[37]);    MULADD(at[3], at[36]);    MULADD(at[4], at[35]);    MULADD(at[5], at[34]);    MULADD(at[6], at[33]);    MULADD(at[7], at[32]);
-   COMBA_STORE(C->dp[7]);
-   /* 8 */
-   COMBA_FORWARD;
-   MULADD(at[0], at[40]);    MULADD(at[1], at[39]);    MULADD(at[2], at[38]);    MULADD(at[3], at[37]);    MULADD(at[4], at[36]);    MULADD(at[5], at[35]);    MULADD(at[6], at[34]);    MULADD(at[7], at[33]);    MULADD(at[8], at[32]);
-   COMBA_STORE(C->dp[8]);
-   /* 9 */
-   COMBA_FORWARD;
-   MULADD(at[0], at[41]);    MULADD(at[1], at[40]);    MULADD(at[2], at[39]);    MULADD(at[3], at[38]);    MULADD(at[4], at[37]);    MULADD(at[5], at[36]);    MULADD(at[6], at[35]);    MULADD(at[7], at[34]);    MULADD(at[8], at[33]);    MULADD(at[9], at[32]);
-   COMBA_STORE(C->dp[9]);
-   /* 10 */
-   COMBA_FORWARD;
-   MULADD(at[0], at[42]);    MULADD(at[1], at[41]);    MULADD(at[2], at[40]);    MULADD(at[3], at[39]);    MULADD(at[4], at[38]);    MULADD(at[5], at[37]);    MULADD(at[6], at[36]);    MULADD(at[7], at[35]);    MULADD(at[8], at[34]);    MULADD(at[9], at[33]);    MULADD(at[10], at[32]);
-   COMBA_STORE(C->dp[10]);
-   /* 11 */
-   COMBA_FORWARD;
-   MULADD(at[0], at[43]);    MULADD(at[1], at[42]);    MULADD(at[2], at[41]);    MULADD(at[3], at[40]);    MULADD(at[4], at[39]);    MULADD(at[5], at[38]);    MULADD(at[6], at[37]);    MULADD(at[7], at[36]);    MULADD(at[8], at[35]);    MULADD(at[9], at[34]);    MULADD(at[10], at[33]);    MULADD(at[11], at[32]);
-   COMBA_STORE(C->dp[11]);
-   /* 12 */
-   COMBA_FORWARD;
-   MULADD(at[0], at[44]);    MULADD(at[1], at[43]);    MULADD(at[2], at[42]);    MULADD(at[3], at[41]);    MULADD(at[4], at[40]);    MULADD(at[5], at[39]);    MULADD(at[6], at[38]);    MULADD(at[7], at[37]);    MULADD(at[8], at[36]);    MULADD(at[9], at[35]);    MULADD(at[10], at[34]);    MULADD(at[11], at[33]);    MULADD(at[12], at[32]);
-   COMBA_STORE(C->dp[12]);
-   /* 13 */
-   COMBA_FORWARD;
-   MULADD(at[0], at[45]);    MULADD(at[1], at[44]);    MULADD(at[2], at[43]);    MULADD(at[3], at[42]);    MULADD(at[4], at[41]);    MULADD(at[5], at[40]);    MULADD(at[6], at[39]);    MULADD(at[7], at[38]);    MULADD(at[8], at[37]);    MULADD(at[9], at[36]);    MULADD(at[10], at[35]);    MULADD(at[11], at[34]);    MULADD(at[12], at[33]);    MULADD(at[13], at[32]);
-   COMBA_STORE(C->dp[13]);
-   /* 14 */
-   COMBA_FORWARD;
-   MULADD(at[0], at[46]);    MULADD(at[1], at[45]);    MULADD(at[2], at[44]);    MULADD(at[3], at[43]);    MULADD(at[4], at[42]);    MULADD(at[5], at[41]);    MULADD(at[6], at[40]);    MULADD(at[7], at[39]);    MULADD(at[8], at[38]);    MULADD(at[9], at[37]);    MULADD(at[10], at[36]);    MULADD(at[11], at[35]);    MULADD(at[12], at[34]);    MULADD(at[13], at[33]);    MULADD(at[14], at[32]);
-   COMBA_STORE(C->dp[14]);
-   /* 15 */
-   COMBA_FORWARD;
-   MULADD(at[0], at[47]);    MULADD(at[1], at[46]);    MULADD(at[2], at[45]);    MULADD(at[3], at[44]);    MULADD(at[4], at[43]);    MULADD(at[5], at[42]);    MULADD(at[6], at[41]);    MULADD(at[7], at[40]);    MULADD(at[8], at[39]);    MULADD(at[9], at[38]);    MULADD(at[10], at[37]);    MULADD(at[11], at[36]);    MULADD(at[12], at[35]);    MULADD(at[13], at[34]);    MULADD(at[14], at[33]);    MULADD(at[15], at[32]);
-   COMBA_STORE(C->dp[15]);
-   /* 16 */
-   COMBA_FORWARD;
-   MULADD(at[0], at[48]);    MULADD(at[1], at[47]);    MULADD(at[2], at[46]);    MULADD(at[3], at[45]);    MULADD(at[4], at[44]);    MULADD(at[5], at[43]);    MULADD(at[6], at[42]);    MULADD(at[7], at[41]);    MULADD(at[8], at[40]);    MULADD(at[9], at[39]);    MULADD(at[10], at[38]);    MULADD(at[11], at[37]);    MULADD(at[12], at[36]);    MULADD(at[13], at[35]);    MULADD(at[14], at[34]);    MULADD(at[15], at[33]);    MULADD(at[16], at[32]);
-   COMBA_STORE(C->dp[16]);
-   /* 17 */
-   COMBA_FORWARD;
-   MULADD(at[0], at[49]);    MULADD(at[1], at[48]);    MULADD(at[2], at[47]);    MULADD(at[3], at[46]);    MULADD(at[4], at[45]);    MULADD(at[5], at[44]);    MULADD(at[6], at[43]);    MULADD(at[7], at[42]);    MULADD(at[8], at[41]);    MULADD(at[9], at[40]);    MULADD(at[10], at[39]);    MULADD(at[11], at[38]);    MULADD(at[12], at[37]);    MULADD(at[13], at[36]);    MULADD(at[14], at[35]);    MULADD(at[15], at[34]);    MULADD(at[16], at[33]);    MULADD(at[17], at[32]);
-   COMBA_STORE(C->dp[17]);
-   /* 18 */
-   COMBA_FORWARD;
-   MULADD(at[0], at[50]);    MULADD(at[1], at[49]);    MULADD(at[2], at[48]);    MULADD(at[3], at[47]);    MULADD(at[4], at[46]);    MULADD(at[5], at[45]);    MULADD(at[6], at[44]);    MULADD(at[7], at[43]);    MULADD(at[8], at[42]);    MULADD(at[9], at[41]);    MULADD(at[10], at[40]);    MULADD(at[11], at[39]);    MULADD(at[12], at[38]);    MULADD(at[13], at[37]);    MULADD(at[14], at[36]);    MULADD(at[15], at[35]);    MULADD(at[16], at[34]);    MULADD(at[17], at[33]);    MULADD(at[18], at[32]);
-   COMBA_STORE(C->dp[18]);
-   /* 19 */
-   COMBA_FORWARD;
-   MULADD(at[0], at[51]);    MULADD(at[1], at[50]);    MULADD(at[2], at[49]);    MULADD(at[3], at[48]);    MULADD(at[4], at[47]);    MULADD(at[5], at[46]);    MULADD(at[6], at[45]);    MULADD(at[7], at[44]);    MULADD(at[8], at[43]);    MULADD(at[9], at[42]);    MULADD(at[10], at[41]);    MULADD(at[11], at[40]);    MULADD(at[12], at[39]);    MULADD(at[13], at[38]);    MULADD(at[14], at[37]);    MULADD(at[15], at[36]);    MULADD(at[16], at[35]);    MULADD(at[17], at[34]);    MULADD(at[18], at[33]);    MULADD(at[19], at[32]);
-   COMBA_STORE(C->dp[19]);
-   /* 20 */
-   COMBA_FORWARD;
-   MULADD(at[0], at[52]);    MULADD(at[1], at[51]);    MULADD(at[2], at[50]);    MULADD(at[3], at[49]);    MULADD(at[4], at[48]);    MULADD(at[5], at[47]);    MULADD(at[6], at[46]);    MULADD(at[7], at[45]);    MULADD(at[8], at[44]);    MULADD(at[9], at[43]);    MULADD(at[10], at[42]);    MULADD(at[11], at[41]);    MULADD(at[12], at[40]);    MULADD(at[13], at[39]);    MULADD(at[14], at[38]);    MULADD(at[15], at[37]);    MULADD(at[16], at[36]);    MULADD(at[17], at[35]);    MULADD(at[18], at[34]);    MULADD(at[19], at[33]);    MULADD(at[20], at[32]);
-   COMBA_STORE(C->dp[20]);
-   /* 21 */
-   COMBA_FORWARD;
-   MULADD(at[0], at[53]);    MULADD(at[1], at[52]);    MULADD(at[2], at[51]);    MULADD(at[3], at[50]);    MULADD(at[4], at[49]);    MULADD(at[5], at[48]);    MULADD(at[6], at[47]);    MULADD(at[7], at[46]);    MULADD(at[8], at[45]);    MULADD(at[9], at[44]);    MULADD(at[10], at[43]);    MULADD(at[11], at[42]);    MULADD(at[12], at[41]);    MULADD(at[13], at[40]);    MULADD(at[14], at[39]);    MULADD(at[15], at[38]);    MULADD(at[16], at[37]);    MULADD(at[17], at[36]);    MULADD(at[18], at[35]);    MULADD(at[19], at[34]);    MULADD(at[20], at[33]);    MULADD(at[21], at[32]);
-   COMBA_STORE(C->dp[21]);
-   /* 22 */
-   COMBA_FORWARD;
-   MULADD(at[0], at[54]);    MULADD(at[1], at[53]);    MULADD(at[2], at[52]);    MULADD(at[3], at[51]);    MULADD(at[4], at[50]);    MULADD(at[5], at[49]);    MULADD(at[6], at[48]);    MULADD(at[7], at[47]);    MULADD(at[8], at[46]);    MULADD(at[9], at[45]);    MULADD(at[10], at[44]);    MULADD(at[11], at[43]);    MULADD(at[12], at[42]);    MULADD(at[13], at[41]);    MULADD(at[14], at[40]);    MULADD(at[15], at[39]);    MULADD(at[16], at[38]);    MULADD(at[17], at[37]);    MULADD(at[18], at[36]);    MULADD(at[19], at[35]);    MULADD(at[20], at[34]);    MULADD(at[21], at[33]);    MULADD(at[22], at[32]);
-   COMBA_STORE(C->dp[22]);
-   /* 23 */
-   COMBA_FORWARD;
-   MULADD(at[0], at[55]);    MULADD(at[1], at[54]);    MULADD(at[2], at[53]);    MULADD(at[3], at[52]);    MULADD(at[4], at[51]);    MULADD(at[5], at[50]);    MULADD(at[6], at[49]);    MULADD(at[7], at[48]);    MULADD(at[8], at[47]);    MULADD(at[9], at[46]);    MULADD(at[10], at[45]);    MULADD(at[11], at[44]);    MULADD(at[12], at[43]);    MULADD(at[13], at[42]);    MULADD(at[14], at[41]);    MULADD(at[15], at[40]);    MULADD(at[16], at[39]);    MULADD(at[17], at[38]);    MULADD(at[18], at[37]);    MULADD(at[19], at[36]);    MULADD(at[20], at[35]);    MULADD(at[21], at[34]);    MULADD(at[22], at[33]);    MULADD(at[23], at[32]);
-   COMBA_STORE(C->dp[23]);
-   /* 24 */
-   COMBA_FORWARD;
-   MULADD(at[0], at[56]);    MULADD(at[1], at[55]);    MULADD(at[2], at[54]);    MULADD(at[3], at[53]);    MULADD(at[4], at[52]);    MULADD(at[5], at[51]);    MULADD(at[6], at[50]);    MULADD(at[7], at[49]);    MULADD(at[8], at[48]);    MULADD(at[9], at[47]);    MULADD(at[10], at[46]);    MULADD(at[11], at[45]);    MULADD(at[12], at[44]);    MULADD(at[13], at[43]);    MULADD(at[14], at[42]);    MULADD(at[15], at[41]);    MULADD(at[16], at[40]);    MULADD(at[17], at[39]);    MULADD(at[18], at[38]);    MULADD(at[19], at[37]);    MULADD(at[20], at[36]);    MULADD(at[21], at[35]);    MULADD(at[22], at[34]);    MULADD(at[23], at[33]);    MULADD(at[24], at[32]);
-   COMBA_STORE(C->dp[24]);
-   /* 25 */
-   COMBA_FORWARD;
-   MULADD(at[0], at[57]);    MULADD(at[1], at[56]);    MULADD(at[2], at[55]);    MULADD(at[3], at[54]);    MULADD(at[4], at[53]);    MULADD(at[5], at[52]);    MULADD(at[6], at[51]);    MULADD(at[7], at[50]);    MULADD(at[8], at[49]);    MULADD(at[9], at[48]);    MULADD(at[10], at[47]);    MULADD(at[11], at[46]);    MULADD(at[12], at[45]);    MULADD(at[13], at[44]);    MULADD(at[14], at[43]);    MULADD(at[15], at[42]);    MULADD(at[16], at[41]);    MULADD(at[17], at[40]);    MULADD(at[18], at[39]);    MULADD(at[19], at[38]);    MULADD(at[20], at[37]);    MULADD(at[21], at[36]);    MULADD(at[22], at[35]);    MULADD(at[23], at[34]);    MULADD(at[24], at[33]);    MULADD(at[25], at[32]);
-   COMBA_STORE(C->dp[25]);
-   /* 26 */
-   COMBA_FORWARD;
-   MULADD(at[0], at[58]);    MULADD(at[1], at[57]);    MULADD(at[2], at[56]);    MULADD(at[3], at[55]);    MULADD(at[4], at[54]);    MULADD(at[5], at[53]);    MULADD(at[6], at[52]);    MULADD(at[7], at[51]);    MULADD(at[8], at[50]);    MULADD(at[9], at[49]);    MULADD(at[10], at[48]);    MULADD(at[11], at[47]);    MULADD(at[12], at[46]);    MULADD(at[13], at[45]);    MULADD(at[14], at[44]);    MULADD(at[15], at[43]);    MULADD(at[16], at[42]);    MULADD(at[17], at[41]);    MULADD(at[18], at[40]);    MULADD(at[19], at[39]);    MULADD(at[20], at[38]);    MULADD(at[21], at[37]);    MULADD(at[22], at[36]);    MULADD(at[23], at[35]);    MULADD(at[24], at[34]);    MULADD(at[25], at[33]);    MULADD(at[26], at[32]);
-   COMBA_STORE(C->dp[26]);
-   /* 27 */
-   COMBA_FORWARD;
-   MULADD(at[0], at[59]);    MULADD(at[1], at[58]);    MULADD(at[2], at[57]);    MULADD(at[3], at[56]);    MULADD(at[4], at[55]);    MULADD(at[5], at[54]);    MULADD(at[6], at[53]);    MULADD(at[7], at[52]);    MULADD(at[8], at[51]);    MULADD(at[9], at[50]);    MULADD(at[10], at[49]);    MULADD(at[11], at[48]);    MULADD(at[12], at[47]);    MULADD(at[13], at[46]);    MULADD(at[14], at[45]);    MULADD(at[15], at[44]);    MULADD(at[16], at[43]);    MULADD(at[17], at[42]);    MULADD(at[18], at[41]);    MULADD(at[19], at[40]);    MULADD(at[20], at[39]);    MULADD(at[21], at[38]);    MULADD(at[22], at[37]);    MULADD(at[23], at[36]);    MULADD(at[24], at[35]);    MULADD(at[25], at[34]);    MULADD(at[26], at[33]);    MULADD(at[27], at[32]);
-   COMBA_STORE(C->dp[27]);
-   /* 28 */
-   COMBA_FORWARD;
-   MULADD(at[0], at[60]);    MULADD(at[1], at[59]);    MULADD(at[2], at[58]);    MULADD(at[3], at[57]);    MULADD(at[4], at[56]);    MULADD(at[5], at[55]);    MULADD(at[6], at[54]);    MULADD(at[7], at[53]);    MULADD(at[8], at[52]);    MULADD(at[9], at[51]);    MULADD(at[10], at[50]);    MULADD(at[11], at[49]);    MULADD(at[12], at[48]);    MULADD(at[13], at[47]);    MULADD(at[14], at[46]);    MULADD(at[15], at[45]);    MULADD(at[16], at[44]);    MULADD(at[17], at[43]);    MULADD(at[18], at[42]);    MULADD(at[19], at[41]);    MULADD(at[20], at[40]);    MULADD(at[21], at[39]);    MULADD(at[22], at[38]);    MULADD(at[23], at[37]);    MULADD(at[24], at[36]);    MULADD(at[25], at[35]);    MULADD(at[26], at[34]);    MULADD(at[27], at[33]);    MULADD(at[28], at[32]);
-   COMBA_STORE(C->dp[28]);
-   /* 29 */
-   COMBA_FORWARD;
-   MULADD(at[0], at[61]);    MULADD(at[1], at[60]);    MULADD(at[2], at[59]);    MULADD(at[3], at[58]);    MULADD(at[4], at[57]);    MULADD(at[5], at[56]);    MULADD(at[6], at[55]);    MULADD(at[7], at[54]);    MULADD(at[8], at[53]);    MULADD(at[9], at[52]);    MULADD(at[10], at[51]);    MULADD(at[11], at[50]);    MULADD(at[12], at[49]);    MULADD(at[13], at[48]);    MULADD(at[14], at[47]);    MULADD(at[15], at[46]);    MULADD(at[16], at[45]);    MULADD(at[17], at[44]);    MULADD(at[18], at[43]);    MULADD(at[19], at[42]);    MULADD(at[20], at[41]);    MULADD(at[21], at[40]);    MULADD(at[22], at[39]);    MULADD(at[23], at[38]);    MULADD(at[24], at[37]);    MULADD(at[25], at[36]);    MULADD(at[26], at[35]);    MULADD(at[27], at[34]);    MULADD(at[28], at[33]);    MULADD(at[29], at[32]);
-   COMBA_STORE(C->dp[29]);
-   /* 30 */
-   COMBA_FORWARD;
-   MULADD(at[0], at[62]);    MULADD(at[1], at[61]);    MULADD(at[2], at[60]);    MULADD(at[3], at[59]);    MULADD(at[4], at[58]);    MULADD(at[5], at[57]);    MULADD(at[6], at[56]);    MULADD(at[7], at[55]);    MULADD(at[8], at[54]);    MULADD(at[9], at[53]);    MULADD(at[10], at[52]);    MULADD(at[11], at[51]);    MULADD(at[12], at[50]);    MULADD(at[13], at[49]);    MULADD(at[14], at[48]);    MULADD(at[15], at[47]);    MULADD(at[16], at[46]);    MULADD(at[17], at[45]);    MULADD(at[18], at[44]);    MULADD(at[19], at[43]);    MULADD(at[20], at[42]);    MULADD(at[21], at[41]);    MULADD(at[22], at[40]);    MULADD(at[23], at[39]);    MULADD(at[24], at[38]);    MULADD(at[25], at[37]);    MULADD(at[26], at[36]);    MULADD(at[27], at[35]);    MULADD(at[28], at[34]);    MULADD(at[29], at[33]);    MULADD(at[30], at[32]);
-   COMBA_STORE(C->dp[30]);
-   /* 31 */
-   COMBA_FORWARD;
-   MULADD(at[0], at[63]);    MULADD(at[1], at[62]);    MULADD(at[2], at[61]);    MULADD(at[3], at[60]);    MULADD(at[4], at[59]);    MULADD(at[5], at[58]);    MULADD(at[6], at[57]);    MULADD(at[7], at[56]);    MULADD(at[8], at[55]);    MULADD(at[9], at[54]);    MULADD(at[10], at[53]);    MULADD(at[11], at[52]);    MULADD(at[12], at[51]);    MULADD(at[13], at[50]);    MULADD(at[14], at[49]);    MULADD(at[15], at[48]);    MULADD(at[16], at[47]);    MULADD(at[17], at[46]);    MULADD(at[18], at[45]);    MULADD(at[19], at[44]);    MULADD(at[20], at[43]);    MULADD(at[21], at[42]);    MULADD(at[22], at[41]);    MULADD(at[23], at[40]);    MULADD(at[24], at[39]);    MULADD(at[25], at[38]);    MULADD(at[26], at[37]);    MULADD(at[27], at[36]);    MULADD(at[28], at[35]);    MULADD(at[29], at[34]);    MULADD(at[30], at[33]);    MULADD(at[31], at[32]);
-   COMBA_STORE(C->dp[31]);
-   /* 32 */
-   COMBA_FORWARD;
-   MULADD(at[1], at[63]);    MULADD(at[2], at[62]);    MULADD(at[3], at[61]);    MULADD(at[4], at[60]);    MULADD(at[5], at[59]);    MULADD(at[6], at[58]);    MULADD(at[7], at[57]);    MULADD(at[8], at[56]);    MULADD(at[9], at[55]);    MULADD(at[10], at[54]);    MULADD(at[11], at[53]);    MULADD(at[12], at[52]);    MULADD(at[13], at[51]);    MULADD(at[14], at[50]);    MULADD(at[15], at[49]);    MULADD(at[16], at[48]);    MULADD(at[17], at[47]);    MULADD(at[18], at[46]);    MULADD(at[19], at[45]);    MULADD(at[20], at[44]);    MULADD(at[21], at[43]);    MULADD(at[22], at[42]);    MULADD(at[23], at[41]);    MULADD(at[24], at[40]);    MULADD(at[25], at[39]);    MULADD(at[26], at[38]);    MULADD(at[27], at[37]);    MULADD(at[28], at[36]);    MULADD(at[29], at[35]);    MULADD(at[30], at[34]);    MULADD(at[31], at[33]);
-   COMBA_STORE(C->dp[32]);
-   /* 33 */
-   COMBA_FORWARD;
-   MULADD(at[2], at[63]);    MULADD(at[3], at[62]);    MULADD(at[4], at[61]);    MULADD(at[5], at[60]);    MULADD(at[6], at[59]);    MULADD(at[7], at[58]);    MULADD(at[8], at[57]);    MULADD(at[9], at[56]);    MULADD(at[10], at[55]);    MULADD(at[11], at[54]);    MULADD(at[12], at[53]);    MULADD(at[13], at[52]);    MULADD(at[14], at[51]);    MULADD(at[15], at[50]);    MULADD(at[16], at[49]);    MULADD(at[17], at[48]);    MULADD(at[18], at[47]);    MULADD(at[19], at[46]);    MULADD(at[20], at[45]);    MULADD(at[21], at[44]);    MULADD(at[22], at[43]);    MULADD(at[23], at[42]);    MULADD(at[24], at[41]);    MULADD(at[25], at[40]);    MULADD(at[26], at[39]);    MULADD(at[27], at[38]);    MULADD(at[28], at[37]);    MULADD(at[29], at[36]);    MULADD(at[30], at[35]);    MULADD(at[31], at[34]);
-   COMBA_STORE(C->dp[33]);
-   /* 34 */
-   COMBA_FORWARD;
-   MULADD(at[3], at[63]);    MULADD(at[4], at[62]);    MULADD(at[5], at[61]);    MULADD(at[6], at[60]);    MULADD(at[7], at[59]);    MULADD(at[8], at[58]);    MULADD(at[9], at[57]);    MULADD(at[10], at[56]);    MULADD(at[11], at[55]);    MULADD(at[12], at[54]);    MULADD(at[13], at[53]);    MULADD(at[14], at[52]);    MULADD(at[15], at[51]);    MULADD(at[16], at[50]);    MULADD(at[17], at[49]);    MULADD(at[18], at[48]);    MULADD(at[19], at[47]);    MULADD(at[20], at[46]);    MULADD(at[21], at[45]);    MULADD(at[22], at[44]);    MULADD(at[23], at[43]);    MULADD(at[24], at[42]);    MULADD(at[25], at[41]);    MULADD(at[26], at[40]);    MULADD(at[27], at[39]);    MULADD(at[28], at[38]);    MULADD(at[29], at[37]);    MULADD(at[30], at[36]);    MULADD(at[31], at[35]);
-   COMBA_STORE(C->dp[34]);
-   /* 35 */
-   COMBA_FORWARD;
-   MULADD(at[4], at[63]);    MULADD(at[5], at[62]);    MULADD(at[6], at[61]);    MULADD(at[7], at[60]);    MULADD(at[8], at[59]);    MULADD(at[9], at[58]);    MULADD(at[10], at[57]);    MULADD(at[11], at[56]);    MULADD(at[12], at[55]);    MULADD(at[13], at[54]);    MULADD(at[14], at[53]);    MULADD(at[15], at[52]);    MULADD(at[16], at[51]);    MULADD(at[17], at[50]);    MULADD(at[18], at[49]);    MULADD(at[19], at[48]);    MULADD(at[20], at[47]);    MULADD(at[21], at[46]);    MULADD(at[22], at[45]);    MULADD(at[23], at[44]);    MULADD(at[24], at[43]);    MULADD(at[25], at[42]);    MULADD(at[26], at[41]);    MULADD(at[27], at[40]);    MULADD(at[28], at[39]);    MULADD(at[29], at[38]);    MULADD(at[30], at[37]);    MULADD(at[31], at[36]);
-   COMBA_STORE(C->dp[35]);
-   /* 36 */
-   COMBA_FORWARD;
-   MULADD(at[5], at[63]);    MULADD(at[6], at[62]);    MULADD(at[7], at[61]);    MULADD(at[8], at[60]);    MULADD(at[9], at[59]);    MULADD(at[10], at[58]);    MULADD(at[11], at[57]);    MULADD(at[12], at[56]);    MULADD(at[13], at[55]);    MULADD(at[14], at[54]);    MULADD(at[15], at[53]);    MULADD(at[16], at[52]);    MULADD(at[17], at[51]);    MULADD(at[18], at[50]);    MULADD(at[19], at[49]);    MULADD(at[20], at[48]);    MULADD(at[21], at[47]);    MULADD(at[22], at[46]);    MULADD(at[23], at[45]);    MULADD(at[24], at[44]);    MULADD(at[25], at[43]);    MULADD(at[26], at[42]);    MULADD(at[27], at[41]);    MULADD(at[28], at[40]);    MULADD(at[29], at[39]);    MULADD(at[30], at[38]);    MULADD(at[31], at[37]);
-   COMBA_STORE(C->dp[36]);
-   /* 37 */
-   COMBA_FORWARD;
-   MULADD(at[6], at[63]);    MULADD(at[7], at[62]);    MULADD(at[8], at[61]);    MULADD(at[9], at[60]);    MULADD(at[10], at[59]);    MULADD(at[11], at[58]);    MULADD(at[12], at[57]);    MULADD(at[13], at[56]);    MULADD(at[14], at[55]);    MULADD(at[15], at[54]);    MULADD(at[16], at[53]);    MULADD(at[17], at[52]);    MULADD(at[18], at[51]);    MULADD(at[19], at[50]);    MULADD(at[20], at[49]);    MULADD(at[21], at[48]);    MULADD(at[22], at[47]);    MULADD(at[23], at[46]);    MULADD(at[24], at[45]);    MULADD(at[25], at[44]);    MULADD(at[26], at[43]);    MULADD(at[27], at[42]);    MULADD(at[28], at[41]);    MULADD(at[29], at[40]);    MULADD(at[30], at[39]);    MULADD(at[31], at[38]);
-   COMBA_STORE(C->dp[37]);
-   /* 38 */
-   COMBA_FORWARD;
-   MULADD(at[7], at[63]);    MULADD(at[8], at[62]);    MULADD(at[9], at[61]);    MULADD(at[10], at[60]);    MULADD(at[11], at[59]);    MULADD(at[12], at[58]);    MULADD(at[13], at[57]);    MULADD(at[14], at[56]);    MULADD(at[15], at[55]);    MULADD(at[16], at[54]);    MULADD(at[17], at[53]);    MULADD(at[18], at[52]);    MULADD(at[19], at[51]);    MULADD(at[20], at[50]);    MULADD(at[21], at[49]);    MULADD(at[22], at[48]);    MULADD(at[23], at[47]);    MULADD(at[24], at[46]);    MULADD(at[25], at[45]);    MULADD(at[26], at[44]);    MULADD(at[27], at[43]);    MULADD(at[28], at[42]);    MULADD(at[29], at[41]);    MULADD(at[30], at[40]);    MULADD(at[31], at[39]);
-   COMBA_STORE(C->dp[38]);
-   /* 39 */
-   COMBA_FORWARD;
-   MULADD(at[8], at[63]);    MULADD(at[9], at[62]);    MULADD(at[10], at[61]);    MULADD(at[11], at[60]);    MULADD(at[12], at[59]);    MULADD(at[13], at[58]);    MULADD(at[14], at[57]);    MULADD(at[15], at[56]);    MULADD(at[16], at[55]);    MULADD(at[17], at[54]);    MULADD(at[18], at[53]);    MULADD(at[19], at[52]);    MULADD(at[20], at[51]);    MULADD(at[21], at[50]);    MULADD(at[22], at[49]);    MULADD(at[23], at[48]);    MULADD(at[24], at[47]);    MULADD(at[25], at[46]);    MULADD(at[26], at[45]);    MULADD(at[27], at[44]);    MULADD(at[28], at[43]);    MULADD(at[29], at[42]);    MULADD(at[30], at[41]);    MULADD(at[31], at[40]);
-   COMBA_STORE(C->dp[39]);
-   /* 40 */
-   COMBA_FORWARD;
-   MULADD(at[9], at[63]);    MULADD(at[10], at[62]);    MULADD(at[11], at[61]);    MULADD(at[12], at[60]);    MULADD(at[13], at[59]);    MULADD(at[14], at[58]);    MULADD(at[15], at[57]);    MULADD(at[16], at[56]);    MULADD(at[17], at[55]);    MULADD(at[18], at[54]);    MULADD(at[19], at[53]);    MULADD(at[20], at[52]);    MULADD(at[21], at[51]);    MULADD(at[22], at[50]);    MULADD(at[23], at[49]);    MULADD(at[24], at[48]);    MULADD(at[25], at[47]);    MULADD(at[26], at[46]);    MULADD(at[27], at[45]);    MULADD(at[28], at[44]);    MULADD(at[29], at[43]);    MULADD(at[30], at[42]);    MULADD(at[31], at[41]);
-   COMBA_STORE(C->dp[40]);
-   /* 41 */
-   COMBA_FORWARD;
-   MULADD(at[10], at[63]);    MULADD(at[11], at[62]);    MULADD(at[12], at[61]);    MULADD(at[13], at[60]);    MULADD(at[14], at[59]);    MULADD(at[15], at[58]);    MULADD(at[16], at[57]);    MULADD(at[17], at[56]);    MULADD(at[18], at[55]);    MULADD(at[19], at[54]);    MULADD(at[20], at[53]);    MULADD(at[21], at[52]);    MULADD(at[22], at[51]);    MULADD(at[23], at[50]);    MULADD(at[24], at[49]);    MULADD(at[25], at[48]);    MULADD(at[26], at[47]);    MULADD(at[27], at[46]);    MULADD(at[28], at[45]);    MULADD(at[29], at[44]);    MULADD(at[30], at[43]);    MULADD(at[31], at[42]);
-   COMBA_STORE(C->dp[41]);
-   /* 42 */
-   COMBA_FORWARD;
-   MULADD(at[11], at[63]);    MULADD(at[12], at[62]);    MULADD(at[13], at[61]);    MULADD(at[14], at[60]);    MULADD(at[15], at[59]);    MULADD(at[16], at[58]);    MULADD(at[17], at[57]);    MULADD(at[18], at[56]);    MULADD(at[19], at[55]);    MULADD(at[20], at[54]);    MULADD(at[21], at[53]);    MULADD(at[22], at[52]);    MULADD(at[23], at[51]);    MULADD(at[24], at[50]);    MULADD(at[25], at[49]);    MULADD(at[26], at[48]);    MULADD(at[27], at[47]);    MULADD(at[28], at[46]);    MULADD(at[29], at[45]);    MULADD(at[30], at[44]);    MULADD(at[31], at[43]);
-   COMBA_STORE(C->dp[42]);
-   /* 43 */
-   COMBA_FORWARD;
-   MULADD(at[12], at[63]);    MULADD(at[13], at[62]);    MULADD(at[14], at[61]);    MULADD(at[15], at[60]);    MULADD(at[16], at[59]);    MULADD(at[17], at[58]);    MULADD(at[18], at[57]);    MULADD(at[19], at[56]);    MULADD(at[20], at[55]);    MULADD(at[21], at[54]);    MULADD(at[22], at[53]);    MULADD(at[23], at[52]);    MULADD(at[24], at[51]);    MULADD(at[25], at[50]);    MULADD(at[26], at[49]);    MULADD(at[27], at[48]);    MULADD(at[28], at[47]);    MULADD(at[29], at[46]);    MULADD(at[30], at[45]);    MULADD(at[31], at[44]);
-   COMBA_STORE(C->dp[43]);
-   /* 44 */
-   COMBA_FORWARD;
-   MULADD(at[13], at[63]);    MULADD(at[14], at[62]);    MULADD(at[15], at[61]);    MULADD(at[16], at[60]);    MULADD(at[17], at[59]);    MULADD(at[18], at[58]);    MULADD(at[19], at[57]);    MULADD(at[20], at[56]);    MULADD(at[21], at[55]);    MULADD(at[22], at[54]);    MULADD(at[23], at[53]);    MULADD(at[24], at[52]);    MULADD(at[25], at[51]);    MULADD(at[26], at[50]);    MULADD(at[27], at[49]);    MULADD(at[28], at[48]);    MULADD(at[29], at[47]);    MULADD(at[30], at[46]);    MULADD(at[31], at[45]);
-   COMBA_STORE(C->dp[44]);
-   /* 45 */
-   COMBA_FORWARD;
-   MULADD(at[14], at[63]);    MULADD(at[15], at[62]);    MULADD(at[16], at[61]);    MULADD(at[17], at[60]);    MULADD(at[18], at[59]);    MULADD(at[19], at[58]);    MULADD(at[20], at[57]);    MULADD(at[21], at[56]);    MULADD(at[22], at[55]);    MULADD(at[23], at[54]);    MULADD(at[24], at[53]);    MULADD(at[25], at[52]);    MULADD(at[26], at[51]);    MULADD(at[27], at[50]);    MULADD(at[28], at[49]);    MULADD(at[29], at[48]);    MULADD(at[30], at[47]);    MULADD(at[31], at[46]);
-   COMBA_STORE(C->dp[45]);
-   /* 46 */
-   COMBA_FORWARD;
-   MULADD(at[15], at[63]);    MULADD(at[16], at[62]);    MULADD(at[17], at[61]);    MULADD(at[18], at[60]);    MULADD(at[19], at[59]);    MULADD(at[20], at[58]);    MULADD(at[21], at[57]);    MULADD(at[22], at[56]);    MULADD(at[23], at[55]);    MULADD(at[24], at[54]);    MULADD(at[25], at[53]);    MULADD(at[26], at[52]);    MULADD(at[27], at[51]);    MULADD(at[28], at[50]);    MULADD(at[29], at[49]);    MULADD(at[30], at[48]);    MULADD(at[31], at[47]);
-   COMBA_STORE(C->dp[46]);
-   /* 47 */
-   COMBA_FORWARD;
-   MULADD(at[16], at[63]);    MULADD(at[17], at[62]);    MULADD(at[18], at[61]);    MULADD(at[19], at[60]);    MULADD(at[20], at[59]);    MULADD(at[21], at[58]);    MULADD(at[22], at[57]);    MULADD(at[23], at[56]);    MULADD(at[24], at[55]);    MULADD(at[25], at[54]);    MULADD(at[26], at[53]);    MULADD(at[27], at[52]);    MULADD(at[28], at[51]);    MULADD(at[29], at[50]);    MULADD(at[30], at[49]);    MULADD(at[31], at[48]);
-   COMBA_STORE(C->dp[47]);
-   /* 48 */
-   COMBA_FORWARD;
-   MULADD(at[17], at[63]);    MULADD(at[18], at[62]);    MULADD(at[19], at[61]);    MULADD(at[20], at[60]);    MULADD(at[21], at[59]);    MULADD(at[22], at[58]);    MULADD(at[23], at[57]);    MULADD(at[24], at[56]);    MULADD(at[25], at[55]);    MULADD(at[26], at[54]);    MULADD(at[27], at[53]);    MULADD(at[28], at[52]);    MULADD(at[29], at[51]);    MULADD(at[30], at[50]);    MULADD(at[31], at[49]);
-   COMBA_STORE(C->dp[48]);
-   /* 49 */
-   COMBA_FORWARD;
-   MULADD(at[18], at[63]);    MULADD(at[19], at[62]);    MULADD(at[20], at[61]);    MULADD(at[21], at[60]);    MULADD(at[22], at[59]);    MULADD(at[23], at[58]);    MULADD(at[24], at[57]);    MULADD(at[25], at[56]);    MULADD(at[26], at[55]);    MULADD(at[27], at[54]);    MULADD(at[28], at[53]);    MULADD(at[29], at[52]);    MULADD(at[30], at[51]);    MULADD(at[31], at[50]);
-   COMBA_STORE(C->dp[49]);
-   /* 50 */
-   COMBA_FORWARD;
-   MULADD(at[19], at[63]);    MULADD(at[20], at[62]);    MULADD(at[21], at[61]);    MULADD(at[22], at[60]);    MULADD(at[23], at[59]);    MULADD(at[24], at[58]);    MULADD(at[25], at[57]);    MULADD(at[26], at[56]);    MULADD(at[27], at[55]);    MULADD(at[28], at[54]);    MULADD(at[29], at[53]);    MULADD(at[30], at[52]);    MULADD(at[31], at[51]);
-   COMBA_STORE(C->dp[50]);
-   /* 51 */
-   COMBA_FORWARD;
-   MULADD(at[20], at[63]);    MULADD(at[21], at[62]);    MULADD(at[22], at[61]);    MULADD(at[23], at[60]);    MULADD(at[24], at[59]);    MULADD(at[25], at[58]);    MULADD(at[26], at[57]);    MULADD(at[27], at[56]);    MULADD(at[28], at[55]);    MULADD(at[29], at[54]);    MULADD(at[30], at[53]);    MULADD(at[31], at[52]);
-   COMBA_STORE(C->dp[51]);
-   /* 52 */
-   COMBA_FORWARD;
-   MULADD(at[21], at[63]);    MULADD(at[22], at[62]);    MULADD(at[23], at[61]);    MULADD(at[24], at[60]);    MULADD(at[25], at[59]);    MULADD(at[26], at[58]);    MULADD(at[27], at[57]);    MULADD(at[28], at[56]);    MULADD(at[29], at[55]);    MULADD(at[30], at[54]);    MULADD(at[31], at[53]);
-   COMBA_STORE(C->dp[52]);
-   /* 53 */
-   COMBA_FORWARD;
-   MULADD(at[22], at[63]);    MULADD(at[23], at[62]);    MULADD(at[24], at[61]);    MULADD(at[25], at[60]);    MULADD(at[26], at[59]);    MULADD(at[27], at[58]);    MULADD(at[28], at[57]);    MULADD(at[29], at[56]);    MULADD(at[30], at[55]);    MULADD(at[31], at[54]);
-   COMBA_STORE(C->dp[53]);
-   /* 54 */
-   COMBA_FORWARD;
-   MULADD(at[23], at[63]);    MULADD(at[24], at[62]);    MULADD(at[25], at[61]);    MULADD(at[26], at[60]);    MULADD(at[27], at[59]);    MULADD(at[28], at[58]);    MULADD(at[29], at[57]);    MULADD(at[30], at[56]);    MULADD(at[31], at[55]);
-   COMBA_STORE(C->dp[54]);
-   /* 55 */
-   COMBA_FORWARD;
-   MULADD(at[24], at[63]);    MULADD(at[25], at[62]);    MULADD(at[26], at[61]);    MULADD(at[27], at[60]);    MULADD(at[28], at[59]);    MULADD(at[29], at[58]);    MULADD(at[30], at[57]);    MULADD(at[31], at[56]);
-   COMBA_STORE(C->dp[55]);
-   /* 56 */
-   COMBA_FORWARD;
-   MULADD(at[25], at[63]);    MULADD(at[26], at[62]);    MULADD(at[27], at[61]);    MULADD(at[28], at[60]);    MULADD(at[29], at[59]);    MULADD(at[30], at[58]);    MULADD(at[31], at[57]);
-   COMBA_STORE(C->dp[56]);
-   /* 57 */
-   COMBA_FORWARD;
-   MULADD(at[26], at[63]);    MULADD(at[27], at[62]);    MULADD(at[28], at[61]);    MULADD(at[29], at[60]);    MULADD(at[30], at[59]);    MULADD(at[31], at[58]);
-   COMBA_STORE(C->dp[57]);
-   /* 58 */
-   COMBA_FORWARD;
-   MULADD(at[27], at[63]);    MULADD(at[28], at[62]);    MULADD(at[29], at[61]);    MULADD(at[30], at[60]);    MULADD(at[31], at[59]);
-   COMBA_STORE(C->dp[58]);
-   /* 59 */
-   COMBA_FORWARD;
-   MULADD(at[28], at[63]);    MULADD(at[29], at[62]);    MULADD(at[30], at[61]);    MULADD(at[31], at[60]);
-   COMBA_STORE(C->dp[59]);
-   /* 60 */
-   COMBA_FORWARD;
-   MULADD(at[29], at[63]);    MULADD(at[30], at[62]);    MULADD(at[31], at[61]);
-   COMBA_STORE(C->dp[60]);
-   /* 61 */
-   COMBA_FORWARD;
-   MULADD(at[30], at[63]);    MULADD(at[31], at[62]);
-   COMBA_STORE(C->dp[61]);
-   /* 62 */
-   COMBA_FORWARD;
-   MULADD(at[31], at[63]);
-   COMBA_STORE(C->dp[62]);
-   COMBA_STORE2(C->dp[63]);
-   C->used = 64;
-   C->sign = A->sign ^ B->sign;
-   fp_clamp(C);
-   COMBA_FINI;
-}
-
-#endif
-
-/* End: fp_mul_comba.c */
-
-/* Start: fp_mul_d.c */
-/* TomsFastMath, a fast ISO C bignum library.
- *
- * This project is meant to fill in where LibTomMath
- * falls short.  That is speed ;-)
- *
- * This project is public domain and free for all purposes.
- *
- * Tom St Denis, tomstdenis@iahu.ca
- */
-#include <tfm.h>
-
-/* c = a * b */
-void fp_mul_d(fp_int *a, fp_digit b, fp_int *c)
-{
-   fp_word  w;
-   int      x, oldused;
-
-   oldused = c->used;
-   c->used = a->used;
-   c->sign = a->sign;
-   w       = 0;
-   for (x = 0; x < a->used; x++) {
-       w         = ((fp_word)a->dp[x]) * ((fp_word)b) + w;
-       c->dp[x]  = (fp_digit)w;
-       w         = w >> DIGIT_BIT;
-   }
-   if (w != 0 && (a->used != FP_SIZE)) {
-      c->dp[c->used++] = w;
-      ++x;
-   }
-   for (; x < oldused; x++) {
-      c->dp[x] = 0;
-   }
-   fp_clamp(c);
-}
-
-
-/* End: fp_mul_d.c */
-
-/* Start: fp_mulmod.c */
-/* TomsFastMath, a fast ISO C bignum library.
- *
- * This project is meant to fill in where LibTomMath
- * falls short.  That is speed ;-)
- *
- * This project is public domain and free for all purposes.
- *
- * Tom St Denis, tomstdenis@iahu.ca
- */
-#include <tfm.h>
-/* d = a * b (mod c) */
-int fp_mulmod(fp_int *a, fp_int *b, fp_int *c, fp_int *d)
-{
-  fp_int tmp;
-  fp_zero(&tmp);
-  fp_mul(a, b, &tmp);
-  return fp_mod(&tmp, c, d);
-}
-
-/* End: fp_mulmod.c */
-
-/* Start: fp_prime_miller_rabin.c */
-/* TomsFastMath, a fast ISO C bignum library.
- *
- * This project is meant to fill in where LibTomMath
- * falls short.  That is speed ;-)
- *
- * This project is public domain and free for all purposes.
- *
- * Tom St Denis, tomstdenis@iahu.ca
- */
-#include <tfm.h>
-
-/* Miller-Rabin test of "a" to the base of "b" as described in
- * HAC pp. 139 Algorithm 4.24
- *
- * Sets result to 0 if definitely composite or 1 if probably prime.
- * Randomly the chance of error is no more than 1/4 and often
- * very much lower.
- */
-void fp_prime_miller_rabin (fp_int * a, fp_int * b, int *result)
-{
-  fp_int  n1, y, r;
-  int     s, j;
-
-  /* default */
-  *result = FP_NO;
-
-  /* ensure b > 1 */
-  if (fp_cmp_d(b, 1) != FP_GT) {
-     return;
-  }
-
-  /* get n1 = a - 1 */
-  fp_init_copy(&n1, a);
-  fp_sub_d(&n1, 1, &n1);
-
-  /* set 2**s * r = n1 */
-  fp_init_copy(&r, &n1);
-
-  /* count the number of least significant bits
-   * which are zero
-   */
-  s = fp_cnt_lsb(&r);
-
-  /* now divide n - 1 by 2**s */
-  fp_div_2d (&r, s, &r, NULL);
-
-  /* compute y = b**r mod a */
-  fp_init(&y);
-  fp_exptmod(b, &r, a, &y);
-
-  /* if y != 1 and y != n1 do */
-  if (fp_cmp_d (&y, 1) != FP_EQ && fp_cmp (&y, &n1) != FP_EQ) {
-    j = 1;
-    /* while j <= s-1 and y != n1 */
-    while ((j <= (s - 1)) && fp_cmp (&y, &n1) != FP_EQ) {
-      fp_sqrmod (&y, a, &y);
-
-      /* if y == 1 then composite */
-      if (fp_cmp_d (&y, 1) == FP_EQ) {
-         return;
-      }
-      ++j;
-    }
-
-    /* if y != n1 then composite */
-    if (fp_cmp (&y, &n1) != FP_EQ) {
-       return;
-    }
-  }
-
-  /* probably prime now */
-  *result = FP_YES;
-}
-
-/* End: fp_prime_miller_rabin.c */
-
-/* Start: fp_prime_random_ex.c */
-/* TomsFastMath, a fast ISO C bignum library.
- *
- * This project is meant to fill in where LibTomMath
- * falls short.  That is speed ;-)
- *
- * This project is public domain and free for all purposes.
- *
- * Tom St Denis, tomstdenis@iahu.ca
- */
-#include <tfm.h>
-
-/* This is possibly the mother of all prime generation functions, muahahahahaha! */
-int fp_prime_random_ex(fp_int *a, int t, int size, int flags, tfm_prime_callback cb, void *dat)
-{
-   unsigned char *tmp, maskAND, maskOR_msb, maskOR_lsb;
-   int res, err, bsize, maskOR_msb_offset;
-
-   /* sanity check the input */
-   if (size <= 1 || t <= 0) {
-      return FP_VAL;
-   }
-
-   /* TFM_PRIME_SAFE implies TFM_PRIME_BBS */
-   if (flags & TFM_PRIME_SAFE) {
-      flags |= TFM_PRIME_BBS;
-   }
-
-   /* calc the byte size */
-   bsize = (size>>3)+(size&7?1:0);
-
-   /* we need a buffer of bsize bytes */
-   tmp = malloc(bsize);
-   if (tmp == NULL) {
-      return FP_MEM;
-   }
-
-   /* calc the maskAND value for the MSbyte*/
-   maskAND = 0xFF >> (8 - (size & 7));
-
-   /* calc the maskOR_msb */
-   maskOR_msb        = 0;
-   maskOR_msb_offset = (size - 2) >> 3;
-   if (flags & TFM_PRIME_2MSB_ON) {
-      maskOR_msb     |= 1 << ((size - 2) & 7);
-   } else if (flags & TFM_PRIME_2MSB_OFF) {
-      maskAND        &= ~(1 << ((size - 2) & 7));
-   }
-
-   /* get the maskOR_lsb */
-   maskOR_lsb         = 1;
-   if (flags & TFM_PRIME_BBS) {
-      maskOR_lsb     |= 3;
-   }
-
-   do {
-      /* read the bytes */
-      if (cb(tmp, bsize, dat) != bsize) {
-         err = FP_VAL;
-         goto error;
-      }
-
-      /* work over the MSbyte */
-      tmp[0]    &= maskAND;
-      tmp[0]    |= 1 << ((size - 1) & 7);
-
-      /* mix in the maskORs */
-      tmp[maskOR_msb_offset]   |= maskOR_msb;
-      tmp[bsize-1]             |= maskOR_lsb;
-
-      /* read it in */
-      fp_read_unsigned_bin(a, tmp, bsize);
-
-      /* is it prime? */
-      res = fp_isprime(a);
-      if (res == FP_NO) continue;
-
-      if (flags & TFM_PRIME_SAFE) {
-         /* see if (a-1)/2 is prime */
-         fp_sub_d(a, 1, a);
-         fp_div_2(a, a);
-
-         /* is it prime? */
-         res = fp_isprime(a);
-      }
-   } while (res == FP_NO);
-
-   if (flags & TFM_PRIME_SAFE) {
-      /* restore a to the original value */
-      fp_mul_2(a, a);
-      fp_add_d(a, 1, a);
-   }
-
-   err = FP_OKAY;
-error:
-   free(tmp);
-   return err;
-}
-
-/* End: fp_prime_random_ex.c */
-
-/* Start: fp_radix_size.c */
-/* TomsFastMath, a fast ISO C bignum library.
- *
- * This project is meant to fill in where LibTomMath
- * falls short.  That is speed ;-)
- *
- * This project is public domain and free for all purposes.
- *
- * Tom St Denis, tomstdenis@iahu.ca
- */
-#include <tfm.h>
-
-int fp_radix_size(fp_int *a, int radix, int *size)
-{
-  int     digs;
-  fp_int  t;
-  fp_digit d;
-
-  *size = 0;
-
-  /* check range of the radix */
-  if (radix < 2 || radix > 64) {
-    return FP_VAL;
-  }
-
-  /* quick out if its zero */
-  if (fp_iszero(a) == 1) {
-     *size = 2;
-     return FP_OKAY;
-  }
-
-  fp_init_copy(&t, a);
-
-  /* if it is negative output a - */
-  if (t.sign == FP_NEG) {
-    *size++;
-    t.sign = FP_ZPOS;
-  }
-
-  digs = 0;
-  while (fp_iszero (&t) == FP_NO) {
-    fp_div_d (&t, (fp_digit) radix, &t, &d);
-    *size++;
-  }
-
-  /* append a NULL so the string is properly terminated */
-  *size++;
-  return FP_OKAY;
-
-}
-
-/* End: fp_radix_size.c */
-
-/* Start: fp_read_radix.c */
-/* TomsFastMath, a fast ISO C bignum library.
- *
- * This project is meant to fill in where LibTomMath
- * falls short.  That is speed ;-)
- *
- * This project is public domain and free for all purposes.
- *
- * Tom St Denis, tomstdenis@iahu.ca
- */
-#include <tfm.h>
-
-int fp_read_radix(fp_int *a, char *str, int radix)
-{
-  int     y, neg;
-  char    ch;
-
-  /* make sure the radix is ok */
-  if (radix < 2 || radix > 64) {
-    return FP_VAL;
-  }
-
-  /* if the leading digit is a
-   * minus set the sign to negative.
-   */
-  if (*str == '-') {
-    ++str;
-    neg = FP_NEG;
-  } else {
-    neg = FP_ZPOS;
-  }
-
-  /* set the integer to the default of zero */
-  fp_zero (a);
-
-  /* process each digit of the string */
-  while (*str) {
-    /* if the radix < 36 the conversion is case insensitive
-     * this allows numbers like 1AB and 1ab to represent the same  value
-     * [e.g. in hex]
-     */
-    ch = (char) ((radix < 36) ? toupper (*str) : *str);
-    for (y = 0; y < 64; y++) {
-      if (ch == fp_s_rmap[y]) {
-         break;
-      }
-    }
-
-    /* if the char was found in the map
-     * and is less than the given radix add it
-     * to the number, otherwise exit the loop.
-     */
-    if (y < radix) {
-      fp_mul_d (a, (fp_digit) radix, a);
-      fp_add_d (a, (fp_digit) y, a);
-    } else {
-      break;
-    }
-    ++str;
-  }
-
-  /* set the sign only if a != 0 */
-  if (fp_iszero(a) != FP_YES) {
-     a->sign = neg;
-  }
-  return FP_OKAY;
-}
-
-/* End: fp_read_radix.c */
-
-/* Start: fp_read_signed_bin.c */
-/* TomsFastMath, a fast ISO C bignum library.
- *
- * This project is meant to fill in where LibTomMath
- * falls short.  That is speed ;-)
- *
- * This project is public domain and free for all purposes.
- *
- * Tom St Denis, tomstdenis@iahu.ca
- */
-#include <tfm.h>
-
-void fp_read_signed_bin(fp_int *a, unsigned char *b, int c)
-{
-  /* read magnitude */
-  fp_read_unsigned_bin (a, b + 1, c - 1);
-
-  /* first byte is 0 for positive, non-zero for negative */
-  if (b[0] == 0) {
-     a->sign = FP_ZPOS;
-  } else {
-     a->sign = FP_NEG;
-  }
-}
-
-/* End: fp_read_signed_bin.c */
-
-/* Start: fp_read_unsigned_bin.c */
-/* TomsFastMath, a fast ISO C bignum library.
- *
- * This project is meant to fill in where LibTomMath
- * falls short.  That is speed ;-)
- *
- * This project is public domain and free for all purposes.
- *
- * Tom St Denis, tomstdenis@iahu.ca
- */
-#include <tfm.h>
-
-void fp_read_unsigned_bin(fp_int *a, unsigned char *b, int c)
-{
-  /* zero the int */
-  fp_zero (a);
-
-  /* read the bytes in */
-  for (; c > 0; c--) {
-    fp_mul_2d (a, 8, a);
-    a->dp[0] |= *b++;
-    a->used += 1;
-  }
-  fp_clamp (a);
-}
-
-/* End: fp_read_unsigned_bin.c */
-
-/* Start: fp_reverse.c */
-/* TomsFastMath, a fast ISO C bignum library.
- *
- * This project is meant to fill in where LibTomMath
- * falls short.  That is speed ;-)
- *
- * This project is public domain and free for all purposes.
- *
- * Tom St Denis, tomstdenis@iahu.ca
- */
-#include <tfm.h>
-
-/* reverse an array, used for radix code */
-void bn_reverse (unsigned char *s, int len)
-{
-  int     ix, iy;
-  unsigned char t;
-
-  ix = 0;
-  iy = len - 1;
-  while (ix < iy) {
-    t     = s[ix];
-    s[ix] = s[iy];
-    s[iy] = t;
-    ++ix;
-    --iy;
-  }
-}
-
-/* End: fp_reverse.c */
-
-/* Start: fp_rshd.c */
-/* TomsFastMath, a fast ISO C bignum library.
- *
- * This project is meant to fill in where LibTomMath
- * falls short.  That is speed ;-)
- *
- * This project is public domain and free for all purposes.
- *
- * Tom St Denis, tomstdenis@iahu.ca
- */
-#include <tfm.h>
-
-void fp_rshd(fp_int *a, int x)
-{
-  int y;
-
-  /* too many digits just zero and return */
-  if (x >= a->used) {
-     fp_zero(a);
-     return;
-  }
-
-   /* shift */
-   for (y = 0; y < a->used - x; y++) {
-      a->dp[y] = a->dp[y+x];
-   }
-
-   /* zero rest */
-   for (; y < a->used; y++) {
-      a->dp[y] = 0;
-   }
-
-   /* decrement count */
-   a->used -= x;
-   fp_clamp(a);
-}
-
-
-/* End: fp_rshd.c */
-
-/* Start: fp_s_rmap.c */
-/* TomsFastMath, a fast ISO C bignum library.
- *
- * This project is meant to fill in where LibTomMath
- * falls short.  That is speed ;-)
- *
- * This project is public domain and free for all purposes.
- *
- * Tom St Denis, tomstdenis@iahu.ca
- */
-#include <tfm.h>
-
-/* chars used in radix conversions */
-const char *fp_s_rmap = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz+/";
-
-/* End: fp_s_rmap.c */
-
-/* Start: fp_set.c */
-/* TomsFastMath, a fast ISO C bignum library.
- *
- * This project is meant to fill in where LibTomMath
- * falls short.  That is speed ;-)
- *
- * This project is public domain and free for all purposes.
- *
- * Tom St Denis, tomstdenis@iahu.ca
- */
-#include <tfm.h>
-
-void fp_set(fp_int *a, fp_digit b)
-{
-   fp_zero(a);
-   a->dp[0] = b;
-   a->used  = b ? 1 : 0;
-}
-
-/* End: fp_set.c */
-
-/* Start: fp_signed_bin_size.c */
-/* TomsFastMath, a fast ISO C bignum library.
- *
- * This project is meant to fill in where LibTomMath
- * falls short.  That is speed ;-)
- *
- * This project is public domain and free for all purposes.
- *
- * Tom St Denis, tomstdenis@iahu.ca
- */
-#include <tfm.h>
-
-int fp_signed_bin_size(fp_int *a)
-{
-  return 1 + fp_unsigned_bin_size (a);
-}
-
-/* End: fp_signed_bin_size.c */
-
-/* Start: fp_sqr.c */
-/* TomsFastMath, a fast ISO C bignum library.
- *
- * This project is meant to fill in where LibTomMath
- * falls short.  That is speed ;-)
- *
- * This project is public domain and free for all purposes.
- *
- * Tom St Denis, tomstdenis@iahu.ca
- */
-#include <tfm.h>
-
-/* b = a*a  */
-void fp_sqr(fp_int *A, fp_int *B)
-{
-    int    r, y, s;
-    fp_int aa, bb, comp, amb, t1;
-
-    y = A->used;
-    if (y <= 64) {
-        if (y <= 4) {
-           fp_sqr_comba4(A,B);
-        } else if (y <= 8) {
-           fp_sqr_comba8(A,B);
-#if defined(TFM_LARGE)
-        } else if (y <= 16 && y >= 12) {
-           fp_sqr_comba16(A,B);
-#endif
-#if defined(TFM_HUGE)
-        } else if (y <= 32 && y >= 20) {
-           fp_sqr_comba32(A,B);
-        } else if (y <= 64 && y >= 48) {
-           fp_sqr_comba64(A,B);
-#endif
-        } else {
-           fp_sqr_comba(A, B);
-        }
-
-    } else {
-        /* do the karatsuba action
-
-           if A = ab ||a|| = r we need to solve
-
-           a^2*r^2 + (-(a-b)^2 + a^2 + b^2)*r + b^2
-
-           So we solve for the three products then we form the final result with careful shifting
-           and addition.
-
-Obvious points of optimization
-
-- "ac" parts can be memcpy'ed with an offset [all you have to do is zero upto the next 8 digits]
-- Similarly the "bd" parts can be memcpy'ed and zeroed to 8
--
-
-        */
-        /* get our value of r */
-        r = y >> 1;
-
-        /* now solve for ac */
-//        fp_copy(A, &t1); fp_rshd(&t1, r);
-        for (s = 0; s < A->used - r; s++) {
-            t1.dp[s] = A->dp[s+r];
-        }
-        for (; s < FP_SIZE; s++) {
-            t1.dp[s] = 0;
-        }
-        if (A->used >= r) {
-           t1.used = A->used - r;
-        } else {
-           t1.used = 0;
-        }
-        t1.sign = A->sign;
-        fp_copy(&t1, &amb);
-        fp_zero(&aa);
-        fp_sqr(&t1, &aa);
-
-        /* now solve for bd */
-//        fp_mod_2d(A, r * DIGIT_BIT, &t1);
-        for (s = 0; s < r; s++) {
-            t1.dp[s] = A->dp[s];
-        }
-        for (; s < FP_SIZE; s++) {
-            t1.dp[s]   = 0;
-        }
-        t1.used = r;
-        fp_clamp(&t1);
-
-        fp_sub(&amb, &t1, &amb);
-        fp_zero(&bb);
-        fp_sqr(&t1, &bb);
-
-        /* now get the (a-b) term */
-        fp_zero(&comp);
-        fp_sqr(&amb, &comp);
-
-        /* now solve the system, do the middle term first */
-        comp.sign ^= 1;
-        fp_add(&comp, &aa, &comp);
-        fp_add(&comp, &bb, &comp);
-        fp_lshd(&comp, r);
-
-        /* leading term */
-        fp_lshd(&aa, r+r);
-
-        /* now sum them together */
-        fp_zero(B);
-        fp_add(&aa, &comp, B);
-        fp_add(&bb, B, B);
-        B->sign = FP_ZPOS;
-    }
-}
-
-
-/* End: fp_sqr.c */
-
-/* Start: fp_sqr_comba.c */
-/* TomsFastMath, a fast ISO C bignum library.
- *
- * This project is meant to fill in where LibTomMath
- * falls short.  That is speed ;-)
- *
- * This project is public domain and free for all purposes.
- *
- * Tom St Denis, tomstdenis@iahu.ca
- */
-#include <tfm.h>
-
-/* About this file...
-*/
-
-#if defined(TFM_X86)
-
-/* x86-32 optimized */
-
-#define COMBA_START
-
-#define CLEAR_CARRY \
-   c0 = c1 = c2 = 0;
-
-#define COMBA_STORE(x) \
-   x = c0;
-
-#define COMBA_STORE2(x) \
-   x = c1;
-
-#define CARRY_FORWARD \
-   do { c0 = c1; c1 = c2; c2 = 0; } while (0);
-
-#define COMBA_FINI
-
-#define SQRADD(i, j)                                      \
-asm volatile (                                            \
-     "movl  %6,%%eax     \n\t"                            \
-     "mull  %%eax        \n\t"                            \
-     "addl  %%eax,%0     \n\t"                            \
-     "adcl  %%edx,%1     \n\t"                            \
-     "adcl  $0,%2        \n\t"                            \
-     :"=r"(c0), "=r"(c1), "=r"(c2): "0"(c0), "1"(c1), "2"(c2), "m"(i) :"%eax","%edx","%cc");
-
-#define SQRADD2(i, j)                                     \
-asm volatile (                                            \
-     "movl  %6,%%eax     \n\t"                            \
-     "mull  %7           \n\t"                            \
-     "addl  %%eax,%0     \n\t"                            \
-     "adcl  %%edx,%1     \n\t"                            \
-     "adcl  $0,%2        \n\t"                            \
-     "addl  %%eax,%0     \n\t"                            \
-     "adcl  %%edx,%1     \n\t"                            \
-     "adcl  $0,%2        \n\t"                            \
-     :"=r"(c0), "=r"(c1), "=r"(c2): "0"(c0), "1"(c1), "2"(c2), "m"(i), "m"(j)  :"%eax","%edx","%cc");
-
-#define SQRADDSC(i, j)                                    \
-asm (                                                     \
-     "movl  %6,%%eax     \n\t"                            \
-     "mull  %7           \n\t"                            \
-     "movl  %%eax,%0     \n\t"                            \
-     "movl  %%edx,%1     \n\t"                            \
-     "xorl  %2,%2        \n\t"                            \
-     :"=r"(sc0), "=r"(sc1), "=r"(sc2): "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) :"%eax","%edx","%cc");
-
-#define SQRADDAC(i, j)                                    \
-asm (                                                     \
-     "movl  %6,%%eax     \n\t"                            \
-     "mull  %7           \n\t"                            \
-     "addl  %%eax,%0     \n\t"                            \
-     "adcl  %%edx,%1     \n\t"                            \
-     "adcl  $0,%2        \n\t"                            \
-     :"=r"(sc0), "=r"(sc1), "=r"(sc2): "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) :"%eax","%edx","%cc");
-
-#define SQRADDDB                                          \
-asm (                                                     \
-     "addl %3,%0         \n\t"                            \
-     "adcl %4,%1         \n\t"                            \
-     "adcl %5,%2         \n\t"                            \
-     "addl %3,%0         \n\t"                            \
-     "adcl %4,%1         \n\t"                            \
-     "adcl %5,%2         \n\t"                            \
-     :"=r"(c0), "=r"(c1), "=r"(c2), "=g"(sc0), "=g"(sc1), "=g"(sc2) : "0"(c0), "1"(c1), "2"(c2), "3"(sc0), "4"(sc1), "5"(sc2) : "%cc");
-
-#elif defined(TFM_X86_64)
-/* x86-64 optimized */
-
-#define COMBA_START
-
-#define CLEAR_CARRY \
-   c0 = c1 = c2 = 0;
-
-#define COMBA_STORE(x) \
-   x = c0;
-
-#define COMBA_STORE2(x) \
-   x = c1;
-
-#define CARRY_FORWARD \
-   do { c0 = c1; c1 = c2; c2 = 0; } while (0);
-
-#define COMBA_FINI
-
-#define SQRADD(i, j)                                      \
-asm (                                                     \
-     "movq  %6,%%rax     \n\t"                            \
-     "mulq  %%rax        \n\t"                            \
-     "addq  %%rax,%0     \n\t"                            \
-     "adcq  %%rdx,%1     \n\t"                            \
-     "adcq  $0,%2        \n\t"                            \
-     :"=r"(c0), "=r"(c1), "=r"(c2): "0"(c0), "1"(c1), "2"(c2), "g"(i) :"%rax","%rdx","%cc");
-
-#define SQRADD2(i, j)                                     \
-asm (                                                     \
-     "movq  %6,%%rax     \n\t"                            \
-     "mulq  %7           \n\t"                            \
-     "addq  %%rax,%0     \n\t"                            \
-     "adcq  %%rdx,%1     \n\t"                            \
-     "adcq  $0,%2        \n\t"                            \
-     "addq  %%rax,%0     \n\t"                            \
-     "adcq  %%rdx,%1     \n\t"                            \
-     "adcq  $0,%2        \n\t"                            \
-     :"=r"(c0), "=r"(c1), "=r"(c2): "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j)  :"%rax","%rdx","%cc");
-
-#define SQRADDSC(i, j)                                    \
-asm (                                                     \
-     "movq  %6,%%rax     \n\t"                            \
-     "mulq  %7           \n\t"                            \
-     "movq  %%rax,%0     \n\t"                            \
-     "movq  %%rdx,%1     \n\t"                            \
-     "xorq  %2,%2        \n\t"                            \
-     :"=r"(sc0), "=r"(sc1), "=r"(sc2): "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) :"%rax","%rdx","%cc");
-
-#define SQRADDAC(i, j)                                                         \
-asm (                                                     \
-     "movq  %6,%%rax     \n\t"                            \
-     "mulq  %7           \n\t"                            \
-     "addq  %%rax,%0     \n\t"                            \
-     "adcq  %%rdx,%1     \n\t"                            \
-     "adcq  $0,%2        \n\t"                            \
-     :"=r"(sc0), "=r"(sc1), "=r"(sc2): "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) :"%rax","%rdx","%cc");
-
-#define SQRADDDB                                                               \
-asm (                                                     \
-     "addq %3,%0         \n\t"                            \
-     "adcq %4,%1         \n\t"                            \
-     "adcq %5,%2         \n\t"                            \
-     "addq %3,%0         \n\t"                            \
-     "adcq %4,%1         \n\t"                            \
-     "adcq %5,%2         \n\t"                            \
-     :"=r"(c0), "=r"(c1), "=r"(c2), "=r"(sc0), "=r"(sc1), "=r"(sc2) : "0"(c0), "1"(c1), "2"(c2), "3"(sc0), "4"(sc1), "5"(sc2) : "%cc");
-
-#elif defined(TFM_SSE2)
-
-/* SSE2 Optimized */
-#define COMBA_START
-
-#define CLEAR_CARRY \
-   c0 = c1 = c2 = 0;
-
-#define COMBA_STORE(x) \
-   x = c0;
-
-#define COMBA_STORE2(x) \
-   x = c1;
-
-#define CARRY_FORWARD \
-   do { c0 = c1; c1 = c2; c2 = 0; } while (0);
-
-#define COMBA_FINI \
-   asm("emms");
-
-#define SQRADD(i, j)                                      \
-asm volatile (                                            \
-     "movd  %6,%%mm0     \n\t"                            \
-     "pmuludq %%mm0,%%mm0\n\t"                            \
-     "movd  %%mm0,%%eax  \n\t"                            \
-     "psrlq $32,%%mm0    \n\t"                            \
-     "addl  %%eax,%0     \n\t"                            \
-     "movd  %%mm0,%%eax  \n\t"                            \
-     "adcl  %%eax,%1     \n\t"                            \
-     "adcl  $0,%2        \n\t"                            \
-     :"=r"(c0), "=r"(c1), "=r"(c2): "0"(c0), "1"(c1), "2"(c2), "m"(i) :"%eax","%cc");
-
-#define SQRADD2(i, j)                                     \
-asm volatile (                                            \
-     "movd  %6,%%mm0     \n\t"                            \
-     "movd  %7,%%mm1     \n\t"                            \
-     "pmuludq %%mm1,%%mm0\n\t"                            \
-     "movd  %%mm0,%%eax  \n\t"                            \
-     "psrlq $32,%%mm0    \n\t"                            \
-     "movd  %%mm0,%%edx  \n\t"                            \
-     "addl  %%eax,%0     \n\t"                            \
-     "adcl  %%edx,%1     \n\t"                            \
-     "adcl  $0,%2        \n\t"                            \
-     "addl  %%eax,%0     \n\t"                            \
-     "adcl  %%edx,%1     \n\t"                            \
-     "adcl  $0,%2        \n\t"                            \
-     :"=r"(c0), "=r"(c1), "=r"(c2): "0"(c0), "1"(c1), "2"(c2), "m"(i), "m"(j)  :"%eax","%edx","%cc");
-
-#define SQRADDSC(i, j)                                                         \
-asm volatile (                                            \
-     "movd  %6,%%mm0     \n\t"                            \
-     "pmuludq %%mm0,%%mm0\n\t"                            \
-     "movd  %%mm0,%%eax  \n\t"                            \
-     "psrlq $32,%%mm0    \n\t"                            \
-     "movl  %%eax,%0     \n\t"                            \
-     "movd  %%mm0,%%eax  \n\t"                            \
-     "movl  %%eax,%1     \n\t"                            \
-     "xorl  %2,%2        \n\t"                            \
-     :"=r"(sc0), "=r"(sc1), "=r"(sc2): "0"(sc0), "1"(sc1), "2"(sc2), "m"(i) :"%eax","%cc");
-
-#define SQRADDAC(i, j)                                                         \
-asm volatile (                                            \
-     "movd  %6,%%mm0     \n\t"                            \
-     "movd  %7,%%mm1     \n\t"                            \
-     "pmuludq %%mm1,%%mm0\n\t"                            \
-     "movd  %%mm0,%%eax  \n\t"                            \
-     "psrlq $32,%%mm0    \n\t"                            \
-     "movd  %%mm0,%%edx  \n\t"                            \
-     "addl  %%eax,%0     \n\t"                            \
-     "adcl  %%edx,%1     \n\t"                            \
-     "adcl  $0,%2        \n\t"                            \
-     "addl  %%eax,%0     \n\t"                            \
-     "adcl  %%edx,%1     \n\t"                            \
-     "adcl  $0,%2        \n\t"                            \
-     :"=r"(sc0), "=r"(sc1), "=r"(sc2): "0"(sc0), "1"(sc1), "2"(sc2), "m"(i), "m"(j)  :"%eax","%edx","%cc");
-
-#define SQRADDDB                                                               \
-asm (                                                     \
-     "addl %3,%0         \n\t"                            \
-     "adcl %4,%1         \n\t"                            \
-     "adcl %5,%2         \n\t"                            \
-     "addl %3,%0         \n\t"                            \
-     "adcl %4,%1         \n\t"                            \
-     "adcl %5,%2         \n\t"                            \
-     :"=r"(c0), "=r"(c1), "=r"(c2), "=g"(sc0), "=g"(sc1), "=g"(sc2) : "0"(c0), "1"(c1), "2"(c2), "3"(sc0), "4"(sc1), "5"(sc2) : "%cc");
-
-#elif defined(TFM_ARM)
-
-/* ARM code */
-
-#define COMBA_START
-
-#define CLEAR_CARRY \
-   c0 = c1 = c2 = 0;
-
-#define COMBA_STORE(x) \
-   x = c0;
-
-#define COMBA_STORE2(x) \
-   x = c1;
-
-#define CARRY_FORWARD \
-   do { c0 = c1; c1 = c2; c2 = 0; } while (0);
-
-#define COMBA_FINI
-
-/* multiplies point i and j, updates carry "c1" and digit c2 */
-#define SQRADD(i, j)                                             \
-asm(                                                             \
-"  UMULL  r0,r1,%6,%6              \n\t"                         \
-"  ADDS   %0,%0,r0                 \n\t"                         \
-"  ADCS   %1,%1,r1                 \n\t"                         \
-"  ADC    %2,%2,#0                 \n\t"                         \
-:"=r"(c0), "=r"(c1), "=r"(c2) : "0"(c0), "1"(c1), "2"(c2), "r"(i) : "r0", "r1", "%cc");
-
-/* for squaring some of the terms are doubled... */
-#define SQRADD2(i, j)                                            \
-asm(                                                             \
-"  UMULL  r0,r1,%6,%7              \n\t"                         \
-"  ADDS   %0,%0,r0                 \n\t"                         \
-"  ADCS   %1,%1,r1                 \n\t"                         \
-"  ADC    %2,%2,#0                 \n\t"                         \
-"  ADDS   %0,%0,r0                 \n\t"                         \
-"  ADCS   %1,%1,r1                 \n\t"                         \
-"  ADC    %2,%2,#0                 \n\t"                         \
-:"=r"(c0), "=r"(c1), "=r"(c2) : "0"(c0), "1"(c1), "2"(c2), "r"(i), "r"(j) : "r0", "r1", "%cc");
-
-#define SQRADDSC(i, j)                                           \
-asm(                                                             \
-"  UMULL  %0,%1,%6,%7              \n\t"                         \
-"  SUB    %2,%2,%2                 \n\t"                         \
-:"=r"(sc0), "=r"(sc1), "=r"(sc2) : "0"(sc0), "1"(sc1), "2"(sc2), "r"(i), "r"(j) : "%cc");
-
-#define SQRADDAC(i, j)                                           \
-asm(                                                             \
-"  UMULL  r0,r1,%6,%7              \n\t"                         \
-"  ADDS   %0,%0,r0                 \n\t"                         \
-"  ADCS   %1,%1,r1                 \n\t"                         \
-"  ADC    %2,%2,#0                 \n\t"                         \
-:"=r"(sc0), "=r"(sc1), "=r"(sc2) : "0"(sc0), "1"(sc1), "2"(sc2), "r"(i), "r"(j) : "r0", "r1", "%cc");
-
-#define SQRADDDB                                                 \
-asm(                                                             \
-"  ADDS  %3,%0                     \n\t"                         \
-"  ADCS  %4,%1                     \n\t"                         \
-"  ADC   %5,%2                     \n\t"                         \
-"  ADDS  %3,%0                     \n\t"                         \
-"  ADCS  %4,%1                     \n\t"                         \
-"  ADC   %5,%2                     \n\t"                         \
-:"=r"(sc0), "=r"(sc1), "=r"(sc2), "=r"(c0), "=r"(c1), "=r"(c2) : "0"(sc0), "1"(sc1), "2"(sc2), "3"(c0), "4"(c1), "5"(c2) : "%cc");
-
-#else
-
-/* ISO C portable code */
-
-#define COMBA_START \
-   { fp_word tt;
-
-#define CLEAR_CARRY \
-   c0 = c1 = c2 = 0;
-
-#define COMBA_STORE(x) \
-   x = c0;
-
-#define COMBA_STORE2(x) \
-   x = c1;
-
-#define CARRY_FORWARD \
-   do { c0 = c1; c1 = c2; c2 = 0; } while (0);
-
-#define COMBA_FINI \
-   }
-
-/* multiplies point i and j, updates carry "c1" and digit c2 */
-#define SQRADD(i, j)                                 \
-   do { fp_word t;                                   \
-   t = c0 + ((fp_word)i) * ((fp_word)j);  c0 = t;    \
-   t = c1 + (t >> DIGIT_BIT);             c1 = t; c2 += t >> DIGIT_BIT; \
-   } while (0);
-
-
-/* for squaring some of the terms are doubled... */
-#define SQRADD2(i, j)                                                 \
-   do { fp_word t;                                                    \
-   t  = ((fp_word)i) * ((fp_word)j);                                  \
-   tt = (fp_word)c0 + t;                 c0 = tt;                              \
-   tt = (fp_word)c1 + (tt >> DIGIT_BIT); c1 = tt; c2 += tt >> DIGIT_BIT;       \
-   tt = (fp_word)c0 + t;                 c0 = tt;                              \
-   tt = (fp_word)c1 + (tt >> DIGIT_BIT); c1 = tt; c2 += tt >> DIGIT_BIT;       \
-   } while (0);
-
-#define SQRADDSC(i, j)                                                         \
-   do { fp_word t;                                                             \
-      t =  ((fp_word)i) * ((fp_word)j);                                        \
-      sc0 = (fp_digit)t; sc1 = (t >> DIGIT_BIT); sc2 = 0;                      \
-   } while (0);
-
-#define SQRADDAC(i, j)                                                         \
-   do { fp_word t;                                                             \
-   t = sc0 + ((fp_word)i) * ((fp_word)j);  sc0 = t;                            \
-   t = sc1 + (t >> DIGIT_BIT);             sc1 = t; sc2 += t >> DIGIT_BIT;     \
-   } while (0);
-
-#define SQRADDDB                                                               \
-   do { fp_word t;                                                             \
-   t = ((fp_word)sc0) + ((fp_word)sc0) + c0; c0 = t;                                                 \
-   t = ((fp_word)sc1) + ((fp_word)sc1) + c1 + (t >> DIGIT_BIT); c1 = t;                              \
-   c2 = c2 + ((fp_word)sc2) + ((fp_word)sc2) + (t >> DIGIT_BIT);                                     \
-   } while (0);
-
-#endif
-
-#include "fp_sqr_comba_generic.c"
-void fp_sqr_comba4(fp_int *A, fp_int *B)
-{
-   fp_digit *a, b[8], c0, c1, c2, sc0, sc1, sc2;
-
-   a = A->dp;
-   COMBA_START;
-
-   /* clear carries */
-   CLEAR_CARRY;
-
-   /* output 0 */
-   SQRADD(a[0],a[0]);
-   COMBA_STORE(b[0]);
-
-   /* output 1 */
-   CARRY_FORWARD;
-   SQRADD2(a[0], a[1]);
-   COMBA_STORE(b[1]);
-
-   /* output 2 */
-   CARRY_FORWARD;
-   SQRADD2(a[0], a[2]); SQRADD(a[1], a[1]);
-   COMBA_STORE(b[2]);
-
-   /* output 3 */
-   CARRY_FORWARD;
-   SQRADD2(a[0], a[3]); SQRADD2(a[1], a[2]);
-   COMBA_STORE(b[3]);
-
-   /* output 4 */
-   CARRY_FORWARD;
-   SQRADD2(a[1], a[3]); SQRADD(a[2], a[2]);
-   COMBA_STORE(b[4]);
-
-   /* output 5 */
-   CARRY_FORWARD;
-   SQRADD2(a[2], a[3]);
-   COMBA_STORE(b[5]);
-
-   /* output 6 */
-   CARRY_FORWARD;
-   SQRADD(a[3], a[3]);
-   COMBA_STORE(b[6]);
-   COMBA_STORE2(b[7]);
-   COMBA_FINI;
-
-   B->used = 8;
-   B->sign = FP_ZPOS;
-   memcpy(B->dp, b, 8 * sizeof(fp_digit));
-   fp_clamp(B);
-}
-
-
-void fp_sqr_comba8(fp_int *A, fp_int *B)
-{
-   fp_digit *a, b[16], c0, c1, c2, sc0, sc1, sc2;
-
-   a = A->dp;
-   COMBA_START;
-
-   /* clear carries */
-   CLEAR_CARRY;
-
-   /* output 0 */
-   SQRADD(a[0],a[0]);
-   COMBA_STORE(b[0]);
-
-   /* output 1 */
-   CARRY_FORWARD;
-   SQRADD2(a[0], a[1]);
-   COMBA_STORE(b[1]);
-
-   /* output 2 */
-   CARRY_FORWARD;
-   SQRADD2(a[0], a[2]); SQRADD(a[1], a[1]);
-   COMBA_STORE(b[2]);
-
-   /* output 3 */
-   CARRY_FORWARD;
-   SQRADD2(a[0], a[3]); SQRADD2(a[1], a[2]);
-   COMBA_STORE(b[3]);
-
-   /* output 4 */
-   CARRY_FORWARD;
-   SQRADD2(a[0], a[4]); SQRADD2(a[1], a[3]); SQRADD(a[2], a[2]);
-   COMBA_STORE(b[4]);
-
-   /* output 5 */
-   CARRY_FORWARD;
-   SQRADDSC(a[0], a[5]); SQRADDAC(a[1], a[4]); SQRADDAC(a[2], a[3]); SQRADDDB;
-   COMBA_STORE(b[5]);
-
-   /* output 6 */
-   CARRY_FORWARD;
-   SQRADDSC(a[0], a[6]); SQRADDAC(a[1], a[5]); SQRADDAC(a[2], a[4]); SQRADDDB; SQRADD(a[3], a[3]);
-   COMBA_STORE(b[6]);
-
-   /* output 7 */
-   CARRY_FORWARD;
-   SQRADDSC(a[0], a[7]); SQRADDAC(a[1], a[6]); SQRADDAC(a[2], a[5]); SQRADDAC(a[3], a[4]); SQRADDDB;
-   COMBA_STORE(b[7]);
-
-   /* output 8 */
-   CARRY_FORWARD;
-   SQRADDSC(a[1], a[7]); SQRADDAC(a[2], a[6]); SQRADDAC(a[3], a[5]); SQRADDDB; SQRADD(a[4], a[4]);
-   COMBA_STORE(b[8]);
-
-   /* output 9 */
-   CARRY_FORWARD;
-   SQRADDSC(a[2], a[7]); SQRADDAC(a[3], a[6]); SQRADDAC(a[4], a[5]); SQRADDDB;
-   COMBA_STORE(b[9]);
-
-   /* output 10 */
-   CARRY_FORWARD;
-   SQRADD2(a[3], a[7]); SQRADD2(a[4], a[6]); SQRADD(a[5], a[5]);
-   COMBA_STORE(b[10]);
-
-   /* output 11 */
-   CARRY_FORWARD;
-   SQRADD2(a[4], a[7]); SQRADD2(a[5], a[6]);
-   COMBA_STORE(b[11]);
-
-   /* output 12 */
-   CARRY_FORWARD;
-   SQRADD2(a[5], a[7]); SQRADD(a[6], a[6]);
-   COMBA_STORE(b[12]);
-
-   /* output 13 */
-   CARRY_FORWARD;
-   SQRADD2(a[6], a[7]);
-   COMBA_STORE(b[13]);
-
-   /* output 14 */
-   CARRY_FORWARD;
-   SQRADD(a[7], a[7]);
-   COMBA_STORE(b[14]);
-   COMBA_STORE2(b[15]);
-   COMBA_FINI;
-
-   B->used = 16;
-   B->sign = FP_ZPOS;
-   memcpy(B->dp, b, 16 * sizeof(fp_digit));
-   fp_clamp(B);
-}
-
-
-#ifdef TFM_LARGE
-void fp_sqr_comba16(fp_int *A, fp_int *B)
-{
-   fp_digit *a, b[32], c0, c1, c2, sc0, sc1, sc2;
-
-   a = A->dp;
-   COMBA_START;
-
-   /* clear carries */
-   CLEAR_CARRY;
-
-   /* output 0 */
-   SQRADD(a[0],a[0]);
-   COMBA_STORE(b[0]);
-
-   /* output 1 */
-   CARRY_FORWARD;
-   SQRADD2(a[0], a[1]);
-   COMBA_STORE(b[1]);
-
-   /* output 2 */
-   CARRY_FORWARD;
-   SQRADD2(a[0], a[2]); SQRADD(a[1], a[1]);
-   COMBA_STORE(b[2]);
-
-   /* output 3 */
-   CARRY_FORWARD;
-   SQRADD2(a[0], a[3]); SQRADD2(a[1], a[2]);
-   COMBA_STORE(b[3]);
-
-   /* output 4 */
-   CARRY_FORWARD;
-   SQRADD2(a[0], a[4]); SQRADD2(a[1], a[3]); SQRADD(a[2], a[2]);
-   COMBA_STORE(b[4]);
-
-   /* output 5 */
-   CARRY_FORWARD;
-   SQRADDSC(a[0], a[5]); SQRADDAC(a[1], a[4]); SQRADDAC(a[2], a[3]); SQRADDDB;
-   COMBA_STORE(b[5]);
-
-   /* output 6 */
-   CARRY_FORWARD;
-   SQRADDSC(a[0], a[6]); SQRADDAC(a[1], a[5]); SQRADDAC(a[2], a[4]); SQRADDDB; SQRADD(a[3], a[3]);
-   COMBA_STORE(b[6]);
-
-   /* output 7 */
-   CARRY_FORWARD;
-   SQRADDSC(a[0], a[7]); SQRADDAC(a[1], a[6]); SQRADDAC(a[2], a[5]); SQRADDAC(a[3], a[4]); SQRADDDB;
-   COMBA_STORE(b[7]);
-
-   /* output 8 */
-   CARRY_FORWARD;
-   SQRADDSC(a[0], a[8]); SQRADDAC(a[1], a[7]); SQRADDAC(a[2], a[6]); SQRADDAC(a[3], a[5]); SQRADDDB; SQRADD(a[4], a[4]);
-   COMBA_STORE(b[8]);
-
-   /* output 9 */
-   CARRY_FORWARD;
-   SQRADDSC(a[0], a[9]); SQRADDAC(a[1], a[8]); SQRADDAC(a[2], a[7]); SQRADDAC(a[3], a[6]); SQRADDAC(a[4], a[5]); SQRADDDB;
-   COMBA_STORE(b[9]);
-
-   /* output 10 */
-   CARRY_FORWARD;
-   SQRADDSC(a[0], a[10]); SQRADDAC(a[1], a[9]); SQRADDAC(a[2], a[8]); SQRADDAC(a[3], a[7]); SQRADDAC(a[4], a[6]); SQRADDDB; SQRADD(a[5], a[5]);
-   COMBA_STORE(b[10]);
-
-   /* output 11 */
-   CARRY_FORWARD;
-   SQRADDSC(a[0], a[11]); SQRADDAC(a[1], a[10]); SQRADDAC(a[2], a[9]); SQRADDAC(a[3], a[8]); SQRADDAC(a[4], a[7]); SQRADDAC(a[5], a[6]); SQRADDDB;
-   COMBA_STORE(b[11]);
-
-   /* output 12 */
-   CARRY_FORWARD;
-   SQRADDSC(a[0], a[12]); SQRADDAC(a[1], a[11]); SQRADDAC(a[2], a[10]); SQRADDAC(a[3], a[9]); SQRADDAC(a[4], a[8]); SQRADDAC(a[5], a[7]); SQRADDDB; SQRADD(a[6], a[6]);
-   COMBA_STORE(b[12]);
-
-   /* output 13 */
-   CARRY_FORWARD;
-   SQRADDSC(a[0], a[13]); SQRADDAC(a[1], a[12]); SQRADDAC(a[2], a[11]); SQRADDAC(a[3], a[10]); SQRADDAC(a[4], a[9]); SQRADDAC(a[5], a[8]); SQRADDAC(a[6], a[7]); SQRADDDB;
-   COMBA_STORE(b[13]);
-
-   /* output 14 */
-   CARRY_FORWARD;
-   SQRADDSC(a[0], a[14]); SQRADDAC(a[1], a[13]); SQRADDAC(a[2], a[12]); SQRADDAC(a[3], a[11]); SQRADDAC(a[4], a[10]); SQRADDAC(a[5], a[9]); SQRADDAC(a[6], a[8]); SQRADDDB; SQRADD(a[7], a[7]);
-   COMBA_STORE(b[14]);
-
-   /* output 15 */
-   CARRY_FORWARD;
-   SQRADDSC(a[0], a[15]); SQRADDAC(a[1], a[14]); SQRADDAC(a[2], a[13]); SQRADDAC(a[3], a[12]); SQRADDAC(a[4], a[11]); SQRADDAC(a[5], a[10]); SQRADDAC(a[6], a[9]); SQRADDAC(a[7], a[8]); SQRADDDB;
-   COMBA_STORE(b[15]);
-
-   /* output 16 */
-   CARRY_FORWARD;
-   SQRADDSC(a[1], a[15]); SQRADDAC(a[2], a[14]); SQRADDAC(a[3], a[13]); SQRADDAC(a[4], a[12]); SQRADDAC(a[5], a[11]); SQRADDAC(a[6], a[10]); SQRADDAC(a[7], a[9]); SQRADDDB; SQRADD(a[8], a[8]);
-   COMBA_STORE(b[16]);
-
-   /* output 17 */
-   CARRY_FORWARD;
-   SQRADDSC(a[2], a[15]); SQRADDAC(a[3], a[14]); SQRADDAC(a[4], a[13]); SQRADDAC(a[5], a[12]); SQRADDAC(a[6], a[11]); SQRADDAC(a[7], a[10]); SQRADDAC(a[8], a[9]); SQRADDDB;
-   COMBA_STORE(b[17]);
-
-   /* output 18 */
-   CARRY_FORWARD;
-   SQRADDSC(a[3], a[15]); SQRADDAC(a[4], a[14]); SQRADDAC(a[5], a[13]); SQRADDAC(a[6], a[12]); SQRADDAC(a[7], a[11]); SQRADDAC(a[8], a[10]); SQRADDDB; SQRADD(a[9], a[9]);
-   COMBA_STORE(b[18]);
-
-   /* output 19 */
-   CARRY_FORWARD;
-   SQRADDSC(a[4], a[15]); SQRADDAC(a[5], a[14]); SQRADDAC(a[6], a[13]); SQRADDAC(a[7], a[12]); SQRADDAC(a[8], a[11]); SQRADDAC(a[9], a[10]); SQRADDDB;
-   COMBA_STORE(b[19]);
-
-   /* output 20 */
-   CARRY_FORWARD;
-   SQRADDSC(a[5], a[15]); SQRADDAC(a[6], a[14]); SQRADDAC(a[7], a[13]); SQRADDAC(a[8], a[12]); SQRADDAC(a[9], a[11]); SQRADDDB; SQRADD(a[10], a[10]);
-   COMBA_STORE(b[20]);
-
-   /* output 21 */
-   CARRY_FORWARD;
-   SQRADDSC(a[6], a[15]); SQRADDAC(a[7], a[14]); SQRADDAC(a[8], a[13]); SQRADDAC(a[9], a[12]); SQRADDAC(a[10], a[11]); SQRADDDB;
-   COMBA_STORE(b[21]);
-
-   /* output 22 */
-   CARRY_FORWARD;
-   SQRADDSC(a[7], a[15]); SQRADDAC(a[8], a[14]); SQRADDAC(a[9], a[13]); SQRADDAC(a[10], a[12]); SQRADDDB; SQRADD(a[11], a[11]);
-   COMBA_STORE(b[22]);
-
-   /* output 23 */
-   CARRY_FORWARD;
-   SQRADDSC(a[8], a[15]); SQRADDAC(a[9], a[14]); SQRADDAC(a[10], a[13]); SQRADDAC(a[11], a[12]); SQRADDDB;
-   COMBA_STORE(b[23]);
-
-   /* output 24 */
-   CARRY_FORWARD;
-   SQRADDSC(a[9], a[15]); SQRADDAC(a[10], a[14]); SQRADDAC(a[11], a[13]); SQRADDDB; SQRADD(a[12], a[12]);
-   COMBA_STORE(b[24]);
-
-   /* output 25 */
-   CARRY_FORWARD;
-   SQRADDSC(a[10], a[15]); SQRADDAC(a[11], a[14]); SQRADDAC(a[12], a[13]); SQRADDDB;
-   COMBA_STORE(b[25]);
-
-   /* output 26 */
-   CARRY_FORWARD;
-   SQRADD2(a[11], a[15]); SQRADD2(a[12], a[14]); SQRADD(a[13], a[13]);
-   COMBA_STORE(b[26]);
-
-   /* output 27 */
-   CARRY_FORWARD;
-   SQRADD2(a[12], a[15]); SQRADD2(a[13], a[14]);
-   COMBA_STORE(b[27]);
-
-   /* output 28 */
-   CARRY_FORWARD;
-   SQRADD2(a[13], a[15]); SQRADD(a[14], a[14]);
-   COMBA_STORE(b[28]);
-
-   /* output 29 */
-   CARRY_FORWARD;
-   SQRADD2(a[14], a[15]);
-   COMBA_STORE(b[29]);
-
-   /* output 30 */
-   CARRY_FORWARD;
-   SQRADD(a[15], a[15]);
-   COMBA_STORE(b[30]);
-   COMBA_STORE2(b[31]);
-   COMBA_FINI;
-
-   B->used = 32;
-   B->sign = FP_ZPOS;
-   memcpy(B->dp, b, 32 * sizeof(fp_digit));
-   fp_clamp(B);
-}
-
-
-#endif
-#ifdef TFM_HUGE
-void fp_sqr_comba32(fp_int *A, fp_int *B)
-{
-   fp_digit *a, b[64], c0, c1, c2, sc0, sc1, sc2;
-
-   a = A->dp;
-   COMBA_START;
-
-   /* clear carries */
-   CLEAR_CARRY;
-
-   /* output 0 */
-   SQRADD(a[0],a[0]);
-   COMBA_STORE(b[0]);
-
-   /* output 1 */
-   CARRY_FORWARD;
-   SQRADD2(a[0], a[1]);
-   COMBA_STORE(b[1]);
-
-   /* output 2 */
-   CARRY_FORWARD;
-   SQRADD2(a[0], a[2]); SQRADD(a[1], a[1]);
-   COMBA_STORE(b[2]);
-
-   /* output 3 */
-   CARRY_FORWARD;
-   SQRADD2(a[0], a[3]); SQRADD2(a[1], a[2]);
-   COMBA_STORE(b[3]);
-
-   /* output 4 */
-   CARRY_FORWARD;
-   SQRADD2(a[0], a[4]); SQRADD2(a[1], a[3]); SQRADD(a[2], a[2]);
-   COMBA_STORE(b[4]);
-
-   /* output 5 */
-   CARRY_FORWARD;
-   SQRADDSC(a[0], a[5]); SQRADDAC(a[1], a[4]); SQRADDAC(a[2], a[3]); SQRADDDB;
-   COMBA_STORE(b[5]);
-
-   /* output 6 */
-   CARRY_FORWARD;
-   SQRADDSC(a[0], a[6]); SQRADDAC(a[1], a[5]); SQRADDAC(a[2], a[4]); SQRADDDB; SQRADD(a[3], a[3]);
-   COMBA_STORE(b[6]);
-
-   /* output 7 */
-   CARRY_FORWARD;
-   SQRADDSC(a[0], a[7]); SQRADDAC(a[1], a[6]); SQRADDAC(a[2], a[5]); SQRADDAC(a[3], a[4]); SQRADDDB;
-   COMBA_STORE(b[7]);
-
-   /* output 8 */
-   CARRY_FORWARD;
-   SQRADDSC(a[0], a[8]); SQRADDAC(a[1], a[7]); SQRADDAC(a[2], a[6]); SQRADDAC(a[3], a[5]); SQRADDDB; SQRADD(a[4], a[4]);
-   COMBA_STORE(b[8]);
-
-   /* output 9 */
-   CARRY_FORWARD;
-   SQRADDSC(a[0], a[9]); SQRADDAC(a[1], a[8]); SQRADDAC(a[2], a[7]); SQRADDAC(a[3], a[6]); SQRADDAC(a[4], a[5]); SQRADDDB;
-   COMBA_STORE(b[9]);
-
-   /* output 10 */
-   CARRY_FORWARD;
-   SQRADDSC(a[0], a[10]); SQRADDAC(a[1], a[9]); SQRADDAC(a[2], a[8]); SQRADDAC(a[3], a[7]); SQRADDAC(a[4], a[6]); SQRADDDB; SQRADD(a[5], a[5]);
-   COMBA_STORE(b[10]);
-
-   /* output 11 */
-   CARRY_FORWARD;
-   SQRADDSC(a[0], a[11]); SQRADDAC(a[1], a[10]); SQRADDAC(a[2], a[9]); SQRADDAC(a[3], a[8]); SQRADDAC(a[4], a[7]); SQRADDAC(a[5], a[6]); SQRADDDB;
-   COMBA_STORE(b[11]);
-
-   /* output 12 */
-   CARRY_FORWARD;
-   SQRADDSC(a[0], a[12]); SQRADDAC(a[1], a[11]); SQRADDAC(a[2], a[10]); SQRADDAC(a[3], a[9]); SQRADDAC(a[4], a[8]); SQRADDAC(a[5], a[7]); SQRADDDB; SQRADD(a[6], a[6]);
-   COMBA_STORE(b[12]);
-
-   /* output 13 */
-   CARRY_FORWARD;
-   SQRADDSC(a[0], a[13]); SQRADDAC(a[1], a[12]); SQRADDAC(a[2], a[11]); SQRADDAC(a[3], a[10]); SQRADDAC(a[4], a[9]); SQRADDAC(a[5], a[8]); SQRADDAC(a[6], a[7]); SQRADDDB;
-   COMBA_STORE(b[13]);
-
-   /* output 14 */
-   CARRY_FORWARD;
-   SQRADDSC(a[0], a[14]); SQRADDAC(a[1], a[13]); SQRADDAC(a[2], a[12]); SQRADDAC(a[3], a[11]); SQRADDAC(a[4], a[10]); SQRADDAC(a[5], a[9]); SQRADDAC(a[6], a[8]); SQRADDDB; SQRADD(a[7], a[7]);
-   COMBA_STORE(b[14]);
-
-   /* output 15 */
-   CARRY_FORWARD;
-   SQRADDSC(a[0], a[15]); SQRADDAC(a[1], a[14]); SQRADDAC(a[2], a[13]); SQRADDAC(a[3], a[12]); SQRADDAC(a[4], a[11]); SQRADDAC(a[5], a[10]); SQRADDAC(a[6], a[9]); SQRADDAC(a[7], a[8]); SQRADDDB;
-   COMBA_STORE(b[15]);
-
-   /* output 16 */
-   CARRY_FORWARD;
-   SQRADDSC(a[0], a[16]); SQRADDAC(a[1], a[15]); SQRADDAC(a[2], a[14]); SQRADDAC(a[3], a[13]); SQRADDAC(a[4], a[12]); SQRADDAC(a[5], a[11]); SQRADDAC(a[6], a[10]); SQRADDAC(a[7], a[9]); SQRADDDB; SQRADD(a[8], a[8]);
-   COMBA_STORE(b[16]);
-
-   /* output 17 */
-   CARRY_FORWARD;
-   SQRADDSC(a[0], a[17]); SQRADDAC(a[1], a[16]); SQRADDAC(a[2], a[15]); SQRADDAC(a[3], a[14]); SQRADDAC(a[4], a[13]); SQRADDAC(a[5], a[12]); SQRADDAC(a[6], a[11]); SQRADDAC(a[7], a[10]); SQRADDAC(a[8], a[9]); SQRADDDB;
-   COMBA_STORE(b[17]);
-
-   /* output 18 */
-   CARRY_FORWARD;
-   SQRADDSC(a[0], a[18]); SQRADDAC(a[1], a[17]); SQRADDAC(a[2], a[16]); SQRADDAC(a[3], a[15]); SQRADDAC(a[4], a[14]); SQRADDAC(a[5], a[13]); SQRADDAC(a[6], a[12]); SQRADDAC(a[7], a[11]); SQRADDAC(a[8], a[10]); SQRADDDB; SQRADD(a[9], a[9]);
-   COMBA_STORE(b[18]);
-
-   /* output 19 */
-   CARRY_FORWARD;
-   SQRADDSC(a[0], a[19]); SQRADDAC(a[1], a[18]); SQRADDAC(a[2], a[17]); SQRADDAC(a[3], a[16]); SQRADDAC(a[4], a[15]); SQRADDAC(a[5], a[14]); SQRADDAC(a[6], a[13]); SQRADDAC(a[7], a[12]); SQRADDAC(a[8], a[11]); SQRADDAC(a[9], a[10]); SQRADDDB;
-   COMBA_STORE(b[19]);
-
-   /* output 20 */
-   CARRY_FORWARD;
-   SQRADDSC(a[0], a[20]); SQRADDAC(a[1], a[19]); SQRADDAC(a[2], a[18]); SQRADDAC(a[3], a[17]); SQRADDAC(a[4], a[16]); SQRADDAC(a[5], a[15]); SQRADDAC(a[6], a[14]); SQRADDAC(a[7], a[13]); SQRADDAC(a[8], a[12]); SQRADDAC(a[9], a[11]); SQRADDDB; SQRADD(a[10], a[10]);
-   COMBA_STORE(b[20]);
-
-   /* output 21 */
-   CARRY_FORWARD;
-   SQRADDSC(a[0], a[21]); SQRADDAC(a[1], a[20]); SQRADDAC(a[2], a[19]); SQRADDAC(a[3], a[18]); SQRADDAC(a[4], a[17]); SQRADDAC(a[5], a[16]); SQRADDAC(a[6], a[15]); SQRADDAC(a[7], a[14]); SQRADDAC(a[8], a[13]); SQRADDAC(a[9], a[12]); SQRADDAC(a[10], a[11]); SQRADDDB;
-   COMBA_STORE(b[21]);
-
-   /* output 22 */
-   CARRY_FORWARD;
-   SQRADDSC(a[0], a[22]); SQRADDAC(a[1], a[21]); SQRADDAC(a[2], a[20]); SQRADDAC(a[3], a[19]); SQRADDAC(a[4], a[18]); SQRADDAC(a[5], a[17]); SQRADDAC(a[6], a[16]); SQRADDAC(a[7], a[15]); SQRADDAC(a[8], a[14]); SQRADDAC(a[9], a[13]); SQRADDAC(a[10], a[12]); SQRADDDB; SQRADD(a[11], a[11]);
-   COMBA_STORE(b[22]);
-
-   /* output 23 */
-   CARRY_FORWARD;
-   SQRADDSC(a[0], a[23]); SQRADDAC(a[1], a[22]); SQRADDAC(a[2], a[21]); SQRADDAC(a[3], a[20]); SQRADDAC(a[4], a[19]); SQRADDAC(a[5], a[18]); SQRADDAC(a[6], a[17]); SQRADDAC(a[7], a[16]); SQRADDAC(a[8], a[15]); SQRADDAC(a[9], a[14]); SQRADDAC(a[10], a[13]); SQRADDAC(a[11], a[12]); SQRADDDB;
-   COMBA_STORE(b[23]);
-
-   /* output 24 */
-   CARRY_FORWARD;
-   SQRADDSC(a[0], a[24]); SQRADDAC(a[1], a[23]); SQRADDAC(a[2], a[22]); SQRADDAC(a[3], a[21]); SQRADDAC(a[4], a[20]); SQRADDAC(a[5], a[19]); SQRADDAC(a[6], a[18]); SQRADDAC(a[7], a[17]); SQRADDAC(a[8], a[16]); SQRADDAC(a[9], a[15]); SQRADDAC(a[10], a[14]); SQRADDAC(a[11], a[13]); SQRADDDB; SQRADD(a[12], a[12]);
-   COMBA_STORE(b[24]);
-
-   /* output 25 */
-   CARRY_FORWARD;
-   SQRADDSC(a[0], a[25]); SQRADDAC(a[1], a[24]); SQRADDAC(a[2], a[23]); SQRADDAC(a[3], a[22]); SQRADDAC(a[4], a[21]); SQRADDAC(a[5], a[20]); SQRADDAC(a[6], a[19]); SQRADDAC(a[7], a[18]); SQRADDAC(a[8], a[17]); SQRADDAC(a[9], a[16]); SQRADDAC(a[10], a[15]); SQRADDAC(a[11], a[14]); SQRADDAC(a[12], a[13]); SQRADDDB;
-   COMBA_STORE(b[25]);
-
-   /* output 26 */
-   CARRY_FORWARD;
-   SQRADDSC(a[0], a[26]); SQRADDAC(a[1], a[25]); SQRADDAC(a[2], a[24]); SQRADDAC(a[3], a[23]); SQRADDAC(a[4], a[22]); SQRADDAC(a[5], a[21]); SQRADDAC(a[6], a[20]); SQRADDAC(a[7], a[19]); SQRADDAC(a[8], a[18]); SQRADDAC(a[9], a[17]); SQRADDAC(a[10], a[16]); SQRADDAC(a[11], a[15]); SQRADDAC(a[12], a[14]); SQRADDDB; SQRADD(a[13], a[13]);
-   COMBA_STORE(b[26]);
-
-   /* output 27 */
-   CARRY_FORWARD;
-   SQRADDSC(a[0], a[27]); SQRADDAC(a[1], a[26]); SQRADDAC(a[2], a[25]); SQRADDAC(a[3], a[24]); SQRADDAC(a[4], a[23]); SQRADDAC(a[5], a[22]); SQRADDAC(a[6], a[21]); SQRADDAC(a[7], a[20]); SQRADDAC(a[8], a[19]); SQRADDAC(a[9], a[18]); SQRADDAC(a[10], a[17]); SQRADDAC(a[11], a[16]); SQRADDAC(a[12], a[15]); SQRADDAC(a[13], a[14]); SQRADDDB;
-   COMBA_STORE(b[27]);
-
-   /* output 28 */
-   CARRY_FORWARD;
-   SQRADDSC(a[0], a[28]); SQRADDAC(a[1], a[27]); SQRADDAC(a[2], a[26]); SQRADDAC(a[3], a[25]); SQRADDAC(a[4], a[24]); SQRADDAC(a[5], a[23]); SQRADDAC(a[6], a[22]); SQRADDAC(a[7], a[21]); SQRADDAC(a[8], a[20]); SQRADDAC(a[9], a[19]); SQRADDAC(a[10], a[18]); SQRADDAC(a[11], a[17]); SQRADDAC(a[12], a[16]); SQRADDAC(a[13], a[15]); SQRADDDB; SQRADD(a[14], a[14]);
-   COMBA_STORE(b[28]);
-
-   /* output 29 */
-   CARRY_FORWARD;
-   SQRADDSC(a[0], a[29]); SQRADDAC(a[1], a[28]); SQRADDAC(a[2], a[27]); SQRADDAC(a[3], a[26]); SQRADDAC(a[4], a[25]); SQRADDAC(a[5], a[24]); SQRADDAC(a[6], a[23]); SQRADDAC(a[7], a[22]); SQRADDAC(a[8], a[21]); SQRADDAC(a[9], a[20]); SQRADDAC(a[10], a[19]); SQRADDAC(a[11], a[18]); SQRADDAC(a[12], a[17]); SQRADDAC(a[13], a[16]); SQRADDAC(a[14], a[15]); SQRADDDB;
-   COMBA_STORE(b[29]);
-
-   /* output 30 */
-   CARRY_FORWARD;
-   SQRADDSC(a[0], a[30]); SQRADDAC(a[1], a[29]); SQRADDAC(a[2], a[28]); SQRADDAC(a[3], a[27]); SQRADDAC(a[4], a[26]); SQRADDAC(a[5], a[25]); SQRADDAC(a[6], a[24]); SQRADDAC(a[7], a[23]); SQRADDAC(a[8], a[22]); SQRADDAC(a[9], a[21]); SQRADDAC(a[10], a[20]); SQRADDAC(a[11], a[19]); SQRADDAC(a[12], a[18]); SQRADDAC(a[13], a[17]); SQRADDAC(a[14], a[16]); SQRADDDB; SQRADD(a[15], a[15]);
-   COMBA_STORE(b[30]);
-
-   /* output 31 */
-   CARRY_FORWARD;
-   SQRADDSC(a[0], a[31]); SQRADDAC(a[1], a[30]); SQRADDAC(a[2], a[29]); SQRADDAC(a[3], a[28]); SQRADDAC(a[4], a[27]); SQRADDAC(a[5], a[26]); SQRADDAC(a[6], a[25]); SQRADDAC(a[7], a[24]); SQRADDAC(a[8], a[23]); SQRADDAC(a[9], a[22]); SQRADDAC(a[10], a[21]); SQRADDAC(a[11], a[20]); SQRADDAC(a[12], a[19]); SQRADDAC(a[13], a[18]); SQRADDAC(a[14], a[17]); SQRADDAC(a[15], a[16]); SQRADDDB;
-   COMBA_STORE(b[31]);
-
-   /* output 32 */
-   CARRY_FORWARD;
-   SQRADDSC(a[1], a[31]); SQRADDAC(a[2], a[30]); SQRADDAC(a[3], a[29]); SQRADDAC(a[4], a[28]); SQRADDAC(a[5], a[27]); SQRADDAC(a[6], a[26]); SQRADDAC(a[7], a[25]); SQRADDAC(a[8], a[24]); SQRADDAC(a[9], a[23]); SQRADDAC(a[10], a[22]); SQRADDAC(a[11], a[21]); SQRADDAC(a[12], a[20]); SQRADDAC(a[13], a[19]); SQRADDAC(a[14], a[18]); SQRADDAC(a[15], a[17]); SQRADDDB; SQRADD(a[16], a[16]);
-   COMBA_STORE(b[32]);
-
-   /* output 33 */
-   CARRY_FORWARD;
-   SQRADDSC(a[2], a[31]); SQRADDAC(a[3], a[30]); SQRADDAC(a[4], a[29]); SQRADDAC(a[5], a[28]); SQRADDAC(a[6], a[27]); SQRADDAC(a[7], a[26]); SQRADDAC(a[8], a[25]); SQRADDAC(a[9], a[24]); SQRADDAC(a[10], a[23]); SQRADDAC(a[11], a[22]); SQRADDAC(a[12], a[21]); SQRADDAC(a[13], a[20]); SQRADDAC(a[14], a[19]); SQRADDAC(a[15], a[18]); SQRADDAC(a[16], a[17]); SQRADDDB;
-   COMBA_STORE(b[33]);
-
-   /* output 34 */
-   CARRY_FORWARD;
-   SQRADDSC(a[3], a[31]); SQRADDAC(a[4], a[30]); SQRADDAC(a[5], a[29]); SQRADDAC(a[6], a[28]); SQRADDAC(a[7], a[27]); SQRADDAC(a[8], a[26]); SQRADDAC(a[9], a[25]); SQRADDAC(a[10], a[24]); SQRADDAC(a[11], a[23]); SQRADDAC(a[12], a[22]); SQRADDAC(a[13], a[21]); SQRADDAC(a[14], a[20]); SQRADDAC(a[15], a[19]); SQRADDAC(a[16], a[18]); SQRADDDB; SQRADD(a[17], a[17]);
-   COMBA_STORE(b[34]);
-
-   /* output 35 */
-   CARRY_FORWARD;
-   SQRADDSC(a[4], a[31]); SQRADDAC(a[5], a[30]); SQRADDAC(a[6], a[29]); SQRADDAC(a[7], a[28]); SQRADDAC(a[8], a[27]); SQRADDAC(a[9], a[26]); SQRADDAC(a[10], a[25]); SQRADDAC(a[11], a[24]); SQRADDAC(a[12], a[23]); SQRADDAC(a[13], a[22]); SQRADDAC(a[14], a[21]); SQRADDAC(a[15], a[20]); SQRADDAC(a[16], a[19]); SQRADDAC(a[17], a[18]); SQRADDDB;
-   COMBA_STORE(b[35]);
-
-   /* output 36 */
-   CARRY_FORWARD;
-   SQRADDSC(a[5], a[31]); SQRADDAC(a[6], a[30]); SQRADDAC(a[7], a[29]); SQRADDAC(a[8], a[28]); SQRADDAC(a[9], a[27]); SQRADDAC(a[10], a[26]); SQRADDAC(a[11], a[25]); SQRADDAC(a[12], a[24]); SQRADDAC(a[13], a[23]); SQRADDAC(a[14], a[22]); SQRADDAC(a[15], a[21]); SQRADDAC(a[16], a[20]); SQRADDAC(a[17], a[19]); SQRADDDB; SQRADD(a[18], a[18]);
-   COMBA_STORE(b[36]);
-
-   /* output 37 */
-   CARRY_FORWARD;
-   SQRADDSC(a[6], a[31]); SQRADDAC(a[7], a[30]); SQRADDAC(a[8], a[29]); SQRADDAC(a[9], a[28]); SQRADDAC(a[10], a[27]); SQRADDAC(a[11], a[26]); SQRADDAC(a[12], a[25]); SQRADDAC(a[13], a[24]); SQRADDAC(a[14], a[23]); SQRADDAC(a[15], a[22]); SQRADDAC(a[16], a[21]); SQRADDAC(a[17], a[20]); SQRADDAC(a[18], a[19]); SQRADDDB;
-   COMBA_STORE(b[37]);
-
-   /* output 38 */
-   CARRY_FORWARD;
-   SQRADDSC(a[7], a[31]); SQRADDAC(a[8], a[30]); SQRADDAC(a[9], a[29]); SQRADDAC(a[10], a[28]); SQRADDAC(a[11], a[27]); SQRADDAC(a[12], a[26]); SQRADDAC(a[13], a[25]); SQRADDAC(a[14], a[24]); SQRADDAC(a[15], a[23]); SQRADDAC(a[16], a[22]); SQRADDAC(a[17], a[21]); SQRADDAC(a[18], a[20]); SQRADDDB; SQRADD(a[19], a[19]);
-   COMBA_STORE(b[38]);
-
-   /* output 39 */
-   CARRY_FORWARD;
-   SQRADDSC(a[8], a[31]); SQRADDAC(a[9], a[30]); SQRADDAC(a[10], a[29]); SQRADDAC(a[11], a[28]); SQRADDAC(a[12], a[27]); SQRADDAC(a[13], a[26]); SQRADDAC(a[14], a[25]); SQRADDAC(a[15], a[24]); SQRADDAC(a[16], a[23]); SQRADDAC(a[17], a[22]); SQRADDAC(a[18], a[21]); SQRADDAC(a[19], a[20]); SQRADDDB;
-   COMBA_STORE(b[39]);
-
-   /* output 40 */
-   CARRY_FORWARD;
-   SQRADDSC(a[9], a[31]); SQRADDAC(a[10], a[30]); SQRADDAC(a[11], a[29]); SQRADDAC(a[12], a[28]); SQRADDAC(a[13], a[27]); SQRADDAC(a[14], a[26]); SQRADDAC(a[15], a[25]); SQRADDAC(a[16], a[24]); SQRADDAC(a[17], a[23]); SQRADDAC(a[18], a[22]); SQRADDAC(a[19], a[21]); SQRADDDB; SQRADD(a[20], a[20]);
-   COMBA_STORE(b[40]);
-
-   /* output 41 */
-   CARRY_FORWARD;
-   SQRADDSC(a[10], a[31]); SQRADDAC(a[11], a[30]); SQRADDAC(a[12], a[29]); SQRADDAC(a[13], a[28]); SQRADDAC(a[14], a[27]); SQRADDAC(a[15], a[26]); SQRADDAC(a[16], a[25]); SQRADDAC(a[17], a[24]); SQRADDAC(a[18], a[23]); SQRADDAC(a[19], a[22]); SQRADDAC(a[20], a[21]); SQRADDDB;
-   COMBA_STORE(b[41]);
-
-   /* output 42 */
-   CARRY_FORWARD;
-   SQRADDSC(a[11], a[31]); SQRADDAC(a[12], a[30]); SQRADDAC(a[13], a[29]); SQRADDAC(a[14], a[28]); SQRADDAC(a[15], a[27]); SQRADDAC(a[16], a[26]); SQRADDAC(a[17], a[25]); SQRADDAC(a[18], a[24]); SQRADDAC(a[19], a[23]); SQRADDAC(a[20], a[22]); SQRADDDB; SQRADD(a[21], a[21]);
-   COMBA_STORE(b[42]);
-
-   /* output 43 */
-   CARRY_FORWARD;
-   SQRADDSC(a[12], a[31]); SQRADDAC(a[13], a[30]); SQRADDAC(a[14], a[29]); SQRADDAC(a[15], a[28]); SQRADDAC(a[16], a[27]); SQRADDAC(a[17], a[26]); SQRADDAC(a[18], a[25]); SQRADDAC(a[19], a[24]); SQRADDAC(a[20], a[23]); SQRADDAC(a[21], a[22]); SQRADDDB;
-   COMBA_STORE(b[43]);
-
-   /* output 44 */
-   CARRY_FORWARD;
-   SQRADDSC(a[13], a[31]); SQRADDAC(a[14], a[30]); SQRADDAC(a[15], a[29]); SQRADDAC(a[16], a[28]); SQRADDAC(a[17], a[27]); SQRADDAC(a[18], a[26]); SQRADDAC(a[19], a[25]); SQRADDAC(a[20], a[24]); SQRADDAC(a[21], a[23]); SQRADDDB; SQRADD(a[22], a[22]);
-   COMBA_STORE(b[44]);
-
-   /* output 45 */
-   CARRY_FORWARD;
-   SQRADDSC(a[14], a[31]); SQRADDAC(a[15], a[30]); SQRADDAC(a[16], a[29]); SQRADDAC(a[17], a[28]); SQRADDAC(a[18], a[27]); SQRADDAC(a[19], a[26]); SQRADDAC(a[20], a[25]); SQRADDAC(a[21], a[24]); SQRADDAC(a[22], a[23]); SQRADDDB;
-   COMBA_STORE(b[45]);
-
-   /* output 46 */
-   CARRY_FORWARD;
-   SQRADDSC(a[15], a[31]); SQRADDAC(a[16], a[30]); SQRADDAC(a[17], a[29]); SQRADDAC(a[18], a[28]); SQRADDAC(a[19], a[27]); SQRADDAC(a[20], a[26]); SQRADDAC(a[21], a[25]); SQRADDAC(a[22], a[24]); SQRADDDB; SQRADD(a[23], a[23]);
-   COMBA_STORE(b[46]);
-
-   /* output 47 */
-   CARRY_FORWARD;
-   SQRADDSC(a[16], a[31]); SQRADDAC(a[17], a[30]); SQRADDAC(a[18], a[29]); SQRADDAC(a[19], a[28]); SQRADDAC(a[20], a[27]); SQRADDAC(a[21], a[26]); SQRADDAC(a[22], a[25]); SQRADDAC(a[23], a[24]); SQRADDDB;
-   COMBA_STORE(b[47]);
-
-   /* output 48 */
-   CARRY_FORWARD;
-   SQRADDSC(a[17], a[31]); SQRADDAC(a[18], a[30]); SQRADDAC(a[19], a[29]); SQRADDAC(a[20], a[28]); SQRADDAC(a[21], a[27]); SQRADDAC(a[22], a[26]); SQRADDAC(a[23], a[25]); SQRADDDB; SQRADD(a[24], a[24]);
-   COMBA_STORE(b[48]);
-
-   /* output 49 */
-   CARRY_FORWARD;
-   SQRADDSC(a[18], a[31]); SQRADDAC(a[19], a[30]); SQRADDAC(a[20], a[29]); SQRADDAC(a[21], a[28]); SQRADDAC(a[22], a[27]); SQRADDAC(a[23], a[26]); SQRADDAC(a[24], a[25]); SQRADDDB;
-   COMBA_STORE(b[49]);
-
-   /* output 50 */
-   CARRY_FORWARD;
-   SQRADDSC(a[19], a[31]); SQRADDAC(a[20], a[30]); SQRADDAC(a[21], a[29]); SQRADDAC(a[22], a[28]); SQRADDAC(a[23], a[27]); SQRADDAC(a[24], a[26]); SQRADDDB; SQRADD(a[25], a[25]);
-   COMBA_STORE(b[50]);
-
-   /* output 51 */
-   CARRY_FORWARD;
-   SQRADDSC(a[20], a[31]); SQRADDAC(a[21], a[30]); SQRADDAC(a[22], a[29]); SQRADDAC(a[23], a[28]); SQRADDAC(a[24], a[27]); SQRADDAC(a[25], a[26]); SQRADDDB;
-   COMBA_STORE(b[51]);
-
-   /* output 52 */
-   CARRY_FORWARD;
-   SQRADDSC(a[21], a[31]); SQRADDAC(a[22], a[30]); SQRADDAC(a[23], a[29]); SQRADDAC(a[24], a[28]); SQRADDAC(a[25], a[27]); SQRADDDB; SQRADD(a[26], a[26]);
-   COMBA_STORE(b[52]);
-
-   /* output 53 */
-   CARRY_FORWARD;
-   SQRADDSC(a[22], a[31]); SQRADDAC(a[23], a[30]); SQRADDAC(a[24], a[29]); SQRADDAC(a[25], a[28]); SQRADDAC(a[26], a[27]); SQRADDDB;
-   COMBA_STORE(b[53]);
-
-   /* output 54 */
-   CARRY_FORWARD;
-   SQRADDSC(a[23], a[31]); SQRADDAC(a[24], a[30]); SQRADDAC(a[25], a[29]); SQRADDAC(a[26], a[28]); SQRADDDB; SQRADD(a[27], a[27]);
-   COMBA_STORE(b[54]);
-
-   /* output 55 */
-   CARRY_FORWARD;
-   SQRADDSC(a[24], a[31]); SQRADDAC(a[25], a[30]); SQRADDAC(a[26], a[29]); SQRADDAC(a[27], a[28]); SQRADDDB;
-   COMBA_STORE(b[55]);
-
-   /* output 56 */
-   CARRY_FORWARD;
-   SQRADDSC(a[25], a[31]); SQRADDAC(a[26], a[30]); SQRADDAC(a[27], a[29]); SQRADDDB; SQRADD(a[28], a[28]);
-   COMBA_STORE(b[56]);
-
-   /* output 57 */
-   CARRY_FORWARD;
-   SQRADDSC(a[26], a[31]); SQRADDAC(a[27], a[30]); SQRADDAC(a[28], a[29]); SQRADDDB;
-   COMBA_STORE(b[57]);
-
-   /* output 58 */
-   CARRY_FORWARD;
-   SQRADD2(a[27], a[31]); SQRADD2(a[28], a[30]); SQRADD(a[29], a[29]);
-   COMBA_STORE(b[58]);
-
-   /* output 59 */
-   CARRY_FORWARD;
-   SQRADD2(a[28], a[31]); SQRADD2(a[29], a[30]);
-   COMBA_STORE(b[59]);
-
-   /* output 60 */
-   CARRY_FORWARD;
-   SQRADD2(a[29], a[31]); SQRADD(a[30], a[30]);
-   COMBA_STORE(b[60]);
-
-   /* output 61 */
-   CARRY_FORWARD;
-   SQRADD2(a[30], a[31]);
-   COMBA_STORE(b[61]);
-
-   /* output 62 */
-   CARRY_FORWARD;
-   SQRADD(a[31], a[31]);
-   COMBA_STORE(b[62]);
-   COMBA_STORE2(b[63]);
-   COMBA_FINI;
-
-   B->used = 64;
-   B->sign = FP_ZPOS;
-   memcpy(B->dp, b, 64 * sizeof(fp_digit));
-   fp_clamp(B);
-}
-
-
-#endif
-
-#ifdef TFM_HUGE
-void fp_sqr_comba64(fp_int *A, fp_int *B)
-{
-   fp_digit *a, b[128], c0, c1, c2, sc0, sc1, sc2;
-
-   a = A->dp;
-   COMBA_START;
-
-   /* clear carries */
-   CLEAR_CARRY;
-
-   /* output 0 */
-   SQRADD(a[0],a[0]);
-   COMBA_STORE(b[0]);
-
-   /* output 1 */
-   CARRY_FORWARD;
-   SQRADD2(a[0], a[1]);
-   COMBA_STORE(b[1]);
-
-   /* output 2 */
-   CARRY_FORWARD;
-   SQRADD2(a[0], a[2]); SQRADD(a[1], a[1]);
-   COMBA_STORE(b[2]);
-
-   /* output 3 */
-   CARRY_FORWARD;
-   SQRADD2(a[0], a[3]); SQRADD2(a[1], a[2]);
-   COMBA_STORE(b[3]);
-
-   /* output 4 */
-   CARRY_FORWARD;
-   SQRADD2(a[0], a[4]); SQRADD2(a[1], a[3]); SQRADD(a[2], a[2]);
-   COMBA_STORE(b[4]);
-
-   /* output 5 */
-   CARRY_FORWARD;
-   SQRADDSC(a[0], a[5]); SQRADDAC(a[1], a[4]); SQRADDAC(a[2], a[3]); SQRADDDB;
-   COMBA_STORE(b[5]);
-
-   /* output 6 */
-   CARRY_FORWARD;
-   SQRADDSC(a[0], a[6]); SQRADDAC(a[1], a[5]); SQRADDAC(a[2], a[4]); SQRADDDB; SQRADD(a[3], a[3]);
-   COMBA_STORE(b[6]);
-
-   /* output 7 */
-   CARRY_FORWARD;
-   SQRADDSC(a[0], a[7]); SQRADDAC(a[1], a[6]); SQRADDAC(a[2], a[5]); SQRADDAC(a[3], a[4]); SQRADDDB;
-   COMBA_STORE(b[7]);
-
-   /* output 8 */
-   CARRY_FORWARD;
-   SQRADDSC(a[0], a[8]); SQRADDAC(a[1], a[7]); SQRADDAC(a[2], a[6]); SQRADDAC(a[3], a[5]); SQRADDDB; SQRADD(a[4], a[4]);
-   COMBA_STORE(b[8]);
-
-   /* output 9 */
-   CARRY_FORWARD;
-   SQRADDSC(a[0], a[9]); SQRADDAC(a[1], a[8]); SQRADDAC(a[2], a[7]); SQRADDAC(a[3], a[6]); SQRADDAC(a[4], a[5]); SQRADDDB;
-   COMBA_STORE(b[9]);
-
-   /* output 10 */
-   CARRY_FORWARD;
-   SQRADDSC(a[0], a[10]); SQRADDAC(a[1], a[9]); SQRADDAC(a[2], a[8]); SQRADDAC(a[3], a[7]); SQRADDAC(a[4], a[6]); SQRADDDB; SQRADD(a[5], a[5]);
-   COMBA_STORE(b[10]);
-
-   /* output 11 */
-   CARRY_FORWARD;
-   SQRADDSC(a[0], a[11]); SQRADDAC(a[1], a[10]); SQRADDAC(a[2], a[9]); SQRADDAC(a[3], a[8]); SQRADDAC(a[4], a[7]); SQRADDAC(a[5], a[6]); SQRADDDB;
-   COMBA_STORE(b[11]);
-
-   /* output 12 */
-   CARRY_FORWARD;
-   SQRADDSC(a[0], a[12]); SQRADDAC(a[1], a[11]); SQRADDAC(a[2], a[10]); SQRADDAC(a[3], a[9]); SQRADDAC(a[4], a[8]); SQRADDAC(a[5], a[7]); SQRADDDB; SQRADD(a[6], a[6]);
-   COMBA_STORE(b[12]);
-
-   /* output 13 */
-   CARRY_FORWARD;
-   SQRADDSC(a[0], a[13]); SQRADDAC(a[1], a[12]); SQRADDAC(a[2], a[11]); SQRADDAC(a[3], a[10]); SQRADDAC(a[4], a[9]); SQRADDAC(a[5], a[8]); SQRADDAC(a[6], a[7]); SQRADDDB;
-   COMBA_STORE(b[13]);
-
-   /* output 14 */
-   CARRY_FORWARD;
-   SQRADDSC(a[0], a[14]); SQRADDAC(a[1], a[13]); SQRADDAC(a[2], a[12]); SQRADDAC(a[3], a[11]); SQRADDAC(a[4], a[10]); SQRADDAC(a[5], a[9]); SQRADDAC(a[6], a[8]); SQRADDDB; SQRADD(a[7], a[7]);
-   COMBA_STORE(b[14]);
-
-   /* output 15 */
-   CARRY_FORWARD;
-   SQRADDSC(a[0], a[15]); SQRADDAC(a[1], a[14]); SQRADDAC(a[2], a[13]); SQRADDAC(a[3], a[12]); SQRADDAC(a[4], a[11]); SQRADDAC(a[5], a[10]); SQRADDAC(a[6], a[9]); SQRADDAC(a[7], a[8]); SQRADDDB;
-   COMBA_STORE(b[15]);
-
-   /* output 16 */
-   CARRY_FORWARD;
-   SQRADDSC(a[0], a[16]); SQRADDAC(a[1], a[15]); SQRADDAC(a[2], a[14]); SQRADDAC(a[3], a[13]); SQRADDAC(a[4], a[12]); SQRADDAC(a[5], a[11]); SQRADDAC(a[6], a[10]); SQRADDAC(a[7], a[9]); SQRADDDB; SQRADD(a[8], a[8]);
-   COMBA_STORE(b[16]);
-
-   /* output 17 */
-   CARRY_FORWARD;
-   SQRADDSC(a[0], a[17]); SQRADDAC(a[1], a[16]); SQRADDAC(a[2], a[15]); SQRADDAC(a[3], a[14]); SQRADDAC(a[4], a[13]); SQRADDAC(a[5], a[12]); SQRADDAC(a[6], a[11]); SQRADDAC(a[7], a[10]); SQRADDAC(a[8], a[9]); SQRADDDB;
-   COMBA_STORE(b[17]);
-
-   /* output 18 */
-   CARRY_FORWARD;
-   SQRADDSC(a[0], a[18]); SQRADDAC(a[1], a[17]); SQRADDAC(a[2], a[16]); SQRADDAC(a[3], a[15]); SQRADDAC(a[4], a[14]); SQRADDAC(a[5], a[13]); SQRADDAC(a[6], a[12]); SQRADDAC(a[7], a[11]); SQRADDAC(a[8], a[10]); SQRADDDB; SQRADD(a[9], a[9]);
-   COMBA_STORE(b[18]);
-
-   /* output 19 */
-   CARRY_FORWARD;
-   SQRADDSC(a[0], a[19]); SQRADDAC(a[1], a[18]); SQRADDAC(a[2], a[17]); SQRADDAC(a[3], a[16]); SQRADDAC(a[4], a[15]); SQRADDAC(a[5], a[14]); SQRADDAC(a[6], a[13]); SQRADDAC(a[7], a[12]); SQRADDAC(a[8], a[11]); SQRADDAC(a[9], a[10]); SQRADDDB;
-   COMBA_STORE(b[19]);
-
-   /* output 20 */
-   CARRY_FORWARD;
-   SQRADDSC(a[0], a[20]); SQRADDAC(a[1], a[19]); SQRADDAC(a[2], a[18]); SQRADDAC(a[3], a[17]); SQRADDAC(a[4], a[16]); SQRADDAC(a[5], a[15]); SQRADDAC(a[6], a[14]); SQRADDAC(a[7], a[13]); SQRADDAC(a[8], a[12]); SQRADDAC(a[9], a[11]); SQRADDDB; SQRADD(a[10], a[10]);
-   COMBA_STORE(b[20]);
-
-   /* output 21 */
-   CARRY_FORWARD;
-   SQRADDSC(a[0], a[21]); SQRADDAC(a[1], a[20]); SQRADDAC(a[2], a[19]); SQRADDAC(a[3], a[18]); SQRADDAC(a[4], a[17]); SQRADDAC(a[5], a[16]); SQRADDAC(a[6], a[15]); SQRADDAC(a[7], a[14]); SQRADDAC(a[8], a[13]); SQRADDAC(a[9], a[12]); SQRADDAC(a[10], a[11]); SQRADDDB;
-   COMBA_STORE(b[21]);
-
-   /* output 22 */
-   CARRY_FORWARD;
-   SQRADDSC(a[0], a[22]); SQRADDAC(a[1], a[21]); SQRADDAC(a[2], a[20]); SQRADDAC(a[3], a[19]); SQRADDAC(a[4], a[18]); SQRADDAC(a[5], a[17]); SQRADDAC(a[6], a[16]); SQRADDAC(a[7], a[15]); SQRADDAC(a[8], a[14]); SQRADDAC(a[9], a[13]); SQRADDAC(a[10], a[12]); SQRADDDB; SQRADD(a[11], a[11]);
-   COMBA_STORE(b[22]);
-
-   /* output 23 */
-   CARRY_FORWARD;
-   SQRADDSC(a[0], a[23]); SQRADDAC(a[1], a[22]); SQRADDAC(a[2], a[21]); SQRADDAC(a[3], a[20]); SQRADDAC(a[4], a[19]); SQRADDAC(a[5], a[18]); SQRADDAC(a[6], a[17]); SQRADDAC(a[7], a[16]); SQRADDAC(a[8], a[15]); SQRADDAC(a[9], a[14]); SQRADDAC(a[10], a[13]); SQRADDAC(a[11], a[12]); SQRADDDB;
-   COMBA_STORE(b[23]);
-
-   /* output 24 */
-   CARRY_FORWARD;
-   SQRADDSC(a[0], a[24]); SQRADDAC(a[1], a[23]); SQRADDAC(a[2], a[22]); SQRADDAC(a[3], a[21]); SQRADDAC(a[4], a[20]); SQRADDAC(a[5], a[19]); SQRADDAC(a[6], a[18]); SQRADDAC(a[7], a[17]); SQRADDAC(a[8], a[16]); SQRADDAC(a[9], a[15]); SQRADDAC(a[10], a[14]); SQRADDAC(a[11], a[13]); SQRADDDB; SQRADD(a[12], a[12]);
-   COMBA_STORE(b[24]);
-
-   /* output 25 */
-   CARRY_FORWARD;
-   SQRADDSC(a[0], a[25]); SQRADDAC(a[1], a[24]); SQRADDAC(a[2], a[23]); SQRADDAC(a[3], a[22]); SQRADDAC(a[4], a[21]); SQRADDAC(a[5], a[20]); SQRADDAC(a[6], a[19]); SQRADDAC(a[7], a[18]); SQRADDAC(a[8], a[17]); SQRADDAC(a[9], a[16]); SQRADDAC(a[10], a[15]); SQRADDAC(a[11], a[14]); SQRADDAC(a[12], a[13]); SQRADDDB;
-   COMBA_STORE(b[25]);
-
-   /* output 26 */
-   CARRY_FORWARD;
-   SQRADDSC(a[0], a[26]); SQRADDAC(a[1], a[25]); SQRADDAC(a[2], a[24]); SQRADDAC(a[3], a[23]); SQRADDAC(a[4], a[22]); SQRADDAC(a[5], a[21]); SQRADDAC(a[6], a[20]); SQRADDAC(a[7], a[19]); SQRADDAC(a[8], a[18]); SQRADDAC(a[9], a[17]); SQRADDAC(a[10], a[16]); SQRADDAC(a[11], a[15]); SQRADDAC(a[12], a[14]); SQRADDDB; SQRADD(a[13], a[13]);
-   COMBA_STORE(b[26]);
-
-   /* output 27 */
-   CARRY_FORWARD;
-   SQRADDSC(a[0], a[27]); SQRADDAC(a[1], a[26]); SQRADDAC(a[2], a[25]); SQRADDAC(a[3], a[24]); SQRADDAC(a[4], a[23]); SQRADDAC(a[5], a[22]); SQRADDAC(a[6], a[21]); SQRADDAC(a[7], a[20]); SQRADDAC(a[8], a[19]); SQRADDAC(a[9], a[18]); SQRADDAC(a[10], a[17]); SQRADDAC(a[11], a[16]); SQRADDAC(a[12], a[15]); SQRADDAC(a[13], a[14]); SQRADDDB;
-   COMBA_STORE(b[27]);
-
-   /* output 28 */
-   CARRY_FORWARD;
-   SQRADDSC(a[0], a[28]); SQRADDAC(a[1], a[27]); SQRADDAC(a[2], a[26]); SQRADDAC(a[3], a[25]); SQRADDAC(a[4], a[24]); SQRADDAC(a[5], a[23]); SQRADDAC(a[6], a[22]); SQRADDAC(a[7], a[21]); SQRADDAC(a[8], a[20]); SQRADDAC(a[9], a[19]); SQRADDAC(a[10], a[18]); SQRADDAC(a[11], a[17]); SQRADDAC(a[12], a[16]); SQRADDAC(a[13], a[15]); SQRADDDB; SQRADD(a[14], a[14]);
-   COMBA_STORE(b[28]);
-
-   /* output 29 */
-   CARRY_FORWARD;
-   SQRADDSC(a[0], a[29]); SQRADDAC(a[1], a[28]); SQRADDAC(a[2], a[27]); SQRADDAC(a[3], a[26]); SQRADDAC(a[4], a[25]); SQRADDAC(a[5], a[24]); SQRADDAC(a[6], a[23]); SQRADDAC(a[7], a[22]); SQRADDAC(a[8], a[21]); SQRADDAC(a[9], a[20]); SQRADDAC(a[10], a[19]); SQRADDAC(a[11], a[18]); SQRADDAC(a[12], a[17]); SQRADDAC(a[13], a[16]); SQRADDAC(a[14], a[15]); SQRADDDB;
-   COMBA_STORE(b[29]);
-
-   /* output 30 */
-   CARRY_FORWARD;
-   SQRADDSC(a[0], a[30]); SQRADDAC(a[1], a[29]); SQRADDAC(a[2], a[28]); SQRADDAC(a[3], a[27]); SQRADDAC(a[4], a[26]); SQRADDAC(a[5], a[25]); SQRADDAC(a[6], a[24]); SQRADDAC(a[7], a[23]); SQRADDAC(a[8], a[22]); SQRADDAC(a[9], a[21]); SQRADDAC(a[10], a[20]); SQRADDAC(a[11], a[19]); SQRADDAC(a[12], a[18]); SQRADDAC(a[13], a[17]); SQRADDAC(a[14], a[16]); SQRADDDB; SQRADD(a[15], a[15]);
-   COMBA_STORE(b[30]);
-
-   /* output 31 */
-   CARRY_FORWARD;
-   SQRADDSC(a[0], a[31]); SQRADDAC(a[1], a[30]); SQRADDAC(a[2], a[29]); SQRADDAC(a[3], a[28]); SQRADDAC(a[4], a[27]); SQRADDAC(a[5], a[26]); SQRADDAC(a[6], a[25]); SQRADDAC(a[7], a[24]); SQRADDAC(a[8], a[23]); SQRADDAC(a[9], a[22]); SQRADDAC(a[10], a[21]); SQRADDAC(a[11], a[20]); SQRADDAC(a[12], a[19]); SQRADDAC(a[13], a[18]); SQRADDAC(a[14], a[17]); SQRADDAC(a[15], a[16]); SQRADDDB;
-   COMBA_STORE(b[31]);
-
-   /* output 32 */
-   CARRY_FORWARD;
-   SQRADDSC(a[0], a[32]); SQRADDAC(a[1], a[31]); SQRADDAC(a[2], a[30]); SQRADDAC(a[3], a[29]); SQRADDAC(a[4], a[28]); SQRADDAC(a[5], a[27]); SQRADDAC(a[6], a[26]); SQRADDAC(a[7], a[25]); SQRADDAC(a[8], a[24]); SQRADDAC(a[9], a[23]); SQRADDAC(a[10], a[22]); SQRADDAC(a[11], a[21]); SQRADDAC(a[12], a[20]); SQRADDAC(a[13], a[19]); SQRADDAC(a[14], a[18]); SQRADDAC(a[15], a[17]); SQRADDDB; SQRADD(a[16], a[16]);
-   COMBA_STORE(b[32]);
-
-   /* output 33 */
-   CARRY_FORWARD;
-   SQRADDSC(a[0], a[33]); SQRADDAC(a[1], a[32]); SQRADDAC(a[2], a[31]); SQRADDAC(a[3], a[30]); SQRADDAC(a[4], a[29]); SQRADDAC(a[5], a[28]); SQRADDAC(a[6], a[27]); SQRADDAC(a[7], a[26]); SQRADDAC(a[8], a[25]); SQRADDAC(a[9], a[24]); SQRADDAC(a[10], a[23]); SQRADDAC(a[11], a[22]); SQRADDAC(a[12], a[21]); SQRADDAC(a[13], a[20]); SQRADDAC(a[14], a[19]); SQRADDAC(a[15], a[18]); SQRADDAC(a[16], a[17]); SQRADDDB;
-   COMBA_STORE(b[33]);
-
-   /* output 34 */
-   CARRY_FORWARD;
-   SQRADDSC(a[0], a[34]); SQRADDAC(a[1], a[33]); SQRADDAC(a[2], a[32]); SQRADDAC(a[3], a[31]); SQRADDAC(a[4], a[30]); SQRADDAC(a[5], a[29]); SQRADDAC(a[6], a[28]); SQRADDAC(a[7], a[27]); SQRADDAC(a[8], a[26]); SQRADDAC(a[9], a[25]); SQRADDAC(a[10], a[24]); SQRADDAC(a[11], a[23]); SQRADDAC(a[12], a[22]); SQRADDAC(a[13], a[21]); SQRADDAC(a[14], a[20]); SQRADDAC(a[15], a[19]); SQRADDAC(a[16], a[18]); SQRADDDB; SQRADD(a[17], a[17]);
-   COMBA_STORE(b[34]);
-
-   /* output 35 */
-   CARRY_FORWARD;
-   SQRADDSC(a[0], a[35]); SQRADDAC(a[1], a[34]); SQRADDAC(a[2], a[33]); SQRADDAC(a[3], a[32]); SQRADDAC(a[4], a[31]); SQRADDAC(a[5], a[30]); SQRADDAC(a[6], a[29]); SQRADDAC(a[7], a[28]); SQRADDAC(a[8], a[27]); SQRADDAC(a[9], a[26]); SQRADDAC(a[10], a[25]); SQRADDAC(a[11], a[24]); SQRADDAC(a[12], a[23]); SQRADDAC(a[13], a[22]); SQRADDAC(a[14], a[21]); SQRADDAC(a[15], a[20]); SQRADDAC(a[16], a[19]); SQRADDAC(a[17], a[18]); SQRADDDB;
-   COMBA_STORE(b[35]);
-
-   /* output 36 */
-   CARRY_FORWARD;
-   SQRADDSC(a[0], a[36]); SQRADDAC(a[1], a[35]); SQRADDAC(a[2], a[34]); SQRADDAC(a[3], a[33]); SQRADDAC(a[4], a[32]); SQRADDAC(a[5], a[31]); SQRADDAC(a[6], a[30]); SQRADDAC(a[7], a[29]); SQRADDAC(a[8], a[28]); SQRADDAC(a[9], a[27]); SQRADDAC(a[10], a[26]); SQRADDAC(a[11], a[25]); SQRADDAC(a[12], a[24]); SQRADDAC(a[13], a[23]); SQRADDAC(a[14], a[22]); SQRADDAC(a[15], a[21]); SQRADDAC(a[16], a[20]); SQRADDAC(a[17], a[19]); SQRADDDB; SQRADD(a[18], a[18]);
-   COMBA_STORE(b[36]);
-
-   /* output 37 */
-   CARRY_FORWARD;
-   SQRADDSC(a[0], a[37]); SQRADDAC(a[1], a[36]); SQRADDAC(a[2], a[35]); SQRADDAC(a[3], a[34]); SQRADDAC(a[4], a[33]); SQRADDAC(a[5], a[32]); SQRADDAC(a[6], a[31]); SQRADDAC(a[7], a[30]); SQRADDAC(a[8], a[29]); SQRADDAC(a[9], a[28]); SQRADDAC(a[10], a[27]); SQRADDAC(a[11], a[26]); SQRADDAC(a[12], a[25]); SQRADDAC(a[13], a[24]); SQRADDAC(a[14], a[23]); SQRADDAC(a[15], a[22]); SQRADDAC(a[16], a[21]); SQRADDAC(a[17], a[20]); SQRADDAC(a[18], a[19]); SQRADDDB;
-   COMBA_STORE(b[37]);
-
-   /* output 38 */
-   CARRY_FORWARD;
-   SQRADDSC(a[0], a[38]); SQRADDAC(a[1], a[37]); SQRADDAC(a[2], a[36]); SQRADDAC(a[3], a[35]); SQRADDAC(a[4], a[34]); SQRADDAC(a[5], a[33]); SQRADDAC(a[6], a[32]); SQRADDAC(a[7], a[31]); SQRADDAC(a[8], a[30]); SQRADDAC(a[9], a[29]); SQRADDAC(a[10], a[28]); SQRADDAC(a[11], a[27]); SQRADDAC(a[12], a[26]); SQRADDAC(a[13], a[25]); SQRADDAC(a[14], a[24]); SQRADDAC(a[15], a[23]); SQRADDAC(a[16], a[22]); SQRADDAC(a[17], a[21]); SQRADDAC(a[18], a[20]); SQRADDDB; SQRADD(a[19], a[19]);
-   COMBA_STORE(b[38]);
-
-   /* output 39 */
-   CARRY_FORWARD;
-   SQRADDSC(a[0], a[39]); SQRADDAC(a[1], a[38]); SQRADDAC(a[2], a[37]); SQRADDAC(a[3], a[36]); SQRADDAC(a[4], a[35]); SQRADDAC(a[5], a[34]); SQRADDAC(a[6], a[33]); SQRADDAC(a[7], a[32]); SQRADDAC(a[8], a[31]); SQRADDAC(a[9], a[30]); SQRADDAC(a[10], a[29]); SQRADDAC(a[11], a[28]); SQRADDAC(a[12], a[27]); SQRADDAC(a[13], a[26]); SQRADDAC(a[14], a[25]); SQRADDAC(a[15], a[24]); SQRADDAC(a[16], a[23]); SQRADDAC(a[17], a[22]); SQRADDAC(a[18], a[21]); SQRADDAC(a[19], a[20]); SQRADDDB;
-   COMBA_STORE(b[39]);
-
-   /* output 40 */
-   CARRY_FORWARD;
-   SQRADDSC(a[0], a[40]); SQRADDAC(a[1], a[39]); SQRADDAC(a[2], a[38]); SQRADDAC(a[3], a[37]); SQRADDAC(a[4], a[36]); SQRADDAC(a[5], a[35]); SQRADDAC(a[6], a[34]); SQRADDAC(a[7], a[33]); SQRADDAC(a[8], a[32]); SQRADDAC(a[9], a[31]); SQRADDAC(a[10], a[30]); SQRADDAC(a[11], a[29]); SQRADDAC(a[12], a[28]); SQRADDAC(a[13], a[27]); SQRADDAC(a[14], a[26]); SQRADDAC(a[15], a[25]); SQRADDAC(a[16], a[24]); SQRADDAC(a[17], a[23]); SQRADDAC(a[18], a[22]); SQRADDAC(a[19], a[21]); SQRADDDB; SQRADD(a[20], a[20]);
-   COMBA_STORE(b[40]);
-
-   /* output 41 */
-   CARRY_FORWARD;
-   SQRADDSC(a[0], a[41]); SQRADDAC(a[1], a[40]); SQRADDAC(a[2], a[39]); SQRADDAC(a[3], a[38]); SQRADDAC(a[4], a[37]); SQRADDAC(a[5], a[36]); SQRADDAC(a[6], a[35]); SQRADDAC(a[7], a[34]); SQRADDAC(a[8], a[33]); SQRADDAC(a[9], a[32]); SQRADDAC(a[10], a[31]); SQRADDAC(a[11], a[30]); SQRADDAC(a[12], a[29]); SQRADDAC(a[13], a[28]); SQRADDAC(a[14], a[27]); SQRADDAC(a[15], a[26]); SQRADDAC(a[16], a[25]); SQRADDAC(a[17], a[24]); SQRADDAC(a[18], a[23]); SQRADDAC(a[19], a[22]); SQRADDAC(a[20], a[21]); SQRADDDB;
-   COMBA_STORE(b[41]);
-
-   /* output 42 */
-   CARRY_FORWARD;
-   SQRADDSC(a[0], a[42]); SQRADDAC(a[1], a[41]); SQRADDAC(a[2], a[40]); SQRADDAC(a[3], a[39]); SQRADDAC(a[4], a[38]); SQRADDAC(a[5], a[37]); SQRADDAC(a[6], a[36]); SQRADDAC(a[7], a[35]); SQRADDAC(a[8], a[34]); SQRADDAC(a[9], a[33]); SQRADDAC(a[10], a[32]); SQRADDAC(a[11], a[31]); SQRADDAC(a[12], a[30]); SQRADDAC(a[13], a[29]); SQRADDAC(a[14], a[28]); SQRADDAC(a[15], a[27]); SQRADDAC(a[16], a[26]); SQRADDAC(a[17], a[25]); SQRADDAC(a[18], a[24]); SQRADDAC(a[19], a[23]); SQRADDAC(a[20], a[22]); SQRADDDB; SQRADD(a[21], a[21]);
-   COMBA_STORE(b[42]);
-
-   /* output 43 */
-   CARRY_FORWARD;
-   SQRADDSC(a[0], a[43]); SQRADDAC(a[1], a[42]); SQRADDAC(a[2], a[41]); SQRADDAC(a[3], a[40]); SQRADDAC(a[4], a[39]); SQRADDAC(a[5], a[38]); SQRADDAC(a[6], a[37]); SQRADDAC(a[7], a[36]); SQRADDAC(a[8], a[35]); SQRADDAC(a[9], a[34]); SQRADDAC(a[10], a[33]); SQRADDAC(a[11], a[32]); SQRADDAC(a[12], a[31]); SQRADDAC(a[13], a[30]); SQRADDAC(a[14], a[29]); SQRADDAC(a[15], a[28]); SQRADDAC(a[16], a[27]); SQRADDAC(a[17], a[26]); SQRADDAC(a[18], a[25]); SQRADDAC(a[19], a[24]); SQRADDAC(a[20], a[23]); SQRADDAC(a[21], a[22]); SQRADDDB;
-   COMBA_STORE(b[43]);
-
-   /* output 44 */
-   CARRY_FORWARD;
-   SQRADDSC(a[0], a[44]); SQRADDAC(a[1], a[43]); SQRADDAC(a[2], a[42]); SQRADDAC(a[3], a[41]); SQRADDAC(a[4], a[40]); SQRADDAC(a[5], a[39]); SQRADDAC(a[6], a[38]); SQRADDAC(a[7], a[37]); SQRADDAC(a[8], a[36]); SQRADDAC(a[9], a[35]); SQRADDAC(a[10], a[34]); SQRADDAC(a[11], a[33]); SQRADDAC(a[12], a[32]); SQRADDAC(a[13], a[31]); SQRADDAC(a[14], a[30]); SQRADDAC(a[15], a[29]); SQRADDAC(a[16], a[28]); SQRADDAC(a[17], a[27]); SQRADDAC(a[18], a[26]); SQRADDAC(a[19], a[25]); SQRADDAC(a[20], a[24]); SQRADDAC(a[21], a[23]); SQRADDDB; SQRADD(a[22], a[22]);
-   COMBA_STORE(b[44]);
-
-   /* output 45 */
-   CARRY_FORWARD;
-   SQRADDSC(a[0], a[45]); SQRADDAC(a[1], a[44]); SQRADDAC(a[2], a[43]); SQRADDAC(a[3], a[42]); SQRADDAC(a[4], a[41]); SQRADDAC(a[5], a[40]); SQRADDAC(a[6], a[39]); SQRADDAC(a[7], a[38]); SQRADDAC(a[8], a[37]); SQRADDAC(a[9], a[36]); SQRADDAC(a[10], a[35]); SQRADDAC(a[11], a[34]); SQRADDAC(a[12], a[33]); SQRADDAC(a[13], a[32]); SQRADDAC(a[14], a[31]); SQRADDAC(a[15], a[30]); SQRADDAC(a[16], a[29]); SQRADDAC(a[17], a[28]); SQRADDAC(a[18], a[27]); SQRADDAC(a[19], a[26]); SQRADDAC(a[20], a[25]); SQRADDAC(a[21], a[24]); SQRADDAC(a[22], a[23]); SQRADDDB;
-   COMBA_STORE(b[45]);
-
-   /* output 46 */
-   CARRY_FORWARD;
-   SQRADDSC(a[0], a[46]); SQRADDAC(a[1], a[45]); SQRADDAC(a[2], a[44]); SQRADDAC(a[3], a[43]); SQRADDAC(a[4], a[42]); SQRADDAC(a[5], a[41]); SQRADDAC(a[6], a[40]); SQRADDAC(a[7], a[39]); SQRADDAC(a[8], a[38]); SQRADDAC(a[9], a[37]); SQRADDAC(a[10], a[36]); SQRADDAC(a[11], a[35]); SQRADDAC(a[12], a[34]); SQRADDAC(a[13], a[33]); SQRADDAC(a[14], a[32]); SQRADDAC(a[15], a[31]); SQRADDAC(a[16], a[30]); SQRADDAC(a[17], a[29]); SQRADDAC(a[18], a[28]); SQRADDAC(a[19], a[27]); SQRADDAC(a[20], a[26]); SQRADDAC(a[21], a[25]); SQRADDAC(a[22], a[24]); SQRADDDB; SQRADD(a[23], a[23]);
-   COMBA_STORE(b[46]);
-
-   /* output 47 */
-   CARRY_FORWARD;
-   SQRADDSC(a[0], a[47]); SQRADDAC(a[1], a[46]); SQRADDAC(a[2], a[45]); SQRADDAC(a[3], a[44]); SQRADDAC(a[4], a[43]); SQRADDAC(a[5], a[42]); SQRADDAC(a[6], a[41]); SQRADDAC(a[7], a[40]); SQRADDAC(a[8], a[39]); SQRADDAC(a[9], a[38]); SQRADDAC(a[10], a[37]); SQRADDAC(a[11], a[36]); SQRADDAC(a[12], a[35]); SQRADDAC(a[13], a[34]); SQRADDAC(a[14], a[33]); SQRADDAC(a[15], a[32]); SQRADDAC(a[16], a[31]); SQRADDAC(a[17], a[30]); SQRADDAC(a[18], a[29]); SQRADDAC(a[19], a[28]); SQRADDAC(a[20], a[27]); SQRADDAC(a[21], a[26]); SQRADDAC(a[22], a[25]); SQRADDAC(a[23], a[24]); SQRADDDB;
-   COMBA_STORE(b[47]);
-
-   /* output 48 */
-   CARRY_FORWARD;
-   SQRADDSC(a[0], a[48]); SQRADDAC(a[1], a[47]); SQRADDAC(a[2], a[46]); SQRADDAC(a[3], a[45]); SQRADDAC(a[4], a[44]); SQRADDAC(a[5], a[43]); SQRADDAC(a[6], a[42]); SQRADDAC(a[7], a[41]); SQRADDAC(a[8], a[40]); SQRADDAC(a[9], a[39]); SQRADDAC(a[10], a[38]); SQRADDAC(a[11], a[37]); SQRADDAC(a[12], a[36]); SQRADDAC(a[13], a[35]); SQRADDAC(a[14], a[34]); SQRADDAC(a[15], a[33]); SQRADDAC(a[16], a[32]); SQRADDAC(a[17], a[31]); SQRADDAC(a[18], a[30]); SQRADDAC(a[19], a[29]); SQRADDAC(a[20], a[28]); SQRADDAC(a[21], a[27]); SQRADDAC(a[22], a[26]); SQRADDAC(a[23], a[25]); SQRADDDB; SQRADD(a[24], a[24]);
-   COMBA_STORE(b[48]);
-
-   /* output 49 */
-   CARRY_FORWARD;
-   SQRADDSC(a[0], a[49]); SQRADDAC(a[1], a[48]); SQRADDAC(a[2], a[47]); SQRADDAC(a[3], a[46]); SQRADDAC(a[4], a[45]); SQRADDAC(a[5], a[44]); SQRADDAC(a[6], a[43]); SQRADDAC(a[7], a[42]); SQRADDAC(a[8], a[41]); SQRADDAC(a[9], a[40]); SQRADDAC(a[10], a[39]); SQRADDAC(a[11], a[38]); SQRADDAC(a[12], a[37]); SQRADDAC(a[13], a[36]); SQRADDAC(a[14], a[35]); SQRADDAC(a[15], a[34]); SQRADDAC(a[16], a[33]); SQRADDAC(a[17], a[32]); SQRADDAC(a[18], a[31]); SQRADDAC(a[19], a[30]); SQRADDAC(a[20], a[29]); SQRADDAC(a[21], a[28]); SQRADDAC(a[22], a[27]); SQRADDAC(a[23], a[26]); SQRADDAC(a[24], a[25]); SQRADDDB;
-   COMBA_STORE(b[49]);
-
-   /* output 50 */
-   CARRY_FORWARD;
-   SQRADDSC(a[0], a[50]); SQRADDAC(a[1], a[49]); SQRADDAC(a[2], a[48]); SQRADDAC(a[3], a[47]); SQRADDAC(a[4], a[46]); SQRADDAC(a[5], a[45]); SQRADDAC(a[6], a[44]); SQRADDAC(a[7], a[43]); SQRADDAC(a[8], a[42]); SQRADDAC(a[9], a[41]); SQRADDAC(a[10], a[40]); SQRADDAC(a[11], a[39]); SQRADDAC(a[12], a[38]); SQRADDAC(a[13], a[37]); SQRADDAC(a[14], a[36]); SQRADDAC(a[15], a[35]); SQRADDAC(a[16], a[34]); SQRADDAC(a[17], a[33]); SQRADDAC(a[18], a[32]); SQRADDAC(a[19], a[31]); SQRADDAC(a[20], a[30]); SQRADDAC(a[21], a[29]); SQRADDAC(a[22], a[28]); SQRADDAC(a[23], a[27]); SQRADDAC(a[24], a[26]); SQRADDDB; SQRADD(a[25], a[25]);
-   COMBA_STORE(b[50]);
-
-   /* output 51 */
-   CARRY_FORWARD;
-   SQRADDSC(a[0], a[51]); SQRADDAC(a[1], a[50]); SQRADDAC(a[2], a[49]); SQRADDAC(a[3], a[48]); SQRADDAC(a[4], a[47]); SQRADDAC(a[5], a[46]); SQRADDAC(a[6], a[45]); SQRADDAC(a[7], a[44]); SQRADDAC(a[8], a[43]); SQRADDAC(a[9], a[42]); SQRADDAC(a[10], a[41]); SQRADDAC(a[11], a[40]); SQRADDAC(a[12], a[39]); SQRADDAC(a[13], a[38]); SQRADDAC(a[14], a[37]); SQRADDAC(a[15], a[36]); SQRADDAC(a[16], a[35]); SQRADDAC(a[17], a[34]); SQRADDAC(a[18], a[33]); SQRADDAC(a[19], a[32]); SQRADDAC(a[20], a[31]); SQRADDAC(a[21], a[30]); SQRADDAC(a[22], a[29]); SQRADDAC(a[23], a[28]); SQRADDAC(a[24], a[27]); SQRADDAC(a[25], a[26]); SQRADDDB;
-   COMBA_STORE(b[51]);
-
-   /* output 52 */
-   CARRY_FORWARD;
-   SQRADDSC(a[0], a[52]); SQRADDAC(a[1], a[51]); SQRADDAC(a[2], a[50]); SQRADDAC(a[3], a[49]); SQRADDAC(a[4], a[48]); SQRADDAC(a[5], a[47]); SQRADDAC(a[6], a[46]); SQRADDAC(a[7], a[45]); SQRADDAC(a[8], a[44]); SQRADDAC(a[9], a[43]); SQRADDAC(a[10], a[42]); SQRADDAC(a[11], a[41]); SQRADDAC(a[12], a[40]); SQRADDAC(a[13], a[39]); SQRADDAC(a[14], a[38]); SQRADDAC(a[15], a[37]); SQRADDAC(a[16], a[36]); SQRADDAC(a[17], a[35]); SQRADDAC(a[18], a[34]); SQRADDAC(a[19], a[33]); SQRADDAC(a[20], a[32]); SQRADDAC(a[21], a[31]); SQRADDAC(a[22], a[30]); SQRADDAC(a[23], a[29]); SQRADDAC(a[24], a[28]); SQRADDAC(a[25], a[27]); SQRADDDB; SQRADD(a[26], a[26]);
-   COMBA_STORE(b[52]);
-
-   /* output 53 */
-   CARRY_FORWARD;
-   SQRADDSC(a[0], a[53]); SQRADDAC(a[1], a[52]); SQRADDAC(a[2], a[51]); SQRADDAC(a[3], a[50]); SQRADDAC(a[4], a[49]); SQRADDAC(a[5], a[48]); SQRADDAC(a[6], a[47]); SQRADDAC(a[7], a[46]); SQRADDAC(a[8], a[45]); SQRADDAC(a[9], a[44]); SQRADDAC(a[10], a[43]); SQRADDAC(a[11], a[42]); SQRADDAC(a[12], a[41]); SQRADDAC(a[13], a[40]); SQRADDAC(a[14], a[39]); SQRADDAC(a[15], a[38]); SQRADDAC(a[16], a[37]); SQRADDAC(a[17], a[36]); SQRADDAC(a[18], a[35]); SQRADDAC(a[19], a[34]); SQRADDAC(a[20], a[33]); SQRADDAC(a[21], a[32]); SQRADDAC(a[22], a[31]); SQRADDAC(a[23], a[30]); SQRADDAC(a[24], a[29]); SQRADDAC(a[25], a[28]); SQRADDAC(a[26], a[27]); SQRADDDB;
-   COMBA_STORE(b[53]);
-
-   /* output 54 */
-   CARRY_FORWARD;
-   SQRADDSC(a[0], a[54]); SQRADDAC(a[1], a[53]); SQRADDAC(a[2], a[52]); SQRADDAC(a[3], a[51]); SQRADDAC(a[4], a[50]); SQRADDAC(a[5], a[49]); SQRADDAC(a[6], a[48]); SQRADDAC(a[7], a[47]); SQRADDAC(a[8], a[46]); SQRADDAC(a[9], a[45]); SQRADDAC(a[10], a[44]); SQRADDAC(a[11], a[43]); SQRADDAC(a[12], a[42]); SQRADDAC(a[13], a[41]); SQRADDAC(a[14], a[40]); SQRADDAC(a[15], a[39]); SQRADDAC(a[16], a[38]); SQRADDAC(a[17], a[37]); SQRADDAC(a[18], a[36]); SQRADDAC(a[19], a[35]); SQRADDAC(a[20], a[34]); SQRADDAC(a[21], a[33]); SQRADDAC(a[22], a[32]); SQRADDAC(a[23], a[31]); SQRADDAC(a[24], a[30]); SQRADDAC(a[25], a[29]); SQRADDAC(a[26], a[28]); SQRADDDB; SQRADD(a[27], a[27]);
-   COMBA_STORE(b[54]);
-
-   /* output 55 */
-   CARRY_FORWARD;
-   SQRADDSC(a[0], a[55]); SQRADDAC(a[1], a[54]); SQRADDAC(a[2], a[53]); SQRADDAC(a[3], a[52]); SQRADDAC(a[4], a[51]); SQRADDAC(a[5], a[50]); SQRADDAC(a[6], a[49]); SQRADDAC(a[7], a[48]); SQRADDAC(a[8], a[47]); SQRADDAC(a[9], a[46]); SQRADDAC(a[10], a[45]); SQRADDAC(a[11], a[44]); SQRADDAC(a[12], a[43]); SQRADDAC(a[13], a[42]); SQRADDAC(a[14], a[41]); SQRADDAC(a[15], a[40]); SQRADDAC(a[16], a[39]); SQRADDAC(a[17], a[38]); SQRADDAC(a[18], a[37]); SQRADDAC(a[19], a[36]); SQRADDAC(a[20], a[35]); SQRADDAC(a[21], a[34]); SQRADDAC(a[22], a[33]); SQRADDAC(a[23], a[32]); SQRADDAC(a[24], a[31]); SQRADDAC(a[25], a[30]); SQRADDAC(a[26], a[29]); SQRADDAC(a[27], a[28]); SQRADDDB;
-   COMBA_STORE(b[55]);
-
-   /* output 56 */
-   CARRY_FORWARD;
-   SQRADDSC(a[0], a[56]); SQRADDAC(a[1], a[55]); SQRADDAC(a[2], a[54]); SQRADDAC(a[3], a[53]); SQRADDAC(a[4], a[52]); SQRADDAC(a[5], a[51]); SQRADDAC(a[6], a[50]); SQRADDAC(a[7], a[49]); SQRADDAC(a[8], a[48]); SQRADDAC(a[9], a[47]); SQRADDAC(a[10], a[46]); SQRADDAC(a[11], a[45]); SQRADDAC(a[12], a[44]); SQRADDAC(a[13], a[43]); SQRADDAC(a[14], a[42]); SQRADDAC(a[15], a[41]); SQRADDAC(a[16], a[40]); SQRADDAC(a[17], a[39]); SQRADDAC(a[18], a[38]); SQRADDAC(a[19], a[37]); SQRADDAC(a[20], a[36]); SQRADDAC(a[21], a[35]); SQRADDAC(a[22], a[34]); SQRADDAC(a[23], a[33]); SQRADDAC(a[24], a[32]); SQRADDAC(a[25], a[31]); SQRADDAC(a[26], a[30]); SQRADDAC(a[27], a[29]); SQRADDDB; SQRADD(a[28], a[28]);
-   COMBA_STORE(b[56]);
-
-   /* output 57 */
-   CARRY_FORWARD;
-   SQRADDSC(a[0], a[57]); SQRADDAC(a[1], a[56]); SQRADDAC(a[2], a[55]); SQRADDAC(a[3], a[54]); SQRADDAC(a[4], a[53]); SQRADDAC(a[5], a[52]); SQRADDAC(a[6], a[51]); SQRADDAC(a[7], a[50]); SQRADDAC(a[8], a[49]); SQRADDAC(a[9], a[48]); SQRADDAC(a[10], a[47]); SQRADDAC(a[11], a[46]); SQRADDAC(a[12], a[45]); SQRADDAC(a[13], a[44]); SQRADDAC(a[14], a[43]); SQRADDAC(a[15], a[42]); SQRADDAC(a[16], a[41]); SQRADDAC(a[17], a[40]); SQRADDAC(a[18], a[39]); SQRADDAC(a[19], a[38]); SQRADDAC(a[20], a[37]); SQRADDAC(a[21], a[36]); SQRADDAC(a[22], a[35]); SQRADDAC(a[23], a[34]); SQRADDAC(a[24], a[33]); SQRADDAC(a[25], a[32]); SQRADDAC(a[26], a[31]); SQRADDAC(a[27], a[30]); SQRADDAC(a[28], a[29]); SQRADDDB;
-   COMBA_STORE(b[57]);
-
-   /* output 58 */
-   CARRY_FORWARD;
-   SQRADDSC(a[0], a[58]); SQRADDAC(a[1], a[57]); SQRADDAC(a[2], a[56]); SQRADDAC(a[3], a[55]); SQRADDAC(a[4], a[54]); SQRADDAC(a[5], a[53]); SQRADDAC(a[6], a[52]); SQRADDAC(a[7], a[51]); SQRADDAC(a[8], a[50]); SQRADDAC(a[9], a[49]); SQRADDAC(a[10], a[48]); SQRADDAC(a[11], a[47]); SQRADDAC(a[12], a[46]); SQRADDAC(a[13], a[45]); SQRADDAC(a[14], a[44]); SQRADDAC(a[15], a[43]); SQRADDAC(a[16], a[42]); SQRADDAC(a[17], a[41]); SQRADDAC(a[18], a[40]); SQRADDAC(a[19], a[39]); SQRADDAC(a[20], a[38]); SQRADDAC(a[21], a[37]); SQRADDAC(a[22], a[36]); SQRADDAC(a[23], a[35]); SQRADDAC(a[24], a[34]); SQRADDAC(a[25], a[33]); SQRADDAC(a[26], a[32]); SQRADDAC(a[27], a[31]); SQRADDAC(a[28], a[30]); SQRADDDB; SQRADD(a[29], a[29]);
-   COMBA_STORE(b[58]);
-
-   /* output 59 */
-   CARRY_FORWARD;
-   SQRADDSC(a[0], a[59]); SQRADDAC(a[1], a[58]); SQRADDAC(a[2], a[57]); SQRADDAC(a[3], a[56]); SQRADDAC(a[4], a[55]); SQRADDAC(a[5], a[54]); SQRADDAC(a[6], a[53]); SQRADDAC(a[7], a[52]); SQRADDAC(a[8], a[51]); SQRADDAC(a[9], a[50]); SQRADDAC(a[10], a[49]); SQRADDAC(a[11], a[48]); SQRADDAC(a[12], a[47]); SQRADDAC(a[13], a[46]); SQRADDAC(a[14], a[45]); SQRADDAC(a[15], a[44]); SQRADDAC(a[16], a[43]); SQRADDAC(a[17], a[42]); SQRADDAC(a[18], a[41]); SQRADDAC(a[19], a[40]); SQRADDAC(a[20], a[39]); SQRADDAC(a[21], a[38]); SQRADDAC(a[22], a[37]); SQRADDAC(a[23], a[36]); SQRADDAC(a[24], a[35]); SQRADDAC(a[25], a[34]); SQRADDAC(a[26], a[33]); SQRADDAC(a[27], a[32]); SQRADDAC(a[28], a[31]); SQRADDAC(a[29], a[30]); SQRADDDB;
-   COMBA_STORE(b[59]);
-
-   /* output 60 */
-   CARRY_FORWARD;
-   SQRADDSC(a[0], a[60]); SQRADDAC(a[1], a[59]); SQRADDAC(a[2], a[58]); SQRADDAC(a[3], a[57]); SQRADDAC(a[4], a[56]); SQRADDAC(a[5], a[55]); SQRADDAC(a[6], a[54]); SQRADDAC(a[7], a[53]); SQRADDAC(a[8], a[52]); SQRADDAC(a[9], a[51]); SQRADDAC(a[10], a[50]); SQRADDAC(a[11], a[49]); SQRADDAC(a[12], a[48]); SQRADDAC(a[13], a[47]); SQRADDAC(a[14], a[46]); SQRADDAC(a[15], a[45]); SQRADDAC(a[16], a[44]); SQRADDAC(a[17], a[43]); SQRADDAC(a[18], a[42]); SQRADDAC(a[19], a[41]); SQRADDAC(a[20], a[40]); SQRADDAC(a[21], a[39]); SQRADDAC(a[22], a[38]); SQRADDAC(a[23], a[37]); SQRADDAC(a[24], a[36]); SQRADDAC(a[25], a[35]); SQRADDAC(a[26], a[34]); SQRADDAC(a[27], a[33]); SQRADDAC(a[28], a[32]); SQRADDAC(a[29], a[31]); SQRADDDB; SQRADD(a[30], a[30]);
-   COMBA_STORE(b[60]);
-
-   /* output 61 */
-   CARRY_FORWARD;
-   SQRADDSC(a[0], a[61]); SQRADDAC(a[1], a[60]); SQRADDAC(a[2], a[59]); SQRADDAC(a[3], a[58]); SQRADDAC(a[4], a[57]); SQRADDAC(a[5], a[56]); SQRADDAC(a[6], a[55]); SQRADDAC(a[7], a[54]); SQRADDAC(a[8], a[53]); SQRADDAC(a[9], a[52]); SQRADDAC(a[10], a[51]); SQRADDAC(a[11], a[50]); SQRADDAC(a[12], a[49]); SQRADDAC(a[13], a[48]); SQRADDAC(a[14], a[47]); SQRADDAC(a[15], a[46]); SQRADDAC(a[16], a[45]); SQRADDAC(a[17], a[44]); SQRADDAC(a[18], a[43]); SQRADDAC(a[19], a[42]); SQRADDAC(a[20], a[41]); SQRADDAC(a[21], a[40]); SQRADDAC(a[22], a[39]); SQRADDAC(a[23], a[38]); SQRADDAC(a[24], a[37]); SQRADDAC(a[25], a[36]); SQRADDAC(a[26], a[35]); SQRADDAC(a[27], a[34]); SQRADDAC(a[28], a[33]); SQRADDAC(a[29], a[32]); SQRADDAC(a[30], a[31]); SQRADDDB;
-   COMBA_STORE(b[61]);
-
-   /* output 62 */
-   CARRY_FORWARD;
-   SQRADDSC(a[0], a[62]); SQRADDAC(a[1], a[61]); SQRADDAC(a[2], a[60]); SQRADDAC(a[3], a[59]); SQRADDAC(a[4], a[58]); SQRADDAC(a[5], a[57]); SQRADDAC(a[6], a[56]); SQRADDAC(a[7], a[55]); SQRADDAC(a[8], a[54]); SQRADDAC(a[9], a[53]); SQRADDAC(a[10], a[52]); SQRADDAC(a[11], a[51]); SQRADDAC(a[12], a[50]); SQRADDAC(a[13], a[49]); SQRADDAC(a[14], a[48]); SQRADDAC(a[15], a[47]); SQRADDAC(a[16], a[46]); SQRADDAC(a[17], a[45]); SQRADDAC(a[18], a[44]); SQRADDAC(a[19], a[43]); SQRADDAC(a[20], a[42]); SQRADDAC(a[21], a[41]); SQRADDAC(a[22], a[40]); SQRADDAC(a[23], a[39]); SQRADDAC(a[24], a[38]); SQRADDAC(a[25], a[37]); SQRADDAC(a[26], a[36]); SQRADDAC(a[27], a[35]); SQRADDAC(a[28], a[34]); SQRADDAC(a[29], a[33]); SQRADDAC(a[30], a[32]); SQRADDDB; SQRADD(a[31], a[31]);
-   COMBA_STORE(b[62]);
-
-   /* output 63 */
-   CARRY_FORWARD;
-   SQRADDSC(a[0], a[63]); SQRADDAC(a[1], a[62]); SQRADDAC(a[2], a[61]); SQRADDAC(a[3], a[60]); SQRADDAC(a[4], a[59]); SQRADDAC(a[5], a[58]); SQRADDAC(a[6], a[57]); SQRADDAC(a[7], a[56]); SQRADDAC(a[8], a[55]); SQRADDAC(a[9], a[54]); SQRADDAC(a[10], a[53]); SQRADDAC(a[11], a[52]); SQRADDAC(a[12], a[51]); SQRADDAC(a[13], a[50]); SQRADDAC(a[14], a[49]); SQRADDAC(a[15], a[48]); SQRADDAC(a[16], a[47]); SQRADDAC(a[17], a[46]); SQRADDAC(a[18], a[45]); SQRADDAC(a[19], a[44]); SQRADDAC(a[20], a[43]); SQRADDAC(a[21], a[42]); SQRADDAC(a[22], a[41]); SQRADDAC(a[23], a[40]); SQRADDAC(a[24], a[39]); SQRADDAC(a[25], a[38]); SQRADDAC(a[26], a[37]); SQRADDAC(a[27], a[36]); SQRADDAC(a[28], a[35]); SQRADDAC(a[29], a[34]); SQRADDAC(a[30], a[33]); SQRADDAC(a[31], a[32]); SQRADDDB;
-   COMBA_STORE(b[63]);
-
-   /* output 64 */
-   CARRY_FORWARD;
-   SQRADDSC(a[1], a[63]); SQRADDAC(a[2], a[62]); SQRADDAC(a[3], a[61]); SQRADDAC(a[4], a[60]); SQRADDAC(a[5], a[59]); SQRADDAC(a[6], a[58]); SQRADDAC(a[7], a[57]); SQRADDAC(a[8], a[56]); SQRADDAC(a[9], a[55]); SQRADDAC(a[10], a[54]); SQRADDAC(a[11], a[53]); SQRADDAC(a[12], a[52]); SQRADDAC(a[13], a[51]); SQRADDAC(a[14], a[50]); SQRADDAC(a[15], a[49]); SQRADDAC(a[16], a[48]); SQRADDAC(a[17], a[47]); SQRADDAC(a[18], a[46]); SQRADDAC(a[19], a[45]); SQRADDAC(a[20], a[44]); SQRADDAC(a[21], a[43]); SQRADDAC(a[22], a[42]); SQRADDAC(a[23], a[41]); SQRADDAC(a[24], a[40]); SQRADDAC(a[25], a[39]); SQRADDAC(a[26], a[38]); SQRADDAC(a[27], a[37]); SQRADDAC(a[28], a[36]); SQRADDAC(a[29], a[35]); SQRADDAC(a[30], a[34]); SQRADDAC(a[31], a[33]); SQRADDDB; SQRADD(a[32], a[32]);
-   COMBA_STORE(b[64]);
-
-   /* output 65 */
-   CARRY_FORWARD;
-   SQRADDSC(a[2], a[63]); SQRADDAC(a[3], a[62]); SQRADDAC(a[4], a[61]); SQRADDAC(a[5], a[60]); SQRADDAC(a[6], a[59]); SQRADDAC(a[7], a[58]); SQRADDAC(a[8], a[57]); SQRADDAC(a[9], a[56]); SQRADDAC(a[10], a[55]); SQRADDAC(a[11], a[54]); SQRADDAC(a[12], a[53]); SQRADDAC(a[13], a[52]); SQRADDAC(a[14], a[51]); SQRADDAC(a[15], a[50]); SQRADDAC(a[16], a[49]); SQRADDAC(a[17], a[48]); SQRADDAC(a[18], a[47]); SQRADDAC(a[19], a[46]); SQRADDAC(a[20], a[45]); SQRADDAC(a[21], a[44]); SQRADDAC(a[22], a[43]); SQRADDAC(a[23], a[42]); SQRADDAC(a[24], a[41]); SQRADDAC(a[25], a[40]); SQRADDAC(a[26], a[39]); SQRADDAC(a[27], a[38]); SQRADDAC(a[28], a[37]); SQRADDAC(a[29], a[36]); SQRADDAC(a[30], a[35]); SQRADDAC(a[31], a[34]); SQRADDAC(a[32], a[33]); SQRADDDB;
-   COMBA_STORE(b[65]);
-
-   /* output 66 */
-   CARRY_FORWARD;
-   SQRADDSC(a[3], a[63]); SQRADDAC(a[4], a[62]); SQRADDAC(a[5], a[61]); SQRADDAC(a[6], a[60]); SQRADDAC(a[7], a[59]); SQRADDAC(a[8], a[58]); SQRADDAC(a[9], a[57]); SQRADDAC(a[10], a[56]); SQRADDAC(a[11], a[55]); SQRADDAC(a[12], a[54]); SQRADDAC(a[13], a[53]); SQRADDAC(a[14], a[52]); SQRADDAC(a[15], a[51]); SQRADDAC(a[16], a[50]); SQRADDAC(a[17], a[49]); SQRADDAC(a[18], a[48]); SQRADDAC(a[19], a[47]); SQRADDAC(a[20], a[46]); SQRADDAC(a[21], a[45]); SQRADDAC(a[22], a[44]); SQRADDAC(a[23], a[43]); SQRADDAC(a[24], a[42]); SQRADDAC(a[25], a[41]); SQRADDAC(a[26], a[40]); SQRADDAC(a[27], a[39]); SQRADDAC(a[28], a[38]); SQRADDAC(a[29], a[37]); SQRADDAC(a[30], a[36]); SQRADDAC(a[31], a[35]); SQRADDAC(a[32], a[34]); SQRADDDB; SQRADD(a[33], a[33]);
-   COMBA_STORE(b[66]);
-
-   /* output 67 */
-   CARRY_FORWARD;
-   SQRADDSC(a[4], a[63]); SQRADDAC(a[5], a[62]); SQRADDAC(a[6], a[61]); SQRADDAC(a[7], a[60]); SQRADDAC(a[8], a[59]); SQRADDAC(a[9], a[58]); SQRADDAC(a[10], a[57]); SQRADDAC(a[11], a[56]); SQRADDAC(a[12], a[55]); SQRADDAC(a[13], a[54]); SQRADDAC(a[14], a[53]); SQRADDAC(a[15], a[52]); SQRADDAC(a[16], a[51]); SQRADDAC(a[17], a[50]); SQRADDAC(a[18], a[49]); SQRADDAC(a[19], a[48]); SQRADDAC(a[20], a[47]); SQRADDAC(a[21], a[46]); SQRADDAC(a[22], a[45]); SQRADDAC(a[23], a[44]); SQRADDAC(a[24], a[43]); SQRADDAC(a[25], a[42]); SQRADDAC(a[26], a[41]); SQRADDAC(a[27], a[40]); SQRADDAC(a[28], a[39]); SQRADDAC(a[29], a[38]); SQRADDAC(a[30], a[37]); SQRADDAC(a[31], a[36]); SQRADDAC(a[32], a[35]); SQRADDAC(a[33], a[34]); SQRADDDB;
-   COMBA_STORE(b[67]);
-
-   /* output 68 */
-   CARRY_FORWARD;
-   SQRADDSC(a[5], a[63]); SQRADDAC(a[6], a[62]); SQRADDAC(a[7], a[61]); SQRADDAC(a[8], a[60]); SQRADDAC(a[9], a[59]); SQRADDAC(a[10], a[58]); SQRADDAC(a[11], a[57]); SQRADDAC(a[12], a[56]); SQRADDAC(a[13], a[55]); SQRADDAC(a[14], a[54]); SQRADDAC(a[15], a[53]); SQRADDAC(a[16], a[52]); SQRADDAC(a[17], a[51]); SQRADDAC(a[18], a[50]); SQRADDAC(a[19], a[49]); SQRADDAC(a[20], a[48]); SQRADDAC(a[21], a[47]); SQRADDAC(a[22], a[46]); SQRADDAC(a[23], a[45]); SQRADDAC(a[24], a[44]); SQRADDAC(a[25], a[43]); SQRADDAC(a[26], a[42]); SQRADDAC(a[27], a[41]); SQRADDAC(a[28], a[40]); SQRADDAC(a[29], a[39]); SQRADDAC(a[30], a[38]); SQRADDAC(a[31], a[37]); SQRADDAC(a[32], a[36]); SQRADDAC(a[33], a[35]); SQRADDDB; SQRADD(a[34], a[34]);
-   COMBA_STORE(b[68]);
-
-   /* output 69 */
-   CARRY_FORWARD;
-   SQRADDSC(a[6], a[63]); SQRADDAC(a[7], a[62]); SQRADDAC(a[8], a[61]); SQRADDAC(a[9], a[60]); SQRADDAC(a[10], a[59]); SQRADDAC(a[11], a[58]); SQRADDAC(a[12], a[57]); SQRADDAC(a[13], a[56]); SQRADDAC(a[14], a[55]); SQRADDAC(a[15], a[54]); SQRADDAC(a[16], a[53]); SQRADDAC(a[17], a[52]); SQRADDAC(a[18], a[51]); SQRADDAC(a[19], a[50]); SQRADDAC(a[20], a[49]); SQRADDAC(a[21], a[48]); SQRADDAC(a[22], a[47]); SQRADDAC(a[23], a[46]); SQRADDAC(a[24], a[45]); SQRADDAC(a[25], a[44]); SQRADDAC(a[26], a[43]); SQRADDAC(a[27], a[42]); SQRADDAC(a[28], a[41]); SQRADDAC(a[29], a[40]); SQRADDAC(a[30], a[39]); SQRADDAC(a[31], a[38]); SQRADDAC(a[32], a[37]); SQRADDAC(a[33], a[36]); SQRADDAC(a[34], a[35]); SQRADDDB;
-   COMBA_STORE(b[69]);
-
-   /* output 70 */
-   CARRY_FORWARD;
-   SQRADDSC(a[7], a[63]); SQRADDAC(a[8], a[62]); SQRADDAC(a[9], a[61]); SQRADDAC(a[10], a[60]); SQRADDAC(a[11], a[59]); SQRADDAC(a[12], a[58]); SQRADDAC(a[13], a[57]); SQRADDAC(a[14], a[56]); SQRADDAC(a[15], a[55]); SQRADDAC(a[16], a[54]); SQRADDAC(a[17], a[53]); SQRADDAC(a[18], a[52]); SQRADDAC(a[19], a[51]); SQRADDAC(a[20], a[50]); SQRADDAC(a[21], a[49]); SQRADDAC(a[22], a[48]); SQRADDAC(a[23], a[47]); SQRADDAC(a[24], a[46]); SQRADDAC(a[25], a[45]); SQRADDAC(a[26], a[44]); SQRADDAC(a[27], a[43]); SQRADDAC(a[28], a[42]); SQRADDAC(a[29], a[41]); SQRADDAC(a[30], a[40]); SQRADDAC(a[31], a[39]); SQRADDAC(a[32], a[38]); SQRADDAC(a[33], a[37]); SQRADDAC(a[34], a[36]); SQRADDDB; SQRADD(a[35], a[35]);
-   COMBA_STORE(b[70]);
-
-   /* output 71 */
-   CARRY_FORWARD;
-   SQRADDSC(a[8], a[63]); SQRADDAC(a[9], a[62]); SQRADDAC(a[10], a[61]); SQRADDAC(a[11], a[60]); SQRADDAC(a[12], a[59]); SQRADDAC(a[13], a[58]); SQRADDAC(a[14], a[57]); SQRADDAC(a[15], a[56]); SQRADDAC(a[16], a[55]); SQRADDAC(a[17], a[54]); SQRADDAC(a[18], a[53]); SQRADDAC(a[19], a[52]); SQRADDAC(a[20], a[51]); SQRADDAC(a[21], a[50]); SQRADDAC(a[22], a[49]); SQRADDAC(a[23], a[48]); SQRADDAC(a[24], a[47]); SQRADDAC(a[25], a[46]); SQRADDAC(a[26], a[45]); SQRADDAC(a[27], a[44]); SQRADDAC(a[28], a[43]); SQRADDAC(a[29], a[42]); SQRADDAC(a[30], a[41]); SQRADDAC(a[31], a[40]); SQRADDAC(a[32], a[39]); SQRADDAC(a[33], a[38]); SQRADDAC(a[34], a[37]); SQRADDAC(a[35], a[36]); SQRADDDB;
-   COMBA_STORE(b[71]);
-
-   /* output 72 */
-   CARRY_FORWARD;
-   SQRADDSC(a[9], a[63]); SQRADDAC(a[10], a[62]); SQRADDAC(a[11], a[61]); SQRADDAC(a[12], a[60]); SQRADDAC(a[13], a[59]); SQRADDAC(a[14], a[58]); SQRADDAC(a[15], a[57]); SQRADDAC(a[16], a[56]); SQRADDAC(a[17], a[55]); SQRADDAC(a[18], a[54]); SQRADDAC(a[19], a[53]); SQRADDAC(a[20], a[52]); SQRADDAC(a[21], a[51]); SQRADDAC(a[22], a[50]); SQRADDAC(a[23], a[49]); SQRADDAC(a[24], a[48]); SQRADDAC(a[25], a[47]); SQRADDAC(a[26], a[46]); SQRADDAC(a[27], a[45]); SQRADDAC(a[28], a[44]); SQRADDAC(a[29], a[43]); SQRADDAC(a[30], a[42]); SQRADDAC(a[31], a[41]); SQRADDAC(a[32], a[40]); SQRADDAC(a[33], a[39]); SQRADDAC(a[34], a[38]); SQRADDAC(a[35], a[37]); SQRADDDB; SQRADD(a[36], a[36]);
-   COMBA_STORE(b[72]);
-
-   /* output 73 */
-   CARRY_FORWARD;
-   SQRADDSC(a[10], a[63]); SQRADDAC(a[11], a[62]); SQRADDAC(a[12], a[61]); SQRADDAC(a[13], a[60]); SQRADDAC(a[14], a[59]); SQRADDAC(a[15], a[58]); SQRADDAC(a[16], a[57]); SQRADDAC(a[17], a[56]); SQRADDAC(a[18], a[55]); SQRADDAC(a[19], a[54]); SQRADDAC(a[20], a[53]); SQRADDAC(a[21], a[52]); SQRADDAC(a[22], a[51]); SQRADDAC(a[23], a[50]); SQRADDAC(a[24], a[49]); SQRADDAC(a[25], a[48]); SQRADDAC(a[26], a[47]); SQRADDAC(a[27], a[46]); SQRADDAC(a[28], a[45]); SQRADDAC(a[29], a[44]); SQRADDAC(a[30], a[43]); SQRADDAC(a[31], a[42]); SQRADDAC(a[32], a[41]); SQRADDAC(a[33], a[40]); SQRADDAC(a[34], a[39]); SQRADDAC(a[35], a[38]); SQRADDAC(a[36], a[37]); SQRADDDB;
-   COMBA_STORE(b[73]);
-
-   /* output 74 */
-   CARRY_FORWARD;
-   SQRADDSC(a[11], a[63]); SQRADDAC(a[12], a[62]); SQRADDAC(a[13], a[61]); SQRADDAC(a[14], a[60]); SQRADDAC(a[15], a[59]); SQRADDAC(a[16], a[58]); SQRADDAC(a[17], a[57]); SQRADDAC(a[18], a[56]); SQRADDAC(a[19], a[55]); SQRADDAC(a[20], a[54]); SQRADDAC(a[21], a[53]); SQRADDAC(a[22], a[52]); SQRADDAC(a[23], a[51]); SQRADDAC(a[24], a[50]); SQRADDAC(a[25], a[49]); SQRADDAC(a[26], a[48]); SQRADDAC(a[27], a[47]); SQRADDAC(a[28], a[46]); SQRADDAC(a[29], a[45]); SQRADDAC(a[30], a[44]); SQRADDAC(a[31], a[43]); SQRADDAC(a[32], a[42]); SQRADDAC(a[33], a[41]); SQRADDAC(a[34], a[40]); SQRADDAC(a[35], a[39]); SQRADDAC(a[36], a[38]); SQRADDDB; SQRADD(a[37], a[37]);
-   COMBA_STORE(b[74]);
-
-   /* output 75 */
-   CARRY_FORWARD;
-   SQRADDSC(a[12], a[63]); SQRADDAC(a[13], a[62]); SQRADDAC(a[14], a[61]); SQRADDAC(a[15], a[60]); SQRADDAC(a[16], a[59]); SQRADDAC(a[17], a[58]); SQRADDAC(a[18], a[57]); SQRADDAC(a[19], a[56]); SQRADDAC(a[20], a[55]); SQRADDAC(a[21], a[54]); SQRADDAC(a[22], a[53]); SQRADDAC(a[23], a[52]); SQRADDAC(a[24], a[51]); SQRADDAC(a[25], a[50]); SQRADDAC(a[26], a[49]); SQRADDAC(a[27], a[48]); SQRADDAC(a[28], a[47]); SQRADDAC(a[29], a[46]); SQRADDAC(a[30], a[45]); SQRADDAC(a[31], a[44]); SQRADDAC(a[32], a[43]); SQRADDAC(a[33], a[42]); SQRADDAC(a[34], a[41]); SQRADDAC(a[35], a[40]); SQRADDAC(a[36], a[39]); SQRADDAC(a[37], a[38]); SQRADDDB;
-   COMBA_STORE(b[75]);
-
-   /* output 76 */
-   CARRY_FORWARD;
-   SQRADDSC(a[13], a[63]); SQRADDAC(a[14], a[62]); SQRADDAC(a[15], a[61]); SQRADDAC(a[16], a[60]); SQRADDAC(a[17], a[59]); SQRADDAC(a[18], a[58]); SQRADDAC(a[19], a[57]); SQRADDAC(a[20], a[56]); SQRADDAC(a[21], a[55]); SQRADDAC(a[22], a[54]); SQRADDAC(a[23], a[53]); SQRADDAC(a[24], a[52]); SQRADDAC(a[25], a[51]); SQRADDAC(a[26], a[50]); SQRADDAC(a[27], a[49]); SQRADDAC(a[28], a[48]); SQRADDAC(a[29], a[47]); SQRADDAC(a[30], a[46]); SQRADDAC(a[31], a[45]); SQRADDAC(a[32], a[44]); SQRADDAC(a[33], a[43]); SQRADDAC(a[34], a[42]); SQRADDAC(a[35], a[41]); SQRADDAC(a[36], a[40]); SQRADDAC(a[37], a[39]); SQRADDDB; SQRADD(a[38], a[38]);
-   COMBA_STORE(b[76]);
-
-   /* output 77 */
-   CARRY_FORWARD;
-   SQRADDSC(a[14], a[63]); SQRADDAC(a[15], a[62]); SQRADDAC(a[16], a[61]); SQRADDAC(a[17], a[60]); SQRADDAC(a[18], a[59]); SQRADDAC(a[19], a[58]); SQRADDAC(a[20], a[57]); SQRADDAC(a[21], a[56]); SQRADDAC(a[22], a[55]); SQRADDAC(a[23], a[54]); SQRADDAC(a[24], a[53]); SQRADDAC(a[25], a[52]); SQRADDAC(a[26], a[51]); SQRADDAC(a[27], a[50]); SQRADDAC(a[28], a[49]); SQRADDAC(a[29], a[48]); SQRADDAC(a[30], a[47]); SQRADDAC(a[31], a[46]); SQRADDAC(a[32], a[45]); SQRADDAC(a[33], a[44]); SQRADDAC(a[34], a[43]); SQRADDAC(a[35], a[42]); SQRADDAC(a[36], a[41]); SQRADDAC(a[37], a[40]); SQRADDAC(a[38], a[39]); SQRADDDB;
-   COMBA_STORE(b[77]);
-
-   /* output 78 */
-   CARRY_FORWARD;
-   SQRADDSC(a[15], a[63]); SQRADDAC(a[16], a[62]); SQRADDAC(a[17], a[61]); SQRADDAC(a[18], a[60]); SQRADDAC(a[19], a[59]); SQRADDAC(a[20], a[58]); SQRADDAC(a[21], a[57]); SQRADDAC(a[22], a[56]); SQRADDAC(a[23], a[55]); SQRADDAC(a[24], a[54]); SQRADDAC(a[25], a[53]); SQRADDAC(a[26], a[52]); SQRADDAC(a[27], a[51]); SQRADDAC(a[28], a[50]); SQRADDAC(a[29], a[49]); SQRADDAC(a[30], a[48]); SQRADDAC(a[31], a[47]); SQRADDAC(a[32], a[46]); SQRADDAC(a[33], a[45]); SQRADDAC(a[34], a[44]); SQRADDAC(a[35], a[43]); SQRADDAC(a[36], a[42]); SQRADDAC(a[37], a[41]); SQRADDAC(a[38], a[40]); SQRADDDB; SQRADD(a[39], a[39]);
-   COMBA_STORE(b[78]);
-
-   /* output 79 */
-   CARRY_FORWARD;
-   SQRADDSC(a[16], a[63]); SQRADDAC(a[17], a[62]); SQRADDAC(a[18], a[61]); SQRADDAC(a[19], a[60]); SQRADDAC(a[20], a[59]); SQRADDAC(a[21], a[58]); SQRADDAC(a[22], a[57]); SQRADDAC(a[23], a[56]); SQRADDAC(a[24], a[55]); SQRADDAC(a[25], a[54]); SQRADDAC(a[26], a[53]); SQRADDAC(a[27], a[52]); SQRADDAC(a[28], a[51]); SQRADDAC(a[29], a[50]); SQRADDAC(a[30], a[49]); SQRADDAC(a[31], a[48]); SQRADDAC(a[32], a[47]); SQRADDAC(a[33], a[46]); SQRADDAC(a[34], a[45]); SQRADDAC(a[35], a[44]); SQRADDAC(a[36], a[43]); SQRADDAC(a[37], a[42]); SQRADDAC(a[38], a[41]); SQRADDAC(a[39], a[40]); SQRADDDB;
-   COMBA_STORE(b[79]);
-
-   /* output 80 */
-   CARRY_FORWARD;
-   SQRADDSC(a[17], a[63]); SQRADDAC(a[18], a[62]); SQRADDAC(a[19], a[61]); SQRADDAC(a[20], a[60]); SQRADDAC(a[21], a[59]); SQRADDAC(a[22], a[58]); SQRADDAC(a[23], a[57]); SQRADDAC(a[24], a[56]); SQRADDAC(a[25], a[55]); SQRADDAC(a[26], a[54]); SQRADDAC(a[27], a[53]); SQRADDAC(a[28], a[52]); SQRADDAC(a[29], a[51]); SQRADDAC(a[30], a[50]); SQRADDAC(a[31], a[49]); SQRADDAC(a[32], a[48]); SQRADDAC(a[33], a[47]); SQRADDAC(a[34], a[46]); SQRADDAC(a[35], a[45]); SQRADDAC(a[36], a[44]); SQRADDAC(a[37], a[43]); SQRADDAC(a[38], a[42]); SQRADDAC(a[39], a[41]); SQRADDDB; SQRADD(a[40], a[40]);
-   COMBA_STORE(b[80]);
-
-   /* output 81 */
-   CARRY_FORWARD;
-   SQRADDSC(a[18], a[63]); SQRADDAC(a[19], a[62]); SQRADDAC(a[20], a[61]); SQRADDAC(a[21], a[60]); SQRADDAC(a[22], a[59]); SQRADDAC(a[23], a[58]); SQRADDAC(a[24], a[57]); SQRADDAC(a[25], a[56]); SQRADDAC(a[26], a[55]); SQRADDAC(a[27], a[54]); SQRADDAC(a[28], a[53]); SQRADDAC(a[29], a[52]); SQRADDAC(a[30], a[51]); SQRADDAC(a[31], a[50]); SQRADDAC(a[32], a[49]); SQRADDAC(a[33], a[48]); SQRADDAC(a[34], a[47]); SQRADDAC(a[35], a[46]); SQRADDAC(a[36], a[45]); SQRADDAC(a[37], a[44]); SQRADDAC(a[38], a[43]); SQRADDAC(a[39], a[42]); SQRADDAC(a[40], a[41]); SQRADDDB;
-   COMBA_STORE(b[81]);
-
-   /* output 82 */
-   CARRY_FORWARD;
-   SQRADDSC(a[19], a[63]); SQRADDAC(a[20], a[62]); SQRADDAC(a[21], a[61]); SQRADDAC(a[22], a[60]); SQRADDAC(a[23], a[59]); SQRADDAC(a[24], a[58]); SQRADDAC(a[25], a[57]); SQRADDAC(a[26], a[56]); SQRADDAC(a[27], a[55]); SQRADDAC(a[28], a[54]); SQRADDAC(a[29], a[53]); SQRADDAC(a[30], a[52]); SQRADDAC(a[31], a[51]); SQRADDAC(a[32], a[50]); SQRADDAC(a[33], a[49]); SQRADDAC(a[34], a[48]); SQRADDAC(a[35], a[47]); SQRADDAC(a[36], a[46]); SQRADDAC(a[37], a[45]); SQRADDAC(a[38], a[44]); SQRADDAC(a[39], a[43]); SQRADDAC(a[40], a[42]); SQRADDDB; SQRADD(a[41], a[41]);
-   COMBA_STORE(b[82]);
-
-   /* output 83 */
-   CARRY_FORWARD;
-   SQRADDSC(a[20], a[63]); SQRADDAC(a[21], a[62]); SQRADDAC(a[22], a[61]); SQRADDAC(a[23], a[60]); SQRADDAC(a[24], a[59]); SQRADDAC(a[25], a[58]); SQRADDAC(a[26], a[57]); SQRADDAC(a[27], a[56]); SQRADDAC(a[28], a[55]); SQRADDAC(a[29], a[54]); SQRADDAC(a[30], a[53]); SQRADDAC(a[31], a[52]); SQRADDAC(a[32], a[51]); SQRADDAC(a[33], a[50]); SQRADDAC(a[34], a[49]); SQRADDAC(a[35], a[48]); SQRADDAC(a[36], a[47]); SQRADDAC(a[37], a[46]); SQRADDAC(a[38], a[45]); SQRADDAC(a[39], a[44]); SQRADDAC(a[40], a[43]); SQRADDAC(a[41], a[42]); SQRADDDB;
-   COMBA_STORE(b[83]);
-
-   /* output 84 */
-   CARRY_FORWARD;
-   SQRADDSC(a[21], a[63]); SQRADDAC(a[22], a[62]); SQRADDAC(a[23], a[61]); SQRADDAC(a[24], a[60]); SQRADDAC(a[25], a[59]); SQRADDAC(a[26], a[58]); SQRADDAC(a[27], a[57]); SQRADDAC(a[28], a[56]); SQRADDAC(a[29], a[55]); SQRADDAC(a[30], a[54]); SQRADDAC(a[31], a[53]); SQRADDAC(a[32], a[52]); SQRADDAC(a[33], a[51]); SQRADDAC(a[34], a[50]); SQRADDAC(a[35], a[49]); SQRADDAC(a[36], a[48]); SQRADDAC(a[37], a[47]); SQRADDAC(a[38], a[46]); SQRADDAC(a[39], a[45]); SQRADDAC(a[40], a[44]); SQRADDAC(a[41], a[43]); SQRADDDB; SQRADD(a[42], a[42]);
-   COMBA_STORE(b[84]);
-
-   /* output 85 */
-   CARRY_FORWARD;
-   SQRADDSC(a[22], a[63]); SQRADDAC(a[23], a[62]); SQRADDAC(a[24], a[61]); SQRADDAC(a[25], a[60]); SQRADDAC(a[26], a[59]); SQRADDAC(a[27], a[58]); SQRADDAC(a[28], a[57]); SQRADDAC(a[29], a[56]); SQRADDAC(a[30], a[55]); SQRADDAC(a[31], a[54]); SQRADDAC(a[32], a[53]); SQRADDAC(a[33], a[52]); SQRADDAC(a[34], a[51]); SQRADDAC(a[35], a[50]); SQRADDAC(a[36], a[49]); SQRADDAC(a[37], a[48]); SQRADDAC(a[38], a[47]); SQRADDAC(a[39], a[46]); SQRADDAC(a[40], a[45]); SQRADDAC(a[41], a[44]); SQRADDAC(a[42], a[43]); SQRADDDB;
-   COMBA_STORE(b[85]);
-
-   /* output 86 */
-   CARRY_FORWARD;
-   SQRADDSC(a[23], a[63]); SQRADDAC(a[24], a[62]); SQRADDAC(a[25], a[61]); SQRADDAC(a[26], a[60]); SQRADDAC(a[27], a[59]); SQRADDAC(a[28], a[58]); SQRADDAC(a[29], a[57]); SQRADDAC(a[30], a[56]); SQRADDAC(a[31], a[55]); SQRADDAC(a[32], a[54]); SQRADDAC(a[33], a[53]); SQRADDAC(a[34], a[52]); SQRADDAC(a[35], a[51]); SQRADDAC(a[36], a[50]); SQRADDAC(a[37], a[49]); SQRADDAC(a[38], a[48]); SQRADDAC(a[39], a[47]); SQRADDAC(a[40], a[46]); SQRADDAC(a[41], a[45]); SQRADDAC(a[42], a[44]); SQRADDDB; SQRADD(a[43], a[43]);
-   COMBA_STORE(b[86]);
-
-   /* output 87 */
-   CARRY_FORWARD;
-   SQRADDSC(a[24], a[63]); SQRADDAC(a[25], a[62]); SQRADDAC(a[26], a[61]); SQRADDAC(a[27], a[60]); SQRADDAC(a[28], a[59]); SQRADDAC(a[29], a[58]); SQRADDAC(a[30], a[57]); SQRADDAC(a[31], a[56]); SQRADDAC(a[32], a[55]); SQRADDAC(a[33], a[54]); SQRADDAC(a[34], a[53]); SQRADDAC(a[35], a[52]); SQRADDAC(a[36], a[51]); SQRADDAC(a[37], a[50]); SQRADDAC(a[38], a[49]); SQRADDAC(a[39], a[48]); SQRADDAC(a[40], a[47]); SQRADDAC(a[41], a[46]); SQRADDAC(a[42], a[45]); SQRADDAC(a[43], a[44]); SQRADDDB;
-   COMBA_STORE(b[87]);
-
-   /* output 88 */
-   CARRY_FORWARD;
-   SQRADDSC(a[25], a[63]); SQRADDAC(a[26], a[62]); SQRADDAC(a[27], a[61]); SQRADDAC(a[28], a[60]); SQRADDAC(a[29], a[59]); SQRADDAC(a[30], a[58]); SQRADDAC(a[31], a[57]); SQRADDAC(a[32], a[56]); SQRADDAC(a[33], a[55]); SQRADDAC(a[34], a[54]); SQRADDAC(a[35], a[53]); SQRADDAC(a[36], a[52]); SQRADDAC(a[37], a[51]); SQRADDAC(a[38], a[50]); SQRADDAC(a[39], a[49]); SQRADDAC(a[40], a[48]); SQRADDAC(a[41], a[47]); SQRADDAC(a[42], a[46]); SQRADDAC(a[43], a[45]); SQRADDDB; SQRADD(a[44], a[44]);
-   COMBA_STORE(b[88]);
-
-   /* output 89 */
-   CARRY_FORWARD;
-   SQRADDSC(a[26], a[63]); SQRADDAC(a[27], a[62]); SQRADDAC(a[28], a[61]); SQRADDAC(a[29], a[60]); SQRADDAC(a[30], a[59]); SQRADDAC(a[31], a[58]); SQRADDAC(a[32], a[57]); SQRADDAC(a[33], a[56]); SQRADDAC(a[34], a[55]); SQRADDAC(a[35], a[54]); SQRADDAC(a[36], a[53]); SQRADDAC(a[37], a[52]); SQRADDAC(a[38], a[51]); SQRADDAC(a[39], a[50]); SQRADDAC(a[40], a[49]); SQRADDAC(a[41], a[48]); SQRADDAC(a[42], a[47]); SQRADDAC(a[43], a[46]); SQRADDAC(a[44], a[45]); SQRADDDB;
-   COMBA_STORE(b[89]);
-
-   /* output 90 */
-   CARRY_FORWARD;
-   SQRADDSC(a[27], a[63]); SQRADDAC(a[28], a[62]); SQRADDAC(a[29], a[61]); SQRADDAC(a[30], a[60]); SQRADDAC(a[31], a[59]); SQRADDAC(a[32], a[58]); SQRADDAC(a[33], a[57]); SQRADDAC(a[34], a[56]); SQRADDAC(a[35], a[55]); SQRADDAC(a[36], a[54]); SQRADDAC(a[37], a[53]); SQRADDAC(a[38], a[52]); SQRADDAC(a[39], a[51]); SQRADDAC(a[40], a[50]); SQRADDAC(a[41], a[49]); SQRADDAC(a[42], a[48]); SQRADDAC(a[43], a[47]); SQRADDAC(a[44], a[46]); SQRADDDB; SQRADD(a[45], a[45]);
-   COMBA_STORE(b[90]);
-
-   /* output 91 */
-   CARRY_FORWARD;
-   SQRADDSC(a[28], a[63]); SQRADDAC(a[29], a[62]); SQRADDAC(a[30], a[61]); SQRADDAC(a[31], a[60]); SQRADDAC(a[32], a[59]); SQRADDAC(a[33], a[58]); SQRADDAC(a[34], a[57]); SQRADDAC(a[35], a[56]); SQRADDAC(a[36], a[55]); SQRADDAC(a[37], a[54]); SQRADDAC(a[38], a[53]); SQRADDAC(a[39], a[52]); SQRADDAC(a[40], a[51]); SQRADDAC(a[41], a[50]); SQRADDAC(a[42], a[49]); SQRADDAC(a[43], a[48]); SQRADDAC(a[44], a[47]); SQRADDAC(a[45], a[46]); SQRADDDB;
-   COMBA_STORE(b[91]);
-
-   /* output 92 */
-   CARRY_FORWARD;
-   SQRADDSC(a[29], a[63]); SQRADDAC(a[30], a[62]); SQRADDAC(a[31], a[61]); SQRADDAC(a[32], a[60]); SQRADDAC(a[33], a[59]); SQRADDAC(a[34], a[58]); SQRADDAC(a[35], a[57]); SQRADDAC(a[36], a[56]); SQRADDAC(a[37], a[55]); SQRADDAC(a[38], a[54]); SQRADDAC(a[39], a[53]); SQRADDAC(a[40], a[52]); SQRADDAC(a[41], a[51]); SQRADDAC(a[42], a[50]); SQRADDAC(a[43], a[49]); SQRADDAC(a[44], a[48]); SQRADDAC(a[45], a[47]); SQRADDDB; SQRADD(a[46], a[46]);
-   COMBA_STORE(b[92]);
-
-   /* output 93 */
-   CARRY_FORWARD;
-   SQRADDSC(a[30], a[63]); SQRADDAC(a[31], a[62]); SQRADDAC(a[32], a[61]); SQRADDAC(a[33], a[60]); SQRADDAC(a[34], a[59]); SQRADDAC(a[35], a[58]); SQRADDAC(a[36], a[57]); SQRADDAC(a[37], a[56]); SQRADDAC(a[38], a[55]); SQRADDAC(a[39], a[54]); SQRADDAC(a[40], a[53]); SQRADDAC(a[41], a[52]); SQRADDAC(a[42], a[51]); SQRADDAC(a[43], a[50]); SQRADDAC(a[44], a[49]); SQRADDAC(a[45], a[48]); SQRADDAC(a[46], a[47]); SQRADDDB;
-   COMBA_STORE(b[93]);
-
-   /* output 94 */
-   CARRY_FORWARD;
-   SQRADDSC(a[31], a[63]); SQRADDAC(a[32], a[62]); SQRADDAC(a[33], a[61]); SQRADDAC(a[34], a[60]); SQRADDAC(a[35], a[59]); SQRADDAC(a[36], a[58]); SQRADDAC(a[37], a[57]); SQRADDAC(a[38], a[56]); SQRADDAC(a[39], a[55]); SQRADDAC(a[40], a[54]); SQRADDAC(a[41], a[53]); SQRADDAC(a[42], a[52]); SQRADDAC(a[43], a[51]); SQRADDAC(a[44], a[50]); SQRADDAC(a[45], a[49]); SQRADDAC(a[46], a[48]); SQRADDDB; SQRADD(a[47], a[47]);
-   COMBA_STORE(b[94]);
-
-   /* output 95 */
-   CARRY_FORWARD;
-   SQRADDSC(a[32], a[63]); SQRADDAC(a[33], a[62]); SQRADDAC(a[34], a[61]); SQRADDAC(a[35], a[60]); SQRADDAC(a[36], a[59]); SQRADDAC(a[37], a[58]); SQRADDAC(a[38], a[57]); SQRADDAC(a[39], a[56]); SQRADDAC(a[40], a[55]); SQRADDAC(a[41], a[54]); SQRADDAC(a[42], a[53]); SQRADDAC(a[43], a[52]); SQRADDAC(a[44], a[51]); SQRADDAC(a[45], a[50]); SQRADDAC(a[46], a[49]); SQRADDAC(a[47], a[48]); SQRADDDB;
-   COMBA_STORE(b[95]);
-
-   /* output 96 */
-   CARRY_FORWARD;
-   SQRADDSC(a[33], a[63]); SQRADDAC(a[34], a[62]); SQRADDAC(a[35], a[61]); SQRADDAC(a[36], a[60]); SQRADDAC(a[37], a[59]); SQRADDAC(a[38], a[58]); SQRADDAC(a[39], a[57]); SQRADDAC(a[40], a[56]); SQRADDAC(a[41], a[55]); SQRADDAC(a[42], a[54]); SQRADDAC(a[43], a[53]); SQRADDAC(a[44], a[52]); SQRADDAC(a[45], a[51]); SQRADDAC(a[46], a[50]); SQRADDAC(a[47], a[49]); SQRADDDB; SQRADD(a[48], a[48]);
-   COMBA_STORE(b[96]);
-
-   /* output 97 */
-   CARRY_FORWARD;
-   SQRADDSC(a[34], a[63]); SQRADDAC(a[35], a[62]); SQRADDAC(a[36], a[61]); SQRADDAC(a[37], a[60]); SQRADDAC(a[38], a[59]); SQRADDAC(a[39], a[58]); SQRADDAC(a[40], a[57]); SQRADDAC(a[41], a[56]); SQRADDAC(a[42], a[55]); SQRADDAC(a[43], a[54]); SQRADDAC(a[44], a[53]); SQRADDAC(a[45], a[52]); SQRADDAC(a[46], a[51]); SQRADDAC(a[47], a[50]); SQRADDAC(a[48], a[49]); SQRADDDB;
-   COMBA_STORE(b[97]);
-
-   /* output 98 */
-   CARRY_FORWARD;
-   SQRADDSC(a[35], a[63]); SQRADDAC(a[36], a[62]); SQRADDAC(a[37], a[61]); SQRADDAC(a[38], a[60]); SQRADDAC(a[39], a[59]); SQRADDAC(a[40], a[58]); SQRADDAC(a[41], a[57]); SQRADDAC(a[42], a[56]); SQRADDAC(a[43], a[55]); SQRADDAC(a[44], a[54]); SQRADDAC(a[45], a[53]); SQRADDAC(a[46], a[52]); SQRADDAC(a[47], a[51]); SQRADDAC(a[48], a[50]); SQRADDDB; SQRADD(a[49], a[49]);
-   COMBA_STORE(b[98]);
-
-   /* output 99 */
-   CARRY_FORWARD;
-   SQRADDSC(a[36], a[63]); SQRADDAC(a[37], a[62]); SQRADDAC(a[38], a[61]); SQRADDAC(a[39], a[60]); SQRADDAC(a[40], a[59]); SQRADDAC(a[41], a[58]); SQRADDAC(a[42], a[57]); SQRADDAC(a[43], a[56]); SQRADDAC(a[44], a[55]); SQRADDAC(a[45], a[54]); SQRADDAC(a[46], a[53]); SQRADDAC(a[47], a[52]); SQRADDAC(a[48], a[51]); SQRADDAC(a[49], a[50]); SQRADDDB;
-   COMBA_STORE(b[99]);
-
-   /* output 100 */
-   CARRY_FORWARD;
-   SQRADDSC(a[37], a[63]); SQRADDAC(a[38], a[62]); SQRADDAC(a[39], a[61]); SQRADDAC(a[40], a[60]); SQRADDAC(a[41], a[59]); SQRADDAC(a[42], a[58]); SQRADDAC(a[43], a[57]); SQRADDAC(a[44], a[56]); SQRADDAC(a[45], a[55]); SQRADDAC(a[46], a[54]); SQRADDAC(a[47], a[53]); SQRADDAC(a[48], a[52]); SQRADDAC(a[49], a[51]); SQRADDDB; SQRADD(a[50], a[50]);
-   COMBA_STORE(b[100]);
-
-   /* output 101 */
-   CARRY_FORWARD;
-   SQRADDSC(a[38], a[63]); SQRADDAC(a[39], a[62]); SQRADDAC(a[40], a[61]); SQRADDAC(a[41], a[60]); SQRADDAC(a[42], a[59]); SQRADDAC(a[43], a[58]); SQRADDAC(a[44], a[57]); SQRADDAC(a[45], a[56]); SQRADDAC(a[46], a[55]); SQRADDAC(a[47], a[54]); SQRADDAC(a[48], a[53]); SQRADDAC(a[49], a[52]); SQRADDAC(a[50], a[51]); SQRADDDB;
-   COMBA_STORE(b[101]);
-
-   /* output 102 */
-   CARRY_FORWARD;
-   SQRADDSC(a[39], a[63]); SQRADDAC(a[40], a[62]); SQRADDAC(a[41], a[61]); SQRADDAC(a[42], a[60]); SQRADDAC(a[43], a[59]); SQRADDAC(a[44], a[58]); SQRADDAC(a[45], a[57]); SQRADDAC(a[46], a[56]); SQRADDAC(a[47], a[55]); SQRADDAC(a[48], a[54]); SQRADDAC(a[49], a[53]); SQRADDAC(a[50], a[52]); SQRADDDB; SQRADD(a[51], a[51]);
-   COMBA_STORE(b[102]);
-
-   /* output 103 */
-   CARRY_FORWARD;
-   SQRADDSC(a[40], a[63]); SQRADDAC(a[41], a[62]); SQRADDAC(a[42], a[61]); SQRADDAC(a[43], a[60]); SQRADDAC(a[44], a[59]); SQRADDAC(a[45], a[58]); SQRADDAC(a[46], a[57]); SQRADDAC(a[47], a[56]); SQRADDAC(a[48], a[55]); SQRADDAC(a[49], a[54]); SQRADDAC(a[50], a[53]); SQRADDAC(a[51], a[52]); SQRADDDB;
-   COMBA_STORE(b[103]);
-
-   /* output 104 */
-   CARRY_FORWARD;
-   SQRADDSC(a[41], a[63]); SQRADDAC(a[42], a[62]); SQRADDAC(a[43], a[61]); SQRADDAC(a[44], a[60]); SQRADDAC(a[45], a[59]); SQRADDAC(a[46], a[58]); SQRADDAC(a[47], a[57]); SQRADDAC(a[48], a[56]); SQRADDAC(a[49], a[55]); SQRADDAC(a[50], a[54]); SQRADDAC(a[51], a[53]); SQRADDDB; SQRADD(a[52], a[52]);
-   COMBA_STORE(b[104]);
-
-   /* output 105 */
-   CARRY_FORWARD;
-   SQRADDSC(a[42], a[63]); SQRADDAC(a[43], a[62]); SQRADDAC(a[44], a[61]); SQRADDAC(a[45], a[60]); SQRADDAC(a[46], a[59]); SQRADDAC(a[47], a[58]); SQRADDAC(a[48], a[57]); SQRADDAC(a[49], a[56]); SQRADDAC(a[50], a[55]); SQRADDAC(a[51], a[54]); SQRADDAC(a[52], a[53]); SQRADDDB;
-   COMBA_STORE(b[105]);
-
-   /* output 106 */
-   CARRY_FORWARD;
-   SQRADDSC(a[43], a[63]); SQRADDAC(a[44], a[62]); SQRADDAC(a[45], a[61]); SQRADDAC(a[46], a[60]); SQRADDAC(a[47], a[59]); SQRADDAC(a[48], a[58]); SQRADDAC(a[49], a[57]); SQRADDAC(a[50], a[56]); SQRADDAC(a[51], a[55]); SQRADDAC(a[52], a[54]); SQRADDDB; SQRADD(a[53], a[53]);
-   COMBA_STORE(b[106]);
-
-   /* output 107 */
-   CARRY_FORWARD;
-   SQRADDSC(a[44], a[63]); SQRADDAC(a[45], a[62]); SQRADDAC(a[46], a[61]); SQRADDAC(a[47], a[60]); SQRADDAC(a[48], a[59]); SQRADDAC(a[49], a[58]); SQRADDAC(a[50], a[57]); SQRADDAC(a[51], a[56]); SQRADDAC(a[52], a[55]); SQRADDAC(a[53], a[54]); SQRADDDB;
-   COMBA_STORE(b[107]);
-
-   /* output 108 */
-   CARRY_FORWARD;
-   SQRADDSC(a[45], a[63]); SQRADDAC(a[46], a[62]); SQRADDAC(a[47], a[61]); SQRADDAC(a[48], a[60]); SQRADDAC(a[49], a[59]); SQRADDAC(a[50], a[58]); SQRADDAC(a[51], a[57]); SQRADDAC(a[52], a[56]); SQRADDAC(a[53], a[55]); SQRADDDB; SQRADD(a[54], a[54]);
-   COMBA_STORE(b[108]);
-
-   /* output 109 */
-   CARRY_FORWARD;
-   SQRADDSC(a[46], a[63]); SQRADDAC(a[47], a[62]); SQRADDAC(a[48], a[61]); SQRADDAC(a[49], a[60]); SQRADDAC(a[50], a[59]); SQRADDAC(a[51], a[58]); SQRADDAC(a[52], a[57]); SQRADDAC(a[53], a[56]); SQRADDAC(a[54], a[55]); SQRADDDB;
-   COMBA_STORE(b[109]);
-
-   /* output 110 */
-   CARRY_FORWARD;
-   SQRADDSC(a[47], a[63]); SQRADDAC(a[48], a[62]); SQRADDAC(a[49], a[61]); SQRADDAC(a[50], a[60]); SQRADDAC(a[51], a[59]); SQRADDAC(a[52], a[58]); SQRADDAC(a[53], a[57]); SQRADDAC(a[54], a[56]); SQRADDDB; SQRADD(a[55], a[55]);
-   COMBA_STORE(b[110]);
-
-   /* output 111 */
-   CARRY_FORWARD;
-   SQRADDSC(a[48], a[63]); SQRADDAC(a[49], a[62]); SQRADDAC(a[50], a[61]); SQRADDAC(a[51], a[60]); SQRADDAC(a[52], a[59]); SQRADDAC(a[53], a[58]); SQRADDAC(a[54], a[57]); SQRADDAC(a[55], a[56]); SQRADDDB;
-   COMBA_STORE(b[111]);
-
-   /* output 112 */
-   CARRY_FORWARD;
-   SQRADDSC(a[49], a[63]); SQRADDAC(a[50], a[62]); SQRADDAC(a[51], a[61]); SQRADDAC(a[52], a[60]); SQRADDAC(a[53], a[59]); SQRADDAC(a[54], a[58]); SQRADDAC(a[55], a[57]); SQRADDDB; SQRADD(a[56], a[56]);
-   COMBA_STORE(b[112]);
-
-   /* output 113 */
-   CARRY_FORWARD;
-   SQRADDSC(a[50], a[63]); SQRADDAC(a[51], a[62]); SQRADDAC(a[52], a[61]); SQRADDAC(a[53], a[60]); SQRADDAC(a[54], a[59]); SQRADDAC(a[55], a[58]); SQRADDAC(a[56], a[57]); SQRADDDB;
-   COMBA_STORE(b[113]);
-
-   /* output 114 */
-   CARRY_FORWARD;
-   SQRADDSC(a[51], a[63]); SQRADDAC(a[52], a[62]); SQRADDAC(a[53], a[61]); SQRADDAC(a[54], a[60]); SQRADDAC(a[55], a[59]); SQRADDAC(a[56], a[58]); SQRADDDB; SQRADD(a[57], a[57]);
-   COMBA_STORE(b[114]);
-
-   /* output 115 */
-   CARRY_FORWARD;
-   SQRADDSC(a[52], a[63]); SQRADDAC(a[53], a[62]); SQRADDAC(a[54], a[61]); SQRADDAC(a[55], a[60]); SQRADDAC(a[56], a[59]); SQRADDAC(a[57], a[58]); SQRADDDB;
-   COMBA_STORE(b[115]);
-
-   /* output 116 */
-   CARRY_FORWARD;
-   SQRADDSC(a[53], a[63]); SQRADDAC(a[54], a[62]); SQRADDAC(a[55], a[61]); SQRADDAC(a[56], a[60]); SQRADDAC(a[57], a[59]); SQRADDDB; SQRADD(a[58], a[58]);
-   COMBA_STORE(b[116]);
-
-   /* output 117 */
-   CARRY_FORWARD;
-   SQRADDSC(a[54], a[63]); SQRADDAC(a[55], a[62]); SQRADDAC(a[56], a[61]); SQRADDAC(a[57], a[60]); SQRADDAC(a[58], a[59]); SQRADDDB;
-   COMBA_STORE(b[117]);
-
-   /* output 118 */
-   CARRY_FORWARD;
-   SQRADDSC(a[55], a[63]); SQRADDAC(a[56], a[62]); SQRADDAC(a[57], a[61]); SQRADDAC(a[58], a[60]); SQRADDDB; SQRADD(a[59], a[59]);
-   COMBA_STORE(b[118]);
-
-   /* output 119 */
-   CARRY_FORWARD;
-   SQRADDSC(a[56], a[63]); SQRADDAC(a[57], a[62]); SQRADDAC(a[58], a[61]); SQRADDAC(a[59], a[60]); SQRADDDB;
-   COMBA_STORE(b[119]);
-
-   /* output 120 */
-   CARRY_FORWARD;
-   SQRADDSC(a[57], a[63]); SQRADDAC(a[58], a[62]); SQRADDAC(a[59], a[61]); SQRADDDB; SQRADD(a[60], a[60]);
-   COMBA_STORE(b[120]);
-
-   /* output 121 */
-   CARRY_FORWARD;
-   SQRADDSC(a[58], a[63]); SQRADDAC(a[59], a[62]); SQRADDAC(a[60], a[61]); SQRADDDB;
-   COMBA_STORE(b[121]);
-
-   /* output 122 */
-   CARRY_FORWARD;
-   SQRADD2(a[59], a[63]); SQRADD2(a[60], a[62]); SQRADD(a[61], a[61]);
-   COMBA_STORE(b[122]);
-
-   /* output 123 */
-   CARRY_FORWARD;
-   SQRADD2(a[60], a[63]); SQRADD2(a[61], a[62]);
-   COMBA_STORE(b[123]);
-
-   /* output 124 */
-   CARRY_FORWARD;
-   SQRADD2(a[61], a[63]); SQRADD(a[62], a[62]);
-   COMBA_STORE(b[124]);
-
-   /* output 125 */
-   CARRY_FORWARD;
-   SQRADD2(a[62], a[63]);
-   COMBA_STORE(b[125]);
-
-   /* output 126 */
-   CARRY_FORWARD;
-   SQRADD(a[63], a[63]);
-   COMBA_STORE(b[126]);
-   COMBA_STORE2(b[127]);
-   COMBA_FINI;
-
-   B->used = 128;
-   B->sign = FP_ZPOS;
-   memcpy(B->dp, b, 128 * sizeof(fp_digit));
-   fp_clamp(B);
-}
-
-
-#endif
-
-/* End: fp_sqr_comba.c */
-
-/* Start: fp_sqr_comba_generic.c */
-/* generic comba squarer */
-void fp_sqr_comba(fp_int *A, fp_int *B)
-{
-  int       pa, ix, iz;
-  fp_digit  c0, c1, c2;
-  fp_int    tmp, *dst;
-
-  /* get size of output and trim */
-  pa = A->used + A->used;
-  if (pa >= FP_SIZE) {
-     pa = FP_SIZE-1;
-  }
-
-  /* number of output digits to produce */
-  COMBA_START;
-  CLEAR_CARRY;
-
-  if (A == B) {
-     fp_zero(&tmp);
-     dst = &tmp;
-  } else {
-     fp_zero(B);
-     dst = B;
-  }
-
-  for (ix = 0; ix < pa; ix++) {
-      int      tx, ty, iy;
-      fp_digit *tmpy, *tmpx;
-
-      /* get offsets into the two bignums */
-      ty = MIN(A->used-1, ix);
-      tx = ix - ty;
-
-      /* setup temp aliases */
-      tmpx = A->dp + tx;
-      tmpy = A->dp + ty;
-
-      /* this is the number of times the loop will iterrate, essentially its
-         while (tx++ < a->used && ty-- >= 0) { ... }
-       */
-      iy = MIN(A->used-tx, ty+1);
-
-      /* now for squaring tx can never equal ty
-       * we halve the distance since they approach at a rate of 2x
-       * and we have to round because odd cases need to be executed
-       */
-      iy = MIN(iy, (ty-tx+1)>>1);
-
-      /* forward carries */
-      CARRY_FORWARD;
-
-      /* execute loop */
-      for (iz = 0; iz < iy; iz++) {
-          SQRADD2(*tmpx++, *tmpy--);
-      }
-
-      /* even columns have the square term in them */
-      if ((ix&1) == 0) {
-          SQRADD(A->dp[ix>>1], A->dp[ix>>1]);
-      }
-
-      /* store it */
-      COMBA_STORE(dst->dp[ix]);
-  }
-  COMBA_STORE2(dst->dp[ix]);
-
-  COMBA_FINI;
-
-  /* setup dest */
-  dst->used = pa;
-  fp_clamp (dst);
-  if (dst != B) {
-     fp_copy(dst, B);
-  }
-}
-
-/* End: fp_sqr_comba_generic.c */
-
-/* Start: fp_sqrmod.c */
-/* TomsFastMath, a fast ISO C bignum library.
- *
- * This project is meant to fill in where LibTomMath
- * falls short.  That is speed ;-)
- *
- * This project is public domain and free for all purposes.
- *
- * Tom St Denis, tomstdenis@iahu.ca
- */
-#include <tfm.h>
-
-/* c = a * a (mod b) */
-int fp_sqrmod(fp_int *a, fp_int *b, fp_int *c)
-{
-  fp_int tmp;
-  fp_zero(&tmp);
-  fp_sqr(a, &tmp);
-  return fp_mod(&tmp, b, c);
-}
-
-/* End: fp_sqrmod.c */
-
-/* Start: fp_sub.c */
-/* TomsFastMath, a fast ISO C bignum library.
- *
- * This project is meant to fill in where LibTomMath
- * falls short.  That is speed ;-)
- *
- * This project is public domain and free for all purposes.
- *
- * Tom St Denis, tomstdenis@iahu.ca
- */
-#include <tfm.h>
-
-/* c = a - b */
-void fp_sub(fp_int *a, fp_int *b, fp_int *c)
-{
-  int     sa, sb;
-
-  sa = a->sign;
-  sb = b->sign;
-
-  if (sa != sb) {
-    /* subtract a negative from a positive, OR */
-    /* subtract a positive from a negative. */
-    /* In either case, ADD their magnitudes, */
-    /* and use the sign of the first number. */
-    c->sign = sa;
-    s_fp_add (a, b, c);
-  } else {
-    /* subtract a positive from a positive, OR */
-    /* subtract a negative from a negative. */
-    /* First, take the difference between their */
-    /* magnitudes, then... */
-    if (fp_cmp_mag (a, b) != FP_LT) {
-      /* Copy the sign from the first */
-      c->sign = sa;
-      /* The first has a larger or equal magnitude */
-      s_fp_sub (a, b, c);
-    } else {
-      /* The result has the *opposite* sign from */
-      /* the first number. */
-      c->sign = (sa == FP_ZPOS) ? FP_NEG : FP_ZPOS;
-      /* The second has a larger magnitude */
-      s_fp_sub (b, a, c);
-    }
-  }
-}
-
-
-/* End: fp_sub.c */
-
-/* Start: fp_sub_d.c */
-/* TomsFastMath, a fast ISO C bignum library.
- *
- * This project is meant to fill in where LibTomMath
- * falls short.  That is speed ;-)
- *
- * This project is public domain and free for all purposes.
- *
- * Tom St Denis, tomstdenis@iahu.ca
- */
-#include <tfm.h>
-
-/* c = a - b */
-void fp_sub_d(fp_int *a, fp_digit b, fp_int *c)
-{
-   fp_int tmp;
-   fp_set(&tmp, b);
-   fp_sub(a, &tmp, c);
-}
-
-/* End: fp_sub_d.c */
-
-/* Start: fp_submod.c */
-/* TomsFastMath, a fast ISO C bignum library.
- *
- * This project is meant to fill in where LibTomMath
- * falls short.  That is speed ;-)
- *
- * This project is public domain and free for all purposes.
- *
- * Tom St Denis, tomstdenis@iahu.ca
- */
-#include <tfm.h>
-
-/* d = a - b (mod c) */
-int fp_submod(fp_int *a, fp_int *b, fp_int *c, fp_int *d)
-{
-  fp_int tmp;
-  fp_zero(&tmp);
-  fp_sub(a, b, &tmp);
-  return fp_mod(&tmp, c, d);
-}
-
-
-/* End: fp_submod.c */
-
-/* Start: fp_to_signed_bin.c */
-/* TomsFastMath, a fast ISO C bignum library.
- *
- * This project is meant to fill in where LibTomMath
- * falls short.  That is speed ;-)
- *
- * This project is public domain and free for all purposes.
- *
- * Tom St Denis, tomstdenis@iahu.ca
- */
-#include <tfm.h>
-
-void fp_to_signed_bin(fp_int *a, unsigned char *b)
-{
-  fp_to_unsigned_bin (a, b + 1);
-  b[0] = (unsigned char) ((a->sign == FP_ZPOS) ? 0 : 1);
-}
-
-/* End: fp_to_signed_bin.c */
-
-/* Start: fp_to_unsigned_bin.c */
-/* TomsFastMath, a fast ISO C bignum library.
- *
- * This project is meant to fill in where LibTomMath
- * falls short.  That is speed ;-)
- *
- * This project is public domain and free for all purposes.
- *
- * Tom St Denis, tomstdenis@iahu.ca
- */
-#include <tfm.h>
-
-void fp_to_unsigned_bin(fp_int *a, unsigned char *b)
-{
-  int     x;
-  fp_int  t;
-
-  fp_init_copy(&t, a);
-
-  x = 0;
-  while (fp_iszero (&t) == FP_NO) {
-      b[x++] = (unsigned char) (t.dp[0] & 255);
-      fp_div_2d (&t, 8, &t, NULL);
-  }
-  bn_reverse (b, x);
-}
-
-/* End: fp_to_unsigned_bin.c */
-
-/* Start: fp_toradix.c */
-/* TomsFastMath, a fast ISO C bignum library.
- *
- * This project is meant to fill in where LibTomMath
- * falls short.  That is speed ;-)
- *
- * This project is public domain and free for all purposes.
- *
- * Tom St Denis, tomstdenis@iahu.ca
- */
-#include <tfm.h>
-
-int fp_toradix(fp_int *a, char *str, int radix)
-{
-  int     digs;
-  fp_int  t;
-  fp_digit d;
-  char   *_s = str;
-
-  /* check range of the radix */
-  if (radix < 2 || radix > 64) {
-    return FP_VAL;
-  }
-
-  /* quick out if its zero */
-  if (fp_iszero(a) == 1) {
-     *str++ = '0';
-     *str = '\0';
-     return FP_OKAY;
-  }
-
-  fp_init_copy(&t, a);
-
-  /* if it is negative output a - */
-  if (t.sign == FP_NEG) {
-    ++_s;
-    *str++ = '-';
-    t.sign = FP_ZPOS;
-  }
-
-  digs = 0;
-  while (fp_iszero (&t) == FP_NO) {
-    fp_div_d (&t, (fp_digit) radix, &t, &d);
-    *str++ = fp_s_rmap[d];
-    ++digs;
-  }
-
-  /* reverse the digits of the string.  In this case _s points
-   * to the first digit [exluding the sign] of the number]
-   */
-  bn_reverse ((unsigned char *)_s, digs);
-
-  /* append a NULL so the string is properly terminated */
-  *str = '\0';
-  return FP_OKAY;
-}
-
-/* End: fp_toradix.c */
-
-/* Start: fp_unsigned_bin_size.c */
-/* TomsFastMath, a fast ISO C bignum library.
- *
- * This project is meant to fill in where LibTomMath
- * falls short.  That is speed ;-)
- *
- * This project is public domain and free for all purposes.
- *
- * Tom St Denis, tomstdenis@iahu.ca
- */
-#include <tfm.h>
-
-int fp_unsigned_bin_size(fp_int *a)
-{
-  int     size = fp_count_bits (a);
-  return (size / 8 + ((size & 7) != 0 ? 1 : 0));
-}
-
-/* End: fp_unsigned_bin_size.c */
-
-/* Start: s_fp_add.c */
-/* TomsFastMath, a fast ISO C bignum library.
- *
- * This project is meant to fill in where LibTomMath
- * falls short.  That is speed ;-)
- *
- * This project is public domain and free for all purposes.
- *
- * Tom St Denis, tomstdenis@iahu.ca
- */
-#include <tfm.h>
-
-/* unsigned addition */
-void s_fp_add(fp_int *a, fp_int *b, fp_int *c)
-{
-  int      x, y, oldused;
-  fp_word  t;
-
-  y       = MAX(a->used, b->used);
-  oldused = c->used;
-  c->used = y;
-
-  t = 0;
-  for (x = 0; x < y; x++) {
-      t         += ((fp_word)a->dp[x]) + ((fp_word)b->dp[x]);
-      c->dp[x]   = (fp_digit)t;
-      t        >>= DIGIT_BIT;
-  }
-  if (t != 0 && x != FP_SIZE) {
-     c->dp[c->used++] = (fp_digit)t;
-     ++x;
-  }
-
-  for (; x < oldused; x++) {
-     c->dp[x] = 0;
-  }
-  fp_clamp(c);
-}
-
-/* End: s_fp_add.c */
-
-/* Start: s_fp_sub.c */
-/* TomsFastMath, a fast ISO C bignum library.
- *
- * This project is meant to fill in where LibTomMath
- * falls short.  That is speed ;-)
- *
- * This project is public domain and free for all purposes.
- *
- * Tom St Denis, tomstdenis@iahu.ca
- */
-#include <tfm.h>
-
-/* unsigned subtraction ||a|| >= ||b|| ALWAYS! */
-void s_fp_sub(fp_int *a, fp_int *b, fp_int *c)
-{
-  int      x, oldused;
-  fp_word  t;
-
-  oldused = c->used;
-  c->used = a->used;
-  t       = 0;
-  for (x = 0; x < a->used; x++) {
-      t         = ((fp_word)a->dp[x]) - (((fp_word)b->dp[x]) + t);
-      c->dp[x]  = (fp_digit)t;
-      t         = (t >> DIGIT_BIT) & 1;
-  }
-
-  for (; x < oldused; x++) {
-     c->dp[x] = 0;
-  }
-  fp_clamp(c);
-}
-
-/* End: s_fp_sub.c */
-
-
-/* EOF */
diff --git a/lib/silcmath/tfm.h b/lib/silcmath/tfm.h
deleted file mode 100644 (file)
index 677f288..0000000
+++ /dev/null
@@ -1,362 +0,0 @@
-/* TomsFastMath, a fast ISO C bignum library.
- *
- * This project is meant to fill in where LibTomMath
- * falls short.  That is speed ;-)
- *
- * This project is public domain and free for all purposes.
- *
- * Tom St Denis, tomstdenis@iahu.ca
- */
-#ifndef TFM_H_
-#define TFM_H_
-
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#include <ctype.h>
-#include <limits.h>
-
-/* Assure these -Pekka */
-#undef CRYPT
-
-#undef MIN
-#define MIN(x,y) ((x)<(y)?(x):(y))
-#undef MAX
-#define MAX(x,y) ((x)>(y)?(x):(y))
-
-/* do we want large code? */
-#define TFM_LARGE
-
-/* do we want huge code (implies large)?  The answer is, yes. */
-#define TFM_HUGE
-
-/* imply TFM_LARGE as required */
-#if defined(TFM_HUGE)
-   #if !defined(TFM_LARGE)
-      #define TFM_LARGE
-   #endif
-#endif
-
-/* Max size of any number in bits.  Basically the largest size you will be multiplying
- * should be half [or smaller] of FP_MAX_SIZE-four_digit
- *
- * You can externally define this or it defaults to 4096-bits.
- */
-#ifndef FP_MAX_SIZE
-/* For SILC -Pekka */
-   #define FP_MAX_SIZE           (8192+(4*DIGIT_BIT))
-/*   #define FP_MAX_SIZE           (4096+(4*DIGIT_BIT))*/
-#endif
-
-/* will this lib work? */
-#if (CHAR_BIT & 7)
-   #error CHAR_BIT must be a multiple of eight.
-#endif
-#if FP_MAX_SIZE % CHAR_BIT
-   #error FP_MAX_SIZE must be a multiple of CHAR_BIT
-#endif
-
-/* autodetect x86-64 and make sure we are using 64-bit digits with x86-64 asm */
-#if defined(__x86_64__)
-   #if defined(TFM_X86) || defined(TFM_SSE2) || defined(TFM_ARM)
-       #error x86-64 detected, x86-32/SSE2/ARM optimizations are not valid!
-   #endif
-   #if !defined(TFM_X86_64) && !defined(TFM_NO_ASM)
-      #define TFM_X86_64
-   #endif
-#endif
-#if defined(TFM_X86_64)
-    #if !defined(FP_64BIT)
-       #define FP_64BIT
-    #endif
-#endif
-
-/* try to detect x86-32 */
-#if defined(__i386__) && !defined(TFM_SSE2)
-   #if defined(TFM_X86_64) || defined(TFM_ARM)
-       #error x86-32 detected, x86-64/ARM optimizations are not valid!
-   #endif
-   #if !defined(TFM_X86) && !defined(TFM_NO_ASM)
-      #define TFM_X86
-   #endif
-#endif
-
-/* make sure we're 32-bit for x86-32/sse/arm */
-#if (defined(TFM_X86) || defined(TFM_SSE2) || defined(TFM_ARM)) && defined(FP_64BIT)
-   #warning x86-32, SSE2 and ARM optimizations require 32-bit digits (undefining)
-   #undef FP_64BIT
-#endif
-
-/* multi asms? */
-#ifdef TFM_X86
-   #define TFM_ASM
-#endif
-#ifdef TFM_X86_64
-   #ifdef TFM_ASM
-      #error TFM_ASM already defined!
-   #endif
-   #define TFM_ASM
-#endif
-#ifdef TFM_SSE2
-   #ifdef TFM_ASM
-      #error TFM_ASM already defined!
-   #endif
-   #define TFM_ASM
-#endif
-#ifdef TFM_ARM
-   #ifdef TFM_ASM
-      #error TFM_ASM already defined!
-   #endif
-   #define TFM_ASM
-#endif
-
-/* we want no asm? */
-#ifdef TFM_NO_ASM
-   #undef TFM_X86
-   #undef TFM_X86_64
-   #undef TFM_SSE2
-   #undef TFM_ARM
-   #undef TFM_ASM
-#endif
-
-/* some default configurations.
- */
-#if defined(FP_64BIT)
-   /* for GCC only on supported platforms */
-#ifndef CRYPT
-   typedef unsigned long ulong64;
-#endif
-   typedef ulong64            fp_digit;
-   typedef unsigned long      fp_word __attribute__ ((mode(TI)));
-#else
-   /* this is to make porting into LibTomCrypt easier :-) */
-#ifndef CRYPT
-   #if defined(_MSC_VER) || defined(__BORLANDC__)
-      typedef unsigned __int64   ulong64;
-      typedef signed __int64     long64;
-   #else
-      typedef unsigned long long ulong64;
-      typedef signed long long   long64;
-   #endif
-#endif
-   typedef unsigned long      fp_digit;
-   typedef ulong64            fp_word;
-#endif
-
-/* # of digits this is */
-#define DIGIT_BIT  (int)((CHAR_BIT) * sizeof(fp_digit))
-#define FP_MASK    (fp_digit)(-1)
-#define FP_SIZE    (FP_MAX_SIZE/DIGIT_BIT)
-
-/* signs */
-#define FP_ZPOS     0
-#define FP_NEG      1
-
-/* return codes */
-#define FP_OKAY     0
-#define FP_VAL      1
-#define FP_MEM      2
-
-/* equalities */
-#define FP_LT        -1   /* less than */
-#define FP_EQ         0   /* equal to */
-#define FP_GT         1   /* greater than */
-
-/* replies */
-#define FP_YES        1   /* yes response */
-#define FP_NO         0   /* no response */
-
-/* a FP type */
-typedef struct {
-    fp_digit dp[FP_SIZE];
-    int      used,
-             sign;
-} fp_int;
-
-/* functions */
-
-/* returns a TFM ident string useful for debugging... */
-const char *fp_ident(void);
-
-/* initialize [or zero] an fp int */
-#define fp_init(a)  (void)memset((a), 0, sizeof(fp_int))
-#define fp_zero(a)  fp_init(a)
-
-/* zero/even/odd ? */
-#define fp_iszero(a) (((a)->used == 0) ? FP_YES : FP_NO)
-#define fp_iseven(a) (((a)->used > 0 && (((a)->dp[0] & 1) == 0)) ? FP_YES : FP_NO)
-#define fp_isodd(a)  (((a)->used > 0 && (((a)->dp[0] & 1) == 1)) ? FP_YES : FP_NO)
-
-/* set to a small digit */
-void fp_set(fp_int *a, fp_digit b);
-
-/* copy from a to b */
-#define fp_copy(a, b)      (void)(((a) != (b)) && memcpy((b), (a), sizeof(fp_int)))
-#define fp_init_copy(a, b) fp_copy(b, a)
-
-/* negate and absolute */
-#define fp_neg(a, b)  { fp_copy(a, b); (b)->sign ^= 1; }
-#define fp_abs(a, b)  { fp_copy(a, b); (b)->sign  = 0; }
-
-/* clamp digits */
-#define fp_clamp(a)   { while ((a)->used && (a)->dp[(a)->used-1] == 0) --((a)->used); (a)->sign = (a)->used ? (a)->sign : FP_ZPOS; }
-
-/* right shift x digits */
-void fp_rshd(fp_int *a, int x);
-
-/* left shift x digits */
-void fp_lshd(fp_int *a, int x);
-
-/* signed comparison */
-int fp_cmp(fp_int *a, fp_int *b);
-
-/* unsigned comparison */
-int fp_cmp_mag(fp_int *a, fp_int *b);
-
-/* power of 2 operations */
-void fp_div_2d(fp_int *a, int b, fp_int *c, fp_int *d);
-void fp_mod_2d(fp_int *a, int b, fp_int *c);
-void fp_mul_2d(fp_int *a, int b, fp_int *c);
-void fp_2expt (fp_int *a, int b);
-void fp_mul_2(fp_int *a, fp_int *c);
-void fp_div_2(fp_int *a, fp_int *c);
-
-/* Counts the number of lsbs which are zero before the first zero bit */
-int fp_cnt_lsb(fp_int *a);
-
-/* c = a + b */
-void fp_add(fp_int *a, fp_int *b, fp_int *c);
-
-/* c = a - b */
-void fp_sub(fp_int *a, fp_int *b, fp_int *c);
-
-/* c = a * b */
-void fp_mul(fp_int *a, fp_int *b, fp_int *c);
-
-/* b = a*a  */
-void fp_sqr(fp_int *a, fp_int *b);
-
-/* a/b => cb + d == a */
-int fp_div(fp_int *a, fp_int *b, fp_int *c, fp_int *d);
-
-/* c = a mod b, 0 <= c < b  */
-int fp_mod(fp_int *a, fp_int *b, fp_int *c);
-
-/* compare against a single digit */
-int fp_cmp_d(fp_int *a, fp_digit b);
-
-/* c = a + b */
-void fp_add_d(fp_int *a, fp_digit b, fp_int *c);
-
-/* c = a - b */
-void fp_sub_d(fp_int *a, fp_digit b, fp_int *c);
-
-/* c = a * b */
-void fp_mul_d(fp_int *a, fp_digit b, fp_int *c);
-
-/* a/b => cb + d == a */
-int fp_div_d(fp_int *a, fp_digit b, fp_int *c, fp_digit *d);
-
-/* c = a mod b, 0 <= c < b  */
-int fp_mod_d(fp_int *a, fp_digit b, fp_digit *c);
-
-/* ---> number theory <--- */
-/* d = a + b (mod c) */
-int fp_addmod(fp_int *a, fp_int *b, fp_int *c, fp_int *d);
-
-/* d = a - b (mod c) */
-int fp_submod(fp_int *a, fp_int *b, fp_int *c, fp_int *d);
-
-/* d = a * b (mod c) */
-int fp_mulmod(fp_int *a, fp_int *b, fp_int *c, fp_int *d);
-
-/* c = a * a (mod b) */
-int fp_sqrmod(fp_int *a, fp_int *b, fp_int *c);
-
-/* c = 1/a (mod b) */
-int fp_invmod(fp_int *a, fp_int *b, fp_int *c);
-
-/* c = (a, b) */
-void fp_gcd(fp_int *a, fp_int *b, fp_int *c);
-
-/* c = [a, b] */
-void fp_lcm(fp_int *a, fp_int *b, fp_int *c);
-
-/* setups the montgomery reduction */
-int fp_montgomery_setup(fp_int *a, fp_digit *mp);
-
-/* computes a = B**n mod b without division or multiplication useful for
- * normalizing numbers in a Montgomery system.
- */
-void fp_montgomery_calc_normalization(fp_int *a, fp_int *b);
-
-/* computes x/R == x (mod N) via Montgomery Reduction */
-void fp_montgomery_reduce(fp_int *a, fp_int *m, fp_digit mp);
-
-/* d = a**b (mod c) */
-int fp_exptmod(fp_int *a, fp_int *b, fp_int *c, fp_int *d);
-
-/* primality stuff */
-
-/* perform a Miller-Rabin test of a to the base b and store result in "result" */
-void fp_prime_miller_rabin (fp_int * a, fp_int * b, int *result);
-
-/* 256 trial divisions + 8 Miller-Rabins, returns FP_YES if probable prime  */
-int fp_isprime(fp_int *a);
-
-/* Primality generation flags */
-#define TFM_PRIME_BBS      0x0001 /* BBS style prime */
-#define TFM_PRIME_SAFE     0x0002 /* Safe prime (p-1)/2 == prime */
-#define TFM_PRIME_2MSB_OFF 0x0004 /* force 2nd MSB to 0 */
-#define TFM_PRIME_2MSB_ON  0x0008 /* force 2nd MSB to 1 */
-
-/* callback for fp_prime_random, should fill dst with random bytes and return how many read [upto len] */
-typedef int tfm_prime_callback(unsigned char *dst, int len, void *dat);
-
-#define fp_prime_random(a, t, size, bbs, cb, dat) fp_prime_random_ex(a, t, ((size) * 8) + 1, (bbs==1)?TFM_PRIME_BBS:0, cb, dat)
-
-int fp_prime_random_ex(fp_int *a, int t, int size, int flags, tfm_prime_callback cb, void *dat);
-
-/* radix conersions */
-int fp_count_bits(fp_int *a);
-
-int fp_unsigned_bin_size(fp_int *a);
-void fp_read_unsigned_bin(fp_int *a, unsigned char *b, int c);
-void fp_to_unsigned_bin(fp_int *a, unsigned char *b);
-
-int fp_signed_bin_size(fp_int *a);
-void fp_read_signed_bin(fp_int *a, unsigned char *b, int c);
-void fp_to_signed_bin(fp_int *a, unsigned char *b);
-
-int fp_read_radix(fp_int *a, char *str, int radix);
-int fp_toradix(fp_int *a, char *str, int radix);
-int fp_toradix_n(fp_int * a, char *str, int radix, int maxlen);
-int fp_radix_size(fp_int *a, int radix, int *size);
-
-/* VARIOUS LOW LEVEL STUFFS */
-void s_fp_add(fp_int *a, fp_int *b, fp_int *c);
-void s_fp_sub(fp_int *a, fp_int *b, fp_int *c);
-void bn_reverse(unsigned char *s, int len);
-void fp_mul_comba(fp_int *A, fp_int *B, fp_int *C);
-#ifdef TFM_HUGE
-void fp_mul_comba32(fp_int *A, fp_int *B, fp_int *C);
-#endif
-#ifdef TFM_LARGE
-void fp_mul_comba16(fp_int *A, fp_int *B, fp_int *C);
-#endif
-void fp_mul_comba8(fp_int *A, fp_int *B, fp_int *C);
-void fp_mul_comba4(fp_int *A, fp_int *B, fp_int *C);
-
-void fp_sqr_comba(fp_int *A, fp_int *B);
-void fp_sqr_comba4(fp_int *A, fp_int *B);
-void fp_sqr_comba8(fp_int *A, fp_int *B);
-#ifdef TFM_LARGE
-void fp_sqr_comba16(fp_int *A, fp_int *B);
-#endif
-#ifdef TFM_HUGE
-void fp_sqr_comba32(fp_int *A, fp_int *B);
-void fp_sqr_comba64(fp_int *A, fp_int *B);
-#endif
-extern const char *fp_s_rmap;
-
-#endif
diff --git a/lib/silcmath/tma.c b/lib/silcmath/tma.c
deleted file mode 100644 (file)
index b29353a..0000000
+++ /dev/null
@@ -1,9519 +0,0 @@
-/* Start: bn_error.c */
-#include "tma.h"
-#ifdef BN_ERROR_C
-/* LibTomMath, multiple-precision integer library -- Tom St Denis
- *
- * LibTomMath is a library that provides multiple-precision
- * integer arithmetic as well as number theoretic functionality.
- *
- * The library was designed directly after the MPI library by
- * Michael Fromberger but has been written from scratch with
- * additional optimizations in place.
- *
- * The library is free for all purposes without any express
- * guarantee it works.
- *
- * Tom St Denis, tomstdenis@gmail.com, http://libtom.org
- */
-
-static const struct {
-     int code;
-     char *msg;
-} msgs[] = {
-     { MP_OKAY, "Successful" },
-     { MP_MEM,  "Out of heap" },
-     { MP_VAL,  "Value out of range" }
-};
-
-/* return a char * string for a given code */
-char *tma_mp_error_to_string(int code)
-{
-   int x;
-
-   /* scan the lookup table for the given message */
-   for (x = 0; x < (int)(sizeof(msgs) / sizeof(msgs[0])); x++) {
-       if (msgs[x].code == code) {
-          return msgs[x].msg;
-       }
-   }
-
-   /* generic reply for invalid code */
-   return "Invalid error code";
-}
-
-#endif
-
-/* $Source$ */
-/* $Revision$ */
-/* $Date$ */
-
-/* End: bn_error.c */
-
-/* Start: bn_fast_tma_mp_invmod.c */
-#include "tma.h"
-#ifdef BN_FAST_MP_INVMOD_C
-/* LibTomMath, multiple-precision integer library -- Tom St Denis
- *
- * LibTomMath is a library that provides multiple-precision
- * integer arithmetic as well as number theoretic functionality.
- *
- * The library was designed directly after the MPI library by
- * Michael Fromberger but has been written from scratch with
- * additional optimizations in place.
- *
- * The library is free for all purposes without any express
- * guarantee it works.
- *
- * Tom St Denis, tomstdenis@gmail.com, http://libtom.org
- */
-
-/* computes the modular inverse via binary extended euclidean algorithm,
- * that is c = 1/a mod b
- *
- * Based on slow invmod except this is optimized for the case where b is
- * odd as per HAC Note 14.64 on pp. 610
- */
-int fast_tma_mp_invmod (tma_mp_int * a, tma_mp_int * b, tma_mp_int * c)
-{
-  tma_mp_int  x, y, u, v, B, D;
-  int     res, neg;
-
-  /* 2. [modified] b must be odd   */
-  if (tma_mp_iseven (b) == 1) {
-    return MP_VAL;
-  }
-
-  /* init all our temps */
-  if ((res = tma_mp_init_multi(&x, &y, &u, &v, &B, &D, NULL)) != MP_OKAY) {
-     return res;
-  }
-
-  /* x == modulus, y == value to invert */
-  if ((res = tma_mp_copy (b, &x)) != MP_OKAY) {
-    goto LBL_ERR;
-  }
-
-  /* we need y = |a| */
-  if ((res = tma_mp_mod (a, b, &y)) != MP_OKAY) {
-    goto LBL_ERR;
-  }
-
-  /* 3. u=x, v=y, A=1, B=0, C=0,D=1 */
-  if ((res = tma_mp_copy (&x, &u)) != MP_OKAY) {
-    goto LBL_ERR;
-  }
-  if ((res = tma_mp_copy (&y, &v)) != MP_OKAY) {
-    goto LBL_ERR;
-  }
-  tma_mp_set (&D, 1);
-
-top:
-  /* 4.  while u is even do */
-  while (tma_mp_iseven (&u) == 1) {
-    /* 4.1 u = u/2 */
-    if ((res = tma_mp_div_2 (&u, &u)) != MP_OKAY) {
-      goto LBL_ERR;
-    }
-    /* 4.2 if B is odd then */
-    if (tma_mp_isodd (&B) == 1) {
-      if ((res = tma_mp_sub (&B, &x, &B)) != MP_OKAY) {
-        goto LBL_ERR;
-      }
-    }
-    /* B = B/2 */
-    if ((res = tma_mp_div_2 (&B, &B)) != MP_OKAY) {
-      goto LBL_ERR;
-    }
-  }
-
-  /* 5.  while v is even do */
-  while (tma_mp_iseven (&v) == 1) {
-    /* 5.1 v = v/2 */
-    if ((res = tma_mp_div_2 (&v, &v)) != MP_OKAY) {
-      goto LBL_ERR;
-    }
-    /* 5.2 if D is odd then */
-    if (tma_mp_isodd (&D) == 1) {
-      /* D = (D-x)/2 */
-      if ((res = tma_mp_sub (&D, &x, &D)) != MP_OKAY) {
-        goto LBL_ERR;
-      }
-    }
-    /* D = D/2 */
-    if ((res = tma_mp_div_2 (&D, &D)) != MP_OKAY) {
-      goto LBL_ERR;
-    }
-  }
-
-  /* 6.  if u >= v then */
-  if (tma_mp_cmp (&u, &v) != MP_LT) {
-    /* u = u - v, B = B - D */
-    if ((res = tma_mp_sub (&u, &v, &u)) != MP_OKAY) {
-      goto LBL_ERR;
-    }
-
-    if ((res = tma_mp_sub (&B, &D, &B)) != MP_OKAY) {
-      goto LBL_ERR;
-    }
-  } else {
-    /* v - v - u, D = D - B */
-    if ((res = tma_mp_sub (&v, &u, &v)) != MP_OKAY) {
-      goto LBL_ERR;
-    }
-
-    if ((res = tma_mp_sub (&D, &B, &D)) != MP_OKAY) {
-      goto LBL_ERR;
-    }
-  }
-
-  /* if not zero goto step 4 */
-  if (tma_mp_iszero (&u) == 0) {
-    goto top;
-  }
-
-  /* now a = C, b = D, gcd == g*v */
-
-  /* if v != 1 then there is no inverse */
-  if (tma_mp_cmp_d (&v, 1) != MP_EQ) {
-    res = MP_VAL;
-    goto LBL_ERR;
-  }
-
-  /* b is now the inverse */
-  neg = a->sign;
-  while (D.sign == MP_NEG) {
-    if ((res = tma_mp_add (&D, b, &D)) != MP_OKAY) {
-      goto LBL_ERR;
-    }
-  }
-  tma_mp_exch (&D, c);
-  c->sign = neg;
-  res = MP_OKAY;
-
-LBL_ERR:tma_mp_clear_multi (&x, &y, &u, &v, &B, &D, NULL);
-  return res;
-}
-#endif
-
-/* $Source$ */
-/* $Revision$ */
-/* $Date$ */
-
-/* End: bn_fast_tma_mp_invmod.c */
-
-/* Start: bn_fast_tma_mp_montgomery_reduce.c */
-#include "tma.h"
-#ifdef BN_FAST_MP_MONTGOMERY_REDUCE_C
-/* LibTomMath, multiple-precision integer library -- Tom St Denis
- *
- * LibTomMath is a library that provides multiple-precision
- * integer arithmetic as well as number theoretic functionality.
- *
- * The library was designed directly after the MPI library by
- * Michael Fromberger but has been written from scratch with
- * additional optimizations in place.
- *
- * The library is free for all purposes without any express
- * guarantee it works.
- *
- * Tom St Denis, tomstdenis@gmail.com, http://libtom.org
- */
-
-/* computes xR**-1 == x (mod N) via Montgomery Reduction
- *
- * This is an optimized implementation of montgomery_reduce
- * which uses the comba method to quickly calculate the columns of the
- * reduction.
- *
- * Based on Algorithm 14.32 on pp.601 of HAC.
-*/
-int fast_tma_mp_montgomery_reduce (tma_mp_int * x, tma_mp_int * n, tma_mp_digit rho)
-{
-  int     ix, res, olduse;
-  tma_mp_word W[MP_WARRAY];
-
-  /* get old used count */
-  olduse = x->used;
-
-  /* grow a as required */
-  if (x->alloc < n->used + 1) {
-    if ((res = tma_mp_grow (x, n->used + 1)) != MP_OKAY) {
-      return res;
-    }
-  }
-
-  /* first we have to get the digits of the input into
-   * an array of double precision words W[...]
-   */
-  {
-    register tma_mp_word *_W;
-    register tma_mp_digit *tmpx;
-
-    /* alias for the W[] array */
-    _W   = W;
-
-    /* alias for the digits of  x*/
-    tmpx = x->dp;
-
-    /* copy the digits of a into W[0..a->used-1] */
-    for (ix = 0; ix < x->used; ix++) {
-      *_W++ = *tmpx++;
-    }
-
-    /* zero the high words of W[a->used..m->used*2] */
-    for (; ix < n->used * 2 + 1; ix++) {
-      *_W++ = 0;
-    }
-  }
-
-  /* now we proceed to zero successive digits
-   * from the least significant upwards
-   */
-  for (ix = 0; ix < n->used; ix++) {
-    /* mu = ai * m' mod b
-     *
-     * We avoid a double precision multiplication (which isn't required)
-     * by casting the value down to a tma_mp_digit.  Note this requires
-     * that W[ix-1] have  the carry cleared (see after the inner loop)
-     */
-    register tma_mp_digit mu;
-    mu = (tma_mp_digit) (((W[ix] & MP_MASK) * rho) & MP_MASK);
-
-    /* a = a + mu * m * b**i
-     *
-     * This is computed in place and on the fly.  The multiplication
-     * by b**i is handled by offseting which columns the results
-     * are added to.
-     *
-     * Note the comba method normally doesn't handle carries in the
-     * inner loop In this case we fix the carry from the previous
-     * column since the Montgomery reduction requires digits of the
-     * result (so far) [see above] to work.  This is
-     * handled by fixing up one carry after the inner loop.  The
-     * carry fixups are done in order so after these loops the
-     * first m->used words of W[] have the carries fixed
-     */
-    {
-      register int iy;
-      register tma_mp_digit *tmpn;
-      register tma_mp_word *_W;
-
-      /* alias for the digits of the modulus */
-      tmpn = n->dp;
-
-      /* Alias for the columns set by an offset of ix */
-      _W = W + ix;
-
-      /* inner loop */
-      for (iy = 0; iy < n->used; iy++) {
-          *_W++ += ((tma_mp_word)mu) * ((tma_mp_word)*tmpn++);
-      }
-    }
-
-    /* now fix carry for next digit, W[ix+1] */
-    W[ix + 1] += W[ix] >> ((tma_mp_word) DIGIT_BIT);
-  }
-
-  /* now we have to propagate the carries and
-   * shift the words downward [all those least
-   * significant digits we zeroed].
-   */
-  {
-    register tma_mp_digit *tmpx;
-    register tma_mp_word *_W, *_W1;
-
-    /* nox fix rest of carries */
-
-    /* alias for current word */
-    _W1 = W + ix;
-
-    /* alias for next word, where the carry goes */
-    _W = W + ++ix;
-
-    for (; ix <= n->used * 2 + 1; ix++) {
-      *_W++ += *_W1++ >> ((tma_mp_word) DIGIT_BIT);
-    }
-
-    /* copy out, A = A/b**n
-     *
-     * The result is A/b**n but instead of converting from an
-     * array of tma_mp_word to tma_mp_digit than calling tma_mp_rshd
-     * we just copy them in the right order
-     */
-
-    /* alias for destination word */
-    tmpx = x->dp;
-
-    /* alias for shifted double precision result */
-    _W = W + n->used;
-
-    for (ix = 0; ix < n->used + 1; ix++) {
-      *tmpx++ = (tma_mp_digit)(*_W++ & ((tma_mp_word) MP_MASK));
-    }
-
-    /* zero oldused digits, if the input a was larger than
-     * m->used+1 we'll have to clear the digits
-     */
-    for (; ix < olduse; ix++) {
-      *tmpx++ = 0;
-    }
-  }
-
-  /* set the max used and clamp */
-  x->used = n->used + 1;
-  tma_mp_clamp (x);
-
-  /* if A >= m then A = A - m */
-  if (tma_mp_cmp_mag (x, n) != MP_LT) {
-    return s_tma_mp_sub (x, n, x);
-  }
-  return MP_OKAY;
-}
-#endif
-
-/* $Source$ */
-/* $Revision$ */
-/* $Date$ */
-
-/* End: bn_fast_tma_mp_montgomery_reduce.c */
-
-/* Start: bn_fast_s_tma_mp_mul_digs.c */
-#include "tma.h"
-#ifdef BN_FAST_S_MP_MUL_DIGS_C
-/* LibTomMath, multiple-precision integer library -- Tom St Denis
- *
- * LibTomMath is a library that provides multiple-precision
- * integer arithmetic as well as number theoretic functionality.
- *
- * The library was designed directly after the MPI library by
- * Michael Fromberger but has been written from scratch with
- * additional optimizations in place.
- *
- * The library is free for all purposes without any express
- * guarantee it works.
- *
- * Tom St Denis, tomstdenis@gmail.com, http://libtom.org
- */
-
-/* Fast (comba) multiplier
- *
- * This is the fast column-array [comba] multiplier.  It is
- * designed to compute the columns of the product first
- * then handle the carries afterwards.  This has the effect
- * of making the nested loops that compute the columns very
- * simple and schedulable on super-scalar processors.
- *
- * This has been modified to produce a variable number of
- * digits of output so if say only a half-product is required
- * you don't have to compute the upper half (a feature
- * required for fast Barrett reduction).
- *
- * Based on Algorithm 14.12 on pp.595 of HAC.
- *
- */
-int fast_s_tma_mp_mul_digs (tma_mp_int * a, tma_mp_int * b, tma_mp_int * c, int digs)
-{
-  int     olduse, res, pa, ix, iz;
-  tma_mp_digit W[MP_WARRAY];
-  register tma_mp_word  _W;
-
-  /* grow the destination as required */
-  if (c->alloc < digs) {
-    if ((res = tma_mp_grow (c, digs)) != MP_OKAY) {
-      return res;
-    }
-  }
-
-  /* number of output digits to produce */
-  pa = MIN(digs, a->used + b->used);
-
-  /* clear the carry */
-  _W = 0;
-  for (ix = 0; ix < pa; ix++) {
-      int      tx, ty;
-      int      iy;
-      tma_mp_digit *tmpx, *tmpy;
-
-      /* get offsets into the two bignums */
-      ty = MIN(b->used-1, ix);
-      tx = ix - ty;
-
-      /* setup temp aliases */
-      tmpx = a->dp + tx;
-      tmpy = b->dp + ty;
-
-      /* this is the number of times the loop will iterrate, essentially
-         while (tx++ < a->used && ty-- >= 0) { ... }
-       */
-      iy = MIN(a->used-tx, ty+1);
-
-      /* execute loop */
-      for (iz = 0; iz < iy; ++iz) {
-         _W += ((tma_mp_word)*tmpx++)*((tma_mp_word)*tmpy--);
-
-      }
-
-      /* store term */
-      W[ix] = ((tma_mp_digit)_W) & MP_MASK;
-
-      /* make next carry */
-      _W = _W >> ((tma_mp_word)DIGIT_BIT);
- }
-
-  /* setup dest */
-  olduse  = c->used;
-  c->used = pa;
-
-  {
-    register tma_mp_digit *tmpc;
-    tmpc = c->dp;
-    for (ix = 0; ix < pa+1; ix++) {
-      /* now extract the previous digit [below the carry] */
-      *tmpc++ = W[ix];
-    }
-
-    /* clear unused digits [that existed in the old copy of c] */
-    for (; ix < olduse; ix++) {
-      *tmpc++ = 0;
-    }
-  }
-  tma_mp_clamp (c);
-  return MP_OKAY;
-}
-#endif
-
-/* $Source$ */
-/* $Revision$ */
-/* $Date$ */
-
-/* End: bn_fast_s_tma_mp_mul_digs.c */
-
-/* Start: bn_fast_s_tma_mp_mul_high_digs.c */
-#include "tma.h"
-#ifdef BN_FAST_S_MP_MUL_HIGH_DIGS_C
-/* LibTomMath, multiple-precision integer library -- Tom St Denis
- *
- * LibTomMath is a library that provides multiple-precision
- * integer arithmetic as well as number theoretic functionality.
- *
- * The library was designed directly after the MPI library by
- * Michael Fromberger but has been written from scratch with
- * additional optimizations in place.
- *
- * The library is free for all purposes without any express
- * guarantee it works.
- *
- * Tom St Denis, tomstdenis@gmail.com, http://libtom.org
- */
-
-/* this is a modified version of fast_s_mul_digs that only produces
- * output digits *above* digs.  See the comments for fast_s_mul_digs
- * to see how it works.
- *
- * This is used in the Barrett reduction since for one of the multiplications
- * only the higher digits were needed.  This essentially halves the work.
- *
- * Based on Algorithm 14.12 on pp.595 of HAC.
- */
-int fast_s_tma_mp_mul_high_digs (tma_mp_int * a, tma_mp_int * b, tma_mp_int * c, int digs)
-{
-  int     olduse, res, pa, ix, iz;
-  tma_mp_digit W[MP_WARRAY];
-  tma_mp_word  _W;
-
-  /* grow the destination as required */
-  pa = a->used + b->used;
-  if (c->alloc < pa) {
-    if ((res = tma_mp_grow (c, pa)) != MP_OKAY) {
-      return res;
-    }
-  }
-
-  /* number of output digits to produce */
-  pa = a->used + b->used;
-  _W = 0;
-  for (ix = digs; ix < pa; ix++) {
-      int      tx, ty, iy;
-      tma_mp_digit *tmpx, *tmpy;
-
-      /* get offsets into the two bignums */
-      ty = MIN(b->used-1, ix);
-      tx = ix - ty;
-
-      /* setup temp aliases */
-      tmpx = a->dp + tx;
-      tmpy = b->dp + ty;
-
-      /* this is the number of times the loop will iterrate, essentially its
-         while (tx++ < a->used && ty-- >= 0) { ... }
-       */
-      iy = MIN(a->used-tx, ty+1);
-
-      /* execute loop */
-      for (iz = 0; iz < iy; iz++) {
-         _W += ((tma_mp_word)*tmpx++)*((tma_mp_word)*tmpy--);
-      }
-
-      /* store term */
-      W[ix] = ((tma_mp_digit)_W) & MP_MASK;
-
-      /* make next carry */
-      _W = _W >> ((tma_mp_word)DIGIT_BIT);
-  }
-
-  /* setup dest */
-  olduse  = c->used;
-  c->used = pa;
-
-  {
-    register tma_mp_digit *tmpc;
-
-    tmpc = c->dp + digs;
-    for (ix = digs; ix < pa; ix++) {
-      /* now extract the previous digit [below the carry] */
-      *tmpc++ = W[ix];
-    }
-
-    /* clear unused digits [that existed in the old copy of c] */
-    for (; ix < olduse; ix++) {
-      *tmpc++ = 0;
-    }
-  }
-  tma_mp_clamp (c);
-  return MP_OKAY;
-}
-#endif
-
-/* $Source$ */
-/* $Revision$ */
-/* $Date$ */
-
-/* End: bn_fast_s_tma_mp_mul_high_digs.c */
-
-/* Start: bn_fast_s_tma_mp_sqr.c */
-#include "tma.h"
-#ifdef BN_FAST_S_MP_SQR_C
-/* LibTomMath, multiple-precision integer library -- Tom St Denis
- *
- * LibTomMath is a library that provides multiple-precision
- * integer arithmetic as well as number theoretic functionality.
- *
- * The library was designed directly after the MPI library by
- * Michael Fromberger but has been written from scratch with
- * additional optimizations in place.
- *
- * The library is free for all purposes without any express
- * guarantee it works.
- *
- * Tom St Denis, tomstdenis@gmail.com, http://libtom.org
- */
-
-/* the jist of squaring...
- * you do like mult except the offset of the tmpx [one that
- * starts closer to zero] can't equal the offset of tmpy.
- * So basically you set up iy like before then you min it with
- * (ty-tx) so that it never happens.  You double all those
- * you add in the inner loop
-
-After that loop you do the squares and add them in.
-*/
-
-int fast_s_tma_mp_sqr (tma_mp_int * a, tma_mp_int * b)
-{
-  int       olduse, res, pa, ix, iz;
-  tma_mp_digit   W[MP_WARRAY], *tmpx;
-  tma_mp_word   W1;
-
-  /* grow the destination as required */
-  pa = a->used + a->used;
-  if (b->alloc < pa) {
-    if ((res = tma_mp_grow (b, pa)) != MP_OKAY) {
-      return res;
-    }
-  }
-
-  /* number of output digits to produce */
-  W1 = 0;
-  for (ix = 0; ix < pa; ix++) {
-      int      tx, ty, iy;
-      tma_mp_word  _W;
-      tma_mp_digit *tmpy;
-
-      /* clear counter */
-      _W = 0;
-
-      /* get offsets into the two bignums */
-      ty = MIN(a->used-1, ix);
-      tx = ix - ty;
-
-      /* setup temp aliases */
-      tmpx = a->dp + tx;
-      tmpy = a->dp + ty;
-
-      /* this is the number of times the loop will iterrate, essentially
-         while (tx++ < a->used && ty-- >= 0) { ... }
-       */
-      iy = MIN(a->used-tx, ty+1);
-
-      /* now for squaring tx can never equal ty
-       * we halve the distance since they approach at a rate of 2x
-       * and we have to round because odd cases need to be executed
-       */
-      iy = MIN(iy, (ty-tx+1)>>1);
-
-      /* execute loop */
-      for (iz = 0; iz < iy; iz++) {
-         _W += ((tma_mp_word)*tmpx++)*((tma_mp_word)*tmpy--);
-      }
-
-      /* double the inner product and add carry */
-      _W = _W + _W + W1;
-
-      /* even columns have the square term in them */
-      if ((ix&1) == 0) {
-         _W += ((tma_mp_word)a->dp[ix>>1])*((tma_mp_word)a->dp[ix>>1]);
-      }
-
-      /* store it */
-      W[ix] = (tma_mp_digit)(_W & MP_MASK);
-
-      /* make next carry */
-      W1 = _W >> ((tma_mp_word)DIGIT_BIT);
-  }
-
-  /* setup dest */
-  olduse  = b->used;
-  b->used = a->used+a->used;
-
-  {
-    tma_mp_digit *tmpb;
-    tmpb = b->dp;
-    for (ix = 0; ix < pa; ix++) {
-      *tmpb++ = W[ix] & MP_MASK;
-    }
-
-    /* clear unused digits [that existed in the old copy of c] */
-    for (; ix < olduse; ix++) {
-      *tmpb++ = 0;
-    }
-  }
-  tma_mp_clamp (b);
-  return MP_OKAY;
-}
-#endif
-
-/* $Source$ */
-/* $Revision$ */
-/* $Date$ */
-
-/* End: bn_fast_s_tma_mp_sqr.c */
-
-/* Start: bn_tma_mp_2expt.c */
-#include "tma.h"
-#ifdef BN_MP_2EXPT_C
-/* LibTomMath, multiple-precision integer library -- Tom St Denis
- *
- * LibTomMath is a library that provides multiple-precision
- * integer arithmetic as well as number theoretic functionality.
- *
- * The library was designed directly after the MPI library by
- * Michael Fromberger but has been written from scratch with
- * additional optimizations in place.
- *
- * The library is free for all purposes without any express
- * guarantee it works.
- *
- * Tom St Denis, tomstdenis@gmail.com, http://libtom.org
- */
-
-/* computes a = 2**b
- *
- * Simple algorithm which zeroes the int, grows it then just sets one bit
- * as required.
- */
-int
-tma_mp_2expt (tma_mp_int * a, int b)
-{
-  int     res;
-
-  /* zero a as per default */
-  tma_mp_zero (a);
-
-  /* grow a to accomodate the single bit */
-  if ((res = tma_mp_grow (a, b / DIGIT_BIT + 1)) != MP_OKAY) {
-    return res;
-  }
-
-  /* set the used count of where the bit will go */
-  a->used = b / DIGIT_BIT + 1;
-
-  /* put the single bit in its place */
-  a->dp[b / DIGIT_BIT] = ((tma_mp_digit)1) << (b % DIGIT_BIT);
-
-  return MP_OKAY;
-}
-#endif
-
-/* $Source$ */
-/* $Revision$ */
-/* $Date$ */
-
-/* End: bn_tma_mp_2expt.c */
-
-/* Start: bn_tma_mp_abs.c */
-#include "tma.h"
-#ifdef BN_MP_ABS_C
-/* LibTomMath, multiple-precision integer library -- Tom St Denis
- *
- * LibTomMath is a library that provides multiple-precision
- * integer arithmetic as well as number theoretic functionality.
- *
- * The library was designed directly after the MPI library by
- * Michael Fromberger but has been written from scratch with
- * additional optimizations in place.
- *
- * The library is free for all purposes without any express
- * guarantee it works.
- *
- * Tom St Denis, tomstdenis@gmail.com, http://libtom.org
- */
-
-/* b = |a|
- *
- * Simple function copies the input and fixes the sign to positive
- */
-int
-tma_mp_abs (tma_mp_int * a, tma_mp_int * b)
-{
-  int     res;
-
-  /* copy a to b */
-  if (a != b) {
-     if ((res = tma_mp_copy (a, b)) != MP_OKAY) {
-       return res;
-     }
-  }
-
-  /* force the sign of b to positive */
-  b->sign = MP_ZPOS;
-
-  return MP_OKAY;
-}
-#endif
-
-/* $Source$ */
-/* $Revision$ */
-/* $Date$ */
-
-/* End: bn_tma_mp_abs.c */
-
-/* Start: bn_tma_mp_add.c */
-#include "tma.h"
-#ifdef BN_MP_ADD_C
-/* LibTomMath, multiple-precision integer library -- Tom St Denis
- *
- * LibTomMath is a library that provides multiple-precision
- * integer arithmetic as well as number theoretic functionality.
- *
- * The library was designed directly after the MPI library by
- * Michael Fromberger but has been written from scratch with
- * additional optimizations in place.
- *
- * The library is free for all purposes without any express
- * guarantee it works.
- *
- * Tom St Denis, tomstdenis@gmail.com, http://libtom.org
- */
-
-/* high level addition (handles signs) */
-int tma_mp_add (tma_mp_int * a, tma_mp_int * b, tma_mp_int * c)
-{
-  int     sa, sb, res;
-
-  /* get sign of both inputs */
-  sa = a->sign;
-  sb = b->sign;
-
-  /* handle two cases, not four */
-  if (sa == sb) {
-    /* both positive or both negative */
-    /* add their magnitudes, copy the sign */
-    c->sign = sa;
-    res = s_tma_mp_add (a, b, c);
-  } else {
-    /* one positive, the other negative */
-    /* subtract the one with the greater magnitude from */
-    /* the one of the lesser magnitude.  The result gets */
-    /* the sign of the one with the greater magnitude. */
-    if (tma_mp_cmp_mag (a, b) == MP_LT) {
-      c->sign = sb;
-      res = s_tma_mp_sub (b, a, c);
-    } else {
-      c->sign = sa;
-      res = s_tma_mp_sub (a, b, c);
-    }
-  }
-  return res;
-}
-
-#endif
-
-/* $Source$ */
-/* $Revision$ */
-/* $Date$ */
-
-/* End: bn_tma_mp_add.c */
-
-/* Start: bn_tma_mp_add_d.c */
-#include "tma.h"
-#ifdef BN_MP_ADD_D_C
-/* LibTomMath, multiple-precision integer library -- Tom St Denis
- *
- * LibTomMath is a library that provides multiple-precision
- * integer arithmetic as well as number theoretic functionality.
- *
- * The library was designed directly after the MPI library by
- * Michael Fromberger but has been written from scratch with
- * additional optimizations in place.
- *
- * The library is free for all purposes without any express
- * guarantee it works.
- *
- * Tom St Denis, tomstdenis@gmail.com, http://libtom.org
- */
-
-/* single digit addition */
-int
-tma_mp_add_d (tma_mp_int * a, tma_mp_digit b, tma_mp_int * c)
-{
-  int     res, ix, oldused;
-  tma_mp_digit *tmpa, *tmpc, mu;
-
-  /* grow c as required */
-  if (c->alloc < a->used + 1) {
-     if ((res = tma_mp_grow(c, a->used + 1)) != MP_OKAY) {
-        return res;
-     }
-  }
-
-  /* if a is negative and |a| >= b, call c = |a| - b */
-  if (a->sign == MP_NEG && (a->used > 1 || a->dp[0] >= b)) {
-     /* temporarily fix sign of a */
-     a->sign = MP_ZPOS;
-
-     /* c = |a| - b */
-     res = tma_mp_sub_d(a, b, c);
-
-     /* fix sign  */
-     a->sign = c->sign = MP_NEG;
-
-     /* clamp */
-     tma_mp_clamp(c);
-
-     return res;
-  }
-
-  /* old number of used digits in c */
-  oldused = c->used;
-
-  /* sign always positive */
-  c->sign = MP_ZPOS;
-
-  /* source alias */
-  tmpa    = a->dp;
-
-  /* destination alias */
-  tmpc    = c->dp;
-
-  /* if a is positive */
-  if (a->sign == MP_ZPOS) {
-     /* add digit, after this we're propagating
-      * the carry.
-      */
-     *tmpc   = *tmpa++ + b;
-     mu      = *tmpc >> DIGIT_BIT;
-     *tmpc++ &= MP_MASK;
-
-     /* now handle rest of the digits */
-     for (ix = 1; ix < a->used; ix++) {
-        *tmpc   = *tmpa++ + mu;
-        mu      = *tmpc >> DIGIT_BIT;
-        *tmpc++ &= MP_MASK;
-     }
-     /* set final carry */
-     ix++;
-     *tmpc++  = mu;
-
-     /* setup size */
-     c->used = a->used + 1;
-  } else {
-     /* a was negative and |a| < b */
-     c->used  = 1;
-
-     /* the result is a single digit */
-     if (a->used == 1) {
-        *tmpc++  =  b - a->dp[0];
-     } else {
-        *tmpc++  =  b;
-     }
-
-     /* setup count so the clearing of oldused
-      * can fall through correctly
-      */
-     ix       = 1;
-  }
-
-  /* now zero to oldused */
-  while (ix++ < oldused) {
-     *tmpc++ = 0;
-  }
-  tma_mp_clamp(c);
-
-  return MP_OKAY;
-}
-
-#endif
-
-/* $Source$ */
-/* $Revision$ */
-/* $Date$ */
-
-/* End: bn_tma_mp_add_d.c */
-
-/* Start: bn_tma_mp_addmod.c */
-#include "tma.h"
-#ifdef BN_MP_ADDMOD_C
-/* LibTomMath, multiple-precision integer library -- Tom St Denis
- *
- * LibTomMath is a library that provides multiple-precision
- * integer arithmetic as well as number theoretic functionality.
- *
- * The library was designed directly after the MPI library by
- * Michael Fromberger but has been written from scratch with
- * additional optimizations in place.
- *
- * The library is free for all purposes without any express
- * guarantee it works.
- *
- * Tom St Denis, tomstdenis@gmail.com, http://libtom.org
- */
-
-/* d = a + b (mod c) */
-int
-tma_mp_addmod (tma_mp_int * a, tma_mp_int * b, tma_mp_int * c, tma_mp_int * d)
-{
-  int     res;
-  tma_mp_int  t;
-
-  if ((res = tma_mp_init (&t)) != MP_OKAY) {
-    return res;
-  }
-
-  if ((res = tma_mp_add (a, b, &t)) != MP_OKAY) {
-    tma_mp_clear (&t);
-    return res;
-  }
-  res = tma_mp_mod (&t, c, d);
-  tma_mp_clear (&t);
-  return res;
-}
-#endif
-
-/* $Source$ */
-/* $Revision$ */
-/* $Date$ */
-
-/* End: bn_tma_mp_addmod.c */
-
-/* Start: bn_tma_mp_and.c */
-#include "tma.h"
-#ifdef BN_MP_AND_C
-/* LibTomMath, multiple-precision integer library -- Tom St Denis
- *
- * LibTomMath is a library that provides multiple-precision
- * integer arithmetic as well as number theoretic functionality.
- *
- * The library was designed directly after the MPI library by
- * Michael Fromberger but has been written from scratch with
- * additional optimizations in place.
- *
- * The library is free for all purposes without any express
- * guarantee it works.
- *
- * Tom St Denis, tomstdenis@gmail.com, http://libtom.org
- */
-
-/* AND two ints together */
-int
-tma_mp_and (tma_mp_int * a, tma_mp_int * b, tma_mp_int * c)
-{
-  int     res, ix, px;
-  tma_mp_int  t, *x;
-
-  if (a->used > b->used) {
-    if ((res = tma_mp_init_copy (&t, a)) != MP_OKAY) {
-      return res;
-    }
-    px = b->used;
-    x = b;
-  } else {
-    if ((res = tma_mp_init_copy (&t, b)) != MP_OKAY) {
-      return res;
-    }
-    px = a->used;
-    x = a;
-  }
-
-  for (ix = 0; ix < px; ix++) {
-    t.dp[ix] &= x->dp[ix];
-  }
-
-  /* zero digits above the last from the smallest tma_mp_int */
-  for (; ix < t.used; ix++) {
-    t.dp[ix] = 0;
-  }
-
-  tma_mp_clamp (&t);
-  tma_mp_exch (c, &t);
-  tma_mp_clear (&t);
-  return MP_OKAY;
-}
-#endif
-
-/* $Source$ */
-/* $Revision$ */
-/* $Date$ */
-
-/* End: bn_tma_mp_and.c */
-
-/* Start: bn_tma_mp_clamp.c */
-#include "tma.h"
-#ifdef BN_MP_CLAMP_C
-/* LibTomMath, multiple-precision integer library -- Tom St Denis
- *
- * LibTomMath is a library that provides multiple-precision
- * integer arithmetic as well as number theoretic functionality.
- *
- * The library was designed directly after the MPI library by
- * Michael Fromberger but has been written from scratch with
- * additional optimizations in place.
- *
- * The library is free for all purposes without any express
- * guarantee it works.
- *
- * Tom St Denis, tomstdenis@gmail.com, http://libtom.org
- */
-
-/* trim unused digits
- *
- * This is used to ensure that leading zero digits are
- * trimed and the leading "used" digit will be non-zero
- * Typically very fast.  Also fixes the sign if there
- * are no more leading digits
- */
-void
-tma_mp_clamp (tma_mp_int * a)
-{
-  /* decrease used while the most significant digit is
-   * zero.
-   */
-  while (a->used > 0 && a->dp[a->used - 1] == 0) {
-    --(a->used);
-  }
-
-  /* reset the sign flag if used == 0 */
-  if (a->used == 0) {
-    a->sign = MP_ZPOS;
-  }
-}
-#endif
-
-/* $Source$ */
-/* $Revision$ */
-/* $Date$ */
-
-/* End: bn_tma_mp_clamp.c */
-
-/* Start: bn_tma_mp_clear.c */
-#include "tma.h"
-#ifdef BN_MP_CLEAR_C
-/* LibTomMath, multiple-precision integer library -- Tom St Denis
- *
- * LibTomMath is a library that provides multiple-precision
- * integer arithmetic as well as number theoretic functionality.
- *
- * The library was designed directly after the MPI library by
- * Michael Fromberger but has been written from scratch with
- * additional optimizations in place.
- *
- * The library is free for all purposes without any express
- * guarantee it works.
- *
- * Tom St Denis, tomstdenis@gmail.com, http://libtom.org
- */
-
-/* clear one (frees)  */
-void
-tma_mp_clear (tma_mp_int * a)
-{
-  int i;
-
-  /* only do anything if a hasn't been freed previously */
-  if (a->dp != NULL) {
-    /* first zero the digits */
-    for (i = 0; i < a->used; i++) {
-        a->dp[i] = 0;
-    }
-
-    /* free ram */
-    XFREE(a->dp);
-
-    /* reset members to make debugging easier */
-    a->dp    = NULL;
-    a->alloc = a->used = 0;
-    a->sign  = MP_ZPOS;
-  }
-}
-#endif
-
-/* $Source$ */
-/* $Revision$ */
-/* $Date$ */
-
-/* End: bn_tma_mp_clear.c */
-
-/* Start: bn_tma_mp_clear_multi.c */
-#include "tma.h"
-#ifdef BN_MP_CLEAR_MULTI_C
-/* LibTomMath, multiple-precision integer library -- Tom St Denis
- *
- * LibTomMath is a library that provides multiple-precision
- * integer arithmetic as well as number theoretic functionality.
- *
- * The library was designed directly after the MPI library by
- * Michael Fromberger but has been written from scratch with
- * additional optimizations in place.
- *
- * The library is free for all purposes without any express
- * guarantee it works.
- *
- * Tom St Denis, tomstdenis@gmail.com, http://libtom.org
- */
-#include <stdarg.h>
-
-void tma_mp_clear_multi(tma_mp_int *mp, ...)
-{
-    tma_mp_int* next_mp = mp;
-    va_list args;
-    va_start(args, mp);
-    while (next_mp != NULL) {
-        tma_mp_clear(next_mp);
-        next_mp = va_arg(args, tma_mp_int*);
-    }
-    va_end(args);
-}
-#endif
-
-/* $Source$ */
-/* $Revision$ */
-/* $Date$ */
-
-/* End: bn_tma_mp_clear_multi.c */
-
-/* Start: bn_tma_mp_cmp.c */
-#include "tma.h"
-#ifdef BN_MP_CMP_C
-/* LibTomMath, multiple-precision integer library -- Tom St Denis
- *
- * LibTomMath is a library that provides multiple-precision
- * integer arithmetic as well as number theoretic functionality.
- *
- * The library was designed directly after the MPI library by
- * Michael Fromberger but has been written from scratch with
- * additional optimizations in place.
- *
- * The library is free for all purposes without any express
- * guarantee it works.
- *
- * Tom St Denis, tomstdenis@gmail.com, http://libtom.org
- */
-
-/* compare two ints (signed)*/
-int
-tma_mp_cmp (tma_mp_int * a, tma_mp_int * b)
-{
-  /* compare based on sign */
-  if (a->sign != b->sign) {
-     if (a->sign == MP_NEG) {
-        return MP_LT;
-     } else {
-        return MP_GT;
-     }
-  }
-
-  /* compare digits */
-  if (a->sign == MP_NEG) {
-     /* if negative compare opposite direction */
-     return tma_mp_cmp_mag(b, a);
-  } else {
-     return tma_mp_cmp_mag(a, b);
-  }
-}
-#endif
-
-/* $Source$ */
-/* $Revision$ */
-/* $Date$ */
-
-/* End: bn_tma_mp_cmp.c */
-
-/* Start: bn_tma_mp_cmp_d.c */
-#include "tma.h"
-#ifdef BN_MP_CMP_D_C
-/* LibTomMath, multiple-precision integer library -- Tom St Denis
- *
- * LibTomMath is a library that provides multiple-precision
- * integer arithmetic as well as number theoretic functionality.
- *
- * The library was designed directly after the MPI library by
- * Michael Fromberger but has been written from scratch with
- * additional optimizations in place.
- *
- * The library is free for all purposes without any express
- * guarantee it works.
- *
- * Tom St Denis, tomstdenis@gmail.com, http://libtom.org
- */
-
-/* compare a digit */
-int tma_mp_cmp_d(tma_mp_int * a, tma_mp_digit b)
-{
-  /* compare based on sign */
-  if (a->sign == MP_NEG) {
-    return MP_LT;
-  }
-
-  /* compare based on magnitude */
-  if (a->used > 1) {
-    return MP_GT;
-  }
-
-  /* compare the only digit of a to b */
-  if (a->dp[0] > b) {
-    return MP_GT;
-  } else if (a->dp[0] < b) {
-    return MP_LT;
-  } else {
-    return MP_EQ;
-  }
-}
-#endif
-
-/* $Source$ */
-/* $Revision$ */
-/* $Date$ */
-
-/* End: bn_tma_mp_cmp_d.c */
-
-/* Start: bn_tma_mp_cmp_mag.c */
-#include "tma.h"
-#ifdef BN_MP_CMP_MAG_C
-/* LibTomMath, multiple-precision integer library -- Tom St Denis
- *
- * LibTomMath is a library that provides multiple-precision
- * integer arithmetic as well as number theoretic functionality.
- *
- * The library was designed directly after the MPI library by
- * Michael Fromberger but has been written from scratch with
- * additional optimizations in place.
- *
- * The library is free for all purposes without any express
- * guarantee it works.
- *
- * Tom St Denis, tomstdenis@gmail.com, http://libtom.org
- */
-
-/* compare maginitude of two ints (unsigned) */
-int tma_mp_cmp_mag (tma_mp_int * a, tma_mp_int * b)
-{
-  int     n;
-  tma_mp_digit *tmpa, *tmpb;
-
-  /* compare based on # of non-zero digits */
-  if (a->used > b->used) {
-    return MP_GT;
-  }
-
-  if (a->used < b->used) {
-    return MP_LT;
-  }
-
-  /* alias for a */
-  tmpa = a->dp + (a->used - 1);
-
-  /* alias for b */
-  tmpb = b->dp + (a->used - 1);
-
-  /* compare based on digits  */
-  for (n = 0; n < a->used; ++n, --tmpa, --tmpb) {
-    if (*tmpa > *tmpb) {
-      return MP_GT;
-    }
-
-    if (*tmpa < *tmpb) {
-      return MP_LT;
-    }
-  }
-  return MP_EQ;
-}
-#endif
-
-/* $Source$ */
-/* $Revision$ */
-/* $Date$ */
-
-/* End: bn_tma_mp_cmp_mag.c */
-
-/* Start: bn_tma_mp_cnt_lsb.c */
-#include "tma.h"
-#ifdef BN_MP_CNT_LSB_C
-/* LibTomMath, multiple-precision integer library -- Tom St Denis
- *
- * LibTomMath is a library that provides multiple-precision
- * integer arithmetic as well as number theoretic functionality.
- *
- * The library was designed directly after the MPI library by
- * Michael Fromberger but has been written from scratch with
- * additional optimizations in place.
- *
- * The library is free for all purposes without any express
- * guarantee it works.
- *
- * Tom St Denis, tomstdenis@gmail.com, http://libtom.org
- */
-
-static const int lnz[16] = {
-   4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0
-};
-
-/* Counts the number of lsbs which are zero before the first zero bit */
-int tma_mp_cnt_lsb(tma_mp_int *a)
-{
-   int x;
-   tma_mp_digit q, qq;
-
-   /* easy out */
-   if (tma_mp_iszero(a) == 1) {
-      return 0;
-   }
-
-   /* scan lower digits until non-zero */
-   for (x = 0; x < a->used && a->dp[x] == 0; x++);
-   q = a->dp[x];
-   x *= DIGIT_BIT;
-
-   /* now scan this digit until a 1 is found */
-   if ((q & 1) == 0) {
-      do {
-         qq  = q & 15;
-         x  += lnz[qq];
-         q >>= 4;
-      } while (qq == 0);
-   }
-   return x;
-}
-
-#endif
-
-/* $Source$ */
-/* $Revision$ */
-/* $Date$ */
-
-/* End: bn_tma_mp_cnt_lsb.c */
-
-/* Start: bn_tma_mp_copy.c */
-#include "tma.h"
-#ifdef BN_MP_COPY_C
-/* LibTomMath, multiple-precision integer library -- Tom St Denis
- *
- * LibTomMath is a library that provides multiple-precision
- * integer arithmetic as well as number theoretic functionality.
- *
- * The library was designed directly after the MPI library by
- * Michael Fromberger but has been written from scratch with
- * additional optimizations in place.
- *
- * The library is free for all purposes without any express
- * guarantee it works.
- *
- * Tom St Denis, tomstdenis@gmail.com, http://libtom.org
- */
-
-/* copy, b = a */
-int
-tma_mp_copy (tma_mp_int * a, tma_mp_int * b)
-{
-  int     res, n;
-
-  /* if dst == src do nothing */
-  if (a == b) {
-    return MP_OKAY;
-  }
-
-  /* grow dest */
-  if (b->alloc < a->used) {
-     if ((res = tma_mp_grow (b, a->used)) != MP_OKAY) {
-        return res;
-     }
-  }
-
-  /* zero b and copy the parameters over */
-  {
-    register tma_mp_digit *tmpa, *tmpb;
-
-    /* pointer aliases */
-
-    /* source */
-    tmpa = a->dp;
-
-    /* destination */
-    tmpb = b->dp;
-
-    /* copy all the digits */
-    for (n = 0; n < a->used; n++) {
-      *tmpb++ = *tmpa++;
-    }
-
-    /* clear high digits */
-    for (; n < b->used; n++) {
-      *tmpb++ = 0;
-    }
-  }
-
-  /* copy used count and sign */
-  b->used = a->used;
-  b->sign = a->sign;
-  return MP_OKAY;
-}
-#endif
-
-/* $Source$ */
-/* $Revision$ */
-/* $Date$ */
-
-/* End: bn_tma_mp_copy.c */
-
-/* Start: bn_tma_mp_count_bits.c */
-#include "tma.h"
-#ifdef BN_MP_COUNT_BITS_C
-/* LibTomMath, multiple-precision integer library -- Tom St Denis
- *
- * LibTomMath is a library that provides multiple-precision
- * integer arithmetic as well as number theoretic functionality.
- *
- * The library was designed directly after the MPI library by
- * Michael Fromberger but has been written from scratch with
- * additional optimizations in place.
- *
- * The library is free for all purposes without any express
- * guarantee it works.
- *
- * Tom St Denis, tomstdenis@gmail.com, http://libtom.org
- */
-
-/* returns the number of bits in an int */
-int
-tma_mp_count_bits (tma_mp_int * a)
-{
-  int     r;
-  tma_mp_digit q;
-
-  /* shortcut */
-  if (a->used == 0) {
-    return 0;
-  }
-
-  /* get number of digits and add that */
-  r = (a->used - 1) * DIGIT_BIT;
-
-  /* take the last digit and count the bits in it */
-  q = a->dp[a->used - 1];
-  while (q > ((tma_mp_digit) 0)) {
-    ++r;
-    q >>= ((tma_mp_digit) 1);
-  }
-  return r;
-}
-#endif
-
-/* $Source$ */
-/* $Revision$ */
-/* $Date$ */
-
-/* End: bn_tma_mp_count_bits.c */
-
-/* Start: bn_tma_mp_div.c */
-#include "tma.h"
-#ifdef BN_MP_DIV_C
-/* LibTomMath, multiple-precision integer library -- Tom St Denis
- *
- * LibTomMath is a library that provides multiple-precision
- * integer arithmetic as well as number theoretic functionality.
- *
- * The library was designed directly after the MPI library by
- * Michael Fromberger but has been written from scratch with
- * additional optimizations in place.
- *
- * The library is free for all purposes without any express
- * guarantee it works.
- *
- * Tom St Denis, tomstdenis@gmail.com, http://libtom.org
- */
-
-#ifdef BN_MP_DIV_SMALL
-
-/* slower bit-bang division... also smaller */
-int tma_mp_div(tma_mp_int * a, tma_mp_int * b, tma_mp_int * c, tma_mp_int * d)
-{
-   tma_mp_int ta, tb, tq, q;
-   int    res, n, n2;
-
-  /* is divisor zero ? */
-  if (tma_mp_iszero (b) == 1) {
-    return MP_VAL;
-  }
-
-  /* if a < b then q=0, r = a */
-  if (tma_mp_cmp_mag (a, b) == MP_LT) {
-    if (d != NULL) {
-      res = tma_mp_copy (a, d);
-    } else {
-      res = MP_OKAY;
-    }
-    if (c != NULL) {
-      tma_mp_zero (c);
-    }
-    return res;
-  }
-
-  /* init our temps */
-  if ((res = tma_mp_init_multi(&ta, &tb, &tq, &q, NULL) != MP_OKAY)) {
-     return res;
-  }
-
-
-  tma_mp_set(&tq, 1);
-  n = tma_mp_count_bits(a) - tma_mp_count_bits(b);
-  if (((res = tma_mp_abs(a, &ta)) != MP_OKAY) ||
-      ((res = tma_mp_abs(b, &tb)) != MP_OKAY) ||
-      ((res = tma_mp_mul_2d(&tb, n, &tb)) != MP_OKAY) ||
-      ((res = tma_mp_mul_2d(&tq, n, &tq)) != MP_OKAY)) {
-      goto LBL_ERR;
-  }
-
-  while (n-- >= 0) {
-     if (tma_mp_cmp(&tb, &ta) != MP_GT) {
-        if (((res = tma_mp_sub(&ta, &tb, &ta)) != MP_OKAY) ||
-            ((res = tma_mp_add(&q, &tq, &q)) != MP_OKAY)) {
-           goto LBL_ERR;
-        }
-     }
-     if (((res = tma_mp_div_2d(&tb, 1, &tb, NULL)) != MP_OKAY) ||
-         ((res = tma_mp_div_2d(&tq, 1, &tq, NULL)) != MP_OKAY)) {
-           goto LBL_ERR;
-     }
-  }
-
-  /* now q == quotient and ta == remainder */
-  n  = a->sign;
-  n2 = (a->sign == b->sign ? MP_ZPOS : MP_NEG);
-  if (c != NULL) {
-     tma_mp_exch(c, &q);
-     c->sign  = (tma_mp_iszero(c) == MP_YES) ? MP_ZPOS : n2;
-  }
-  if (d != NULL) {
-     tma_mp_exch(d, &ta);
-     d->sign = (tma_mp_iszero(d) == MP_YES) ? MP_ZPOS : n;
-  }
-LBL_ERR:
-   tma_mp_clear_multi(&ta, &tb, &tq, &q, NULL);
-   return res;
-}
-
-#else
-
-/* integer signed division.
- * c*b + d == a [e.g. a/b, c=quotient, d=remainder]
- * HAC pp.598 Algorithm 14.20
- *
- * Note that the description in HAC is horribly
- * incomplete.  For example, it doesn't consider
- * the case where digits are removed from 'x' in
- * the inner loop.  It also doesn't consider the
- * case that y has fewer than three digits, etc..
- *
- * The overall algorithm is as described as
- * 14.20 from HAC but fixed to treat these cases.
-*/
-int tma_mp_div (tma_mp_int * a, tma_mp_int * b, tma_mp_int * c, tma_mp_int * d)
-{
-  tma_mp_int  q, x, y, t1, t2;
-  int     res, n, t, i, norm, neg;
-
-  /* is divisor zero ? */
-  if (tma_mp_iszero (b) == 1) {
-    return MP_VAL;
-  }
-
-  /* if a < b then q=0, r = a */
-  if (tma_mp_cmp_mag (a, b) == MP_LT) {
-    if (d != NULL) {
-      res = tma_mp_copy (a, d);
-    } else {
-      res = MP_OKAY;
-    }
-    if (c != NULL) {
-      tma_mp_zero (c);
-    }
-    return res;
-  }
-
-  if ((res = tma_mp_init_size (&q, a->used + 2)) != MP_OKAY) {
-    return res;
-  }
-  q.used = a->used + 2;
-
-  if ((res = tma_mp_init (&t1)) != MP_OKAY) {
-    goto LBL_Q;
-  }
-
-  if ((res = tma_mp_init (&t2)) != MP_OKAY) {
-    goto LBL_T1;
-  }
-
-  if ((res = tma_mp_init_copy (&x, a)) != MP_OKAY) {
-    goto LBL_T2;
-  }
-
-  if ((res = tma_mp_init_copy (&y, b)) != MP_OKAY) {
-    goto LBL_X;
-  }
-
-  /* fix the sign */
-  neg = (a->sign == b->sign) ? MP_ZPOS : MP_NEG;
-  x.sign = y.sign = MP_ZPOS;
-
-  /* normalize both x and y, ensure that y >= b/2, [b == 2**DIGIT_BIT] */
-  norm = tma_mp_count_bits(&y) % DIGIT_BIT;
-  if (norm < (int)(DIGIT_BIT-1)) {
-     norm = (DIGIT_BIT-1) - norm;
-     if ((res = tma_mp_mul_2d (&x, norm, &x)) != MP_OKAY) {
-       goto LBL_Y;
-     }
-     if ((res = tma_mp_mul_2d (&y, norm, &y)) != MP_OKAY) {
-       goto LBL_Y;
-     }
-  } else {
-     norm = 0;
-  }
-
-  /* note hac does 0 based, so if used==5 then its 0,1,2,3,4, e.g. use 4 */
-  n = x.used - 1;
-  t = y.used - 1;
-
-  /* while (x >= y*b**n-t) do { q[n-t] += 1; x -= y*b**{n-t} } */
-  if ((res = tma_mp_lshd (&y, n - t)) != MP_OKAY) { /* y = y*b**{n-t} */
-    goto LBL_Y;
-  }
-
-  while (tma_mp_cmp (&x, &y) != MP_LT) {
-    ++(q.dp[n - t]);
-    if ((res = tma_mp_sub (&x, &y, &x)) != MP_OKAY) {
-      goto LBL_Y;
-    }
-  }
-
-  /* reset y by shifting it back down */
-  tma_mp_rshd (&y, n - t);
-
-  /* step 3. for i from n down to (t + 1) */
-  for (i = n; i >= (t + 1); i--) {
-    if (i > x.used) {
-      continue;
-    }
-
-    /* step 3.1 if xi == yt then set q{i-t-1} to b-1,
-     * otherwise set q{i-t-1} to (xi*b + x{i-1})/yt */
-    if (x.dp[i] == y.dp[t]) {
-      q.dp[i - t - 1] = ((((tma_mp_digit)1) << DIGIT_BIT) - 1);
-    } else {
-      tma_mp_word tmp;
-      tmp = ((tma_mp_word) x.dp[i]) << ((tma_mp_word) DIGIT_BIT);
-      tmp |= ((tma_mp_word) x.dp[i - 1]);
-      tmp /= ((tma_mp_word) y.dp[t]);
-      if (tmp > (tma_mp_word) MP_MASK)
-        tmp = MP_MASK;
-      q.dp[i - t - 1] = (tma_mp_digit) (tmp & (tma_mp_word) (MP_MASK));
-    }
-
-    /* while (q{i-t-1} * (yt * b + y{t-1})) >
-             xi * b**2 + xi-1 * b + xi-2
-
-       do q{i-t-1} -= 1;
-    */
-    q.dp[i - t - 1] = (q.dp[i - t - 1] + 1) & MP_MASK;
-    do {
-      q.dp[i - t - 1] = (q.dp[i - t - 1] - 1) & MP_MASK;
-
-      /* find left hand */
-      tma_mp_zero (&t1);
-      t1.dp[0] = (t - 1 < 0) ? 0 : y.dp[t - 1];
-      t1.dp[1] = y.dp[t];
-      t1.used = 2;
-      if ((res = tma_mp_mul_d (&t1, q.dp[i - t - 1], &t1)) != MP_OKAY) {
-        goto LBL_Y;
-      }
-
-      /* find right hand */
-      t2.dp[0] = (i - 2 < 0) ? 0 : x.dp[i - 2];
-      t2.dp[1] = (i - 1 < 0) ? 0 : x.dp[i - 1];
-      t2.dp[2] = x.dp[i];
-      t2.used = 3;
-    } while (tma_mp_cmp_mag(&t1, &t2) == MP_GT);
-
-    /* step 3.3 x = x - q{i-t-1} * y * b**{i-t-1} */
-    if ((res = tma_mp_mul_d (&y, q.dp[i - t - 1], &t1)) != MP_OKAY) {
-      goto LBL_Y;
-    }
-
-    if ((res = tma_mp_lshd (&t1, i - t - 1)) != MP_OKAY) {
-      goto LBL_Y;
-    }
-
-    if ((res = tma_mp_sub (&x, &t1, &x)) != MP_OKAY) {
-      goto LBL_Y;
-    }
-
-    /* if x < 0 then { x = x + y*b**{i-t-1}; q{i-t-1} -= 1; } */
-    if (x.sign == MP_NEG) {
-      if ((res = tma_mp_copy (&y, &t1)) != MP_OKAY) {
-        goto LBL_Y;
-      }
-      if ((res = tma_mp_lshd (&t1, i - t - 1)) != MP_OKAY) {
-        goto LBL_Y;
-      }
-      if ((res = tma_mp_add (&x, &t1, &x)) != MP_OKAY) {
-        goto LBL_Y;
-      }
-
-      q.dp[i - t - 1] = (q.dp[i - t - 1] - 1UL) & MP_MASK;
-    }
-  }
-
-  /* now q is the quotient and x is the remainder
-   * [which we have to normalize]
-   */
-
-  /* get sign before writing to c */
-  x.sign = x.used == 0 ? MP_ZPOS : a->sign;
-
-  if (c != NULL) {
-    tma_mp_clamp (&q);
-    tma_mp_exch (&q, c);
-    c->sign = neg;
-  }
-
-  if (d != NULL) {
-    tma_mp_div_2d (&x, norm, &x, NULL);
-    tma_mp_exch (&x, d);
-  }
-
-  res = MP_OKAY;
-
-LBL_Y:tma_mp_clear (&y);
-LBL_X:tma_mp_clear (&x);
-LBL_T2:tma_mp_clear (&t2);
-LBL_T1:tma_mp_clear (&t1);
-LBL_Q:tma_mp_clear (&q);
-  return res;
-}
-
-#endif
-
-#endif
-
-/* $Source$ */
-/* $Revision$ */
-/* $Date$ */
-
-/* End: bn_tma_mp_div.c */
-
-/* Start: bn_tma_mp_div_2.c */
-#include "tma.h"
-#ifdef BN_MP_DIV_2_C
-/* LibTomMath, multiple-precision integer library -- Tom St Denis
- *
- * LibTomMath is a library that provides multiple-precision
- * integer arithmetic as well as number theoretic functionality.
- *
- * The library was designed directly after the MPI library by
- * Michael Fromberger but has been written from scratch with
- * additional optimizations in place.
- *
- * The library is free for all purposes without any express
- * guarantee it works.
- *
- * Tom St Denis, tomstdenis@gmail.com, http://libtom.org
- */
-
-/* b = a/2 */
-int tma_mp_div_2(tma_mp_int * a, tma_mp_int * b)
-{
-  int     x, res, oldused;
-
-  /* copy */
-  if (b->alloc < a->used) {
-    if ((res = tma_mp_grow (b, a->used)) != MP_OKAY) {
-      return res;
-    }
-  }
-
-  oldused = b->used;
-  b->used = a->used;
-  {
-    register tma_mp_digit r, rr, *tmpa, *tmpb;
-
-    /* source alias */
-    tmpa = a->dp + b->used - 1;
-
-    /* dest alias */
-    tmpb = b->dp + b->used - 1;
-
-    /* carry */
-    r = 0;
-    for (x = b->used - 1; x >= 0; x--) {
-      /* get the carry for the next iteration */
-      rr = *tmpa & 1;
-
-      /* shift the current digit, add in carry and store */
-      *tmpb-- = (*tmpa-- >> 1) | (r << (DIGIT_BIT - 1));
-
-      /* forward carry to next iteration */
-      r = rr;
-    }
-
-    /* zero excess digits */
-    tmpb = b->dp + b->used;
-    for (x = b->used; x < oldused; x++) {
-      *tmpb++ = 0;
-    }
-  }
-  b->sign = a->sign;
-  tma_mp_clamp (b);
-  return MP_OKAY;
-}
-#endif
-
-/* $Source$ */
-/* $Revision$ */
-/* $Date$ */
-
-/* End: bn_tma_mp_div_2.c */
-
-/* Start: bn_tma_mp_div_2d.c */
-#include "tma.h"
-#ifdef BN_MP_DIV_2D_C
-/* LibTomMath, multiple-precision integer library -- Tom St Denis
- *
- * LibTomMath is a library that provides multiple-precision
- * integer arithmetic as well as number theoretic functionality.
- *
- * The library was designed directly after the MPI library by
- * Michael Fromberger but has been written from scratch with
- * additional optimizations in place.
- *
- * The library is free for all purposes without any express
- * guarantee it works.
- *
- * Tom St Denis, tomstdenis@gmail.com, http://libtom.org
- */
-
-/* shift right by a certain bit count (store quotient in c, optional remainder in d) */
-int tma_mp_div_2d (tma_mp_int * a, int b, tma_mp_int * c, tma_mp_int * d)
-{
-  tma_mp_digit D, r, rr;
-  int     x, res;
-  tma_mp_int  t;
-
-
-  /* if the shift count is <= 0 then we do no work */
-  if (b <= 0) {
-    res = tma_mp_copy (a, c);
-    if (d != NULL) {
-      tma_mp_zero (d);
-    }
-    return res;
-  }
-
-  if ((res = tma_mp_init (&t)) != MP_OKAY) {
-    return res;
-  }
-
-  /* get the remainder */
-  if (d != NULL) {
-    if ((res = tma_mp_mod_2d (a, b, &t)) != MP_OKAY) {
-      tma_mp_clear (&t);
-      return res;
-    }
-  }
-
-  /* copy */
-  if ((res = tma_mp_copy (a, c)) != MP_OKAY) {
-    tma_mp_clear (&t);
-    return res;
-  }
-
-  /* shift by as many digits in the bit count */
-  if (b >= (int)DIGIT_BIT) {
-    tma_mp_rshd (c, b / DIGIT_BIT);
-  }
-
-  /* shift any bit count < DIGIT_BIT */
-  D = (tma_mp_digit) (b % DIGIT_BIT);
-  if (D != 0) {
-    register tma_mp_digit *tmpc, mask, shift;
-
-    /* mask */
-    mask = (((tma_mp_digit)1) << D) - 1;
-
-    /* shift for lsb */
-    shift = DIGIT_BIT - D;
-
-    /* alias */
-    tmpc = c->dp + (c->used - 1);
-
-    /* carry */
-    r = 0;
-    for (x = c->used - 1; x >= 0; x--) {
-      /* get the lower  bits of this word in a temp */
-      rr = *tmpc & mask;
-
-      /* shift the current word and mix in the carry bits from the previous word */
-      *tmpc = (*tmpc >> D) | (r << shift);
-      --tmpc;
-
-      /* set the carry to the carry bits of the current word found above */
-      r = rr;
-    }
-  }
-  tma_mp_clamp (c);
-  if (d != NULL) {
-    tma_mp_exch (&t, d);
-  }
-  tma_mp_clear (&t);
-  return MP_OKAY;
-}
-#endif
-
-/* $Source$ */
-/* $Revision$ */
-/* $Date$ */
-
-/* End: bn_tma_mp_div_2d.c */
-
-/* Start: bn_tma_mp_div_3.c */
-#include "tma.h"
-#ifdef BN_MP_DIV_3_C
-/* LibTomMath, multiple-precision integer library -- Tom St Denis
- *
- * LibTomMath is a library that provides multiple-precision
- * integer arithmetic as well as number theoretic functionality.
- *
- * The library was designed directly after the MPI library by
- * Michael Fromberger but has been written from scratch with
- * additional optimizations in place.
- *
- * The library is free for all purposes without any express
- * guarantee it works.
- *
- * Tom St Denis, tomstdenis@gmail.com, http://libtom.org
- */
-
-/* divide by three (based on routine from MPI and the GMP manual) */
-int
-tma_mp_div_3 (tma_mp_int * a, tma_mp_int *c, tma_mp_digit * d)
-{
-  tma_mp_int   q;
-  tma_mp_word  w, t;
-  tma_mp_digit b;
-  int      res, ix;
-
-  /* b = 2**DIGIT_BIT / 3 */
-  b = (((tma_mp_word)1) << ((tma_mp_word)DIGIT_BIT)) / ((tma_mp_word)3);
-
-  if ((res = tma_mp_init_size(&q, a->used)) != MP_OKAY) {
-     return res;
-  }
-
-  q.used = a->used;
-  q.sign = a->sign;
-  w = 0;
-  for (ix = a->used - 1; ix >= 0; ix--) {
-     w = (w << ((tma_mp_word)DIGIT_BIT)) | ((tma_mp_word)a->dp[ix]);
-
-     if (w >= 3) {
-        /* multiply w by [1/3] */
-        t = (w * ((tma_mp_word)b)) >> ((tma_mp_word)DIGIT_BIT);
-
-        /* now subtract 3 * [w/3] from w, to get the remainder */
-        w -= t+t+t;
-
-        /* fixup the remainder as required since
-         * the optimization is not exact.
-         */
-        while (w >= 3) {
-           t += 1;
-           w -= 3;
-        }
-      } else {
-        t = 0;
-      }
-      q.dp[ix] = (tma_mp_digit)t;
-  }
-
-  /* [optional] store the remainder */
-  if (d != NULL) {
-     *d = (tma_mp_digit)w;
-  }
-
-  /* [optional] store the quotient */
-  if (c != NULL) {
-     tma_mp_clamp(&q);
-     tma_mp_exch(&q, c);
-  }
-  tma_mp_clear(&q);
-
-  return res;
-}
-
-#endif
-
-/* $Source$ */
-/* $Revision$ */
-/* $Date$ */
-
-/* End: bn_tma_mp_div_3.c */
-
-/* Start: bn_tma_mp_div_d.c */
-#include "tma.h"
-#ifdef BN_MP_DIV_D_C
-/* LibTomMath, multiple-precision integer library -- Tom St Denis
- *
- * LibTomMath is a library that provides multiple-precision
- * integer arithmetic as well as number theoretic functionality.
- *
- * The library was designed directly after the MPI library by
- * Michael Fromberger but has been written from scratch with
- * additional optimizations in place.
- *
- * The library is free for all purposes without any express
- * guarantee it works.
- *
- * Tom St Denis, tomstdenis@gmail.com, http://libtom.org
- */
-
-static int s_is_power_of_two(tma_mp_digit b, int *p)
-{
-   int x;
-
-   /* fast return if no power of two */
-   if ((b==0) || (b & (b-1))) {
-      return 0;
-   }
-
-   for (x = 0; x < DIGIT_BIT; x++) {
-      if (b == (((tma_mp_digit)1)<<x)) {
-         *p = x;
-         return 1;
-      }
-   }
-   return 0;
-}
-
-/* single digit division (based on routine from MPI) */
-int tma_mp_div_d (tma_mp_int * a, tma_mp_digit b, tma_mp_int * c, tma_mp_digit * d)
-{
-  tma_mp_int  q;
-  tma_mp_word w;
-  tma_mp_digit t;
-  int     res, ix;
-
-  /* cannot divide by zero */
-  if (b == 0) {
-     return MP_VAL;
-  }
-
-  /* quick outs */
-  if (b == 1 || tma_mp_iszero(a) == 1) {
-     if (d != NULL) {
-        *d = 0;
-     }
-     if (c != NULL) {
-        return tma_mp_copy(a, c);
-     }
-     return MP_OKAY;
-  }
-
-  /* power of two ? */
-  if (s_is_power_of_two(b, &ix) == 1) {
-     if (d != NULL) {
-        *d = a->dp[0] & ((((tma_mp_digit)1)<<ix) - 1);
-     }
-     if (c != NULL) {
-        return tma_mp_div_2d(a, ix, c, NULL);
-     }
-     return MP_OKAY;
-  }
-
-#ifdef BN_MP_DIV_3_C
-  /* three? */
-  if (b == 3) {
-     return tma_mp_div_3(a, c, d);
-  }
-#endif
-
-  /* no easy answer [c'est la vie].  Just division */
-  if ((res = tma_mp_init_size(&q, a->used)) != MP_OKAY) {
-     return res;
-  }
-
-  q.used = a->used;
-  q.sign = a->sign;
-  w = 0;
-  for (ix = a->used - 1; ix >= 0; ix--) {
-     w = (w << ((tma_mp_word)DIGIT_BIT)) | ((tma_mp_word)a->dp[ix]);
-
-     if (w >= b) {
-        t = (tma_mp_digit)(w / b);
-        w -= ((tma_mp_word)t) * ((tma_mp_word)b);
-      } else {
-        t = 0;
-      }
-      q.dp[ix] = (tma_mp_digit)t;
-  }
-
-  if (d != NULL) {
-     *d = (tma_mp_digit)w;
-  }
-
-  if (c != NULL) {
-     tma_mp_clamp(&q);
-     tma_mp_exch(&q, c);
-  }
-  tma_mp_clear(&q);
-
-  return res;
-}
-
-#endif
-
-/* $Source$ */
-/* $Revision$ */
-/* $Date$ */
-
-/* End: bn_tma_mp_div_d.c */
-
-/* Start: bn_tma_mp_dr_is_modulus.c */
-#include "tma.h"
-#ifdef BN_MP_DR_IS_MODULUS_C
-/* LibTomMath, multiple-precision integer library -- Tom St Denis
- *
- * LibTomMath is a library that provides multiple-precision
- * integer arithmetic as well as number theoretic functionality.
- *
- * The library was designed directly after the MPI library by
- * Michael Fromberger but has been written from scratch with
- * additional optimizations in place.
- *
- * The library is free for all purposes without any express
- * guarantee it works.
- *
- * Tom St Denis, tomstdenis@gmail.com, http://libtom.org
- */
-
-/* determines if a number is a valid DR modulus */
-int tma_mp_dr_is_modulus(tma_mp_int *a)
-{
-   int ix;
-
-   /* must be at least two digits */
-   if (a->used < 2) {
-      return 0;
-   }
-
-   /* must be of the form b**k - a [a <= b] so all
-    * but the first digit must be equal to -1 (mod b).
-    */
-   for (ix = 1; ix < a->used; ix++) {
-       if (a->dp[ix] != MP_MASK) {
-          return 0;
-       }
-   }
-   return 1;
-}
-
-#endif
-
-/* $Source$ */
-/* $Revision$ */
-/* $Date$ */
-
-/* End: bn_tma_mp_dr_is_modulus.c */
-
-/* Start: bn_tma_mp_dr_reduce.c */
-#include "tma.h"
-#ifdef BN_MP_DR_REDUCE_C
-/* LibTomMath, multiple-precision integer library -- Tom St Denis
- *
- * LibTomMath is a library that provides multiple-precision
- * integer arithmetic as well as number theoretic functionality.
- *
- * The library was designed directly after the MPI library by
- * Michael Fromberger but has been written from scratch with
- * additional optimizations in place.
- *
- * The library is free for all purposes without any express
- * guarantee it works.
- *
- * Tom St Denis, tomstdenis@gmail.com, http://libtom.org
- */
-
-/* reduce "x" in place modulo "n" using the Diminished Radix algorithm.
- *
- * Based on algorithm from the paper
- *
- * "Generating Efficient Primes for Discrete Log Cryptosystems"
- *                 Chae Hoon Lim, Pil Joong Lee,
- *          POSTECH Information Research Laboratories
- *
- * The modulus must be of a special format [see manual]
- *
- * Has been modified to use algorithm 7.10 from the LTM book instead
- *
- * Input x must be in the range 0 <= x <= (n-1)**2
- */
-int
-tma_mp_dr_reduce (tma_mp_int * x, tma_mp_int * n, tma_mp_digit k)
-{
-  int      err, i, m;
-  tma_mp_word  r;
-  tma_mp_digit mu, *tmpx1, *tmpx2;
-
-  /* m = digits in modulus */
-  m = n->used;
-
-  /* ensure that "x" has at least 2m digits */
-  if (x->alloc < m + m) {
-    if ((err = tma_mp_grow (x, m + m)) != MP_OKAY) {
-      return err;
-    }
-  }
-
-/* top of loop, this is where the code resumes if
- * another reduction pass is required.
- */
-top:
-  /* aliases for digits */
-  /* alias for lower half of x */
-  tmpx1 = x->dp;
-
-  /* alias for upper half of x, or x/B**m */
-  tmpx2 = x->dp + m;
-
-  /* set carry to zero */
-  mu = 0;
-
-  /* compute (x mod B**m) + k * [x/B**m] inline and inplace */
-  for (i = 0; i < m; i++) {
-      r         = ((tma_mp_word)*tmpx2++) * ((tma_mp_word)k) + *tmpx1 + mu;
-      *tmpx1++  = (tma_mp_digit)(r & MP_MASK);
-      mu        = (tma_mp_digit)(r >> ((tma_mp_word)DIGIT_BIT));
-  }
-
-  /* set final carry */
-  *tmpx1++ = mu;
-
-  /* zero words above m */
-  for (i = m + 1; i < x->used; i++) {
-      *tmpx1++ = 0;
-  }
-
-  /* clamp, sub and return */
-  tma_mp_clamp (x);
-
-  /* if x >= n then subtract and reduce again
-   * Each successive "recursion" makes the input smaller and smaller.
-   */
-  if (tma_mp_cmp_mag (x, n) != MP_LT) {
-    s_tma_mp_sub(x, n, x);
-    goto top;
-  }
-  return MP_OKAY;
-}
-#endif
-
-/* $Source$ */
-/* $Revision$ */
-/* $Date$ */
-
-/* End: bn_tma_mp_dr_reduce.c */
-
-/* Start: bn_tma_mp_dr_setup.c */
-#include "tma.h"
-#ifdef BN_MP_DR_SETUP_C
-/* LibTomMath, multiple-precision integer library -- Tom St Denis
- *
- * LibTomMath is a library that provides multiple-precision
- * integer arithmetic as well as number theoretic functionality.
- *
- * The library was designed directly after the MPI library by
- * Michael Fromberger but has been written from scratch with
- * additional optimizations in place.
- *
- * The library is free for all purposes without any express
- * guarantee it works.
- *
- * Tom St Denis, tomstdenis@gmail.com, http://libtom.org
- */
-
-/* determines the setup value */
-void tma_mp_dr_setup(tma_mp_int *a, tma_mp_digit *d)
-{
-   /* the casts are required if DIGIT_BIT is one less than
-    * the number of bits in a tma_mp_digit [e.g. DIGIT_BIT==31]
-    */
-   *d = (tma_mp_digit)((((tma_mp_word)1) << ((tma_mp_word)DIGIT_BIT)) -
-        ((tma_mp_word)a->dp[0]));
-}
-
-#endif
-
-/* $Source$ */
-/* $Revision$ */
-/* $Date$ */
-
-/* End: bn_tma_mp_dr_setup.c */
-
-/* Start: bn_tma_mp_exch.c */
-#include "tma.h"
-#ifdef BN_MP_EXCH_C
-/* LibTomMath, multiple-precision integer library -- Tom St Denis
- *
- * LibTomMath is a library that provides multiple-precision
- * integer arithmetic as well as number theoretic functionality.
- *
- * The library was designed directly after the MPI library by
- * Michael Fromberger but has been written from scratch with
- * additional optimizations in place.
- *
- * The library is free for all purposes without any express
- * guarantee it works.
- *
- * Tom St Denis, tomstdenis@gmail.com, http://libtom.org
- */
-
-/* swap the elements of two integers, for cases where you can't simply swap the
- * tma_mp_int pointers around
- */
-void
-tma_mp_exch (tma_mp_int * a, tma_mp_int * b)
-{
-  tma_mp_int  t;
-
-  t  = *a;
-  *a = *b;
-  *b = t;
-}
-#endif
-
-/* $Source$ */
-/* $Revision$ */
-/* $Date$ */
-
-/* End: bn_tma_mp_exch.c */
-
-/* Start: bn_tma_mp_expt_d.c */
-#include "tma.h"
-#ifdef BN_MP_EXPT_D_C
-/* LibTomMath, multiple-precision integer library -- Tom St Denis
- *
- * LibTomMath is a library that provides multiple-precision
- * integer arithmetic as well as number theoretic functionality.
- *
- * The library was designed directly after the MPI library by
- * Michael Fromberger but has been written from scratch with
- * additional optimizations in place.
- *
- * The library is free for all purposes without any express
- * guarantee it works.
- *
- * Tom St Denis, tomstdenis@gmail.com, http://libtom.org
- */
-
-/* calculate c = a**b  using a square-multiply algorithm */
-int tma_mp_expt_d (tma_mp_int * a, tma_mp_digit b, tma_mp_int * c)
-{
-  int     res, x;
-  tma_mp_int  g;
-
-  if ((res = tma_mp_init_copy (&g, a)) != MP_OKAY) {
-    return res;
-  }
-
-  /* set initial result */
-  tma_mp_set (c, 1);
-
-  for (x = 0; x < (int) DIGIT_BIT; x++) {
-    /* square */
-    if ((res = tma_mp_sqr (c, c)) != MP_OKAY) {
-      tma_mp_clear (&g);
-      return res;
-    }
-
-    /* if the bit is set multiply */
-    if ((b & (tma_mp_digit) (((tma_mp_digit)1) << (DIGIT_BIT - 1))) != 0) {
-      if ((res = tma_mp_mul (c, &g, c)) != MP_OKAY) {
-         tma_mp_clear (&g);
-         return res;
-      }
-    }
-
-    /* shift to next bit */
-    b <<= 1;
-  }
-
-  tma_mp_clear (&g);
-  return MP_OKAY;
-}
-#endif
-
-/* $Source$ */
-/* $Revision$ */
-/* $Date$ */
-
-/* End: bn_tma_mp_expt_d.c */
-
-/* Start: bn_tma_mp_exptmod.c */
-#include "tma.h"
-#ifdef BN_MP_EXPTMOD_C
-/* LibTomMath, multiple-precision integer library -- Tom St Denis
- *
- * LibTomMath is a library that provides multiple-precision
- * integer arithmetic as well as number theoretic functionality.
- *
- * The library was designed directly after the MPI library by
- * Michael Fromberger but has been written from scratch with
- * additional optimizations in place.
- *
- * The library is free for all purposes without any express
- * guarantee it works.
- *
- * Tom St Denis, tomstdenis@gmail.com, http://libtom.org
- */
-
-
-/* this is a shell function that calls either the normal or Montgomery
- * exptmod functions.  Originally the call to the montgomery code was
- * embedded in the normal function but that wasted alot of stack space
- * for nothing (since 99% of the time the Montgomery code would be called)
- */
-int tma_mp_exptmod (tma_mp_int * G, tma_mp_int * X, tma_mp_int * P, tma_mp_int * Y)
-{
-  int dr;
-
-  /* modulus P must be positive */
-  if (P->sign == MP_NEG) {
-     return MP_VAL;
-  }
-
-  /* if exponent X is negative we have to recurse */
-  if (X->sign == MP_NEG) {
-#ifdef BN_MP_INVMOD_C
-     tma_mp_int tmpG, tmpX;
-     int err;
-
-     /* first compute 1/G mod P */
-     if ((err = tma_mp_init(&tmpG)) != MP_OKAY) {
-        return err;
-     }
-     if ((err = tma_mp_invmod(G, P, &tmpG)) != MP_OKAY) {
-        tma_mp_clear(&tmpG);
-        return err;
-     }
-
-     /* now get |X| */
-     if ((err = tma_mp_init(&tmpX)) != MP_OKAY) {
-        tma_mp_clear(&tmpG);
-        return err;
-     }
-     if ((err = tma_mp_abs(X, &tmpX)) != MP_OKAY) {
-        tma_mp_clear_multi(&tmpG, &tmpX, NULL);
-        return err;
-     }
-
-     /* and now compute (1/G)**|X| instead of G**X [X < 0] */
-     err = tma_mp_exptmod(&tmpG, &tmpX, P, Y);
-     tma_mp_clear_multi(&tmpG, &tmpX, NULL);
-     return err;
-#else
-     /* no invmod */
-     return MP_VAL;
-#endif
-  }
-
-/* modified diminished radix reduction */
-#if defined(BN_MP_REDUCE_IS_2K_L_C) && defined(BN_MP_REDUCE_2K_L_C) && defined(BN_S_MP_EXPTMOD_C)
-  if (tma_mp_reduce_is_2k_l(P) == MP_YES) {
-     return s_tma_mp_exptmod(G, X, P, Y, 1);
-  }
-#endif
-
-#ifdef BN_MP_DR_IS_MODULUS_C
-  /* is it a DR modulus? */
-  dr = tma_mp_dr_is_modulus(P);
-#else
-  /* default to no */
-  dr = 0;
-#endif
-
-#ifdef BN_MP_REDUCE_IS_2K_C
-  /* if not, is it a unrestricted DR modulus? */
-  if (dr == 0) {
-     dr = tma_mp_reduce_is_2k(P) << 1;
-  }
-#endif
-
-  /* if the modulus is odd or dr != 0 use the montgomery method */
-#ifdef BN_MP_EXPTMOD_FAST_C
-  if (tma_mp_isodd (P) == 1 || dr !=  0) {
-    return tma_mp_exptmod_fast (G, X, P, Y, dr);
-  } else {
-#endif
-#ifdef BN_S_MP_EXPTMOD_C
-    /* otherwise use the generic Barrett reduction technique */
-    return s_tma_mp_exptmod (G, X, P, Y, 0);
-#else
-    /* no exptmod for evens */
-    return MP_VAL;
-#endif
-#ifdef BN_MP_EXPTMOD_FAST_C
-  }
-#endif
-}
-
-#endif
-
-/* $Source$ */
-/* $Revision$ */
-/* $Date$ */
-
-/* End: bn_tma_mp_exptmod.c */
-
-/* Start: bn_tma_mp_exptmod_fast.c */
-#include "tma.h"
-#ifdef BN_MP_EXPTMOD_FAST_C
-/* LibTomMath, multiple-precision integer library -- Tom St Denis
- *
- * LibTomMath is a library that provides multiple-precision
- * integer arithmetic as well as number theoretic functionality.
- *
- * The library was designed directly after the MPI library by
- * Michael Fromberger but has been written from scratch with
- * additional optimizations in place.
- *
- * The library is free for all purposes without any express
- * guarantee it works.
- *
- * Tom St Denis, tomstdenis@gmail.com, http://libtom.org
- */
-
-/* computes Y == G**X mod P, HAC pp.616, Algorithm 14.85
- *
- * Uses a left-to-right k-ary sliding window to compute the modular exponentiation.
- * The value of k changes based on the size of the exponent.
- *
- * Uses Montgomery or Diminished Radix reduction [whichever appropriate]
- */
-
-#ifdef MP_LOW_MEM
-   #define TAB_SIZE 32
-#else
-   #define TAB_SIZE 256
-#endif
-
-int tma_mp_exptmod_fast (tma_mp_int * G, tma_mp_int * X, tma_mp_int * P, tma_mp_int * Y, int redmode)
-{
-  tma_mp_int  M[TAB_SIZE], res;
-  tma_mp_digit buf, mp;
-  int     err, bitbuf, bitcpy, bitcnt, mode, digidx, x, y, winsize;
-
-  /* use a pointer to the reduction algorithm.  This allows us to use
-   * one of many reduction algorithms without modding the guts of
-   * the code with if statements everywhere.
-   */
-  int     (*redux)(tma_mp_int*,tma_mp_int*,tma_mp_digit);
-
-  /* find window size */
-  x = tma_mp_count_bits (X);
-  if (x <= 7) {
-    winsize = 2;
-  } else if (x <= 36) {
-    winsize = 3;
-  } else if (x <= 140) {
-    winsize = 4;
-  } else if (x <= 450) {
-    winsize = 5;
-  } else if (x <= 1303) {
-    winsize = 6;
-  } else if (x <= 3529) {
-    winsize = 7;
-  } else {
-    winsize = 8;
-  }
-
-#ifdef MP_LOW_MEM
-  if (winsize > 5) {
-     winsize = 5;
-  }
-#endif
-
-  /* init M array */
-  /* init first cell */
-  if ((err = tma_mp_init(&M[1])) != MP_OKAY) {
-     return err;
-  }
-
-  /* now init the second half of the array */
-  for (x = 1<<(winsize-1); x < (1 << winsize); x++) {
-    if ((err = tma_mp_init(&M[x])) != MP_OKAY) {
-      for (y = 1<<(winsize-1); y < x; y++) {
-        tma_mp_clear (&M[y]);
-      }
-      tma_mp_clear(&M[1]);
-      return err;
-    }
-  }
-
-  /* determine and setup reduction code */
-  if (redmode == 0) {
-#ifdef BN_MP_MONTGOMERY_SETUP_C
-     /* now setup montgomery  */
-     if ((err = tma_mp_montgomery_setup (P, &mp)) != MP_OKAY) {
-        goto LBL_M;
-     }
-#else
-     err = MP_VAL;
-     goto LBL_M;
-#endif
-
-     /* automatically pick the comba one if available (saves quite a few calls/ifs) */
-#ifdef BN_FAST_MP_MONTGOMERY_REDUCE_C
-     if (((P->used * 2 + 1) < MP_WARRAY) &&
-          P->used < (1 << ((CHAR_BIT * sizeof (tma_mp_word)) - (2 * DIGIT_BIT)))) {
-        redux = fast_tma_mp_montgomery_reduce;
-     } else
-#endif
-     {
-#ifdef BN_MP_MONTGOMERY_REDUCE_C
-        /* use slower baseline Montgomery method */
-        redux = tma_mp_montgomery_reduce;
-#else
-        err = MP_VAL;
-        goto LBL_M;
-#endif
-     }
-  } else if (redmode == 1) {
-#if defined(BN_MP_DR_SETUP_C) && defined(BN_MP_DR_REDUCE_C)
-     /* setup DR reduction for moduli of the form B**k - b */
-     tma_mp_dr_setup(P, &mp);
-     redux = tma_mp_dr_reduce;
-#else
-     err = MP_VAL;
-     goto LBL_M;
-#endif
-  } else {
-#if defined(BN_MP_REDUCE_2K_SETUP_C) && defined(BN_MP_REDUCE_2K_C)
-     /* setup DR reduction for moduli of the form 2**k - b */
-     if ((err = tma_mp_reduce_2k_setup(P, &mp)) != MP_OKAY) {
-        goto LBL_M;
-     }
-     redux = tma_mp_reduce_2k;
-#else
-     err = MP_VAL;
-     goto LBL_M;
-#endif
-  }
-
-  /* setup result */
-  if ((err = tma_mp_init (&res)) != MP_OKAY) {
-    goto LBL_M;
-  }
-
-  /* create M table
-   *
-
-   *
-   * The first half of the table is not computed though accept for M[0] and M[1]
-   */
-
-  if (redmode == 0) {
-#ifdef BN_MP_MONTGOMERY_CALC_NORMALIZATION_C
-     /* now we need R mod m */
-     if ((err = tma_mp_montgomery_calc_normalization (&res, P)) != MP_OKAY) {
-       goto LBL_RES;
-     }
-#else
-     err = MP_VAL;
-     goto LBL_RES;
-#endif
-
-     /* now set M[1] to G * R mod m */
-     if ((err = tma_mp_mulmod (G, &res, P, &M[1])) != MP_OKAY) {
-       goto LBL_RES;
-     }
-  } else {
-     tma_mp_set(&res, 1);
-     if ((err = tma_mp_mod(G, P, &M[1])) != MP_OKAY) {
-        goto LBL_RES;
-     }
-  }
-
-  /* compute the value at M[1<<(winsize-1)] by squaring M[1] (winsize-1) times */
-  if ((err = tma_mp_copy (&M[1], &M[1 << (winsize - 1)])) != MP_OKAY) {
-    goto LBL_RES;
-  }
-
-  for (x = 0; x < (winsize - 1); x++) {
-    if ((err = tma_mp_sqr (&M[1 << (winsize - 1)], &M[1 << (winsize - 1)])) != MP_OKAY) {
-      goto LBL_RES;
-    }
-    if ((err = redux (&M[1 << (winsize - 1)], P, mp)) != MP_OKAY) {
-      goto LBL_RES;
-    }
-  }
-
-  /* create upper table */
-  for (x = (1 << (winsize - 1)) + 1; x < (1 << winsize); x++) {
-    if ((err = tma_mp_mul (&M[x - 1], &M[1], &M[x])) != MP_OKAY) {
-      goto LBL_RES;
-    }
-    if ((err = redux (&M[x], P, mp)) != MP_OKAY) {
-      goto LBL_RES;
-    }
-  }
-
-  /* set initial mode and bit cnt */
-  mode   = 0;
-  bitcnt = 1;
-  buf    = 0;
-  digidx = X->used - 1;
-  bitcpy = 0;
-  bitbuf = 0;
-
-  for (;;) {
-    /* grab next digit as required */
-    if (--bitcnt == 0) {
-      /* if digidx == -1 we are out of digits so break */
-      if (digidx == -1) {
-        break;
-      }
-      /* read next digit and reset bitcnt */
-      buf    = X->dp[digidx--];
-      bitcnt = (int)DIGIT_BIT;
-    }
-
-    /* grab the next msb from the exponent */
-    y     = (tma_mp_digit)(buf >> (DIGIT_BIT - 1)) & 1;
-    buf <<= (tma_mp_digit)1;
-
-    /* if the bit is zero and mode == 0 then we ignore it
-     * These represent the leading zero bits before the first 1 bit
-     * in the exponent.  Technically this opt is not required but it
-     * does lower the # of trivial squaring/reductions used
-     */
-    if (mode == 0 && y == 0) {
-      continue;
-    }
-
-    /* if the bit is zero and mode == 1 then we square */
-    if (mode == 1 && y == 0) {
-      if ((err = tma_mp_sqr (&res, &res)) != MP_OKAY) {
-        goto LBL_RES;
-      }
-      if ((err = redux (&res, P, mp)) != MP_OKAY) {
-        goto LBL_RES;
-      }
-      continue;
-    }
-
-    /* else we add it to the window */
-    bitbuf |= (y << (winsize - ++bitcpy));
-    mode    = 2;
-
-    if (bitcpy == winsize) {
-      /* ok window is filled so square as required and multiply  */
-      /* square first */
-      for (x = 0; x < winsize; x++) {
-        if ((err = tma_mp_sqr (&res, &res)) != MP_OKAY) {
-          goto LBL_RES;
-        }
-        if ((err = redux (&res, P, mp)) != MP_OKAY) {
-          goto LBL_RES;
-        }
-      }
-
-      /* then multiply */
-      if ((err = tma_mp_mul (&res, &M[bitbuf], &res)) != MP_OKAY) {
-        goto LBL_RES;
-      }
-      if ((err = redux (&res, P, mp)) != MP_OKAY) {
-        goto LBL_RES;
-      }
-
-      /* empty window and reset */
-      bitcpy = 0;
-      bitbuf = 0;
-      mode   = 1;
-    }
-  }
-
-  /* if bits remain then square/multiply */
-  if (mode == 2 && bitcpy > 0) {
-    /* square then multiply if the bit is set */
-    for (x = 0; x < bitcpy; x++) {
-      if ((err = tma_mp_sqr (&res, &res)) != MP_OKAY) {
-        goto LBL_RES;
-      }
-      if ((err = redux (&res, P, mp)) != MP_OKAY) {
-        goto LBL_RES;
-      }
-
-      /* get next bit of the window */
-      bitbuf <<= 1;
-      if ((bitbuf & (1 << winsize)) != 0) {
-        /* then multiply */
-        if ((err = tma_mp_mul (&res, &M[1], &res)) != MP_OKAY) {
-          goto LBL_RES;
-        }
-        if ((err = redux (&res, P, mp)) != MP_OKAY) {
-          goto LBL_RES;
-        }
-      }
-    }
-  }
-
-  if (redmode == 0) {
-     /* fixup result if Montgomery reduction is used
-      * recall that any value in a Montgomery system is
-      * actually multiplied by R mod n.  So we have
-      * to reduce one more time to cancel out the factor
-      * of R.
-      */
-     if ((err = redux(&res, P, mp)) != MP_OKAY) {
-       goto LBL_RES;
-     }
-  }
-
-  /* swap res with Y */
-  tma_mp_exch (&res, Y);
-  err = MP_OKAY;
-LBL_RES:tma_mp_clear (&res);
-LBL_M:
-  tma_mp_clear(&M[1]);
-  for (x = 1<<(winsize-1); x < (1 << winsize); x++) {
-    tma_mp_clear (&M[x]);
-  }
-  return err;
-}
-#endif
-
-
-/* $Source$ */
-/* $Revision$ */
-/* $Date$ */
-
-/* End: bn_tma_mp_exptmod_fast.c */
-
-/* Start: bn_tma_mp_exteuclid.c */
-#include "tma.h"
-#ifdef BN_MP_EXTEUCLID_C
-/* LibTomMath, multiple-precision integer library -- Tom St Denis
- *
- * LibTomMath is a library that provides multiple-precision
- * integer arithmetic as well as number theoretic functionality.
- *
- * The library was designed directly after the MPI library by
- * Michael Fromberger but has been written from scratch with
- * additional optimizations in place.
- *
- * The library is free for all purposes without any express
- * guarantee it works.
- *
- * Tom St Denis, tomstdenis@gmail.com, http://libtom.org
- */
-
-/* Extended euclidean algorithm of (a, b) produces
-   a*u1 + b*u2 = u3
- */
-int tma_mp_exteuclid(tma_mp_int *a, tma_mp_int *b, tma_mp_int *U1, tma_mp_int *U2, tma_mp_int *U3)
-{
-   tma_mp_int u1,u2,u3,v1,v2,v3,t1,t2,t3,q,tmp;
-   int err;
-
-   if ((err = tma_mp_init_multi(&u1, &u2, &u3, &v1, &v2, &v3, &t1, &t2, &t3, &q, &tmp, NULL)) != MP_OKAY) {
-      return err;
-   }
-
-   /* initialize, (u1,u2,u3) = (1,0,a) */
-   tma_mp_set(&u1, 1);
-   if ((err = tma_mp_copy(a, &u3)) != MP_OKAY)                                        { goto _ERR; }
-
-   /* initialize, (v1,v2,v3) = (0,1,b) */
-   tma_mp_set(&v2, 1);
-   if ((err = tma_mp_copy(b, &v3)) != MP_OKAY)                                        { goto _ERR; }
-
-   /* loop while v3 != 0 */
-   while (tma_mp_iszero(&v3) == MP_NO) {
-       /* q = u3/v3 */
-       if ((err = tma_mp_div(&u3, &v3, &q, NULL)) != MP_OKAY)                         { goto _ERR; }
-
-       /* (t1,t2,t3) = (u1,u2,u3) - (v1,v2,v3)q */
-       if ((err = tma_mp_mul(&v1, &q, &tmp)) != MP_OKAY)                              { goto _ERR; }
-       if ((err = tma_mp_sub(&u1, &tmp, &t1)) != MP_OKAY)                             { goto _ERR; }
-       if ((err = tma_mp_mul(&v2, &q, &tmp)) != MP_OKAY)                              { goto _ERR; }
-       if ((err = tma_mp_sub(&u2, &tmp, &t2)) != MP_OKAY)                             { goto _ERR; }
-       if ((err = tma_mp_mul(&v3, &q, &tmp)) != MP_OKAY)                              { goto _ERR; }
-       if ((err = tma_mp_sub(&u3, &tmp, &t3)) != MP_OKAY)                             { goto _ERR; }
-
-       /* (u1,u2,u3) = (v1,v2,v3) */
-       if ((err = tma_mp_copy(&v1, &u1)) != MP_OKAY)                                  { goto _ERR; }
-       if ((err = tma_mp_copy(&v2, &u2)) != MP_OKAY)                                  { goto _ERR; }
-       if ((err = tma_mp_copy(&v3, &u3)) != MP_OKAY)                                  { goto _ERR; }
-
-       /* (v1,v2,v3) = (t1,t2,t3) */
-       if ((err = tma_mp_copy(&t1, &v1)) != MP_OKAY)                                  { goto _ERR; }
-       if ((err = tma_mp_copy(&t2, &v2)) != MP_OKAY)                                  { goto _ERR; }
-       if ((err = tma_mp_copy(&t3, &v3)) != MP_OKAY)                                  { goto _ERR; }
-   }
-
-   /* make sure U3 >= 0 */
-   if (u3.sign == MP_NEG) {
-      tma_mp_neg(&u1, &u1);
-      tma_mp_neg(&u2, &u2);
-      tma_mp_neg(&u3, &u3);
-   }
-
-   /* copy result out */
-   if (U1 != NULL) { tma_mp_exch(U1, &u1); }
-   if (U2 != NULL) { tma_mp_exch(U2, &u2); }
-   if (U3 != NULL) { tma_mp_exch(U3, &u3); }
-
-   err = MP_OKAY;
-_ERR: tma_mp_clear_multi(&u1, &u2, &u3, &v1, &v2, &v3, &t1, &t2, &t3, &q, &tmp, NULL);
-   return err;
-}
-#endif
-
-/* $Source$ */
-/* $Revision$ */
-/* $Date$ */
-
-/* End: bn_tma_mp_exteuclid.c */
-
-/* Start: bn_tma_mp_fread.c */
-#include "tma.h"
-#ifdef BN_MP_FREAD_C
-/* LibTomMath, multiple-precision integer library -- Tom St Denis
- *
- * LibTomMath is a library that provides multiple-precision
- * integer arithmetic as well as number theoretic functionality.
- *
- * The library was designed directly after the MPI library by
- * Michael Fromberger but has been written from scratch with
- * additional optimizations in place.
- *
- * The library is free for all purposes without any express
- * guarantee it works.
- *
- * Tom St Denis, tomstdenis@gmail.com, http://libtom.org
- */
-
-/* read a bigint from a file stream in ASCII */
-int tma_mp_fread(tma_mp_int *a, int radix, FILE *stream)
-{
-   int err, ch, neg, y;
-
-   /* clear a */
-   tma_mp_zero(a);
-
-   /* if first digit is - then set negative */
-   ch = fgetc(stream);
-   if (ch == '-') {
-      neg = MP_NEG;
-      ch = fgetc(stream);
-   } else {
-      neg = MP_ZPOS;
-   }
-
-   for (;;) {
-      /* find y in the radix map */
-      for (y = 0; y < radix; y++) {
-          if (tma_mp_s_rmap[y] == ch) {
-             break;
-          }
-      }
-      if (y == radix) {
-         break;
-      }
-
-      /* shift up and add */
-      if ((err = tma_mp_mul_d(a, radix, a)) != MP_OKAY) {
-         return err;
-      }
-      if ((err = tma_mp_add_d(a, y, a)) != MP_OKAY) {
-         return err;
-      }
-
-      ch = fgetc(stream);
-   }
-   if (tma_mp_cmp_d(a, 0) != MP_EQ) {
-      a->sign = neg;
-   }
-
-   return MP_OKAY;
-}
-
-#endif
-
-/* $Source$ */
-/* $Revision$ */
-/* $Date$ */
-
-/* End: bn_tma_mp_fread.c */
-
-/* Start: bn_tma_mp_fwrite.c */
-#include "tma.h"
-#ifdef BN_MP_FWRITE_C
-/* LibTomMath, multiple-precision integer library -- Tom St Denis
- *
- * LibTomMath is a library that provides multiple-precision
- * integer arithmetic as well as number theoretic functionality.
- *
- * The library was designed directly after the MPI library by
- * Michael Fromberger but has been written from scratch with
- * additional optimizations in place.
- *
- * The library is free for all purposes without any express
- * guarantee it works.
- *
- * Tom St Denis, tomstdenis@gmail.com, http://libtom.org
- */
-
-int tma_mp_fwrite(tma_mp_int *a, int radix, FILE *stream)
-{
-   char *buf;
-   int err, len, x;
-
-   if ((err = tma_mp_radix_size(a, radix, &len)) != MP_OKAY) {
-      return err;
-   }
-
-   buf = OPT_CAST(char) XMALLOC (len);
-   if (buf == NULL) {
-      return MP_MEM;
-   }
-
-   if ((err = tma_mp_toradix(a, buf, radix)) != MP_OKAY) {
-      XFREE (buf);
-      return err;
-   }
-
-   for (x = 0; x < len; x++) {
-       if (fputc(buf[x], stream) == EOF) {
-          XFREE (buf);
-          return MP_VAL;
-       }
-   }
-
-   XFREE (buf);
-   return MP_OKAY;
-}
-
-#endif
-
-/* $Source$ */
-/* $Revision$ */
-/* $Date$ */
-
-/* End: bn_tma_mp_fwrite.c */
-
-/* Start: bn_tma_mp_gcd.c */
-#include "tma.h"
-#ifdef BN_MP_GCD_C
-/* LibTomMath, multiple-precision integer library -- Tom St Denis
- *
- * LibTomMath is a library that provides multiple-precision
- * integer arithmetic as well as number theoretic functionality.
- *
- * The library was designed directly after the MPI library by
- * Michael Fromberger but has been written from scratch with
- * additional optimizations in place.
- *
- * The library is free for all purposes without any express
- * guarantee it works.
- *
- * Tom St Denis, tomstdenis@gmail.com, http://libtom.org
- */
-
-/* Greatest Common Divisor using the binary method */
-int tma_mp_gcd (tma_mp_int * a, tma_mp_int * b, tma_mp_int * c)
-{
-  tma_mp_int  u, v;
-  int     k, u_lsb, v_lsb, res;
-
-  /* either zero than gcd is the largest */
-  if (tma_mp_iszero (a) == MP_YES) {
-    return tma_mp_abs (b, c);
-  }
-  if (tma_mp_iszero (b) == MP_YES) {
-    return tma_mp_abs (a, c);
-  }
-
-  /* get copies of a and b we can modify */
-  if ((res = tma_mp_init_copy (&u, a)) != MP_OKAY) {
-    return res;
-  }
-
-  if ((res = tma_mp_init_copy (&v, b)) != MP_OKAY) {
-    goto LBL_U;
-  }
-
-  /* must be positive for the remainder of the algorithm */
-  u.sign = v.sign = MP_ZPOS;
-
-  /* B1.  Find the common power of two for u and v */
-  u_lsb = tma_mp_cnt_lsb(&u);
-  v_lsb = tma_mp_cnt_lsb(&v);
-  k     = MIN(u_lsb, v_lsb);
-
-  if (k > 0) {
-     /* divide the power of two out */
-     if ((res = tma_mp_div_2d(&u, k, &u, NULL)) != MP_OKAY) {
-        goto LBL_V;
-     }
-
-     if ((res = tma_mp_div_2d(&v, k, &v, NULL)) != MP_OKAY) {
-        goto LBL_V;
-     }
-  }
-
-  /* divide any remaining factors of two out */
-  if (u_lsb != k) {
-     if ((res = tma_mp_div_2d(&u, u_lsb - k, &u, NULL)) != MP_OKAY) {
-        goto LBL_V;
-     }
-  }
-
-  if (v_lsb != k) {
-     if ((res = tma_mp_div_2d(&v, v_lsb - k, &v, NULL)) != MP_OKAY) {
-        goto LBL_V;
-     }
-  }
-
-  while (tma_mp_iszero(&v) == 0) {
-     /* make sure v is the largest */
-     if (tma_mp_cmp_mag(&u, &v) == MP_GT) {
-        /* swap u and v to make sure v is >= u */
-        tma_mp_exch(&u, &v);
-     }
-
-     /* subtract smallest from largest */
-     if ((res = s_tma_mp_sub(&v, &u, &v)) != MP_OKAY) {
-        goto LBL_V;
-     }
-
-     /* Divide out all factors of two */
-     if ((res = tma_mp_div_2d(&v, tma_mp_cnt_lsb(&v), &v, NULL)) != MP_OKAY) {
-        goto LBL_V;
-     }
-  }
-
-  /* multiply by 2**k which we divided out at the beginning */
-  if ((res = tma_mp_mul_2d (&u, k, c)) != MP_OKAY) {
-     goto LBL_V;
-  }
-  c->sign = MP_ZPOS;
-  res = MP_OKAY;
-LBL_V:tma_mp_clear (&u);
-LBL_U:tma_mp_clear (&v);
-  return res;
-}
-#endif
-
-/* $Source$ */
-/* $Revision$ */
-/* $Date$ */
-
-/* End: bn_tma_mp_gcd.c */
-
-/* Start: bn_tma_mp_get_int.c */
-#include "tma.h"
-#ifdef BN_MP_GET_INT_C
-/* LibTomMath, multiple-precision integer library -- Tom St Denis
- *
- * LibTomMath is a library that provides multiple-precision
- * integer arithmetic as well as number theoretic functionality.
- *
- * The library was designed directly after the MPI library by
- * Michael Fromberger but has been written from scratch with
- * additional optimizations in place.
- *
- * The library is free for all purposes without any express
- * guarantee it works.
- *
- * Tom St Denis, tomstdenis@gmail.com, http://libtom.org
- */
-
-/* get the lower 32-bits of an tma_mp_int */
-unsigned long tma_mp_get_int(tma_mp_int * a)
-{
-  int i;
-  unsigned long res;
-
-  if (a->used == 0) {
-     return 0;
-  }
-
-  /* get number of digits of the lsb we have to read */
-  i = MIN(a->used,(int)((sizeof(unsigned long)*CHAR_BIT+DIGIT_BIT-1)/DIGIT_BIT))-1;
-
-  /* get most significant digit of result */
-  res = DIGIT(a,i);
-
-  while (--i >= 0) {
-    res = (res << DIGIT_BIT) | DIGIT(a,i);
-  }
-
-  /* force result to 32-bits always so it is consistent on non 32-bit platforms */
-  return res & 0xFFFFFFFFUL;
-}
-#endif
-
-/* $Source$ */
-/* $Revision$ */
-/* $Date$ */
-
-/* End: bn_tma_mp_get_int.c */
-
-/* Start: bn_tma_mp_grow.c */
-#include "tma.h"
-#ifdef BN_MP_GROW_C
-/* LibTomMath, multiple-precision integer library -- Tom St Denis
- *
- * LibTomMath is a library that provides multiple-precision
- * integer arithmetic as well as number theoretic functionality.
- *
- * The library was designed directly after the MPI library by
- * Michael Fromberger but has been written from scratch with
- * additional optimizations in place.
- *
- * The library is free for all purposes without any express
- * guarantee it works.
- *
- * Tom St Denis, tomstdenis@gmail.com, http://libtom.org
- */
-
-/* grow as required */
-int tma_mp_grow (tma_mp_int * a, int size)
-{
-  int     i;
-  tma_mp_digit *tmp;
-
-  /* if the alloc size is smaller alloc more ram */
-  if (a->alloc < size) {
-    /* ensure there are always at least MP_PREC digits extra on top */
-    size += (MP_PREC * 2) - (size % MP_PREC);
-
-    /* reallocate the array a->dp
-     *
-     * We store the return in a temporary variable
-     * in case the operation failed we don't want
-     * to overwrite the dp member of a.
-     */
-    tmp = OPT_CAST(tma_mp_digit) XREALLOC (a->dp, sizeof (tma_mp_digit) * size);
-    if (tmp == NULL) {
-      /* reallocation failed but "a" is still valid [can be freed] */
-      return MP_MEM;
-    }
-
-    /* reallocation succeeded so set a->dp */
-    a->dp = tmp;
-
-    /* zero excess digits */
-    i        = a->alloc;
-    a->alloc = size;
-    for (; i < a->alloc; i++) {
-      a->dp[i] = 0;
-    }
-  }
-  return MP_OKAY;
-}
-#endif
-
-/* $Source$ */
-/* $Revision$ */
-/* $Date$ */
-
-/* End: bn_tma_mp_grow.c */
-
-/* Start: bn_tma_mp_init.c */
-#include "tma.h"
-#ifdef BN_MP_INIT_C
-/* LibTomMath, multiple-precision integer library -- Tom St Denis
- *
- * LibTomMath is a library that provides multiple-precision
- * integer arithmetic as well as number theoretic functionality.
- *
- * The library was designed directly after the MPI library by
- * Michael Fromberger but has been written from scratch with
- * additional optimizations in place.
- *
- * The library is free for all purposes without any express
- * guarantee it works.
- *
- * Tom St Denis, tomstdenis@gmail.com, http://libtom.org
- */
-
-/* init a new tma_mp_int */
-int tma_mp_init (tma_mp_int * a)
-{
-  int i;
-
-  /* allocate memory required and clear it */
-  a->dp = OPT_CAST(tma_mp_digit) XMALLOC (sizeof (tma_mp_digit) * MP_PREC);
-  if (a->dp == NULL) {
-    return MP_MEM;
-  }
-
-  /* set the digits to zero */
-  for (i = 0; i < MP_PREC; i++) {
-      a->dp[i] = 0;
-  }
-
-  /* set the used to zero, allocated digits to the default precision
-   * and sign to positive */
-  a->used  = 0;
-  a->alloc = MP_PREC;
-  a->sign  = MP_ZPOS;
-
-  return MP_OKAY;
-}
-#endif
-
-/* $Source$ */
-/* $Revision$ */
-/* $Date$ */
-
-/* End: bn_tma_mp_init.c */
-
-/* Start: bn_tma_mp_init_copy.c */
-#include "tma.h"
-#ifdef BN_MP_INIT_COPY_C
-/* LibTomMath, multiple-precision integer library -- Tom St Denis
- *
- * LibTomMath is a library that provides multiple-precision
- * integer arithmetic as well as number theoretic functionality.
- *
- * The library was designed directly after the MPI library by
- * Michael Fromberger but has been written from scratch with
- * additional optimizations in place.
- *
- * The library is free for all purposes without any express
- * guarantee it works.
- *
- * Tom St Denis, tomstdenis@gmail.com, http://libtom.org
- */
-
-/* creates "a" then copies b into it */
-int tma_mp_init_copy (tma_mp_int * a, tma_mp_int * b)
-{
-  int     res;
-
-  if ((res = tma_mp_init (a)) != MP_OKAY) {
-    return res;
-  }
-  return tma_mp_copy (b, a);
-}
-#endif
-
-/* $Source$ */
-/* $Revision$ */
-/* $Date$ */
-
-/* End: bn_tma_mp_init_copy.c */
-
-/* Start: bn_tma_mp_init_multi.c */
-#include "tma.h"
-#ifdef BN_MP_INIT_MULTI_C
-/* LibTomMath, multiple-precision integer library -- Tom St Denis
- *
- * LibTomMath is a library that provides multiple-precision
- * integer arithmetic as well as number theoretic functionality.
- *
- * The library was designed directly after the MPI library by
- * Michael Fromberger but has been written from scratch with
- * additional optimizations in place.
- *
- * The library is free for all purposes without any express
- * guarantee it works.
- *
- * Tom St Denis, tomstdenis@gmail.com, http://libtom.org
- */
-#include <stdarg.h>
-
-int tma_mp_init_multi(tma_mp_int *mp, ...)
-{
-    tma_mp_err res = MP_OKAY;      /* Assume ok until proven otherwise */
-    int n = 0;                 /* Number of ok inits */
-    tma_mp_int* cur_arg = mp;
-    va_list args;
-
-    va_start(args, mp);        /* init args to next argument from caller */
-    while (cur_arg != NULL) {
-        if (tma_mp_init(cur_arg) != MP_OKAY) {
-            /* Oops - error! Back-track and tma_mp_clear what we already
-               succeeded in init-ing, then return error.
-            */
-            va_list clean_args;
-
-            /* end the current list */
-            va_end(args);
-
-            /* now start cleaning up */
-            cur_arg = mp;
-            va_start(clean_args, mp);
-            while (n--) {
-                tma_mp_clear(cur_arg);
-                cur_arg = va_arg(clean_args, tma_mp_int*);
-            }
-            va_end(clean_args);
-            res = MP_MEM;
-            break;
-        }
-        n++;
-        cur_arg = va_arg(args, tma_mp_int*);
-    }
-    va_end(args);
-    return res;                /* Assumed ok, if error flagged above. */
-}
-
-#endif
-
-/* $Source$ */
-/* $Revision$ */
-/* $Date$ */
-
-/* End: bn_tma_mp_init_multi.c */
-
-/* Start: bn_tma_mp_init_set.c */
-#include "tma.h"
-#ifdef BN_MP_INIT_SET_C
-/* LibTomMath, multiple-precision integer library -- Tom St Denis
- *
- * LibTomMath is a library that provides multiple-precision
- * integer arithmetic as well as number theoretic functionality.
- *
- * The library was designed directly after the MPI library by
- * Michael Fromberger but has been written from scratch with
- * additional optimizations in place.
- *
- * The library is free for all purposes without any express
- * guarantee it works.
- *
- * Tom St Denis, tomstdenis@gmail.com, http://libtom.org
- */
-
-/* initialize and set a digit */
-int tma_mp_init_set (tma_mp_int * a, tma_mp_digit b)
-{
-  int err;
-  if ((err = tma_mp_init(a)) != MP_OKAY) {
-     return err;
-  }
-  tma_mp_set(a, b);
-  return err;
-}
-#endif
-
-/* $Source$ */
-/* $Revision$ */
-/* $Date$ */
-
-/* End: bn_tma_mp_init_set.c */
-
-/* Start: bn_tma_mp_init_set_int.c */
-#include "tma.h"
-#ifdef BN_MP_INIT_SET_INT_C
-/* LibTomMath, multiple-precision integer library -- Tom St Denis
- *
- * LibTomMath is a library that provides multiple-precision
- * integer arithmetic as well as number theoretic functionality.
- *
- * The library was designed directly after the MPI library by
- * Michael Fromberger but has been written from scratch with
- * additional optimizations in place.
- *
- * The library is free for all purposes without any express
- * guarantee it works.
- *
- * Tom St Denis, tomstdenis@gmail.com, http://libtom.org
- */
-
-/* initialize and set a digit */
-int tma_mp_init_set_int (tma_mp_int * a, unsigned long b)
-{
-  int err;
-  if ((err = tma_mp_init(a)) != MP_OKAY) {
-     return err;
-  }
-  return tma_mp_set_int(a, b);
-}
-#endif
-
-/* $Source$ */
-/* $Revision$ */
-/* $Date$ */
-
-/* End: bn_tma_mp_init_set_int.c */
-
-/* Start: bn_tma_mp_init_size.c */
-#include "tma.h"
-#ifdef BN_MP_INIT_SIZE_C
-/* LibTomMath, multiple-precision integer library -- Tom St Denis
- *
- * LibTomMath is a library that provides multiple-precision
- * integer arithmetic as well as number theoretic functionality.
- *
- * The library was designed directly after the MPI library by
- * Michael Fromberger but has been written from scratch with
- * additional optimizations in place.
- *
- * The library is free for all purposes without any express
- * guarantee it works.
- *
- * Tom St Denis, tomstdenis@gmail.com, http://libtom.org
- */
-
-/* init an tma_mp_init for a given size */
-int tma_mp_init_size (tma_mp_int * a, int size)
-{
-  int x;
-
-  /* pad size so there are always extra digits */
-  size += (MP_PREC * 2) - (size % MP_PREC);
-
-  /* alloc mem */
-  a->dp = OPT_CAST(tma_mp_digit) XMALLOC (sizeof (tma_mp_digit) * size);
-  if (a->dp == NULL) {
-    return MP_MEM;
-  }
-
-  /* set the members */
-  a->used  = 0;
-  a->alloc = size;
-  a->sign  = MP_ZPOS;
-
-  /* zero the digits */
-  for (x = 0; x < size; x++) {
-      a->dp[x] = 0;
-  }
-
-  return MP_OKAY;
-}
-#endif
-
-/* $Source$ */
-/* $Revision$ */
-/* $Date$ */
-
-/* End: bn_tma_mp_init_size.c */
-
-/* Start: bn_tma_mp_invmod.c */
-#include "tma.h"
-#ifdef BN_MP_INVMOD_C
-/* LibTomMath, multiple-precision integer library -- Tom St Denis
- *
- * LibTomMath is a library that provides multiple-precision
- * integer arithmetic as well as number theoretic functionality.
- *
- * The library was designed directly after the MPI library by
- * Michael Fromberger but has been written from scratch with
- * additional optimizations in place.
- *
- * The library is free for all purposes without any express
- * guarantee it works.
- *
- * Tom St Denis, tomstdenis@gmail.com, http://libtom.org
- */
-
-/* hac 14.61, pp608 */
-int tma_mp_invmod (tma_mp_int * a, tma_mp_int * b, tma_mp_int * c)
-{
-  /* b cannot be negative */
-  if (b->sign == MP_NEG || tma_mp_iszero(b) == 1) {
-    return MP_VAL;
-  }
-
-#ifdef BN_FAST_MP_INVMOD_C
-  /* if the modulus is odd we can use a faster routine instead */
-  if (tma_mp_isodd (b) == 1) {
-    return fast_tma_mp_invmod (a, b, c);
-  }
-#endif
-
-#ifdef BN_MP_INVMOD_SLOW_C
-  return tma_mp_invmod_slow(a, b, c);
-#endif
-
-  return MP_VAL;
-}
-#endif
-
-/* $Source$ */
-/* $Revision$ */
-/* $Date$ */
-
-/* End: bn_tma_mp_invmod.c */
-
-/* Start: bn_tma_mp_invmod_slow.c */
-#include "tma.h"
-#ifdef BN_MP_INVMOD_SLOW_C
-/* LibTomMath, multiple-precision integer library -- Tom St Denis
- *
- * LibTomMath is a library that provides multiple-precision
- * integer arithmetic as well as number theoretic functionality.
- *
- * The library was designed directly after the MPI library by
- * Michael Fromberger but has been written from scratch with
- * additional optimizations in place.
- *
- * The library is free for all purposes without any express
- * guarantee it works.
- *
- * Tom St Denis, tomstdenis@gmail.com, http://libtom.org
- */
-
-/* hac 14.61, pp608 */
-int tma_mp_invmod_slow (tma_mp_int * a, tma_mp_int * b, tma_mp_int * c)
-{
-  tma_mp_int  x, y, u, v, A, B, C, D;
-  int     res;
-
-  /* b cannot be negative */
-  if (b->sign == MP_NEG || tma_mp_iszero(b) == 1) {
-    return MP_VAL;
-  }
-
-  /* init temps */
-  if ((res = tma_mp_init_multi(&x, &y, &u, &v,
-                           &A, &B, &C, &D, NULL)) != MP_OKAY) {
-     return res;
-  }
-
-  /* x = a, y = b */
-  if ((res = tma_mp_mod(a, b, &x)) != MP_OKAY) {
-      goto LBL_ERR;
-  }
-  if ((res = tma_mp_copy (b, &y)) != MP_OKAY) {
-    goto LBL_ERR;
-  }
-
-  /* 2. [modified] if x,y are both even then return an error! */
-  if (tma_mp_iseven (&x) == 1 && tma_mp_iseven (&y) == 1) {
-    res = MP_VAL;
-    goto LBL_ERR;
-  }
-
-  /* 3. u=x, v=y, A=1, B=0, C=0,D=1 */
-  if ((res = tma_mp_copy (&x, &u)) != MP_OKAY) {
-    goto LBL_ERR;
-  }
-  if ((res = tma_mp_copy (&y, &v)) != MP_OKAY) {
-    goto LBL_ERR;
-  }
-  tma_mp_set (&A, 1);
-  tma_mp_set (&D, 1);
-
-top:
-  /* 4.  while u is even do */
-  while (tma_mp_iseven (&u) == 1) {
-    /* 4.1 u = u/2 */
-    if ((res = tma_mp_div_2 (&u, &u)) != MP_OKAY) {
-      goto LBL_ERR;
-    }
-    /* 4.2 if A or B is odd then */
-    if (tma_mp_isodd (&A) == 1 || tma_mp_isodd (&B) == 1) {
-      /* A = (A+y)/2, B = (B-x)/2 */
-      if ((res = tma_mp_add (&A, &y, &A)) != MP_OKAY) {
-         goto LBL_ERR;
-      }
-      if ((res = tma_mp_sub (&B, &x, &B)) != MP_OKAY) {
-         goto LBL_ERR;
-      }
-    }
-    /* A = A/2, B = B/2 */
-    if ((res = tma_mp_div_2 (&A, &A)) != MP_OKAY) {
-      goto LBL_ERR;
-    }
-    if ((res = tma_mp_div_2 (&B, &B)) != MP_OKAY) {
-      goto LBL_ERR;
-    }
-  }
-
-  /* 5.  while v is even do */
-  while (tma_mp_iseven (&v) == 1) {
-    /* 5.1 v = v/2 */
-    if ((res = tma_mp_div_2 (&v, &v)) != MP_OKAY) {
-      goto LBL_ERR;
-    }
-    /* 5.2 if C or D is odd then */
-    if (tma_mp_isodd (&C) == 1 || tma_mp_isodd (&D) == 1) {
-      /* C = (C+y)/2, D = (D-x)/2 */
-      if ((res = tma_mp_add (&C, &y, &C)) != MP_OKAY) {
-         goto LBL_ERR;
-      }
-      if ((res = tma_mp_sub (&D, &x, &D)) != MP_OKAY) {
-         goto LBL_ERR;
-      }
-    }
-    /* C = C/2, D = D/2 */
-    if ((res = tma_mp_div_2 (&C, &C)) != MP_OKAY) {
-      goto LBL_ERR;
-    }
-    if ((res = tma_mp_div_2 (&D, &D)) != MP_OKAY) {
-      goto LBL_ERR;
-    }
-  }
-
-  /* 6.  if u >= v then */
-  if (tma_mp_cmp (&u, &v) != MP_LT) {
-    /* u = u - v, A = A - C, B = B - D */
-    if ((res = tma_mp_sub (&u, &v, &u)) != MP_OKAY) {
-      goto LBL_ERR;
-    }
-
-    if ((res = tma_mp_sub (&A, &C, &A)) != MP_OKAY) {
-      goto LBL_ERR;
-    }
-
-    if ((res = tma_mp_sub (&B, &D, &B)) != MP_OKAY) {
-      goto LBL_ERR;
-    }
-  } else {
-    /* v - v - u, C = C - A, D = D - B */
-    if ((res = tma_mp_sub (&v, &u, &v)) != MP_OKAY) {
-      goto LBL_ERR;
-    }
-
-    if ((res = tma_mp_sub (&C, &A, &C)) != MP_OKAY) {
-      goto LBL_ERR;
-    }
-
-    if ((res = tma_mp_sub (&D, &B, &D)) != MP_OKAY) {
-      goto LBL_ERR;
-    }
-  }
-
-  /* if not zero goto step 4 */
-  if (tma_mp_iszero (&u) == 0)
-    goto top;
-
-  /* now a = C, b = D, gcd == g*v */
-
-  /* if v != 1 then there is no inverse */
-  if (tma_mp_cmp_d (&v, 1) != MP_EQ) {
-    res = MP_VAL;
-    goto LBL_ERR;
-  }
-
-  /* if its too low */
-  while (tma_mp_cmp_d(&C, 0) == MP_LT) {
-      if ((res = tma_mp_add(&C, b, &C)) != MP_OKAY) {
-         goto LBL_ERR;
-      }
-  }
-
-  /* too big */
-  while (tma_mp_cmp_mag(&C, b) != MP_LT) {
-      if ((res = tma_mp_sub(&C, b, &C)) != MP_OKAY) {
-         goto LBL_ERR;
-      }
-  }
-
-  /* C is now the inverse */
-  tma_mp_exch (&C, c);
-  res = MP_OKAY;
-LBL_ERR:tma_mp_clear_multi (&x, &y, &u, &v, &A, &B, &C, &D, NULL);
-  return res;
-}
-#endif
-
-/* $Source$ */
-/* $Revision$ */
-/* $Date$ */
-
-/* End: bn_tma_mp_invmod_slow.c */
-
-/* Start: bn_tma_mp_is_square.c */
-#include "tma.h"
-#ifdef BN_MP_IS_SQUARE_C
-/* LibTomMath, multiple-precision integer library -- Tom St Denis
- *
- * LibTomMath is a library that provides multiple-precision
- * integer arithmetic as well as number theoretic functionality.
- *
- * The library was designed directly after the MPI library by
- * Michael Fromberger but has been written from scratch with
- * additional optimizations in place.
- *
- * The library is free for all purposes without any express
- * guarantee it works.
- *
- * Tom St Denis, tomstdenis@gmail.com, http://libtom.org
- */
-
-/* Check if remainders are possible squares - fast exclude non-squares */
-static const char rem_128[128] = {
- 0, 0, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1,
- 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1,
- 1, 0, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1,
- 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1,
- 0, 0, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1,
- 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1,
- 1, 0, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1,
- 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1
-};
-
-static const char rem_105[105] = {
- 0, 0, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1,
- 0, 0, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1,
- 0, 1, 1, 1, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1,
- 1, 0, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1,
- 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1,
- 1, 1, 1, 1, 0, 1, 0, 1, 1, 0, 0, 1, 1, 1, 1,
- 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1
-};
-
-/* Store non-zero to ret if arg is square, and zero if not */
-int tma_mp_is_square(tma_mp_int *arg,int *ret)
-{
-  int           res;
-  tma_mp_digit      c;
-  tma_mp_int        t;
-  unsigned long r;
-
-  /* Default to Non-square :) */
-  *ret = MP_NO;
-
-  if (arg->sign == MP_NEG) {
-    return MP_VAL;
-  }
-
-  /* digits used?  (TSD) */
-  if (arg->used == 0) {
-     return MP_OKAY;
-  }
-
-  /* First check mod 128 (suppose that DIGIT_BIT is at least 7) */
-  if (rem_128[127 & DIGIT(arg,0)] == 1) {
-     return MP_OKAY;
-  }
-
-  /* Next check mod 105 (3*5*7) */
-  if ((res = tma_mp_mod_d(arg,105,&c)) != MP_OKAY) {
-     return res;
-  }
-  if (rem_105[c] == 1) {
-     return MP_OKAY;
-  }
-
-
-  if ((res = tma_mp_init_set_int(&t,11L*13L*17L*19L*23L*29L*31L)) != MP_OKAY) {
-     return res;
-  }
-  if ((res = tma_mp_mod(arg,&t,&t)) != MP_OKAY) {
-     goto ERR;
-  }
-  r = tma_mp_get_int(&t);
-  /* Check for other prime modules, note it's not an ERROR but we must
-   * free "t" so the easiest way is to goto ERR.  We know that res
-   * is already equal to MP_OKAY from the tma_mp_mod call
-   */
-  if ( (1L<<(r%11)) & 0x5C4L )             goto ERR;
-  if ( (1L<<(r%13)) & 0x9E4L )             goto ERR;
-  if ( (1L<<(r%17)) & 0x5CE8L )            goto ERR;
-  if ( (1L<<(r%19)) & 0x4F50CL )           goto ERR;
-  if ( (1L<<(r%23)) & 0x7ACCA0L )          goto ERR;
-  if ( (1L<<(r%29)) & 0xC2EDD0CL )         goto ERR;
-  if ( (1L<<(r%31)) & 0x6DE2B848L )        goto ERR;
-
-  /* Final check - is sqr(sqrt(arg)) == arg ? */
-  if ((res = tma_mp_sqrt(arg,&t)) != MP_OKAY) {
-     goto ERR;
-  }
-  if ((res = tma_mp_sqr(&t,&t)) != MP_OKAY) {
-     goto ERR;
-  }
-
-  *ret = (tma_mp_cmp_mag(&t,arg) == MP_EQ) ? MP_YES : MP_NO;
-ERR:tma_mp_clear(&t);
-  return res;
-}
-#endif
-
-/* $Source$ */
-/* $Revision$ */
-/* $Date$ */
-
-/* End: bn_tma_mp_is_square.c */
-
-/* Start: bn_tma_mp_jacobi.c */
-#include "tma.h"
-#ifdef BN_MP_JACOBI_C
-/* LibTomMath, multiple-precision integer library -- Tom St Denis
- *
- * LibTomMath is a library that provides multiple-precision
- * integer arithmetic as well as number theoretic functionality.
- *
- * The library was designed directly after the MPI library by
- * Michael Fromberger but has been written from scratch with
- * additional optimizations in place.
- *
- * The library is free for all purposes without any express
- * guarantee it works.
- *
- * Tom St Denis, tomstdenis@gmail.com, http://libtom.org
- */
-
-/* computes the jacobi c = (a | n) (or Legendre if n is prime)
- * HAC pp. 73 Algorithm 2.149
- */
-int tma_mp_jacobi (tma_mp_int * a, tma_mp_int * p, int *c)
-{
-  tma_mp_int  a1, p1;
-  int     k, s, r, res;
-  tma_mp_digit residue;
-
-  /* if p <= 0 return MP_VAL */
-  if (tma_mp_cmp_d(p, 0) != MP_GT) {
-     return MP_VAL;
-  }
-
-  /* step 1.  if a == 0, return 0 */
-  if (tma_mp_iszero (a) == 1) {
-    *c = 0;
-    return MP_OKAY;
-  }
-
-  /* step 2.  if a == 1, return 1 */
-  if (tma_mp_cmp_d (a, 1) == MP_EQ) {
-    *c = 1;
-    return MP_OKAY;
-  }
-
-  /* default */
-  s = 0;
-
-  /* step 3.  write a = a1 * 2**k  */
-  if ((res = tma_mp_init_copy (&a1, a)) != MP_OKAY) {
-    return res;
-  }
-
-  if ((res = tma_mp_init (&p1)) != MP_OKAY) {
-    goto LBL_A1;
-  }
-
-  /* divide out larger power of two */
-  k = tma_mp_cnt_lsb(&a1);
-  if ((res = tma_mp_div_2d(&a1, k, &a1, NULL)) != MP_OKAY) {
-     goto LBL_P1;
-  }
-
-  /* step 4.  if e is even set s=1 */
-  if ((k & 1) == 0) {
-    s = 1;
-  } else {
-    /* else set s=1 if p = 1/7 (mod 8) or s=-1 if p = 3/5 (mod 8) */
-    residue = p->dp[0] & 7;
-
-    if (residue == 1 || residue == 7) {
-      s = 1;
-    } else if (residue == 3 || residue == 5) {
-      s = -1;
-    }
-  }
-
-  /* step 5.  if p == 3 (mod 4) *and* a1 == 3 (mod 4) then s = -s */
-  if ( ((p->dp[0] & 3) == 3) && ((a1.dp[0] & 3) == 3)) {
-    s = -s;
-  }
-
-  /* if a1 == 1 we're done */
-  if (tma_mp_cmp_d (&a1, 1) == MP_EQ) {
-    *c = s;
-  } else {
-    /* n1 = n mod a1 */
-    if ((res = tma_mp_mod (p, &a1, &p1)) != MP_OKAY) {
-      goto LBL_P1;
-    }
-    if ((res = tma_mp_jacobi (&p1, &a1, &r)) != MP_OKAY) {
-      goto LBL_P1;
-    }
-    *c = s * r;
-  }
-
-  /* done */
-  res = MP_OKAY;
-LBL_P1:tma_mp_clear (&p1);
-LBL_A1:tma_mp_clear (&a1);
-  return res;
-}
-#endif
-
-/* $Source$ */
-/* $Revision$ */
-/* $Date$ */
-
-/* End: bn_tma_mp_jacobi.c */
-
-/* Start: bn_tma_mp_karatsuba_mul.c */
-#include "tma.h"
-#ifdef BN_MP_KARATSUBA_MUL_C
-/* LibTomMath, multiple-precision integer library -- Tom St Denis
- *
- * LibTomMath is a library that provides multiple-precision
- * integer arithmetic as well as number theoretic functionality.
- *
- * The library was designed directly after the MPI library by
- * Michael Fromberger but has been written from scratch with
- * additional optimizations in place.
- *
- * The library is free for all purposes without any express
- * guarantee it works.
- *
- * Tom St Denis, tomstdenis@gmail.com, http://libtom.org
- */
-
-/* c = |a| * |b| using Karatsuba Multiplication using
- * three half size multiplications
- *
- * Let B represent the radix [e.g. 2**DIGIT_BIT] and
- * let n represent half of the number of digits in
- * the min(a,b)
- *
- * a = a1 * B**n + a0
- * b = b1 * B**n + b0
- *
- * Then, a * b =>
-   a1b1 * B**2n + ((a1 + a0)(b1 + b0) - (a0b0 + a1b1)) * B + a0b0
- *
- * Note that a1b1 and a0b0 are used twice and only need to be
- * computed once.  So in total three half size (half # of
- * digit) multiplications are performed, a0b0, a1b1 and
- * (a1+b1)(a0+b0)
- *
- * Note that a multiplication of half the digits requires
- * 1/4th the number of single precision multiplications so in
- * total after one call 25% of the single precision multiplications
- * are saved.  Note also that the call to tma_mp_mul can end up back
- * in this function if the a0, a1, b0, or b1 are above the threshold.
- * This is known as divide-and-conquer and leads to the famous
- * O(N**lg(3)) or O(N**1.584) work which is asymptopically lower than
- * the standard O(N**2) that the baseline/comba methods use.
- * Generally though the overhead of this method doesn't pay off
- * until a certain size (N ~ 80) is reached.
- */
-int tma_mp_karatsuba_mul (tma_mp_int * a, tma_mp_int * b, tma_mp_int * c)
-{
-  tma_mp_int  x0, x1, y0, y1, t1, x0y0, x1y1;
-  int     B, err;
-
-  /* default the return code to an error */
-  err = MP_MEM;
-
-  /* min # of digits */
-  B = MIN (a->used, b->used);
-
-  /* now divide in two */
-  B = B >> 1;
-
-  /* init copy all the temps */
-  if (tma_mp_init_size (&x0, B) != MP_OKAY)
-    goto ERR;
-  if (tma_mp_init_size (&x1, a->used - B) != MP_OKAY)
-    goto X0;
-  if (tma_mp_init_size (&y0, B) != MP_OKAY)
-    goto X1;
-  if (tma_mp_init_size (&y1, b->used - B) != MP_OKAY)
-    goto Y0;
-
-  /* init temps */
-  if (tma_mp_init_size (&t1, B * 2) != MP_OKAY)
-    goto Y1;
-  if (tma_mp_init_size (&x0y0, B * 2) != MP_OKAY)
-    goto T1;
-  if (tma_mp_init_size (&x1y1, B * 2) != MP_OKAY)
-    goto X0Y0;
-
-  /* now shift the digits */
-  x0.used = y0.used = B;
-  x1.used = a->used - B;
-  y1.used = b->used - B;
-
-  {
-    register int x;
-    register tma_mp_digit *tmpa, *tmpb, *tmpx, *tmpy;
-
-    /* we copy the digits directly instead of using higher level functions
-     * since we also need to shift the digits
-     */
-    tmpa = a->dp;
-    tmpb = b->dp;
-
-    tmpx = x0.dp;
-    tmpy = y0.dp;
-    for (x = 0; x < B; x++) {
-      *tmpx++ = *tmpa++;
-      *tmpy++ = *tmpb++;
-    }
-
-    tmpx = x1.dp;
-    for (x = B; x < a->used; x++) {
-      *tmpx++ = *tmpa++;
-    }
-
-    tmpy = y1.dp;
-    for (x = B; x < b->used; x++) {
-      *tmpy++ = *tmpb++;
-    }
-  }
-
-  /* only need to clamp the lower words since by definition the
-   * upper words x1/y1 must have a known number of digits
-   */
-  tma_mp_clamp (&x0);
-  tma_mp_clamp (&y0);
-
-  /* now calc the products x0y0 and x1y1 */
-  /* after this x0 is no longer required, free temp [x0==t2]! */
-  if (tma_mp_mul (&x0, &y0, &x0y0) != MP_OKAY)
-    goto X1Y1;          /* x0y0 = x0*y0 */
-  if (tma_mp_mul (&x1, &y1, &x1y1) != MP_OKAY)
-    goto X1Y1;          /* x1y1 = x1*y1 */
-
-  /* now calc x1+x0 and y1+y0 */
-  if (s_tma_mp_add (&x1, &x0, &t1) != MP_OKAY)
-    goto X1Y1;          /* t1 = x1 - x0 */
-  if (s_tma_mp_add (&y1, &y0, &x0) != MP_OKAY)
-    goto X1Y1;          /* t2 = y1 - y0 */
-  if (tma_mp_mul (&t1, &x0, &t1) != MP_OKAY)
-    goto X1Y1;          /* t1 = (x1 + x0) * (y1 + y0) */
-
-  /* add x0y0 */
-  if (tma_mp_add (&x0y0, &x1y1, &x0) != MP_OKAY)
-    goto X1Y1;          /* t2 = x0y0 + x1y1 */
-  if (s_tma_mp_sub (&t1, &x0, &t1) != MP_OKAY)
-    goto X1Y1;          /* t1 = (x1+x0)*(y1+y0) - (x1y1 + x0y0) */
-
-  /* shift by B */
-  if (tma_mp_lshd (&t1, B) != MP_OKAY)
-    goto X1Y1;          /* t1 = (x0y0 + x1y1 - (x1-x0)*(y1-y0))<<B */
-  if (tma_mp_lshd (&x1y1, B * 2) != MP_OKAY)
-    goto X1Y1;          /* x1y1 = x1y1 << 2*B */
-
-  if (tma_mp_add (&x0y0, &t1, &t1) != MP_OKAY)
-    goto X1Y1;          /* t1 = x0y0 + t1 */
-  if (tma_mp_add (&t1, &x1y1, c) != MP_OKAY)
-    goto X1Y1;          /* t1 = x0y0 + t1 + x1y1 */
-
-  /* Algorithm succeeded set the return code to MP_OKAY */
-  err = MP_OKAY;
-
-X1Y1:tma_mp_clear (&x1y1);
-X0Y0:tma_mp_clear (&x0y0);
-T1:tma_mp_clear (&t1);
-Y1:tma_mp_clear (&y1);
-Y0:tma_mp_clear (&y0);
-X1:tma_mp_clear (&x1);
-X0:tma_mp_clear (&x0);
-ERR:
-  return err;
-}
-#endif
-
-/* $Source$ */
-/* $Revision$ */
-/* $Date$ */
-
-/* End: bn_tma_mp_karatsuba_mul.c */
-
-/* Start: bn_tma_mp_karatsuba_sqr.c */
-#include "tma.h"
-#ifdef BN_MP_KARATSUBA_SQR_C
-/* LibTomMath, multiple-precision integer library -- Tom St Denis
- *
- * LibTomMath is a library that provides multiple-precision
- * integer arithmetic as well as number theoretic functionality.
- *
- * The library was designed directly after the MPI library by
- * Michael Fromberger but has been written from scratch with
- * additional optimizations in place.
- *
- * The library is free for all purposes without any express
- * guarantee it works.
- *
- * Tom St Denis, tomstdenis@gmail.com, http://libtom.org
- */
-
-/* Karatsuba squaring, computes b = a*a using three
- * half size squarings
- *
- * See comments of karatsuba_mul for details.  It
- * is essentially the same algorithm but merely
- * tuned to perform recursive squarings.
- */
-int tma_mp_karatsuba_sqr (tma_mp_int * a, tma_mp_int * b)
-{
-  tma_mp_int  x0, x1, t1, t2, x0x0, x1x1;
-  int     B, err;
-
-  err = MP_MEM;
-
-  /* min # of digits */
-  B = a->used;
-
-  /* now divide in two */
-  B = B >> 1;
-
-  /* init copy all the temps */
-  if (tma_mp_init_size (&x0, B) != MP_OKAY)
-    goto ERR;
-  if (tma_mp_init_size (&x1, a->used - B) != MP_OKAY)
-    goto X0;
-
-  /* init temps */
-  if (tma_mp_init_size (&t1, a->used * 2) != MP_OKAY)
-    goto X1;
-  if (tma_mp_init_size (&t2, a->used * 2) != MP_OKAY)
-    goto T1;
-  if (tma_mp_init_size (&x0x0, B * 2) != MP_OKAY)
-    goto T2;
-  if (tma_mp_init_size (&x1x1, (a->used - B) * 2) != MP_OKAY)
-    goto X0X0;
-
-  {
-    register int x;
-    register tma_mp_digit *dst, *src;
-
-    src = a->dp;
-
-    /* now shift the digits */
-    dst = x0.dp;
-    for (x = 0; x < B; x++) {
-      *dst++ = *src++;
-    }
-
-    dst = x1.dp;
-    for (x = B; x < a->used; x++) {
-      *dst++ = *src++;
-    }
-  }
-
-  x0.used = B;
-  x1.used = a->used - B;
-
-  tma_mp_clamp (&x0);
-
-  /* now calc the products x0*x0 and x1*x1 */
-  if (tma_mp_sqr (&x0, &x0x0) != MP_OKAY)
-    goto X1X1;           /* x0x0 = x0*x0 */
-  if (tma_mp_sqr (&x1, &x1x1) != MP_OKAY)
-    goto X1X1;           /* x1x1 = x1*x1 */
-
-  /* now calc (x1+x0)**2 */
-  if (s_tma_mp_add (&x1, &x0, &t1) != MP_OKAY)
-    goto X1X1;           /* t1 = x1 - x0 */
-  if (tma_mp_sqr (&t1, &t1) != MP_OKAY)
-    goto X1X1;           /* t1 = (x1 - x0) * (x1 - x0) */
-
-  /* add x0y0 */
-  if (s_tma_mp_add (&x0x0, &x1x1, &t2) != MP_OKAY)
-    goto X1X1;           /* t2 = x0x0 + x1x1 */
-  if (s_tma_mp_sub (&t1, &t2, &t1) != MP_OKAY)
-    goto X1X1;           /* t1 = (x1+x0)**2 - (x0x0 + x1x1) */
-
-  /* shift by B */
-  if (tma_mp_lshd (&t1, B) != MP_OKAY)
-    goto X1X1;           /* t1 = (x0x0 + x1x1 - (x1-x0)*(x1-x0))<<B */
-  if (tma_mp_lshd (&x1x1, B * 2) != MP_OKAY)
-    goto X1X1;           /* x1x1 = x1x1 << 2*B */
-
-  if (tma_mp_add (&x0x0, &t1, &t1) != MP_OKAY)
-    goto X1X1;           /* t1 = x0x0 + t1 */
-  if (tma_mp_add (&t1, &x1x1, b) != MP_OKAY)
-    goto X1X1;           /* t1 = x0x0 + t1 + x1x1 */
-
-  err = MP_OKAY;
-
-X1X1:tma_mp_clear (&x1x1);
-X0X0:tma_mp_clear (&x0x0);
-T2:tma_mp_clear (&t2);
-T1:tma_mp_clear (&t1);
-X1:tma_mp_clear (&x1);
-X0:tma_mp_clear (&x0);
-ERR:
-  return err;
-}
-#endif
-
-/* $Source$ */
-/* $Revision$ */
-/* $Date$ */
-
-/* End: bn_tma_mp_karatsuba_sqr.c */
-
-/* Start: bn_tma_mp_lcm.c */
-#include "tma.h"
-#ifdef BN_MP_LCM_C
-/* LibTomMath, multiple-precision integer library -- Tom St Denis
- *
- * LibTomMath is a library that provides multiple-precision
- * integer arithmetic as well as number theoretic functionality.
- *
- * The library was designed directly after the MPI library by
- * Michael Fromberger but has been written from scratch with
- * additional optimizations in place.
- *
- * The library is free for all purposes without any express
- * guarantee it works.
- *
- * Tom St Denis, tomstdenis@gmail.com, http://libtom.org
- */
-
-/* computes least common multiple as |a*b|/(a, b) */
-int tma_mp_lcm (tma_mp_int * a, tma_mp_int * b, tma_mp_int * c)
-{
-  int     res;
-  tma_mp_int  t1, t2;
-
-
-  if ((res = tma_mp_init_multi (&t1, &t2, NULL)) != MP_OKAY) {
-    return res;
-  }
-
-  /* t1 = get the GCD of the two inputs */
-  if ((res = tma_mp_gcd (a, b, &t1)) != MP_OKAY) {
-    goto LBL_T;
-  }
-
-  /* divide the smallest by the GCD */
-  if (tma_mp_cmp_mag(a, b) == MP_LT) {
-     /* store quotient in t2 such that t2 * b is the LCM */
-     if ((res = tma_mp_div(a, &t1, &t2, NULL)) != MP_OKAY) {
-        goto LBL_T;
-     }
-     res = tma_mp_mul(b, &t2, c);
-  } else {
-     /* store quotient in t2 such that t2 * a is the LCM */
-     if ((res = tma_mp_div(b, &t1, &t2, NULL)) != MP_OKAY) {
-        goto LBL_T;
-     }
-     res = tma_mp_mul(a, &t2, c);
-  }
-
-  /* fix the sign to positive */
-  c->sign = MP_ZPOS;
-
-LBL_T:
-  tma_mp_clear_multi (&t1, &t2, NULL);
-  return res;
-}
-#endif
-
-/* $Source$ */
-/* $Revision$ */
-/* $Date$ */
-
-/* End: bn_tma_mp_lcm.c */
-
-/* Start: bn_tma_mp_lshd.c */
-#include "tma.h"
-#ifdef BN_MP_LSHD_C
-/* LibTomMath, multiple-precision integer library -- Tom St Denis
- *
- * LibTomMath is a library that provides multiple-precision
- * integer arithmetic as well as number theoretic functionality.
- *
- * The library was designed directly after the MPI library by
- * Michael Fromberger but has been written from scratch with
- * additional optimizations in place.
- *
- * The library is free for all purposes without any express
- * guarantee it works.
- *
- * Tom St Denis, tomstdenis@gmail.com, http://libtom.org
- */
-
-/* shift left a certain amount of digits */
-int tma_mp_lshd (tma_mp_int * a, int b)
-{
-  int     x, res;
-
-  /* if its less than zero return */
-  if (b <= 0) {
-    return MP_OKAY;
-  }
-
-  /* grow to fit the new digits */
-  if (a->alloc < a->used + b) {
-     if ((res = tma_mp_grow (a, a->used + b)) != MP_OKAY) {
-       return res;
-     }
-  }
-
-  {
-    register tma_mp_digit *top, *bottom;
-
-    /* increment the used by the shift amount then copy upwards */
-    a->used += b;
-
-    /* top */
-    top = a->dp + a->used - 1;
-
-    /* base */
-    bottom = a->dp + a->used - 1 - b;
-
-    /* much like tma_mp_rshd this is implemented using a sliding window
-     * except the window goes the otherway around.  Copying from
-     * the bottom to the top.  see bn_tma_mp_rshd.c for more info.
-     */
-    for (x = a->used - 1; x >= b; x--) {
-      *top-- = *bottom--;
-    }
-
-    /* zero the lower digits */
-    top = a->dp;
-    for (x = 0; x < b; x++) {
-      *top++ = 0;
-    }
-  }
-  return MP_OKAY;
-}
-#endif
-
-/* $Source$ */
-/* $Revision$ */
-/* $Date$ */
-
-/* End: bn_tma_mp_lshd.c */
-
-/* Start: bn_tma_mp_mod.c */
-#include "tma.h"
-#ifdef BN_MP_MOD_C
-/* LibTomMath, multiple-precision integer library -- Tom St Denis
- *
- * LibTomMath is a library that provides multiple-precision
- * integer arithmetic as well as number theoretic functionality.
- *
- * The library was designed directly after the MPI library by
- * Michael Fromberger but has been written from scratch with
- * additional optimizations in place.
- *
- * The library is free for all purposes without any express
- * guarantee it works.
- *
- * Tom St Denis, tomstdenis@gmail.com, http://libtom.org
- */
-
-/* c = a mod b, 0 <= c < b */
-int
-tma_mp_mod (tma_mp_int * a, tma_mp_int * b, tma_mp_int * c)
-{
-  tma_mp_int  t;
-  int     res;
-
-  if ((res = tma_mp_init (&t)) != MP_OKAY) {
-    return res;
-  }
-
-  if ((res = tma_mp_div (a, b, NULL, &t)) != MP_OKAY) {
-    tma_mp_clear (&t);
-    return res;
-  }
-
-  if (t.sign != b->sign) {
-    res = tma_mp_add (b, &t, c);
-  } else {
-    res = MP_OKAY;
-    tma_mp_exch (&t, c);
-  }
-
-  tma_mp_clear (&t);
-  return res;
-}
-#endif
-
-/* $Source$ */
-/* $Revision$ */
-/* $Date$ */
-
-/* End: bn_tma_mp_mod.c */
-
-/* Start: bn_tma_mp_mod_2d.c */
-#include "tma.h"
-#ifdef BN_MP_MOD_2D_C
-/* LibTomMath, multiple-precision integer library -- Tom St Denis
- *
- * LibTomMath is a library that provides multiple-precision
- * integer arithmetic as well as number theoretic functionality.
- *
- * The library was designed directly after the MPI library by
- * Michael Fromberger but has been written from scratch with
- * additional optimizations in place.
- *
- * The library is free for all purposes without any express
- * guarantee it works.
- *
- * Tom St Denis, tomstdenis@gmail.com, http://libtom.org
- */
-
-/* calc a value mod 2**b */
-int
-tma_mp_mod_2d (tma_mp_int * a, int b, tma_mp_int * c)
-{
-  int     x, res;
-
-  /* if b is <= 0 then zero the int */
-  if (b <= 0) {
-    tma_mp_zero (c);
-    return MP_OKAY;
-  }
-
-  /* if the modulus is larger than the value than return */
-  if (b >= (int) (a->used * DIGIT_BIT)) {
-    res = tma_mp_copy (a, c);
-    return res;
-  }
-
-  /* copy */
-  if ((res = tma_mp_copy (a, c)) != MP_OKAY) {
-    return res;
-  }
-
-  /* zero digits above the last digit of the modulus */
-  for (x = (b / DIGIT_BIT) + ((b % DIGIT_BIT) == 0 ? 0 : 1); x < c->used; x++) {
-    c->dp[x] = 0;
-  }
-  /* clear the digit that is not completely outside/inside the modulus */
-  c->dp[b / DIGIT_BIT] &=
-    (tma_mp_digit) ((((tma_mp_digit) 1) << (((tma_mp_digit) b) % DIGIT_BIT)) - ((tma_mp_digit) 1));
-  tma_mp_clamp (c);
-  return MP_OKAY;
-}
-#endif
-
-/* $Source$ */
-/* $Revision$ */
-/* $Date$ */
-
-/* End: bn_tma_mp_mod_2d.c */
-
-/* Start: bn_tma_mp_mod_d.c */
-#include "tma.h"
-#ifdef BN_MP_MOD_D_C
-/* LibTomMath, multiple-precision integer library -- Tom St Denis
- *
- * LibTomMath is a library that provides multiple-precision
- * integer arithmetic as well as number theoretic functionality.
- *
- * The library was designed directly after the MPI library by
- * Michael Fromberger but has been written from scratch with
- * additional optimizations in place.
- *
- * The library is free for all purposes without any express
- * guarantee it works.
- *
- * Tom St Denis, tomstdenis@gmail.com, http://libtom.org
- */
-
-int
-tma_mp_mod_d (tma_mp_int * a, tma_mp_digit b, tma_mp_digit * c)
-{
-  return tma_mp_div_d(a, b, NULL, c);
-}
-#endif
-
-/* $Source$ */
-/* $Revision$ */
-/* $Date$ */
-
-/* End: bn_tma_mp_mod_d.c */
-
-/* Start: bn_tma_mp_montgomery_calc_normalization.c */
-#include "tma.h"
-#ifdef BN_MP_MONTGOMERY_CALC_NORMALIZATION_C
-/* LibTomMath, multiple-precision integer library -- Tom St Denis
- *
- * LibTomMath is a library that provides multiple-precision
- * integer arithmetic as well as number theoretic functionality.
- *
- * The library was designed directly after the MPI library by
- * Michael Fromberger but has been written from scratch with
- * additional optimizations in place.
- *
- * The library is free for all purposes without any express
- * guarantee it works.
- *
- * Tom St Denis, tomstdenis@gmail.com, http://libtom.org
- */
-
-/*
- * shifts with subtractions when the result is greater than b.
- *
- * The method is slightly modified to shift B unconditionally upto just under
- * the leading bit of b.  This saves alot of multiple precision shifting.
- */
-int tma_mp_montgomery_calc_normalization (tma_mp_int * a, tma_mp_int * b)
-{
-  int     x, bits, res;
-
-  /* how many bits of last digit does b use */
-  bits = tma_mp_count_bits (b) % DIGIT_BIT;
-
-  if (b->used > 1) {
-     if ((res = tma_mp_2expt (a, (b->used - 1) * DIGIT_BIT + bits - 1)) != MP_OKAY) {
-        return res;
-     }
-  } else {
-     tma_mp_set(a, 1);
-     bits = 1;
-  }
-
-
-  /* now compute C = A * B mod b */
-  for (x = bits - 1; x < (int)DIGIT_BIT; x++) {
-    if ((res = tma_mp_mul_2 (a, a)) != MP_OKAY) {
-      return res;
-    }
-    if (tma_mp_cmp_mag (a, b) != MP_LT) {
-      if ((res = s_tma_mp_sub (a, b, a)) != MP_OKAY) {
-        return res;
-      }
-    }
-  }
-
-  return MP_OKAY;
-}
-#endif
-
-/* $Source$ */
-/* $Revision$ */
-/* $Date$ */
-
-/* End: bn_tma_mp_montgomery_calc_normalization.c */
-
-/* Start: bn_tma_mp_montgomery_reduce.c */
-#include "tma.h"
-#ifdef BN_MP_MONTGOMERY_REDUCE_C
-/* LibTomMath, multiple-precision integer library -- Tom St Denis
- *
- * LibTomMath is a library that provides multiple-precision
- * integer arithmetic as well as number theoretic functionality.
- *
- * The library was designed directly after the MPI library by
- * Michael Fromberger but has been written from scratch with
- * additional optimizations in place.
- *
- * The library is free for all purposes without any express
- * guarantee it works.
- *
- * Tom St Denis, tomstdenis@gmail.com, http://libtom.org
- */
-
-/* computes xR**-1 == x (mod N) via Montgomery Reduction */
-int
-tma_mp_montgomery_reduce (tma_mp_int * x, tma_mp_int * n, tma_mp_digit rho)
-{
-  int     ix, res, digs;
-  tma_mp_digit mu;
-
-  /* can the fast reduction [comba] method be used?
-   *
-   * Note that unlike in mul you're safely allowed *less*
-   * than the available columns [255 per default] since carries
-   * are fixed up in the inner loop.
-   */
-  digs = n->used * 2 + 1;
-  if ((digs < MP_WARRAY) &&
-      n->used <
-      (1 << ((CHAR_BIT * sizeof (tma_mp_word)) - (2 * DIGIT_BIT)))) {
-    return fast_tma_mp_montgomery_reduce (x, n, rho);
-  }
-
-  /* grow the input as required */
-  if (x->alloc < digs) {
-    if ((res = tma_mp_grow (x, digs)) != MP_OKAY) {
-      return res;
-    }
-  }
-  x->used = digs;
-
-  for (ix = 0; ix < n->used; ix++) {
-    /* mu = ai * rho mod b
-     *
-     * The value of rho must be precalculated via
-     * montgomery_setup() such that
-     * it equals -1/n0 mod b this allows the
-     * following inner loop to reduce the
-     * input one digit at a time
-     */
-    mu = (tma_mp_digit) (((tma_mp_word)x->dp[ix]) * ((tma_mp_word)rho) & MP_MASK);
-
-    /* a = a + mu * m * b**i */
-    {
-      register int iy;
-      register tma_mp_digit *tmpn, *tmpx, u;
-      register tma_mp_word r;
-
-      /* alias for digits of the modulus */
-      tmpn = n->dp;
-
-      /* alias for the digits of x [the input] */
-      tmpx = x->dp + ix;
-
-      /* set the carry to zero */
-      u = 0;
-
-      /* Multiply and add in place */
-      for (iy = 0; iy < n->used; iy++) {
-        /* compute product and sum */
-        r       = ((tma_mp_word)mu) * ((tma_mp_word)*tmpn++) +
-                  ((tma_mp_word) u) + ((tma_mp_word) * tmpx);
-
-        /* get carry */
-        u       = (tma_mp_digit)(r >> ((tma_mp_word) DIGIT_BIT));
-
-        /* fix digit */
-        *tmpx++ = (tma_mp_digit)(r & ((tma_mp_word) MP_MASK));
-      }
-      /* At this point the ix'th digit of x should be zero */
-
-
-      /* propagate carries upwards as required*/
-      while (u) {
-        *tmpx   += u;
-        u        = *tmpx >> DIGIT_BIT;
-        *tmpx++ &= MP_MASK;
-      }
-    }
-  }
-
-  /* at this point the n.used'th least
-   * significant digits of x are all zero
-   * which means we can shift x to the
-   * right by n.used digits and the
-   * residue is unchanged.
-   */
-
-  /* x = x/b**n.used */
-  tma_mp_clamp(x);
-  tma_mp_rshd (x, n->used);
-
-  /* if x >= n then x = x - n */
-  if (tma_mp_cmp_mag (x, n) != MP_LT) {
-    return s_tma_mp_sub (x, n, x);
-  }
-
-  return MP_OKAY;
-}
-#endif
-
-/* $Source$ */
-/* $Revision$ */
-/* $Date$ */
-
-/* End: bn_tma_mp_montgomery_reduce.c */
-
-/* Start: bn_tma_mp_montgomery_setup.c */
-#include "tma.h"
-#ifdef BN_MP_MONTGOMERY_SETUP_C
-/* LibTomMath, multiple-precision integer library -- Tom St Denis
- *
- * LibTomMath is a library that provides multiple-precision
- * integer arithmetic as well as number theoretic functionality.
- *
- * The library was designed directly after the MPI library by
- * Michael Fromberger but has been written from scratch with
- * additional optimizations in place.
- *
- * The library is free for all purposes without any express
- * guarantee it works.
- *
- * Tom St Denis, tomstdenis@gmail.com, http://libtom.org
- */
-
-/* setups the montgomery reduction stuff */
-int
-tma_mp_montgomery_setup (tma_mp_int * n, tma_mp_digit * rho)
-{
-  tma_mp_digit x, b;
-
-/* fast inversion mod 2**k
- *
- * Based on the fact that
- *
- * XA = 1 (mod 2**n)  =>  (X(2-XA)) A = 1 (mod 2**2n)
- *                    =>  2*X*A - X*X*A*A = 1
- *                    =>  2*(1) - (1)     = 1
- */
-  b = n->dp[0];
-
-  if ((b & 1) == 0) {
-    return MP_VAL;
-  }
-
-  x = (((b + 2) & 4) << 1) + b; /* here x*a==1 mod 2**4 */
-  x *= 2 - b * x;               /* here x*a==1 mod 2**8 */
-#if !defined(MP_8BIT)
-  x *= 2 - b * x;               /* here x*a==1 mod 2**16 */
-#endif
-#if defined(MP_64BIT) || !(defined(MP_8BIT) || defined(MP_16BIT))
-  x *= 2 - b * x;               /* here x*a==1 mod 2**32 */
-#endif
-#ifdef MP_64BIT
-  x *= 2 - b * x;               /* here x*a==1 mod 2**64 */
-#endif
-
-  /* rho = -1/m mod b */
-  *rho = (unsigned long)(((tma_mp_word)1 << ((tma_mp_word) DIGIT_BIT)) - x) & MP_MASK;
-
-  return MP_OKAY;
-}
-#endif
-
-/* $Source$ */
-/* $Revision$ */
-/* $Date$ */
-
-/* End: bn_tma_mp_montgomery_setup.c */
-
-/* Start: bn_tma_mp_mul.c */
-#include "tma.h"
-#ifdef BN_MP_MUL_C
-/* LibTomMath, multiple-precision integer library -- Tom St Denis
- *
- * LibTomMath is a library that provides multiple-precision
- * integer arithmetic as well as number theoretic functionality.
- *
- * The library was designed directly after the MPI library by
- * Michael Fromberger but has been written from scratch with
- * additional optimizations in place.
- *
- * The library is free for all purposes without any express
- * guarantee it works.
- *
- * Tom St Denis, tomstdenis@gmail.com, http://libtom.org
- */
-
-/* high level multiplication (handles sign) */
-int tma_mp_mul (tma_mp_int * a, tma_mp_int * b, tma_mp_int * c)
-{
-  int     res, neg;
-  neg = (a->sign == b->sign) ? MP_ZPOS : MP_NEG;
-
-  /* use Toom-Cook? */
-#ifdef BN_MP_TOOM_MUL_C
-  if (MIN (a->used, b->used) >= TOOM_MUL_CUTOFF) {
-    res = tma_mp_toom_mul(a, b, c);
-  } else
-#endif
-#ifdef BN_MP_KARATSUBA_MUL_C
-  /* use Karatsuba? */
-  if (MIN (a->used, b->used) >= KARATSUBA_MUL_CUTOFF) {
-    res = tma_mp_karatsuba_mul (a, b, c);
-  } else
-#endif
-  {
-    /* can we use the fast multiplier?
-     *
-     * The fast multiplier can be used if the output will
-     * have less than MP_WARRAY digits and the number of
-     * digits won't affect carry propagation
-     */
-    int     digs = a->used + b->used + 1;
-
-#ifdef BN_FAST_S_MP_MUL_DIGS_C
-    if ((digs < MP_WARRAY) &&
-        MIN(a->used, b->used) <=
-        (1 << ((CHAR_BIT * sizeof (tma_mp_word)) - (2 * DIGIT_BIT)))) {
-      res = fast_s_tma_mp_mul_digs (a, b, c, digs);
-    } else
-#endif
-#ifdef BN_S_MP_MUL_DIGS_C
-      res = s_tma_mp_mul (a, b, c); /* uses s_tma_mp_mul_digs */
-#else
-      res = MP_VAL;
-#endif
-
-  }
-  c->sign = (c->used > 0) ? neg : MP_ZPOS;
-  return res;
-}
-#endif
-
-/* $Source$ */
-/* $Revision$ */
-/* $Date$ */
-
-/* End: bn_tma_mp_mul.c */
-
-/* Start: bn_tma_mp_mul_2.c */
-#include "tma.h"
-#ifdef BN_MP_MUL_2_C
-/* LibTomMath, multiple-precision integer library -- Tom St Denis
- *
- * LibTomMath is a library that provides multiple-precision
- * integer arithmetic as well as number theoretic functionality.
- *
- * The library was designed directly after the MPI library by
- * Michael Fromberger but has been written from scratch with
- * additional optimizations in place.
- *
- * The library is free for all purposes without any express
- * guarantee it works.
- *
- * Tom St Denis, tomstdenis@gmail.com, http://libtom.org
- */
-
-/* b = a*2 */
-int tma_mp_mul_2(tma_mp_int * a, tma_mp_int * b)
-{
-  int     x, res, oldused;
-
-  /* grow to accomodate result */
-  if (b->alloc < a->used + 1) {
-    if ((res = tma_mp_grow (b, a->used + 1)) != MP_OKAY) {
-      return res;
-    }
-  }
-
-  oldused = b->used;
-  b->used = a->used;
-
-  {
-    register tma_mp_digit r, rr, *tmpa, *tmpb;
-
-    /* alias for source */
-    tmpa = a->dp;
-
-    /* alias for dest */
-    tmpb = b->dp;
-
-    /* carry */
-    r = 0;
-    for (x = 0; x < a->used; x++) {
-
-      /* get what will be the *next* carry bit from the
-       * MSB of the current digit
-       */
-      rr = *tmpa >> ((tma_mp_digit)(DIGIT_BIT - 1));
-
-      /* now shift up this digit, add in the carry [from the previous] */
-      *tmpb++ = ((*tmpa++ << ((tma_mp_digit)1)) | r) & MP_MASK;
-
-      /* copy the carry that would be from the source
-       * digit into the next iteration
-       */
-      r = rr;
-    }
-
-    /* new leading digit? */
-    if (r != 0) {
-      /* add a MSB which is always 1 at this point */
-      *tmpb = 1;
-      ++(b->used);
-    }
-
-    /* now zero any excess digits on the destination
-     * that we didn't write to
-     */
-    tmpb = b->dp + b->used;
-    for (x = b->used; x < oldused; x++) {
-      *tmpb++ = 0;
-    }
-  }
-  b->sign = a->sign;
-  return MP_OKAY;
-}
-#endif
-
-/* $Source$ */
-/* $Revision$ */
-/* $Date$ */
-
-/* End: bn_tma_mp_mul_2.c */
-
-/* Start: bn_tma_mp_mul_2d.c */
-#include "tma.h"
-#ifdef BN_MP_MUL_2D_C
-/* LibTomMath, multiple-precision integer library -- Tom St Denis
- *
- * LibTomMath is a library that provides multiple-precision
- * integer arithmetic as well as number theoretic functionality.
- *
- * The library was designed directly after the MPI library by
- * Michael Fromberger but has been written from scratch with
- * additional optimizations in place.
- *
- * The library is free for all purposes without any express
- * guarantee it works.
- *
- * Tom St Denis, tomstdenis@gmail.com, http://libtom.org
- */
-
-/* shift left by a certain bit count */
-int tma_mp_mul_2d (tma_mp_int * a, int b, tma_mp_int * c)
-{
-  tma_mp_digit d;
-  int      res;
-
-  /* copy */
-  if (a != c) {
-     if ((res = tma_mp_copy (a, c)) != MP_OKAY) {
-       return res;
-     }
-  }
-
-  if (c->alloc < (int)(c->used + b/DIGIT_BIT + 1)) {
-     if ((res = tma_mp_grow (c, c->used + b / DIGIT_BIT + 1)) != MP_OKAY) {
-       return res;
-     }
-  }
-
-  /* shift by as many digits in the bit count */
-  if (b >= (int)DIGIT_BIT) {
-    if ((res = tma_mp_lshd (c, b / DIGIT_BIT)) != MP_OKAY) {
-      return res;
-    }
-  }
-
-  /* shift any bit count < DIGIT_BIT */
-  d = (tma_mp_digit) (b % DIGIT_BIT);
-  if (d != 0) {
-    register tma_mp_digit *tmpc, shift, mask, r, rr;
-    register int x;
-
-    /* bitmask for carries */
-    mask = (((tma_mp_digit)1) << d) - 1;
-
-    /* shift for msbs */
-    shift = DIGIT_BIT - d;
-
-    /* alias */
-    tmpc = c->dp;
-
-    /* carry */
-    r    = 0;
-    for (x = 0; x < c->used; x++) {
-      /* get the higher bits of the current word */
-      rr = (*tmpc >> shift) & mask;
-
-      /* shift the current word and OR in the carry */
-      *tmpc = ((*tmpc << d) | r) & MP_MASK;
-      ++tmpc;
-
-      /* set the carry to the carry bits of the current word */
-      r = rr;
-    }
-
-    /* set final carry */
-    if (r != 0) {
-       c->dp[(c->used)++] = r;
-    }
-  }
-  tma_mp_clamp (c);
-  return MP_OKAY;
-}
-#endif
-
-/* $Source$ */
-/* $Revision$ */
-/* $Date$ */
-
-/* End: bn_tma_mp_mul_2d.c */
-
-/* Start: bn_tma_mp_mul_d.c */
-#include "tma.h"
-#ifdef BN_MP_MUL_D_C
-/* LibTomMath, multiple-precision integer library -- Tom St Denis
- *
- * LibTomMath is a library that provides multiple-precision
- * integer arithmetic as well as number theoretic functionality.
- *
- * The library was designed directly after the MPI library by
- * Michael Fromberger but has been written from scratch with
- * additional optimizations in place.
- *
- * The library is free for all purposes without any express
- * guarantee it works.
- *
- * Tom St Denis, tomstdenis@gmail.com, http://libtom.org
- */
-
-/* multiply by a digit */
-int
-tma_mp_mul_d (tma_mp_int * a, tma_mp_digit b, tma_mp_int * c)
-{
-  tma_mp_digit u, *tmpa, *tmpc;
-  tma_mp_word  r;
-  int      ix, res, olduse;
-
-  /* make sure c is big enough to hold a*b */
-  if (c->alloc < a->used + 1) {
-    if ((res = tma_mp_grow (c, a->used + 1)) != MP_OKAY) {
-      return res;
-    }
-  }
-
-  /* get the original destinations used count */
-  olduse = c->used;
-
-  /* set the sign */
-  c->sign = a->sign;
-
-  /* alias for a->dp [source] */
-  tmpa = a->dp;
-
-  /* alias for c->dp [dest] */
-  tmpc = c->dp;
-
-  /* zero carry */
-  u = 0;
-
-  /* compute columns */
-  for (ix = 0; ix < a->used; ix++) {
-    /* compute product and carry sum for this term */
-    r       = ((tma_mp_word) u) + ((tma_mp_word)*tmpa++) * ((tma_mp_word)b);
-
-    /* mask off higher bits to get a single digit */
-    *tmpc++ = (tma_mp_digit) (r & ((tma_mp_word) MP_MASK));
-
-    /* send carry into next iteration */
-    u       = (tma_mp_digit) (r >> ((tma_mp_word) DIGIT_BIT));
-  }
-
-  /* store final carry [if any] and increment ix offset  */
-  *tmpc++ = u;
-  ++ix;
-
-  /* now zero digits above the top */
-  while (ix++ < olduse) {
-     *tmpc++ = 0;
-  }
-
-  /* set used count */
-  c->used = a->used + 1;
-  tma_mp_clamp(c);
-
-  return MP_OKAY;
-}
-#endif
-
-/* $Source$ */
-/* $Revision$ */
-/* $Date$ */
-
-/* End: bn_tma_mp_mul_d.c */
-
-/* Start: bn_tma_mp_mulmod.c */
-#include "tma.h"
-#ifdef BN_MP_MULMOD_C
-/* LibTomMath, multiple-precision integer library -- Tom St Denis
- *
- * LibTomMath is a library that provides multiple-precision
- * integer arithmetic as well as number theoretic functionality.
- *
- * The library was designed directly after the MPI library by
- * Michael Fromberger but has been written from scratch with
- * additional optimizations in place.
- *
- * The library is free for all purposes without any express
- * guarantee it works.
- *
- * Tom St Denis, tomstdenis@gmail.com, http://libtom.org
- */
-
-/* d = a * b (mod c) */
-int tma_mp_mulmod (tma_mp_int * a, tma_mp_int * b, tma_mp_int * c, tma_mp_int * d)
-{
-  int     res;
-  tma_mp_int  t;
-
-  if ((res = tma_mp_init (&t)) != MP_OKAY) {
-    return res;
-  }
-
-  if ((res = tma_mp_mul (a, b, &t)) != MP_OKAY) {
-    tma_mp_clear (&t);
-    return res;
-  }
-  res = tma_mp_mod (&t, c, d);
-  tma_mp_clear (&t);
-  return res;
-}
-#endif
-
-/* $Source$ */
-/* $Revision$ */
-/* $Date$ */
-
-/* End: bn_tma_mp_mulmod.c */
-
-/* Start: bn_tma_mp_n_root.c */
-#include "tma.h"
-#ifdef BN_MP_N_ROOT_C
-/* LibTomMath, multiple-precision integer library -- Tom St Denis
- *
- * LibTomMath is a library that provides multiple-precision
- * integer arithmetic as well as number theoretic functionality.
- *
- * The library was designed directly after the MPI library by
- * Michael Fromberger but has been written from scratch with
- * additional optimizations in place.
- *
- * The library is free for all purposes without any express
- * guarantee it works.
- *
- * Tom St Denis, tomstdenis@gmail.com, http://libtom.org
- */
-
-/* find the n'th root of an integer
- *
- * Result found such that (c)**b <= a and (c+1)**b > a
- *
- * This algorithm uses Newton's approximation
- * x[i+1] = x[i] - f(x[i])/f'(x[i])
- * which will find the root in log(N) time where
- * each step involves a fair bit.  This is not meant to
- * find huge roots [square and cube, etc].
- */
-int tma_mp_n_root (tma_mp_int * a, tma_mp_digit b, tma_mp_int * c)
-{
-  tma_mp_int  t1, t2, t3;
-  int     res, neg;
-
-  /* input must be positive if b is even */
-  if ((b & 1) == 0 && a->sign == MP_NEG) {
-    return MP_VAL;
-  }
-
-  if ((res = tma_mp_init (&t1)) != MP_OKAY) {
-    return res;
-  }
-
-  if ((res = tma_mp_init (&t2)) != MP_OKAY) {
-    goto LBL_T1;
-  }
-
-  if ((res = tma_mp_init (&t3)) != MP_OKAY) {
-    goto LBL_T2;
-  }
-
-  /* if a is negative fudge the sign but keep track */
-  neg     = a->sign;
-  a->sign = MP_ZPOS;
-
-  /* t2 = 2 */
-  tma_mp_set (&t2, 2);
-
-  do {
-    /* t1 = t2 */
-    if ((res = tma_mp_copy (&t2, &t1)) != MP_OKAY) {
-      goto LBL_T3;
-    }
-
-    /* t2 = t1 - ((t1**b - a) / (b * t1**(b-1))) */
-
-    /* t3 = t1**(b-1) */
-    if ((res = tma_mp_expt_d (&t1, b - 1, &t3)) != MP_OKAY) {
-      goto LBL_T3;
-    }
-
-    /* numerator */
-    /* t2 = t1**b */
-    if ((res = tma_mp_mul (&t3, &t1, &t2)) != MP_OKAY) {
-      goto LBL_T3;
-    }
-
-    /* t2 = t1**b - a */
-    if ((res = tma_mp_sub (&t2, a, &t2)) != MP_OKAY) {
-      goto LBL_T3;
-    }
-
-    /* denominator */
-    /* t3 = t1**(b-1) * b  */
-    if ((res = tma_mp_mul_d (&t3, b, &t3)) != MP_OKAY) {
-      goto LBL_T3;
-    }
-
-    /* t3 = (t1**b - a)/(b * t1**(b-1)) */
-    if ((res = tma_mp_div (&t2, &t3, &t3, NULL)) != MP_OKAY) {
-      goto LBL_T3;
-    }
-
-    if ((res = tma_mp_sub (&t1, &t3, &t2)) != MP_OKAY) {
-      goto LBL_T3;
-    }
-  }  while (tma_mp_cmp (&t1, &t2) != MP_EQ);
-
-  /* result can be off by a few so check */
-  for (;;) {
-    if ((res = tma_mp_expt_d (&t1, b, &t2)) != MP_OKAY) {
-      goto LBL_T3;
-    }
-
-    if (tma_mp_cmp (&t2, a) == MP_GT) {
-      if ((res = tma_mp_sub_d (&t1, 1, &t1)) != MP_OKAY) {
-         goto LBL_T3;
-      }
-    } else {
-      break;
-    }
-  }
-
-  /* reset the sign of a first */
-  a->sign = neg;
-
-  /* set the result */
-  tma_mp_exch (&t1, c);
-
-  /* set the sign of the result */
-  c->sign = neg;
-
-  res = MP_OKAY;
-
-LBL_T3:tma_mp_clear (&t3);
-LBL_T2:tma_mp_clear (&t2);
-LBL_T1:tma_mp_clear (&t1);
-  return res;
-}
-#endif
-
-/* $Source$ */
-/* $Revision$ */
-/* $Date$ */
-
-/* End: bn_tma_mp_n_root.c */
-
-/* Start: bn_tma_mp_neg.c */
-#include "tma.h"
-#ifdef BN_MP_NEG_C
-/* LibTomMath, multiple-precision integer library -- Tom St Denis
- *
- * LibTomMath is a library that provides multiple-precision
- * integer arithmetic as well as number theoretic functionality.
- *
- * The library was designed directly after the MPI library by
- * Michael Fromberger but has been written from scratch with
- * additional optimizations in place.
- *
- * The library is free for all purposes without any express
- * guarantee it works.
- *
- * Tom St Denis, tomstdenis@gmail.com, http://libtom.org
- */
-
-/* b = -a */
-int tma_mp_neg (tma_mp_int * a, tma_mp_int * b)
-{
-  int     res;
-  if (a != b) {
-     if ((res = tma_mp_copy (a, b)) != MP_OKAY) {
-        return res;
-     }
-  }
-
-  if (tma_mp_iszero(b) != MP_YES) {
-     b->sign = (a->sign == MP_ZPOS) ? MP_NEG : MP_ZPOS;
-  } else {
-     b->sign = MP_ZPOS;
-  }
-
-  return MP_OKAY;
-}
-#endif
-
-/* $Source$ */
-/* $Revision$ */
-/* $Date$ */
-
-/* End: bn_tma_mp_neg.c */
-
-/* Start: bn_tma_mp_or.c */
-#include "tma.h"
-#ifdef BN_MP_OR_C
-/* LibTomMath, multiple-precision integer library -- Tom St Denis
- *
- * LibTomMath is a library that provides multiple-precision
- * integer arithmetic as well as number theoretic functionality.
- *
- * The library was designed directly after the MPI library by
- * Michael Fromberger but has been written from scratch with
- * additional optimizations in place.
- *
- * The library is free for all purposes without any express
- * guarantee it works.
- *
- * Tom St Denis, tomstdenis@gmail.com, http://libtom.org
- */
-
-/* OR two ints together */
-int tma_mp_or (tma_mp_int * a, tma_mp_int * b, tma_mp_int * c)
-{
-  int     res, ix, px;
-  tma_mp_int  t, *x;
-
-  if (a->used > b->used) {
-    if ((res = tma_mp_init_copy (&t, a)) != MP_OKAY) {
-      return res;
-    }
-    px = b->used;
-    x = b;
-  } else {
-    if ((res = tma_mp_init_copy (&t, b)) != MP_OKAY) {
-      return res;
-    }
-    px = a->used;
-    x = a;
-  }
-
-  for (ix = 0; ix < px; ix++) {
-    t.dp[ix] |= x->dp[ix];
-  }
-  tma_mp_clamp (&t);
-  tma_mp_exch (c, &t);
-  tma_mp_clear (&t);
-  return MP_OKAY;
-}
-#endif
-
-/* $Source$ */
-/* $Revision$ */
-/* $Date$ */
-
-/* End: bn_tma_mp_or.c */
-
-/* Start: bn_tma_mp_prime_fermat.c */
-#include "tma.h"
-#ifdef BN_MP_PRIME_FERMAT_C
-/* LibTomMath, multiple-precision integer library -- Tom St Denis
- *
- * LibTomMath is a library that provides multiple-precision
- * integer arithmetic as well as number theoretic functionality.
- *
- * The library was designed directly after the MPI library by
- * Michael Fromberger but has been written from scratch with
- * additional optimizations in place.
- *
- * The library is free for all purposes without any express
- * guarantee it works.
- *
- * Tom St Denis, tomstdenis@gmail.com, http://libtom.org
- */
-
-/* performs one Fermat test.
- *
- * If "a" were prime then b**a == b (mod a) since the order of
- * the multiplicative sub-group would be phi(a) = a-1.  That means
- * it would be the same as b**(a mod (a-1)) == b**1 == b (mod a).
- *
- * Sets result to 1 if the congruence holds, or zero otherwise.
- */
-int tma_mp_prime_fermat (tma_mp_int * a, tma_mp_int * b, int *result)
-{
-  tma_mp_int  t;
-  int     err;
-
-  /* default to composite  */
-  *result = MP_NO;
-
-  /* ensure b > 1 */
-  if (tma_mp_cmp_d(b, 1) != MP_GT) {
-     return MP_VAL;
-  }
-
-  /* init t */
-  if ((err = tma_mp_init (&t)) != MP_OKAY) {
-    return err;
-  }
-
-  /* compute t = b**a mod a */
-  if ((err = tma_mp_exptmod (b, a, a, &t)) != MP_OKAY) {
-    goto LBL_T;
-  }
-
-  /* is it equal to b? */
-  if (tma_mp_cmp (&t, b) == MP_EQ) {
-    *result = MP_YES;
-  }
-
-  err = MP_OKAY;
-LBL_T:tma_mp_clear (&t);
-  return err;
-}
-#endif
-
-/* $Source$ */
-/* $Revision$ */
-/* $Date$ */
-
-/* End: bn_tma_mp_prime_fermat.c */
-
-/* Start: bn_tma_mp_prime_is_divisible.c */
-#include "tma.h"
-#ifdef BN_MP_PRIME_IS_DIVISIBLE_C
-/* LibTomMath, multiple-precision integer library -- Tom St Denis
- *
- * LibTomMath is a library that provides multiple-precision
- * integer arithmetic as well as number theoretic functionality.
- *
- * The library was designed directly after the MPI library by
- * Michael Fromberger but has been written from scratch with
- * additional optimizations in place.
- *
- * The library is free for all purposes without any express
- * guarantee it works.
- *
- * Tom St Denis, tomstdenis@gmail.com, http://libtom.org
- */
-
-/* determines if an integers is divisible by one
- * of the first PRIME_SIZE primes or not
- *
- * sets result to 0 if not, 1 if yes
- */
-int tma_mp_prime_is_divisible (tma_mp_int * a, int *result)
-{
-  int     err, ix;
-  tma_mp_digit res;
-
-  /* default to not */
-  *result = MP_NO;
-
-  for (ix = 0; ix < PRIME_SIZE; ix++) {
-    /* what is a mod LBL_prime_tab[ix] */
-    if ((err = tma_mp_mod_d (a, ltm_prime_tab[ix], &res)) != MP_OKAY) {
-      return err;
-    }
-
-    /* is the residue zero? */
-    if (res == 0) {
-      *result = MP_YES;
-      return MP_OKAY;
-    }
-  }
-
-  return MP_OKAY;
-}
-#endif
-
-/* $Source$ */
-/* $Revision$ */
-/* $Date$ */
-
-/* End: bn_tma_mp_prime_is_divisible.c */
-
-/* Start: bn_tma_mp_prime_is_prime.c */
-#include "tma.h"
-#ifdef BN_MP_PRIME_IS_PRIME_C
-/* LibTomMath, multiple-precision integer library -- Tom St Denis
- *
- * LibTomMath is a library that provides multiple-precision
- * integer arithmetic as well as number theoretic functionality.
- *
- * The library was designed directly after the MPI library by
- * Michael Fromberger but has been written from scratch with
- * additional optimizations in place.
- *
- * The library is free for all purposes without any express
- * guarantee it works.
- *
- * Tom St Denis, tomstdenis@gmail.com, http://libtom.org
- */
-
-/* performs a variable number of rounds of Miller-Rabin
- *
- * Probability of error after t rounds is no more than
-
- *
- * Sets result to 1 if probably prime, 0 otherwise
- */
-int tma_mp_prime_is_prime (tma_mp_int * a, int t, int *result)
-{
-  tma_mp_int  b;
-  int     ix, err, res;
-
-  /* default to no */
-  *result = MP_NO;
-
-  /* valid value of t? */
-  if (t <= 0 || t > PRIME_SIZE) {
-    return MP_VAL;
-  }
-
-  /* is the input equal to one of the primes in the table? */
-  for (ix = 0; ix < PRIME_SIZE; ix++) {
-      if (tma_mp_cmp_d(a, ltm_prime_tab[ix]) == MP_EQ) {
-         *result = 1;
-         return MP_OKAY;
-      }
-  }
-
-  /* first perform trial division */
-  if ((err = tma_mp_prime_is_divisible (a, &res)) != MP_OKAY) {
-    return err;
-  }
-
-  /* return if it was trivially divisible */
-  if (res == MP_YES) {
-    return MP_OKAY;
-  }
-
-  /* now perform the miller-rabin rounds */
-  if ((err = tma_mp_init (&b)) != MP_OKAY) {
-    return err;
-  }
-
-  for (ix = 0; ix < t; ix++) {
-    /* set the prime */
-    tma_mp_set (&b, ltm_prime_tab[ix]);
-
-    if ((err = tma_mp_prime_miller_rabin (a, &b, &res)) != MP_OKAY) {
-      goto LBL_B;
-    }
-
-    if (res == MP_NO) {
-      goto LBL_B;
-    }
-  }
-
-  /* passed the test */
-  *result = MP_YES;
-LBL_B:tma_mp_clear (&b);
-  return err;
-}
-#endif
-
-/* $Source$ */
-/* $Revision$ */
-/* $Date$ */
-
-/* End: bn_tma_mp_prime_is_prime.c */
-
-/* Start: bn_tma_mp_prime_miller_rabin.c */
-#include "tma.h"
-#ifdef BN_MP_PRIME_MILLER_RABIN_C
-/* LibTomMath, multiple-precision integer library -- Tom St Denis
- *
- * LibTomMath is a library that provides multiple-precision
- * integer arithmetic as well as number theoretic functionality.
- *
- * The library was designed directly after the MPI library by
- * Michael Fromberger but has been written from scratch with
- * additional optimizations in place.
- *
- * The library is free for all purposes without any express
- * guarantee it works.
- *
- * Tom St Denis, tomstdenis@gmail.com, http://libtom.org
- */
-
-/* Miller-Rabin test of "a" to the base of "b" as described in
- * HAC pp. 139 Algorithm 4.24
- *
- * Sets result to 0 if definitely composite or 1 if probably prime.
- * Randomly the chance of error is no more than 1/4 and often
- * very much lower.
- */
-int tma_mp_prime_miller_rabin (tma_mp_int * a, tma_mp_int * b, int *result)
-{
-  tma_mp_int  n1, y, r;
-  int     s, j, err;
-
-  /* default */
-  *result = MP_NO;
-
-  /* ensure b > 1 */
-  if (tma_mp_cmp_d(b, 1) != MP_GT) {
-     return MP_VAL;
-  }
-
-  /* get n1 = a - 1 */
-  if ((err = tma_mp_init_copy (&n1, a)) != MP_OKAY) {
-    return err;
-  }
-  if ((err = tma_mp_sub_d (&n1, 1, &n1)) != MP_OKAY) {
-    goto LBL_N1;
-  }
-
-  /* set 2**s * r = n1 */
-  if ((err = tma_mp_init_copy (&r, &n1)) != MP_OKAY) {
-    goto LBL_N1;
-  }
-
-  /* count the number of least significant bits
-   * which are zero
-   */
-  s = tma_mp_cnt_lsb(&r);
-
-  /* now divide n - 1 by 2**s */
-  if ((err = tma_mp_div_2d (&r, s, &r, NULL)) != MP_OKAY) {
-    goto LBL_R;
-  }
-
-  /* compute y = b**r mod a */
-  if ((err = tma_mp_init (&y)) != MP_OKAY) {
-    goto LBL_R;
-  }
-  if ((err = tma_mp_exptmod (b, &r, a, &y)) != MP_OKAY) {
-    goto LBL_Y;
-  }
-
-  /* if y != 1 and y != n1 do */
-  if (tma_mp_cmp_d (&y, 1) != MP_EQ && tma_mp_cmp (&y, &n1) != MP_EQ) {
-    j = 1;
-    /* while j <= s-1 and y != n1 */
-    while ((j <= (s - 1)) && tma_mp_cmp (&y, &n1) != MP_EQ) {
-      if ((err = tma_mp_sqrmod (&y, a, &y)) != MP_OKAY) {
-         goto LBL_Y;
-      }
-
-      /* if y == 1 then composite */
-      if (tma_mp_cmp_d (&y, 1) == MP_EQ) {
-         goto LBL_Y;
-      }
-
-      ++j;
-    }
-
-    /* if y != n1 then composite */
-    if (tma_mp_cmp (&y, &n1) != MP_EQ) {
-      goto LBL_Y;
-    }
-  }
-
-  /* probably prime now */
-  *result = MP_YES;
-LBL_Y:tma_mp_clear (&y);
-LBL_R:tma_mp_clear (&r);
-LBL_N1:tma_mp_clear (&n1);
-  return err;
-}
-#endif
-
-/* $Source$ */
-/* $Revision$ */
-/* $Date$ */
-
-/* End: bn_tma_mp_prime_miller_rabin.c */
-
-/* Start: bn_tma_mp_prime_next_prime.c */
-#include "tma.h"
-#ifdef BN_MP_PRIME_NEXT_PRIME_C
-/* LibTomMath, multiple-precision integer library -- Tom St Denis
- *
- * LibTomMath is a library that provides multiple-precision
- * integer arithmetic as well as number theoretic functionality.
- *
- * The library was designed directly after the MPI library by
- * Michael Fromberger but has been written from scratch with
- * additional optimizations in place.
- *
- * The library is free for all purposes without any express
- * guarantee it works.
- *
- * Tom St Denis, tomstdenis@gmail.com, http://libtom.org
- */
-
-/* finds the next prime after the number "a" using "t" trials
- * of Miller-Rabin.
- *
- * bbs_style = 1 means the prime must be congruent to 3 mod 4
- */
-int tma_mp_prime_next_prime(tma_mp_int *a, int t, int bbs_style)
-{
-   int      err, res, x, y;
-   tma_mp_digit res_tab[PRIME_SIZE], step, kstep;
-   tma_mp_int   b;
-
-   /* ensure t is valid */
-   if (t <= 0 || t > PRIME_SIZE) {
-      return MP_VAL;
-   }
-
-   /* force positive */
-   a->sign = MP_ZPOS;
-
-   /* simple algo if a is less than the largest prime in the table */
-   if (tma_mp_cmp_d(a, ltm_prime_tab[PRIME_SIZE-1]) == MP_LT) {
-      /* find which prime it is bigger than */
-      for (x = PRIME_SIZE - 2; x >= 0; x--) {
-          if (tma_mp_cmp_d(a, ltm_prime_tab[x]) != MP_LT) {
-             if (bbs_style == 1) {
-                /* ok we found a prime smaller or
-                 * equal [so the next is larger]
-                 *
-                 * however, the prime must be
-                 * congruent to 3 mod 4
-                 */
-                if ((ltm_prime_tab[x + 1] & 3) != 3) {
-                   /* scan upwards for a prime congruent to 3 mod 4 */
-                   for (y = x + 1; y < PRIME_SIZE; y++) {
-                       if ((ltm_prime_tab[y] & 3) == 3) {
-                          tma_mp_set(a, ltm_prime_tab[y]);
-                          return MP_OKAY;
-                       }
-                   }
-                }
-             } else {
-                tma_mp_set(a, ltm_prime_tab[x + 1]);
-                return MP_OKAY;
-             }
-          }
-      }
-      /* at this point a maybe 1 */
-      if (tma_mp_cmp_d(a, 1) == MP_EQ) {
-         tma_mp_set(a, 2);
-         return MP_OKAY;
-      }
-      /* fall through to the sieve */
-   }
-
-   /* generate a prime congruent to 3 mod 4 or 1/3 mod 4? */
-   if (bbs_style == 1) {
-      kstep   = 4;
-   } else {
-      kstep   = 2;
-   }
-
-   /* at this point we will use a combination of a sieve and Miller-Rabin */
-
-   if (bbs_style == 1) {
-      /* if a mod 4 != 3 subtract the correct value to make it so */
-      if ((a->dp[0] & 3) != 3) {
-         if ((err = tma_mp_sub_d(a, (a->dp[0] & 3) + 1, a)) != MP_OKAY) { return err; };
-      }
-   } else {
-      if (tma_mp_iseven(a) == 1) {
-         /* force odd */
-         if ((err = tma_mp_sub_d(a, 1, a)) != MP_OKAY) {
-            return err;
-         }
-      }
-   }
-
-   /* generate the restable */
-   for (x = 1; x < PRIME_SIZE; x++) {
-      if ((err = tma_mp_mod_d(a, ltm_prime_tab[x], res_tab + x)) != MP_OKAY) {
-         return err;
-      }
-   }
-
-   /* init temp used for Miller-Rabin Testing */
-   if ((err = tma_mp_init(&b)) != MP_OKAY) {
-      return err;
-   }
-
-   for (;;) {
-      /* skip to the next non-trivially divisible candidate */
-      step = 0;
-      do {
-         /* y == 1 if any residue was zero [e.g. cannot be prime] */
-         y     =  0;
-
-         /* increase step to next candidate */
-         step += kstep;
-
-         /* compute the new residue without using division */
-         for (x = 1; x < PRIME_SIZE; x++) {
-             /* add the step to each residue */
-             res_tab[x] += kstep;
-
-             /* subtract the modulus [instead of using division] */
-             if (res_tab[x] >= ltm_prime_tab[x]) {
-                res_tab[x]  -= ltm_prime_tab[x];
-             }
-
-             /* set flag if zero */
-             if (res_tab[x] == 0) {
-                y = 1;
-             }
-         }
-      } while (y == 1 && step < ((((tma_mp_digit)1)<<DIGIT_BIT) - kstep));
-
-      /* add the step */
-      if ((err = tma_mp_add_d(a, step, a)) != MP_OKAY) {
-         goto LBL_ERR;
-      }
-
-      /* if didn't pass sieve and step == MAX then skip test */
-      if (y == 1 && step >= ((((tma_mp_digit)1)<<DIGIT_BIT) - kstep)) {
-         continue;
-      }
-
-      /* is this prime? */
-      for (x = 0; x < t; x++) {
-          tma_mp_set(&b, ltm_prime_tab[t]);
-          if ((err = tma_mp_prime_miller_rabin(a, &b, &res)) != MP_OKAY) {
-             goto LBL_ERR;
-          }
-          if (res == MP_NO) {
-             break;
-          }
-      }
-
-      if (res == MP_YES) {
-         break;
-      }
-   }
-
-   err = MP_OKAY;
-LBL_ERR:
-   tma_mp_clear(&b);
-   return err;
-}
-
-#endif
-
-/* $Source$ */
-/* $Revision$ */
-/* $Date$ */
-
-/* End: bn_tma_mp_prime_next_prime.c */
-
-/* Start: bn_tma_mp_prime_rabin_miller_trials.c */
-#include "tma.h"
-#ifdef BN_MP_PRIME_RABIN_MILLER_TRIALS_C
-/* LibTomMath, multiple-precision integer library -- Tom St Denis
- *
- * LibTomMath is a library that provides multiple-precision
- * integer arithmetic as well as number theoretic functionality.
- *
- * The library was designed directly after the MPI library by
- * Michael Fromberger but has been written from scratch with
- * additional optimizations in place.
- *
- * The library is free for all purposes without any express
- * guarantee it works.
- *
- * Tom St Denis, tomstdenis@gmail.com, http://libtom.org
- */
-
-
-static const struct {
-   int k, t;
-} sizes[] = {
-{   128,    28 },
-{   256,    16 },
-{   384,    10 },
-{   512,     7 },
-{   640,     6 },
-{   768,     5 },
-{   896,     4 },
-{  1024,     4 }
-};
-
-/* returns # of RM trials required for a given bit size */
-int tma_mp_prime_rabin_miller_trials(int size)
-{
-   int x;
-
-   for (x = 0; x < (int)(sizeof(sizes)/(sizeof(sizes[0]))); x++) {
-       if (sizes[x].k == size) {
-          return sizes[x].t;
-       } else if (sizes[x].k > size) {
-          return (x == 0) ? sizes[0].t : sizes[x - 1].t;
-       }
-   }
-   return sizes[x-1].t + 1;
-}
-
-
-#endif
-
-/* $Source$ */
-/* $Revision$ */
-/* $Date$ */
-
-/* End: bn_tma_mp_prime_rabin_miller_trials.c */
-
-/* Start: bn_tma_mp_prime_random_ex.c */
-#include "tma.h"
-#ifdef BN_MP_PRIME_RANDOM_EX_C
-/* LibTomMath, multiple-precision integer library -- Tom St Denis
- *
- * LibTomMath is a library that provides multiple-precision
- * integer arithmetic as well as number theoretic functionality.
- *
- * The library was designed directly after the MPI library by
- * Michael Fromberger but has been written from scratch with
- * additional optimizations in place.
- *
- * The library is free for all purposes without any express
- * guarantee it works.
- *
- * Tom St Denis, tomstdenis@gmail.com, http://libtom.org
- */
-
-/* makes a truly random prime of a given size (bits),
- *
- * Flags are as follows:
- *
- *   LTM_PRIME_BBS      - make prime congruent to 3 mod 4
- *   LTM_PRIME_SAFE     - make sure (p-1)/2 is prime as well (implies LTM_PRIME_BBS)
- *   LTM_PRIME_2MSB_OFF - make the 2nd highest bit zero
- *   LTM_PRIME_2MSB_ON  - make the 2nd highest bit one
- *
- * You have to supply a callback which fills in a buffer with random bytes.  "dat" is a parameter you can
- * have passed to the callback (e.g. a state or something).  This function doesn't use "dat" itself
- * so it can be NULL
- *
- */
-
-/* This is possibly the mother of all prime generation functions, muahahahahaha! */
-int tma_mp_prime_random_ex(tma_mp_int *a, int t, int size, int flags, ltm_prime_callback cb, void *dat)
-{
-   unsigned char *tmp, maskAND, maskOR_msb, maskOR_lsb;
-   int res, err, bsize, maskOR_msb_offset;
-
-   /* sanity check the input */
-   if (size <= 1 || t <= 0) {
-      return MP_VAL;
-   }
-
-   /* LTM_PRIME_SAFE implies LTM_PRIME_BBS */
-   if (flags & LTM_PRIME_SAFE) {
-      flags |= LTM_PRIME_BBS;
-   }
-
-   /* calc the byte size */
-   bsize = (size>>3) + ((size&7)?1:0);
-
-   /* we need a buffer of bsize bytes */
-   tmp = OPT_CAST(unsigned char) XMALLOC(bsize);
-   if (tmp == NULL) {
-      return MP_MEM;
-   }
-
-   /* calc the maskAND value for the MSbyte*/
-   maskAND = ((size&7) == 0) ? 0xFF : (0xFF >> (8 - (size & 7)));
-
-   /* calc the maskOR_msb */
-   maskOR_msb        = 0;
-   maskOR_msb_offset = ((size & 7) == 1) ? 1 : 0;
-   if (flags & LTM_PRIME_2MSB_ON) {
-      maskOR_msb       |= 0x80 >> ((9 - size) & 7);
-   }
-
-   /* get the maskOR_lsb */
-   maskOR_lsb         = 1;
-   if (flags & LTM_PRIME_BBS) {
-      maskOR_lsb     |= 3;
-   }
-
-   do {
-      /* read the bytes */
-      if (cb(tmp, bsize, dat) != bsize) {
-         err = MP_VAL;
-         goto error;
-      }
-
-      /* work over the MSbyte */
-      tmp[0]    &= maskAND;
-      tmp[0]    |= 1 << ((size - 1) & 7);
-
-      /* mix in the maskORs */
-      tmp[maskOR_msb_offset]   |= maskOR_msb;
-      tmp[bsize-1]             |= maskOR_lsb;
-
-      /* read it in */
-      if ((err = tma_mp_read_unsigned_bin(a, tmp, bsize)) != MP_OKAY)     { goto error; }
-
-      /* is it prime? */
-      if ((err = tma_mp_prime_is_prime(a, t, &res)) != MP_OKAY)           { goto error; }
-      if (res == MP_NO) {
-         continue;
-      }
-
-      if (flags & LTM_PRIME_SAFE) {
-         /* see if (a-1)/2 is prime */
-         if ((err = tma_mp_sub_d(a, 1, a)) != MP_OKAY)                    { goto error; }
-         if ((err = tma_mp_div_2(a, a)) != MP_OKAY)                       { goto error; }
-
-         /* is it prime? */
-         if ((err = tma_mp_prime_is_prime(a, t, &res)) != MP_OKAY)        { goto error; }
-      }
-   } while (res == MP_NO);
-
-   if (flags & LTM_PRIME_SAFE) {
-      /* restore a to the original value */
-      if ((err = tma_mp_mul_2(a, a)) != MP_OKAY)                          { goto error; }
-      if ((err = tma_mp_add_d(a, 1, a)) != MP_OKAY)                       { goto error; }
-   }
-
-   err = MP_OKAY;
-error:
-   XFREE(tmp);
-   return err;
-}
-
-
-#endif
-
-/* $Source$ */
-/* $Revision$ */
-/* $Date$ */
-
-/* End: bn_tma_mp_prime_random_ex.c */
-
-/* Start: bn_tma_mp_radix_size.c */
-#include "tma.h"
-#ifdef BN_MP_RADIX_SIZE_C
-/* LibTomMath, multiple-precision integer library -- Tom St Denis
- *
- * LibTomMath is a library that provides multiple-precision
- * integer arithmetic as well as number theoretic functionality.
- *
- * The library was designed directly after the MPI library by
- * Michael Fromberger but has been written from scratch with
- * additional optimizations in place.
- *
- * The library is free for all purposes without any express
- * guarantee it works.
- *
- * Tom St Denis, tomstdenis@gmail.com, http://libtom.org
- */
-
-/* returns size of ASCII reprensentation */
-int tma_mp_radix_size (tma_mp_int * a, int radix, int *size)
-{
-  int     res, digs;
-  tma_mp_int  t;
-  tma_mp_digit d;
-
-  *size = 0;
-
-  /* special case for binary */
-  if (radix == 2) {
-    *size = tma_mp_count_bits (a) + (a->sign == MP_NEG ? 1 : 0) + 1;
-    return MP_OKAY;
-  }
-
-  /* make sure the radix is in range */
-  if (radix < 2 || radix > 64) {
-    return MP_VAL;
-  }
-
-  if (tma_mp_iszero(a) == MP_YES) {
-    *size = 2;
-    return MP_OKAY;
-  }
-
-  /* digs is the digit count */
-  digs = 0;
-
-  /* if it's negative add one for the sign */
-  if (a->sign == MP_NEG) {
-    ++digs;
-  }
-
-  /* init a copy of the input */
-  if ((res = tma_mp_init_copy (&t, a)) != MP_OKAY) {
-    return res;
-  }
-
-  /* force temp to positive */
-  t.sign = MP_ZPOS;
-
-  /* fetch out all of the digits */
-  while (tma_mp_iszero (&t) == MP_NO) {
-    if ((res = tma_mp_div_d (&t, (tma_mp_digit) radix, &t, &d)) != MP_OKAY) {
-      tma_mp_clear (&t);
-      return res;
-    }
-    ++digs;
-  }
-  tma_mp_clear (&t);
-
-  /* return digs + 1, the 1 is for the NULL byte that would be required. */
-  *size = digs + 1;
-  return MP_OKAY;
-}
-
-#endif
-
-/* $Source$ */
-/* $Revision$ */
-/* $Date$ */
-
-/* End: bn_tma_mp_radix_size.c */
-
-/* Start: bn_tma_mp_radix_smap.c */
-#include "tma.h"
-#ifdef BN_MP_RADIX_SMAP_C
-/* LibTomMath, multiple-precision integer library -- Tom St Denis
- *
- * LibTomMath is a library that provides multiple-precision
- * integer arithmetic as well as number theoretic functionality.
- *
- * The library was designed directly after the MPI library by
- * Michael Fromberger but has been written from scratch with
- * additional optimizations in place.
- *
- * The library is free for all purposes without any express
- * guarantee it works.
- *
- * Tom St Denis, tomstdenis@gmail.com, http://libtom.org
- */
-
-/* chars used in radix conversions */
-const char *tma_mp_s_rmap = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz+/";
-#endif
-
-/* $Source$ */
-/* $Revision$ */
-/* $Date$ */
-
-/* End: bn_tma_mp_radix_smap.c */
-
-/* Start: bn_tma_mp_rand.c */
-#include "tma.h"
-#ifdef BN_MP_RAND_C
-/* LibTomMath, multiple-precision integer library -- Tom St Denis
- *
- * LibTomMath is a library that provides multiple-precision
- * integer arithmetic as well as number theoretic functionality.
- *
- * The library was designed directly after the MPI library by
- * Michael Fromberger but has been written from scratch with
- * additional optimizations in place.
- *
- * The library is free for all purposes without any express
- * guarantee it works.
- *
- * Tom St Denis, tomstdenis@gmail.com, http://libtom.org
- */
-
-/* makes a pseudo-random int of a given size */
-int
-tma_mp_rand (tma_mp_int * a, int digits)
-{
-  int     res;
-  tma_mp_digit d;
-
-  tma_mp_zero (a);
-  if (digits <= 0) {
-    return MP_OKAY;
-  }
-
-  /* first place a random non-zero digit */
-  do {
-    d = ((tma_mp_digit) abs (rand ())) & MP_MASK;
-  } while (d == 0);
-
-  if ((res = tma_mp_add_d (a, d, a)) != MP_OKAY) {
-    return res;
-  }
-
-  while (--digits > 0) {
-    if ((res = tma_mp_lshd (a, 1)) != MP_OKAY) {
-      return res;
-    }
-
-    if ((res = tma_mp_add_d (a, ((tma_mp_digit) abs (rand ())), a)) != MP_OKAY) {
-      return res;
-    }
-  }
-
-  return MP_OKAY;
-}
-#endif
-
-/* $Source$ */
-/* $Revision$ */
-/* $Date$ */
-
-/* End: bn_tma_mp_rand.c */
-
-/* Start: bn_tma_mp_read_radix.c */
-#include "tma.h"
-#ifdef BN_MP_READ_RADIX_C
-/* LibTomMath, multiple-precision integer library -- Tom St Denis
- *
- * LibTomMath is a library that provides multiple-precision
- * integer arithmetic as well as number theoretic functionality.
- *
- * The library was designed directly after the MPI library by
- * Michael Fromberger but has been written from scratch with
- * additional optimizations in place.
- *
- * The library is free for all purposes without any express
- * guarantee it works.
- *
- * Tom St Denis, tomstdenis@gmail.com, http://libtom.org
- */
-
-/* read a string [ASCII] in a given radix */
-int tma_mp_read_radix (tma_mp_int * a, const char *str, int radix)
-{
-  int     y, res, neg;
-  char    ch;
-
-  /* zero the digit bignum */
-  tma_mp_zero(a);
-
-  /* make sure the radix is ok */
-  if (radix < 2 || radix > 64) {
-    return MP_VAL;
-  }
-
-  /* if the leading digit is a
-   * minus set the sign to negative.
-   */
-  if (*str == '-') {
-    ++str;
-    neg = MP_NEG;
-  } else {
-    neg = MP_ZPOS;
-  }
-
-  /* set the integer to the default of zero */
-  tma_mp_zero (a);
-
-  /* process each digit of the string */
-  while (*str) {
-    /* if the radix < 36 the conversion is case insensitive
-     * this allows numbers like 1AB and 1ab to represent the same  value
-     * [e.g. in hex]
-     */
-    ch = (char) ((radix < 36) ? toupper (*str) : *str);
-    for (y = 0; y < 64; y++) {
-      if (ch == tma_mp_s_rmap[y]) {
-         break;
-      }
-    }
-
-    /* if the char was found in the map
-     * and is less than the given radix add it
-     * to the number, otherwise exit the loop.
-     */
-    if (y < radix) {
-      if ((res = tma_mp_mul_d (a, (tma_mp_digit) radix, a)) != MP_OKAY) {
-         return res;
-      }
-      if ((res = tma_mp_add_d (a, (tma_mp_digit) y, a)) != MP_OKAY) {
-         return res;
-      }
-    } else {
-      break;
-    }
-    ++str;
-  }
-
-  /* set the sign only if a != 0 */
-  if (tma_mp_iszero(a) != 1) {
-     a->sign = neg;
-  }
-  return MP_OKAY;
-}
-#endif
-
-/* $Source$ */
-/* $Revision$ */
-/* $Date$ */
-
-/* End: bn_tma_mp_read_radix.c */
-
-/* Start: bn_tma_mp_read_signed_bin.c */
-#include "tma.h"
-#ifdef BN_MP_READ_SIGNED_BIN_C
-/* LibTomMath, multiple-precision integer library -- Tom St Denis
- *
- * LibTomMath is a library that provides multiple-precision
- * integer arithmetic as well as number theoretic functionality.
- *
- * The library was designed directly after the MPI library by
- * Michael Fromberger but has been written from scratch with
- * additional optimizations in place.
- *
- * The library is free for all purposes without any express
- * guarantee it works.
- *
- * Tom St Denis, tomstdenis@gmail.com, http://libtom.org
- */
-
-/* read signed bin, big endian, first byte is 0==positive or 1==negative */
-int tma_mp_read_signed_bin (tma_mp_int * a, const unsigned char *b, int c)
-{
-  int     res;
-
-  /* read magnitude */
-  if ((res = tma_mp_read_unsigned_bin (a, b + 1, c - 1)) != MP_OKAY) {
-    return res;
-  }
-
-  /* first byte is 0 for positive, non-zero for negative */
-  if (b[0] == 0) {
-     a->sign = MP_ZPOS;
-  } else {
-     a->sign = MP_NEG;
-  }
-
-  return MP_OKAY;
-}
-#endif
-
-/* $Source$ */
-/* $Revision$ */
-/* $Date$ */
-
-/* End: bn_tma_mp_read_signed_bin.c */
-
-/* Start: bn_tma_mp_read_unsigned_bin.c */
-#include "tma.h"
-#ifdef BN_MP_READ_UNSIGNED_BIN_C
-/* LibTomMath, multiple-precision integer library -- Tom St Denis
- *
- * LibTomMath is a library that provides multiple-precision
- * integer arithmetic as well as number theoretic functionality.
- *
- * The library was designed directly after the MPI library by
- * Michael Fromberger but has been written from scratch with
- * additional optimizations in place.
- *
- * The library is free for all purposes without any express
- * guarantee it works.
- *
- * Tom St Denis, tomstdenis@gmail.com, http://libtom.org
- */
-
-/* reads a unsigned char array, assumes the msb is stored first [big endian] */
-int tma_mp_read_unsigned_bin (tma_mp_int * a, const unsigned char *b, int c)
-{
-  int     res;
-
-  /* make sure there are at least two digits */
-  if (a->alloc < 2) {
-     if ((res = tma_mp_grow(a, 2)) != MP_OKAY) {
-        return res;
-     }
-  }
-
-  /* zero the int */
-  tma_mp_zero (a);
-
-  /* read the bytes in */
-  while (c-- > 0) {
-    if ((res = tma_mp_mul_2d (a, 8, a)) != MP_OKAY) {
-      return res;
-    }
-
-#ifndef MP_8BIT
-      a->dp[0] |= *b++;
-      a->used += 1;
-#else
-      a->dp[0] = (*b & MP_MASK);
-      a->dp[1] |= ((*b++ >> 7U) & 1);
-      a->used += 2;
-#endif
-  }
-  tma_mp_clamp (a);
-  return MP_OKAY;
-}
-#endif
-
-/* $Source$ */
-/* $Revision$ */
-/* $Date$ */
-
-/* End: bn_tma_mp_read_unsigned_bin.c */
-
-/* Start: bn_tma_mp_reduce.c */
-#include "tma.h"
-#ifdef BN_MP_REDUCE_C
-/* LibTomMath, multiple-precision integer library -- Tom St Denis
- *
- * LibTomMath is a library that provides multiple-precision
- * integer arithmetic as well as number theoretic functionality.
- *
- * The library was designed directly after the MPI library by
- * Michael Fromberger but has been written from scratch with
- * additional optimizations in place.
- *
- * The library is free for all purposes without any express
- * guarantee it works.
- *
- * Tom St Denis, tomstdenis@gmail.com, http://libtom.org
- */
-
-/* reduces x mod m, assumes 0 < x < m**2, mu is
- * precomputed via tma_mp_reduce_setup.
- * From HAC pp.604 Algorithm 14.42
- */
-int tma_mp_reduce (tma_mp_int * x, tma_mp_int * m, tma_mp_int * mu)
-{
-  tma_mp_int  q;
-  int     res, um = m->used;
-
-  /* q = x */
-  if ((res = tma_mp_init_copy (&q, x)) != MP_OKAY) {
-    return res;
-  }
-
-  /* q1 = x / b**(k-1)  */
-  tma_mp_rshd (&q, um - 1);
-
-  /* according to HAC this optimization is ok */
-  if (((unsigned long) um) > (((tma_mp_digit)1) << (DIGIT_BIT - 1))) {
-    if ((res = tma_mp_mul (&q, mu, &q)) != MP_OKAY) {
-      goto CLEANUP;
-    }
-  } else {
-#ifdef BN_S_MP_MUL_HIGH_DIGS_C
-    if ((res = s_tma_mp_mul_high_digs (&q, mu, &q, um)) != MP_OKAY) {
-      goto CLEANUP;
-    }
-#elif defined(BN_FAST_S_MP_MUL_HIGH_DIGS_C)
-    if ((res = fast_s_tma_mp_mul_high_digs (&q, mu, &q, um)) != MP_OKAY) {
-      goto CLEANUP;
-    }
-#else
-    {
-      res = MP_VAL;
-      goto CLEANUP;
-    }
-#endif
-  }
-
-  /* q3 = q2 / b**(k+1) */
-  tma_mp_rshd (&q, um + 1);
-
-  /* x = x mod b**(k+1), quick (no division) */
-  if ((res = tma_mp_mod_2d (x, DIGIT_BIT * (um + 1), x)) != MP_OKAY) {
-    goto CLEANUP;
-  }
-
-  /* q = q * m mod b**(k+1), quick (no division) */
-  if ((res = s_tma_mp_mul_digs (&q, m, &q, um + 1)) != MP_OKAY) {
-    goto CLEANUP;
-  }
-
-  /* x = x - q */
-  if ((res = tma_mp_sub (x, &q, x)) != MP_OKAY) {
-    goto CLEANUP;
-  }
-
-  /* If x < 0, add b**(k+1) to it */
-  if (tma_mp_cmp_d (x, 0) == MP_LT) {
-    tma_mp_set (&q, 1);
-    if ((res = tma_mp_lshd (&q, um + 1)) != MP_OKAY)
-      goto CLEANUP;
-    if ((res = tma_mp_add (x, &q, x)) != MP_OKAY)
-      goto CLEANUP;
-  }
-
-  /* Back off if it's too big */
-  while (tma_mp_cmp (x, m) != MP_LT) {
-    if ((res = s_tma_mp_sub (x, m, x)) != MP_OKAY) {
-      goto CLEANUP;
-    }
-  }
-
-CLEANUP:
-  tma_mp_clear (&q);
-
-  return res;
-}
-#endif
-
-/* $Source$ */
-/* $Revision$ */
-/* $Date$ */
-
-/* End: bn_tma_mp_reduce.c */
-
-/* Start: bn_tma_mp_reduce_2k.c */
-#include "tma.h"
-#ifdef BN_MP_REDUCE_2K_C
-/* LibTomMath, multiple-precision integer library -- Tom St Denis
- *
- * LibTomMath is a library that provides multiple-precision
- * integer arithmetic as well as number theoretic functionality.
- *
- * The library was designed directly after the MPI library by
- * Michael Fromberger but has been written from scratch with
- * additional optimizations in place.
- *
- * The library is free for all purposes without any express
- * guarantee it works.
- *
- * Tom St Denis, tomstdenis@gmail.com, http://libtom.org
- */
-
-/* reduces a modulo n where n is of the form 2**p - d */
-int tma_mp_reduce_2k(tma_mp_int *a, tma_mp_int *n, tma_mp_digit d)
-{
-   tma_mp_int q;
-   int    p, res;
-
-   if ((res = tma_mp_init(&q)) != MP_OKAY) {
-      return res;
-   }
-
-   p = tma_mp_count_bits(n);
-top:
-   /* q = a/2**p, a = a mod 2**p */
-   if ((res = tma_mp_div_2d(a, p, &q, a)) != MP_OKAY) {
-      goto ERR;
-   }
-
-   if (d != 1) {
-      /* q = q * d */
-      if ((res = tma_mp_mul_d(&q, d, &q)) != MP_OKAY) {
-         goto ERR;
-      }
-   }
-
-   /* a = a + q */
-   if ((res = s_tma_mp_add(a, &q, a)) != MP_OKAY) {
-      goto ERR;
-   }
-
-   if (tma_mp_cmp_mag(a, n) != MP_LT) {
-      s_tma_mp_sub(a, n, a);
-      goto top;
-   }
-
-ERR:
-   tma_mp_clear(&q);
-   return res;
-}
-
-#endif
-
-/* $Source$ */
-/* $Revision$ */
-/* $Date$ */
-
-/* End: bn_tma_mp_reduce_2k.c */
-
-/* Start: bn_tma_mp_reduce_2k_l.c */
-#include "tma.h"
-#ifdef BN_MP_REDUCE_2K_L_C
-/* LibTomMath, multiple-precision integer library -- Tom St Denis
- *
- * LibTomMath is a library that provides multiple-precision
- * integer arithmetic as well as number theoretic functionality.
- *
- * The library was designed directly after the MPI library by
- * Michael Fromberger but has been written from scratch with
- * additional optimizations in place.
- *
- * The library is free for all purposes without any express
- * guarantee it works.
- *
- * Tom St Denis, tomstdenis@gmail.com, http://libtom.org
- */
-
-/* reduces a modulo n where n is of the form 2**p - d
-   This differs from reduce_2k since "d" can be larger
-   than a single digit.
-*/
-int tma_mp_reduce_2k_l(tma_mp_int *a, tma_mp_int *n, tma_mp_int *d)
-{
-   tma_mp_int q;
-   int    p, res;
-
-   if ((res = tma_mp_init(&q)) != MP_OKAY) {
-      return res;
-   }
-
-   p = tma_mp_count_bits(n);
-top:
-   /* q = a/2**p, a = a mod 2**p */
-   if ((res = tma_mp_div_2d(a, p, &q, a)) != MP_OKAY) {
-      goto ERR;
-   }
-
-   /* q = q * d */
-   if ((res = tma_mp_mul(&q, d, &q)) != MP_OKAY) {
-      goto ERR;
-   }
-
-   /* a = a + q */
-   if ((res = s_tma_mp_add(a, &q, a)) != MP_OKAY) {
-      goto ERR;
-   }
-
-   if (tma_mp_cmp_mag(a, n) != MP_LT) {
-      s_tma_mp_sub(a, n, a);
-      goto top;
-   }
-
-ERR:
-   tma_mp_clear(&q);
-   return res;
-}
-
-#endif
-
-/* $Source$ */
-/* $Revision$ */
-/* $Date$ */
-
-/* End: bn_tma_mp_reduce_2k_l.c */
-
-/* Start: bn_tma_mp_reduce_2k_setup.c */
-#include "tma.h"
-#ifdef BN_MP_REDUCE_2K_SETUP_C
-/* LibTomMath, multiple-precision integer library -- Tom St Denis
- *
- * LibTomMath is a library that provides multiple-precision
- * integer arithmetic as well as number theoretic functionality.
- *
- * The library was designed directly after the MPI library by
- * Michael Fromberger but has been written from scratch with
- * additional optimizations in place.
- *
- * The library is free for all purposes without any express
- * guarantee it works.
- *
- * Tom St Denis, tomstdenis@gmail.com, http://libtom.org
- */
-
-/* determines the setup value */
-int tma_mp_reduce_2k_setup(tma_mp_int *a, tma_mp_digit *d)
-{
-   int res, p;
-   tma_mp_int tmp;
-
-   if ((res = tma_mp_init(&tmp)) != MP_OKAY) {
-      return res;
-   }
-
-   p = tma_mp_count_bits(a);
-   if ((res = tma_mp_2expt(&tmp, p)) != MP_OKAY) {
-      tma_mp_clear(&tmp);
-      return res;
-   }
-
-   if ((res = s_tma_mp_sub(&tmp, a, &tmp)) != MP_OKAY) {
-      tma_mp_clear(&tmp);
-      return res;
-   }
-
-   *d = tmp.dp[0];
-   tma_mp_clear(&tmp);
-   return MP_OKAY;
-}
-#endif
-
-/* $Source$ */
-/* $Revision$ */
-/* $Date$ */
-
-/* End: bn_tma_mp_reduce_2k_setup.c */
-
-/* Start: bn_tma_mp_reduce_2k_setup_l.c */
-#include "tma.h"
-#ifdef BN_MP_REDUCE_2K_SETUP_L_C
-/* LibTomMath, multiple-precision integer library -- Tom St Denis
- *
- * LibTomMath is a library that provides multiple-precision
- * integer arithmetic as well as number theoretic functionality.
- *
- * The library was designed directly after the MPI library by
- * Michael Fromberger but has been written from scratch with
- * additional optimizations in place.
- *
- * The library is free for all purposes without any express
- * guarantee it works.
- *
- * Tom St Denis, tomstdenis@gmail.com, http://libtom.org
- */
-
-/* determines the setup value */
-int tma_mp_reduce_2k_setup_l(tma_mp_int *a, tma_mp_int *d)
-{
-   int    res;
-   tma_mp_int tmp;
-
-   if ((res = tma_mp_init(&tmp)) != MP_OKAY) {
-      return res;
-   }
-
-   if ((res = tma_mp_2expt(&tmp, tma_mp_count_bits(a))) != MP_OKAY) {
-      goto ERR;
-   }
-
-   if ((res = s_tma_mp_sub(&tmp, a, d)) != MP_OKAY) {
-      goto ERR;
-   }
-
-ERR:
-   tma_mp_clear(&tmp);
-   return res;
-}
-#endif
-
-/* $Source$ */
-/* $Revision$ */
-/* $Date$ */
-
-/* End: bn_tma_mp_reduce_2k_setup_l.c */
-
-/* Start: bn_tma_mp_reduce_is_2k.c */
-#include "tma.h"
-#ifdef BN_MP_REDUCE_IS_2K_C
-/* LibTomMath, multiple-precision integer library -- Tom St Denis
- *
- * LibTomMath is a library that provides multiple-precision
- * integer arithmetic as well as number theoretic functionality.
- *
- * The library was designed directly after the MPI library by
- * Michael Fromberger but has been written from scratch with
- * additional optimizations in place.
- *
- * The library is free for all purposes without any express
- * guarantee it works.
- *
- * Tom St Denis, tomstdenis@gmail.com, http://libtom.org
- */
-
-/* determines if tma_mp_reduce_2k can be used */
-int tma_mp_reduce_is_2k(tma_mp_int *a)
-{
-   int ix, iy, iw;
-   tma_mp_digit iz;
-
-   if (a->used == 0) {
-      return MP_NO;
-   } else if (a->used == 1) {
-      return MP_YES;
-   } else if (a->used > 1) {
-      iy = tma_mp_count_bits(a);
-      iz = 1;
-      iw = 1;
-
-      /* Test every bit from the second digit up, must be 1 */
-      for (ix = DIGIT_BIT; ix < iy; ix++) {
-          if ((a->dp[iw] & iz) == 0) {
-             return MP_NO;
-          }
-          iz <<= 1;
-          if (iz > (tma_mp_digit)MP_MASK) {
-             ++iw;
-             iz = 1;
-          }
-      }
-   }
-   return MP_YES;
-}
-
-#endif
-
-/* $Source$ */
-/* $Revision$ */
-/* $Date$ */
-
-/* End: bn_tma_mp_reduce_is_2k.c */
-
-/* Start: bn_tma_mp_reduce_is_2k_l.c */
-#include "tma.h"
-#ifdef BN_MP_REDUCE_IS_2K_L_C
-/* LibTomMath, multiple-precision integer library -- Tom St Denis
- *
- * LibTomMath is a library that provides multiple-precision
- * integer arithmetic as well as number theoretic functionality.
- *
- * The library was designed directly after the MPI library by
- * Michael Fromberger but has been written from scratch with
- * additional optimizations in place.
- *
- * The library is free for all purposes without any express
- * guarantee it works.
- *
- * Tom St Denis, tomstdenis@gmail.com, http://libtom.org
- */
-
-/* determines if reduce_2k_l can be used */
-int tma_mp_reduce_is_2k_l(tma_mp_int *a)
-{
-   int ix, iy;
-
-   if (a->used == 0) {
-      return MP_NO;
-   } else if (a->used == 1) {
-      return MP_YES;
-   } else if (a->used > 1) {
-      /* if more than half of the digits are -1 we're sold */
-      for (iy = ix = 0; ix < a->used; ix++) {
-          if (a->dp[ix] == MP_MASK) {
-              ++iy;
-          }
-      }
-      return (iy >= (a->used/2)) ? MP_YES : MP_NO;
-
-   }
-   return MP_NO;
-}
-
-#endif
-
-/* $Source$ */
-/* $Revision$ */
-/* $Date$ */
-
-/* End: bn_tma_mp_reduce_is_2k_l.c */
-
-/* Start: bn_tma_mp_reduce_setup.c */
-#include "tma.h"
-#ifdef BN_MP_REDUCE_SETUP_C
-/* LibTomMath, multiple-precision integer library -- Tom St Denis
- *
- * LibTomMath is a library that provides multiple-precision
- * integer arithmetic as well as number theoretic functionality.
- *
- * The library was designed directly after the MPI library by
- * Michael Fromberger but has been written from scratch with
- * additional optimizations in place.
- *
- * The library is free for all purposes without any express
- * guarantee it works.
- *
- * Tom St Denis, tomstdenis@gmail.com, http://libtom.org
- */
-
-/* pre-calculate the value required for Barrett reduction
- * For a given modulus "b" it calulates the value required in "a"
- */
-int tma_mp_reduce_setup (tma_mp_int * a, tma_mp_int * b)
-{
-  int     res;
-
-  if ((res = tma_mp_2expt (a, b->used * 2 * DIGIT_BIT)) != MP_OKAY) {
-    return res;
-  }
-  return tma_mp_div (a, b, a, NULL);
-}
-#endif
-
-/* $Source$ */
-/* $Revision$ */
-/* $Date$ */
-
-/* End: bn_tma_mp_reduce_setup.c */
-
-/* Start: bn_tma_mp_rshd.c */
-#include "tma.h"
-#ifdef BN_MP_RSHD_C
-/* LibTomMath, multiple-precision integer library -- Tom St Denis
- *
- * LibTomMath is a library that provides multiple-precision
- * integer arithmetic as well as number theoretic functionality.
- *
- * The library was designed directly after the MPI library by
- * Michael Fromberger but has been written from scratch with
- * additional optimizations in place.
- *
- * The library is free for all purposes without any express
- * guarantee it works.
- *
- * Tom St Denis, tomstdenis@gmail.com, http://libtom.org
- */
-
-/* shift right a certain amount of digits */
-void tma_mp_rshd (tma_mp_int * a, int b)
-{
-  int     x;
-
-  /* if b <= 0 then ignore it */
-  if (b <= 0) {
-    return;
-  }
-
-  /* if b > used then simply zero it and return */
-  if (a->used <= b) {
-    tma_mp_zero (a);
-    return;
-  }
-
-  {
-    register tma_mp_digit *bottom, *top;
-
-    /* shift the digits down */
-
-    /* bottom */
-    bottom = a->dp;
-
-    /* top [offset into digits] */
-    top = a->dp + b;
-
-    /* this is implemented as a sliding window where
-     * the window is b-digits long and digits from
-     * the top of the window are copied to the bottom
-     *
-     * e.g.
-
-     b-2 | b-1 | b0 | b1 | b2 | ... | bb |   ---->
-                 /\                   |      ---->
-                  \-------------------/      ---->
-     */
-    for (x = 0; x < (a->used - b); x++) {
-      *bottom++ = *top++;
-    }
-
-    /* zero the top digits */
-    for (; x < a->used; x++) {
-      *bottom++ = 0;
-    }
-  }
-
-  /* remove excess digits */
-  a->used -= b;
-}
-#endif
-
-/* $Source$ */
-/* $Revision$ */
-/* $Date$ */
-
-/* End: bn_tma_mp_rshd.c */
-
-/* Start: bn_tma_mp_set.c */
-#include "tma.h"
-#ifdef BN_MP_SET_C
-/* LibTomMath, multiple-precision integer library -- Tom St Denis
- *
- * LibTomMath is a library that provides multiple-precision
- * integer arithmetic as well as number theoretic functionality.
- *
- * The library was designed directly after the MPI library by
- * Michael Fromberger but has been written from scratch with
- * additional optimizations in place.
- *
- * The library is free for all purposes without any express
- * guarantee it works.
- *
- * Tom St Denis, tomstdenis@gmail.com, http://libtom.org
- */
-
-/* set to a digit */
-void tma_mp_set (tma_mp_int * a, tma_mp_digit b)
-{
-  tma_mp_zero (a);
-  a->dp[0] = b & MP_MASK;
-  a->used  = (a->dp[0] != 0) ? 1 : 0;
-}
-#endif
-
-/* $Source$ */
-/* $Revision$ */
-/* $Date$ */
-
-/* End: bn_tma_mp_set.c */
-
-/* Start: bn_tma_mp_set_int.c */
-#include "tma.h"
-#ifdef BN_MP_SET_INT_C
-/* LibTomMath, multiple-precision integer library -- Tom St Denis
- *
- * LibTomMath is a library that provides multiple-precision
- * integer arithmetic as well as number theoretic functionality.
- *
- * The library was designed directly after the MPI library by
- * Michael Fromberger but has been written from scratch with
- * additional optimizations in place.
- *
- * The library is free for all purposes without any express
- * guarantee it works.
- *
- * Tom St Denis, tomstdenis@gmail.com, http://libtom.org
- */
-
-/* set a 32-bit const */
-int tma_mp_set_int (tma_mp_int * a, unsigned long b)
-{
-  int     x, res;
-
-  tma_mp_zero (a);
-
-  /* set four bits at a time */
-  for (x = 0; x < 8; x++) {
-    /* shift the number up four bits */
-    if ((res = tma_mp_mul_2d (a, 4, a)) != MP_OKAY) {
-      return res;
-    }
-
-    /* OR in the top four bits of the source */
-    a->dp[0] |= (b >> 28) & 15;
-
-    /* shift the source up to the next four bits */
-    b <<= 4;
-
-    /* ensure that digits are not clamped off */
-    a->used += 1;
-  }
-  tma_mp_clamp (a);
-  return MP_OKAY;
-}
-#endif
-
-/* $Source$ */
-/* $Revision$ */
-/* $Date$ */
-
-/* End: bn_tma_mp_set_int.c */
-
-/* Start: bn_tma_mp_shrink.c */
-#include "tma.h"
-#ifdef BN_MP_SHRINK_C
-/* LibTomMath, multiple-precision integer library -- Tom St Denis
- *
- * LibTomMath is a library that provides multiple-precision
- * integer arithmetic as well as number theoretic functionality.
- *
- * The library was designed directly after the MPI library by
- * Michael Fromberger but has been written from scratch with
- * additional optimizations in place.
- *
- * The library is free for all purposes without any express
- * guarantee it works.
- *
- * Tom St Denis, tomstdenis@gmail.com, http://libtom.org
- */
-
-/* shrink a bignum */
-int tma_mp_shrink (tma_mp_int * a)
-{
-  tma_mp_digit *tmp;
-  if (a->alloc != a->used && a->used > 0) {
-    if ((tmp = OPT_CAST(tma_mp_digit) XREALLOC (a->dp, sizeof (tma_mp_digit) * a->used)) == NULL) {
-      return MP_MEM;
-    }
-    a->dp    = tmp;
-    a->alloc = a->used;
-  }
-  return MP_OKAY;
-}
-#endif
-
-/* $Source$ */
-/* $Revision$ */
-/* $Date$ */
-
-/* End: bn_tma_mp_shrink.c */
-
-/* Start: bn_tma_mp_signed_bin_size.c */
-#include "tma.h"
-#ifdef BN_MP_SIGNED_BIN_SIZE_C
-/* LibTomMath, multiple-precision integer library -- Tom St Denis
- *
- * LibTomMath is a library that provides multiple-precision
- * integer arithmetic as well as number theoretic functionality.
- *
- * The library was designed directly after the MPI library by
- * Michael Fromberger but has been written from scratch with
- * additional optimizations in place.
- *
- * The library is free for all purposes without any express
- * guarantee it works.
- *
- * Tom St Denis, tomstdenis@gmail.com, http://libtom.org
- */
-
-/* get the size for an signed equivalent */
-int tma_mp_signed_bin_size (tma_mp_int * a)
-{
-  return 1 + tma_mp_unsigned_bin_size (a);
-}
-#endif
-
-/* $Source$ */
-/* $Revision$ */
-/* $Date$ */
-
-/* End: bn_tma_mp_signed_bin_size.c */
-
-/* Start: bn_tma_mp_sqr.c */
-#include "tma.h"
-#ifdef BN_MP_SQR_C
-/* LibTomMath, multiple-precision integer library -- Tom St Denis
- *
- * LibTomMath is a library that provides multiple-precision
- * integer arithmetic as well as number theoretic functionality.
- *
- * The library was designed directly after the MPI library by
- * Michael Fromberger but has been written from scratch with
- * additional optimizations in place.
- *
- * The library is free for all purposes without any express
- * guarantee it works.
- *
- * Tom St Denis, tomstdenis@gmail.com, http://libtom.org
- */
-
-/* computes b = a*a */
-int
-tma_mp_sqr (tma_mp_int * a, tma_mp_int * b)
-{
-  int     res;
-
-#ifdef BN_MP_TOOM_SQR_C
-  /* use Toom-Cook? */
-  if (a->used >= TOOM_SQR_CUTOFF) {
-    res = tma_mp_toom_sqr(a, b);
-  /* Karatsuba? */
-  } else
-#endif
-#ifdef BN_MP_KARATSUBA_SQR_C
-if (a->used >= KARATSUBA_SQR_CUTOFF) {
-    res = tma_mp_karatsuba_sqr (a, b);
-  } else
-#endif
-  {
-#ifdef BN_FAST_S_MP_SQR_C
-    /* can we use the fast comba multiplier? */
-    if ((a->used * 2 + 1) < MP_WARRAY &&
-         a->used <
-         (1 << (sizeof(tma_mp_word) * CHAR_BIT - 2*DIGIT_BIT - 1))) {
-      res = fast_s_tma_mp_sqr (a, b);
-    } else
-#endif
-#ifdef BN_S_MP_SQR_C
-      res = s_tma_mp_sqr (a, b);
-#else
-      res = MP_VAL;
-#endif
-  }
-  b->sign = MP_ZPOS;
-  return res;
-}
-#endif
-
-/* $Source$ */
-/* $Revision$ */
-/* $Date$ */
-
-/* End: bn_tma_mp_sqr.c */
-
-/* Start: bn_tma_mp_sqrmod.c */
-#include "tma.h"
-#ifdef BN_MP_SQRMOD_C
-/* LibTomMath, multiple-precision integer library -- Tom St Denis
- *
- * LibTomMath is a library that provides multiple-precision
- * integer arithmetic as well as number theoretic functionality.
- *
- * The library was designed directly after the MPI library by
- * Michael Fromberger but has been written from scratch with
- * additional optimizations in place.
- *
- * The library is free for all purposes without any express
- * guarantee it works.
- *
- * Tom St Denis, tomstdenis@gmail.com, http://libtom.org
- */
-
-/* c = a * a (mod b) */
-int
-tma_mp_sqrmod (tma_mp_int * a, tma_mp_int * b, tma_mp_int * c)
-{
-  int     res;
-  tma_mp_int  t;
-
-  if ((res = tma_mp_init (&t)) != MP_OKAY) {
-    return res;
-  }
-
-  if ((res = tma_mp_sqr (a, &t)) != MP_OKAY) {
-    tma_mp_clear (&t);
-    return res;
-  }
-  res = tma_mp_mod (&t, b, c);
-  tma_mp_clear (&t);
-  return res;
-}
-#endif
-
-/* $Source$ */
-/* $Revision$ */
-/* $Date$ */
-
-/* End: bn_tma_mp_sqrmod.c */
-
-/* Start: bn_tma_mp_sqrt.c */
-#include "tma.h"
-#ifdef BN_MP_SQRT_C
-/* LibTomMath, multiple-precision integer library -- Tom St Denis
- *
- * LibTomMath is a library that provides multiple-precision
- * integer arithmetic as well as number theoretic functionality.
- *
- * The library was designed directly after the MPI library by
- * Michael Fromberger but has been written from scratch with
- * additional optimizations in place.
- *
- * The library is free for all purposes without any express
- * guarantee it works.
- *
- * Tom St Denis, tomstdenis@gmail.com, http://libtom.org
- */
-
-/* this function is less generic than tma_mp_n_root, simpler and faster */
-int tma_mp_sqrt(tma_mp_int *arg, tma_mp_int *ret)
-{
-  int res;
-  tma_mp_int t1,t2;
-
-  /* must be positive */
-  if (arg->sign == MP_NEG) {
-    return MP_VAL;
-  }
-
-  /* easy out */
-  if (tma_mp_iszero(arg) == MP_YES) {
-    tma_mp_zero(ret);
-    return MP_OKAY;
-  }
-
-  if ((res = tma_mp_init_copy(&t1, arg)) != MP_OKAY) {
-    return res;
-  }
-
-  if ((res = tma_mp_init(&t2)) != MP_OKAY) {
-    goto E2;
-  }
-
-  /* First approx. (not very bad for large arg) */
-  tma_mp_rshd (&t1,t1.used/2);
-
-  /* t1 > 0  */
-  if ((res = tma_mp_div(arg,&t1,&t2,NULL)) != MP_OKAY) {
-    goto E1;
-  }
-  if ((res = tma_mp_add(&t1,&t2,&t1)) != MP_OKAY) {
-    goto E1;
-  }
-  if ((res = tma_mp_div_2(&t1,&t1)) != MP_OKAY) {
-    goto E1;
-  }
-  /* And now t1 > sqrt(arg) */
-  do {
-    if ((res = tma_mp_div(arg,&t1,&t2,NULL)) != MP_OKAY) {
-      goto E1;
-    }
-    if ((res = tma_mp_add(&t1,&t2,&t1)) != MP_OKAY) {
-      goto E1;
-    }
-    if ((res = tma_mp_div_2(&t1,&t1)) != MP_OKAY) {
-      goto E1;
-    }
-    /* t1 >= sqrt(arg) >= t2 at this point */
-  } while (tma_mp_cmp_mag(&t1,&t2) == MP_GT);
-
-  tma_mp_exch(&t1,ret);
-
-E1: tma_mp_clear(&t2);
-E2: tma_mp_clear(&t1);
-  return res;
-}
-
-#endif
-
-/* $Source$ */
-/* $Revision$ */
-/* $Date$ */
-
-/* End: bn_tma_mp_sqrt.c */
-
-/* Start: bn_tma_mp_sub.c */
-#include "tma.h"
-#ifdef BN_MP_SUB_C
-/* LibTomMath, multiple-precision integer library -- Tom St Denis
- *
- * LibTomMath is a library that provides multiple-precision
- * integer arithmetic as well as number theoretic functionality.
- *
- * The library was designed directly after the MPI library by
- * Michael Fromberger but has been written from scratch with
- * additional optimizations in place.
- *
- * The library is free for all purposes without any express
- * guarantee it works.
- *
- * Tom St Denis, tomstdenis@gmail.com, http://libtom.org
- */
-
-/* high level subtraction (handles signs) */
-int
-tma_mp_sub (tma_mp_int * a, tma_mp_int * b, tma_mp_int * c)
-{
-  int     sa, sb, res;
-
-  sa = a->sign;
-  sb = b->sign;
-
-  if (sa != sb) {
-    /* subtract a negative from a positive, OR */
-    /* subtract a positive from a negative. */
-    /* In either case, ADD their magnitudes, */
-    /* and use the sign of the first number. */
-    c->sign = sa;
-    res = s_tma_mp_add (a, b, c);
-  } else {
-    /* subtract a positive from a positive, OR */
-    /* subtract a negative from a negative. */
-    /* First, take the difference between their */
-    /* magnitudes, then... */
-    if (tma_mp_cmp_mag (a, b) != MP_LT) {
-      /* Copy the sign from the first */
-      c->sign = sa;
-      /* The first has a larger or equal magnitude */
-      res = s_tma_mp_sub (a, b, c);
-    } else {
-      /* The result has the *opposite* sign from */
-      /* the first number. */
-      c->sign = (sa == MP_ZPOS) ? MP_NEG : MP_ZPOS;
-      /* The second has a larger magnitude */
-      res = s_tma_mp_sub (b, a, c);
-    }
-  }
-  return res;
-}
-
-#endif
-
-/* $Source$ */
-/* $Revision$ */
-/* $Date$ */
-
-/* End: bn_tma_mp_sub.c */
-
-/* Start: bn_tma_mp_sub_d.c */
-#include "tma.h"
-#ifdef BN_MP_SUB_D_C
-/* LibTomMath, multiple-precision integer library -- Tom St Denis
- *
- * LibTomMath is a library that provides multiple-precision
- * integer arithmetic as well as number theoretic functionality.
- *
- * The library was designed directly after the MPI library by
- * Michael Fromberger but has been written from scratch with
- * additional optimizations in place.
- *
- * The library is free for all purposes without any express
- * guarantee it works.
- *
- * Tom St Denis, tomstdenis@gmail.com, http://libtom.org
- */
-
-/* single digit subtraction */
-int
-tma_mp_sub_d (tma_mp_int * a, tma_mp_digit b, tma_mp_int * c)
-{
-  tma_mp_digit *tmpa, *tmpc, mu;
-  int       res, ix, oldused;
-
-  /* grow c as required */
-  if (c->alloc < a->used + 1) {
-     if ((res = tma_mp_grow(c, a->used + 1)) != MP_OKAY) {
-        return res;
-     }
-  }
-
-  /* if a is negative just do an unsigned
-   * addition [with fudged signs]
-   */
-  if (a->sign == MP_NEG) {
-     a->sign = MP_ZPOS;
-     res     = tma_mp_add_d(a, b, c);
-     a->sign = c->sign = MP_NEG;
-
-     /* clamp */
-     tma_mp_clamp(c);
-
-     return res;
-  }
-
-  /* setup regs */
-  oldused = c->used;
-  tmpa    = a->dp;
-  tmpc    = c->dp;
-
-  /* if a <= b simply fix the single digit */
-  if ((a->used == 1 && a->dp[0] <= b) || a->used == 0) {
-     if (a->used == 1) {
-        *tmpc++ = b - *tmpa;
-     } else {
-        *tmpc++ = b;
-     }
-     ix      = 1;
-
-     /* negative/1digit */
-     c->sign = MP_NEG;
-     c->used = 1;
-  } else {
-     /* positive/size */
-     c->sign = MP_ZPOS;
-     c->used = a->used;
-
-     /* subtract first digit */
-     *tmpc    = *tmpa++ - b;
-     mu       = *tmpc >> (sizeof(tma_mp_digit) * CHAR_BIT - 1);
-     *tmpc++ &= MP_MASK;
-
-     /* handle rest of the digits */
-     for (ix = 1; ix < a->used; ix++) {
-        *tmpc    = *tmpa++ - mu;
-        mu       = *tmpc >> (sizeof(tma_mp_digit) * CHAR_BIT - 1);
-        *tmpc++ &= MP_MASK;
-     }
-  }
-
-  /* zero excess digits */
-  while (ix++ < oldused) {
-     *tmpc++ = 0;
-  }
-  tma_mp_clamp(c);
-  return MP_OKAY;
-}
-
-#endif
-
-/* $Source$ */
-/* $Revision$ */
-/* $Date$ */
-
-/* End: bn_tma_mp_sub_d.c */
-
-/* Start: bn_tma_mp_submod.c */
-#include "tma.h"
-#ifdef BN_MP_SUBMOD_C
-/* LibTomMath, multiple-precision integer library -- Tom St Denis
- *
- * LibTomMath is a library that provides multiple-precision
- * integer arithmetic as well as number theoretic functionality.
- *
- * The library was designed directly after the MPI library by
- * Michael Fromberger but has been written from scratch with
- * additional optimizations in place.
- *
- * The library is free for all purposes without any express
- * guarantee it works.
- *
- * Tom St Denis, tomstdenis@gmail.com, http://libtom.org
- */
-
-/* d = a - b (mod c) */
-int
-tma_mp_submod (tma_mp_int * a, tma_mp_int * b, tma_mp_int * c, tma_mp_int * d)
-{
-  int     res;
-  tma_mp_int  t;
-
-
-  if ((res = tma_mp_init (&t)) != MP_OKAY) {
-    return res;
-  }
-
-  if ((res = tma_mp_sub (a, b, &t)) != MP_OKAY) {
-    tma_mp_clear (&t);
-    return res;
-  }
-  res = tma_mp_mod (&t, c, d);
-  tma_mp_clear (&t);
-  return res;
-}
-#endif
-
-/* $Source$ */
-/* $Revision$ */
-/* $Date$ */
-
-/* End: bn_tma_mp_submod.c */
-
-/* Start: bn_tma_mp_to_signed_bin.c */
-#include "tma.h"
-#ifdef BN_MP_TO_SIGNED_BIN_C
-/* LibTomMath, multiple-precision integer library -- Tom St Denis
- *
- * LibTomMath is a library that provides multiple-precision
- * integer arithmetic as well as number theoretic functionality.
- *
- * The library was designed directly after the MPI library by
- * Michael Fromberger but has been written from scratch with
- * additional optimizations in place.
- *
- * The library is free for all purposes without any express
- * guarantee it works.
- *
- * Tom St Denis, tomstdenis@gmail.com, http://libtom.org
- */
-
-/* store in signed [big endian] format */
-int tma_mp_to_signed_bin (tma_mp_int * a, unsigned char *b)
-{
-  int     res;
-
-  if ((res = tma_mp_to_unsigned_bin (a, b + 1)) != MP_OKAY) {
-    return res;
-  }
-  b[0] = (unsigned char) ((a->sign == MP_ZPOS) ? 0 : 1);
-  return MP_OKAY;
-}
-#endif
-
-/* $Source$ */
-/* $Revision$ */
-/* $Date$ */
-
-/* End: bn_tma_mp_to_signed_bin.c */
-
-/* Start: bn_tma_mp_to_signed_bin_n.c */
-#include "tma.h"
-#ifdef BN_MP_TO_SIGNED_BIN_N_C
-/* LibTomMath, multiple-precision integer library -- Tom St Denis
- *
- * LibTomMath is a library that provides multiple-precision
- * integer arithmetic as well as number theoretic functionality.
- *
- * The library was designed directly after the MPI library by
- * Michael Fromberger but has been written from scratch with
- * additional optimizations in place.
- *
- * The library is free for all purposes without any express
- * guarantee it works.
- *
- * Tom St Denis, tomstdenis@gmail.com, http://libtom.org
- */
-
-/* store in signed [big endian] format */
-int tma_mp_to_signed_bin_n (tma_mp_int * a, unsigned char *b, unsigned long *outlen)
-{
-   if (*outlen < (unsigned long)tma_mp_signed_bin_size(a)) {
-      return MP_VAL;
-   }
-   *outlen = tma_mp_signed_bin_size(a);
-   return tma_mp_to_signed_bin(a, b);
-}
-#endif
-
-/* $Source$ */
-/* $Revision$ */
-/* $Date$ */
-
-/* End: bn_tma_mp_to_signed_bin_n.c */
-
-/* Start: bn_tma_mp_to_unsigned_bin.c */
-#include "tma.h"
-#ifdef BN_MP_TO_UNSIGNED_BIN_C
-/* LibTomMath, multiple-precision integer library -- Tom St Denis
- *
- * LibTomMath is a library that provides multiple-precision
- * integer arithmetic as well as number theoretic functionality.
- *
- * The library was designed directly after the MPI library by
- * Michael Fromberger but has been written from scratch with
- * additional optimizations in place.
- *
- * The library is free for all purposes without any express
- * guarantee it works.
- *
- * Tom St Denis, tomstdenis@gmail.com, http://libtom.org
- */
-
-/* store in unsigned [big endian] format */
-int tma_mp_to_unsigned_bin (tma_mp_int * a, unsigned char *b)
-{
-  int     x, res;
-  tma_mp_int  t;
-
-  if ((res = tma_mp_init_copy (&t, a)) != MP_OKAY) {
-    return res;
-  }
-
-  x = 0;
-  while (tma_mp_iszero (&t) == 0) {
-#ifndef MP_8BIT
-      b[x++] = (unsigned char) (t.dp[0] & 255);
-#else
-      b[x++] = (unsigned char) (t.dp[0] | ((t.dp[1] & 0x01) << 7));
-#endif
-    if ((res = tma_mp_div_2d (&t, 8, &t, NULL)) != MP_OKAY) {
-      tma_mp_clear (&t);
-      return res;
-    }
-  }
-  bn_reverse (b, x);
-  tma_mp_clear (&t);
-  return MP_OKAY;
-}
-#endif
-
-/* $Source$ */
-/* $Revision$ */
-/* $Date$ */
-
-/* End: bn_tma_mp_to_unsigned_bin.c */
-
-/* Start: bn_tma_mp_to_unsigned_bin_n.c */
-#include "tma.h"
-#ifdef BN_MP_TO_UNSIGNED_BIN_N_C
-/* LibTomMath, multiple-precision integer library -- Tom St Denis
- *
- * LibTomMath is a library that provides multiple-precision
- * integer arithmetic as well as number theoretic functionality.
- *
- * The library was designed directly after the MPI library by
- * Michael Fromberger but has been written from scratch with
- * additional optimizations in place.
- *
- * The library is free for all purposes without any express
- * guarantee it works.
- *
- * Tom St Denis, tomstdenis@gmail.com, http://libtom.org
- */
-
-/* store in unsigned [big endian] format */
-int tma_mp_to_unsigned_bin_n (tma_mp_int * a, unsigned char *b, unsigned long *outlen)
-{
-   if (*outlen < (unsigned long)tma_mp_unsigned_bin_size(a)) {
-      return MP_VAL;
-   }
-   *outlen = tma_mp_unsigned_bin_size(a);
-   return tma_mp_to_unsigned_bin(a, b);
-}
-#endif
-
-/* $Source$ */
-/* $Revision$ */
-/* $Date$ */
-
-/* End: bn_tma_mp_to_unsigned_bin_n.c */
-
-/* Start: bn_tma_mp_toom_mul.c */
-#include "tma.h"
-#ifdef BN_MP_TOOM_MUL_C
-/* LibTomMath, multiple-precision integer library -- Tom St Denis
- *
- * LibTomMath is a library that provides multiple-precision
- * integer arithmetic as well as number theoretic functionality.
- *
- * The library was designed directly after the MPI library by
- * Michael Fromberger but has been written from scratch with
- * additional optimizations in place.
- *
- * The library is free for all purposes without any express
- * guarantee it works.
- *
- * Tom St Denis, tomstdenis@gmail.com, http://libtom.org
- */
-
-/* multiplication using the Toom-Cook 3-way algorithm
- *
- * Much more complicated than Karatsuba but has a lower
- * asymptotic running time of O(N**1.464).  This algorithm is
- * only particularly useful on VERY large inputs
- * (we're talking 1000s of digits here...).
-*/
-int tma_mp_toom_mul(tma_mp_int *a, tma_mp_int *b, tma_mp_int *c)
-{
-    tma_mp_int w0, w1, w2, w3, w4, tmp1, tmp2, a0, a1, a2, b0, b1, b2;
-    int res, B;
-
-    /* init temps */
-    if ((res = tma_mp_init_multi(&w0, &w1, &w2, &w3, &w4,
-                             &a0, &a1, &a2, &b0, &b1,
-                             &b2, &tmp1, &tmp2, NULL)) != MP_OKAY) {
-       return res;
-    }
-
-    /* B */
-    B = MIN(a->used, b->used) / 3;
-
-    /* a = a2 * B**2 + a1 * B + a0 */
-    if ((res = tma_mp_mod_2d(a, DIGIT_BIT * B, &a0)) != MP_OKAY) {
-       goto ERR;
-    }
-
-    if ((res = tma_mp_copy(a, &a1)) != MP_OKAY) {
-       goto ERR;
-    }
-    tma_mp_rshd(&a1, B);
-    tma_mp_mod_2d(&a1, DIGIT_BIT * B, &a1);
-
-    if ((res = tma_mp_copy(a, &a2)) != MP_OKAY) {
-       goto ERR;
-    }
-    tma_mp_rshd(&a2, B*2);
-
-    /* b = b2 * B**2 + b1 * B + b0 */
-    if ((res = tma_mp_mod_2d(b, DIGIT_BIT * B, &b0)) != MP_OKAY) {
-       goto ERR;
-    }
-
-    if ((res = tma_mp_copy(b, &b1)) != MP_OKAY) {
-       goto ERR;
-    }
-    tma_mp_rshd(&b1, B);
-    tma_mp_mod_2d(&b1, DIGIT_BIT * B, &b1);
-
-    if ((res = tma_mp_copy(b, &b2)) != MP_OKAY) {
-       goto ERR;
-    }
-    tma_mp_rshd(&b2, B*2);
-
-    /* w0 = a0*b0 */
-    if ((res = tma_mp_mul(&a0, &b0, &w0)) != MP_OKAY) {
-       goto ERR;
-    }
-
-    /* w4 = a2 * b2 */
-    if ((res = tma_mp_mul(&a2, &b2, &w4)) != MP_OKAY) {
-       goto ERR;
-    }
-
-    /* w1 = (a2 + 2(a1 + 2a0))(b2 + 2(b1 + 2b0)) */
-    if ((res = tma_mp_mul_2(&a0, &tmp1)) != MP_OKAY) {
-       goto ERR;
-    }
-    if ((res = tma_mp_add(&tmp1, &a1, &tmp1)) != MP_OKAY) {
-       goto ERR;
-    }
-    if ((res = tma_mp_mul_2(&tmp1, &tmp1)) != MP_OKAY) {
-       goto ERR;
-    }
-    if ((res = tma_mp_add(&tmp1, &a2, &tmp1)) != MP_OKAY) {
-       goto ERR;
-    }
-
-    if ((res = tma_mp_mul_2(&b0, &tmp2)) != MP_OKAY) {
-       goto ERR;
-    }
-    if ((res = tma_mp_add(&tmp2, &b1, &tmp2)) != MP_OKAY) {
-       goto ERR;
-    }
-    if ((res = tma_mp_mul_2(&tmp2, &tmp2)) != MP_OKAY) {
-       goto ERR;
-    }
-    if ((res = tma_mp_add(&tmp2, &b2, &tmp2)) != MP_OKAY) {
-       goto ERR;
-    }
-
-    if ((res = tma_mp_mul(&tmp1, &tmp2, &w1)) != MP_OKAY) {
-       goto ERR;
-    }
-
-    /* w3 = (a0 + 2(a1 + 2a2))(b0 + 2(b1 + 2b2)) */
-    if ((res = tma_mp_mul_2(&a2, &tmp1)) != MP_OKAY) {
-       goto ERR;
-    }
-    if ((res = tma_mp_add(&tmp1, &a1, &tmp1)) != MP_OKAY) {
-       goto ERR;
-    }
-    if ((res = tma_mp_mul_2(&tmp1, &tmp1)) != MP_OKAY) {
-       goto ERR;
-    }
-    if ((res = tma_mp_add(&tmp1, &a0, &tmp1)) != MP_OKAY) {
-       goto ERR;
-    }
-
-    if ((res = tma_mp_mul_2(&b2, &tmp2)) != MP_OKAY) {
-       goto ERR;
-    }
-    if ((res = tma_mp_add(&tmp2, &b1, &tmp2)) != MP_OKAY) {
-       goto ERR;
-    }
-    if ((res = tma_mp_mul_2(&tmp2, &tmp2)) != MP_OKAY) {
-       goto ERR;
-    }
-    if ((res = tma_mp_add(&tmp2, &b0, &tmp2)) != MP_OKAY) {
-       goto ERR;
-    }
-
-    if ((res = tma_mp_mul(&tmp1, &tmp2, &w3)) != MP_OKAY) {
-       goto ERR;
-    }
-
-
-    /* w2 = (a2 + a1 + a0)(b2 + b1 + b0) */
-    if ((res = tma_mp_add(&a2, &a1, &tmp1)) != MP_OKAY) {
-       goto ERR;
-    }
-    if ((res = tma_mp_add(&tmp1, &a0, &tmp1)) != MP_OKAY) {
-       goto ERR;
-    }
-    if ((res = tma_mp_add(&b2, &b1, &tmp2)) != MP_OKAY) {
-       goto ERR;
-    }
-    if ((res = tma_mp_add(&tmp2, &b0, &tmp2)) != MP_OKAY) {
-       goto ERR;
-    }
-    if ((res = tma_mp_mul(&tmp1, &tmp2, &w2)) != MP_OKAY) {
-       goto ERR;
-    }
-
-    /* now solve the matrix
-
-       0  0  0  0  1
-       1  2  4  8  16
-       1  1  1  1  1
-       16 8  4  2  1
-       1  0  0  0  0
-
-       using 12 subtractions, 4 shifts,
-              2 small divisions and 1 small multiplication
-     */
-
-     /* r1 - r4 */
-     if ((res = tma_mp_sub(&w1, &w4, &w1)) != MP_OKAY) {
-        goto ERR;
-     }
-     /* r3 - r0 */
-     if ((res = tma_mp_sub(&w3, &w0, &w3)) != MP_OKAY) {
-        goto ERR;
-     }
-     /* r1/2 */
-     if ((res = tma_mp_div_2(&w1, &w1)) != MP_OKAY) {
-        goto ERR;
-     }
-     /* r3/2 */
-     if ((res = tma_mp_div_2(&w3, &w3)) != MP_OKAY) {
-        goto ERR;
-     }
-     /* r2 - r0 - r4 */
-     if ((res = tma_mp_sub(&w2, &w0, &w2)) != MP_OKAY) {
-        goto ERR;
-     }
-     if ((res = tma_mp_sub(&w2, &w4, &w2)) != MP_OKAY) {
-        goto ERR;
-     }
-     /* r1 - r2 */
-     if ((res = tma_mp_sub(&w1, &w2, &w1)) != MP_OKAY) {
-        goto ERR;
-     }
-     /* r3 - r2 */
-     if ((res = tma_mp_sub(&w3, &w2, &w3)) != MP_OKAY) {
-        goto ERR;
-     }
-     /* r1 - 8r0 */
-     if ((res = tma_mp_mul_2d(&w0, 3, &tmp1)) != MP_OKAY) {
-        goto ERR;
-     }
-     if ((res = tma_mp_sub(&w1, &tmp1, &w1)) != MP_OKAY) {
-        goto ERR;
-     }
-     /* r3 - 8r4 */
-     if ((res = tma_mp_mul_2d(&w4, 3, &tmp1)) != MP_OKAY) {
-        goto ERR;
-     }
-     if ((res = tma_mp_sub(&w3, &tmp1, &w3)) != MP_OKAY) {
-        goto ERR;
-     }
-     /* 3r2 - r1 - r3 */
-     if ((res = tma_mp_mul_d(&w2, 3, &w2)) != MP_OKAY) {
-        goto ERR;
-     }
-     if ((res = tma_mp_sub(&w2, &w1, &w2)) != MP_OKAY) {
-        goto ERR;
-     }
-     if ((res = tma_mp_sub(&w2, &w3, &w2)) != MP_OKAY) {
-        goto ERR;
-     }
-     /* r1 - r2 */
-     if ((res = tma_mp_sub(&w1, &w2, &w1)) != MP_OKAY) {
-        goto ERR;
-     }
-     /* r3 - r2 */
-     if ((res = tma_mp_sub(&w3, &w2, &w3)) != MP_OKAY) {
-        goto ERR;
-     }
-     /* r1/3 */
-     if ((res = tma_mp_div_3(&w1, &w1, NULL)) != MP_OKAY) {
-        goto ERR;
-     }
-     /* r3/3 */
-     if ((res = tma_mp_div_3(&w3, &w3, NULL)) != MP_OKAY) {
-        goto ERR;
-     }
-
-     /* at this point shift W[n] by B*n */
-     if ((res = tma_mp_lshd(&w1, 1*B)) != MP_OKAY) {
-        goto ERR;
-     }
-     if ((res = tma_mp_lshd(&w2, 2*B)) != MP_OKAY) {
-        goto ERR;
-     }
-     if ((res = tma_mp_lshd(&w3, 3*B)) != MP_OKAY) {
-        goto ERR;
-     }
-     if ((res = tma_mp_lshd(&w4, 4*B)) != MP_OKAY) {
-        goto ERR;
-     }
-
-     if ((res = tma_mp_add(&w0, &w1, c)) != MP_OKAY) {
-        goto ERR;
-     }
-     if ((res = tma_mp_add(&w2, &w3, &tmp1)) != MP_OKAY) {
-        goto ERR;
-     }
-     if ((res = tma_mp_add(&w4, &tmp1, &tmp1)) != MP_OKAY) {
-        goto ERR;
-     }
-     if ((res = tma_mp_add(&tmp1, c, c)) != MP_OKAY) {
-        goto ERR;
-     }
-
-ERR:
-     tma_mp_clear_multi(&w0, &w1, &w2, &w3, &w4,
-                    &a0, &a1, &a2, &b0, &b1,
-                    &b2, &tmp1, &tmp2, NULL);
-     return res;
-}
-
-#endif
-
-/* $Source$ */
-/* $Revision$ */
-/* $Date$ */
-
-/* End: bn_tma_mp_toom_mul.c */
-
-/* Start: bn_tma_mp_toom_sqr.c */
-#include "tma.h"
-#ifdef BN_MP_TOOM_SQR_C
-/* LibTomMath, multiple-precision integer library -- Tom St Denis
- *
- * LibTomMath is a library that provides multiple-precision
- * integer arithmetic as well as number theoretic functionality.
- *
- * The library was designed directly after the MPI library by
- * Michael Fromberger but has been written from scratch with
- * additional optimizations in place.
- *
- * The library is free for all purposes without any express
- * guarantee it works.
- *
- * Tom St Denis, tomstdenis@gmail.com, http://libtom.org
- */
-
-/* squaring using Toom-Cook 3-way algorithm */
-int
-tma_mp_toom_sqr(tma_mp_int *a, tma_mp_int *b)
-{
-    tma_mp_int w0, w1, w2, w3, w4, tmp1, a0, a1, a2;
-    int res, B;
-
-    /* init temps */
-    if ((res = tma_mp_init_multi(&w0, &w1, &w2, &w3, &w4, &a0, &a1, &a2, &tmp1, NULL)) != MP_OKAY) {
-       return res;
-    }
-
-    /* B */
-    B = a->used / 3;
-
-    /* a = a2 * B**2 + a1 * B + a0 */
-    if ((res = tma_mp_mod_2d(a, DIGIT_BIT * B, &a0)) != MP_OKAY) {
-       goto ERR;
-    }
-
-    if ((res = tma_mp_copy(a, &a1)) != MP_OKAY) {
-       goto ERR;
-    }
-    tma_mp_rshd(&a1, B);
-    tma_mp_mod_2d(&a1, DIGIT_BIT * B, &a1);
-
-    if ((res = tma_mp_copy(a, &a2)) != MP_OKAY) {
-       goto ERR;
-    }
-    tma_mp_rshd(&a2, B*2);
-
-    /* w0 = a0*a0 */
-    if ((res = tma_mp_sqr(&a0, &w0)) != MP_OKAY) {
-       goto ERR;
-    }
-
-    /* w4 = a2 * a2 */
-    if ((res = tma_mp_sqr(&a2, &w4)) != MP_OKAY) {
-       goto ERR;
-    }
-
-    /* w1 = (a2 + 2(a1 + 2a0))**2 */
-    if ((res = tma_mp_mul_2(&a0, &tmp1)) != MP_OKAY) {
-       goto ERR;
-    }
-    if ((res = tma_mp_add(&tmp1, &a1, &tmp1)) != MP_OKAY) {
-       goto ERR;
-    }
-    if ((res = tma_mp_mul_2(&tmp1, &tmp1)) != MP_OKAY) {
-       goto ERR;
-    }
-    if ((res = tma_mp_add(&tmp1, &a2, &tmp1)) != MP_OKAY) {
-       goto ERR;
-    }
-
-    if ((res = tma_mp_sqr(&tmp1, &w1)) != MP_OKAY) {
-       goto ERR;
-    }
-
-    /* w3 = (a0 + 2(a1 + 2a2))**2 */
-    if ((res = tma_mp_mul_2(&a2, &tmp1)) != MP_OKAY) {
-       goto ERR;
-    }
-    if ((res = tma_mp_add(&tmp1, &a1, &tmp1)) != MP_OKAY) {
-       goto ERR;
-    }
-    if ((res = tma_mp_mul_2(&tmp1, &tmp1)) != MP_OKAY) {
-       goto ERR;
-    }
-    if ((res = tma_mp_add(&tmp1, &a0, &tmp1)) != MP_OKAY) {
-       goto ERR;
-    }
-
-    if ((res = tma_mp_sqr(&tmp1, &w3)) != MP_OKAY) {
-       goto ERR;
-    }
-
-
-    /* w2 = (a2 + a1 + a0)**2 */
-    if ((res = tma_mp_add(&a2, &a1, &tmp1)) != MP_OKAY) {
-       goto ERR;
-    }
-    if ((res = tma_mp_add(&tmp1, &a0, &tmp1)) != MP_OKAY) {
-       goto ERR;
-    }
-    if ((res = tma_mp_sqr(&tmp1, &w2)) != MP_OKAY) {
-       goto ERR;
-    }
-
-    /* now solve the matrix
-
-       0  0  0  0  1
-       1  2  4  8  16
-       1  1  1  1  1
-       16 8  4  2  1
-       1  0  0  0  0
-
-       using 12 subtractions, 4 shifts, 2 small divisions and 1 small multiplication.
-     */
-
-     /* r1 - r4 */
-     if ((res = tma_mp_sub(&w1, &w4, &w1)) != MP_OKAY) {
-        goto ERR;
-     }
-     /* r3 - r0 */
-     if ((res = tma_mp_sub(&w3, &w0, &w3)) != MP_OKAY) {
-        goto ERR;
-     }
-     /* r1/2 */
-     if ((res = tma_mp_div_2(&w1, &w1)) != MP_OKAY) {
-        goto ERR;
-     }
-     /* r3/2 */
-     if ((res = tma_mp_div_2(&w3, &w3)) != MP_OKAY) {
-        goto ERR;
-     }
-     /* r2 - r0 - r4 */
-     if ((res = tma_mp_sub(&w2, &w0, &w2)) != MP_OKAY) {
-        goto ERR;
-     }
-     if ((res = tma_mp_sub(&w2, &w4, &w2)) != MP_OKAY) {
-        goto ERR;
-     }
-     /* r1 - r2 */
-     if ((res = tma_mp_sub(&w1, &w2, &w1)) != MP_OKAY) {
-        goto ERR;
-     }
-     /* r3 - r2 */
-     if ((res = tma_mp_sub(&w3, &w2, &w3)) != MP_OKAY) {
-        goto ERR;
-     }
-     /* r1 - 8r0 */
-     if ((res = tma_mp_mul_2d(&w0, 3, &tmp1)) != MP_OKAY) {
-        goto ERR;
-     }
-     if ((res = tma_mp_sub(&w1, &tmp1, &w1)) != MP_OKAY) {
-        goto ERR;
-     }
-     /* r3 - 8r4 */
-     if ((res = tma_mp_mul_2d(&w4, 3, &tmp1)) != MP_OKAY) {
-        goto ERR;
-     }
-     if ((res = tma_mp_sub(&w3, &tmp1, &w3)) != MP_OKAY) {
-        goto ERR;
-     }
-     /* 3r2 - r1 - r3 */
-     if ((res = tma_mp_mul_d(&w2, 3, &w2)) != MP_OKAY) {
-        goto ERR;
-     }
-     if ((res = tma_mp_sub(&w2, &w1, &w2)) != MP_OKAY) {
-        goto ERR;
-     }
-     if ((res = tma_mp_sub(&w2, &w3, &w2)) != MP_OKAY) {
-        goto ERR;
-     }
-     /* r1 - r2 */
-     if ((res = tma_mp_sub(&w1, &w2, &w1)) != MP_OKAY) {
-        goto ERR;
-     }
-     /* r3 - r2 */
-     if ((res = tma_mp_sub(&w3, &w2, &w3)) != MP_OKAY) {
-        goto ERR;
-     }
-     /* r1/3 */
-     if ((res = tma_mp_div_3(&w1, &w1, NULL)) != MP_OKAY) {
-        goto ERR;
-     }
-     /* r3/3 */
-     if ((res = tma_mp_div_3(&w3, &w3, NULL)) != MP_OKAY) {
-        goto ERR;
-     }
-
-     /* at this point shift W[n] by B*n */
-     if ((res = tma_mp_lshd(&w1, 1*B)) != MP_OKAY) {
-        goto ERR;
-     }
-     if ((res = tma_mp_lshd(&w2, 2*B)) != MP_OKAY) {
-        goto ERR;
-     }
-     if ((res = tma_mp_lshd(&w3, 3*B)) != MP_OKAY) {
-        goto ERR;
-     }
-     if ((res = tma_mp_lshd(&w4, 4*B)) != MP_OKAY) {
-        goto ERR;
-     }
-
-     if ((res = tma_mp_add(&w0, &w1, b)) != MP_OKAY) {
-        goto ERR;
-     }
-     if ((res = tma_mp_add(&w2, &w3, &tmp1)) != MP_OKAY) {
-        goto ERR;
-     }
-     if ((res = tma_mp_add(&w4, &tmp1, &tmp1)) != MP_OKAY) {
-        goto ERR;
-     }
-     if ((res = tma_mp_add(&tmp1, b, b)) != MP_OKAY) {
-        goto ERR;
-     }
-
-ERR:
-     tma_mp_clear_multi(&w0, &w1, &w2, &w3, &w4, &a0, &a1, &a2, &tmp1, NULL);
-     return res;
-}
-
-#endif
-
-/* $Source$ */
-/* $Revision$ */
-/* $Date$ */
-
-/* End: bn_tma_mp_toom_sqr.c */
-
-/* Start: bn_tma_mp_toradix.c */
-#include "tma.h"
-#ifdef BN_MP_TORADIX_C
-/* LibTomMath, multiple-precision integer library -- Tom St Denis
- *
- * LibTomMath is a library that provides multiple-precision
- * integer arithmetic as well as number theoretic functionality.
- *
- * The library was designed directly after the MPI library by
- * Michael Fromberger but has been written from scratch with
- * additional optimizations in place.
- *
- * The library is free for all purposes without any express
- * guarantee it works.
- *
- * Tom St Denis, tomstdenis@gmail.com, http://libtom.org
- */
-
-/* stores a bignum as a ASCII string in a given radix (2..64) */
-int tma_mp_toradix (tma_mp_int * a, char *str, int radix)
-{
-  int     res, digs;
-  tma_mp_int  t;
-  tma_mp_digit d;
-  char   *_s = str;
-
-  /* check range of the radix */
-  if (radix < 2 || radix > 64) {
-    return MP_VAL;
-  }
-
-  /* quick out if its zero */
-  if (tma_mp_iszero(a) == 1) {
-     *str++ = '0';
-     *str = '\0';
-     return MP_OKAY;
-  }
-
-  if ((res = tma_mp_init_copy (&t, a)) != MP_OKAY) {
-    return res;
-  }
-
-  /* if it is negative output a - */
-  if (t.sign == MP_NEG) {
-    ++_s;
-    *str++ = '-';
-    t.sign = MP_ZPOS;
-  }
-
-  digs = 0;
-  while (tma_mp_iszero (&t) == 0) {
-    if ((res = tma_mp_div_d (&t, (tma_mp_digit) radix, &t, &d)) != MP_OKAY) {
-      tma_mp_clear (&t);
-      return res;
-    }
-    *str++ = tma_mp_s_rmap[d];
-    ++digs;
-  }
-
-  /* reverse the digits of the string.  In this case _s points
-   * to the first digit [exluding the sign] of the number]
-   */
-  bn_reverse ((unsigned char *)_s, digs);
-
-  /* append a NULL so the string is properly terminated */
-  *str = '\0';
-
-  tma_mp_clear (&t);
-  return MP_OKAY;
-}
-
-#endif
-
-/* $Source$ */
-/* $Revision$ */
-/* $Date$ */
-
-/* End: bn_tma_mp_toradix.c */
-
-/* Start: bn_tma_mp_toradix_n.c */
-#include "tma.h"
-#ifdef BN_MP_TORADIX_N_C
-/* LibTomMath, multiple-precision integer library -- Tom St Denis
- *
- * LibTomMath is a library that provides multiple-precision
- * integer arithmetic as well as number theoretic functionality.
- *
- * The library was designed directly after the MPI library by
- * Michael Fromberger but has been written from scratch with
- * additional optimizations in place.
- *
- * The library is free for all purposes without any express
- * guarantee it works.
- *
- * Tom St Denis, tomstdenis@gmail.com, http://libtom.org
- */
-
-/* stores a bignum as a ASCII string in a given radix (2..64)
- *
- * Stores upto maxlen-1 chars and always a NULL byte
- */
-int tma_mp_toradix_n(tma_mp_int * a, char *str, int radix, int maxlen)
-{
-  int     res, digs;
-  tma_mp_int  t;
-  tma_mp_digit d;
-  char   *_s = str;
-
-  /* check range of the maxlen, radix */
-  if (maxlen < 2 || radix < 2 || radix > 64) {
-    return MP_VAL;
-  }
-
-  /* quick out if its zero */
-  if (tma_mp_iszero(a) == MP_YES) {
-     *str++ = '0';
-     *str = '\0';
-     return MP_OKAY;
-  }
-
-  if ((res = tma_mp_init_copy (&t, a)) != MP_OKAY) {
-    return res;
-  }
-
-  /* if it is negative output a - */
-  if (t.sign == MP_NEG) {
-    /* we have to reverse our digits later... but not the - sign!! */
-    ++_s;
-
-    /* store the flag and mark the number as positive */
-    *str++ = '-';
-    t.sign = MP_ZPOS;
-
-    /* subtract a char */
-    --maxlen;
-  }
-
-  digs = 0;
-  while (tma_mp_iszero (&t) == 0) {
-    if (--maxlen < 1) {
-       /* no more room */
-       break;
-    }
-    if ((res = tma_mp_div_d (&t, (tma_mp_digit) radix, &t, &d)) != MP_OKAY) {
-      tma_mp_clear (&t);
-      return res;
-    }
-    *str++ = tma_mp_s_rmap[d];
-    ++digs;
-  }
-
-  /* reverse the digits of the string.  In this case _s points
-   * to the first digit [exluding the sign] of the number
-   */
-  bn_reverse ((unsigned char *)_s, digs);
-
-  /* append a NULL so the string is properly terminated */
-  *str = '\0';
-
-  tma_mp_clear (&t);
-  return MP_OKAY;
-}
-
-#endif
-
-/* $Source$ */
-/* $Revision$ */
-/* $Date$ */
-
-/* End: bn_tma_mp_toradix_n.c */
-
-/* Start: bn_tma_mp_unsigned_bin_size.c */
-#include "tma.h"
-#ifdef BN_MP_UNSIGNED_BIN_SIZE_C
-/* LibTomMath, multiple-precision integer library -- Tom St Denis
- *
- * LibTomMath is a library that provides multiple-precision
- * integer arithmetic as well as number theoretic functionality.
- *
- * The library was designed directly after the MPI library by
- * Michael Fromberger but has been written from scratch with
- * additional optimizations in place.
- *
- * The library is free for all purposes without any express
- * guarantee it works.
- *
- * Tom St Denis, tomstdenis@gmail.com, http://libtom.org
- */
-
-/* get the size for an unsigned equivalent */
-int tma_mp_unsigned_bin_size (tma_mp_int * a)
-{
-  int     size = tma_mp_count_bits (a);
-  return (size / 8 + ((size & 7) != 0 ? 1 : 0));
-}
-#endif
-
-/* $Source$ */
-/* $Revision$ */
-/* $Date$ */
-
-/* End: bn_tma_mp_unsigned_bin_size.c */
-
-/* Start: bn_tma_mp_xor.c */
-#include "tma.h"
-#ifdef BN_MP_XOR_C
-/* LibTomMath, multiple-precision integer library -- Tom St Denis
- *
- * LibTomMath is a library that provides multiple-precision
- * integer arithmetic as well as number theoretic functionality.
- *
- * The library was designed directly after the MPI library by
- * Michael Fromberger but has been written from scratch with
- * additional optimizations in place.
- *
- * The library is free for all purposes without any express
- * guarantee it works.
- *
- * Tom St Denis, tomstdenis@gmail.com, http://libtom.org
- */
-
-/* XOR two ints together */
-int
-tma_mp_xor (tma_mp_int * a, tma_mp_int * b, tma_mp_int * c)
-{
-  int     res, ix, px;
-  tma_mp_int  t, *x;
-
-  if (a->used > b->used) {
-    if ((res = tma_mp_init_copy (&t, a)) != MP_OKAY) {
-      return res;
-    }
-    px = b->used;
-    x = b;
-  } else {
-    if ((res = tma_mp_init_copy (&t, b)) != MP_OKAY) {
-      return res;
-    }
-    px = a->used;
-    x = a;
-  }
-
-  for (ix = 0; ix < px; ix++) {
-     t.dp[ix] ^= x->dp[ix];
-  }
-  tma_mp_clamp (&t);
-  tma_mp_exch (c, &t);
-  tma_mp_clear (&t);
-  return MP_OKAY;
-}
-#endif
-
-/* $Source$ */
-/* $Revision$ */
-/* $Date$ */
-
-/* End: bn_tma_mp_xor.c */
-
-/* Start: bn_tma_mp_zero.c */
-#include "tma.h"
-#ifdef BN_MP_ZERO_C
-/* LibTomMath, multiple-precision integer library -- Tom St Denis
- *
- * LibTomMath is a library that provides multiple-precision
- * integer arithmetic as well as number theoretic functionality.
- *
- * The library was designed directly after the MPI library by
- * Michael Fromberger but has been written from scratch with
- * additional optimizations in place.
- *
- * The library is free for all purposes without any express
- * guarantee it works.
- *
- * Tom St Denis, tomstdenis@gmail.com, http://libtom.org
- */
-
-/* set to zero */
-void tma_mp_zero (tma_mp_int * a)
-{
-  int       n;
-  tma_mp_digit *tmp;
-
-  a->sign = MP_ZPOS;
-  a->used = 0;
-
-  tmp = a->dp;
-  for (n = 0; n < a->alloc; n++) {
-     *tmp++ = 0;
-  }
-}
-#endif
-
-/* $Source$ */
-/* $Revision$ */
-/* $Date$ */
-
-/* End: bn_tma_mp_zero.c */
-
-/* Start: bn_prime_tab.c */
-#include "tma.h"
-#ifdef BN_PRIME_TAB_C
-/* LibTomMath, multiple-precision integer library -- Tom St Denis
- *
- * LibTomMath is a library that provides multiple-precision
- * integer arithmetic as well as number theoretic functionality.
- *
- * The library was designed directly after the MPI library by
- * Michael Fromberger but has been written from scratch with
- * additional optimizations in place.
- *
- * The library is free for all purposes without any express
- * guarantee it works.
- *
- * Tom St Denis, tomstdenis@gmail.com, http://libtom.org
- */
-const tma_mp_digit ltm_prime_tab[] = {
-  0x0002, 0x0003, 0x0005, 0x0007, 0x000B, 0x000D, 0x0011, 0x0013,
-  0x0017, 0x001D, 0x001F, 0x0025, 0x0029, 0x002B, 0x002F, 0x0035,
-  0x003B, 0x003D, 0x0043, 0x0047, 0x0049, 0x004F, 0x0053, 0x0059,
-  0x0061, 0x0065, 0x0067, 0x006B, 0x006D, 0x0071, 0x007F,
-#ifndef MP_8BIT
-  0x0083,
-  0x0089, 0x008B, 0x0095, 0x0097, 0x009D, 0x00A3, 0x00A7, 0x00AD,
-  0x00B3, 0x00B5, 0x00BF, 0x00C1, 0x00C5, 0x00C7, 0x00D3, 0x00DF,
-  0x00E3, 0x00E5, 0x00E9, 0x00EF, 0x00F1, 0x00FB, 0x0101, 0x0107,
-  0x010D, 0x010F, 0x0115, 0x0119, 0x011B, 0x0125, 0x0133, 0x0137,
-
-  0x0139, 0x013D, 0x014B, 0x0151, 0x015B, 0x015D, 0x0161, 0x0167,
-  0x016F, 0x0175, 0x017B, 0x017F, 0x0185, 0x018D, 0x0191, 0x0199,
-  0x01A3, 0x01A5, 0x01AF, 0x01B1, 0x01B7, 0x01BB, 0x01C1, 0x01C9,
-  0x01CD, 0x01CF, 0x01D3, 0x01DF, 0x01E7, 0x01EB, 0x01F3, 0x01F7,
-  0x01FD, 0x0209, 0x020B, 0x021D, 0x0223, 0x022D, 0x0233, 0x0239,
-  0x023B, 0x0241, 0x024B, 0x0251, 0x0257, 0x0259, 0x025F, 0x0265,
-  0x0269, 0x026B, 0x0277, 0x0281, 0x0283, 0x0287, 0x028D, 0x0293,
-  0x0295, 0x02A1, 0x02A5, 0x02AB, 0x02B3, 0x02BD, 0x02C5, 0x02CF,
-
-  0x02D7, 0x02DD, 0x02E3, 0x02E7, 0x02EF, 0x02F5, 0x02F9, 0x0301,
-  0x0305, 0x0313, 0x031D, 0x0329, 0x032B, 0x0335, 0x0337, 0x033B,
-  0x033D, 0x0347, 0x0355, 0x0359, 0x035B, 0x035F, 0x036D, 0x0371,
-  0x0373, 0x0377, 0x038B, 0x038F, 0x0397, 0x03A1, 0x03A9, 0x03AD,
-  0x03B3, 0x03B9, 0x03C7, 0x03CB, 0x03D1, 0x03D7, 0x03DF, 0x03E5,
-  0x03F1, 0x03F5, 0x03FB, 0x03FD, 0x0407, 0x0409, 0x040F, 0x0419,
-  0x041B, 0x0425, 0x0427, 0x042D, 0x043F, 0x0443, 0x0445, 0x0449,
-  0x044F, 0x0455, 0x045D, 0x0463, 0x0469, 0x047F, 0x0481, 0x048B,
-
-  0x0493, 0x049D, 0x04A3, 0x04A9, 0x04B1, 0x04BD, 0x04C1, 0x04C7,
-  0x04CD, 0x04CF, 0x04D5, 0x04E1, 0x04EB, 0x04FD, 0x04FF, 0x0503,
-  0x0509, 0x050B, 0x0511, 0x0515, 0x0517, 0x051B, 0x0527, 0x0529,
-  0x052F, 0x0551, 0x0557, 0x055D, 0x0565, 0x0577, 0x0581, 0x058F,
-  0x0593, 0x0595, 0x0599, 0x059F, 0x05A7, 0x05AB, 0x05AD, 0x05B3,
-  0x05BF, 0x05C9, 0x05CB, 0x05CF, 0x05D1, 0x05D5, 0x05DB, 0x05E7,
-  0x05F3, 0x05FB, 0x0607, 0x060D, 0x0611, 0x0617, 0x061F, 0x0623,
-  0x062B, 0x062F, 0x063D, 0x0641, 0x0647, 0x0649, 0x064D, 0x0653
-#endif
-};
-#endif
-
-/* $Source$ */
-/* $Revision$ */
-/* $Date$ */
-
-/* End: bn_prime_tab.c */
-
-/* Start: bn_reverse.c */
-#include "tma.h"
-#ifdef BN_REVERSE_C
-/* LibTomMath, multiple-precision integer library -- Tom St Denis
- *
- * LibTomMath is a library that provides multiple-precision
- * integer arithmetic as well as number theoretic functionality.
- *
- * The library was designed directly after the MPI library by
- * Michael Fromberger but has been written from scratch with
- * additional optimizations in place.
- *
- * The library is free for all purposes without any express
- * guarantee it works.
- *
- * Tom St Denis, tomstdenis@gmail.com, http://libtom.org
- */
-
-/* reverse an array, used for radix code */
-void
-bn_reverse (unsigned char *s, int len)
-{
-  int     ix, iy;
-  unsigned char t;
-
-  ix = 0;
-  iy = len - 1;
-  while (ix < iy) {
-    t     = s[ix];
-    s[ix] = s[iy];
-    s[iy] = t;
-    ++ix;
-    --iy;
-  }
-}
-#endif
-
-/* $Source$ */
-/* $Revision$ */
-/* $Date$ */
-
-/* End: bn_reverse.c */
-
-/* Start: bn_s_tma_mp_add.c */
-#include "tma.h"
-#ifdef BN_S_MP_ADD_C
-/* LibTomMath, multiple-precision integer library -- Tom St Denis
- *
- * LibTomMath is a library that provides multiple-precision
- * integer arithmetic as well as number theoretic functionality.
- *
- * The library was designed directly after the MPI library by
- * Michael Fromberger but has been written from scratch with
- * additional optimizations in place.
- *
- * The library is free for all purposes without any express
- * guarantee it works.
- *
- * Tom St Denis, tomstdenis@gmail.com, http://libtom.org
- */
-
-/* low level addition, based on HAC pp.594, Algorithm 14.7 */
-int
-s_tma_mp_add (tma_mp_int * a, tma_mp_int * b, tma_mp_int * c)
-{
-  tma_mp_int *x;
-  int     olduse, res, min, max;
-
-  /* find sizes, we let |a| <= |b| which means we have to sort
-   * them.  "x" will point to the input with the most digits
-   */
-  if (a->used > b->used) {
-    min = b->used;
-    max = a->used;
-    x = a;
-  } else {
-    min = a->used;
-    max = b->used;
-    x = b;
-  }
-
-  /* init result */
-  if (c->alloc < max + 1) {
-    if ((res = tma_mp_grow (c, max + 1)) != MP_OKAY) {
-      return res;
-    }
-  }
-
-  /* get old used digit count and set new one */
-  olduse = c->used;
-  c->used = max + 1;
-
-  {
-    register tma_mp_digit u, *tmpa, *tmpb, *tmpc;
-    register int i;
-
-    /* alias for digit pointers */
-
-    /* first input */
-    tmpa = a->dp;
-
-    /* second input */
-    tmpb = b->dp;
-
-    /* destination */
-    tmpc = c->dp;
-
-    /* zero the carry */
-    u = 0;
-    for (i = 0; i < min; i++) {
-      /* Compute the sum at one digit, T[i] = A[i] + B[i] + U */
-      *tmpc = *tmpa++ + *tmpb++ + u;
-
-      /* U = carry bit of T[i] */
-      u = *tmpc >> ((tma_mp_digit)DIGIT_BIT);
-
-      /* take away carry bit from T[i] */
-      *tmpc++ &= MP_MASK;
-    }
-
-    /* now copy higher words if any, that is in A+B
-     * if A or B has more digits add those in
-     */
-    if (min != max) {
-      for (; i < max; i++) {
-        /* T[i] = X[i] + U */
-        *tmpc = x->dp[i] + u;
-
-        /* U = carry bit of T[i] */
-        u = *tmpc >> ((tma_mp_digit)DIGIT_BIT);
-
-        /* take away carry bit from T[i] */
-        *tmpc++ &= MP_MASK;
-      }
-    }
-
-    /* add carry */
-    *tmpc++ = u;
-
-    /* clear digits above oldused */
-    for (i = c->used; i < olduse; i++) {
-      *tmpc++ = 0;
-    }
-  }
-
-  tma_mp_clamp (c);
-  return MP_OKAY;
-}
-#endif
-
-/* $Source$ */
-/* $Revision$ */
-/* $Date$ */
-
-/* End: bn_s_tma_mp_add.c */
-
-/* Start: bn_s_tma_mp_exptmod.c */
-#include "tma.h"
-#ifdef BN_S_MP_EXPTMOD_C
-/* LibTomMath, multiple-precision integer library -- Tom St Denis
- *
- * LibTomMath is a library that provides multiple-precision
- * integer arithmetic as well as number theoretic functionality.
- *
- * The library was designed directly after the MPI library by
- * Michael Fromberger but has been written from scratch with
- * additional optimizations in place.
- *
- * The library is free for all purposes without any express
- * guarantee it works.
- *
- * Tom St Denis, tomstdenis@gmail.com, http://libtom.org
- */
-#ifdef MP_LOW_MEM
-   #define TAB_SIZE 32
-#else
-   #define TAB_SIZE 256
-#endif
-
-int s_tma_mp_exptmod (tma_mp_int * G, tma_mp_int * X, tma_mp_int * P, tma_mp_int * Y, int redmode)
-{
-  tma_mp_int  M[TAB_SIZE], res, mu;
-  tma_mp_digit buf;
-  int     err, bitbuf, bitcpy, bitcnt, mode, digidx, x, y, winsize;
-  int (*redux)(tma_mp_int*,tma_mp_int*,tma_mp_int*);
-
-  /* find window size */
-  x = tma_mp_count_bits (X);
-  if (x <= 7) {
-    winsize = 2;
-  } else if (x <= 36) {
-    winsize = 3;
-  } else if (x <= 140) {
-    winsize = 4;
-  } else if (x <= 450) {
-    winsize = 5;
-  } else if (x <= 1303) {
-    winsize = 6;
-  } else if (x <= 3529) {
-    winsize = 7;
-  } else {
-    winsize = 8;
-  }
-
-#ifdef MP_LOW_MEM
-    if (winsize > 5) {
-       winsize = 5;
-    }
-#endif
-
-  /* init M array */
-  /* init first cell */
-  if ((err = tma_mp_init(&M[1])) != MP_OKAY) {
-     return err;
-  }
-
-  /* now init the second half of the array */
-  for (x = 1<<(winsize-1); x < (1 << winsize); x++) {
-    if ((err = tma_mp_init(&M[x])) != MP_OKAY) {
-      for (y = 1<<(winsize-1); y < x; y++) {
-        tma_mp_clear (&M[y]);
-      }
-      tma_mp_clear(&M[1]);
-      return err;
-    }
-  }
-
-  /* create mu, used for Barrett reduction */
-  if ((err = tma_mp_init (&mu)) != MP_OKAY) {
-    goto LBL_M;
-  }
-
-  if (redmode == 0) {
-     if ((err = tma_mp_reduce_setup (&mu, P)) != MP_OKAY) {
-        goto LBL_MU;
-     }
-     redux = tma_mp_reduce;
-  } else {
-     if ((err = tma_mp_reduce_2k_setup_l (P, &mu)) != MP_OKAY) {
-        goto LBL_MU;
-     }
-     redux = tma_mp_reduce_2k_l;
-  }
-
-  /* create M table
-   *
-   * The M table contains powers of the base,
-   * e.g. M[x] = G**x mod P
-   *
-   * The first half of the table is not
-   * computed though accept for M[0] and M[1]
-   */
-  if ((err = tma_mp_mod (G, P, &M[1])) != MP_OKAY) {
-    goto LBL_MU;
-  }
-
-  /* compute the value at M[1<<(winsize-1)] by squaring
-   * M[1] (winsize-1) times
-   */
-  if ((err = tma_mp_copy (&M[1], &M[1 << (winsize - 1)])) != MP_OKAY) {
-    goto LBL_MU;
-  }
-
-  for (x = 0; x < (winsize - 1); x++) {
-    /* square it */
-    if ((err = tma_mp_sqr (&M[1 << (winsize - 1)],
-                       &M[1 << (winsize - 1)])) != MP_OKAY) {
-      goto LBL_MU;
-    }
-
-    /* reduce modulo P */
-    if ((err = redux (&M[1 << (winsize - 1)], P, &mu)) != MP_OKAY) {
-      goto LBL_MU;
-    }
-  }
-
-  /* create upper table, that is M[x] = M[x-1] * M[1] (mod P)
-   * for x = (2**(winsize - 1) + 1) to (2**winsize - 1)
-   */
-  for (x = (1 << (winsize - 1)) + 1; x < (1 << winsize); x++) {
-    if ((err = tma_mp_mul (&M[x - 1], &M[1], &M[x])) != MP_OKAY) {
-      goto LBL_MU;
-    }
-    if ((err = redux (&M[x], P, &mu)) != MP_OKAY) {
-      goto LBL_MU;
-    }
-  }
-
-  /* setup result */
-  if ((err = tma_mp_init (&res)) != MP_OKAY) {
-    goto LBL_MU;
-  }
-  tma_mp_set (&res, 1);
-
-  /* set initial mode and bit cnt */
-  mode   = 0;
-  bitcnt = 1;
-  buf    = 0;
-  digidx = X->used - 1;
-  bitcpy = 0;
-  bitbuf = 0;
-
-  for (;;) {
-    /* grab next digit as required */
-    if (--bitcnt == 0) {
-      /* if digidx == -1 we are out of digits */
-      if (digidx == -1) {
-        break;
-      }
-      /* read next digit and reset the bitcnt */
-      buf    = X->dp[digidx--];
-      bitcnt = (int) DIGIT_BIT;
-    }
-
-    /* grab the next msb from the exponent */
-    y     = (buf >> (tma_mp_digit)(DIGIT_BIT - 1)) & 1;
-    buf <<= (tma_mp_digit)1;
-
-    /* if the bit is zero and mode == 0 then we ignore it
-     * These represent the leading zero bits before the first 1 bit
-     * in the exponent.  Technically this opt is not required but it
-     * does lower the # of trivial squaring/reductions used
-     */
-    if (mode == 0 && y == 0) {
-      continue;
-    }
-
-    /* if the bit is zero and mode == 1 then we square */
-    if (mode == 1 && y == 0) {
-      if ((err = tma_mp_sqr (&res, &res)) != MP_OKAY) {
-        goto LBL_RES;
-      }
-      if ((err = redux (&res, P, &mu)) != MP_OKAY) {
-        goto LBL_RES;
-      }
-      continue;
-    }
-
-    /* else we add it to the window */
-    bitbuf |= (y << (winsize - ++bitcpy));
-    mode    = 2;
-
-    if (bitcpy == winsize) {
-      /* ok window is filled so square as required and multiply  */
-      /* square first */
-      for (x = 0; x < winsize; x++) {
-        if ((err = tma_mp_sqr (&res, &res)) != MP_OKAY) {
-          goto LBL_RES;
-        }
-        if ((err = redux (&res, P, &mu)) != MP_OKAY) {
-          goto LBL_RES;
-        }
-      }
-
-      /* then multiply */
-      if ((err = tma_mp_mul (&res, &M[bitbuf], &res)) != MP_OKAY) {
-        goto LBL_RES;
-      }
-      if ((err = redux (&res, P, &mu)) != MP_OKAY) {
-        goto LBL_RES;
-      }
-
-      /* empty window and reset */
-      bitcpy = 0;
-      bitbuf = 0;
-      mode   = 1;
-    }
-  }
-
-  /* if bits remain then square/multiply */
-  if (mode == 2 && bitcpy > 0) {
-    /* square then multiply if the bit is set */
-    for (x = 0; x < bitcpy; x++) {
-      if ((err = tma_mp_sqr (&res, &res)) != MP_OKAY) {
-        goto LBL_RES;
-      }
-      if ((err = redux (&res, P, &mu)) != MP_OKAY) {
-        goto LBL_RES;
-      }
-
-      bitbuf <<= 1;
-      if ((bitbuf & (1 << winsize)) != 0) {
-        /* then multiply */
-        if ((err = tma_mp_mul (&res, &M[1], &res)) != MP_OKAY) {
-          goto LBL_RES;
-        }
-        if ((err = redux (&res, P, &mu)) != MP_OKAY) {
-          goto LBL_RES;
-        }
-      }
-    }
-  }
-
-  tma_mp_exch (&res, Y);
-  err = MP_OKAY;
-LBL_RES:tma_mp_clear (&res);
-LBL_MU:tma_mp_clear (&mu);
-LBL_M:
-  tma_mp_clear(&M[1]);
-  for (x = 1<<(winsize-1); x < (1 << winsize); x++) {
-    tma_mp_clear (&M[x]);
-  }
-  return err;
-}
-#endif
-
-/* $Source$ */
-/* $Revision$ */
-/* $Date$ */
-
-/* End: bn_s_tma_mp_exptmod.c */
-
-/* Start: bn_s_tma_mp_mul_digs.c */
-#include "tma.h"
-#ifdef BN_S_MP_MUL_DIGS_C
-/* LibTomMath, multiple-precision integer library -- Tom St Denis
- *
- * LibTomMath is a library that provides multiple-precision
- * integer arithmetic as well as number theoretic functionality.
- *
- * The library was designed directly after the MPI library by
- * Michael Fromberger but has been written from scratch with
- * additional optimizations in place.
- *
- * The library is free for all purposes without any express
- * guarantee it works.
- *
- * Tom St Denis, tomstdenis@gmail.com, http://libtom.org
- */
-
-/* multiplies |a| * |b| and only computes upto digs digits of result
- * HAC pp. 595, Algorithm 14.12  Modified so you can control how
- * many digits of output are created.
- */
-int s_tma_mp_mul_digs (tma_mp_int * a, tma_mp_int * b, tma_mp_int * c, int digs)
-{
-  tma_mp_int  t;
-  int     res, pa, pb, ix, iy;
-  tma_mp_digit u;
-  tma_mp_word r;
-  tma_mp_digit tmpx, *tmpt, *tmpy;
-
-  /* can we use the fast multiplier? */
-  if (((digs) < MP_WARRAY) &&
-      MIN (a->used, b->used) <
-          (1 << ((CHAR_BIT * sizeof (tma_mp_word)) - (2 * DIGIT_BIT)))) {
-    return fast_s_tma_mp_mul_digs (a, b, c, digs);
-  }
-
-  if ((res = tma_mp_init_size (&t, digs)) != MP_OKAY) {
-    return res;
-  }
-  t.used = digs;
-
-  /* compute the digits of the product directly */
-  pa = a->used;
-  for (ix = 0; ix < pa; ix++) {
-    /* set the carry to zero */
-    u = 0;
-
-    /* limit ourselves to making digs digits of output */
-    pb = MIN (b->used, digs - ix);
-
-    /* setup some aliases */
-    /* copy of the digit from a used within the nested loop */
-    tmpx = a->dp[ix];
-
-    /* an alias for the destination shifted ix places */
-    tmpt = t.dp + ix;
-
-    /* an alias for the digits of b */
-    tmpy = b->dp;
-
-    /* compute the columns of the output and propagate the carry */
-    for (iy = 0; iy < pb; iy++) {
-      /* compute the column as a tma_mp_word */
-      r       = ((tma_mp_word)*tmpt) +
-                ((tma_mp_word)tmpx) * ((tma_mp_word)*tmpy++) +
-                ((tma_mp_word) u);
-
-      /* the new column is the lower part of the result */
-      *tmpt++ = (tma_mp_digit) (r & ((tma_mp_word) MP_MASK));
-
-      /* get the carry word from the result */
-      u       = (tma_mp_digit) (r >> ((tma_mp_word) DIGIT_BIT));
-    }
-    /* set carry if it is placed below digs */
-    if (ix + iy < digs) {
-      *tmpt = u;
-    }
-  }
-
-  tma_mp_clamp (&t);
-  tma_mp_exch (&t, c);
-
-  tma_mp_clear (&t);
-  return MP_OKAY;
-}
-#endif
-
-/* $Source$ */
-/* $Revision$ */
-/* $Date$ */
-
-/* End: bn_s_tma_mp_mul_digs.c */
-
-/* Start: bn_s_tma_mp_mul_high_digs.c */
-#include "tma.h"
-#ifdef BN_S_MP_MUL_HIGH_DIGS_C
-/* LibTomMath, multiple-precision integer library -- Tom St Denis
- *
- * LibTomMath is a library that provides multiple-precision
- * integer arithmetic as well as number theoretic functionality.
- *
- * The library was designed directly after the MPI library by
- * Michael Fromberger but has been written from scratch with
- * additional optimizations in place.
- *
- * The library is free for all purposes without any express
- * guarantee it works.
- *
- * Tom St Denis, tomstdenis@gmail.com, http://libtom.org
- */
-
-/* multiplies |a| * |b| and does not compute the lower digs digits
- * [meant to get the higher part of the product]
- */
-int
-s_tma_mp_mul_high_digs (tma_mp_int * a, tma_mp_int * b, tma_mp_int * c, int digs)
-{
-  tma_mp_int  t;
-  int     res, pa, pb, ix, iy;
-  tma_mp_digit u;
-  tma_mp_word r;
-  tma_mp_digit tmpx, *tmpt, *tmpy;
-
-  /* can we use the fast multiplier? */
-#ifdef BN_FAST_S_MP_MUL_HIGH_DIGS_C
-  if (((a->used + b->used + 1) < MP_WARRAY)
-      && MIN (a->used, b->used) < (1 << ((CHAR_BIT * sizeof (tma_mp_word)) - (2 * DIGIT_BIT)))) {
-    return fast_s_tma_mp_mul_high_digs (a, b, c, digs);
-  }
-#endif
-
-  if ((res = tma_mp_init_size (&t, a->used + b->used + 1)) != MP_OKAY) {
-    return res;
-  }
-  t.used = a->used + b->used + 1;
-
-  pa = a->used;
-  pb = b->used;
-  for (ix = 0; ix < pa; ix++) {
-    /* clear the carry */
-    u = 0;
-
-    /* left hand side of A[ix] * B[iy] */
-    tmpx = a->dp[ix];
-
-    /* alias to the address of where the digits will be stored */
-    tmpt = &(t.dp[digs]);
-
-    /* alias for where to read the right hand side from */
-    tmpy = b->dp + (digs - ix);
-
-    for (iy = digs - ix; iy < pb; iy++) {
-      /* calculate the double precision result */
-      r       = ((tma_mp_word)*tmpt) +
-                ((tma_mp_word)tmpx) * ((tma_mp_word)*tmpy++) +
-                ((tma_mp_word) u);
-
-      /* get the lower part */
-      *tmpt++ = (tma_mp_digit) (r & ((tma_mp_word) MP_MASK));
-
-      /* carry the carry */
-      u       = (tma_mp_digit) (r >> ((tma_mp_word) DIGIT_BIT));
-    }
-    *tmpt = u;
-  }
-  tma_mp_clamp (&t);
-  tma_mp_exch (&t, c);
-  tma_mp_clear (&t);
-  return MP_OKAY;
-}
-#endif
-
-/* $Source$ */
-/* $Revision$ */
-/* $Date$ */
-
-/* End: bn_s_tma_mp_mul_high_digs.c */
-
-/* Start: bn_s_tma_mp_sqr.c */
-#include "tma.h"
-#ifdef BN_S_MP_SQR_C
-/* LibTomMath, multiple-precision integer library -- Tom St Denis
- *
- * LibTomMath is a library that provides multiple-precision
- * integer arithmetic as well as number theoretic functionality.
- *
- * The library was designed directly after the MPI library by
- * Michael Fromberger but has been written from scratch with
- * additional optimizations in place.
- *
- * The library is free for all purposes without any express
- * guarantee it works.
- *
- * Tom St Denis, tomstdenis@gmail.com, http://libtom.org
- */
-
-/* low level squaring, b = a*a, HAC pp.596-597, Algorithm 14.16 */
-int s_tma_mp_sqr (tma_mp_int * a, tma_mp_int * b)
-{
-  tma_mp_int  t;
-  int     res, ix, iy, pa;
-  tma_mp_word r;
-  tma_mp_digit u, tmpx, *tmpt;
-
-  pa = a->used;
-  if ((res = tma_mp_init_size (&t, 2*pa + 1)) != MP_OKAY) {
-    return res;
-  }
-
-  /* default used is maximum possible size */
-  t.used = 2*pa + 1;
-
-  for (ix = 0; ix < pa; ix++) {
-    /* first calculate the digit at 2*ix */
-    /* calculate double precision result */
-    r = ((tma_mp_word) t.dp[2*ix]) +
-        ((tma_mp_word)a->dp[ix])*((tma_mp_word)a->dp[ix]);
-
-    /* store lower part in result */
-    t.dp[ix+ix] = (tma_mp_digit) (r & ((tma_mp_word) MP_MASK));
-
-    /* get the carry */
-    u           = (tma_mp_digit)(r >> ((tma_mp_word) DIGIT_BIT));
-
-    /* left hand side of A[ix] * A[iy] */
-    tmpx        = a->dp[ix];
-
-    /* alias for where to store the results */
-    tmpt        = t.dp + (2*ix + 1);
-
-    for (iy = ix + 1; iy < pa; iy++) {
-      /* first calculate the product */
-      r       = ((tma_mp_word)tmpx) * ((tma_mp_word)a->dp[iy]);
-
-      /* now calculate the double precision result, note we use
-       * addition instead of *2 since it's easier to optimize
-       */
-      r       = ((tma_mp_word) *tmpt) + r + r + ((tma_mp_word) u);
-
-      /* store lower part */
-      *tmpt++ = (tma_mp_digit) (r & ((tma_mp_word) MP_MASK));
-
-      /* get carry */
-      u       = (tma_mp_digit)(r >> ((tma_mp_word) DIGIT_BIT));
-    }
-    /* propagate upwards */
-    while (u != ((tma_mp_digit) 0)) {
-      r       = ((tma_mp_word) *tmpt) + ((tma_mp_word) u);
-      *tmpt++ = (tma_mp_digit) (r & ((tma_mp_word) MP_MASK));
-      u       = (tma_mp_digit)(r >> ((tma_mp_word) DIGIT_BIT));
-    }
-  }
-
-  tma_mp_clamp (&t);
-  tma_mp_exch (&t, b);
-  tma_mp_clear (&t);
-  return MP_OKAY;
-}
-#endif
-
-/* $Source$ */
-/* $Revision$ */
-/* $Date$ */
-
-/* End: bn_s_tma_mp_sqr.c */
-
-/* Start: bn_s_tma_mp_sub.c */
-#include "tma.h"
-#ifdef BN_S_MP_SUB_C
-/* LibTomMath, multiple-precision integer library -- Tom St Denis
- *
- * LibTomMath is a library that provides multiple-precision
- * integer arithmetic as well as number theoretic functionality.
- *
- * The library was designed directly after the MPI library by
- * Michael Fromberger but has been written from scratch with
- * additional optimizations in place.
- *
- * The library is free for all purposes without any express
- * guarantee it works.
- *
- * Tom St Denis, tomstdenis@gmail.com, http://libtom.org
- */
-
-/* low level subtraction (assumes |a| > |b|), HAC pp.595 Algorithm 14.9 */
-int
-s_tma_mp_sub (tma_mp_int * a, tma_mp_int * b, tma_mp_int * c)
-{
-  int     olduse, res, min, max;
-
-  /* find sizes */
-  min = b->used;
-  max = a->used;
-
-  /* init result */
-  if (c->alloc < max) {
-    if ((res = tma_mp_grow (c, max)) != MP_OKAY) {
-      return res;
-    }
-  }
-  olduse = c->used;
-  c->used = max;
-
-  {
-    register tma_mp_digit u, *tmpa, *tmpb, *tmpc;
-    register int i;
-
-    /* alias for digit pointers */
-    tmpa = a->dp;
-    tmpb = b->dp;
-    tmpc = c->dp;
-
-    /* set carry to zero */
-    u = 0;
-    for (i = 0; i < min; i++) {
-      /* T[i] = A[i] - B[i] - U */
-      *tmpc = *tmpa++ - *tmpb++ - u;
-
-      /* U = carry bit of T[i]
-       * Note this saves performing an AND operation since
-       * if a carry does occur it will propagate all the way to the
-       * MSB.  As a result a single shift is enough to get the carry
-       */
-      u = *tmpc >> ((tma_mp_digit)(CHAR_BIT * sizeof (tma_mp_digit) - 1));
-
-      /* Clear carry from T[i] */
-      *tmpc++ &= MP_MASK;
-    }
-
-    /* now copy higher words if any, e.g. if A has more digits than B  */
-    for (; i < max; i++) {
-      /* T[i] = A[i] - U */
-      *tmpc = *tmpa++ - u;
-
-      /* U = carry bit of T[i] */
-      u = *tmpc >> ((tma_mp_digit)(CHAR_BIT * sizeof (tma_mp_digit) - 1));
-
-      /* Clear carry from T[i] */
-      *tmpc++ &= MP_MASK;
-    }
-
-    /* clear digits above used (since we may not have grown result above) */
-    for (i = c->used; i < olduse; i++) {
-      *tmpc++ = 0;
-    }
-  }
-
-  tma_mp_clamp (c);
-  return MP_OKAY;
-}
-
-#endif
-
-/* $Source$ */
-/* $Revision$ */
-/* $Date$ */
-
-/* End: bn_s_tma_mp_sub.c */
-
-/* Start: bncore.c */
-#include "tma.h"
-#ifdef BNCORE_C
-/* LibTomMath, multiple-precision integer library -- Tom St Denis
- *
- * LibTomMath is a library that provides multiple-precision
- * integer arithmetic as well as number theoretic functionality.
- *
- * The library was designed directly after the MPI library by
- * Michael Fromberger but has been written from scratch with
- * additional optimizations in place.
- *
- * The library is free for all purposes without any express
- * guarantee it works.
- *
- * Tom St Denis, tomstdenis@gmail.com, http://libtom.org
- */
-
-/* Known optimal configurations
-
- CPU                    /Compiler     /MUL CUTOFF/SQR CUTOFF
--------------------------------------------------------------
- Intel P4 Northwood     /GCC v3.4.1   /        88/       128/LTM 0.32 ;-)
- AMD Athlon64           /GCC v3.4.4   /        80/       120/LTM 0.35
-
-*/
-
-int     KARATSUBA_MUL_CUTOFF = 80,      /* Min. number of digits before Karatsuba multiplication is used. */
-        KARATSUBA_SQR_CUTOFF = 120,     /* Min. number of digits before Karatsuba squaring is used. */
-
-        TOOM_MUL_CUTOFF      = 350,      /* no optimal values of these are known yet so set em high */
-        TOOM_SQR_CUTOFF      = 400;
-#endif
-
-/* $Source$ */
-/* $Revision$ */
-/* $Date$ */
-
-/* End: bncore.c */
-
-
-/* EOF */
diff --git a/lib/silcmath/tma.h b/lib/silcmath/tma.h
deleted file mode 100644 (file)
index d651f96..0000000
+++ /dev/null
@@ -1,587 +0,0 @@
-/* LibTomMath, multiple-precision integer library -- Tom St Denis
- *
- * LibTomMath is a library that provides multiple-precision
- * integer arithmetic as well as number theoretic functionality.
- *
- * The library was designed directly after the MPI library by
- * Michael Fromberger but has been written from scratch with
- * additional optimizations in place.
- *
- * The library is free for all purposes without any express
- * guarantee it works.
- *
- * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com
- */
-#ifndef TMA_H
-#define TMA_H
-
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#include <ctype.h>
-#include <limits.h>
-
-#include "tma_class.h"
-
-/* Assure these -Pekka */
-#undef MP_8BIT
-#undef MP_16BIT
-#undef CRYPT
-
-#ifndef MIN
-   #define MIN(x,y) ((x)<(y)?(x):(y))
-#endif
-
-#ifndef MAX
-   #define MAX(x,y) ((x)>(y)?(x):(y))
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-
-/* C++ compilers don't like assigning void * to tma_mp_digit * */
-#define  OPT_CAST(x)  (x *)
-
-#else
-
-/* C on the other hand doesn't care */
-#define  OPT_CAST(x)
-
-#endif
-
-
-/* detect 64-bit mode if possible */
-#if defined(__x86_64__)
-   #if !(defined(MP_64BIT) && defined(MP_16BIT) && defined(MP_8BIT))
-      #define MP_64BIT
-   #endif
-#endif
-
-/* some default configurations.
- *
- * A "tma_mp_digit" must be able to hold DIGIT_BIT + 1 bits
- * A "tma_mp_word" must be able to hold 2*DIGIT_BIT + 1 bits
- *
- * At the very least a tma_mp_digit must be able to hold 7 bits
- * [any size beyond that is ok provided it doesn't overflow the data type]
- */
-#ifdef MP_8BIT
-   typedef unsigned char      tma_mp_digit;
-   typedef unsigned short     tma_mp_word;
-#elif defined(MP_16BIT)
-   typedef unsigned short     tma_mp_digit;
-   typedef unsigned long      tma_mp_word;
-#elif defined(MP_64BIT)
-   /* for GCC only on supported platforms */
-#ifndef CRYPT
-   typedef unsigned long long ulong64;
-   typedef signed long long   long64;
-#endif
-
-   typedef unsigned long      tma_mp_digit;
-   typedef unsigned long      tma_mp_word __attribute__ ((mode(TI)));
-
-   #define DIGIT_BIT          60
-#else
-   /* this is the default case, 28-bit digits */
-
-   /* this is to make porting into LibTomCrypt easier :-) */
-#ifndef CRYPT
-   #if defined(_MSC_VER) || defined(__BORLANDC__)
-      typedef unsigned __int64   ulong64;
-      typedef signed __int64     long64;
-   #else
-      typedef unsigned long long ulong64;
-      typedef signed long long   long64;
-   #endif
-#endif
-
-   typedef unsigned long      tma_mp_digit;
-   typedef ulong64            tma_mp_word;
-
-#ifdef MP_31BIT
-   /* this is an extension that uses 31-bit digits */
-   #define DIGIT_BIT          31
-#else
-   /* default case is 28-bit digits, defines MP_28BIT as a handy macro to test */
-   #define DIGIT_BIT          28
-   #define MP_28BIT
-#endif
-#endif
-
-/* define heap macros */
-#ifndef CRYPT
-   /* default to libc stuff */
-   #ifndef XMALLOC
-       #define XMALLOC  malloc
-       #define XFREE    free
-       #define XREALLOC realloc
-       #define XCALLOC  calloc
-   #else
-      /* prototypes for our heap functions */
-      extern void *XMALLOC(size_t n);
-      extern void *XREALLOC(void *p, size_t n);
-      extern void *XCALLOC(size_t n, size_t s);
-      extern void XFREE(void *p);
-   #endif
-#endif
-
-
-/* otherwise the bits per digit is calculated automatically from the size of a tma_mp_digit */
-#ifndef DIGIT_BIT
-   #define DIGIT_BIT     ((int)((CHAR_BIT * sizeof(tma_mp_digit) - 1)))  /* bits per digit */
-#endif
-
-#define MP_DIGIT_BIT     DIGIT_BIT
-#define MP_MASK          ((((tma_mp_digit)1)<<((tma_mp_digit)DIGIT_BIT))-((tma_mp_digit)1))
-#define MP_DIGIT_MAX     MP_MASK
-
-/* equalities */
-#define MP_LT        -1   /* less than */
-#define MP_EQ         0   /* equal to */
-#define MP_GT         1   /* greater than */
-
-#define MP_ZPOS       0   /* positive integer */
-#define MP_NEG        1   /* negative */
-
-#define MP_OKAY       0   /* ok result */
-#define MP_MEM        -2  /* out of mem */
-#define MP_VAL        -3  /* invalid input */
-#define MP_RANGE      MP_VAL
-
-#define MP_YES        1   /* yes response */
-#define MP_NO         0   /* no response */
-
-/* Primality generation flags */
-#define LTM_PRIME_BBS      0x0001 /* BBS style prime */
-#define LTM_PRIME_SAFE     0x0002 /* Safe prime (p-1)/2 == prime */
-#define LTM_PRIME_2MSB_ON  0x0008 /* force 2nd MSB to 1 */
-
-typedef int           tma_mp_err;
-
-/* you'll have to tune these... */
-extern int KARATSUBA_MUL_CUTOFF,
-           KARATSUBA_SQR_CUTOFF,
-           TOOM_MUL_CUTOFF,
-           TOOM_SQR_CUTOFF;
-
-/* define this to use lower memory usage routines (exptmods mostly) */
-/* #define MP_LOW_MEM */
-
-/* default precision */
-#ifndef MP_PREC
-   #ifndef MP_LOW_MEM
-      #define MP_PREC                 32     /* default digits of precision */
-   #else
-      #define MP_PREC                 8      /* default digits of precision */
-   #endif
-#endif
-
-/* size of comba arrays, should be at least 2 * 2**(BITS_PER_WORD - BITS_PER_DIGIT*2) */
-#define MP_WARRAY               (1 << (sizeof(tma_mp_word) * CHAR_BIT - 2 * DIGIT_BIT + 1))
-
-/* the infamous tma_mp_int structure */
-typedef struct  {
-    int used, alloc, sign;
-    tma_mp_digit *dp;
-} tma_mp_int;
-
-/* callback for tma_mp_prime_random, should fill dst with random bytes and return how many read [upto len] */
-typedef int ltm_prime_callback(unsigned char *dst, int len, void *dat);
-
-
-#define USED(m)    ((m)->used)
-#define DIGIT(m,k) ((m)->dp[(k)])
-#define SIGN(m)    ((m)->sign)
-
-/* error code to char* string */
-char *tma_mp_error_to_string(int code);
-
-/* ---> init and deinit bignum functions <--- */
-/* init a bignum */
-int tma_mp_init(tma_mp_int *a);
-
-/* free a bignum */
-void tma_mp_clear(tma_mp_int *a);
-
-/* init a null terminated series of arguments */
-int tma_mp_init_multi(tma_mp_int *mp, ...);
-
-/* clear a null terminated series of arguments */
-void tma_mp_clear_multi(tma_mp_int *mp, ...);
-
-/* exchange two ints */
-void tma_mp_exch(tma_mp_int *a, tma_mp_int *b);
-
-/* shrink ram required for a bignum */
-int tma_mp_shrink(tma_mp_int *a);
-
-/* grow an int to a given size */
-int tma_mp_grow(tma_mp_int *a, int size);
-
-/* init to a given number of digits */
-int tma_mp_init_size(tma_mp_int *a, int size);
-
-/* ---> Basic Manipulations <--- */
-#define tma_mp_iszero(a) (((a)->used == 0) ? MP_YES : MP_NO)
-#define tma_mp_iseven(a) (((a)->used > 0 && (((a)->dp[0] & 1) == 0)) ? MP_YES : MP_NO)
-#define tma_mp_isodd(a)  (((a)->used > 0 && (((a)->dp[0] & 1) == 1)) ? MP_YES : MP_NO)
-
-/* set to zero */
-void tma_mp_zero(tma_mp_int *a);
-
-/* set to a digit */
-void tma_mp_set(tma_mp_int *a, tma_mp_digit b);
-
-/* set a 32-bit const */
-int tma_mp_set_int(tma_mp_int *a, unsigned long b);
-
-/* get a 32-bit value */
-unsigned long tma_mp_get_int(tma_mp_int * a);
-
-/* initialize and set a digit */
-int tma_mp_init_set (tma_mp_int * a, tma_mp_digit b);
-
-/* initialize and set 32-bit value */
-int tma_mp_init_set_int (tma_mp_int * a, unsigned long b);
-
-/* copy, b = a */
-int tma_mp_copy(tma_mp_int *a, tma_mp_int *b);
-
-/* inits and copies, a = b */
-int tma_mp_init_copy(tma_mp_int *a, tma_mp_int *b);
-
-/* trim unused digits */
-void tma_mp_clamp(tma_mp_int *a);
-
-/* ---> digit manipulation <--- */
-
-/* right shift by "b" digits */
-void tma_mp_rshd(tma_mp_int *a, int b);
-
-/* left shift by "b" digits */
-int tma_mp_lshd(tma_mp_int *a, int b);
-
-/* c = a / 2**b */
-int tma_mp_div_2d(tma_mp_int *a, int b, tma_mp_int *c, tma_mp_int *d);
-
-/* b = a/2 */
-int tma_mp_div_2(tma_mp_int *a, tma_mp_int *b);
-
-/* c = a * 2**b */
-int tma_mp_mul_2d(tma_mp_int *a, int b, tma_mp_int *c);
-
-/* b = a*2 */
-int tma_mp_mul_2(tma_mp_int *a, tma_mp_int *b);
-
-/* c = a mod 2**d */
-int tma_mp_mod_2d(tma_mp_int *a, int b, tma_mp_int *c);
-
-/* computes a = 2**b */
-int tma_mp_2expt(tma_mp_int *a, int b);
-
-/* Counts the number of lsbs which are zero before the first zero bit */
-int tma_mp_cnt_lsb(tma_mp_int *a);
-
-/* I Love Earth! */
-
-/* makes a pseudo-random int of a given size */
-int tma_mp_rand(tma_mp_int *a, int digits);
-
-/* ---> binary operations <--- */
-/* c = a XOR b  */
-int tma_mp_xor(tma_mp_int *a, tma_mp_int *b, tma_mp_int *c);
-
-/* c = a OR b */
-int tma_mp_or(tma_mp_int *a, tma_mp_int *b, tma_mp_int *c);
-
-/* c = a AND b */
-int tma_mp_and(tma_mp_int *a, tma_mp_int *b, tma_mp_int *c);
-
-/* ---> Basic arithmetic <--- */
-
-/* b = -a */
-int tma_mp_neg(tma_mp_int *a, tma_mp_int *b);
-
-/* b = |a| */
-int tma_mp_abs(tma_mp_int *a, tma_mp_int *b);
-
-/* compare a to b */
-int tma_mp_cmp(tma_mp_int *a, tma_mp_int *b);
-
-/* compare |a| to |b| */
-int tma_mp_cmp_mag(tma_mp_int *a, tma_mp_int *b);
-
-/* c = a + b */
-int tma_mp_add(tma_mp_int *a, tma_mp_int *b, tma_mp_int *c);
-
-/* c = a - b */
-int tma_mp_sub(tma_mp_int *a, tma_mp_int *b, tma_mp_int *c);
-
-/* c = a * b */
-int tma_mp_mul(tma_mp_int *a, tma_mp_int *b, tma_mp_int *c);
-
-/* b = a*a  */
-int tma_mp_sqr(tma_mp_int *a, tma_mp_int *b);
-
-/* a/b => cb + d == a */
-int tma_mp_div(tma_mp_int *a, tma_mp_int *b, tma_mp_int *c, tma_mp_int *d);
-
-/* c = a mod b, 0 <= c < b  */
-int tma_mp_mod(tma_mp_int *a, tma_mp_int *b, tma_mp_int *c);
-
-/* ---> single digit functions <--- */
-
-/* compare against a single digit */
-int tma_mp_cmp_d(tma_mp_int *a, tma_mp_digit b);
-
-/* c = a + b */
-int tma_mp_add_d(tma_mp_int *a, tma_mp_digit b, tma_mp_int *c);
-
-/* c = a - b */
-int tma_mp_sub_d(tma_mp_int *a, tma_mp_digit b, tma_mp_int *c);
-
-/* c = a * b */
-int tma_mp_mul_d(tma_mp_int *a, tma_mp_digit b, tma_mp_int *c);
-
-/* a/b => cb + d == a */
-int tma_mp_div_d(tma_mp_int *a, tma_mp_digit b, tma_mp_int *c, tma_mp_digit *d);
-
-/* a/3 => 3c + d == a */
-int tma_mp_div_3(tma_mp_int *a, tma_mp_int *c, tma_mp_digit *d);
-
-/* c = a**b */
-int tma_mp_expt_d(tma_mp_int *a, tma_mp_digit b, tma_mp_int *c);
-
-/* c = a mod b, 0 <= c < b  */
-int tma_mp_mod_d(tma_mp_int *a, tma_mp_digit b, tma_mp_digit *c);
-
-/* ---> number theory <--- */
-
-/* d = a + b (mod c) */
-int tma_mp_addmod(tma_mp_int *a, tma_mp_int *b, tma_mp_int *c, tma_mp_int *d);
-
-/* d = a - b (mod c) */
-int tma_mp_submod(tma_mp_int *a, tma_mp_int *b, tma_mp_int *c, tma_mp_int *d);
-
-/* d = a * b (mod c) */
-int tma_mp_mulmod(tma_mp_int *a, tma_mp_int *b, tma_mp_int *c, tma_mp_int *d);
-
-/* c = a * a (mod b) */
-int tma_mp_sqrmod(tma_mp_int *a, tma_mp_int *b, tma_mp_int *c);
-
-/* c = 1/a (mod b) */
-int tma_mp_invmod(tma_mp_int *a, tma_mp_int *b, tma_mp_int *c);
-
-/* c = (a, b) */
-int tma_mp_gcd(tma_mp_int *a, tma_mp_int *b, tma_mp_int *c);
-
-/* produces value such that U1*a + U2*b = U3 */
-int tma_mp_exteuclid(tma_mp_int *a, tma_mp_int *b, tma_mp_int *U1, tma_mp_int *U2, tma_mp_int *U3);
-
-/* c = [a, b] or (a*b)/(a, b) */
-int tma_mp_lcm(tma_mp_int *a, tma_mp_int *b, tma_mp_int *c);
-
-/* finds one of the b'th root of a, such that |c|**b <= |a|
- *
- * returns error if a < 0 and b is even
- */
-int tma_mp_n_root(tma_mp_int *a, tma_mp_digit b, tma_mp_int *c);
-
-/* special sqrt algo */
-int tma_mp_sqrt(tma_mp_int *arg, tma_mp_int *ret);
-
-/* is number a square? */
-int tma_mp_is_square(tma_mp_int *arg, int *ret);
-
-/* computes the jacobi c = (a | n) (or Legendre if b is prime)  */
-int tma_mp_jacobi(tma_mp_int *a, tma_mp_int *n, int *c);
-
-/* used to setup the Barrett reduction for a given modulus b */
-int tma_mp_reduce_setup(tma_mp_int *a, tma_mp_int *b);
-
-/* Barrett Reduction, computes a (mod b) with a precomputed value c
- *
- * Assumes that 0 < a <= b*b, note if 0 > a > -(b*b) then you can merely
- * compute the reduction as -1 * tma_mp_reduce(tma_mp_abs(a)) [pseudo code].
- */
-int tma_mp_reduce(tma_mp_int *a, tma_mp_int *b, tma_mp_int *c);
-
-/* setups the montgomery reduction */
-int tma_mp_montgomery_setup(tma_mp_int *a, tma_mp_digit *mp);
-
-/* computes a = B**n mod b without division or multiplication useful for
- * normalizing numbers in a Montgomery system.
- */
-int tma_mp_montgomery_calc_normalization(tma_mp_int *a, tma_mp_int *b);
-
-/* computes x/R == x (mod N) via Montgomery Reduction */
-int tma_mp_montgomery_reduce(tma_mp_int *a, tma_mp_int *m, tma_mp_digit mp);
-
-/* returns 1 if a is a valid DR modulus */
-int tma_mp_dr_is_modulus(tma_mp_int *a);
-
-/* sets the value of "d" required for tma_mp_dr_reduce */
-void tma_mp_dr_setup(tma_mp_int *a, tma_mp_digit *d);
-
-/* reduces a modulo b using the Diminished Radix method */
-int tma_mp_dr_reduce(tma_mp_int *a, tma_mp_int *b, tma_mp_digit mp);
-
-/* returns true if a can be reduced with tma_mp_reduce_2k */
-int tma_mp_reduce_is_2k(tma_mp_int *a);
-
-/* determines k value for 2k reduction */
-int tma_mp_reduce_2k_setup(tma_mp_int *a, tma_mp_digit *d);
-
-/* reduces a modulo b where b is of the form 2**p - k [0 <= a] */
-int tma_mp_reduce_2k(tma_mp_int *a, tma_mp_int *n, tma_mp_digit d);
-
-/* returns true if a can be reduced with tma_mp_reduce_2k_l */
-int tma_mp_reduce_is_2k_l(tma_mp_int *a);
-
-/* determines k value for 2k reduction */
-int tma_mp_reduce_2k_setup_l(tma_mp_int *a, tma_mp_int *d);
-
-/* reduces a modulo b where b is of the form 2**p - k [0 <= a] */
-int tma_mp_reduce_2k_l(tma_mp_int *a, tma_mp_int *n, tma_mp_int *d);
-
-/* d = a**b (mod c) */
-int tma_mp_exptmod(tma_mp_int *a, tma_mp_int *b, tma_mp_int *c, tma_mp_int *d);
-
-/* ---> Primes <--- */
-
-/* number of primes */
-#ifdef MP_8BIT
-   #define PRIME_SIZE      31
-#else
-   #define PRIME_SIZE      256
-#endif
-
-/* table of first PRIME_SIZE primes */
-extern const tma_mp_digit ltm_prime_tab[];
-
-/* result=1 if a is divisible by one of the first PRIME_SIZE primes */
-int tma_mp_prime_is_divisible(tma_mp_int *a, int *result);
-
-/* performs one Fermat test of "a" using base "b".
- * Sets result to 0 if composite or 1 if probable prime
- */
-int tma_mp_prime_fermat(tma_mp_int *a, tma_mp_int *b, int *result);
-
-/* performs one Miller-Rabin test of "a" using base "b".
- * Sets result to 0 if composite or 1 if probable prime
- */
-int tma_mp_prime_miller_rabin(tma_mp_int *a, tma_mp_int *b, int *result);
-
-/* This gives [for a given bit size] the number of trials required
- * such that Miller-Rabin gives a prob of failure lower than 2^-96
- */
-int tma_mp_prime_rabin_miller_trials(int size);
-
-/* performs t rounds of Miller-Rabin on "a" using the first
- * t prime bases.  Also performs an initial sieve of trial
- * division.  Determines if "a" is prime with probability
- * of error no more than (1/4)**t.
- *
- * Sets result to 1 if probably prime, 0 otherwise
- */
-int tma_mp_prime_is_prime(tma_mp_int *a, int t, int *result);
-
-/* finds the next prime after the number "a" using "t" trials
- * of Miller-Rabin.
- *
- * bbs_style = 1 means the prime must be congruent to 3 mod 4
- */
-int tma_mp_prime_next_prime(tma_mp_int *a, int t, int bbs_style);
-
-/* makes a truly random prime of a given size (bytes),
- * call with bbs = 1 if you want it to be congruent to 3 mod 4
- *
- * You have to supply a callback which fills in a buffer with random bytes.  "dat" is a parameter you can
- * have passed to the callback (e.g. a state or something).  This function doesn't use "dat" itself
- * so it can be NULL
- *
- * The prime generated will be larger than 2^(8*size).
- */
-#define tma_mp_prime_random(a, t, size, bbs, cb, dat) tma_mp_prime_random_ex(a, t, ((size) * 8) + 1, (bbs==1)?LTM_PRIME_BBS:0, cb, dat)
-
-/* makes a truly random prime of a given size (bits),
- *
- * Flags are as follows:
- *
- *   LTM_PRIME_BBS      - make prime congruent to 3 mod 4
- *   LTM_PRIME_SAFE     - make sure (p-1)/2 is prime as well (implies LTM_PRIME_BBS)
- *   LTM_PRIME_2MSB_OFF - make the 2nd highest bit zero
- *   LTM_PRIME_2MSB_ON  - make the 2nd highest bit one
- *
- * You have to supply a callback which fills in a buffer with random bytes.  "dat" is a parameter you can
- * have passed to the callback (e.g. a state or something).  This function doesn't use "dat" itself
- * so it can be NULL
- *
- */
-int tma_mp_prime_random_ex(tma_mp_int *a, int t, int size, int flags, ltm_prime_callback cb, void *dat);
-
-/* ---> radix conversion <--- */
-int tma_mp_count_bits(tma_mp_int *a);
-
-int tma_mp_unsigned_bin_size(tma_mp_int *a);
-int tma_mp_read_unsigned_bin(tma_mp_int *a, const unsigned char *b, int c);
-int tma_mp_to_unsigned_bin(tma_mp_int *a, unsigned char *b);
-int tma_mp_to_unsigned_bin_n (tma_mp_int * a, unsigned char *b, unsigned long *outlen);
-
-int tma_mp_signed_bin_size(tma_mp_int *a);
-int tma_mp_read_signed_bin(tma_mp_int *a, const unsigned char *b, int c);
-int tma_mp_to_signed_bin(tma_mp_int *a,  unsigned char *b);
-int tma_mp_to_signed_bin_n (tma_mp_int * a, unsigned char *b, unsigned long *outlen);
-
-int tma_mp_read_radix(tma_mp_int *a, const char *str, int radix);
-int tma_mp_toradix(tma_mp_int *a, char *str, int radix);
-int tma_mp_toradix_n(tma_mp_int * a, char *str, int radix, int maxlen);
-int tma_mp_radix_size(tma_mp_int *a, int radix, int *size);
-
-int tma_mp_fread(tma_mp_int *a, int radix, FILE *stream);
-int tma_mp_fwrite(tma_mp_int *a, int radix, FILE *stream);
-
-#define tma_mp_read_raw(mp, str, len) tma_mp_read_signed_bin((mp), (str), (len))
-#define tma_mp_raw_size(mp)           tma_mp_signed_bin_size(mp)
-#define tma_mp_toraw(mp, str)         tma_mp_to_signed_bin((mp), (str))
-#define tma_mp_read_mag(mp, str, len) tma_mp_read_unsigned_bin((mp), (str), (len))
-#define tma_mp_mag_size(mp)           tma_mp_unsigned_bin_size(mp)
-#define tma_mp_tomag(mp, str)         tma_mp_to_unsigned_bin((mp), (str))
-
-#define tma_mp_tobinary(M, S)  tma_mp_toradix((M), (S), 2)
-#define tma_mp_tooctal(M, S)   tma_mp_toradix((M), (S), 8)
-#define tma_mp_todecimal(M, S) tma_mp_toradix((M), (S), 10)
-#define tma_mp_tohex(M, S)     tma_mp_toradix((M), (S), 16)
-
-/* lowlevel functions, do not call! */
-int s_tma_mp_add(tma_mp_int *a, tma_mp_int *b, tma_mp_int *c);
-int s_tma_mp_sub(tma_mp_int *a, tma_mp_int *b, tma_mp_int *c);
-#define s_tma_mp_mul(a, b, c) s_tma_mp_mul_digs(a, b, c, (a)->used + (b)->used + 1)
-int fast_s_tma_mp_mul_digs(tma_mp_int *a, tma_mp_int *b, tma_mp_int *c, int digs);
-int s_tma_mp_mul_digs(tma_mp_int *a, tma_mp_int *b, tma_mp_int *c, int digs);
-int fast_s_tma_mp_mul_high_digs(tma_mp_int *a, tma_mp_int *b, tma_mp_int *c, int digs);
-int s_tma_mp_mul_high_digs(tma_mp_int *a, tma_mp_int *b, tma_mp_int *c, int digs);
-int fast_s_tma_mp_sqr(tma_mp_int *a, tma_mp_int *b);
-int s_tma_mp_sqr(tma_mp_int *a, tma_mp_int *b);
-int tma_mp_karatsuba_mul(tma_mp_int *a, tma_mp_int *b, tma_mp_int *c);
-int tma_mp_toom_mul(tma_mp_int *a, tma_mp_int *b, tma_mp_int *c);
-int tma_mp_karatsuba_sqr(tma_mp_int *a, tma_mp_int *b);
-int tma_mp_toom_sqr(tma_mp_int *a, tma_mp_int *b);
-int fast_tma_mp_invmod(tma_mp_int *a, tma_mp_int *b, tma_mp_int *c);
-int tma_mp_invmod_slow (tma_mp_int * a, tma_mp_int * b, tma_mp_int * c);
-int fast_tma_mp_montgomery_reduce(tma_mp_int *a, tma_mp_int *m, tma_mp_digit mp);
-int tma_mp_exptmod_fast(tma_mp_int *G, tma_mp_int *X, tma_mp_int *P, tma_mp_int *Y, int mode);
-int s_tma_mp_exptmod (tma_mp_int * G, tma_mp_int * X, tma_mp_int * P, tma_mp_int * Y, int mode);
-void bn_reverse(unsigned char *s, int len);
-
-extern const char *tma_mp_s_rmap;
-
-#ifdef __cplusplus
-   }
-#endif
-
-/* $Source$ */
-/* $Revision$ */
-/* $Date$ */
-#endif /* TMA_H */
diff --git a/lib/silcmath/tma_class.h b/lib/silcmath/tma_class.h
deleted file mode 100644 (file)
index 0e283d1..0000000
+++ /dev/null
@@ -1,1000 +0,0 @@
-#if !(defined(LTM1) && defined(LTM2) && defined(LTM3))
-#if defined(LTM2)
-#define LTM3
-#endif
-#if defined(LTM1)
-#define LTM2
-#endif
-#define LTM1
-
-#if defined(LTM_ALL)
-#define BN_MP_DIV_SMALL              // -Pekka
-#define BN_ERROR_C
-#define BN_FAST_MP_INVMOD_C
-#define BN_FAST_MP_MONTGOMERY_REDUCE_C
-#define BN_FAST_S_MP_MUL_DIGS_C
-#define BN_FAST_S_MP_MUL_HIGH_DIGS_C
-#define BN_FAST_S_MP_SQR_C
-#define BN_MP_2EXPT_C
-#define BN_MP_ABS_C
-#define BN_MP_ADD_C
-#define BN_MP_ADD_D_C
-#define BN_MP_ADDMOD_C
-#define BN_MP_AND_C
-#define BN_MP_CLAMP_C
-#define BN_MP_CLEAR_C
-#define BN_MP_CLEAR_MULTI_C
-#define BN_MP_CMP_C
-#define BN_MP_CMP_D_C
-#define BN_MP_CMP_MAG_C
-#define BN_MP_CNT_LSB_C
-#define BN_MP_COPY_C
-#define BN_MP_COUNT_BITS_C
-#define BN_MP_DIV_C
-#define BN_MP_DIV_2_C
-#define BN_MP_DIV_2D_C
-#define BN_MP_DIV_3_C
-#define BN_MP_DIV_D_C
-#define BN_MP_DR_IS_MODULUS_C
-#define BN_MP_DR_REDUCE_C
-#define BN_MP_DR_SETUP_C
-#define BN_MP_EXCH_C
-#define BN_MP_EXPT_D_C
-#define BN_MP_EXPTMOD_C
-#define BN_MP_EXPTMOD_FAST_C
-#define BN_MP_EXTEUCLID_C
-#define BN_MP_FREAD_C
-#define BN_MP_FWRITE_C
-#define BN_MP_GCD_C
-#define BN_MP_GET_INT_C
-#define BN_MP_GROW_C
-#define BN_MP_INIT_C
-#define BN_MP_INIT_COPY_C
-#define BN_MP_INIT_MULTI_C
-#define BN_MP_INIT_SET_C
-#define BN_MP_INIT_SET_INT_C
-#define BN_MP_INIT_SIZE_C
-#define BN_MP_INVMOD_C
-#define BN_MP_INVMOD_SLOW_C
-#define BN_MP_IS_SQUARE_C
-#define BN_MP_JACOBI_C
-#define BN_MP_KARATSUBA_MUL_C
-#define BN_MP_KARATSUBA_SQR_C
-#define BN_MP_LCM_C
-#define BN_MP_LSHD_C
-#define BN_MP_MOD_C
-#define BN_MP_MOD_2D_C
-#define BN_MP_MOD_D_C
-#define BN_MP_MONTGOMERY_CALC_NORMALIZATION_C
-#define BN_MP_MONTGOMERY_REDUCE_C
-#define BN_MP_MONTGOMERY_SETUP_C
-#define BN_MP_MUL_C
-#define BN_MP_MUL_2_C
-#define BN_MP_MUL_2D_C
-#define BN_MP_MUL_D_C
-#define BN_MP_MULMOD_C
-#define BN_MP_N_ROOT_C
-#define BN_MP_NEG_C
-#define BN_MP_OR_C
-#define BN_MP_PRIME_FERMAT_C
-#define BN_MP_PRIME_IS_DIVISIBLE_C
-#define BN_MP_PRIME_IS_PRIME_C
-#define BN_MP_PRIME_MILLER_RABIN_C
-#define BN_MP_PRIME_NEXT_PRIME_C
-#define BN_MP_PRIME_RABIN_MILLER_TRIALS_C
-#define BN_MP_PRIME_RANDOM_EX_C
-#define BN_MP_RADIX_SIZE_C
-#define BN_MP_RADIX_SMAP_C
-#define BN_MP_RAND_C
-#define BN_MP_READ_RADIX_C
-#define BN_MP_READ_SIGNED_BIN_C
-#define BN_MP_READ_UNSIGNED_BIN_C
-#define BN_MP_REDUCE_C
-#define BN_MP_REDUCE_2K_C
-#define BN_MP_REDUCE_2K_L_C
-#define BN_MP_REDUCE_2K_SETUP_C
-#define BN_MP_REDUCE_2K_SETUP_L_C
-#define BN_MP_REDUCE_IS_2K_C
-#define BN_MP_REDUCE_IS_2K_L_C
-#define BN_MP_REDUCE_SETUP_C
-#define BN_MP_RSHD_C
-#define BN_MP_SET_C
-#define BN_MP_SET_INT_C
-#define BN_MP_SHRINK_C
-#define BN_MP_SIGNED_BIN_SIZE_C
-#define BN_MP_SQR_C
-#define BN_MP_SQRMOD_C
-#define BN_MP_SQRT_C
-#define BN_MP_SUB_C
-#define BN_MP_SUB_D_C
-#define BN_MP_SUBMOD_C
-#define BN_MP_TO_SIGNED_BIN_C
-#define BN_MP_TO_SIGNED_BIN_N_C
-#define BN_MP_TO_UNSIGNED_BIN_C
-#define BN_MP_TO_UNSIGNED_BIN_N_C
-#define BN_MP_TOOM_MUL_C
-#define BN_MP_TOOM_SQR_C
-#define BN_MP_TORADIX_C
-#define BN_MP_TORADIX_N_C
-#define BN_MP_UNSIGNED_BIN_SIZE_C
-#define BN_MP_XOR_C
-#define BN_MP_ZERO_C
-#define BN_PRIME_TAB_C
-#define BN_REVERSE_C
-#define BN_S_MP_ADD_C
-#define BN_S_MP_EXPTMOD_C
-#define BN_S_MP_MUL_DIGS_C
-#define BN_S_MP_MUL_HIGH_DIGS_C
-#define BN_S_MP_SQR_C
-#define BN_S_MP_SUB_C
-#define BNCORE_C
-#endif
-
-#if defined(BN_ERROR_C)
-   #define BN_MP_ERROR_TO_STRING_C
-#endif
-
-#if defined(BN_FAST_MP_INVMOD_C)
-   #define BN_MP_ISEVEN_C
-   #define BN_MP_INIT_MULTI_C
-   #define BN_MP_COPY_C
-   #define BN_MP_MOD_C
-   #define BN_MP_SET_C
-   #define BN_MP_DIV_2_C
-   #define BN_MP_ISODD_C
-   #define BN_MP_SUB_C
-   #define BN_MP_CMP_C
-   #define BN_MP_ISZERO_C
-   #define BN_MP_CMP_D_C
-   #define BN_MP_ADD_C
-   #define BN_MP_EXCH_C
-   #define BN_MP_CLEAR_MULTI_C
-#endif
-
-#if defined(BN_FAST_MP_MONTGOMERY_REDUCE_C)
-   #define BN_MP_GROW_C
-   #define BN_MP_RSHD_C
-   #define BN_MP_CLAMP_C
-   #define BN_MP_CMP_MAG_C
-   #define BN_S_MP_SUB_C
-#endif
-
-#if defined(BN_FAST_S_MP_MUL_DIGS_C)
-   #define BN_MP_GROW_C
-   #define BN_MP_CLAMP_C
-#endif
-
-#if defined(BN_FAST_S_MP_MUL_HIGH_DIGS_C)
-   #define BN_MP_GROW_C
-   #define BN_MP_CLAMP_C
-#endif
-
-#if defined(BN_FAST_S_MP_SQR_C)
-   #define BN_MP_GROW_C
-   #define BN_MP_CLAMP_C
-#endif
-
-#if defined(BN_MP_2EXPT_C)
-   #define BN_MP_ZERO_C
-   #define BN_MP_GROW_C
-#endif
-
-#if defined(BN_MP_ABS_C)
-   #define BN_MP_COPY_C
-#endif
-
-#if defined(BN_MP_ADD_C)
-   #define BN_S_MP_ADD_C
-   #define BN_MP_CMP_MAG_C
-   #define BN_S_MP_SUB_C
-#endif
-
-#if defined(BN_MP_ADD_D_C)
-   #define BN_MP_GROW_C
-   #define BN_MP_SUB_D_C
-   #define BN_MP_CLAMP_C
-#endif
-
-#if defined(BN_MP_ADDMOD_C)
-   #define BN_MP_INIT_C
-   #define BN_MP_ADD_C
-   #define BN_MP_CLEAR_C
-   #define BN_MP_MOD_C
-#endif
-
-#if defined(BN_MP_AND_C)
-   #define BN_MP_INIT_COPY_C
-   #define BN_MP_CLAMP_C
-   #define BN_MP_EXCH_C
-   #define BN_MP_CLEAR_C
-#endif
-
-#if defined(BN_MP_CLAMP_C)
-#endif
-
-#if defined(BN_MP_CLEAR_C)
-#endif
-
-#if defined(BN_MP_CLEAR_MULTI_C)
-   #define BN_MP_CLEAR_C
-#endif
-
-#if defined(BN_MP_CMP_C)
-   #define BN_MP_CMP_MAG_C
-#endif
-
-#if defined(BN_MP_CMP_D_C)
-#endif
-
-#if defined(BN_MP_CMP_MAG_C)
-#endif
-
-#if defined(BN_MP_CNT_LSB_C)
-   #define BN_MP_ISZERO_C
-#endif
-
-#if defined(BN_MP_COPY_C)
-   #define BN_MP_GROW_C
-#endif
-
-#if defined(BN_MP_COUNT_BITS_C)
-#endif
-
-#if defined(BN_MP_DIV_C)
-   #define BN_MP_ISZERO_C
-   #define BN_MP_CMP_MAG_C
-   #define BN_MP_COPY_C
-   #define BN_MP_ZERO_C
-   #define BN_MP_INIT_MULTI_C
-   #define BN_MP_SET_C
-   #define BN_MP_COUNT_BITS_C
-   #define BN_MP_ABS_C
-   #define BN_MP_MUL_2D_C
-   #define BN_MP_CMP_C
-   #define BN_MP_SUB_C
-   #define BN_MP_ADD_C
-   #define BN_MP_DIV_2D_C
-   #define BN_MP_EXCH_C
-   #define BN_MP_CLEAR_MULTI_C
-   #define BN_MP_INIT_SIZE_C
-   #define BN_MP_INIT_C
-   #define BN_MP_INIT_COPY_C
-   #define BN_MP_LSHD_C
-   #define BN_MP_RSHD_C
-   #define BN_MP_MUL_D_C
-   #define BN_MP_CLAMP_C
-   #define BN_MP_CLEAR_C
-#endif
-
-#if defined(BN_MP_DIV_2_C)
-   #define BN_MP_GROW_C
-   #define BN_MP_CLAMP_C
-#endif
-
-#if defined(BN_MP_DIV_2D_C)
-   #define BN_MP_COPY_C
-   #define BN_MP_ZERO_C
-   #define BN_MP_INIT_C
-   #define BN_MP_MOD_2D_C
-   #define BN_MP_CLEAR_C
-   #define BN_MP_RSHD_C
-   #define BN_MP_CLAMP_C
-   #define BN_MP_EXCH_C
-#endif
-
-#if defined(BN_MP_DIV_3_C)
-   #define BN_MP_INIT_SIZE_C
-   #define BN_MP_CLAMP_C
-   #define BN_MP_EXCH_C
-   #define BN_MP_CLEAR_C
-#endif
-
-#if defined(BN_MP_DIV_D_C)
-   #define BN_MP_ISZERO_C
-   #define BN_MP_COPY_C
-   #define BN_MP_DIV_2D_C
-   #define BN_MP_DIV_3_C
-   #define BN_MP_INIT_SIZE_C
-   #define BN_MP_CLAMP_C
-   #define BN_MP_EXCH_C
-   #define BN_MP_CLEAR_C
-#endif
-
-#if defined(BN_MP_DR_IS_MODULUS_C)
-#endif
-
-#if defined(BN_MP_DR_REDUCE_C)
-   #define BN_MP_GROW_C
-   #define BN_MP_CLAMP_C
-   #define BN_MP_CMP_MAG_C
-   #define BN_S_MP_SUB_C
-#endif
-
-#if defined(BN_MP_DR_SETUP_C)
-#endif
-
-#if defined(BN_MP_EXCH_C)
-#endif
-
-#if defined(BN_MP_EXPT_D_C)
-   #define BN_MP_INIT_COPY_C
-   #define BN_MP_SET_C
-   #define BN_MP_SQR_C
-   #define BN_MP_CLEAR_C
-   #define BN_MP_MUL_C
-#endif
-
-#if defined(BN_MP_EXPTMOD_C)
-   #define BN_MP_INIT_C
-   #define BN_MP_INVMOD_C
-   #define BN_MP_CLEAR_C
-   #define BN_MP_ABS_C
-   #define BN_MP_CLEAR_MULTI_C
-   #define BN_MP_REDUCE_IS_2K_L_C
-   #define BN_S_MP_EXPTMOD_C
-   #define BN_MP_DR_IS_MODULUS_C
-   #define BN_MP_REDUCE_IS_2K_C
-   #define BN_MP_ISODD_C
-   #define BN_MP_EXPTMOD_FAST_C
-#endif
-
-#if defined(BN_MP_EXPTMOD_FAST_C)
-   #define BN_MP_COUNT_BITS_C
-   #define BN_MP_INIT_C
-   #define BN_MP_CLEAR_C
-   #define BN_MP_MONTGOMERY_SETUP_C
-   #define BN_FAST_MP_MONTGOMERY_REDUCE_C
-   #define BN_MP_MONTGOMERY_REDUCE_C
-   #define BN_MP_DR_SETUP_C
-   #define BN_MP_DR_REDUCE_C
-   #define BN_MP_REDUCE_2K_SETUP_C
-   #define BN_MP_REDUCE_2K_C
-   #define BN_MP_MONTGOMERY_CALC_NORMALIZATION_C
-   #define BN_MP_MULMOD_C
-   #define BN_MP_SET_C
-   #define BN_MP_MOD_C
-   #define BN_MP_COPY_C
-   #define BN_MP_SQR_C
-   #define BN_MP_MUL_C
-   #define BN_MP_EXCH_C
-#endif
-
-#if defined(BN_MP_EXTEUCLID_C)
-   #define BN_MP_INIT_MULTI_C
-   #define BN_MP_SET_C
-   #define BN_MP_COPY_C
-   #define BN_MP_ISZERO_C
-   #define BN_MP_DIV_C
-   #define BN_MP_MUL_C
-   #define BN_MP_SUB_C
-   #define BN_MP_NEG_C
-   #define BN_MP_EXCH_C
-   #define BN_MP_CLEAR_MULTI_C
-#endif
-
-#if defined(BN_MP_FREAD_C)
-   #define BN_MP_ZERO_C
-   #define BN_MP_S_RMAP_C
-   #define BN_MP_MUL_D_C
-   #define BN_MP_ADD_D_C
-   #define BN_MP_CMP_D_C
-#endif
-
-#if defined(BN_MP_FWRITE_C)
-   #define BN_MP_RADIX_SIZE_C
-   #define BN_MP_TORADIX_C
-#endif
-
-#if defined(BN_MP_GCD_C)
-   #define BN_MP_ISZERO_C
-   #define BN_MP_ABS_C
-   #define BN_MP_ZERO_C
-   #define BN_MP_INIT_COPY_C
-   #define BN_MP_CNT_LSB_C
-   #define BN_MP_DIV_2D_C
-   #define BN_MP_CMP_MAG_C
-   #define BN_MP_EXCH_C
-   #define BN_S_MP_SUB_C
-   #define BN_MP_MUL_2D_C
-   #define BN_MP_CLEAR_C
-#endif
-
-#if defined(BN_MP_GET_INT_C)
-#endif
-
-#if defined(BN_MP_GROW_C)
-#endif
-
-#if defined(BN_MP_INIT_C)
-#endif
-
-#if defined(BN_MP_INIT_COPY_C)
-   #define BN_MP_COPY_C
-#endif
-
-#if defined(BN_MP_INIT_MULTI_C)
-   #define BN_MP_ERR_C
-   #define BN_MP_INIT_C
-   #define BN_MP_CLEAR_C
-#endif
-
-#if defined(BN_MP_INIT_SET_C)
-   #define BN_MP_INIT_C
-   #define BN_MP_SET_C
-#endif
-
-#if defined(BN_MP_INIT_SET_INT_C)
-   #define BN_MP_INIT_C
-   #define BN_MP_SET_INT_C
-#endif
-
-#if defined(BN_MP_INIT_SIZE_C)
-   #define BN_MP_INIT_C
-#endif
-
-#if defined(BN_MP_INVMOD_C)
-   #define BN_MP_ISZERO_C
-   #define BN_MP_ISODD_C
-   #define BN_FAST_MP_INVMOD_C
-   #define BN_MP_INVMOD_SLOW_C
-#endif
-
-#if defined(BN_MP_INVMOD_SLOW_C)
-   #define BN_MP_ISZERO_C
-   #define BN_MP_INIT_MULTI_C
-   #define BN_MP_MOD_C
-   #define BN_MP_COPY_C
-   #define BN_MP_ISEVEN_C
-   #define BN_MP_SET_C
-   #define BN_MP_DIV_2_C
-   #define BN_MP_ISODD_C
-   #define BN_MP_ADD_C
-   #define BN_MP_SUB_C
-   #define BN_MP_CMP_C
-   #define BN_MP_CMP_D_C
-   #define BN_MP_CMP_MAG_C
-   #define BN_MP_EXCH_C
-   #define BN_MP_CLEAR_MULTI_C
-#endif
-
-#if defined(BN_MP_IS_SQUARE_C)
-   #define BN_MP_MOD_D_C
-   #define BN_MP_INIT_SET_INT_C
-   #define BN_MP_MOD_C
-   #define BN_MP_GET_INT_C
-   #define BN_MP_SQRT_C
-   #define BN_MP_SQR_C
-   #define BN_MP_CMP_MAG_C
-   #define BN_MP_CLEAR_C
-#endif
-
-#if defined(BN_MP_JACOBI_C)
-   #define BN_MP_CMP_D_C
-   #define BN_MP_ISZERO_C
-   #define BN_MP_INIT_COPY_C
-   #define BN_MP_CNT_LSB_C
-   #define BN_MP_DIV_2D_C
-   #define BN_MP_MOD_C
-   #define BN_MP_CLEAR_C
-#endif
-
-#if defined(BN_MP_KARATSUBA_MUL_C)
-   #define BN_MP_MUL_C
-   #define BN_MP_INIT_SIZE_C
-   #define BN_MP_CLAMP_C
-   #define BN_MP_SUB_C
-   #define BN_MP_ADD_C
-   #define BN_MP_LSHD_C
-   #define BN_MP_CLEAR_C
-#endif
-
-#if defined(BN_MP_KARATSUBA_SQR_C)
-   #define BN_MP_INIT_SIZE_C
-   #define BN_MP_CLAMP_C
-   #define BN_MP_SQR_C
-   #define BN_MP_SUB_C
-   #define BN_S_MP_ADD_C
-   #define BN_MP_LSHD_C
-   #define BN_MP_ADD_C
-   #define BN_MP_CLEAR_C
-#endif
-
-#if defined(BN_MP_LCM_C)
-   #define BN_MP_INIT_MULTI_C
-   #define BN_MP_GCD_C
-   #define BN_MP_CMP_MAG_C
-   #define BN_MP_DIV_C
-   #define BN_MP_MUL_C
-   #define BN_MP_CLEAR_MULTI_C
-#endif
-
-#if defined(BN_MP_LSHD_C)
-   #define BN_MP_GROW_C
-   #define BN_MP_RSHD_C
-#endif
-
-#if defined(BN_MP_MOD_C)
-   #define BN_MP_INIT_C
-   #define BN_MP_DIV_C
-   #define BN_MP_CLEAR_C
-   #define BN_MP_ADD_C
-   #define BN_MP_EXCH_C
-#endif
-
-#if defined(BN_MP_MOD_2D_C)
-   #define BN_MP_ZERO_C
-   #define BN_MP_COPY_C
-   #define BN_MP_CLAMP_C
-#endif
-
-#if defined(BN_MP_MOD_D_C)
-   #define BN_MP_DIV_D_C
-#endif
-
-#if defined(BN_MP_MONTGOMERY_CALC_NORMALIZATION_C)
-   #define BN_MP_COUNT_BITS_C
-   #define BN_MP_2EXPT_C
-   #define BN_MP_SET_C
-   #define BN_MP_MUL_2_C
-   #define BN_MP_CMP_MAG_C
-   #define BN_S_MP_SUB_C
-#endif
-
-#if defined(BN_MP_MONTGOMERY_REDUCE_C)
-   #define BN_FAST_MP_MONTGOMERY_REDUCE_C
-   #define BN_MP_GROW_C
-   #define BN_MP_CLAMP_C
-   #define BN_MP_RSHD_C
-   #define BN_MP_CMP_MAG_C
-   #define BN_S_MP_SUB_C
-#endif
-
-#if defined(BN_MP_MONTGOMERY_SETUP_C)
-#endif
-
-#if defined(BN_MP_MUL_C)
-   #define BN_MP_TOOM_MUL_C
-   #define BN_MP_KARATSUBA_MUL_C
-   #define BN_FAST_S_MP_MUL_DIGS_C
-   #define BN_S_MP_MUL_C
-   #define BN_S_MP_MUL_DIGS_C
-#endif
-
-#if defined(BN_MP_MUL_2_C)
-   #define BN_MP_GROW_C
-#endif
-
-#if defined(BN_MP_MUL_2D_C)
-   #define BN_MP_COPY_C
-   #define BN_MP_GROW_C
-   #define BN_MP_LSHD_C
-   #define BN_MP_CLAMP_C
-#endif
-
-#if defined(BN_MP_MUL_D_C)
-   #define BN_MP_GROW_C
-   #define BN_MP_CLAMP_C
-#endif
-
-#if defined(BN_MP_MULMOD_C)
-   #define BN_MP_INIT_C
-   #define BN_MP_MUL_C
-   #define BN_MP_CLEAR_C
-   #define BN_MP_MOD_C
-#endif
-
-#if defined(BN_MP_N_ROOT_C)
-   #define BN_MP_INIT_C
-   #define BN_MP_SET_C
-   #define BN_MP_COPY_C
-   #define BN_MP_EXPT_D_C
-   #define BN_MP_MUL_C
-   #define BN_MP_SUB_C
-   #define BN_MP_MUL_D_C
-   #define BN_MP_DIV_C
-   #define BN_MP_CMP_C
-   #define BN_MP_SUB_D_C
-   #define BN_MP_EXCH_C
-   #define BN_MP_CLEAR_C
-#endif
-
-#if defined(BN_MP_NEG_C)
-   #define BN_MP_COPY_C
-   #define BN_MP_ISZERO_C
-#endif
-
-#if defined(BN_MP_OR_C)
-   #define BN_MP_INIT_COPY_C
-   #define BN_MP_CLAMP_C
-   #define BN_MP_EXCH_C
-   #define BN_MP_CLEAR_C
-#endif
-
-#if defined(BN_MP_PRIME_FERMAT_C)
-   #define BN_MP_CMP_D_C
-   #define BN_MP_INIT_C
-   #define BN_MP_EXPTMOD_C
-   #define BN_MP_CMP_C
-   #define BN_MP_CLEAR_C
-#endif
-
-#if defined(BN_MP_PRIME_IS_DIVISIBLE_C)
-   #define BN_MP_MOD_D_C
-#endif
-
-#if defined(BN_MP_PRIME_IS_PRIME_C)
-   #define BN_MP_CMP_D_C
-   #define BN_MP_PRIME_IS_DIVISIBLE_C
-   #define BN_MP_INIT_C
-   #define BN_MP_SET_C
-   #define BN_MP_PRIME_MILLER_RABIN_C
-   #define BN_MP_CLEAR_C
-#endif
-
-#if defined(BN_MP_PRIME_MILLER_RABIN_C)
-   #define BN_MP_CMP_D_C
-   #define BN_MP_INIT_COPY_C
-   #define BN_MP_SUB_D_C
-   #define BN_MP_CNT_LSB_C
-   #define BN_MP_DIV_2D_C
-   #define BN_MP_EXPTMOD_C
-   #define BN_MP_CMP_C
-   #define BN_MP_SQRMOD_C
-   #define BN_MP_CLEAR_C
-#endif
-
-#if defined(BN_MP_PRIME_NEXT_PRIME_C)
-   #define BN_MP_CMP_D_C
-   #define BN_MP_SET_C
-   #define BN_MP_SUB_D_C
-   #define BN_MP_ISEVEN_C
-   #define BN_MP_MOD_D_C
-   #define BN_MP_INIT_C
-   #define BN_MP_ADD_D_C
-   #define BN_MP_PRIME_MILLER_RABIN_C
-   #define BN_MP_CLEAR_C
-#endif
-
-#if defined(BN_MP_PRIME_RABIN_MILLER_TRIALS_C)
-#endif
-
-#if defined(BN_MP_PRIME_RANDOM_EX_C)
-   #define BN_MP_READ_UNSIGNED_BIN_C
-   #define BN_MP_PRIME_IS_PRIME_C
-   #define BN_MP_SUB_D_C
-   #define BN_MP_DIV_2_C
-   #define BN_MP_MUL_2_C
-   #define BN_MP_ADD_D_C
-#endif
-
-#if defined(BN_MP_RADIX_SIZE_C)
-   #define BN_MP_COUNT_BITS_C
-   #define BN_MP_INIT_COPY_C
-   #define BN_MP_ISZERO_C
-   #define BN_MP_DIV_D_C
-   #define BN_MP_CLEAR_C
-#endif
-
-#if defined(BN_MP_RADIX_SMAP_C)
-   #define BN_MP_S_RMAP_C
-#endif
-
-#if defined(BN_MP_RAND_C)
-   #define BN_MP_ZERO_C
-   #define BN_MP_ADD_D_C
-   #define BN_MP_LSHD_C
-#endif
-
-#if defined(BN_MP_READ_RADIX_C)
-   #define BN_MP_ZERO_C
-   #define BN_MP_S_RMAP_C
-   #define BN_MP_RADIX_SMAP_C
-   #define BN_MP_MUL_D_C
-   #define BN_MP_ADD_D_C
-   #define BN_MP_ISZERO_C
-#endif
-
-#if defined(BN_MP_READ_SIGNED_BIN_C)
-   #define BN_MP_READ_UNSIGNED_BIN_C
-#endif
-
-#if defined(BN_MP_READ_UNSIGNED_BIN_C)
-   #define BN_MP_GROW_C
-   #define BN_MP_ZERO_C
-   #define BN_MP_MUL_2D_C
-   #define BN_MP_CLAMP_C
-#endif
-
-#if defined(BN_MP_REDUCE_C)
-   #define BN_MP_REDUCE_SETUP_C
-   #define BN_MP_INIT_COPY_C
-   #define BN_MP_RSHD_C
-   #define BN_MP_MUL_C
-   #define BN_S_MP_MUL_HIGH_DIGS_C
-   #define BN_FAST_S_MP_MUL_HIGH_DIGS_C
-   #define BN_MP_MOD_2D_C
-   #define BN_S_MP_MUL_DIGS_C
-   #define BN_MP_SUB_C
-   #define BN_MP_CMP_D_C
-   #define BN_MP_SET_C
-   #define BN_MP_LSHD_C
-   #define BN_MP_ADD_C
-   #define BN_MP_CMP_C
-   #define BN_S_MP_SUB_C
-   #define BN_MP_CLEAR_C
-#endif
-
-#if defined(BN_MP_REDUCE_2K_C)
-   #define BN_MP_INIT_C
-   #define BN_MP_COUNT_BITS_C
-   #define BN_MP_DIV_2D_C
-   #define BN_MP_MUL_D_C
-   #define BN_S_MP_ADD_C
-   #define BN_MP_CMP_MAG_C
-   #define BN_S_MP_SUB_C
-   #define BN_MP_CLEAR_C
-#endif
-
-#if defined(BN_MP_REDUCE_2K_L_C)
-   #define BN_MP_INIT_C
-   #define BN_MP_COUNT_BITS_C
-   #define BN_MP_DIV_2D_C
-   #define BN_MP_MUL_C
-   #define BN_S_MP_ADD_C
-   #define BN_MP_CMP_MAG_C
-   #define BN_S_MP_SUB_C
-   #define BN_MP_CLEAR_C
-#endif
-
-#if defined(BN_MP_REDUCE_2K_SETUP_C)
-   #define BN_MP_INIT_C
-   #define BN_MP_COUNT_BITS_C
-   #define BN_MP_2EXPT_C
-   #define BN_MP_CLEAR_C
-   #define BN_S_MP_SUB_C
-#endif
-
-#if defined(BN_MP_REDUCE_2K_SETUP_L_C)
-   #define BN_MP_INIT_C
-   #define BN_MP_2EXPT_C
-   #define BN_MP_COUNT_BITS_C
-   #define BN_S_MP_SUB_C
-   #define BN_MP_CLEAR_C
-#endif
-
-#if defined(BN_MP_REDUCE_IS_2K_C)
-   #define BN_MP_REDUCE_2K_C
-   #define BN_MP_COUNT_BITS_C
-#endif
-
-#if defined(BN_MP_REDUCE_IS_2K_L_C)
-#endif
-
-#if defined(BN_MP_REDUCE_SETUP_C)
-   #define BN_MP_2EXPT_C
-   #define BN_MP_DIV_C
-#endif
-
-#if defined(BN_MP_RSHD_C)
-   #define BN_MP_ZERO_C
-#endif
-
-#if defined(BN_MP_SET_C)
-   #define BN_MP_ZERO_C
-#endif
-
-#if defined(BN_MP_SET_INT_C)
-   #define BN_MP_ZERO_C
-   #define BN_MP_MUL_2D_C
-   #define BN_MP_CLAMP_C
-#endif
-
-#if defined(BN_MP_SHRINK_C)
-#endif
-
-#if defined(BN_MP_SIGNED_BIN_SIZE_C)
-   #define BN_MP_UNSIGNED_BIN_SIZE_C
-#endif
-
-#if defined(BN_MP_SQR_C)
-   #define BN_MP_TOOM_SQR_C
-   #define BN_MP_KARATSUBA_SQR_C
-   #define BN_FAST_S_MP_SQR_C
-   #define BN_S_MP_SQR_C
-#endif
-
-#if defined(BN_MP_SQRMOD_C)
-   #define BN_MP_INIT_C
-   #define BN_MP_SQR_C
-   #define BN_MP_CLEAR_C
-   #define BN_MP_MOD_C
-#endif
-
-#if defined(BN_MP_SQRT_C)
-   #define BN_MP_N_ROOT_C
-   #define BN_MP_ISZERO_C
-   #define BN_MP_ZERO_C
-   #define BN_MP_INIT_COPY_C
-   #define BN_MP_RSHD_C
-   #define BN_MP_DIV_C
-   #define BN_MP_ADD_C
-   #define BN_MP_DIV_2_C
-   #define BN_MP_CMP_MAG_C
-   #define BN_MP_EXCH_C
-   #define BN_MP_CLEAR_C
-#endif
-
-#if defined(BN_MP_SUB_C)
-   #define BN_S_MP_ADD_C
-   #define BN_MP_CMP_MAG_C
-   #define BN_S_MP_SUB_C
-#endif
-
-#if defined(BN_MP_SUB_D_C)
-   #define BN_MP_GROW_C
-   #define BN_MP_ADD_D_C
-   #define BN_MP_CLAMP_C
-#endif
-
-#if defined(BN_MP_SUBMOD_C)
-   #define BN_MP_INIT_C
-   #define BN_MP_SUB_C
-   #define BN_MP_CLEAR_C
-   #define BN_MP_MOD_C
-#endif
-
-#if defined(BN_MP_TO_SIGNED_BIN_C)
-   #define BN_MP_TO_UNSIGNED_BIN_C
-#endif
-
-#if defined(BN_MP_TO_SIGNED_BIN_N_C)
-   #define BN_MP_SIGNED_BIN_SIZE_C
-   #define BN_MP_TO_SIGNED_BIN_C
-#endif
-
-#if defined(BN_MP_TO_UNSIGNED_BIN_C)
-   #define BN_MP_INIT_COPY_C
-   #define BN_MP_ISZERO_C
-   #define BN_MP_DIV_2D_C
-   #define BN_MP_CLEAR_C
-#endif
-
-#if defined(BN_MP_TO_UNSIGNED_BIN_N_C)
-   #define BN_MP_UNSIGNED_BIN_SIZE_C
-   #define BN_MP_TO_UNSIGNED_BIN_C
-#endif
-
-#if defined(BN_MP_TOOM_MUL_C)
-   #define BN_MP_INIT_MULTI_C
-   #define BN_MP_MOD_2D_C
-   #define BN_MP_COPY_C
-   #define BN_MP_RSHD_C
-   #define BN_MP_MUL_C
-   #define BN_MP_MUL_2_C
-   #define BN_MP_ADD_C
-   #define BN_MP_SUB_C
-   #define BN_MP_DIV_2_C
-   #define BN_MP_MUL_2D_C
-   #define BN_MP_MUL_D_C
-   #define BN_MP_DIV_3_C
-   #define BN_MP_LSHD_C
-   #define BN_MP_CLEAR_MULTI_C
-#endif
-
-#if defined(BN_MP_TOOM_SQR_C)
-   #define BN_MP_INIT_MULTI_C
-   #define BN_MP_MOD_2D_C
-   #define BN_MP_COPY_C
-   #define BN_MP_RSHD_C
-   #define BN_MP_SQR_C
-   #define BN_MP_MUL_2_C
-   #define BN_MP_ADD_C
-   #define BN_MP_SUB_C
-   #define BN_MP_DIV_2_C
-   #define BN_MP_MUL_2D_C
-   #define BN_MP_MUL_D_C
-   #define BN_MP_DIV_3_C
-   #define BN_MP_LSHD_C
-   #define BN_MP_CLEAR_MULTI_C
-#endif
-
-#if defined(BN_MP_TORADIX_C)
-   #define BN_MP_ISZERO_C
-   #define BN_MP_INIT_COPY_C
-   #define BN_MP_DIV_D_C
-   #define BN_MP_CLEAR_C
-   #define BN_MP_S_RMAP_C
-#endif
-
-#if defined(BN_MP_TORADIX_N_C)
-   #define BN_MP_ISZERO_C
-   #define BN_MP_INIT_COPY_C
-   #define BN_MP_DIV_D_C
-   #define BN_MP_CLEAR_C
-   #define BN_MP_S_RMAP_C
-#endif
-
-#if defined(BN_MP_UNSIGNED_BIN_SIZE_C)
-   #define BN_MP_COUNT_BITS_C
-#endif
-
-#if defined(BN_MP_XOR_C)
-   #define BN_MP_INIT_COPY_C
-   #define BN_MP_CLAMP_C
-   #define BN_MP_EXCH_C
-   #define BN_MP_CLEAR_C
-#endif
-
-#if defined(BN_MP_ZERO_C)
-#endif
-
-#if defined(BN_PRIME_TAB_C)
-#endif
-
-#if defined(BN_REVERSE_C)
-#endif
-
-#if defined(BN_S_MP_ADD_C)
-   #define BN_MP_GROW_C
-   #define BN_MP_CLAMP_C
-#endif
-
-#if defined(BN_S_MP_EXPTMOD_C)
-   #define BN_MP_COUNT_BITS_C
-   #define BN_MP_INIT_C
-   #define BN_MP_CLEAR_C
-   #define BN_MP_REDUCE_SETUP_C
-   #define BN_MP_REDUCE_C
-   #define BN_MP_REDUCE_2K_SETUP_L_C
-   #define BN_MP_REDUCE_2K_L_C
-   #define BN_MP_MOD_C
-   #define BN_MP_COPY_C
-   #define BN_MP_SQR_C
-   #define BN_MP_MUL_C
-   #define BN_MP_SET_C
-   #define BN_MP_EXCH_C
-#endif
-
-#if defined(BN_S_MP_MUL_DIGS_C)
-   #define BN_FAST_S_MP_MUL_DIGS_C
-   #define BN_MP_INIT_SIZE_C
-   #define BN_MP_CLAMP_C
-   #define BN_MP_EXCH_C
-   #define BN_MP_CLEAR_C
-#endif
-
-#if defined(BN_S_MP_MUL_HIGH_DIGS_C)
-   #define BN_FAST_S_MP_MUL_HIGH_DIGS_C
-   #define BN_MP_INIT_SIZE_C
-   #define BN_MP_CLAMP_C
-   #define BN_MP_EXCH_C
-   #define BN_MP_CLEAR_C
-#endif
-
-#if defined(BN_S_MP_SQR_C)
-   #define BN_MP_INIT_SIZE_C
-   #define BN_MP_CLAMP_C
-   #define BN_MP_EXCH_C
-   #define BN_MP_CLEAR_C
-#endif
-
-#if defined(BN_S_MP_SUB_C)
-   #define BN_MP_GROW_C
-   #define BN_MP_CLAMP_C
-#endif
-
-#if defined(BNCORE_C)
-#endif
-
-#ifdef LTM3
-#define LTM_LAST
-#endif
-#include "tma_superclass.h"
-#include "tma_class.h"
-#else
-#define LTM_LAST
-#endif
-
-/* $Source$ */
-/* $Revision$ */
-/* $Date$ */
diff --git a/lib/silcmath/tma_superclass.h b/lib/silcmath/tma_superclass.h
deleted file mode 100644 (file)
index 0eeaf5f..0000000
+++ /dev/null
@@ -1,76 +0,0 @@
-/* super class file for PK algos */
-
-/* default ... include all MPI */
-#define LTM_ALL
-
-/* RSA only (does not support DH/DSA/ECC) */
-/* #define SC_RSA_1 */
-
-/* For reference.... On an Athlon64 optimizing for speed...
-
-   LTM's mpi.o with all functions [striped] is 142KiB in size.
-
-*/
-
-/* Works for RSA only, mpi.o is 68KiB */
-#ifdef SC_RSA_1
-   #define BN_MP_SHRINK_C
-   #define BN_MP_LCM_C
-   #define BN_MP_PRIME_RANDOM_EX_C
-   #define BN_MP_INVMOD_C
-   #define BN_MP_GCD_C
-   #define BN_MP_MOD_C
-   #define BN_MP_MULMOD_C
-   #define BN_MP_ADDMOD_C
-   #define BN_MP_EXPTMOD_C
-   #define BN_MP_SET_INT_C
-   #define BN_MP_INIT_MULTI_C
-   #define BN_MP_CLEAR_MULTI_C
-   #define BN_MP_UNSIGNED_BIN_SIZE_C
-   #define BN_MP_TO_UNSIGNED_BIN_C
-   #define BN_MP_MOD_D_C
-   #define BN_MP_PRIME_RABIN_MILLER_TRIALS_C
-   #define BN_REVERSE_C
-   #define BN_PRIME_TAB_C
-
-   /* other modifiers */
-   #define BN_MP_DIV_SMALL                    /* Slower division, not critical */
-
-   /* here we are on the last pass so we turn things off.  The functions classes are still there
-    * but we remove them specifically from the build.  This also invokes tweaks in functions
-    * like removing support for even moduli, etc...
-    */
-#ifdef LTM_LAST
-   #undef  BN_MP_TOOM_MUL_C
-   #undef  BN_MP_TOOM_SQR_C
-   #undef  BN_MP_KARATSUBA_MUL_C
-   #undef  BN_MP_KARATSUBA_SQR_C
-   #undef  BN_MP_REDUCE_C
-   #undef  BN_MP_REDUCE_SETUP_C
-   #undef  BN_MP_DR_IS_MODULUS_C
-   #undef  BN_MP_DR_SETUP_C
-   #undef  BN_MP_DR_REDUCE_C
-   #undef  BN_MP_REDUCE_IS_2K_C
-   #undef  BN_MP_REDUCE_2K_SETUP_C
-   #undef  BN_MP_REDUCE_2K_C
-   #undef  BN_S_MP_EXPTMOD_C
-   #undef  BN_MP_DIV_3_C
-   #undef  BN_S_MP_MUL_HIGH_DIGS_C
-   #undef  BN_FAST_S_MP_MUL_HIGH_DIGS_C
-   #undef  BN_FAST_MP_INVMOD_C
-
-   /* To safely undefine these you have to make sure your RSA key won't exceed the Comba threshold
-    * which is roughly 255 digits [7140 bits for 32-bit machines, 15300 bits for 64-bit machines]
-    * which means roughly speaking you can handle upto 2536-bit RSA keys with these defined without
-    * trouble.
-    */
-   #undef  BN_S_MP_MUL_DIGS_C
-   #undef  BN_S_MP_SQR_C
-   #undef  BN_MP_MONTGOMERY_REDUCE_C
-#endif
-
-#endif
-
-/* $Source$ */
-/* $Revision$ */
-/* $Date$ */
diff --git a/lib/silcsftp/.cvsignore b/lib/silcsftp/.cvsignore
deleted file mode 100644 (file)
index 282522d..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-Makefile
-Makefile.in
index 59f7dfb61a29ce9ad9d9d8df216d3a45c31967df..10eb160cbcbdf0ee7839960655a92197c0721ec6 100644 (file)
@@ -403,6 +403,9 @@ SilcSFTP silc_sftp_client_start(SilcStream stream,
 
   SILC_LOG_DEBUG(("Starting SFTP client"));
 
+  if (!schedule)
+    schedule = silc_schedule_get_global();
+
   if (!stream)
     return NULL;
 
index c111c9da8848b127379f10e61d1a9bc07a802901..afa2d2291c36d259dd55b081445e6649d24b9b26 100644 (file)
@@ -4,7 +4,7 @@
 
   Author: Pekka Riikonen <priikone@silcnet.org>
 
-  Copyright (C) 2001 - 2007 Pekka Riikonen
+  Copyright (C) 2001 - 2008 Pekka Riikonen
 
   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
@@ -575,7 +575,7 @@ void memfs_open(void *context, SilcSFTP sftp,
                           (attrs->flags & SILC_SFTP_ATTR_PERMISSIONS ?
                            attrs->permissions : 0600));
   if (fd == -1) {
-    (*callback)(sftp, silc_sftp_map_errno(errno), NULL, callback_context);
+    (*callback)(sftp, silc_sftp_map_errno(silc_errno), NULL, callback_context);
     return;
   }
 
@@ -601,7 +601,7 @@ void memfs_close(void *context, SilcSFTP sftp,
   if (h->fd != -1) {
     ret = silc_file_close(h->fd);
     if (ret == -1) {
-      (*callback)(sftp, silc_sftp_map_errno(errno), NULL, NULL,
+      (*callback)(sftp, silc_sftp_map_errno(silc_errno), NULL, NULL,
                  callback_context);
       return;
     }
@@ -630,7 +630,8 @@ void memfs_read(void *context, SilcSFTP sftp,
     if (!ret)
       (*callback)(sftp, SILC_SFTP_STATUS_EOF, NULL, 0, callback_context);
     else
-      (*callback)(sftp, silc_sftp_map_errno(errno), NULL, 0, callback_context);
+      (*callback)(sftp, silc_sftp_map_errno(silc_errno),
+                 NULL, 0, callback_context);
     return;
   }
 
@@ -640,7 +641,8 @@ void memfs_read(void *context, SilcSFTP sftp,
     if (!ret)
       (*callback)(sftp, SILC_SFTP_STATUS_EOF, NULL, 0, callback_context);
     else
-      (*callback)(sftp, silc_sftp_map_errno(errno), NULL, 0, callback_context);
+      (*callback)(sftp, silc_sftp_map_errno(silc_errno),
+                 NULL, 0, callback_context);
     return;
   }
 
@@ -665,7 +667,7 @@ void memfs_write(void *context, SilcSFTP sftp,
   /* Attempt to write */
   ret = silc_file_write(h->fd, data, data_len);
   if (ret <= 0) {
-    (*callback)(sftp, silc_sftp_map_errno(errno), NULL, NULL,
+    (*callback)(sftp, silc_sftp_map_errno(silc_errno), NULL, NULL,
                callback_context);
     return;
   }
@@ -769,7 +771,7 @@ void memfs_readdir(void *context, SilcSFTP sftp,
   char long_name[256];
   SilcUInt64 filesize = 0;
   char *date;
-  struct stat stats;
+  SilcFileStatStruct stats;
 
   if (!h->entry->directory) {
     (*callback)(sftp, SILC_SFTP_STATUS_FAILURE, NULL, callback_context);
@@ -803,8 +805,7 @@ void memfs_readdir(void *context, SilcSFTP sftp,
 
     if (!entry->directory) {
       filesize = silc_file_size(entry->data + 7);
-      memset(&stats, 0, sizeof(stats));
-      stat(entry->data + 7, &stats);
+      silc_file_stat(entry->data + 7, TRUE, &stats);
     }
 
     /* Long name format is:
@@ -839,8 +840,8 @@ void memfs_readdir(void *context, SilcSFTP sftp,
     attrs->gid = 0;
     if (!entry->directory) {
       attrs->flags |= SILC_SFTP_ATTR_ACMODTIME;
-      attrs->atime = stats.st_atime;
-      attrs->mtime = stats.st_mtime;
+      attrs->atime = silc_time_epoch(&stats.last_access);
+      attrs->mtime = silc_time_epoch(&stats.last_mod);
     }
 
     /* Add the name */
@@ -875,8 +876,7 @@ void memfs_stat(void *context, SilcSFTP sftp,
   MemFS fs = (MemFS)context;
   MemFSEntry entry;
   SilcSFTPAttributes attrs;
-  int ret;
-  struct stat stats;
+  SilcFileStatStruct stats;
 
   if (!path || !strlen(path))
     path = (const char *)DIR_SEPARATOR;
@@ -894,9 +894,8 @@ void memfs_stat(void *context, SilcSFTP sftp,
   }
 
   /* Get real stat */
-  ret = stat(entry->data + 7, &stats);
-  if (ret == -1) {
-    (*callback)(sftp, silc_sftp_map_errno(errno), NULL, callback_context);
+  if (!silc_file_stat(entry->data + 7, TRUE, &stats)) {
+    (*callback)(sftp, silc_sftp_map_errno(silc_errno), NULL, callback_context);
     return;
   }
 
@@ -908,11 +907,11 @@ void memfs_stat(void *context, SilcSFTP sftp,
   attrs->flags = (SILC_SFTP_ATTR_SIZE |
                  SILC_SFTP_ATTR_UIDGID |
                  SILC_SFTP_ATTR_ACMODTIME);
-  attrs->size = stats.st_size;
+  attrs->size = stats.size;
   attrs->uid = 0;                  /* We use always 0 UID and GID */
   attrs->gid = 0;
-  attrs->atime = stats.st_atime;
-  attrs->mtime = stats.st_mtime;
+  attrs->atime = silc_time_epoch(&stats.last_access);
+  attrs->mtime = silc_time_epoch(&stats.last_mod);
 
   /* Return attributes */
   (*callback)(sftp, SILC_SFTP_STATUS_OK, (const SilcSFTPAttributes)attrs,
@@ -929,8 +928,7 @@ void memfs_lstat(void *context, SilcSFTP sftp,
   MemFS fs = (MemFS)context;
   MemFSEntry entry;
   SilcSFTPAttributes attrs;
-  int ret;
-  struct stat stats;
+  SilcFileStatStruct stats;
 
   if (!path || !strlen(path))
     path = (const char *)DIR_SEPARATOR;
@@ -948,17 +946,8 @@ void memfs_lstat(void *context, SilcSFTP sftp,
   }
 
   /* Get real stat */
-#ifdef SILC_WIN32
-  ret = stat(entry->data + 7, &stats);
-#endif /* SILC_WIN32 */
-#ifdef SILC_UNIX
-  ret = lstat(entry->data + 7, &stats);
-#endif /* SILC_UNIX */
-#ifdef SILC_SYMBIAN
-  ret = stat(entry->data + 7, &stats);
-#endif /* SILC_SYMBIAN */
-  if (ret == -1) {
-    (*callback)(sftp, silc_sftp_map_errno(errno), NULL, callback_context);
+  if (!silc_file_stat(entry->data + 7, FALSE, &stats)) {
+    (*callback)(sftp, silc_sftp_map_errno(silc_errno), NULL, callback_context);
     return;
   }
 
@@ -970,11 +959,11 @@ void memfs_lstat(void *context, SilcSFTP sftp,
   attrs->flags = (SILC_SFTP_ATTR_SIZE |
                  SILC_SFTP_ATTR_UIDGID |
                  SILC_SFTP_ATTR_ACMODTIME);
-  attrs->size = stats.st_size;
+  attrs->size = stats.size;
   attrs->uid = 0;                  /* We use always 0 UID and GID */
   attrs->gid = 0;
-  attrs->atime = stats.st_atime;
-  attrs->mtime = stats.st_mtime;
+  attrs->atime = silc_time_epoch(&stats.last_access);
+  attrs->mtime = silc_time_epoch(&stats.last_mod);
 
   /* Return attributes */
   (*callback)(sftp, SILC_SFTP_STATUS_OK, (const SilcSFTPAttributes)attrs,
@@ -990,8 +979,7 @@ void memfs_fstat(void *context, SilcSFTP sftp,
 {
   MemFSFileHandle h = (MemFSFileHandle)handle;
   SilcSFTPAttributes attrs;
-  int ret;
-  struct stat stats;
+  SilcFileStatStruct stats;
 
   if (h->entry->directory || !h->entry->data) {
     (*callback)(sftp, SILC_SFTP_STATUS_FAILURE, NULL, callback_context);
@@ -999,9 +987,8 @@ void memfs_fstat(void *context, SilcSFTP sftp,
   }
 
   /* Get real stat */
-  ret = fstat(h->fd, &stats);
-  if (ret == -1) {
-    (*callback)(sftp, silc_sftp_map_errno(errno), NULL, callback_context);
+  if (!silc_file_fstat(h->fd, &stats)) {
+    (*callback)(sftp, silc_sftp_map_errno(silc_errno), NULL, callback_context);
     return;
   }
 
@@ -1013,11 +1000,11 @@ void memfs_fstat(void *context, SilcSFTP sftp,
   attrs->flags = (SILC_SFTP_ATTR_SIZE |
                  SILC_SFTP_ATTR_UIDGID |
                  SILC_SFTP_ATTR_ACMODTIME);
-  attrs->size = stats.st_size;
+  attrs->size = stats.size;
   attrs->uid = 0;                  /* We use always 0 UID and GID */
   attrs->gid = 0;
-  attrs->atime = stats.st_atime;
-  attrs->mtime = stats.st_mtime;
+  attrs->atime = silc_time_epoch(&stats.last_access);
+  attrs->mtime = silc_time_epoch(&stats.last_mod);
 
   /* Return attributes */
   (*callback)(sftp, SILC_SFTP_STATUS_OK, (const SilcSFTPAttributes)attrs,
index 549751e8aecc9cd3488b207f6e9dfdacf2c39794..b22e21fba5c8c55e80aee0411be951c5193f3a11 100644 (file)
@@ -361,6 +361,9 @@ SilcSFTP silc_sftp_server_start(SilcStream stream,
 {
   SilcSFTPServer server;
 
+  if (!schedule)
+    schedule = silc_schedule_get_global();
+
   server = silc_calloc(1, sizeof(*server));
   if (!server)
     return NULL;
index 826181856b24dd7ce839de8eee1b8a0700625d38..6ec07bba94c2aec6b414bde5dcaa5cdf8f7f0cfb 100644 (file)
@@ -4,7 +4,7 @@
 
   Author: Pekka Riikonen <priikone@silcnet.org>
 
-  Copyright (C) 2001 - 2007 Pekka Riikonen
+  Copyright (C) 2001 - 2008 Pekka Riikonen
 
   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
@@ -475,7 +475,7 @@ void silc_sftp_name_free(SilcSFTPName name)
 
 /* Maps errno to SFTP status message. */
 
-SilcSFTPStatus silc_sftp_map_errno(int err)
+SilcSFTPStatus silc_sftp_map_errno(SilcResult err)
 {
   SilcSFTPStatus ret;
 
@@ -483,18 +483,15 @@ SilcSFTPStatus silc_sftp_map_errno(int err)
   case 0:
     ret = SILC_SFTP_STATUS_OK;
     break;
-  case ENOENT:
-  case ENOTDIR:
-  case EBADF:
+  case SILC_ERR_NOT_DIRECTORY:
+  case SILC_ERR_NO_SUCH_FILE:
+  case SILC_ERR_BAD_FD:
     ret = SILC_SFTP_STATUS_NO_SUCH_FILE;
     break;
-  case EPERM:
-  case EACCES:
-  case EFAULT:
+  case SILC_ERR_PERMISSION_DENIED:
     ret = SILC_SFTP_STATUS_PERMISSION_DENIED;
     break;
-  case ENAMETOOLONG:
-  case EINVAL:
+  case SILC_ERR_INVALID_ARGUMENT:
     ret = SILC_SFTP_STATUS_BAD_MESSAGE;
     break;
   default:
index fef68ce4720419e5897a232bf9ac31cc4cfc6ccd..fe92bd5850154c9c9d400be881fa1fc325b2f8da 100644 (file)
@@ -1,6 +1,6 @@
 /*
 
-  sftp_util.h 
+  sftp_util.h
 
   Author: Pekka Riikonen <priikone@silcnet.org>
 
@@ -64,13 +64,13 @@ typedef SilcUInt32 SilcSFTPPacket;
    buffer. If `packet_buf' is non-NULL then the new packet data is put
    to that buffer instead of allocating new one.  If the new data cannot
    fit to `packet_buf' will be reallocated. */
-SilcBuffer silc_sftp_packet_encode(SilcSFTPPacket packet, 
+SilcBuffer silc_sftp_packet_encode(SilcSFTPPacket packet,
                                   SilcBuffer packet_buf, SilcUInt32 len, ...);
 
 /* Same as silc_sftp_packet_encode but takes the variable argument list
    pointer as argument. */
-SilcBuffer silc_sftp_packet_encode_vp(SilcSFTPPacket packet, 
-                                     SilcBuffer packet_buf, SilcUInt32 len, 
+SilcBuffer silc_sftp_packet_encode_vp(SilcSFTPPacket packet,
+                                     SilcBuffer packet_buf, SilcUInt32 len,
                                      va_list vp);
 
 /* Decodes the SFTP packet data `data' and return the SFTP packet type.
@@ -95,7 +95,7 @@ void silc_sftp_attr_free(SilcSFTPAttributes attr);
 void silc_sftp_name_add(SilcSFTPName name, const char *short_name,
                        const char *long_name, SilcSFTPAttributes attrs);
 
-/* Encodes the SilcSFTPName to a buffer and returns the allocated buffer. 
+/* Encodes the SilcSFTPName to a buffer and returns the allocated buffer.
    The caller must free the buffer. */
 SilcBuffer silc_sftp_name_encode(SilcSFTPName name);
 
@@ -108,6 +108,6 @@ SilcSFTPName silc_sftp_name_decode(SilcUInt32 count, SilcBuffer buffer);
 void silc_sftp_name_free(SilcSFTPName name);
 
 /* Maps errno to SFTP status message. */
-SilcSFTPStatus silc_sftp_map_errno(int err);
+SilcSFTPStatus silc_sftp_map_errno(SilcResult err);
 
 #endif /* SFTP_UTIL_H */
index 5a2702fcb19c86ed0b234525de32b90347b32124..d2364146c79f39c5f0254ce317efb6930748471f 100644 (file)
@@ -410,6 +410,9 @@ typedef void (*SilcSFTPExtendedCallback)(SilcSFTP sftp,
  *    used to read and write the SFTP packets.  The `error_cb' will be called
  *    in case a stream error occurs, such as end of stream.
  *
+ *    If `schedule' is NULL this will call silc_schedule_get_global to try to
+ *    get global scheduler.
+ *
  ***/
 SilcSFTP silc_sftp_client_start(SilcStream stream,
                                SilcSchedule schedule,
@@ -874,6 +877,9 @@ void silc_sftp_extended(SilcSFTP sftp,
  *    responsible of closing and destroying the `stream'.  The `fs' is the
  *    filesystem context allocated by the application.
  *
+ *    If `schedule' is NULL this will call silc_schedule_get_global to try to
+ *    get global scheduler.
+ *
  ***/
 SilcSFTP silc_sftp_server_start(SilcStream stream,
                                SilcSchedule schedule,
index 71ec8982979eaf6def1425d3858a438db8a8f53e..403e50715d1ffd721d1d4f161dc461fe18ee8235 100644 (file)
@@ -296,7 +296,7 @@ int main(int argc, char **argv)
     silc_log_set_debug_string("*");
   }
 
-  client->schedule = silc_schedule_init(0, NULL);
+  client->schedule = silc_schedule_init(0, NULL, NULL);
   if (!client->schedule)
     return -1;
 
index 294c293340770e76dbb719e84eb0897cd433cc10..ced35250e7c1d623a4380494f8d22cbaf8e8e3b2 100644 (file)
@@ -71,7 +71,7 @@ int main()
   silc_log_debug_hexdump(TRUE);
   silc_log_set_debug_string("*sftp*");
 
-  server->schedule = silc_schedule_init(0, NULL);
+  server->schedule = silc_schedule_init(0, NULL, NULL);
   if (!server->schedule)
     return -1;
 
diff --git a/lib/silcsim/.cvsignore b/lib/silcsim/.cvsignore
deleted file mode 100644 (file)
index 282522d..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-Makefile
-Makefile.in
diff --git a/lib/silcsim/Makefile.ad b/lib/silcsim/Makefile.ad
deleted file mode 100644 (file)
index e0b3fb2..0000000
+++ /dev/null
@@ -1,89 +0,0 @@
-#
-#  Makefile.ad
-#
-#  Author: Pekka Riikonen <priikone@silcnet.org>
-#
-#  Copyright (C) 2000 - 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.
-#
-
-AUTOMAKE_OPTIONS = 1.0 no-dependencies foreign
-
-if SILC_SIM
-noinst_LTLIBRARIES = libsilcsim.la
-else
-noinst_LTLIBRARIES =
-endif
-
-libsilcsim_la_SOURCES = \
-       silcsim.c \
-       silcsimutil.c
-
-#
-# SILC Ciphers to be compiled as modules
-#
-SIM_CIPHER_OBJS = \
-        none.o \
-        blowfish.o \
-        aes.o \
-        rsa.o \
-        twofish.o
-
-#
-# SILC Hash Functions to be compiled as modules
-#
-SIM_HASH_OBJS = \
-       md5.o \
-       sha1.o \
-       sha256.o
-
-if SILC_SIM
-all: $(SIM_CIPHER_OBJS) $(SIM_HASH_OBJS)
-endif
-
-if SILC_LIBTOOLFIX
-LTFLAGS = --libtool-enable-shared
-else
-LTFLAGS =
-endif
-
-$(SIM_CIPHER_OBJS):
-       @if test '!' -f lib$*.la ; then \
-         $(LIBTOOL) --mode=link $(CCLD) -rpath $(silc_modulesdir) \
-               ../silccrypt/$*.lo -o lib$*.la $(LTFLAGS); \
-         cd $(srcdir) && $(LN_S) -f $(srcdir)/.libs/lib$*.so \
-               $(srcdir)/$*.sim.so; \
-       fi
-
-$(SIM_HASH_OBJS):
-       @if test '!' -f lib$*.la ; then \
-         $(LIBTOOL) --mode=link $(CCLD) -rpath $(silc_modulesdir) \
-               ../silccrypt/$*.lo -o lib$*.la $(LTFLAGS); \
-         cd $(srcdir) && $(LN_S) -f $(srcdir)/.libs/lib$*.so \
-               $(srcdir)/$*.sim.so; \
-       fi
-
-CLEANFILES = *.sim.so *.la
-
-#ifdef SILC_DIST_TOOLKIT
-include_HEADERS = silcsim.h silcsimutil.h
-#endif SILC_DIST_TOOLKIT
-
-EXTRA_DIST = *.h
-
-#
-# Installation
-#
-install-data-hook:
-       -mkdir -p $(modulesdir)
-       -$(INSTALL_DATA) $(top_srcdir)/lib/silcsim/*.so $(modulesdir)/
-
-include $(top_srcdir)/Makefile.defines.in
diff --git a/lib/silcsim/silcsim.c b/lib/silcsim/silcsim.c
deleted file mode 100644 (file)
index 7a00daf..0000000
+++ /dev/null
@@ -1,167 +0,0 @@
-/*
-
-  silcsim.c
-
-  Author: Pekka Riikonen <priikone@silcnet.org>
-
-  Copyright (C) 2000 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.
-
-*/
-/*
-  These routines implement the SILC Module (SIM) support. SIM's are
-  dynamically run-time loaded shared objects that can implement some
-  routines SILC can use to extend its features. Currently all
-  SILC Crypto modules are implemented as SIM's. They all implement
-  the SILC Crypto API and can be loaded run-time into the SILC and
-  used when needed. 
-
-  Basically any SILC API can be implemented as SIM, however, currently
-  only SILC Crypto modules (ciphers and hash functions (PKCS are not
-  supported)) are supported.
-
-  This implementation expects that no SILC specific symbols needs to
-  be exported into the SIM's. This means that SIM's cannot directly
-  use SILC specific symbols or definitions. This feature can be
-  supported with SIM's but currently (with Crypto modules) this is
-  not needed. 
-
-  NOTE: These routines maybe highly system dependant thus I can expect 
-  some heavy #ifdef's here. However, I'm more happy to see some macro 
-  SIM API and restrict the #ifdef's to silcsim.h file.
-
-*/
-
-#include "silc.h"
-
-/* 
-   SILC Module (SIM) Context.
-
-   This context holds relevant information about the SIM loaded into
-   the system. Following short description of the fields.
-
-   void *handle
-
-       Pointer to the SIM. This is used to get the symbols out of
-       the SIM. This is initalized by system specific routine.
-
-   SilcSimType type
-
-       Type of the SIM.
-
-   char *libname;
-
-       Filename and path to the SIM library file.
-
-   int flags
-
-       Flags used with the SIM. These are system specific flags.
-       See below for more information.
-
-*/
-struct SilcSimStruct {
-  void *handle;
-  SilcSimType type;
-  char *libname;
-  int flags;
-};
-
-#ifdef SILC_SIM                        /* SIM upport enabled */
-
-/* Allocates new SIM context. This is later send to all SIM 
-   routines. */
-
-SilcSim silc_sim_alloc(SilcSimType type, const char *libname, 
-                      SilcUInt32 flags)
-{
-  SilcSim sim;
-
-  SILC_LOG_DEBUG(("Initializing new SIM context"));
-
-  sim = silc_calloc(1, sizeof(*sim));
-  if (!sim) {
-    SILC_LOG_ERROR(("Could not allocate new SIM context"));
-    return NULL;
-  }
-
-  sim->handle = NULL;
-  sim->type = type;
-  sim->libname = strdup(libname);
-  sim->flags = !flags ? SILC_SIM_FLAGS : flags;
-
-  return sim;
-}
-
-/* Free's SIM context. SIM must be closed with silc_sim_close before
-   calling this. */
-
-void silc_sim_free(SilcSim sim)
-{
-  assert(sim->handle == NULL);
-  silc_free(sim->libname);
-  silc_free(sim);
-}
-
-/* Loads SIM into the SILC system. */
-
-int silc_sim_load(SilcSim sim)
-{
-  assert(sim != NULL);
-
-  SILC_LOG_DEBUG(("Loading SIM '%s'", sim->libname));
-
-  /* Load the library */
-  sim->handle = dlopen(sim->libname, sim->flags);
-  if (!sim->handle) {
-    SILC_LOG_ERROR(("Error loading SIM: %s", silc_sim_error(sim)));
-    return FALSE;
-  }
-
-  return TRUE;
-}
-
-/* Closes SIM. This is called when execution of program is ending or
-   one explicitly wants to remove this SIM from SILC. */
-
-int silc_sim_close(SilcSim sim)
-{
-  assert(sim != NULL);
-
-  SILC_LOG_DEBUG(("Closing SIM '%s'", sim->libname));
-
-  /* Close the library */
-  dlclose(sim->handle);
-  sim->handle = NULL;
-
-  return TRUE;
-}
-
-/* Returns error string if error has occured while processing SIM's. */
-
-const char *silc_sim_error(SilcSim sim)
-{
-  return dlerror();
-}
-
-/* Returns opaque pointer for a symbol in SIM. Caller must know the
-   symbols they want to get from SIM and use the returned pointer to
-   what ever it is intended. */
-
-void *silc_sim_getsym(SilcSim sim, const char *symbol)
-{
-  assert(sim != NULL);
-
-  SILC_LOG_DEBUG(("Getting symbol '%s' from SIM", symbol));
-
-  return dlsym(sim->handle, symbol);
-}
-
-#endif /* SILC_SIM */
diff --git a/lib/silcsim/silcsim.h b/lib/silcsim/silcsim.h
deleted file mode 100644 (file)
index 357ab57..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
-
-  silcsim.h
-
-  Author: Pekka Riikonen <priikone@silcnet.org>
-
-  Copyright (C) 2000 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 SILCSIM_H
-#define SILCSIM_H
-
-typedef struct SilcSimStruct *SilcSim;
-
-/* All SIM types. New types maybe freely added. */
-typedef enum {
-  SILC_SIM_NONE = 0,
-  SILC_SIM_CIPHER,
-  SILC_SIM_HASH,
-} SilcSimType;
-
-/* Flags used to retrieve the symbols from the library file. Default
-   is that the symbols are resolved as they are loaded. However, if
-   system doesn't support this we have no other choice but to do it lazy
-   thus experience some overhead when using the symbol first time. */
-#if defined(RTLD_NOW)
-#define SILC_SIM_FLAGS RTLD_NOW
-#elif defined(RTLD_LAZY)
-#define SILC_SIM_FLAGS RTLD_LAZY
-#else
-#define SILC_SIM_FLAGS 0
-#endif
-
-/* Prototypes */
-SilcSim silc_sim_alloc(SilcSimType type, const char *libname, 
-                      SilcUInt32 flags);
-void silc_sim_free(SilcSim sim);
-int silc_sim_load(SilcSim sim);
-int silc_sim_close(SilcSim sim);
-const char *silc_sim_error(SilcSim sim);
-void *silc_sim_getsym(SilcSim sim, const char *symbol);
-
-#endif
diff --git a/lib/silcsim/silcsimutil.c b/lib/silcsim/silcsimutil.c
deleted file mode 100644 (file)
index 67cb5bf..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
-
-  silcsimutil.c
-
-  Author: Pekka Riikonen <priikone@silcnet.org>
-
-  Copyright (C) 2000 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.
-
-*/
-
-#include "silc.h"
-
-#ifdef SILC_SIM                        /* SIM support enabled */
-
-static char symname[256];
-
-/* This is used to produce the function names that are then get from
-   SIM's. */
-
-char *silc_sim_symname(char *symbol, char *function)
-{
-  int len1, len2, len3;
-
-  len1 = strlen(symbol);
-  len2 = strlen(function);
-  len3 = strlen(SILC_SIM_SYMBOL_PREFIX);
-  memset(symname, 0, sizeof(symname));
-  silc_strncat(symname, sizeof(symname), SILC_SIM_SYMBOL_PREFIX, len3);
-  silc_strncat(symname, sizeof(symname), "_", 1);
-  silc_strncat(symname, sizeof(symname), symbol, len1);
-  silc_strncat(symname, sizeof(symname), "_", 1);
-  silc_strncat(symname, sizeof(symname), function, len2);
-
-  return symname;
-}
-
-#endif /* SILC_SIM */
diff --git a/lib/silcsim/silcsimutil.h b/lib/silcsim/silcsimutil.h
deleted file mode 100644 (file)
index cf81882..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
-
-  silcsimutil.h
-
-  Author: Pekka Riikonen <priikone@silcnet.org>
-
-  Copyright (C) 2000 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 SILCSIMUTIL_H
-#define SILCSIMUTIL_H
-
-#define SILC_SIM_SYMBOL_PREFIX "silc"
-
-/* Prototypes */
-
-char *silc_sim_symname(char *symbol, char *function);
-
-#endif
diff --git a/lib/silcske/.cvsignore b/lib/silcske/.cvsignore
deleted file mode 100644 (file)
index 282522d..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-Makefile
-Makefile.in
index 3e92d0ed86a50ca24b08748836f17651d1b3255e..d44e9faf35d7354fdb4632267f405ddd16cd2d4b 100644 (file)
 
 /************************** Types and definitions ***************************/
 
+SILC_FSM_STATE(silc_connauth_st_initiator_start);
+SILC_FSM_STATE(silc_connauth_st_initiator_auth_send);
+SILC_FSM_STATE(silc_connauth_st_initiator_result);
+SILC_FSM_STATE(silc_connauth_st_initiator_failure);
+SILC_FSM_STATE(silc_connauth_st_responder_start);
+SILC_FSM_STATE(silc_connauth_st_responder_authenticate);
+SILC_FSM_STATE(silc_connauth_st_responder_authenticate_pk);
+SILC_FSM_STATE(silc_connauth_st_responder_success);
+SILC_FSM_STATE(silc_connauth_st_responder_failure);
+
 static SilcBool silc_connauth_packet_receive(SilcPacketEngine engine,
                                             SilcPacketStream stream,
                                             SilcPacket packet,
@@ -33,6 +43,7 @@ struct SilcConnAuthStruct {
   SilcSKE ske;
   SilcFSM fsm;
   SilcAsyncOperationStruct op;
+  SilcAsyncOperation key_op;
   SilcConnectionType conn_type;
   SilcAuthMethod auth_method;
   void *auth_data;
@@ -76,19 +87,44 @@ static SilcBool silc_connauth_packet_receive(SilcPacketEngine engine,
 static void silc_connauth_abort(SilcAsyncOperation op, void *context)
 {
   SilcConnAuth connauth = context;
+  if (connauth->key_op)
+    silc_async_abort(connauth->key_op, NULL, NULL);
   connauth->aborted = TRUE;
 }
 
+/* Signature callback */
+
+static void silc_connauth_get_signature_cb(SilcBool success,
+                                          const unsigned char *signature,
+                                          SilcUInt32 signature_len,
+                                          void *context)
+{
+  SilcConnAuth connauth = context;
+
+  connauth->key_op = NULL;
+
+  if (!success) {
+    silc_fsm_next(connauth->fsm, silc_connauth_st_initiator_failure);
+    SILC_FSM_CALL_CONTINUE(connauth->fsm);
+    return;
+  }
+
+  connauth->auth_data = silc_memdup(signature, signature_len);
+  connauth->auth_data_len = signature_len;
+
+  SILC_FSM_CALL_CONTINUE(connauth->fsm);
+}
+
 /* Generates signature for public key based authentication */
 
-static SilcBool silc_connauth_get_signature(SilcConnAuth connauth,
-                                           unsigned char **auth_data,
-                                           SilcUInt32 *auth_data_len)
+static SilcAsyncOperation
+silc_connauth_get_signature(SilcConnAuth connauth)
 {
-  int len;
+  SilcAsyncOperation op;
   SilcSKE ske;
   SilcPrivateKey private_key;
   SilcBuffer auth;
+  int len;
 
   SILC_LOG_DEBUG(("Compute signature"));
 
@@ -99,54 +135,73 @@ static SilcBool silc_connauth_get_signature(SilcConnAuth connauth,
      KE Start Payload. */
   len = ske->hash_len + silc_buffer_len(ske->start_payload_copy);
   auth = silc_buffer_alloc_size(len);
-  if (!auth)
-    return FALSE;
+  if (!auth) {
+    silc_connauth_get_signature_cb(FALSE, NULL, 0, connauth);
+    return NULL;
+  }
   silc_buffer_format(auth,
-                    SILC_STR_UI_XNSTRING(ske->hash, ske->hash_len),
-                    SILC_STR_UI_XNSTRING(
-                              ske->start_payload_copy->data,
-                              silc_buffer_len(ske->start_payload_copy)),
+                    SILC_STR_DATA(ske->hash, ske->hash_len),
+                    SILC_STR_DATA(ske->start_payload_copy->data,
+                                  silc_buffer_len(ske->start_payload_copy)),
                     SILC_STR_END);
 
-  len = ((silc_pkcs_private_key_get_len(private_key) + 7) / 8) + 1;
-  *auth_data = silc_calloc(len, sizeof(**auth_data));
-  if (*auth_data == NULL) {
-    silc_buffer_free(auth);
-    return FALSE;
-  }
-
   /* Compute signature */
-  if (!silc_pkcs_sign(private_key, auth->data, silc_buffer_len(auth),
-                     *auth_data, len, auth_data_len, TRUE, ske->prop->hash)) {
-    silc_free(*auth_data);
-    silc_buffer_free(auth);
-    return FALSE;
-  }
+  op = silc_pkcs_sign_async(private_key, auth->data, silc_buffer_len(auth),
+                           TRUE, ske->prop->hash, ske->rng,
+                           silc_connauth_get_signature_cb, connauth);
 
   silc_buffer_free(auth);
-  return TRUE;
+
+  return op;
+}
+
+/* Verify callback */
+
+static void silc_connauth_verify_signature_cb(SilcBool success,
+                                             void *context)
+{
+  SilcConnAuth connauth = context;
+
+  connauth->key_op = NULL;
+  silc_free(connauth->auth_data);
+
+  if (!success) {
+    SILC_LOG_DEBUG(("Invalid signature"));
+    silc_fsm_next(connauth->fsm, silc_connauth_st_responder_failure);
+    SILC_FSM_CALL_CONTINUE(connauth->fsm);
+    return;
+  }
+
+  SILC_LOG_DEBUG(("Signature is Ok"));
+  SILC_FSM_CALL_CONTINUE(connauth->fsm);
 }
 
 /* Verifies digital signature */
 
-static SilcBool silc_connauth_verify_signature(SilcConnAuth connauth,
-                                              SilcPublicKey pub_key,
-                                              unsigned char *sign,
-                                              SilcUInt32 sign_len)
+static SilcAsyncOperation
+silc_connauth_verify_signature(SilcConnAuth connauth,
+                              SilcPublicKey pub_key,
+                              unsigned char *sign,
+                              SilcUInt32 sign_len)
 {
-  int len;
+  SilcAsyncOperation op;
   SilcBuffer auth;
   SilcSKE ske = connauth->ske;
+  int len;
 
-  if (!pub_key || !sign)
-    return FALSE;
+  if (!pub_key || !sign) {
+    silc_connauth_verify_signature_cb(FALSE, connauth);
+    return NULL;
+  }
 
   /* Make the authentication data. Protocol says it is HASH plus
      KE Start Payload. */
   len = ske->hash_len + silc_buffer_len(ske->start_payload_copy);
   auth = silc_buffer_alloc_size(len);
-  if (!auth)
-    return FALSE;
+  if (!auth) {
+    silc_connauth_verify_signature_cb(FALSE, connauth);
+    return NULL;
+  }
   silc_buffer_format(auth,
                     SILC_STR_UI_XNSTRING(ske->hash, ske->hash_len),
                     SILC_STR_UI_XNSTRING(
@@ -155,15 +210,13 @@ static SilcBool silc_connauth_verify_signature(SilcConnAuth connauth,
                     SILC_STR_END);
 
   /* Verify signature */
-  if (!silc_pkcs_verify(pub_key, sign, sign_len, auth->data,
-                       silc_buffer_len(auth), ske->prop->hash)) {
-    silc_buffer_free(auth);
-    return FALSE;
-  }
+  op = silc_pkcs_verify_async(pub_key, sign, sign_len, auth->data,
+                             silc_buffer_len(auth), TRUE, ske->prop->hash,
+                             silc_connauth_verify_signature_cb, connauth);
 
   silc_buffer_free(auth);
 
-  return TRUE;
+  return op;
 }
 
 /* Timeout */
@@ -172,6 +225,8 @@ SILC_TASK_CALLBACK(silc_connauth_timeout)
 {
   SilcConnAuth connauth = context;
   SILC_LOG_DEBUG(("Protocol timeout"));
+  if (connauth->key_op)
+    silc_async_abort(connauth->key_op, NULL, NULL);
   connauth->aborted = TRUE;
   silc_fsm_continue_sync(connauth->fsm);
 }
@@ -255,18 +310,9 @@ SilcSKE silc_connauth_get_ske(SilcConnAuth connauth)
 
 /******************************** Initiator *********************************/
 
-SILC_FSM_STATE(silc_connauth_st_initiator_start);
-SILC_FSM_STATE(silc_connauth_st_initiator_result);
-SILC_FSM_STATE(silc_connauth_st_initiator_failure);
-
 SILC_FSM_STATE(silc_connauth_st_initiator_start)
 {
   SilcConnAuth connauth = fsm_context;
-  SilcBuffer packet;
-  int payload_len = 0;
-  unsigned char *auth_data = NULL;
-  SilcUInt32 auth_data_len = 0;
-  SilcPacketFlags flags = 0;
 
   SILC_LOG_DEBUG(("Start"));
 
@@ -282,32 +328,45 @@ SILC_FSM_STATE(silc_connauth_st_initiator_start)
                                   silc_connauth_timeout, connauth,
                                   connauth->timeout_secs, 0);
 
+  /** Generate auth data */
+  silc_fsm_next(fsm, silc_connauth_st_initiator_auth_send);
+
+  /* Get authentication data */
   switch (connauth->auth_method) {
   case SILC_AUTH_NONE:
     /* No authentication required */
+    connauth->auth_data = NULL;
+    connauth->auth_data_len = 0;
+    return SILC_FSM_CONTINUE;
     break;
 
   case SILC_AUTH_PASSWORD:
-    auth_data = silc_memdup(connauth->auth_data, connauth->auth_data_len);
-    if (!auth_data) {
-      /** Out of memory */
-      silc_fsm_next(fsm, silc_connauth_st_initiator_failure);
-      return SILC_FSM_CONTINUE;
-    }
-    auth_data_len = connauth->auth_data_len;
-    flags = SILC_PACKET_FLAG_LONG_PAD;
+    /* We have authentication data already */
+    return SILC_FSM_CONTINUE;
     break;
 
   case SILC_AUTH_PUBLIC_KEY:
-    if (!silc_connauth_get_signature(connauth, &auth_data, &auth_data_len)) {
-      /** Error computing signature */
-      silc_fsm_next(fsm, silc_connauth_st_initiator_failure);
-      return SILC_FSM_CONTINUE;
-    }
+    /* Compute signature */
+    SILC_FSM_CALL(connauth->key_op = silc_connauth_get_signature(connauth));
+    /* NOT REACHED */
     break;
   }
 
-  payload_len = 4 + auth_data_len;
+  silc_fsm_next(fsm, silc_connauth_st_initiator_failure);
+  return SILC_FSM_CONTINUE;
+}
+
+SILC_FSM_STATE(silc_connauth_st_initiator_auth_send)
+{
+  SilcConnAuth connauth = fsm_context;
+  SilcBuffer packet;
+  int payload_len ;
+  SilcPacketFlags flags = 0;
+
+  if (connauth->auth_method == SILC_AUTH_PASSWORD)
+    flags |= SILC_PACKET_FLAG_LONG_PAD;
+
+  payload_len = 4 + connauth->auth_data_len;
   packet = silc_buffer_alloc_size(payload_len);
   if (!packet) {
     /** Out of memory */
@@ -318,9 +377,12 @@ SILC_FSM_STATE(silc_connauth_st_initiator_start)
   silc_buffer_format(packet,
                     SILC_STR_UI_SHORT(payload_len),
                     SILC_STR_UI_SHORT(connauth->conn_type),
-                    SILC_STR_UI_XNSTRING(auth_data, auth_data_len),
+                    SILC_STR_DATA(connauth->auth_data,
+                                  connauth->auth_data_len),
                     SILC_STR_END);
 
+  silc_free(connauth->auth_data);
+
   /* Send the packet */
   if (!silc_packet_send(connauth->ske->stream, SILC_PACKET_CONNECTION_AUTH,
                        flags, packet->data, silc_buffer_len(packet))) {
@@ -329,10 +391,6 @@ SILC_FSM_STATE(silc_connauth_st_initiator_start)
     return SILC_FSM_CONTINUE;
   }
 
-  if (auth_data) {
-    memset(auth_data, 0, auth_data_len);
-    silc_free(auth_data);
-  }
   silc_buffer_free(packet);
 
   /** Wait for responder */
@@ -423,10 +481,14 @@ silc_connauth_initiator(SilcConnAuth connauth,
 
   connauth->conn_type = conn_type;
   connauth->auth_method = auth_method;
-  connauth->auth_data = auth_data;
-  connauth->auth_data_len = auth_data_len;
   connauth->completion = completion;
   connauth->context = context;
+  connauth->auth_data = auth_data;
+  connauth->auth_data_len = auth_data_len;
+
+  if (connauth->auth_method == SILC_AUTH_PASSWORD)
+    connauth->auth_data = silc_memdup(connauth->auth_data,
+                                     connauth->auth_data_len);
 
   /* Link to packet stream to get packets */
   silc_packet_stream_link(connauth->ske->stream,
@@ -444,12 +506,6 @@ silc_connauth_initiator(SilcConnAuth connauth,
 
 /******************************** Responder *********************************/
 
-SILC_FSM_STATE(silc_connauth_st_responder_start);
-SILC_FSM_STATE(silc_connauth_st_responder_authenticate);
-SILC_FSM_STATE(silc_connauth_st_responder_authenticate_pk);
-SILC_FSM_STATE(silc_connauth_st_responder_success);
-SILC_FSM_STATE(silc_connauth_st_responder_failure);
-
 SILC_FSM_STATE(silc_connauth_st_responder_start)
 {
   SilcConnAuth connauth = fsm_context;
@@ -605,7 +661,8 @@ SILC_FSM_STATE(silc_connauth_st_responder_authenticate)
 
     /** Find public key */
     silc_fsm_next(fsm, silc_connauth_st_responder_authenticate_pk);
-    SILC_FSM_CALL(silc_skr_find(repository, silc_fsm_get_schedule(fsm),
+    SILC_FSM_CALL(connauth->key_op =
+                 silc_skr_find(repository, silc_fsm_get_schedule(fsm),
                                find, silc_connauth_skr_callback,
                                connauth));
     /* NOT REACHED */
@@ -639,25 +696,16 @@ SILC_FSM_STATE(silc_connauth_st_responder_authenticate_pk)
   SILC_LOG_DEBUG(("Found %d public keys",
                  silc_dlist_count(connauth->public_keys)));
 
-  /* Verify signature */
+  /** Verify signature */
   key = silc_dlist_get(connauth->public_keys);
-  if (!silc_connauth_verify_signature(connauth, key->key,
-                                     connauth->auth_data,
-                                     connauth->auth_data_len)) {
-    /** Invalid signature */
-    SILC_LOG_DEBUG(("Invalid signature"));
-    silc_free(connauth->auth_data);
-    silc_fsm_next(fsm, silc_connauth_st_responder_failure);
-    return SILC_FSM_CONTINUE;
-  }
-
-  silc_free(connauth->auth_data);
+  silc_fsm_next(fsm, silc_connauth_st_responder_success);
+  SILC_FSM_CALL(connauth->key_op =
+               silc_connauth_verify_signature(connauth, key->key,
+                                              connauth->auth_data,
+                                              connauth->auth_data_len));
+  /* NOT REACHED */
 
   SILC_LOG_DEBUG(("Signature is Ok"));
-
-  /** Authentication successful */
-  silc_fsm_next(fsm, silc_connauth_st_responder_success);
-  return SILC_FSM_CONTINUE;
 }
 
 SILC_FSM_STATE(silc_connauth_st_responder_success)
index caf2579628bf9a1a426057a5179f2949dfa5d07e..fece34b67a8ee872a0e4cf792f6153a0f7311afe 100644 (file)
@@ -37,8 +37,10 @@ struct SilcSKECallbacksStruct {
 SILC_FSM_STATE(silc_ske_st_initiator_start);
 SILC_FSM_STATE(silc_ske_st_initiator_phase1);
 SILC_FSM_STATE(silc_ske_st_initiator_phase2);
+SILC_FSM_STATE(silc_ske_st_initiator_phase2_send);
 SILC_FSM_STATE(silc_ske_st_initiator_phase3);
 SILC_FSM_STATE(silc_ske_st_initiator_phase4);
+SILC_FSM_STATE(silc_ske_st_initiator_phase5);
 SILC_FSM_STATE(silc_ske_st_initiator_end);
 SILC_FSM_STATE(silc_ske_st_initiator_aborted);
 SILC_FSM_STATE(silc_ske_st_initiator_error);
@@ -48,6 +50,7 @@ SILC_FSM_STATE(silc_ske_st_responder_phase1);
 SILC_FSM_STATE(silc_ske_st_responder_phase2);
 SILC_FSM_STATE(silc_ske_st_responder_phase4);
 SILC_FSM_STATE(silc_ske_st_responder_phase5);
+SILC_FSM_STATE(silc_ske_st_responder_phase5_send);
 SILC_FSM_STATE(silc_ske_st_responder_end);
 SILC_FSM_STATE(silc_ske_st_responder_aborted);
 SILC_FSM_STATE(silc_ske_st_responder_failure);
@@ -136,6 +139,8 @@ static SilcPacketCallbacks silc_ske_stream_cbs =
 static void silc_ske_abort(SilcAsyncOperation op, void *context)
 {
   SilcSKE ske = context;
+  if (ske->key_op)
+    silc_async_abort(ske->key_op, NULL, NULL);
   ske->aborted = TRUE;
 }
 
@@ -628,7 +633,7 @@ static SilcSKEStatus silc_ske_create_rnd(SilcSKE ske, SilcMPInt *n,
                                         SilcMPInt *rnd)
 {
   SilcSKEStatus status = SILC_SKE_STATUS_OK;
-  unsigned char *string;
+  unsigned char string[2048];
   SilcUInt32 l;
 
   if (!len)
@@ -639,8 +644,7 @@ static SilcSKEStatus silc_ske_create_rnd(SilcSKE ske, SilcMPInt *n,
   l = ((len - 1) / 8);
 
   /* Get the random number as string */
-  string = silc_rng_get_rn_data(ske->rng, l);
-  if (!string)
+  if (!silc_rng_get_rn_data(ske->rng, l, string, sizeof(string)))
     return SILC_SKE_STATUS_OUT_OF_MEMORY;
 
   /* Decode the string into a MP integer */
@@ -654,7 +658,6 @@ static SilcSKEStatus silc_ske_create_rnd(SilcSKE ske, SilcMPInt *n,
     status = SILC_SKE_STATUS_ERROR;
 
   memset(string, 'F', l);
-  silc_free(string);
 
   return status;
 }
@@ -860,7 +863,7 @@ silc_ske_assemble_security_properties(SilcSKE ske,
   rp->pkcs_alg_len = strlen(rp->pkcs_alg_list);
 
   /* Get supported encryption algorithms */
-  rp->enc_alg_list = silc_cipher_get_supported();
+  rp->enc_alg_list = silc_cipher_get_supported(TRUE);
   rp->enc_alg_len = strlen(rp->enc_alg_list);
 
   /* Get supported hash algorithms */
@@ -1000,6 +1003,86 @@ SILC_TASK_CALLBACK(silc_ske_timeout)
   silc_fsm_continue_sync(&ske->fsm);
 }
 
+/* Initiator signature callback */
+
+static void silc_ske_initiator_sign_cb(SilcBool success,
+                                      const unsigned char *signature,
+                                      SilcUInt32 signature_len,
+                                      void *context)
+{
+  SilcSKE ske = context;
+
+  ske->key_op = NULL;
+
+  if (ske->aborted) {
+    silc_fsm_next(&ske->fsm, silc_ske_st_initiator_failure);
+    SILC_FSM_CALL_CONTINUE(&ske->fsm);
+    return;
+  }
+
+  ske->ke1_payload->sign_data = silc_memdup(signature, signature_len);
+  if (ske->ke1_payload->sign_data)
+    ske->ke1_payload->sign_len = signature_len;
+
+  SILC_FSM_CALL_CONTINUE(&ske->fsm);
+}
+
+/* Responder signature callback */
+
+static void silc_ske_responder_sign_cb(SilcBool success,
+                                      const unsigned char *signature,
+                                      SilcUInt32 signature_len,
+                                      void *context)
+{
+  SilcSKE ske = context;
+
+  ske->key_op = NULL;
+
+  if (ske->aborted) {
+    silc_fsm_next(&ske->fsm, silc_ske_st_responder_failure);
+    SILC_FSM_CALL_CONTINUE(&ske->fsm);
+    return;
+  }
+
+  ske->ke2_payload->sign_data = silc_memdup(signature, signature_len);
+  if (ske->ke2_payload->sign_data)
+    ske->ke2_payload->sign_len = signature_len;
+
+  SILC_FSM_CALL_CONTINUE(&ske->fsm);
+}
+
+/* Verify callback */
+
+static void silc_ske_verify_cb(SilcBool success, void *context)
+{
+  SilcSKE ske = context;
+
+  ske->key_op = NULL;
+
+  if (ske->aborted) {
+    if (ske->responder)
+      silc_fsm_next(&ske->fsm, silc_ske_st_responder_failure);
+    else
+      silc_fsm_next(&ske->fsm, silc_ske_st_initiator_failure);
+    SILC_FSM_CALL_CONTINUE(&ske->fsm);
+    return;
+  }
+
+  if (!success) {
+    SILC_LOG_ERROR(("Signature verification failed, incorrect signature"));
+    ske->status = SILC_SKE_STATUS_INCORRECT_SIGNATURE;
+    if (ske->responder)
+      silc_fsm_next(&ske->fsm, silc_ske_st_responder_error);
+    else
+      silc_fsm_next(&ske->fsm, silc_ske_st_initiator_error);
+    SILC_FSM_CALL_CONTINUE(&ske->fsm);
+    return;
+  }
+
+  SILC_LOG_DEBUG(("Signature is Ok"));
+  SILC_FSM_CALL_CONTINUE(&ske->fsm);
+}
+
 /******************************* Protocol API *******************************/
 
 /* Allocates new SKE object. */
@@ -1337,7 +1420,6 @@ SILC_FSM_STATE(silc_ske_st_initiator_phase2)
 {
   SilcSKE ske = fsm_context;
   SilcSKEStatus status;
-  SilcBuffer payload_buf;
   SilcMPInt *x;
   SilcSKEKEPayload payload;
   SilcUInt32 pk_len;
@@ -1385,13 +1467,16 @@ SILC_FSM_STATE(silc_ske_st_initiator_phase2)
   silc_mp_init(&payload->x);
   silc_mp_pow_mod(&payload->x, &ske->prop->group->generator, x,
                  &ske->prop->group->group);
+  ske->x = x;
 
   /* Get public key */
-  payload->pk_data = silc_pkcs_public_key_encode(ske->public_key, &pk_len);
+  payload->pk_data = silc_pkcs_public_key_encode(NULL, ske->public_key,
+                                                &pk_len);
   if (!payload->pk_data) {
     /** Error encoding public key */
     silc_mp_uninit(x);
     silc_free(x);
+    ske->x = NULL;
     silc_mp_uninit(&payload->x);
     silc_free(payload);
     ske->ke1_payload = NULL;
@@ -1402,10 +1487,13 @@ SILC_FSM_STATE(silc_ske_st_initiator_phase2)
   payload->pk_len = pk_len;
   payload->pk_type = silc_pkcs_get_type(ske->public_key);
 
+  /** Send KE1 packet */
+  silc_fsm_next(fsm, silc_ske_st_initiator_phase2_send);
+
   /* Compute signature data if we are doing mutual authentication */
   if (ske->private_key && ske->prop->flags & SILC_SKE_SP_FLAG_MUTUAL) {
-    unsigned char hash[SILC_HASH_MAXLEN], sign[2048 + 1];
-    SilcUInt32 hash_len, sign_len;
+    unsigned char hash[SILC_HASH_MAXLEN];
+    SilcUInt32 hash_len;
 
     SILC_LOG_DEBUG(("We are doing mutual authentication"));
     SILC_LOG_DEBUG(("Computing HASH_i value"));
@@ -1417,30 +1505,32 @@ SILC_FSM_STATE(silc_ske_st_initiator_phase2)
     SILC_LOG_DEBUG(("Signing HASH_i value"));
 
     /* Sign the hash value */
-    if (!silc_pkcs_sign(ske->private_key, hash, hash_len, sign,
-                       sizeof(sign) - 1, &sign_len, FALSE, ske->prop->hash)) {
-      /** Error computing signature */
-      silc_mp_uninit(x);
-      silc_free(x);
-      silc_mp_uninit(&payload->x);
-      silc_free(payload->pk_data);
-      silc_free(payload);
-      ske->ke1_payload = NULL;
-      ske->status = SILC_SKE_STATUS_SIGNATURE_ERROR;
-      silc_fsm_next(fsm, silc_ske_st_initiator_error);
-      return SILC_FSM_CONTINUE;
-    }
-    payload->sign_data = silc_memdup(sign, sign_len);
-    if (payload->sign_data)
-      payload->sign_len = sign_len;
-    memset(sign, 0, sizeof(sign));
+    SILC_FSM_CALL(ske->key_op =
+                 silc_pkcs_sign_async(ske->private_key, hash, hash_len, FALSE,
+                                      ske->prop->hash, ske->rng,
+                                      silc_ske_initiator_sign_cb, ske));
+    /* NOT REACHED */
   }
 
+  return SILC_FSM_CONTINUE;
+}
+
+/* Send KE1 packet */
+
+SILC_FSM_STATE(silc_ske_st_initiator_phase2_send)
+{
+  SilcSKE ske = fsm_context;
+  SilcSKEStatus status;
+  SilcBuffer payload_buf;
+  SilcSKEKEPayload payload;
+
+  SILC_LOG_DEBUG(("Start"));
+
+  payload = ske->ke1_payload;
+
   status = silc_ske_payload_ke_encode(ske, payload, &payload_buf);
   if (status != SILC_SKE_STATUS_OK) {
     /** Error encoding KE payload */
-    silc_mp_uninit(x);
-    silc_free(x);
     silc_mp_uninit(&payload->x);
     silc_free(payload->pk_data);
     silc_free(payload->sign_data);
@@ -1451,10 +1541,6 @@ SILC_FSM_STATE(silc_ske_st_initiator_phase2)
     return SILC_FSM_CONTINUE;
   }
 
-  ske->x = x;
-
-  /* Check for backwards compatibility */
-
   /* Send the packet. */
   if (!silc_ske_packet_send(ske, SILC_PACKET_KEY_EXCHANGE_1, 0,
                            silc_buffer_data(payload_buf),
@@ -1595,7 +1681,6 @@ SILC_FSM_STATE(silc_ske_st_initiator_phase4)
   SilcSKEKEPayload payload;
   unsigned char hash[SILC_HASH_MAXLEN];
   SilcUInt32 hash_len;
-  int key_len, block_len;
 
   if (ske->aborted) {
     /** Aborted */
@@ -1621,22 +1706,56 @@ SILC_FSM_STATE(silc_ske_st_initiator_phase4)
   ske->hash = silc_memdup(hash, hash_len);
   ske->hash_len = hash_len;
 
+  /** Send reply */
+  silc_fsm_next(fsm, silc_ske_st_initiator_phase5);
+
   if (ske->prop->public_key) {
     SILC_LOG_DEBUG(("Public key is authentic"));
     SILC_LOG_DEBUG(("Verifying signature (HASH)"));
 
     /* Verify signature */
-    if (!silc_pkcs_verify(ske->prop->public_key, payload->sign_data,
-                         payload->sign_len, hash, hash_len, NULL)) {
-      SILC_LOG_ERROR(("Signature verification failed, incorrect signature"));
-      status = SILC_SKE_STATUS_INCORRECT_SIGNATURE;
-      goto err;
-    }
+    SILC_FSM_CALL(ske->key_op =
+                 silc_pkcs_verify_async(ske->prop->public_key,
+                                        payload->sign_data,
+                                        payload->sign_len, hash,
+                                        hash_len, FALSE, NULL,
+                                        silc_ske_verify_cb, ske));
+    /* NOT REACHED */
+  }
+ err:
+  memset(hash, 'F', sizeof(hash));
+  silc_ske_payload_ke_free(payload);
+  ske->ke2_payload = NULL;
+
+  silc_mp_uninit(ske->KEY);
+  silc_free(ske->KEY);
+  ske->KEY = NULL;
 
-    SILC_LOG_DEBUG(("Signature is Ok"));
-    memset(hash, 'F', hash_len);
+  if (ske->hash) {
+    memset(ske->hash, 'F', hash_len);
+    silc_free(ske->hash);
+    ske->hash = NULL;
   }
 
+  if (status == SILC_SKE_STATUS_OK)
+    status = SILC_SKE_STATUS_ERROR;
+
+  /** Error */
+  ske->status = status;
+  silc_fsm_next(fsm, silc_ske_st_initiator_error);
+  return SILC_FSM_CONTINUE;
+}
+
+/* Process key material */
+
+SILC_FSM_STATE(silc_ske_st_initiator_phase5)
+{
+  SilcSKE ske = fsm_context;
+  SilcSKEStatus status;
+  unsigned char tmp[4];
+  SilcUInt32 hash_len;
+  int key_len, block_len;
+
   ske->status = SILC_SKE_STATUS_OK;
 
   /* In case we are doing rekey move to finish it.  */
@@ -1656,12 +1775,13 @@ SILC_FSM_STATE(silc_ske_st_initiator_phase4)
   if (!ske->keymat) {
     SILC_LOG_ERROR(("Error processing key material"));
     status = SILC_SKE_STATUS_ERROR;
-    goto err;
+    silc_fsm_next(fsm, silc_ske_st_initiator_error);
+    return SILC_FSM_CONTINUE;
   }
 
   /* Send SUCCESS packet */
-  SILC_PUT32_MSB((SilcUInt32)SILC_SKE_STATUS_OK, hash);
-  if (!silc_ske_packet_send(ske, SILC_PACKET_SUCCESS, 0, hash, 4)) {
+  SILC_PUT32_MSB((SilcUInt32)SILC_SKE_STATUS_OK, tmp);
+  if (!silc_ske_packet_send(ske, SILC_PACKET_SUCCESS, 0, tmp, 4)) {
     /** Error sending packet */
     SILC_LOG_DEBUG(("Error sending packet"));
     ske->status = SILC_SKE_STATUS_ERROR;
@@ -1672,29 +1792,6 @@ SILC_FSM_STATE(silc_ske_st_initiator_phase4)
   /** Waiting completion */
   silc_fsm_next(fsm, silc_ske_st_initiator_end);
   return SILC_FSM_WAIT;
-
- err:
-  memset(hash, 'F', sizeof(hash));
-  silc_ske_payload_ke_free(payload);
-  ske->ke2_payload = NULL;
-
-  silc_mp_uninit(ske->KEY);
-  silc_free(ske->KEY);
-  ske->KEY = NULL;
-
-  if (ske->hash) {
-    memset(ske->hash, 'F', hash_len);
-    silc_free(ske->hash);
-    ske->hash = NULL;
-  }
-
-  if (status == SILC_SKE_STATUS_OK)
-    status = SILC_SKE_STATUS_ERROR;
-
-  /** Error */
-  ske->status = status;
-  silc_fsm_next(fsm, silc_ske_st_initiator_error);
-  return SILC_FSM_CONTINUE;
 }
 
 /* Protocol completed */
@@ -1783,7 +1880,8 @@ SILC_FSM_STATE(silc_ske_st_initiator_failure)
   SilcSKE ske = fsm_context;
   SilcUInt32 error = SILC_SKE_STATUS_ERROR;
 
-  if (ske->packet && silc_buffer_len(&ske->packet->buffer) == 4) {
+  if (ske->packet && ske->packet->type == SILC_PACKET_FAILURE &&
+      silc_buffer_len(&ske->packet->buffer) == 4) {
     SILC_GET32_MSB(error, ske->packet->buffer.data);
     ske->status = error;
     silc_packet_free(ske->packet);
@@ -2087,14 +2185,13 @@ SILC_FSM_STATE(silc_ske_st_responder_phase2)
   return SILC_FSM_CONTINUE;
 }
 
-/* Phase-4. Generate KE2 payload */
+/* Phase-4. Generate KE2 payload, verify signature */
 
 SILC_FSM_STATE(silc_ske_st_responder_phase4)
 {
   SilcSKE ske = fsm_context;
   SilcSKEStatus status;
-  SilcSKEKEPayload recv_payload, send_payload;
-  SilcMPInt *x, *KEY;
+  SilcSKEKEPayload recv_payload;
 
   if (ske->aborted) {
     /** Aborted */
@@ -2112,6 +2209,9 @@ SILC_FSM_STATE(silc_ske_st_responder_phase4)
 
   recv_payload = ske->ke1_payload;
 
+  /** Send KE2 packet */
+  silc_fsm_next(fsm, silc_ske_st_responder_phase5);
+
   /* The public key verification was performed only if the Mutual
      Authentication flag is set. */
   if (ske->start_payload &&
@@ -2133,19 +2233,30 @@ SILC_FSM_STATE(silc_ske_st_responder_phase4)
     SILC_LOG_DEBUG(("Verifying signature (HASH_i)"));
 
     /* Verify signature */
-    if (!silc_pkcs_verify(ske->prop->public_key, recv_payload->sign_data,
-                         recv_payload->sign_len, hash, hash_len, NULL)) {
-      /** Incorrect signature */
-      SILC_LOG_ERROR(("Signature verification failed, incorrect signature"));
-      ske->status = SILC_SKE_STATUS_INCORRECT_SIGNATURE;
-      silc_fsm_next(fsm, silc_ske_st_responder_error);
-      return SILC_FSM_CONTINUE;
-    }
+    SILC_FSM_CALL(ske->key_op =
+                 silc_pkcs_verify_async(ske->prop->public_key,
+                                        recv_payload->sign_data,
+                                        recv_payload->sign_len,
+                                        hash, hash_len, FALSE, NULL,
+                                        silc_ske_verify_cb, ske));
+    /* NOT REACHED */
+  }
 
-    SILC_LOG_DEBUG(("Signature is Ok"));
+  return SILC_FSM_CONTINUE;
+}
 
-    memset(hash, 'F', hash_len);
-  }
+/* Phase-5.  Send KE2 payload */
+
+SILC_FSM_STATE(silc_ske_st_responder_phase5)
+{
+  SilcSKE ske = fsm_context;
+  SilcSKEStatus status;
+  unsigned char hash[SILC_HASH_MAXLEN], *pk;
+  SilcUInt32 hash_len, pk_len;
+  SilcMPInt *x, *KEY;
+  SilcSKEKEPayload send_payload;
+
+  SILC_LOG_DEBUG(("Start"));
 
   /* Create the random number x, 1 < x < q. */
   x = silc_calloc(1, sizeof(*x));
@@ -2184,28 +2295,11 @@ SILC_FSM_STATE(silc_ske_st_responder_phase4)
                  &ske->prop->group->group);
   ske->KEY = KEY;
 
-  /** Send KE2 payload */
-  silc_fsm_next(fsm, silc_ske_st_responder_phase5);
-  return SILC_FSM_CONTINUE;
-}
-
-/* Phase-5.  Send KE2 payload */
-
-SILC_FSM_STATE(silc_ske_st_responder_phase5)
-{
-  SilcSKE ske = fsm_context;
-  SilcSKEStatus status;
-  SilcBuffer payload_buf;
-  unsigned char hash[SILC_HASH_MAXLEN], sign[2048 + 1], *pk;
-  SilcUInt32 hash_len, sign_len, pk_len;
-
-  SILC_LOG_DEBUG(("Start"));
-
   if (ske->public_key && ske->private_key) {
     SILC_LOG_DEBUG(("Getting public key"));
 
     /* Get the public key */
-    pk = silc_pkcs_public_key_encode(ske->public_key, &pk_len);
+    pk = silc_pkcs_public_key_encode(NULL, ske->public_key, &pk_len);
     if (!pk) {
       /** Error encoding public key */
       status = SILC_SKE_STATUS_OUT_OF_MEMORY;
@@ -2230,21 +2324,31 @@ SILC_FSM_STATE(silc_ske_st_responder_phase5)
   ske->hash = silc_memdup(hash, hash_len);
   ske->hash_len = hash_len;
 
+  /** Send KE2 packet */
+  silc_fsm_next(fsm, silc_ske_st_responder_phase5_send);
+
   if (ske->public_key && ske->private_key) {
     SILC_LOG_DEBUG(("Signing HASH value"));
 
     /* Sign the hash value */
-    if (!silc_pkcs_sign(ske->private_key, hash, hash_len, sign,
-                       sizeof(sign) - 1, &sign_len, FALSE, ske->prop->hash)) {
-      /** Error computing signature */
-      status = SILC_SKE_STATUS_SIGNATURE_ERROR;
-      silc_fsm_next(fsm, silc_ske_st_responder_error);
-      return SILC_FSM_CONTINUE;
-    }
-    ske->ke2_payload->sign_data = silc_memdup(sign, sign_len);
-    ske->ke2_payload->sign_len = sign_len;
-    memset(sign, 0, sizeof(sign));
+    SILC_FSM_CALL(ske->key_op =
+                 silc_pkcs_sign_async(ske->private_key, hash, hash_len, FALSE,
+                                      ske->prop->hash, ske->rng,
+                                      silc_ske_responder_sign_cb, ske));
+    /* NOT REACHED */
   }
+
+  return SILC_FSM_CONTINUE;
+}
+
+/* Send KE2 packet */
+
+SILC_FSM_STATE(silc_ske_st_responder_phase5_send)
+{
+  SilcSKE ske = fsm_context;
+  SilcSKEStatus status;
+  SilcBuffer payload_buf;
+
   ske->ke2_payload->pk_type = silc_pkcs_get_type(ske->public_key);
 
   /* Encode the Key Exchange Payload */
@@ -2356,7 +2460,8 @@ SILC_FSM_STATE(silc_ske_st_responder_failure)
 
   SILC_LOG_DEBUG(("Key exchange protocol failed"));
 
-  if (ske->packet && silc_buffer_len(&ske->packet->buffer) == 4) {
+  if (ske->packet && ske->packet->type == SILC_PACKET_FAILURE &&
+      silc_buffer_len(&ske->packet->buffer) == 4) {
     SILC_GET32_MSB(error, ske->packet->buffer.data);
     ske->status = error;
     silc_packet_free(ske->packet);
index 051324550b66727f0f413281fae1b8466df22b40..caa491a90f5ee95d5c3015654438063385478470 100644 (file)
@@ -75,6 +75,7 @@ struct SilcSKEStruct {
   SilcSchedule schedule;
   SilcFSMStruct fsm;
   SilcAsyncOperationStruct op;
+  SilcAsyncOperation key_op;
   SilcUInt16 session_port;
 
   /* Packet retransmission */
diff --git a/lib/silcskr/DIRECTORY b/lib/silcskr/DIRECTORY
deleted file mode 100644 (file)
index 943b0cb..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-<!--
-@LIBRARY=SILC Key Repository Library
-@FILENAME=silcskrlib.html
-@LINK=silcskr.html:SILC SKR Interface
--->
-
-<big><b>SILC Key Repository Library</b></big>
-<br />
-<small>Directory: lib/silcskr/</small>
-<br />
-<small>Library: libsilc.a, libsilc.lib</small>
-<br /><br />
-<b>Introduction</b>
-
-<br /><br />
-SILC Key Repository (SKR) Library can be used to store and retrieve public
-keys and certificates.
-
-<br /><br />
-@LINKS@
diff --git a/lib/silcskr/Makefile.ad b/lib/silcskr/Makefile.ad
deleted file mode 100644 (file)
index 26c9a6a..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-#
-#  Makefile.ad
-#
-#  Author: Pekka Riikonen <priikone@silcnet.org>
-#
-#  Copyright (C) 2005 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.
-#
-
-AUTOMAKE_OPTIONS = 1.0 no-dependencies foreign
-
-noinst_LTLIBRARIES = libsilcskr.la
-
-libsilcskr_la_SOURCES = silcskr.c
-
-#ifdef SILC_DIST_TOOLKIT
-include_HEADERS = silcskr.h silcskr_i.h
-#endif SILC_DIST_TOOLKIT
-
-EXTRA_DIST = *.h $(SILC_EXTRA_DIST)
-
-include $(top_srcdir)/Makefile.defines.in
diff --git a/lib/silcskr/silcskr.c b/lib/silcskr/silcskr.c
deleted file mode 100644 (file)
index 327c612..0000000
+++ /dev/null
@@ -1,988 +0,0 @@
-/*
-
-  silcskr.c
-
-  Author: Pekka Riikonen <priikone@silcnet.org>
-
-  Copyright (C) 2005 - 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.
-
-*/
-
-#include "silc.h"
-#include "silcskr.h"
-
-/************************** Types and definitions ***************************/
-
-/* Search constraints */
-typedef enum {
-  SILC_SKR_FIND_PKCS_TYPE,
-  SILC_SKR_FIND_USERNAME,
-  SILC_SKR_FIND_HOST,
-  SILC_SKR_FIND_REALNAME,
-  SILC_SKR_FIND_EMAIL,
-  SILC_SKR_FIND_ORG,
-  SILC_SKR_FIND_COUNTRY,
-  SILC_SKR_FIND_PUBLIC_KEY,
-  SILC_SKR_FIND_CONTEXT,
-  SILC_SKR_FIND_USAGE,         /* Never added as key specific */
-} SilcSKRFindType;
-
-/* Hash table key context */
-typedef struct {
-  SilcSKRFindType type;                /* Type of key */
-  void *data;                  /* Hash table key */
-} *SilcSKREntry, SilcSKREntryStruct;
-
-/* Foreach user context when finding entries from hash table */
-typedef struct {
-  SilcDList list;
-  void *key_context;
-  SilcSKRKeyUsage usage;
-} SilcSKRFindForeach;
-
-#if defined(SILC_DEBUG)
-static const char *find_name[] = {
-  "PKCS TYPE ",
-  "USERNAME  ",
-  "HOST      ",
-  "REALNAME  ",
-  "EMAIL     ",
-  "ORG       ",
-  "COUNTRY   ",
-  "PUBLIC KEY",
-  "CONTEXT   ",
-  "USAGE     ",
-  NULL
-};
-#endif /* SILC_DEBUG */
-
-/************************ Static utility functions **************************/
-
-#if defined(SILC_DEBUG)
-
-/* Returns search constraint string */
-
-static void silc_skr_type_string(SilcSKRFindType type, void *data,
-                                char *retbuf, SilcUInt32 retbuf_size)
-{
-  switch (type) {
-  case SILC_SKR_FIND_PKCS_TYPE:
-  case SILC_SKR_FIND_USAGE:
-    silc_snprintf(retbuf, retbuf_size, "[%s] [%d]", find_name[type],
-                 (int)SILC_PTR_TO_32(data));
-    break;
-
-  case SILC_SKR_FIND_PUBLIC_KEY:
-  case SILC_SKR_FIND_CONTEXT:
-    silc_snprintf(retbuf, retbuf_size, "[%s] [%p]", find_name[type], data);
-    break;
-
-  default:
-    silc_snprintf(retbuf, retbuf_size, "[%s] [%s]", find_name[type],
-                 (char *)data);
-  }
-}
-#endif /* SILC_DEBUG */
-
-/* Hash table destructor for search constraints */
-
-static void silc_skr_find_destructor(void *key, void *context,
-                                    void *user_context)
-{
-  SilcSKRFindType type = SILC_PTR_TO_32(key);
-  SilcPKCSType pkcs_type = SILC_PTR_TO_32(user_context);
-
-  switch (type) {
-  case SILC_SKR_FIND_PKCS_TYPE:
-  case SILC_SKR_FIND_USAGE:
-  case SILC_SKR_FIND_CONTEXT:
-    break;
-
-  case SILC_SKR_FIND_PUBLIC_KEY:
-    silc_pkcs_public_key_free(context);
-    break;
-
-  default:
-    /* In SILC Public key all entries are referenced from the public key
-       so don't free them.  This test is valid only when removing key
-       from the repository. */
-    if (pkcs_type == SILC_PKCS_SILC)
-      break;
-
-    silc_free(context);
-  }
-}
-
-/* Hash table destructor for key entries */
-
-static void silc_skr_destructor(void *key, void *context, void *user_context)
-{
-  SilcSKREntry type = key;
-  SilcSKRKeyInternal entry = context;
-  SilcPKCSType pkcs_type = silc_pkcs_get_type(entry->key.key);
-
-  /* Destroy search data, except for SILC_SKR_FIND_PUBLIC_KEY because it
-     shares same context with the key entry. */
-  if (SILC_PTR_TO_32(type->type) != SILC_SKR_FIND_PUBLIC_KEY)
-    silc_skr_find_destructor(SILC_32_TO_PTR(type->type), type->data,
-                            SILC_32_TO_PTR(pkcs_type));
-  silc_free(type);
-
-  /* Destroy key */
-  entry->refcnt--;
-  if (entry->refcnt > 0)
-    return;
-
-  SILC_LOG_DEBUG(("Freeing public key %p", entry->key.key));
-
-  silc_pkcs_public_key_free(entry->key.key);
-  silc_free(entry);
-}
-
-/* Hash table hash function for key entries */
-
-static SilcUInt32 silc_skr_hash(void *key, void *user_context)
-{
-  SilcSKREntry type = key;
-
-  switch (type->type) {
-  case SILC_SKR_FIND_PKCS_TYPE:
-  case SILC_SKR_FIND_CONTEXT:
-    return type->type + (type->type ^ SILC_PTR_TO_32(type->data));
-    break;
-
-  case SILC_SKR_FIND_PUBLIC_KEY:
-    return type->type + silc_hash_public_key(type->data, user_context);
-    break;
-
-  default:
-    break;
-  }
-
-  return type->type + silc_hash_string(type->data, user_context);
-}
-
-/* Hash table comparison function for key entries */
-
-static SilcBool silc_skr_compare(void *key1, void *key2, void *user_context)
-{
-  SilcSKREntry type1 = key1;
-  SilcSKREntry type2 = key2;
-
-  if (type1->type != type2->type)
-    return FALSE;
-
-  switch (type1->type) {
-  case SILC_SKR_FIND_PKCS_TYPE:
-  case SILC_SKR_FIND_CONTEXT:
-    return type1->data == type2->data;
-    break;
-
-  case SILC_SKR_FIND_PUBLIC_KEY:
-    return silc_hash_public_key_compare(type1->data, type2->data,
-                                       user_context);
-    break;
-
-  default:
-    break;
-  }
-
-  return silc_utf8_strcasecmp((const char *)type1->data,
-                             (const char *)type2->data);
-}
-
-/* Foreach function for finding entries in the repository */
-
-static void silc_skr_find_foreach(void *key, void *context,
-                                 void *user_context)
-{
-  SilcSKRFindForeach *f = user_context;
-  SilcSKRKeyInternal k = context;
-
-  if (k) {
-    /* If key context is present, it must match the context in the key.
-       This is used only internally when adding keys, to check if the key
-       is added with same context. */
-    if (f->key_context && f->key_context != k->key.key_context)
-      return;
-
-    /* Check for usage bits.  At least one usage bit must be set. */
-    if (f->usage && k->key.usage && (f->usage & k->key.usage) == 0)
-      return;
-
-    silc_dlist_add(f->list, k);
-  }
-}
-
-/* Finds entry from repository by search constraint type and data */
-
-static SilcBool silc_skr_find_entry(SilcSKR skr,
-                                   SilcSKRStatus *status,
-                                   SilcSKRFindType type,
-                                   void *type_data,
-                                   SilcDList *results,
-                                   void *key_context,
-                                   SilcSKRKeyUsage usage)
-{
-  SilcSKREntryStruct find;
-  SilcSKRFindForeach f;
-
-  f.list = silc_dlist_init();
-  if (!f.list) {
-    *status |= SILC_SKR_NO_MEMORY;
-    return FALSE;
-  }
-  f.key_context = key_context;
-  f.usage = usage;
-
-  find.type = type;
-  find.data = type_data;
-
-  silc_hash_table_find_foreach(skr->keys, (void *)&find,
-                              silc_skr_find_foreach, &f);
-
-  if (!silc_dlist_count(f.list)) {
-    *status |= SILC_SKR_NOT_FOUND;
-    silc_dlist_uninit(f.list);
-    return FALSE;
-  }
-
-  if (results)
-    *results = f.list;
-  else
-    silc_dlist_uninit(f.list);
-
-  return TRUE;
-}
-
-/* Add a key by search constraint type to repository */
-
-static SilcBool silc_skr_add_entry(SilcSKR skr, SilcSKRFindType type,
-                                  void *type_data, SilcSKRKeyInternal key)
-{
-  SilcSKREntry entry;
-
-#if defined(SILC_DEBUG)
-  char tmp[256];
-  memset(tmp, 0, sizeof(tmp));
-  silc_skr_type_string(type, type_data, tmp, sizeof(tmp) - 1);
-  SILC_LOG_DEBUG(("Search constraint %s", tmp));
-#endif /* SILC_DEBUG */
-
-  entry = silc_calloc(1, sizeof(*entry));
-  if (!entry)
-    return FALSE;
-
-  entry->type = type;
-  entry->data = type_data;
-
-  return silc_hash_table_add(skr->keys, entry, key);
-}
-
-/* Delete a key by search constraint type from repository */
-
-static SilcBool silc_skr_del_entry(SilcSKR skr, SilcSKRFindType type,
-                                  void *type_data, SilcSKRKeyInternal key)
-{
-  SilcSKREntryStruct entry;
-
-  if (!type_data)
-    return FALSE;
-
-  entry.type = type;
-  entry.data = type_data;
-
-  return silc_hash_table_del_by_context(skr->keys, &entry, key);
-}
-
-/* This performs AND operation.  Any entry already in `results' that is not
-   in `list' will be removed from `results'. */
-
-static SilcBool silc_skr_results_and(SilcDList list, SilcSKRStatus *status,
-                                    SilcDList *results)
-{
-  SilcSKRKeyInternal entry, r;
-
-  if (*results == NULL) {
-    *results = silc_dlist_init();
-    if (*results == NULL) {
-      *status |= SILC_SKR_NO_MEMORY;
-      return FALSE;
-    }
-  }
-
-  /* If results is empty, just add all entries from list to results */
-  if (!silc_dlist_count(*results)) {
-    silc_dlist_start(list);
-    while ((entry = silc_dlist_get(list)) != SILC_LIST_END)
-      silc_dlist_add(*results, entry);
-
-    return TRUE;
-  }
-
-  silc_dlist_start(*results);
-  while ((entry = silc_dlist_get(*results)) != SILC_LIST_END) {
-
-    /* Check if this entry is in list  */
-    silc_dlist_start(list);
-    while ((r = silc_dlist_get(list)) != SILC_LIST_END) {
-      if (r == entry)
-       break;
-    }
-    if (r != SILC_LIST_END)
-      continue;
-
-    /* Remove from results */
-    silc_dlist_del(*results, entry);
-  }
-
-  /* If results became empty, we did not find any key */
-  if (!silc_dlist_count(*results)) {
-    SILC_LOG_DEBUG(("Not all search constraints found"));
-    *status |= SILC_SKR_NOT_FOUND;
-    return FALSE;
-  }
-
-  return TRUE;
-}
-
-
-/***************************** SILC Public Key ******************************/
-
-/* Add SILC style public key to repository */
-
-static SilcSKRStatus silc_skr_add_silc(SilcSKR skr,
-                                      SilcPublicKey public_key,
-                                      SilcSKRKeyUsage usage,
-                                      void *key_context,
-                                      SilcSKRKey *return_key)
-{
-  SilcSKRKeyInternal key;
-  SilcSKRStatus status = SILC_SKR_ERROR;
-  SilcPublicKeyIdentifier ident;
-  SilcSILCPublicKey silc_pubkey;
-#if defined(SILC_DEBUG)
-  char tmp[256];
-#endif /* SILC_DEBUG */
-
-  /* Get the SILC public key */
-  silc_pubkey = silc_pkcs_get_context(SILC_PKCS_SILC, public_key);
-  ident = &silc_pubkey->identifier;
-
-  SILC_LOG_DEBUG(("Adding SILC public key %p [%s], context %p",
-                 public_key, ident->username, key_context));
-
-  silc_mutex_lock(skr->lock);
-
-  /* Check that this key hasn't been added already */
-  if (silc_skr_find_entry(skr, &status, SILC_SKR_FIND_PUBLIC_KEY,
-                         public_key, NULL, key_context, 0)) {
-    silc_mutex_unlock(skr->lock);
-    SILC_LOG_DEBUG(("Key already added"));
-    return status | SILC_SKR_ALREADY_EXIST;
-  }
-
-  /* Allocate key entry */
-  key = silc_calloc(1, sizeof(*key));
-  if (!key) {
-    silc_mutex_unlock(skr->lock);
-    return status | SILC_SKR_NO_MEMORY;
-  }
-
-  key->key.usage = usage;
-  key->key.key = public_key;
-  key->key.key_context = key_context;
-
-#if defined(SILC_DEBUG)
-  silc_skr_type_string(SILC_SKR_FIND_USAGE, SILC_32_TO_PTR(usage),
-                      tmp, sizeof(tmp) - 1);
-  SILC_LOG_DEBUG((" Search constraint %s", tmp));
-#endif /* SILC_DEBUG */
-
-  /* Add key specifics */
-
-  if (!silc_skr_add_entry(skr, SILC_SKR_FIND_PUBLIC_KEY,
-                         public_key, key))
-    goto err;
-  key->refcnt++;
-
-  if (!silc_skr_add_entry(skr, SILC_SKR_FIND_PKCS_TYPE,
-                         SILC_32_TO_PTR(SILC_PKCS_SILC), key))
-    goto err;
-  key->refcnt++;
-
-  if (ident->username) {
-    if (!silc_skr_add_entry(skr, SILC_SKR_FIND_USERNAME,
-                           ident->username, key))
-      goto err;
-    key->refcnt++;
-  }
-
-  if (ident->host) {
-    if (!silc_skr_add_entry(skr, SILC_SKR_FIND_HOST,
-                           ident->host, key))
-      goto err;
-    key->refcnt++;
-  }
-
-  if (ident->realname) {
-    if (!silc_skr_add_entry(skr, SILC_SKR_FIND_REALNAME,
-                           ident->realname, key))
-      goto err;
-    key->refcnt++;
-  }
-
-  if (ident->email) {
-    if (!silc_skr_add_entry(skr, SILC_SKR_FIND_EMAIL,
-                           ident->email, key))
-      goto err;
-    key->refcnt++;
-  }
-
-  if (ident->org) {
-    if (!silc_skr_add_entry(skr, SILC_SKR_FIND_ORG,
-                           ident->org, key))
-      goto err;
-    key->refcnt++;
-  }
-
-  if (ident->country) {
-    if (!silc_skr_add_entry(skr, SILC_SKR_FIND_COUNTRY,
-                           ident->country, key))
-      goto err;
-    key->refcnt++;
-  }
-
-  if (key_context) {
-    if (!silc_skr_add_entry(skr, SILC_SKR_FIND_CONTEXT,
-                           key_context, key))
-      goto err;
-    key->refcnt++;
-  }
-
-  silc_mutex_unlock(skr->lock);
-
-  if (return_key)
-    *return_key = (SilcSKRKey)key;
-
-  return SILC_SKR_OK;
-
- err:
-  silc_mutex_unlock(skr->lock);
-  return status;
-}
-
-/* Add SILC style public key to repository, and only the public key, not
-   other details from the key. */
-
-static SilcSKRStatus silc_skr_add_silc_simple(SilcSKR skr,
-                                             SilcPublicKey public_key,
-                                             SilcSKRKeyUsage usage,
-                                             void *key_context,
-                                             SilcSKRKey *return_key)
-{
-  SilcSKRKeyInternal key;
-  SilcSKRStatus status = SILC_SKR_ERROR;
-#if defined(SILC_DEBUG)
-  char tmp[256];
-#endif /* SILC_DEBUG */
-
-  SILC_LOG_DEBUG(("Adding SILC public key"));
-
-  silc_mutex_lock(skr->lock);
-
-  /* Check that this key hasn't been added already */
-  if (silc_skr_find_entry(skr, &status, SILC_SKR_FIND_PUBLIC_KEY,
-                         public_key, NULL, key_context, 0)) {
-    silc_mutex_unlock(skr->lock);
-    SILC_LOG_DEBUG(("Key already added"));
-    return status | SILC_SKR_ALREADY_EXIST;
-  }
-
-  /* Allocate key entry */
-  key = silc_calloc(1, sizeof(*key));
-  if (!key) {
-    silc_mutex_unlock(skr->lock);
-    return status | SILC_SKR_NO_MEMORY;
-  }
-
-  key->key.usage = usage;
-  key->key.key = public_key;
-  key->key.key_context = key_context;
-
-#if defined(SILC_DEBUG)
-  silc_skr_type_string(SILC_SKR_FIND_USAGE, SILC_32_TO_PTR(usage),
-                      tmp, sizeof(tmp) - 1);
-  SILC_LOG_DEBUG(("Search cons %s", tmp));
-#endif /* SILC_DEBUG */
-
-  /* Add key specifics */
-
-  if (!silc_skr_add_entry(skr, SILC_SKR_FIND_PUBLIC_KEY,
-                         public_key, key))
-    goto err;
-  key->refcnt++;
-
-  if (key_context) {
-    if (!silc_skr_add_entry(skr, SILC_SKR_FIND_CONTEXT,
-                           key_context, key))
-      goto err;
-    key->refcnt++;
-  }
-
-  silc_mutex_unlock(skr->lock);
-
-  if (return_key)
-    *return_key = (SilcSKRKey)key;
-
-  return SILC_SKR_OK;
-
- err:
-  silc_mutex_unlock(skr->lock);
-  return status;
-}
-
-/* Deletes SILC public key from repository */
-
-static SilcSKRStatus silc_skr_del_silc_public_key(SilcSKR skr,
-                                                 SilcPublicKey public_key,
-                                                 void *key_context)
-{
-  SilcSKRStatus status = SILC_SKR_ERROR;
-  SilcPublicKeyIdentifier ident;
-  SilcSILCPublicKey silc_pubkey;
-  SilcSKRKeyInternal key;
-  SilcDList entry;
-
-  /* Get the SILC public key */
-  silc_pubkey = silc_pkcs_get_context(SILC_PKCS_SILC, public_key);
-  ident = &silc_pubkey->identifier;
-
-  SILC_LOG_DEBUG(("Deleting SILC public key [%s]", ident->username));
-
-  silc_mutex_lock(skr->lock);
-
-  /* Check that this key exists */
-  if (!silc_skr_find_entry(skr, &status, SILC_SKR_FIND_PUBLIC_KEY,
-                          public_key, &entry, key_context, 0)) {
-    silc_mutex_unlock(skr->lock);
-    SILC_LOG_DEBUG(("Key does not exist"));
-    return status | SILC_SKR_NOT_FOUND;
-  }
-
-  silc_dlist_start(entry);
-  key = silc_dlist_get(entry);
-  silc_dlist_uninit(entry);
-
-  silc_skr_del_entry(skr, SILC_SKR_FIND_PUBLIC_KEY, public_key, key);
-  silc_skr_del_entry(skr, SILC_SKR_FIND_PKCS_TYPE,
-                    SILC_32_TO_PTR(SILC_PKCS_SILC), key);
-  silc_skr_del_entry(skr, SILC_SKR_FIND_USERNAME, ident->username, key);
-  silc_skr_del_entry(skr, SILC_SKR_FIND_HOST, ident->host, key);
-  silc_skr_del_entry(skr, SILC_SKR_FIND_REALNAME, ident->realname, key);
-  silc_skr_del_entry(skr, SILC_SKR_FIND_EMAIL, ident->email, key);
-  silc_skr_del_entry(skr, SILC_SKR_FIND_ORG, ident->org, key);
-  silc_skr_del_entry(skr, SILC_SKR_FIND_COUNTRY, ident->country, key);
-  silc_skr_del_entry(skr, SILC_SKR_FIND_CONTEXT, key_context, key);
-
-  silc_mutex_unlock(skr->lock);
-
-  return SILC_SKR_OK;
-}
-
-
-/**************************** Key Repository API ****************************/
-
-/* Allocate key repository */
-
-SilcSKR silc_skr_alloc(void)
-{
-  SilcSKR skr;
-
-  skr = silc_calloc(1, sizeof(*skr));
-  if (!skr)
-    return NULL;
-
-  if (!silc_skr_init(skr)) {
-    silc_skr_free(skr);
-    return NULL;
-  }
-
-  return skr;
-}
-
-/* Free key repository */
-
-void silc_skr_free(SilcSKR skr)
-{
-  silc_skr_uninit(skr);
-  silc_free(skr);
-}
-
-/* Initializes key repository */
-
-SilcBool silc_skr_init(SilcSKR skr)
-{
-  silc_mutex_alloc(&skr->lock);
-
-  skr->keys = silc_hash_table_alloc(0, silc_skr_hash, NULL,
-                                   silc_skr_compare, NULL,
-                                   silc_skr_destructor, NULL, TRUE);
-  if (!skr->keys)
-    return FALSE;
-
-  return TRUE;
-}
-
-/* Uninitializes key repository */
-
-void silc_skr_uninit(SilcSKR skr)
-{
-  if (skr->keys)
-    silc_hash_table_free(skr->keys);
-  silc_mutex_free(skr->lock);
-}
-
-/* Adds public key to key repository */
-
-SilcSKRStatus silc_skr_add_public_key(SilcSKR skr,
-                                     SilcPublicKey public_key,
-                                     SilcSKRKeyUsage usage,
-                                     void *key_context,
-                                     SilcSKRKey *return_key)
-{
-  SilcPKCSType type;
-
-  if (!public_key)
-    return SILC_SKR_ERROR;
-
-  type = silc_pkcs_get_type(public_key);
-
-  SILC_LOG_DEBUG(("Adding public key %p to repository", public_key));
-
-  switch (type) {
-
-  case SILC_PKCS_SILC:
-    return silc_skr_add_silc(skr, public_key, usage, key_context, return_key);
-    break;
-
-  default:
-    break;
-  }
-
-  return SILC_SKR_ERROR;
-}
-
-/* Adds public key to repository. */
-
-SilcSKRStatus silc_skr_add_public_key_simple(SilcSKR skr,
-                                            SilcPublicKey public_key,
-                                            SilcSKRKeyUsage usage,
-                                            void *key_context,
-                                            SilcSKRKey *return_key)
-{
-  SilcPKCSType type;
-
-  if (!public_key)
-    return SILC_SKR_ERROR;
-
-  type = silc_pkcs_get_type(public_key);
-
-  SILC_LOG_DEBUG(("Adding public key %p to repository", public_key));
-
-  switch (type) {
-
-  case SILC_PKCS_SILC:
-    return silc_skr_add_silc_simple(skr, public_key, usage, key_context,
-                                   return_key);
-    break;
-
-  default:
-    break;
-  }
-
-  return SILC_SKR_ERROR;
-}
-
-/* Remove key from repository */
-
-SilcSKRStatus silc_skr_del_public_key(SilcSKR skr,
-                                     SilcPublicKey public_key,
-                                     void *key_context)
-{
-  SilcPKCSType type;
-
-  if (!public_key)
-    return SILC_SKR_ERROR;
-
-  type = silc_pkcs_get_type(public_key);
-
-  SILC_LOG_DEBUG(("Deleting public key %p from repository", public_key));
-
-  switch (type) {
-
-  case SILC_PKCS_SILC:
-    return silc_skr_del_silc_public_key(skr, public_key, key_context);
-    break;
-
-  default:
-    break;
-  }
-
-  return SILC_SKR_ERROR;
-}
-
-/* Reference key */
-
-void silc_skr_ref_public_key(SilcSKR skr, SilcSKRKey key)
-{
-  SilcSKRKeyInternal k = (SilcSKRKeyInternal)key;
-
-  silc_mutex_lock(skr->lock);
-  SILC_LOG_DEBUG(("SKR key %p ref %d -> %d", k->refcnt, k->refcnt + 1));
-  k->refcnt++;
-  silc_mutex_unlock(skr->lock);
-}
-
-/* Release key reference. */
-
-void silc_skr_unref_public_key(SilcSKR skr, SilcSKRKey key)
-{
-  SilcSKRKeyInternal k = (SilcSKRKeyInternal)key;
-
-  silc_mutex_lock(skr->lock);
-
-  SILC_LOG_DEBUG(("SKR key %p ref %d -> %d", k->refcnt, k->refcnt - 1));
-  k->refcnt--;
-
-  if (k->refcnt == 0) {
-    /* If reference is zero, the key has been removed from the repository
-       already.  Just destroy the public key. */
-    silc_pkcs_public_key_free(key->key);
-    silc_free(key);
-  }
-
-  silc_mutex_unlock(skr->lock);
-}
-
-
-/************************** Search Constraints API **************************/
-
-/* Allocate search constraints */
-
-SilcSKRFind silc_skr_find_alloc(void)
-{
-  SilcSKRFind find;
-
-  find = silc_calloc(1, sizeof(*find));
-  if (!find)
-    return NULL;
-
-  find->constr = silc_hash_table_alloc(0, silc_hash_uint, NULL, NULL, NULL,
-                                      silc_skr_find_destructor, NULL, TRUE);
-  if (!find->constr) {
-    silc_skr_find_free(find);
-    return NULL;
-  }
-
-  return find;
-}
-
-/* Free search constraints */
-
-void silc_skr_find_free(SilcSKRFind find)
-{
-  if (find->constr)
-    silc_hash_table_free(find->constr);
-  silc_free(find);
-}
-
-SilcBool silc_skr_find_set_pkcs_type(SilcSKRFind find, SilcPKCSType type)
-{
-  return silc_hash_table_add(find->constr,
-                            SILC_32_TO_PTR(SILC_SKR_FIND_PKCS_TYPE),
-                            SILC_32_TO_PTR(type));
-}
-
-SilcBool silc_skr_find_set_username(SilcSKRFind find, const char *username)
-{
-  void *c = silc_memdup(username, strlen(username));
-  if (!c)
-    return FALSE;
-  return silc_hash_table_add(find->constr,
-                            SILC_32_TO_PTR(SILC_SKR_FIND_USERNAME), c);
-}
-
-SilcBool silc_skr_find_set_host(SilcSKRFind find, const char *host)
-{
-  void *c = silc_memdup(host, strlen(host));
-  if (!c)
-    return FALSE;
-  return silc_hash_table_add(find->constr,
-                            SILC_32_TO_PTR(SILC_SKR_FIND_HOST), c);
-}
-
-SilcBool silc_skr_find_set_realname(SilcSKRFind find, const char *realname)
-{
-  void *c = silc_memdup(realname, strlen(realname));
-  if (!c)
-    return FALSE;
-  return silc_hash_table_add(find->constr,
-                            SILC_32_TO_PTR(SILC_SKR_FIND_REALNAME), c);
-}
-
-SilcBool silc_skr_find_set_email(SilcSKRFind find, const char *email)
-{
-  void *c = silc_memdup(email, strlen(email));
-  if (!c)
-    return FALSE;
-  return silc_hash_table_add(find->constr,
-                            SILC_32_TO_PTR(SILC_SKR_FIND_EMAIL), c);
-}
-
-SilcBool silc_skr_find_set_org(SilcSKRFind find, const char *org)
-{
-  void *c = silc_memdup(org, strlen(org));
-  if (!c)
-    return FALSE;
-  return silc_hash_table_add(find->constr,
-                            SILC_32_TO_PTR(SILC_SKR_FIND_ORG), c);
-}
-
-SilcBool silc_skr_find_set_country(SilcSKRFind find, const char *country)
-{
-  void *c = silc_memdup(country, strlen(country));
-  if (!c)
-    return FALSE;
-  return silc_hash_table_add(find->constr,
-                            SILC_32_TO_PTR(SILC_SKR_FIND_COUNTRY), c);
-}
-
-SilcBool silc_skr_find_set_public_key(SilcSKRFind find,
-                                     SilcPublicKey public_key)
-{
-  SilcPublicKey pk = silc_pkcs_public_key_copy(public_key);
-  if (!pk)
-    return FALSE;
-  return silc_hash_table_add(find->constr,
-                            SILC_32_TO_PTR(SILC_SKR_FIND_PUBLIC_KEY), pk);
-}
-
-SilcBool silc_skr_find_set_context(SilcSKRFind find, void *context)
-{
-  if (!context)
-    return TRUE;
-  return silc_hash_table_add(find->constr,
-                            SILC_32_TO_PTR(SILC_SKR_FIND_CONTEXT), context);
-}
-
-SilcBool silc_skr_find_set_usage(SilcSKRFind find, SilcSKRKeyUsage usage)
-{
-  if (!usage)
-    return TRUE;
-  return silc_hash_table_add(find->constr,
-                            SILC_32_TO_PTR(SILC_SKR_FIND_USAGE),
-                            SILC_32_TO_PTR(usage));
-}
-
-/******************************** Search API ********************************/
-
-/* Finds key(s) by the set search constraints.  The callback will be called
-   once keys has been found. */
-/* This is now synchronous function but may later change async */
-
-SilcAsyncOperation silc_skr_find(SilcSKR skr, SilcSchedule schedule,
-                                SilcSKRFind find,
-                                SilcSKRFindCallback callback,
-                                void *callback_context)
-{
-  SilcSKRStatus status = SILC_SKR_ERROR;
-  SilcHashTableList htl;
-  SilcDList list, results = NULL;
-  void *type, *ctx, *usage = NULL;
-#if defined(SILC_DEBUG)
-  char tmp[256];
-#endif /* SILC_DEBUG */
-
-  SILC_LOG_DEBUG(("Finding key from repository"));
-
-  if (!find || !callback)
-    return NULL;
-
-  silc_mutex_lock(skr->lock);
-
-  /* Get usage bits, if searching by them */
-  silc_hash_table_find(find->constr, SILC_32_TO_PTR(SILC_SKR_FIND_USAGE),
-                      NULL, &usage);
-
-#if defined(SILC_DEBUG)
-  if (usage) {
-    memset(tmp, 0, sizeof(tmp));
-    silc_skr_type_string(SILC_SKR_FIND_USAGE, usage, tmp, sizeof(tmp) - 1);
-    SILC_LOG_DEBUG(("Finding key by %s", tmp));
-  }
-#endif /* SILC_DEBUG */
-
-  silc_hash_table_list(find->constr, &htl);
-  while (silc_hash_table_get(&htl, &type, &ctx)) {
-
-    /* SILC_SKR_FIND_USAGE is handled separately while searching the keys. */
-    if ((SilcSKRFindType)SILC_32_TO_PTR(type) == SILC_SKR_FIND_USAGE)
-      continue;
-
-#if defined(SILC_DEBUG)
-    memset(tmp, 0, sizeof(tmp));
-    silc_skr_type_string((SilcSKRFindType)SILC_32_TO_PTR(type),
-                        ctx, tmp, sizeof(tmp) - 1);
-    SILC_LOG_DEBUG(("Finding key by %s", tmp));
-#endif /* SILC_DEBUG */
-
-    /* Find entries by this search constraint */
-    if (!silc_skr_find_entry(skr, &status,
-                            (SilcSKRFindType)SILC_32_TO_PTR(type),
-                            ctx, &list, NULL, SILC_PTR_TO_32(usage))) {
-      SILC_LOG_DEBUG(("Not found"));
-      if (results) {
-       silc_dlist_uninit(results);
-       results = NULL;
-      }
-      break;
-    }
-
-    /* For now, our logic rule is AND.  All constraints must be found
-       to find the key.  Later OR might be added also. */
-    if (!silc_skr_results_and(list, &status, &results)) {
-      SILC_LOG_DEBUG(("Not found"));
-      if (results) {
-       silc_dlist_uninit(results);
-       results = NULL;
-      }
-      silc_dlist_uninit(list);
-      break;
-    }
-
-    silc_dlist_uninit(list);
-  }
-  silc_hash_table_list_reset(&htl);
-
-  silc_mutex_unlock(skr->lock);
-
-  /* Return results */
-  if (!results) {
-    callback(skr, find, status, NULL, callback_context);
-  } else {
-    silc_dlist_start(results);
-    callback(skr, find, SILC_SKR_OK, results, callback_context);
-  }
-
-  return NULL;
-}
diff --git a/lib/silcskr/silcskr.h b/lib/silcskr/silcskr.h
deleted file mode 100644 (file)
index be1521b..0000000
+++ /dev/null
@@ -1,590 +0,0 @@
-/*
-
-  silcskr.h
-
-  Author: Pekka Riikonen <priikone@silcnet.org>
-
-  Copyright (C) 2005 - 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.
-
-*/
-
-/****h* silcskr/SILC Key Repository
- *
- * DESCRIPTION
- *
- * SILC Key repository is a generic public key and certificate repository
- * which allows fast and versatile ways to retrieve public keys from the
- * the repository.
- *
- * SILC Key Repository is thread safe.  Same key repository context can be
- * safely used in multi threaded environment.
- *
- ***/
-
-#ifndef SILCSKR_H
-#define SILCSKR_H
-
-/****s* silcskr/SilcSKRAPI/SilcSKR
- *
- * NAME
- *
- *    typedef struct SilcSKRObject *SilcSKR, SilcSKRStruct;
- *
- * DESCRIPTION
- *
- *    This context is the actual SILC Key Repository and is allocated
- *    by silc_skr_alloc (or initialized by silc_skr_init) and given as
- *    attribute to all silc_skr_* functions.  It is freed by the
- *    silc_skr_free (or uninitialized with silc_skr_uninit) function.
- *
- ***/
-typedef struct SilcSKRObject *SilcSKR, SilcSKRStruct;
-
-/****s* silcskr/SilcSKRAPI/SilcSKRFind
- *
- * NAME
- *
- *    typedef struct SilcSKRFindStruct *SilcSKRFind
- *
- * DESCRIPTION
- *
- *    This context contains the search constraints used find keys from the
- *    key repository.  It is allocated by silc_skr_find_alloc and freed
- *    by silc_skr_find_free.  The context is given as argument to all
- *    silc_skr_find* functions.
- *
- ***/
-typedef struct SilcSKRFindStruct *SilcSKRFind;
-
-/****d* silcskr/SilcSKRAPI/SilcSKRKeyUsage
- *
- * NAME
- *
- *    typedef enum { ... } SilcSKRKeyUsage;
- *
- * DESCRIPTION
- *
- *    Indicates the usage of the key.  Keys can be added for different
- *    reasons and for different purpose to the repository.  SilcSKRKeyUsage
- *    indicates for what reason the key exists in the repository.  The default
- *    usage is SILC_SKR_USAGE_ANY and allows any kind of usage for the key.
- *    If the usage should be limited then specific usage bitmask can be
- *    specified when adding the key.  When searching keys from the
- *    repository at least one of the key usage bits must be found in order
- *    to find the key.
- *
- * SOURCE
- */
-typedef enum {
-  SILC_SKR_USAGE_ANY                   = 0x0000,  /* Any usage */
-  SILC_SKR_USAGE_AUTH                  = 0x0001,  /* Signatures/verification */
-  SILC_SKR_USAGE_ENC                   = 0x0002,  /* Encryption/decryption */
-  SILC_SKR_USAGE_KEY_AGREEMENT         = 0x0004,  /* Key agreement protocol */
-  SILC_SKR_USAGE_IDENTIFICATION        = 0x0008,  /* Identifying key owner */
-  SILC_SKR_USAGE_SERVICE_AUTHORIZATION = 0x0010,  /* Service authorization */
-
-  /* From 0x0100 reserved for private/application use. */
-} SilcSKRKeyUsage;
-/***/
-
-/****s* silcskr/SilcSKRAPI/SilcSKRKey
- *
- * NAME
- *
- *    typedef struct SilcSKRKeyStruct { ... } *SilcSKRKey;
- *
- * DESCRIPTION
- *
- *    This context holds the public key, optional public key specific
- *    context and public key usage bits.  This context is returned in
- *    the SilcSKRFindCallback list.  Each entry in the list is SIlcSKRKey.
- *
- * SOURCE
- *
- */
-typedef struct SilcSKRKeyStruct {
-  SilcSKRKeyUsage usage;       /* Key usage */
-  SilcPublicKey key;           /* Public key */
-  void *key_context;           /* Optional key specific context */
-} *SilcSKRKey;
-/***/
-
-/****d* silcskr/SilcSKRAPI/SilcSKRStatus
- *
- * NAME
- *
- *    typedef enum { ... } SilcSKRStatus;
- *
- * DESCRIPTION
- *
- *    Indicates the status of the key repository procedures.  This is
- *    returned to SilcSKRFindCallback function to indicate the status
- *    of the finding.  This is a bitmask, and more than one status may
- *    be set at one time.
- *
- *    If there are no errors only SILC_SKR_OK is set.  If error occurred
- *    then at least SILC_SKR_ERROR is set, and possibly other error
- *    status also.
- *
- *    If the SILC_SKR_UNSUPPORTED_TYPE is returned the repository does not
- *    support the public key type and it cannot be added to the repository.
- *
- * SOURCE
- */
-typedef enum {
-  SILC_SKR_OK                 = 0x00000001, /* All is Ok */
-  SILC_SKR_ERROR              = 0x00000002, /* Generic error status */
-  SILC_SKR_ALREADY_EXIST      = 0x00000004, /* Key already exist */
-  SILC_SKR_NOT_FOUND          = 0x00000008, /* No keys were found */
-  SILC_SKR_NO_MEMORY          = 0x00000010, /* System out of memory */
-  SILC_SKR_UNSUPPORTED_TYPE   = 0x00000020, /* Unsupported PKCS type */
-} SilcSKRStatus;
-/***/
-
-/****f* silcskr/SilcSKRAPI/SilcSKRFindCallback
- *
- * SYNOPSIS
- *
- *    typedef void (*SilcSKRFindCallback)(SilcSKR skr, SilcSKRFind find,
- *                                        SilcSKRStatus status,
- *                                        SilcDList keys, void *context);
- *
- * DESCRIPTION
- *
- *    Callback that is given as argument to silc_skr_find and other find
- *    functions.  Returns the results of the finding.  If keys were found
- *    the `keys' is non-NULL and receiver must free it with silc_dlist_uninit.
- *    Each entry in the `keys' is SilcSKRKey context.  The list `keys' is
- *    already at start so calling silc_dlist_start is not necessary when
- *    traversing the list from the start.  If the `find' is non-NULL it must
- *    be freed with silc_skr_find_free.
- *
- ***/
-typedef void (*SilcSKRFindCallback)(SilcSKR skr, SilcSKRFind find,
-                                   SilcSKRStatus status,
-                                   SilcDList keys, void *context);
-
-/****f* silcskr/SilcSKRAPI/silc_skr_alloc
- *
- * SYNOPSIS
- *
- *    SilcSKR silc_skr_alloc(void);
- *
- * DESCRIPTION
- *
- *    Allocates key repository context.
- *
- ***/
-SilcSKR silc_skr_alloc(void);
-
-/****f* silcskr/SilcSKRAPI/silc_skr_free
- *
- * SYNOPSIS
- *
- *    void silc_skr_free(SilcSKR skr);
- *
- * DESCRIPTION
- *
- *    Free's the key repository context `skr' and all resources in it.
- *
- ***/
-void silc_skr_free(SilcSKR skr);
-
-/****f* silcskr/SilcSKRAPI/silc_skr_init
- *
- * SYNOPSIS
- *
- *    SilcBool silc_skr_init(SilcSKR skr);
- *
- * DESCRIPTION
- *
- *    Initializes a pre-allocated SilcSKR context.  This function is
- *    equivalent to silc_skr_alloc but takes pre-allocated context as
- *    argument.  Returns FALSE if initialization failed.
- *
- ***/
-SilcBool silc_skr_init(SilcSKR skr);
-
-/****f* silcskr/SilcSKRAPI/silc_skr_uninit
- *
- * SYNOPSIS
- *
- *    void silc_skr_uninit(SilcSKR skr);
- *
- * DESCRIPTION
- *
- *    Uninitializes a pre-allocated SilcSKR context.  Use this function if
- *    you called silc_skr_init.
- *
- ***/
-void silc_skr_uninit(SilcSKR skr);
-
-/****f* silcskr/SilcSKRAPI/silc_skr_add_public_key
- *
- * SYNOPSIS
- *
- *    SilcSKRStatus silc_skr_add_public_key(SilcSKR skr,
- *                                          SilcPublicKey public_key,
- *                                          SilcSKRKeyUsage usage,
- *                                          void *key_context,
- *                                          SilcSKRKey *return_key);
- *
- * DESCRIPTION
- *
- *    Add a public key to repository.  The repository will steal `public_key'
- *    and caller must not free it.  The `key_context' is optional key specific
- *    context that will be saved in the repository with the key, and can be
- *    retrieved with the key.  Public key can be added only once to the
- *    repository.  To add same key more than once to repository different
- *    `key_context' must be used each time.
- *
- *    Returns an entry of the added public key in the repository to the
- *    `return_key' pointer, if it is non-NULL.  The returned entry remains
- *    valid as long as the public key is in the repository, however a
- *    reference may be taken with silc_skr_ref_public_key to assure the
- *    entry remains valid.
- *
- *    Returns SILC_SKR_OK if the key was added successfully, and error
- *    status if key could not be added, or has been added already.
- *
- * EXAMPLE
- *
- *    // Add a key to repository
- *    if (silc_skr_add_public_key(repository, pubkey, SILC_SKR_USAGE_ANY,
- *                                NULL, NULL) != SILC_SKR_OK)
- *      goto error;
- *
- ***/
-SilcSKRStatus silc_skr_add_public_key(SilcSKR skr,
-                                     SilcPublicKey public_key,
-                                     SilcSKRKeyUsage usage,
-                                     void *key_context,
-                                     SilcSKRKey *return_key);
-
-/****f* silcskr/SilcSKRAPI/silc_skr_add_public_key_simple
- *
- * SYNOPSIS
- *
- *    SilcSKRStatus silc_skr_add_public_key_simple(SilcSKR skr,
- *                                                 SilcPublicKey public_key,
- *                                                 SilcSKRKeyUsage usage,
- *                                                 void *key_context,
- *                                                 SilcSKRKey *return_key);
- *
- * DESCRIPTION
- *
- *    Same as silc_skr_add_public_key but adds only the public key, usage
- *    bits and key context.  The key cannot be found with any other search
- *    constraint except setting the public key, usage bits and/or key
- *    context as search constraint.  This function can be used to add the
- *    key with as little memory as possible to the repository, and makes
- *    it a good way to cheaply store large amounts of public keys.
- *
- *    Returns an entry of the added public key in the repository to the
- *    `return_key' pointer, if it is non-NULL.  The returned entry remains
- *    valid as long as the public key is in the repository, however a
- *    reference may be taken with silc_skr_ref_public_key to assure the
- *    entry remains valid.
- *
- *    Returns SILC_SKR_OK if the key was added successfully, and error
- *    status if key could not be added, or has been added already.
- *
- ***/
-SilcSKRStatus silc_skr_add_public_key_simple(SilcSKR skr,
-                                            SilcPublicKey public_key,
-                                            SilcSKRKeyUsage usage,
-                                            void *key_context,
-                                            SilcSKRKey *return_key);
-
-/****f* silcskr/SilcSKRAPI/silc_skr_del_public_key
- *
- * SYNOPSIS
- *
- *    SilcSKRStatus silc_skr_del_public_key(SilcSKR skr,
- *                                          SilcPublicKey public_key,
- *                                          void *key_context);
- *
- * DESCRIPTION
- *
- *    Removes and destroyes the public key from the repository.  The
- *    public_key will become invalid after this call returns.
- *
- *    Returns SILC_SKR_OK if the key was added successfully, and error
- *    status if key could not be added, or has been added already.
- *
- ***/
-SilcSKRStatus silc_skr_del_public_key(SilcSKR skr,
-                                     SilcPublicKey public_key,
-                                     void *key_context);
-
-/****f* silcskr/SilcSKRAPI/silc_skr_ref_public_key
- *
- * SYNOPSIS
- *
- *    void silc_skr_ref_public_key(SilcSKR skr, SilcSKRKey key);
- *
- * DESCRIPTION
- *
- *    Takes a reference of the public key added to repository indicated
- *    by `key'.  The reference must be released by calling the function
- *    silc_skr_unref_public_key when it is not needed anymore.
- *
- ***/
-void silc_skr_ref_public_key(SilcSKR skr, SilcSKRKey key);
-
-/****f* silcskr/SilcSKRAPI/silc_skr_unref_public_key
- *
- * SYNOPSIS
- *
- *    void silc_skr_unref_public_key(SilcSKR skr, SilcSKRKey key);
- *
- * DESCRIPTION
- *
- *    Releases the reference of the public key added to the repository
- *    indicated by `key'.  If the released reference is the last reference
- *    to the key it will become invalid after this function returns.
- *
- ***/
-void silc_skr_unref_public_key(SilcSKR skr, SilcSKRKey key);
-
-/****f* silcskr/SilcSKRAPI/silc_skr_find_alloc
- *
- * SYNOPSIS
- *
- *    SilcSKRFind silc_skr_find_alloc(void);
- *
- * DESCRIPTION
- *
- *    Allocates SilcSKRFind context that will hold search constraints used
- *    to find specific keys from the repository.  Caller must free the
- *    context by calling silc_skr_find_free.
- *
- ***/
-SilcSKRFind silc_skr_find_alloc(void);
-
-/****f* silcskr/SilcSKRAPI/silc_skr_find_free
- *
- * SYNOPSIS
- *
- *    void silc_skr_find_free(SilcSKRFind find);
- *
- * DESCRIPTION
- *
- *    Free's the search constraints context `find' and all resources in it.
- *
- ***/
-void silc_skr_find_free(SilcSKRFind find);
-
-/****f* silcskr/SilcSKRAPI/silc_skr_find_add_pkcs_type
- *
- * SYNOPSIS
- *
- *    SilcBool silc_skr_find_add_pkcs_type(SilcSKRFind find,
- *                                         SilcPKCSType type);
- *
- * DESCRIPTION
- *
- *    Sets public key cryptosystem type as search constraint.  Will search
- *    only for the specific type of key(s).
- *
- ***/
-SilcBool silc_skr_find_set_pkcs_type(SilcSKRFind find, SilcPKCSType type);
-
-/****f* silcskr/SilcSKRAPI/silc_skr_find_set_username
- *
- * SYNOPSIS
- *
- *    SilcBool silc_skr_find_set_username(SilcSKRFind find,
- *                                        const char *username);
- *
- * DESCRIPTION
- *
- *    Sets username as search constraint.  This specific username must be
- *    present in the key.
- *
- *    This may be used with SILC_PKCS_SILC PKCS type only.
- *
- ***/
-SilcBool silc_skr_find_set_username(SilcSKRFind find, const char *username);
-
-/****f* silcskr/SilcSKRAPI/silc_skr_find_set_host
- *
- * SYNOPSIS
- *
- *    SilcBool silc_skr_find_set_host(SilcSKRFind find,
- *                                    const char *host);
- *
- * DESCRIPTION
- *
- *    Sets host as search constraint.  This specific host must be
- *    present in the key.  The `host' may be a hostname or IP address.
- *
- *    This may be used with SILC_PKCS_SILC PKCS type only.
- *
- ***/
-SilcBool silc_skr_find_set_host(SilcSKRFind find, const char *host);
-
-/****f* silcskr/SilcSKRAPI/silc_skr_find_set_realname
- *
- * SYNOPSIS
- *
- *    SilcBool silc_skr_find_set_realname(SilcSKRFind find,
- *                                        const char *realname);
- *
- * DESCRIPTION
- *
- *    Sets real name as search constraint.  This specific name must be
- *    present in the key.
- *
- *    This may be used with SILC_PKCS_SILC PKCS type only.
- *
- ***/
-SilcBool silc_skr_find_set_realname(SilcSKRFind find, const char *realname);
-
-/****f* silcskr/SilcSKRAPI/silc_skr_find_set_email
- *
- * SYNOPSIS
- *
- *    SilcBool silc_skr_find_set_email(SilcSKRFind find,
- *                                     const char *email);
- *
- * DESCRIPTION
- *
- *    Sets email address as search constraint.  This specific address must be
- *    present in the key.
- *
- *    This may be used with SILC_PKCS_SILC PKCS type only.
- *
- ***/
-SilcBool silc_skr_find_set_email(SilcSKRFind find, const char *email);
-
-/****f* silcskr/SilcSKRAPI/silc_skr_find_set_org
- *
- * SYNOPSIS
- *
- *    SilcBool silc_skr_find_set_org(SilcSKRFind find,
- *                                   const char *email);
- *
- * DESCRIPTION
- *
- *    Sets organization as search constraint.  This specific organization
- *    must be present in the key.
- *
- *    This may be used with SILC_PKCS_SILC PKCS type only.
- *
- ***/
-SilcBool silc_skr_find_set_org(SilcSKRFind find, const char *org);
-
-/****f* silcskr/SilcSKRAPI/silc_skr_find_set_country
- *
- * SYNOPSIS
- *
- *    SilcBool silc_skr_find_set_country(SilcSKRFind find,
- *                                       const char *email);
- *
- * DESCRIPTION
- *
- *    Sets country as search constraint.  This specific country must be
- *    present in the key.
- *
- *    This may be used with SILC_PKCS_SILC PKCS type only.
- *
- ***/
-SilcBool silc_skr_find_set_country(SilcSKRFind find, const char *country);
-
-/****f* silcskr/SilcSKRAPI/silc_skr_find_set_public_key
- *
- * SYNOPSIS
- *
- *    SilcBool silc_skr_find_set_public_key(SilcSKRFind find,
- *                                          SilcPublicKey public_key);
- *
- * DESCRIPTION
- *
- *    Sets public key as search constraint.  This specific key must be
- *    present in the key.
- *
- ***/
-SilcBool silc_skr_find_set_public_key(SilcSKRFind find,
-                                     SilcPublicKey public_key);
-
-/****f* silcskr/SilcSKRAPI/silc_skr_find_set_context
- *
- * SYNOPSIS
- *
- *    SilcBool silc_skr_find_set_context(SilcSKRFind find, void *context);
- *
- * DESCRIPTION
- *
- *    Sets public key specific context as search constraint.  This specific
- *    context must be associated with the key.  This is the context that
- *    was given as argument when adding the key to repository.
- *
- ***/
-SilcBool silc_skr_find_set_context(SilcSKRFind find, void *context);
-
-/****f* silcskr/SilcSKRAPI/silc_skr_find_set_usage
- *
- * SYNOPSIS
- *
- *    SilcBool silc_skr_find_set_usage(SilcSKRFind find,
- *                                     SilcSKRKeyUsage usage);
- *
- * DESCRIPTION
- *
- *    Sets key usage as search constraint.  At least one of the key usage
- *    bits must be present in the key.  This search constraint cannot be
- *    used alone to search keys.  At least one other search constraint
- *    must also be used.
- *
- ***/
-SilcBool silc_skr_find_set_usage(SilcSKRFind find, SilcSKRKeyUsage usage);
-
-/****f* silcskr/SilcSKRAPI/silc_skr_find
- *
- * SYNOPSIS
- *
- *    SilcAsyncOperation silc_skr_find(SilcSKR skr, SilcSchedule schedule,
- *                                     SilcSKRFind find,
- *                                     SilcSKRFindCallback callback,
- *                                     void *callback_context);
- *
- * DESCRIPTION
- *
- *    Finds key(s) from key repository `skr' by the search constraints
- *    `find'.  As the finding procedure may be asynchronous this returns
- *    SilcAsyncOperation that may be used to control (like abort) the
- *    operation.  The `callback' with `callback_context' will be called
- *    to return found keys.  If this returns NULL the finding was not
- *    asynchronous, and the `callback' has been called already.
- *
- * EXAMPLE
- *
- *   SilcSKRFind find;
- *
- *   // Find all SILC public keys originating from Finland
- *   find = silc_skr_find_alloc();
- *   silc_skr_find_set_pkcs_type(find, SILC_PKCS_SILC);
- *   silc_skr_find_set_country(find, "FI");
- *
- *   // Find
- *   silc_skr_find(skr, schedule, find, find_callback, cb_context);
- *
- ***/
-SilcAsyncOperation silc_skr_find(SilcSKR skr, SilcSchedule schedule,
-                                SilcSKRFind find,
-                                SilcSKRFindCallback callback,
-                                void *callback_context);
-
-#include "silcskr_i.h"
-
-#endif /* SILCSKR_H */
diff --git a/lib/silcskr/silcskr_i.h b/lib/silcskr/silcskr_i.h
deleted file mode 100644 (file)
index ef6ec71..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
-
-  silcskr_i.h
-
-  Author: Pekka Riikonen <priikone@silcnet.org>
-
-  Copyright (C) 2005 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 SILCSKR_I_H
-#define SILCSKR_I_H
-
-#ifndef SILCSKR_H
-#error "Do not include this header directly"
-#endif
-
-/* Internal representation of SilcSKRKey context. */
-typedef struct {
-  struct SilcSKRKeyStruct key;            /* Key data */
-  SilcInt32 refcnt;                       /* Reference counter */
-} *SilcSKRKeyInternal;
-
-/* Key Repository context */
-struct SilcSKRObject {
-  SilcSchedule scheduler;
-  SilcMutex lock;                        /* Repository lock */
-  SilcHashTable keys;                    /* All keys in repository */
-};
-
-/* Find context */
-struct SilcSKRFindStruct {
-  SilcHashTable constr;                           /* Search constraints */
-};
-
-#endif /* SILCSKR_I_H */
diff --git a/lib/silcskr/tests/Makefile.am b/lib/silcskr/tests/Makefile.am
deleted file mode 100644 (file)
index 580daad..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-#
-#  Makefile.am
-#
-#  Author: Pekka Riikonen <priikone@silcnet.org>
-#
-#  Copyright (C) 2005 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.
-#
-
-AUTOMAKE_OPTIONS = 1.0 no-dependencies foreign
-
-bin_PROGRAMS = test_silcskr
-
-test_silcskr_SOURCES = test_silcskr.c
-
-LIBS = $(SILC_COMMON_LIBS)
-LDADD = -L.. -L../.. -lsilc -lsilcskr
-
-include $(top_srcdir)/Makefile.defines.in
diff --git a/lib/silcskr/tests/test_silcskr.c b/lib/silcskr/tests/test_silcskr.c
deleted file mode 100644 (file)
index 00936a8..0000000
+++ /dev/null
@@ -1,138 +0,0 @@
-/* SILC SKR tests */
-
-#include "silc.h"
-#include "silcskr.h"
-
-SilcBool found = TRUE;
-
-static void skr_found(SilcSKR skr, SilcSKRFind find, SilcSKRStatus status,
-                     SilcDList results, void *context)
-{
-  SilcSKRKey key;
-
-  SILC_LOG_DEBUG(("Result status %d", status));
-  if (status & SILC_SKR_OK) {
-    SILC_LOG_DEBUG(("Found %d keys", silc_dlist_count(results)));
-
-    while ((key = silc_dlist_get(results)) != SILC_LIST_END)
-      SILC_LOG_DEBUG(("Key: %s", ((SilcPublicKey)key->key)->identifier));
-
-    silc_dlist_uninit(results);
-    found = TRUE;
-  } else
-    found = FALSE;
-}
-
-int main(int argc, char **argv)
-{
-  SilcBool success = FALSE;
-  SilcSchedule schedule;
-  SilcSKR skr;
-  SilcSKRFind find;
-  SilcPublicKey pk;
-
-  if (argc > 1 && !strcmp(argv[1], "-d")) {
-    silc_log_debug(TRUE);
-    silc_log_debug_hexdump(TRUE);
-    silc_log_set_debug_string("*skr*");
-  }
-
-  SILC_LOG_DEBUG(("Allocating scheduler"));
-  schedule = silc_schedule_init(0, NULL);
-
-  SILC_LOG_DEBUG(("Allocating SKR"));
-  skr = silc_skr_alloc();
-  if (!skr)
-    goto err;
-
-  SILC_LOG_DEBUG(("Adding public key to SKR"));
-  pk = silc_calloc(1, sizeof(*pk));
-  pk->len = 1;
-  pk->pk_type = SILC_PKCS_SILC;
-  pk->name = strdup("rsa");
-  pk->pk = strdup("  ");
-  pk->pk_len = 2;
-  pk->identifier = silc_pkcs_encode_identifier("foo", "foo.com",
-                                              "Foo T. Bar", "foo@foo.com",
-                                              "ORG", "FI");
-  silc_skr_add_public_key(skr, pk, 0, NULL);
-
-  SILC_LOG_DEBUG(("Adding public key to SKR"));
-  pk = silc_calloc(1, sizeof(*pk));
-  pk->len = 1;
-  pk->pk_type = SILC_PKCS_SILC;
-  pk->name = strdup("rsa");
-  pk->pk = strdup("  ");
-  pk->pk_len = 2;
-  pk->identifier = silc_pkcs_encode_identifier("bar", "bar.com",
-                                              "Bar T. Bar", "bar@foo.com",
-                                              "ORG", "FI");
-  silc_skr_add_public_key(skr, pk, SILC_SKR_USAGE_IDENTIFICATION |
-                         SILC_SKR_USAGE_AUTH, NULL);
-
-  SILC_LOG_DEBUG(("Attempting to add key twice"));
-  if (silc_skr_add_public_key(skr, pk, 0, NULL) == SILC_SKR_OK) {
-    SILC_LOG_DEBUG(("Adding key twice not detected"));
-    goto err;
-  }
-
-  SILC_LOG_DEBUG(("Finding public key by email"));
-  find = silc_skr_find_alloc();
-  silc_skr_find_set_email(find, "foo@foo.com");
-  silc_skr_find(skr, schedule, find, skr_found, NULL);
-  silc_skr_find_free(find);
-  if (!found)
-    goto err;
-
-  SILC_LOG_DEBUG(("Finding public key by country"));
-  find = silc_skr_find_alloc();
-  silc_skr_find_set_country(find, "FI");
-  silc_skr_find(skr, schedule, find, skr_found, NULL);
-  silc_skr_find_free(find);
-  if (!found)
-    goto err;
-
-  SILC_LOG_DEBUG(("Finding public key by country, ORG and hostname"));
-  find = silc_skr_find_alloc();
-  silc_skr_find_set_country(find, "FI");
-  silc_skr_find_set_org(find, "ORG");
-  silc_skr_find_set_host(find, "foo.com");
-  silc_skr_find(skr, schedule, find, skr_found, NULL);
-  silc_skr_find_free(find);
-  if (!found)
-    goto err;
-
-  SILC_LOG_DEBUG(("Finding public key by SILC public key"));
-  silc_skr_find_silc(skr, pk, skr_found, NULL);
-  if (!found)
-    goto err;
-
-  SILC_LOG_DEBUG(("Finding public key by country and usage (must not find)"));
-  find = silc_skr_find_alloc();
-  silc_skr_find_set_country(find, "FI");
-  silc_skr_find_set_usage(find, SILC_SKR_USAGE_ENC);
-  silc_skr_find(skr, schedule, find, skr_found, NULL);
-  silc_skr_find_free(find);
-  if (found)
-    goto err;
-
-  SILC_LOG_DEBUG(("Finding public key by country and usage"));
-  find = silc_skr_find_alloc();
-  silc_skr_find_set_country(find, "FI");
-  silc_skr_find_set_usage(find, SILC_SKR_USAGE_IDENTIFICATION);
-  silc_skr_find(skr, schedule, find, skr_found, NULL);
-  silc_skr_find_free(find);
-  if (!found)
-    goto err;
-
-  silc_skr_free(skr);
-  silc_schedule_uninit(schedule);
-
-  success = TRUE;
-
- err:
-  SILC_LOG_DEBUG(("Testing was %s", success ? "SUCCESS" : "FAILURE"));
-  fprintf(stderr, "Testing was %s\n", success ? "SUCCESS" : "FAILURE");
-
-  return success;
-}
diff --git a/lib/silcutil/.cvsignore b/lib/silcutil/.cvsignore
deleted file mode 100644 (file)
index 282522d..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-Makefile
-Makefile.in
diff --git a/lib/silcutil/DIRECTORY b/lib/silcutil/DIRECTORY
deleted file mode 100644 (file)
index 7782933..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-<!--
-@LIBRARY=SILC Utility Library
-@FILENAME=silcutillib.html
-@LINK=silctypes.html:Basic Types and Definitions
-@LINK=silcbuffer.html:Data Buffer Interface
-@LINK=silcbuffmt.html:Data Buffer Format Interface
-@LINK=silchashtable.html:Hash Table Interface
-@LINK=silcmemory.html:Memory Allocation Interface
-@LINK=silcstack.html:Data Stack (memory pool) Interface
-@LINK=silcfsm.html:Finite State Machine Interface
-@LINK=silcthread.html:Thread Interface
-@LINK=silcmutex.html:Mutual Exclusion Lock Interface
-@LINK=silccond.html:Condition Variable Interface
-@LINK=silcatomic.html:Atomic Operations Interface
-@LINK=silcnet.html:Network (TCP and UDP) Interface
-@LINK=silcschedule.html:Scheduler Interface
-@LINK=silcasync.html:Asynchronous Operation Interface
-@LINK=silcstream.html:Abstract Stream Interface
-@LINK=silcsocketstream.html:Socket Stream Interface
-@LINK=silcfdstream.html:File Descriptor Stream Interface
-@LINK=silcfileutil.html:File Utility Functions
-@LINK=silcstrutil.html:String Utility Interface
-@LINK=silcsnprintf.html:Snprintf Interface
-@LINK=silcutf8.html:UTF-8 String Interface
-@LINK=silcstringprep.html:Stringprep Interface
-@LINK=silcutil.html:Utility Functions
-@LINK=silclist.html:List Interface
-@LINK=silcdlist.html:Dynamic List Interface
-@LINK=silcmime.html:MIME Interface
-@LINK=silctime.html:Time Utility Functions
-@LINK=silclog.html:Logging Interface
-@LINK=silcconfig.html:Config File Interface
--->
-
-<big><b>SILC Utility Library</b></big>
-<br />
-<small>Directory: lib/silcutil/</small>
-<br />
-<small>Library: libsilc.a, libsilc.lib</small>
-<br /><br />
-<b>Introduction</b>
-
-<br /><br />
-SILC Utility Library provides a full featured runtime library for
-applications.  It provides the application's main loop, called SILC
-Scheduler, 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.
-
-<br /><br />
-@LINKS@
diff --git a/lib/silcutil/Makefile.ad b/lib/silcutil/Makefile.ad
deleted file mode 100644 (file)
index b685a75..0000000
+++ /dev/null
@@ -1,119 +0,0 @@
-#
-#  Makefile.ad
-#
-#  Author: Pekka Riikonen <priikone@silcnet.org>
-#
-#  Copyright (C) 2000 - 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.
-#
-
-AUTOMAKE_OPTIONS = 1.0 no-dependencies foreign
-
-if SILC_WIN32
-SUBDIRS=win32
-else
-if SILC_SYMBIAN
-SUBDIRS=symbian
-else
-SUBDIRS=unix
-endif
-endif
-
-#ifdef SILC_DIST_TOOLKIT
-DIST_SUBDIRS=win32 symbian unix
-#else !SILC_DIST_TOOLKIT
-#ifdef SILC_DIST_CLIENT
-DIST_SUBDIRS=win32 unix
-#else !SILC_DIST_CLIENT
-#ifdef SILC_DIST_SERVER
-DIST_SUBDIRS=unix
-#endif SILC_DIST_SERVER
-#endif SILC_DIST_CLIENT
-#endif SILC_DIST_TOOLKIT
-
-#ifdef SILC_DIST_TOOLKIT
-SILC_DIST_SOURCE = stacktrace.c
-SILC_DIST_HEADER = stacktrace.h
-#endif SILC_DIST_TOOLKIT
-
-noinst_LTLIBRARIES = libsilcutil.la
-
-libsilcutil_la_SOURCES = \
-       $(SILC_DIST_SOURCE) \
-       silcbuffmt.c    \
-       silcconfig.c    \
-       silclog.c       \
-       silcmemory.c    \
-       silcnet.c       \
-       silcschedule.c  \
-       silcfileutil.c  \
-       silcstrutil.c   \
-       silcutil.c      \
-       silchashtable.c \
-       silcutf8.c      \
-       silcstringprep.c \
-       silcstream.c    \
-       silcfdstream.c  \
-       silcsocketstream.c \
-       silcfsm.c       \
-       silcasync.c     \
-       silctime.c      \
-       silcmime.c      \
-       silcstack.c     \
-       silcsnprintf.c
-
-#ifdef SILC_DIST_TOOLKIT
-include_HEADERS =      \
-       $(SILC_DIST_HEADER) \
-       silcbuffer.h    \
-       silcbuffmt.h    \
-       silcconfig.h    \
-       silchashtable.h \
-       silclog.h       \
-       silclog_i.h     \
-       silcmemory.h    \
-       silcmutex.h     \
-       silcatomic.h    \
-       silccond.h      \
-       silcnet.h       \
-       silcnet_i.h     \
-       silcschedule.h  \
-       silcschedule_i.h \
-       silcthread.h    \
-       silclist.h      \
-       silcdlist.h     \
-       silcfileutil.h  \
-       silcutil.h      \
-       silcstrutil.h   \
-       silcutf8.h      \
-       silcstringprep.h \
-       silctypes.h     \
-       silcstream.h    \
-       silcfdstream.h \
-       silcsocketstream.h \
-       silcsocketstream_i.h \
-       silcfsm.h       \
-       silcfsm_i.h     \
-       silctime.h      \
-       silcmime.h      \
-       silcmime_i.h    \
-       silcasync.h     \
-       silcasync_i.h   \
-       silcstack.h     \
-       silcstack_i.h   \
-       silcsnprintf.h
-
-SILC_EXTRA_DIST = tests
-#endif SILC_DIST_TOOLKIT
-
-EXTRA_DIST = *.h $(SILC_EXTRA_DIST)
-
-include $(top_srcdir)/Makefile.defines.in
diff --git a/lib/silcutil/beos/.cvsignore b/lib/silcutil/beos/.cvsignore
deleted file mode 100644 (file)
index 282522d..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-Makefile
-Makefile.in
diff --git a/lib/silcutil/beos/Makefile.am b/lib/silcutil/beos/Makefile.am
deleted file mode 100644 (file)
index fefc204..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-#
-#  Makefile.am
-#
-#  Author: Pekka Riikonen <priikone@silcnet.org>
-#
-#  Copyright (C) 2002 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; either version 2 of the License, or
-#  (at your option) any later version.
-#
-#  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.
-#
-
-AUTOMAKE_OPTIONS = 1.0 no-dependencies foreign
-
-noinst_LTLIBRARIES = libsilcbeosutil.la
-
-libsilcbeosutil_la_SOURCES =   \
-       silcbeosschedule.c      \
-       silcbeosnet.c           \
-       silcbeosutil.c          \
-       silcbeossockconn.c      \
-       silcbeosmutex.c         \
-       silcbeosthread.c
-
-include $(top_srcdir)/Makefile.defines.in
diff --git a/lib/silcutil/beos/silcbeosmutex.c b/lib/silcutil/beos/silcbeosmutex.c
deleted file mode 100644 (file)
index 2e1cef0..0000000
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
-
-  silcbeosmutex.c 
-
-  Author: Pekka Riikonen <priikone@silcnet.org>
-
-  Copyright (C) 2002 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.
-
-*/
-/* I used Apache's APR code as a reference here. */
-/* $Id$ */
-
-#include "silc.h"
-
-#ifdef SILC_THREADS
-
-/* SILC Mutex structure */
-struct SilcMutexStruct {
-  sem_id sema;
-};
-
-SilcBool silc_mutex_alloc(SilcMutex *mutex)
-{
-  int ret;
-
-  *mutex = silc_calloc(1, sizeof(**mutex));
-  if (*mutex == NULL)
-    return FALSE;
-
-  ret = create_sem(0, "SILC_MUTEX");
-  if (ret < B_NO_ERROR) {
-    silc_free(*mutex);
-    return FALSE;
-  }
-
-  (*mutex)->sema = ret;
-
-  return TRUE;
-}
-
-void silc_mutex_free(SilcMutex mutex)
-{
-  delete_sem(mutex->sema);
-  silc_free(mutex);
-}
-
-void silc_mutex_lock(SilcMutex mutex)
-{
-  if (acquire_sem(mutex->sema) < B_NO_ERROR)
-    assert(FALSE);
-}
-
-void silc_mutex_unlock(SilcMutex mutex)
-{
-  if (release_sem(mutex->sema) < B_NO_ERROR)
-    assert(FALSE);
-}
-
-#endif /* SILC_THREADS */
diff --git a/lib/silcutil/beos/silcbeosnet.c b/lib/silcutil/beos/silcbeosnet.c
deleted file mode 100644 (file)
index dc4ed70..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
-
-  silcbeosnet.c 
-
-  Author: Pekka Riikonen <priikone@silcnet.org>
-
-  Copyright (C) 2002 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.
-
-*/
-/* $Id$ */
-
-#include "silc.h"
-
-/* Maybe works, or maybe not */
-#include "../unix/silcunixnet.c"
diff --git a/lib/silcutil/beos/silcbeosschedule.c b/lib/silcutil/beos/silcbeosschedule.c
deleted file mode 100644 (file)
index 5ff1549..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
-
-  silcbeosschedule.c 
-
-  Author: Pekka Riikonen <priikone@silcnet.org>
-
-  Copyright (C) 2002 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.
-
-*/
-/* $Id$ */
-
-/* Maybe works, or maybe not. The wakeup may cause problems, except 
-   on BONE... */
-#include "../unix/silcunixschedule.c"
diff --git a/lib/silcutil/beos/silcbeossockconn.c b/lib/silcutil/beos/silcbeossockconn.c
deleted file mode 100644 (file)
index 875442c..0000000
+++ /dev/null
@@ -1,136 +0,0 @@
-/*
-
-  silcbeossockconn.c 
-
-  Author: Pekka Riikonen <priikone@silcnet.org>
-
-  Copyright (C) 2002 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.
-
-*/
-/* $Id$ */
-
-/* On BONE we can use Unix code */
-#ifdef SILC_BEOS_BONE
-#include "../unix/silcunixsockconn.c"
-#else
-#include "silc.h"
-
-/* Writes data from encrypted buffer to the socket connection. If the
-   data cannot be written at once, it will be written later with a timeout. 
-   The data is written from the data section of the buffer, not from head
-   or tail section. This automatically pulls the data section towards end
-   after writing the data. */
-
-int silc_socket_write(SilcSocketConnection sock)
-{
-  int ret = 0;
-  SilcBuffer src = sock->outbuf;
-
-  if (SILC_IS_DISABLED(sock))
-    return -1;
-
-  SILC_LOG_DEBUG(("Writing data to socket %d", sock->sock));
-
-  if (src->len > 0) {
-    ret = send(sock->sock, src->data, src->len, 0);
-    if (ret == -1) {
-      if (errno == EWOULDBLOCK) {
-       SILC_LOG_DEBUG(("Could not write immediately, will do it later"));
-       return -2;
-      }
-      SILC_LOG_ERROR(("Cannot write to socket: %d", sock->sock));
-      sock->sock_error = errno;
-      return -1;
-    }
-
-    if (ret < src->len) {
-      SILC_LOG_DEBUG(("Wrote data %d of %d bytes, will write rest later",
-                     ret, src->len));
-      silc_buffer_pull(src, ret);
-      return -2;
-    }
-
-    silc_buffer_pull(src, ret);
-  }
-
-  SILC_LOG_DEBUG(("Wrote data %d bytes", ret));
-
-  return ret;
-}
-
-/* Reads data from the socket connection into the incoming data buffer.
-   It reads as much as possible from the socket connection. This returns
-   amount of bytes read or -1 on error or -2 on case where all of the
-   data could not be read at once. */
-
-int silc_socket_read(SilcSocketConnection sock)
-{
-  int len = 0;
-  unsigned char buf[SILC_SOCKET_READ_SIZE];
-
-  if (SILC_IS_DISABLED(sock))
-    return -1;
-
-  SILC_LOG_DEBUG(("Reading data from socket %d", sock->sock));
-
-  /* Read the data from the socket. */
-  len = recv(sock->sock, buf, sizeof(buf), 0);
-  if (len == -1) {
-    if (errno == EWOULDBLOCK || errno == EINTR) {
-      SILC_LOG_DEBUG(("Could not read immediately, will do it later"));
-      return -2;
-    }
-    SILC_LOG_ERROR(("Cannot read from socket: %d", sock->sock));
-    sock->sock_error = errno;
-    return -1;
-  }
-
-  if (!len)
-    return 0;
-
-  /* Insert the data to the buffer. */
-
-  if (!sock->inbuf)
-    sock->inbuf = silc_buffer_alloc(SILC_SOCKET_BUF_SIZE);
-  
-  /* If the data does not fit to the buffer reallocate it */
-  if ((sock->inbuf->end - sock->inbuf->tail) < len)
-    sock->inbuf = silc_buffer_realloc(sock->inbuf, sock->inbuf->truelen + 
-                                     (len * 2));
-  silc_buffer_put_tail(sock->inbuf, buf, len);
-  silc_buffer_pull_tail(sock->inbuf, len);
-
-  SILC_LOG_DEBUG(("Read %d bytes", len));
-
-  return len;
-}
-
-/* Returns human readable socket error message */
-
-SilcBool silc_socket_get_error(SilcSocketConnection sock, char *error,
-                          SilcUInt32 error_len)
-{
-  char *err;
-
-  if (!sock->sock_error)
-    return FALSE;
-
-  err = strerror(sock->sock_error);
-  if (strlen(err) > error_len)
-    return FALSE;
-
-  memset(error, 0, error_len);
-  memcpy(error, err, strlen(err));
-  return TRUE;
-}
-
-#endif /* SILC_BEOS_BONE */
diff --git a/lib/silcutil/beos/silcbeosthread.c b/lib/silcutil/beos/silcbeosthread.c
deleted file mode 100644 (file)
index eb41141..0000000
+++ /dev/null
@@ -1,112 +0,0 @@
-/*
-
-  silcbeosthread.c 
-
-  Author: Pekka Riikonen <priikone@silcnet.org>
-
-  Copyright (C) 2002 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.
-
-*/
-/* I used Apache's APR code as a reference here. */
-/* $Id$ */
-
-/* XXX This leaks memory. Perhaps the SilcThread API should be changed
-   since the silc_thread_self() causes that BeOS and OS/2 is hard to
-   do to support this SilcThread API */
-
-#include "silc.h"
-
-#ifdef SILC_THREADS
-
-/* Thread structure for BeOS */
-typedef struct {
-  thread_id thread;
-  SilcThreadStart start_func;
-  void *context;
-  SilcBool waitable;
-} *SilcBeosThread;
-
-/* Actual routine that is called by BeOS when the thread is created.
-   We will call the start_func from here. */
-
-static void *silc_thread_beos_start(void *context)
-{
-  SilcBeosThread thread = (SilcBeosThread)context;
-  return (*thread->start_func)(thread->context);
-}
-
-#endif
-
-SilcThread silc_thread_create(SilcThreadStart start_func, void *context,
-                             SilcBool waitable)
-{
-#ifdef SILC_THREADS
-  int ret;
-  SilcBeosThread thread = silc_calloc(1, sizeof(*thread));
-  if (!thread)
-    return NULL;
-
-  thread->start_func = start_func;
-  thread->context = context;
-  thread->waitable = waitable;
-
-  /* Create the thread, and run it */
-  thread->thread = spawn_thread((thread_func)silc_thread_beos_start,
-                               B_NORMAL_PRIORITY, thread);
-  ret = resume_thread(thread->thread);
-  if (ret < B_NO_ERROR) {
-    SILC_LOG_ERROR(("Could not create new thread"));
-    silc_free(thread);
-    return NULL;
-  }
-
-  return (SilcThread)thread->thread;
-#else
-  /* Call thread callback immediately */
-  (*start_func)(context);
-  return NULL;
-#endif
-}
-
-void silc_thread_exit(void *exit_value)
-{
-#ifdef SILC_THREADS
-  exit_thread((status_t)exit_value);
-#endif
-}
-
-SilcThread silc_thread_self(void)
-{
-#ifdef SILC_THREADS
-  return (SilcThread)find_thread(NULL);
-#else
-  return NULL;
-#endif
-}
-
-SilcBool silc_thread_wait(SilcThread thread, void **exit_value)
-{
-#ifdef SILC_THREADS
-  status_t ret, retval;
-
-  ret = wait_for_thread((thread_id)thread, &retval);
-  if (ret == B_NO_ERROR) {
-    if (exit_value)
-      *exit_value = retval;
-    return TRUE;
-  }
-
-  return FALSE;
-#else
-  return FALSE;
-#endif
-}
diff --git a/lib/silcutil/beos/silcbeosutil.c b/lib/silcutil/beos/silcbeosutil.c
deleted file mode 100644 (file)
index 6af5811..0000000
+++ /dev/null
@@ -1,127 +0,0 @@
-/*
-
-  silcbeosutil.c 
-
-  Author: Pekka Riikonen <priikone@silcnet.org>
-
-  Copyright (C) 2002 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.
-
-*/
-/* $Id$ */
-
-#include "silc.h"
-
-/* Inspects the `string' for wildcards and returns regex string that can
-   be used by the GNU regex library. A comma (`,') in the `string' means
-   that the string is list. */
-
-char *silc_string_regexify(const char *string)
-{
-  int i, len, count;
-  char *regex;
-
-  len = strlen(string);
-  count = 4;
-  for (i = 0; i < len; i++)
-    if (string[i] == '*' || string[i] == '?')
-      count++;
-
-  regex = silc_calloc(len + count, sizeof(*regex));
-
-  count = 0;
-  regex[count] = '(';
-  count++;
-
-  for (i = 0; i < len; i++) {
-    if (string[i] == '*' || string[i] == '?') {
-      regex[count] = '.';
-      count++;
-    } else if (string[i] == ',') {
-      if (i + 1 == len)
-       continue;
-      regex[count] = '|';
-      count++;
-      continue;
-    }
-
-    regex[count] = string[i];
-    count++;
-  }
-
-  regex[count++] = ')';
-  regex[count] = '$';
-
-  return regex;
-}
-
-/* Combines two regex strings into one regex string so that they can be
-   used as one by the GNU regex library. The `string2' is combine into
-   the `string1'. */
-
-char *silc_string_regex_combine(const char *string1, const char *string2)
-{
-  char *tmp;
-  int len1, len2;
-
-  len1 = strlen(string1);
-  len2 = strlen(string2);
-
-  tmp = silc_calloc(2 + len1 + len2, sizeof(*tmp));
-  strncat(tmp, string1, len1 - 2);
-  strncat(tmp, "|", 1);
-  strncat(tmp, string2 + 1, len2 - 1);
-
-  return tmp;
-}
-
-/* Matches the two strings and returns TRUE if the strings match. */
-
-int silc_string_regex_match(const char *regex, const char *string)
-{
-  regex_t preg;
-  int ret = FALSE;
-  
-  if (regcomp(&preg, regex, REG_NOSUB | REG_EXTENDED) < 0)
-    return FALSE;
-
-  if (regexec(&preg, string, 0, NULL, 0) == 0)
-    ret = TRUE;
-
-  regfree(&preg);
-
-  return ret;
-}
-
-/* Do regex match to the two strings `string1' and `string2'. If the
-   `string2' matches the `string1' this returns TRUE. */
-
-int silc_string_match(const char *string1, const char *string2)
-{
-  char *s1;
-  int ret = FALSE;
-
-  if (!string1 || !string2)
-    return ret;
-
-  s1 = silc_string_regexify(string1);
-  ret = silc_string_regex_match(s1, string2);
-  silc_free(s1);
-
-  return ret;
-}
-
-/* Return current time to struct timeval. */
-
-int silc_gettimeofday(struct timeval *p)
-{
-  return gettimeofday(p, NULL);
-}
diff --git a/lib/silcutil/os2/.cvsignore b/lib/silcutil/os2/.cvsignore
deleted file mode 100644 (file)
index 282522d..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-Makefile
-Makefile.in
diff --git a/lib/silcutil/os2/Makefile.am b/lib/silcutil/os2/Makefile.am
deleted file mode 100644 (file)
index c1d4860..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-#
-#  Makefile.am
-#
-#  Author: Pekka Riikonen <priikone@silcnet.org>
-#
-#  Copyright (C) 2002 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; either version 2 of the License, or
-#  (at your option) any later version.
-#
-#  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.
-#
-
-AUTOMAKE_OPTIONS = 1.0 no-dependencies foreign
-
-noinst_LTLIBRARIES = libsilcos2util.la
-
-libsilcos2util_la_SOURCES =    \
-       silcos2schedule.c       \
-       silcos2net.c            \
-       silcos2util.c           \
-       silcos2sockconn.c       \
-       silcos2mutex.c          \
-       silcos2thread.c
-
-include $(top_srcdir)/Makefile.defines.in
diff --git a/lib/silcutil/os2/silcos2mutex.c b/lib/silcutil/os2/silcos2mutex.c
deleted file mode 100644 (file)
index 38acee0..0000000
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
-
-  silcos2mutex.c 
-
-  Author: Pekka Riikonen <priikone@silcnet.org>
-
-  Copyright (C) 2002 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.
-
-*/
-/* I used Apache's APR code as a reference here. */
-/* $Id$ */
-
-#include "silc.h"
-
-#ifdef SILC_THREADS
-
-/* SILC Mutex structure */
-struct SilcMutexStruct {
-  HMTX mutex;
-};
-
-SilcBool silc_mutex_alloc(SilcMutex *mutex)
-{
-  char name[64];
-
-  *mutex = silc_calloc(1, sizeof(**mutex));
-  if (*mutex == NULL)
-    return FALSE;
-
-  /* Create the lock. Is the name working? :) */
-  memset(name, 0, sizeof(name));
-  snprintf(name, sizeof(name) - 1, "%p/SEM32/SILC1234$", *mutex);
-  if (!DosCreateMutexSem(name, &(*mutex)->mutex, DC_SEM_SHARED, FALSE)) {
-    silc_free(*mutex);
-    return FALSE;
-  }
-
-  return TRUE;
-}
-
-void silc_mutex_free(SilcMutex mutex)
-{
-  DosCloseMutexSem(mutex->mutex);
-  silc_free(mutex);
-}
-
-void silc_mutex_lock(SilcMutex mutex)
-{
-  if (!DosRequestMutexSem(mutex->mutex, SEM_INDEFINITE_WAIT))
-    assert(FALSE);
-}
-
-void silc_mutex_unlock(SilcMutex mutex)
-{
-  if (!DosReleaseMutexSem(mutex->mutex)
-    assert(FALSE);
-}
-
-#endif /* SILC_THREADS */
diff --git a/lib/silcutil/os2/silcos2net.c b/lib/silcutil/os2/silcos2net.c
deleted file mode 100644 (file)
index 050385a..0000000
+++ /dev/null
@@ -1,316 +0,0 @@
-/*
-
-  silcos2net.c 
-
-  Author: Pekka Riikonen <priikone@silcnet.org>
-
-  Copyright (C) 2002 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.
-
-*/
-/* $Id$ */
-
-#include "silc.h"
-#include "silcnet.h"
-
-/* XXX TODO */
-
-#ifdef HAVE_IPV6
-#define SIZEOF_SOCKADDR(so) ((so).sa.sa_family == AF_INET6 ?   \
-  sizeof(so.sin6) : sizeof(so.sin))
-#else
-#define SIZEOF_SOCKADDR(so) (sizeof(so.sin))
-#endif
-
-typedef union {
-  struct sockaddr sa;
-  struct sockaddr_in sin;
-#ifdef HAVE_IPV6
-  struct sockaddr_in6 sin6;
-#endif
-} SilcSockaddr;
-
-static SilcBool silc_net_set_sockaddr(SilcSockaddr *addr, const char *ip_addr,
-                                 int port)
-{
-  int len;
-
-  memset(addr, 0, sizeof(*addr));
-
-  /* Check for IPv4 and IPv6 addresses */
-  if (ip_addr) {
-    if (!silc_net_is_ip(ip_addr)) {
-      SILC_LOG_ERROR(("%s is not IP address", ip_addr));
-      return FALSE;
-    }
-
-    if (silc_net_is_ip4(ip_addr)) {
-      /* IPv4 address */
-      len = sizeof(addr->sin.sin_addr);
-      silc_net_addr2bin(ip_addr, 
-                       (unsigned char *)&addr->sin.sin_addr.s_addr, len);
-      addr->sin.sin_family = AF_INET;
-      addr->sin.sin_port = port ? htons(port) : 0;
-    } else {
-#ifdef HAVE_IPV6
-      /* IPv6 address */
-      len = sizeof(addr->sin6.sin6_addr);
-      silc_net_addr2bin(ip_addr, 
-                       (unsigned char *)&addr->sin6.sin6_addr, len);
-      addr->sin6.sin6_family = AF_INET6;
-      addr->sin6.sin6_port = port ? htons(port) : 0;
-#else
-      SILC_LOG_ERROR(("IPv6 support is not compiled in"));
-      return FALSE;
-#endif
-    }
-  } else {
-    /* Any address */
-    addr->sin.sin_family = AF_INET;
-    addr->sin.sin_addr.s_addr = INADDR_ANY;
-    if (port)
-      addr->sin.sin_port = htons(port);
-  }
-
-  return TRUE;
-}
-
-/* This function creates server or daemon or listener or what ever. This
-   does not fork a new process, it must be done by the caller if caller
-   wants to create a child process. This is used by the SILC server. 
-   If argument `ip_addr' is NULL `any' address will be used. Returns 
-   the created socket or -1 on error. */
-
-int silc_net_create_server(int port, const char *ip_addr)
-{
-  int sock, rval;
-  SilcSockaddr server;
-
-  SILC_LOG_DEBUG(("Creating a new server listener"));
-
-  /* Set sockaddr for server */
-  if (!silc_net_set_sockaddr(&server, ip_addr, port))
-    return -1;
-
-  /* Create the socket */
-  sock = socket(server.sin.sin_family, SOCK_STREAM, 0);
-  if (sock < 0) {
-    SILC_LOG_ERROR(("Cannot create socket: %s", strerror(errno)));
-    return -1;
-  }
-
-  /* Set the socket options */
-  rval = silc_net_set_socket_opt(sock, SOL_SOCKET, SO_REUSEADDR, 1);
-  if (rval < 0) {
-    SILC_LOG_ERROR(("Cannot set socket options: %s", strerror(errno)));
-    return -1;
-  }
-
-  /* Bind the server socket */
-  rval = bind(sock, &server.sa, SIZEOF_SOCKADDR(server));
-  if (rval < 0) {
-    SILC_LOG_DEBUG(("Cannot bind socket: %s", strerror(errno)));
-    return -1;
-  }
-
-  /* Specify that we are listenning */
-  rval = listen(sock, 5);
-  if (rval < 0) {
-    SILC_LOG_ERROR(("Cannot set socket listenning: %s", strerror(errno)));
-    return -1;
-  }
-
-  /* Set the server socket to non-blocking mode */
-  silc_net_set_socket_nonblock(sock);
-
-  SILC_LOG_DEBUG(("Server listener created, fd=%d", sock));
-
-  return sock;
-}
-
-/* Closes the server by closing the socket connection. */
-
-void silc_net_close_server(int sock)
-{
-  shutdown(sock, 2);
-  close(sock);
-
-  SILC_LOG_DEBUG(("Server socket closed"));
-}
-
-/* Creates a connection (TCP/IP) to a remote host. Returns the connection
-   socket or -1 on error. This blocks the process while trying to create
-   the connection. */
-
-int silc_net_create_connection(const char *local_ip, int port, 
-                              const char *host)
-{
-  int sock, rval;
-  char ip_addr[64];
-  SilcSockaddr desthost;
-
-  SILC_LOG_DEBUG(("Creating connection to host %s port %d", host, port));
-
-  /* Do host lookup */
-  if (!silc_net_gethostbyname(host, ip_addr, sizeof(ip_addr))) {
-    SILC_LOG_ERROR(("Network (%s) unreachable: could not resolve the "
-                   "IP address", host));
-    return -1;
-  }
-
-  /* Set sockaddr for this connection */
-  if (!silc_net_set_sockaddr(&desthost, ip_addr, port))
-    return -1;
-
-  /* Create the connection socket */
-  sock = socket(desthost.sin.sin_family, SOCK_STREAM, 0);
-  if (sock < 0) {
-    SILC_LOG_ERROR(("Cannot create socket: %s", strerror(errno)));
-    return -1;
-  }
-
-  /* Bind to the local address if provided */
-  if (local_ip) {
-    SilcSockaddr local;
-
-    /* Set sockaddr for local listener, and try to bind it. */
-    if (silc_net_set_sockaddr(&local, local_ip, 0))
-      bind(sock, &local.sa, sizeof(local));
-  }
-
-  /* Connect to the host */
-  rval = connect(sock, &desthost.sa, sizeof(desthost));
-  if (rval < 0) {
-    SILC_LOG_ERROR(("Cannot connect to remote host: %s", strerror(errno)));
-    shutdown(sock, 2);
-    close(sock);
-    return -1;
-  }
-
-  /* Set appropriate options */
-#if defined(TCP_NODELAY)
-  silc_net_set_socket_opt(sock, IPPROTO_TCP, TCP_NODELAY, 1);
-#endif
-  silc_net_set_socket_opt(sock, SOL_SOCKET, SO_KEEPALIVE, 1);
-
-  SILC_LOG_DEBUG(("Connection created"));
-
-  return sock;
-}
-
-/* Creates a connection (TCP/IP) to a remote host. Returns the connection
-   socket or -1 on error. This creates non-blocking socket hence the
-   connection returns directly. To get the result of the connect() one
-   must select() the socket and read the result after it's ready. */
-
-int silc_net_create_connection_async(const char *local_ip, int port, 
-                                    const char *host)
-{
-  int sock, rval;
-  char ip_addr[64];
-  SilcSockaddr desthost;
-
-  SILC_LOG_DEBUG(("Creating connection (async) to host %s port %d", 
-                 host, port));
-
-  /* Do host lookup */
-  if (!silc_net_gethostbyname(host, ip_addr, sizeof(ip_addr))) {
-    SILC_LOG_ERROR(("Network (%s) unreachable: could not resolve the "
-                   "IP address", host));
-    return -1;
-  }
-
-  /* Set sockaddr for this connection */
-  if (!silc_net_set_sockaddr(&desthost, ip_addr, port))
-    return -1;
-
-  /* Create the connection socket */
-  sock = socket(desthost.sin.sin_family, SOCK_STREAM, 0);
-  if (sock < 0) {
-    SILC_LOG_ERROR(("Cannot create socket: %s", strerror(errno)));
-    return -1;
-  }
-
-  /* Bind to the local address if provided */
-  if (local_ip) {
-    SilcSockaddr local;
-
-    /* Set sockaddr for local listener, and try to bind it. */
-    if (silc_net_set_sockaddr(&local, local_ip, 0))
-      bind(sock, &local.sa, sizeof(local));
-  }
-
-  /* Set the socket to non-blocking mode */
-  silc_net_set_socket_nonblock(sock);
-
-  /* Connect to the host */
-  rval = connect(sock, &desthost.sa, sizeof(desthost));
-  if (rval < 0) {
-    if (errno !=  EINPROGRESS) {
-      SILC_LOG_ERROR(("Cannot connect to remote host: %s", strerror(errno)));
-      shutdown(sock, 2);
-      close(sock);
-      return -1;
-    }
-  }
-
-  /* Set appropriate options */
-#if defined(TCP_NODELAY)
-  silc_net_set_socket_opt(sock, IPPROTO_TCP, TCP_NODELAY, 1);
-#endif
-  silc_net_set_socket_opt(sock, SOL_SOCKET, SO_KEEPALIVE, 1);
-
-  SILC_LOG_DEBUG(("Connection operation in progress"));
-
-  return sock;
-}
-
-/* Closes the connection by closing the socket connection. */
-
-void silc_net_close_connection(int sock)
-{
-  close(sock);
-}
-
-/* Set's the socket to non-blocking mode. */
-
-int silc_net_set_socket_nonblock(int sock)
-{
-  return fcntl(sock, F_SETFL, fcntl(sock, F_GETFL, 0) | O_NONBLOCK);
-}
-
-/* Converts the IP number string from numbers-and-dots notation to
-   binary form. */
-
-SilcBool silc_net_addr2bin(const char *addr, void *bin, SilcUInt32 bin_len)
-{
-  int ret = 0;
-
-  if (silc_net_is_ip4(addr)) {
-    /* IPv4 address */
-    struct in_addr tmp;
-    ret = inet_aton(addr, &tmp);
-    if (bin_len < 4)
-      return FALSE;
-    
-    memcpy(bin, (unsigned char *)&tmp.s_addr, 4);
-#ifdef HAVE_IPV6
-  } else {
-    /* IPv6 address */
-    if (bin_len < 16)
-      return FALSE;
-
-    ret = inet_pton(AF_INET6, addr, &bin);
-#endif /* HAVE_IPV6 */
-  }
-
-  return ret != 0;
-}
diff --git a/lib/silcutil/os2/silcos2schedule.c b/lib/silcutil/os2/silcos2schedule.c
deleted file mode 100644 (file)
index 4cec586..0000000
+++ /dev/null
@@ -1,163 +0,0 @@
-/*
-
-  silcos2schedule.c 
-
-  Author: Pekka Riikonen <priikone@silcnet.org>
-
-  Copyright (C) 2002 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.
-
-*/
-/* $Id$ */
-
-/* XXX TODO */
-
-#include "silc.h"
-#include "silcschedule_i.h"
-
-/* Calls normal select() system call. */
-
-int silc_select(SilcScheduleFd fds, SilcUInt32 fds_count, struct timeval *timeout)
-{
-  fd_set in, out;
-  int ret, i, max_fd = 0;
-
-  FD_ZERO(&in);
-  FD_ZERO(&out);
-
-  for (i = 0; i < fds_count; i++) {
-    if (!fds[i].events)
-      continue;
-
-    if (fds[i].fd > max_fd)
-      max_fd = fds[i].fd;
-
-    if (fds[i].events & SILC_TASK_READ)
-      FD_SET(fds[i].fd, &in);
-    if (fds[i].events & SILC_TASK_WRITE)
-      FD_SET(fds[i].fd, &out);
-
-    fds[i].revents = 0;
-  }
-
-  /*  ret = select(max_fd + 1, &in, &out, NULL, timeout); */
-  if (ret <= 0)
-    return ret;
-
-  for (i = 0; i < fds_count; i++) {
-    if (!fds[i].events)
-      continue;
-
-    if (FD_ISSET(fds[i].fd, &in))
-      fds[i].revents |= SILC_TASK_READ;
-    if (FD_ISSET(fds[i].fd, &out))
-      fds[i].revents |= SILC_TASK_WRITE;
-  }
-
-  return ret;
-}
-
-#ifdef SILC_THREADS
-
-/* XXX Do this like it's done in win32/ */
-
-/* Internal wakeup context. */
-typedef struct {
-
-} *SilcOs2Wakeup;
-
-SILC_TASK_CALLBACK(silc_schedule_wakeup_cb)
-{
-
-}
-
-#endif /* SILC_THREADS */
-
-/* Initializes the platform specific scheduler.  This for example initializes
-   the wakeup mechanism of the scheduler.  In multi-threaded environment
-   the scheduler needs to be wakenup when tasks are added or removed from
-   the task queues.  Returns context to the platform specific scheduler. */
-
-void *silc_schedule_internal_init(SilcSchedule schedule, void *context)
-{
-#ifdef SILC_THREADS
-  return NULL;
-
-#endif
-  return NULL;
-}
-
-/* Uninitializes the platform specific scheduler context. */
-
-void silc_schedule_internal_uninit(void *context)
-{
-#ifdef SILC_THREADS
-
-#endif
-}
-
-/* Wakes up the scheduler */
-
-void silc_schedule_internal_wakeup(void *context)
-{
-#ifdef SILC_THREADS
-
-#endif
-}
-
-/* Register signal */
-
-void silc_schedule_internal_signal_register(void *context,
-                                            SilcUInt32 signal,
-                                            SilcTaskCallback callback,
-                                            void *callback_context)
-{
-
-}
-
-/* Unregister signal */
-
-void silc_schedule_internal_signal_unregister(void *context,
-                                              SilcUInt32 signal,
-                                              SilcTaskCallback callback,
-                                              void *callback_context)
-{
-
-}
-
-/* Mark signal to be called later. */
-
-void silc_schedule_internal_signal_call(void *context, SilcUInt32 signal)
-{
-
-}
-
-/* Call all signals */
-
-void silc_schedule_internal_signals_call(void *context,
-                                         SilcSchedule schedule)
-{
-
-}
-
-/* Block registered signals in scheduler. */
-
-void silc_schedule_internal_signals_block(void *context)
-{
-
-}
-
-/* Unblock registered signals in schedule. */
-
-void silc_schedule_internal_signals_unblock(void *context)
-{
-
-}
diff --git a/lib/silcutil/os2/silcos2sockconn.c b/lib/silcutil/os2/silcos2sockconn.c
deleted file mode 100644 (file)
index d551c0b..0000000
+++ /dev/null
@@ -1,122 +0,0 @@
-/*
-
-  silcos2sockconn.c 
-
-  Author: Pekka Riikonen <priikone@silcnet.org>
-
-  Copyright (C) 2002 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.
-
-*/
-/* $Id$ */
-
-/* XXX TODO */
-
-#include "silc.h"
-
-/* Writes data from encrypted buffer to the socket connection. If the
-   data cannot be written at once, it will be written later with a timeout. 
-   The data is written from the data section of the buffer, not from head
-   or tail section. This automatically pulls the data section towards end
-   after writing the data. */
-
-int silc_socket_write(SilcSocketConnection sock)
-{
-  int ret = 0, err;
-  SilcBuffer src = sock->outbuf;
-
-  if (SILC_IS_DISABLED(sock))
-    return -1;
-
-  SILC_LOG_DEBUG(("Writing data to socket %d", sock->sock));
-
-  if (src->len > 0) {
-    ret = send(sock->sock, src->data, src->len, 0);
-    if (ret == -1) {
-      if (errno == EWOULDBLOCK) {
-       SILC_LOG_DEBUG(("Could not write immediately, will do it later"));
-       return -2;
-      }
-      SILC_LOG_ERROR(("Cannot write to socket: %d", sock->sock));
-      sock->sock_error = errno;
-      return -1;
-    }
-
-    if (ret < src->len) {
-      SILC_LOG_DEBUG(("Wrote data %d of %d bytes, will write rest later",
-                     ret, src->len));
-      silc_buffer_pull(src, ret);
-      return -2;
-    }
-
-    silc_buffer_pull(src, ret);
-  }
-
-  SILC_LOG_DEBUG(("Wrote data %d bytes", ret));
-
-  return ret;
-}
-
-/* Reads data from the socket connection into the incoming data buffer.
-   It reads as much as possible from the socket connection. This returns
-   amount of bytes read or -1 on error or -2 on case where all of the
-   data could not be read at once. */
-
-int silc_socket_read(SilcSocketConnection sock)
-{
-  int len = 0;
-  unsigned char buf[SILC_SOCKET_READ_SIZE];
-
-  if (SILC_IS_DISABLED(sock))
-    return -1;
-
-  SILC_LOG_DEBUG(("Reading data from socket %d", sock->sock));
-
-  /* Read the data from the socket. */
-  len = recv(sock->sock, buf, sizeof(buf), 0);
-  if (len == -1) {
-    if (errno == EWOULDBLOCK || errno == EINTR) {
-      SILC_LOG_DEBUG(("Could not read immediately, will do it later"));
-      return -2;
-    }
-    SILC_LOG_ERROR(("Cannot read from socket: %d", sock->sock));
-    sock->sock_error = errno;
-    return -1;
-  }
-
-  if (!len)
-    return 0;
-
-  /* Insert the data to the buffer. */
-
-  if (!sock->inbuf)
-    sock->inbuf = silc_buffer_alloc(SILC_SOCKET_BUF_SIZE);
-  
-  /* If the data does not fit to the buffer reallocate it */
-  if ((sock->inbuf->end - sock->inbuf->tail) < len)
-    sock->inbuf = silc_buffer_realloc(sock->inbuf, sock->inbuf->truelen + 
-                                     (len * 2));
-  silc_buffer_put_tail(sock->inbuf, buf, len);
-  silc_buffer_pull_tail(sock->inbuf, len);
-
-  SILC_LOG_DEBUG(("Read %d bytes", len));
-
-  return len;
-}
-
-/* Returns human readable socket error message */
-
-SilcBool silc_socket_get_error(SilcSocketConnection sock, char *error,
-                          SilcUInt32 error_len)
-{
-  /* XXX TODO */
-  return FALSE;
-}
diff --git a/lib/silcutil/os2/silcos2thread.c b/lib/silcutil/os2/silcos2thread.c
deleted file mode 100644 (file)
index eb18dcd..0000000
+++ /dev/null
@@ -1,113 +0,0 @@
-/*
-
-  silcos2thread.c 
-
-  Author: Pekka Riikonen <priikone@silcnet.org>
-
-  Copyright (C) 2002 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.
-
-*/
-/* I used Apache's APR code as a reference here. */
-/* $Id$ */
-
-#include "silc.h"
-
-/* XXX This leaks memory. Perhaps the SilcThread API should be changed
-   since the silc_thread_self() causes that BeOS and OS/2 is hard to
-   do to support this SilcThread API */
-
-#ifdef SILC_THREADS
-
-/* Thread structure for OS/2 */
-typedef struct {
-  unsigned long thread;
-  SilcThreadStart start_func;
-  void *context;
-  SilcBool waitable;
-} *SilcOs2Thread;
-
-/* Actual routine that is called by OS/2 when the thread is created.
-   We will call the start_func from here. When this returns the thread
-   is destroyed. */
-
-static void silc_thread_os2_start(void *context)
-{
-  SilcOs2Thread thread = (SilcOs2Thread)context;
-  silc_thread_exit((*thread->start_func)(thread->context));
-}
-
-#endif
-
-SilcThread silc_thread_create(SilcThreadStart start_func, void *context,
-                             SilcBool waitable)
-{
-#ifdef SILC_THREADS
-  int ret;
-  SilcOs2Thread thread = silc_calloc(1, sizeof(*thread));
-  if (!thread)
-    return NULL;
-
-  thread->start_func = start_func;
-  thread->context = context;
-  thread->waitable = waitable;
-
-  /* Create the thread, and run it */
-  thread->thread = _beginthread(silc_thread_os2_start, NULL, 65536, thread);
-  if (thread->thread < 0) {
-    SILC_LOG_ERROR(("Could not create new thread"));
-    silc_free(thread);
-    return NULL;
-  }
-
-  return (SilcThread)thread->thread;
-#else
-  /* Call thread callback immediately */
-  (*start_func)(context);
-  return NULL;
-#endif
-}
-
-void silc_thread_exit(void *exit_value)
-{
-#ifdef SILC_THREADS
-  _endthread();
-#endif
-}
-
-SilcThread silc_thread_self(void)
-{
-#ifdef SILC_THREADS
-  PIB *pib;
-  TIB *tib;
-  DosGetInfoBlocks(&tib, &pib);
-  return (SilcThread)tib->tib_ptib2->tib2_ultid;
-#else
-  return NULL;
-#endif
-}
-
-SilcBool silc_thread_wait(SilcThread thread, void **exit_value)
-{
-#ifdef SILC_THREADS
-
-  if (DosWaitThread((unsigned long)thread, DCWW_WAIT) !=
-      ERROR_INVALID_THREADID) {
-    if (exit_value)
-      *exit_value = NULL;
-    return TRUE;
-  }
-
-  return FALSE;
-#else
-  return FALSE;
-#endif
-}
diff --git a/lib/silcutil/os2/silcos2util.c b/lib/silcutil/os2/silcos2util.c
deleted file mode 100644 (file)
index 7910fd7..0000000
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
-
-  silcos2util.c 
-
-  Author: Pekka Riikonen <priikone@silcnet.org>
-
-  Copyright (C) 2002 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.
-
-*/
-/* $Id$ */
-
-#include "silc.h"
-
-char *silc_string_regexify(const char *string)
-{
-  return strdup(string);
-}
-
-char *silc_string_regex_combine(const char *string1, const char *string2)
-{
-  return strdup(string1);
-}
-
-int silc_string_regex_match(const char *regex, const char *string)
-{
-  return TRUE;
-}
-
-int silc_string_match(const char *string1, const char *string2)
-{
-  return TRUE;
-}
-
-#define FILETIME_1970 0x019db1ded53e8000
-const BYTE DWLEN = sizeof(DWORD) * 8;
-
-/* Return current time in struct timeval. Code ripped from some xntp
-   implementation on http://src.openresources.com. */
-
-int silc_gettimeofday(struct timeval *tv)
-{
-  FILETIME ft;
-  __SilcInt64 msec;
-  
-  GetSystemTimeAsFileTime(&ft);
-  msec = (__SilcInt64) ft.dwHighDateTime << DWLEN | ft.dwLowDateTime;
-  msec = (msec - FILETIME_1970) / 10;
-  tv->tv_sec  = (long) (msec / 1000000);
-  tv->tv_usec = (long) (msec % 1000000);
-
-  return 0;
-}
diff --git a/lib/silcutil/silcasync.c b/lib/silcutil/silcasync.c
deleted file mode 100644 (file)
index 216e30a..0000000
+++ /dev/null
@@ -1,113 +0,0 @@
-/*
-
-  silcasync.c
-
-  Author: Pekka Riikonen <priikone@silcnet.org>
-
-  Copyright (C) 2005, 2006 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.
-
-*/
-
-#include "silc.h"
-
-/* Halts async operation */
-
-SilcBool silc_async_halt(SilcAsyncOperation op)
-{
-  SILC_LOG_DEBUG(("Halting async operation"));
-
-  if (op->pause_cb)
-    return op->pause_cb(op, TRUE, op->context);
-
-  return FALSE;
-}
-
-/* Resumes async operation */
-
-SilcBool silc_async_resume(SilcAsyncOperation op)
-{
-  SILC_LOG_DEBUG(("Resuming async operation"));
-
-  if (op->pause_cb)
-    return op->pause_cb(op, FALSE, op->context);
-
-  return FALSE;
-}
-
-/* Aborts async operation */
-
-void silc_async_abort(SilcAsyncOperation op,
-                      SilcAsyncOperationAbort abort_cb, void *context)
-{
-  SILC_LOG_DEBUG(("Aborting async operation"));
-
-  if (op->abort_cb)
-    op->abort_cb(op, op->context);
-
-  if (abort_cb)
-    abort_cb(op, context);
-
-  silc_async_free(op);
-}
-
-/* Creates new async operation */
-
-SilcAsyncOperation silc_async_alloc(SilcAsyncOperationAbort abort_cb,
-                                   SilcAsyncOperationPause pause_cb,
-                                   void *context)
-{
-  SilcAsyncOperation op;
-
-  SILC_LOG_DEBUG(("Creating new async operation"));
-
-  op = silc_calloc(1, sizeof(*op));
-  if (!op)
-    return NULL;
-
-  silc_async_init(op, abort_cb, pause_cb, context);
-
-  op->allocated = TRUE;
-
-  return op;
-}
-
-/* Creates new async operation */
-
-SilcBool silc_async_init(SilcAsyncOperation op,
-                        SilcAsyncOperationAbort abort_cb,
-                        SilcAsyncOperationPause pause_cb,
-                        void *context)
-{
-  SILC_ASSERT(abort_cb);
-  op->abort_cb = abort_cb;
-  op->pause_cb = pause_cb;
-  op->context = context;
-  op->allocated = FALSE;
-  return TRUE;
-}
-
-/* Stops async operation */
-
-void silc_async_free(SilcAsyncOperation op)
-{
-  if (op->allocated) {
-    SILC_LOG_DEBUG(("Stopping async operation"));
-    silc_free(op);
-  }
-}
-
-/* Return context */
-
-void *silc_async_get_context(SilcAsyncOperation op)
-{
-  return op->context;
-}
diff --git a/lib/silcutil/silcasync.h b/lib/silcutil/silcasync.h
deleted file mode 100644 (file)
index 2853e9c..0000000
+++ /dev/null
@@ -1,303 +0,0 @@
-/*
-
-  silcasync.h
-
-  Author: Pekka Riikonen <priikone@silcnet.org>
-
-  Copyright (C) 2005 - 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.
-
-*/
-
-/****h* silcutil/SILC Async Operation Interface
- *
- * DESCRIPTION
- *
- * SILC Async Operation API is an interface that can be used to control
- * asynchronous operations.  All functions that take callback as argument
- * should return SilcAsyncOperation context.  That context then can be
- * used to control, such as, abort the asynchronous operation.  Using
- * SILC Async Operation API, asynchronous functions can be controlled
- * and aborted safely.
- *
- * The SILC Async Operation API is divided in two levels; the underlaying
- * operation level that implements the asynchronous operation, and the
- * upper layer that can control the asynchronous operation.  The operation
- * layer must guarantee that if the upper layer aborts the asynchronous
- * operation, no callback function will be called back to the upper layer.
- * This must be remembered when implementing the operation layer.
- *
- ***/
-
-#ifndef SILCASYNC_H
-#define SILCASYNC_H
-
-/****s* silcutil/SilcAsyncOperationAPI/SilcAsyncOperation
- *
- * NAME
- *
- *    typedef struct SilcAsyncOperationObject *SilcAsyncOperation;
- *
- * DESCRIPTION
- *
- *    The asynchronous operation context allocated by silc_async_alloc.
- *    The layer that implements the asynchronous operation allocates this
- *    context.  The layer that receives this context can use it to control
- *    the underlaying asynchronous operation.  It is also possible to use
- *    a pre-allocated context by using SilcAsyncOperationStruct instead
- *    SilcAsyncOperation.
- *
- ***/
-typedef struct SilcAsyncOperationObject *SilcAsyncOperation;
-
-/****s* silcutil/SilcAsyncOperationAPI/SilcAsyncOperationStruct
- *
- * NAME
- *
- *    typedef struct SilcAsyncOperationObject SilcAsyncOperationStruct;
- *
- * DESCRIPTION
- *
- *    The asynchronous operation context that can be used as a pre-allocated
- *    context.  This is initialized with silc_async_init.  It need not
- *    be uninitialized.  The layer that implements the asynchronous
- *    operation initializes this context.  The layer that has access to this
- *    context can use it to control the underlaying asynchronous operation.
- *
- ***/
-typedef struct SilcAsyncOperationObject SilcAsyncOperationStruct;
-
-/****f* silcutil/SilcAsyncOperationAPI/SilcAsyncOperationAbort
- *
- * SYNOPSIS
- *
- *    typedef void (*SilcAsyncOperationAbort)(SilcAsyncOperation op,
- *                                            void *context);
- *
- * DESCRIPTION
- *
- *    This callback is called when upper layer calls the silc_async_abort,
- *    and is used to actually perform the abortion of the asynchronous
- *    operation.  The silc_async_free must not be called in this function.
- *
- *    This callback type can also be provided to silc_async_abort function
- *    by the upper layer, if it wants that callback is called to the upper
- *    layer when aborting the operation.
- *
- ***/
-typedef void (*SilcAsyncOperationAbort)(SilcAsyncOperation op,
-                                       void *context);
-
-/****f* silcutil/SilcAsyncOperationAPI/SilcAsyncOperationPause
- *
- * SYNOPSIS
- *
- *    typedef SilcBool (*SilcAsyncOperationPause)(SilcAsyncOperation op,
- *                                                SilcBool pause_operation,
- *                                                void *context);
- *
- * DESCRIPTION
- *
- *    This callback is used to halt an operation, if upper layer calls the
- *    silc_async_halt function, or to resume an operation if upper layer
- *    calls the silc_async_resume, after it has earlier halted the operation.
- *    If this callback is implemented it is guaranteed that the asynchronous
- *    operation is not progressed when it is halted.  If the `pause_operation'
- *    is TRUE the operation is halted.  If it is FALSE, then the operation
- *    resumes its execution.  This function returns TRUE if the operation
- *    was (or is going to be) halted or resumed, and FALSE on error.
- *
- ***/
-typedef SilcBool (*SilcAsyncOperationPause)(SilcAsyncOperation op,
-                                           SilcBool pause_operation,
-                                           void *context);
-
-/* Upper layer functions for managing asynchronous operations.  Layer
-   that has received SilcAsyncOperation context can control the async
-   operation with these functions. */
-
-/****f* silcutil/SilcAsyncOperationAPI/silc_async_halt
- *
- * SYNOPSIS
- *
- *    SilcBool silc_async_halt(SilcAsyncOperation op);
- *
- * DESCRIPTION
- *
- *    Halt the execution of the asynchronous operation.  If the operation
- *    supports this feature, it is guaranteed that the operation is halted
- *    and its execution is not progressed until the silc_async_resume function
- *    is called.  The operation still can be aborted even if it is halted.
- *    If this function is not supported, calling this has no effect and the
- *    function returns FALSE.  This function is for the upper layer that
- *    controls the asynchronous operation.
- *
- ***/
-SilcBool silc_async_halt(SilcAsyncOperation op);
-
-/****f* silcutil/SilcAsyncOperationAPI/silc_async_resume
- *
- * SYNOPSIS
- *
- *    SilcBool silc_async_resume(SilcAsyncOperation op);
- *
- * DESCRIPTION
- *
- *    Resume the execution of the asynchronous operation.  If the halting of
- *    the operation was supported, then this function is used to resume the
- *    execution of the operation after it was halted.  If this function is
- *    not supported, calling this has no effect and the function returns
- *    FALSE.  This function is for the upper layer that controls the
- *    asynchronous operation.
- *
- ***/
-SilcBool silc_async_resume(SilcAsyncOperation op);
-
-/****f* silcutil/SilcAsyncOperationAPI/silc_async_abort
- *
- * SYNOPSIS
- *
- *    void silc_async_abort(SilcAsyncOperation op,
- *                          SilcAsyncOperationAbort abort_cb, void *context);
- *
- * DESCRIPTION
- *
- *    This function is used by upper layer that received SilcAsyncOperation
- *    context from an asynchronous function, to abort the asynchronous
- *    operation.  The `op' becomes invalid after this function returns.
- *    It is also guaranteed (assuming the use of this API is implemented
- *    correctly) that some other completion callback is not called after
- *    the operation was aborted.  However, if the caller wants to receive
- *    a callback when aborting the caller may specify the `abort_cb' and
- *    `context' which will be called after the operation is aborted, but
- *    before the `op' becomes invalid.  The `abort_cb' is called immediately
- *    inside this function.
- *
- ***/
-void silc_async_abort(SilcAsyncOperation op,
-                      SilcAsyncOperationAbort abort_cb, void *context);
-
-/* The operation layer functions.  The layer that performs the async
-   operation use these functions. */
-
-/****f* silcutil/SilcAsyncOperationAPI/silc_async_alloc
- *
- * SYNOPSIS
- *
- *    SilcAsyncOperation silc_async_alloc(SilcAsyncOperationAbort abort_cb,
- *                                        SilcAsyncOperationPause pause_cb,
- *                                        void *context);
- *
- * DESCRIPTION
- *
- *    Start asynchronous operation, and assign `abort_cb' callback for it,
- *    which can be used by some upper layer to abort the asynchronous
- *    operation, by calling the silc_async_abort.  The layer which calls
- *    this function must also call silc_async_free when the asynchronous
- *    operation is successfully completed.  If it is aborted by upper layer
- *    then silc_async_free must not be called, since it is called by the
- *    silc_async_abort function.
- *
- *    If the `pause_cb' is provided then the upper layer may also halt and
- *    then later resume the execution of the operation, by calling the
- *    silc_async_halt and silc_async_resume respectively.  If `pause_cb' is
- *    not provided then these functions has no effect for this operation.
- *
- * EXAMPLE
- *
- *    SilcAsyncOperation silc_async_call(Callback callback, void *cb_context)
- *    {
- *      SilcAsyncOperation op;
- *      ...
- *
- *      // Allocate async operation so that caller can control us, like abort
- *      op = silc_async_alloc(silc_async_call_abort, NULL, ctx);
- *
- *      // Start async operation in FSM
- *      silc_fsm_init(&ctx->fsm, ctx, fsm_destructor, ctx, schedule);
- *      silc_fsm_start(&ctx->fsm, first_state);
- *      ...
- *
- *      // Return async operation for upper layer
- *      return op;
- *    }
- *
- ***/
-SilcAsyncOperation silc_async_alloc(SilcAsyncOperationAbort abort_cb,
-                                   SilcAsyncOperationPause pause_cb,
-                                   void *context);
-
-/****f* silcutil/SilcAsyncOperationAPI/silc_async_init
- *
- * SYNOPSIS
- *
- *    SilcBool silc_async_init(SilcAsyncOperation op,
- *                             SilcAsyncOperationAbort abort_cb,
- *                             SilcAsyncOperationPause pause_cb,
- *                             void *context);
- *
- * DESCRIPTION
- *
- *    Initializes and starts a pre-allocated asynchronous operation context,
- *    and assigns `abort_cb' callback for it, which can be used by some upper
- *    layer to abort the asynchronous operation, by calling the
- *    silc_async_abort.  Since this use pre-allocated context, the function
- *    silc_async_free need not be called.  This function is equivalent
- *    to silc_async_alloc except this does not allocate any memory.  The `op'
- *    needs not be uninitialized.
- *
- *    If the `pause_cb' is provided then the upper layer may also halt and
- *    then later resume the execution of the operation, by calling the
- *    silc_async_halt and silc_async_resume respectively.  If `pause_cb' is
- *    not provided then these functions has no effect for this operation.
- *
- ***/
-SilcBool silc_async_init(SilcAsyncOperation op,
-                        SilcAsyncOperationAbort abort_cb,
-                        SilcAsyncOperationPause pause_cb,
-                        void *context);
-
-/****f* silcutil/SilcAsyncOperationAPI/silc_async_free
- *
- * SYNOPSIS
- *
- *    void silc_async_free(SilcAsyncOperation op);
- *
- * DESCRIPTION
- *
- *    Stop the asynchronous operation.  If the asynchronous operation ended
- *    normally (ie. it was not aborted) this function must be called by the
- *    caller who called silc_async_alloc.  The `op' will become invalid after
- *    this and the upper layer must not call silc_async_abort after this
- *    function is called.  The layer that calls this, must call some other
- *    completion callback to the upper layer, so that it knows that the
- *    asynchronous operation is completed.
- *
- ***/
-void silc_async_free(SilcAsyncOperation op);
-
-/****f* silcutil/SilcAsyncOperationAPI/silc_async_get_context
- *
- * SYNOPSIS
- *
- *    void *silc_async_get_context(SilcAsyncOperation op);
- *
- * DESCRIPTION
- *
- *    Returns the context that was given to the silc_async_alloc or
- *    silc_async_init.
- *
- ***/
-void *silc_async_get_context(SilcAsyncOperation op);
-
-#include "silcasync_i.h"
-
-#endif /* SILCASYNC_H */
diff --git a/lib/silcutil/silcasync_i.h b/lib/silcutil/silcasync_i.h
deleted file mode 100644 (file)
index 5a7a1e1..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
-
-  silcasync_i.h
-
-  Author: Pekka Riikonen <priikone@silcnet.org>
-
-  Copyright (C) 2005 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 SILCASYNC_I_H
-#define SILCASYNC_I_H
-
-#ifndef SILCASYNC_H
-#error "Do not include this header directly"
-#endif
-
-/* Async operation context */
-struct SilcAsyncOperationObject {
-  SilcAsyncOperationAbort abort_cb;
-  SilcAsyncOperationPause pause_cb;
-  void *context;
-  unsigned int allocated  : 1;
-};
-
-#endif /* SILCASYNC_I_H */
diff --git a/lib/silcutil/silcatomic.h b/lib/silcutil/silcatomic.h
deleted file mode 100644 (file)
index de22f80..0000000
+++ /dev/null
@@ -1,1253 +0,0 @@
-/*
-
-  silcatomic.h
-
-  Author: Pekka Riikonen <priikone@silcnet.org>
-
-  Copyright (C) 2006 - 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.
-
-*/
-
-/****h* silcutil/SILC Atomic Operations Interface
- *
- * DESCRIPTION
- *
- * SILC Atomic operations interface provides utility functions to perform
- * simple operations with integers atomically.  This enables fast integer
- * additions and subtractions safely in multithreaded environment.  It is
- * especially suited for reference counters and similar and is much faster
- * than using locking.  This interface supports 8, 16 and 32 bit integers
- * and 32 or 64 bit pointers.
- *
- * On some platforms this interface actually use mutual exclusion lock
- * instead of true atomic operations, leading into some performace penalty.
- * Also on some platforms the 8 and 16 bit integers are actually 32 bit
- * integers.
- *
- * Fast operations are supported on: x86, x86_64, ia64, PPC
- *
- ***/
-
-#ifndef SILCATOMIC_H
-#define SILCATOMIC_H
-
-/* For now we always assume SMP */
-#define SILC_SMP 1
-
-/* Use lock prefix only on true SMP systems */
-#ifdef SILC_SMP
-#define SILC_SMP_LOCK "lock; "
-#else
-#define SILC_SMP_LOCK
-#endif /* SILC_SMP */
-
-/****s* silcutil/SilcAtomicAPI/SilcAtomic32
- *
- * NAME
- *
- *    typedef struct { ... } SilcAtomic32;
- *
- * DESCRIPTION
- *
- *    The atomic operation structure given as argument to all atomic
- *    operation functions.  It hols the actual 32-bit atomic variable.
- *
- * EXAMPLE
- *
- *    SilcAtomic32 refcnt;
- *
- *    // Initialize atomic variable
- *    silc_atomic_init32(&refcnt, 0);
- *
- *    ...
- *    // Increment referene counter
- *    silc_atomic_add_int32(&refcnt, 1);
- *    ...
- *
- *    // Uninitialize atomic variable
- *    silc_atomic_uninit32(&refcnt);
- *
- ***/
-
-/****s* silcutil/SilcAtomicAPI/SilcAtomic16
- *
- * NAME
- *
- *    typedef struct { ... } SilcAtomic16;
- *
- * DESCRIPTION
- *
- *    The atomic operation structure given as argument to all atomic
- *    operation functions.  It hols the actual 16-bit atomic variable.
- *
- * EXAMPLE
- *
- *    SilcAtomic16 refcnt;
- *
- *    // Initialize atomic variable
- *    silc_atomic_init16(&refcnt, 0);
- *
- *    ...
- *    // Increment referene counter
- *    silc_atomic_add_int16(&refcnt, 1);
- *    ...
- *
- *    // Uninitialize atomic variable
- *    silc_atomic_uninit16(&refcnt);
- *
- ***/
-
-/****s* silcutil/SilcAtomicAPI/SilcAtomic8
- *
- * NAME
- *
- *    typedef struct { ... } SilcAtomic8;
- *
- * DESCRIPTION
- *
- *    The atomic operation structure given as argument to all atomic
- *    operation functions.  It hols the actual 8-bit atomic variable.
- *
- * EXAMPLE
- *
- *    SilcAtomic8 refcnt;
- *
- *    // Initialize atomic variable
- *    silc_atomic_init8(&refcnt, 0);
- *
- *    ...
- *    // Increment referene counter
- *    silc_atomic_add_int8(&refcnt, 1);
- *    ...
- *
- *    // Uninitialize atomic variable
- *    silc_atomic_uninit8(&refcnt);
- *
- ***/
-
-/****s* silcutil/SilcAtomicAPI/SilcAtomicPointer
- *
- * NAME
- *
- *    typedef struct { ... } SilcAtomicPointer;
- *
- * DESCRIPTION
- *
- *    The atomic operation structure given as argument to all atomic
- *    operation functions.  It hols the actual pointer variable.
- *
- * EXAMPLE
- *
- *    SilcAtomicPointer ptr;
- *
- *    // Initialize atomic variable
- *    silc_atomic_init_pointer(&ptr, NULL);
- *
- *    ...
- *    // Set pointer
- *    silc_atomic_set_pointer(&ptr, context);
- *    ...
- *
- *    // Uninitialize atomic variable
- *    silc_atomic_uninit_pointer(&ptr);
- *
- ***/
-
-#if !defined(SILC_THREADS) || defined(SILC_WIN32) || (defined(__GNUC__) &&  \
-    (defined(SILC_I486) || defined(SILC_X86_64) || defined(SILC_IA64) ||    \
-     defined(SILC_POWERPC)))
-typedef struct {
-  volatile SilcUInt32 value;
-} SilcAtomic32;
-typedef struct {
-  volatile void *value;
-} SilcAtomicPointer;
-#else
-#define SILC_ATOMIC_MUTEX
-typedef struct {
-  SilcMutex lock;
-  volatile SilcUInt32 value;
-} SilcAtomic32;
-typedef struct {
-  SilcMutex lock;
-  volatile void *value;
-} SilcAtomicPointer;
-#endif
-
-#if !defined(SILC_THREADS) || (defined(__GNUC__) && (defined(SILC_I486) ||  \
-                                                    defined(SILC_X86_64)))
-typedef struct {
-  volatile SilcUInt16 value;
-} SilcAtomic16;
-#elif defined(SILC_WIN32) || (defined(__GNUC__) && (defined(SILC_IA64) ||   \
-                                                   defined(SILC_POWERPC)))
-typedef struct {
-  volatile SilcUInt32 value;
-} SilcAtomic16;
-#else
-typedef struct {
-  SilcMutex lock;
-  volatile SilcUInt16 value;
-} SilcAtomic16;
-#endif
-
-#if !defined(SILC_THREADS) || (defined(__GNUC__) && (defined(SILC_I486) ||  \
-                                                    defined(SILC_X86_64)))
-typedef struct {
-  volatile SilcUInt8 value;
-} SilcAtomic8;
-#elif defined(SILC_WIN32) || (defined(__GNUC__) && (defined(SILC_IA64) ||   \
-                                                   defined(SILC_POWERPC)))
-typedef struct {
-  volatile SilcUInt32 value;
-} SilcAtomic8;
-#else
-typedef struct {
-  SilcMutex lock;
-  volatile SilcUInt8 value;
-} SilcAtomic8;
-#endif
-
-/****f* silcutil/SilcAtomicAPI/silc_atomic_init32
- *
- * SYNOPSIS
- *
- *    static inline
- *    SilcBool silc_atomic_init32(SilcAtomic32 *atomic, SilcUInt32 value);
- *
- * DESCRIPTION
- *
- *    Initializes the atomic variable `atomic', and sets the `value' as its
- *    inital value.  Returns FALSE on error.  To uninitialize call the
- *    silc_atomic_uninit32 function.
- *
- ***/
-
-/****f* silcutil/SilcAtomicAPI/silc_atomic_init16
- *
- * SYNOPSIS
- *
- *    static inline
- *    SilcBool silc_atomic_init16(SilcAtomic16 *atomic, SilcUInt16 value);
- *
- * DESCRIPTION
- *
- *    Initializes the atomic variable `atomic', and sets the `value' as its
- *    inital value.  Returns FALSE on error.  To uninitialize call the
- *    silc_atomic_uninit32 function.
- *
- ***/
-
-/****f* silcutil/SilcAtomicAPI/silc_atomic_init8
- *
- * SYNOPSIS
- *
- *    static inline
- *    SilcBool silc_atomic_init8(SilcAtomic8 *atomic, SilcUInt8 value);
- *
- * DESCRIPTION
- *
- *    Initializes the atomic variable `atomic', and sets the `value' as its
- *    inital value.  Returns FALSE on error.  To uninitialize call the
- *    silc_atomic_uninit8 function.
- *
- ***/
-
-/****f* silcutil/SilcAtomicAPI/silc_atomic_init_pointer
- *
- * SYNOPSIS
- *
- *    static inline
- *    SilcBool silc_atomic_init_pointer(SilcAtomicPointer *atomic,
- *                                      void *pointer);
- *
- * DESCRIPTION
- *
- *    Initializes the atomic pointer variable `atomic', and sets the `pointer'
- *    as its inital pointer.  Returns FALSE on error.  To uninitialize call
- *    the silc_atomic_uninit_pointer function.
- *
- ***/
-
-#define SILC_ATOMIC_INIT_F(name, bits, type)                           \
-static inline                                                          \
-SilcBool silc_atomic_init##name(SilcAtomic##bits *atomic, type value)
-
-#if defined(SILC_ATOMIC_MUTEX)
-#define SILC_ATOMIC_INIT(name, bits, type)                             \
-SILC_ATOMIC_INIT_F(name, bits, type)                                   \
-{                                                                      \
-  atomic->value = value;                                               \
-  return silc_mutex_alloc(&atomic->lock);                              \
-}
-#else
-#define SILC_ATOMIC_INIT(name, bits, type)                             \
-SILC_ATOMIC_INIT_F(name, bits, type)                                   \
-{                                                                      \
-  atomic->value = value;                                               \
-  return TRUE;                                                         \
-}
-#endif /* SILC_ATOMIC_MUTEX */
-
-SILC_ATOMIC_INIT(8, 8, SilcUInt8)
-SILC_ATOMIC_INIT(16, 16, SilcUInt16)
-SILC_ATOMIC_INIT(32, 32, SilcUInt32)
-SILC_ATOMIC_INIT(_pointer, Pointer, void *)
-
-/****f* silcutil/SilcAtomicAPI/silc_atomic_uninit32
- *
- * SYNOPSIS
- *
- *    static inline
- *    void silc_atomic_uninit32(SilcAtomic32 *atomic);
- *
- * DESCRIPTION
- *
- *    Uninitializes the atomic variable `atomic'.  This should alwyas be
- *    called after the atomic variable is not used anymore.
- *
- ***/
-
-/****f* silcutil/SilcAtomicAPI/silc_atomic_uninit16
- *
- * SYNOPSIS
- *
- *    static inline
- *    void silc_atomic_uninit16(SilcAtomic16 *atomic);
- *
- * DESCRIPTION
- *
- *    Uninitializes the atomic variable `atomic'.  This should alwyas be
- *    called after the atomic variable is not used anymore.
- *
- ***/
-
-/****f* silcutil/SilcAtomicAPI/silc_atomic_uninit8
- *
- * SYNOPSIS
- *
- *    static inline
- *    void silc_atomic_uninit8(SilcAtomic8 *atomic);
- *
- * DESCRIPTION
- *
- *    Uninitializes the atomic variable `atomic'.  This should alwyas be
- *    called after the atomic variable is not used anymore.
- *
- ***/
-
-/****f* silcutil/SilcAtomicAPI/silc_atomic_uninit_pointer
- *
- * SYNOPSIS
- *
- *    static inline
- *    void silc_atomic_uninit_pointer(SilcAtomicPointer *atomic);
- *
- * DESCRIPTION
- *
- *    Uninitializes the atomic variable `atomic'.  This should alwyas be
- *    called after the atomic variable is not used anymore.
- *
- ***/
-
-#define SILC_ATOMIC_UNINIT_F(bits, t)                                  \
-static inline void silc_atomic_uninit##bits(SilcAtomic##t *atomic)
-
-#if defined(SILC_ATOMIC_MUTEX)
-#define SILC_ATOMIC_UNINIT(bits, t)                                    \
-SILC_ATOMIC_UNINIT_F(bits, t)                                          \
-{                                                                      \
-  silc_mutex_free(atomic->lock);                                       \
-}
-#else
-#define SILC_ATOMIC_UNINIT(bits, t)                                    \
-SILC_ATOMIC_UNINIT_F(bits, t)                                          \
-{                                                                      \
-  memset(atomic, 0, sizeof(*atomic));                                  \
-}
-#endif /* SILC_ATOMIC_MUTEX */
-
-SILC_ATOMIC_UNINIT(8, 8)
-SILC_ATOMIC_UNINIT(16, 16)
-SILC_ATOMIC_UNINIT(32, 32)
-SILC_ATOMIC_UNINIT(_pointer, Pointer)
-
-/****f* silcutil/SilcAtomicAPI/silc_atomic_set_int32
- *
- * SYNOPSIS
- *
- *    static inline
- *    void silc_atomic_set_int32(SilcAtomic32 *atomic, SilcUInt32 value);
- *
- * DESCRIPTION
- *
- *    Atomically sets `value' to 32-bit integer.
- *
- ***/
-
-/****f* silcutil/SilcAtomicAPI/silc_atomic_set_int16
- *
- * SYNOPSIS
- *
- *    static inline
- *    void silc_atomic_set_int16(SilcAtomic16 *atomic, SilcUInt16 value);
- *
- * DESCRIPTION
- *
- *    Atomically sets `value' to 16-bit integer.
- *
- ***/
-
-/****f* silcutil/SilcAtomicAPI/silc_atomic_set_int8
- *
- * SYNOPSIS
- *
- *    static inline
- *    void silc_atomic_set_int8(SilcAtomic8 *atomic, SilcUInt8 value);
- *
- * DESCRIPTION
- *
- *    Atomically sets `value' to 8-bit integer.
- *
- ***/
-
-#define SILC_ATOMIC_SET_INT_F(bits)                                    \
-static inline void silc_atomic_set_int##bits(SilcAtomic##bits *atomic, \
-                                            SilcUInt##bits value)
-
-#if !defined(SILC_THREADS)
-#define SILC_ATOMIC_SET_INT(bits, bp, bp2)                             \
-SILC_ATOMIC_SET_INT_F(bits)                                            \
-{                                                                      \
-  /* No atomic operations */                                           \
-  atomic->value = value;                                               \
-}
-
-#elif defined(SILC_WIN32)
-#define SILC_ATOMIC_SET_INT(bits, bp, bp2)                             \
-SILC_ATOMIC_SET_INT_F(bits)                                            \
-{                                                                      \
-  /* Windows */                                                                \
-  InterlockedExchange((LONG *)&atomic->value, (LONG)value);            \
-}
-
-#elif defined(__GNUC__) && (defined(SILC_I486) || defined(SILC_X86_64))
-#define SILC_ATOMIC_SET_INT(bits, bp, bp2)                             \
-SILC_ATOMIC_SET_INT_F(bits)                                            \
-{                                                                      \
-  /* GCC + i486 or x86_64 */                                           \
-  __asm __volatile("xchg" bp " %" bp2 "0, %1"                          \
-                  : "=r" (value)                                       \
-                  : "m" (atomic->value), "0" (value));                 \
-}
-
-#elif defined(__GNUC__) && defined(SILC_IA64)
-#define SILC_ATOMIC_SET_INT(bits, bp, bp2)                             \
-SILC_ATOMIC_SET_INT_F(bits)                                            \
-{                                                                      \
-  /* IA64, memory barrier needed */                                    \
-  atomic->value = value;                                               \
-  __sync_synchronize();                                                        \
-}
-
-#elif defined(__GNUC__) && defined(SILC_POWERPC)
-#define SILC_ATOMIC_SET_INT(bits, bp, bp2)                             \
-SILC_ATOMIC_SET_INT_F(bits)                                            \
-{                                                                      \
-  /* PowerPC, memory barrier needed */                                 \
-  atomic->value = value;                                               \
-  __asm("sync" : : : "memory");                                                \
-}
-
-#else /* SILC_ATOMIC_MUTEX */
-#define SILC_ATOMIC_SET_INT(bits, bp, bp2)                             \
-SILC_ATOMIC_SET_INT_F(bits)                                            \
-{                                                                      \
-  /* Mutex */                                                          \
-  silc_mutex_lock(atomic->lock);                                       \
-  atomic->value = value;                                               \
-  silc_mutex_unlock(atomic->lock);                                     \
-}
-#endif /* !SILC_THREADS */
-
-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
- *
- * SYNOPSIS
- *
- *    static inline
- *    void silc_atomic_set_pointer(SilcAtomicPointer *atomic, void *pointer);
- *
- * DESCRIPTION
- *
- *    Atomically sets `pointer' to the atomic variable.
- *
- ***/
-
-static inline
-void silc_atomic_set_pointer(SilcAtomicPointer *atomic, void *pointer)
-{
-#if !defined(SILC_THREADS) ||                   \
-     (defined(__GNUC__) && (defined(SILC_I486) || defined(SILC_X86_64)))
-  /* No threads, Windows, i486 or x86_64, no memory barrier needed */
-  atomic->value = pointer;
-
-#elif defined(SILC_WIN32)
-  InterlockedExchangePointer(&atomic->value, pointer);
-
-#elif defined(__GNUC__) && defined(SILC_IA64)
-  /* IA64, memory barrier needed */
-  atomic->value = pointer;
-  __sync_synchronize();
-
-#elif defined(__GNUC__) && defined(SILC_POWERPC)
-  /* PowerPC, memory barrier needed */
-  atomic->value = pointer;
-  __asm("sync" : : : "memory");
-
-#else
-  /* Mutex */
-  silc_mutex_lock(atomic->lock);
-  atomic->value = pointer;
-  silc_mutex_unlock(atomic->lock);
-#endif
-}
-
-/****f* silcutil/SilcAtomicAPI/silc_atomic_get_int32
- *
- * SYNOPSIS
- *
- *    static inline
- *    SilcUInt32 silc_atomic_get_int32(SilcAtomic32 *atomic);
- *
- * DESCRIPTION
- *
- *    Returns the current value of the atomic variable.
- *
- ***/
-
-/****f* silcutil/SilcAtomicAPI/silc_atomic_get_int16
- *
- * SYNOPSIS
- *
- *    static inline
- *    SilcUInt32 silc_atomic_get_int16(SilcAtomic16 *atomic);
- *
- * DESCRIPTION
- *
- *    Returns the current value of the atomic variable.
- *
- ***/
-
-/****f* silcutil/SilcAtomicAPI/silc_atomic_get_int8
- *
- * SYNOPSIS
- *
- *    static inline
- *    SilcUInt32 silc_atomic_get_int8(SilcAtomic8 *atomic);
- *
- * DESCRIPTION
- *
- *    Returns the current value of the atomic variable.
- *
- ***/
-
-#define SILC_ATOMIC_GET_INT_F(bits)                                    \
-static inline                                                          \
-SilcUInt##bits silc_atomic_get_int##bits(SilcAtomic##bits *atomic)
-
-#if !defined(SILC_THREADS) || defined(SILC_WIN32) ||                   \
-     (defined(__GNUC__) && (defined(SILC_I486) || defined(SILC_X86_64)))
-#define SILC_ATOMIC_GET_INT(bits)                                      \
-SILC_ATOMIC_GET_INT_F(bits)                                            \
-{                                                                      \
-  SilcUInt##bits ret;                                                  \
-                                                                       \
-  /* No threads, Windows, i486 or x86_64, no memory barrier needed */  \
-  ret = atomic->value;                                                 \
-  return ret;                                                          \
-}
-
-#elif defined(__GNUC__) && defined(SILC_IA64)
-#define SILC_ATOMIC_GET_INT(bits)                                      \
-SILC_ATOMIC_GET_INT_F(bits)                                            \
-{                                                                      \
-  SilcUInt##bits ret;                                                  \
-                                                                       \
-  /* IA64, memory barrier needed */                                    \
-  __sync_synchronize();                                                        \
-  ret = atomic->value;                                                 \
-  return ret;                                                          \
-}
-
-#elif defined(__GNUC__) && defined(SILC_POWERPC)
-#define SILC_ATOMIC_GET_INT(bits)                                      \
-SILC_ATOMIC_GET_INT_F(bits)                                            \
-{                                                                      \
-  SilcUInt##bits ret;                                                  \
-                                                                       \
-  /* PowerPC, memory barrier needed */                                 \
-  __asm("sync" : : : "memory");                                                \
-  ret = atomic->value;                                                 \
-  return ret;                                                          \
-}
-
-#else /* SILC_ATOMIC_MUTEX */
-#define SILC_ATOMIC_GET_INT(bits)                                      \
-SILC_ATOMIC_GET_INT_F(bits)                                            \
-{                                                                      \
-  SilcUInt##bits ret;                                                  \
-                                                                       \
-  /* Mutex */                                                          \
-  silc_mutex_lock(atomic->lock);                                       \
-  ret = atomic->value;                                                 \
-  silc_mutex_unlock(atomic->lock);                                     \
-  return ret;                                                          \
-}
-#endif /* !SILC_THREADS */
-
-SILC_ATOMIC_GET_INT(8)
-SILC_ATOMIC_GET_INT(16)
-SILC_ATOMIC_GET_INT(32)
-
-/****f* silcutil/SilcAtomicAPI/silc_atomic_get_pointer
- *
- * SYNOPSIS
- *
- *    static inline
- *    SilcUInt8 silc_atomic_get_pointer(SilcAtomicPointer *atomic)
- *
- * DESCRIPTION
- *
- *    Returns the current pointer value of the atomic variable.
- *
- ***/
-
-static inline
-void *silc_atomic_get_pointer(SilcAtomicPointer *atomic)
-{
-  void *ret;
-
-#if !defined(SILC_THREADS) || defined(SILC_WIN32) ||                    \
-     (defined(__GNUC__) && (defined(SILC_I486) || defined(SILC_X86_64)))
-  /* No threads, Windows, i486 or x86_64, no memory barrier needed */
-  ret = (void *)atomic->value;
-  return ret;
-
-#elif defined(__GNUC__) && defined(SILC_IA64)
-  /* IA64, memory barrier needed */
-  __sync_synchronize();
-  ret = (void *)atomic->value;
-  return ret;
-
-#elif defined(__GNUC__) && defined(SILC_POWERPC)
-  /* PowerPC, memory barrier needed */
-  __asm("sync" : : : "memory");
-  ret = (void *)atomic->value;
-  return ret;
-
-#else
-  /* Mutex */
-  silc_mutex_lock(atomic->lock);
-  ret = (void *)atomic->value;
-  silc_mutex_unlock(atomic->lock);
-  return ret;
-#endif
-}
-
-/****f* silcutil/SilcAtomicAPI/silc_atomic_add_int32
- *
- * SYNOPSIS
- *
- *    static inline
- *    SilcUInt32 silc_atomic_add_int32(SilcAtomic32 *atomic, SilcInt32 value);
- *
- * DESCRIPTION
- *
- *    Atomically adds `value' to 32-bit integer.  Returns the value after
- *    addition.
- *
- ***/
-
-/****f* silcutil/SilcAtomicAPI/silc_atomic_add_int16
- *
- * SYNOPSIS
- *
- *    static inline
- *    SilcUInt16 silc_atomic_add_int16(SilcAtomic16 *atomic, SilcInt16 value);
- *
- * DESCRIPTION
- *
- *    Atomically adds `value' to 16-bit integer.  Returns the value after
- *    addition.
- *
- ***/
-
-/****f* silcutil/SilcAtomicAPI/silc_atomic_add_int8
- *
- * SYNOPSIS
- *
- *    static inline
- *    SilcUInt8 silc_atomic_add_int8(SilcAtomic8 *atomic, SilcInt8 value);
- *
- * DESCRIPTION
- *
- *    Atomically adds `value' to 8-bit integer.  Returns the value after
- *    addition.
- *
- ***/
-
-#define SILC_ATOMIC_ADD_INT_F(bits)                                    \
-static inline                                                          \
-SilcUInt##bits silc_atomic_add_int##bits(SilcAtomic##bits *atomic,     \
-                                        SilcInt##bits value)
-
-#if !defined(SILC_THREADS)
-#define SILC_ATOMIC_ADD_INT(bits, bp)                                  \
-SILC_ATOMIC_ADD_INT_F(bits)                                            \
-{                                                                      \
-  SilcUInt##bits ret;                                                  \
-  /* No atomic operations */                                           \
-  ret = atomic->value;                                                 \
-  atomic->value += value;                                              \
-  return ret + value;                                                  \
-}
-
-#elif defined(SILC_WIN32)
-#define SILC_ATOMIC_ADD_INT(bits, bp)                                  \
-SILC_ATOMIC_ADD_INT_F(bits)                                            \
-{                                                                      \
-  SilcUInt##bits ret;                                                  \
-  LONG val = value;                                                    \
-  /* Windows */                                                                \
-  ret = InterlockedExchangeAdd(&atomic->value, val);                   \
-  return ret + value;                                                  \
-}
-
-#elif defined(__GNUC__) && (defined(SILC_I486) || defined(SILC_X86_64))
-#define SILC_ATOMIC_ADD_INT(bits, bp)                                  \
-SILC_ATOMIC_ADD_INT_F(bits)                                            \
-{                                                                      \
-  SilcUInt##bits ret;                                                  \
-  /* GCC + i486 or x86_64 */                                           \
-  __asm __volatile(SILC_SMP_LOCK "xadd" bp " %0, %1"                   \
-                  : "=r" (ret), "+m" (atomic->value)                   \
-                  : "0" (value));                                      \
-  return ret + value;                                                  \
-}
-
-#elif defined(__GNUC__) && defined(SILC_IA64)
-#define SILC_ATOMIC_ADD_INT(bits, bp)                                  \
-SILC_ATOMIC_ADD_INT_F(bits)                                            \
-{                                                                      \
-  SilcUInt##bits ret;                                                  \
-  SilcInt32 val = value;                                               \
-  /* GCC + IA64 (GCC builtin atomic operations) */                     \
-  ret = __sync_fetch_and_add(&atomic->value, val);                     \
-  return ret + value;                                                  \
-}
-
-#elif defined(__GNUC__) && defined(SILC_POWERPC)
-#define SILC_ATOMIC_ADD_INT(bits, bp)                                  \
-SILC_ATOMIC_ADD_INT_F(bits)                                            \
-{                                                                      \
-  SilcUInt32 ret;                                                      \
-  SilcInt32 val = value;                                               \
-  /* GCC + PowerPC (code adapted from IBM's documentation) */          \
-  __asm __volatile("0: lwarx  %0,  0, %2\n"                            \
-                  "   add    %0, %1, %0\n"                             \
-                  "   stwcx. %0,  0, %2\n"                             \
-                  "   bne-   0b"                                       \
-                  : "=&r" (ret)                                        \
-                  : "r" (val), "r" (&atomic->value)                    \
-                  : "cc");                                             \
-  return ret;                                                          \
-}
-
-#else /* SILC_ATOMIC_MUTEX */
-#define SILC_ATOMIC_ADD_INT(bits, bp)                                  \
-SILC_ATOMIC_ADD_INT_F(bits)                                            \
-{                                                                      \
-  SilcUInt##bits ret;                                                  \
-  /* Mutex */                                                          \
-  silc_mutex_lock(atomic->lock);                                       \
-  ret = atomic->value;                                                 \
-  atomic->value += value;                                              \
-  silc_mutex_unlock(atomic->lock);                                     \
-  return ret + value;                                                  \
-}
-#endif /* !SILC_THREADS */
-
-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
- *
- * SYNOPSIS
- *
- *    static inline
- *    SilcUInt32 silc_atomic_sub_int32(SilcAtomic32 *atomic, SilcInt32 value);
- *
- * DESCRIPTION
- *
- *    Atomically subtracts `value' from 32-bit integer.  Returns the value
- *    after subtraction.
- *
- ***/
-
-/****f* silcutil/SilcAtomicAPI/silc_atomic_sub_int16
- *
- * SYNOPSIS
- *
- *    static inline
- *    SilcUInt16 silc_atomic_sub_int16(SilcAtomic16 *atomic, SilcInt16 value);
- *
- * DESCRIPTION
- *
- *    Atomically subtracts `value' from 16-bit integer.  Returns the value
- *    after subtraction.
- *
- ***/
-
-/****f* silcutil/SilcAtomicAPI/silc_atomic_sub_int8
- *
- * SYNOPSIS
- *
- *    static inline
- *    SilcUInt8 silc_atomic_sub_int8(SilcAtomic8 *atomic, SilcInt8 value);
- *
- * DESCRIPTION
- *
- *    Atomically subtracts `value' from 8-bit integer.  Returns the value
- *    after subtraction.
- *
- ***/
-
-#define silc_atomic_sub_int8(a, v) silc_atomic_add_int8(a, (-v))
-#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
- *
- * SYNOPSIS
- *
- *    static inline
- *    void silc_atomic_inc32(SilcAtomic32 *atomic);
- *
- * DESCRIPTION
- *
- *    Atomically increments 32-bit integer by one.
- *
- ***/
-
-/****f* silcutil/SilcAtomicAPI/silc_atomic_inc16
- *
- * SYNOPSIS
- *
- *    static inline
- *    void silc_atomic_inc16(SilcAtomic16 *atomic);
- *
- * DESCRIPTION
- *
- *    Atomically increments 16-bit integer by one.
- *
- ***/
-
-/****f* silcutil/SilcAtomicAPI/silc_atomic_inc8
- *
- * SYNOPSIS
- *
- *    static inline
- *    void silc_atomic_inc8(SilcAtomic8 *atomic);
- *
- * DESCRIPTION
- *
- *    Atomically increments 8-bit integer by one.
- *
- ***/
-
-#define SILC_ATOMIC_INC_F(bits)                                                \
-static inline void silc_atomic_inc##bits(SilcAtomic##bits *atomic)
-
-#if !defined(SILC_THREADS)
-#define SILC_ATOMIC_INC(bits, bp)                                      \
-SILC_ATOMIC_INC_F(bits)                                                        \
-{                                                                      \
-  /* No atomic operations */                                           \
-  ++atomic->value;                                                     \
-}
-
-#elif defined(SILC_WIN32)
-#define SILC_ATOMIC_INC(bits, bp)                                      \
-SILC_ATOMIC_INC_F(bits)                                                        \
-{                                                                      \
-  /* Windows */                                                                \
-  InterlockedIncrement((LONG *)&atomic->value);                                \
-}
-
-#elif defined(__GNUC__) && (defined(SILC_I486) || defined(SILC_X86_64))
-#define SILC_ATOMIC_INC(bits, bp)                                      \
-SILC_ATOMIC_INC_F(bits)                                                        \
-{                                                                      \
-  /* GCC + i486 or x86_64 */                                           \
-  __asm __volatile(SILC_SMP_LOCK "inc" bp " %0"                                \
-                  : "+m" (atomic->value));                             \
-}
-
-#elif defined(__GNUC__) && defined(SILC_IA64)
-#define SILC_ATOMIC_INC(bits, bp)                                      \
-SILC_ATOMIC_INC_F(bits)                                                        \
-{                                                                      \
-  /* GCC + IA64 (GCC builtin atomic operations) */                     \
-  __sync_fetch_and_add(&atomic->value, 1);                             \
-}
-
-#elif defined(__GNUC__) && defined(SILC_POWERPC)
-#define SILC_ATOMIC_INC(bits, bp)                                      \
-SILC_ATOMIC_INC_F(bits)                                                        \
-{                                                                      \
-  SilcUInt32 ret;                                                      \
-  SilcInt32 val = 1;                                                   \
-  /* GCC + PowerPC (code adapted from IBM's documentation) */          \
-  __asm __volatile("0: lwarx  %0,  0, %2\n"                            \
-                  "   add    %0, %1, %0\n"                             \
-                  "   stwcx. %0,  0, %2\n"                             \
-                  "   bne-   0b"                                       \
-                  : "=&r" (ret)                                        \
-                  : "r" (val), "r" (&atomic->value)                    \
-                  : "cc");                                             \
-}
-
-#else /* SILC_ATOMIC_MUTEX */
-#define SILC_ATOMIC_INC(bits, bp)                                      \
-SILC_ATOMIC_INC_F(bits)                                                        \
-{                                                                      \
-  /* Mutex */                                                          \
-  silc_mutex_lock(atomic->lock);                                       \
-  ++atomic->value;                                                     \
-  silc_mutex_unlock(atomic->lock);                                     \
-}
-#endif /* !SILC_THREADS */
-
-SILC_ATOMIC_INC(8, "b")
-SILC_ATOMIC_INC(16, "w")
-SILC_ATOMIC_INC(32, "l")
-
-/****f* silcutil/SilcAtomicAPI/silc_atomic_dec32
- *
- * SYNOPSIS
- *
- *    static inline
- *    void silc_atomic_dec32(SilcAtomic32 *atomic);
- *
- * DESCRIPTION
- *
- *    Atomically decrements 32-bit integer by one.
- *
- ***/
-
-/****f* silcutil/SilcAtomicAPI/silc_atomic_dec16
- *
- * SYNOPSIS
- *
- *    static inline
- *    void silc_atomic_dec16(SilcAtomic16 *atomic);
- *
- * DESCRIPTION
- *
- *    Atomically decrements 16-bit integer by one.
- *
- ***/
-
-/****f* silcutil/SilcAtomicAPI/silc_atomic_dec8
- *
- * SYNOPSIS
- *
- *    static inline
- *    void silc_atomic_dec8(SilcAtomic8 *atomic);
- *
- * DESCRIPTION
- *
- *    Atomically decrements 8-bit integer by one.
- *
- ***/
-
-#define SILC_ATOMIC_DEC_F(bits)                                                \
-static inline void silc_atomic_dec##bits(SilcAtomic##bits *atomic)
-
-#if !defined(SILC_THREADS)
-#define SILC_ATOMIC_DEC(bits, bp)                                      \
-SILC_ATOMIC_DEC_F(bits)                                                        \
-{                                                                      \
-  /* No atomic operations */                                           \
-  --atomic->value;                                                     \
-}
-
-#elif defined(SILC_WIN32)
-#define SILC_ATOMIC_DEC(bits, bp)                                      \
-SILC_ATOMIC_DEC_F(bits)                                                        \
-{                                                                      \
-  /* Windows */                                                                \
-  InterlockedDecrement((LONG *)&atomic->value);                                \
-}
-
-#elif defined(__GNUC__) && (defined(SILC_I486) || defined(SILC_X86_64))
-#define SILC_ATOMIC_DEC(bits, bp)                                      \
-SILC_ATOMIC_DEC_F(bits)                                                        \
-{                                                                      \
-  /* GCC + i486 or x86_64 */                                           \
-  __asm __volatile(SILC_SMP_LOCK "dec" bp " %0"                                \
-                  : "+m" (atomic->value));                             \
-}
-
-#elif defined(__GNUC__) && defined(SILC_IA64)
-#define SILC_ATOMIC_DEC(bits, bp)                                      \
-SILC_ATOMIC_DEC_F(bits)                                                        \
-{                                                                      \
-  /* GCC + IA64 (GCC builtin atomic operations) */                     \
-  __sync_fetch_and_sub(&atomic->value, 1);                             \
-}
-
-#elif defined(__GNUC__) && defined(SILC_POWERPC)
-#define SILC_ATOMIC_DEC(bits, bp)                                      \
-SILC_ATOMIC_DEC_F(bits)                                                        \
-{                                                                      \
-  SilcUInt32 ret;                                                      \
-  SilcInt32 val = -1;                                                  \
-  /* GCC + PowerPC (code adapted from IBM's documentation) */          \
-  __asm __volatile("0: lwarx  %0,  0, %2\n"                            \
-                  "   add    %0, %1, %0\n"                             \
-                  "   stwcx. %0,  0, %2\n"                             \
-                  "   bne-   0b"                                       \
-                  : "=&r" (ret)                                        \
-                  : "r" (val), "r" (&atomic->value)                    \
-                  : "cc");                                             \
-}
-
-#else /* SILC_ATOMIC_MUTEX */
-#define SILC_ATOMIC_DEC(bits, bp)                                      \
-SILC_ATOMIC_DEC_F(bits)                                                        \
-{                                                                      \
-  /* Mutex */                                                          \
-  silc_mutex_lock(atomic->lock);                                       \
-  --atomic->value;                                                     \
-  silc_mutex_unlock(atomic->lock);                                     \
-}
-#endif /* !SILC_THREADS */
-
-SILC_ATOMIC_DEC(8, "b")
-SILC_ATOMIC_DEC(16, "w")
-SILC_ATOMIC_DEC(32, "l")
-
-/****f* silcutil/SilcAtomicAPI/silc_atomic_cas32
- *
- * SYNOPSIS
- *
- *    static inline
- *    SilcBool silc_atomic_cas32(SilcAtomic32 *atomic, SilcUInt32 old_val,
- *                               SilcUInt32 new_val)
- *
- * DESCRIPTION
- *
- *    Performs compare and swap (CAS).  Atomically compares if the variable
- *    `atomic' has the value `old_val' and in that case swaps it with the
- *    value `new_val'.  Returns TRUE if the old value was same and it was
- *    swapped and FALSE if it differed and was not swapped.
- *
- ***/
-
-/****f* silcutil/SilcAtomicAPI/silc_atomic_cas16
- *
- * SYNOPSIS
- *
- *    static inline
- *    SilcBool silc_atomic_cas16(SilcAtomic16 *atomic, SilcUInt16 old_val,
- *                               SilcUInt16 new_val)
- *
- * DESCRIPTION
- *
- *    Performs compare and swap (CAS).  Atomically compares if the variable
- *    `atomic' has the value `old_val' and in that case swaps it with the
- *    value `new_val'.  Returns TRUE if the old value was same and it was
- *    swapped and FALSE if it differed and was not swapped.
- *
- ***/
-
-/****f* silcutil/SilcAtomicAPI/silc_atomic_cas8
- *
- * SYNOPSIS
- *
- *    static inline
- *    SilcBool silc_atomic_cas8(SilcAtomic8 *atomic, SilcUInt8 old_val,
- *                              SilcUInt8 new_val)
- *
- * DESCRIPTION
- *
- *    Performs compare and swap (CAS).  Atomically compares if the variable
- *    `atomic' has the value `old_val' and in that case swaps it with the
- *    value `new_val'.  Returns TRUE if the old value was same and it was
- *    swapped and FALSE if it differed and was not swapped.
- *
- ***/
-
-#define SILC_ATOMIC_CAS_F(bits)                                                \
-static inline SilcBool silc_atomic_cas##bits(SilcAtomic##bits *atomic,  \
-                                            SilcInt##bits old_val,     \
-                                            SilcInt##bits new_val)
-
-#if !defined(SILC_THREADS)
-#define SILC_ATOMIC_CAS(bits, bp)                                      \
-SILC_ATOMIC_CAS_F(bits)                                                        \
-{                                                                      \
-  /* No atomic operations */                                           \
-  if (atomic->value == (SilcUInt##bits)old_val) {                      \
-    atomic->value = new_val;                                           \
-    return TRUE;                                                       \
-  }                                                                    \
-  return FALSE;                                                                \
-}
-
-#elif defined(SILC_WIN32)
-#define SILC_ATOMIC_CAS(bits, bp)                                      \
-SILC_ATOMIC_CAS_F(bits)                                                        \
-{                                                                      \
-  /* Windows */                                                                \
-  LONG o = old_val, n = new_val;                                       \
-  return InterlockedCompareExchange(&atomic->value, n, o) == o;                \
-}
-
-#elif defined(__GNUC__) && (defined(SILC_I486) || defined(SILC_X86_64))
-#define SILC_ATOMIC_CAS(bits, bp)                                      \
-SILC_ATOMIC_CAS_F(bits)                                                        \
-{                                                                      \
-  /* GCC + i486 or x86_64 */                                           \
-  SilcUInt##bits ret;                                                  \
-  __asm __volatile(SILC_SMP_LOCK "cmpxchg" bp " %2, %1"                        \
-                  : "=a" (ret), "=m" (atomic->value)                   \
-                  : "r" (new_val), "m" (atomic->value), "0" (old_val)); \
-  return ret == (SilcUInt##bits)old_val;                               \
-}
-
-#elif defined(__GNUC__) && defined(SILC_IA64)
-#define SILC_ATOMIC_CAS(bits, bp)                                      \
-SILC_ATOMIC_CAS_F(bits)                                                        \
-{                                                                      \
-  /* GCC + IA64 (GCC builtin atomic operations) */                     \
-  SilcUInt32 o = old_val, n = new_val;                                 \
-  return __sync_bool_compare_and_swap(&atomic->value, o, n);           \
-}
-
-#elif defined(__GNUC__) && defined(SILC_POWERPC)
-#define SILC_ATOMIC_CAS(bits, bp)                                      \
-SILC_ATOMIC_CAS_F(bits)                                                        \
-{                                                                      \
-  /* GCC + PowerPC */                                                  \
-  /* XXX TODO */                                                       \
-}
-
-#else /* SILC_ATOMIC_MUTEX */
-#define SILC_ATOMIC_CAS(bits, bp)                                      \
-SILC_ATOMIC_CAS_F(bits)                                                        \
-{                                                                      \
-  /* Mutex */                                                          \
-  silc_mutex_lock(atomic->lock);                                       \
-  if (atomic->value == (SilcUInt##bits)old_val) {                      \
-    atomic->value = new_val;                                           \
-    silc_mutex_unlock(atomic->lock);                                   \
-    return TRUE;                                                       \
-  }                                                                    \
-  silc_mutex_unlock(atomic->lock);                                     \
-  return FALSE;                                                                \
-}
-#endif /* !SILC_THREADS */
-
-SILC_ATOMIC_CAS(8, "b")
-SILC_ATOMIC_CAS(16, "w")
-SILC_ATOMIC_CAS(32, "l")
-
-/****f* silcutil/SilcAtomicAPI/silc_atomic_cas_pointer
- *
- * SYNOPSIS
- *
- *    static inline
- *    SilcBool silc_atomic_cas_pointer(SilcAtomicPointer *atomic,
- *                                     void *old_ptr, void *new_ptr);
- *
- * DESCRIPTION
- *
- *    Performs compare and swap (CAS).  Atomically compares if the variable
- *    `atomic' has the pointer `old_ptr' and in that case swaps it with the
- *    pointer `new_ptr'.  Returns TRUE if the old pointer was same and it was
- *    swapped and FALSE if it differed and was not swapped.
- *
- ***/
-
-static inline
-SilcBool silc_atomic_cas_pointer(SilcAtomicPointer *atomic, void *old_val,
-                                void *new_val)
-{
-#if !defined(SILC_THREADS)
-  /* No atomic operations */
-  if (atomic->value == old_val) {
-    atomic->value = new_val;
-    return TRUE;
-  }
-  return FALSE;
-
-#elif defined(SILC_WIN32)
-  /* Windows */
-  return InterlockedCompareExchangePointer(&atomic->value, new_val, old_val)
-    == old_val;
-
-#elif defined(__GNUC__) && defined(SILC_I486)
-  /* GCC + i486 */
-  void *ret;
-  __asm __volatile(SILC_SMP_LOCK "cmpxchgl %2, %1"
-                  : "=a" (ret), "=m" (atomic->value)
-                  : "c" (new_val), "m" (atomic->value), "0" (old_val));
-  return ret == old_val;
-
-#elif defined(__GNUC__) && defined(SILC_X86_64)
-  /* GCC + x86_64 */
-  void *ret;
-  __asm __volatile(SILC_SMP_LOCK "cmpxchgq %q2, %1"
-                  : "=a" (ret), "=m" (atomic->value)
-                  : "c" (new_val), "m" (atomic->value), "0" (old_val));
-  return ret == old_val;
-
-#elif defined(__GNUC__) && defined(SILC_IA64)
-  /* GCC + IA64 (GCC builtin atomic operations) */
-  return  __sync_bool_compare_and_swap((long *)&atomic->value, (long)old_val,
-                                      (long)new_val);
-
-#elif defined(__GNUC__) && defined(SILC_POWERPC)
-  /* GCC + PowerPC */
-  /* XXX TODO */
-
-#else
-  /* Mutex */
-  silc_mutex_lock(atomic->lock);
-  if (atomic->value == old_val) {
-    atomic->value = new_val;
-    silc_mutex_unlock(atomic->lock);
-    return TRUE;
-  }
-  silc_mutex_unlock(atomic->lock);
-  return FALSE;
-#endif
-}
-
-#endif /* SILCATOMIC_H */
diff --git a/lib/silcutil/silcbuffer.h b/lib/silcutil/silcbuffer.h
deleted file mode 100644 (file)
index 5ce6711..0000000
+++ /dev/null
@@ -1,1208 +0,0 @@
-/*
-
-  silcbuffer.h
-
-  Author: Pekka Riikonen <priikone@silcnet.org>
-
-  Copyright (C) 1998 - 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.
-
-*/
-/* $Id$ */
-
-/****h* silcutil/SILC 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
- * is constructed of four different data sections that in whole creates
- * the allocated data area.
- *
- ***/
-
-#ifndef SILCBUFFER_H
-#define SILCBUFFER_H
-
-/****s* silcutil/SilcBufferAPI/SilcBuffer
- *
- * NAME
- *
- *    typedef struct { ... } *SilcBuffer, SilcBufferStruct;
- *
- * DESCRIPTION
- *
- *    SILC Buffer object. Following short description of the fields
- *    of the buffer.
- *
- * EXAMPLE
- *
- *    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.
- *
- *        --------------------------------
- *        | head  | data         | tail  |
- *        --------------------------------
- *        ^       ^
- *
- *        Current head section in the buffer is sb->data - sb->head.
- *
- *    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.
- *
- *        --------------------------------
- *        | head  | data         | tail  |
- *        --------------------------------
- *                ^              ^
- *
- *        Current valid data area in the buffer is sb->tail - sb->data.
- *
- *     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.
- *
- *        --------------------------------
- *        | head  | data         | tail  |
- *        --------------------------------
- *                               ^       ^
- *
- *        Current tail section in the buffer is sb->end - sb->tail.
- *
- *    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.
- *        Usually this field is not needed except when checking the size
- *        of the buffer.
- *
- *        --------------------------------
- *        | head  | data         | tail  |
- *        --------------------------------
- *                                       ^
- *
- *        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.
- *
- * SOURCE
- */
-typedef struct SilcBufferObject {
-  unsigned char *head;
-  unsigned char *data;
-  unsigned char *tail;
-  unsigned char *end;
-} *SilcBuffer, SilcBufferStruct;
-/***/
-
-/* Macros */
-
-/****f* silcutil/SilcBufferAPI/silc_buffer_data
- *
- * NAME
- *
- *    unsigned char *silc_buffer_data(SilcBuffer sb)
- *
- * DESCRIPTION
- *
- *    Returns pointer to the data area of the buffer.
- *
- * SOURCE
- */
-#define silc_buffer_data(x) (x)->data
-/***/
-
-/****f* silcutil/SilcBufferAPI/silc_buffer_datalen
- *
- * NAME
- *
- *    #define silc_buffer_datalen ...
- *
- * DESCRIPTION
- *
- *    Macro that can be used in function argument list to give the data
- *    pointer and the data length, instead of calling both silc_buffer_data
- *    and silc_buffer_len separately.
- *
- * EXAMPLE
- *
- *    // Following are the same thing
- *    silc_foo_function(foo, silc_buffer_datalen(buf));
- *    silc_foo_function(foo, silc_buffer_data(buf), silc_buffer_len(buf));
- *
- * SOURCE
- */
-#define silc_buffer_datalen(x) (x) ? silc_buffer_data((x)) : NULL, \
-  (x) ? silc_buffer_len((x)) : 0
-/***/
-
-/* Inline functions */
-
-/****d* silcutil/SilcBufferAPI/silc_buffer_truelen
- *
- * NAME
- *
- *    SilcUInt32 silc_buffer_truelen(SilcBuffer sb)
- *
- * DESCRIPTION
- *
- *    Returns the true length of the buffer.
- *
- ***/
-static inline
-SilcUInt32 silc_buffer_truelen(SilcBuffer x)
-{
-  return (SilcUInt32)(x->end - x->head);
-}
-
-/****d* silcutil/SilcBufferAPI/silc_buffer_len
- *
- * NAME
- *
- *    SilcUInt32 silc_buffer_len(SilcBuffer sb)
- *
- * DESCRIPTION
- *
- *    Returns the current length of the data area of the buffer.
- *
- ***/
-static inline
-SilcUInt32 silc_buffer_len(SilcBuffer x)
-{
-  return (SilcUInt32)(x->tail - x->data);
-}
-
-/****d* silcutil/SilcBufferAPI/silc_buffer_headlen
- *
- * NAME
- *
- *    SilcUInt32 silc_buffer_headlen(SilcBuffer sb)
- *
- * DESCRIPTION
- *
- *    Returns the current length of the head data area of the buffer.
- *
- ***/
-static inline
-SilcUInt32 silc_buffer_headlen(SilcBuffer x)
-{
-  return (SilcUInt32)(x->data - x->head);
-}
-
-/****d* silcutil/SilcBufferAPI/silc_buffer_taillen
- *
- * NAME
- *
- *    SilcUInt32 silc_buffer_taillen(SilcBuffer sb)
- *
- * DESCRIPTION
- *
- *    Returns the current length of the tail data area of the buffer.
- *
- ***/
-static inline
-SilcUInt32 silc_buffer_taillen(SilcBuffer x)
-{
-  return (SilcUInt32)(x->end - x->tail);
-}
-
-/****f* silcutil/SilcBufferAPI/silc_buffer_alloc
- *
- * SYNOPSIS
- *
- *    static inline
- *    SilcBuffer silc_buffer_alloc(SilcUInt32 len);
- *
- * DESCRIPTION
- *
- *    Allocates new SilcBuffer and returns it.  Returns NULL on error.
- *
- ***/
-
-static inline
-SilcBuffer silc_buffer_alloc(SilcUInt32 len)
-{
-  SilcBuffer sb;
-
-  /* Allocate new SilcBuffer */
-  sb = (SilcBuffer)silc_calloc(1, sizeof(*sb));
-  if (silc_unlikely(!sb))
-    return NULL;
-
-  if (silc_likely(len)) {
-    /* Allocate the actual data area */
-    sb->head = (unsigned char *)silc_calloc(len, sizeof(*sb->head));
-    if (silc_unlikely(!sb->head))
-      return NULL;
-
-    /* Set pointers to the new buffer */
-    sb->data = sb->head;
-    sb->tail = sb->head;
-    sb->end = sb->head + len;
-  }
-
-  return sb;
-}
-
-/****f* silcutil/SilcBufferAPI/silc_buffer_free
- *
- * SYNOPSIS
- *
- *    static inline
- *    void silc_buffer_free(SilcBuffer sb);
- *
- * DESCRIPTION
- *
- *    Frees SilcBuffer.  Can be called safely `sb' as NULL.
- *
- * NOTES
- *
- *    Must not be called for buffers allocated with silc_buffer_salloc,
- *    silc_buffer_salloc_size, silc_buffer_scopy and silc_buffer_sclone.
- *
- ***/
-
-static inline
-void silc_buffer_free(SilcBuffer sb)
-{
-  if (sb) {
-#if defined(SILC_DEBUG)
-    if (sb->head)
-      memset(sb->head, 'F', silc_buffer_truelen(sb));
-#endif
-    silc_free(sb->head);
-    silc_free(sb);
-  }
-}
-
-/****f* silcutil/SilcBufferAPI/silc_buffer_steal
- *
- * SYNOPSIS
- *
- *    static inline
- *    unsigned char *silc_buffer_steal(SilcBuffer sb, SilcUInt32 *data_len);
- *
- * DESCRIPTION
- *
- *    Steals the data from the buffer `sb'.  This returns pointer to the
- *    start of the buffer and the true length of that buffer.  The `sb'
- *    cannot be used anymore after calling this function because the
- *    data buffer was stolen.  The `sb' must be freed with silc_buffer_free.
- *    The caller is responsible of freeing the stolen data buffer with
- *    silc_free.
- *
- ***/
-
-static inline
-unsigned char *silc_buffer_steal(SilcBuffer sb, SilcUInt32 *data_len)
-{
-  unsigned char *buf = sb->head;
-  if (data_len)
-    *data_len = silc_buffer_truelen(sb);
-  sb->head = sb->data = sb->tail = sb->end = NULL;
-  return buf;
-}
-
-/****f* silcutil/SilcBufferAPI/silc_buffer_purge
- *
- * SYNOPSIS
- *
- *    static inline
- *    void silc_buffer_purge(SilcBuffer sb);
- *
- * DESCRIPTION
- *
- *    Same as silc_buffer_free but free's only the contents of the buffer
- *    not the buffer itself.  The `sb' remains intact, data is freed.  Buffer
- *    is ready for re-use after calling this function.
- *
- * NOTES
- *
- *    Must not be called for buffers allocated with silc_buffer_salloc,
- *    silc_buffer_salloc_size, silc_buffer_scopy and silc_buffer_sclone.
- *
- ***/
-
-static inline
-void silc_buffer_purge(SilcBuffer sb)
-{
-  silc_free(silc_buffer_steal(sb, NULL));
-}
-
-/****f* silcutil/SilcBufferAPI/silc_buffer_set
- *
- * SYNOPSIS
- *
- *    static inline
- *    void silc_buffer_set(SilcBuffer sb,
- *                        unsigned char *data,
- *                         SilcUInt32 data_len);
- *
- * DESCRIPTION
- *
- *    Sets the `data' and `data_len' to the buffer pointer sent as argument.
- *    The data area is automatically set to the `data_len'. This function
- *    can be used to set the data to static buffer without needing any
- *    memory allocations. The `data' will not be copied to the buffer.
- *
- * EXAMPLE
- *
- *    SilcBufferStruct buf;
- *    silc_buffer_set(&buf, data, data_len);
- *
- ***/
-
-static inline
-void silc_buffer_set(SilcBuffer sb, unsigned char *data, SilcUInt32 data_len)
-{
-  sb->data = sb->head = data;
-  sb->tail = sb->end = data + data_len;
-}
-
-/****f* silcutil/SilcBufferAPI/silc_buffer_pull
- *
- * SYNOPSIS
- *
- *    static inline
- *    unsigned char *silc_buffer_pull(SilcBuffer sb, SilcUInt32 len);
- *
- * DESCRIPTION
- *
- *    Pulls current data area towards end. The length of the currently
- *    valid data area is also decremented. Returns pointer to the data
- *    area before pulling. Returns NULL on error.
- *
- * EXAMPLE
- *
- *    ---------------------------------
- *    | head  | data       | tail     |
- *    ---------------------------------
- *            ^
- *            Pulls the start of the data area.
- *
- *    ---------------------------------
- *    | head     | data    | tail     |
- *    ---------------------------------
- *            ^
- *
- *    silc_buffer_pull(sb, 20);
- *
- ***/
-
-static inline
-unsigned char *silc_buffer_pull(SilcBuffer sb, SilcUInt32 len)
-{
-  unsigned char *old_data = sb->data;
-#if defined(SILC_DEBUG)
-  SILC_ASSERT(len <= silc_buffer_len(sb));
-#else
-  if (silc_unlikely(len > silc_buffer_len(sb)))
-    return NULL;
-#endif
-  sb->data += len;
-  return old_data;
-}
-
-/****f* silcutil/SilcBufferAPI/silc_buffer_push
- *
- * SYNOPSIS
- *
- *    static inline
- *    unsigned char *silc_buffer_push(SilcBuffer sb, SilcUInt32 len);
- *
- * DESCRIPTION
- *
- *    Pushes current data area towards beginning. Length of the currently
- *    valid data area is also incremented. Returns a pointer to the
- *    data area before pushing. Returns NULL on error.
- *
- * EXAMPLE
- *
- *    ---------------------------------
- *    | head     | data    | tail     |
- *    ---------------------------------
- *               ^
- *               Pushes the start of the data area.
- *
- *    ---------------------------------
- *    | head  | data       | tail     |
- *    ---------------------------------
- *               ^
- *
- *    silc_buffer_push(sb, 20);
- *
- ***/
-
-static inline
-unsigned char *silc_buffer_push(SilcBuffer sb, SilcUInt32 len)
-{
-  unsigned char *old_data = sb->data;
-#if defined(SILC_DEBUG)
-  SILC_ASSERT((sb->data - len) >= sb->head);
-#else
-  if (silc_unlikely((sb->data - len) < sb->head))
-    return NULL;
-#endif
-  sb->data -= len;
-  return old_data;
-}
-
-/****f* silcutil/SilcBufferAPI/silc_buffer_pull_tail
- *
- * SYNOPSIS
- *
- *    static inline
- *    unsigned char *silc_buffer_pull_tail(SilcBuffer sb, SilcUInt32 len);
- *
- * DESCRIPTION
- *
- *    Pulls current tail section towards end. Length of the current valid
- *    data area is also incremented. Returns a pointer to the data area
- *    before pulling. Returns NULL on error.
- *
- * EXAMPLE
- *
- *    ---------------------------------
- *    | head  | data       | tail     |
- *    ---------------------------------
- *                         ^
- *                         Pulls the start of the tail section.
- *
- *    ---------------------------------
- *    | head  | data           | tail |
- *    ---------------------------------
- *                         ^
- *
- *    silc_buffer_pull_tail(sb, 23);
- *
- ***/
-
-static inline
-unsigned char *silc_buffer_pull_tail(SilcBuffer sb, SilcUInt32 len)
-{
-  unsigned char *old_tail = sb->tail;
-#if defined(SILC_DEBUG)
-  SILC_ASSERT(len <= silc_buffer_taillen(sb));
-#else
-  if (silc_unlikely(len > silc_buffer_taillen(sb)))
-    return NULL;
-#endif
-  sb->tail += len;
-  return old_tail;
-}
-
-/****f* silcutil/SilcBufferAPI/silc_buffer_push_tail
- *
- * SYNOPSIS
- *
- *    static inline
- *    unsigned char *silc_buffer_push_tail(SilcBuffer sb, SilcUInt32 len);
- *
- * DESCRIPTION
- *
- *    Pushes current tail section towards beginning. Length of the current
- *    valid data area is also decremented. Returns a pointer to the
- *    tail section before pushing. Returns NULL on error.
- *
- * EXAMPLE
- *
- *    ---------------------------------
- *    | head  | data           | tail |
- *    ---------------------------------
- *                             ^
- *                             Pushes the start of the tail section.
- *
- *    ---------------------------------
- *    | head  | data       | tail     |
- *    ---------------------------------
- *                             ^
- *
- *    silc_buffer_push_tail(sb, 23);
- *
- ***/
-
-static inline
-unsigned char *silc_buffer_push_tail(SilcBuffer sb, SilcUInt32 len)
-{
-  unsigned char *old_tail = sb->tail;
-#if defined(SILC_DEBUG)
-  SILC_ASSERT((sb->tail - len) >= sb->data);
-#else
-  if (silc_unlikely((sb->tail - len) < sb->data))
-    return NULL;
-#endif
-  sb->tail -= len;
-  return old_tail;
-}
-
-/****f* silcutil/SilcBufferAPI/silc_buffer_put_head
- *
- * SYNOPSIS
- *
- *    static inline
- *    unsigned char *silc_buffer_put_head(SilcBuffer sb,
- *                                       const unsigned char *data,
- *                                       SilcUInt32 len);
- *
- * DESCRIPTION
- *
- *    Puts data at the head of the buffer. Returns pointer to the copied
- *    data area. Returns NULL on error.
- *
- * EXAMPLE
- *
- *    ---------------------------------
- *    | head  | data       | tail     |
- *    ---------------------------------
- *    ^
- *    Puts data to the head section.
- *
- *    silc_buffer_put_head(sb, data, data_len);
- *
- ***/
-
-static inline
-unsigned char *silc_buffer_put_head(SilcBuffer sb,
-                                   const unsigned char *data,
-                                   SilcUInt32 len)
-{
-#if defined(SILC_DEBUG)
-  SILC_ASSERT(len <= silc_buffer_headlen(sb));
-#else
-  if (silc_unlikely(len > silc_buffer_headlen(sb)))
-    return NULL;
-#endif
-  return (unsigned char *)memcpy(sb->head, data, len);
-}
-
-/****f* silcutil/SilcBufferAPI/silc_buffer_put
- *
- * SYNOPSIS
- *
- *    static inline
- *    unsigned char *silc_buffer_put(SilcBuffer sb,
- *                                  const unsigned char *data,
- *                                  SilcUInt32 len);
- *
- * DESCRIPTION
- *
- *    Puts data at the start of the valid data area. Returns a pointer
- *    to the copied data area.  Returns NULL on error.
- *
- * EXAMPLE
- *
- *    ---------------------------------
- *    | head  | data       | tail     |
- *    ---------------------------------
- *            ^
- *            Puts data to the data section.
- *
- *    silc_buffer_put(sb, data, data_len);
- *
- ***/
-
-static inline
-unsigned char *silc_buffer_put(SilcBuffer sb,
-                              const unsigned char *data,
-                              SilcUInt32 len)
-{
-#if defined(SILC_DEBUG)
-  SILC_ASSERT(len <= silc_buffer_len(sb));
-#else
-  if (silc_unlikely(len > silc_buffer_len(sb)))
-    return NULL;
-#endif
-  return (unsigned char *)memcpy(sb->data, data, len);
-}
-
-/****f* silcutil/SilcBufferAPI/silc_buffer_put_tail
- *
- * SYNOPSIS
- *
- *    static inline
- *    unsigned char *silc_buffer_put_tail(SilcBuffer sb,
- *                                       const unsigned char *data,
- *                                       SilcUInt32 len);
- *
- * DESCRIPTION
- *
- *    Puts data at the tail of the buffer. Returns pointer to the copied
- *    data area.  Returns NULL on error.
- *
- * EXAMPLE
- *
- *    ---------------------------------
- *    | head  | data           | tail |
- *    ---------------------------------
- *                             ^
- *                            Puts data to the tail section.
- *
- *    silc_buffer_put_tail(sb, data, data_len);
- *
- ***/
-
-static inline
-unsigned char *silc_buffer_put_tail(SilcBuffer sb,
-                                   const unsigned char *data,
-                                   SilcUInt32 len)
-{
-#if defined(SILC_DEBUG)
-  SILC_ASSERT(len <= silc_buffer_taillen(sb));
-#else
-  if (silc_unlikely(len > silc_buffer_taillen(sb)))
-    return NULL;
-#endif
-  return (unsigned char *)memcpy(sb->tail, data, len);
-}
-
-/****f* silcutil/SilcBufferAPI/silc_buffer_alloc_size
- *
- * SYNOPSIS
- *
- *    static inline
- *    SilcBuffer silc_buffer_alloc_size(SilcUInt32 len);
- *
- * DESCRIPTION
- *
- *    Allocates `len' bytes size buffer and moves the tail area automatically
- *    `len' bytes so that the buffer is ready to use without calling the
- *    silc_buffer_pull_tail.  Returns NULL on error.
- *
- ***/
-
-static inline
-SilcBuffer silc_buffer_alloc_size(SilcUInt32 len)
-{
-  SilcBuffer sb = silc_buffer_alloc(len);
-  if (silc_unlikely(!sb))
-    return NULL;
-  silc_buffer_pull_tail(sb, len);
-  return sb;
-}
-
-/****f* silcutil/SilcBufferAPI/silc_buffer_reset
- *
- * SYNOPSIS
- *
- *    static inline
- *    void silc_buffer_reset(SilcBuffer sb);
- *
- * DESCRIPTION
- *
- *    Resets the buffer to the state as if it was just allocated by
- *    silc_buffer_alloc.  This does not clear the data area.  Use
- *    silc_buffer_clear if you also want to clear the data area.
- *
- ***/
-
-static inline
-void silc_buffer_reset(SilcBuffer sb)
-{
-  sb->data = sb->tail = sb->head;
-}
-
-/****f* silcutil/SilcBufferAPI/silc_buffer_clear
- *
- * SYNOPSIS
- *
- *    static inline
- *    void silc_buffer_clear(SilcBuffer sb);
- *
- * DESCRIPTION
- *
- *    Clears and initialiazes the buffer to the state as if it was just
- *    allocated by silc_buffer_alloc.
- *
- ***/
-
-static inline
-void silc_buffer_clear(SilcBuffer sb)
-{
-  memset(sb->head, 0, silc_buffer_truelen(sb));
-  silc_buffer_reset(sb);
-}
-
-/****f* silcutil/SilcBufferAPI/silc_buffer_start
- *
- * SYNOPSIS
- *
- *    static inline
- *    void silc_buffer_start(SilcBuffer sb);
- *
- * DESCRIPTION
- *
- *    Moves the data area at the start of the buffer.  The tail area remains
- *    as is.
- *
- ***/
-
-static inline
-void silc_buffer_start(SilcBuffer sb)
-{
-  sb->data = sb->head;
-}
-
-/****f* silcutil/SilcBufferAPI/silc_buffer_end
- *
- * SYNOPSIS
- *
- *    static inline
- *    void silc_buffer_end(SilcBuffer sb);
- *
- * DESCRIPTION
- *
- *    Moves the end of the data area to the end of the buffer.  The start
- *    of the data area remains same.  If the start of data area is at the
- *    start of the buffer, after this function returns the buffer's data
- *    area length is the length of the entire buffer.
- *
- ***/
-
-static inline
-void silc_buffer_end(SilcBuffer sb)
-{
-  sb->tail = sb->end;
-}
-
-/****f* silcutil/SilcBufferAPI/silc_buffer_copy
- *
- * SYNOPSIS
- *
- *    static inline
- *    SilcBuffer silc_buffer_copy(SilcBuffer sb);
- *
- * DESCRIPTION
- *
- *    Generates copy of a SilcBuffer. This copies everything inside the
- *    currently valid data area, nothing more. Use silc_buffer_clone to
- *    copy entire buffer.  Returns NULL on error.
- *
- ***/
-
-static inline
-SilcBuffer silc_buffer_copy(SilcBuffer sb)
-{
-  SilcBuffer sb_new;
-
-  sb_new = silc_buffer_alloc_size(silc_buffer_len(sb));
-  if (silc_unlikely(!sb_new))
-    return NULL;
-  silc_buffer_put(sb_new, sb->data, silc_buffer_len(sb));
-
-  return sb_new;
-}
-
-/****f* silcutil/SilcBufferAPI/silc_buffer_clone
- *
- * SYNOPSIS
- *
- *    static inline
- *    SilcBuffer silc_buffer_clone(SilcBuffer sb);
- *
- * DESCRIPTION
- *
- *    Clones SilcBuffer. This generates new SilcBuffer and copies
- *    everything from the source buffer. The result is exact clone of
- *    the original buffer.  Returns NULL on error.
- *
- ***/
-
-static inline
-SilcBuffer silc_buffer_clone(SilcBuffer sb)
-{
-  SilcBuffer sb_new;
-
-  sb_new = silc_buffer_alloc_size(silc_buffer_truelen(sb));
-  if (silc_unlikely(!sb_new))
-    return NULL;
-  silc_buffer_put(sb_new, sb->head, silc_buffer_truelen(sb));
-  sb_new->data = sb_new->head + silc_buffer_headlen(sb);
-  sb_new->tail = sb_new->data + silc_buffer_len(sb);
-
-  return sb_new;
-}
-
-/****f* silcutil/SilcBufferAPI/silc_buffer_realloc
- *
- * SYNOPSIS
- *
- *    static inline
- *    SilcBuffer silc_buffer_realloc(SilcBuffer sb, SilcUInt32 newsize);
- *
- * DESCRIPTION
- *
- *    Reallocates buffer. Old data is saved into the new buffer. The buffer
- *    is exact clone of the old one except that there is now more space
- *    at the end of buffer.  This always returns the same `sb' unless `sb'
- *    was NULL. Returns NULL on error.
- *
- ***/
-
-static inline
-SilcBuffer silc_buffer_realloc(SilcBuffer sb, SilcUInt32 newsize)
-{
-  SilcUInt32 hlen, dlen;
-  unsigned char *h;
-
-  if (!sb)
-    return silc_buffer_alloc(newsize);
-
-  if (silc_unlikely(newsize <= silc_buffer_truelen(sb)))
-    return sb;
-
-  hlen = silc_buffer_headlen(sb);
-  dlen = silc_buffer_len(sb);
-  h = (unsigned char *)silc_realloc(sb->head, newsize);
-  if (silc_unlikely(!h))
-    return NULL;
-  sb->head = h;
-  sb->data = sb->head + hlen;
-  sb->tail = sb->data + dlen;
-  sb->end = sb->head + newsize;
-
-  return sb;
-}
-
-/****f* silcutil/SilcBufferAPI/silc_buffer_realloc_size
- *
- * SYNOPSIS
- *
- *    static inline
- *    SilcBuffer silc_buffer_realloc_size(SilcBuffer sb, SilcUInt32 newsize);
- *
- * DESCRIPTION
- *
- *    Same as silc_buffer_realloc but moves moves the tail area
- *    automatically so that the buffer is ready to use without calling the
- *    silc_buffer_pull_tail.  Returns NULL on error.
- *
- ***/
-
-static inline
-SilcBuffer silc_buffer_realloc_size(SilcBuffer sb, SilcUInt32 newsize)
-{
-  sb = silc_buffer_realloc(sb, newsize);
-  if (silc_unlikely(!sb))
-    return NULL;
-  silc_buffer_pull_tail(sb, silc_buffer_taillen(sb));
-  return sb;
-}
-
-/****f* silcutil/SilcBufferAPI/silc_buffer_enlarge
- *
- * SYNOPSIS
- *
- *    static inline
- *    SilcBuffer silc_buffer_enlarge(SilcBuffer sb, SilcUInt32 size);
- *
- * DESCRIPTION
- *
- *    Enlarges the buffer by the amount of `size' if it doesn't have that
- *    must space in the data area and in the tail area.  Moves the tail
- *    area automatically after enlarging so that the current data area
- *    is at least the size of `size'.  If there is more space than `size'
- *    in the data area this does not do anything.  If there is enough
- *    space in the tail area this merely moves the tail area to reveal
- *    the extra space.  Returns FALSE on error.
- *
- ***/
-
-static inline
-SilcBool silc_buffer_enlarge(SilcBuffer sb, SilcUInt32 size)
-{
-  if (size > silc_buffer_len(sb)) {
-    if (size > silc_buffer_taillen(sb) + silc_buffer_len(sb))
-      if (silc_unlikely(!silc_buffer_realloc(sb, silc_buffer_truelen(sb) +
-                                            (size - silc_buffer_taillen(sb) -
-                                             silc_buffer_len(sb)))))
-       return FALSE;
-    silc_buffer_pull_tail(sb, size - silc_buffer_len(sb));
-  }
-  return TRUE;
-}
-
-
-/* SilcStack aware SilcBuffer routines */
-
-/****f* silcutil/SilcBufferAPI/silc_buffer_salloc
- *
- * SYNOPSIS
- *
- *    static inline
- *    SilcBuffer silc_buffer_salloc(SilcStack stack, SilcUInt32 len);
- *
- * DESCRIPTION
- *
- *    Allocates new SilcBuffer and returns it.
- *
- *    This routine use SilcStack are memory source.  If `stack' is NULL
- *    reverts back to normal allocating routine.
- *
- ***/
-
-static inline
-SilcBuffer silc_buffer_salloc(SilcStack stack, SilcUInt32 len)
-{
-  SilcBuffer sb;
-
-  if (!stack)
-    return silc_buffer_alloc(len);
-
-  /* Allocate new SilcBuffer */
-  sb = (SilcBuffer)silc_scalloc(stack, 1, sizeof(*sb));
-  if (silc_unlikely(!sb))
-    return NULL;
-
-  /* Allocate the actual data area */
-  sb->head = (unsigned char *)silc_smalloc(stack, len);
-  if (silc_unlikely(!sb->head))
-    return NULL;
-
-  /* Set pointers to the new buffer */
-  sb->data = sb->head;
-  sb->tail = sb->head;
-  sb->end = sb->head + len;
-
-  return sb;
-}
-
-/****f* silcutil/SilcBufferAPI/silc_buffer_salloc_size
- *
- * SYNOPSIS
- *
- *    static inline
- *    SilcBuffer silc_buffer_salloc_size(SilcStack stack, SilcUInt32 len);
- *
- * DESCRIPTION
- *
- *    Allocates `len' bytes size buffer and moves the tail area automatically
- *    `len' bytes so that the buffer is ready to use without calling the
- *    silc_buffer_pull_tail.
- *
- *    This routine use SilcStack are memory source.  If `stack' is NULL
- *    reverts back to normal allocating routine.
- *
- ***/
-
-static inline
-SilcBuffer silc_buffer_salloc_size(SilcStack stack, SilcUInt32 len)
-{
-  SilcBuffer sb = silc_buffer_salloc(stack, len);
-  if (silc_unlikely(!sb))
-    return NULL;
-  silc_buffer_pull_tail(sb, len);
-  return sb;
-}
-
-/****f* silcutil/SilcBufferAPI/silc_buffer_srealloc
- *
- * SYNOPSIS
- *
- *    static inline
- *    SilcBuffer silc_buffer_srealloc(SilcStack stack,
- *                                    SilcBuffer sb, SilcUInt32 newsize);
- *
- * DESCRIPTION
- *
- *    Reallocates buffer. Old data is saved into the new buffer. The buffer
- *    is exact clone of the old one except that there is now more space
- *    at the end of buffer.
- *
- *    This routine use SilcStack are memory source.  If `stack' is NULL
- *    reverts back to normal allocating routine.
- *
- ***/
-
-static inline
-SilcBuffer silc_buffer_srealloc(SilcStack stack,
-                               SilcBuffer sb, SilcUInt32 newsize)
-{
-  SilcUInt32 hlen, dlen;
-  unsigned char *h;
-
-  if (!stack)
-    return silc_buffer_realloc(sb, newsize);
-
-  if (!sb)
-    return silc_buffer_salloc(stack, newsize);
-
-  if (newsize <= silc_buffer_truelen(sb))
-    return sb;
-
-  hlen = silc_buffer_headlen(sb);
-  dlen = silc_buffer_len(sb);
-  h = (unsigned char *)silc_srealloc(stack, silc_buffer_truelen(sb),
-                                    sb->head, newsize);
-  if (!h) {
-    /* Do slow and stack wasting realloc.  The old sb->head is lost and
-       is freed eventually. */
-    h = (unsigned char *)silc_smalloc(stack, newsize);
-    if (silc_unlikely(!h))
-      return NULL;
-    memcpy(h, sb->head, silc_buffer_truelen(sb));
-  }
-
-  sb->head = h;
-  sb->data = sb->head + hlen;
-  sb->tail = sb->data + dlen;
-  sb->end = sb->head + newsize;
-
-  return sb;
-}
-
-/****f* silcutil/SilcBufferAPI/silc_buffer_srealloc_size
- *
- * SYNOPSIS
- *
- *    static inline
- *    SilcBuffer silc_buffer_srealloc_size(SilcStack stack,
- *                                         SilcBuffer sb, SilcUInt32 newsize);
- *
- * DESCRIPTION
- *
- *    Same as silc_buffer_srealloc but moves moves the tail area
- *    automatically so that the buffer is ready to use without calling the
- *    silc_buffer_pull_tail.
- *
- *    This routine use SilcStack are memory source.  If `stack' is NULL
- *    reverts back to normal allocating routine.
- *
- ***/
-
-static inline
-SilcBuffer silc_buffer_srealloc_size(SilcStack stack,
-                                    SilcBuffer sb, SilcUInt32 newsize)
-{
-  sb = silc_buffer_srealloc(stack, sb, newsize);
-  if (silc_unlikely(!sb))
-    return NULL;
-  silc_buffer_pull_tail(sb, silc_buffer_taillen(sb));
-  return sb;
-}
-
-/****f* silcutil/SilcBufferAPI/silc_buffer_senlarge
- *
- * SYNOPSIS
- *
- *    static inline
- *    SilcBuffer silc_buffer_senlarge(SilcStack stack, SilcBuffer sb,
- *                                    SilcUInt32 size);
- *
- * DESCRIPTION
- *
- *    Enlarges the buffer by the amount of `size' if it doesn't have that
- *    must space in the data area and in the tail area.  Moves the tail
- *    area automatically after enlarging so that the current data area
- *    is at least the size of `size'.  If there is more space than `size'
- *    in the data area this does not do anything.  If there is enough
- *    space in the tail area this merely moves the tail area to reveal
- *    the extra space.  Returns FALSE on error.
- *
- *    This routine use SilcStack are memory source.  If `stack' is NULL
- *    reverts back to normal allocating routine.
- *
- ***/
-
-static inline
-SilcBool silc_buffer_senlarge(SilcStack stack, SilcBuffer sb, SilcUInt32 size)
-{
-  if (size > silc_buffer_len(sb)) {
-    if (size > silc_buffer_taillen(sb) + silc_buffer_len(sb))
-      if (silc_unlikely(!silc_buffer_srealloc(stack, sb,
-                                             silc_buffer_truelen(sb) +
-                                             (size - silc_buffer_taillen(sb) -
-                                              silc_buffer_len(sb)))))
-       return FALSE;
-    silc_buffer_pull_tail(sb, size - silc_buffer_len(sb));
-  }
-  return TRUE;
-}
-
-/****f* silcutil/SilcBufferAPI/silc_buffer_scopy
- *
- * SYNOPSIS
- *
- *    static inline
- *    SilcBuffer silc_buffer_scopy(SilcStack stack, SilcBuffer sb);
- *
- * DESCRIPTION
- *
- *    Generates copy of a SilcBuffer. This copies everything inside the
- *    currently valid data area, nothing more. Use silc_buffer_clone to
- *    copy entire buffer.
- *
- *    This routine use SilcStack are memory source.  If `stack' is NULL
- *    reverts back to normal allocating routine.
- *
- ***/
-
-static inline
-SilcBuffer silc_buffer_scopy(SilcStack stack, SilcBuffer sb)
-{
-  SilcBuffer sb_new;
-
-  sb_new = silc_buffer_salloc_size(stack, silc_buffer_len(sb));
-  if (silc_unlikely(!sb_new))
-    return NULL;
-  silc_buffer_put(sb_new, sb->data, silc_buffer_len(sb));
-
-  return sb_new;
-}
-
-/****f* silcutil/SilcBufferAPI/silc_buffer_sclone
- *
- * SYNOPSIS
- *
- *    static inline
- *    SilcBuffer silc_buffer_sclone(SilcStack stack, SilcBuffer sb);
- *
- * DESCRIPTION
- *
- *    Clones SilcBuffer. This generates new SilcBuffer and copies
- *    everything from the source buffer. The result is exact clone of
- *    the original buffer.
- *
- *    This routine use SilcStack are memory source.  If `stack' is NULL
- *    reverts back to normal allocating routine.
- *
- ***/
-
-static inline
-SilcBuffer silc_buffer_sclone(SilcStack stack, SilcBuffer sb)
-{
-  SilcBuffer sb_new;
-
-  sb_new = silc_buffer_salloc_size(stack, silc_buffer_truelen(sb));
-  if (silc_unlikely(!sb_new))
-    return NULL;
-  silc_buffer_put(sb_new, sb->head, silc_buffer_truelen(sb));
-  sb_new->data = sb_new->head + silc_buffer_headlen(sb);
-  sb_new->tail = sb_new->data + silc_buffer_len(sb);
-
-  return sb_new;
-}
-
-#endif /* SILCBUFFER_H */
diff --git a/lib/silcutil/silcbuffmt.c b/lib/silcutil/silcbuffmt.c
deleted file mode 100644 (file)
index 98836b6..0000000
+++ /dev/null
@@ -1,778 +0,0 @@
-/*
-
-  silcbuffmt.c
-
-  Author: Pekka Riikonen <priikone@silcnet.org>
-
-  Copyright (C) 1997 - 2007 Pekka Riikonen
-
-  This program is free software; you can redistribute it and/or modify
-  it under the terms of the GNU General Public License as published by
-  the Free Software Foundation; version 2 of the License.
-
-  This program is distributed in the hope that it will be useful,
-  but WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-  GNU General Public License for more details.
-
-*/
-/* $Id$ */
-
-#include "silc.h"
-
-/************************** Types and definitions ***************************/
-
-/* Check that buffer has enough room to format data in it, if not
-   allocate more. */
-#define FORMAT_HAS_SPACE(s, b, req)                    \
-do {                                                   \
-  if (silc_unlikely(!silc_buffer_senlarge(s, b, req))) \
-    goto fail;                                         \
-  flen += req;                                         \
-} while(0)
-
-/* Check that there is data to be unformatted */
-#define UNFORMAT_HAS_SPACE(b, req)             \
-do {                                           \
-  if (silc_unlikely(req > silc_buffer_len(b))) \
-    goto fail;                                 \
-  if (silc_unlikely((req + 1) <= 0))           \
-    goto fail;                                 \
-} while(0)
-
-
-/******************************* Formatting *********************************/
-
-int silc_buffer_format(SilcBuffer dst, ...)
-{
-  va_list ap;
-  int ret;
-
-  va_start(ap, dst);
-  ret = silc_buffer_sformat_vp(NULL, dst, ap);
-  va_end(ap);
-
-  return ret;
-}
-
-int silc_buffer_format_vp(SilcBuffer dst, va_list ap)
-{
-  return silc_buffer_sformat_vp(NULL, dst, ap);
-}
-
-int silc_buffer_sformat(SilcStack stack, SilcBuffer dst, ...)
-{
-  va_list ap;
-  int ret;
-
-  va_start(ap, dst);
-  ret = silc_buffer_sformat_vp(stack, dst, ap);
-  va_end(ap);
-
-  return ret;
-}
-
-int silc_buffer_sformat_vp(SilcStack stack, SilcBuffer dst, va_list ap)
-{
-  SilcBufferParamType fmt;
-  int flen = 0;
-  SilcBool advance = FALSE;
-
-  /* Parse the arguments by formatting type. */
-  while (1) {
-    fmt = va_arg(ap, SilcBufferParamType);
-
-    switch(fmt) {
-    case SILC_PARAM_FUNC:
-      {
-       SilcBufferFormatFunc func = NULL;
-       SilcBufferSFormatFunc funcs = NULL;
-       void *val;
-       void *context;
-       int tmp_len;
-       if (!stack)
-         func = va_arg(ap, SilcBufferFormatFunc);
-       else
-         funcs = va_arg(ap, SilcBufferSFormatFunc);
-       val = va_arg(ap, void *);
-       context = va_arg(ap, void *);
-       if (!stack)
-         tmp_len = func(dst, val, context);
-       else
-         tmp_len = funcs(stack, dst, val, context);
-       if (tmp_len < 0)
-         goto fail;
-       if (tmp_len) {
-         silc_buffer_pull(dst, tmp_len);
-         flen += tmp_len;
-       }
-      }
-      break;
-    case SILC_PARAM_UI8_STRING:
-    case SILC_PARAM_UI16_STRING:
-    case SILC_PARAM_UI32_STRING:
-    case SILC_PARAM_UI8_STRING_ALLOC:
-    case SILC_PARAM_UI16_STRING_ALLOC:
-    case SILC_PARAM_UI32_STRING_ALLOC:
-      {
-       unsigned char *x = va_arg(ap, unsigned char *);
-       SilcUInt32 tmp_len = x ? strlen(x) : 0;
-       if (x && tmp_len) {
-         FORMAT_HAS_SPACE(stack, dst, tmp_len);
-         silc_buffer_put(dst, x, tmp_len);
-         silc_buffer_pull(dst, tmp_len);
-       }
-       break;
-      }
-    case SILC_PARAM_UI8_NSTRING:
-    case SILC_PARAM_UI16_NSTRING:
-    case SILC_PARAM_UI32_NSTRING:
-    case SILC_PARAM_UI_XNSTRING:
-    case SILC_PARAM_DATA:
-    case SILC_PARAM_UI8_NSTRING_ALLOC:
-    case SILC_PARAM_UI16_NSTRING_ALLOC:
-    case SILC_PARAM_UI32_NSTRING_ALLOC:
-    case SILC_PARAM_UI_XNSTRING_ALLOC:
-    case SILC_PARAM_DATA_ALLOC:
-      {
-       unsigned char *x = va_arg(ap, unsigned char *);
-       SilcUInt32 tmp_len = va_arg(ap, SilcUInt32);
-       if (x && tmp_len) {
-         FORMAT_HAS_SPACE(stack, dst, tmp_len);
-         silc_buffer_put(dst, x, tmp_len);
-         silc_buffer_pull(dst, tmp_len);
-       }
-       break;
-      }
-    case SILC_PARAM_UI8_CHAR:
-      {
-       unsigned char x = (unsigned char)va_arg(ap, int);
-       FORMAT_HAS_SPACE(stack, dst, 1);
-       silc_buffer_put(dst, &x, 1);
-       silc_buffer_pull(dst, 1);
-       break;
-      }
-    case SILC_PARAM_UI16_SHORT:
-      {
-       unsigned char xf[2];
-       SilcUInt16 x = (SilcUInt16)va_arg(ap, int);
-       FORMAT_HAS_SPACE(stack, dst, 2);
-       SILC_PUT16_MSB(x, xf);
-       silc_buffer_put(dst, xf, 2);
-       silc_buffer_pull(dst, 2);
-       break;
-      }
-    case SILC_PARAM_UI32_INT:
-      {
-       unsigned char xf[4];
-       SilcUInt32 x = va_arg(ap, SilcUInt32);
-       FORMAT_HAS_SPACE(stack, dst, 4);
-       SILC_PUT32_MSB(x, xf);
-       silc_buffer_put(dst, xf, 4);
-       silc_buffer_pull(dst, 4);
-       break;
-      }
-    case SILC_PARAM_UI64_INT:
-      {
-       unsigned char xf[8];
-       SilcUInt64 x = va_arg(ap, SilcUInt64);
-       FORMAT_HAS_SPACE(stack, dst, sizeof(SilcUInt64));
-       SILC_PUT64_MSB(x, xf);
-       silc_buffer_put(dst, xf, sizeof(SilcUInt64));
-       silc_buffer_pull(dst, sizeof(SilcUInt64));
-       break;
-      }
-    case SILC_PARAM_SI8_CHAR:
-      {
-       char x = (char)va_arg(ap, int);
-       FORMAT_HAS_SPACE(stack, dst, 1);
-       silc_buffer_put(dst, &x, 1);
-       silc_buffer_pull(dst, 1);
-       break;
-      }
-    case SILC_PARAM_SI16_SHORT:
-      {
-       unsigned char xf[2];
-       SilcInt16 x = (SilcInt16)va_arg(ap, int);
-       FORMAT_HAS_SPACE(stack, dst, 2);
-       SILC_PUT16_MSB(x, xf);
-       silc_buffer_put(dst, xf, 2);
-       silc_buffer_pull(dst, 2);
-       break;
-      }
-    case SILC_PARAM_SI32_INT:
-      {
-       unsigned char xf[4];
-       SilcInt32 x = va_arg(ap, SilcInt32);
-       FORMAT_HAS_SPACE(stack, dst, 4);
-       SILC_PUT32_MSB(x, xf);
-       silc_buffer_put(dst, xf, 4);
-       silc_buffer_pull(dst, 4);
-       break;
-      }
-    case SILC_PARAM_SI64_INT:
-      {
-       unsigned char xf[8];
-       SilcInt64 x = va_arg(ap, SilcInt64);
-       FORMAT_HAS_SPACE(stack, dst, sizeof(SilcInt64));
-       SILC_PUT64_MSB(x, xf);
-       silc_buffer_put(dst, xf, sizeof(SilcInt64));
-       silc_buffer_pull(dst, sizeof(SilcInt64));
-       break;
-      }
-    case SILC_PARAM_BUFFER:
-    case SILC_PARAM_BUFFER_ALLOC:
-      {
-       SilcBuffer x = va_arg(ap, SilcBuffer);
-       unsigned char xf[4];
-       if (x && silc_buffer_len(x)) {
-         FORMAT_HAS_SPACE(stack, dst, silc_buffer_len(x) + 4);
-         SILC_PUT32_MSB(silc_buffer_len(x), xf);
-         silc_buffer_put(dst, xf, 4);
-         silc_buffer_pull(dst, 4);
-         silc_buffer_put(dst, silc_buffer_data(x), silc_buffer_len(x));
-         silc_buffer_pull(dst, silc_buffer_len(x));
-       }
-      }
-      break;
-    case SILC_PARAM_OFFSET:
-      {
-       int offst = va_arg(ap, int);
-       if (!offst)
-         break;
-       if (offst > 1) {
-         if (offst > silc_buffer_len(dst))
-           goto fail;
-         silc_buffer_pull(dst, offst);
-         flen += offst;
-       } else {
-         silc_buffer_push(dst, -(offst));
-         flen += -(offst);
-       }
-       break;
-      }
-    case SILC_PARAM_ADVANCE:
-      advance = TRUE;
-      break;
-    case SILC_PARAM_END:
-      goto ok;
-      break;
-    default:
-      SILC_LOG_DEBUG(("Bad buffer formatting type `%d'. Could not "
-                     "format the data.", fmt));
-      goto fail;
-      break;
-    }
-  }
-
- fail:
-  SILC_LOG_DEBUG(("Error occured while formatting data"));
-  if (!advance)
-    silc_buffer_push(dst, flen);
-  return -1;
-
- ok:
-  /* Push the buffer back to where it belongs. */
-  if (!advance)
-    silc_buffer_push(dst, flen);
-  return flen;
-}
-
-
-/****************************** Unformatting ********************************/
-
-int silc_buffer_unformat(SilcBuffer src, ...)
-{
-  va_list ap;
-  int ret;
-
-  va_start(ap, src);
-  ret = silc_buffer_sunformat_vp(NULL, src, ap);
-  va_end(ap);
-
-  return ret;
-}
-
-int silc_buffer_unformat_vp(SilcBuffer src, va_list ap)
-{
-  return silc_buffer_sunformat_vp(NULL, src, ap);
-}
-
-int silc_buffer_sunformat(SilcStack stack, SilcBuffer src, ...)
-{
-  va_list ap;
-  int ret;
-
-  va_start(ap, src);
-  ret = silc_buffer_sunformat_vp(stack, src, ap);
-  va_end(ap);
-
-  return ret;
-}
-
-int silc_buffer_sunformat_vp(SilcStack stack, SilcBuffer src, va_list ap)
-{
-  SilcBufferParamType fmt;
-  unsigned char *start_ptr = src->data;
-  int len = 0;
-  SilcBool advance = FALSE;
-
-  /* Parse the arguments by formatting type. */
-  while(1) {
-    fmt = va_arg(ap, SilcBufferParamType);
-
-    switch(fmt) {
-    case SILC_PARAM_FUNC:
-      {
-       SilcBufferUnformatFunc func = NULL;
-       SilcBufferSUnformatFunc funcs = NULL;
-       void **val;
-       void *context;
-       int tmp_len;
-       if (!stack)
-         func = va_arg(ap, SilcBufferUnformatFunc);
-       else
-         funcs = va_arg(ap, SilcBufferSUnformatFunc);
-       val = va_arg(ap, void **);
-       context = va_arg(ap, void *);
-       if (!stack)
-         tmp_len = func(src, val, context);
-       else
-         tmp_len = funcs(stack, src, val, context);
-       if (tmp_len < 0)
-         goto fail;
-       if (tmp_len) {
-         UNFORMAT_HAS_SPACE(src, tmp_len);
-         silc_buffer_pull(src, tmp_len);
-       }
-      }
-    case SILC_PARAM_UI_XNSTRING:
-    case SILC_PARAM_DATA:
-      {
-       unsigned char **x = va_arg(ap, unsigned char **);
-       SilcUInt32 len2 = va_arg(ap, SilcUInt32);
-       UNFORMAT_HAS_SPACE(src, len2);
-       if (silc_likely(len2 && x))
-         *x = src->data;
-       silc_buffer_pull(src, len2);
-       break;
-      }
-    case SILC_PARAM_UI_XNSTRING_ALLOC:
-    case SILC_PARAM_DATA_ALLOC:
-      {
-       unsigned char **x = va_arg(ap, unsigned char **);
-       SilcUInt32 len2 = va_arg(ap, SilcUInt32);
-       UNFORMAT_HAS_SPACE(src, len2);
-       if (silc_likely(len2 && x)) {
-         *x = silc_scalloc(stack, len2 + 1, sizeof(unsigned char));
-         if (*x)
-           memcpy(*x, src->data, len2);
-       }
-       silc_buffer_pull(src, len2);
-       break;
-      }
-    case SILC_PARAM_UI8_CHAR:
-      {
-       unsigned char *x = va_arg(ap, unsigned char *);
-       UNFORMAT_HAS_SPACE(src, 1);
-       if (silc_likely(x))
-         *x = src->data[0];
-       silc_buffer_pull(src, 1);
-       break;
-      }
-    case SILC_PARAM_UI16_SHORT:
-      {
-       SilcUInt16 *x = va_arg(ap, SilcUInt16 *);
-       UNFORMAT_HAS_SPACE(src, 2);
-       if (silc_likely(x))
-         SILC_GET16_MSB(*x, src->data);
-       silc_buffer_pull(src, 2);
-       break;
-      }
-    case SILC_PARAM_UI32_INT:
-      {
-       SilcUInt32 *x = va_arg(ap, SilcUInt32 *);
-       UNFORMAT_HAS_SPACE(src, 4);
-       if (silc_likely(x))
-         SILC_GET32_MSB(*x, src->data);
-       silc_buffer_pull(src, 4);
-       break;
-      }
-    case SILC_PARAM_UI64_INT:
-      {
-       SilcUInt64 *x = va_arg(ap, SilcUInt64 *);
-       UNFORMAT_HAS_SPACE(src, sizeof(SilcUInt64));
-       if (silc_likely(x))
-         SILC_GET64_MSB(*x, src->data);
-       silc_buffer_pull(src, sizeof(SilcUInt64));
-       break;
-      }
-    case SILC_PARAM_SI8_CHAR:
-      {
-       char *x = va_arg(ap, char *);
-       UNFORMAT_HAS_SPACE(src, 1);
-       if (silc_likely(x))
-         *x = src->data[0];
-       silc_buffer_pull(src, 1);
-       break;
-      }
-    case SILC_PARAM_SI16_SHORT:
-      {
-       SilcInt16 *x = va_arg(ap, SilcInt16 *);
-       UNFORMAT_HAS_SPACE(src, 2);
-       if (silc_likely(x))
-         SILC_GET16_MSB(*x, src->data);
-       silc_buffer_pull(src, 2);
-       break;
-      }
-    case SILC_PARAM_SI32_INT:
-      {
-       SilcInt32 *x = va_arg(ap, SilcInt32 *);
-       UNFORMAT_HAS_SPACE(src, 4);
-       if (silc_likely(x))
-         SILC_GET32_MSB(*x, src->data);
-       silc_buffer_pull(src, 4);
-       break;
-      }
-    case SILC_PARAM_SI64_INT:
-      {
-       SilcInt64 *x = va_arg(ap, SilcInt64 *);
-       UNFORMAT_HAS_SPACE(src, sizeof(SilcInt64));
-       if (silc_likely(x))
-         SILC_GET64_MSB(*x, src->data);
-       silc_buffer_pull(src, sizeof(SilcInt64));
-       break;
-      }
-    case SILC_PARAM_UI8_STRING:
-      {
-       SilcUInt8 len2;
-       unsigned char **x = va_arg(ap, unsigned char **);
-       UNFORMAT_HAS_SPACE(src, 1);
-       len2 = (SilcUInt8)src->data[0];
-       silc_buffer_pull(src, 1);
-       UNFORMAT_HAS_SPACE(src, len2);
-       if (silc_likely(x))
-         *x = src->data;
-       silc_buffer_pull(src, len2);
-       break;
-      }
-    case SILC_PARAM_UI16_STRING:
-      {
-       SilcUInt16 len2;
-       unsigned char **x = va_arg(ap, unsigned char **);
-       UNFORMAT_HAS_SPACE(src, 2);
-       SILC_GET16_MSB(len2, src->data);
-       silc_buffer_pull(src, 2);
-       UNFORMAT_HAS_SPACE(src, len2);
-       if (silc_likely(x))
-         *x = src->data;
-       silc_buffer_pull(src, len2);
-       break;
-      }
-    case SILC_PARAM_UI8_STRING_ALLOC:
-      {
-       SilcUInt8 len2;
-       unsigned char **x = va_arg(ap, unsigned char **);
-       UNFORMAT_HAS_SPACE(src, 1);
-       len2 = (SilcUInt8)src->data[0];
-       silc_buffer_pull(src, 1);
-       UNFORMAT_HAS_SPACE(src, len2);
-       if (silc_likely(x && len2)) {
-         *x = silc_scalloc(stack, len2 + 1, sizeof(unsigned char));
-         if (*x)
-           memcpy(*x, src->data, len2);
-       }
-       silc_buffer_pull(src, len2);
-       break;
-      }
-    case SILC_PARAM_UI16_STRING_ALLOC:
-      {
-       SilcUInt16 len2;
-       unsigned char **x = va_arg(ap, unsigned char **);
-       UNFORMAT_HAS_SPACE(src, 2);
-       SILC_GET16_MSB(len2, src->data);
-       silc_buffer_pull(src, 2);
-       UNFORMAT_HAS_SPACE(src, len2);
-       if (silc_likely(x && len2)) {
-         *x = silc_scalloc(stack, len2 + 1, sizeof(unsigned char));
-         if (*x)
-           memcpy(*x, src->data, len2);
-       }
-       silc_buffer_pull(src, len2);
-       break;
-      }
-    case SILC_PARAM_UI32_STRING:
-      {
-       SilcUInt32 len2;
-       unsigned char **x = va_arg(ap, unsigned char **);
-       UNFORMAT_HAS_SPACE(src, 4);
-       SILC_GET32_MSB(len2, src->data);
-       silc_buffer_pull(src, 4);
-       UNFORMAT_HAS_SPACE(src, len2);
-       if (silc_likely(x))
-         *x = src->data;
-       silc_buffer_pull(src, len2);
-       break;
-      }
-    case SILC_PARAM_UI32_STRING_ALLOC:
-      {
-       SilcUInt32 len2;
-       unsigned char **x = va_arg(ap, unsigned char **);
-       UNFORMAT_HAS_SPACE(src, 4);
-       SILC_GET32_MSB(len2, src->data);
-       silc_buffer_pull(src, 4);
-       UNFORMAT_HAS_SPACE(src, len2);
-       if (silc_likely(x && len2)) {
-         *x = silc_scalloc(stack, len2 + 1, sizeof(unsigned char));
-         if (*x)
-           memcpy(*x, src->data, len2);
-       }
-       silc_buffer_pull(src, len2);
-       break;
-      }
-    case SILC_PARAM_UI8_NSTRING:
-      {
-       SilcUInt8 len2;
-       unsigned char **x = va_arg(ap, unsigned char **);
-       SilcUInt8 *len3 = va_arg(ap, SilcUInt8 *);
-       UNFORMAT_HAS_SPACE(src, 1);
-       len2 = (SilcUInt8)src->data[0];
-       silc_buffer_pull(src, 1);
-       UNFORMAT_HAS_SPACE(src, len2);
-       if (len3)
-         *len3 = len2;
-       if (x)
-         *x = src->data;
-       silc_buffer_pull(src, len2);
-       break;
-      }
-    case SILC_PARAM_UI16_NSTRING:
-      {
-       SilcUInt16 len2;
-       unsigned char **x = va_arg(ap, unsigned char **);
-       SilcUInt16 *len3 = va_arg(ap, SilcUInt16 *);
-       UNFORMAT_HAS_SPACE(src, 2);
-       SILC_GET16_MSB(len2, src->data);
-       silc_buffer_pull(src, 2);
-       UNFORMAT_HAS_SPACE(src, len2);
-       if (len3)
-         *len3 = len2;
-       if (x)
-         *x = src->data;
-       silc_buffer_pull(src, len2);
-       break;
-      }
-    case SILC_PARAM_UI8_NSTRING_ALLOC:
-      {
-       SilcUInt8 len2;
-       unsigned char **x = va_arg(ap, unsigned char **);
-       SilcUInt8 *len3 = va_arg(ap, SilcUInt8 *);
-       UNFORMAT_HAS_SPACE(src, 1);
-       len2 = (SilcUInt8)src->data[0];
-       silc_buffer_pull(src, 1);
-       UNFORMAT_HAS_SPACE(src, len2);
-       if (len3)
-         *len3 = len2;
-       if (x && len2) {
-         *x = silc_scalloc(stack, len2 + 1, sizeof(unsigned char));
-         if (*x)
-           memcpy(*x, src->data, len2);
-       }
-       silc_buffer_pull(src, len2);
-       break;
-      }
-    case SILC_PARAM_UI16_NSTRING_ALLOC:
-      {
-       SilcUInt16 len2;
-       unsigned char **x = va_arg(ap, unsigned char **);
-       SilcUInt16 *len3 = va_arg(ap, SilcUInt16 *);
-       UNFORMAT_HAS_SPACE(src, 2);
-       SILC_GET16_MSB(len2, src->data);
-       silc_buffer_pull(src, 2);
-       UNFORMAT_HAS_SPACE(src, len2);
-       if (len3)
-         *len3 = len2;
-       if (x && len2) {
-         *x = silc_scalloc(stack, len2 + 1, sizeof(unsigned char));
-         if (*x)
-           memcpy(*x, src->data, len2);
-       }
-       silc_buffer_pull(src, len2);
-       break;
-      }
-    case SILC_PARAM_UI32_NSTRING:
-      {
-       SilcUInt32 len2;
-       unsigned char **x = va_arg(ap, unsigned char **);
-       SilcUInt32 *len3 = va_arg(ap, SilcUInt32 *);
-       UNFORMAT_HAS_SPACE(src, 4);
-       SILC_GET32_MSB(len2, src->data);
-       silc_buffer_pull(src, 4);
-       UNFORMAT_HAS_SPACE(src, len2);
-       if (len3)
-         *len3 = len2;
-       if (x)
-         *x = src->data;
-       silc_buffer_pull(src, len2);
-       break;
-      }
-    case SILC_PARAM_BUFFER:
-      {
-       SilcBuffer x = va_arg(ap, SilcBuffer);
-       SilcUInt32 len2;
-       UNFORMAT_HAS_SPACE(src, 4);
-       SILC_GET32_MSB(len2, src->data);
-       silc_buffer_pull(src, 4);
-       UNFORMAT_HAS_SPACE(src, len2);
-       silc_buffer_set(x, src->data, len2);
-       silc_buffer_pull(src, len2);
-      }
-      break;
-    case SILC_PARAM_BUFFER_ALLOC:
-      {
-       SilcBuffer x = va_arg(ap, SilcBuffer);
-       SilcUInt32 len2;
-       UNFORMAT_HAS_SPACE(src, 4);
-       SILC_GET32_MSB(len2, src->data);
-       silc_buffer_pull(src, 4);
-       UNFORMAT_HAS_SPACE(src, len2);
-       if (silc_buffer_sformat(stack, x,
-                               SILC_STR_DATA(src->data, len2),
-                               SILC_STR_END) < 0)
-         goto fail;
-       silc_buffer_pull(src, len2);
-      }
-      break;
-    case SILC_PARAM_OFFSET:
-      {
-       int offst = va_arg(ap, int);
-       if (!offst)
-         break;
-       if (offst > 1) {
-         UNFORMAT_HAS_SPACE(src, offst);
-         silc_buffer_pull(src, offst);
-       } else {
-         silc_buffer_push(src, -(offst));
-       }
-       break;
-      }
-    case SILC_PARAM_ADVANCE:
-      advance = TRUE;
-      break;
-    case SILC_PARAM_END:
-      goto ok;
-      break;
-    default:
-      SILC_LOG_DEBUG(("Bad buffer formatting type `%d'. Could not "
-                     "format the data.", fmt));
-      goto fail;
-      break;
-    }
-  }
-
- fail:
-  SILC_LOG_DEBUG(("Error occured while unformatting buffer, type %d", fmt));
-  len = src->data - start_ptr;
-  silc_buffer_push(src, len);
-  return -1;
-
- ok:
-  /* Push the buffer back to the start. */
-  if (!advance) {
-    len = src->data - start_ptr;
-    silc_buffer_push(src, len);
-  }
-  return len;
-}
-
-
-/**************************** Utility functions *****************************/
-
-/* Formats strings into a buffer */
-
-int silc_buffer_strformat(SilcBuffer dst, ...)
-{
-  int len = silc_buffer_truelen(dst);
-  int hlen = silc_buffer_headlen(dst);
-  va_list va;
-
-  va_start(va, dst);
-
-  /* Parse the arguments by formatting type. */
-  while(1) {
-    char *string = va_arg(va, char *);
-    unsigned char *d;
-    SilcInt32 slen;
-
-    if (!string)
-      continue;
-    if (string == (char *)SILC_PARAM_END)
-      goto ok;
-
-    slen = strlen(string);
-    d = silc_realloc(dst->head, sizeof(*dst->head) * (slen + len + 1));
-    if (silc_unlikely(!d))
-      return -1;
-    dst->head = d;
-    memcpy(dst->head + len, string, slen);
-    len += slen;
-    dst->head[len] = '\0';
-  }
-
-  SILC_LOG_DEBUG(("Error occured while formatting buffer"));
-  va_end(va);
-  return -1;
-
- ok:
-  dst->end = dst->head + len;
-  dst->data = dst->head + hlen;
-  dst->tail = dst->end;
-
-  va_end(va);
-  return len;
-}
-
-/* Formats strings into a buffer.  Allocates memory from SilcStack. */
-
-int silc_buffer_sstrformat(SilcStack stack, SilcBuffer dst, ...)
-{
-  int len = silc_buffer_truelen(dst);
-  int hlen = silc_buffer_headlen(dst);
-  va_list va;
-
-  va_start(va, dst);
-
-  /* Parse the arguments by formatting type. */
-  while(1) {
-    char *string = va_arg(va, char *);
-    unsigned char *d;
-    SilcInt32 slen;
-
-    if (!string)
-      continue;
-    if (string == (char *)SILC_PARAM_END)
-      goto ok;
-
-    slen = strlen(string);
-    d = silc_srealloc(stack, len + 1, dst->head,
-                     sizeof(*dst->head) * (slen + len + 1));
-    if (silc_unlikely(!d))
-      return -1;
-    dst->head = d;
-    memcpy(dst->head + len, string, slen);
-    len += slen;
-    dst->head[len] = '\0';
-  }
-
-  SILC_LOG_DEBUG(("Error occured while formatting buffer"));
-  va_end(va);
-  return -1;
-
- ok:
-  dst->end = dst->head + len;
-  dst->data = dst->head + hlen;
-  dst->tail = dst->end;
-
-  va_end(va);
-  return len;
-}
diff --git a/lib/silcutil/silcbuffmt.h b/lib/silcutil/silcbuffmt.h
deleted file mode 100644 (file)
index 909d6ea..0000000
+++ /dev/null
@@ -1,810 +0,0 @@
-/*
-
-  silcbuffmt.h
-
-  Author: Pekka Riikonen <priikone@silcnet.org>
-
-  Copyright (C) 1997 - 2007 Pekka Riikonen
-
-  This program is free software; you can redistribute it and/or modify
-  it under the terms of the GNU General Public License as published by
-  the Free Software Foundation; version 2 of the License.
-
-  This program is distributed in the hope that it will be useful,
-  but WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-  GNU General Public License for more details.
-
-*/
-
-/****h* silcutil/SILC Buffer Format Interface
- *
- * DESCRIPTION
- *
- * SILC Buffer Format API provides functions for formatting different data
- * types into a buffer and retrieving different data types from a buffer
- * into specified data types.  It is especially useful to format packets,
- * protocol payloads and such.
- *
- * As the SilcBuffer API is not thread-safe these routines may not be used
- * in multithreaded environment with a same SilcBuffer context without
- * concurrency control.
- *
- ***/
-
-#ifndef SILCBUFFMT_H
-#define SILCBUFFMT_H
-
-/****f* silcutil/SilcBufferFormatAPI/SilcBufferFormatFunc
- *
- * SYNOPSIS
- *
- *    typedef int (*SilcBufferFormatFunc)(SilcBuffer buffer,
- *                                        void *value,
- *                                        void *context);
- *
- * DESCRIPTION
- *
- *    Formatting function callback given with SILC_STR_FUNC type.  The
- *    `buffer' is the buffer being formatted at the location where the
- *    SILC_STR_FUNC was placed in formatting.  The function should call
- *    silc_buffer_enlarge before it adds the data to the buffer to make
- *    sure that it has enough space.  The buffer->head points to the
- *    start of the buffer and silc_buffer_headlen() gives the length
- *    of the currently formatted data area.  It is also possible to use
- *    silc_buffer_format with `buffer' which will enlarge the buffer if
- *    needed.
- *
- *    The `value' is the value given to SILC_STR_FUNC that is to be formatted
- *    into the buffer.  It may be NULL if the function is not formatting
- *    new data into the buffer.  The `context' is caller specific context.
- *    Returns -1 on error and length of the formatted value otherwise, and
- *    0 if nothing was formatted.
- *
- ***/
-typedef int (*SilcBufferFormatFunc)(SilcBuffer buffer, void *value,
-                                   void *context);
-
-/****f* silcutil/SilcBufferFormatAPI/SilcBufferSFormatFunc
- *
- * SYNOPSIS
- *
- *    typedef int (*SilcBufferSFormatFunc)(SilcStack stack,
- *                                         SilcBuffer buffer,
- *                                         void *value,
- *                                         void *context);
- *
- * DESCRIPTION
- *
- *    Formatting function callback given with SILC_STR_FUNC type.  The
- *    `buffer' is the buffer being formatted at the location where the
- *    SILC_STR_FUNC was placed in formatting.  The function should call
- *    silc_buffer_senlarge before it adds the data to the buffer to make
- *    sure that it has enough space.  The buffer->head points to the
- *    start of the buffer and silc_buffer_headlen() gives the length
- *    of the currently formatted data area.  It is also possible to use
- *    silc_buffer_sformat with `buffer' which will enlarge the buffer if
- *    needed.
- *
- *    The `value' is the value given to SILC_STR_FUNC that is to be formatted
- *    into the buffer.  It may be NULL if the function is not formatting
- *    new data into the buffer.  The `context' is caller specific context.
- *    Returns -1 on error and length of the formatted value otherwise, and
- *    0 if nothing was formatted.
- *
- *    This is same as SilcBufferFormatFunc except the SilcStack will be
- *    delivered.  This callback must be used when SilcStack is used with
- *    formatting.
- *
- ***/
-typedef int (*SilcBufferSFormatFunc)(SilcStack stack, SilcBuffer buffer,
-                                    void *value, void *context);
-
-/****f* silcutil/SilcBufferFormatAPI/SilcBufferUnformatFunc
- *
- * SYNOPSIS
- *
- *    typedef int (*SilcBufferUnformatFunc)(SilcBuffer buffer,
- *                                          void **value,
- *                                          void *context);
- *
- * DESCRIPTION
- *
- *    Unformatting function callback given with SILC_STR_FUNC type.  The
- *    `buffer' is the buffer being unformatted and is at the location where
- *    the SILC_STR_FUNC was placed in unformatting.  The function should
- *    check there is enough data in the `buffer' before trying to decode
- *    from it.
- *
- *    If this function unformats anything from the buffer its value is to
- *    be returned to the `value' pointer.  The implementation should itself
- *    decide whether the unformatted value is allocated or not.  If this
- *    function does not unformat anything, nothing is returned to `value'
- *
- *    The `context' is caller specific context.  Returns -1 on error, and
- *    length of the unformatted value otherwise, and 0 if nothing was
- *    unformatted.
- *
- ***/
-typedef int (*SilcBufferUnformatFunc)(SilcBuffer buffer, void **value,
-                                     void *context);
-
-/****f* silcutil/SilcBufferFormatAPI/SilcBufferSUnformatFunc
- *
- * SYNOPSIS
- *
- *    typedef int (*SilcBufferSUnformatFunc)(SilcStack stack,
- *                                           SilcBuffer buffer,
- *                                           void **value,
- *                                           void *context);
- *
- * DESCRIPTION
- *
- *    Unformatting function callback given with SILC_STR_FUNC type.  The
- *    `buffer' is the buffer being unformatted and is at the location where
- *    the SILC_STR_FUNC was placed in unformatting.  The function should
- *    check there is enough data in the `buffer' before trying to decode
- *    from it.
- *
- *    If this function unformats anything from the buffer its value is to
- *    be returned to the `value' pointer.  The implementation should itself
- *    decide whether the unformatted value is allocated or not.  If this
- *    function does not unformat anything, nothing is returned to `value'
- *
- *    The `context' is caller specific context.  Returns -1 on error, and
- *    length of the unformatted value otherwise, and 0 if nothing was
- *    unformatted.
- *
- *    This is same as SilcBufferUnformatFunc except the SilcStack will be
- *    delivered.  This callback must be used when SilcStack is used with
- *    unformatting.
- *
- ***/
-typedef int (*SilcBufferSUnformatFunc)(SilcStack stack, SilcBuffer buffer,
-                                      void **value, void *context);
-
-/* Prototypes */
-
-/****f* silcutil/SilcBufferFormatAPI/silc_buffer_format
- *
- * SYNOPSIS
- *
- *    int silc_buffer_format(SilcBuffer dst, ...);
- *
- * DESCRIPTION
- *
- *    Formats a buffer from a variable argument list.  Returns -1 on error
- *    and the length of the formatted buffer otherwise.  The buffer is
- *    enlarged automatically during formatting, if it doesn't already have
- *    enough space.
- *
- * EXAMPLE
- *
- *    Three basic ways of using silc_buffer_format:
- *
- *    // Statically allocated zero size buffer
- *    SilcBufferStruct buffer;
- *
- *    memset(&buffer, 0, sizeof(buffer));
- *    ret = silc_buffer_format(&buffer,
- *                             SILC_STR_UI_INT(intval),
- *                             SILC_STR_CHAR(charval),
- *                             SILC_STR_UI_INT(intval),
- *                             SILC_STR_SHORT(str_len),
- *                             SILC_STR_DATA(str, str_len),
- *                             SILC_STR_END);
- *    if (ret < 0)
- *      error;
- *
- *    // Free the allocated data
- *    silc_buffer_purge(&buffer);
- *
- *    // Dynamically allocated zero size buffer
- *    SilcBuffer buf;
- *    buf = silc_buffer_alloc(0);
- *    ret = silc_buffer_format(buf,
- *                             SILC_STR_UI_INT(intval),
- *                             SILC_STR_CHAR(charval),
- *                             SILC_STR_END);
- *    if (ret < 0)
- *      error;
- *
- *    // Free the allocated buffer
- *    silc_buffer_free(buf);
- *
- *    // Dynamically allocated buffer with enough space
- *    SilcBuffer buf;
- *    buf = silc_buffer_alloc(2 + str_len);
- *    ret = silc_buffer_format(buf,
- *                             SILC_STR_UI_SHORT(str_len),
- *                             SILC_STR_DATA(str, str_len),
- *                             SILC_STR_END);
- *    if (ret < 0)
- *      error;
- *
- ***/
-int silc_buffer_format(SilcBuffer dst, ...);
-
-/****f* silcutil/SilcBufferFormatAPI/silc_buffer_sformat
- *
- * SYNOPSIS
- *
- *    int silc_buffer_sformat(SilcStack stack, SilcBuffer dst, ...);
- *
- * DESCRIPTION
- *
- *    Same as silc_buffer_format but uses `stack' to allocate the memory.
- *    if `stack' is NULL reverts back to silc_buffer_format call.
- *
- ***/
-int silc_buffer_sformat(SilcStack stack, SilcBuffer dst, ...);
-
-/****f* silcutil/SilcBufferFormatAPI/silc_buffer_format_vp
- *
- * SYNOPSIS
- *
- *    int silc_buffer_format_vp(SilcBuffer dst, va_list vp);
- *
- * DESCRIPTION
- *
- *    Formats a buffer from a variable argument list indicated by the `ap'.
- *    Returns -1 on error and the length of the formatted buffer otherwise.
- *
- ***/
-int silc_buffer_format_vp(SilcBuffer dst, va_list ap);
-
-/****f* silcutil/SilcBufferFormatAPI/silc_buffer_sformat_vp
- *
- * SYNOPSIS
- *
- *    int silc_buffer_sformat_vp(SilcStack stack, SilcBuffer dst, va_list vp);
- *
- * DESCRIPTION
- *
- *    Same as silc_buffer_format_vp but uses `stack' to allocate the memory.
- *    if `stack' is NULL reverts back to silc_buffer_format_vp call.
- *
- ***/
-int silc_buffer_sformat_vp(SilcStack stack, SilcBuffer dst, va_list ap);
-
-/****f* silcutil/SilcBufferFormatAPI/silc_buffer_unformat
- *
- * SYNOPSIS
- *
- *    int silc_buffer_unformat(SilcBuffer src, ...);
- *
- * DESCRIPTION
- *
- *    Unformats a buffer from a variable argument list.  Returns -1 on error
- *    and the length of the unformatted buffer otherwise.
- *
- * EXAMPLE
- *
- *    ret = silc_buffer_unformat(buffer,
- *                               SILC_STR_UI_INT(&intval),
- *                               SILC_STR_CHAR(&charval),
- *                               SILC_STR_OFFSET(4),
- *                               SILC_STR_UI16_NSTRING_ALLOC(&str, &str_len),
- *                               SILC_STR_END);
- *    if (ret < 0)
- *      error;
- *
- ***/
-int silc_buffer_unformat(SilcBuffer src, ...);
-
-/****f* silcutil/SilcBufferFormatAPI/silc_buffer_sunformat
- *
- * SYNOPSIS
- *
- *    int silc_buffer_sunformat(SilcStack stack, SilcBuffer src, ...);
- *
- * DESCRIPTION
- *
- *    Same as silc_buffer_unformat but uses `stack' to allocate the memory.
- *    if `stack' is NULL reverts back to silc_buffer_format call.
- *
- ***/
-int silc_buffer_sunformat(SilcStack stack, SilcBuffer src, ...);
-
-/****f* silcutil/SilcBufferFormatAPI/silc_buffer_unformat_vp
- *
- * SYNOPSIS
- *
- *    int silc_buffer_unformat_vp(SilcBuffer src, va_list vp);
- *
- * DESCRIPTION
- *
- *    Unformats a buffer from a variable argument list indicated by the `ap'.
- *    Returns -1 on error and the length of the unformatted buffer otherwise.
- *
- ***/
-int silc_buffer_unformat_vp(SilcBuffer src, va_list ap);
-
-/****f* silcutil/SilcBufferFormatAPI/silc_buffer_sunformat_vp
- *
- * SYNOPSIS
- *
- *    int silc_buffer_sunformat_vp(SilcBuffer src, va_list vp);
- *
- * DESCRIPTION
- *
- *    Same as silc_buffer_unformat_vp but uses `stack' to allocate the
- *    memory.  if `stack' is NULL reverts back to silc_buffer_format_vp call.
- *
- ***/
-int silc_buffer_sunformat_vp(SilcStack stack, SilcBuffer src, va_list ap);
-
-/****f* silcutil/SilcBufferFormatAPI/silc_buffer_strformat
- *
- * SYNOPSIS
- *
- *    int silc_buffer_strformat(SilcBuffer dst, ...);
- *
- * DESCRIPTION
- *
- *    Formats a buffer from variable argument list of strings.  Each
- *    string must be NULL-terminated and the variable argument list must
- *    be end with SILC_STRFMT_END argument.  This allows that a string in
- *    the list can be NULL, in which case it is skipped.  This automatically
- *    allocates the space for the buffer data but `dst' must be already
- *    allocated by the caller.
- *
- * EXAMPLE
- *
- *    ret = silc_buffer_strformat(buffer, "foo", "bar", SILC_STRFMT_END);
- *    if (ret < 0)
- *      error;
- *
- ***/
-int silc_buffer_strformat(SilcBuffer dst, ...);
-
-/****f* silcutil/SilcBufferFormatAPI/silc_buffer_sstrformat
- *
- * SYNOPSIS
- *
- *    int silc_buffer_strformat(SilcStack stack, SilcBuffer dst, ...);
- *
- * DESCRIPTION
- *
- *    Formats a buffer from variable argument list of strings.  Each
- *    string must be NULL-terminated and the variable argument list must
- *    be end with SILC_STRFMT_END argument.  This allows that a string in
- *    the list can be NULL, in which case it is skipped.  This automatically
- *    allocates the space for the buffer data but `dst' must be already
- *    allocated by the caller.  This function is equivalent to
- *    silc_buffer_strformat but allocates memory from `stack'.
- *
- ***/
-int silc_buffer_sstrformat(SilcStack stack, SilcBuffer dst, ...);
-
-/****d* silcutil/SilcBufferFormatAPI/SilcBufferParamType
- *
- * NAME
- *
- *    typedef enum { ... } SilcBufferParamType;
- *
- * DESCRIPTION
- *
- *    Buffer parameter types.  These are not needed when formatting or
- *    unformatting buffers.  Use the macros such as SILC_STR_UI_CHAR and
- *    others instead.  These types may be used when describing what a
- *    buffer looks like, and how it may be formatted and unformatted.
- *
- * SOURCE
- */
-typedef enum {
-  SILC_PARAM_SI8_CHAR,            /* Signed 8-bit char */
-  SILC_PARAM_UI8_CHAR,            /* Unsigned 8-bit char */
-  SILC_PARAM_SI16_SHORT,          /* Signed 16-bit int */
-  SILC_PARAM_UI16_SHORT,          /* Unsigned 16-bit int */
-  SILC_PARAM_SI32_INT,            /* Signed 32-bit int */
-  SILC_PARAM_UI32_INT,            /* Unsigned 32-bit int */
-  SILC_PARAM_SI64_INT,            /* Signed 64-bit int */
-  SILC_PARAM_UI64_INT,            /* Unsigned 64-bit int */
-  SILC_PARAM_UI8_STRING,          /* String (max len 8-bits)*/
-  SILC_PARAM_UI16_STRING,         /* String (max len 16-bits) */
-  SILC_PARAM_UI32_STRING,         /* String (max len 32-bits) */
-  SILC_PARAM_BUFFER,              /* SilcBuffer */
-
-  /* Internal types */
-  SILC_PARAM_DATA,                /* Binary data */
-  SILC_PARAM_UI8_NSTRING,         /* String (max len 8-bits) */
-  SILC_PARAM_UI16_NSTRING,        /* String (max len 16-bits) */
-  SILC_PARAM_UI32_NSTRING,        /* String (max len 32-bits) */
-  SILC_PARAM_UI8_STRING_ALLOC,    /* Alloc + memcpy */
-  SILC_PARAM_UI16_STRING_ALLOC,           /* Alloc + memcpy */
-  SILC_PARAM_UI32_STRING_ALLOC,           /* Alloc + memcpy */
-  SILC_PARAM_UI8_NSTRING_ALLOC,           /* Alloc + memcpy */
-  SILC_PARAM_UI16_NSTRING_ALLOC,   /* Alloc + memcpy */
-  SILC_PARAM_UI32_NSTRING_ALLOC,   /* Alloc + memcpy */
-  SILC_PARAM_DATA_ALLOC,          /* Alloc + memcpy */
-  SILC_PARAM_BUFFER_ALLOC,        /* Alloc + memcpy */
-
-  SILC_PARAM_OFFSET,
-  SILC_PARAM_ADVANCE,
-  SILC_PARAM_FUNC,
-
-  SILC_PARAM_UI_XNSTRING,
-  SILC_PARAM_UI_XNSTRING_ALLOC,
-
-  SILC_PARAM_END
-} SilcBufferParamType;
-/***/
-
-/****d* silcutil/SilcBufferFormatAPI/SILC_STR_*_CHAR
- *
- * NAME
- *
- *    #define SILC_STR_UI_CHAR() ...
- *    #define SILC_STR_SI_CHAR() ...
- *
- * DESCRIPTION
- *
- *    One signed/unsigned character.
- *
- *    Formatting:    SILC_STR_SI_CHAR(char)
- *                   SILC_STR_UI_CHAR(unsigned char)
- *    Unformatting:  SILC_STR_SI_CHAR(char *)
- *                   SILC_STR_UI_CHAR(unsigned char *)
- *
- ***/
-#define SILC_STR_SI_CHAR(x) SILC_PARAM_SI8_CHAR, (x)
-#define SILC_STR_UI_CHAR(x) SILC_PARAM_UI8_CHAR, (x)
-
-/****d* silcutil/SilcBufferFormatAPI/SILC_STR_*_SHORT
- *
- * NAME
- *
- *    #define SILC_STR_UI_SHORT() ...
- *    #define SILC_STR_SI_SHORT() ...
- *
- * DESCRIPTION
- *
- *    SilcInt16/SilcUInt16.
- *
- *    Formatting:    SILC_STR_SI_SHORT(SilcInt16)
- *                   SILC_STR_UI_SHORT(SilcUInt16)
- *    Unformatting:  SILC_STR_SI_SHORT(SilcInt16 *)
- *                   SILC_STR_UI_SHORT(SilcUInt16 *)
- *
- ***/
-#define SILC_STR_SI_SHORT(x) SILC_PARAM_SI16_SHORT, (x)
-#define SILC_STR_UI_SHORT(x) SILC_PARAM_UI16_SHORT, (x)
-
-/****d* silcutil/SilcBufferFormatAPI/SILC_STR_*_INT
- *
- * NAME
- *
- *    #define SILC_STR_UI_INT() ...
- *    #define SILC_STR_SI_INT() ...
- *
- * DESCRIPTION
- *
- *    SilcInt32/SilcUInt32.
- *
- *    Formatting:    SILC_STR_SI_INT(SilcInt32)
- *                   SILC_STR_UI_INT(SilcUInt32)
- *    Unformatting:  SILC_STR_SI_INT(SilcInt32 *)
- *                   SILC_STR_UI_INT(SilcUInt32 *)
- *
- ***/
-#define SILC_STR_SI_INT(x) SILC_PARAM_SI32_INT, (x)
-#define SILC_STR_UI_INT(x) SILC_PARAM_UI32_INT, (x)
-
-/****d* silcutil/SilcBufferFormatAPI/SILC_STR_*_INT64
- *
- * NAME
- *
- *    #define SILC_STR_UI_INT64() ...
- *    #define SILC_STR_SI_INT64() ...
- *
- * DESCRIPTION
- *
- *    SilcInt64/SilcUInt64.
- *
- *     Formatting:    SILC_STR_SI_INT64(SilcInt64)
- *                    SILC_STR_UI_INT64(SilcUInt64)
- *     Unformatting:  SILC_STR_SI_INT64(SilcInt64 *)
- *                    SILC_STR_UI_INT64(SilcUInt64 *)
- *
- ***/
-#define SILC_STR_SI_INT64(x) SILC_PARAM_SI64_INT, (x)
-#define SILC_STR_UI_INT64(x) SILC_PARAM_UI64_INT, (x)
-
-/****d* silcutil/SilcBufferFormatAPI/SILC_STR_*_STRING
- *
- * NAME
- *
- *    #define SILC_STR_UI8_STRING() ...
- *    #define SILC_STR_UI8_STRING_ALLOC() ...
- *    #define SILC_STR_UI16_STRING() ...
- *    #define SILC_STR_UI16_STRING_ALLOC() ...
- *    #define SILC_STR_UI32_STRING() ...
- *    #define SILC_STR_UI32_STRING_ALLOC() ...
- *
- * DESCRIPTION
- *
- *    Unsigned NULL terminated string. Note that the string must be
- *    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 **)
- *
- *    Unformatting procedure will check for length of the string from the
- *    buffer before trying to get the string out. Thus, one *must* format the
- *    length as UI_INT or UI_SHORT into the buffer *before* formatting the
- *    actual string to the buffer, and, in unformatting one must ignore the
- *    length of the string because unformatting procedure will take it
- *    automatically.
- *
- *    Example:
- *
- *    Formatting:    ..., SILC_STR_UI_INT(strlen(string)),
- *                        SILC_STR_UI32_STRING(string), ...
- *    Unformatting:  ..., SILC_STR_UI32_STRING(&string), ...
- *
- *    I.e., you can ignore the formatted length field in unformatting.
- *
- *    UI8, UI16 and UI32 means that the length is considered to be
- *    either char (8 bits), short (16 bits) or int (32 bits) in
- *    unformatting.
- *
- *    _ALLOC routines automatically allocates memory for the variable sent
- *    as argument in unformatting.
- *
- ***/
-#define SILC_STR_UI8_STRING(x) SILC_PARAM_UI8_STRING, (x)
-#define SILC_STR_UI8_STRING_ALLOC(x) SILC_PARAM_UI8_STRING_ALLOC, (x)
-#define SILC_STR_UI16_STRING(x) SILC_PARAM_UI16_STRING, (x)
-#define SILC_STR_UI16_STRING_ALLOC(x) SILC_PARAM_UI16_STRING_ALLOC, (x)
-#define SILC_STR_UI32_STRING(x) SILC_PARAM_UI32_STRING, (x)
-#define SILC_STR_UI32_STRING_ALLOC(x) SILC_PARAM_UI32_STRING_ALLOC, (x)
-
-/****d* silcutil/SilcBufferFormatAPI/SILC_STR_*_NSTRING
- *
- * NAME
- *
- *    #define SILC_STR_UI8_NSTRING() ...
- *    #define SILC_STR_UI8_NSTRING_ALLOC() ...
- *    #define SILC_STR_UI16_NSTRING() ...
- *    #define SILC_STR_UI16_NSTRING_ALLOC() ...
- *    #define SILC_STR_UI32_NSTRING() ...
- *    #define SILC_STR_UI32_NSTRING_ALLOC() ...
- *
- * DESCRIPTION
- *
- *    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 *)
- *
- *    Unformatting procedure will check for length of the string from the
- *    buffer before trying to get the string out. Thus, one *must* format the
- *    length as UI_INT or UI_SHORT into the buffer *before* formatting the
- *    actual string to the buffer, and, in unformatting one must ignore the
- *    length of the string because unformatting procedure will take it
- *    automatically.
- *
- *     Example:
- *
- *     Formatting:    ..., SILC_STR_UI_INT(strlen(string)),
- *                         SILC_STR_UI32_NSTRING(string, strlen(string)), ...
- *     Unformatting:  ..., SILC_STR_UI32_NSTRING(&string, &len), ...
- *
- *    I.e., you can ignore the formatted length field in unformatting. The
- *    length taken from the buffer is returned to the pointer sent as
- *    argument (&len in above example).
- *
- *    UI8, UI16 and UI32 means that the length is considered to be
- *    either char (8 bits), short (16 bits) or int (32 bits) in
- *    unformatting.
- *
- *    _ALLOC routines automatically allocates memory for the variable sent
- *    as argument in unformatting.
- *
- ***/
-#define SILC_STR_UI8_NSTRING(x, l) SILC_PARAM_UI8_NSTRING, (x), (l)
-#define SILC_STR_UI8_NSTRING_ALLOC(x, l) \
-  SILC_PARAM_UI8_NSTRING_ALLOC, (x), (l)
-#define SILC_STR_UI16_NSTRING(x, l) SILC_PARAM_UI16_NSTRING, (x), (l)
-#define SILC_STR_UI16_NSTRING_ALLOC(x, l) \
-  SILC_PARAM_UI16_NSTRING_ALLOC, (x), (l)
-#define SILC_STR_UI32_NSTRING(x, l) SILC_PARAM_UI32_NSTRING, (x), (l)
-#define SILC_STR_UI32_NSTRING_ALLOC(x, l) \
-  SILC_PARAM_UI32_NSTRING_ALLOC, (x), (l)
-
-/****d* silcutil/SilcBufferFormatAPI/SILC_STR_DATA
- *
- * NAME
- *
- *    #define SILC_STR_DATA() ...
- *    #define SILC_STR_DATA_ALLOC() ...
- *
- * DESCRIPTION
- *
- *    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)
- *
- *    This type can be used to take arbitrary size data block from the buffer
- *    by sending the requested amount of bytes as argument.
- *
- *    _ALLOC routines automatically allocates memory for the variable sent
- *    as argument in unformatting.
- *
- ***/
-#define SILC_STR_DATA(x, l) SILC_PARAM_DATA, (x), (l)
-#define SILC_STR_DATA_ALLOC(x, l) SILC_PARAM_DATA_ALLOC, (x), (l)
-
-/* Deprecated */
-#define SILC_STR_UI_XNSTRING(x, l) SILC_PARAM_UI_XNSTRING, (x), (l)
-#define SILC_STR_UI_XNSTRING_ALLOC(x, l) SILC_PARAM_UI_XNSTRING_ALLOC, (x), (l)
-
-/****d* silcutil/SilcBufferFormatAPI/SILC_STR_BUFFER
- *
- * NAME
- *
- *    #define SILC_STR_BUFFER() ...
- *    #define SILC_STR_BUFFER_ALLOC() ...
- *
- * DESCRIPTION
- *
- *    SilcBuffer formatting.
- *
- *    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
- *    a 32-bit integer.  In unformatting the SilcBuffer context must be
- *    pre-allocated.
- *
- *    _ALLOC routines automatically allocates memory inside SilcBuffer in
- *    unformatting.
- *
- ***/
-#define SILC_STR_BUFFER(x) SILC_PARAM_BUFFER, (x)
-#define SILC_STR_BUFFER_ALLOC(x) SILC_PARAM_BUFFER_ALLOC, (x)
-
-/****d* silcutil/SilcBufferFormatAPI/SILC_STR_FUNC
- *
- * NAME
- *
- *    #define SILC_STR_FUNC() ...
- *
- * DESCRIPTION
- *
- *    SilcBuffer formatting.
- *
- *    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
- *    the `value'.  In encoding the `value' will be passed to the `function'
- *    and can be encoded into the buffer.  The buffer will be passed as
- *    well to the `function' at the location where SILC_STR_FUNC is placed
- *    in formatting.  The `context' delivers caller specific context to
- *    the `function'
- *
- *    In unformatting the `function' will decode the encoded type and
- *    return it to `value' pointer.  The decoding function should decide
- *    itself whether to allocate or not the decoded value.
- *
- *    The `function' does not have to encode anything and passing `value'
- *    as NULL is allowed.  The `function' could for example modify the
- *    existing buffer.
- *
- * EXAMPLE
- *
- *    // Encode payload, encrypt and compute MAC.
- *    silc_buffer_format(buf,
- *                       SILC_STR_FUNC(foo_encode_id, id, ctx),
- *                       SILC_STR_UI_SHORT(len),
- *                       SILC_STR_DATA(data, len),
- *                       SILC_STR_FUNC(foo_buf_encrypt, NULL, key),
- *                       SILC_STR_FUNC(foo_buf_hmac, NULL, hmac),
- *                       SILC_STR_DATA(iv, iv_len);
- *                       SILC_STR_END);
- *
- *    // Check MAC, decrypt and decode payload
- *    silc_buffer_unformat(buf,
- *                         SILC_STR_FUNC(foo_buf_hmac, NULL, hmac),
- *                         SILC_STR_FUNC(foo_buf_decrypt, NULL, key),
- *                         SILC_STR_FUNC(foo_decode_id, &id, ctx),
- *                         SILC_STR_UI_SHORT(&len),
- *                         SILC_STR_END);
- *
- ***/
-#define SILC_STR_FUNC(func, val, context) SILC_PARAM_FUNC, \
-    func, (val), (context)
-
-/****d* silcutil/SilcBufferFormatAPI/SILC_STR_OFFSET
- *
- * NAME
- *
- *    #define SILC_STR_OFFSET() ...
- *
- * DESCRIPTION
- *
- *    Offset in buffer.  This can be used in formatting and unformatting to
- *    move the data pointer of the buffer either forwards (positive offset)
- *    or backwards (negative offset).  It can be used to for example skip
- *    some types during unformatting.
- *
- *    Example:
- *
- *    ..., SILC_STR_OFFSET(5), ...
- *    ..., SILC_STR_OFFSET(-3), ...
- *
- *    Moves the data pointer at the point of the offset either forward
- *    or backward and then moves to the next type.  Multiple SILC_STR_OFFSETs
- *    can be used in formatting and unformatting at the same time.
- *
- ***/
-#define SILC_STR_OFFSET(x) SILC_PARAM_OFFSET, (x)
-
-/****d* silcutil/SilcBufferFormatAPI/SILC_STR_ADVANCE
- *
- * NAME
- *
- *    #define SILC_STR_ADVANCE ...
- *
- * DESCRIPTION
- *
- *    Advance the buffer to the end of the data after the formatting is
- *    done.  In normal operation when the formatted data is written the
- *    buffer is located at the start of the data.  With SILC_STR_ADVANCE
- *    the buffer will be located at the end of the data.  This makes it
- *    easy to add new data immediately after the previously added data.
- *    The SILC_STR_ADVANCE may also be used in unformatting.
- *
- * EXAMPLE
- *
- *    do {
- *      len = read(fd, buf, sizeof(buf));
- *      if (len > 0)
- *        // Add read data to the buffer
- *        silc_buffer_format(buffer,
- *                           SILC_STR_ADVANCE,
- *                           SILC_STR_DATA(buf, len),
- *                           SILC_STR_END);
- *    } while (len > 0);
- *
- *    // Move to beginning of buffer
- *    silc_buffer_start(buffer);
- *
- ***/
-#define SILC_STR_ADVANCE SILC_PARAM_ADVANCE
-
-/****d* silcutil/SilcBufferFormatAPI/SILC_STR_END
- *
- * NAME
- *
- *    #define SILC_STR_END ...
- *
- * DESCRIPTION
- *
- *    Marks end of the argument list. This must be at the end of the
- *    argument list or error will occur.
- *
- ***/
-#define SILC_STR_END SILC_PARAM_END
-
-/****d* silcutil/SilcBufferFormatAPI/SILC_STRFMT_END
- *
- * NAME
- *
- *    #define SILC_STRFMT_END ...
- *
- * DESCRIPTION
- *
- *    Marks end of the argument list in silc_buffer_strformat function.
- *    This must be at the end of the argument list or error will occur.
- *
- ***/
-#define SILC_STRFMT_END (void *)SILC_STR_END
-
-#endif /* !SILCBUFFMT_H */
diff --git a/lib/silcutil/silccond.h b/lib/silcutil/silccond.h
deleted file mode 100644 (file)
index 1fe8bb2..0000000
+++ /dev/null
@@ -1,169 +0,0 @@
-/*
-
-  silccond.h
-
-  Author: Pekka Riikonen <priikone@silcnet.org>
-
-  Copyright (C) 2006 - 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.
-
-*/
-
-/****h* silcutil/SILC Condition Variable Interface
- *
- * DESCRIPTION
- *
- * A condition variable interface for multi-thread synchronization.
- * Condition variables enable threads to suspend execution and yield
- * the processors until some predicate on some shared data is satisfied.
- *
- ***/
-
-#ifndef SILCCOND_H
-#define SILCCOND_H
-
-/****s* silcutil/SilcCondAPI/SilcCond
- *
- * NAME
- *
- *    typedef struct SilcCondStruct *SilcCond;
- *
- * DESCRIPTION
- *
- *    This context is the actual condition variable and is allocated
- *    by silc_cond_alloc and given as argument to all silc_cond_*
- *    functions.  It is freed by the silc_cond_free function.
- *
- ***/
-typedef struct SilcCondStruct *SilcCond;
-
-/****s* silcutil/SilcCondAPI/silc_cond_alloc
- *
- * SYNOPSIS
- *
- *    SilcBool silc_cond_alloc(SilcCond *cond);
- *
- * DESCRIPTION
- *
- *    Allocates SILC Condition variable context.  The condition must
- *    be allocated before it can be used.  It is freed by the
- *    silc_cond_free function.  This returns TRUE and allocated
- *    condition in to the `cond' pointer and FALSE on error.
- *
- ***/
-SilcBool silc_cond_alloc(SilcCond *cond);
-
-/****s* silcutil/SilcCondAPI/silc_cond_free
- *
- * SYNOPSIS
- *
- *    void silc_cond_free(SilcCond cond);
- *
- * DESCRIPTION
- *
- *    Free condition variable context.  If `cond' is NULL this function
- *    has no effect.
- *
- ***/
-void silc_cond_free(SilcCond cond);
-
-/****s* silcutil/SilcCondAPI/silc_cond_wait
- *
- * SYNOPSIS
- *
- *    void silc_cond_wait(SilcCond cond, SilcMutex mutex);
- *
- * DESCRIPTION
- *
- *    Waits for condition variable `cond' to be signalled.  This function
- *    will block the calling thread until the condition variable is
- *    signalled.  The `mutex' must be locked before calling this function.
- *    The `mutex' will be unlocked inside this function.  After this
- *    function returns the `mutex' is in locked state again.
- *
- * EXAMPLE
- *
- *    silc_mutex_lock(lock);
- *    while (c->a == NULL)
- *      silc_cond_wait(cond, lock);
- *    ...
- *    silc_mutex_unlock(lock);
- *
- ***/
-void silc_cond_wait(SilcCond cond, SilcMutex mutex);
-
-/****s* silcutil/SilcCondAPI/silc_cond_timedwait
- *
- * SYNOPSIS
- *
- *    void silc_cond_timedwait(SilcCond cond, SilcMutex mutex, int timeout);
- *
- * DESCRIPTION
- *
- *    Waits for condition variable `cond' to be signalled or for the
- *    `timeout' to expire.  The timeout is in milliseconds.  If it is 0
- *    no timeout exist.  Returns FALSE if timeout expired, TRUE when
- *    signalled.  This function will block the calling thread until the
- *    condition variable is signalled.  The `mutex' must be locked before
- *    calling this function.  The `mutex' will be unlocked inside this
- *    function.  After this function returns the `mutex' is in locked
- *    state again.
- *
- ***/
-SilcBool silc_cond_timedwait(SilcCond cond, SilcMutex mutex, int timeout);
-
-/****s* silcutil/SilcCondAPI/silc_cond_signal
- *
- * SYNOPSIS
- *
- *    void silc_cond_signal(SilcCond cond);
- *
- * DESCRIPTION
- *
- *    Signals a waiting thread and wakes it up.  If there are no waiters
- *    this function has no effect.  In case of multiple waiters only one
- *    is signalled.  To signal all of them use silc_cond_broadcast.
- *
- * NOTES
- *
- *    Before calling this function the mutex used with the silc_cond_wait
- *    must be acquired.
- *
- * EXAMPLE
- *
- *    silc_mutex_lock(lock);
- *    c->a = context;
- *    silc_cond_signal(cond);
- *    silc_mutex_unlock(lock);
- *
- ***/
-void silc_cond_signal(SilcCond cond);
-
-/****s* silcutil/SilcCondAPI/silc_cond_broadcast
- *
- * SYNOPSIS
- *
- *    void silc_cond_broadcast(SilcCond cond);
- *
- * DESCRIPTION
- *
- *    Signals and wakes up all waiters.  If there are no waiters this
- *    function has no effect.
- *
- * NOTES
- *
- *    Before calling this function the mutex used with the silc_cond_wait
- *    must be acquired.
- *
- ***/
-void silc_cond_broadcast(SilcCond cond);
-
-#endif /* SILCCOND_H */
diff --git a/lib/silcutil/silcconfig.c b/lib/silcutil/silcconfig.c
deleted file mode 100644 (file)
index f9fe843..0000000
+++ /dev/null
@@ -1,668 +0,0 @@
-/*
-
-  silcconfig.c
-
-  Author: Giovanni Giacobbi <giovanni@giacobbi.net>
-
-  Copyright (C) 2002 - 2006 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
-  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.
-
-*/
-/* $Id$ */
-
-#include "silc.h"
-
-/* limit debug logging verbosity */
-#if 0
-#define SILC_CONFIG_DEBUG(fmt) SILC_LOG_DEBUG(fmt)
-#else
-#define SILC_CONFIG_DEBUG(fmt)
-#endif
-
-#define BUF_SIZE 255
-
-/* this is the option struct and currently it is only used internally to
- * the module and other structs. */
-typedef struct SilcConfigOptionStruct {
-  char *name;                  /* *lowercase* name of the option */
-  SilcConfigType type;         /* important: the type of the returned value */
-  SilcConfigCallback cb;       /* the value handler */
-  const SilcConfigTable *subtable; /* used if type is SILC_CONFIG_ARG_BLOCK */
-  void *context;               /* context passed to the callback function */
-  struct SilcConfigOptionStruct *next;
-} SilcConfigOption;
-
-/* unique for each config file (and included ones) */
-struct SilcConfigFileObject {
-  char *filename;      /* the original filename opened */
-  int level;           /* parsing level, how many nested
-                          silc_config_main we have */
-  char *base;          /* this is a fixed pointer to the base location */
-  char *p;             /* the Parser poitner */
-  SilcUInt32 len;      /* fixed length of the whole file */
-  SilcUInt32 line;     /* current parsing line, strictly linked to p */
-  SilcBool included;   /* wether this file is main or included */
-};
-
-/* We need the entity to base our block-style parsing on */
-struct SilcConfigEntityObject {
-  SilcConfigOption *opts;      /* known options list */
-  SilcConfigFile *file;                /* parsing file object */
-};
-
-/* access error descriptions only with silc_config_strerror() */
-static char *errorstrs[] = {
-  "-OK",                                     /* SILC_CONFIG_OK */
-  "-SILENT",                                 /* SILC_CONFIG_ESILENT */
-  "-PRINTLINE",                                      /* SILC_CONFIG_EPRINTLINE */
-  "Invalid syntax",                          /* SILC_CONFIG_EGENERIC */
-  "Internal error! Please report this bug",   /* SILC_CONFIG_EINTERNAL */
-  "Can't open specified file",               /* SILC_CONFIG_ECANTOPEN */
-  "Expected open-brace '{'",                 /* SILC_CONFIG_EOPENBRACE */
-  "Missing close-brace '}'",                 /* SILC_CONFIG_ECLOSEBRACE */
-  "Invalid data type",                       /* SILC_CONFIG_ETYPE */
-  "Unknown option",                          /* SILC_CONFIG_EBADOPTION */
-  "Invalid text",                            /* SILC_CONFIG_EINVALIDTEXT */
-  "Double option specification",             /* SILC_CONFIG_EDOUBLE */
-  "Expected data but not found",             /* SILC_CONFIG_EEXPECTED */
-  "Expected '='",                            /* SILC_CONFIG_EEXPECTEDEQUAL */
-  "Unexpected data",                         /* SILC_CONFIG_EUNEXPECTED */
-  "Missing mandatory fields",                /* SILC_CONFIG_EMISSFIELDS */
-  "Missing ';'",                             /* SILC_CONFIG_EMISSCOLON */
-};
-
-/* return string describing SilcConfig's error code */
-char *silc_config_strerror(int errnum)
-{
-  if ((errnum < 0) || (errnum >= sizeof(errorstrs)/sizeof(*errorstrs)) ||
-    (errorstrs[errnum] == NULL)) {
-    char *defret = "-INVALIDERROR";
-    return defret;
-  }
-  return errorstrs[errnum];
-}
-
-/* Begin of internal SilcConfig's text util functions */
-
-/* Points the first non-space character */
-static void my_trim_spaces(SilcConfigFile *file)
-{
-  register char *r = file->p;
-  while ((*r != '\0' && *r != EOF) && isspace((int)*r))
-    if (*r++ == '\n') file->line++;
-  file->p = r;
-}
-
-/* Skips the current line until newline (lf or cr) */
-static void my_skip_line(SilcConfigFile *file)
-{
-  register char *r = file->p;
-  while ((*r != '\0' && *r != EOF) && (*r != '\n') && (*r != '\r')) r++;
-  file->p = ((*r != '\0' && *r != EOF) ? r + 1 : r);
-  file->line++;
-}
-
-/* Obtains a text token from the current position until first separator.
- * a separator is any non alphanumeric character nor "_" or "-" */
-static char *my_next_token(SilcConfigFile *file, char *to)
-{
-  unsigned int count = 0;
-  register char *o;
-  my_trim_spaces(file);
-  o = file->p;
-  while ((isalnum((int)*o) || (*o == '_') || (*o == '-')) && count < BUF_SIZE) {
-    count++;
-    *to++ = *o++;
-  }
-  *to = '\0';
-  file->p = o;
-  return to;
-}
-
-/* Obtains a string from the current position. The only difference from
- * next_token() is that quoted-strings are also accepted */
-static char *my_get_string(SilcConfigFile *file, char *to)
-{
-  char *o;
-  my_trim_spaces(file);
-  o = file->p;
-  if (*o == '"') {
-    unsigned int count = 0;
-    char *d = to;
-    while (count < BUF_SIZE) {
-      o++;
-      if (*o == '"') {
-          break;
-      }
-      if (*o == '\\') {
-          o++;
-      }
-      count++;
-      *d++ = *o;
-    }
-    if (count >= BUF_SIZE) { /* XXX FIXME: gotta do something here */
-      fprintf(stderr, "Bullshit, missing matching \"");
-      exit(1);
-    }
-    *d = '\0';
-    /* update stream pointer */
-    file->p = o + 1;
-  } else {
-    /* we don't need quote parsing, fall-back to token extractor */
-    my_next_token(file, to);
-  }
-  return to;
-}
-
-/* Skips all comment lines and spaces lines until first useful character */
-static void my_skip_comments(SilcConfigFile *file)
-{
-  while (1) {
-    my_trim_spaces(file);
-    if (*file->p != '#') return;
-    my_skip_line(file);
-  }
-}
-
-/* End of internal text functions
- * Next section contains SilcConfig internal config utils */
-
-/* find an option in the list by name and returns its pointer */
-static SilcConfigOption *silc_config_find_option(SilcConfigEntity ent,
-       const char *name)
-{
-  SilcConfigOption *tmp;
-  for (tmp = ent->opts; tmp; tmp = tmp->next) {
-    if (!strcasecmp(tmp->name, name))
-      return tmp;
-  }
-  return NULL;
-}
-
-/* Converts a string in the type specified. returns a dynamically
- * allocated pointer. */
-static void *silc_config_marshall(SilcConfigType type, const char *val)
-{
-  void *pt;
-  int val_int;
-  SilcBool val_boolean;
-  char *val_tmp;
-  SilcUInt32 val_size;
-
-  switch (type) {
-    case SILC_CONFIG_ARG_TOGGLE:
-      if (!strcasecmp(val, "yes") || !strcasecmp(val, "true") ||
-               !strcasecmp(val, "on") || !strcasecmp(val, "1")) {
-       val_boolean = TRUE;
-      }
-      else if (!strcasecmp(val, "no") || !strcasecmp(val, "false") ||
-               !strcasecmp(val, "off") || !strcasecmp(val, "0")) {
-       val_boolean = FALSE;
-      }
-      else
-       return NULL;
-      pt = silc_calloc(1, sizeof(val_boolean));
-      *(SilcBool *)pt = (SilcBool) val_boolean;
-      return pt;
-    case SILC_CONFIG_ARG_INT:
-      val_int = (int) strtol(val, &val_tmp, 0);
-      if (*val_tmp) /* error converting string */
-       return NULL;
-      pt = silc_calloc(1, sizeof(val_int));
-      *(int *)pt = val_int;
-      return pt;
-    case SILC_CONFIG_ARG_SIZE:
-      val_size = (SilcUInt32) strtol(val, &val_tmp, 0);
-      if (val == val_tmp)
-       return NULL; /* really wrong, there must be at least one digit */
-      /* Search for a designator */
-      switch (tolower((int)val_tmp[0])) {
-       case '\0': /* None */
-         break;
-       case 'k': /* Kilobytes */
-         val_size *= (SilcUInt32) 1024;
-         break;
-       case 'm': /* Megabytes */
-         val_size *= (SilcUInt32) (1024 * 1024);
-         break;
-       case 'g':
-         val_size *= (SilcUInt32) (1024 * 1024 * 1024);
-         break;
-       default:
-         return NULL;
-      }
-      /* the string must die here */
-      if (val_tmp[1])
-       return NULL;
-      pt = silc_calloc(1, sizeof(val_size));
-      *(SilcUInt32 *)pt = val_size;
-      return pt;
-    case SILC_CONFIG_ARG_STR: /* the only difference between STR and STRE is */
-      if (!val[0])           /* that STR cannot be empty, while STRE can.  */
-       return NULL;
-    case SILC_CONFIG_ARG_STRE:
-      pt = (void *) strdup(val);
-      return pt;
-    /* following types are not supposed to have a return value */
-    case SILC_CONFIG_ARG_BLOCK:
-    case SILC_CONFIG_ARG_NONE:
-      return NULL;
-    default:
-      return NULL;
-  }
-
-  return NULL;
-}
-
-/* End of internal functions */
-
-
-/* Tries to open the config file and returns a valid SilcConfigFile object
- * or NULL if failed */
-
-SilcConfigFile *silc_config_open(const char *configfile)
-{
-  char *buffer;
-  SilcUInt32 filelen;
-  SilcConfigFile *ret;
-
-  if (!(buffer = silc_file_readfile(configfile, &filelen)))
-    return NULL;
-
-  ret = silc_calloc(1, sizeof(*ret));
-  ret->filename = strdup(configfile);
-  ret->base = ret->p = buffer;
-  ret->len = filelen;
-  ret->line = 1; /* line count, start from first line */
-  return ret;
-}
-
-/* Frees a file object */
-
-void silc_config_close(SilcConfigFile *file)
-{
-  if (file) {
-    silc_free(file->filename);
-    memset(file->base, 'F', file->len);
-    silc_free(file->base);
-    memset(file, 'F', sizeof(*file));
-    silc_free(file);
-  }
-}
-
-/* initializes a SilcConfigEntity pointer allocation */
-
-SilcConfigEntity silc_config_init(SilcConfigFile *file)
-{
-  SilcConfigEntity ret;
-
-  if (!file)
-    return NULL;
-
-  SILC_CONFIG_DEBUG(("Allocating new config entity"));
-  ret = silc_calloc(1, sizeof(*ret));
-  ret->file = file;
-  return ret;
-}
-
-/* Returns the original filename of the object file */
-
-char *silc_config_get_filename(SilcConfigFile *file)
-{
-  if (file)
-    return file->filename;
-  return NULL;
-}
-
-/* Returns the current line that file parsing arrived at */
-
-SilcUInt32 silc_config_get_line(SilcConfigFile *file)
-{
-  if (file)
-    return file->line;
-  return 0;
-}
-
-/* Returns a pointer to the beginning of the requested line.  If the line
- * was not found, NULL is returned */
-
-char *silc_config_read_line(SilcConfigFile *file, SilcUInt32 line)
-{
-  register char *p;
-  int len;
-  char *ret = NULL, *endbuf;
-
-  if (!file || (line <= 0))
-    return NULL;
-  for (p = file->base; *p && (*p != EOF); p++) {
-    if (line <= 1)
-      goto found;
-    if (*p == '\n')
-      line--;
-  }
-  return NULL;
-
- found:
-  if ((endbuf = strchr(p, '\n'))) {
-    len = endbuf - p;
-    if (len > 0)
-      ret = silc_memdup(p, len);
-  } else {
-    ret = silc_memdup(p, strlen(p));
-  }
-  return ret;
-}
-
-/* Convenience function to read the current parsed line */
-
-char *silc_config_read_current_line(SilcConfigFile *file)
-{
-  return silc_config_read_line(file, file->line);
-}
-
-/* (Private) destroy a SilcConfigEntity */
-
-static void silc_config_destroy(SilcConfigEntity ent, SilcBool destroy_opts)
-{
-  SilcConfigOption *oldopt, *nextopt;
-  SILC_CONFIG_DEBUG(("Freeing config entity [ent=0x%x] [opts=0x%x]",
-                       (SilcUInt32) ent, (SilcUInt32) ent->opts));
-
-  /* if she wants to preserve options just free the object struct */
-  if (!destroy_opts)
-    goto skip_sect;
-
-  for (oldopt = ent->opts; oldopt; oldopt = nextopt) {
-    nextopt = oldopt->next;
-    memset(oldopt->name, 'F', strlen(oldopt->name) + 1);
-    silc_free(oldopt->name);
-    memset(oldopt, 'F', sizeof(*oldopt));
-    silc_free(oldopt);
-  }
-
- skip_sect:
-  memset(ent, 'F', sizeof(*ent));
-  silc_free(ent);
-}
-
-/* Registers a new option in the specified entity.
- * Returns TRUE on success, FALSE if already registered. */
-
-SilcBool silc_config_register(SilcConfigEntity ent, const char *name,
-                         SilcConfigType type, SilcConfigCallback cb,
-                         const SilcConfigTable *subtable, void *context)
-{
-  SilcConfigOption *newopt;
-  SILC_CONFIG_DEBUG(("Register new option=\"%s\" "
-                    "type=%u cb=0x%08x context=0x%08x",
-                    name, type, (SilcUInt32) cb, (SilcUInt32) context));
-
-  /* if we are registering a block, make sure there is a specified sub-table */
-  if (!ent || !name || ((type == SILC_CONFIG_ARG_BLOCK) && !subtable))
-    return FALSE;
-
-  /* don't register a reserved tag */
-  if (!strcasecmp(name, "include"))
-    return FALSE;
-
-  /* check if an option was previously registered */
-  if (silc_config_find_option(ent, name)) {
-    SILC_LOG_DEBUG(("Error: Can't register \"%s\" twice.", name));
-    return FALSE;
-  }
-
-  /* allocate and append the new option */
-  newopt = silc_calloc(1, sizeof(*newopt));
-  newopt->name = strdup(name);
-  newopt->type = type;
-  newopt->cb = cb;
-  newopt->subtable = subtable;
-  newopt->context = context;
-
-  /* append this option to the list */
-  if (!ent->opts)
-    ent->opts = newopt;
-  else {
-    SilcConfigOption *tmp;
-    for (tmp = ent->opts; tmp->next; tmp = tmp->next);
-    tmp->next = newopt;
-  }
-  return TRUE;
-}
-
-/* Register a new option table in the specified config entity */
-
-SilcBool silc_config_register_table(SilcConfigEntity ent,
-                               const SilcConfigTable table[], void *context)
-{
-  int i;
-  if (!ent || !table)
-    return FALSE;
-  SILC_CONFIG_DEBUG(("Registering table"));
-  /* XXX FIXME: some potability checks needed - really? */
-  for (i = 0; table[i].name; i++) {
-    if (!silc_config_register(ent, table[i].name, table[i].type,
-                             table[i].callback, table[i].subtable, context))
-      return FALSE;
-  }
-  return TRUE;
-}
-
-/* ... */
-
-static int silc_config_main_internal(SilcConfigEntity ent)
-{
-  SilcConfigFile *file = ent->file;
-  char **p = &file->p;
-
-  /* loop throught statements */
-  while (1) {
-    char buf[BUF_SIZE];
-    SilcConfigOption *thisopt;
-
-    /* makes it pointing to the next interesting char */
-    my_skip_comments(file);
-    /* got eof? */
-    if (**p == '\0' || **p == EOF) {
-      if (file->level > 1) /* cannot get eof in a sub-level! */
-       return SILC_CONFIG_EEXPECTED;
-      goto finish;
-    }
-    /* check if we completed this (sub) section (it doesn't matter if this
-     * is the main section) */
-    if (**p == '}') {
-      if (file->level < 2) /* can't be! must be at least one sub-block */
-       return SILC_CONFIG_EUNEXPECTED;
-      (*p)++;
-      goto finish;
-    }
-    //SILC_LOG_HEXDUMP(("Preparing lookup at line=%lu", file->line), *p, 16);
-
-    /* obtain the keyword */
-    my_next_token(file, buf);
-    SILC_CONFIG_DEBUG(("Looking up keyword=\"%s\" [line=%lu]",
-                      buf, file->line));
-
-    /* handle special directive */
-    if (!strcasecmp(buf, "include")) {
-      int ret;
-      SilcConfigFile *inc_file;
-      SilcConfigEntity inc_ent;
-
-      my_trim_spaces(file); /* prepare next char */
-
-      /* Now trying to include the specified file.  The included file will
-       * be allowed to include sub-files but it will preserve the block-level
-       * of the including block. Note that the included file won't be allowed
-       * to raise the block level of the including block. */
-
-      my_get_string(file, buf); /* get the filename */
-      SILC_LOG_DEBUG(("Including file \"%s\"", buf));
-      /* before getting on, check if this row is REALLY complete */
-      if (*(*p)++ != ';')
-       return SILC_CONFIG_EMISSCOLON;
-
-      /* open the file and start the parsing */
-      inc_file = silc_config_open(buf);
-      if (!inc_file) /* does it point a valid filename? */
-        return SILC_CONFIG_ECANTOPEN;
-      inc_file->included = TRUE;
-
-      /* create a new entity and hack it to use the same options */
-      inc_ent = silc_config_init(inc_file);
-      inc_ent->opts = ent->opts;
-      ret = silc_config_main(inc_ent);
-
-      /* Cleanup.
-       * If the included file returned an error, the application will probably
-       * want to output some kind of error message. Because of this, we can't
-       * destroy THIS file object. The hack works this way: The application
-       * expects to destroy the originally created object file, so we'll swap
-       * the original file with the included file. */
-      if (ret) {
-        SilcConfigFile tmp_file;
-        SILC_CONFIG_DEBUG(("SWAPPING FILE OBJECTS"));
-        memcpy(&tmp_file, inc_file, sizeof(tmp_file));
-        memcpy(inc_file, file, sizeof(tmp_file));
-        silc_config_close(inc_file);
-        memcpy(file, &tmp_file, sizeof(tmp_file));
-        return ret;
-      }
-      /* otherwise if no errors encoured, continue normally */
-      silc_config_close(inc_file);
-      continue; /* this one is handled */
-    }
-
-    /* we have a registered option (it can also be a sub-block) */
-    thisopt = silc_config_find_option(ent, buf);
-    if (!thisopt)
-      return SILC_CONFIG_EBADOPTION;
-
-    my_trim_spaces(file); /* prepare next char */
-
-    /* option type is a block? */
-    if (thisopt->type == SILC_CONFIG_ARG_BLOCK) {
-      int ret;
-      SilcConfigEntity sub_ent;
-
-      SILC_CONFIG_DEBUG(("Entering sub-block"));
-      if (*(*p)++ != '{')
-       return SILC_CONFIG_EOPENBRACE;
-      /* build the new entity for this sub-block */
-      sub_ent = silc_config_init(ent->file);
-      /* use the previous specified table to describe this block's options */
-      silc_config_register_table(sub_ent, thisopt->subtable, thisopt->context);
-      /* run this block! */
-      ret = silc_config_main(sub_ent);
-      SILC_CONFIG_DEBUG(("Returned from sub-block [ret=%d]", ret));
-
-      if (ret) /* now check the result */
-       return ret;
-
-      /* now call block clean-up callback (if any) */
-      if (thisopt->cb) {
-       int ret;
-       SILC_CONFIG_DEBUG(("Now calling clean-up callback"));
-       ret = thisopt->cb(thisopt->type, thisopt->name, file->line, NULL,
-                         thisopt->context);
-       if (ret) {
-         SILC_CONFIG_DEBUG(("Callback refused the value [ret=%d]", ret));
-         return ret;
-       }
-      }
-      /* Do we want ';' to be mandatory after close brace? */
-      if (*(*p)++ != ';')
-       return SILC_CONFIG_EMISSCOLON;
-    }
-    else if (thisopt->type == SILC_CONFIG_ARG_NONE) {
-      /* before getting on, check if this row is REALLY complete */
-      if (*(*p)++ != ';')
-       return SILC_CONFIG_EMISSCOLON;
-      SILC_CONFIG_DEBUG(("Triggering callback for none"));
-      if (thisopt->cb) {
-       thisopt->cb(thisopt->type, thisopt->name, file->line,
-                   NULL, thisopt->context);
-      }
-    }
-    else {
-      void *pt;
-      int ret = 0;     /* very important in case of no cb */
-
-      if (*(*p)++ != '=')
-       return SILC_CONFIG_EEXPECTEDEQUAL;
-
-      my_get_string(file, buf); /* get the option argument */
-      SILC_CONFIG_DEBUG(("With argument=\"%s\"", buf));
-
-      /* before getting on, check if this row is REALLY complete */
-      if (*(*p)++ != ';')
-       return SILC_CONFIG_EMISSCOLON;
-
-      /* convert the option argument to the right format */
-      pt = silc_config_marshall(thisopt->type, buf);
-      if (!pt)
-       return SILC_CONFIG_EINVALIDTEXT;
-      if (thisopt->cb)
-       ret = thisopt->cb(thisopt->type, thisopt->name, file->line,
-                         pt, thisopt->context);
-
-      /* since we have to free "pt" both on failure and on success, we
-         assume that ret == 0 if we didn't actually call any cb. */
-      silc_free(pt);
-      if (ret) {
-       SILC_CONFIG_DEBUG(("Callback refused the value [ret=%d]", ret));
-       return ret;
-      }
-    }
-    continue;
-
- finish:
-    break;
-  }
-
-  return SILC_CONFIG_OK;
-}
-
-/* ... */
-
-int silc_config_main(SilcConfigEntity ent)
-{
-  SilcConfigFile *file = ent->file;
-  int ret;
-
-  /* don't silently accept a NULL entity */
-  if (!ent) {
-    ret = SILC_CONFIG_EGENERIC;
-    goto main_cleanup;
-  }
-
-  /* call the real main and store the result */
-  file->level++;
-  SILC_CONFIG_DEBUG(("[Lev=%d] Entering config parsing core", file->level));
-  ret = silc_config_main_internal(ent);
-  SILC_CONFIG_DEBUG(("[Lev=%d] Quitting main [ret=%d]", file->level, ret));
-  if (!file->level) /* when swap happens, we could close a file twice */
-    goto main_end;
-  file->level--;
-
-  /* If this file was included don't destroy the options set because it is
-   * the same of the including block. Although if this entity is in a
-   * sub-block created inside the included file, this options set must be
-   * destroyed. */
- main_cleanup:
-  if ((file->level != 0) || (file->included != TRUE))
-    silc_config_destroy(ent, TRUE);
-  else
-    silc_config_destroy(ent, FALSE);
-
- main_end:
-  return ret;
-}
diff --git a/lib/silcutil/silcconfig.h b/lib/silcutil/silcconfig.h
deleted file mode 100644 (file)
index c58bd28..0000000
+++ /dev/null
@@ -1,462 +0,0 @@
-/*
-
-  silcconfig.h
-
-  Author: Giovanni Giacobbi <giovanni@giacobbi.net>
-
-  Copyright (C) 2002 - 2003 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
-  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.
-
-*/
-
-/****h* silcutil/SILC Config Interface
- *
- * DESCRIPTION
- *
- * The SILC Config util library is based on two main objects, SilcConfigFile
- * (or File object) and SilcConfigEntity (or Entity).  The File objects are
- * structs directly corresponding to the real files in the filesystem, while
- * Entities are a little more abstract.
- *
- * An Entity is composed by delimited area on a File object (it can take the
- * whole File object or just part of it), plus a group of known options.
- * In order to parse this file, first you need to create a File object with
- * the silc_config_open() function, and then you need to create the Entity
- * with the silc_config_init() function.
- *
- * Now you can use the newly created Entity to register a group of expected
- * known options and sub-blocks, and then you can call the main parsing loop
- * with the silc_config_main() function. When silc_config_main() will 
- * return, if some error encoured the object file will point to the file 
- * that caused this error (this can be different from the originally 
- * opened file if it contained `Include' directives).  If no errors 
- * encoured then the File objects will still point to the original file.
- *
- * While silc_config_main() will take care of destroying Entities before
- * returning, you need to take care that the File object you created is freed
- * with the silc_config_close() function.
- *
- * The SILC Config library won't take care about storing the values contained
- * in the config file.  You must take care about it with the callback
- * functions.
- *
- * The config file syntax is pretty straightforward.  All lines starting
- * with `#' will be skipped, while sub-blocks are delimited by braces (see
- * the example below).
- *
- * Options with argument must have the `=' character between the option
- * name and the value.  Simple words and numbers does not require quoting.
- * There is a special built-in directive "Include" which allows you to include
- * another config file in the point the directive is.  You can also Include
- * inside a sub-block body, in this case when parsing the included config file
- * it will be assumed that we are within this block, and the included file
- * won't be allowed to close his root block.
- *
- * Example:
- *
- *    cipher {
- *       name = aes-256-cbc;
- *       module = "aes.sim.so";
- *       key_length = 32;       # usually the default is just fine
- *       block_length = 16;
- *    };
- *    Include "/etc/silc/hash_funcs.conf";
- *
- ***/
-
-#ifndef SILCCONFIG_H
-#define SILCCONFIG_H
-
-/****d* silcutil/SilcConfigAPI/SilcConfigErrno
- *
- * NAME
- *
- *    enum { ... } - describe a SILC Config error
- *
- * DESCRIPTION
- *
- *    The virtual integer `errno' is returned by the silc_config_main()
- *    function and indicates what went wrong.
- *    You can convert it to the corresponding error string with the function
- *    silc_config_strerror().
- *
- * SOURCE
- */
-enum {
-  SILC_CONFIG_OK,              /* OK */
-  SILC_CONFIG_ESILENT,         /* Error defined by callback function */
-  SILC_CONFIG_EPRINTLINE,      /* Error defined by callback function */
-  SILC_CONFIG_EGENERIC,                /* Invalid syntax */
-  SILC_CONFIG_EINTERNAL,       /* Internal Error (caused by developer) */
-  SILC_CONFIG_ECANTOPEN,       /* Can't open specified file */
-  SILC_CONFIG_EOPENBRACE,      /* Expected open-brace '{' */
-  SILC_CONFIG_ECLOSEBRACE,     /* Missing close-brace '}' */
-  SILC_CONFIG_ETYPE,           /* Invalid data type */
-  SILC_CONFIG_EBADOPTION,      /* Unknown option */
-  SILC_CONFIG_EINVALIDTEXT,    /* Invalid text */
-  SILC_CONFIG_EDOUBLE,         /* Double option specification */
-  SILC_CONFIG_EEXPECTED,       /* Expected data but not found */
-  SILC_CONFIG_EEXPECTEDEQUAL,  /* Expected '=' */
-  SILC_CONFIG_EUNEXPECTED,     /* Unexpected data */
-  SILC_CONFIG_EMISSFIELDS,     /* Missing mandatory fields */
-  SILC_CONFIG_EMISSCOLON,      /* Missing ';' */
-};
-/***/
-
-/****d* silcutil/SilcConfigAPI/SilcConfigType
- *
- * NAME
- *
- *    typedef enum { ... } SilcConfigType;
- *
- * DESCRIPTION
- *
- *    This identifies the parameter type that an option has. This parameter
- *    is very important because the callback's *val pointer points to a
- *    memory location containing the previously specified data type.
- *    For example, if you specified an option with an integer parameter
- *    callback's *val will be a pointer to an integer.
- *
- * SOURCE
- */
-typedef enum {
-  SILC_CONFIG_ARG_TOGGLE,      /* TOGGLE on,off; yes,no; true, false; */
-  SILC_CONFIG_ARG_INT,         /* callback wants an integer */
-  SILC_CONFIG_ARG_STR,         /* callback expects \0-terminated str */
-  SILC_CONFIG_ARG_STRE,                /* same as above, but can also be empty */
-  SILC_CONFIG_ARG_BLOCK,       /* this is a sub-block */
-  SILC_CONFIG_ARG_SIZE,                /* like int, but accepts suffixes kMG */
-  SILC_CONFIG_ARG_NONE,                /* does not expect any args */
-} SilcConfigType;
-/***/
-
-/****f* silcutil/SilcConfigAPI/SilcConfigCallback
- *
- * SYNOPSIS
- *
- *    typedef int (*SilcConfigCallback)(SilcConfigType type, const char *name,
- *                                      SilcUInt32 line, void *val,
- *                                      void *context);
- * DESCRIPTION
- *
- *    This is the callback prototype for the options handler.  The pointer
- *    `val' points to a location of type described by `type'.  `name' points
- *    to a null-terminated string with the name of the option which triggered
- *    this callback, that is stated at line `line'.  `context' is the
- *    user-specified context provided when this option was registered.
- *
- ***/
-typedef int (*SilcConfigCallback)(SilcConfigType type, const char *name,
-                                 SilcUInt32 line, void *val, void *context);
-
-/****s* silcutil/SilcConfigAPI/SilcConfigTable
- *
- * SYNOPSIS
- *
- *    typedef struct { ... } SilcConfigTable;
- *
- * DESCRIPTION
- *
- *    SILC Config table defines an easy and quick way of registering options
- *    in an entity. The function silc_config_register_table() will take as
- *    argument a SilcConfigTable array terminated by a NULL struct, it is
- *    important thus, that the `name' field of the terminating struct is set
- *    to NULL.
- *
- *    char *name
- *
- *       The option name lowercase. The matching is always case-insensitive,
- *       but for convention the option specification must always be lowercase.
- *
- *    SilcConfigType type
- *
- *       This specifies what kind of parameter this option expects.  The
- *       special cases SILC_CONFIG_ARG_BLOCK tells SILC Config that this is
- *       not a normal option but the name of a sub-block of the current
- *       block (there is no limit to the number of nested blocks allowed).
- *
- *    SilcConfigCallback callback
- *
- *       Normally this is the value handler of the current option. If this
- *       field is set to NULL then the value is silently discarded. Useful
- *       for example to support deprecated options.
- *
- *    SilcConfigTable *subtable
- *
- *       If the `type' field is set to SILC_CONFIG_ARG_BLOCK, then this field
- *       must point to a valid sub-table NULL-terminated array. If `type' is
- *       something else, this valued is unused.
- *
- ***/
-typedef struct SilcConfigTableStruct {
-  char *name;
-  SilcConfigType type;
-  SilcConfigCallback callback;
-  const struct SilcConfigTableStruct *subtable;
-} SilcConfigTable;
-
-/****s* silcutil/SilcConfigAPI/SilcConfigFile
- *
- * SYNOPSIS
- *
- *    typedef struct SilcConfigFileObject SilcConfigFile;
- *
- * DESCRIPTION
- *
- *    A File object holds the data contained in a previously loaded file by
- *    the silc_config_open() function.
- *    This is an internally allocated struct and must be used only with the
- *    helper functions.
- *
- ***/
-typedef struct SilcConfigFileObject SilcConfigFile;
-
-/****s* silcutil/SilcConfigAPI/SilcConfigEntity
- *
- * SYNOPSIS
- *
- *    typedef struct SilcConfigEntityObject *SilcConfigEntity;
- *
- * DESCRIPTION
- *
- *    The SILC Config is based on config entities.  An entity contains the
- *    SilcConfigFile object we are parsing and the registered options.
- *
- ***/
-typedef struct SilcConfigEntityObject *SilcConfigEntity;
-
-/* Macros */
-
-/****d* silcutil/SilcConfigAPI/SILC_CONFIG_CALLBACK
- *
- * NAME
- *
- *    #define SILC_CONFIG_CALLBACK ...
- *
- * DESCRIPTION
- *
- *    Generic macro to define SilcConfigCallback functions. This defines a
- *    static function with name `func' as a config callback function.
- *
- * SOURCE
- */
-#define SILC_CONFIG_CALLBACK(func)                             \
-static int func(SilcConfigType type, const char *name,         \
-               SilcUInt32 line, void *val, void *context)
-/***/
-
-/* Prototypes */
-
-/****f* silcutil/SilcConfigAPI/silc_config_open
- *
- * SYNOPSIS
- *
- *    SilcConfigFile *silc_config_open(char *configfile);
- *
- * DESCRIPTION
- *
- *    Tries to open the config file `configfile' and returns a valid File
- *    object on success, or NULL on failure.
- *    An File object created this way must be destroyed with the function
- *    silc_config_close().
- *
- ***/
-SilcConfigFile *silc_config_open(const char *configfile);
-
-/****f* silcutil/SilcConfigAPI/silc_config_close
- *
- * SYNOPSIS
- *
- *    void silc_config_close(SilcConfigFile *file);
- *
- * DESCRIPTION
- *
- *    Closes and frees the File object `file', which must have been returned
- *    by a previous call to silc_config_open().  Otherwise, or if
- *    this function has already been called before for the same File object,
- *    undefined behaviour occurs.
- *    If `file' is NULL, no operation is performed.
- *
- ***/
-void silc_config_close(SilcConfigFile *file);
-
-/****f* silcutil/SilcConfigAPI/silc_config_init
- *
- * SYNOPSIS
- *
- *    SilcConfigEntity silc_config_init(SilcConfigFile *file);
- *
- * DESCRIPTION
- *
- *    Creates an Entity pointing to the valid File object `file', which must
- *    be returned by a previous call to silc_config_open(), otherwise NULL
- *    is returned.
- *    Entities will be automatically destroyed after the call to the
- *    silc_config_main() function, because of this no uninit functions are
- *    provided.
- *
- ***/
-SilcConfigEntity silc_config_init(SilcConfigFile *file);
-
-/****f* silcutil/SilcConfigAPI/silc_config_strerror
- *
- * SYNOPSIS
- *
- *    char *silc_config_strerror(int errnum);
- *
- * DESCRIPTION
- *
- *    The silc_config_strerror() function returns a string describing the
- *    error code passed in the argument `errnum'.
- *
- ***/
-char *silc_config_strerror(int errnum);
-
-/****f* silcutil/SilcConfigAPI/silc_config_get_filename
- *
- * SYNOPSIS
- *
- *    char *silc_config_get_filename(SilcConfigFile *file);
- *
- * DESCRIPTION
- *
- *    Returns the original filename of the object file.
- *    The returned pointer points to internally allocated storage and must
- *    not be freed, modified or stored.
- *
- ***/
-char *silc_config_get_filename(SilcConfigFile *file);
-
-/****f* silcutil/SilcConfigAPI/silc_config_get_line
- *
- * SYNOPSIS
- *
- *    SilcUInt32 silc_config_get_line(SilcConfigFile *file);
- *
- * DESCRIPTION
- *
- *    Returns the current line that file parsing arrived at.
- *
- ***/
-SilcUInt32 silc_config_get_line(SilcConfigFile *file);
-
-/****f* silcutil/SilcConfigAPI/silc_config_read_line
- *
- * SYNOPSIS
- *
- *    char *silc_config_read_line(SilcConfigFile *file, SilcUInt32 line);
- *
- * DESCRIPTION
- *
- *    Returns a dynamically allocated null-terminated buffer containing the
- *    line `line' of `file'.
- *    The returned pointer must be freed when it's not needed any longer.
- *
- * SEE ALSO
- *    silc_config_read_current_line
- *
- ***/
-char *silc_config_read_line(SilcConfigFile *file, SilcUInt32 line);
-
-/****f* silcutil/SilcConfigAPI/silc_config_read_current_line
- *
- * SYNOPSIS
- *
- *    char *silc_config_read_current_line(SilcConfigFile *file);
- *
- * DESCRIPTION
- *
- *    Returns a dynamically allocated buffer containing the line that the
- *    parser stopped at.  This is a convenience function for
- *    silc_config_read_line.
- *    The returned pointer must be freed when it's not needed any longer.
- *
- ***/
-char *silc_config_read_current_line(SilcConfigFile *file);
-
-/****f* silcutil/SilcConfigAPI/silc_config_register
- *
- * SYNOPSIS
- *
- *    SilcBool silc_config_register(SilcConfigEntity ent, const char *name,
- *                              SilcConfigType type, SilcConfigCallback cb,
- *                              const SilcConfigTable *subtable,
- *                              void *context);
- *
- * DESCRIPTION
- *
- *    Register option `name' in the entity `ent'. If `cb' is not NULL, it
- *    will be called with the *val pointer pointing to an internally
- *    allocated storage of type described by `type'.
- *
- *    If `type' is SILC_CONFIG_ARG_BLOCK, then `subtable' must be a valid
- *    pointer to a SilcConfigTable array specifying the options in the
- *    sub-block.
- *
- *    If the option `name' was already registered in this sub-block or it
- *    matches the reserved word "Include", then this function returns FALSE,
- *    otherwise it returns TRUE.
- *
- * SEE ALSO
- *    silc_config_register_table
- *
- ***/
-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
- *
- * SYNOPSIS
- *
- *    SilcBool silc_config_register_table(SilcConfigEntity ent,
- *                                    const SilcConfigTable table[],
- *                                    void *context);
- *
- * DESCRIPTION
- *
- *    Register the tableset of options `table' automatically in the entity
- *    `ent'.  If defined in the table, the callback functions will be called
- *    all with the same context `context'.
- *
- *    The `table' array must be terminated with an entry with the name field
- *    set to NULL.
- *
- *    If the table contains invalid data this function returns FALSE, otherwise
- *    it returns TRUE.  If a calling to this function failed, you must destroy
- *    and recreate the entity before retrying, as it's impossible to detect
- *    the point at the function stopped the registering process.
- *
- * SEE ALSO
- *    SilcConfigTable
- *
- ***/
-SilcBool silc_config_register_table(SilcConfigEntity ent,
-                               const SilcConfigTable table[], void *context);
-
-/****f* silcutil/SilcConfigAPI/silc_config_main
- *
- * SYNOPSIS
- *
- *    int silc_config_main(SilcConfigEntity ent);
- *
- * DESCRIPTION
- *
- *    Enter the main parsing loop. When this function returns the parsing
- *    is finished in the current block (and sub-blocks).
- *
- *    When this function exits, the entity is already destroyed, because
- *    of this you should set it to NULL right after the function call.
- *
- ***/
-int silc_config_main(SilcConfigEntity ent);
-
-#endif /* !SILCCONFIG_H */
diff --git a/lib/silcutil/silcdlist.h b/lib/silcutil/silcdlist.h
deleted file mode 100644 (file)
index 87dfb4c..0000000
+++ /dev/null
@@ -1,306 +0,0 @@
-/*
-
-  silcdlist.h
-
-  Author: Pekka Riikonen <priikone@silcnet.org>
-
-  Copyright (C) 2000 - 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 SILDCLIST_H
-#define SILDCLIST_H
-
-#include "silclist.h"
-
-/****h* silcutil/SILC Dynamic List Interface
- *
- * DESCRIPTION
- *
- * SILC Dynamic List API can be used to add opaque contexts to list that
- * will automatically allocate list entries.  Normal SILC List API cannot
- * be used for this purpose because in that case the context passed to the
- * list must be defined as list structure already.  This is not the case in
- * SilcDList.  But SilcDList is a bit slower than SilcList because it
- * requires memory allocation when adding new entries to the list.
- *
- * SILC Dynamic List is not thread-safe.  If the same list context must be
- * used in multithreaded environment concurrency control must be employed.
- *
- ***/
-
-/****s* silcutil/SilcDListAPI/SilcDList
- *
- * NAME
- *
- *    typedef struct { ... } *SilcDList;
- *
- * DESCRIPTION
- *
- *    This is the actual SilcDList object that is used by application.
- *    Application defines this object and adds contexts to this list with
- *    Dynamic List Interface functions.
- *
- ***/
-typedef struct SilcDListStruct {
-  SilcList list;
-  void *current;
-  void *prev;
-} *SilcDList;
-
-/* SilcDListEntry structure, one entry in the list. This MUST NOT be used
-   directly by the application. */
-typedef struct SilcDListEntryStruct {
-  void *context;
-  struct SilcDListEntryStruct *next;
-  struct SilcDListEntryStruct *prev;
-} *SilcDListEntry;
-
-/****f* silcutil/SilcDListAPI/silc_dlist_init
- *
- * SYNOPSIS
- *
- *    static inline
- *    SilcDList silc_dlist_init(void);
- *
- * DESCRIPTION
- *
- *    Initializes SilcDList.
- *
- ***/
-
-static inline
-SilcDList silc_dlist_init(void)
-{
-  SilcDList list;
-
-  list = (SilcDList)silc_malloc(sizeof(*list));
-  if (!list)
-    return NULL;
-  list->current = list->prev = NULL;
-  silc_list_init_prev(list->list, struct SilcDListEntryStruct, next, prev);
-
-  return list;
-}
-
-/****f* silcutil/SilcDListAPI/silc_dlist_uninit
- *
- * SYNOPSIS
- *
- *    static inline
- *    void silc_dlist_uninit(SilcDList list);
- *
- * DESCRIPTION
- *
- *    Uninits and frees all memory. Must be called to free memory. Does NOT
- *    free the contexts saved by caller.
- *
- ***/
-
-static inline
-void silc_dlist_uninit(SilcDList list)
-{
-  if (list) {
-    SilcDListEntry e;
-    silc_list_start(list->list);
-    while ((e = (SilcDListEntry)silc_list_get(list->list)) != SILC_LIST_END) {
-      silc_list_del(list->list, e);
-      silc_free(e);
-    }
-    silc_free(list);
-  }
-}
-
-/****f* silcutil/SilcDListAPI/silc_dlist_count
- *
- * SYNOPSIS
- *
- *    static inline
- *    int silc_dlist_count(SilcDList list);
- *
- * DESCRIPTION
- *
- * Return the number of entries in the list.
- *
- ***/
-
-static inline
-int silc_dlist_count(SilcDList list)
-{
-  return silc_list_count(list->list);
-}
-
-/****f* silcutil/SilcDListAPI/silc_dlist_start
- *
- * SYNOPSIS
- *
- *    static inline
- *    void silc_dlist_start(SilcDList list);
- *
- * DESCRIPTION
- *
- *    Set the start of the list. This prepares the list for traversing entries
- *    from the start of the list towards end of the list.
- *
- ***/
-
-static inline
-void silc_dlist_start(SilcDList list)
-{
-  silc_list_start(list->list);
-  list->current = list->prev = NULL;
-}
-
-/****f* silcutil/SilcDListAPI/silc_dlist_end
- *
- * SYNOPSIS
- *
- *    static inline
- *    void silc_dlist_end(SilcDList list);
- *
- * DESCRIPTION
- *
- *    Set the end of the list. This prepares the list for traversing entries
- *    from the end of the list towards start of the list.
- *
- ***/
-
-static inline
-void silc_dlist_end(SilcDList list)
-{
-  silc_list_end(list->list);
-  list->current = list->prev = NULL;
-}
-
-/****f* silcutil/SilcDListAPI/silc_dlist_add
- *
- * SYNOPSIS
- *
- *    static inline
- *    SilcBool silc_dlist_add(SilcDList list, void *context);
- *
- * DESCRIPTION
- *
- *    Adds new entry to the list. This is the default function to add new
- *    entries to the list.
- *
- ***/
-
-static inline
-SilcBool silc_dlist_add(SilcDList list, void *context)
-{
-  SilcDListEntry e = (SilcDListEntry)silc_malloc(sizeof(*e));
-  if (silc_unlikely(!e))
-    return FALSE;
-  e->context = context;
-  silc_list_add(list->list, e);
-  return TRUE;
-}
-
-/****f* silcutil/SilcDList/silc_dlist_insert
- *
- * SYNOPSIS
- *
- *    static inline
- *    SilcBool silc_dlist_insert(SilcDList list, void *context);
- *
- * DESCRIPTION
- *
- *    Insert new entry to the list between current and previous entry.
- *    If list is at the start this adds the entry at head of the list.
- *    Use silc_dlist_add to add at the end of the list.
- *
- ***/
-
-static inline
-SilcBool silc_dlist_insert(SilcDList list, void *context)
-{
-  SilcDListEntry e = (SilcDListEntry)silc_malloc(sizeof(*e));
-  if (silc_unlikely(!e))
-    return FALSE;
-  e->context = context;
-  silc_list_insert(list->list, list->prev, e);
-  return TRUE;
-}
-
-/****f* silcutil/SilcDListAPI/silc_dlist_del
- *
- * SYNOPSIS
- *
- *    static inline
- *    void silc_dlist_del(SilcDList list, void *entry);
- *
- * DESCRIPTION
- *
- *    Remove entry from the list.
- *
- ***/
-
-static inline
-void silc_dlist_del(SilcDList list, void *entry)
-{
-  SilcDListEntry e;
-
-  silc_list_start(list->list);
-  while ((e = (SilcDListEntry)silc_list_get(list->list)) != SILC_LIST_END) {
-    if (e->context == entry) {
-      silc_list_del(list->list, e);
-#if defined(SILC_DEBUG)
-      memset(e, 'F', sizeof(*e));
-#endif
-      if (list->current == e)
-       list->current = NULL;
-      if (list->prev == e)
-       list->prev = NULL;
-      silc_free(e);
-      break;
-    }
-  }
-}
-
-/****f* silcutil/SilcDListAPI/silc_dlist_get
- *
- * SYNOPSIS
- *
- *    static inline
- *    void *silc_dlist_get(SilcDList list);
- *
- * DESCRIPTION
- *
- *    Returns current entry from the list and moves the list pointer forward
- *    so that calling this next time returns the next entry from the list.
- *    This can be used to traverse the list. Return SILC_LIST_END when the
- *    entire list has been traversed. Later, silc_list_start (or
- *    silc_dlist_end) must be called again when re-starting list traversing.
- *
- * EXAMPLE
- *
- *    // Traverse the list from the beginning to the end
- *    silc_dlist_start(list)
- *    while ((entry = silc_dlist_get(list)) != SILC_LIST_END) {
- *      ...
- *    }
- *
- ***/
-
-static inline
-void *silc_dlist_get(SilcDList list)
-{
-  SilcDListEntry e;
-  list->prev = list->current;
-  list->current = e = (SilcDListEntry)silc_list_get(list->list);
-  if (e != SILC_LIST_END)
-    return e->context;
-  return SILC_LIST_END;
-}
-
-#endif
diff --git a/lib/silcutil/silcfdstream.c b/lib/silcutil/silcfdstream.c
deleted file mode 100644 (file)
index 1ae8d41..0000000
+++ /dev/null
@@ -1,344 +0,0 @@
-/*
-
-  silcfdstream.c
-
-  Author: Pekka Riikonen <priikone@silcnet.org>
-
-  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
-  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.
-
-*/
-
-#include "silc.h"
-
-/************************** Types and definitions ***************************/
-
-#define SILC_IS_FD_STREAM(s) (s && s->ops == &silc_fd_stream_ops)
-
-const SilcStreamOps silc_fd_stream_ops;
-
-/* FD stream context */
-typedef struct {
-  const SilcStreamOps *ops;
-  SilcSchedule schedule;
-  SilcStreamNotifier notifier;
-  void *notifier_context;
-  int fd1;
-  int fd2;
-  int error;
-} *SilcFDStream;
-
-
-/************************ Static utility functions **************************/
-
-/* The IO process callback that calls the notifier callback to upper layer. */
-
-SILC_TASK_CALLBACK(silc_fd_stream_io)
-{
-  SilcFDStream stream = context;
-
-  if (!stream->notifier)
-    return;
-
-  switch (type) {
-  case SILC_TASK_READ:
-    stream->notifier(stream, SILC_STREAM_CAN_READ, stream->notifier_context);
-    break;
-
-  case SILC_TASK_WRITE:
-    stream->notifier(stream, SILC_STREAM_CAN_WRITE, stream->notifier_context);
-    break;
-
-  default:
-    break;
-  }
-}
-
-
-/****************************** Public API **********************************/
-
-/* Create file descriptor stream */
-
-SilcStream silc_fd_stream_create(int fd)
-{
-  if (fd < 1)
-    return NULL;
-  return silc_fd_stream_create2(fd, 0);
-}
-
-/* Create stream with two file descriptors */
-
-SilcStream silc_fd_stream_create2(int read_fd, int write_fd)
-{
-  SilcFDStream stream;
-
-  stream = silc_calloc(1, sizeof(*stream));
-  if (!stream)
-    return NULL;
-
-  SILC_LOG_DEBUG(("Creating new fd stream %p", stream));
-
-  stream->ops = &silc_fd_stream_ops;
-  stream->fd1 = read_fd;
-  stream->fd2 = write_fd;
-
-  return stream;
-}
-
-/* Create by opening file */
-
-SilcStream silc_fd_stream_file(const char *filename, SilcBool reading,
-                              SilcBool writing)
-{
-  const char *read_file = NULL, *write_file = NULL;
-
-  if (!filename)
-    return NULL;
-
-  if (writing)
-    write_file = filename;
-  if (reading)
-    read_file = filename;
-
-  return silc_fd_stream_file2(read_file, write_file);
-}
-
-/* Create by opening two files */
-
-SilcStream silc_fd_stream_file2(const char *read_file, const char *write_file)
-{
-  SilcStream stream;
-  int fd1 = 0, fd2 = 0;
-
-  SILC_LOG_DEBUG(("Creating new fd stream for reading `%s' and writing `%s'",
-                 read_file ? read_file : "(none)",
-                 write_file ? write_file : "(none)"));
-
-  if (write_file) {
-    fd2 = silc_file_open(write_file, O_CREAT | O_WRONLY);
-    if (fd2 < 0) {
-      silc_file_close(fd1);
-      return NULL;
-    }
-  }
-
-  if (read_file) {
-    fd1 = silc_file_open(read_file, O_RDONLY);
-    if (fd1 < 0)
-      return NULL;
-  }
-
-  stream = silc_fd_stream_create2(fd1, fd2);
-  if (!stream) {
-    silc_file_close(fd1);
-    silc_file_close(fd2);
-  }
-
-  return stream;
-}
-
-/* Return fds */
-
-SilcBool silc_fd_stream_get_info(SilcStream stream, int *read_fd,
-                                int *write_fd)
-{
-  SilcFDStream fd_stream = stream;
-
-  if (!SILC_IS_FD_STREAM(fd_stream))
-    return FALSE;
-
-  if (read_fd)
-    *read_fd = fd_stream->fd1;
-  if (write_fd)
-    *write_fd = fd_stream->fd2;
-
-  return TRUE;
-}
-
-/* Return errno */
-
-int silc_fd_stream_get_error(SilcStream stream)
-{
-  SilcFDStream fd_stream = stream;
-
-  if (!SILC_IS_FD_STREAM(fd_stream))
-    return 0;
-
-  return fd_stream->error;
-}
-
-/* Read */
-
-int silc_fd_stream_read(SilcStream stream, unsigned char *buf,
-                       SilcUInt32 buf_len)
-{
-  SilcFDStream fd_stream = stream;
-  int len = 0;
-
-  if (!fd_stream->notifier)
-    return -2;
-
-  SILC_LOG_DEBUG(("Reading data from fd %d", fd_stream->fd1));
-
-  len = silc_file_read(fd_stream->fd1, buf, buf_len);
-  if (len < 0) {
-    if (errno == EAGAIN || errno == EINTR) {
-      SILC_LOG_DEBUG(("Could not read immediately, will do it later"));
-      silc_schedule_set_listen_fd(fd_stream->schedule, fd_stream->fd1,
-                                 SILC_TASK_READ, FALSE);
-      return -1;
-    }
-    SILC_LOG_DEBUG(("Cannot read from fd: %d:%s",
-                   fd_stream->fd1, strerror(errno)));
-    silc_schedule_unset_listen_fd(fd_stream->schedule, fd_stream->fd1);
-    fd_stream->error = errno;
-    return -2;
-  }
-
-  SILC_LOG_DEBUG(("Read %d bytes", len));
-
-  if (!len)
-    silc_schedule_unset_listen_fd(fd_stream->schedule, fd_stream->fd1);
-
-  return len;
-}
-
-/* Write */
-
-int silc_fd_stream_write(SilcStream stream, const unsigned char *data,
-                        SilcUInt32 data_len)
-{
-  SilcFDStream fd_stream = stream;
-  int ret;
-
-  if (!fd_stream->notifier)
-    return -2;
-
-  SILC_LOG_DEBUG(("Writing data to fd %d", fd_stream->fd2));
-
-  ret = silc_file_write(fd_stream->fd2, data, data_len);
-  if (ret < 0) {
-    if (errno == EAGAIN || errno == EINTR) {
-      SILC_LOG_DEBUG(("Could not write immediately, will do it later"));
-      silc_schedule_set_listen_fd(fd_stream->schedule, fd_stream->fd2,
-                                 SILC_TASK_READ | SILC_TASK_WRITE, FALSE);
-      return -1;
-    }
-    SILC_LOG_DEBUG(("Cannot write to fd: %s", strerror(errno)));
-    silc_schedule_unset_listen_fd(fd_stream->schedule, fd_stream->fd2);
-    fd_stream->error = errno;
-    return -2;
-  }
-
-  SILC_LOG_DEBUG(("Wrote data %d bytes", ret));
-
-  if (fd_stream->fd1 == fd_stream->fd2)
-    silc_schedule_set_listen_fd(fd_stream->schedule, fd_stream->fd2,
-                               SILC_TASK_READ, FALSE);
-  else
-    silc_schedule_unset_listen_fd(fd_stream->schedule, fd_stream->fd2);
-
-  return ret;
-}
-
-/* Close stream */
-
-SilcBool silc_fd_stream_close(SilcStream stream)
-{
-  SilcFDStream fd_stream = stream;
-
-  if (fd_stream->fd1 > 0) {
-    silc_file_close(fd_stream->fd1);
-    if (fd_stream->schedule) {
-      silc_schedule_unset_listen_fd(fd_stream->schedule, fd_stream->fd1);
-      silc_schedule_task_del_by_fd(fd_stream->schedule, fd_stream->fd1);
-    }
-  }
-  if (fd_stream->fd2 > 0 && fd_stream->fd2 != fd_stream->fd1) {
-    silc_file_close(fd_stream->fd2);
-    if (fd_stream->schedule) {
-      silc_schedule_unset_listen_fd(fd_stream->schedule, fd_stream->fd2);
-      silc_schedule_task_del_by_fd(fd_stream->schedule, fd_stream->fd2);
-    }
-  }
-
-  return TRUE;
-}
-
-/* Destroy stream */
-
-void silc_fd_stream_destroy(SilcStream stream)
-{
-  silc_fd_stream_close(stream);
-  silc_free(stream);
-}
-
-/* Sets stream notification callback for the stream */
-
-SilcBool silc_fd_stream_notifier(SilcStream stream,
-                                SilcSchedule schedule,
-                                SilcStreamNotifier callback,
-                                void *context)
-{
-  SilcFDStream fd_stream = stream;
-
-  SILC_LOG_DEBUG(("Setting stream notifier callback"));
-
-  fd_stream->notifier = callback;
-  fd_stream->notifier_context = context;
-  fd_stream->schedule = schedule;
-
-  /* Schedule the file descriptors */
-  if (schedule) {
-    if (fd_stream->fd2 > 0) {
-      silc_schedule_task_add_fd(schedule, fd_stream->fd2,
-                               silc_fd_stream_io, stream);
-      silc_file_set_nonblock(fd_stream->fd2);
-    }
-    if (fd_stream->fd1 > 0) {
-      silc_schedule_task_add_fd(schedule, fd_stream->fd1,
-                               silc_fd_stream_io, stream);
-      silc_schedule_set_listen_fd(schedule, fd_stream->fd1,
-                                 SILC_TASK_READ, FALSE);
-      silc_file_set_nonblock(fd_stream->fd1);
-      if (fd_stream->fd2 < 1)
-       fd_stream->fd2 = fd_stream->fd1;
-    }
-  } else {
-    if (fd_stream->schedule) {
-      silc_schedule_unset_listen_fd(fd_stream->schedule, fd_stream->fd1);
-      silc_schedule_unset_listen_fd(fd_stream->schedule, fd_stream->fd2);
-      silc_schedule_task_del_by_fd(fd_stream->schedule, fd_stream->fd1);
-      silc_schedule_task_del_by_fd(fd_stream->schedule, fd_stream->fd2);
-    }
-  }
-
-  return TRUE;
-}
-
-/* Return schedule */
-
-SilcSchedule silc_fd_stream_get_schedule(SilcStream stream)
-{
-  SilcFDStream fd_stream = stream;
-  return fd_stream->schedule;
-}
-
-/* File descriptor stream operations */
-const SilcStreamOps silc_fd_stream_ops =
-{
-  silc_fd_stream_read,
-  silc_fd_stream_write,
-  silc_fd_stream_close,
-  silc_fd_stream_destroy,
-  silc_fd_stream_notifier,
-  silc_fd_stream_get_schedule
-};
diff --git a/lib/silcutil/silcfdstream.h b/lib/silcutil/silcfdstream.h
deleted file mode 100644 (file)
index f64d6b5..0000000
+++ /dev/null
@@ -1,144 +0,0 @@
-/*
-
-  silcfdstream.h
-
-  Author: Pekka Riikonen <priikone@silcnet.org>
-
-  Copyright (C) 2005 - 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.
-
-*/
-
-/****h* silcutil/SILC File Descriptor Stream Interface
- *
- * DESCRIPTION
- *
- * Implementation of SILC File Descriptor Stream.  The file descriptor
- * stream can be used read from and write to a file descriptor.  This
- * interface should be used only with real file descriptors, not with
- * sockets.  Use the SILC Socket Stream for sockets.
- *
- * SILC File Descriptor Stream is not thread-safe.  If same stream must be
- * used in multithreaded environment concurrency control must be employed.
- *
- ***/
-
-#ifndef SILCFDSTREAM_H
-#define SILCFDSTREAM_H
-
-/****f* silcutil/SilcFDStreamAPI/silc_fd_stream_create
- *
- * SYNOPSIS
- *
- *    SilcStream silc_fd_stream_create(int fd);
- *
- * DESCRIPTION
- *
- *    Creates file descriptor stream for the open file descriptor indicated
- *    by `fd'.  The stream is closed with the silc_stream_close and destroyed
- *    with the silc_stream_destroy.
- *
- *    If the silc_stream_set_notifier is called the stream is set to
- *    non-blocking mode.
- *
- ***/
-SilcStream silc_fd_stream_create(int fd);
-
-/****f* silcutil/SilcFDStreamAPI/silc_fd_stream_create2
- *
- * SYNOPSIS
- *
- *    SilcStream silc_fd_stream_create2(int read_fd, int write_fd);
- *
- * DESCRIPTION
- *
- *    Creates file descriptor stream for the open file descriptors indicated
- *    by `read_fd' and `write_fd'.  The `read_fd' must be opened for reading
- *    and `write_fd' opened for writing.  The stream is closed with the
- *    silc_stream_close and destroyed with the silc_stream_destroy.
- *
- *    If the silc_stream_set_notifier is called the stream is set to
- *    non-blocking mode.
- *
- ***/
-SilcStream silc_fd_stream_create2(int read_fd, int write_fd);
-
-/****f* silcutil/SilcFDStreamAPI/silc_fd_stream_file
- *
- * SYNOPSIS
- *
- *    SilcStream silc_fd_stream_file(const char *filename, SilcBool reading,
- *                                   SilcBool writing);
- *
- * DESCRIPTION
- *
- *    Same as silc_fd_stream_create but creates the stream by opening the
- *    file indicated by `filename'.  If the `reading' is TRUE the file is
- *    opened for reading.  If the `writing' is TRUE the file is opened
- *    for writing.
- *
- *    If the silc_stream_set_notifier is called the stream is set to
- *    non-blocking mode.
- *
- ***/
-SilcStream silc_fd_stream_file(const char *filename, SilcBool reading,
-                              SilcBool writing);
-
-/****f* silcutil/SilcFDStreamAPI/silc_fd_stream_file2
- *
- * SYNOPSIS
- *
- *    SilcStream silc_fd_stream_file2(const char *read_file,
- *                                    const char *write_file);
- *
- * DESCRIPTION
- *
- *    Same as silc_fd_stream_file but creates the stream by opening `read_file'
- *    for reading and `write_file' for writing.
- *
- *    If the silc_stream_set_notifier is called the stream is set to
- *    non-blocking mode.
- *
- ***/
-SilcStream silc_fd_stream_file2(const char *read_file, const char *write_file);
-
-/****f* silcutil/SilcFDStreamAPI/silc_fd_stream_get_info
- *
- * SYNOPSIS
- *
- *    SilcBool
- *    silc_fd_stream_get_info(SilcStream stream, int *read_fd, int *write_fd);
- *
- * DESCRIPTION
- *
- *    Returns the file descriptors associated with the stream.  The 'write_fd'
- *    is available only if the stream was created with silc_fd_stream_create2
- *    function.
- *
- ***/
-SilcBool silc_fd_stream_get_info(SilcStream stream,
-                                int *read_fd, int *write_fd);
-
-/****f* silcutil/SilcFDStreamAPI/silc_fd_stream_get_error
- *
- * SYNOPSIS
- *
- *    int silc_fd_stream_get_error(SilcStream stream);
- *
- * DESCRIPTION
- *
- *    If error occurred during file descriptor stream operations, this
- *    function can be used to retrieve the error number that occurred.
- *
- ***/
-int silc_fd_stream_get_error(SilcStream stream);
-
-#endif /* SILCFDSTREAM_H */
diff --git a/lib/silcutil/silcfileutil.c b/lib/silcutil/silcfileutil.c
deleted file mode 100644 (file)
index 02620b0..0000000
+++ /dev/null
@@ -1,196 +0,0 @@
-/*
-
-  silcfileutil.c
-
-  Author: Pekka Riikonen <priikone@silcnet.org>
-
-  Copyright (C) 1997 - 2007 Pekka Riikonen
-
-  This program is free software; you can redistribute it and/or modify
-  it under the terms of the GNU General Public License as published by
-  the Free Software Foundation; version 2 of the License.
-
-  This program is distributed in the hope that it will be useful,
-  but WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-  GNU General Public License for more details.
-
-*/
-/* $Id$ */
-
-#include "silc.h"
-
-/* Opens a file indicated by the filename `filename' with flags indicated
-   by the `flags'. */
-
-int silc_file_open(const char *filename, int flags)
-{
-  return silc_file_open_mode(filename, flags, 0600);
-}
-
-/* Opens a file indicated by the filename `filename' with flags indicated
-   by the `flags', and with the specified `mode'. */
-
-int silc_file_open_mode(const char *filename, int flags, int mode)
-{
-  int fd = open(filename, flags, mode);
-  return fd;
-}
-
-/* Reads data from file descriptor `fd' to `buf'. */
-
-int silc_file_read(int fd, unsigned char *buf, SilcUInt32 buf_len)
-{
-  return read(fd, (void *)buf, buf_len);
-}
-
-/* Writes `buffer' of length of `len' to file descriptor `fd'. */
-
-int silc_file_write(int fd, const char *buffer, SilcUInt32 len)
-{
-  return write(fd, (const void *)buffer, len);
-}
-
-/* Closes file descriptor */
-
-int silc_file_close(int fd)
-{
-  return close(fd);
-}
-
-/* Writes a buffer to the file. */
-
-int silc_file_writefile(const char *filename, const char *buffer,
-                       SilcUInt32 len)
-{
-  int fd;
-  int flags = O_CREAT | O_WRONLY | O_TRUNC;
-
-#if defined(O_BINARY)
-  flags |= O_BINARY;
-#endif /* O_BINARY */
-
-  if ((fd = open(filename, flags, 0644)) == -1) {
-    SILC_LOG_ERROR(("Cannot open file %s for writing: %s", filename,
-                   strerror(errno)));
-    return -1;
-  }
-
-  if (silc_file_write(fd, buffer, len) == -1) {
-    SILC_LOG_ERROR(("Cannot write to file %s: %s", filename, strerror(errno)));
-    silc_file_close(fd);
-    return -1;
-  }
-
-#ifdef SILC_UNIX
-  fsync(fd);
-#endif /* SILC_UNIX */
-
-  return silc_file_close(fd);
-}
-
-/* Writes a buffer to the file.  If the file is created specific mode is
-   set to the file. */
-
-int silc_file_writefile_mode(const char *filename, const char *buffer,
-                            SilcUInt32 len, int mode)
-{
-  int fd;
-  int flags = O_CREAT | O_WRONLY | O_TRUNC;
-
-#if defined(O_BINARY)
-  flags |= O_BINARY;
-#endif /* O_BINARY */
-
-  if ((fd = open(filename, flags, mode)) == -1) {
-    SILC_LOG_ERROR(("Cannot open file %s for writing: %s", filename,
-                   strerror(errno)));
-    return -1;
-  }
-
-  if ((silc_file_write(fd, buffer, len)) == -1) {
-    SILC_LOG_ERROR(("Cannot write to file %s: %s", filename, strerror(errno)));
-    silc_file_close(fd);
-    return -1;
-  }
-
-#ifdef SILC_UNIX
-  fsync(fd);
-#endif /* SILC_UNIX */
-
-  return silc_file_close(fd);
-}
-
-/* Reads a file to a buffer. The allocated buffer is returned. Length of
-   the file read is returned to the return_len argument. */
-
-char *silc_file_readfile(const char *filename, SilcUInt32 *return_len)
-{
-  int fd;
-  char *buffer;
-  int filelen;
-
-  fd = silc_file_open(filename, O_RDONLY);
-  if (fd < 0) {
-    if (errno == ENOENT)
-      return NULL;
-    SILC_LOG_ERROR(("Cannot open file %s: %s", filename, strerror(errno)));
-    return NULL;
-  }
-
-  filelen = lseek(fd, (off_t)0L, SEEK_END);
-  if (filelen < 0) {
-    silc_file_close(fd);
-    return NULL;
-  }
-  if (lseek(fd, (off_t)0L, SEEK_SET) < 0) {
-    silc_file_close(fd);
-    return NULL;
-  }
-
-  if (filelen < 0) {
-    SILC_LOG_ERROR(("Cannot open file %s: %s", filename, strerror(errno)));
-    silc_file_close(fd);
-    return NULL;
-  }
-
-  buffer = silc_calloc(filelen + 1, sizeof(char));
-
-  if ((silc_file_read(fd, buffer, filelen)) == -1) {
-    memset(buffer, 0, sizeof(buffer));
-    silc_file_close(fd);
-    SILC_LOG_ERROR(("Cannot read from file %s: %s", filename,
-                    strerror(errno)));
-    return NULL;
-  }
-
-  silc_file_close(fd);
-  buffer[filelen] = EOF;
-
-  if (return_len)
-    *return_len = filelen;
-
-  return buffer;
-}
-
-/* Returns the size of `filename'. Returns 0 on error. */
-
-SilcUInt64 silc_file_size(const char *filename)
-{
-  int ret;
-  struct stat stats;
-
-#ifdef SILC_WIN32
-  ret = stat(filename, &stats);
-#endif /* SILC_WIN32 */
-#ifdef SILC_UNIX
-  ret = lstat(filename, &stats);
-#endif /* SILC_UNIX */
-#ifdef SILC_SYMBIAN
-  ret = stat(filename, &stats);
-#endif /* SILC_SYMBIAN */
-  if (ret < 0)
-    return 0;
-
-  return (SilcUInt64)stats.st_size;
-}
diff --git a/lib/silcutil/silcfileutil.h b/lib/silcutil/silcfileutil.h
deleted file mode 100644 (file)
index 80e9d99..0000000
+++ /dev/null
@@ -1,180 +0,0 @@
-/*
-
-  silcfileutil.h
-
-  Author: Pekka Riikonen <priikone@silcnet.org>
-
-  Copyright (C) 1997 - 2005 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.
-
-*/
-
-/****h* silcutil/SILC File Util Interface
- *
- * DESCRIPTION
- *
- *    The SILC File Util Interface is a small set of functions that provides a
- *    portable access method to the filesystem.
- *
- ***/
-
-#ifndef SILCFILEUTIL_H
-#define SILCFILEUTIL_H
-
-/* Prototypes */
-
-/****f* silcutil/SilcFileUtilAPI/silc_file_open
- *
- * SYNOPSIS
- *
- *    int silc_file_open(const char *filename, int flags);
- *
- * DESCRIPTION
- *
- *    Opens a file indicated by the filename `filename' with flags indicated
- *    by `flags'.  The opening permission defaults to 0600.  The `flags'
- *    are defined in open(2).
- *
- ***/
-int silc_file_open(const char *filename, int flags);
-
-/****f* silcutil/SilcFileUtilAPI/silc_file_open_mode
- *
- * SYNOPSIS
- *
- *    int silc_file_open_mode(const char *filename, int flags, int mode);
- *
- * DESCRIPTION
- *
- *    Opens a file indicated by the filename `filename' with flags indicated
- *    by `flags'.  The argument `mode' specifies the permissions to use in
- *    case a new file is created.  The `flags' are defined in open(2).
- *
- ***/
-int silc_file_open_mode(const char *filename, int flags, int mode);
-
-/****f* silcutil/SilcFileUtilAPI/silc_file_read
- *
- * SYNOPSIS
- *
- *    int silc_file_read(int fd, unsigned char *buf, SilcUInt32 buf_len);
- *
- * DESCRIPTION
- *
- *    Reads data from file descriptor `fd' to `buf'.
- *
- ***/
-int silc_file_read(int fd, unsigned char *buf, SilcUInt32 buf_len);
-
-/****f* silcutil/SilcFileUtilAPI/silc_file_write
- *
- * SYNOPSIS
- *
- *    int silc_file_write(int fd, const char *buffer, SilcUInt32 len);
- *
- * DESCRIPTION
- *
- *    Writes `buffer' of length of `len' to file descriptor `fd'.
- *
- ***/
-int silc_file_write(int fd, const char *buffer, SilcUInt32 len);
-
-/****f* silcutil/SilcFileUtilAPI/silc_file_close
- *
- * SYNOPSIS
- *
- *    int silc_file_close(int fd);
- *
- * DESCRIPTION
- *
- *    Closes file descriptor previously opened with silc_file_open().
- *
- ***/
-int silc_file_close(int fd);
-
-/****f* silcutil/SilcFileUtilAPI/silc_file_set_nonblock
- *
- * SYNOPSIS
- *
- *    int silc_file_set_nonblock(int fd);
- *
- * DESCRIPTION
- *
- *    Sets the file descriptor to non-blocking mode.
- *
- ***/
-int silc_file_set_nonblock(int fd);
-
-/****f* silcutil/SilcFileUtilAPI/silc_file_readfile
- *
- * SYNOPSIS
- *
- *    char *silc_file_readfile(const char *filename, SilcUInt32 *return_len);
- *
- * DESCRIPTION
- *
- *    Reads the content of `filename' to a buffer.  The allocated buffer is
- *    returned.  This does not NULL terminate the buffer but EOF terminate
- *    it.  The caller must replace the EOF with NULL if the buffer must be
- *    NULL terminated.
- *
- *    If the `return_len' pointer is not NULL, it's filled with the length of
- *    the file.
- *
- ***/
-char *silc_file_readfile(const char *filename, SilcUInt32 *return_len);
-
-/****f* silcutil/SilcFileUtilAPI/silc_file_writefile
- *
- * SYNOPSIS
- *
- *    int silc_file_writefile(const char *filename, const char *buffer,
- *                            SilcUInt32 len);
- *
- * DESCRIPTION
- *
- *    Writes a buffer to the file.  If the file is created specific mode is
- *    set to the file.
- *
- ***/
-int silc_file_writefile(const char *filename, const char *buffer,
-                       SilcUInt32 len);
-
-/****f* silcutil/SilcFileUtilAPI/silc_file_writefile_mode
- *
- * SYNOPSIS
- *
- *    int silc_file_writefile_mode(const char *filename, const char *buffer,
- *                                 SilcUInt32 len, int mode);
- *
- * DESCRIPTION
- *
- *    Writes a buffer to the file.  If the file is created the specified `mode'
- *    is set to the file.
- *
- ***/
-int silc_file_writefile_mode(const char *filename, const char *buffer,
-                            SilcUInt32 len, int mode);
-
-/****f* silcutil/SilcFileUtilAPI/silc_file_size
- *
- * SYNOPSIS
- *
- *    SilcUInt64 silc_file_size(const char *filename);
- *
- * DESCRIPTION
- *
- *    Returns the size of `filename'. Returns 0 on error.
- *
- ***/
-SilcUInt64 silc_file_size(const char *filename);
-
-#endif /* !SILCFILEUTIL_H */
diff --git a/lib/silcutil/silcfsm.c b/lib/silcutil/silcfsm.c
deleted file mode 100644 (file)
index 3382713..0000000
+++ /dev/null
@@ -1,792 +0,0 @@
-/*
-
-  silcfsm.c
-
-  Author: Pekka Riikonen <priikone@silcnet.org>
-
-  Copyright (C) 2005 - 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.
-
-*/
-
-#include "silc.h"
-
-SILC_TASK_CALLBACK(silc_fsm_run);
-SILC_TASK_CALLBACK(silc_fsm_finish_fsm);
-SILC_TASK_CALLBACK(silc_fsm_event_timedout);
-SILC_TASK_CALLBACK(silc_fsm_start_real_thread);
-static void silc_fsm_thread_termination_signal(SilcFSMEvent event);
-static void silc_fsm_event_ref(SilcFSMEvent event);
-static void silc_fsm_event_unref(SilcFSMEvent event);
-void *silc_fsm_thread(void *context);
-
-/* Allocate FSM */
-
-SilcFSM silc_fsm_alloc(void *fsm_context,
-                       SilcFSMDestructor destructor,
-                       void *destructor_context,
-                       SilcSchedule schedule)
-{
-  SilcFSM fsm;
-
-  fsm = silc_calloc(1, sizeof(*fsm));
-  if (silc_unlikely(!fsm))
-    return NULL;
-
-  if (silc_unlikely(!silc_fsm_init(fsm, fsm_context, destructor,
-                                  destructor_context, schedule))) {
-    silc_free(fsm);
-    return NULL;
-  }
-
-  return fsm;
-}
-
-/* Initialize FSM */
-
-SilcBool silc_fsm_init(SilcFSM fsm,
-                      void *fsm_context,
-                      SilcFSMDestructor destructor,
-                      void *destructor_context,
-                      SilcSchedule schedule)
-{
-  if (!schedule)
-    return FALSE;
-
-  fsm->fsm_context = fsm_context;
-  fsm->state_context = NULL;
-  fsm->destructor = destructor;
-  fsm->destructor_context = destructor_context;
-  fsm->schedule = schedule;
-  fsm->thread = FALSE;
-  fsm->async_call = FALSE;
-  fsm->started = FALSE;
-  fsm->u.m.lock = NULL;
-  silc_atomic_init32(&fsm->u.m.threads, 0);
-
-  return TRUE;
-}
-
-/* Allocate FSM thread.  Internally machine and thread use same context. */
-
-SilcFSMThread silc_fsm_thread_alloc(SilcFSM fsm,
-                                   void *thread_context,
-                                   SilcFSMThreadDestructor destructor,
-                                   void *destructor_context,
-                                   SilcBool real_thread)
-{
-  SilcFSMThread thread;
-
-  thread = silc_calloc(1, sizeof(*thread));
-  if (silc_unlikely(!thread))
-    return NULL;
-
-  silc_fsm_thread_init(thread, fsm, thread_context, destructor,
-                      destructor_context, real_thread);
-  return thread;
-}
-
-/* Initialize FSM thread.  Internally machine and thread use same context. */
-
-void silc_fsm_thread_init(SilcFSMThread thread,
-                         SilcFSM fsm,
-                         void *thread_context,
-                         SilcFSMThreadDestructor destructor,
-                         void *destructor_context,
-                         SilcBool real_thread)
-{
-  SILC_LOG_DEBUG(("Initializing new thread %p (%s)",
-                 thread, real_thread ? "real" : "FSM"));
-
-  SILC_ASSERT(!fsm->thread);
-
-  thread->fsm_context = thread_context;
-  thread->state_context = NULL;
-  thread->destructor = (SilcFSMDestructor)destructor;
-  thread->destructor_context = destructor_context;
-  thread->schedule = fsm->schedule;
-  thread->thread = TRUE;
-  thread->async_call = FALSE;
-  thread->started = FALSE;
-  thread->real_thread = real_thread;
-  thread->u.t.fsm = fsm;
-
-  /* Add to machine */
-  silc_atomic_add_int32(&fsm->u.m.threads, 1);
-
-  /* Allocate lock for the machine if using real threads. */
-  if (real_thread && !fsm->u.m.lock)
-    if (!silc_mutex_alloc(&fsm->u.m.lock))
-      thread->real_thread = FALSE;
-}
-
-/* FSM is destroyed through scheduler to make sure that all dying
-   real system threads will have their finish callbacks scheduled before
-   this one (when SILC_FSM_THREAD_WAIT was used). */
-
-SILC_TASK_CALLBACK(silc_fsm_free_final)
-{
-  SilcFSM f = context;
-
-#if defined(SILC_DEBUG)
-  /* We must be finished */
-  SILC_ASSERT(f->finished);
-
-  /* Machine must not have active threads */
-  if (!f->thread && silc_atomic_get_int32(&f->u.m.threads))
-    SILC_ASSERT(silc_atomic_get_int32(&f->u.m.threads) == 0);
-#endif /* SILC_DEBUG */
-
-  if (!f->thread && f->u.m.lock)
-    silc_mutex_free(f->u.m.lock);
-
-  if (f->thread && f->u.t.event)
-    silc_fsm_event_free(f->u.t.event);
-
-  if (!f->thread)
-    silc_atomic_uninit32(&f->u.m.threads);
-
-  silc_free(f);
-}
-
-/* Free FSM */
-
-void silc_fsm_free(void *fsm)
-{
-  SilcFSM f = fsm;
-  if (!f->thread)
-    if (silc_schedule_task_add_timeout(f->schedule, silc_fsm_free_final,
-                                      f, 0, 0))
-      return;
-  silc_fsm_free_final(f->schedule, silc_schedule_get_context(f->schedule),
-                     0, 0, f);
-}
-
-/* Task to start real thread. We start threads through scheduler, not
-   directly in silc_fsm_start. */
-
-SILC_TASK_CALLBACK(silc_fsm_start_real_thread)
-{
-  SilcFSM f = context;
-
-#ifdef SILC_THREADS
-  if (silc_thread_create(silc_fsm_thread, f, FALSE))
-    return;
-#endif /* SILC_THREADS */
-
-  SILC_LOG_DEBUG(("Could not create real thread, using normal FSM thread"));
-
-  /* Normal FSM operation */
-  f->real_thread = FALSE;
-  silc_fsm_continue_sync(f);
-}
-
-/* Start FSM in the specified state */
-
-void silc_fsm_start(void *fsm, SilcFSMStateCallback start_state)
-{
-  SilcFSM f = fsm;
-
-  SILC_LOG_DEBUG(("Starting %s %p", f->thread ? "thread" : "FSM", fsm));
-
-  f->finished = FALSE;
-  f->next_state = start_state;
-  f->synchronous = FALSE;
-  f->started = TRUE;
-
-  /* Start real thread through scheduler */
-  if (f->thread && f->real_thread) {
-    if (!silc_schedule_task_add_timeout(f->schedule,
-                                       silc_fsm_start_real_thread,
-                                       f, 0, 0))
-      silc_fsm_start_real_thread(f->schedule,
-                                silc_schedule_get_context(f->schedule),
-                                0, 0, f);
-    silc_schedule_wakeup(f->schedule);
-    return;
-  }
-
-  /* Normal FSM operation */
-  if (!silc_schedule_task_add_timeout(f->schedule, silc_fsm_run, f, 0, 0))
-    silc_fsm_run(f->schedule, silc_schedule_get_context(f->schedule), 0, 0, f);
-
-  /* Wakeup scheduler in case we are starting this thread from another
-     real thread. */
-  if (f->thread)
-    silc_schedule_wakeup(f->schedule);
-}
-
-/* Start FSM in the specified state synchronously */
-
-void silc_fsm_start_sync(void *fsm, SilcFSMStateCallback start_state)
-{
-  SilcFSM f = fsm;
-
-  SILC_LOG_DEBUG(("Starting %s %p", f->thread ? "thread" : "FSM", fsm));
-
-  f->finished = FALSE;
-  f->next_state = start_state;
-  f->synchronous = TRUE;
-  f->started = TRUE;
-
-  /* Start real thread directly */
-  if (f->thread && f->real_thread) {
-    silc_fsm_start_real_thread(f->schedule,
-                              silc_schedule_get_context(f->schedule),
-                              0, 0, f);
-    return;
-  }
-
-  /* Normal FSM operation */
-  silc_fsm_run(f->schedule, silc_schedule_get_context(f->schedule), 0, 0, f);
-}
-
-/* Set next FSM state */
-
-void silc_fsm_next(void *fsm, SilcFSMStateCallback next_state)
-{
-  SilcFSM f = fsm;
-  f->next_state = next_state;
-}
-
-/* Continue after timeout */
-
-void silc_fsm_next_later(void *fsm, SilcFSMStateCallback next_state,
-                        SilcUInt32 seconds, SilcUInt32 useconds)
-{
-  SilcFSM f = fsm;
-
-  f->next_state = next_state;
-  if (!seconds && !useconds)
-    return;
-
-  silc_schedule_task_add_timeout(f->schedule, silc_fsm_run, f,
-                                seconds, useconds);
-  f->next_later = TRUE;
-
-  /* Wakeup up the scheduler just in case this was called from another
-     thread. */
-  silc_schedule_wakeup(f->schedule);
-}
-
-/* Continue after callback or async operation */
-
-void silc_fsm_continue(void *fsm)
-{
-  SilcFSM f = fsm;
-
-  if (f->next_later) {
-    /* Cancel next_later timeout */
-    silc_schedule_task_del_by_all(f->schedule, 0, silc_fsm_run, f);
-    f->next_later = FALSE;
-  }
-
-  if (!silc_schedule_task_add_timeout(f->schedule, silc_fsm_run, f, 0, 0))
-    silc_fsm_run(f->schedule, silc_schedule_get_context(f->schedule), 0, 0, f);
-
-  /* Wakeup up the scheduler just in case this was called from another
-     thread. */
-  silc_schedule_wakeup(f->schedule);
-}
-
-/* Continue after callback or async operation immediately */
-
-void silc_fsm_continue_sync(void *fsm)
-{
-  SilcFSM f = fsm;
-  if (f->next_later) {
-    silc_schedule_task_del_by_all(f->schedule, 0, silc_fsm_run, f);
-    f->next_later = FALSE;
-  }
-  silc_fsm_run(f->schedule, silc_schedule_get_context(f->schedule), 0, 0, f);
-}
-
-/* Finish FSM */
-
-void silc_fsm_finish(void *fsm)
-{
-  SilcFSM f = fsm;
-
-  SILC_ASSERT(!f->finished);
-
-  f->started = FALSE;
-  f->finished = TRUE;
-
-  silc_schedule_task_del_by_all(f->schedule, 0, silc_fsm_run, f);
-  f->next_later = FALSE;
-
-  /* If we are thread and using real threads, the FSM thread will finish
-     after the real thread has finished, in the main thread. */
-  if (f->thread && f->real_thread) {
-    /* Stop the real thread's scheduler to finish the thread */
-    silc_schedule_stop(f->schedule);
-    silc_schedule_wakeup(f->schedule);
-    return;
-  }
-
-  /* Normal FSM operation */
-  if (!f->synchronous)
-    if (silc_schedule_task_add_timeout(f->schedule, silc_fsm_finish_fsm,
-                                      f, 0, 0))
-      return;
-
-  silc_fsm_finish_fsm(f->schedule, silc_schedule_get_context(f->schedule),
-                     0, 0, fsm);
-}
-
-/* Return associated scheduler */
-
-SilcSchedule silc_fsm_get_schedule(void *fsm)
-{
-  SilcFSM f = fsm;
-  return f->schedule;
-}
-
-/* Return thread's machine */
-
-SilcFSM silc_fsm_get_machine(SilcFSMThread thread)
-{
-  SILC_ASSERT(thread->thread);
-  return (SilcFSM)thread->u.t.fsm;
-}
-
-/* Returns TRUE if FSM is started */
-
-SilcBool silc_fsm_is_started(void *fsm)
-{
-  SilcFSM f = fsm;
-  return f->started;
-}
-
-/* Set context */
-
-void silc_fsm_set_context(void *fsm, void *fsm_context)
-{
-  SilcFSM f = fsm;
-  f->fsm_context = fsm_context;
-}
-
-/* Get context */
-
-void *silc_fsm_get_context(void *fsm)
-{
-  SilcFSM f = fsm;
-  return f->fsm_context;
-}
-
-/* Set state context */
-
-void silc_fsm_set_state_context(void *fsm, void *state_context)
-{
-  SilcFSM f = fsm;
-  f->state_context = state_context;
-}
-
-/* Get state context */
-
-void *silc_fsm_get_state_context(void *fsm)
-{
-  SilcFSM f = fsm;
-  return f->state_context;
-}
-
-/* Wait for thread to terminate */
-
-SilcBool silc_fsm_thread_wait(void *fsm, void *thread)
-{
-  SilcFSM t = thread;
-
-  SILC_ASSERT(t->thread);
-
-  t->u.t.event = silc_fsm_event_alloc(t->u.t.fsm);
-  if (!t->u.t.event)
-    return FALSE;
-
-  SILC_LOG_DEBUG(("Waiting for thread %p to terminate", thread));
-  silc_fsm_event_wait(t->u.t.event, fsm);
-  return TRUE;
-}
-
-/* The machine */
-
-SILC_TASK_CALLBACK(silc_fsm_run)
-{
-  SilcFSM fsm = context;
-  SilcFSMStatus status;
-
-  SILC_LOG_DEBUG(("Running %s %p", fsm->thread ? "thread" : "FSM", fsm));
-
-  /* Run the states */
-  do
-    status = fsm->next_state(fsm, fsm->fsm_context, fsm->state_context);
-  while (status == SILC_FSM_ST_CONTINUE);
-
-  switch (status) {
-  case SILC_FSM_ST_YIELD:
-    /* Continue through scheduler */
-    silc_fsm_continue(fsm);
-    break;
-
-  case SILC_FSM_ST_WAIT:
-    /* The machine is in hold */
-    SILC_LOG_DEBUG(("State wait %p", fsm));
-    fsm->synchronous = FALSE;
-    break;
-
-  case SILC_FSM_ST_FINISH:
-    /* Finish the state machine */
-    SILC_LOG_DEBUG(("State finish %p", fsm));
-    silc_fsm_finish(fsm);
-    break;
-
-  default:
-    break;
-  }
-}
-
-/* Finishes the FSM.  This is always executed in the main thread, even
-   for FSM threads that were run in real threads. */
-
-SILC_TASK_CALLBACK(silc_fsm_finish_fsm)
-{
-  SilcFSM fsm = context;
-
-  SILC_LOG_DEBUG(("%s %p, is finished", fsm->thread ? "Thread" : "FSM", fsm));
-
-  fsm->next_state = NULL;
-
-  if (fsm->thread) {
-    /* This is thread, send signal */
-    if (fsm->u.t.event) {
-      silc_fsm_thread_termination_signal(fsm->u.t.event);
-      silc_fsm_event_free(fsm->u.t.event);
-      fsm->u.t.event = NULL;
-    }
-
-    /* Remove the thread from machine */
-    silc_atomic_sub_int32(&fsm->u.t.fsm->u.m.threads, 1);
-
-    /* Call the destructor callback only if the underlaying machine is
-       still valid. */
-    if (fsm->destructor && fsm->u.t.fsm->finished == FALSE)
-      fsm->destructor(fsm, fsm->fsm_context, fsm->destructor_context);
-
-  } else {
-    /* Machine must not have active threads */
-    assert(silc_atomic_get_int32(&fsm->u.m.threads) == 0);
-
-    if (fsm->u.m.lock) {
-      silc_mutex_free(fsm->u.m.lock);
-      fsm->u.m.lock = NULL;
-    }
-
-    /* Call the destructor callback. */
-    if (fsm->destructor)
-      fsm->destructor(fsm, fsm->fsm_context, fsm->destructor_context);
-  }
-}
-
-/* Allocate FSM event */
-
-SilcFSMEvent silc_fsm_event_alloc(SilcFSM fsm)
-{
-  SilcFSMEvent event;
-
-  event = silc_calloc(1, sizeof(*event));
-  if (silc_unlikely(!event))
-    return NULL;
-
-  silc_fsm_event_init(event, fsm);
-  event->allocated = TRUE;
-
-  return event;
-}
-
-/* Initializes FSM event */
-
-void silc_fsm_event_init(SilcFSMEvent event, SilcFSM fsm)
-{
-  SILC_LOG_DEBUG(("Initializing event %p", event));
-  SILC_ASSERT(!fsm->thread);
-  memset(event, 0, sizeof(*event));
-  event->fsm = fsm;
-  event->refcnt = 0;
-  silc_list_init(event->waiters, struct SilcFSMObject, next);
-}
-
-/* Free event */
-
-void silc_fsm_event_free(SilcFSMEvent event)
-{
-  if (event->refcnt > 0)
-    return;
-  if (silc_list_count(event->waiters) > 0)
-    return;
-  silc_free(event);
-}
-
-/* Reference event */
-
-static void silc_fsm_event_ref(SilcFSMEvent event)
-{
-  event->refcnt++;
-}
-
-/* Unreference event */
-
-static void silc_fsm_event_unref(SilcFSMEvent event)
-{
-  event->refcnt--;
-  if (event->refcnt == 0 && event->allocated)
-    silc_fsm_event_free(event);
-}
-
-/* Wait until event is non-zero. */
-
-SilcUInt32 silc_fsm_event_wait(SilcFSMEvent event, void *fsm)
-{
-  SilcMutex lock = event->fsm->u.m.lock;
-
-  silc_mutex_lock(lock);
-
-  if (!event->value) {
-#if defined(SILC_DEBUG)
-    SilcFSM entry;
-    silc_list_start(event->waiters);
-    while ((entry = silc_list_get(event->waiters)))
-      SILC_ASSERT(entry != fsm);
-#endif /* SILC_DEBUG */
-
-    SILC_LOG_DEBUG(("Waiting for event %p", event));
-
-    /* Add the FSM to waiter list */
-    silc_list_add(event->waiters, fsm);
-    silc_mutex_unlock(lock);
-    return 0;
-  }
-
-  SILC_LOG_DEBUG(("Received event %p", event));
-
-  /* Remove from waiting */
-  silc_list_del(event->waiters, fsm);
-
-  /* Decrease the counter only after all waiters have acquired the signal. */
-  if (!silc_list_count(event->waiters))
-    event->value--;
-
-  silc_mutex_unlock(lock);
-  return 1;
-}
-
-/* Wait util event is non-zero, or timeout occurs. */
-
-SilcUInt32 silc_fsm_event_timedwait(SilcFSMEvent event, void *fsm,
-                                   SilcUInt32 seconds, SilcUInt32 useconds,
-                                   SilcBool *ret_to)
-{
-  SilcMutex lock = event->fsm->u.m.lock;
-  SilcFSM f = fsm;
-  SilcUInt32 value;
-
-  silc_mutex_lock(lock);
-
-  if (f->event_timedout) {
-    SILC_LOG_DEBUG(("Event waiting timedout"));
-    f->event_timedout = FALSE;
-    if (ret_to)
-      *ret_to = TRUE;
-    silc_mutex_unlock(lock);
-    return 1;
-  }
-
-  silc_mutex_unlock(lock);
-
-  value = silc_fsm_event_wait(event, fsm);
-  if (!value) {
-    silc_schedule_task_add_timeout(f->schedule, silc_fsm_event_timedout,
-                                  f, seconds, useconds);
-    f->event = event;
-  }
-
-  if (ret_to)
-    *ret_to = FALSE;
-
-  return value;
-}
-
-/* Event timedout */
-
-SILC_TASK_CALLBACK(silc_fsm_event_timedout)
-{
-  SilcFSM fsm = context;
-  SilcMutex lock = fsm->event->fsm->u.m.lock;
-
-  SILC_LOG_DEBUG(("Event %p timedout", fsm->event));
-
-  /* Remove the waiter from the event waiters list */
-  silc_mutex_lock(lock);
-  silc_list_del(fsm->event->waiters, fsm);
-
-  /* Continue */
-  if (fsm->event) {
-    silc_fsm_continue(fsm);
-    fsm->event_timedout = TRUE;
-    fsm->event = NULL;
-  }
-
-  silc_mutex_unlock(lock);
-}
-
-/* Signalled, event */
-
-SILC_TASK_CALLBACK(silc_fsm_signal)
-{
-  SilcFSMEventSignal p = context;
-  SilcMutex lock = p->event->fsm->u.m.lock;
-  SilcFSM fsm;
-
-  /* We have to check for couple of things before delivering the signal. */
-
-  /* If the event value has went to zero while we've been waiting this
-     callback, the event has been been signalled already.  It can happen
-     when using real threads because the FSM may not be in waiting state
-     when the event is signalled. */
-  silc_mutex_lock(lock);
-  if (!p->event->value) {
-    silc_mutex_unlock(lock);
-    silc_fsm_event_unref(p->event);
-    silc_free(p);
-    return;
-  }
-
-  /* If the waiter is not waiting anymore, don't deliver the signal.  It
-     can happen if there were multiple signallers and the waiter went away
-     after the first signal. */
-  silc_list_start(p->event->waiters);
-  while ((fsm = silc_list_get(p->event->waiters)))
-    if (fsm == p->fsm)
-      break;
-  if (!fsm) {
-    silc_mutex_unlock(lock);
-    silc_fsm_event_unref(p->event);
-    silc_free(p);
-    return;
-  }
-  silc_mutex_unlock(lock);
-
-  SILC_LOG_DEBUG(("Signalled %s %p", p->fsm->thread ? "thread" : "FSM",
-                 p->fsm));
-
-  /* Signal */
-  silc_fsm_continue_sync(p->fsm);
-
-  silc_fsm_event_unref(p->event);
-  silc_free(p);
-}
-
-/* Signal event */
-
-void silc_fsm_event_signal(SilcFSMEvent event)
-{
-  SilcFSM fsm;
-  SilcFSMEventSignal p;
-  SilcMutex lock = event->fsm->u.m.lock;
-
-  SILC_LOG_DEBUG(("Signal event %p", event));
-
-  silc_mutex_lock(lock);
-
-  event->value++;
-  silc_list_start(event->waiters);
-  while ((fsm = silc_list_get(event->waiters))) {
-    if (fsm->event) {
-      silc_schedule_task_del_by_all(fsm->schedule, 0, silc_fsm_event_timedout,
-                                   fsm);
-      fsm->event = NULL;
-    }
-
-    p = silc_calloc(1, sizeof(*p));
-    if (silc_unlikely(!p))
-      continue;
-    p->event = event;
-    p->fsm = fsm;
-    silc_fsm_event_ref(event);
-
-    /* Signal through scheduler.  Wake up destination scheduler in case
-       caller is a real thread. */
-    silc_schedule_task_add_timeout(fsm->schedule, silc_fsm_signal, p, 0, 0);
-    silc_schedule_wakeup(fsm->schedule);
-  }
-
-  silc_mutex_unlock(lock);
-}
-
-/* Post thread termination event.  Special function used only to
-   signal thread termination when SILC_FSM_THREAD_WAIT was used. */
-
-static void silc_fsm_thread_termination_signal(SilcFSMEvent event)
-{
-  SilcFSM fsm;
-  SilcMutex lock = event->fsm->u.m.lock;
-
-  SILC_LOG_DEBUG(("Post thread terminate event %p", event));
-
-  silc_mutex_lock(lock);
-
-  silc_list_start(event->waiters);
-  while ((fsm = silc_list_get(event->waiters))) {
-    /* Signal on thread termination.  Wake up destination scheduler in case
-       caller is a real thread. */
-    silc_list_del(event->waiters, fsm);
-    silc_fsm_continue(fsm);
-    silc_schedule_wakeup(fsm->schedule);
-  }
-
-  silc_mutex_unlock(lock);
-}
-
-/* Real thread */
-
-void *silc_fsm_thread(void *context)
-{
-  SilcFSM fsm = context;
-  SilcSchedule old = fsm->schedule;
-
-  SILC_LOG_DEBUG(("Starting FSM thread in real thread"));
-
-  /* We allocate new SilcSchedule for the FSM, as the old SilcSchedule
-     cannot be used in this thread.  Application may still use it if it
-     wants but we use our own. */
-  fsm->schedule = silc_schedule_init(0, old);
-  if (silc_unlikely(!fsm->schedule))
-    return NULL;
-
-  /* Start the FSM thread */
-  if (silc_unlikely(!silc_schedule_task_add_timeout(fsm->schedule,
-                                                   silc_fsm_run, fsm, 0, 0)))
-    return NULL;
-
-  /* Run the scheduler */
-  silc_schedule(fsm->schedule);
-
-  /* Free resources */
-  silc_schedule_uninit(fsm->schedule);
-
-  fsm->schedule = old;
-
-  /* Finish the FSM thread in the main thread */
-  SILC_ASSERT(fsm->finished);
-  silc_schedule_task_add_timeout(fsm->schedule, silc_fsm_finish_fsm,
-                                fsm, 0, 0);
-  silc_schedule_wakeup(fsm->schedule);
-
-  return NULL;
-}
diff --git a/lib/silcutil/silcfsm.h b/lib/silcutil/silcfsm.h
deleted file mode 100644 (file)
index d9c4be0..0000000
+++ /dev/null
@@ -1,1062 +0,0 @@
-/*
-
-  silcfsm.h
-
-  Author: Pekka Riikonen <priikone@silcnet.org>
-
-  Copyright (C) 2005, 2006, 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.
-
-*/
-
-/****h* silcutil/SILC Finite State Machine
- *
- * DESCRIPTION
- *
- * SILC FSM Interface implements a finite state machine.  The FSM can be
- * used to implement all kinds of machines and protocols.  The FSM supports
- * also threads and can be synchronized by using mutex locks.  The FSM
- * also supports real system threads.  It is possible to create new FSM
- * thread and then execute in real system thread, if platform supports
- * threads.
- *
- * The FSM provides also asynchronous events that can be used to wait for
- * some events or states to occur.  The FSM events may be used as condition
- * variables and signallers.  The FSM events can safely be used in FSM
- * threads that are executed in real system threads.
- *
- * To synchronize machines that use FSM threads that are executed in real
- * system threads the SILC Mutex API (silcmutex.h) may be used.  Normal
- * multi-threaded coding conventions apply when programming with real FSM
- * threads.  If the FSM threads are not real system threads, synchronization
- * is not required.
- *
- ***/
-
-#ifndef SILCFSM_H
-#define SILCFSM_H
-
-/****s* silcutil/SilcFSMAPI/SilcFSM
- *
- * NAME
- *
- *    typedef struct SilcFSMObject *SilcFSM;
- *
- * DESCRIPTION
- *
- *    The actual FSM context and is allocated with silc_fsm_alloc and
- *    given as argument to all silc_fsm_* functions.  It is freed by
- *    silc_fsm_free function.  It is also possible to use pre-allocated
- *    FSM context by using SilcFSMStruct instead of SilcFSM.
- *
- ***/
-typedef struct SilcFSMObject *SilcFSM;
-
-/****s* silcutil/SilcFSMAPI/SilcFSMStruct
- *
- * NAME
- *
- *    typedef struct SilcFSMObject SilcFSMStruct;
- *
- * DESCRIPTION
- *
- *    The actual FSM context and can be used as pre-allocated FSM context,
- *    instead of SilcFSM context.  This context is initialized with the
- *    silc_fsm_init function.  It need not be uninitialized.
- *
- ***/
-typedef struct SilcFSMObject SilcFSMStruct;
-
-/****s* silcutil/SilcFSMAPI/SilcFSMThread
- *
- * NAME
- *
- *    typedef struct SilcFSMObject *SilcFSMThread;
- *
- * DESCRIPTION
- *
- *    FSM thread context.  The SILC FSM supports threads, virtual machine
- *    threads (inside FSM) and actual real system threads if platorm
- *    supports them.  In a complex machine certain complex operations may
- *    be desired to execute in a thread.  The SilcFSMThread is allocated
- *    by silc_fsm_thread_alloc and feed by silc_fsm_free.  It is also
- *    possible to use pre-allocated thread by using SilcFSMThreadStruct
- *    instead of SilcFSMThread.
- *
- ***/
-typedef struct SilcFSMObject *SilcFSMThread;
-
-/****s* silcutil/SilcFSMAPI/SilcFSMThreadStruct
- *
- * NAME
- *
- *    typedef struct SilcFSMObject SilcFSMThreadStruct;
- *
- * DESCRIPTION
- *
- *    FSM thread context and can be used as a pre-allocated FSM thread context,
- *    instead of SilcFSMThread context.  This context is initialized with the
- *    silc_fsm_thread_init function.  It need not be uninitialized.
- *
- ***/
-typedef struct SilcFSMObject SilcFSMThreadStruct;
-
-/****d* silcutil/SilcFSMAPI/SILC_FSM_CONTINUE
- *
- * NAME
- *
- *    #define SILC_FSM_CONTINUE ...
- *
- * DESCRIPTION
- *
- *    Moves to next state synchronously.  This type is used is returned
- *    from state functions to immediately move to next state.
- *
- * EXAMPLE
- *
- *    SILC_FSM_STATE(silc_foo_state)
- *    {
- *      ...
- *
- *      // Move to next state now
- *      silc_fsm_next(fsm, silc_foo_next_state);
- *      return SILC_FSM_CONTINUE;
- *    }
- *
- ***/
-#if defined(SILC_DEBUG)
-#define SILC_FSM_CONTINUE \
-  fsm->next_state(fsm, fsm->fsm_context, fsm->state_context);
-#else
-#define SILC_FSM_CONTINUE SILC_FSM_ST_CONTINUE;
-#endif /* SILC_DEBUG */
-
-/****d* silcutil/SilcFSMAPI/SILC_FSM_YIELD
- *
- * NAME
- *
- *    #define SILC_FSM_YIELD ...
- *
- * DESCRIPTION
- *
- *    Moves to next state through the machine scheduler.  Other threads
- *    running in the machine will get running time with SILC_FSM_YIELD.
- *    When using real threads, using SILC_FSM_YIELD is usually unnecessary.
- *    This type is returned in the state function.
- *
- ***/
-#define SILC_FSM_YIELD SILC_FSM_ST_YIELD;
-
-/****d* silcutil/SilcFSMAPI/SILC_FSM_WAIT
- *
- * NAME
- *
- *    #define SILC_FSM_WAIT ...
- *
- * DESCRIPTION
- *
- *    Suspends the machine or thread until it is awaken.  This is used
- *    when asynchronous call is made or timer is set, or something else
- *    that requires waiting.  This type is returned in the state function.
- *
- ***/
-#define SILC_FSM_WAIT SILC_FSM_ST_WAIT
-
-/****d* silcutil/SilcFSMAPI/SILC_FSM_FINISH
- *
- * NAME
- *
- *    #define SILC_FSM_FINISH ...
- *
- * DESCRIPTION
- *
- *    Finishes the machine or thread and calls its destructor, if defined.
- *    If the machine is finished when it has running threads the machine
- *    will fatally fail.  User must always finish the threads before
- *    finishing the machine.  This type is returned in the state function.
- *
- ***/
-#define SILC_FSM_FINISH SILC_FSM_ST_FINISH
-
-/****f* silcutil/SilcFSMAPI/SilcFSMDestructor
- *
- * SYNOPSIS
- *
- *    typedef void (*SilcFSMDestructor)(SilcFSM fsm, void *fsm_context,
- *                                      void *destructor_context);
- *
- * DESCRIPTION
- *
- *    The destructor callback that was set in silc_fsm_alloc or in
- *    silc_fsm_init function.  It will be called when a state function
- *    returns SILC_FSM_FINISH.  This function will be called through
- *    the scheduler; it will not be called immediately after the state
- *    function returns SILC_FSM_FINISH, but will be called later.  The
- *    `fsm' can be freed in this function.
- *
- ***/
-typedef void (*SilcFSMDestructor)(SilcFSM fsm, void *fsm_context,
-                                  void *destructor_context);
-
-/****f* silcutil/SilcFSMAPI/SilcFSMThreadDestructor
- *
- * SYNOPSIS
- *
- *    typedef void (*SilcFSMThreadDestructor)(SilcFSMThread thread,
- *                                            void *thread_context,
- *                                            void *destructor_context);
- *
- * DESCRIPTION
- *
- *    The destructor callback that was set in silc_fsm_thread_alloc or in
- *    silc_fsm_thread_init function.  It will be called when a state function
- *    returns SILC_FSM_FINISH.  This function will be called through the
- *    scheduler; it will not be called immediately after the state function
- *    returns SILC_FSM_FINISH, but will be called later.  The `thread' can
- *    be freed in this function.
- *
- * NOTES
- *
- *    Even if the `thread' was executed in real system thread, this callback
- *    is always received in the main machine thread, not in the created
- *    thread.
- *
- ***/
-typedef void (*SilcFSMThreadDestructor)(SilcFSMThread thread,
-                                       void *thread_context,
-                                       void *destructor_context);
-
-/****d* silcutil/SilcFSMAPI/SILC_FSM_STATE
- *
- * NAME
- *
- *    #define SILC_FSM_STATE(name)
- *
- * DESCRIPTION
- *
- *    This macro is used to declare an FSM state function.  The `fsm' is
- *    the SilcFSM or SilcFSMThread context, the `fsm_context' is the context
- *    given as argument to silc_fsm_alloc, silc_fsm_init, silc_fsm_thread_init,
- *    or silc_fsm_thread_alloc function.  The `state_context' is the optional
- *    state specific context set with silc_fsm_set_state_context function.
- *
- * SOURCE
- */
-#define SILC_FSM_STATE(name)                                           \
-int name(struct SilcFSMObject *fsm, void *fsm_context, void *state_context)
-/***/
-
-/* State function callback */
-typedef int (*SilcFSMStateCallback)(struct SilcFSMObject *fsm,
-                                   void *fsm_context,
-                                   void *state_context);
-
-/****d* silcutil/SilcFSMAPI/SILC_FSM_CALL
- *
- * NAME
- *
- *    SILC_FSM_CALL(function)
- *
- * DESCRIPTION
- *
- *    Macro used to call asynchronous calls from state function.  If the
- *    call is not really asynchronous then this will cause the machine to
- *    directly proceed to next state.  If the call is truly asynchronous
- *    then this will set the machine to wait state.  The silc_fsm_next
- *    must be called before this macro, so that the next state is set.
- *
- * NOTES
- *
- *    The state function returns in this macro.
- *
- * EXAMPLE
- *
- *    // Simple example
- *    silc_fsm_next(fsm, some_next_state);
- *    SILC_FSM_CALL(silc_some_async_call(server, some_callback, context));
- *
- *    // More complex example
- *    silc_fsm_next(fsm, some_next_state);
- *    SILC_FSM_CALL((some_context->operation =
- *                   silc_some_async_call(server, some_callback, context)));
- *
- ***/
-#define SILC_FSM_CALL(function)                        \
-do {                                           \
-  SILC_VERIFY(!silc_fsm_set_call(fsm, TRUE));  \
-  function;                                    \
-  if (!silc_fsm_set_call(fsm, FALSE))          \
-    return SILC_FSM_CONTINUE;                  \
-  return SILC_FSM_WAIT;                                \
-} while(0)
-
-/****d* silcutil/SilcFSMAPI/SILC_FSM_CALL_CONTINUE
- *
- * NAME
- *
- *    SILC_FSM_CALL_CONTINUE(fsm)
- *
- * DESCRIPTION
- *
- *    Macro used to proceed after asynchornous call.  This is called in the
- *    callback of the asynchronous call to continue in the state machine.
- *
- * EXAMPLE
- *
- *    void some_callback(void *context) {
- *      SilcFSM fsm = context;
- *      ...
- *      // Continue to the next state
- *      SILC_FSM_CALL_CONTINUE(fsm);
- *    }
- *
- ***/
-#define SILC_FSM_CALL_CONTINUE(fsm)            \
-do {                                           \
-  if (!silc_fsm_set_call(fsm, FALSE))          \
-    silc_fsm_continue(fsm);                    \
-} while(0)
-
-/****d* silcutil/SilcFSMAPI/SILC_FSM_CALL_CONTINUE_SYNC
- *
- * NAME
- *
- *    SILC_FSM_CALL_CONTINUE_SYNC(fsm)
- *
- * DESCRIPTION
- *
- *    Macro used to proceed after asynchornous call.  This is called in the
- *    callback of the asynchronous call to continue in the state machine.
- *    This continues to the next state synchronously, not through the
- *    scheduler.
- *
- * EXAMPLE
- *
- *    void some_callback(void *context) {
- *      SilcFSM fsm = context;
- *      ...
- *      // Continue to the next state immediately
- *      SILC_FSM_CALL_CONTINUE_SYNC(fsm);
- *    }
- *
- ***/
-#define SILC_FSM_CALL_CONTINUE_SYNC(fsm)       \
-do {                                           \
-  if (!silc_fsm_set_call(fsm, FALSE))          \
-    silc_fsm_continue_sync(fsm);               \
-} while(0)
-
-/****d* silcutil/SilcFSMAPI/SILC_FSM_THREAD_WAIT
- *
- * NAME
- *
- *    SILC_FSM_THREAD_WAIT(thread)
- *
- * DESCRIPTION
- *
- *    Macro used to wait for the `thread' to terminate.  The machine or
- *    thread will be suspended while it is waiting for the thread to
- *    terminate.  The machine or thread will continue once the waited
- *    thread has terminated.
- *
- * NOTES
- *
- *    The state function returns in this macro.
- *
- *    This macro is the only way to safely make sure that the thread has
- *    terminated by the time FSM continues from the waiting state.  Using
- *    FSM events to signal from the thread before SILC_FSM_FINISH is returned
- *    works with normal FSM threads, but especially with real system threads
- *    it does not guarantee that the FSM won't continue before the thread has
- *    actually terminated.  Usually this is not a problem, but it can be a
- *    problem if the FSM is waiting to be freed.  In this case using this
- *    macro is strongly recommended.
- *
- ***/
-#define SILC_FSM_THREAD_WAIT(thread)           \
-do {                                           \
-  silc_fsm_thread_wait(fsm, thread);           \
-  return SILC_FSM_WAIT;                                \
-} while(0)
-
-/****f* silcutil/SilcFSMAPI/silc_fsm_alloc
- *
- * SYNOPSIS
- *
- *    SilcFSM silc_fsm_alloc(void *fsm_context,
- *                           SilcFSMDestructor destructor,
- *                           void *destructor_context,
- *                           SilcSchedule schedule);
- *
- * DESCRIPTION
- *
- *    Allocates SILC Finite State Machine context.  The `destructor' with
- *    `destructor_context' will be called when the machines finishes.  The
- *    caller must free the returned context with silc_fsm_free.  The
- *    `fsm_context' is delivered to every FSM state function.  The `schedule'
- *    is the caller's scheduler and the FSM will be run in the scheduler.
- *
- * EXAMPLE
- *
- *    SilcAsyncOperation silc_async_call(Callback callback, void *cb_context)
- *    {
- *      SilcAsyncOperation op;
- *      SilcFSM fsm;
- *      ...
- *
- *      // Allocate async operation so that caller can control us, like abort
- *      op = silc_async_alloc(silc_async_call_abort, NULL, ourcontext);
- *
- *      // Start FSM
- *      fsm = silc_fsm_alloc(ourcontext, fsm_destructor, ourcontext,
- *                           schedule);
- *      silc_fsm_start(fsm, first_state);
- *      ...
- *
- *      // Return async operation for upper layer
- *      return op;
- *    }
- *
- ***/
-SilcFSM silc_fsm_alloc(void *fsm_context,
-                       SilcFSMDestructor destructor,
-                       void *destructor_context,
-                       SilcSchedule schedule);
-
-/****f* silcutil/SilcFSMAPI/silc_fsm_init
- *
- * SYNOPSIS
- *
- *    SilcBool silc_fsm_init(SilcFSM fsm,
- *                           void *fsm_context,
- *                           SilcFSMDestructor destructor,
- *                           void *destructor_context,
- *                           SilcSchedule schedule);
- *
- * DESCRIPTION
- *
- *    Initializes a pre-allocated SilcFSM context.  This call is equivalent
- *    to silc_fsm_alloc except that this takes the pre-allocated context
- *    as argument.  The silc_fsm_free must not be called if this was called.
- *    Returns TRUE if the initialization is Ok or FALSE if error occurred.
- *    This function does not allocate any memory.  The `schedule' is the
- *    caller's scheduler and the FSM will be run in the scheduler.
- *
- * EXAMPLE
- *
- *    SilcFSMStruct fsm;
- *
- *    silc_fsm_init(&fsm, application, fsm_destructor, application, schedule);
- *    silc_fsm_start(&fsm, first_state);
- *
- ***/
-SilcBool silc_fsm_init(SilcFSM fsm,
-                      void *fsm_context,
-                       SilcFSMDestructor destructor,
-                       void *destructor_context,
-                       SilcSchedule schedule);
-
-/****f* silcutil/SilcFSMAPI/silc_fsm_thread_alloc
- *
- * SYNOPSIS
- *
- *    SilcFSMThread silc_fsm_thread_alloc(SilcFSM fsm,
- *                                        void *thread_context,
- *                                        SilcFSMThreadDestructor destructor,
- *                                        void *destructor_context,
- *                                        SilcBool real_thread);
- *
- * DESCRIPTION
- *
- *    Allocates FSM thread context.  The thread will be executed in the
- *    FSM machine indicated by `fsm'.  The caller must free the returned
- *    thread context with silc_fsm_free.  If the 'real_thread' is TRUE
- *    then the thread will actually be executed in real thread, if platform
- *    supports them.  The `thread_context' is delivered to every state
- *    function in the thread.
- *
- * NOTES
- *
- *    If the system does not support threads, then this function will revert
- *    back to normal FSM threads.
- *
- *    If the `real_thread' is TRUE then FSM will allocate new SilcSchedule
- *    for the FSM thread. If you need scheduler in the real thread it is
- *    strongly recommended that you use the SilcSchedule that is allocated
- *    for the thread.  You can retrieve the SilcSchedule from the thread
- *    using silc_fsm_get_schedule function.  Note that, the allocated
- *    SilcSchedule will become invalid after the thread finishes.
- *
- *    If `real_thread' is FALSE the silc_fsm_get_schedule will return
- *    the SilcSchedule that was originally given to silc_fsm_alloc or
- *    silc_fsm_init.
- *
- * EXAMPLE
- *
- *    SILC_FSM_STATE(silc_foo_state)
- *    {
- *      SilcFSMThread thread;
- *      ...
- *
- *      // Execute the route lookup in thread
- *      thread = silc_fsm_thread_alloc(fsm, fsm_context, NULL, NULL, FALSE);
- *      silc_fsm_start(thread, silc_route_lookup_start);
- *
- *      // Wait here for the thread to terminate. Set the state where to go
- *      // after the thread has terminated.
- *      silc_fsm_next(fsm, silc_foo_route_lookup_finished);
- *      SILC_FSM_THREAD_WAIT(thread);
- *    }
- *
- ***/
-SilcFSMThread silc_fsm_thread_alloc(SilcFSM fsm,
-                                   void *thread_context,
-                                   SilcFSMThreadDestructor destructor,
-                                   void *destructor_context,
-                                   SilcBool real_thread);
-
-/****f* silcutil/SilcFSMAPI/silc_fsm_thread_init
- *
- * SYNOPSIS
- *
- *    void silc_fsm_thread_init(SilcFSMThread thread,
- *                              SilcFSM fsm,
- *                              void *thread_context,
- *                              SilcFSMThreadDestructor destructor,
- *                              void *destructor_context,
- *                              SilcBool real_thread);
- *
- * DESCRIPTION
- *
- *    Initializes a pre-allocated SilcFSMThread context.  This call is
- *    equivalent to silc_fsm_thread_alloc except that this takes the
- *    pre-allocated context as argument.  The silc_fsm_free must not be
- *    called if this was called.  If the `real_thread' is TRUE then the
- *    thread will actually be executed in real thread, if platform supports
- *    them.
- *
- * NOTES
- *
- *    See the notes from the silc_fsm_thread_alloc.
- *
- * EXAMPLE
- *
- *    SilcFSMThreadStruct thread;
- *
- *    silc_fsm_thread_init(&thread, fsm, application, NULL, NULL, FALSE);
- *    silc_fsm_start(&thread, first_state);
- *
- ***/
-void silc_fsm_thread_init(SilcFSMThread thread,
-                         SilcFSM fsm,
-                         void *thread_context,
-                         SilcFSMThreadDestructor destructor,
-                         void *destructor_context,
-                         SilcBool real_thread);
-
-/****f* silcutil/SilcFSMAPI/silc_fsm_free
- *
- * SYNOPSIS
- *
- *    void silc_fsm_free(void *fsm);
- *
- * DESCRIPTION
- *
- *    Free the SILC FSM context that was allocated with silc_fsm_alloc,
- *    or free the SILC FSM thread context that was allocated with
- *    silc_fsm_thread_alloc.  This function is used with both SilcFSM
- *    and SilcFSMThread contexts.
- *
- * NOTES
- *
- *    When freeing FSM, it must not have any active threads.
- *
- ***/
-void silc_fsm_free(void *fsm);
-
-/****f* silcutil/SilcFSMAPI/silc_fsm_start
- *
- * SYNOPSIS
- *
- *    void silc_fsm_start(void *fsm, SilcFSMStateCallback start_state);
- *
- * DESCRIPTION
- *
- *    This function must be called after the SILC FSM context was created.
- *    This actually starts the state machine.  Note that, the machine is
- *    started later after this function returns.  The `start_state' is the
- *    state where the machine or thread is started.  This function is used
- *    with both SilcFSM and SilcFSMThread contexts.
- *
- * EXAMPLE
- *
- *    SilcFSM fsm;
- *
- *    fsm = silc_fsm_alloc(context, destructor, context, schedule);
- *    silc_fsm_start(fsm, first_state);
- *
- ***/
-void silc_fsm_start(void *fsm, SilcFSMStateCallback start_state);
-
-/****f* silcutil/SilcFSMAPI/silc_fsm_start_sync
- *
- * SYNOPSIS
- *
- *    void silc_fsm_start_sync(void *fsm, SilcFSMStateCallback start_state);
- *
- * DESCRIPTION
- *
- *    This function is same as silc_fsm_start, except that the FSM will
- *    be started immediately inside this function.  After this function
- *    returns the `start_state' has already been executed.  If the machine
- *    is completely synchronous (no waiting used in the machine) then
- *    the machine will have finished once this function returns.  Also
- *    note that if the machine is completely synchronous the destructor
- *    will also be called from inside this function.  This function is used
- *    with both SilcFSM and SilcFSMThread contexts.
- *
- ***/
-void silc_fsm_start_sync(void *fsm, SilcFSMStateCallback start_state);
-
-/****f* silcutil/SilcFSMAPI/silc_fsm_next
- *
- * SYNOPSIS
- *
- *    void silc_fsm_next(void *fsm, SilcFSMStateCallback next_state);
- *
- * DESCRIPTION
- *
- *    Set the next state to be executed.  If the state function that
- *    call this function returns SILC_FSM_CONTINUE, the `next_state'
- *    will be executed immediately.  If it returns SILC_FSM_YIELD it
- *    yields the thread and the `next_state' will be run after other
- *    threads have run first.  This function must always be used to set
- *    the next state in the machine or thread.  This function is used
- *    with both SilcFSM and SilcFSMThread contexts.
- *
- * EXAMPLE
- *
- *    // Move to next state
- *    silc_fsm_next(fsm, next_state);
- *    return SILC_FSM_CONTINUE;
- *
- ***/
-void silc_fsm_next(void *fsm, SilcFSMStateCallback next_state);
-
-/****f* silcutil/SilcFSMAPI/silc_fsm_next_later
- *
- * SYNOPSIS
- *
- *    void silc_fsm_next_later(void *fsm, SilcFSMStateCallback next_state,
- *                             SilcUInt32 seconds, SilcUInt32 useconds);
- *
- * DESCRIPTION
- *
- *    Set the next state to be executed later, at the specified time.
- *    The SILC_FSM_WAIT must be returned in the state function if this
- *    function is called.  If any other state is returned machine operation
- *    is undefined.  The machine or thread will move to `next_state' after
- *    the specified timeout.  This function is used with both SilcFSM and
- *    SilcFSMThread contexts.
- *
- * NOTES
- *
- *    If both `seconds' and `useconds' are 0, the effect is same as calling
- *    silc_fsm_next function, and SILC_FSM_CONTINUE must be returned.
- *
- *    If silc_fsm_continue or silc_fsm_continue_sync is called while the
- *    machine or thread is in SILC_FSM_WAIT state the timeout is automatically
- *    canceled and the state moves to the next state.
- *
- * EXAMPLE
- *
- *    // Move to next state after 10 seconds
- *    silc_fsm_next_later(fsm, next_state, 10, 0);
- *    return SILC_FSM_WAIT;
- *
- ***/
-void silc_fsm_next_later(void *fsm, SilcFSMStateCallback next_state,
-                        SilcUInt32 seconds, SilcUInt32 useconds);
-
-/****f* silcutil/SilcFSMAPI/silc_fsm_continue
- *
- * SYNOPSIS
- *
- *    void silc_fsm_continue(void *fsm);
- *
- * DESCRIPTION
- *
- *    Continues in the state machine from a SILC_FSM_WAIT state.  This can
- *    be called from outside waiting FSM to continue to the next state.
- *    This function can be used instead of SILC_FSM_CALL_CONTINUE macro
- *    in case the SILC_FSM_CALL was not used.  This must not be used if
- *    SILC_FSM_CALL was used.  This function is used with both SilcFSM and
- *    SilcFSMThread contexts.
- *
- ***/
-void silc_fsm_continue(void *fsm);
-
-/****f* silcutil/SilcFSMAPI/silc_fsm_continue_sync
- *
- * SYNOPSIS
- *
- *    void silc_fsm_continue_sync(void *fsm);
- *
- * DESCRIPTION
- *
- *    Continues immediately in the state machine from a SILC_FSM_WAIT state.
- *    This can be called from outside waiting FSM to immediately continue to
- *    the next state.  This function can be used instead of the
- *    SILC_FSM_CALL_CONTINUE_SYNC macro in case the SILC_FSM_CALL was not used.
- *    This must not be used if SILC_FSM_CALL was used.  This function is used
- *    with both SilcFSM and SilcFSMThread contexts.
- *
- ***/
-void silc_fsm_continue_sync(void *fsm);
-
-/****f* silcutil/SilcFSMAPI/silc_fsm_finish
- *
- * SYNOPSIS
- *
- *    void silc_fsm_finish(void *fsm);
- *
- * DESCRIPTION
- *
- *    Finishes the `fsm'.  This function may be used in case the FSM
- *    needs to be finished outside FSM states.  Usually FSM is finished
- *    by returning SILC_FSM_FINISH from the state, but if this is not
- *    possible this function may be called.  This function is used with
- *    both SilcFSM and SilcFSMThread contexts.
- *
- *    If the `fsm' is a machine and it has running threads, the machine
- *    will fatally fail.  The caller must first finish the threads and
- *    then the machine.
- *
- ***/
-void silc_fsm_finish(void *fsm);
-
-/****f* silcutil/SilcFSMAPI/silc_fsm_set_context
- *
- * SYNOPSIS
- *
- *    void silc_fsm_set_context(void *fsm, void *fsm_context);
- *
- * DESCRIPTION
- *
- *    Set new context for the `fsm'.  This function can be used to change
- *    the context inside the `fsm', if needed.  This function is used with
- *    both SilcFSM and SilcFSMThread contexts.  The context is the
- *    `fsm_context' in the state function (SILC_FSM_STATE).
- *
- ***/
-void silc_fsm_set_context(void *fsm, void *fsm_context);
-
-/****f* silcutil/SilcFSMAPI/silc_fsm_get_context
- *
- * SYNOPSIS
- *
- *    void *silc_fsm_get_context(void *fsm);
- *
- * DESCRIPTION
- *
- *    Returns the context associated with the `fsm'.  It is the context that
- *    was given to silc_fsm_alloc, silc_fsm_init, silc_fsm_thread_alloc or
- *    silc_fsm_thread_init.  This function is used with both SilcFSM and
- *    SilcFSMThread contexts.
- *
- ***/
-void *silc_fsm_get_context(void *fsm);
-
-/****f* silcutil/SilcFSMAPI/silc_fsm_set_state_context
- *
- * SYNOPSIS
- *
- *    void silc_fsm_set_state_context(void *fsm, void *state_context);
- *
- * DESCRIPTION
- *
- *    Set's a state specific context for the `fsm'.  This function can be
- *    used to change the state context inside the `fsm', if needed.  This
- *    function is used with both SilcFSM and SilcFSMThread contexts.  The
- *    context is the `state_context' in the state function (SILC_FSM_STATE).
- *
- ***/
-void silc_fsm_set_state_context(void *fsm, void *state_context);
-
-/****f* silcutil/SilcFSMAPI/silc_fsm_get_state_context
- *
- * SYNOPSIS
- *
- *    void *silc_fsm_get_state_context(void *fsm);
- *
- * DESCRIPTION
- *
- *    Returns the state context associated with the `fsm'.  It is the context
- *    that was set with silc_fsm_set_state_context function.  This function
- *    is used with both SilcFSM and SilcFSMThread contexts.
- *
- ***/
-void *silc_fsm_get_state_context(void *fsm);
-
-/****f* silcutil/SilcFSMAPI/silc_fsm_get_schedule
- *
- * SYNOPSIS
- *
- *    SilcSchedule silc_fsm_get_schedule(void *fsm);
- *
- * DESCRIPTION
- *
- *    Returns the SilcSchedule that has been associated with the `fsm'.
- *    If caller needs scheduler it may retrieve it with this function.  This
- *    function is used with both SilcFSM and SilcFSMThread contexts.
- *
- *    If the `fsm' is thread and real system threads are being used, and this
- *    is called from the thread, it will return the SilcSchedule that was
- *    allocated by the FSM for the thread.  It is strongly recommended to
- *    use this SilcSchedule if you are using real threads, and you need
- *    scheduler in the thread.  Note that, once the thread finishes the
- *    returned SilcSchedule becomes invalid.
- *
- *    In other times this returns the SilcSchedule pointer that was given
- *    to silc_fsm_alloc or silc_fsm_init.
- *
- ***/
-SilcSchedule silc_fsm_get_schedule(void *fsm);
-
-/****f* silcutil/SilcFSMAPI/silc_fsm_get_machine
- *
- * SYNOPSIS
- *
- *    SilcFSM silc_fsm_get_machine(SilcFSMThread thread);
- *
- * DESCRIPTION
- *
- *    Returns the machine from the FSM thread indicated by `thread'.
- *
- ***/
-SilcFSM silc_fsm_get_machine(SilcFSMThread thread);
-
-/****f* silcutil/SilcFSMAPI/silc_fsm_is_started
- *
- * SYNOPSIS
- *
- *    SilcBool silc_fsm_is_started(void *fsm);
- *
- * DESCRIPTION
- *
- *    Returns TRUE if the machine or thread `fsm' has been started and has
- *    not been finished yet.  This function is used with both SilcFSM and
- *    SilcFSMThread contexts.
- *
- ***/
-SilcBool silc_fsm_is_started(void *fsm);
-
-/* FSM Events */
-
-/****s* silcutil/SilcFSMAPI/SilcFSMEvent
- *
- * NAME
- *
- *    typedef struct SilcFSMEventObject *SilcFSMEvent;
- *
- * DESCRIPTION
- *
- *    The FSM event context allocated with silc_fsm_event_alloc.  The
- *    caller must free it with silc_fsm_event_free.  It is also possible
- *    to use pre-allocated SilcFSMEventStruct instead of SilcFSMEvent context.
- *
- ***/
-typedef struct SilcFSMEventObject *SilcFSMEvent;
-
-/****s* silcutil/SilcFSMAPI/SilcFSMEventStruct
- *
- * NAME
- *
- *    typedef struct SilcFSMEventObject SilcFSMEventStruct;
- *
- * DESCRIPTION
- *
- *    The FSM event context that can be used as pre-allocated context.
- *    It is initialized with silc_fsm_event_init.  It need not be
- *    uninitialized.
- *
- ***/
-typedef struct SilcFSMEventObject SilcFSMEventStruct;
-
-/****f* silcutil/SilcFSMAPI/silc_fsm_event_alloc
- *
- * SYNOPSIS
- *
- *    SilcFSMEvent silc_fsm_event_alloc(SilcFSM fsm);
- *
- * DESCRIPTION
- *
- *    Allocates asynchronous FSM event.  FSM events are asynchronous events
- *    that can be waited and signalled.  They can be used as condition
- *    variables and signallers.  They can be used for example to wait that
- *    some event happens, some thread moves to a specific state or similar.
- *    The FSM Events may also be used in FSM threads that are executed in
- *    real system threads.  It is safe to wait and signal the event from
- *    threads.
- *
- *    Use the macros SILC_FSM_EVENT_WAIT and SILC_FSM_EVENT_TIMEDWAIT to wait
- *    for the event.  Use the SILC_FSM_EVENT_SIGNAL macro to signal all the
- *    waiters.
- *
- ***/
-SilcFSMEvent silc_fsm_event_alloc(SilcFSM fsm);
-
-/****f* silcutil/SilcFSMAPI/silc_fsm_event_init
- *
- * SYNOPSIS
- *
- *    void silc_fsm_event_init(SilcFSMEvent event, SilcFSM fsm);
- *
- * DESCRIPTION
- *
- *    Initializes a pre-allocates FSM event context.  This call is
- *    equivalent to silc_fsm_event_alloc except this use the pre-allocated
- *    context.  This fuction does not allocate any memory.
- *
- ***/
-void silc_fsm_event_init(SilcFSMEvent event, SilcFSM fsm);
-
-/****f* silcutil/SilcFSMAPI/silc_fsm_event_free
- *
- * SYNOPSIS
- *
- *    void silc_fsm_event_free(SilcFSMEvent event);
- *
- * DESCRIPTION
- *
- *    Free the event allocated by silc_fsm_event_alloc function.
- *
- ***/
-void silc_fsm_event_free(SilcFSMEvent event);
-
-/****d* silcutil/SilcFSMAPI/SILC_FSM_EVENT_WAIT
- *
- * NAME
- *
- *    SILC_FSM_EVENT_WAIT(event)
- *
- * DESCRIPTION
- *
- *    Macro used to wait for the `event' to be signalled.  The machine
- *    or thread will be suspended while it is waiting for the event.
- *    This macro can only be used in FSM state functions.  When the
- *    event is signalled the FSM will re-enter the current state (or
- *    state that was set with silc_fsm_next before waiting).
- *
- * EXAMPLE
- *
- *    // Signalling example
- *    ctx->async_event = silc_fsm_event_alloc(fsm);
- *    ...
- *
- *    SILC_FSM_STATE(silc_foo_state)
- *    {
- *      ...
- *
- *      // Wait here for async call to complete
- *      SILC_FSM_EVENT_WAIT(ctx->async_event);
- *
- *      // Async call completed
- *      if (ctx->async_success == FALSE)
- *        fatal(error);
- *      ...
- *    }
- *
- ***/
-#define SILC_FSM_EVENT_WAIT(event)             \
-do {                                           \
-  if (silc_fsm_event_wait(event, fsm) == 0)    \
-    return SILC_FSM_WAIT;                      \
-} while(0)
-
-/****d* silcutil/SilcFSMAPI/SILC_FSM_EVENT_TIMEDWAIT
- *
- * NAME
- *
- *    SILC_FSM_EVENT_TIMEDWAIT(event, seconds, useconds, timedout)
- *
- * DESCRIPTION
- *
- *    Macro used to wait for the `event' to be signalled, or until
- *    the timeout specified by `seconds' and `useconds' has elapsed.  If
- *    the timeout occurs before the event is signalled, the machine
- *    will wakeup.  The `timedout' is SilcBool pointer and if it is
- *    non-NULL indication of whether timeout occurred or not is saved to
- *    the pointer.  This macro can only be used in FSM state functions.
- *    When the event is signalled or timedout the FSM will re-enter
- *    the current state (or state that was set with silc_fsm_next before
- *    waiting).
- *
- * EXAMPLE
- *
- *    SILC_FSM_STATE(silc_foo_state)
- *    {
- *      SilcBool timedout;
- *      ...
- *
- *      // Wait here for async call to complete, or 10 seconds for timeout
- *      SILC_FSM_EVENT_TIMEDWAIT(ctx->async_event, 10, 0, &timedout);
- *
- *      // See if timeout occurred
- *      if (timedout == TRUE)
- *        fatal(error);
- *
- *      // Async call completed
- *      if (ctx->async_success == FALSE)
- *        fatal(error);
- *      ...
- *    }
- *
- ***/
-#define SILC_FSM_EVENT_TIMEDWAIT(event, seconds, useconds, ret_to)     \
-do {                                                                   \
-  if (silc_fsm_event_timedwait(event, fsm, seconds, useconds, ret_to) == 0) \
-    return SILC_FSM_WAIT;                                              \
-} while(0)
-
-/****f* silcutil/SilcFSMAPI/SILC_FSM_EVENT_SIGNAL
- *
- * SYNOPSIS
- *
- *    SILC_FSM_EVENT_SIGNAL(event)
- *
- * DESCRIPTION
- *
- *    Signals the `event' and awakens everybody that are waiting for this
- *    event.  This macro never blocks.  It can be safely called at any place
- *    in state function and in asynchronous callbacks or other functions.
- *
- * EXAMPLE
- *
- *    SILC_FSM_STATE(silc_foo_async_completion)
- *    {
- *      ...
- *
- *      // Notify all waiters
- *      ctx->async_success = TRUE;
- *      SILC_FSM_EVENT_SIGNAL(ctx->async_event);
- *      ...
- *    }
- *
- ***/
-#define SILC_FSM_EVENT_SIGNAL(event)           \
-do {                                           \
-  silc_fsm_event_signal(event);                        \
-} while(0)
-
-#include "silcfsm_i.h"
-
-#endif /* SILCFSM_H */
diff --git a/lib/silcutil/silcfsm_i.h b/lib/silcutil/silcfsm_i.h
deleted file mode 100644 (file)
index 50475da..0000000
+++ /dev/null
@@ -1,106 +0,0 @@
-/*
-
-  silcfsm_i.h
-
-  Author: Pekka Riikonen <priikone@silcnet.org>
-
-  Copyright (C) 2005 - 2006 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 SILCFSM_I_H
-#define SILCFSM_I_H
-
-#ifndef SILCFSM_H
-#error "Do not include this header directly"
-#endif
-
-/* FSM state status */
-typedef enum {
-  SILC_FSM_ST_CONTINUE,             /* Continue immediately to next state */
-  SILC_FSM_ST_YIELD,        /* Continue to next state through scheduler */
-  SILC_FSM_ST_WAIT,         /* Wait for some async call or timeout */
-  SILC_FSM_ST_FINISH,       /* Finish state machine and call destructor
-                               through scheduler */
-} SilcFSMStatus;
-
-/* Event structure, holds list of FSM machines that are waiting for this
-   event.  The SilcFSM has *next; pointer that is used with SilcList.
-   Internally events act as semaphore counters. */
-struct SilcFSMEventObject {
-  SilcFSM fsm;                         /* Machine */
-  SilcList waiters;                    /* List of SilcFSM pointers */
-  unsigned int value     : 21;         /* Current event semaphore value */
-  unsigned int refcnt    : 10;         /* Reference counter */
-  unsigned int allocated : 1;          /* Set if allocated */
-};
-
-/* FSM and FSM thread context */
-struct SilcFSMObject {
-  struct SilcFSMObject *next;
-  void *fsm_context;                   /* Caller's context */
-  SilcSchedule schedule;               /* Scheduler */
-  SilcFSMEvent event;                  /* Valid if waiting event timeout */
-  SilcFSMStateCallback next_state;     /* Next state in machine */
-  void *state_context;                 /* Extra state specific context */
-  SilcFSMDestructor destructor;                /* Destructor */
-  void *destructor_context;
-  union {
-    /* Machine */
-    struct {
-      SilcAtomic32 threads;            /* Number of threads */
-      SilcMutex lock;                  /* Lock, valid if using real threads */
-    } m;
-
-    /* Thread */
-    struct {
-      struct SilcFSMObject *fsm;       /* Machine */
-      SilcFSMEvent event;               /* Event for waiting termination */
-    } t;
-  } u;
-  unsigned int thread           : 1;   /* Set if this is thread */
-  unsigned int real_thread      : 1;    /* Set if to use real threads */
-  unsigned int async_call       : 1;    /* Set if called real async call */
-  unsigned int finished         : 1;    /* Set if SILC_FSM_FINISH returned */
-  unsigned int event_timedout   : 1;    /* Set if waiting event timedout */
-  unsigned int synchronous      : 1;    /* Set if silc_fsm_start_sync called */
-  unsigned int next_later       : 1;    /* Set if silc_fsm_next_later called */
-  unsigned int started          : 1;    /* Set when started and not finished */
-};
-
-/* Event signal context */
-typedef struct {
-  SilcFSMEvent event;                  /* Event */
-  SilcFSM fsm;                         /* Signalled FSM */
-} *SilcFSMEventSignal;
-
-/* Used internally by the SILC_FSM_CALL macros to detect whether async
-   call is really async or not. */
-static inline
-SilcBool silc_fsm_set_call(struct SilcFSMObject *fsm, SilcBool async_call)
-{
-  SilcBool old = fsm->async_call;
-  fsm->async_call = async_call;
-  return old;
-}
-
-/* Wait for thread to terminate */
-SilcBool silc_fsm_thread_wait(void *fsm, void *thread);
-
-/* Events */
-SilcUInt32 silc_fsm_event_wait(SilcFSMEvent event, void *fsm);
-SilcUInt32 silc_fsm_event_timedwait(SilcFSMEvent event, void *fsm,
-                                   SilcUInt32 seconds, SilcUInt32 useconds,
-                                   SilcBool *ret_to);
-void silc_fsm_event_signal(SilcFSMEvent event);
-
-#endif /* SILCFSM_I_H */
diff --git a/lib/silcutil/silchashtable.c b/lib/silcutil/silchashtable.c
deleted file mode 100644 (file)
index 6ba2e0a..0000000
+++ /dev/null
@@ -1,962 +0,0 @@
-/*
-
-  silchashtable.c
-
-  Author: Pekka Riikonen <priikone@silcnet.org>
-
-  Copyright (C) 2001 - 2006 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.
-
-*/
-/* Implementation of collision resistant hash table. This is a hash table
-   that provides a reliable (what you add stays there, and duplicate keys
-   are allowed) with as fast reference to the key as possible. If duplicate
-   keys are a lot in the hash table the lookup gets slower of course.
-   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. */
-/* $Id$ */
-
-#include "silc.h"
-#include "silchashtable.h"
-
-/* Define to 1 if you want hash table debug enabled */
-#define SILC_HASH_TABLE_DEBUG 0
-
-#if SILC_HASH_TABLE_DEBUG == 1
-#define SILC_HT_DEBUG(fmt) SILC_LOG_DEBUG(fmt)
-#else
-#define SILC_HT_DEBUG(fmt)
-#endif
-
-/* Default size of the hash table (index to prime table) */
-#define SILC_HASH_TABLE_SIZE 2
-
-/* Produce the index by hashing the key */
-#define SILC_HASH_TABLE_HASH(f, c) \
-  ((f)(key, (c)) % primesize[ht->table_size])
-
-/* Check whether need to rehash */
-#define SILC_HASH_REHASH_INC \
-  (ht->auto_rehash && (ht->entry_count / 2) > primesize[ht->table_size])
-#define SILC_HASH_REHASH_DEC \
-  (ht->auto_rehash && (ht->entry_count * 2) < primesize[ht->table_size] && \
-   ht->entry_count > primesize[SILC_HASH_TABLE_SIZE])
-
-/* One entry in the hash table. Includes the key and the associated
-   context. The `next' pointer is non-NULL if two (or more) different
-   keys hashed to same value.  The pointer is the pointer to the next
-   entry. */
-typedef struct SilcHashTableEntryStruct {
-  void *key;
-  void *context;
-  struct SilcHashTableEntryStruct *next;
-} *SilcHashTableEntry;
-
-/* Hash table. */
-struct SilcHashTableStruct {
-  SilcHashTableEntry *table;
-  SilcUInt32 table_size;
-  SilcUInt32 entry_count;
-  SilcHashFunction hash;
-  SilcHashCompare compare;
-  SilcHashDestructor destructor;
-  void *hash_user_context;
-  void *compare_user_context;
-  void *destructor_user_context;
-  unsigned int auto_rehash : 1;
-};
-
-/* Prime sizes for the hash table. The size of the table will always
-   be one of these. */
-const SilcUInt32 primesize[] =
-{
-  3, 5, 11, 17, 37, 67, 109, 131, 163, 257, 367, 521, 823, 1031,
-  1237, 1447, 2053, 2389, 2777, 3323, 4099, 5059, 6247, 7001, 8209, 10993,
-  14057, 16411, 19181, 21089, 25033, 32771, 40009, 47431, 65537, 106721,
-  131101, 262147, 360163, 524309, 810343, 1048583, 2097169, 4194319,
-  6153409, 8388617, 13845163, 16777259, 33554467, 67108879
-};
-
-/* Find appropriate size for the hash table. The size will be a prime. */
-
-static SilcUInt32 silc_hash_table_primesize(SilcUInt32 size, SilcUInt32 *index)
-{
-  int i;
-
-  for (i = 0; i < sizeof(primesize) / sizeof(primesize[0]); i++)
-    if (primesize[i] >= size) {
-      *index = i;
-      SILC_HT_DEBUG(("sizeof of the hash table is %d", primesize[*index]));
-      return primesize[i];
-    }
-
-  *index = i - 1;
-  SILC_HT_DEBUG(("sizeof of the hash table is %d", primesize[*index]));
-  return primesize[i - 1];
-}
-
-/* Internal routine to find entry in the hash table by `key'. Returns
-   the previous entry (if exists) as well. */
-
-static inline SilcHashTableEntry *
-silc_hash_table_find_internal(SilcHashTable ht, void *key,
-                             SilcHashTableEntry *prev_entry,
-                             SilcHashFunction hash, void *hash_user_context,
-                             SilcHashCompare compare,
-                             void *compare_user_context)
-{
-  SilcHashTableEntry *entry, prev = NULL;
-  SilcUInt32 i = SILC_HASH_TABLE_HASH(hash, hash_user_context);
-
-  SILC_HT_DEBUG(("index %d key %p", i, key));
-
-  entry = &ht->table[i];
-  if (compare) {
-    while (*entry && !compare((*entry)->key, key, compare_user_context)) {
-      prev = *entry;
-      entry = &(*entry)->next;
-    }
-  } else {
-    while (*entry && (*entry)->key != key) {
-      prev = *entry;
-      entry = &(*entry)->next;
-    }
-  }
-
-  *prev_entry = prev;
-  return entry;
-}
-
-/* Internal routine to find entry in the hash table by `key' and `context'.
-   Returns the previous entry (if exists) as well to `prev_entry'. */
-
-static inline SilcHashTableEntry *
-silc_hash_table_find_internal_context(SilcHashTable ht, void *key,
-                                     void *context,
-                                     SilcHashTableEntry *prev_entry,
-                                     SilcHashFunction hash,
-                                     void *hash_user_context,
-                                     SilcHashCompare compare,
-                                     void *compare_user_context)
-{
-  SilcHashTableEntry *entry, prev = NULL;
-  SilcUInt32 i = SILC_HASH_TABLE_HASH(hash, hash_user_context);
-
-  SILC_HT_DEBUG(("index %d key %p context %p", i, key, context));
-
-  entry = &ht->table[i];
-  if (ht->compare) {
-    while (*entry) {
-      if (compare((*entry)->key, key, compare_user_context) &&
-         (*entry)->context == context)
-       break;
-      prev = *entry;
-      entry = &(*entry)->next;
-    }
-  } else {
-    while (*entry) {
-      if ((*entry)->key == key && (*entry)->context == context)
-       break;
-      prev = *entry;
-      entry = &(*entry)->next;
-    }
-  }
-
-  if (prev_entry)
-    *prev_entry = prev;
-  return entry;
-}
-
-/* Internal routine to find entry in the hash table by `key'. */
-
-static inline SilcHashTableEntry *
-silc_hash_table_find_internal_simple(SilcHashTable ht, void *key,
-                                    SilcHashFunction hash,
-                                    void *hash_user_context,
-                                    SilcHashCompare compare,
-                                    void *compare_user_context)
-{
-  SilcHashTableEntry *entry;
-  SilcUInt32 i = SILC_HASH_TABLE_HASH(hash, hash_user_context);
-
-  SILC_HT_DEBUG(("index %d key %p", i, key));
-
-  entry = &ht->table[i];
-  if (compare) {
-    while (*entry && !compare((*entry)->key, key, compare_user_context))
-      entry = &(*entry)->next;
-  } else {
-    while (*entry && (*entry)->key != key)
-      entry = &(*entry)->next;
-  }
-
-  return entry;
-}
-
-/* Internal routine to find all keys by `key'. This may return multiple
-   entries if multiple entries with same key exists. With specific
-   hash and comparison functions. */
-
-static inline void
-silc_hash_table_find_internal_all(SilcHashTable ht, void *key,
-                                 SilcHashFunction hash,
-                                 void *hash_user_context,
-                                 SilcHashCompare compare,
-                                 void *compare_user_context,
-                                 SilcHashForeach foreach,
-                                 void *foreach_user_context)
-{
-  SilcHashTableEntry e, tmp;
-  SilcBool auto_rehash, found = FALSE;
-  SilcUInt32 i = SILC_HASH_TABLE_HASH(hash, hash_user_context);
-
-  SILC_HT_DEBUG(("index %d key %p", i, key));
-
-  /* Disallow auto rehashing while going through the table since we call
-     the `foreach' function which could alter the table. */
-  auto_rehash = ht->auto_rehash;
-  ht->auto_rehash = FALSE;
-
-  e = ht->table[i];
-  if (compare) {
-    while (e) {
-      tmp = e->next;
-      if (compare(e->key, key, compare_user_context)) {
-       found = TRUE;
-       foreach(e->key, e->context, foreach_user_context);
-      }
-      e = tmp;
-    }
-  } else {
-    while (e) {
-      tmp = e->next;
-      if (e->key == key) {
-       found = TRUE;
-       foreach(e->key, e->context, foreach_user_context);
-      }
-      e = tmp;
-    }
-  }
-
-  /* If nothing was found call with NULL context the callback */
-  if (!found)
-    foreach(key, NULL, foreach_user_context);
-
-  ht->auto_rehash = auto_rehash;
-}
-
-/* Internal routine to add new key to the hash table */
-
-static inline SilcBool
-silc_hash_table_add_internal(SilcHashTable ht, void *key, void *context,
-                            SilcHashFunction hash,
-                            void *hash_user_context)
-{
-  SilcHashTableEntry *entry;
-  SilcUInt32 i = SILC_HASH_TABLE_HASH(hash, hash_user_context);
-
-  SILC_HT_DEBUG(("index %d key %p", i, key));
-
-  entry = &ht->table[i];
-  if (*entry) {
-    /* The entry exists already. We have a collision, add it to the
-       list to avoid collision. */
-    SilcHashTableEntry e, tmp;
-
-    e = *entry;
-    tmp = e->next;
-    while (tmp) {
-      e = tmp;
-      tmp = tmp->next;
-    }
-
-    SILC_HT_DEBUG(("Collision; adding new key to list"));
-
-    e->next = silc_calloc(1, sizeof(*e->next));
-    if (!e->next)
-      return FALSE;
-    e->next->key = key;
-    e->next->context = context;
-    ht->entry_count++;
-  } else {
-    /* New key */
-    SILC_HT_DEBUG(("New key"));
-    *entry = silc_calloc(1, sizeof(**entry));
-    if (!(*entry))
-      return FALSE;
-    (*entry)->key = key;
-    (*entry)->context = context;
-    ht->entry_count++;
-  }
-
-  if (SILC_HASH_REHASH_INC)
-    silc_hash_table_rehash(ht, 0);
-
-  return TRUE;
-}
-
-/* Internal routine to replace old key with new one (if it exists) */
-
-static inline SilcBool
-silc_hash_table_replace_internal(SilcHashTable ht, void *key, void *context,
-                                SilcHashFunction hash,
-                                void *hash_user_context)
-{
-  SilcHashTableEntry *entry;
-  SilcUInt32 i = SILC_HASH_TABLE_HASH(hash, hash_user_context);
-
-  SILC_HT_DEBUG(("index %d key %p", i, key));
-
-  entry = &ht->table[i];
-  if (*entry) {
-    /* The entry exists already. We have a collision, replace the old
-       key and context. */
-    if (ht->destructor)
-      ht->destructor((*entry)->key, (*entry)->context,
-                    ht->destructor_user_context);
-  } else {
-    /* New key */
-    *entry = silc_calloc(1, sizeof(**entry));
-    if (!(*entry))
-      return FALSE;
-    ht->entry_count++;
-  }
-
-  (*entry)->key = key;
-  (*entry)->context = context;
-
-  if (SILC_HASH_REHASH_INC)
-    silc_hash_table_rehash(ht, 0);
-
-  return TRUE;
-}
-
-/* Allocates new hash table and returns it.  If the `table_size' is not
-   zero then the hash table size is the size provided. If zero then the
-   default size will be used. Note that if the `table_size' is provided
-   it should be a prime. The `hash', `compare' and `destructor' are
-   the hash function, the key comparison function and key and context
-   destructor function, respectively. The `hash' is mandatory, the others
-   are optional. */
-
-SilcHashTable silc_hash_table_alloc(SilcUInt32 table_size,
-                                   SilcHashFunction hash,
-                                   void *hash_user_context,
-                                   SilcHashCompare compare,
-                                   void *compare_user_context,
-                                   SilcHashDestructor destructor,
-                                   void *destructor_user_context,
-                                   SilcBool auto_rehash)
-{
-  SilcHashTable ht;
-  SilcUInt32 size_index = SILC_HASH_TABLE_SIZE;
-
-  if (!hash)
-    return NULL;
-
-  ht = silc_calloc(1, sizeof(*ht));
-  if (!ht)
-    return NULL;
-  ht->table = silc_calloc(table_size ? silc_hash_table_primesize(table_size,
-                                                                &size_index) :
-                         primesize[SILC_HASH_TABLE_SIZE],
-                         sizeof(*ht->table));
-  if (!ht->table) {
-    silc_free(ht);
-    return NULL;
-  }
-  ht->table_size = size_index;
-  ht->hash = hash;
-  ht->compare = compare;
-  ht->destructor = destructor;
-  ht->hash_user_context = hash_user_context;
-  ht->compare_user_context = compare_user_context;
-  ht->destructor_user_context = destructor_user_context;
-  ht->auto_rehash = auto_rehash;
-
-  return ht;
-}
-
-/* Frees the hash table. The destructor function provided in the
-   silc_hash_table_alloc will be called for all keys in the hash table. */
-
-void silc_hash_table_free(SilcHashTable ht)
-{
-  SilcHashTableEntry e, tmp;
-  int i;
-
-  for (i = 0; i < primesize[ht->table_size]; i++) {
-    e = ht->table[i];
-    while (e) {
-      if (ht->destructor)
-       ht->destructor(e->key, e->context, ht->destructor_user_context);
-      tmp = e;
-      e = e->next;
-      silc_free(tmp);
-    }
-  }
-
-  silc_free(ht->table);
-  silc_free(ht);
-}
-
-/* Returns the size of the hash table */
-
-SilcUInt32 silc_hash_table_size(SilcHashTable ht)
-{
-  return primesize[ht->table_size];
-}
-
-/* Returns the number of the entires in the hash table. If there is more
-   entries in the table thatn the size of the hash table calling the
-   silc_hash_table_rehash is recommended. */
-
-SilcUInt32 silc_hash_table_count(SilcHashTable ht)
-{
-  return ht->entry_count;
-}
-
-/* Adds new entry to the hash table. The `key' is hashed using the
-   hash function and the both `key' and `context' will be saved to the
-   hash table. This function quarantees that the entry is always added
-   to the hash table reliably (it is collision resistant). */
-
-SilcBool silc_hash_table_add(SilcHashTable ht, void *key, void *context)
-{
-  return silc_hash_table_add_internal(ht, key, context, ht->hash,
-                                     ht->hash_user_context);
-}
-
-/* Same as above but with specific hash function and user context. */
-
-SilcBool silc_hash_table_add_ext(SilcHashTable ht, void *key, void *context,
-                                SilcHashFunction hash,
-                                void *hash_user_context)
-{
-  return silc_hash_table_add_internal(ht, key, context,
-                                     hash, hash_user_context);
-}
-
-/* Same as above but if the `key' already exists in the hash table
-   the old key and the old context will be replace with the `key' and
-   the `context. The destructor function will be called for the
-   replaced key and context. */
-
-SilcBool silc_hash_table_replace(SilcHashTable ht, void *key, void *context)
-{
-  return silc_hash_table_replace_internal(ht, key, context, ht->hash,
-                                         ht->hash_user_context);
-}
-
-/* Same as above but with specific hash function. */
-
-SilcBool silc_hash_table_replace_ext(SilcHashTable ht, void *key,
-                                    void *context,
-                                    SilcHashFunction hash,
-                                    void *hash_user_context)
-{
-  return silc_hash_table_replace_internal(ht, key, context,
-                                         hash, hash_user_context);
-}
-
-/* Removes the entry from the hash table by the provided `key'. This will
-   call the destructor funtion for the found entry. Return TRUE if the
-   entry was removed successfully and FALSE otherwise. */
-
-SilcBool silc_hash_table_del(SilcHashTable ht, void *key)
-{
-  SilcHashTableEntry *entry, prev, e;
-
-  entry = silc_hash_table_find_internal(ht, key, &prev,
-                                       ht->hash, ht->hash_user_context,
-                                       ht->compare, ht->compare_user_context);
-  if (*entry == NULL)
-    return FALSE;
-
-  e = *entry;
-
-  if (!prev && e->next)
-    *entry = e->next;
-  if (!prev && e->next == NULL)
-    *entry = NULL;
-  if (prev)
-    prev->next = NULL;
-  if (prev && e->next)
-    prev->next = e->next;
-
-  if (ht->destructor)
-    ht->destructor(e->key, e->context, ht->destructor_user_context);
-  silc_free(e);
-
-  ht->entry_count--;
-
-  if (SILC_HASH_REHASH_DEC)
-    silc_hash_table_rehash(ht, 0);
-
-  return TRUE;
-}
-
-/* Same as above but with specific hash and compare functions. */
-
-SilcBool silc_hash_table_del_ext(SilcHashTable ht, void *key,
-                                SilcHashFunction hash,
-                                void *hash_user_context,
-                                SilcHashCompare compare,
-                                void *compare_user_context,
-                                SilcHashDestructor destructor,
-                                void *destructor_user_context)
-{
-  SilcHashTableEntry *entry, prev, e;
-
-  entry = silc_hash_table_find_internal(ht, key, &prev,
-                                       hash ? hash : ht->hash,
-                                       hash_user_context ? hash_user_context :
-                                       ht->hash_user_context,
-                                       compare ? compare : ht->compare,
-                                       compare_user_context ?
-                                       compare_user_context :
-                                       ht->compare_user_context);
-  if (*entry == NULL)
-    return FALSE;
-
-  e = *entry;
-
-  if (!prev && e->next)
-    *entry = e->next;
-  if (!prev && e->next == NULL)
-    *entry = NULL;
-  if (prev)
-    prev->next = NULL;
-  if (prev && e->next)
-    prev->next = e->next;
-
-  if (destructor) {
-    destructor(e->key, e->context, destructor_user_context);
-  } else {
-    if (ht->destructor)
-      ht->destructor(e->key, e->context, ht->destructor_user_context);
-  }
-  silc_free(e);
-
-  ht->entry_count--;
-
-  if (SILC_HASH_REHASH_DEC)
-    silc_hash_table_rehash(ht, 0);
-
-  return TRUE;
-}
-
-/* Same as above but verifies that the context associated with the `key'
-   matches the `context'. This is handy to use with hash tables that may
-   have duplicate keys. In that case the `context' may be used to check
-   whether the correct entry is being deleted. */
-
-SilcBool silc_hash_table_del_by_context(SilcHashTable ht, void *key,
-                                       void *context)
-{
-  SilcHashTableEntry *entry, prev, e;
-
-  entry = silc_hash_table_find_internal_context(ht, key, context, &prev,
-                                               ht->hash,
-                                               ht->hash_user_context,
-                                               ht->compare,
-                                               ht->compare_user_context);
-  if (*entry == NULL)
-    return FALSE;
-
-  e = *entry;
-
-  if (!prev && e->next)
-    *entry = e->next;
-  if (!prev && e->next == NULL)
-    *entry = NULL;
-  if (prev)
-    prev->next = NULL;
-  if (prev && e->next)
-    prev->next = e->next;
-
-  if (ht->destructor)
-    ht->destructor(e->key, e->context, ht->destructor_user_context);
-  silc_free(e);
-
-  ht->entry_count--;
-
-  if (SILC_HASH_REHASH_DEC)
-    silc_hash_table_rehash(ht, 0);
-
-  return TRUE;
-}
-
-/* Same as above but with specific hash and compare functions. */
-
-SilcBool silc_hash_table_del_by_context_ext(SilcHashTable ht, void *key,
-                                           void *context,
-                                           SilcHashFunction hash,
-                                           void *hash_user_context,
-                                           SilcHashCompare compare,
-                                           void *compare_user_context,
-                                           SilcHashDestructor destructor,
-                                           void *destructor_user_context)
-{
-  SilcHashTableEntry *entry, prev, e;
-
-  entry = silc_hash_table_find_internal_context(ht, key, context, &prev,
-                                               hash ? hash : ht->hash,
-                                               hash_user_context ?
-                                               hash_user_context :
-                                               ht->hash_user_context,
-                                               compare ?
-                                               compare : ht->compare,
-                                               compare_user_context ?
-                                               compare_user_context :
-                                               ht->compare_user_context);
-  if (*entry == NULL)
-    return FALSE;
-
-  e = *entry;
-
-  if (!prev && e->next)
-    *entry = e->next;
-  if (!prev && e->next == NULL)
-    *entry = NULL;
-  if (prev)
-    prev->next = NULL;
-  if (prev && e->next)
-    prev->next = e->next;
-
-  if (destructor) {
-    destructor(e->key, e->context, destructor_user_context);
-  } else {
-    if (ht->destructor)
-      ht->destructor(e->key, e->context, ht->destructor_user_context);
-  }
-  silc_free(e);
-
-  ht->entry_count--;
-
-  if (SILC_HASH_REHASH_DEC)
-    silc_hash_table_rehash(ht, 0);
-
-  return TRUE;
-}
-
-/* Finds the entry in the hash table by the provided `key' as fast as
-   possible. Return TRUE if the entry was found and FALSE otherwise.
-   The found entry is returned to the `ret_key' and `ret_context',
-   respectively. If the `ret_key and `ret_context' are NULL then this
-   maybe used only to check whether given key exists in the table. */
-
-SilcBool silc_hash_table_find(SilcHashTable ht, void *key,
-                             void **ret_key, void **ret_context)
-{
-  return silc_hash_table_find_ext(ht, key, ret_key, ret_context,
-                                 NULL, NULL, NULL, NULL);
-}
-
-/* Same as above but with specified hash and comparison functions. */
-
-SilcBool silc_hash_table_find_ext(SilcHashTable ht, void *key,
-                                 void **ret_key, void **ret_context,
-                                 SilcHashFunction hash,
-                                 void *hash_user_context,
-                                 SilcHashCompare compare,
-                                 void *compare_user_context)
-{
-  SilcHashTableEntry *entry;
-
-  entry = silc_hash_table_find_internal_simple(ht, key,
-                                              hash ? hash : ht->hash,
-                                              hash_user_context ?
-                                              hash_user_context :
-                                              ht->hash_user_context,
-                                              compare ? compare :
-                                              ht->compare,
-                                              compare_user_context ?
-                                              compare_user_context :
-                                              ht->compare_user_context);
-  if (*entry == NULL)
-    return FALSE;
-
-  if (ret_key)
-    *ret_key = (*entry)->key;
-  if (ret_context)
-    *ret_context = (*entry)->context;
-
-  return TRUE;
-}
-
-/* Same as silc_hash_table_find but finds with specific context. */
-
-SilcBool silc_hash_table_find_by_context(SilcHashTable ht, void *key,
-                                        void *context, void **ret_key)
-{
-  return silc_hash_table_find_by_context_ext(ht, key, context, ret_key,
-                                            NULL, NULL, NULL, NULL);
-}
-
-/* Same as above but with specified hash and comparison functions. */
-
-SilcBool silc_hash_table_find_by_context_ext(SilcHashTable ht, void *key,
-                                            void *context, void **ret_key,
-                                            SilcHashFunction hash,
-                                            void *hash_user_context,
-                                            SilcHashCompare compare,
-                                            void *compare_user_context)
-{
-  SilcHashTableEntry *entry;
-
-  entry = silc_hash_table_find_internal_context(ht, key, context, NULL,
-                                               hash ? hash : ht->hash,
-                                               hash_user_context ?
-                                               hash_user_context :
-                                               ht->hash_user_context,
-                                               compare ? compare :
-                                               ht->compare,
-                                               compare_user_context ?
-                                               compare_user_context :
-                                               ht->compare_user_context);
-  if (!entry || !(*entry))
-    return FALSE;
-
-  if (ret_key)
-    *ret_key = (*entry)->key;
-
-  return TRUE;
-}
-
-/* As the hash table is collision resistant it is possible to save duplicate
-   keys to the hash table. This function can be used to find all keys
-   and contexts from the hash table that are found using the `key'. The
-   `foreach' is called for every found key. */
-
-void silc_hash_table_find_foreach(SilcHashTable ht, void *key,
-                                 SilcHashForeach foreach, void *user_context)
-{
-  silc_hash_table_find_internal_all(ht, key, ht->hash, ht->hash_user_context,
-                                   ht->compare, ht->compare_user_context,
-                                   foreach, user_context);
-}
-
-/* Same as above but with specific hash and comparison functions. */
-
-void silc_hash_table_find_foreach_ext(SilcHashTable ht, void *key,
-                                     SilcHashFunction hash,
-                                     void *hash_user_context,
-                                     SilcHashCompare compare,
-                                     void *compare_user_context,
-                                     SilcHashForeach foreach,
-                                     void *foreach_user_context)
-{
-  silc_hash_table_find_internal_all(ht, key,
-                                   hash ? hash : ht->hash,
-                                   hash_user_context ?
-                                   hash_user_context :
-                                   ht->hash_user_context,
-                                   compare ? compare :
-                                   ht->compare,
-                                   compare_user_context ?
-                                   compare_user_context :
-                                   ht->compare_user_context,
-                                   foreach, foreach_user_context);
-}
-
-/* Traverse all entrys in the hash table and call the `foreach' for
-   every entry with the `user_context' context. */
-
-void silc_hash_table_foreach(SilcHashTable ht, SilcHashForeach foreach,
-                            void *user_context)
-{
-  SilcHashTableEntry e, tmp;
-  int i;
-  SilcBool auto_rehash;
-
-  if (!foreach)
-    return;
-
-  auto_rehash = ht->auto_rehash;
-  ht->auto_rehash = FALSE;
-  for (i = 0; i < primesize[ht->table_size]; i++) {
-    e = ht->table[i];
-    while (e) {
-      /* Entry may become invalid inside the `foreach' */
-      tmp = e->next;
-      foreach(e->key, e->context, user_context);
-      e = tmp;
-    }
-  }
-  ht->auto_rehash = auto_rehash;
-}
-
-/* Rehashs the hash table. The size of the new hash table is provided
-   as `new_size'. If the `new_size' is zero then this routine will make
-   the new table of a suitable size. Note that this operation may be
-   very slow. */
-
-void silc_hash_table_rehash(SilcHashTable ht, SilcUInt32 new_size)
-{
-  int i;
-  SilcHashTableEntry *table, e, tmp;
-  SilcUInt32 table_size, size_index;
-  SilcBool auto_rehash;
-
-  SILC_HT_DEBUG(("Start"));
-
-  if (new_size)
-    silc_hash_table_primesize(new_size, &size_index);
-  else
-    silc_hash_table_primesize(ht->entry_count, &size_index);
-
-  if (size_index == ht->table_size)
-    return;
-
-  SILC_HT_DEBUG(("Rehashing"));
-
-  /* Take old hash table */
-  table = ht->table;
-  table_size = ht->table_size;
-  auto_rehash = ht->auto_rehash;
-  ht->auto_rehash = FALSE;
-
-  /* Allocate new table */
-  ht->table = silc_calloc(primesize[size_index], sizeof(*ht->table));
-  if (!ht->table)
-    return;
-  ht->table_size = size_index;
-  ht->entry_count = 0;
-
-  /* Rehash */
-  for (i = 0; i < primesize[table_size]; i++) {
-    e = table[i];
-    while (e) {
-      silc_hash_table_add(ht, e->key, e->context);
-      tmp = e;
-      e = e->next;
-
-      /* Remove old entry */
-      silc_free(tmp);
-    }
-  }
-
-  ht->auto_rehash = auto_rehash;
-
-  /* Remove old table */
-  silc_free(table);
-}
-
-/* Same as above but with specific hash function. */
-
-void silc_hash_table_rehash_ext(SilcHashTable ht, SilcUInt32 new_size,
-                               SilcHashFunction hash,
-                               void *hash_user_context)
-{
-  int i;
-  SilcHashTableEntry *table, e, tmp;
-  SilcUInt32 table_size, size_index;
-  SilcBool auto_rehash;
-
-  SILC_HT_DEBUG(("Start"));
-
-  if (new_size)
-    silc_hash_table_primesize(new_size, &size_index);
-  else
-    silc_hash_table_primesize(ht->entry_count, &size_index);
-
-  if (size_index == ht->table_size)
-    return;
-
-  SILC_HT_DEBUG(("Rehashing"));
-
-  /* Take old hash table */
-  table = ht->table;
-  table_size = ht->table_size;
-  auto_rehash = ht->auto_rehash;
-  ht->auto_rehash = FALSE;
-
-  /* Allocate new table */
-  ht->table = silc_calloc(primesize[size_index], sizeof(*ht->table));
-  if (!ht->table)
-    return;
-  ht->table_size = size_index;
-  ht->entry_count = 0;
-
-  /* Rehash */
-  for (i = 0; i < primesize[table_size]; i++) {
-    e = table[i];
-    while (e) {
-      silc_hash_table_add_ext(ht, e->key, e->context, hash,
-                             hash_user_context);
-      tmp = e;
-      e = e->next;
-
-      /* Remove old entry */
-      silc_free(tmp);
-    }
-  }
-
-  ht->auto_rehash = auto_rehash;
-
-  /* Remove old table */
-  silc_free(table);
-}
-
-/* Prepares the `htl' list structure sent as argument to be used in the
-   hash table traversing with the silc_hash_table_get. Usage:
-   SilcHashTableList htl; silc_hash_table_list(ht, &htl); */
-
-void silc_hash_table_list(SilcHashTable ht, SilcHashTableList *htl)
-{
-  htl->ht = ht;
-  htl->entry = NULL;
-  htl->index = 0;
-  htl->auto_rehash = ht->auto_rehash;
-
-  /* Disallow rehashing of the table while traversing the table */
-  ht->auto_rehash = FALSE;
-}
-
-/* Resets the `htl' SilcHashTableList. */
-
-void silc_hash_table_list_reset(SilcHashTableList *htl)
-{
-  /* Set back the original auto rehash value to the table */
-  htl->ht->auto_rehash = htl->auto_rehash;
-}
-
-/* Returns always the next entry in the hash table into the `key' and
-   `context' and TRUE.  If this returns FALSE then there are no anymore
-   any entrys. Usage: while (silc_hash_table_get(&htl, &key, &context)) */
-
-SilcBool silc_hash_table_get(SilcHashTableList *htl, void **key,
-                            void **context)
-{
-  SilcHashTableEntry entry = (SilcHashTableEntry)htl->entry;
-
-  if (!htl->ht->entry_count)
-    return FALSE;
-
-  while (!entry && htl->index < primesize[htl->ht->table_size]) {
-    entry = htl->ht->table[htl->index];
-    htl->index++;
-  }
-
-  if (!entry)
-    return FALSE;
-
-  htl->entry = entry->next;
-
-  if (key)
-    *key = entry->key;
-  if (context)
-    *context = entry->context;
-
-  return TRUE;
-}
diff --git a/lib/silcutil/silchashtable.h b/lib/silcutil/silchashtable.h
deleted file mode 100644 (file)
index f7d21cb..0000000
+++ /dev/null
@@ -1,736 +0,0 @@
-/*
-
-  silchashtable.h
-
-  Author: Pekka Riikonen <priikone@silcnet.org>
-
-  Copyright (C) 2001 - 2006 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.
-
-*/
-
-/****h* silcutil/SILC Hash Table Interface
- *
- * 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 gets
- * slower of course. 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 its own hash and comparison
- * functions.
- *
- * There are two ways to traverse the entire hash table if this feature
- * is needed. There exists a foreach function that calls a foreach
- * callback for each entry in the hash table. Other way is to use
- * SilcHashTableList structure and traverse the hash table inside while()
- * using the list structure. Both are equally fast.
- *
- * The hash table is not thread safe.  If same hash table context is used in
- * multi thread environment concurrency control must be employed.
- *
- ***/
-
-#ifndef SILCHASHTABLE_H
-#define SILCHASHTABLE_H
-
-/****s* silcutil/SilcHashTableAPI/SilcHashTable
- *
- * NAME
- *
- *    typedef struct SilcHashTableStruct *SilcHashTable;
- *
- * DESCRIPTION
- *
- *    This context is the actual hash table and is allocated
- *    by silc_hash_table_alloc and given as argument usually to
- *    all silc_hash_table_* functions.  It is freed by the
- *    silc_hash_table_free function.
- *
- ***/
-typedef struct SilcHashTableStruct *SilcHashTable;
-
-/****s* silcutil/SilcHashTableAPI/SilcHashTableList
- *
- * NAME
- *
- *    typedef struct SilcHashTableListStruct SilcHashTableList;
- *
- * DESCRIPTION
- *
- *    This structure is used to tarverse the hash table. This structure
- *    is given as argument to the silc_hash_table_list function to
- *    initialize it and then used to traverse the hash table with the
- *    silc_hash_table_get function. It needs not be allocated or freed.
- *
- * EXAMPLE
- *
- *    SilcHashTableList htl;
- *    silc_hash_table_list(hash_table, &htl);
- *    while (silc_hash_table_get(&htl, (void *)&key, (void *)&context))
- *      ...
- *    silc_hash_table_list_reset(&htl);
- *
- * SOURCE
- */
-typedef struct SilcHashTableListStruct SilcHashTableList;
-
-/* List structure to traverse the hash table. */
-struct SilcHashTableListStruct {
-  SilcHashTable ht;
-  void *entry;
-  unsigned int index        : 31;
-  unsigned int auto_rehash  : 1;
-};
-/***/
-
-/****f* silcutil/SilcHashTableAPI/SilcHashFunction
- *
- * SYNOPSIS
- *
- *    typedef SilcUInt32 (*SilcHashFunction)(void *key, void *user_context);
- *
- * DESCRIPTION
- *
- *    A type for the hash function. This function is used to hash the
- *    provided key value `key' and return the index for the hash table.
- *    The `user_context' is application specific context and is delivered
- *    to the callback.
- *
- ***/
-typedef SilcUInt32 (*SilcHashFunction)(void *key, void *user_context);
-
-/****f* silcutil/SilcHashTableAPI/SilcHashCompare
- *
- * SYNOPSIS
- *
- *    typedef SilcBool (*SilcHashCompare)(void *key1, void *key2,
- *                                        void *user_context);
- *
- * DESCRIPTION
- *
- *    A comparison funtion that is called to compare the two keys `key1' and
- *    `key2'. If they are equal this must return TRUE or FALSE otherwise.
- *    The application provides this function when allocating a new hash table.
- *    The `user_context' is application specific context and is delivered
- *    to the callback.
- *
- ***/
-typedef SilcBool (*SilcHashCompare)(void *key1, void *key2,
-                                   void *user_context);
-
-/****f* silcutil/SilcHashTableAPI/SilcHashDestructor
- *
- * SYNOPSIS
- *
- *    typedef void (*SilcHashDestructor)(void *key, void *context,
- *                                       void *user_context);
- *
- * DESCRIPTION
- *
- *    A destructor callback that the library will call to destroy the
- *    `key' and `context'.  The application provides the function when
- *    allocating a new hash table. The `user_context' is application
- *    specific context and is delivered to the callback.
- *
- ***/
-typedef void (*SilcHashDestructor)(void *key, void *context,
-                                  void *user_context);
-
-/****f* silcutil/SilcHashTableAPI/SilcHashForeach
- *
- * SYNOPSIS
- *
- *    typedef void (*SilcHashForeach)(void *key, void *context,
- *                                    void *user_context);
- *
- * DESCRIPTION
- *
- *    Foreach function. This is called when traversing the entrys in the
- *    hash table using silc_hash_table_foreach. The `user_context' is
- *    application specific context and is delivered to the callback.
- *
- ***/
-typedef void (*SilcHashForeach)(void *key, void *context, void *user_context);
-
-/* Simple hash table interface */
-
-/****f* silcutil/SilcHashTableAPI/silc_hash_table_alloc
- *
- * SYNOPSIS
- *
- *    SilcHashTable silc_hash_table_alloc(SilcUInt32 table_size,
- *                                        SilcHashFunction hash,
- *                                        void *hash_user_context,
- *                                        SilcHashCompare compare,
- *                                        void *compare_user_context,
- *                                        SilcHashDestructor destructor,
- *                                        void *destructor_user_context,
- *                                        SilcBool auto_rehash);
- *
- * DESCRIPTION
- *
- *    Allocates new hash table and returns it.  If the `table_size' is not
- *    zero then the hash table size is the size provided. If zero then the
- *    default size will be used. Note that if the `table_size' is provided
- *    it should be a prime. The `hash', `compare' and `destructor' are
- *    the hash function, the key comparison function and key and context
- *    destructor function, respectively. The `hash' is mandatory, the others
- *    are optional.
- *
- ***/
-SilcHashTable silc_hash_table_alloc(SilcUInt32 table_size,
-                                   SilcHashFunction hash,
-                                   void *hash_user_context,
-                                   SilcHashCompare compare,
-                                   void *compare_user_context,
-                                   SilcHashDestructor destructor,
-                                   void *destructor_user_context,
-                                   SilcBool auto_rehash);
-
-/****f* silcutil/SilcHashTableAPI/silc_hash_table_free
- *
- * SYNOPSIS
- *
- *    void silc_hash_table_free(SilcHashTable ht);
- *
- * DESCRIPTION
- *
- *    Frees the hash table. The destructor function provided in the
- *    silc_hash_table_alloc will be called for all keys in the hash table.
- *
- ***/
-void silc_hash_table_free(SilcHashTable ht);
-
-/****f* silcutil/SilcHashTableAPI/silc_hash_table_size
- *
- * SYNOPSIS
- *
- *    SilcUInt32 silc_hash_table_size(SilcHashTable ht);
- *
- * DESCRIPTION
- *
- *    Returns the size of the hash table. This is the true size of the
- *    hash table.
- *
- ***/
-SilcUInt32 silc_hash_table_size(SilcHashTable ht);
-
-/****f* silcutil/SilcHashTableAPI/silc_hash_table_count
- *
- * SYNOPSIS
- *
- *    SilcUInt32 silc_hash_table_count(SilcHashTable ht);
- *
- * DESCRIPTION
- *
- *    Returns the number of the entires in the hash table. If there is more
- *    entries in the table thatn the size of the hash table calling the
- *    silc_hash_table_rehash is recommended.
- *
- ***/
-SilcUInt32 silc_hash_table_count(SilcHashTable ht);
-
-/****f* silcutil/SilcHashTableAPI/silc_hash_table_add
- *
- * SYNOPSIS
- *
- *    SilcBool silc_hash_table_add(SilcHashTable ht, void *key, void *context);
- *
- * DESCRIPTION
- *
- *    Adds new entry to the hash table. The `key' is hashed using the
- *    hash function and the both `key' and `context' will be saved to the
- *    hash table. This function quarantees that the entry is always added
- *    to the hash table reliably (it is collision resistant).
- *
- ***/
-SilcBool silc_hash_table_add(SilcHashTable ht, void *key, void *context);
-
-/****f* silcutil/SilcHashTableAPI/silc_hash_table_replace
- *
- * SYNOPSIS
- *
- *    SilcBool silc_hash_table_replace(SilcHashTable ht, void *key,
- *                                     void *context);
- *
- * DESCRIPTION
- *
- *    Same as silc_hash_table_add but if the `key' already exists in the
- *    hash table the old key and the old context will be replaced with the
- *    `key' and the `context. The destructor function will be called for the
- *    replaced key and context.
- *
- ***/
-SilcBool silc_hash_table_replace(SilcHashTable ht, void *key, void *context);
-
-/****f* silcutil/SilcHashTableAPI/silc_hash_table_del
- *
- * SYNOPSIS
- *
- *    SilcBool silc_hash_table_del(SilcHashTable ht, void *key);
- *
- * DESCRIPTION
- *
- *    Removes the entry from the hash table by the provided `key'. This will
- *    call the destructor funtion for the found entry. Return TRUE if the
- *    entry was removed successfully and FALSE otherwise.
- *
- ***/
-SilcBool silc_hash_table_del(SilcHashTable ht, void *key);
-
-/****f* silcutil/SilcHashTableAPI/silc_hash_table_del_by_context
- *
- * SYNOPSIS
- *
- *    SilcBool silc_hash_table_del_by_context(SilcHashTable ht, void *key,
- *                                            void *context);
- *
- * DESCRIPTION
- *
- *    Same as silc_hash_table_del but verifies that the context associated
- *    with the `key' matches the `context'. This is handy to use with hash
- *    tables that may have duplicate keys. In that case the `context' may
- *    be used to check whether the correct entry is being deleted.
- *
- ***/
-SilcBool silc_hash_table_del_by_context(SilcHashTable ht, void *key,
-                                       void *context);
-
-/****f* silcutil/SilcHashTableAPI/silc_hash_table_find
- *
- * SYNOPSIS
- *
- *    SilcBool silc_hash_table_find(SilcHashTable ht, void *key,
- *                                  void **ret_key, void **ret_context);
- *
- * DESCRIPTION
- *
- *    Finds the entry in the hash table by the provided `key' as fast as
- *    possible. Return TRUE if the entry was found and FALSE otherwise.
- *    The found entry is returned to the `ret_key' and `ret_context',
- *    respectively. If the `ret_key and `ret_context' are NULL then this
- *    maybe used only to check whether given key exists in the table.
- *
- ***/
-SilcBool silc_hash_table_find(SilcHashTable ht, void *key,
-                             void **ret_key, void **ret_context);
-
-/****f* silcutil/SilcHashTableAPI/silc_hash_table_find_by_context
- *
- * SYNOPSIS
- *
- *    SilcBool silc_hash_table_find_by_context(SilcHashTable ht, void *key,
- *                                             void *context, void **ret_key);
- *
- * DESCRIPTION
- *
- *    Finds the entry in the hash table by the provided `key' and
- *    `context' as fast as possible.  This is handy function when there
- *    can be multiple same keys in the hash table.  By using this function
- *    the specific key with specific context can be found.  Return
- *    TRUE if the entry with the key and context was found and FALSE
- *    otherwise.  The function returns only the key to `ret_key' since
- *    the caller already knows the context.
- *
- ***/
-SilcBool silc_hash_table_find_by_context(SilcHashTable ht, void *key,
-                                        void *context, void **ret_key);
-
-/****f* silcutil/SilcHashTableAPI/silc_hash_table_find_foreach
- *
- * SYNOPSIS
- *
- *    void silc_hash_table_find_foreach(SilcHashTable ht, void *key,
- *                                      SilcHashForeach foreach,
- *                                      void *user_context);
- *
- * DESCRIPTION
- *
- *    As the hash table is collision resistant it is possible to save duplicate
- *    keys to the hash table. This function can be used to find all keys
- *    and contexts from the hash table that are found using the `key'. The
- *    `foreach' is called for every found key. If no entries can be found
- *    the `foreach' will be called once with the context set NULL and
- *    `key' and `user_context' sent to the function.
- *
- * NOTES
- *
- *    The hash table will not be rehashed during the traversing of the table,
- *    even if the table was marked as auto rehashable.  The caller also must
- *    not call silc_hash_table_rehash while traversing the table.
- *
- ***/
-void silc_hash_table_find_foreach(SilcHashTable ht, void *key,
-                                 SilcHashForeach foreach, void *user_context);
-
-/****f* silcutil/SilcHashTableAPI/silc_hash_table_foreach
- *
- * SYNOPSIS
- *
- *    void silc_hash_table_foreach(SilcHashTable ht, SilcHashForeach foreach,
- *                                 void *user_context);
- *
- * DESCRIPTION
- *
- *    Traverse all entrys in the hash table and call the `foreach' for
- *    every entry with the `user_context' context.
- *
- * NOTES
- *
- *    The hash table will not be rehashed during the traversing of the table,
- *    even if the table was marked as auto rehashable.  The caller also must
- *    not call silc_hash_table_rehash while traversing the table.
- *
- ***/
-void silc_hash_table_foreach(SilcHashTable ht, SilcHashForeach foreach,
-                            void *user_context);
-
-/****f* silcutil/SilcHashTableAPI/silc_hash_table_rehash
- *
- * SYNOPSIS
- *
- *    void silc_hash_table_rehash(SilcHashTable ht, SilcUInt32 new_size);
- *
- * DESCRIPTION
- *
- *    Rehashs the hash table. The size of the new hash table is provided
- *    as `new_size'. If the `new_size' is zero then this routine will make
- *    the new table of a suitable size. Note that this operation may be
- *    very slow.
- *
- ***/
-void silc_hash_table_rehash(SilcHashTable ht, SilcUInt32 new_size);
-
-/****f* silcutil/SilcHashTableAPI/silc_hash_table_list
- *
- * SYNOPSIS
- *
- *    void silc_hash_table_list(SilcHashTable ht, SilcHashTableList *htl);
- *
- * DESCRIPTION
- *
- *    Prepares the `htl' SilcHashTableList sent as argument to be used in the
- *    hash table traversing with the silc_hash_table_get.  After the hash
- *    table traversing is completed the silc_hash_table_list_reset must be
- *    called.
- *
- * NOTES
- *
- *    The hash table will not be rehashed during the traversing of the list,
- *    even if the table was marked as auto rehashable.  The caller also must
- *    not call silc_hash_table_rehash while traversing the list.
- *
- ***/
-void silc_hash_table_list(SilcHashTable ht, SilcHashTableList *htl);
-
-/****f* silcutil/SilcHashTableAPI/silc_hash_table_list_reset
- *
- * SYNOPSIS
- *
- *    void silc_hash_table_list_reset(SilcHashTableList *htl);
- *
- * DESCRIPTION
- *
- *    Resets the `htl' SilcHashTableList.  This must be called after the
- *    hash table traversing is completed.
- *
- ***/
-void silc_hash_table_list_reset(SilcHashTableList *htl);
-
-/****f* silcutil/SilcHashTableAPI/silc_hash_table_get
- *
- * SYNOPSIS
- *
- *    SilcBool silc_hash_table_get(SilcHashTableList *htl, void **key,
- *                                 void **context);
- *
- * DESCRIPTION
- *
- *    Returns always the next entry in the hash table into the `key' and
- *    `context' and TRUE.  If this returns FALSE then there are no more
- *    entries.
- *
- * EXAMPLE
- *
- *    SilcHashTableList htl;
- *    silc_hash_table_list(hash_table, &htl);
- *    while (silc_hash_table_get(&htl, (void *)&key, (void *)&context))
- *      ...
- *    silc_hash_table_list_reset(&htl);
- *
- ***/
-SilcBool silc_hash_table_get(SilcHashTableList *htl,
-                            void **key, void **context);
-
-
-/* Extended hash table interface (same as above but with specific
-   hash and comparison functions). */
-
-/****f* silcutil/SilcHashTableAPI/silc_hash_table_add_ext
- *
- * SYNOPSIS
- *
- *    SilcBool silc_hash_table_add_ext(SilcHashTable ht, void *key,
- *                                     void *context,
- *                                     SilcHashFunction hash,
- *                                     void *hash_user_context);
- *
- * DESCRIPTION
- *
- *    Adds new entry to the hash table. The `key' is hashed using the
- *    hash function and the both `key' and `context' will be saved to the
- *    hash table. This function quarantees that the entry is always added
- *    to the hash table reliably (it is collision resistant).
- *
- *    The `hash' and `hash_user_context' are application specified hash
- *    function. If not provided the hash table's default is used.
- *
- ***/
-SilcBool silc_hash_table_add_ext(SilcHashTable ht,
-                                void *key, void *context,
-                                SilcHashFunction hash,
-                                void *hash_user_context);
-
-/****f* silcutil/SilcHashTableAPI/silc_hash_table_replace_ext
- *
- * SYNOPSIS
- *
- *    SilcBool silc_hash_table_replace_ext(SilcHashTable ht, void *key,
- *                                         void *context,
- *                                         SilcHashFunction hash,
- *                                         void *hash_user_context);
- *
- * DESCRIPTION
- *
- *    Same as silc_hash_table_add_ext but if the `key' already exists in the
- *    hash table the old key and the old context will be replaced with the
- *    `key' and the `context. The destructor function will be called for the
- *    replaced key and context.
- *
- *    The `hash' and `hash_user_context' are application specified hash
- *    function. If not provided the hash table's default is used.
- *
- ***/
-SilcBool silc_hash_table_replace_ext(SilcHashTable ht,
-                                    void *key, void *context,
-                                    SilcHashFunction hash,
-                                    void *hash_user_context);
-
-/****f* silcutil/SilcHashTableAPI/silc_hash_table_del_ext
- *
- * SYNOPSIS
- *
- *    SilcBool silc_hash_table_del_ext(SilcHashTable ht, void *key,
- *                                     SilcHashFunction hash,
- *                                     void *hash_user_context,
- *                                     SilcHashCompare compare,
- *                                     void *compare_user_context,
- *                                     SilcHashDestructor destructor,
- *                                     void *destructor_user_context);
- *
- * DESCRIPTION
- *
- *    Removes the entry from the hash table by the provided `key'. This will
- *    call the destructor funtion for the found entry. Return TRUE if the
- *    entry was removed successfully and FALSE otherwise.
- *
- *    The `hash' and `hash_user_context' are application specified hash
- *    function. If not provided the hash table's default is used.
- *    The `compare' and `compare_user_context' are application specified
- *    comparing function. If not provided the hash table's default is used.
- *    The `destructor' and `destructor_user_context' are application
- *    specific destructor function.
- *
- ***/
-SilcBool silc_hash_table_del_ext(SilcHashTable ht, void *key,
-                                SilcHashFunction hash,
-                                void *hash_user_context,
-                                SilcHashCompare compare,
-                                void *compare_user_context,
-                                SilcHashDestructor destructor,
-                                void *destructor_user_context);
-
-/****f* silcutil/SilcHashTableAPI/silc_hash_table_del_by_context_ext
- *
- * SYNOPSIS
- *
- *    SilcBool
- *    silc_hash_table_del_by_context_ext(SilcHashTable ht, void *key,
- *                                       void *context,
- *                                       SilcHashFunction hash,
- *                                       void *hash_user_context,
- *                                       SilcHashCompare compare,
- *                                       void *compare_user_context,
- *                                       SilcHashDestructor destructor,
- *                                       void *destructor_user_context);
- *
- * DESCRIPTION
- *
- *    Same as silc_hash_table_del but verifies that the context associated
- *    with the `key' matches the `context'. This is handy to use with hash
- *    tables that may have duplicate keys. In that case the `context' may
- *    be used to check whether the correct entry is being deleted.
- *
- *    The `hash' and `hash_user_context' are application specified hash
- *    function. If not provided the hash table's default is used.
- *    The `compare' and `compare_user_context' are application specified
- *    comparing function. If not provided the hash table's default is used.
- *    The `destructor' and `destructor_user_context' are application
- *    specific destructor function.
- *
- ***/
-SilcBool silc_hash_table_del_by_context_ext(SilcHashTable ht, void *key,
-                                           void *context,
-                                           SilcHashFunction hash,
-                                           void *hash_user_context,
-                                           SilcHashCompare compare,
-                                           void *compare_user_context,
-                                           SilcHashDestructor destructor,
-                                           void *destructor_user_context);
-
-/****f* silcutil/SilcHashTableAPI/silc_hash_table_find_ext
- *
- * SYNOPSIS
- *
- *    SilcBool silc_hash_table_find_ext(SilcHashTable ht, void *key,
- *                                      void **ret_key, void **ret_context,
- *                                      SilcHashFunction hash,
- *                                      void *hash_user_context,
- *                                      SilcHashCompare compare,
- *                                      void *compare_user_context);
- *
- * DESCRIPTION
- *
- *    Finds the entry in the hash table by the provided `key' as fast as
- *    possible. Return TRUE if the entry was found and FALSE otherwise.
- *    The found entry is returned to the `ret_key' and `ret_context',
- *    respectively. If the `ret_key and `ret_context' are NULL then this
- *    maybe used only to check whether given key exists in the table.
- *
- *    The `hash' and `hash_user_context' are application specified hash
- *    function. If not provided the hash table's default is used.
- *    The `compare' and `compare_user_context' are application specified
- *    comparing function. If not provided the hash table's default is used.
- *
- ***/
-SilcBool silc_hash_table_find_ext(SilcHashTable ht, void *key,
-                                 void **ret_key, void **ret_context,
-                                 SilcHashFunction hash,
-                                 void *hash_user_context,
-                                 SilcHashCompare compare,
-                                 void *compare_user_context);
-
-/****f* silcutil/SilcHashTableAPI/silc_hash_table_find_by_context_ext
- *
- * SYNOPSIS
- *
- *    SilcBool
- *    silc_hash_table_find_by_context_ext(SilcHashTable ht, void *key,
- *                                        void *context, void **ret_key,
- *                                        SilcHashFunction hash,
- *                                        void *hash_user_context,
- *                                        SilcHashCompare compare,
- *                                        void *compare_user_context);
- *
- * DESCRIPTION
- *
- *    Finds the entry in the hash table by the provided `key' and
- *    `context' as fast as possible.  This is handy function when there
- *    can be multiple same keys in the hash table.  By using this function
- *    the specific key with specific context can be found.  Return
- *    TRUE if the entry with the key and context was found and FALSE
- *    otherwise.  The function returns only the key to `ret_key' since
- *    the caller already knows the context.
- *
- *    The `hash' and `hash_user_context' are application specified hash
- *    function. If not provided the hash table's default is used.
- *    The `compare' and `compare_user_context' are application specified
- *    comparing function. If not provided the hash table's default is used.
- *
- ***/
-SilcBool silc_hash_table_find_by_context_ext(SilcHashTable ht, void *key,
-                                            void *context, void **ret_key,
-                                            SilcHashFunction hash,
-                                            void *hash_user_context,
-                                            SilcHashCompare compare,
-                                            void *compare_user_context);
-
-/****f* silcutil/SilcHashTableAPI/silc_hash_table_find_foreach_ext
- *
- * SYNOPSIS
- *
- *    void silc_hash_table_find_foreach_ext(SilcHashTable ht, void *key,
- *                                          SilcHashFunction hash,
- *                                          void *hash_user_context,
- *                                          SilcHashCompare compare,
- *                                          void *compare_user_context,
- *                                          SilcHashForeach foreach,
- *                                          void *foreach_user_context);
- *
- * DESCRIPTION
- *
- *    As the hash table is collision resistant it is possible to save duplicate
- *    keys to the hash table. This function can be used to find all keys
- *    and contexts from the hash table that are found using the `key'. The
- *    `foreach' is called for every found key. If no entries can be found
- *    the `foreach' will be called once with the context set NULL and
- *    `key' and `user_context' sent to the function.
- *
- *    The `hash' and `hash_user_context' are application specified hash
- *    function. If not provided the hash table's default is used.
- *    The `compare' and `compare_user_context' are application specified
- *    comparing function. If not provided the hash table's default is used.
- *
- * NOTES
- *
- *    The hash table will not be rehashed during the traversing of the table,
- *    even if the table was marked as auto rehashable.  The caller also must
- *    not call silc_hash_table_rehash while traversing the table.
- *
- ***/
-void silc_hash_table_find_foreach_ext(SilcHashTable ht, void *key,
-                                     SilcHashFunction hash,
-                                     void *hash_user_context,
-                                     SilcHashCompare compare,
-                                     void *compare_user_context,
-                                     SilcHashForeach foreach,
-                                     void *foreach_user_context);
-
-/****f* silcutil/SilcHashTableAPI/silc_hash_table_rehash_ext
- *
- * SYNOPSIS
- *
- *    void silc_hash_table_rehash_ext(SilcHashTable ht, SilcUInt32 new_size,
- *                                    SilcHashFunction hash,
- *                                    void *hash_user_context);
- *
- * DESCRIPTION
- *
- *    Rehashs the hash table. The size of the new hash table is provided
- *    as `new_size'. If the `new_size' is zero then this routine will make
- *    the new table of a suitable size. Note that this operation may be
- *    very slow.
- *
- *    The `hash' and `hash_user_context' are application specified hash
- *    function. If not provided the hash table's default is used.
- *
- ***/
-void silc_hash_table_rehash_ext(SilcHashTable ht, SilcUInt32 new_size,
-                               SilcHashFunction hash,
-                               void *hash_user_context);
-
-#endif
diff --git a/lib/silcutil/silclist.h b/lib/silcutil/silclist.h
deleted file mode 100644 (file)
index 81ea363..0000000
+++ /dev/null
@@ -1,345 +0,0 @@
-/*
-
-  silclist.h
-
-  Author: Pekka Riikonen <priikone@silcnet.org>
-
-  Copyright (C) 2002 - 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.
-
-*/
-
-/****h* silcutil/SILC List Interface
- *
- * DESCRIPTION
- *
- * Implementation of the SilcList interface.  This interface provides
- * simple linked list.  This interface does not allocate any memory.
- *
- * SILC List is not thread-safe.  If the same list context must be used
- * in multithreaded environment concurrency control must be employed.
- *
- ***/
-
-#ifndef SILCLIST_H
-#define SILCLIST_H
-
-/****s* silcutil/SilcList/SilcList
- *
- * NAME
- *
- *    typedef struct { ... } SilcList;
- *
- * DESCRIPTION
- *
- *    This is the SilcList context, and is initialized by calling the
- *    function silc_list_init.
- *
- ***/
-typedef struct SilcListStruct {
-  void *head;                       /* Start of the list */
-  void *tail;                       /* End of the list */
-  void *current;                    /* Current pointer in list */
-  SilcUInt16 next_offset;           /* Offset to 'next' pointer */
-  SilcUInt16 prev_offset;           /* Offset to 'prev' pointer */
-  unsigned int prev_set    : 1;             /* Set if 'prev' exists */
-  unsigned int end_set     : 1;             /* Set if silc_list_end was called */
-  unsigned int count       : 30;     /* Number of entries in the list */
-} SilcList;
-
-/****d* silcutil/SilcList/SILC_LIST_END
- *
- * NAME
- *
- *    #define SILC_LIST_END ...
- *
- * DESCRIPTION
- *
- *    Functions return this when the list is invalid or when traversing
- *    the list there is no more entires in the list.
- *
- * SOURCE
- */
-#define SILC_LIST_END NULL
-/***/
-
-/****f* silcutil/SilcList/silc_list_init
- *
- * SYNOPSIS
- *
- *    #define silc_list_init(list, type, nextfield) ...
- *
- * DESCRIPTION
- *
- *    This macro initializes the SilcList list.  The `list' is the defined
- *    list, second argument is the structure of the entries in the list,
- *    and last argument is the pointer in the structure that is used
- *    as next list members.  When using SilcList you must not touch the
- *    structure member pointers manually.  If your list has also a prev
- *    pointer should use silc_list_init_prev instead of this call if
- *    you need to be able traverse the list backwards as well.
- *
- * EXAMPLE
- *
- *    struct SilcInternalEntryStruct {
- *      char *dummy;
- *      struct SilcInternalEntryStruct *next; // The list member pointer
- *    };
- *
- *    SilcList list;
- *    silc_list_init(list, struct SilcInternalEntryStruct, next);
- *
- ***/
-#define silc_list_init(list, type, nextfield)          \
-do {                                                   \
-  (list).count = 0;                                    \
-  (list).next_offset = silc_offsetof(type, nextfield); \
-  (list).prev_set = 0;                                 \
-  (list).prev_offset = 0;                              \
-  (list).end_set = 0;                                  \
-  (list).head = (list).tail = (list).current = NULL;   \
-} while(0)
-
-/****f* silcutil/SilcList/silc_list_init_prev
- *
- * SYNOPSIS
- *
- *    #define silc_list_init_prev(list, type, nextfield, prevfield) ...
- *
- * DESCRIPTION
- *
- *    This macro initializes the SilcList list.  The `list' is the defined
- *    list, second argument is the structure of the entries in the list,
- *    and last two arguments are the pointers in the structure that is used
- *    as next and prev list members.  When using SilcList you must not
- *    touch the structure member pointers manually.
- *
- *    Having both next and prev pointers makes it possible to traverse
- *    list from both ends of the list (from start to end, and from end
- *    to start).
- *
- * EXAMPLE
- *
- *    struct SilcInternalEntryStruct {
- *      char *dummy;
- *      struct SilcInternalEntryStruct *next; // The list member pointer
- *      struct SilcInternalEntryStruct *prev; // The list member pointer
- *    };
- *
- *    SilcList list;
- *    silc_list_init_prev(list, struct SilcInternalEntryStruct, next, prev);
- *
- ***/
-#define silc_list_init_prev(list, type, nextfield, prevfield)  \
-do {                                                           \
-  (list).count = 0;                                            \
-  (list).next_offset = silc_offsetof(type, nextfield);         \
-  (list).prev_offset = silc_offsetof(type, prevfield);         \
-  (list).prev_set = 1;                                         \
-  (list).end_set = 0;                                          \
-  (list).head = (list).tail = (list).current = NULL;           \
-} while(0)
-
-/****f* silcutil/SilcList/silc_list_count
- *
- * SYNOPSIS
- *
- *    #define silc_list_count(list) ...
- *
- * DESCRIPTION
- *
- *    Returns the number of entries in the list indicated by `list'.
- *
- ***/
-#define silc_list_count(list) (list).count
-
-/****f* silcutil/SilcList/silc_list_start
- *
- * SYNOPSIS
- *
- *    #define silc_list_start(list) ...
- *
- * DESCRIPTION
- *
- *    Sets the start of the list.  This prepares the list for traversing
- *    the entries from the start of the list towards end of the list.
- *
- ***/
-#define silc_list_start(list)                          \
-  ((list).current = (list).head, (list).end_set = 0)
-
-/****f* silcutil/SilcList/silc_list_end
- *
- * SYNOPSIS
- *
- *    #define silc_list_end(list) ...
- *
- * DESCRIPTION
- *
- *    Sets the end of the list.  This prepares the list for traversing
- *    the entries from the end of the list towards start of the list.
- *
- * NOTES
- *
- *    You can use this call only if you initialized the list with
- *    silc_list_init_prev.
- *
- ***/
-#define silc_list_end(list)                            \
-  ((list).current = (list).tail, (list).end_set = 1)
-
-/* Macros to get position to next and prev list pointers */
-#define __silc_list_next(list, pos)                            \
-  ((void **)((unsigned char *)(pos) + (list).next_offset))
-#define __silc_list_prev(list, pos)                            \
-  ((void **)((unsigned char *)(pos) + (list).prev_offset))
-
-/****f* silcutil/SilcList/silc_list_add
- *
- * SYNOPSIS
- *
- *    #define silc_list_add(list, entry) ...
- *
- * DESCRIPTION
- *
- *    Adds new entry indicated by `entry' to the end of the list indicated
- *    by `list'.
- *
- ***/
-#define silc_list_add(list, entry)                     \
-do {                                                   \
-  if (!(list).head)                                    \
-    (list).head = (entry);                             \
-  else                                                 \
-    *__silc_list_next(list, (list).tail) = (entry);    \
-  if ((list).prev_set)                                 \
-    *__silc_list_prev(list, entry) = (list).tail;      \
-  (list).tail = (entry);                               \
-  *__silc_list_next(list, entry) = NULL;               \
-  (list).count++;                                      \
-} while(0)
-
-/****f* silcutil/SilcList/silc_list_insert
- *
- * SYNOPSIS
- *
- *    #define silc_list_insert(list, current, entry) ...
- *
- * DESCRIPTION
- *
- *    Insert new entry indicated by `entry' after the entry `current'
- *    to the list indicated by `list'.  If `current' is NULL, then the
- *    `entry' is added at the head of the list.  Use the silc_list_add
- *    to add at the end of the list.
- *
- ***/
-#define silc_list_insert(list, current, entry)                          \
-do {                                                                    \
-  if (!(current)) {                                                     \
-    if ((list).head)                                                    \
-      *__silc_list_next(list, entry) = (list).head;                     \
-    else                                                                \
-      *__silc_list_next(list, entry) = NULL;                            \
-    if ((list).prev_set && (list).head)                                         \
-      *__silc_list_prev(list, (list).head) = entry;                     \
-    if (!(list).tail)                                                   \
-      (list).tail = (entry);                                            \
-    (list).head = (entry);                                              \
-    if ((list).prev_set)                                                \
-      *__silc_list_prev(list, entry) = NULL;                            \
-  } else {                                                              \
-    *__silc_list_next(list, entry) = *__silc_list_next(list, current);  \
-    *__silc_list_next(list, current) = entry;                           \
-    if ((list).prev_set) {                                              \
-      *__silc_list_prev(list, entry) = current;                                 \
-      if (*__silc_list_next(list, entry))                               \
-        *__silc_list_prev(list, *__silc_list_next(list, entry)) = entry; \
-    }                                                                   \
-    if ((list).tail == (current))                                       \
-      (list).tail = (entry);                                            \
-  }                                                                     \
-  (list).count++;                                                       \
-} while(0)
-
-/****f* silcutil/SilcList/silc_list_del
- *
- * SYNOPSIS
- *
- *    #define silc_list_del(list, entry) ...
- *
- * DESCRIPTION
- *
- *    Remove entry indicated by `entry' from the list indicated by `list'.
- *
- ***/
-#define silc_list_del(list, entry)                                     \
-do {                                                                   \
-  void **p, *prev;                                                     \
-  prev = NULL;                                                         \
-  for (p = &(list).head; *p; p = __silc_list_next(list, *p)) {         \
-    if (*p == (entry)) {                                               \
-      *p = *__silc_list_next(list, entry);                             \
-      if (*p && (list).prev_set)                                       \
-        *__silc_list_prev(list, *p) = *__silc_list_prev(list, entry);  \
-      if ((list).current == (entry))                                   \
-        (list).current = *p;                                           \
-      (list).count--;                                                  \
-      break;                                                           \
-    }                                                                  \
-    prev = *p;                                                         \
-  }                                                                    \
-  if (entry == (list).tail)                                            \
-    (list).tail = prev;                                                        \
-} while(0)
-
-/****f* silcutil/SilcList/silc_list_get
- *
- * SYNOPSIS
- *
- *    #define silc_list_get(list) ...
- *
- * DESCRIPTION
- *
- *    Returns the current entry from the list indicated by `list' and
- *    moves the list pointer forward so that calling this next time will
- *    return the next entry from the list.  This can be used to traverse
- *    the list.  Returns SILC_LIST_END when the entire list has been
- *    tarversed and no additional entries exist in the list. Later,
- *    silc_list_start (or silc_list_end) must be called again when
- *    re-starting the list tarversing.
- *
- * EXAMPLE
- *
- *    // Traverse the list from the beginning to the end
- *    silc_list_start(list);
- *    while ((entry = silc_list_get(list)) != SILC_LIST_END) {
- *      ...
- *    }
- *
- *    // Traverse the list from the end to the beginning
- *    silc_list_end(list);
- *    while ((entry = silc_list_get(list)) != SILC_LIST_END) {
- *      ...
- *    }
- *
- ***/
-#define silc_list_get(x) __silc_list_get(&(x))
-static inline
-void *__silc_list_get(SilcList *list)
-{
-  void *pos = list->current;
-  if (pos)
-    list->current = (list->end_set ? *__silc_list_prev(*list, pos) :
-                    *__silc_list_next(*list, pos));
-  return pos;
-}
-
-#endif
diff --git a/lib/silcutil/silclog.c b/lib/silcutil/silclog.c
deleted file mode 100644 (file)
index 824efb7..0000000
+++ /dev/null
@@ -1,610 +0,0 @@
-/*
-
-  silclog.c
-
-  Author: Pekka Riikonen <priikone@silcnet.org>
-
-  Copyright (C) 1997 - 2007 Pekka Riikonen
-
-  This program is free software; you can redistribute it and/or modify
-  it under the terms of the GNU General Public License as published by
-  the Free Software Foundation; version 2 of the License.
-
-  This program is distributed in the hope that it will be useful,
-  but WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-  GNU General Public License for more details.
-
-*/
-/* $Id$ */
-
-#include "silc.h"
-
-/* SilcLogSettings context */
-typedef struct {
-  SilcUInt32 flushdelay;
-
-  char debug_string[128];
-  SilcLogDebugCb debug_cb;
-  void *debug_context;
-  SilcLogHexdumpCb hexdump_cb;
-  void *hexdump_context;
-
-  unsigned int timestamp       : 1;
-  unsigned int quick           : 1;
-  unsigned int debug           : 1;
-  unsigned int debug_hexdump   : 1;
-  unsigned int scheduled       : 1;
-  unsigned int no_init         : 1;
-  unsigned int starting        : 1;
-} *SilcLogSettings, SilcLogSettingsStruct;
-
-/* SilcLog context */
-typedef struct {
-  char filename[256];
-  FILE *fp;
-  SilcUInt64 maxsize;
-  const char *typename;
-  SilcLogType type;
-  SilcLogCb cb;
-  void *context;
-} *SilcLog, SilcLogStruct;
-
-#ifndef SILC_SYMBIAN
-
-/* Default settings */
-static SilcLogSettingsStruct silclog =
-{
-  300,
-  { 0 },
-  NULL, NULL,
-  NULL, NULL,
-  TRUE,
-  FALSE,
-  FALSE,
-  FALSE,
-  FALSE,
-  FALSE,
-  TRUE,
-};
-
-#endif /* !SILC_SYMBIAN */
-
-/* Default log contexts */
-#ifndef SILC_SYMBIAN
-static SilcLogStruct silclogs[4] =
-#else
-const SilcLogStruct silclogs[4] =
-#endif /* !SILC_SYMBIAN */
-{
-  {"", NULL, 0, "Info", SILC_LOG_INFO, NULL, NULL},
-  {"", NULL, 0, "Warning", SILC_LOG_WARNING, NULL, NULL},
-  {"", NULL, 0, "Error", SILC_LOG_ERROR, NULL, NULL},
-  {"", NULL, 0, "Fatal", SILC_LOG_FATAL, NULL, NULL},
-};
-
-/* Return log context by type */
-
-static SilcLog silc_log_get_context(SilcLogType type)
-{
-  if (type < 1 || type > 4)
-    return NULL;
-  return (SilcLog)&silclogs[(int)type - 1];
-}
-
-/* Check log file site and cycle log file if it is over max size. */
-
-static void silc_log_checksize(SilcLog log)
-{
-  char newname[256];
-  SilcUInt64 size;
-
-  if (!log || !log->fp || !log->maxsize)
-    return;
-
-  size = silc_file_size(log->filename);
-  if (!size) {
-    fclose(log->fp);
-    log->fp = NULL;
-  }
-
-  if (size < log->maxsize)
-    return;
-
-  /* Cycle log file */
-  fprintf(log->fp,
-         "[%s] [%s] Cycling log file, over max log size (%lu kilobytes)\n",
-         silc_time_string(0), log->typename,
-         (unsigned long)log->maxsize / 1024);
-  fflush(log->fp);
-  fclose(log->fp);
-
-  memset(newname, 0, sizeof(newname));
-  silc_snprintf(newname, sizeof(newname) - 1, "%s.old", log->filename);
-  unlink(newname);
-  rename(log->filename, newname);
-
-  log->fp = fopen(log->filename, "w");
-  if (!log->fp)
-    SILC_LOG_WARNING(("Couldn't reopen log file '%s' for type '%s': %s",
-                     log->filename, log->typename, strerror(errno)));
-#ifdef HAVE_CHMOD
-  chmod(log->filename, 0600);
-#endif /* HAVE_CHMOD */
-}
-
-/* Internal timeout callback to flush log channels and check file sizes */
-
-SILC_TASK_CALLBACK(silc_log_fflush_callback)
-{
-#ifndef SILC_SYMBIAN
-  SilcLog log;
-
-  if (!silclog.quick) {
-    silc_log_flush_all();
-    log = silc_log_get_context(SILC_LOG_INFO);
-    silc_log_checksize(log);
-    log = silc_log_get_context(SILC_LOG_WARNING);
-    silc_log_checksize(log);
-    log = silc_log_get_context(SILC_LOG_ERROR);
-    silc_log_checksize(log);
-    log = silc_log_get_context(SILC_LOG_FATAL);
-    silc_log_checksize(log);
-  }
-
-  silclog.starting = FALSE;
-
-  if (silclog.flushdelay < 2)
-    silclog.flushdelay = 2;
-  silc_schedule_task_add_timeout(context, silc_log_fflush_callback, context,
-                                silclog.flushdelay, 0);
-#endif /* !SILC_SYMBIAN */
-}
-
-/* Output log message to log file */
-
-void silc_log_output(SilcLogType type, char *string)
-{
-  const char *typename = NULL;
-  SilcLog log = silc_log_get_context(type);
-  FILE *fp;
-
-  if (!log)
-    goto end;
-
-  /* Forward to callback if set */
-  if (log->cb)
-    if ((*log->cb)(type, string, log->context))
-      goto end;
-
-  typename = log->typename;
-
-#ifndef SILC_SYMBIAN
-  if (!silclog.scheduled) {
-    if (silclog.no_init == FALSE) {
-      fprintf(stderr,
-             "Warning, trying to output without log files initialization, "
-             "log output is going to stderr\n");
-      silclog.no_init = TRUE;
-    }
-
-    fp = stderr;
-    log = NULL;
-    goto found;
-  }
-#endif /* !SILC_SYMBIAN */
-
-  /* Find open log file */
-  while (log) {
-    if (log->fp) {
-      fp = log->fp;
-      break;
-    }
-
-    log = silc_log_get_context(--type);
-  }
-  if (!log || !log->fp)
-    goto end;
-
-#ifndef SILC_SYMBIAN
- found:
-  if (silclog.timestamp)
-    fprintf(fp, "[%s] [%s] %s\n", silc_time_string(0), typename, string);
-  else
-    fprintf(fp, "[%s] %s\n", typename, string);
-
-  if (silclog.quick || silclog.starting) {
-    fflush(fp);
-    if (log)
-      silc_log_checksize(log);
-  }
-#endif /* !SILC_SYMBIAN */
-
- end:
-#ifndef SILC_SYMBIAN
-  /* Output log to stderr if debugging */
-  if (typename && silclog.debug) {
-    fprintf(stderr, "[Logging] [%s] %s\n", typename, string);
-    fflush(stderr);
-  }
-#else
-  fprintf(stderr, "[Logging] [%s] %s\n", typename, string);
-#endif /* !SILC_SYMBIAN */
-
-  silc_free(string);
-}
-
-/* Set and initialize the specified log file. */
-
-SilcBool silc_log_set_file(SilcLogType type, char *filename,
-                          SilcUInt32 maxsize, SilcSchedule scheduler)
-{
-#ifndef SILC_SYMBIAN
-  FILE *fp = NULL;
-  SilcLog log;
-
-  log = silc_log_get_context(type);
-  if (!log)
-    return FALSE;
-
-  SILC_LOG_DEBUG(("Setting '%s' file to %s (max size=%d)",
-                 log->typename, filename, maxsize));
-
-  /* Open log file */
-  if (filename) {
-    fp = fopen(filename, "a+");
-    if (!fp) {
-      fprintf(stderr, "warning: couldn't open log file '%s': %s\n",
-             filename, strerror(errno));
-      return FALSE;
-    }
-#ifdef HAVE_CHMOD
-    chmod(filename, 0600);
-#endif /* HAVE_CHMOD */
-  }
-
-  /* Close previous log file if it exists */
-  if (strlen(log->filename)) {
-    if (log->fp)
-      fclose(log->fp);
-    memset(log->filename, 0, sizeof(log->filename));
-    log->fp = NULL;
-  }
-
-  /* Set new log file */
-  if (fp) {
-    log->fp = fp;
-    log->maxsize = maxsize;
-
-    memset(log->filename, 0, sizeof(log->filename));
-    silc_strncat(log->filename, sizeof(log->filename), filename,
-                strlen(filename));
-  }
-
-  /* Add flush timeout */
-  if (scheduler) {
-    silc_schedule_task_del_by_callback(scheduler, silc_log_fflush_callback);
-    silc_schedule_task_add_timeout(scheduler, silc_log_fflush_callback,
-                                  scheduler, 10, 0);
-    silclog.scheduled = TRUE;
-  }
-
-#endif /* !SILC_SYMBIAN */
-  return TRUE;
-}
-
-/* Return log filename */
-
-char *silc_log_get_file(SilcLogType type)
-{
-  SilcLog log = silc_log_get_context(type);
-  return log && log->fp ? log->filename : NULL;
-}
-
-/* Sets a log callback, set callback to NULL to return to default behaviour */
-
-void silc_log_set_callback(SilcLogType type, SilcLogCb cb, void *context)
-{
-#ifndef SILC_SYMBIAN
-  SilcLog log = silc_log_get_context(type);
-  if (log) {
-    log->cb = cb;
-    log->context = context;
-  }
-#endif /* !SILC_SYMBIAN */
-}
-
-/* Reset log callbacks */
-
-void silc_log_reset_callbacks(void)
-{
-#ifndef SILC_SYMBIAN
-  SilcLog log;
-  log = silc_log_get_context(SILC_LOG_INFO);
-  log->cb = log->context = NULL;
-  log = silc_log_get_context(SILC_LOG_WARNING);
-  log->cb = log->context = NULL;
-  log = silc_log_get_context(SILC_LOG_ERROR);
-  log->cb = log->context = NULL;
-  log = silc_log_get_context(SILC_LOG_FATAL);
-  log->cb = log->context = NULL;
-#endif /* !SILC_SYMBIAN */
-}
-
-/* Flush all log files */
-
-void silc_log_flush_all(void)
-{
-  SilcLog log;
-  log = silc_log_get_context(SILC_LOG_INFO);
-  if (log->fp)
-    fflush(log->fp);
-  log = silc_log_get_context(SILC_LOG_WARNING);
-  if (log->fp)
-    fflush(log->fp);
-  log = silc_log_get_context(SILC_LOG_ERROR);
-  if (log->fp)
-    fflush(log->fp);
-  log = silc_log_get_context(SILC_LOG_FATAL);
-  if (log->fp)
-    fflush(log->fp);
-}
-
-/* Reset a log file */
-
-static void silc_log_reset(SilcLog log)
-{
-  if (log->fp) {
-    fflush(log->fp);
-    fclose(log->fp);
-  }
-
-  if (!strlen(log->filename))
-    return;
-
-  log->fp = fopen(log->filename, "a+");
-  if (!log->fp)
-    SILC_LOG_WARNING(("Couldn't reset log file '%s' for type '%s': %s",
-                     log->filename, log->typename, strerror(errno)));
-}
-
-/* Reset all log files */
-
-void silc_log_reset_all(void)
-{
-  SilcLog log;
-  log = silc_log_get_context(SILC_LOG_INFO);
-  if (log->fp)
-    silc_log_reset(log);
-  log = silc_log_get_context(SILC_LOG_WARNING);
-  if (log->fp)
-    silc_log_reset(log);
-  log = silc_log_get_context(SILC_LOG_ERROR);
-  if (log->fp)
-    silc_log_reset(log);
-  log = silc_log_get_context(SILC_LOG_FATAL);
-  if (log->fp)
-    silc_log_reset(log);
-  silc_log_flush_all();
-}
-
-/* Sets debug callbacks */
-
-void silc_log_set_debug_callbacks(SilcLogDebugCb debug_cb,
-                                 void *debug_context,
-                                 SilcLogHexdumpCb hexdump_cb,
-                                 void *hexdump_context)
-{
-#ifndef SILC_SYMBIAN
-  silclog.debug_cb = debug_cb;
-  silclog.debug_context = debug_context;
-  silclog.hexdump_cb = hexdump_cb;
-  silclog.hexdump_context = hexdump_context;
-#endif /* !SILC_SYMBIAN */
-}
-
-/* Resets debug callbacks */
-
-void silc_log_reset_debug_callbacks()
-{
-#ifndef SILC_SYMBIAN
-  silclog.debug_cb = NULL;
-  silclog.debug_context = NULL;
-  silclog.hexdump_cb = NULL;
-  silclog.hexdump_context = NULL;
-#endif /* !SILC_SYMBIAN */
-}
-
-/* Set current debug string */
-
-void silc_log_set_debug_string(const char *debug_string)
-{
-#ifndef SILC_SYMBIAN
-  char *string;
-  int len;
-  if ((strchr(debug_string, '(') && strchr(debug_string, ')')) ||
-      strchr(debug_string, '$'))
-    string = strdup(debug_string);
-  else
-    string = silc_string_regexify(debug_string);
-  len = strlen(string);
-  if (len >= sizeof(silclog.debug_string))
-    len = sizeof(silclog.debug_string) - 1;
-  memset(silclog.debug_string, 0, sizeof(silclog.debug_string));
-  strncpy(silclog.debug_string, string, len);
-  silc_free(string);
-#endif /* !SILC_SYMBIAN */
-}
-
-/* Set timestamp */
-
-void silc_log_timestamp(SilcBool enable)
-{
-#ifndef SILC_SYMBIAN
-  silclog.timestamp = enable;
-#endif /* !SILC_SYMBIAN */
-}
-
-/* Set flushdelay */
-
-void silc_log_flushdelay(SilcUInt32 flushdelay)
-{
-#ifndef SILC_SYMBIAN
-  silclog.flushdelay = flushdelay;
-#endif /* !SILC_SYMBIAN */
-}
-
-/* Set quick logging */
-
-void silc_log_quick(SilcBool enable)
-{
-#ifndef SILC_SYMBIAN
-  silclog.quick = enable;
-#endif /* !SILC_SYMBIAN */
-}
-
-/* Set debugging */
-
-void silc_log_debug(SilcBool enable)
-{
-#ifndef SILC_SYMBIAN
-  silclog.debug = enable;
-#endif /* !SILC_SYMBIAN */
-}
-
-/* Set debug hexdump */
-
-void silc_log_debug_hexdump(SilcBool enable)
-{
-#ifndef SILC_SYMBIAN
-  silclog.debug_hexdump = enable;
-#endif /* !SILC_SYMBIAN */
-}
-
-/* Outputs the debug message to stderr. */
-
-void silc_log_output_debug(char *file, const char *function,
-                          int line, char *string)
-{
-  SilcTimeStruct curtime;
-
-#ifndef SILC_SYMBIAN
-  if (!silclog.debug)
-    goto end;
-
-  if (!silc_string_regex_match(silclog.debug_string, file) &&
-      !silc_string_regex_match(silclog.debug_string, function))
-    goto end;
-
-  if (silclog.debug_cb) {
-    if ((*silclog.debug_cb)(file, (char *)function, line, string,
-                           silclog.debug_context))
-      goto end;
-  }
-#endif /* !SILC_SYMBIAN */
-
-  silc_time_value(0, &curtime);
-
-#ifdef SILC_WIN32
-  if (strrchr(function, '\\'))
-    fprintf(stderr, "%s:%d: %s\n", strrchr(function, '\\') + 1, line, string);
-  else
-#endif /* SILC_WIN32 */
-#ifdef SILC_SYMBIAN
-  silc_symbian_debug(function, line, string);
-#else
-  fprintf(stderr, "%02d:%02d:%02d %s:%d: %s\n", curtime.hour,
-         curtime.minute, curtime.second, function, line,
-         string);
-  fflush(stderr);
-#endif /* SILC_SYMBIAN */
-
- end:
-  silc_free(string);
-}
-
-/* Hexdumps a message */
-
-void silc_log_output_hexdump(char *file, const char *function,
-                            int line, void *data_in,
-                            SilcUInt32 len, char *string)
-{
-  int i, k;
-  int off, pos, count;
-  unsigned char *data = (unsigned char *)data_in;
-
-#ifndef SILC_SYMBIAN
-  if (!silclog.debug_hexdump)
-    goto end;
-
-  if (!silc_string_regex_match(silclog.debug_string, file) &&
-      !silc_string_regex_match(silclog.debug_string, function))
-    goto end;
-
-  if (silclog.hexdump_cb) {
-    if ((*silclog.hexdump_cb)(file, (char *)function, line,
-                             data_in, len, string, silclog.hexdump_context))
-      goto end;
-  }
-#endif /* !SILC_SYMBIAN */
-
-  fprintf(stderr, "%s:%d: %s\n", function, line, string);
-
-  k = 0;
-  pos = 0;
-  count = 16;
-  off = len % 16;
-  while (1) {
-    if (off) {
-      if ((len - pos) < 16 && (len - pos <= len - off))
-       count = off;
-    } else {
-      if (pos == len)
-       count = 0;
-    }
-    if (off == len)
-      count = len;
-
-    if (count)
-      fprintf(stderr, "%08X  ", k++ * 16);
-
-    for (i = 0; i < count; i++) {
-      fprintf(stderr, "%02X ", data[pos + i]);
-
-      if ((i + 1) % 4 == 0)
-       fprintf(stderr, " ");
-    }
-
-    if (count && count < 16) {
-      int j;
-
-      for (j = 0; j < 16 - count; j++) {
-       fprintf(stderr, "   ");
-
-       if ((j + count + 1) % 4 == 0)
-         fprintf(stderr, " ");
-      }
-    }
-
-    for (i = 0; i < count; i++) {
-      char ch;
-
-      if (data[pos] < 32 || data[pos] >= 127)
-       ch = '.';
-      else
-       ch = data[pos];
-
-      fprintf(stderr, "%c", ch);
-      pos++;
-    }
-
-    if (count)
-      fprintf(stderr, "\n");
-
-    if (count < 16)
-      break;
-  }
-
- end:
-  silc_free(string);
-}
diff --git a/lib/silcutil/silclog.h b/lib/silcutil/silclog.h
deleted file mode 100644 (file)
index 4ae8ca9..0000000
+++ /dev/null
@@ -1,601 +0,0 @@
-/*
-
-  silclog.h
-
-  Author: Pekka Riikonen <priikone@silcnet.org>
-
-  Copyright (C) 1997 - 2006 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.
-
-*/
-
-/****h* silcutil/SILC Logging Interface
- *
- * DESCRIPTION
- *
- * The SILC logging APIs provide a powerful and easy-to-use interface to
- * the logging system and debugging output.
- *
- ***/
-
-#ifndef SILCLOG_H
-#define SILCLOG_H
-
-/****d* silcutil/SilcLogAPI/SilcLogType
- *
- * NAME
- *
- *    typedef enum { ... } SilcLogType;
- *
- * DESCRIPTION
- *
- *    The log type.  This can be given to various silc_log_* routines.
- *
- * SOURCE
- */
-typedef enum {
-  SILC_LOG_INFO       = 1,     /* Generic info */
-  SILC_LOG_WARNING    = 2,      /* Warnings and non-critical failures */
-  SILC_LOG_ERROR      = 3,      /* Generic error and critical failure */
-  SILC_LOG_FATAL      = 4,     /* Fatal error */
-} SilcLogType;
-/***/
-
-#include "silclog_i.h"
-
-/****f* silcutil/SilcLogAPI/SilcLogCb
- *
- * SYNOPSIS
- *
- *    typedef SilcBool (*SilcLogCb)(SilcLogType type, char *message,
- *                                  void *context);
- *
- * DESCRIPTION
- *
- *    The logging custom callback function.  The `type' is the channel ID
- *    that triggered the event, which allows you to use the same callback
- *    function for multiple logging channels.
- *
- *    The `message' parameter points to a null-terminated buffer containing
- *    the received message, while `context' is the caller-specified context.
- *    The message must not be modified or freed by the callback function.
- *    If the function returns TRUE, SilcLog will assume the message was
- *    handled and won't run its default handler.
- *
- * SEE ALSO
- *    silc_log_set_callback
- *
- ***/
-typedef SilcBool (*SilcLogCb)(SilcLogType type, char *message, void *context);
-
-/****f* silcutil/SilcLogAPI/SilcLogDebugCb
- *
- * SYNOPSIS
- *
- *    typedef SilcBool (*SilcLogDebugCb)(char *file, char *function, int line,
- *                                       char *message, void *context);
- *
- * DESCRIPTION
- *
- *    The debug logging callback function.  The default behaviour is to
- *    output messages to stderr.  `file', `function', and `line' are the
- *    corresponding offsets in the source files.  `message' points to a
- *    null-terminated buffer containing the debugging message, and `context'
- *    is the caller-specified context.
- *
- *    The message must not be modified or freed by the callback function.
- *    If the function returns TRUE, SilcLog will assume the message as handled
- *    and won't run its default handler.
- *
- * SEE ALSO
- *    silc_debug, silc_log_set_debug_callbacks
- *
- ***/
-typedef SilcBool (*SilcLogDebugCb)(char *file, char *function, int line,
-                                  char *message, void *context);
-
-/****f* silcutil/SilcLogAPI/SilcLogHexdumpCb
- *
- * SYNOPSIS
- *
- *    typedef SilcBool
- *    (*SilcDebugHexdumpCb)(char *file, char *function, int line,
- *                          unsigned char *data,
- *                          SilcUInt32 data_len,
- *                          char *message, void *context;
- *
- * DESCRIPTION
- *
- *    The hexdump logging callback function.  The default behaviour is to
- *    print a formatted hexdump to stderr, and is commonly what you would
- *    like it to be.  `file', `function', and `line' are the corresponding
- *    offsets in the source files.  `data' is the begin of the buffer that
- *    should be hexdumped, which is `data_len' bytes long.
- *
- *    The `message' parameter points to a null-terminated buffer containing
- *    the received message, while `context' is the caller-specified context.
- *    The message must not be modified or freed by the callback function.
- *    If the function returns TRUE, SilcLog will assume the message as handled
- *    and won't run its default handler.
- *
- * SEE ALSO
- *    silc_debug_hexdump, silc_log_set_debug_callbacks
- *
- ***/
-typedef SilcBool (*SilcLogHexdumpCb)(char *file, char *function, int line,
-                                    unsigned char *data, SilcUInt32 data_len,
-                                    char *message, void *context);
-
-/* Macros */
-
-/****d* silcutil/SilcLogAPI/SILC_LOG_INFO
- *
- * NAME
- *
- *    #define SILC_LOG_INFO(...)
- *
- * DESCRIPTION
- *
- *    This macro is a wrapper to the main logging function.
- *    It supports variable argument list formatting, and *automatically*
- *    appends newline at the end of the string.
- *
- * NOTES
- *
- *    This macro requires double parenthesis to ensure that the VA list
- *    formatting would work correctly.
- *
- * EXAMPLE
- *
- *    SILC_LOG_INFO(("Today i feel %s", core->mood));
- *
- * SOURCE
- */
-#define SILC_LOG_INFO(fmt) silc_log_output(SILC_LOG_INFO, silc_format fmt)
-/***/
-
-/****d* silcutil/SilcLogAPI/SILC_LOG_WARNING
- *
- * NAME
- *
- *    #define SILC_LOG_WARNING(...)
- *
- * DESCRIPTION
- *
- *    Wrapper to the WARNING logging channel.
- *    Please see the SILC_LOG_INFO macro.
- *
- * SEE ALSO
- *    SILC_LOG_INFO
- *
- * SOURCE
- */
-#define SILC_LOG_WARNING(fmt) silc_log_output(SILC_LOG_WARNING, silc_format fmt)
-/***/
-
-/****d* silcutil/SilcLogAPI/SILC_LOG_ERROR
- *
- * NAME
- *
- *    #define SILC_LOG_ERROR(...)
- *
- * DESCRIPTION
- *
- *    Wrapper to the ERROR logging channel.
- *    Please see the SILC_LOG_INFO macro.
- *
- * SEE ALSO
- *    SILC_LOG_INFO
- *
- * SOURCE
- */
-#define SILC_LOG_ERROR(fmt) silc_log_output(SILC_LOG_ERROR, silc_format fmt)
-/***/
-
-/****d* silcutil/SilcLogAPI/SILC_LOG_FATAL
- *
- * NAME
- *
- *    #define SILC_LOG_FATAL(...)
- *
- * DESCRIPTION
- *
- *    Wrapper to the FATAL logging channel.
- *    Please see the SILC_LOG_INFO macro.
- *
- * SEE ALSO
- *    SILC_LOG_INFO
- *
- * SOURCE
- */
-#define SILC_LOG_FATAL(fmt) silc_log_output(SILC_LOG_FATAL, silc_format fmt)
-/***/
-
-/****d* silcutil/SilcLogAPI/SILC_LOG_DEBUG
- *
- * NAME
- *
- *    #define SILC_LOG_DEBUG(...)
- *
- * DESCRIPTION
- *
- *    This is a special wrapper to the debugging output (usually stderr).
- *    The standard behaviour is the same as SILC_LOG_INFO, with the difference
- *    that this macro also depends on the global define SILC_DEBUG.
- *
- *    Undefining SILC_DEBUG causes these functions to be defined to an empty
- *    value, thus removing all debug logging calls from the compiled
- *    application.
- *
- * SOURCE
- */
-#if defined(SILC_DEBUG)
-#define SILC_LOG_DEBUG(fmt) silc_log_output_debug(__FILE__,    \
-                               __FUNCTION__,                   \
-                               __LINE__,                       \
-                               silc_format fmt)
-#define SILC_NOT_IMPLEMENTED(string)                                   \
-  SILC_LOG_INFO(("*********** %s: NOT IMPLEMENTED YET", string));
-#else
-#define SILC_LOG_DEBUG(fmt) do { } while(0)
-#define SILC_NOT_IMPLEMENTED(string) do { } while(0)
-#endif /* SILC_DEBUG */
-/***/
-
-/****d* silcutil/SilcLogAPI/SILC_LOG_HEXDUMP
- *
- * NAME
- *
- *    #define SILC_LOG_HEXDUMP(...)
- *
- * DESCRIPTION
- *
- *    This is a special wrapper to the hexdump output function.  This macro
- *    behaves slightly differently from other logging wrappers.
- *    The first parameter, is composed by a group of parameters delimited by
- *    parenthesis.
- *    The second parameter is a `char *' pointer pointing to the beginning
- *    of the memory section that should be hexdumped, and the third parameter
- *    is the length of this memory section.
- *    Undefining the global SILC_DEBUG define causes these functions to be
- *    defined to an empty value, thus removing all debug logging calls from
- *    the compiled application.
- *    This macro is also affected by the global variable silc_debug_hexdump.
- *
- * EXAMPLE
- *
- *    SILC_LOG_HEXDUMP(("Outgoing packet [%d], len %d", pckt->seq, pckt->len),
- *                     pckt->data, pckt->datalen);
- *
- * SOURCE
- */
-#if defined(SILC_DEBUG)
-#define SILC_LOG_HEXDUMP(fmt, data, len) silc_log_output_hexdump(__FILE__, \
-                               __FUNCTION__,                              \
-                               __LINE__,                                  \
-                               (void *)(data), (len),                     \
-                               silc_format fmt)
-#else
-#define SILC_LOG_HEXDUMP(fmt, data, len) do { } while(0)
-#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 (!(expr))                                                         \
-    SILC_LOG_ERROR(("SILC_VERIFY %s:%d", __FUNCTION__, __LINE__));
-#endif /* SILC_DEBUG */
-/***/
-
-/* Prototypes */
-
-/****f* silcutil/SilcLogAPI/silc_log_set_file
- *
- * SYNOPSIS
- *
- *    SilcBool silc_log_set_file(SilcLogType type, char *filename,
- *                           SilcUInt32 maxsize,
- *                           SilcSchedule scheduler);
- *
- * DESCRIPTION
- *
- *    Sets `filename', which can be maximum `maxsize' bytes long, as the new
- *    logging file for the channel `type'.  If you specify an illegal filename
- *    a warning message is printed and FALSE is returned.  In this case
- *    logging settings are not changed.
- *
- *    You can disable logging for a channel by specifying NULL filename, the
- *    maxsize in this case is not important.  The `scheduler' parameter is
- *    needed by the internal logging to allow buffered output and thus to
- *    save HD activity.
- *
- ***/
-SilcBool silc_log_set_file(SilcLogType type, char *filename,
-                          SilcUInt32 maxsize, SilcSchedule scheduler);
-
-/****f* silcutil/SilcLogAPI/silc_log_get_file
- *
- * SYNOPSIS
- *
- *    char *silc_log_get_file(SilcLogType type);
- *
- * DESCRIPTION
- *
- *    Returns the current logging file for the channel `type'.
- *    If there has been an error during the opening of this channel, NULL
- *    is returned, even if the file has been previously set with
- *    silc_log_set_file().
- *
- *    The returned pointer points to internally allocated storage and must
- *    not be freed, modified or stored.
- *
- ***/
-char *silc_log_get_file(SilcLogType type);
-
-/****f* silcutil/SilcLogAPI/silc_log_set_callback
- *
- * SYNOPSIS
- *
- *    void silc_log_set_callback(SilcLogType type, SilcLogCb cb,
- *                               void *context);
- *
- * DESCRIPTION
- *
- *    Set `cb' as the default callback function for the logging channel
- *    `type'.  When SilcLog receives a message for this channel, it will
- *    trigger the callback function.  If the callback function returns TRUE
- *    SilcLog will assume the input as handled and won't run its default
- *    handler.
- *
- *    You can disable/remove a callback by setting it to NULL or calling the
- *    function silc_log_reset_callbacks.  If set, the callback function
- *    must be in the form described by SilcLogCb.
- *
- * SEE ALSO
- *    silc_log_reset_callbacks
- *
- ***/
-void silc_log_set_callback(SilcLogType type, SilcLogCb cb, void *context);
-
-/****f* silcutil/SilcLogAPI/silc_log_reset_callbacks
- *
- * SYNOPSIS
- *
- *    void silc_log_reset_callbacks();
- *
- * DESCRIPTION
- *
- *    Removes all logging callbacks for normal channels.  This function does
- *    NOT remove callbacks for debugging channels (debug and hexdump), you
- *    rather need to call silc_log_set_debug_callbacks() with NULL callbacks.
- *
- ***/
-void silc_log_reset_callbacks(void);
-
-/****f* silcutil/SilcLogAPI/silc_log_flush_all
- *
- * SYNOPSIS
- *
- *    void silc_log_flush_all();
- *
- * DESCRIPTION
- *
- *    Forces flushing for all logging channels.  This should be called for
- *    example after receiving special signals.
- *
- * SEE ALSO
- *    silc_log_quick
- *
- ***/
-void silc_log_flush_all(void);
-
-/****f* silcutil/SilcLogAPI/silc_log_reset_all
- *
- * SYNOPSIS
- *
- *    void silc_log_reset_all();
- *
- * DESCRIPTION
- *
- *    Forces all logging channels to close and reopen their streams.  Useful
- *    for example after a SIGHUP signal.
- *
- *    Please note that this function could generate some warning messages if
- *    one or more logging channels point to an illegal filename.
- *
- ***/
-void silc_log_reset_all(void);
-
-/****f* silcutil/SilcLogAPI/silc_log_set_debug_callbacks
- *
- * SYNOPSIS
- *
- *    void silc_log_set_debug_callbacks(SilcLogDebugCb debug_cb,
- *                                      void *debug_context,
- *                                      SilcLogHexdumpCb hexdump_cb,
- *                                      void *hexdump_context);
- *
- * DESCRIPTION
- *
- *    Sets `debug_cb' as the the default callback function for the debug
- *    output, that will be called with the `debug_context' parameter.
- *    When SilcLog receives a debug message, it will trigger the callback
- *    function.  If the callback function returns TRUE SilcLog will assume
- *    the input as handled and won't run its default handler.  The `hexdump_cb'
- *    and `hexdump_context' works the same way, except that they are referred
- *    to SILC_LOG_HEXDUMP requests.
- *
- *    You can disable/remove a callback by setting it to NULL.  If set, each
- *    callback function must be either in the form described by SilcLogDebugCb
- *    or SilcLogHexdumpCb.
- *
- ***/
-void silc_log_set_debug_callbacks(SilcLogDebugCb debug_cb,
-                                 void *debug_context,
-                                 SilcLogHexdumpCb hexdump_cb,
-                                 void *hexdump_context);
-
-/****f* silcutil/SilcLogAPI/silc_log_reset_debug_callbacks
- *
- * SYNOPSIS
- *
- *    void silc_log_reset_debug_callbacks();
- *
- * DESCRIPTION
- *
- *    Resets debug callbacks set with silc_log_set_debug_callbacks.
- *
- ***/
-void silc_log_reset_debug_callbacks(void);
-
-/****f* silcutil/SilcLogAPI/silc_log_set_debug_string
- *
- * SYNOPSIS
- *
- *    void silc_log_set_debug_string(const char *debug_string);
- *
- * DESCRIPTION
- *
- *    Sets `debug_string' as the regexp string for filtering debugging
- *    output.  The string is copied and it can be modified/destroyed after
- *    this function call.
- *
- ***/
-void silc_log_set_debug_string(const char *debug_string);
-
-/****f* silcutil/SilcLogAPI/silc_log_timestamp
- *
- * NAME
- *
- *    void silc_log_timestamp(SilcBool enable);
- *
- * DESCRIPTION
- *
- *    Use timestamp in log messages.  Set `enable' to TRUE to enable
- *    timestamp and to FALSE to disable it.  Default is TRUE.
- *
- ***/
-void silc_log_timestamp(SilcBool enable);
-
-/****f* silcutil/SilcLogAPI/silc_log_flushdelay
- *
- * NAME
- *
- *    void silc_log_flushdelay(SilcUInt32 flushdelay);
- *
- * DESCRIPTION
- *
- *    Sets the logfiles flushing delay in seconds.  Default is 300 seconds.
- *
- ***/
-void silc_log_flushdelay(SilcUInt32 flushdelay);
-
-/****f* silcutil/SilcLogAPI/silc_log_quick
- *
- * NAME
- *
- *    void silc_log_quick(SilcBool enable);
- *
- * DESCRIPTION
- *
- *    SilcLog makes use of libc stream buffering output, which means that it
- *    saves HD activity by buffering the logging messages and writing them
- *    all together every some minutes (default is 5 minutes).
- *
- *    Setting `enable' to TRUE will force SilcLog to write messages to the
- *    filesystem as soon as they are received. This increases the CPU activity
- *    notably on bigger servers, but reduces memory usage.
- *
- *    If you want to change the logging style on-the-fly, make sure to call
- *    silc_log_flush_all() after setting `enable'  to TRUE.
- *
- *    Default is FALSE.
- *
- ***/
-void silc_log_quick(SilcBool enable);
-
-/****v* silcutil/SilcLogAPI/silc_log_debug
- *
- * NAME
- *
- *    void silc_log_debug(SilcBool enable);
- *
- * DESCRIPTION
- *
- *    If `enable' is set to FALSE, debugging functions won't procude any
- *    output and if set to TRUE prints debug messages to stderr.  Default
- *    is FALSE.
- *
- * SEE ALSO
- *    SILC_LOG_DEBUG
- *
- ***/
-void silc_log_debug(SilcBool enable);
-
-/****v* silcutil/SilcLogAPI/silc_log_debug_hexdump
- *
- * NAME
- *
- *    void silc_log_debug_hexdump(SilcBool enable);
- *
- * DESCRIPTION
- *
- *    If `enable' is set to FALSE, debugging functions won't produce
- *    any output anf if set to TRUE prints hexdump debug message to
- *    stderr.  Default is FALSE.
- *
- * SEE ALSO
- *    SILC_LOG_HEXDUMP
- *
- ***/
-void silc_log_debug_hexdump(SilcBool enable);
-
-#endif /* !SILCLOG_H */
diff --git a/lib/silcutil/silclog_i.h b/lib/silcutil/silclog_i.h
deleted file mode 100644 (file)
index 8a2a597..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
-
-  silclog_i.h
-
-  Author: Pekka Riikonen <priikone@silcnet.org>
-
-  Copyright (C) 2005 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 SILCLOG_I_H
-#define SILCLOG_I_H
-
-#ifndef SILCLOG_H
-#error "Do not include this header directly"
-#endif
-
-#if defined(SILC_WIN32)
-#ifndef __FUNCTION__
-#define __FUNCTION__ __FILE__
-#endif
-#endif
-
-void silc_log_output(SilcLogType type, char *string);
-void silc_log_output_debug(char *file, const char *function,
-                          int line, char *string);
-void silc_log_output_hexdump(char *file, const char *function,
-                            int line, void *data_in,
-                            SilcUInt32 len, char *string);
-
-#endif /* SILCLOG_I_H */
diff --git a/lib/silcutil/silcmemory.c b/lib/silcutil/silcmemory.c
deleted file mode 100644 (file)
index cf8bc54..0000000
+++ /dev/null
@@ -1,155 +0,0 @@
-/*
-
-  silcmemory.c
-
-  Author: Pekka Riikonen <priikone@silcnet.org>
-
-  Copyright (C) 1999 - 2006 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.
-
-*/
-/* $Id$ */
-
-#include "silc.h"
-
-#ifndef SILC_STACKTRACE
-
-#define SILC_MAX_ALLOC (1024 * 1024L * 1024L)
-
-void *silc_malloc(size_t size)
-{
-  void *addr;
-  if (silc_unlikely(size <= 0 || size >= SILC_MAX_ALLOC)) {
-    SILC_LOG_ERROR(("Invalid memory allocation"));
-    return NULL;
-  }
-  addr = malloc(size);
-  if (silc_unlikely(!addr))
-    SILC_LOG_ERROR(("System out of memory"));
-  return addr;
-}
-
-void *silc_calloc(size_t items, size_t size)
-{
-  void *addr;
-  if (silc_unlikely(size * items <= 0 || size * items >= SILC_MAX_ALLOC)) {
-    SILC_LOG_ERROR(("Invalid memory allocation"));
-    return NULL;
-  }
-  addr = calloc(items, size);
-  if (silc_unlikely(!addr))
-    SILC_LOG_ERROR(("System out of memory"));
-  return addr;
-}
-
-void *silc_realloc(void *ptr, size_t size)
-{
-  void *addr;
-  if (silc_unlikely(size <= 0 || size >= SILC_MAX_ALLOC)) {
-    SILC_LOG_ERROR(("Invalid memory allocation"));
-    return NULL;
-  }
-  addr = realloc(ptr, size);
-  if (silc_unlikely(!addr))
-    SILC_LOG_ERROR(("System out of memory"));
-  return addr;
-}
-
-void silc_free(void *ptr)
-{
-  free(ptr);
-}
-
-void *silc_memdup(const void *ptr, size_t size)
-{
-  unsigned char *addr;
-  addr = silc_malloc(size + 1);
-  if (silc_unlikely(!addr)) {
-    SILC_LOG_ERROR(("System out of memory"));
-    return NULL;
-  }
-  memcpy((void *)addr, ptr, size);
-  addr[size] = '\0';
-  return (void *)addr;
-}
-
-#endif /* !SILC_STACKTRACE */
-
-/* SilcStack aware routines */
-
-void *silc_smalloc(SilcStack stack, SilcUInt32 size)
-{
-  return stack ? silc_stack_malloc(stack, size, TRUE) : silc_malloc(size);
-}
-
-void *silc_smalloc_ua(SilcStack stack, SilcUInt32 size)
-{
-  return stack ? silc_stack_malloc(stack, size, FALSE) : silc_malloc(size);
-}
-
-void *silc_scalloc(SilcStack stack, SilcUInt32 items, SilcUInt32 size)
-{
-  unsigned char *addr;
-
-  if (!stack)
-    return silc_calloc(items, size);
-
-  addr = silc_stack_malloc(stack, items * size, TRUE);
-  if (silc_unlikely(!addr))
-    return NULL;
-  memset(addr, 0, items * size);
-  return (void *)addr;
-}
-
-void *silc_srealloc(SilcStack stack, SilcUInt32 old_size,
-                   void *ptr, SilcUInt32 size)
-{
-  return stack ? silc_stack_realloc(stack, old_size, ptr, size, TRUE) :
-    silc_realloc(ptr, size);
-}
-
-void *silc_srealloc_ua(SilcStack stack, SilcUInt32 old_size,
-                      void *ptr, SilcUInt32 size)
-{
-  return stack ? silc_stack_realloc(stack, old_size, ptr, size, FALSE) :
-    silc_realloc(ptr, size);
-}
-
-void *silc_smemdup(SilcStack stack, const void *ptr, SilcUInt32 size)
-{
-  unsigned char *addr;
-
-  if (!stack)
-    return silc_memdup(ptr, size);
-
-  addr = silc_stack_malloc(stack, size + 1, TRUE);
-  if (silc_unlikely(!addr))
-    return NULL;
-  memcpy((void *)addr, ptr, size);
-  addr[size] = '\0';
-  return (void *)addr;
-}
-
-char *silc_sstrdup(SilcStack stack, const char *str)
-{
-  SilcInt32 size = strlen(str);
-  char *addr;
-
-  if (!stack)
-    return silc_memdup(str, size);
-
-  addr = silc_stack_malloc(stack, size + 1, FALSE);
-  if (silc_unlikely(!addr))
-    return NULL;
-  memcpy((void *)addr, str, size);
-  addr[size] = '\0';
-  return addr;
-}
diff --git a/lib/silcutil/silcmemory.h b/lib/silcutil/silcmemory.h
deleted file mode 100644 (file)
index 63fc1fc..0000000
+++ /dev/null
@@ -1,311 +0,0 @@
-/*
-
-  silcmemory.h
-
-  Author: Pekka Riikonen <priikone@silcnet.org>
-
-  Copyright (C) 1999 - 2005 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.
-
-*/
-
-/****h* silcutil/SILC 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.
- *
- ***/
-
-#ifndef SILCMEMORY_H
-#define SILCMEMORY_H
-
-/* Prototypes */
-
-#ifndef SILC_STACKTRACE
-
-/****f* silcutil/SilcMemoryAPI/silc_malloc
- *
- * SYNOPSIS
- *
- *    void *silc_malloc(size_t size);
- *
- * DESCRIPTION
- *
- *    Allocates memory of `size' bytes and returns pointer to the allocated
- *    memory area.  Free the memory by calling silc_free.  Returns NULL on
- *    error.
- *
- ***/
-void *silc_malloc(size_t size);
-
-/****f* silcutil/SilcMemoryAPI/silc_calloc
- *
- * SYNOPSIS
- *
- *    void *silc_calloc(size_t items, size_t size);
- *
- * DESCRIPTION
- *
- *    Allocates memory of for an array of `items' elements of `size' bytes
- *    and returns pointer to the allocated memory area.  The memory area is
- *    also zeroed.  Free the memory by calling silc_free.  Returns NULL on
- *    error.
- *
- ***/
-void *silc_calloc(size_t items, size_t size);
-
-/****f* silcutil/SilcMemoryAPI/silc_realloc
- *
- * SYNOPSIS
- *
- *    void *silc_realloc(void *ptr, size_t size);
- *
- * DESCRIPTION
- *
- *    Change the size of the memory block indicated by `ptr' to the new
- *    size of `size' bytes.  The contents of `ptr' will not be changed.
- *    If `ptr' is NULL the call is equivalent to silc_malloc.  If the
- *    `size' is zero (0) the call is equivalent to silc_free.  Free the
- *    memory by calling silc_free.
- *
- * NOTES
- *
- *    The pointer returned to the reallocated memory area might not be
- *    same as `ptr'.
- *
- ***/
-void *silc_realloc(void *ptr, size_t size);
-
-/****f* silcutil/SilcMemoryAPI/silc_free
- *
- * SYNOPSIS
- *
- *    void silc_free(void *ptr);
- *
- * DESCRIPTION
- *
- *    Frees the memory area indicated by the `ptr'. If `ptr' is NULL no
- *    operation is performed.
- *
- ***/
-void silc_free(void *ptr);
-
-/****f* silcutil/SilcMemoryAPI/silc_memdup
- *
- * SYNOPSIS
- *
- *    void *silc_memdup(const void *ptr, size_t size);
- *
- * DESCRIPTION
- *
- *    Duplicates the memory area indicated by `ptr' which is of size
- *    of `size' bytes. Returns pointer to the duplicated memory area.
- *    This NULL terminates the dupped memory area by allocating `size' + 1
- *    bytes, so this function can be used to duplicate strings that does
- *    not have NULL termination.
- *
- ***/
-void *silc_memdup(const void *ptr, size_t size);
-
-#else
-#ifndef SILC_DIST_TOOLKIT
-#error "The stack trace is not supported in this distribution"
-#endif /* SILC_DIST_TOOLKIT */
-
-#include "stacktrace.h"
-#endif /* SILC_STACKTRACE */
-
-
-/* Following functions that use SilcStack as memory source. */
-
-/****f* silcutil/SilcMemoryAPI/silc_smalloc
- *
- * SYNOPSIS
- *
- *    void *silc_smalloc(SilcStack stack, SilcUInt32 size);
- *
- * DESCRIPTION
- *
- *    Allocate memory block of size of `size' from the stack indicated by
- *    `stack' and return pointer to it.  Returns NULL on error.  This
- *    function allocates aligned memory so it can be used to allocate
- *    memory for structures, for example.  If you allocate strings or
- *    data buffers using silc_smalloc_ua is recommended instead of this
- *    function.
- *
- * NOTES
- *
- *    Be careful with this function:  do not free the returned pointer
- *    explicitly and do not save the returned pointer to a permanent
- *    location.
- *
- *    If `stack' is NULL this function calls silc_malloc.
- *
- ***/
-void *silc_smalloc(SilcStack stack, SilcUInt32 size);
-
-/****f* silcutil/SilcMemoryAPI/silc_smalloc_ua
- *
- * SYNOPSIS
- *
- *    void *silc_smalloc_ua(SilcStack stack, SilcUInt32 size);
- *
- * DESCRIPTION
- *
- *    Allocate unaligned memory block of size of `size' from the stack
- *    indicated by `stack' and return pointer to it.  Returns NULL on error.
- *
- * NOTES
- *
- *    This function must not be used to allocate memory for structures.
- *    Use this function only for strings and data buffers.
- *
- *    Be careful with this function:  do not free the returned pointer
- *    explicitly and do not save the returned pointer to a permanent
- *    location.
- *
- *    If `stack' is NULL this function calls silc_malloc.
- *
- ***/
-void *silc_smalloc_ua(SilcStack stack, SilcUInt32 size);
-
-/****f* silcutil/SilcMemoryAPI/silc_scalloc
- *
- * SYNOPSIS
- *
- *    void *silc_scalloc(SilcStack stack, SilcUInt32 items, SilcUInt32 size);
- *
- * DESCRIPTION
- *
- *    Allocate memory block of size of `size' from the stack indicated by
- *    `stack', zero the memory area and return pointer to it.  This
- *    function allocates aligned memory.  Returns NULL on error.
- *
- * NOTES
- *
- *    Be careful with this function:  do not free the returned pointer
- *    explicitly and do not save the returned pointer to a permanent
- *    location.
- *
- *    If `stack' is NULL this function calls silc_calloc.
- *
- ***/
-void *silc_scalloc(SilcStack stack, SilcUInt32 items, SilcUInt32 size);
-
-/****f* silcutil/SilcMemoryAPI/silc_srealloc
- *
- * SYNOPSIS
- *
- *    void *silc_srealloc(SilcStack stack, SilcUInt32 old_size,
- *                        void *ptr, SilcUInt32 size);
- *
- * DESCRIPTION
- *
- *    Change the size of the memory block indicated by `ptr' to the new
- *    size of `size' bytes.  The contents of `ptr' will not be changed.
- *    If `ptr' is NULL the call is equivalent to silc_smalloc.  If `size'
- *    is zero (0) error will occur.  Returns NULL on error and the old
- *    pointer remain intact.
- *
- * NOTES
- *
- *    This function reallocates successfully only if the previous allocation
- *    to `stack' was `ptr'.  If there was another memory allocation between
- *    allocating `ptr' and this call, this routine will return NULL.  The
- *    NULL is also returned if the `size' does not fit to current stack
- *    and allocating new block would require slow copying of the data.  It
- *    is left to the caller to decide whether to allocate new pointer and
- *    copy the old data in case this function returns NULL.
- *
- *    This function can be used to reallocate only aligned memory allocated
- *    with silc_smalloc.
- *
- *    If `stack' is NULL this function calls silc_realloc.
- *
- ***/
-void *silc_srealloc(SilcStack stack, SilcUInt32 old_size,
-                   void *ptr, SilcUInt32 size);
-
-/****f* silcutil/SilcMemoryAPI/silc_srealloc_ua
- *
- * SYNOPSIS
- *
- *    void *silc_srealloc_ua(SilcStack stack, SilcUInt32 old_size,
- *                           void *ptr, SilcUInt32 size);
- *
- * DESCRIPTION
- *
- *    Same as silc_srealloc but reallocates unaligned memory.
- *
- * NOTES
- *
- *    This function can be used to reallocate only unaligned memory
- *    allocated with silc_smalloc_ua.
- *
- *    If `stack' is NULL this function calls silc_realloc.
- *
- ***/
-void *silc_srealloc_ua(SilcStack stack, SilcUInt32 old_size,
-                      void *ptr, SilcUInt32 size);
-
-/****f* silcutil/SilcMemoryAPI/silc_smemdup
- *
- * SYNOPSIS
- *
- *    void *silc_smemdup(SilcStack stack, const void *ptr, SilcUInt32 size);
- *
- * DESCRIPTION
- *
- *    Duplicates the memory area indicated by `ptr' which is the size of
- *    `size' bytes.  Returns pointer to the duplicated memory area.  This
- *    NULL terminates the dupped memory area by allocating `size' + 1
- *    bytes, so this function can be used to duplicate strings that does not
- *    have NULL termination.  This function allocates aligned memory so
- *    it can be used to duplicate also structures.  Returns NULL on error.
- *
- * NOTES
- *
- *    Be careful with this function:  do not free the returned pointer
- *    explicitly and do not save the returned pointer to a permanent
- *    location.
- *
- *    If `stack' is NULL this function calls silc_memdup.
- *
- ***/
-void *silc_smemdup(SilcStack stack, const void *ptr, SilcUInt32 size);
-
-/****f* silcutil/SilcMemoryAPI/silc_sstrdup
- *
- * SYNOPSIS
- *
- *    char *silc_sstrdup(SilcStack stack, const char *str);
- *
- * DESCRIPTION
- *
- *    Duplicates the string indicated by `str' and returns the duplicated
- *    string.  This function allocates unaligned memory.  Returns NULL
- *    on error.
- *
- * NOTES
- *
- *    Be careful with this function:  do not free the returned pointer
- *    explicitly and do not save the returned pointer to a permanent
- *    location.
- *
- *    If `stack' is NULL this function calls silc_strdup.
- *
- ***/
-char *silc_sstrdup(SilcStack stack, const char *str);
-
-#endif /* SILCMEMORY_H */
diff --git a/lib/silcutil/silcmime.c b/lib/silcutil/silcmime.c
deleted file mode 100644 (file)
index c0817ec..0000000
+++ /dev/null
@@ -1,827 +0,0 @@
-/*
-
-  silcmime.c
-
-  Author: Pekka Riikonen <priikone@silcnet.org>
-
-  Copyright (C) 2005 - 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.
-
-*/
-
-#include "silc.h"
-
-/************************ 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,
-                                    void *user_context)
-{
-  silc_free(key);
-  silc_hash_table_free(context);
-}
-
-/* Assembler partial MIME destructor */
-
-static void silc_mime_assemble_dest(void *key, void *context,
-                                   void *user_context)
-{
-  silc_mime_free(context);
-}
-
-
-/******************************* Public API *********************************/
-
-/* Allocate MIME context */
-
-SilcMime silc_mime_alloc(void)
-{
-  SilcMime mime;
-
-  mime = silc_calloc(1, sizeof(*mime));
-  if (!mime)
-    return NULL;
-
-  mime->fields = silc_hash_table_alloc(0, silc_hash_string, mime,
-                                      silc_hash_string_compare, mime,
-                                      silc_mime_field_dest, mime, TRUE);
-  if (!mime->fields) {
-    silc_mime_free(mime);
-    return NULL;
-  }
-
-  return mime;
-}
-
-/* Free MIME context */
-
-void silc_mime_free(SilcMime mime)
-{
-  SilcMime m;
-
-  if (mime->fields)
-    silc_hash_table_free(mime->fields);
-
-  if (mime->multiparts) {
-    silc_dlist_start(mime->multiparts);
-    while ((m = silc_dlist_get(mime->multiparts)) != SILC_LIST_END)
-      silc_mime_free(m);
-    silc_dlist_uninit(mime->multiparts);
-  }
-  silc_free(mime->boundary);
-  silc_free(mime->multitype);
-  silc_free(mime->data);
-  silc_free(mime);
-}
-
-/* Allocate MIME assembler */
-
-SilcMimeAssembler silc_mime_assembler_alloc(void)
-{
-  SilcMimeAssembler assembler;
-
-  assembler = silc_calloc(1, sizeof(*assembler));
-  if (!assembler)
-    return NULL;
-
-  assembler->fragments =
-    silc_hash_table_alloc(0, silc_hash_string, NULL,
-                         silc_hash_string_compare, NULL,
-                         silc_mime_assembler_dest, assembler, TRUE);
-  if (!assembler->fragments) {
-    silc_mime_assembler_free(assembler);
-    return NULL;
-  }
-
-  return assembler;
-}
-
-/* Free MIME assembler */
-
-void silc_mime_assembler_free(SilcMimeAssembler assembler)
-{
-  silc_hash_table_free(assembler->fragments);
-  silc_free(assembler);
-}
-
-/* Decode MIME message */
-
-SilcMime silc_mime_decode(SilcMime mime, const unsigned char *data,
-                         SilcUInt32 data_len)
-{
-  SilcMime m = NULL;
-  int i, k;
-  char *tmp, *field, *value, *line;
-
-  SILC_LOG_DEBUG(("Parsing MIME message"));
-
-  if (!data)
-    return NULL;
-
-  if (!mime) {
-    mime = silc_mime_alloc();
-    if (!mime)
-      return NULL;
-    m = mime;
-  }
-
-  /* Parse the fields */
-  line = tmp = (char *)data;
-  for (i = 0; i < data_len; i++) {
-    /* Get field line */
-    if (data_len - i >= 2 && tmp[i] == '\r' && tmp[i + 1] == '\n') {
-      /* Get field */
-      field = strchr(line, ':');
-      if (!field)
-       goto err;
-      field = silc_memdup(line, field - line);
-      if (!field)
-       goto err;
-
-      /* Get value. Remove whitespaces too. */
-      value = strchr(line, ':');
-      if ((tmp + i) - value < 2)
-       goto err;
-      value++;
-      for (k = 0; k < (tmp + i) - value; k++) {
-       if (value[k] == '\r')
-         goto err;
-       if (value[k] != ' ' && value[k] != '\t')
-         break;
-      }
-      value += k;
-      if ((tmp + i) - value < 1)
-       goto err;
-      value = silc_memdup(value, (tmp + i) - value);
-      if (!value)
-       goto err;
-
-      SILC_LOG_DEBUG(("Header '%s' '%s'", field, value));
-
-      /* Add field and value */
-      silc_mime_add_field(mime, field, value);
-      silc_free(field);
-      silc_free(value);
-
-      /* Mark start of next line */
-      line = (tmp + i) + 2;
-      i += 2;
-
-      /* Break if this is last header */
-      if (data_len - i >= 2 &&
-         tmp[i] == '\r' && tmp[i + 1] == '\n') {
-       i += 2;
-       break;
-      }
-    }
-  }
-
-  /* Parse multiparts if present */
-  field = (char *)silc_mime_get_field(mime, "Content-Type");
-  if (field && strstr(field, "multipart")) {
-    char b[1024];
-    SilcMime p;
-    unsigned int len;
-
-    mime->multiparts = silc_dlist_init();
-    if (!mime->multiparts)
-      goto err;
-
-    /* Get multipart type */
-    value = strchr(field, '/');
-    if (!value)
-      goto err;
-    value++;
-    if (strchr(field, '"'))
-      value++;
-    if (!strchr(field, ';'))
-      goto err;
-    memset(b, 0, sizeof(b));
-    len = (unsigned int)(strchr(field, ';') - value);
-    if (len > sizeof(b) - 1)
-      goto err;
-    strncpy(b, value, len);
-    if (strchr(b, '"'))
-      *strchr(b, '"') = '\0';
-    mime->multitype = silc_memdup(b, strlen(b));
-
-    /* Get boundary */
-    value = strrchr(field, '=');
-    if (value && strlen(value) > 1) {
-      value++;
-
-      SILC_LOG_DEBUG(("Boundary '%s'", value));
-
-      memset(b, 0, sizeof(b));
-      line = strdup(value);
-      if (strrchr(line, '"')) {
-       *strrchr(line, '"') = '\0';
-       silc_snprintf(b, sizeof(b) - 1, "--%s", line + 1);
-       mime->boundary = strdup(line + 1);
-      } else {
-       silc_snprintf(b, sizeof(b) - 1, "--%s", line);
-       mime->boundary = strdup(line);
-      }
-      silc_free(line);
-
-      for (i = i; i < data_len; i++) {
-       /* Get boundary data */
-       if (data_len - i >= strlen(b) &&
-           tmp[i] == '-' && tmp[i + 1] == '-') {
-         if (memcmp(tmp + i, b, strlen(b)))
-           continue;
-
-         i += strlen(b);
-
-         if (data_len - i >= 4 &&
-             tmp[i    ] == '\r' && tmp[i + 1] == '\n' &&
-             tmp[i + 2] == '\r' && tmp[i + 3] == '\n')
-           i += 4;
-         else if (data_len - i >= 2 &&
-                  tmp[i] == '\r' && tmp[i + 1] == '\n')
-           i += 2;
-         else if (data_len - i >= 2 &&
-                  tmp[i] == '-' && tmp[i + 1] == '-')
-           break;
-
-         line = tmp + i;
-
-         /* Find end of boundary */
-         for (k = i; k < data_len; k++)
-           if (data_len - k >= strlen(b) &&
-               tmp[k] == '-' && tmp[k + 1] == '-')
-             if (!memcmp(tmp + k, b, strlen(b)))
-               break;
-         if (k >= data_len)
-           goto err;
-
-         /* Remove preceding CRLF */
-         k -= 2;
-
-         /* Parse the part */
-         p = silc_mime_decode(NULL, line, k - i);
-         if (!p)
-           goto err;
-
-         silc_dlist_add(mime->multiparts, p);
-         i += (k - i);
-       }
-      }
-    }
-  } else {
-    /* Get data area.  If we are at the end and we have fields present
-       there is no data area present, but, if fields are not present we
-       only have data area. */
-    if (i >= data_len && !silc_hash_table_count(mime->fields))
-      i = 0;
-    SILC_LOG_DEBUG(("Data len %d", data_len - i));
-    if (data_len - i)
-      silc_mime_add_data(mime, tmp + i, data_len - i);
-  }
-
-  return mime;
-
- err:
-  if (m)
-    silc_mime_free(m);
-  return NULL;
-}
-
-/* Encode MIME message */
-
-unsigned char *silc_mime_encode(SilcMime mime, SilcUInt32 *encoded_len)
-{
-  SilcMime part;
-  SilcHashTableList htl;
-  SilcBufferStruct buf;
-  SilcBuffer buffer;
-  char *field, *value, tmp[1024], tmp2[4];
-  unsigned char *ret;
-  int i;
-
-  SILC_LOG_DEBUG(("Encoding MIME message"));
-
-  if (!mime)
-    return NULL;
-
-  memset(&buf, 0, sizeof(buf));
-
-  /* Encode the headers. Order doesn't matter */
-  i = 0;
-  silc_hash_table_list(mime->fields, &htl);
-  while (silc_hash_table_get(&htl, (void *)&field, (void *)&value)) {
-    memset(tmp, 0, sizeof(tmp));
-    SILC_LOG_DEBUG(("Header %s: %s", field, value));
-    silc_snprintf(tmp, sizeof(tmp) - 1, "%s: %s\r\n", field, value);
-    silc_buffer_strformat(&buf, tmp, SILC_STRFMT_END);
-    i++;
-  }
-  silc_hash_table_list_reset(&htl);
-  if (i)
-    silc_buffer_strformat(&buf, "\r\n", SILC_STRFMT_END);
-
-  /* Assemble the whole buffer */
-  buffer = silc_buffer_alloc_size(mime->data_len + silc_buffer_len(&buf));
-  if (!buffer)
-    return NULL;
-
-  /* Add headers */
-  if (silc_buffer_len(&buf)) {
-    silc_buffer_put(buffer, buf.head, silc_buffer_len(&buf));
-    silc_buffer_pull(buffer, silc_buffer_len(&buf));
-    silc_buffer_purge(&buf);
-  }
-
-  /* Add data */
-  if (mime->data) {
-    SILC_LOG_DEBUG(("Data len %d", mime->data_len));
-    silc_buffer_put(buffer, mime->data, mime->data_len);
-  }
-
-  /* Add multiparts */
-  if (mime->multiparts) {
-    SILC_LOG_DEBUG(("Encoding multiparts"));
-
-    silc_dlist_start(mime->multiparts);
-    i = 0;
-    while ((part = silc_dlist_get(mime->multiparts)) != SILC_LIST_END) {
-      unsigned char *pd;
-      SilcUInt32 pd_len;
-
-      /* Recursive encoding */
-      pd = silc_mime_encode(part, &pd_len);
-      if (!pd)
-       return NULL;
-
-      memset(tmp, 0, sizeof(tmp));
-      memset(tmp2, 0, sizeof(tmp2));
-
-      /* If fields are not present, add extra CRLF */
-      if (!silc_hash_table_count(part->fields))
-       silc_snprintf(tmp2, sizeof(tmp2) - 1, "\r\n");
-      silc_snprintf(tmp, sizeof(tmp) - 1, "%s--%s\r\n%s",
-              i != 0 ? "\r\n" : "", mime->boundary, tmp2);
-      i = 1;
-
-      buffer = silc_buffer_realloc(buffer, silc_buffer_truelen(buffer) +
-                                  pd_len + strlen(tmp));
-      if (!buffer)
-       return NULL;
-      silc_buffer_put_tail(buffer, tmp, strlen(tmp));
-      silc_buffer_pull_tail(buffer, strlen(tmp));
-      silc_buffer_put_tail(buffer, pd, pd_len);
-      silc_buffer_pull_tail(buffer, pd_len);
-      silc_free(pd);
-    }
-
-    memset(tmp, 0, sizeof(tmp));
-    silc_snprintf(tmp, sizeof(tmp) - 1, "\r\n--%s--\r\n", mime->boundary);
-    buffer = silc_buffer_realloc(buffer, silc_buffer_truelen(buffer) +
-                                strlen(tmp));
-    if (!buffer)
-      return NULL;
-    silc_buffer_put_tail(buffer, tmp, strlen(tmp));
-    silc_buffer_pull_tail(buffer, strlen(tmp));
-  }
-
-  ret = silc_buffer_steal(buffer, encoded_len);
-  silc_buffer_free(buffer);
-
-  return ret;
-}
-
-/* Assembles MIME message from partial MIME messages */
-
-SilcMime silc_mime_assemble(SilcMimeAssembler assembler, SilcMime partial)
-{
-  char *type, *id = NULL, *tmp;
-  SilcHashTable f;
-  SilcMime p, complete;
-  int i, number, total = -1;
-  const unsigned char *data;
-  SilcUInt32 data_len;
-  SilcBuffer compbuf = NULL;
-
-  SILC_LOG_DEBUG(("Assembling MIME fragments"));
-
-  if (!assembler || !partial)
-    goto err;
-
-  type = (char *)silc_mime_get_field(partial, "Content-Type");
-  if (!type)
-    goto err;
-
-  /* Get ID */
-  tmp = strstr(type, "id=");
-  if (!tmp)
-    goto err;
-  if (strlen(tmp) <= 4)
-    goto err;
-  tmp += 3;
-  if (*tmp == '"')
-    tmp++;
-  id = strdup(tmp);
-  if (strchr(id, ';'))
-    *strchr(id, ';') = '\0';
-  if (strrchr(id, '"'))
-    *strrchr(id, '"') = '\0';
-
-  SILC_LOG_DEBUG(("Fragment ID %s", id));
-
-  /* Get fragment number */
-  tmp = strstr(type, "number=");
-  if (!tmp)
-    goto err;
-  tmp = strchr(tmp, '=');
-  if (strlen(tmp) < 2)
-    goto err;
-  tmp++;
-  if (strchr(tmp, ';')) {
-    tmp = strdup(tmp);
-    *strchr(tmp, ';') = '\0';
-    number = atoi(tmp);
-    silc_free(tmp);
-  } else {
-    number = atoi(tmp);
-  }
-
-  SILC_LOG_DEBUG(("Fragment number %d", number));
-
-  /* Find fragments with this ID. */
-  if (!silc_hash_table_find(assembler->fragments, (void *)id,
-                           NULL, (void *)&f)) {
-    /* This is new fragment to new message.  Add to hash table and return. */
-    f = silc_hash_table_alloc(0, silc_hash_uint, NULL, NULL, NULL,
-                             silc_mime_assemble_dest, NULL, TRUE);
-    if (!f)
-        goto err;
-    silc_hash_table_add(f, SILC_32_TO_PTR(number), partial);
-    silc_hash_table_add(assembler->fragments, id, f);
-    return NULL;
-  }
-
-  /* Try to get total number */
-  tmp = strstr(type, "total=");
-  if (tmp) {
-    tmp = strchr(tmp, '=');
-    if (strlen(tmp) < 2)
-      goto err;
-    tmp++;
-    if (strchr(tmp, ';')) {
-      tmp = strdup(tmp);
-      *strchr(tmp, ';') = '\0';
-      total = atoi(tmp);
-      silc_free(tmp);
-    } else {
-      total = atoi(tmp);
-    }
-
-    SILC_LOG_DEBUG(("Fragment total %d", total));
-  }
-
-  /* If more fragments to come, add to hash table */
-  if (number != total) {
-    silc_hash_table_add(f, SILC_32_TO_PTR(number), partial);
-    return NULL;
-  }
-
-  silc_hash_table_add(f, SILC_32_TO_PTR(number), partial);
-
-  /* Verify that we really have all the fragments */
-  if (silc_hash_table_count(f) < total)
-    return NULL;
-
-  /* Assemble the complete MIME message now. We get them in order from
-     the hash table. */
-  for (i = 1; i <= total; i++) {
-    if (!silc_hash_table_find(f, SILC_32_TO_PTR(i), NULL, (void *)&p))
-      goto err;
-
-    /* The fragment is in the data portion of the partial message */
-    data = silc_mime_get_data(p, &data_len);
-    if (!data)
-      goto err;
-
-    /* Assemble */
-    if (!compbuf) {
-      compbuf = silc_buffer_alloc_size(data_len);
-      if (!compbuf)
-       goto err;
-      silc_buffer_put(compbuf, data, data_len);
-    } else {
-      compbuf = silc_buffer_realloc(compbuf, silc_buffer_truelen(compbuf) +
-                                   data_len);
-      if (!compbuf)
-       goto err;
-      silc_buffer_put_tail(compbuf, data, data_len);
-      silc_buffer_pull_tail(compbuf, data_len);
-    }
-  }
-
-  /* Now parse the complete MIME message and deliver it */
-  complete = silc_mime_decode(NULL, (const unsigned char *)compbuf->head,
-                             silc_buffer_truelen(compbuf));
-  if (!complete)
-    goto err;
-
-  /* Delete the hash table entry. Destructors will free memory */
-  silc_hash_table_del(assembler->fragments, (void *)id);
-  silc_free(id);
-  silc_buffer_free(compbuf);
-
-  return complete;
-
- err:
-  silc_free(id);
-  if (compbuf)
-    silc_buffer_free(compbuf);
-  silc_mime_free(partial);
-  return NULL;
-}
-
-/* Encodes partial MIME messages */
-
-SilcDList silc_mime_encode_partial(SilcMime mime, int max_size)
-{
-  unsigned char *buf, *tmp;
-  SilcUInt32 buf_len, len, tmp_len, off;
-  SilcDList list;
-  SilcBuffer buffer;
-  SilcMime partial;
-  char type[128], id[64];
-  int num;
-
-  SILC_LOG_DEBUG(("Fragmenting MIME message"));
-
-  /* Encode as normal */
-  buf = silc_mime_encode(mime, &buf_len);
-  if (!buf)
-    return NULL;
-
-  list = silc_dlist_init();
-
-  /* Fragment if it is too large */
-  if (buf_len > max_size) {
-    memset(id, 0, sizeof(id));
-    memset(type, 0, sizeof(type));
-    gethostname(type, sizeof(type) - 1);
-    srand((time(NULL) + buf_len) ^ rand());
-    silc_snprintf(id, sizeof(id) - 1, "%X%X%X%s",
-            (unsigned int)rand(), (unsigned int)time(NULL),
-            (unsigned int)buf_len, type);
-
-    SILC_LOG_DEBUG(("Fragment ID %s", id));
-
-    partial = silc_mime_alloc();
-    if (!partial)
-      return NULL;
-
-    silc_mime_add_field(partial, "MIME-Version", "1.0");
-    memset(type, 0, sizeof(type));
-    silc_snprintf(type, sizeof(type) - 1,
-            "message/partial; id=\"%s\"; number=1", id);
-    silc_mime_add_field(partial, "Content-Type", type);
-    silc_mime_add_data(partial, buf, max_size);
-
-    tmp = silc_mime_encode(partial, &tmp_len);
-    if (!tmp)
-      return NULL;
-    silc_mime_free(partial);
-
-    /* Add to list */
-    buffer = silc_buffer_alloc_size(tmp_len);
-    if (!buffer)
-      return NULL;
-    silc_buffer_put(buffer, tmp, tmp_len);
-    silc_dlist_add(list, buffer);
-    silc_free(tmp);
-
-    len = buf_len - max_size;
-    off = max_size;
-    num = 2;
-    while (len > 0) {
-      partial = silc_mime_alloc();
-      if (!partial)
-       return NULL;
-
-      memset(type, 0, sizeof(type));
-      silc_mime_add_field(partial, "MIME-Version", "1.0");
-
-      if (len > max_size) {
-       silc_snprintf(type, sizeof(type) - 1,
-                "message/partial; id=\"%s\"; number=%d",
-                id, num++);
-       silc_mime_add_data(partial, buf + off, max_size);
-       off += max_size;
-       len -= max_size;
-      } else {
-       silc_snprintf(type, sizeof(type) - 1,
-                "message/partial; id=\"%s\"; number=%d; total=%d",
-                id, num, num);
-       silc_mime_add_data(partial, buf + off, len);
-       len = 0;
-      }
-
-      silc_mime_add_field(partial, "Content-Type", type);
-
-      tmp = silc_mime_encode(partial, &tmp_len);
-      if (!tmp)
-       return NULL;
-      silc_mime_free(partial);
-
-      /* Add to list */
-      buffer = silc_buffer_alloc_size(tmp_len);
-      if (!buffer)
-       return NULL;
-      silc_buffer_put(buffer, tmp, tmp_len);
-      silc_dlist_add(list, buffer);
-      silc_free(tmp);
-    }
-  } else {
-    /* No need to fragment */
-    buffer = silc_buffer_alloc_size(buf_len);
-    if (!buffer)
-      return NULL;
-    silc_buffer_put(buffer, buf, buf_len);
-    silc_dlist_add(list, buffer);
-  }
-
-  silc_free(buf);
-
-  return list;
-}
-
-/* Free partial MIME list */
-
-void silc_mime_partial_free(SilcDList partials)
-{
-  SilcBuffer buf;
-
-  if (!partials)
-    return;
-
-  silc_dlist_start(partials);
-  while ((buf = silc_dlist_get(partials)) != SILC_LIST_END)
-    silc_buffer_free(buf);
-  silc_dlist_uninit(partials);
-}
-
-/* Add field */
-
-void silc_mime_add_field(SilcMime mime, const char *field, const char *value)
-{
-  if (!mime || !field || !value)
-    return;
-
-  silc_hash_table_add(mime->fields, strdup(field), strdup(value));
-}
-
-/* Get field */
-
-const char *silc_mime_get_field(SilcMime mime, const char *field)
-{
-  char *value;
-
-  if (!mime || !field)
-    return NULL;
-
-  if (!silc_hash_table_find(mime->fields, (void *)field,
-                           NULL, (void *)&value))
-    return NULL;
-
-  return (const char *)value;
-}
-
-/* Add data */
-
-void silc_mime_add_data(SilcMime mime, const unsigned char *data,
-                       SilcUInt32 data_len)
-{
-  if (!mime || !data)
-    return;
-
-  if (mime->data)
-    silc_free(mime->data);
-
-  mime->data = silc_memdup(data, data_len);
-  mime->data_len = data_len;
-}
-
-/* Get data */
-
-const unsigned char *silc_mime_get_data(SilcMime mime, SilcUInt32 *data_len)
-{
-  if (!mime)
-    return NULL;
-
-  if (data_len)
-    *data_len = mime->data_len;
-
-  return mime->data;
-}
-
-/* Steal data */
-
-unsigned char *silc_mime_steal_data(SilcMime mime, SilcUInt32 *data_len)
-{
-  unsigned char *data;
-
-  if (!mime)
-    return NULL;
-
-  if (data_len)
-    *data_len = mime->data_len;
-
-  data = mime->data;
-
-  mime->data = NULL;
-  mime->data_len = 0;
-
-  return data;
-}
-
-/* Returns TRUE if partial message */
-
-SilcBool silc_mime_is_partial(SilcMime mime)
-{
-  const char *type = silc_mime_get_field(mime, "Content-Type");
-  if (!type)
-    return FALSE;
-
-  if (!strstr(type, "message/partial"))
-    return FALSE;
-
-  return TRUE;
-}
-
-/* Set as multipart message */
-
-void silc_mime_set_multipart(SilcMime mime, const char *type,
-                            const char *boundary)
-{
-  char tmp[1024];
-
-  if (!mime || !type || !boundary)
-    return;
-
-  memset(tmp, 0, sizeof(tmp));
-  silc_snprintf(tmp, sizeof(tmp) - 1, "multipart/%s; boundary=%s", type, boundary);
-  silc_mime_add_field(mime, "Content-Type", tmp);
-  silc_free(mime->boundary);
-  mime->boundary = strdup(boundary);
-
-  if (mime->multiparts)
-    return;
-  mime->multiparts = silc_dlist_init();
-}
-
-/* Add multipart */
-
-SilcBool silc_mime_add_multipart(SilcMime mime, SilcMime part)
-{
-  if (!mime || !mime->multiparts || !part)
-    return FALSE;
-
-  silc_dlist_add(mime->multiparts, part);
-  return TRUE;
-}
-
-/* Return TRUE if has multiparts */
-
-SilcBool silc_mime_is_multipart(SilcMime mime)
-{
-  if (!mime)
-    return FALSE;
-
-  return mime->multiparts != NULL;
-}
-
-/* Returns multiparts */
-
-SilcDList silc_mime_get_multiparts(SilcMime mime, const char **type)
-{
-  if (!mime)
-    return NULL;
-
-  if (type)
-    *type = (const char *)mime->multitype;
-
-  return mime->multiparts;
-}
diff --git a/lib/silcutil/silcmime.h b/lib/silcutil/silcmime.h
deleted file mode 100644 (file)
index 8bc221c..0000000
+++ /dev/null
@@ -1,405 +0,0 @@
-/*
-
-  silcmime.h
-
-  Author: Pekka Riikonen <priikone@silcnet.org>
-
-  Copyright (C) 2005 - 2006 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.
-
-*/
-
-/****h* silcutil/SILC MIME Interface
- *
- * DESCRIPTION
- *
- * Simple implementation of MIME.  Supports creation and parsing of simple
- * MIME messages, multipart MIME messages, including nested multiparts, and
- * MIME fragmentation and defragmentation.
- *
- * SILC Mime API is not thread-safe.  If the same MIME context must be
- * used in multithreaded environment concurrency control must be employed.
- *
- ***/
-
-#ifndef SILCMIME_H
-#define SILCMIME_H
-
-/****s* silcutil/SILCMIMEAPI/SilcMime
- *
- * NAME
- *
- *    typedef struct SilcMimeStruct *SilcMime;
- *
- * DESCRIPTION
- *
- *    This context is the actual MIME message and is allocated
- *    by silc_mime_alloc and given as argument to all silc_mime_*
- *    functions.  It is freed by the silc_mime_free function.
- *
- ***/
-typedef struct SilcMimeStruct *SilcMime;
-
-/****s* silcutil/SILCMIMEAPI/SilcMimeAssembler
- *
- * NAME
- *
- *    typedef struct SilcMimeAssemblerStruct *SilcMimeAssembler;
- *
- * DESCRIPTION
- *
- *    This context is a SILC MIME Assembler that is used to assemble partial
- *    MIME messages (fgraments) into complete MIME messages.  It is allocated
- *    by silc_mime_assembler_alloc and freed by silc_mime_assembler_free.
- *
- ***/
-typedef struct SilcMimeAssemblerStruct *SilcMimeAssembler;
-
-/****f* silcutil/SILCMIMEAPI/silc_mime_alloc
- *
- * SYNOPSIS
- *
- *    SilcMime silc_mime_alloc(void)
- *
- * DESCRIPTION
- *
- *    Allocates SILC Mime message context.
- *
- ***/
-SilcMime silc_mime_alloc(void);
-
-/****f* silcutil/SILCMIMEAPI/silc_mime_free
- *
- * SYNOPSIS
- *
- *    void silc_mime_alloc(SilcMime mime)
- *
- * DESCRIPTION
- *
- *    Frees `mime' context.
- *
- ***/
-void silc_mime_free(SilcMime mime);
-
-/****f* silcutil/SILCMIMEAPI/silc_mime_assembler_alloc
- *
- * SYNOPSIS
- *
- *    SilcMimeAssembler silc_mime_assembler_alloc(void);
- *
- * DESCRIPTION
- *
- *    Allocates MIME fragment assembler.
- *
- ***/
-SilcMimeAssembler silc_mime_assembler_alloc(void);
-
-/****f* silcutil/SILCMIMEAPI/silc_mime_assembler_free
- *
- * SYNOPSIS
- *
- *    void silc_mime_assembler_free(SilcMimeAssembler assembler)
- *
- * DESCRIPTION
- *
- *    Frees `assembler' context.
- *
- ***/
-void silc_mime_assembler_free(SilcMimeAssembler assembler);
-
-/****f* silcutil/SILCMIMEAPI/silc_mime_decode
- *
- * SYNOPSIS
- *
- *    SilcMime silc_mime_decode(SilcMime mime, const unsigned char *data,
- *                              SilcUInt32 data_len);
- *
- * DESCRIPTION
- *
- *    Decodes a MIME message and returns the parsed message into newly
- *    allocated SilcMime context and returns it.  If `mime' is non-NULL
- *    then the MIME message will be encoded into the pre-allocated `mime'
- *    context and same context is returned.  If it is NULL then newly
- *    allocated SilcMime context is returned.  On error NULL is returned.
- *
- * EXAMPLE
- *
- *    // Parse MIME message and get its content type
- *    mime = silc_mime_decode(NULL, data, data_len);
- *    type = silc_mime_get_field(mime, "Content-Type");
- *    ...
- *
- *    // Assemble received MIME fragment
- *    mime = silc_mime_decode(NULL, data, data_len);
- *    if (silc_mime_is_partial(mime) == TRUE)
- *      silc_mime_assmeble(assembler, mime);
- *
- ***/
-SilcMime silc_mime_decode(SilcMime mime, const unsigned char *data,
-                         SilcUInt32 data_len);
-
-/****f* silcutil/SILCMIMEAPI/silc_mime_encode
- *
- * SYNOPSIS
- *
- *    unsigned char *silc_mime_encode(SilcMime mime, SilcUInt32 *encoded_len);
- *
- * DESCRIPTION
- *
- *    Encodes the `mime' context into a raw MIME message (may be human
- *    readable).  The caller must free the returned buffer.  If the `mime'
- *    is multipart MIME message all parts will be automatically encoded
- *    as well.
- *
- *    If you want to create fragmented MIME message use the function
- *    silc_mime_encode_partial.
- *
- ***/
-unsigned char *silc_mime_encode(SilcMime mime, SilcUInt32 *encoded_len);
-
-/****f* silcutil/SILCMIMEAPI/silc_mime_assemble
- *
- * SYNOPSIS
- *
- *    SilcMime silc_mime_assemble(SilcMimeAssembler assembler,
- *                                SilcMime partial);
- *
- * DESCRIPTION
- *
- *    Processes and attempts to assemble the received MIME fragment `partial'.
- *    To check if a received MIME message is a fragment use the
- *    silc_mime_is_partial function.  Returns NULL if all fragments has not
- *    yet been received, or the newly allocated completed MIME message if
- *    all fragments were received.  The caller must free the returned
- *    SilcMime context.  The caller must not free the `partial'.
- *
- * EXAMPLE
- *
- *    // Assemble received MIME fragment
- *    mime = silc_mime_decode(data, data_len);
- *    if (silc_mime_is_partial(mime) == TRUE) {
- *      complete = silc_mime_assmeble(assembler, mime);
- *      if (complete == NULL)
- *        return;
- *      ...
- *    }
- *
- ***/
-SilcMime silc_mime_assemble(SilcMimeAssembler assembler, SilcMime partial);
-
-/****f* silcutil/SILCMIMEAPI/silc_mime_encode_partial
- *
- * SYNOPSIS
- *
- *    SilcDList silc_mime_encode_partial(SilcMime mime, int max_size);
- *
- * DESCRIPTION
- *
- *    Same as silc_mime_encode except fragments the MIME message `mime'
- *    if it is larger than `max_size' in bytes.  Returns the MIME fragments
- *    in SilcDList where each entry is SilcBuffer context.  The caller must
- *    free the returned list and all SilcBuffer entries in it by calling
- *    silc_mime_partial_free function.
- *
- *    To assemble the fragments into a complete MIME message the
- *    silc_mime_assemble can be used.
- *
- ***/
-SilcDList silc_mime_encode_partial(SilcMime mime, int max_size);
-
-/****f* silcutil/SILCMIMEAPI/silc_mime_partial_free
- *
- * SYNOPSIS
- *
- *    void silc_mime_partial_free(SilcDList partials);
- *
- * DESCRIPTION
- *
- *    This function must be called to free the list returned by the
- *    silc_mime_encode_partial function.
- *
- ***/
-void silc_mime_partial_free(SilcDList partials);
-
-/****f* silcutil/SILCMIMEAPI/silc_mime_add_field
- *
- * SYNOPSIS
- *
- *    void silc_mime_add_field(SilcMime mime,
- *                             const char *field, const char *value);
- *
- * DESCRIPTION
- *
- *    Adds a field indicated by `field' to MIME message `mime'.  The field
- *    value is `value'.
- *
- * EXAMPLE
- *
- *    silc_mime_add_field(mime, "MIME-Version", "1.0");
- *    silc_mime_add_field(mime, "Content-Type", "image/jpeg");
- *    silc_mime_add_field(mime, "Content-Transfer-Encoding", "binary");
- *
- ***/
-void silc_mime_add_field(SilcMime mime, const char *field, const char *value);
-
-/****f* silcutil/SILCMIMEAPI/silc_mime_get_field
- *
- * SYNOPSIS
- *
- *    const char *silc_mime_get_field(SilcMime mime, const char *field);
- *
- * DESCRIPTION
- *
- *    Returns the `field' value or NULL if such field does not exist in the
- *    MIME message `mime'.
- *
- ***/
-const char *silc_mime_get_field(SilcMime mime, const char *field);
-
-/****f* silcutil/SILCMIMEAPI/silc_mime_add_data
- *
- * SYNOPSIS
- *
- *    void silc_mime_add_data(SilcMime mime, const unsigned char *data,
- *                            SilcUInt32 data_len);
- *
- * DESCRIPTION
- *
- *    Adds the actual MIME data to the `mime' message.
- *
- ***/
-void silc_mime_add_data(SilcMime mime, const unsigned char *data,
-                       SilcUInt32 data_len);
-
-/****f* silcutil/SILCMIMEAPI/silc_mime_get_data
- *
- * SYNOPSIS
- *
- *    const unsigned char *
- *    silc_mime_get_data(SilcMime mime, SilcUInt32 *data_len);
- *
- * DESCRIPTION
- *
- *    Returns the MIME data from the `mime' message.
- *
- ***/
-const unsigned char *silc_mime_get_data(SilcMime mime, SilcUInt32 *data_len);
-
-/****f* silcutil/SILCMIMEAPI/silc_mime_steal_data
- *
- * SYNOPSIS
- *
- *    unsigned char *
- *    silc_mime_steal_data(SilcMime mime, SilcUInt32 *data_len);
- *
- * DESCRIPTION
- *
- *    Returns the MIME data from the `mime' message.  The data will be
- *    removed from the `mime' and the caller is responsible of freeing the
- *    returned pointer.
- *
- ***/
-unsigned char *silc_mime_steal_data(SilcMime mime, SilcUInt32 *data_len);
-
-/****f* silcutil/SILCMIMEAPI/silc_mime_is_partial
- *
- * SYNOPSIS
- *
- *    SilcBool silc_mime_is_partial(SilcMime mime);
- *
- * DESCRIPTION
- *
- *    Returns TRUE if the MIME message `mime' is a partial MIME fragment.
- *
- ***/
-SilcBool silc_mime_is_partial(SilcMime mime);
-
-/****f* silcutil/SILCMIMEAPI/silc_mime_set_multipart
- *
- * SYNOPSIS
- *
- *    void silc_mime_set_multipart(SilcMime mime, const char *type,
- *                                 const char *boundary);
- *
- * DESCRIPTION
- *
- *    Sets the `mime' to be a multipart MIME message.  The `type' specifies
- *    the multipart type, usually "mixed", but can be something else too.
- *    The `boundary' specifies the multipart boundary.
- *
- ***/
-void silc_mime_set_multipart(SilcMime mime, const char *type,
-                            const char *boundary);
-
-/****f* silcutil/SILCMIMEAPI/silc_mime_add_multipart
- *
- * SYNOPSIS
- *
- *    SilcBool silc_mime_add_multipart(SilcMime mime, SilcMime part);
- *
- * DESCRIPTION
- *
- *    Adds a multipart `part` to MIME message `mime'.  The `part' will be
- *    freed automatically when silc_mime_free is called for `mime'.  Returns
- *    TRUE if `part' was added to `mime' and FALSE if `mime' is not marked
- *    as multipart MIME message.
- *
- * NOTES
- *
- *    The silc_mime_set_multipart must be called for `mime' before parts
- *    can be added to it.  Otherwise FALSE will be returned.
- *
- * EXAMPLE
- *
- *    part = silc_mime_alloc();
- *    silc_mime_add_field(part, "Content-Type", "image/jpeg");
- *    silc_mime_add_data(part, data, data_len);
- *
- *    silc_mime_set_multipart(mime, "mixed", "boundary1");
- *    silc_mime_add_multipart(mime, part);
- *
- ***/
-SilcBool silc_mime_add_multipart(SilcMime mime, SilcMime part);
-
-/****f* silcutil/SILCMIMEAPI/silc_mime_is_multipart
- *
- * SYNOPSIS
- *
- *    SilcBool silc_mime_is_multipart(SilcMime mime);
- *
- * DESCRIPTION
- *
- *    Returns TRUE if the MIME message `mime' is a multipart MIME message.
- *    Its parts can be get by calling silc_mime_get_multiparts.
- *
- ***/
-SilcBool silc_mime_is_multipart(SilcMime mime);
-
-/****f* silcutil/SILCMIMEAPI/silc_mime_get_multiparts
- *
- * SYNOPSIS
- *
- *    SilcDList silc_mime_get_multiparts(SilcMime mime, const char **type);
- *
- * DESCRIPTION
- *
- *    Returns list of the parts from the MIME message `mime'.  Each entry
- *    in the list is SilcMime context.  The caller must not free the returned
- *    list or the SilcMime contexts in the list.  Returns NULL if no parts
- *    exists in the MIME message.  Returns the multipart type (like "mixed")
- *    into `type' pointer.
- *
- ***/
-SilcDList silc_mime_get_multiparts(SilcMime mime, const char **type);
-
-#include "silcmime_i.h"
-
-#endif /* SILCMIME_H */
diff --git a/lib/silcutil/silcmime_i.h b/lib/silcutil/silcmime_i.h
deleted file mode 100644 (file)
index 5721a5a..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
-
-  silcmime_i.h
-
-  Author: Pekka Riikonen <priikone@silcnet.org>
-
-  Copyright (C) 2005 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 SILCMIME_I_H
-#define SILCMIME_I_H
-
-#ifndef SILCMIME_H
-#error "Do not include this header directly"
-#endif
-
-/* MIME context */
-struct SilcMimeStruct {
-  SilcHashTable fields;
-  unsigned char *data;
-  SilcUInt32 data_len;
-  SilcDList multiparts;
-  char *boundary;
-  char *multitype;
-};
-
-/* MIME assembler */
-struct SilcMimeAssemblerStruct {
-  SilcHashTable fragments;
-};
-
-#endif /* SILCMIME_I_H */
diff --git a/lib/silcutil/silcmutex.h b/lib/silcutil/silcmutex.h
deleted file mode 100644 (file)
index 6e8efeb..0000000
+++ /dev/null
@@ -1,233 +0,0 @@
-/*
-
-  silcmutex.h
-
-  Author: Pekka Riikonen <priikone@silcnet.org>
-
-  Copyright (C) 2001 - 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.
-
-*/
-
-/****h* silcutil/SILC Mutex Interface
- *
- * DESCRIPTION
- *
- * Interface for mutual exclusion locks and read/write locks.  This is
- * platform independent interface for applications that need concurrency
- * control.
- *
- ***/
-
-#ifndef SILCMUTEX_H
-#define SILCMUTEX_H
-
-/****s* silcutil/SilcMutexAPI/SilcMutex
- *
- * NAME
- *
- *    typedef struct SilcMutexStruct *SilcMutex;
- *
- * DESCRIPTION
- *
- *    This context is the actual SILC Mutex and is allocated
- *    by silc_mutex_alloc and given as argument to all silc_mutex_*
- *    functions.  It is freed by the silc_mutex_free function.
- *
- ***/
-typedef struct SilcMutexStruct *SilcMutex;
-
-/****s* silcutil/SilcMutexAPI/SilcRwLock
- *
- * NAME
- *
- *    typedef struct SilcRwLockStruct *SilcRwLock;
- *
- * DESCRIPTION
- *
- *    This context is the actual SILC read/write lock and is allocated
- *    by silc_rwlock_alloc and given as argument to all silc_rwlock_*
- *    functions.  It is freed by the silc_rwlock_free function.
- *
- ***/
-typedef struct SilcRwLockStruct *SilcRwLock;
-
-/****f* silcutil/SilcMutexAPI/silc_mutex_alloc
- *
- * SYNOPSIS
- *
- *    SilcBool silc_mutex_alloc(SilcMutex *mutex);
- *
- * DESCRIPTION
- *
- *    Allocates SILC Mutex object.  The mutex object must be allocated
- *    before it can be used.  It is freed by the silc_mutex_free function.
- *    This returns TRUE and allocated mutex in to the `mutex' and FALSE
- *    on error.  If threads support is not compiled in this returns FALSE,
- *    but should not be considered as an error.
- *
- ***/
-SilcBool silc_mutex_alloc(SilcMutex *mutex);
-
-/****f* silcutil/SilcMutexAPI/silc_mutex_free
- *
- * SYNOPSIS
- *
- *    void silc_mutex_free(SilcMutex mutex);
- *
- * DESCRIPTION
- *
- *    Free SILC Mutex object and frees all allocated memory.  If `mutex'
- *    is NULL this function has no effect.
- *
- ***/
-void silc_mutex_free(SilcMutex mutex);
-
-/****f* silcutil/SilcMutexAPI/silc_mutex_lock
- *
- * SYNOPSIS
- *
- *    void silc_mutex_lock(SilcMutex mutex);
- *
- * DESCRIPTION
- *
- *    Locks the mutex. If the mutex is locked by another thread the
- *    current thread will block until the other thread has issued
- *    silc_mutex_unlock for the mutex.  If `mutex' is NULL this function
- *    has no effect.
- *
- * NOTES
- *
- *    The caller must not call silc_mutex_lock for mutex that has been
- *    already locked in the current thread.  In this case deadlock will
- *    occur.
- *
- ***/
-void silc_mutex_lock(SilcMutex mutex);
-
-/****f* silcutil/SilcMutexAPI/silc_mutex_unlock
- *
- * SYNOPSIS
- *
- *    void silc_mutex_unlock(SilcMutex mutex);
- *
- * DESCRIPTION
- *
- *    Unlocks the mutex and thus releases it for another thread that
- *    may be waiting for the lock.  If `mutex' is NULL this function
- *    has no effect.
- *
- * NOTES
- *
- *    The caller must not call the silc_mutex_unlock for an unlocked
- *    mutex or mutex not locked by the current thread.
- *
- ***/
-void silc_mutex_unlock(SilcMutex mutex);
-
-/****f* silcutil/SilcMutexAPI/silc_mutex_assert_locked
- *
- * SYNOPSIS
- *
- *    void silc_mutex_assert_locked(SilcMutex mutex);
- *
- * DESCRIPTION
- *
- *    Asserts that the `mutex' is locked.  It is fatal error if the mutex
- *    is not locked.  If debugging is not compiled in this function has
- *    no effect (SILC_DEBUG define).
- *
- ***/
-void silc_mutex_assert_locked(SilcMutex mutex);
-
-/****f* silcutil/SilcMutexAPI/silc_rwlock_alloc
- *
- * SYNOPSIS
- *
- *    SilcBool silc_rwlock_alloc(SilcRwLock *rwlock);
- *
- * DESCRIPTION
- *
- *    Allocates SILC read/write lock.  The read/write lock must be allocated
- *    before it can be used.  It is freed by the silc_rwlock_free function.
- *    This returns TRUE and allocated read/write lock in to the `rwlock' and
- *    FALSE on error.
- *
- ***/
-SilcBool silc_rwlock_alloc(SilcRwLock *rwlock);
-
-/****f* silcutil/SilcRwLockAPI/silc_rwlock_free
- *
- * SYNOPSIS
- *
- *    void silc_rwlock_free(SilcRwLock rwlock);
- *
- * DESCRIPTION
- *
- *    Free SILC Rwlock object and frees all allocated memory.  If `rwlock'
- *    is NULL this function has no effect.
- *
- ***/
-void silc_rwlock_free(SilcRwLock rwlock);
-
-/****f* silcutil/SilcRwLockAPI/silc_rwlock_rdlock
- *
- * SYNOPSIS
- *
- *    void silc_rwlock_rdlock(SilcRwLock rwlock);
- *
- * DESCRIPTION
- *
- *    Acquires read lock of the read/write lock `rwlock'.  If the `rwlock'
- *    is locked by a writer the current thread will block until the other
- *    thread has issued silc_rwlock_unlock for the `rwlock'.  This function
- *    may be called multiple times to acquire the read lock.  There must be
- *    same number of silc_rwlock_unlock calls.  If `rwlock' is NULL this
- *    function has no effect.
- *
- ***/
-void silc_rwlock_rdlock(SilcRwLock rwlock);
-
-/****f* silcutil/SilcRwLockAPI/silc_rwlock_wrlock
- *
- * SYNOPSIS
- *
- *    void silc_rwlock_wrlock(SilcRwLock rwlock);
- *
- * DESCRIPTION
- *
- *    Acquires write lock of the read/write lock `rwlock'.  If the `rwlock'
- *    is locked by a writer or a reader the current thread will block until
- *    the other thread(s) have issued silc_rwlock_unlock for the `rwlock'.
- *    A thread may acquire the write lock only once.  A deadlock may occur
- *    if thread attempts to acquire the write lock when it has already done
- *    so.  If `rwlock' is NULL this function has no effect.
- *
- ***/
-void silc_rwlock_wrlock(SilcRwLock rwlock);
-
-/****f* silcutil/SilcRwLockAPI/silc_rwlock_unlock
- *
- * SYNOPSIS
- *
- *    void silc_rwlock_unlock(SilcRwLock rwlock);
- *
- * DESCRIPTION
- *
- *    Releases the lock of the read/write lock `rwlock'.  If `rwlock' was
- *    locked by a writer this will release the writer lock.  Otherwise this
- *    releases the reader lock.  If `rwlock' is NULL this function has no
- *    effect.
- *
- ***/
-void silc_rwlock_unlock(SilcRwLock rwlock);
-
-#endif
diff --git a/lib/silcutil/silcnet.c b/lib/silcutil/silcnet.c
deleted file mode 100644 (file)
index 17c17d8..0000000
+++ /dev/null
@@ -1,632 +0,0 @@
-/*
-
-  silcnet.c
-
-  Author: Pekka Riikonen <priikone@silcnet.org>
-
-  Copyright (C) 1997 - 2006 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.
-
-*/
-/* $Id$ */
-
-#include "silc.h"
-
-/* Returns bound port from listener */
-
-SilcUInt16 *silc_net_listener_get_port(SilcNetListener listener,
-                                      SilcUInt32 *port_count)
-{
-  SilcUInt16 *ports;
-  int i;
-
-  ports = silc_calloc(listener->socks_count, sizeof(*ports));
-  if (!ports)
-    return NULL;
-
-  for (i = 0; i < listener->socks_count; i++)
-    ports[i] = silc_net_get_local_port(listener->socks[i]);
-
-  if (port_count)
-    *port_count = listener->socks_count;
-
-  return ports;
-}
-
-/* Return bound IP from listener */
-
-char **silc_net_listener_get_ip(SilcNetListener listener,
-                               SilcUInt32 *ip_count)
-{
-  char **ips = NULL, *ip;
-  int i, k;
-
-  ips = silc_calloc(listener->socks_count, sizeof(*ips));
-  if (!ips)
-    return NULL;
-
-  for (i = 0, k = 0; i < listener->socks_count; i++) {
-    if (silc_net_check_local_by_sock(listener->socks[i], NULL, &ip))
-      ips[k++] = ip;
-  }
-
-  if (ip_count)
-    *ip_count = k;
-
-  return ips;
-}
-
-/* Return bound hostname from listener */
-
-char **silc_net_listener_get_hostname(SilcNetListener listener,
-                                     SilcUInt32 *hostname_count)
-{
-  char **hs = NULL, *h;
-  int i, k;
-
-  hs = silc_calloc(listener->socks_count, sizeof(*hs));
-  if (!hs)
-    return NULL;
-
-  for (i = 0, k = 0; i < listener->socks_count; i++) {
-    if (silc_net_check_local_by_sock(listener->socks[i], &h, NULL))
-      hs[k++] = h;
-  }
-
-  if (hostname_count)
-    *hostname_count = k;
-
-  return hs;
-}
-
-static const char *silc_net_error[] = {
-  "Ok",
-  "Unknown IP address",
-  "Unknown hostname",
-  "Destination unreachable",
-  "Connection refused",
-  "Connection timeout",
-  "System out of memory",
-  "Unexpected error",
-};
-
-/* Return error as string */
-
-const char *silc_net_get_error_string(SilcNetStatus error)
-{
-  if (error < SILC_NET_OK || error > SILC_NET_ERROR)
-    return "";
-  return silc_net_error[error];
-}
-
-/* Accepts a connection from a particular socket */
-
-int silc_net_accept_connection(int sock)
-{
-  return accept(sock, 0, 0);
-}
-
-/* Sets a option for a socket. */
-
-int silc_net_set_socket_opt(int sock, int level, int option, int on)
-{
-  return setsockopt(sock, level, option, (void *)&on, sizeof(on));
-}
-
-/* Get socket options */
-
-int silc_net_get_socket_opt(int sock, int level, int option,
-                           void *optval, int *opt_len)
-{
-  return getsockopt(sock, level, option, optval, opt_len);
-}
-
-/* Checks whether IP address sent as argument is valid IPv4 address. */
-
-SilcBool silc_net_is_ip4(const char *addr)
-{
-  int count = 0;
-
-  while (*addr) {
-    if (*addr != '.' && !isdigit((int)*addr))
-      return FALSE;
-    if (*addr == '.')
-      count++;
-    addr++;
-  }
-
-  if (count != 3)
-    return FALSE;
-
-  return TRUE;
-}
-
-/* Checks whether IP address sent as argument is valid IPv6 address. */
-
-SilcBool silc_net_is_ip6(const char *addr)
-{
-  /* XXX does this work with all kinds of IPv6 addresses? */
-  while (*addr) {
-    if (*addr != ':' && !isxdigit((int)*addr))
-      return FALSE;
-    addr++;
-  }
-
-  return TRUE;
-}
-
-/* Checks whether IP address sent as argument is valid IP address. */
-
-SilcBool silc_net_is_ip(const char *addr)
-{
-  if (silc_net_is_ip4(addr))
-    return TRUE;
-  return silc_net_is_ip6(addr);
-}
-
-/* Internal context for async resolving */
-typedef struct {
-  SilcNetResolveCallback completion;
-  void *context;
-  SilcBool prefer_ipv6;
-  SilcSchedule schedule;
-  char *input;
-  char *result;
-} *SilcNetResolveContext;
-
-SILC_TASK_CALLBACK(silc_net_resolve_completion)
-{
-  SilcNetResolveContext r = (SilcNetResolveContext)context;
-
-  /* Call the completion callback */
-  if (r->completion)
-    (*r->completion)(r->result, r->context);
-
-  silc_free(r->input);
-  silc_free(r->result);
-  silc_free(r);
-}
-
-/* Thread function to resolve the address for hostname. */
-
-static void *silc_net_gethostbyname_thread(void *context)
-{
-  SilcNetResolveContext r = (SilcNetResolveContext)context;
-  SilcSchedule schedule = r->schedule;
-  char tmp[64];
-
-  if (silc_net_gethostbyname(r->input, r->prefer_ipv6, tmp, sizeof(tmp)))
-    r->result = strdup(tmp);
-
-  silc_schedule_task_add(schedule, 0, silc_net_resolve_completion, r, 0, 1,
-                        SILC_TASK_TIMEOUT);
-  silc_schedule_wakeup(schedule);
-  return NULL;
-}
-
-/* Thread function to resolve the hostname for address. */
-
-static void *silc_net_gethostbyaddr_thread(void *context)
-{
-  SilcNetResolveContext r = (SilcNetResolveContext)context;
-  SilcSchedule schedule = r->schedule;
-  char tmp[256];
-
-  if (silc_net_gethostbyaddr(r->input, tmp, sizeof(tmp)))
-    r->result = strdup(tmp);
-
-  silc_schedule_task_add(schedule, 0, silc_net_resolve_completion, r, 0, 1,
-                        SILC_TASK_TIMEOUT);
-  silc_schedule_wakeup(schedule);
-  return NULL;
-}
-
-/* Resolves IP address for hostname. */
-
-SilcBool silc_net_gethostbyname(const char *name,
-                               SilcBool prefer_ipv6, char *address,
-                               SilcUInt32 address_len)
-{
-#ifdef HAVE_IPV6
-  struct addrinfo hints, *ai, *tmp, *ip4 = NULL, *ip6 = NULL;
-
-  memset(&hints, 0, sizeof(hints));
-  hints.ai_socktype = SOCK_STREAM;
-  if (getaddrinfo(name, NULL, &hints, &ai))
-    return FALSE;
-
-  for (tmp = ai; tmp; tmp = tmp->ai_next) {
-    if (tmp->ai_family == AF_INET6) {
-      ip6 = tmp;
-      if (ip4)
-       break;
-      continue;
-    }
-    if (tmp->ai_family == AF_INET) {
-      ip4 = tmp;
-      if (ip6)
-       break;
-      continue;
-    }
-  }
-
-  tmp = (prefer_ipv6 ? (ip6 ? ip6 : ip4) : (ip4 ? ip4 : ip6));
-  if (!tmp) {
-    freeaddrinfo(ai);
-    return FALSE;
-  }
-
-  if (getnameinfo(tmp->ai_addr, tmp->ai_addrlen, address,
-                 address_len, NULL, 0, NI_NUMERICHOST)) {
-    freeaddrinfo(ai);
-    return FALSE;
-  }
-
-  freeaddrinfo(ai);
-#else
-  struct hostent *hp;
-  struct in_addr ip;
-  char *tmp;
-
-  if (silc_net_is_ip4(name)) {
-    memset(address, 0, address_len);
-    if (address_len < strlen(name))
-      return FALSE;
-    strncpy(address, name, strlen(name));
-    return TRUE;
-  }
-
-  hp = gethostbyname(name);
-  if (!hp)
-    return FALSE;
-
-  memcpy(&ip.s_addr, hp->h_addr_list[0], 4);
-  tmp = inet_ntoa(ip);
-  if (!tmp)
-    return FALSE;
-  if (address_len < strlen(tmp))
-    return FALSE;
-  memset(address, 0, address_len);
-  strncpy(address, tmp, strlen(tmp));
-#endif
-
-  return TRUE;
-}
-
-/* Resolves IP address for hostname async. */
-
-void silc_net_gethostbyname_async(const char *name,
-                                 SilcBool prefer_ipv6,
-                                 SilcSchedule schedule,
-                                 SilcNetResolveCallback completion,
-                                 void *context)
-{
-  SilcNetResolveContext r = silc_calloc(1, sizeof(*r));
-
-  r->completion = completion;
-  r->context = context;
-  r->prefer_ipv6 = prefer_ipv6;
-  r->schedule = schedule;
-  r->input = strdup(name);
-
-  silc_thread_create(silc_net_gethostbyname_thread, r, FALSE);
-}
-
-/* Resolves hostname by IP address. */
-
-SilcBool silc_net_gethostbyaddr(const char *addr, char *name,
-                               SilcUInt32 name_len)
-{
-#ifdef HAVE_IPV6
-  struct addrinfo req, *ai;
-
-  memset(&req, 0, sizeof(req));
-  req.ai_socktype = SOCK_STREAM;
-  req.ai_flags = AI_CANONNAME;
-
-  if (getaddrinfo(addr, NULL, &req, &ai))
-    return FALSE;
-  if (getnameinfo(ai->ai_addr, ai->ai_addrlen, name, name_len, NULL, 0, 0)) {
-    freeaddrinfo(ai);
-    return FALSE;
-  }
-  freeaddrinfo(ai);
-#else
-  struct hostent *hp;
-  unsigned char a[4];
-
-  if (!silc_net_addr2bin(addr, a, sizeof(a)))
-    return FALSE;
-
-  hp = gethostbyaddr(a, 4, AF_INET);
-  if (!hp)
-    return FALSE;
-  if (name_len < strlen(hp->h_name))
-    return FALSE;
-  memset(name, 0, name_len);
-  strncpy(name, hp->h_name, strlen(hp->h_name));
-#endif
-
-  return TRUE;
-}
-
-/* Resolves hostname by IP address async. */
-
-void silc_net_gethostbyaddr_async(const char *addr,
-                                 SilcSchedule schedule,
-                                 SilcNetResolveCallback completion,
-                                 void *context)
-{
-  SilcNetResolveContext r = silc_calloc(1, sizeof(*r));
-
-  r->completion = completion;
-  r->context = context;
-  r->schedule = schedule;
-  r->input = strdup(addr);
-
-  silc_thread_create(silc_net_gethostbyaddr_thread, r, FALSE);
-}
-
-#ifndef SILC_SYMBIAN
-
-/* Performs lookups for remote name and IP address. This peforms reverse
-   lookup as well to verify that the IP has FQDN. */
-
-SilcBool silc_net_check_host_by_sock(SilcSocket sock, char **hostname,
-                                    char **ip)
-{
-  char host[1024];
-  int rval, len;
-
-#ifdef HAVE_IPV6
-  struct sockaddr_storage remote;
-  char s[NI_MAXHOST];
-
-  if (hostname)
-    *hostname = NULL;
-  *ip = NULL;
-
-  SILC_LOG_DEBUG(("Resolving remote hostname and IP address"));
-
-  memset(&remote, 0, sizeof(remote));
-  memset(&s, 0, sizeof(s));
-  len = sizeof(remote);
-  rval = getpeername(sock, (struct sockaddr *)&remote, &len);
-  if (rval < 0)
-    return FALSE;
-
-  if (getnameinfo((struct sockaddr *)&remote, len, s, sizeof(s), NULL, 0,
-                 NI_NUMERICHOST))
-    return FALSE;
-
-  *ip = silc_memdup(s, strlen(s));
-  if (*ip == NULL)
-    return FALSE;
-#else
-  struct sockaddr_in remote;
-  char *host_ip;
-
-  if (hostname)
-    *hostname = NULL;
-  *ip = NULL;
-
-  SILC_LOG_DEBUG(("Resolving remote hostname and IP address"));
-
-  memset(&remote, 0, sizeof(remote));
-  len = sizeof(remote);
-  rval = getpeername(sock, (struct sockaddr *)&remote, &len);
-  if (rval < 0)
-    return FALSE;
-
-  host_ip = inet_ntoa(remote.sin_addr);
-  if (!host_ip)
-    return FALSE;
-
-  *ip = silc_memdup(host_ip, strlen(host_ip));
-  if (*ip == NULL)
-    return FALSE;
-#endif
-
-  /* Do reverse lookup if we want hostname too. */
-  if (hostname) {
-    /* Get host by address */
-    if (!silc_net_gethostbyaddr(*ip, host, sizeof(host)))
-      return FALSE;
-
-    *hostname = silc_memdup(host, strlen(host));
-    SILC_LOG_DEBUG(("Resolved hostname `%s'", *hostname));
-
-    /* Reverse */
-    if (!silc_net_gethostbyname(*hostname, TRUE, host, sizeof(host)))
-      return FALSE;
-
-    if (strcmp(*ip, host))
-      return FALSE;
-  }
-
-  SILC_LOG_DEBUG(("Resolved IP address `%s'", *ip));
-  return TRUE;
-}
-
-/* Performs lookups for local name and IP address. This peforms reverse
-   lookup as well to verify that the IP has FQDN. */
-
-SilcBool silc_net_check_local_by_sock(SilcSocket sock, char **hostname,
-                                     char **ip)
-{
-  char host[1024];
-  int rval, len;
-
-#ifdef HAVE_IPV6
-  struct sockaddr_storage local;
-  char s[NI_MAXHOST];
-
-  if (hostname)
-    *hostname = NULL;
-  *ip = NULL;
-
-  SILC_LOG_DEBUG(("Resolving local hostname and IP address"));
-
-  memset(&local, 0, sizeof(local));
-  memset(&s, 0, sizeof(s));
-  len = sizeof(local);
-  rval = getsockname(sock, (struct sockaddr *)&local, &len);
-  if (rval < 0)
-    return FALSE;
-
-  if (getnameinfo((struct sockaddr *)&local, len, s, sizeof(s), NULL, 0,
-                 NI_NUMERICHOST))
-    return FALSE;
-
-  *ip = silc_memdup(s, strlen(s));
-  if (*ip == NULL)
-    return FALSE;
-#else
-  struct sockaddr_in local;
-  char *host_ip;
-
-  if (hostname)
-    *hostname = NULL;
-  *ip = NULL;
-
-  SILC_LOG_DEBUG(("Resolving local hostname and IP address"));
-
-  memset(&local, 0, sizeof(local));
-  len = sizeof(local);
-  rval = getsockname(sock, (struct sockaddr *)&local, &len);
-  if (rval < 0)
-    return FALSE;
-
-  host_ip = inet_ntoa(local.sin_addr);
-  if (!host_ip)
-    return FALSE;
-
-  *ip = silc_memdup(host_ip, strlen(host_ip));
-  if (*ip == NULL)
-    return FALSE;
-#endif
-
-  /* Do reverse lookup if we want hostname too. */
-  if (hostname) {
-    /* Get host by address */
-    if (!silc_net_gethostbyaddr(*ip, host, sizeof(host)))
-      return FALSE;
-
-    *hostname = silc_memdup(host, strlen(host));
-    SILC_LOG_DEBUG(("Resolved hostname `%s'", *hostname));
-
-    /* Reverse */
-    if (!silc_net_gethostbyname(*hostname, TRUE, host, sizeof(host)))
-      return FALSE;
-
-    if (strcmp(*ip, host))
-      return FALSE;
-  }
-
-  SILC_LOG_DEBUG(("Resolved IP address `%s'", *ip));
-  return TRUE;
-}
-
-/* Return remote port by socket. */
-
-SilcUInt16 silc_net_get_remote_port(SilcSocket sock)
-{
-#ifdef HAVE_IPV6
-  struct sockaddr_storage remote;
-  int len;
-  char s[NI_MAXSERV];
-
-  memset(&remote, 0, sizeof(remote));
-  len = sizeof(remote);
-  if (getpeername(sock, (struct sockaddr *)&remote, &len) < 0)
-    return 0;
-
-  if (getnameinfo((struct sockaddr *)&remote, len, NULL, 0, s, sizeof(s),
-                 NI_NUMERICSERV))
-    return 0;
-
-  return atoi(s);
-#else
-  struct sockaddr_in remote;
-  int len;
-
-  memset(&remote, 0, sizeof(remote));
-  len = sizeof(remote);
-  if (getpeername(sock, (struct sockaddr *)&remote, &len) < 0)
-    return 0;
-
-  return ntohs(remote.sin_port);
-#endif
-}
-
-/* Return local port by socket. */
-
-SilcUInt16 silc_net_get_local_port(SilcSocket sock)
-{
-#ifdef HAVE_IPV6
-  struct sockaddr_storage local;
-  int len;
-  char s[NI_MAXSERV];
-
-  memset(&local, 0, sizeof(local));
-  len = sizeof(local);
-  if (getsockname(sock, (struct sockaddr *)&local, &len) < 0)
-    return 0;
-
-  if (getnameinfo((struct sockaddr *)&local, len, NULL, 0, s, sizeof(s),
-                 NI_NUMERICSERV))
-    return 0;
-
-  return atoi(s);
-#else
-  struct sockaddr_in local;
-  int len;
-
-  memset(&local, 0, sizeof(local));
-  len = sizeof(local);
-  if (getsockname(sock, (struct sockaddr *)&local, &len) < 0)
-    return 0;
-
-  return ntohs(local.sin_port);
-#endif
-}
-#endif /* !SILC_SYMBIAN */
-
-/* Return name of localhost. */
-
-char *silc_net_localhost(void)
-{
-  char hostname[256], ip_addr[64];
-
-  if (gethostname(hostname, sizeof(hostname)))
-    return NULL;
-
-  if (!silc_net_gethostbyname(hostname, TRUE, ip_addr, sizeof(ip_addr)))
-    return strdup(hostname);
-
-  silc_net_gethostbyaddr(ip_addr, hostname, sizeof(hostname));
-  return strdup(hostname);
-}
-
-/* Returns local IP address */
-
-char *silc_net_localip(void)
-{
-  char hostname[256], ip_addr[64];
-
-  if (gethostname(hostname, sizeof(hostname)))
-    return NULL;
-
-  if (!silc_net_gethostbyname(hostname, TRUE, ip_addr, sizeof(ip_addr)))
-    return NULL;
-
-  return strdup(ip_addr);
-}
diff --git a/lib/silcutil/silcnet.h b/lib/silcutil/silcnet.h
deleted file mode 100644 (file)
index f2e040b..0000000
+++ /dev/null
@@ -1,675 +0,0 @@
-/*
-
-  silcnet.h
-
-  Author: Pekka Riikonen <priikone@silcnet.org>
-
-  Copyright (C) 1997 - 2007 Pekka Riikonen
-
-  This program is free software; you can redistribute it and/or modify
-  it under the terms of the GNU General Public License as published by
-  the Free Software Foundation; version 2 of the License.
-
-  This program is distributed in the hope that it will be useful,
-  but WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-  GNU General Public License for more details.
-
-*/
-
-/****h* silcutil/SILC Net 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.
- *
- ***/
-
-#ifndef SILCNET_H
-#define SILCNET_H
-
-/* Prototypes */
-
-/****s* silcutil/SilcNetAPI/SilcNetListener
- *
- * NAME
- *
- *    typedef struct SilcNetListenerStruct *SilcNetListener;
- *
- * DESCRIPTION
- *
- *    The network listenr context.  This context is created with the
- *    silc_net_create_listener function and destroyed with
- *    silc_net_close_listener function.
- *
- ***/
-typedef struct SilcNetListenerStruct *SilcNetListener;
-
-/****d* silcutil/SilcNetAPI/SilcNetStatus
- *
- * NAME
- *
- *    typedef enum { ... } SilcNetStatus;
- *
- * DESCRIPTION
- *
- *    Status to indicate the result of the network operation creation.  This
- *    type is returned in the SilcNetCallback callback function.
- *
- * SOURCE
- */
-typedef enum {
-  SILC_NET_OK,                        /* Everything Ok */
-  SILC_NET_UNKNOWN_IP,                /* Unknown IP address */
-  SILC_NET_UNKNOWN_HOST,              /* Unknown hostname */
-  SILC_NET_HOST_UNREACHABLE,          /* Destination unreachable */
-  SILC_NET_CONNECTION_REFUSED,        /* Connection refused */
-  SILC_NET_CONNECTION_TIMEOUT,        /* Connection timedout */
-  SILC_NET_NO_MEMORY,                 /* System out of memory */
-  SILC_NET_ERROR,                     /* Unknown error */
-} SilcNetStatus;
-/***/
-
-/****f* silcutil/SilcNetAPI/SilcNetCallback
- *
- * SYNOPSIS
- *
- *    typedef void (*SilcNetCallback)(SilcNetStatus status,
- *                                    SilcStream stream, void *context);
- *
- * DESCRIPTION
- *
- *    A callback of this type is returned by silc_net_tcp_create_listener
- *    and silc_net_tcp_connect functions.  For silc_net_tcp_create_listener
- *    this callback means that new incoming connection was accepted, and the
- *    `stream' is the socket stream representing the socket connection.
- *
- *    For silc_net_tcp_connect this means that we have connected to the
- *    remote host and the `stream' is the socket stream for the socket
- *    connection.  The SILC Stream API (such as silc_stream_read, etc.) can
- *    be used to read and write to the stream.  The created stream is socket
- *    stream so various SilcSocketStream API functions can be used with
- *    the `stream'.
- *
- ***/
-typedef void (*SilcNetCallback)(SilcNetStatus status,
-                               SilcStream stream, void *context);
-
-/****f* silcutil/SilcNetAPI/silc_net_tcp_create_listener
- *
- * SYNOPSIS
- *
- *    SilcNetListener
- *    silc_net_tcp_create_listener(const char **local_ip_addr,
- *                                 SilcUInt32 local_ip_count, int port,
- *                                 SilcBool lookup, SilcBool require_fqdn,
- *                                 SilcSchedule schedule,
- *                                 SilcNetCallback callback, void *context);
- *
- * DESCRIPTION
- *
- *    This function creates TCP listener.  This is used to create network
- *    listener for incoming connections, and `callback' will be called
- *    everytime new connection is received.  If `local_ip_addr' is NULL 'any'
- *    address is used.  If provided it can be used bind the listener to
- *    `local_ip_count' many IP addresses provided in `local_ip_addr' table.
- *    On success returns the SilcNetListener context, or NULL on error.
- *    If `require_fqdn' is TRUE the listener will require that the incoming
- *    connection has FQDN to be able to connect.  If the `lookup' is TRUE
- *    then the incoming connection hostname will be resolved.  If the `port'
- *    is zero (0), operating system will define it automatically.
- *
- *    The `callback' always delivers valid new stream.  It is not called
- *    with an error status.
- *
- ***/
-SilcNetListener
-silc_net_tcp_create_listener(const char **local_ip_addr,
-                            SilcUInt32 local_ip_count, int port,
-                            SilcBool lookup, SilcBool require_fqdn,
-                            SilcSchedule schedule,
-                            SilcNetCallback callback, void *context);
-
-/****f* silcutil/SilcNetAPI/silc_net_listener_get_port
- *
- * SYNOPSIS
- *
- *    SilcUInt16 silc_net_listener_get_port(SilcNetListener listener);
- *
- * DESCRIPTION
- *
- *    Returns the ports to where the `listener' is bound.  This can be used
- *    to get the port if none was specified in silc_net_tcp_create_listener.
- *    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.
- *
- ***/
-SilcUInt16 *silc_net_listener_get_port(SilcNetListener listener,
-                                      SilcUInt32 *port_count);
-
-/****f* silcutil/SilcNetAPI/silc_net_listener_get_ip
- *
- * SYNOPSIS
- *
- *    char **silc_net_listener_get_ip(SilcNetListener listener,
- *                                    SilcUInt32 *ip_count);
- *
- * 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
- *    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
- *
- * SYNOPSIS
- *
- *    char **silc_net_listener_get_hostname(SilcNetListener listener,
- *                                          SilcUInt32 *hostname_count);
- *
- * 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.
- *
- ***/
-char **silc_net_listener_get_hostname(SilcNetListener listener,
-                                     SilcUInt32 *hostname_count);
-
-/****f* silcutil/SilcNetAPI/silc_net_close_listener
- *
- * SYNOPSIS
- *
- *    void silc_net_close_listener(SilcNetListener listener);
- *
- * DESCRIPTION
- *
- *    Closes the network listener indicated by `listener'.
- *
- ***/
-void silc_net_close_listener(SilcNetListener listener);
-
-/****f* silcutil/SilcNetAPI/silc_net_tcp_connect
- *
- * SYNOPSIS
- *
- *    SilcAsyncOperation silc_net_tcp_connect(const char *local_ip_addr,
- *                                            const char *remote_ip_addr,
- *                                            int remote_port,
- *                                            SilcSchedule schedule,
- *                                            SilcNetCallback callback,
- *                                            void *context);
- *
- * DESCRIPTION
- *
- *    Creates TCP/IP connection to the remote host indicated by `remote_host'
- *    which may be hostname or IP address, on the port indicated by
- *    `remote_port'.  If the `local_ip_addr' is provided the local host is
- *    bound to that address before creating the connection.  This is
- *    asynchronous call, and this function returns before the connection is
- *    actually established.  The `callback' will be called after the
- *    connection is created to deliver the SilcStream for the created
- *    connection.  This function supports IPv6 if the platform supports it.
- *
- *    The returned SilcAsyncOperation context can be used to control the
- *    asynchronous connecting, such as to abort it.  If it is aborted
- *    using silc_async_abort the `callback' will not be called.  If NULL
- *    is returned the operation cannot be aborted.
- *
- ***/
-SilcAsyncOperation silc_net_tcp_connect(const char *local_ip_addr,
-                                       const char *remote_ip_addr,
-                                       int remote_port,
-                                       SilcSchedule schedule,
-                                       SilcNetCallback callback,
-                                       void *context);
-
-/****f* silcutil/SilcNetAPI/silc_net_udp_connect
- *
- * SYNOPSIS
- *
- *    SilcStream
- *    silc_net_udp_connect(const char *local_ip_addr, int local_port,
- *                         const char *remote_ip_addr, int remote_port,
- *                         SilcSchedule schedule);
- *
- * DESCRIPTION
- *
- *    This function creates UDP stream.  The UDP stream is bound to the
- *    `local_ip_addr' if it is specified.  If `local_port' is non-zero the
- *    stream is bound to that port.  If the `remote_ip_addr' and `remote_port'
- *    is also provided, packets may be sent to that address using
- *    silc_stream_write function and packets may be received using
- *    silc_stream_read function.
- *
- *    If the remote address is not provided the stream is in connectionless
- *    state.  This means that packets can be received only by using
- *    silc_net_udp_receive and sent only by using the function
- *    silc_net_udp_send.
- *
- *    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
- *    provided, and silc_net_udp_receive if it was not.
- *
- *    Supports IPv6 if the platform supports it.
- *
- * EXAMPLE
- *
- *    SilcStream udpstream;
- *
- *    // Create UDP stream and prepare to receive packets
- *    udpstream = silc_net_udp_connect("10.2.1.7", 5000,
- *                                     "10.2.1.100, 5000, schedule);
- *    silc_stream_set_notifier(udpstream, schedule, receive_callback, context);
- *
- *    // Send packet to remote host
- *    silc_stream_write(udpstream, data, data_len);
- *
- *    Create UDP listener:
- *
- *    udpstream = silc_net_udp_connect("0.0.0.0", 500, NULL, 0, schedule);
- *    silc_stream_set_notifier(udpstream, schedule, receive_callback, context);
- *
- ***/
-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
- *
- * SYNOPSIS
- *
- *    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)
- *
- * DESCRIPTION
- *
- *    Receive a UDP packet from the `stream'.  The IP address and port of
- *    the sender is returned into `remote_ip_addr' buffer and `remote_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.
- *
- ***/
-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
- *
- * SYNOPSIS
- *
- *    int silc_net_udp_send(SilcStream stream,
- *                          const char *remote_ip_addr, int remote_port,
- *                          const unsigned char *data, SilcUInt32 data_len);
- *
- * DESCRIPTION
- *
- *    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.
- *
- *    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
- *    notifier callback will later be called with SILC_STREAM_CAN_WRITE
- *    status when stream is again ready for writing.
- *
- ***/
-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_get_error_string
- *
- * SYNOPSIS
- *
- *    const char silc_net_get_error_string(SilcNetStatus error);
- *
- * DESCRIPTION
- *
- *    Return `error' as a string.
- *
- ***/
-const char *silc_net_get_error_string(SilcNetStatus error);
-
-/****f* silcutil/SilcNetAPI/silc_net_close_connection
- *
- * SYNOPSIS
- *
- *    void silc_net_close_connection(int sock);
- *
- * DESCRIPTION
- *
- *    Closes the connection by closing the socket connection.  This routine
- *    can only be used with POSIX compliant systems.
- *
- ***/
-void silc_net_close_connection(int sock);
-
-/****f* silcutil/SilcNetAPI/silc_net_accept_connection
- *
- * SYNOPSIS
- *
- *    int silc_net_accept_connection(int sock);
- *
- * DESCRIPTION
- *
- *    Accepts a connection from a particular socket.  This routine can only
- *    be used with POSIX compliant systems.  This call is equivalent to
- *    accept(2).
- *
- ***/
-int silc_net_accept_connection(int sock);
-
-/****f* silcutil/SilcNetAPI/silc_net_set_socket_opt
- *
- * SYNOPSIS
- *
- *    int silc_net_set_socket_opt(int sock, int level, int option, int on);
- *
- * DESCRIPTION
- *
- *    Sets a option for a socket.  This function can be used to set
- *    various options for the socket.  Some of the options might be
- *    system specific.  This routine can only be used with POSIX compliant
- *    systems.  This call is equivalent to setsockopt(2);
- *
- ***/
-int silc_net_set_socket_opt(int sock, int level, int option, int on);
-
-/****f* silcutil/SilcNetAPI/silc_net_get_socket_opt
- *
- * SYNOPSIS
- *
- *    int silc_net_get_socket_opt(int sock, int level, int option,
- *                                void *optval, int *opt_len);
- *
- * DESCRIPTION
- *
- *    Return socket options to the `optval' and `opt_len'.  This routine
- *    can only be used with POSIX compliant systems.  This call is
- *    equivalent to getsockopt(2).
- *
- ***/
-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
- *
- * SYNOPSIS
- *
- *    int silc_net_set_socket_nonblock(SilcSocket sock);
- *
- * DESCRIPTION
- *
- *    Sets the socket `sock' to non-blocking mode.
- *
- ***/
-int silc_net_set_socket_nonblock(SilcSocket sock);
-
-/****f* silcutil/SilcNetAPI/silc_net_is_ip4
- *
- * SYNOPSIS
- *
- *    SilcBool silc_net_is_ip4(const char *addr);
- *
- * DESCRIPTION
- *
- *    Checks whether IP address sent as argument is valid IPv4 address.
- *
- ***/
-SilcBool silc_net_is_ip4(const char *addr);
-
-/****f* silcutil/SilcNetAPI/silc_net_is_ip6
- *
- * SYNOPSIS
- *
- *    SilcBool silc_net_is_ip6(const char *addr);
- *
- * DESCRIPTION
- *
- *    Checks whether IP address sent as argument is valid IPv6 address.
- *
- ***/
-SilcBool silc_net_is_ip6(const char *addr);
-
-/****f* silcutil/SilcNetAPI/silc_net_is_ip
- *
- * SYNOPSIS
- *
- *    SilcBool silc_net_is_ip(const char *addr);
- *
- * DESCRIPTION
- *
- *    Checks whether IP address sent as argument is valid IP address.
- *    This supports both IPv4 and IPv6 addresses.
- *
- ***/
-SilcBool silc_net_is_ip(const char *addr);
-
-/****f* silcutil/SilcNetAPI/silc_net_addr2bin
- *
- * SYNOPSIS
- *
- *    SilcBool silc_net_addr2bin(const char *addr, void *bin,
- *                               SilcUInt32 bin_len);
- *
- * DESCRIPTION
- *
- *    Converts the IP number string from numbers-and-dots notation to
- *    binary form in network byte order.  The address can be either
- *    IPv4 or IPv6 address.
- *
- ***/
-SilcBool silc_net_addr2bin(const char *addr, void *bin, SilcUInt32 bin_len);
-
-/****f* silcutil/SilcNetAPI/SilcNetResolveCallback
- *
- * SYNOPSIS
- *
- *    typedef void (*SilcNetResolveCallback)(const char *result,
- *                                           void *context);
- *
- * DESCRIPTION
- *
- *    A callback function of this type is called after the asynchronous
- *    resolving operation has been completed.  This callback is used
- *    when asynchronously resolving IP addresses and hostnames.
- *
- ***/
-typedef void (*SilcNetResolveCallback)(const char *result, void *context);
-
-/****f* silcutil/SilcNetAPI/silc_net_gethostbyname
- *
- * SYNOPSIS
- *
- *    SilcBool silc_net_gethostbyname(const char *name, SilcBool prefer_ipv6,
- *                                    char *address, SilcUInt32 address_len);
- *
- * DESCRIPTION
- *
- *    Resolves the IP address of the hostname indicated by the `name'.
- *    This returns TRUE and the IP address of the host to the `address'
- *    buffer, or FALSE if the address could not be resolved.  This is
- *    synchronous function and will block the calling process.  If the
- *    `prefer_ipv6' is TRUE then this will return IPv6 address if it
- *    finds.  If FALSE if returns IPv4 address even if it found IPv6
- *    address also.
- *
- ***/
-SilcBool silc_net_gethostbyname(const char *name, SilcBool prefer_ipv6,
-                               char *address, SilcUInt32 address_len);
-
-/****f* silcutil/SilcNetAPI/silc_net_gethostbyname_async
- *
- * SYNOPSIS
- *
- *    void silc_net_gethostbyname_async(const char *name,
- *                                      SilcBool prefer_ipv6,
- *                                      SilcSchedule schedule,
- *                                      SilcNetResolveCallback completion,
- *                                      void *context)
- *
- * DESCRIPTION
- *
- *    Asynchronously resolves the IP address of the hostname indicated
- *    by the `name'.  This function returns immediately, and the
- *    `completion' callback will be called after the resolving is
- *    completed.
- *
- *    If the `prefer_ipv6' is TRUE then this will return IPv6 address if it
- *    finds.  If FALSE if returns IPv4 address even if it found IPv6
- *    address also.
- *
- ***/
-void silc_net_gethostbyname_async(const char *name,
-                                 SilcBool prefer_ipv6,
-                                 SilcSchedule schedule,
-                                 SilcNetResolveCallback completion,
-                                 void *context);
-
-/****f* silcutil/SilcNetAPI/silc_net_gethostbyaddr
- *
- * SYNOPSIS
- *
- *   SilcBool silc_net_gethostbyaddr(const char *addr, char *name,
- *                                   SilcUInt32 name_len);
- *
-x * DESCRIPTION
- *
- *    Resolves the hostname for the IP address indicated by the `addr'
- *    This returns TRUE and the resolved hostname to the `name' buffer,
- *    or FALSE on error. The `addr' may be either IPv4 or IPv6 address.
- *    This is synchronous function and will block the calling process.
- *
- ***/
-SilcBool silc_net_gethostbyaddr(const char *addr, char *name,
-                               SilcUInt32 name_len);
-
-/****f* silcutil/SilcNetAPI/silc_net_gethostbyaddr_async
- *
- * SYNOPSIS
- *
- *    void silc_net_gethostbyaddr_async(const char *addr,
- *                                      SilcSchedule schedule,
- *                                      SilcNetResolveCallback completion,
- *                                      void *context)
- *
- * DESCRIPTION
- *
- *    Asynchronously resolves the hostname for the IP address indicated
- *    by the `addr'.  This function returns immediately, and the
- *    `completion' callback will be called after the resolving is
- *    completed.
- *
- ***/
-void silc_net_gethostbyaddr_async(const char *addr,
-                                 SilcSchedule schedule,
-                                 SilcNetResolveCallback completion,
-                                 void *context);
-
-/****f* silcutil/SilcNetAPI/silc_net_check_host_by_sock
- *
- * SYNOPSIS
- *
- *    SilcBool silc_net_check_host_by_sock(SilcSocket sock, char **hostname,
- *                                         char **ip);
- *
- * DESCRIPTION
- *
- *    Performs lookups for remote name and IP address. This peforms reverse
- *    lookup as well to verify that the IP has FQDN.
- *
- ***/
-SilcBool silc_net_check_host_by_sock(SilcSocket sock, char **hostname,
-                                    char **ip);
-
-/****f* silcutil/SilcNetAPI/silc_net_check_local_by_sock
- *
- * SYNOPSIS
- *
- *    SilcBool silc_net_check_local_by_sock(SilcSocket sock, char **hostname,
- *                                          char **ip);
- *
- * DESCRIPTION
- *
- *    Performs lookups for local name and IP address. This peforms reverse
- *    lookup as well to verify that the IP has FQDN.
- *
- ***/
-SilcBool silc_net_check_local_by_sock(SilcSocket sock, char **hostname,
-                                     char **ip);
-
-/****f* silcutil/SilcNetAPI/silc_net_get_remote_port
- *
- * SYNOPSIS
- *
- *    SilcUInt16 silc_net_get_remote_port(SilcSocket sock);
- *
- * DESCRIPTION
- *
- *    Return remote port by socket.
- *
- ***/
-SilcUInt16 silc_net_get_remote_port(SilcSocket sock);
-
-/****f* silcutil/SilcNetAPI/silc_net_get_local_port
- *
- * SYNOPSIS
- *
- *    SilcUInt16 silc_net_get_local_port(SilcSocket sock);
- *
- * DESCRIPTION
- *
- *    Return local port by socket.
- *
- ***/
-SilcUInt16 silc_net_get_local_port(SilcSocket sock);
-
-/****f* silcutil/SilcNetAPI/silc_net_localhost
- *
- * SYNOPSIS
- *
- *    char *silc_net_localhost(void);
- *
- * DESCRIPTION
- *
- *    Return name of localhost.  This will also attempt to resolve
- *    the real hostname by the local host's IP address.  If unsuccessful
- *    the first found hostname is returned.  The caller must free
- *    returned hostname.
- *
- ***/
-char *silc_net_localhost(void);
-
-/****f* silcutil/SilcNetAPI/silc_net_localip
- *
- * SYNOPSIS
- *
- *    char *silc_net_localip(void)
- *
- * DESCRIPTION
- *
- *    Return IP of localhost.  The caller must free the returned IP.
- *
- ***/
-char *silc_net_localip(void);
-
-#include "silcnet_i.h"
-
-#endif /* SILCNET_H */
diff --git a/lib/silcutil/silcnet_i.h b/lib/silcutil/silcnet_i.h
deleted file mode 100644 (file)
index a5ec103..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
-
-  silcnet_i.h
-
-  Author: Pekka Riikonen <priikone@silcnet.org>
-
-  Copyright (C) 2005 - 2006 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 SILCNET_I_H
-#define SILCNET_I_H
-
-#ifndef SILCNET_H
-#error "Do not include this header directly"
-#endif
-
-/* Net listener context */
-struct SilcNetListenerStruct {
-  SilcSchedule schedule;
-  SilcNetCallback callback;
-  void *context;
-  SilcSocket *socks;
-  unsigned int socks_count   : 30;
-  unsigned int require_fqdn  : 1;
-  unsigned int lookup        : 1;
-};
-
-#endif /* SILCNET_I_H */
diff --git a/lib/silcutil/silcschedule.c b/lib/silcutil/silcschedule.c
deleted file mode 100644 (file)
index 6c2f78c..0000000
+++ /dev/null
@@ -1,997 +0,0 @@
-/*
-
-  silcschedule.c
-
-  Author: Pekka Riikonen <priikone@silcnet.org>
-
-  Copyright (C) 1998 - 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.
-
-*/
-/* $Id$ */
-
-#include "silc.h"
-
-/************************** Types and definitions ***************************/
-
-/* Platform specific implementation */
-extern const SilcScheduleOps schedule_ops;
-
-static void silc_schedule_task_remove(SilcSchedule schedule, SilcTask task);
-static void silc_schedule_dispatch_fd(SilcSchedule schedule);
-static void silc_schedule_dispatch_timeout(SilcSchedule schedule,
-                                          SilcBool dispatch_all);
-
-
-/************************ Static utility functions **************************/
-
-/* Fd task hash table destructor */
-
-static void silc_schedule_fd_destructor(void *key, void *context,
-                                       void *user_context)
-{
-  silc_free(context);
-}
-
-/* Executes file descriptor tasks. Invalid tasks are removed here. */
-
-static void silc_schedule_dispatch_fd(SilcSchedule schedule)
-{
-  SilcTaskFd task;
-  SilcTask t;
-
-  /* The dispatch list includes only valid tasks, and tasks that have
-     something to dispatch.  Dispatching is atomic; no matter if another
-     thread invalidates a task when we unlock, we dispatch to completion. */
-  SILC_SCHEDULE_UNLOCK(schedule);
-  silc_list_start(schedule->fd_dispatch);
-  while ((task = silc_list_get(schedule->fd_dispatch))) {
-    t = (SilcTask)task;
-
-    /* Is the task ready for reading */
-    if (task->revents & SILC_TASK_READ)
-      t->callback(schedule, schedule->app_context, SILC_TASK_READ,
-                 task->fd, t->context);
-
-    /* Is the task ready for writing */
-    if (t->valid && task->revents & SILC_TASK_WRITE)
-      t->callback(schedule, schedule->app_context, SILC_TASK_WRITE,
-                 task->fd, t->context);
-  }
-  SILC_SCHEDULE_LOCK(schedule);
-
-  /* Remove invalidated tasks */
-  silc_list_start(schedule->fd_dispatch);
-  while ((task = silc_list_get(schedule->fd_dispatch)))
-    if (silc_unlikely(!task->header.valid))
-      silc_schedule_task_remove(schedule, (SilcTask)task);
-}
-
-/* Executes all tasks whose timeout has expired. The task is removed from
-   the task queue after the callback function has returned. Also, invalid
-   tasks are removed here. */
-
-static void silc_schedule_dispatch_timeout(SilcSchedule schedule,
-                                          SilcBool dispatch_all)
-{
-  SilcTask t;
-  SilcTaskTimeout task;
-  struct timeval curtime;
-  int count = 0;
-
-  SILC_LOG_DEBUG(("Running timeout tasks"));
-
-  silc_gettimeofday(&curtime);
-
-  /* First task in the task queue has always the earliest timeout. */
-  silc_list_start(schedule->timeout_queue);
-  task = silc_list_get(schedule->timeout_queue);
-  if (silc_unlikely(!task))
-    return;
-  do {
-    t = (SilcTask)task;
-
-    /* Remove invalid task */
-    if (silc_unlikely(!t->valid)) {
-      silc_schedule_task_remove(schedule, t);
-      continue;
-    }
-
-    /* Execute the task if the timeout has expired */
-    if (silc_compare_timeval(&task->timeout, &curtime) > 0 && !dispatch_all)
-      break;
-
-    t->valid = FALSE;
-    SILC_SCHEDULE_UNLOCK(schedule);
-    t->callback(schedule, schedule->app_context, SILC_TASK_EXPIRE, 0,
-               t->context);
-    SILC_SCHEDULE_LOCK(schedule);
-
-    /* Remove the expired task */
-    silc_schedule_task_remove(schedule, t);
-
-    /* Balance when we have lots of small timeouts */
-    if (silc_unlikely((++count) > 40))
-      break;
-  } while (silc_likely((task = silc_list_get(schedule->timeout_queue))));
-}
-
-/* Calculates next timeout. This is the timeout value when at earliest some
-   of the timeout tasks expire. If this is in the past, they will be
-   dispatched now. */
-
-static void silc_schedule_select_timeout(SilcSchedule schedule)
-{
-  SilcTask t;
-  SilcTaskTimeout task;
-  struct timeval curtime;
-  SilcBool dispatch = TRUE;
-
-  /* Get the current time */
-  silc_gettimeofday(&curtime);
-  schedule->has_timeout = FALSE;
-
-  /* First task in the task queue has always the earliest timeout. */
-  silc_list_start(schedule->timeout_queue);
-  task = silc_list_get(schedule->timeout_queue);
-  if (silc_unlikely(!task))
-    return;
-  do {
-    t = (SilcTask)task;
-
-    /* Remove invalid task */
-    if (silc_unlikely(!t->valid)) {
-      silc_schedule_task_remove(schedule, t);
-      continue;
-    }
-
-    /* If the timeout is in past, we will run the task and all other
-       timeout tasks from the past. */
-    if (silc_compare_timeval(&task->timeout, &curtime) <= 0 && dispatch) {
-      silc_schedule_dispatch_timeout(schedule, FALSE);
-      if (silc_unlikely(!schedule->valid))
-       return;
-
-      /* Start selecting new timeout again after dispatch */
-      silc_list_start(schedule->timeout_queue);
-      dispatch = FALSE;
-      continue;
-    }
-
-    /* Calculate the next timeout */
-    curtime.tv_sec = task->timeout.tv_sec - curtime.tv_sec;
-    curtime.tv_usec = task->timeout.tv_usec - curtime.tv_usec;
-    if (curtime.tv_sec < 0)
-      curtime.tv_sec = 0;
-
-    /* We wouldn't want to go under zero, check for it. */
-    if (curtime.tv_usec < 0) {
-      curtime.tv_sec -= 1;
-      if (curtime.tv_sec < 0)
-       curtime.tv_sec = 0;
-      curtime.tv_usec += 1000000L;
-    }
-    break;
-  } while ((task = silc_list_get(schedule->timeout_queue)));
-
-  /* Save the timeout */
-  if (task) {
-    schedule->timeout = curtime;
-    schedule->has_timeout = TRUE;
-    SILC_LOG_DEBUG(("timeout: sec=%d, usec=%d", schedule->timeout.tv_sec,
-                   schedule->timeout.tv_usec));
-  }
-}
-
-/* Removes task from the scheduler.  This must be called with scheduler
-   locked. */
-
-static void silc_schedule_task_remove(SilcSchedule schedule, SilcTask task)
-{
-  SilcTaskFd ftask;
-
-  if (silc_unlikely(task == SILC_ALL_TASKS)) {
-    SilcTask task;
-    SilcHashTableList htl;
-    void *fd;
-
-    /* Delete from fd queue */
-    silc_hash_table_list(schedule->fd_queue, &htl);
-    while (silc_hash_table_get(&htl, &fd, (void *)&task))
-      silc_hash_table_del(schedule->fd_queue, fd);
-    silc_hash_table_list_reset(&htl);
-
-    /* Delete from timeout queue */
-    silc_list_start(schedule->timeout_queue);
-    while ((task = silc_list_get(schedule->timeout_queue))) {
-      silc_list_del(schedule->timeout_queue, task);
-      silc_free(task);
-    }
-
-    return;
-  }
-
-  if (silc_likely(task->type == 1)) {
-    /* Delete from timeout queue */
-    silc_list_del(schedule->timeout_queue, task);
-
-    /* Put to free list */
-    silc_list_add(schedule->free_tasks, task);
-  } else {
-    /* Delete from fd queue */
-    ftask = (SilcTaskFd)task;
-    silc_hash_table_del(schedule->fd_queue, SILC_32_TO_PTR(ftask->fd));
-  }
-}
-
-/* Timeout freelist garbage collection */
-
-SILC_TASK_CALLBACK(silc_schedule_timeout_gc)
-{
-  SilcTaskTimeout t;
-  int c;
-
-  if (!schedule->valid)
-    return;
-
-  SILC_LOG_DEBUG(("Timeout freelist garbage collection"));
-
-  SILC_SCHEDULE_LOCK(schedule);
-
-  if (silc_list_count(schedule->free_tasks) <= 10) {
-    SILC_SCHEDULE_UNLOCK(schedule);
-    silc_schedule_task_add_timeout(schedule, silc_schedule_timeout_gc,
-                                  schedule, 3600, 0);
-    return;
-  }
-  if (silc_list_count(schedule->timeout_queue) >
-      silc_list_count(schedule->free_tasks)) {
-    SILC_SCHEDULE_UNLOCK(schedule);
-    silc_schedule_task_add_timeout(schedule, silc_schedule_timeout_gc,
-                                  schedule, 3600, 0);
-    return;
-  }
-
-  c = silc_list_count(schedule->free_tasks) / 2;
-  if (c > silc_list_count(schedule->timeout_queue))
-    c = (silc_list_count(schedule->free_tasks) -
-        silc_list_count(schedule->timeout_queue));
-  if (silc_list_count(schedule->free_tasks) - c < 10)
-    c -= (10 - (silc_list_count(schedule->free_tasks) - c));
-
-  SILC_LOG_DEBUG(("Freeing %d unused tasks, leaving %d", c,
-                 silc_list_count(schedule->free_tasks) - c));
-
-  silc_list_start(schedule->free_tasks);
-  while ((t = silc_list_get(schedule->free_tasks)) && c-- > 0) {
-    silc_list_del(schedule->free_tasks, t);
-    silc_free(t);
-  }
-  silc_list_start(schedule->free_tasks);
-
-  SILC_SCHEDULE_UNLOCK(schedule);
-
-  silc_schedule_task_add_timeout(schedule, silc_schedule_timeout_gc,
-                                schedule, 3600, 0);
-}
-
-#ifdef SILC_DIST_INPLACE
-/* Print schedule statistics to stdout */
-
-void silc_schedule_stats(SilcSchedule schedule)
-{
-  SilcTaskFd ftask;
-  fprintf(stdout, "Schedule %p statistics:\n\n", schedule);
-  fprintf(stdout, "Num FD tasks         : %lu (%lu bytes allocated)\n",
-         silc_hash_table_count(schedule->fd_queue),
-         sizeof(*ftask) * silc_hash_table_count(schedule->fd_queue));
-  fprintf(stdout, "Num Timeout tasks    : %d (%d bytes allocated)\n",
-         silc_list_count(schedule->timeout_queue),
-         sizeof(struct SilcTaskTimeoutStruct) *
-         silc_list_count(schedule->timeout_queue));
-  fprintf(stdout, "Num Timeout freelist : %d (%d bytes allocated)\n",
-         silc_list_count(schedule->free_tasks),
-         sizeof(struct SilcTaskTimeoutStruct) *
-         silc_list_count(schedule->free_tasks));
-}
-#endif /* SILC_DIST_INPLACE */
-
-/****************************** Public API **********************************/
-
-/* Initializes the scheduler. This returns the scheduler context that
-   is given as arugment usually to all silc_schedule_* functions.
-   The `max_tasks' indicates the number of maximum tasks that the
-   scheduler can handle. The `app_context' is application specific
-   context that is delivered to task callbacks. */
-
-SilcSchedule silc_schedule_init(int max_tasks, void *app_context)
-{
-  SilcSchedule schedule;
-
-  SILC_LOG_DEBUG(("Initializing scheduler"));
-
-  schedule = silc_calloc(1, sizeof(*schedule));
-  if (!schedule)
-    return NULL;
-
-  schedule->fd_queue =
-    silc_hash_table_alloc(0, silc_hash_uint, NULL, NULL, NULL,
-                         silc_schedule_fd_destructor, NULL, TRUE);
-  if (!schedule->fd_queue) {
-    silc_free(schedule);
-    return NULL;
-  }
-
-  silc_list_init(schedule->timeout_queue, struct SilcTaskStruct, next);
-  silc_list_init(schedule->free_tasks, struct SilcTaskStruct, next);
-
-  schedule->app_context = app_context;
-  schedule->valid = TRUE;
-  schedule->max_tasks = max_tasks;
-
-  /* Allocate scheduler lock */
-  silc_mutex_alloc(&schedule->lock);
-
-  /* Initialize the platform specific scheduler. */
-  schedule->internal = schedule_ops.init(schedule, app_context);
-  if (!schedule->internal) {
-    silc_hash_table_free(schedule->fd_queue);
-    silc_mutex_free(schedule->lock);
-    silc_free(schedule);
-    return NULL;
-  }
-
-  /* Timeout freelist garbage collection */
-  silc_schedule_task_add_timeout(schedule, silc_schedule_timeout_gc,
-                                schedule, 3600, 0);
-
-  return schedule;
-}
-
-/* Uninitializes the schedule. This is called when the program is ready
-   to end. This removes all tasks and task queues. Returns FALSE if the
-   scheduler could not be uninitialized. This happens when the scheduler
-   is still valid and silc_schedule_stop has not been called. */
-
-SilcBool silc_schedule_uninit(SilcSchedule schedule)
-{
-  SilcTask task;
-
-  SILC_LOG_DEBUG(("Uninitializing scheduler"));
-
-  if (schedule->valid == TRUE)
-    return FALSE;
-
-  /* Dispatch all timeouts before going away */
-  SILC_SCHEDULE_LOCK(schedule);
-  silc_schedule_dispatch_timeout(schedule, TRUE);
-  SILC_SCHEDULE_UNLOCK(schedule);
-
-  /* Deliver signals before going away */
-  if (schedule->signal_tasks) {
-    schedule_ops.signals_call(schedule, schedule->internal);
-    schedule->signal_tasks = FALSE;
-  }
-
-  /* Unregister all tasks */
-  silc_schedule_task_del(schedule, SILC_ALL_TASKS);
-  silc_schedule_task_remove(schedule, SILC_ALL_TASKS);
-
-  /* Delete timeout task freelist */
-  silc_list_start(schedule->free_tasks);
-  while ((task = silc_list_get(schedule->free_tasks)))
-    silc_free(task);
-
-  /* Unregister all task queues */
-  silc_hash_table_free(schedule->fd_queue);
-
-  /* Uninit the platform specific scheduler. */
-  schedule_ops.uninit(schedule, schedule->internal);
-
-  silc_mutex_free(schedule->lock);
-  silc_free(schedule);
-
-  return TRUE;
-}
-
-/* Stops the schedule even if it is not supposed to be stopped yet.
-   After calling this, one should call silc_schedule_uninit (after the
-   silc_schedule has returned). */
-
-void silc_schedule_stop(SilcSchedule schedule)
-{
-  SILC_LOG_DEBUG(("Stopping scheduler"));
-  SILC_SCHEDULE_LOCK(schedule);
-  schedule->valid = FALSE;
-  SILC_SCHEDULE_UNLOCK(schedule);
-}
-
-/* Runs the scheduler once and then returns.   Must be called locked. */
-
-static SilcBool silc_schedule_iterate(SilcSchedule schedule, int timeout_usecs)
-{
-  struct timeval timeout;
-  int ret;
-
-  do {
-    SILC_LOG_DEBUG(("In scheduler loop"));
-
-    /* Deliver signals if any has been set to be called */
-    if (silc_unlikely(schedule->signal_tasks)) {
-      SILC_SCHEDULE_UNLOCK(schedule);
-      schedule_ops.signals_call(schedule, schedule->internal);
-      schedule->signal_tasks = FALSE;
-      SILC_SCHEDULE_LOCK(schedule);
-    }
-
-    /* Check if scheduler is valid */
-    if (silc_unlikely(schedule->valid == FALSE)) {
-      SILC_LOG_DEBUG(("Scheduler not valid anymore, exiting"));
-      return FALSE;
-    }
-
-    /* Calculate next timeout for silc_select().  This is the timeout value
-       when at earliest some of the timeout tasks expire.  This may dispatch
-       already expired timeouts. */
-    silc_schedule_select_timeout(schedule);
-
-    /* Check if scheduler is valid */
-    if (silc_unlikely(schedule->valid == FALSE)) {
-      SILC_LOG_DEBUG(("Scheduler not valid anymore, exiting"));
-      return FALSE;
-    }
-
-    if (timeout_usecs >= 0) {
-      timeout.tv_sec = 0;
-      timeout.tv_usec = timeout_usecs;
-      schedule->timeout = timeout;
-      schedule->has_timeout = TRUE;
-    }
-
-    /* This is the main silc_select(). The program blocks here until some
-       of the selected file descriptors change status or the selected
-       timeout expires. */
-    SILC_LOG_DEBUG(("Select"));
-    ret = schedule_ops.schedule(schedule, schedule->internal);
-
-    if (silc_likely(ret == 0)) {
-      /* Timeout */
-      SILC_LOG_DEBUG(("Running timeout tasks"));
-      if (silc_likely(silc_list_count(schedule->timeout_queue)))
-       silc_schedule_dispatch_timeout(schedule, FALSE);
-      continue;
-
-    } else if (silc_likely(ret > 0)) {
-      /* There is some data available now */
-      SILC_LOG_DEBUG(("Running fd tasks"));
-      silc_schedule_dispatch_fd(schedule);
-
-      /* If timeout was very short, dispatch also timeout tasks */
-      if (schedule->has_timeout && schedule->timeout.tv_sec == 0 &&
-         schedule->timeout.tv_usec < 50000)
-       silc_schedule_dispatch_timeout(schedule, FALSE);
-      continue;
-
-    } else {
-      /* Error or special case handling */
-      if (errno == EINTR)
-       continue;
-      if (ret == -2)
-       break;
-
-      SILC_LOG_ERROR(("Error in select()/poll(): %s", strerror(errno)));
-      continue;
-    }
-  } while (timeout_usecs == -1);
-
-  return TRUE;
-}
-
-/* Runs the scheduler once and then returns. */
-
-SilcBool silc_schedule_one(SilcSchedule schedule, int timeout_usecs)
-{
-  SilcBool ret;
-  SILC_SCHEDULE_LOCK(schedule);
-  ret = silc_schedule_iterate(schedule, timeout_usecs);
-  SILC_SCHEDULE_UNLOCK(schedule);
-  return ret;
-}
-
-/* Runs the scheduler and blocks here.  When this returns the scheduler
-   has ended. */
-
-#ifndef SILC_SYMBIAN
-void silc_schedule(SilcSchedule schedule)
-{
-  SILC_LOG_DEBUG(("Running scheduler"));
-
-  /* Start the scheduler loop */
-  SILC_SCHEDULE_LOCK(schedule);
-  silc_schedule_iterate(schedule, -1);
-  SILC_SCHEDULE_UNLOCK(schedule);
-}
-#endif /* !SILC_SYMBIAN */
-
-/* Wakes up the scheduler. This is used only in multi-threaded
-   environments where threads may add new tasks or remove old tasks
-   from task queues. This is called to wake up the scheduler in the
-   main thread so that it detects the changes in the task queues.
-   If threads support is not compiled in this function has no effect.
-   Implementation of this function is platform specific. */
-
-void silc_schedule_wakeup(SilcSchedule schedule)
-{
-#ifdef SILC_THREADS
-  SILC_LOG_DEBUG(("Wakeup scheduler"));
-  SILC_SCHEDULE_LOCK(schedule);
-  schedule_ops.wakeup(schedule, schedule->internal);
-  SILC_SCHEDULE_UNLOCK(schedule);
-#endif
-}
-
-/* Returns the application specific context that was saved into the
-   scheduler in silc_schedule_init function.  The context is also
-   returned to application in task callback functions, but this function
-   may be used to get it as well if needed. */
-
-void *silc_schedule_get_context(SilcSchedule schedule)
-{
-  return schedule->app_context;
-}
-
-/* Set notify callback */
-
-void silc_schedule_set_notify(SilcSchedule schedule,
-                             SilcTaskNotifyCb notify, void *context)
-{
-  schedule->notify = notify;
-  schedule->notify_context = context;
-}
-
-/* Add new task to the scheduler */
-
-SilcTask silc_schedule_task_add(SilcSchedule schedule, SilcUInt32 fd,
-                               SilcTaskCallback callback, void *context,
-                               long seconds, long useconds,
-                               SilcTaskType type)
-{
-  SilcTask task = NULL;
-
-  if (silc_unlikely(!schedule->valid))
-    return NULL;
-
-  SILC_SCHEDULE_LOCK(schedule);
-
-  if (silc_likely(type == SILC_TASK_TIMEOUT)) {
-    SilcTaskTimeout tmp, prev, ttask;
-    SilcList list;
-
-    silc_list_start(schedule->free_tasks);
-    ttask = silc_list_get(schedule->free_tasks);
-    if (silc_unlikely(!ttask)) {
-      ttask = silc_calloc(1, sizeof(*ttask));
-      if (silc_unlikely(!ttask))
-       goto out;
-    } else
-      silc_list_del(schedule->free_tasks, ttask);
-
-    ttask->header.type = 1;
-    ttask->header.callback = callback;
-    ttask->header.context = context;
-    ttask->header.valid = TRUE;
-
-    /* Add timeout */
-    silc_gettimeofday(&ttask->timeout);
-    if ((seconds + useconds) > 0) {
-      ttask->timeout.tv_sec += seconds + (useconds / 1000000L);
-      ttask->timeout.tv_usec += (useconds % 1000000L);
-      if (ttask->timeout.tv_usec >= 1000000L) {
-       ttask->timeout.tv_sec += 1;
-       ttask->timeout.tv_usec -= 1000000L;
-      }
-    }
-
-    SILC_LOG_DEBUG(("New timeout task %p: sec=%d, usec=%d", ttask,
-                   seconds, useconds));
-
-    /* Add task to correct spot so that the first task in the list has
-       the earliest timeout. */
-    list = schedule->timeout_queue;
-    silc_list_start(list);
-    prev = NULL;
-    while ((tmp = silc_list_get(list)) != SILC_LIST_END) {
-      /* If we have shorter timeout, we have found our spot */
-      if (silc_compare_timeval(&ttask->timeout, &tmp->timeout) < 0) {
-       silc_list_insert(schedule->timeout_queue, prev, ttask);
-       break;
-      }
-      prev = tmp;
-    }
-    if (!tmp)
-      silc_list_add(schedule->timeout_queue, ttask);
-
-    task = (SilcTask)ttask;
-
-    /* Call notify callback */
-    if (schedule->notify)
-      schedule->notify(schedule, TRUE, task, FALSE, 0, 0, seconds, useconds,
-                      schedule->notify_context);
-
-  } else if (silc_likely(type == SILC_TASK_FD)) {
-    SilcTaskFd ftask;
-
-    /* Check if fd is already added */
-    if (silc_unlikely(silc_hash_table_find(schedule->fd_queue,
-                                          SILC_32_TO_PTR(fd),
-                                          NULL, (void *)&task))) {
-      if (task->valid)
-        goto out;
-
-      /* Remove invalid task.  We must have unique fd key to hash table. */
-      silc_schedule_task_remove(schedule, task);
-    }
-
-    /* Check max tasks */
-    if (silc_unlikely(schedule->max_tasks > 0 &&
-                     silc_hash_table_count(schedule->fd_queue) >=
-                     schedule->max_tasks)) {
-      SILC_LOG_WARNING(("Scheduler task limit reached: cannot add new task"));
-      task = NULL;
-      goto out;
-    }
-
-    ftask = silc_calloc(1, sizeof(*ftask));
-    if (silc_unlikely(!ftask)) {
-      task = NULL;
-      goto out;
-    }
-
-    SILC_LOG_DEBUG(("New fd task %p fd=%d", ftask, fd));
-
-    ftask->header.type = 0;
-    ftask->header.callback = callback;
-    ftask->header.context = context;
-    ftask->header.valid = TRUE;
-    ftask->events = SILC_TASK_READ;
-    ftask->fd = fd;
-
-    /* Add task and schedule it */
-    if (!silc_hash_table_add(schedule->fd_queue, SILC_32_TO_PTR(fd), ftask)) {
-      silc_free(ftask);
-      task = NULL;
-      goto out;
-    }
-    if (!schedule_ops.schedule_fd(schedule, schedule->internal,
-                                 ftask, ftask->events)) {
-      silc_hash_table_del(schedule->fd_queue, SILC_32_TO_PTR(fd));
-      task = NULL;
-      goto out;
-    }
-
-    task = (SilcTask)ftask;
-
-    /* Call notify callback */
-    if (schedule->notify)
-      schedule->notify(schedule, TRUE, task, TRUE, ftask->fd,
-                      SILC_TASK_READ, 0, 0, schedule->notify_context);
-
-  } else if (silc_unlikely(type == SILC_TASK_SIGNAL)) {
-    SILC_SCHEDULE_UNLOCK(schedule);
-    schedule_ops.signal_register(schedule, schedule->internal, fd,
-                                callback, context);
-    return NULL;
-  }
-
- out:
-  SILC_SCHEDULE_UNLOCK(schedule);
-
-#ifdef SILC_SYMBIAN
-  /* On symbian we wakeup scheduler immediately after adding timeout task
-     in case the task is added outside the scheduler loop (in some active
-     object). */
-  if (task && task->type == 1)
-    silc_schedule_wakeup(schedule);
-#endif /* SILC_SYMBIAN */
-
-  return task;
-}
-
-/* Invalidates task */
-
-SilcBool silc_schedule_task_del(SilcSchedule schedule, SilcTask task)
-{
-  if (silc_unlikely(task == SILC_ALL_TASKS)) {
-    SilcHashTableList htl;
-
-    SILC_LOG_DEBUG(("Unregister all tasks"));
-
-    SILC_SCHEDULE_LOCK(schedule);
-
-    /* Delete from fd queue */
-    silc_hash_table_list(schedule->fd_queue, &htl);
-    while (silc_hash_table_get(&htl, NULL, (void *)&task)) {
-      task->valid = FALSE;
-
-      /* Call notify callback */
-      if (schedule->notify)
-       schedule->notify(schedule, FALSE, task, TRUE,
-                        ((SilcTaskFd)task)->fd, 0, 0, 0,
-                        schedule->notify_context);
-    }
-    silc_hash_table_list_reset(&htl);
-
-    /* Delete from timeout queue */
-    silc_list_start(schedule->timeout_queue);
-    while ((task = (SilcTask)silc_list_get(schedule->timeout_queue))) {
-      task->valid = FALSE;
-
-      /* Call notify callback */
-      if (schedule->notify)
-       schedule->notify(schedule, FALSE, task, FALSE, 0, 0, 0, 0,
-                        schedule->notify_context);
-    }
-
-    SILC_SCHEDULE_UNLOCK(schedule);
-    return TRUE;
-  }
-
-  SILC_LOG_DEBUG(("Unregistering task %p", task));
-  SILC_SCHEDULE_LOCK(schedule);
-  task->valid = FALSE;
-
-  /* Call notify callback */
-  if (schedule->notify)
-    schedule->notify(schedule, FALSE, task, !task->type, 0, 0, 0, 0,
-                    schedule->notify_context);
-  SILC_SCHEDULE_UNLOCK(schedule);
-
-  return TRUE;
-}
-
-/* Invalidate task by fd */
-
-SilcBool silc_schedule_task_del_by_fd(SilcSchedule schedule, SilcUInt32 fd)
-{
-  SilcTask task = NULL;
-  SilcBool ret = FALSE;
-
-  SILC_LOG_DEBUG(("Unregister task by fd %d", fd));
-
-  SILC_SCHEDULE_LOCK(schedule);
-
-  /* fd is unique, so there is only one task with this fd in the table */
-  if (silc_likely(silc_hash_table_find(schedule->fd_queue,
-                                      SILC_32_TO_PTR(fd), NULL,
-                                      (void *)&task))) {
-    SILC_LOG_DEBUG(("Deleting task %p", task));
-    task->valid = FALSE;
-
-    /* Call notify callback */
-    if (schedule->notify)
-      schedule->notify(schedule, FALSE, task, TRUE, fd, 0, 0, 0,
-                      schedule->notify_context);
-    ret = TRUE;
-  }
-
-  SILC_SCHEDULE_UNLOCK(schedule);
-
-  /* If it is signal, remove it */
-  if (silc_unlikely(!task)) {
-    schedule_ops.signal_unregister(schedule, schedule->internal, fd);
-    ret = TRUE;
-  }
-
-  return ret;
-}
-
-/* Invalidate task by task callback. */
-
-SilcBool silc_schedule_task_del_by_callback(SilcSchedule schedule,
-                                           SilcTaskCallback callback)
-{
-  SilcTask task;
-  SilcHashTableList htl;
-  SilcList list;
-  SilcBool ret = FALSE;
-
-  SILC_LOG_DEBUG(("Unregister task by callback"));
-
-  SILC_SCHEDULE_LOCK(schedule);
-
-  /* Delete from fd queue */
-  silc_hash_table_list(schedule->fd_queue, &htl);
-  while (silc_hash_table_get(&htl, NULL, (void *)&task)) {
-    if (task->callback == callback) {
-      task->valid = FALSE;
-
-      /* Call notify callback */
-      if (schedule->notify)
-       schedule->notify(schedule, FALSE, task, TRUE,
-                        ((SilcTaskFd)task)->fd, 0, 0, 0,
-                        schedule->notify_context);
-      ret = TRUE;
-    }
-  }
-  silc_hash_table_list_reset(&htl);
-
-  /* Delete from timeout queue */
-  list = schedule->timeout_queue;
-  silc_list_start(list);
-  while ((task = (SilcTask)silc_list_get(list))) {
-    if (task->callback == callback) {
-      task->valid = FALSE;
-
-      /* Call notify callback */
-      if (schedule->notify)
-       schedule->notify(schedule, FALSE, task, FALSE, 0, 0, 0, 0,
-                        schedule->notify_context);
-      ret = TRUE;
-    }
-  }
-
-  SILC_SCHEDULE_UNLOCK(schedule);
-
-  return ret;
-}
-
-/* Invalidate task by context. */
-
-SilcBool silc_schedule_task_del_by_context(SilcSchedule schedule,
-                                          void *context)
-{
-  SilcTask task;
-  SilcHashTableList htl;
-  SilcList list;
-  SilcBool ret = FALSE;
-
-  SILC_LOG_DEBUG(("Unregister task by context"));
-
-  SILC_SCHEDULE_LOCK(schedule);
-
-  /* Delete from fd queue */
-  silc_hash_table_list(schedule->fd_queue, &htl);
-  while (silc_hash_table_get(&htl, NULL, (void *)&task)) {
-    if (task->context == context) {
-      task->valid = FALSE;
-
-      /* Call notify callback */
-      if (schedule->notify)
-       schedule->notify(schedule, FALSE, task, TRUE,
-                        ((SilcTaskFd)task)->fd, 0, 0, 0,
-                        schedule->notify_context);
-      ret = TRUE;
-    }
-  }
-  silc_hash_table_list_reset(&htl);
-
-  /* Delete from timeout queue */
-  list = schedule->timeout_queue;
-  silc_list_start(list);
-  while ((task = (SilcTask)silc_list_get(list))) {
-    if (task->context == context) {
-      task->valid = FALSE;
-
-      /* Call notify callback */
-      if (schedule->notify)
-       schedule->notify(schedule, FALSE, task, FALSE, 0, 0, 0, 0,
-                        schedule->notify_context);
-      ret = TRUE;
-    }
-  }
-
-  SILC_SCHEDULE_UNLOCK(schedule);
-
-  return ret;
-}
-
-/* Invalidate task by all */
-
-SilcBool silc_schedule_task_del_by_all(SilcSchedule schedule, int fd,
-                                      SilcTaskCallback callback,
-                                      void *context)
-{
-  SilcTask task;
-  SilcList list;
-  SilcBool ret = FALSE;
-
-  SILC_LOG_DEBUG(("Unregister task by fd, callback and context"));
-
-  /* For fd task, callback and context is irrelevant as fd is unique */
-  if (fd)
-    return silc_schedule_task_del_by_fd(schedule, fd);
-
-  SILC_SCHEDULE_LOCK(schedule);
-
-  /* Delete from timeout queue */
-  list = schedule->timeout_queue;
-  silc_list_start(list);
-  while ((task = (SilcTask)silc_list_get(list))) {
-    if (task->callback == callback && task->context == context) {
-      task->valid = FALSE;
-
-      /* Call notify callback */
-      if (schedule->notify)
-       schedule->notify(schedule, FALSE, task, FALSE, 0, 0, 0, 0,
-                        schedule->notify_context);
-      ret = TRUE;
-    }
-  }
-
-  SILC_SCHEDULE_UNLOCK(schedule);
-
-  return TRUE;
-}
-
-/* Sets a file descriptor to be listened by scheduler. One can call this
-   directly if wanted. This can be called multiple times for one file
-   descriptor to set different iomasks. */
-
-SilcBool silc_schedule_set_listen_fd(SilcSchedule schedule, SilcUInt32 fd,
-                                    SilcTaskEvent mask, SilcBool send_events)
-{
-  SilcTaskFd task;
-
-  if (silc_unlikely(!schedule->valid))
-    return FALSE;
-
-  SILC_SCHEDULE_LOCK(schedule);
-
-  if (silc_hash_table_find(schedule->fd_queue, SILC_32_TO_PTR(fd),
-                          NULL, (void *)&task)) {
-    if (!schedule_ops.schedule_fd(schedule, schedule->internal, task, mask)) {
-      SILC_SCHEDULE_UNLOCK(schedule);
-      return FALSE;
-    }
-    task->events = mask;
-    if (silc_unlikely(send_events) && mask) {
-      task->revents = mask;
-      silc_schedule_dispatch_fd(schedule);
-    }
-
-    /* Call notify callback */
-    if (schedule->notify)
-      schedule->notify(schedule, TRUE, (SilcTask)task,
-                      TRUE, task->fd, mask, 0, 0,
-                      schedule->notify_context);
-  }
-
-  SILC_SCHEDULE_UNLOCK(schedule);
-
-  return TRUE;
-}
-
-/* Returns the file descriptor's current requested event mask. */
-
-SilcTaskEvent silc_schedule_get_fd_events(SilcSchedule schedule,
-                                         SilcUInt32 fd)
-{
-  SilcTaskFd task;
-  SilcTaskEvent event = 0;
-
-  if (silc_unlikely(!schedule->valid))
-    return 0;
-
-  SILC_SCHEDULE_LOCK(schedule);
-  if (silc_hash_table_find(schedule->fd_queue, SILC_32_TO_PTR(fd),
-                          NULL, (void *)&task))
-    event = task->events;
-  SILC_SCHEDULE_UNLOCK(schedule);
-
-  return event;
-}
-
-/* Removes a file descriptor from listen list. */
-
-void silc_schedule_unset_listen_fd(SilcSchedule schedule, SilcUInt32 fd)
-{
-  silc_schedule_set_listen_fd(schedule, fd, 0, FALSE);
-}
diff --git a/lib/silcutil/silcschedule.h b/lib/silcutil/silcschedule.h
deleted file mode 100644 (file)
index 8c2154a..0000000
+++ /dev/null
@@ -1,638 +0,0 @@
-/*
-
-  silcschedule.h
-
-  Author: Pekka Riikonen <priikone@silcnet.org>
-
-  Copyright (C) 1998 - 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.
-
-*/
-
-/****h* silcutil/SILC Schedule Interface
- *
- * DESCRIPTION
- *
- * The SILC Scheduler is the heart of any application. The scheduler provides
- * 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 is designed to be the sole main loop of the application
- * so that the application does not need any other main loop.  However,
- * SILC Scheduler does support running the scheduler only once, so 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 registers
- * 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 WIN32 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
- * create GUI applications. The scheduler can also handle all kinds of
- * WIN32 handles, this includes sockets created by the SILC Net API routines,
- * 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.
- *
- ***/
-
-#ifndef SILCSCHEDULE_H
-#define SILCSCHEDULE_H
-
-/****s* silcutil/SilcScheduleAPI/SilcSchedule
- *
- * NAME
- *
- *    typedef struct SilcScheduleStruct *SilcSchedule;
- *
- * DESCRIPTION
- *
- *    This context is the actual Scheduler and is allocated by
- *    the silc_schedule_init funtion.  The context is given as argument
- *    to all silc_schedule_* functions.  It must be freed by the
- *    silc_schedule_uninit function.
- *
- ***/
-typedef struct SilcScheduleStruct *SilcSchedule;
-
-/****s* silcutil/SilcScheduleAPI/SilcTask
- *
- * NAME
- *
- *    typedef struct SilcTaskStruct *SilcTask;
- *
- * DESCRIPTION
- *
- *    This object represents one task in the scheduler.  It is allocated
- *    by the silc_schedule_task_add function and freed by one of the
- *    silc_schedule_task_del* functions.
- *
- ***/
-typedef struct SilcTaskStruct *SilcTask;
-
-/****d* silcutil/SilcScheduleAPI/SilcTaskEvent
- *
- * NAME
- *
- *    typedef enum { ... } SilcTaskEvent;
- *
- * DESCRIPTION
- *
- *    SILC Task event types.  The event type indicates the occurred
- *    event of the task.  This type will be given as argument to the
- *    SilcTaskCallback function to indicate the event for the caller.
- *    The SILC_TASK_READ and SILC_TASK_WRITE may be set by the caller
- *    of the silc_schedule_set_listen_fd, if the caller needs to control
- *    the events for the task. The SILC_TASK_EXPIRE is set always only
- *    by the scheduler when timeout expires for timeout task.  The
- *    SILC_TASK_INTERRUPT is set for signal callback.
- *
- * SOURCE
- */
-typedef enum {
-  SILC_TASK_READ         = 0x0001,              /* Reading */
-  SILC_TASK_WRITE        = 0x0002,              /* Writing */
-  SILC_TASK_EXPIRE       = 0x0004,              /* Timeout */
-  SILC_TASK_INTERRUPT    = 0x0008,              /* Signal */
-} SilcTaskEvent;
-/***/
-
-/****f* silcutil/SilcScheduleAPI/SilcTaskCallback
- *
- * SYNOPSIS
- *
- *    typedef void (*SilcTaskCallback)(SilcSchedule schedule,
- *                                     void *app_context,
- *                                     SilcTaskEvent type, SilcUInt32 fd,
- *                                     void *context);
- *
- * DESCRIPTION
- *
- *    The task callback function.  This function will be called by the
- *    scheduler when some event of the task is performed.  For example,
- *    when data is available from the connection this will be called.
- *
- *    The `schedule' is the scheduler context, the `type' is the indicated
- *    event, the `fd' is the file descriptor of the task and the `context'
- *    is a caller specified context. If multiple events occurred this
- *    callback is called separately for all events.  The `app_context'
- *    is application specific context that was given as argument to the
- *    silc_schedule_init function.  If the task is timeout task then `fd'
- *    is zero (0).
- *
- *    To specify task callback function in the application using the
- *    SILC_TASK_CALLBACK macro is recommended.
- *
- *    The callback should not perform lenghty or blocking operations as
- *    this would also block all other waiting tasks.  The task callback
- *    should either handle the operation fast or issue an asynchronous
- *    call (like to register 0 timeout task) to handle it later.
- *
- ***/
-typedef void (*SilcTaskCallback)(SilcSchedule schedule, void *app_context,
-                                SilcTaskEvent type, SilcUInt32 fd,
-                                void *context);
-
-/****f* silcutil/SilcScheduleAPI/SilcTaskNotifyCb
- *
- * SYNOPSIS
- *
- *    typedef void (*SilcTaskNotifyCb)(SilcSchedule schedule,
- *                                     SilcBool added, SilcTask task,
- *                                     SilcBool fd_task, SilcUInt32 fd,
- *                                     SilcTaskEvent event,
- *                                     long seconds, long useconds,
- *                                     void *context);
- *
- * DESCRIPTION
- *
- *    Task notify callback.  Callback of this type can be set to scheduler
- *    by calling silc_schedule_set_notify and will be called whenever new
- *    task is added or old task is removed.  If `added' is TRUE then `task'
- *    is added to scheduler.  If `added' is FALSE then `task' will be removed
- *    from the scheduler.  If `fd_task' is TRUE the `task' is file descriptor
- *    task and has `fd' is its file descriptor.  If `fd_task' is FALSE then
- *    the task is timeout task and `seconds' and `useconds' specify the
- *    timeout.  The `context' is the context given to silc_schedule_set_notify.
- *
- * NOTES
- *
- *    The `schedule' is locked while this callback is called.  This means that
- *    new tasks cannot be added or removed inside this callback.
- *
- *    When timeout task expires this callback is not called.  This is called
- *    only when task is explicitly deleted from the scheduler.  Note that,
- *    when timeout task expires it is removed from the scheduler and `task'
- *    will become invalid.
- *
- *    If fd task changes its events, this will be called as if it was a new
- *    task with different `event' mask.
- *
- ***/
-typedef void (*SilcTaskNotifyCb)(SilcSchedule schedule,
-                                SilcBool added, SilcTask task,
-                                SilcBool fd_task, SilcUInt32 fd,
-                                SilcTaskEvent event,
-                                long seconds, long useconds,
-                                void *app_context);
-
-/* Macros */
-
-/****d* silcutil/SilcScheduleAPI/SILC_ALL_TASKS
- *
- * NAME
- *
- *    #define SILC_ALL_TASKS ...
- *
- * DESCRIPTION
- *
- *    Marks for all tasks in the scheduler. This can be passed to
- *    silc_schedule_task_del function to delete all tasks at once.
- *
- * SOURCE
- */
-#define SILC_ALL_TASKS ((SilcTask)1)
-/***/
-
-/****d* silcutil/SilcScheduleAPI/SILC_TASK_CALLBACK
- *
- * NAME
- *
- *    #define SILC_TASK_CALLBACK ...
- *
- * DESCRIPTION
- *
- *    Generic macro to declare task callback functions. This defines a
- *    function with name `func' as a task callback function.
- *
- * SOURCE
- */
-#define SILC_TASK_CALLBACK(func)                                       \
-void func(SilcSchedule schedule, void *app_context, SilcTaskEvent type,        \
-         SilcUInt32 fd, void *context)
-/***/
-
-/* Prototypes */
-
-#include "silcschedule_i.h"
-
-/****f* silcutil/SilcScheduleAPI/silc_schedule_init
- *
- * SYNOPSIS
- *
- *    SilcSchedule silc_schedule_init(int max_tasks, void *app_context);
- *
- * DESCRIPTION
- *
- *    Initializes the scheduler. This returns the scheduler context that
- *    is given as argument usually to all silc_schedule_* functions.
- *    The `app_context' is application specific context that is delivered
- *    to all task callbacks. The caller must free that context.  The
- *    'app_context' can be for example the application itself.
- *
- *    The `max_tasks' is the maximum number of file descriptor and socket
- *    tasks in the scheduler.  Set value to 0 to use default.  Operating
- *    system will enforce the final limit.  On some operating systems the
- *    limit can be significantly increased when this function is called in
- *    priviliged mode (as super user).
- *
- ***/
-SilcSchedule silc_schedule_init(int max_tasks, void *app_context);
-
-/****f* silcutil/SilcScheduleAPI/silc_schedule_uninit
- *
- * SYNOPSIS
- *
- *    SilcBool silc_schedule_uninit(SilcSchedule schedule);
- *
- * DESCRIPTION
- *
- *    Uninitializes the scheduler. This is called when the program is ready
- *    to end. This removes all tasks from the scheduler. Returns FALSE if the
- *    scheduler could not be uninitialized. This happens when the scheduler
- *    is still valid and silc_schedule_stop has not been called.
- *
- ***/
-SilcBool silc_schedule_uninit(SilcSchedule schedule);
-
-/****f* silcutil/SilcScheduleAPI/silc_schedule_stop
- *
- * SYNOPSIS
- *
- *    void silc_schedule_stop(SilcSchedule schedule);
- *
- * DESCRIPTION
- *
- *    Stops the scheduler even if it is not supposed to be stopped yet.
- *    After calling this, one must call silc_schedule_uninit (after the
- *    silc_schedule has returned).  After this is called it is guaranteed
- *    that next time the scheduler enters the main loop it will be stopped.
- *    However, untill it enters the main loop it will not detect that
- *    it is stopped for example if this is called from another thread.
- *
- ***/
-void silc_schedule_stop(SilcSchedule schedule);
-
-/****f* silcutil/SilcScheduleAPI/silc_schedule
- *
- * SYNOPSIS
- *
- *    void silc_schedule(SilcSchedule schedule);
- *
- * DESCRIPTION
- *
- *    The SILC scheduler.  The program will run inside this function.
- *    When this returns the program is to be ended.  Before this function
- *    can be called, one must call silc_schedule_init function.
- *
- * NOTES
- *
- *    On Windows this will block the calling thread but will continue
- *    to dispatch window messages, and thus can be used as the main loop
- *    of the program.
- *
- *    On Symbian this will block the calling thread.  The Symbian Active
- *    Scheduler must be running before calling this function.
- *
- ***/
-void silc_schedule(SilcSchedule schedule);
-
-/****f* silcutil/SilcScheduleAPI/silc_schedule_one
- *
- * SYNOPSIS
- *
- *    SilcBool silc_schedule_one(SilcSchedule schedule, int timeout_usecs);
- *
- * DESCRIPTION
- *
- *    Same as the silc_schedule but runs the scheduler only one round
- *    and then returns.  This function is handy when the SILC scheduler
- *    is used inside some other external scheduler, for example.  If
- *    the `timeout_usecs' is non-negative a timeout will be added to the
- *    scheduler.  The function will not return in this timeout unless
- *    some other event occurs.
- *
- *    Typically this would be called from a timeout or idle task
- *    periodically (typically from 5-50 ms) to schedule SILC tasks.  In
- *    this case the `timeout_usecs' is usually 0 to make the function
- *    return immediately.
- *
- ***/
-SilcBool silc_schedule_one(SilcSchedule schedule, int timeout_usecs);
-
-/****f* silcutil/SilcScheduleAPI/silc_schedule_wakeup
- *
- * SYNOPSIS
- *
- *    void silc_schedule_wakeup(SilcSchedule schedule);
- *
- * DESCRIPTION
- *
- *    Wakes up the scheduler. This is may be used in multi-threaded
- *    environments where threads may add new tasks or remove old tasks
- *    from the scheduler. This is called to wake up the scheduler in the
- *    main thread so that it detects the changes in the scheduler.
- *    If threads support is not compiled in this function has no effect.
- *
- ***/
-void silc_schedule_wakeup(SilcSchedule schedule);
-
-/****f* silcutil/SilcScheduleAPI/silc_schedule_get_context
- *
- * SYNOPSIS
- *
- *    void *silc_schedule_get_context(SilcSchedule schedule);
- *
- * DESCRIPTION
- *
- *    Returns the application specific context that was saved into the
- *    scheduler in silc_schedule_init function.  The context is also
- *    returned to application in the SilcTaskCallback, but this function
- *    may be used to get it as well if needed.
- *
- ***/
-void *silc_schedule_get_context(SilcSchedule schedule);
-
-/****f* silcutil/SilcScheduleAPI/silc_schedule_set_notify
- *
- * SYNOPSIS
- *
- *    void silc_schedule_set_notify(SilcSchedule schedule,
- *                                  SilcTaskNotifyCb notify, void *context);
- *
- * DESCRIPTION
- *
- *    Set notify callback to scheduler.  The `notify' will be called whenever
- *    task is added to or deleted from scheduler.
- *
- ***/
-void silc_schedule_set_notify(SilcSchedule schedule,
-                             SilcTaskNotifyCb notify, void *context);
-
-/****f* silcutil/SilcScheduleAPI/silc_schedule_task_add_fd
- *
- * SYNOPSIS
- *
- *    SilcTask
- *    silc_schedule_task_add_fd(SilcSchedule schedule, SilcUInt32 fd,
- *                              SilcTaskCallback callback, void *context);
- *
- * DESCRIPTION
- *
- *    Add file descriptor task to scheduler.  The `fd' may be either real
- *    file descriptor, socket or on some platforms an opaque file descriptor
- *    handle.  To receive events for the file descriptor set the correct
- *    request events with silc_schedule_set_listen_fd function.
- *
- *    The task will be initially set for SILC_TASK_READ events.  Setting that
- *    event immediately after this call returns is not necessary.
- *
- *    This returns the new task or NULL on error.  If a task with `fd' has
- *    already been added this will return the existing task pointer.
- *
- ***/
-#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
- *
- * SYNOPSIS
- *
- *    SilcTask
- *    silc_schedule_task_add_timeout(SilcSchedule schedule,
- *                                   SilcTaskCallback callback, void *context,
- *                                   long seconds, long useconds);
- *
- * DESCRIPTION
- *
- *    Add timeout task to scheduler.  The `callback' will be called once
- *    the specified timeout has elapsed.  The task will be removed from the
- *    scheduler automatically once the task expires.  The event returned
- *    to the `callback' is SILC_TASK_EXPIRE.  A task added with zero (0)
- *    timeout will be executed immediately next time tasks are scheduled.
- *
- ***/
-#define silc_schedule_task_add_timeout(schedule, callback, context, s, u) \
-  silc_schedule_task_add(schedule, 0, callback, context, s, u,         \
-                         SILC_TASK_TIMEOUT)
-
-/****f* silcutil/SilcScheduleAPI/silc_schedule_task_add_signal
- *
- * SYNOPSIS
- *
- *    SilcTask
- *    silc_schedule_task_add_signal(SilcSchedule schedule, int signal,
- *                                  SilcTaskCallback callback, void *context);
- *
- * DESCRIPTION
- *
- *    Add platform specific process signal handler to scheduler.  On Unix
- *    systems the `signal' is one of the signal specified in signal(7).  On
- *    other platforms this function may not be available at all, and has no
- *    effect when called.  The event delivered to the `callback' is
- *    SILC_TASK_INTERRUPT.
- *
- * NOTES
- *
- *    One signal may be registered only one callback.  Adding second callback
- *    for signal that already has one will fail.
- *
- *    This function always returns NULL.  To remove signal from scheduler by
- *    the signal call silc_schedule_task_del_by_fd.
- *
- ***/
-#define silc_schedule_task_add_signal(schedule, sig, callback, context) \
-  silc_schedule_task_add(schedule, sig, callback, context, 0, 0,       \
-                        SILC_TASK_SIGNAL)
-
-/****f* silcutil/SilcScheduleAPI/silc_schedule_task_del
- *
- * SYNOPSIS
- *
- *    SilcBool silc_schedule_task_del(SilcSchedule schedule, SilcTask task);
- *
- * DESCRIPTION
- *
- *    Deletes the `task' from the scheduler indicated by the `schedule'.
- *    After deleting the task it is guaranteed that the task callback
- *    will not be called. If the `task' is SILC_ALL_TASKS then all
- *    tasks is removed from the scheduler.  Returns always TRUE.
- *
- *    It is safe to call this function in any place. Tasks may be removed
- *    in task callbacks (including in the task's own task callback) and
- *    in multi-threaded environment in other threads as well.
- *
- ***/
-SilcBool silc_schedule_task_del(SilcSchedule schedule, SilcTask task);
-
-/****f* silcutil/SilcScheduleAPI/silc_schedule_task_del_by_fd
- *
- * SYNOPSIS
- *
- *    SilcBool silc_schedule_task_del_by_fd(SilcSchedule schedule,
- *                                          SilcUInt32 fd);
- *
- * DESCRIPTION
- *
- *    Deletes a task from the scheduler by the specified `fd'.  Returns
- *    FALSE if such fd task does not exist.
- *
- *    It is safe to call this function in any place. Tasks may be removed
- *    in task callbacks (including in the task's own task callback) and
- *    in multi-threaded environment in other threads as well.
- *
- ***/
-SilcBool silc_schedule_task_del_by_fd(SilcSchedule schedule, SilcUInt32 fd);
-
-/****f* silcutil/SilcScheduleAPI/silc_schedule_task_del_by_callback
- *
- * SYNOPSIS
- *
- *    SilcBool silc_schedule_task_del_by_callback(SilcSchedule schedule,
- *                                                SilcTaskCallback callback);
- *
- * DESCRIPTION
- *
- *    Deletes a task from the scheduler by the specified `callback' task
- *    callback function.  Returns FALSE if such task with such callback
- *    does not exist.
- *
- *    It is safe to call this function in any place. Tasks may be removed
- *    in task callbacks (including in the task's own task callback) and
- *    in multi-threaded environment in other threads as well.
- *
- ***/
-SilcBool silc_schedule_task_del_by_callback(SilcSchedule schedule,
-                                           SilcTaskCallback callback);
-
-/****f* silcutil/SilcScheduleAPI/silc_schedule_task_del_by_context
- *
- * SYNOPSIS
- *
- *    SilcBool silc_schedule_task_del_by_context(SilcSchedule schedule,
- *                                               void *context);
- *
- * DESCRIPTION
- *
- *    Deletes a task from the scheduler by the specified `context'.  Returns
- *    FALSE if such task with such context does not exist.
- *
- *    It is safe to call this function in any place. Tasks may be removed
- *    in task callbacks (including in the task's own task callback) and
- *    in multi-threaded environment in other threads as well.
- *
- ***/
-SilcBool silc_schedule_task_del_by_context(SilcSchedule schedule,
-                                          void *context);
-
-/****f* silcutil/SilcScheduleAPI/silc_schedule_task_del_by_all
- *
- * SYNOPSIS
- *
- *    SilcBool silc_schedule_task_del_by_all(SilcSchedule schedule, int fd,
- *                                           SilcTaskCallback callback,
- *                                           void *context);
- *
- * DESCRIPTION
- *
- *    Deletes a task from the scheduler by the specified `fd', `callback'
- *    and `context'.  Returns FALSE if such task does not exist.
- *
- *    It is safe to call this function in any place. Tasks may be removed
- *    in task callbacks (including in the task's own task callback) and
- *    in multi-threaded environment in other threads as well.
- *
- ***/
-SilcBool silc_schedule_task_del_by_all(SilcSchedule schedule, int fd,
-                                      SilcTaskCallback callback,
-                                      void *context);
-
-/****f* silcutil/SilcScheduleAPI/silc_schedule_set_listen_fd
- *
- * SYNOPSIS
- *
- *    SilcBool silc_schedule_set_listen_fd(SilcSchedule schedule,
- *                                         SilcUInt32 fd,
- *                                         SilcTaskEvent mask,
- *                                         SilcBool send_events);
- *
- * DESCRIPTION
- *
- *    Sets a file descriptor `fd' to be listened by the scheduler for
- *    `mask' events.  To tell scheduler not to listen anymore for this
- *    file descriptor call the silc_schedule_unset_listen_fd function.
- *    When new task is created with silc_schedule_task_add the event
- *    for the task's fd is initially set to SILC_TASK_READ. If you need
- *    to control the task's fd's events you must call this function
- *    whenever you need to change the events. This can be called multiple
- *    times to change the events.
- *
- *    If the `send_events' is TRUE then this function sends the events
- *    in `mask' to the application.  If FALSE then they are sent only
- *    after the event occurs in reality.  In normal cases the `send_events'
- *    is set to FALSE.
- *
- *    Returns FALSE if the operation could not performed and TRUE if it
- *    was a success.
- *
- ***/
-SilcBool silc_schedule_set_listen_fd(SilcSchedule schedule, SilcUInt32 fd,
-                                    SilcTaskEvent mask, SilcBool send_events);
-
-/****f* silcutil/SilcScheduleAPI/silc_schedule_get_fd_events
- *
- * SYNOPSIS
- *
- *    SilcTaskEvent silc_schedule_get_fd_events(SilcSchedule schedule,
- *                                              SilcUInt32 fd);
- *
- * DESCRIPTION
- *
- *    Returns the file descriptor `fd' current requested events mask,
- *    or 0 on error.
- *
- ***/
-SilcTaskEvent silc_schedule_get_fd_events(SilcSchedule schedule,
-                                         SilcUInt32 fd);
-
-/****f* silcutil/SilcScheduleAPI/silc_schedule_unset_listen_fd
- *
- * SYNOPSIS
- *
- *    void silc_schedule_unset_listen_fd(SilcSchedule schedule, SilcUInt32 fd);
- *
- * DESCRIPTION
- *
- *    Tells the scheduler not to listen anymore for the specified
- *    file descriptor `fd'. No events will be detected for the `fd'
- *    after calling this function.
- *
- ***/
-void silc_schedule_unset_listen_fd(SilcSchedule schedule, SilcUInt32 fd);
-
-#endif
diff --git a/lib/silcutil/silcschedule_i.h b/lib/silcutil/silcschedule_i.h
deleted file mode 100644 (file)
index 61ea481..0000000
+++ /dev/null
@@ -1,164 +0,0 @@
-/*
-
-  silcschedule_i.h.
-
-  Author: Pekka Riikonen <priikone@silcnet.org>
-
-  Copyright (C) 2001 - 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 SILCSCHEDULE_I_H
-#define SILCSCHEDULE_I_H
-
-#ifndef SILCSCHEDULE_H
-#error "Do not include this header directly"
-#endif
-
-#include "silchashtable.h"
-#include "silclist.h"
-
-/* Task types */
-typedef enum {
-  /* File descriptor task that performs some event over file descriptors.
-     These tasks are for example network connections. */
-  SILC_TASK_FD           = 0,
-
-  /* Timeout tasks are tasks that are executed after the specified
-     time has elapsed. After the task is executed the task is removed
-     automatically from the scheduler. It is safe to re-register the
-     task in task callback. It is also safe to unregister a task in
-     the task callback. */
-  SILC_TASK_TIMEOUT,
-
-  /* Platform specific process signal task.  On Unix systems this is one of
-     the signals described in signal(7).  On other platforms this may not
-     be available at all.  Only one callback per signal may be added. */
-  SILC_TASK_SIGNAL
-} SilcTaskType;
-
-/* Task header */
-struct SilcTaskStruct {
-  struct SilcTaskStruct *next;
-  SilcTaskCallback callback;
-  void *context;
-  unsigned int type    : 1;    /* 0 = fd, 1 = timeout */
-  unsigned int valid   : 1;    /* Set if task is valid */
-};
-
-/* Timeout task */
-typedef struct SilcTaskTimeoutStruct {
-  struct SilcTaskStruct header;
-  struct timeval timeout;
-} *SilcTaskTimeout;
-
-/* Fd task */
-typedef struct SilcTaskFdStruct {
-  struct SilcTaskStruct header;
-  unsigned int scheduled  : 1;
-  unsigned int events     : 14;
-  unsigned int revents    : 15;
-  SilcUInt32 fd;
-} *SilcTaskFd;
-
-/* Scheduler context */
-struct SilcScheduleStruct {
-  void *internal;
-  void *app_context;              /* Application specific context */
-  SilcTaskNotifyCb notify;        /* Notify callback */
-  void *notify_context;                   /* Notify context */
-  SilcHashTable fd_queue;         /* FD task queue */
-  SilcList fd_dispatch;                   /* Dispatched FDs */
-  SilcList timeout_queue;         /* Timeout queue */
-  SilcList free_tasks;            /* Timeout task freelist */
-  SilcMutex lock;                 /* Scheduler lock */
-  struct timeval timeout;         /* Current timeout */
-  unsigned int max_tasks     : 29; /* Max FD tasks */
-  unsigned int has_timeout   : 1;  /* Set if timeout is set */
-  unsigned int valid         : 1;  /* Set if scheduler is valid */
-  unsigned int signal_tasks  : 1;  /* Set if to dispatch signals */
-};
-
-/* Locks. These also blocks signals that we care about and thus guarantee
-   that while we are in scheduler no signals can happen.  This way we can
-   synchronise signals with SILC Scheduler. */
-#define SILC_SCHEDULE_LOCK(schedule)                           \
-do {                                                           \
-  silc_mutex_lock(schedule->lock);                             \
-  schedule_ops.signals_block(schedule, schedule->internal);    \
-} while (0)
-#define SILC_SCHEDULE_UNLOCK(schedule)                         \
-do {                                                           \
-  schedule_ops.signals_unblock(schedule, schedule->internal);  \
-  silc_mutex_unlock(schedule->lock);                           \
-} while (0)
-
-/* Platform specific scheduler operations */
-typedef struct {
-  /* Initializes the platform specific scheduler.  This for example initializes
-     the wakeup mechanism of the scheduler.  In multi-threaded environment
-     the scheduler needs to be wakenup when tasks are added or removed from
-     the task queues.  Returns context to the platform specific scheduler.
-     If this returns NULL the scheduler initialization will fail.  Do not
-     add FD tasks inside function.  Timeout tasks can be added. */
-  void *(*init)(SilcSchedule schedule, void *app_context);
-
-  /* Uninitializes the platform specific scheduler context. */
-  void (*uninit)(SilcSchedule schedule, void *context);
-
-  /* System specific waiter. This must fill the schedule->fd_dispatch queue
-     with valid tasks that has something to dispatch, when this returns. */
-  int (*schedule)(SilcSchedule schedule, void *context);
-
-  /* Schedule `task' with events `event_mask'. Zero `event_mask'
-     unschedules the task. */
-  SilcBool (*schedule_fd)(SilcSchedule schedule, void *context,
-                         SilcTaskFd task, SilcTaskEvent event_mask);
-
-  /* Wakes up the scheduler. This is platform specific routine */
-  void (*wakeup)(SilcSchedule schedule, void *context);
-
-  /* Register signal */
-  void (*signal_register)(SilcSchedule schedule, void *context,
-                         SilcUInt32 signal, SilcTaskCallback callback,
-                         void *callback_context);
-
-  /* Unregister signal */
-  void (*signal_unregister)(SilcSchedule schedule, void *context,
-                           SilcUInt32 signal);
-
-  /* Call all signals */
-  void (*signals_call)(SilcSchedule schedule, void *context);
-
-  /* Block registered signals in scheduler. */
-  void (*signals_block)(SilcSchedule schedule, void *context);
-
-  /* Unblock registered signals in schedule. */
-  void (*signals_unblock)(SilcSchedule schedule, void *context);
-} SilcScheduleOps;
-
-/* The generic function to add any type of task to the scheduler.  This
-   used to be exported as is to application, but now they should use the
-   macro wrappers defined in silcschedule.h.  For Fd task the timeout must
-   be zero, for timeout task the timeout must not be zero, for signal task
-   the fd argument is the signal. */
-SilcTask silc_schedule_task_add(SilcSchedule schedule, SilcUInt32 fd,
-                               SilcTaskCallback callback, void *context,
-                               long seconds, long useconds,
-                               SilcTaskType type);
-
-#ifdef SILC_DIST_INPLACE
-/* Print scheduler statistics to stdout. */
-void silc_schedule_stats(SilcSchedule schedule);
-#endif /* SILC_DIST_INPLACE */
-
-#endif /* SILCSCHEDULE_I_H */
diff --git a/lib/silcutil/silcsnprintf.c b/lib/silcutil/silcsnprintf.c
deleted file mode 100644 (file)
index 501625a..0000000
+++ /dev/null
@@ -1,778 +0,0 @@
-/*
- * Copyright Patrick Powell 1995
- * This code is based on code written by Patrick Powell (papowell@astart.com)
- * It may be used for any purpose as long as this notice remains intact
- * on all source code distributions
- */
-
-/**************************************************************
- * Original:
- * Patrick Powell Tue Apr 11 09:48:21 PDT 1995
- * A bombproof version of doprnt (dopr) included.
- * Sigh.  This sort of thing is always nasty do deal with.  Note that
- * the version here does not include floating point...
- *
- * snprintf() is used instead of sprintf() as it does limit checks
- * for string length.  This covers a nasty loophole.
- *
- * The other functions are there to prevent NULL pointers from
- * causing nast effects.
- *
- * More Recently:
- *  Brandon Long <blong@fiction.net> 9/15/96 for mutt 0.43
- *  This was ugly.  It is still ugly.  I opted out of floating point
- *  numbers, but the formatter understands just about everything
- *  from the normal C string format, at least as far as I can tell from
- *  the Solaris 2.5 printf(3S) man page.
- *
- *  Brandon Long <blong@fiction.net> 10/22/97 for mutt 0.87.1
- *    Ok, added some minimal floating point support, which means this
- *    probably requires libm on most operating systems.  Don't yet
- *    support the exponent (e,E) and sigfig (g,G).  Also, fmtint()
- *    was pretty badly broken, it just wasn't being exercised in ways
- *    which showed it, so that's been fixed.  Also, formated the code
- *    to mutt conventions, and removed dead code left over from the
- *    original.  Also, there is now a builtin-test, just compile with:
- *           gcc -DTEST_SNPRINTF -o snprintf snprintf.c -lm
- *    and run snprintf for results.
- *
- *  Thomas Roessler <roessler@guug.de> 01/27/98 for mutt 0.89i
- *    The PGP code was using unsigned hexadecimal formats.
- *    Unfortunately, unsigned formats simply didn't work.
- *
- *  Michael Elkins <me@cs.hmc.edu> 03/05/98 for mutt 0.90.8
- *    The original code assumed that both snprintf() and vsnprintf() were
- *    missing.  Some systems only have snprintf() but not vsnprintf(), so
- *    the code is now broken down under HAVE_SNPRINTF and HAVE_VSNPRINTF.
- *
- *  Andrew Tridgell (tridge@samba.org) Oct 1998
- *    fixed handling of %.0f
- *    added test for HAVE_LONG_DOUBLE
- *
- * tridge@samba.org, idra@samba.org, April 2001
- *    got rid of fcvt code (twas buggy and made testing harder)
- *    added C99 semantics
- *
- **************************************************************/
-
-#include "silc.h"
-
-#ifdef HAVE_LONG_DOUBLE
-#define LDOUBLE long double
-#else
-#define LDOUBLE double
-#endif
-
-#ifdef HAVE_LONG_LONG
-#define LLONG long long
-#else
-#define LLONG long
-#endif
-
-/*
- * dopr(): poor man's version of doprintf
- */
-
-/* format read states */
-#define DP_S_DEFAULT 0
-#define DP_S_FLAGS   1
-#define DP_S_MIN     2
-#define DP_S_DOT     3
-#define DP_S_MAX     4
-#define DP_S_MOD     5
-#define DP_S_CONV    6
-#define DP_S_DONE    7
-
-/* format flags - Bits */
-#define DP_F_MINUS     (1 << 0)
-#define DP_F_PLUS      (1 << 1)
-#define DP_F_SPACE     (1 << 2)
-#define DP_F_NUM       (1 << 3)
-#define DP_F_ZERO      (1 << 4)
-#define DP_F_UP        (1 << 5)
-#define DP_F_UNSIGNED  (1 << 6)
-#define DP_F_HEXPREFIX         (1 << 7)
-
-/* Conversion Flags */
-#define DP_C_SHORT   1
-#define DP_C_LONG    2
-#define DP_C_LDOUBLE 3
-#define DP_C_LLONG   4
-
-#define char_to_int(p) ((p)- '0')
-#ifndef MAX
-#define MAX(p,q) (((p) >= (q)) ? (p) : (q))
-#endif
-
-static size_t dopr(char *buffer, size_t maxlen, const char *format,
-                  va_list args_in);
-static void fmtstr(char *buffer, size_t *currlen, size_t maxlen,
-                   char *value, int flags, int min, int max);
-static void fmtint(char *buffer, size_t *currlen, size_t maxlen,
-                   long value, int base, int min, int max, int flags);
-static void fmtfp(char *buffer, size_t *currlen, size_t maxlen,
-                  LDOUBLE fvalue, int min, int max, int flags);
-static void dopr_outch(char *buffer, size_t *currlen, size_t maxlen, char c);
-
-static size_t dopr(char *buffer, size_t maxlen, const char *format,
-                  va_list args_in)
-{
-  char ch;
-  LLONG value;
-  LDOUBLE fvalue;
-  char *strvalue;
-  int min;
-  int max;
-  int state;
-  int flags;
-  int cflags;
-  size_t currlen;
-  va_list args;
-
-  silc_va_copy(args, args_in);
-
-  state = DP_S_DEFAULT;
-  currlen = flags = cflags = min = 0;
-  max = -1;
-  ch = *format++;
-
-  while (state != DP_S_DONE) {
-    if (ch == '\0')
-      state = DP_S_DONE;
-
-    switch(state) {
-    case DP_S_DEFAULT:
-      if (ch == '%')
-       state = DP_S_FLAGS;
-      else
-       dopr_outch (buffer, &currlen, maxlen, ch);
-      ch = *format++;
-      break;
-    case DP_S_FLAGS:
-      switch (ch) {
-      case '-':
-       flags |= DP_F_MINUS;
-       ch = *format++;
-       break;
-      case '+':
-       flags |= DP_F_PLUS;
-       ch = *format++;
-       break;
-      case ' ':
-       flags |= DP_F_SPACE;
-       ch = *format++;
-       break;
-      case '#':
-       flags |= DP_F_NUM;
-       ch = *format++;
-       break;
-      case '0':
-       flags |= DP_F_ZERO;
-       ch = *format++;
-       break;
-      default:
-       state = DP_S_MIN;
-       break;
-      }
-      break;
-    case DP_S_MIN:
-      if (isdigit((unsigned char)ch)) {
-       min = 10*min + char_to_int (ch);
-       ch = *format++;
-      } else if (ch == '*') {
-       min = va_arg (args, int);
-       ch = *format++;
-       state = DP_S_DOT;
-      } else {
-       state = DP_S_DOT;
-      }
-      break;
-    case DP_S_DOT:
-      if (ch == '.') {
-       state = DP_S_MAX;
-       ch = *format++;
-      } else {
-       state = DP_S_MOD;
-      }
-      break;
-    case DP_S_MAX:
-      if (isdigit((unsigned char)ch)) {
-       if (max < 0)
-         max = 0;
-       max = 10*max + char_to_int (ch);
-       ch = *format++;
-      } else if (ch == '*') {
-       max = va_arg (args, int);
-       ch = *format++;
-       state = DP_S_MOD;
-      } else {
-       state = DP_S_MOD;
-      }
-      break;
-    case DP_S_MOD:
-      switch (ch) {
-      case 'h':
-       cflags = DP_C_SHORT;
-       ch = *format++;
-       break;
-      case 'l':
-       cflags = DP_C_LONG;
-       ch = *format++;
-       if (ch == 'l') {        /* It's a long long */
-         cflags = DP_C_LLONG;
-         ch = *format++;
-       }
-       break;
-      case 'L':
-       cflags = DP_C_LDOUBLE;
-       ch = *format++;
-       break;
-      default:
-       break;
-      }
-      state = DP_S_CONV;
-      break;
-    case DP_S_CONV:
-      switch (ch) {
-      case 'd':
-      case 'i':
-       if (cflags == DP_C_SHORT)
-         value = va_arg (args, int);
-       else if (cflags == DP_C_LONG)
-         value = va_arg (args, long int);
-       else if (cflags == DP_C_LLONG)
-         value = va_arg (args, LLONG);
-       else
-         value = va_arg (args, int);
-       fmtint (buffer, &currlen, maxlen, value, 10, min, max, flags);
-       break;
-      case 'o':
-       flags |= DP_F_UNSIGNED;
-       if (cflags == DP_C_SHORT)
-         value = va_arg (args, unsigned int);
-       else if (cflags == DP_C_LONG)
-         value = (long)va_arg (args, unsigned long int);
-       else if (cflags == DP_C_LLONG)
-         value = (long)va_arg (args, unsigned LLONG);
-       else
-         value = (long)va_arg (args, unsigned int);
-       fmtint (buffer, &currlen, maxlen, value, 8, min, max, flags);
-       break;
-      case 'u':
-       flags |= DP_F_UNSIGNED;
-       if (cflags == DP_C_SHORT)
-         value = va_arg (args, unsigned int);
-       else if (cflags == DP_C_LONG)
-         value = (long)va_arg (args, unsigned long int);
-       else if (cflags == DP_C_LLONG)
-         value = (LLONG)va_arg (args, unsigned LLONG);
-       else
-         value = (long)va_arg (args, unsigned int);
-       fmtint (buffer, &currlen, maxlen, value, 10, min, max, flags);
-       break;
-      case 'X':
-       flags |= DP_F_UP;
-      case 'x':
-       flags |= DP_F_UNSIGNED;
-       if (cflags == DP_C_SHORT)
-         value = va_arg (args, unsigned int);
-       else if (cflags == DP_C_LONG)
-         value = (long)va_arg (args, unsigned long int);
-       else if (cflags == DP_C_LLONG)
-         value = (LLONG)va_arg (args, unsigned LLONG);
-       else
-         value = (long)va_arg (args, unsigned int);
-       fmtint (buffer, &currlen, maxlen, value, 16, min, max, flags);
-       break;
-      case 'f':
-       if (cflags == DP_C_LDOUBLE)
-         fvalue = va_arg (args, LDOUBLE);
-       else
-         fvalue = va_arg (args, double);
-       /* um, floating point? */
-       fmtfp (buffer, &currlen, maxlen, fvalue, min, max, flags);
-       break;
-      case 'E':
-       flags |= DP_F_UP;
-      case 'e':
-       if (cflags == DP_C_LDOUBLE)
-         fvalue = va_arg (args, LDOUBLE);
-       else
-         fvalue = va_arg (args, double);
-       fmtfp (buffer, &currlen, maxlen, fvalue, min, max, flags);
-       break;
-      case 'G':
-       flags |= DP_F_UP;
-      case 'g':
-       if (cflags == DP_C_LDOUBLE)
-         fvalue = va_arg (args, LDOUBLE);
-       else
-         fvalue = va_arg (args, double);
-       fmtfp (buffer, &currlen, maxlen, fvalue, min, max, flags);
-       break;
-      case 'c':
-       dopr_outch (buffer, &currlen, maxlen, va_arg (args, int));
-       break;
-      case 's':
-       strvalue = va_arg (args, char *);
-       if (!strvalue) strvalue = "(NULL)";
-       if (max == -1) {
-         max = strlen(strvalue);
-       }
-       if (min > 0 && max >= 0 && min > max) max = min;
-       fmtstr (buffer, &currlen, maxlen, strvalue, flags, min, max);
-       break;
-      case 'p':
-       flags |= (DP_F_UNSIGNED | DP_F_HEXPREFIX);
-       strvalue = va_arg (args, void *);
-       fmtint (buffer, &currlen, maxlen, (long )strvalue, 16, min, max,
-               flags);
-       break;
-      case 'n':
-       if (cflags == DP_C_SHORT) {
-         short int *num;
-         num = va_arg (args, short int *);
-         *num = currlen;
-       } else if (cflags == DP_C_LONG) {
-         long int *num;
-         num = va_arg (args, long int *);
-         *num = (long int)currlen;
-       } else if (cflags == DP_C_LLONG) {
-         LLONG *num;
-         num = va_arg (args, LLONG *);
-         *num = (LLONG)currlen;
-       } else {
-         int *num;
-         num = va_arg (args, int *);
-         *num = currlen;
-       }
-       break;
-      case '%':
-       dopr_outch (buffer, &currlen, maxlen, ch);
-       break;
-      case 'w':
-       /* not supported yet, treat as next char */
-       ch = *format++;
-       break;
-      default:
-       /* Unknown, skip */
-       break;
-      }
-      ch = *format++;
-      state = DP_S_DEFAULT;
-      flags = cflags = min = 0;
-      max = -1;
-      break;
-    case DP_S_DONE:
-      break;
-    default:
-      /* hmm? */
-      break; /* some picky compilers need this */
-    }
-  }
-  if (maxlen != 0) {
-    if (currlen < maxlen - 1)
-      buffer[currlen] = '\0';
-    else if (maxlen > 0)
-      buffer[maxlen - 1] = '\0';
-  }
-
-  return currlen;
-}
-
-static void fmtstr(char *buffer, size_t *currlen, size_t maxlen,
-                   char *value, int flags, int min, int max)
-{
-  int padlen, strln;     /* amount to pad */
-  int cnt = 0;
-
-  if (value == 0) {
-    value = "<NULL>";
-  }
-
-  for (strln = 0; value[strln]; ++strln); /* strlen */
-  padlen = min - strln;
-  if (padlen < 0)
-    padlen = 0;
-  if (flags & DP_F_MINUS)
-    padlen = -padlen; /* Left Justify */
-
-  while ((padlen > 0) && (cnt < max)) {
-    dopr_outch (buffer, currlen, maxlen, ' ');
-    --padlen;
-    ++cnt;
-  }
-  while (*value && (cnt < max)) {
-    dopr_outch (buffer, currlen, maxlen, *value++);
-    ++cnt;
-  }
-  while ((padlen < 0) && (cnt < max)) {
-    dopr_outch (buffer, currlen, maxlen, ' ');
-    ++padlen;
-    ++cnt;
-  }
-}
-
-/* Have to handle DP_F_NUM (ie 0x and 0 alternates) */
-
-static void fmtint(char *buffer, size_t *currlen, size_t maxlen,
-                  long value, int base, int min, int max, int flags)
-{
-  int signvalue = 0;
-  unsigned long uvalue;
-  char convert[20];
-  int place = 0;
-  int spadlen = 0; /* amount to space pad */
-  int zpadlen = 0; /* amount to zero pad */
-  int caps = 0;
-
-  if (max < 0)
-    max = 0;
-
-  uvalue = value;
-
-  if(!(flags & DP_F_UNSIGNED)) {
-    if( value < 0 ) {
-      signvalue = '-';
-      uvalue = -value;
-    } else {
-      if (flags & DP_F_PLUS)  /* Do a sign (+/i) */
-       signvalue = '+';
-      else if (flags & DP_F_SPACE)
-       signvalue = ' ';
-    }
-  }
-
-  if (flags & DP_F_UP) caps = 1; /* Should characters be upper case? */
-
-  do {
-    convert[place++] =
-      (caps? "0123456789ABCDEF":"0123456789abcdef")
-      [uvalue % (unsigned)base  ];
-    uvalue = (uvalue / (unsigned)base );
-  } while(uvalue && (place < 20));
-  if (place == 20) place--;
-  convert[place] = 0;
-
-  zpadlen = max - place;
-  spadlen = min - MAX (max, place) - (signvalue ? 1 : 0);
-  if (zpadlen < 0) zpadlen = 0;
-  if (spadlen < 0) spadlen = 0;
-  if (flags & DP_F_ZERO) {
-    zpadlen = MAX(zpadlen, spadlen);
-    spadlen = 0;
-  }
-  if (flags & DP_F_MINUS)
-    spadlen = -spadlen; /* Left Justifty */
-
-  /* Spaces */
-  while (spadlen > 0) {
-    dopr_outch (buffer, currlen, maxlen, ' ');
-    --spadlen;
-  }
-
-  /* 0x prefix */
-  if (flags & DP_F_HEXPREFIX) {
-    dopr_outch (buffer, currlen, maxlen, '0');
-    dopr_outch (buffer, currlen, maxlen, 'x');
-  }
-
-  /* Sign */
-  if (signvalue)
-    dopr_outch (buffer, currlen, maxlen, signvalue);
-
-  /* Zeros */
-  if (zpadlen > 0) {
-    while (zpadlen > 0) {
-      dopr_outch (buffer, currlen, maxlen, '0');
-      --zpadlen;
-    }
-  }
-
-  /* Digits */
-  while (place > 0)
-    dopr_outch (buffer, currlen, maxlen, convert[--place]);
-
-  /* Left Justified spaces */
-  while (spadlen < 0) {
-    dopr_outch (buffer, currlen, maxlen, ' ');
-    ++spadlen;
-  }
-}
-
-static LDOUBLE abs_val(LDOUBLE value)
-{
-  LDOUBLE result = value;
-
-  if (value < 0)
-    result = -value;
-
-  return result;
-}
-
-static LDOUBLE POW10(int exp)
-{
-  LDOUBLE result = 1;
-
-  while (exp) {
-    result *= 10;
-    exp--;
-  }
-
-  return result;
-}
-
-static LLONG ROUND(LDOUBLE value)
-{
-  LLONG intpart;
-
-  intpart = (LLONG)value;
-  value = value - intpart;
-  if (value >= 0.5) intpart++;
-
-  return intpart;
-}
-
-/* a replacement for modf that doesn't need the math library. Should
-   be portable, but slow */
-static double my_modf(double x0, double *iptr)
-{
-  int i;
-  long l;
-  double x = x0;
-  double f = 1.0;
-
-  for (i=0;i<100;i++) {
-    l = (long)x;
-    if (l <= (x+1) && l >= (x-1)) break;
-    x *= 0.1;
-    f *= 10.0;
-  }
-
-  if (i == 100) {
-    /* yikes! the number is beyond what we can handle.
-       What do we do? */
-    (*iptr) = 0;
-    return 0;
-  }
-
-  if (i != 0) {
-    double i2;
-    double ret;
-
-    ret = my_modf(x0-l*f, &i2);
-    (*iptr) = l*f + i2;
-    return ret;
-  }
-
-  (*iptr) = l;
-  return x - (*iptr);
-}
-
-
-static void fmtfp (char *buffer, size_t *currlen, size_t maxlen,
-                  LDOUBLE fvalue, int min, int max, int flags)
-{
-  int signvalue = 0;
-  double ufvalue;
-  char iconvert[311];
-  char fconvert[311];
-  int iplace = 0;
-  int fplace = 0;
-  int padlen = 0; /* amount to pad */
-  int zpadlen = 0;
-  int caps = 0;
-  int idx;
-  double intpart;
-  double fracpart;
-  double temp;
-
-  /*
-   * AIX manpage says the default is 0, but Solaris says the default
-   * is 6, and sprintf on AIX defaults to 6
-   */
-  if (max < 0)
-    max = 6;
-
-  ufvalue = abs_val (fvalue);
-
-  if (fvalue < 0) {
-    signvalue = '-';
-  } else {
-    if (flags & DP_F_PLUS) { /* Do a sign (+/i) */
-      signvalue = '+';
-    } else {
-      if (flags & DP_F_SPACE)
-       signvalue = ' ';
-    }
-  }
-
-#if 0
-  if (flags & DP_F_UP) caps = 1; /* Should characters be upper case? */
-#endif
-
-#if 0
-  if (max == 0) ufvalue += 0.5; /* if max = 0 we must round */
-#endif
-
-  /*
-   * Sorry, we only support 16 digits past the decimal because of our
-   * conversion method
-   */
-  if (max > 16)
-    max = 16;
-
-  /* We "cheat" by converting the fractional part to integer by
-   * multiplying by a factor of 10
-   */
-
-  temp = ufvalue;
-  my_modf(temp, &intpart);
-
-  fracpart = ROUND((POW10(max)) * (ufvalue - intpart));
-
-  if (fracpart >= POW10(max)) {
-    intpart++;
-    fracpart -= POW10(max);
-  }
-
-
-  /* Convert integer part */
-  do {
-    temp = intpart*0.1;
-    my_modf(temp, &intpart);
-    idx = (int) ((temp -intpart +0.05)* 10.0);
-    /* idx = (int) (((double)(temp*0.1) -intpart +0.05) *10.0); */
-    /* printf ("%llf, %f, %x\n", temp, intpart, idx); */
-    iconvert[iplace++] =
-      (caps? "0123456789ABCDEF":"0123456789abcdef")[idx];
-  } while (intpart && (iplace < 311));
-  if (iplace == 311) iplace--;
-  iconvert[iplace] = 0;
-
-  /* Convert fractional part */
-  if (fracpart)
-    {
-      do {
-       temp = fracpart*0.1;
-       my_modf(temp, &fracpart);
-       idx = (int) ((temp -fracpart +0.05)* 10.0);
-       /* idx = (int) ((((temp/10) -fracpart) +0.05) *10); */
-       /* printf ("%lf, %lf, %ld\n", temp, fracpart, idx ); */
-       fconvert[fplace++] =
-         (caps? "0123456789ABCDEF":"0123456789abcdef")[idx];
-      } while(fracpart && (fplace < 311));
-      if (fplace == 311) fplace--;
-    }
-  fconvert[fplace] = 0;
-
-  /* -1 for decimal point, another -1 if we are printing a sign */
-  padlen = min - iplace - max - 1 - ((signvalue) ? 1 : 0);
-  zpadlen = max - fplace;
-  if (zpadlen < 0) zpadlen = 0;
-  if (padlen < 0)
-    padlen = 0;
-  if (flags & DP_F_MINUS)
-    padlen = -padlen; /* Left Justifty */
-
-  if ((flags & DP_F_ZERO) && (padlen > 0)) {
-    if (signvalue) {
-      dopr_outch (buffer, currlen, maxlen, signvalue);
-      --padlen;
-      signvalue = 0;
-    }
-    while (padlen > 0) {
-      dopr_outch (buffer, currlen, maxlen, '0');
-      --padlen;
-    }
-  }
-  while (padlen > 0) {
-    dopr_outch (buffer, currlen, maxlen, ' ');
-    --padlen;
-  }
-  if (signvalue)
-    dopr_outch (buffer, currlen, maxlen, signvalue);
-
-  while (iplace > 0)
-    dopr_outch (buffer, currlen, maxlen, iconvert[--iplace]);
-
-  /*
-   * Decimal point.  This should probably use locale to find the correct
-   * char to print out.
-   */
-  if (max > 0) {
-    dopr_outch (buffer, currlen, maxlen, '.');
-
-    while (zpadlen > 0) {
-      dopr_outch (buffer, currlen, maxlen, '0');
-      --zpadlen;
-    }
-
-    while (fplace > 0)
-      dopr_outch (buffer, currlen, maxlen, fconvert[--fplace]);
-  }
-
-  while (padlen < 0) {
-    dopr_outch (buffer, currlen, maxlen, ' ');
-    ++padlen;
-  }
-}
-
-static void dopr_outch(char *buffer, size_t *currlen, size_t maxlen, char c)
-{
-  if (*currlen < maxlen) {
-    buffer[(*currlen)] = c;
-  }
-  (*currlen)++;
-}
-
-int silc_vsnprintf(char *str, size_t count, const char *fmt, va_list args)
-{
-  if (str != NULL)
-    str[0] = 0;
-  return dopr(str, count, fmt, args);
-}
-
-int silc_snprintf(char *str, size_t count, const char *fmt, ...)
-{
-  size_t ret;
-  va_list ap;
-
-  va_start(ap, fmt);
-  ret = silc_vsnprintf(str, count, fmt, ap);
-  va_end(ap);
-  return ret;
-}
-
-int silc_vasprintf(char **ptr, const char *format, va_list ap)
-{
-  int ret;
-  va_list ap2;
-
-  silc_va_copy(ap2, ap);
-
-  ret = silc_vsnprintf(NULL, 0, format, ap2);
-  if (ret <= 0) return ret;
-
-  (*ptr) = (char *)silc_malloc(ret+1);
-  if (!*ptr) return -1;
-
-  silc_va_copy(ap2, ap);
-
-  ret = silc_vsnprintf(*ptr, ret+1, format, ap2);
-
-  return ret;
-}
-
-int silc_asprintf(char **ptr, const char *format, ...)
-{
-  va_list ap;
-  int ret;
-
-  *ptr = NULL;
-  va_start(ap, format);
-  ret = silc_vasprintf(ptr, format, ap);
-  va_end(ap);
-
-  return ret;
-}
diff --git a/lib/silcutil/silcsnprintf.h b/lib/silcutil/silcsnprintf.h
deleted file mode 100644 (file)
index 00ae8c2..0000000
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
-
-  silcsnprintf.h
-
-  Author: Pekka Riikonen <priikone@silcnet.org>
-
-  Copyright (C) 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.
-
-*/
-
-/****h* silcutil/Snprintf
- *
- * DESCRIPTION
- *
- * Platform independent version of snprintf and other similar string
- * formatting routines.
- *
- ***/
-
-#ifndef SILCSNPRINTF_H
-#define SILCSNPRINTF_H
-
-/****f* silcutil/SilcSnprintf/silc_snprintf
- *
- * SYNOPSIS
- *
- *    int silc_snprintf(char *str, size_t count, const char *fmt, ...);
- *
- * DESCRIPTION
- *
- *    Outputs string into `str' of maximum of size `count' including the
- *    trailing '\0' according to the `fmt'.  The `fmt' is equivalent to
- *    snprintf(3) and printf(3) formatting.  Returns the number of character
- *    in `str' or negative value on error.
- *
- ***/
-int silc_snprintf(char *str, size_t count, const char *fmt, ...);
-
-/****f* silcutil/SilcSnprintf/silc_vsnprintf
- *
- * SYNOPSIS
- *
- *    int silc_vsnprintf(char *str, size_t count, const char *fmt,
- *                       va_list args)
- *
- * DESCRIPTION
- *
- *    Same as silc_snprintf but takes the argument for the formatting from
- *    the `args' variable argument list.
- *
- ***/
-int silc_vsnprintf(char *str, size_t count, const char *fmt, va_list args);
-
-/****f* silcutil/SilcSnprintf/silc_asprintf
- *
- * SYNOPSIS
- *
- *    int silc_asprintf(char **ptr, const char *format, ...)
- *
- * DESCRIPTION
- *
- *    Same as silc_snprintf but allocates a string large enough to hold the
- *    output including the trailing '\0'.  The caller must free the `ptr'.
- *
- ***/
-int silc_asprintf(char **ptr, const char *format, ...);
-
-/****f* silcutil/SilcSnprintf/silc_vasprintf
- *
- * SYNOPSIS
- *
- *    int silc_vasprintf(char **ptr, const char *format, va_list ap)
- *
- * DESCRIPTION
- *
- *    Same as silc_asprintf but takes the argument from the `ap' variable
- *    argument list.
- *
- ***/
-int silc_vasprintf(char **ptr, const char *format, va_list ap);
-
-#endif /* SILCSNPRINTF_H */
diff --git a/lib/silcutil/silcsocketstream.c b/lib/silcutil/silcsocketstream.c
deleted file mode 100644 (file)
index af8f2c3..0000000
+++ /dev/null
@@ -1,414 +0,0 @@
-/*
-
-  silcsocketstream.c
-
-  Author: Pekka Riikonen <priikone@silcnet.org>
-
-  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
-  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.
-
-*/
-
-#include "silc.h"
-
-/************************** Types and definitions ***************************/
-
-/* Stream operation functions (platform specific) */
-int silc_socket_stream_read(SilcStream stream, unsigned char *buf,
-                           SilcUInt32 buf_len);
-int silc_socket_stream_write(SilcStream stream, const unsigned char *data,
-                            SilcUInt32 data_len);
-SilcBool silc_socket_stream_close(SilcStream stream);
-void silc_socket_stream_destroy(SilcStream stream);
-int silc_socket_udp_stream_read(SilcStream stream, unsigned char *buf,
-                               SilcUInt32 buf_len);
-int silc_socket_udp_stream_write(SilcStream stream, const unsigned char *data,
-                                SilcUInt32 data_len);
-SilcBool silc_socket_stream_close(SilcStream stream);
-void silc_socket_stream_destroy(SilcStream stream);
-SilcBool silc_socket_stream_notifier(SilcStream stream,
-                                    SilcSchedule schedule,
-                                    SilcStreamNotifier callback,
-                                    void *context);
-SilcSchedule silc_socket_stream_get_schedule(SilcStream stream);
-
-/* Internal async host lookup context. */
-typedef struct {
-  SilcSocketStream stream;
-  SilcSocketStreamStatus status;
-  SilcSocketStreamCallback callback;
-  SilcAsyncOperation op;
-  void *context;
-  unsigned int require_fqdn : 1;
-  unsigned int aborted      : 1;
-} *SilcSocketHostLookup;
-
-
-/************************ Static utility functions **************************/
-
-/* Finishing timeout callback that will actually call the user specified
-   host lookup callback.  This is executed back in the calling thread and
-   not in the lookup thread. */
-
-SILC_TASK_CALLBACK(silc_socket_host_lookup_finish)
-{
-  SilcSocketHostLookup lookup = context;
-  SilcSocketStream stream = lookup->stream;
-
-  if (lookup->aborted) {
-    SILC_LOG_DEBUG(("Socket stream creation was aborted"));
-    stream->schedule = NULL;
-    silc_socket_stream_destroy(stream);
-    silc_free(lookup);
-    return;
-  }
-
-  if (lookup->status != SILC_SOCKET_OK) {
-    SILC_LOG_DEBUG(("Socket stream lookup failed"));
-    stream->schedule = NULL;
-    silc_socket_stream_destroy(stream);
-    stream = lookup->stream = NULL;
-  }
-
-  /* Return the created socket stream to the caller */
-  if (lookup->callback)
-    lookup->callback(lookup->status, stream, lookup->context);
-
-  if (lookup->op)
-    silc_async_free(lookup->op);
-  silc_free(lookup);
-}
-
-/* The thread function that performs the actual lookup. */
-
-static void *silc_socket_host_lookup_start(void *context)
-{
-  SilcSocketHostLookup lookup = (SilcSocketHostLookup)context;
-  SilcSocketStream stream = lookup->stream;
-  SilcSchedule schedule = stream->schedule;
-
-  stream->port = silc_net_get_remote_port(stream->sock);
-
-  silc_net_check_host_by_sock(stream->sock, &stream->hostname, &stream->ip);
-  if (!stream->ip) {
-    lookup->status = SILC_SOCKET_UNKNOWN_IP;
-    goto out;
-  }
-
-  if (!stream->hostname && lookup->require_fqdn) {
-    lookup->status = SILC_SOCKET_UNKNOWN_HOST;
-    goto out;
-  }
-
-  if (!stream->hostname) {
-    stream->hostname = strdup(stream->ip);
-    if (!stream->hostname) {
-      lookup->status = SILC_SOCKET_NO_MEMORY;
-      goto out;
-    }
-  }
-
-  lookup->status = SILC_SOCKET_OK;
-
- out:
-  silc_schedule_task_add_timeout(schedule, silc_socket_host_lookup_finish,
-                                lookup, 0, 0);
-  silc_schedule_wakeup(schedule);
-  return NULL;
-}
-
-/* Abort callback for stream creation. */
-
-static void silc_socket_host_lookup_abort(SilcAsyncOperation op,
-                                         void *context)
-{
-  SilcSocketHostLookup lookup = context;
-
-  /* The host lookup is done in thread.  We'll let it finish in its own
-     good time and handle the abortion after it finishes. */
-  lookup->aborted = TRUE;
-}
-
-
-/******************************* Public API *********************************/
-
-/* Creates TCP socket stream */
-
-SilcAsyncOperation
-silc_socket_tcp_stream_create(SilcSocket sock, SilcBool lookup,
-                             SilcBool require_fqdn,
-                             SilcSchedule schedule,
-                             SilcSocketStreamCallback callback,
-                             void *context)
-{
-  SilcSocketStream stream;
-  SilcSocketHostLookup l;
-
-  if (!sock || !schedule) {
-    SILC_LOG_ERROR(("Missing arguments to silc_socket_tcp_stream_create"));
-    if (callback)
-      callback(SILC_SOCKET_ERROR, NULL, context);
-    return NULL;
-  }
-
-  stream = silc_calloc(1, sizeof(*stream));
-  if (!stream) {
-    if (callback)
-      callback(SILC_SOCKET_NO_MEMORY, NULL, context);
-    return NULL;
-  }
-
-  SILC_LOG_DEBUG(("Creating TCP socket stream %p, sock %lu", stream, sock));
-
-  stream->ops = &silc_socket_stream_ops;
-  stream->sock = sock;
-  stream->schedule = schedule;
-  stream->connected = TRUE;
-
-  l = silc_calloc(1, sizeof(*l));
-  if (!l) {
-    silc_free(stream);
-    if (callback)
-      callback(SILC_SOCKET_NO_MEMORY, NULL, context);
-    return NULL;
-  }
-
-  l->stream = stream;
-  l->callback = callback;
-  l->context = context;
-  l->require_fqdn = require_fqdn;
-
-  if (lookup) {
-    /* Start asynchronous IP, hostname and port lookup process */
-    l->op = silc_async_alloc(silc_socket_host_lookup_abort, NULL, l);
-    if (!l->op) {
-      silc_free(stream);
-      silc_free(l);
-      if (callback)
-       callback(SILC_SOCKET_ERROR, NULL, context);
-      return NULL;
-    }
-
-    /* Lookup in thread */
-    SILC_LOG_DEBUG(("Starting async host lookup"));
-    silc_thread_create(silc_socket_host_lookup_start, l, FALSE);
-    return l->op;
-  } else {
-    /* No lookup */
-    l->status = SILC_SOCKET_OK;
-    silc_socket_host_lookup_finish(schedule,
-                                  silc_schedule_get_context(schedule),
-                                  0, 0, l);
-    return NULL;
-  }
-}
-
-/* Creates UDP socket stream */
-
-SilcStream silc_socket_udp_stream_create(SilcSocket sock, SilcBool ipv6,
-                                        SilcBool connected,
-                                        SilcSchedule schedule)
-{
-  SilcSocketStream stream;
-
-  stream = silc_calloc(1, sizeof(*stream));
-  if (!stream)
-    return NULL;
-
-  SILC_LOG_DEBUG(("Creating UDP socket stream %p", stream));
-
-  stream->ops = &silc_socket_udp_stream_ops;
-  stream->sock = sock;
-  stream->schedule = schedule;
-  stream->ipv6 = ipv6;
-  stream->connected = connected;
-
-  return (SilcStream)stream;
-}
-
-/* Returns TRUE if the stream is UDP stream */
-
-SilcBool silc_socket_stream_is_udp(SilcStream stream, SilcBool *connected)
-{
-  SilcSocketStream socket_stream = stream;
-
-  if (!SILC_IS_SOCKET_STREAM_UDP(socket_stream))
-    return FALSE;
-
-  if (connected)
-    *connected = socket_stream->connected;
-
-  return TRUE;
-}
-
-/* Returns socket stream information */
-
-SilcBool silc_socket_stream_get_info(SilcStream stream,
-                                    SilcSocket *sock, const char **hostname,
-                                    const char **ip, SilcUInt16 *port)
-{
-  SilcSocketStream socket_stream = stream;
-
-  if (!SILC_IS_SOCKET_STREAM(socket_stream) &&
-      !SILC_IS_SOCKET_STREAM_UDP(socket_stream))
-    return FALSE;
-
-  if (sock)
-    *sock = socket_stream->sock;
-  if (port) {
-    if (!socket_stream->port)
-      return FALSE;
-    *port = socket_stream->port;
-  }
-  if (ip) {
-    if (!socket_stream->ip)
-      return FALSE;
-    *ip = socket_stream->ip;
-  }
-  if (hostname) {
-    if (!socket_stream->hostname)
-      return FALSE;
-    *hostname = socket_stream->hostname;
-  }
-
-  return TRUE;
-}
-
-/* Set socket information */
-
-SilcBool silc_socket_stream_set_info(SilcStream stream,
-                                    const char *hostname,
-                                    const char *ip, SilcUInt16 port)
-{
-  SilcSocketStream socket_stream = stream;
-
-  if (!SILC_IS_SOCKET_STREAM(socket_stream) &&
-      !SILC_IS_SOCKET_STREAM_UDP(socket_stream))
-    return FALSE;
-
-  if (hostname) {
-    silc_free(socket_stream->hostname);
-    socket_stream->hostname = strdup(hostname);
-    if (!socket_stream->hostname)
-      return FALSE;
-  }
-  if (ip) {
-    silc_free(socket_stream->ip);
-    socket_stream->ip = strdup(ip);
-    if (!socket_stream->ip)
-      return FALSE;
-    if (!socket_stream->hostname) {
-      socket_stream->hostname = strdup(ip);
-      if (!socket_stream->hostname)
-       return FALSE;
-    }
-  }
-  if (port)
-    socket_stream->port = port;
-
-  return TRUE;
-}
-
-/* Return socket errno */
-
-int silc_socket_stream_get_error(SilcStream stream)
-{
-  SilcSocketStream socket_stream = stream;
-
-  if (!SILC_IS_SOCKET_STREAM(socket_stream) &&
-      !SILC_IS_SOCKET_STREAM_UDP(socket_stream))
-    return 0;
-
-  return socket_stream->sock_error;
-}
-
-/* Set QoS for socket stream */
-
-SilcBool silc_socket_stream_set_qos(SilcStream stream,
-                                   SilcUInt32 read_rate,
-                                   SilcUInt32 read_limit_bytes,
-                                   SilcUInt32 limit_sec,
-                                   SilcUInt32 limit_usec)
-{
-  SilcSocketStream socket_stream = stream;
-
-  if (!SILC_IS_SOCKET_STREAM(socket_stream) &&
-      !SILC_IS_SOCKET_STREAM_UDP(socket_stream))
-    return FALSE;
-
-  SILC_LOG_DEBUG(("Setting QoS for socket stream"));
-
-  if (socket_stream->qos && !read_rate && !read_limit_bytes &&
-      !limit_sec && !limit_usec) {
-    silc_schedule_task_del_by_context(socket_stream->schedule,
-                                     socket_stream->qos);
-    silc_free(socket_stream->qos->buffer);
-    silc_free(socket_stream->qos);
-    socket_stream->qos = NULL;
-    return TRUE;
-  }
-
-  if (!socket_stream->qos) {
-    socket_stream->qos = silc_calloc(1, sizeof(*socket_stream->qos));
-    if (!socket_stream->qos)
-      return FALSE;
-  }
-
-  socket_stream->qos->read_rate = read_rate;
-  socket_stream->qos->read_limit_bytes = read_limit_bytes;
-  socket_stream->qos->limit_sec = limit_sec;
-  socket_stream->qos->limit_usec = limit_usec;
-  memset(&socket_stream->qos->next_limit, 0,
-        sizeof(socket_stream->qos->next_limit));
-  socket_stream->qos->cur_rate = 0;
-  socket_stream->qos->sock = socket_stream;
-
-  socket_stream->qos->buffer = silc_realloc(socket_stream->qos->buffer,
-                                           read_limit_bytes);
-  if (!socket_stream->qos->buffer)
-    return FALSE;
-
-  return TRUE;
-}
-
-/* Return associated scheduler */
-
-SilcSchedule silc_socket_stream_get_schedule(SilcStream stream)
-{
-  SilcSocketStream socket_stream = stream;
-
-  if (!SILC_IS_SOCKET_STREAM(socket_stream) &&
-      !SILC_IS_SOCKET_STREAM_UDP(socket_stream))
-    return NULL;
-
-  return socket_stream->schedule;
-}
-
-/* SILC Socket Stream ops.  Functions are implemented under the
-   platform specific subdirectories. */
-const SilcStreamOps silc_socket_stream_ops =
-{
-  silc_socket_stream_read,
-  silc_socket_stream_write,
-  silc_socket_stream_close,
-  silc_socket_stream_destroy,
-  silc_socket_stream_notifier,
-  silc_socket_stream_get_schedule,
-};
-const SilcStreamOps silc_socket_udp_stream_ops =
-{
-  silc_socket_udp_stream_read,
-  silc_socket_udp_stream_write,
-  silc_socket_stream_close,
-  silc_socket_stream_destroy,
-  silc_socket_stream_notifier,
-  silc_socket_stream_get_schedule,
-};
diff --git a/lib/silcutil/silcsocketstream.h b/lib/silcutil/silcsocketstream.h
deleted file mode 100644 (file)
index e9fd435..0000000
+++ /dev/null
@@ -1,280 +0,0 @@
-/*
-
-  silcsocketstream.h
-
-  Author: Pekka Riikonen <priikone@silcnet.org>
-
-  Copyright (C) 2005 - 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.
-
-*/
-
-/****h* silcutil/SILC Socket Stream Interface
- *
- * DESCRIPTION
- *
- * Implementation of SILC Socket Stream.  SILC Socket Stream can be used
- * read data from and write data to a socket connection.  The SILC Socket
- * Stream provides also Quality of Service (QoS) support that can be used
- * to control the throughput of the stream.  It also supports both TCP and
- * UDP, and IPv4 and IPv6.
- *
- * SILC Socket Stream is not thread-safe.  If the same socket stream must be
- * used in multithreaded environment concurrency control must be employed.
- *
- ***/
-
-#ifndef SILCSOCKETSTREAM_H
-#define SILCSOCKETSTREAM_H
-
-/****d* silcutil/SilcSocketStreamAPI/SilcSocketStreamStatus
- *
- * NAME
- *
- *    typedef enum { ... } SilcStreamStatus;
- *
- * DESCRIPTION
- *
- *    Socket Stream status.  This status is returned into the
- *    SilcSocketStreamCallback function after the socket stream is
- *    created.
- *
- * SOURCE
- */
-typedef enum {
-  SILC_SOCKET_OK,              /* Normal status */
-  SILC_SOCKET_UNKNOWN_IP,      /* Remote does not have IP address */
-  SILC_SOCKET_UNKNOWN_HOST,    /* Remote does not have host name */
-  SILC_SOCKET_NO_MEMORY,       /* System out of memory */
-  SILC_SOCKET_ERROR,           /* Unknown error */
-} SilcSocketStreamStatus;
-/***/
-
-/****f* silcutil/SilcSocketStreamAPI/SilcSocketStreamCallback
- *
- * SYNOPSIS
- *
- *    typedef void (*SilcSocketStreamCallback)(SilcSocketStreamStatus status,
- *                                             SilcStream stream,
- *                                             void *context);
- *
- * DESCRIPTION
- *
- *    Callback function of this type is called after the socket stream
- *    creation is completed.  If the `stream' is NULL the socket stream could
- *    not be created or the socket connection is not otherwise allowed.  The
- *    `status' will indicate the error status.  In case error ocurrs the
- *    associated socket has already been destroyed.  The `stream' is socket
- *    stream representing the socket connection and silc_socket_stream_*
- *    functions can be used to access the stream.  All other silc_stream_*
- *    functions can also be used to read data, send data, and otherwise
- *    handle the stream.
- *
- *    If the silc_stream_set_notifier is called the stream will be set to
- *    non-blocking mode.
- *
- ***/
-typedef void (*SilcSocketStreamCallback)(SilcSocketStreamStatus status,
-                                        SilcStream stream, void *context);
-
-/****f* silcutil/SilcSocketStreamAPI/silc_socket_tcp_stream_create
- *
- * SYNOPSIS
- *
- *    SilcAsyncOperation
- *    silc_socket_tcp_stream_create(SilcSocket sock, SilcBool lookup,
- *                                  SilcBool require_fqdn,
- *                                  SilcSchedule schedule,
- *                                  SilcSocketStreamCallback callback,
- *                                  void *context);
- *
- * DESCRIPTION
- *
- *    Creates TCP socket stream of the TCP connection indicated by `sock'.
- *    The stream can be destroyed by calling the silc_stream_destroy.  Data
- *    can be sent and received from the stream by calling silc_stream_write
- *    and silc_stream_read.  The creation process is asynchronous since
- *    socket connection information, such as hostname and IP address are
- *    resolved, so SilcAsyncOperation is returned which can be used to cancel
- *    the creation process.  The `callback' will be called to return the
- *    created socket stream.
- *
- *    If the `lookup' is TRUE then this will perform IP and hostname lookup
- *    for the socket.  If the `require_fqdn' is TRUE then the socket must
- *    have valid hostname and IP address, otherwise the stream creation will
- *    fail.  If it is FALSE then only valid IP address is required.  Note that,
- *    if the `lookup' is FALSE then the hostname, IP and port information
- *    will not be available from the socket stream.  In that case this will
- *    also return NULL as the `callback' is called immediately.
- *
- *    If the silc_stream_set_notifier is called the stream is set to
- *    non-blocking mode.
- *
- ***/
-SilcAsyncOperation
-silc_socket_tcp_stream_create(SilcSocket sock, SilcBool lookup,
-                             SilcBool require_fqdn,
-                             SilcSchedule schedule,
-                             SilcSocketStreamCallback callback,
-                             void *context);
-
-/****f* silcutil/SilcSocketStreamAPI/silc_socket_udp_stream_create
- *
- * SYNOPSIS
- *
- *    SilcStream silc_socket_udp_stream_create(SilcSocket sock,
- *                                             SilcBool ipv6,
- *                                             SilcBool connected,
- *                                             SilcSchedule schedule);
- *
- * DESCRIPTION
- *
- *    Creates UDP socket stream of the UDP connection indicated by `sock'.
- *    The stream can be destroyed by calling the silc_stream_destroy.
- *    The `connected' defines whether the socket is in connected or in
- *    connectionless state.
- *
- *    Note that, UDP packets may be read only through the notifier
- *    callback (see silc_stream_set_notifier), when SILC_STREAM_CAN_READ
- *    is returned to the callback.  Because of this the notifier callback
- *    must be set.
- *
- *    Note that, UDP packet sending using silc_stream_write and receiving
- *    with silc_stream_read works only if the `sock' is a UDP socket in a
- *    connected state.  In connectionless state sending packets with
- *    silc_stream_write is possible only if the remote address and port
- *    has been set with silc_socket_stream_set_info.  If it is not set
- *    in connectionless state packets may be sent only by using the
- *    silc_net_udp_send function.  In connectionless state packets may be
- *    received only by using silc_net_udp_receive.
- *
- *    This function returns the created SilcStream or NULL on error.
- *
- *    If the silc_stream_set_notifier is called the stream is set to
- *    non-blocking mode.
- *
- ***/
-SilcStream silc_socket_udp_stream_create(SilcSocket sock,
-                                        SilcBool ipv6,
-                                        SilcBool connected,
-                                        SilcSchedule schedule);
-
-/****f* silcutil/SilcSocketStreamAPI/silc_socket_stream_is_udp
- *
- * SYNOPSIS
- *
- *    SilcBool silc_socket_stream_is_udp(SilcStream stream,
- *                                       SilcBool *connected);
- *
- * DESCRIPTION
- *
- *    Returns TRUE if the `stream' is UDP stream.  If the `connected' pointer
- *    is non-NULL it will have indication whether the UDP stream is in
- *    connected state.  If it is then packets can be read and written using
- *    silc_stream_read and silc_stream_write.  If it is not then packets
- *    need to read and written by using silc_net_udp_receive and
- *    silc_net_udp_send.
- *
- ***/
-SilcBool silc_socket_stream_is_udp(SilcStream stream, SilcBool *connected);
-
-/****f* silcutil/SilcSocketStreamAPI/silc_socket_stream_get_info
- *
- * SYNOPSIS
- *
- *    SilcBool
- *    silc_socket_stream_get_info(SilcStream stream,
- *                                SilcSocket *sock, const char **hostname,
- *                                const char **ip, SilcUInt16 *port);
- *
- * DESCRIPTION
- *
- *    Returns socket stream information such as the socket, remote hostname,
- *    remote IP address and the remote port of the remote socket connection.
- *    Return FALSE if these informations are not available.
- *
- ***/
-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
- *
- * SYNOPSIS
- *
- *    SilcBool
- *    silc_socket_stream_set_info(SilcStream stream,
- *                                const char *hostname,
- *                                const char *ip, SilcUInt16 port);
- *
- * DESCRIPTION
- *
- *    Use this function to set the hostname, IP address and remote port
- *    information to the socket stream indicated by `stream' if you did not
- *    perform lookup in the silc_socket_tcp_stream_create.  This is not
- *    mandatory but if you would like to associate the information with the
- *    stream use this function.  If the lookup was performed when creating
- *    the stream then calling this function is not necessary.  Use the
- *    function silc_socket_stream_get_info to get the information from the
- *    stream.
- *
- ***/
-SilcBool silc_socket_stream_set_info(SilcStream stream,
-                                    const char *hostname,
-                                    const char *ip, SilcUInt16 port);
-
-/****f* silcutil/SilcSocketStreamAPI/silc_socket_stream_get_error
- *
- * SYNOPSIS
- *
- *    int silc_socket_stream_get_error(SilcStream stream);
- *
- * DESCRIPTION
- *
- *    If error occurred during socket stream operations, this function
- *    can be used to retrieve the error number that occurred.
- *
- ***/
-int silc_socket_stream_get_error(SilcStream stream);
-
-/****f* silcutil/SilcSocketStreamAPI/silc_socket_stream_set_qos
- *
- * SYNOPSIS
- *
- *    SilcBool silc_socket_stream_set_qos(SilcStream stream,
- *                                        SilcUInt32 read_rate,
- *                                        SilcUInt32 read_limit_bytes,
- *                                        SilcUInt32 limit_sec,
- *                                        SilcUInt32 limit_usec)
- *
- * DESCRIPTION
- *
- *    Sets a "Quality of Service" settings for socket stream `stream'.
- *    The `read_rate' specifies the maximum read operations per second.
- *    If more read operations are executed the limit will be applied for
- *    the reading.  The `read_limit_bytes' specifies the maximum data
- *    that is read.  It is guaranteed that silc_stream_read  never returns
- *    more than `read_limit_bytes' of data.  The `limit_sec' and `limit_usec'
- *    specifies the time limit that is applied if `read_rate' and/or
- *    `read_limit_bytes' is reached.  If all arguments except `stream'
- *    are zero this resets the QoS from the socket stream, all QoS for
- *    this socket stream that may be pending will be cancelled.
- *
- ***/
-SilcBool silc_socket_stream_set_qos(SilcStream stream,
-                                   SilcUInt32 read_rate,
-                                   SilcUInt32 read_limit_bytes,
-                                   SilcUInt32 limit_sec,
-                                   SilcUInt32 limit_usec);
-
-#include "silcsocketstream_i.h"
-
-#endif /* SILCSOCKETSTREAM_H */
diff --git a/lib/silcutil/silcsocketstream_i.h b/lib/silcutil/silcsocketstream_i.h
deleted file mode 100644 (file)
index 13013f2..0000000
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
-
-  silcsocketstream_i.h
-
-  Author: Pekka Riikonen <priikone@silcnet.org>
-
-  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
-  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 SILCSOCKETSTREAM_I_H
-#define SILCSOCKETSTREAM_I_H
-
-#ifndef SILCSOCKETSTREAM_H
-#error "Do not include this header directly"
-#endif
-
-typedef struct SilcSocketStreamStruct *SilcSocketStream;
-
-/* Qos context */
-typedef struct SilcSocketQosStruct {
-  SilcUInt16 read_limit_bytes;     /* Max read bytes */
-  SilcUInt16 read_rate;                    /* Max read rate/second */
-  SilcUInt16 limit_sec;                    /* Limit seconds */
-  SilcUInt32 limit_usec;           /* Limit microseconds */
-  struct timeval next_limit;
-  unsigned int cur_rate : 31;
-  unsigned int applied  : 1;
-  SilcUInt32 data_len;
-  unsigned char *buffer;
-  SilcSocketStream sock;
-} *SilcSocketQos;
-
-/* SILC Socket Stream context */
-struct SilcSocketStreamStruct {
-  const SilcStreamOps *ops;
-  SilcSchedule schedule;
-  SilcSocket sock;
-  char *hostname;
-  char *ip;
-  SilcUInt16 port;
-  SilcUInt16 sock_error;
-  SilcSocketQos qos;
-  SilcStreamNotifier notifier;
-  void *notifier_context;
-  unsigned int ipv6      : 1;       /* UDP IPv6 */
-  unsigned int connected : 1;      /* UDP connected state */
-};
-
-#define SILC_IS_SOCKET_STREAM(s) (s && s->ops == &silc_socket_stream_ops)
-#define SILC_IS_SOCKET_STREAM_UDP(s) (s && s->ops == &silc_socket_udp_stream_ops)
-
-extern const SilcStreamOps silc_socket_stream_ops;
-extern const SilcStreamOps silc_socket_udp_stream_ops;
-
-#endif /* SILCSOCKETSTREAM_I_H */
diff --git a/lib/silcutil/silcstack.c b/lib/silcutil/silcstack.c
deleted file mode 100644 (file)
index 6107cf0..0000000
+++ /dev/null
@@ -1,326 +0,0 @@
-/*
-
-  silcstack.c
-
-  Author: Pekka Riikonen <priikone@silcnet.org>
-
-  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
-  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.
-
-*/
-
-/* #define SILC_STACK_DEBUG 1 */
-
-#include "silc.h"
-
-/* Allocate the stack */
-
-SilcStack silc_stack_alloc(SilcUInt32 stack_size)
-{
-  SilcStack stack;
-
-  stack = silc_calloc(1, sizeof(*stack));
-  if (!stack)
-    return NULL;
-
-  stack->frames = silc_calloc(SILC_STACK_DEFAULT_NUM,
-                             sizeof(*stack->frames));
-  if (!stack->frames) {
-    silc_free(stack);
-    return NULL;
-  }
-
-  /* Create initial stack */
-  stack->stack_size = stack_size ? stack_size : SILC_STACK_DEFAULT_SIZE;
-  stack->stack[0] = silc_malloc(stack->stack_size +
-                               SILC_STACK_ALIGN(sizeof(*stack->stack[0]),
-                                                SILC_STACK_DEFAULT_ALIGN));
-  if (!stack->stack[0]) {
-    silc_free(stack->frames);
-    silc_free(stack);
-    return NULL;
-  }
-  stack->stack[0]->bytes_left = stack->stack_size;
-
-  /* Use the allocated stack in first stack frame */
-  stack->frame = &stack->frames[0];
-  stack->frame->prev = NULL;
-  stack->frame->bytes_used = stack->stack_size;
-  stack->frame->sp = 1;
-  stack->frame->si = 0;
-
-  return stack;
-}
-
-/* Frees the stack and all allocated memory */
-
-void silc_stack_free(SilcStack stack)
-{
-  int i;
-
-  if (!stack)
-    return;
-
-  silc_free(stack->frames);
-  for (i = 0; i < SILC_STACK_BLOCK_NUM; i++)
-    silc_free(stack->stack[i]);
-  silc_free(stack);
-}
-
-/* Push to next stack frame */
-
-SilcUInt32 silc_stack_push(SilcStack stack, SilcStackFrame *frame)
-{
-  if (!stack)
-    return 0;
-
-  if (!frame) {
-    /* See if all frames are in use, and allocate SILC_STACK_DEFAULT_NUM
-       many new frames if needed. */
-    if (stack->frame->sp >= SILC_STACK_ALIGN(stack->frame->sp,
-                                            SILC_STACK_DEFAULT_NUM)) {
-      int i = stack->frame->sp;
-      SILC_LOG_DEBUG(("Allocating more stack frames"));
-      frame = silc_realloc(stack->frames,
-                          SILC_STACK_ALIGN(i + 1, SILC_STACK_DEFAULT_NUM) *
-                          sizeof(*stack->frames));
-      if (!frame)
-       return 0;
-      stack->frames = frame;
-      stack->frame = &stack->frames[i - 1];
-
-      /* The prev pointers may become invalid in silc_realloc() */
-      for (i = 1; i < stack->frame->sp; i++)
-       stack->frames[i].prev = &stack->frames[i - 1];
-    }
-
-    frame = &stack->frames[stack->frame->sp];
-  }
-
-  /* Push */
-  frame->prev = stack->frame;
-  frame->sp = stack->frame->sp + 1;
-  frame->si = stack->frame->si;
-  frame->bytes_used = stack->stack[frame->si]->bytes_left;
-  stack->frame = frame;
-
-  SILC_ST_DEBUG(("Push %p: sp %d -> %d, si %d", stack, frame->prev->sp,
-                frame->sp, frame->si));
-
-  return stack->frame->sp;
-}
-
-/* Pop to previous stack frame */
-
-SilcUInt32 silc_stack_pop(SilcStack stack)
-{
-  SilcUInt32 si;
-
-  if (!stack)
-    return 0;
-
-  /* Pop */
-  assert(stack->frame->prev);
-  si = stack->frame->si;
-  while (si > stack->frame->prev->si) {
-    if (stack->stack[si])
-      stack->stack[si]->bytes_left = SILC_STACK_BLOCK_SIZE(stack, si);
-    si--;
-  }
-  stack->stack[si]->bytes_left = stack->frame->bytes_used;
-  stack->frame = stack->frame->prev;
-
-  SILC_ST_DEBUG(("Pop %p: sp %d -> %d, si %d", stack, stack->frame->sp + 1,
-                stack->frame->sp, stack->frame->si));
-
-  return stack->frame->sp + 1;
-}
-
-/* Allocate memory.  If the `aligned' is FALSE this allocates unaligned
-   memory, otherwise memory is aligned.  Returns pointer to the memory
-   or NULL on error. */
-
-void *silc_stack_malloc(SilcStack stack, SilcUInt32 size, SilcBool aligned)
-{
-  void *ptr;
-  SilcUInt32 bsize, bsize2;
-  SilcUInt32 si = stack->frame->si;
-
-  SILC_STACK_STAT(stack, num_malloc, 1);
-  SILC_ST_DEBUG(("Allocating %d bytes (%s) from %p",
-                size, aligned ? "align" : "not align", stack));
-
-  if (silc_unlikely(!size)) {
-    SILC_LOG_ERROR(("Allocation by zero (0)"));
-    SILC_STACK_STAT(stack, num_errors, 1);
-    return NULL;
-  }
-
-  if (silc_unlikely(size > SILC_STACK_MAX_ALLOC)) {
-    SILC_LOG_ERROR(("Allocating too much"));
-    SILC_STACK_STAT(stack, num_errors, 1);
-    return NULL;
-  }
-
-  /* Align properly if wanted */
-  size = (aligned ? SILC_STACK_ALIGN(size, SILC_STACK_DEFAULT_ALIGN) : size);
-
-  /* Compute the size of current stack block */
-  bsize = SILC_STACK_BLOCK_SIZE(stack, si);
-
-  /* See if there is space in the current stack block */
-  if (stack->stack[si]->bytes_left >= size) {
-    /* Get pointer to the memory */
-    ptr = SILC_STACK_DATA(stack, si, bsize);
-    stack->stack[si]->bytes_left -= size;
-    SILC_STACK_STAT(stack, bytes_malloc, size);
-    return ptr;
-  }
-
-  /* There is not enough space in this block.  Find the spot to stack
-     block that can handle this size memory. */
-  if (bsize < SILC_STACK_DEFAULT_SIZE)
-    bsize = SILC_STACK_DEFAULT_SIZE;
-  bsize += size;
-  bsize2 = SILC_STACK_DEFAULT_SIZE;
-  si = 0;
-  while (bsize2 < bsize) {
-    bsize2 <<= 1;
-    si++;
-  }
-  if (silc_unlikely(si >= SILC_STACK_BLOCK_NUM)) {
-    SILC_LOG_ERROR(("Allocating too large block"));
-    SILC_STACK_STAT(stack, num_errors, 1);
-    return NULL;
-  }
-
-  /* Allocate the block if it doesn't exist yet */
-  if (!stack->stack[si]) {
-    SILC_ST_DEBUG(("Allocating new stack block, %d bytes", bsize2));
-    stack->stack[si] = silc_malloc(bsize2 +
-                                  SILC_STACK_ALIGN(sizeof(**stack->stack),
-                                                   SILC_STACK_DEFAULT_ALIGN));
-    if (silc_unlikely(!stack->stack[si])) {
-      SILC_STACK_STAT(stack, num_errors, 1);
-      return NULL;
-    }
-    stack->stack[si]->bytes_left = bsize2;
-  }
-
-  /* Now return memory from this new block.  It is guaranteed that in this
-     block there is enough space for this memory. */
-  assert(stack->stack[si]->bytes_left >= size);
-  ptr = SILC_STACK_DATA(stack, si, bsize2);
-  stack->stack[si]->bytes_left -= size;
-  stack->frame->si = si;
-  SILC_STACK_STAT(stack, bytes_malloc, size);
-
-  return ptr;
-}
-
-/* Attempts to reallocate memory by changing the size of the `ptr' into
-   `size'.  This routine works only if the previous allocation to `stack'
-   was `ptr'.  If there is another memory allocation between allocating
-   `ptr' and this call this routine will return NULL.  NULL is also returned
-   if the `size' does not fit into the current block.  If NULL is returned
-   the old memory remains intact. */
-
-void *silc_stack_realloc(SilcStack stack, SilcUInt32 old_size,
-                        void *ptr, SilcUInt32 size, SilcBool aligned)
-{
-  SilcUInt32 si = stack->frame->si;
-  SilcUInt32 bsize;
-  void *sptr;
-
-  if (!ptr)
-    return silc_stack_malloc(stack, size, aligned);
-
-  SILC_STACK_STAT(stack, num_malloc, 1);
-  SILC_ST_DEBUG(("Reallocating %d bytes (%d) (%s) from %p", size, old_size,
-                aligned ? "align" : "not align", stack));
-
-  if (silc_unlikely(!size || !old_size)) {
-    SILC_LOG_ERROR(("Allocation by zero (0)"));
-    SILC_STACK_STAT(stack, num_errors, 1);
-    return NULL;
-  }
-
-  if (silc_unlikely(size > SILC_STACK_MAX_ALLOC)) {
-    SILC_LOG_ERROR(("Allocating too much"));
-    SILC_STACK_STAT(stack, num_errors, 1);
-    return NULL;
-  }
-
-  /* Align the old size if needed */
-  old_size = (aligned ?
-             SILC_STACK_ALIGN(old_size,
-                              SILC_STACK_DEFAULT_ALIGN) : old_size);
-
-  /* Compute the size of current stack block */
-  bsize = SILC_STACK_BLOCK_SIZE(stack, si);
-
-  /* Check that `ptr' is last allocation */
-  sptr = (unsigned char *)stack->stack[si] +
-    SILC_STACK_ALIGN(sizeof(**stack->stack), SILC_STACK_DEFAULT_ALIGN);
-  if (stack->stack[si]->bytes_left + old_size +
-      ((unsigned char *)ptr - (unsigned char *)sptr) != bsize) {
-    SILC_LOG_DEBUG(("Cannot reallocate"));
-    SILC_STACK_STAT(stack, num_errors, 1);
-    return NULL;
-  }
-
-  /* Now check that the new size fits to this block */
-  if (stack->stack[si]->bytes_left >= size) {
-    /* It fits, so simply return the old pointer */
-    size = (aligned ? SILC_STACK_ALIGN(size,
-                                      SILC_STACK_DEFAULT_ALIGN) : size);
-    stack->stack[si]->bytes_left -= (size - old_size);
-    SILC_STACK_STAT(stack, bytes_malloc, (size - old_size));
-    return ptr;
-  }
-
-  SILC_LOG_DEBUG(("Cannot reallocate in this block"));
-  SILC_STACK_STAT(stack, num_errors, 1);
-  return NULL;
-}
-
-#ifdef SILC_DIST_INPLACE
-/* Statistics dumping. */
-
-void silc_stack_stats(SilcStack stack)
-{
-  SilcUInt32 stack_size = 0;
-  int i, c = 0;
-
-  for (i = 0; i < SILC_STACK_BLOCK_NUM; i++) {
-    if (!stack->stack[i])
-      continue;
-    stack_size += SILC_STACK_BLOCK_SIZE(stack, i);
-    c++;
-  }
-
-  fprintf(stdout, "\nSilcStack %p statistics :\n\n", stack);
-  fprintf(stdout, "  Size of stack           : %u\n",
-         (unsigned int)stack_size);
-  fprintf(stdout, "  Number of allocs        : %u\n",
-         (unsigned int)stack->snum_malloc);
-  fprintf(stdout, "  Bytes allocated         : %u\n",
-         (unsigned int)stack->sbytes_malloc);
-  fprintf(stdout, "  Average alloc size      : %.2f\n",
-         (double)((double)stack->sbytes_malloc / (double)stack->snum_malloc));
-  fprintf(stdout, "  Number of alloc errors  : %u\n",
-         (unsigned int)stack->snum_errors);
-  fprintf(stdout, "  Number of frames        : %u\n",
-         (unsigned int)SILC_STACK_ALIGN(stack->frame->sp,
-                                        SILC_STACK_DEFAULT_NUM));
-  fprintf(stdout, "  Number of blocks        : %u\n", c);
-}
-#endif /* SILC_DIST_INPLACE */
diff --git a/lib/silcutil/silcstack.h b/lib/silcutil/silcstack.h
deleted file mode 100644 (file)
index 3543de2..0000000
+++ /dev/null
@@ -1,228 +0,0 @@
-/*
-
-  silcstack.h
-
-  Author: Pekka Riikonen <priikone@silcnet.org>
-
-  Copyright (C) 2003 - 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.
-
-*/
-
-/****h* silcutil/SilcStack Interface
- *
- * DESCRIPTION
- *
- * Implementation of data stack which can be used to allocate memory from
- * the stack.  Basicly 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 can be used to allocate both aligned and unaligned memory so
- * it is suitable for allocating structures and is optimal for allocating
- * strings and data buffers.  SilcStack also supports stack pushing and
- * popping allowing to push the stack, allocate memory and then pop it
- * to free the allocated memory.  The freeing does not actually do any
- * real memory freeing so it is optimized for performance.
- *
- * 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:
- *
- * silc_smalloc, silc_smalloc_ua, silc_scalloc, silc_srealloc, silc_smemdup,
- * 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
- *
- * The data stack is not thread-safe.  If the same stack context must be
- * used in multithreaded environment concurrency control must be employed.
- * Each thread should allocate their own SilcStack.
- *
- ***/
-
-#ifndef SILCSTACK_H
-#define SILCSTACK_H
-
-/****s* silcutil/SilcStackAPI/SilcStack
- *
- * NAME
- *
- *    typedef struct SilcStackStruct *SilcStack;
- *
- * DESCRIPTION
- *
- *    This context represents the stack and it is allocated by
- *    silc_stack_alloc and is destroyed with silc_stack_free functions.
- *    The context is given as argument to all routines that use this
- *    stack allocation library.
- *
- ***/
-typedef struct SilcStackStruct *SilcStack;
-
-/****s* silcutil/SilcStackAPI/SilcStackFrame
- *
- * NAME
- *
- *    typedef struct SilcStackFrameStruct SilcStackFrame;
- *
- * DESCRIPTION
- *
- *    Static stack frame context that optionally can be used as stack
- *    frame in SilcStack.  By default silc_stack_push use pre-allocated
- *    stack frame (or allocates new one if all frames are reserved), but
- *    user may also use statically allocated SilcStackFrame instead.  This
- *    is recommended when using SilcStack in recursive routine and the
- *    recursion may become deep.  Using static frame assures that during
- *    recursion frames never run out and silc_stack_push never allocates
- *    any memory.  In other normal usage statically allocated SilcStackFrame
- *    is not needed, unless performance is critical.
- *
- ***/
-typedef struct SilcStackFrameStruct SilcStackFrame;
-
-/****f* silcutil/SilcStackAPI/silc_stack_alloc
- *
- * SYNOPSIS
- *
- *    SilcStack silc_stack_alloc(SilcUInt32 stack_size);
- *
- * DESCRIPTION
- *
- *    Allocates new data stack that can be used as stack for fast memory
- *    allocation by various routines.  Returns the pointer to the stack
- *    that must be freed with silc_stack_free function when it is not
- *    needed anymore.  If the `stack_size' is zero (0) by default a
- *    1 kilobyte (1024 bytes) stack is allocated.  If the `stack_size'
- *    is non-zero the byte value must be multiple by 8.
- *
- ***/
-SilcStack silc_stack_alloc(SilcUInt32 stack_size);
-
-/****f* silcutil/SilcStackAPI/silc_stack_free
- *
- * SYNOPSIS
- *
- *    void silc_stack_free(SilcStack stack);
- *
- * DESCRIPTION
- *
- *    Frees the data stack context.  The stack cannot be used anymore after
- *    this and all allocated memory are freed.
- *
- ***/
-void silc_stack_free(SilcStack stack);
-
-/****f* silcutil/SilcStackAPI/silc_stack_push
- *
- * SYNOPSIS
- *
- *    SilcUInt32 silc_stack_push(SilcStack stack, SilcStackFrame *frame);
- *
- * DESCRIPTION
- *
- *    Push the top of the stack down which becomes the new top of the stack.
- *    For every silc_stack_push call there must be silc_stack_pop call.  All
- *    allocations between these two calls will be done from the top of the
- *    stack and all allocated memory is freed after the next silc_stack_pop
- *    is called.  This returns so called stack pointer for the new stack
- *    frame, which the caller may use to check that all calls to
- *    silc_stack_pop has been made.  This call may do a small memory
- *    allocation in some cases, but usually it does not allocate any memory.
- *    If this returns zero (0) the system is out of memory.
- *
- *    If the `frame' is non-NULL then that SilcStackFrame is used as
- *    stack frame.  Usually `frame' is set to NULL by user.  Statically
- *    allocated SilcStackFrame should be used when using silc_stack_push
- *    in recursive function and the recursion may become deep.  In this
- *    case using statically allocated SilcStackFrame is recommended since
- *    it assures that frames never run out and silc_stack_push never
- *    allocates any memory.  If your routine is not recursive then
- *    setting `frame' to NULL is recommended, unless performance is
- *    critical.
- *
- *    This function is used when a routine is doing frequent allocations
- *    from the stack.  If the stack is not pushed and later popped all
- *    allocations are made from the stack and the stack eventually runs out
- *    (it gets enlarged by normal memory allocation).  By pushing and then
- *    later popping the frequent allocations does not consume the stack.
- *
- *    If `stack' is NULL this call has no effect.
- *
- * EXAMPLE
- *
- *    All memory allocations in silc_foo_parse_packet will be done in
- *    a fresh stack frame and that data is freed after the parsing is
- *    completed.
- *
- *    silc_stack_push(stack, NULL);
- *    silc_foo_parse_packet(packet, stack);
- *    silc_stack_pop(stack);
- *
- *    Another example with recursion and using statically allocated
- *    SilcStackFrame.  After popping the statically allocated frame can
- *    be reused if necessary.
- *
- *    void silc_foo_this_function(SilcStack stack)
- *    {
- *      SilcStackFrame frame;
- *      ...
- *      silc_stack_push(stack, &frame);
- *      silc_foo_this_function(stack);   // Call recursively
- *      silc_stack_pop(stack);
- *      ...
- *    }
- *
- ***/
-SilcUInt32 silc_stack_push(SilcStack stack, SilcStackFrame *frame);
-
-/****f* silcutil/SilcStackAPI/silc_stack_pop
- *
- * SYNOPSIS
- *
- *    SilcUInt32 silc_stack_pop(SilcStack stack);
- *
- * DESCRIPTION
- *
- *    Pop the top of the stack upwards which reveals the previous stack frame
- *    and becomes the top of the stack.  After popping, memory allocated in
- *    the old frame is freed.  For each silc_stack_push call there must be
- *    silc_stack_pop call to free all memory (in reality any memory is not
- *    freed but within the stack it is).  This returns the stack pointer of
- *    old frame after popping and caller may check that it is same as
- *    returned by the silc_stack_push.  If it they differ, some routine
- *    has called silc_stack_push but has not called silc_stack_pop, or
- *    silc_stack_pop has been called too many times.  Application should
- *    treat this as a fatal error, as it is a bug in the application code.
- *
- *    If `stack' is NULL this call has no effect.
- *
- * EXAMPLE
- *
- *    This example saves the stack pointer which is checked when popping
- *    the current stack frame.  If the stack pointer differs then someone
- *    has pushed the stack frame but forgot to pop it (or has called it
- *    too many times).
- *
- *    sp = silc_stack_push(stack, NULL);
- *    silc_foo_parse_packet(packet, stack);
- *    if (silc_stack_pop(stack) != sp)
- *      fatal("corrupted stack");
- *
- ***/
-SilcUInt32 silc_stack_pop(SilcStack stack);
-
-#include "silcstack_i.h"
-
-#endif /* SILCSTACK_H */
diff --git a/lib/silcutil/silcstack_i.h b/lib/silcutil/silcstack_i.h
deleted file mode 100644 (file)
index 33c9032..0000000
+++ /dev/null
@@ -1,112 +0,0 @@
-/*
-
-  silcstack_i.h
-
-  Author: Pekka Riikonen <priikone@silcnet.org>
-
-  Copyright (C) 2003 - 2005 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 SILCSTACK_I_H
-#define SILCSTACK_I_H
-
-#ifndef SILCSTACK_H
-#error "Do not include this header directly"
-#endif
-
-/* The default stack size when stack is created */
-#define SILC_STACK_DEFAULT_SIZE       1024
-
-/* Number of pre-allocated stack frames */
-#define SILC_STACK_DEFAULT_NUM        8
-
-/* Default alignment */
-#define SILC_STACK_DEFAULT_ALIGN      sizeof(unsigned long)
-
-/* Maximum allocation that can be made with SilcStack.  This is
-   SILC_STACK_DEFAULT_SIZE * (2 ^ (SILC_STACK_BLOCK_NUM - 1)). */
-#define SILC_STACK_MAX_ALLOC          0x02000000
-#define SILC_STACK_BLOCK_NUM          16
-
-/* Stack frame data area */
-typedef struct SilcStackDataStruct {
-  SilcUInt32 bytes_left;                     /* Free bytes in stack */
-  /* Stack data area starts here */
-} *SilcStackData;
-
-/* Stack frame */
-struct SilcStackFrameStruct {
-  struct SilcStackFrameStruct *prev;          /* Pointer to previous frame */
-  SilcUInt32 bytes_used;                     /* Bytes used when pushed */
-  unsigned int sp : 27;                              /* Stack pointer */
-  unsigned int si : 5;                       /* Stack index */
-};
-
-/* The SilcStack context */
-struct SilcStackStruct {
-  SilcStackData stack[SILC_STACK_BLOCK_NUM];  /* Allocated stack blocks */
-  SilcStackFrame *frames;                    /* Allocated stack frames */
-  SilcStackFrame *frame;                     /* Current stack frame */
-  SilcUInt32 stack_size;                     /* Default stack size */
-#ifdef SILC_DIST_INPLACE
-  /* Statistics */
-  SilcUInt32 snum_malloc;
-  SilcUInt32 sbytes_malloc;
-  SilcUInt32 snum_errors;
-#endif /* SILC_DIST_INPLACE */
-};
-
-/* Align the requested amount bytes.  The `align' defines the requested
-   alignment. */
-#define SILC_STACK_ALIGN(bytes, align) (((bytes) + (align - 1)) & ~(align - 1))
-
-/* Computes the size of stack block si. */
-#define SILC_STACK_BLOCK_SIZE(stack, si)               \
-  (((si) == 0) ? stack->stack_size :                   \
-   SILC_STACK_DEFAULT_SIZE * (1L << ((si) - 1)) << 1);
-
-/* Returns a pointer to the data in the frame */
-#define SILC_STACK_DATA(stack, si, bsize)                                \
-  (((unsigned char *)(stack)->stack[si]) +                               \
-   SILC_STACK_ALIGN(sizeof(**(stack)->stack), SILC_STACK_DEFAULT_ALIGN) + \
-   ((bsize) - (stack)->stack[si]->bytes_left))
-
-#ifdef SILC_DIST_INPLACE
-/* Statistics updating */
-#define SILC_STACK_STAT(stack, stat, val) ((stack)->s ## stat += (val))
-#define SILC_ST_DEBUG(fmt) SILC_LOG_DEBUG(fmt)
-#else /* !SILC_DIST_INPLACE */
-#define SILC_STACK_STAT(stack, stat, val)
-#define SILC_ST_DEBUG(fmt)
-#endif /* SILC_DIST_INPLACE */
-
-/* Allocate memory.  If the `aligned' is FALSE this allocates unaligned
-   memory, otherwise memory is aligned.  Returns pointer to the memory
-   or NULL on error. */
-void *silc_stack_malloc(SilcStack stack, SilcUInt32 size, SilcBool aligned);
-
-/* Attempts to reallocate memory by changing the size of the `ptr' into
-   `size'.  This routine works only if the previous allocation to `stack'
-   was `ptr'.  If there is another memory allocation between allocating
-   `ptr' and this call this routine will return NULL.  NULL is also returned
-   if the `size' does not fit into the current block.  If NULL is returned
-   the old memory remains intact. */
-void *silc_stack_realloc(SilcStack stack, SilcUInt32 old_size,
-                        void *ptr, SilcUInt32 size, SilcBool aligned);
-
-#ifdef SILC_DIST_INPLACE
-/* Prints statistics of the usage of SilcStack to stdout. */
-void silc_stack_stats(SilcStack stack);
-#endif /* SILC_DIST_INPLACE */
-
-#endif /* SILCSTACK_I_H */
diff --git a/lib/silcutil/silcstream.c b/lib/silcutil/silcstream.c
deleted file mode 100644 (file)
index af4789d..0000000
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
-
-  silcstream.c
-
-  Author: Pekka Riikonen <priikone@silcnet.org>
-
-  Copyright (C) 2005 - 2006 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.
-
-*/
-
-#include "silc.h"
-
-typedef struct {
-  SilcStreamOps *ops;
-} *SilcStreamHeader;
-
-int silc_stream_read(SilcStream stream, unsigned char *buf,
-                    SilcUInt32 buf_len)
-{
-  SilcStreamHeader h = stream;
-  return h->ops->read(stream, buf, buf_len);
-}
-
-int silc_stream_write(SilcStream stream, const unsigned char *data,
-                     SilcUInt32 data_len)
-{
-  SilcStreamHeader h = stream;
-  return h->ops->write(stream, data, data_len);
-}
-
-SilcBool silc_stream_close(SilcStream stream)
-{
-  SilcStreamHeader h = stream;
-  return h->ops->close(stream);
-}
-
-void silc_stream_destroy(SilcStream stream)
-{
-  SilcStreamHeader h = stream;
-  h->ops->destroy(stream);
-}
-
-SilcBool silc_stream_set_notifier(SilcStream stream, SilcSchedule schedule,
-                                 SilcStreamNotifier notifier, void *context)
-{
-  SilcStreamHeader h = stream;
-  return h->ops->notifier(stream, schedule, notifier, context);
-}
-
-SilcSchedule silc_stream_get_schedule(SilcStream stream)
-{
-  SilcStreamHeader h = stream;
-  return h->ops->get_schedule(stream);
-}
diff --git a/lib/silcutil/silcstream.h b/lib/silcutil/silcstream.h
deleted file mode 100644 (file)
index 3067313..0000000
+++ /dev/null
@@ -1,277 +0,0 @@
-/*
-
-  silcstream.h
-
-  Author: Pekka Riikonen <priikone@silcnet.org>
-
-  Copyright (C) 2005 - 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.
-
-*/
-
-/****h* silcutil/SILC Stream Interface
- *
- * DESCRIPTION
- *
- * SILC Stream API is a generic representation of a stream.  A common API
- * is defined that can be used to read from and write to the stream.  Any
- * other stream API derived from this API can use this same interface for
- * reading and writing.
- *
- * Note that stream implementations usually are not thread-safe.  Always
- * verify whether a stream implementation is thread-safe by checking their
- * corresponding documentation.
- *
- ***/
-
-#ifndef SILCSTREAM_H
-#define SILCSTREAM_H
-
-/****s* silcutil/SilcStreamAPI/SilcStream
- *
- * NAME
- *
- *    typedef void *SilcStream;
- *
- * DESCRIPTION
- *
- *    Abstact stream context representing any stream.  All streams are using
- *    this abstraction so that the stream can be accessed using the standard
- *    silc_stream_* functions.  All streams are destroyed by calling the
- *    silc_stream_destroy function.
- *
- ***/
-typedef void *SilcStream;
-
-/****d* silcutil/SilcStreamAPI/SilcStreamStatus
- *
- * NAME
- *
- *    typedef enum { ... } SilcStreamStatus;
- *
- * DESCRIPTION
- *
- *    Stream status.  This status is returned into the SilcStreamNotifier
- *    callback function to indicate the status of the stream at a given
- *    moment.
- *
- * SOURCE
- */
-typedef enum {
-  SILC_STREAM_CAN_READ,                /* Data available for reading */
-  SILC_STREAM_CAN_WRITE,       /* Stream ready for writing */
-  SILC_STREAM_EOS,             /* End of stream */
-  SILC_STREAM_CLOSED,          /* Stream is closed */
-  SILC_STREAM_INVALID,         /* Stream is invalid */
-  SILC_STREAM_NO_MEMORY,       /* System out of memory */
-  SILC_STREAM_ERROR,           /* Unknown error */
-} SilcStreamStatus;
-/***/
-
-/****f* silcutil/SilcStreamAPI/SilcStreamNotifier
- *
- * SYNOPSIS
- *
- *    typedef void (*SilcStreamNotifier)(SilcStream stream,
- *                                       SilcStreamStatus status,
- *                                       void *context);
- *
- * DESCRIPTION
- *
- *    A callback of this type is called as stream notifier to notify of a
- *    certain action taken over the stream.  This is called to notify for
- *    example that data is ready for reading, or writing or that end of
- *    stream occurred.
- *
- ***/
-typedef void (*SilcStreamNotifier)(SilcStream stream,
-                                  SilcStreamStatus status,
-                                  void *context);
-
-/****s* silcutil/SilcStreamAPI/SilcStreamOps
- *
- * NAME
- *
- *    typedef struct { ... } SilcStreamOps;
- *
- * DESCRIPTION
- *
- *    SILC Stream operations structure.  This structure includes callback
- *    functions to the actual stream implementation.  Any stream that
- *    use SILC Stream abstraction must fill this structure with the actual
- *    stream implementation.
- *
- *    Each stream implementation MUST set this structure as the first field
- *    in their stream structure.  As it is that structure that is passed
- *    to the silc_stream_* routines, the SILC Stream API expects that the
- *    SilcStream context starts with this structure.
- *
- * EXAMPLE
- *
- *    typedef struct {
- *      const SilcStreamOps *ops;
- *      ... other stuff ...
- *    } *SilcFooStream;
- *
- *    SilcFooStream foo;
- *    silc_stream_write(foo, data, data_len);
- *
- * SOURCE
- */
-typedef struct {
-  /* This is called to read data from the stream.  This is called when
-     silc_stream_read function was called. */
-  int (*read)(SilcStream stream, unsigned char *buf, SilcUInt32 buf_len);
-
-  /* This is called when writing data to the stream.  This is called when
-     silc_stream_write function was called. */
-  int (*write)(SilcStream stream, const unsigned char *data,
-              SilcUInt32 data_len);
-
-  /* This is called to close the stream.  This is called when the
-     silc_stream_close function was called. */
-  SilcBool (*close)(SilcStream stream);
-
-  /* This is called to destroy the stream.  This is called when the
-     silc_stream_destroy function was called. */
-  void (*destroy)(SilcStream stream);
-
-  /* This is called to set a notifier callback to the stream and schedule
-     the stream.  Stream should not be scheduled before calling this
-     function.  If stream does not need scheduler then the scheduler can
-     be ignored.  This is called when silc_stream_set_notifier was called.
-     Returns FALSE if the stream could not be scheduled. */
-  SilcBool (*notifier)(SilcStream stream, SilcSchedule schedule,
-                      SilcStreamNotifier callback, void *context);
-
-  /* This is called to return the associated scheduler, if set.  This is
-     called when silc_stream_get_schedule was called. */
-  SilcSchedule (*get_schedule)(SilcStream stream);
-} SilcStreamOps;
-/***/
-
-/****f* silcutil/SilcStreamAPI/silc_stream_read
- *
- * SYNOPSIS
- *
- *    int silc_stream_read(SilcStream stream, unsigned char *buf,
- *                         SilcUInt32 buf_len);
- *
- * DESCRIPTION
- *
- *    Reads data from the stream indicated by `stream' into the data buffer
- *    indicated by `buf' which is size of `buf_len'.  This returns the amount
- *    of data read, zero (0) if end of stream occurred, -1 if data could
- *    not be read at this moment, or -2 if error occurred.  If -1 is returned
- *    the notifier callback will later be called with SILC_STREAM_CAN_READ
- *    status when stream is again ready for reading.
- *
- ***/
-int silc_stream_read(SilcStream stream, unsigned char *buf,
-                    SilcUInt32 buf_len);
-
-/****f* silcutil/SilcStreamAPI/silc_stream_write
- *
- * SYNOPSIS
- *
- *    int silc_stream_write(SilcStream stream, const unsigned char *data,
- *                          SilcUInt32 data_len);
- *
- * DESCRIPTION
- *
- *    Writes `data_len' bytes of data to the stream indicated by `stream' from
- *    data buffer indicated by `data'.  Returns the amount of data written,
- *    zero (0) if end of stream occurred, -1 if data could not be written
- *    at this moment, or -2 if error occurred.  If -1 is returned the
- *    notifier callback will later be called with SILC_STREAM_CAN_WRITE
- *    status when stream is again ready for writing.
- *
- ***/
-int silc_stream_write(SilcStream stream, const unsigned char *data,
-                     SilcUInt32 data_len);
-
-/****f* silcutil/SilcStreamAPI/silc_stream_close
- *
- * SYNOPSIS
- *
- *    SilcBool silc_stream_close(SilcStream stream);
- *
- * DESCRIPTION
- *
- *    Closes the stream indicated by `stream'.  No data can be read or written
- *    to the stream after calling this function.  Return TRUE if the stream
- *    could be closed.  If action is taken on closed stream the notifier
- *    callback may be called with an error status.
- *
- ***/
-SilcBool silc_stream_close(SilcStream stream);
-
-/****f* silcutil/SilcStreamAPI/silc_stream_destroy
- *
- * SYNOPSIS
- *
- *    void silc_stream_destroy(SilcStream stream);
- *
- * DESCRIPTION
- *
- *    Destroy the stream indicated by `stream'.  The `stream' will become
- *    invalid after this function returns.  All streams are destroyed by
- *    calling this function.  The silc_stream_close should be called
- *    before calling this function.  However, if it is not called this
- *    function will call it.
- *
- ***/
-void silc_stream_destroy(SilcStream stream);
-
-/****f* silcutil/SilcStreamAPI/silc_stream_set_notifier
- *
- * SYNOPSIS
- *
- *    SilcBool silc_stream_set_notifier(SilcStream stream,
- *                                      SilcSchedule schedule,
- *                                      SilcStreamNotifier notifier,
- *                                      void *context);
- *
- * DESCRIPTION
- *
- *    Schedule `stream' for stream events.  Set the `notifier' callback to
- *    be called when some event takes place on the stream.  The event will
- *    be delievered to the `notifier' callback with the `context'.  It is
- *    called for example when data is available for reading or writing, or
- *    if an error occurs.  This can be called at any time for valid stream.
- *    This call will also set the `stream' into non-blocking mode.
- *
- *    If `notifier' is set to NULL no callback will be called for the stream,
- *    and the stream is not scheduled anymore.
- *
- *    This function returns FALSE if the `schedule' was provided and the
- *    stream could not be scheduled.  The actual API for `stream' may provide
- *    access to the actual error information.  Returns TRUE on success.
- *
- ***/
-SilcBool silc_stream_set_notifier(SilcStream stream, SilcSchedule schedule,
-                                 SilcStreamNotifier notifier, void *context);
-
-/****f* silcutil/SilcStreamAPI/silc_stream_get_schedule
- *
- * SYNOPSIS
- *
- *    SilcSchedule silc_stream_get_schedule(SilcStream stream);
- *
- * DESCRIPTION
- *
- *    Returns the scheduler that has been associated with the `stream', or
- *    NULL if one has not been set for the `stream'.
- *
- ***/
-SilcSchedule silc_stream_get_schedule(SilcStream stream);
-
-#endif /* SILCSTREAM_H */
diff --git a/lib/silcutil/silcstringprep.c b/lib/silcutil/silcstringprep.c
deleted file mode 100644 (file)
index b1716cc..0000000
+++ /dev/null
@@ -1,269 +0,0 @@
-/*
-
-  silcstringprep.c
-
-  Author: Pekka Riikonen <priikone@silcnet.org>
-
-  Copyright (C) 2004 - 2005 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.
-
-*/
-
-#include "silc.h"
-#include "silcstringprep.h"
-#include "stringprep.h"
-
-/* We use GNU Libidn which has stringprep to do the magic.  Only bad thing
-   is that its interface is idiotic.  We have our own API here in case
-   we'll implement it ourselves later. */
-
-/* Prohibited characters as defined by the protocol in Appendix C */
-const Stringprep_table_element silc_appendix_c[] =
-{
-  {0x000021}, {0x00002A}, {0x00002C}, {0x00003F}, {0x000040},
-  {0}
-};
-
-/* Prohibited characters as defined by the protocol in Appendix D */
-const Stringprep_table_element silc_appendix_d[] =
-{
-  {0x0000A2, 0x0000A9},
-  {0x0000AC}, {0x0000AE}, {0x0000AF}, {0x0000B0}, {0x0000B1}, {0x0000B4},
-  {0x0000B6}, {0x0000B8}, {0x0000D7}, {0x0000F7},
-  {0x0002C2, 0x0002C5}, {0x0002D2, 0x0002FF},
-  {0x000374}, {0x000375}, {0x000384}, {0x000385}, {0x0003F6}, {0x000482},
-  {0x00060E}, {0x00060F}, {0x0006E9}, {0x0006FD}, {0x0006FE}, {0x0009F2},
-  {0x0009F3}, {0x0009FA}, {0x000AF1}, {0x000B70},
-  {0x000BF3, 0x000BFA}, {0x000E3F},
-  {0x000F01, 0x000F03}, {0x000F13, 0x000F17}, {0x000F1A, 0x000F1F},
-  {0x000F34}, {0x000F36}, {0x000F38}, {0x000FBE}, {0x000FBF},
-  {0x000FC0, 0x000FC5}, {0x000FC7, 0x000FCF}, {0x0017DB}, {0x001940},
-  {0x0019E0, 0x0019FF}, {0x001FBD}, {0x001FBF, 0x001FC1},
-  {0x001FCD, 0x001FCF}, {0x001FDD, 0x001FDF}, {0x001FED, 0x001FEF},
-  {0x001FFD}, {0x001FFE}, {0x002044}, {0x002052}, {0x00207A, 0x00207C},
-  {0x00208A, 0x00208C}, {0x0020A0, 0x0020B1}, {0x002100, 0x00214F},
-  {0x002150, 0x00218F}, {0x002190, 0x0021FF}, {0x002200, 0x0022FF},
-  {0x002300, 0x0023FF}, {0x002400, 0x00243F}, {0x002440, 0x00245F},
-  {0x002460, 0x0024FF}, {0x002500, 0x00257F}, {0x002580, 0x00259F},
-  {0x0025A0, 0x0025FF}, {0x002600, 0x0026FF}, {0x002700, 0x0027BF},
-  {0x0027C0, 0x0027EF}, {0x0027F0, 0x0027FF}, {0x002800, 0x0028FF},
-  {0x002900, 0x00297F}, {0x002980, 0x0029FF}, {0x002A00, 0x002AFF},
-  {0x002B00, 0x002BFF}, {0x002E9A}, {0x002EF4, 0x002EFF},
-  {0x002FF0, 0x002FFF}, {0x00303B, 0x00303D}, {0x003040},
-  {0x003095, 0x003098}, {0x00309F, 0x0030A0}, {0x0030FF, 0x003104},
-  {0x00312D, 0x003130}, {0x00318F}, {0x0031B8, 0x0031FF},
-  {0x00321D, 0x00321F}, {0x003244, 0x00325F}, {0x00327C, 0x00327E},
-  {0x0032B1, 0x0032BF}, {0x0032CC, 0x0032CF}, {0x0032FF},
-  {0x003377, 0x00337A}, {0x0033DE, 0x0033DF}, {0x0033FF},
-  {0x004DB6, 0x004DFF},
-  {0x009FA6, 0x009FFF}, {0x00A48D, 0x00A48F}, {0x00A4A2, 0x00A4A3},
-  {0x00A4B4}, {0x00A4C1}, {0x00A4C5}, {0x00A4C7, 0x00ABFF},
-  {0x00D7A4, 0x00D7FF}, {0x00FA2E, 0x00FAFF}, {0x00FFE0, 0x00FFEE},
-  {0x00FFFC}, {0x010000, 0x01007F}, {0x010080, 0x0100FF},
-  {0x010100, 0x01013F}, {0x01D000, 0x01D0FF}, {0x01D100, 0x01D1FF},
-  {0x01D300, 0x01D35F}, {0x01D400, 0x01D7FF},
-  {0x0E0100, 0x0E01EF},
-  {0}
-};
-
-/* Default SILC Identifier String profile defined by the protocol */
-const Stringprep_profile stringprep_silc_identifier_prep[] =
-{
-  {STRINGPREP_MAP_TABLE, 0, stringprep_rfc3454_B_1},
-  {STRINGPREP_MAP_TABLE, 0, stringprep_rfc3454_B_2},
-  {STRINGPREP_NFKC, 0, 0},
-  {STRINGPREP_PROHIBIT_TABLE, 0, stringprep_rfc3454_C_1_1},
-  {STRINGPREP_PROHIBIT_TABLE, 0, stringprep_rfc3454_C_1_2},
-  {STRINGPREP_PROHIBIT_TABLE, 0, stringprep_rfc3454_C_2_1},
-  {STRINGPREP_PROHIBIT_TABLE, 0, stringprep_rfc3454_C_2_2},
-  {STRINGPREP_PROHIBIT_TABLE, 0, stringprep_rfc3454_C_3},
-  {STRINGPREP_PROHIBIT_TABLE, 0, stringprep_rfc3454_C_4},
-  {STRINGPREP_PROHIBIT_TABLE, 0, stringprep_rfc3454_C_5},
-  {STRINGPREP_PROHIBIT_TABLE, 0, stringprep_rfc3454_C_6},
-  {STRINGPREP_PROHIBIT_TABLE, 0, stringprep_rfc3454_C_7},
-  {STRINGPREP_PROHIBIT_TABLE, 0, stringprep_rfc3454_C_8},
-  {STRINGPREP_PROHIBIT_TABLE, 0, stringprep_rfc3454_C_9},
-  {STRINGPREP_PROHIBIT_TABLE, 0, stringprep_rfc3454_C_9},
-  {STRINGPREP_PROHIBIT_TABLE, 0, silc_appendix_c},
-  {STRINGPREP_PROHIBIT_TABLE, 0, silc_appendix_d},
-  {STRINGPREP_UNASSIGNED_TABLE, 0, stringprep_rfc3454_A_1},
-  {0}
-};
-
-/* Default channel name string profile defined by the protocol */
-const Stringprep_profile stringprep_silc_identifier_ch_prep[] =
-{
-  {STRINGPREP_MAP_TABLE, 0, stringprep_rfc3454_B_1},
-  {STRINGPREP_MAP_TABLE, 0, stringprep_rfc3454_B_2},
-  {STRINGPREP_NFKC, 0, 0},
-  {STRINGPREP_PROHIBIT_TABLE, 0, stringprep_rfc3454_C_1_1},
-  {STRINGPREP_PROHIBIT_TABLE, 0, stringprep_rfc3454_C_1_2},
-  {STRINGPREP_PROHIBIT_TABLE, 0, stringprep_rfc3454_C_2_1},
-  {STRINGPREP_PROHIBIT_TABLE, 0, stringprep_rfc3454_C_2_2},
-  {STRINGPREP_PROHIBIT_TABLE, 0, stringprep_rfc3454_C_3},
-  {STRINGPREP_PROHIBIT_TABLE, 0, stringprep_rfc3454_C_4},
-  {STRINGPREP_PROHIBIT_TABLE, 0, stringprep_rfc3454_C_5},
-  {STRINGPREP_PROHIBIT_TABLE, 0, stringprep_rfc3454_C_6},
-  {STRINGPREP_PROHIBIT_TABLE, 0, stringprep_rfc3454_C_7},
-  {STRINGPREP_PROHIBIT_TABLE, 0, stringprep_rfc3454_C_8},
-  {STRINGPREP_PROHIBIT_TABLE, 0, stringprep_rfc3454_C_9},
-  {STRINGPREP_PROHIBIT_TABLE, 0, stringprep_rfc3454_C_9},
-  {STRINGPREP_PROHIBIT_TABLE, 0, silc_appendix_d},
-  {STRINGPREP_UNASSIGNED_TABLE, 0, stringprep_rfc3454_A_1},
-  {0}
-};
-
-/* Identifier string case folding and normalizing */
-const Stringprep_profile stringprep_silc_identifierc_prep[] =
-{
-  {STRINGPREP_MAP_TABLE, 0, stringprep_rfc3454_B_1},
-  {STRINGPREP_MAP_TABLE, 0, stringprep_rfc3454_B_2},
-  {STRINGPREP_NFKC, 0, 0},
-  {0}
-};
-
-/* Case folding and normalizing */
-const Stringprep_profile stringprep_silc_casefold_prep[] =
-{
-  {STRINGPREP_MAP_TABLE, 0, stringprep_rfc3454_B_2},
-  {STRINGPREP_NFKC, 0, 0},
-  {0}
-};
-
-
-/* Prepares string according to the profile */
-
-SilcStringprepStatus
-silc_stringprep(const unsigned char *bin, SilcUInt32 bin_len,
-               SilcStringEncoding bin_encoding,
-               const char *profile_name,
-               SilcStringprepFlags flags,
-               unsigned char **out, SilcUInt32 *out_len,
-               SilcStringEncoding out_encoding)
-{
-  Stringprep_profile_flags f = 0;
-  const Stringprep_profile *profile;
-  unsigned char *utf8s;
-  SilcUInt32 utf8s_len;
-  int ret;
-
-  SILC_LOG_DEBUG(("Preparing string"));
-
-  if (!bin || !bin_len || !profile_name)
-    return SILC_STRINGPREP_ERR;
-
-  /* Convert string to UTF-8 */
-  utf8s_len = silc_utf8_encoded_len(bin, bin_len, bin_encoding);
-  if (!utf8s_len)
-    return SILC_STRINGPREP_ERR_ENCODING;
-  utf8s = silc_calloc(utf8s_len + 1, sizeof(*utf8s));
-  if (!utf8s)
-    return SILC_STRINGPREP_ERR_OUT_OF_MEMORY;
-  silc_utf8_encode(bin, bin_len, bin_encoding, utf8s, utf8s_len);
-
-  /* Check profile. */
-  if (!strcmp(profile_name, SILC_IDENTIFIER_PREP))
-    profile = stringprep_silc_identifier_prep;
-  else if (!strcmp(profile_name, SILC_IDENTIFIER_CH_PREP))
-    profile = stringprep_silc_identifier_ch_prep;
-  else if (!strcmp(profile_name, SILC_IDENTIFIERC_PREP))
-    profile = stringprep_silc_identifierc_prep;
-  else if (!strcmp(profile_name, SILC_CASEFOLD_PREP))
-    profile = stringprep_silc_casefold_prep;
-  else
-    return SILC_STRINGPREP_ERR_UNSUP_PROFILE;
-
-  /* Translate flags */
-  if (!(flags & SILC_STRINGPREP_ALLOW_UNASSIGNED))
-    f |= STRINGPREP_NO_UNASSIGNED;
-
-  /* Prepare */
-  ret = stringprep((char *)utf8s, utf8s_len, f, profile);
-  SILC_LOG_DEBUG(("stringprep() return %d", ret));
-
-  /* Since the stringprep() doesn't allocate returned buffer, and
-     stringprep_profile() doesn't do it correctly, we can't know how
-     much space we must have for the conversion.  Allocate more if it
-     fails, and try again. */
-  if (ret == STRINGPREP_TOO_SMALL_BUFFER) {
-    utf8s = silc_realloc(utf8s, sizeof(*utf8s) * ((utf8s_len * 2) + 1));
-    if (!utf8s)
-      return SILC_STRINGPREP_ERR_OUT_OF_MEMORY;
-    memset(utf8s + utf8s_len + 1, 0, utf8s_len);
-    ret = stringprep((char *)utf8s, utf8s_len * 2, f, profile);
-    SILC_LOG_DEBUG(("stringprep() return %d", ret));
-  }
-
-  switch (ret) {
-  case STRINGPREP_OK:
-    ret = SILC_STRINGPREP_OK;
-    break;
-
-  case STRINGPREP_CONTAINS_UNASSIGNED:
-    ret = SILC_STRINGPREP_ERR_UNASSIGNED;
-    break;
-
-  case STRINGPREP_CONTAINS_PROHIBITED:
-    ret = SILC_STRINGPREP_ERR_PROHIBITED;
-    break;
-
-  case STRINGPREP_BIDI_BOTH_L_AND_RAL:
-    ret = SILC_STRINGPREP_ERR_BIDI_RAL_WITH_L;
-    break;
-
-  case STRINGPREP_BIDI_LEADTRAIL_NOT_RAL:
-    ret = SILC_STRINGPREP_ERR_BIDI_RAL;
-    break;
-
-  case STRINGPREP_BIDI_CONTAINS_PROHIBITED:
-    ret = SILC_STRINGPREP_ERR_BIDI_PROHIBITED;
-    break;
-
-  case STRINGPREP_UNKNOWN_PROFILE:
-    ret = SILC_STRINGPREP_ERR_UNSUP_PROFILE;
-    break;
-
-  case STRINGPREP_MALLOC_ERROR:
-    ret = SILC_STRINGPREP_ERR_OUT_OF_MEMORY;
-    break;
-
-  default:
-    ret = SILC_STRINGPREP_ERR;
-    break;
-  }
-
-  /* Convert to desired output character encoding */
-  if (ret == SILC_STRINGPREP_OK) {
-    if (out && out_len) {
-      if (out_encoding != SILC_STRING_UTF8) {
-       *out_len = silc_utf8_decoded_len(utf8s, strlen(utf8s), out_encoding);
-       if (*out_len) {
-         *out = silc_calloc(*out_len + 1, sizeof(**out));
-         if (*out) {
-           silc_utf8_decode(utf8s, strlen(utf8s), out_encoding, *out,
-                            *out_len);
-         } else {
-           ret = SILC_STRINGPREP_ERR_OUT_OF_MEMORY;
-         }
-       } else {
-         ret = SILC_STRINGPREP_ERR_ENCODING;
-       }
-      } else {
-       *out_len = strlen(utf8s);
-       *out = silc_memdup(utf8s, *out_len);
-      }
-    }
-  }
-
-  silc_free(utf8s);
-
-  return (SilcStringprepStatus)ret;
-}
diff --git a/lib/silcutil/silcstringprep.h b/lib/silcutil/silcstringprep.h
deleted file mode 100644 (file)
index 21bc331..0000000
+++ /dev/null
@@ -1,138 +0,0 @@
-/*
-
-  silcstringprep.h
-
-  Author: Pekka Riikonen <priikone@silcnet.org>
-
-  Copyright (C) 2004 - 2005 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.
-
-*/
-
-/****h* silcutil/SILC Stringprep
- *
- * DESCRIPTION
- *
- * Interface for the stringprep (RFC3454) standard, that is used to prepare
- * strings for internationalization.  The interface can be used to prepare
- * strings according to various stringprep profiles.  The profiles defines
- * what characters the strings may contain, what characters are prohibited
- * and how the strings are prepared.
- *
- ***/
-
-#ifndef SILCSTRINGPREP_H
-#define SILCSTRINGPREP_H
-
-/****d* silcutil/SilcStringprep/SilcStringprepStatus
- *
- * NAME
- *
- *    typedef enum { ... } SilcStringprepStatus;
- *
- * DESCRIPTION
- *
- *    Status and errors returned by silc_stringprep.
- *
- * SOURCE
- */
-typedef enum {
-  SILC_STRINGPREP_OK,                    /* Preparation success */
-  SILC_STRINGPREP_ERR_UNASSIGNED,         /* Contains unassigned characters */
-  SILC_STRINGPREP_ERR_PROHIBITED,        /* Contains prohibited characters */
-  SILC_STRINGPREP_ERR_BIDI_PROHIBITED,   /* BIDI contains prohibited chars */
-  SILC_STRINGPREP_ERR_BIDI_RAL_WITH_L,   /* BIDI has both R/AL and L */
-  SILC_STRINGPREP_ERR_BIDI_RAL,                  /* BIDI has R/AL but not as leading
-                                            and/or trailing character. */
-  SILC_STRINGPREP_ERR_OUT_OF_MEMORY,     /* System out of memory */
-  SILC_STRINGPREP_ERR_ENCODING,                  /* Character encoding error */
-  SILC_STRINGPREP_ERR_UNSUP_ENCODING,     /* Unsupported character encoding  */
-  SILC_STRINGPREP_ERR_UNSUP_PROFILE,     /* Unsupported profile */
-  SILC_STRINGPREP_ERR,                   /* Unknown error */
-} SilcStringprepStatus;
-/***/
-
-/****d* silcutil/SilcStringprep/SilcStringprepFlags
- *
- * NAME
- *
- *    typedef enum { ... } SilcStringprepFlags;
- *
- * DESCRIPTION
- *
- *    Flags that change how the strings are prepared with silc_stringprep.
- *
- * SOURCE
- */
-typedef enum {
-  SILC_STRINGPREP_NONE               = 0x00,  /* No flags */
-  SILC_STRINGPREP_ALLOW_UNASSIGNED   = 0x01,  /* Allow unassigned characters
-                                                without returning error. */
-} SilcStringprepFlags;
-/***/
-
-/* Profiles */
-#define SILC_IDENTIFIER_PREP "silc-identifier-prep"
-#define SILC_IDENTIFIERC_PREP "silc-identifierc-prep"
-#define SILC_IDENTIFIER_CH_PREP "silc-identifier-ch-prep"
-#define SILC_CASEFOLD_PREP "silc-casefold-prep"
-
-/****f* silcutil/SilcStringprep/silc_stringprep
- *
- * SYNOPSIS
- *
- *    SilcStringprepStatus
- *    silc_stringprep(const unsigned char *bin, SilcUInt32 bin_len,
- *                    SilcStringEncoding bin_encoding,
- *                    const char *profile_name,
- *                    SilcStringprepFlags flags,
- *                    unsigned char **out, SilcUInt32 *out_len,
- *                    SilcStringEncoding out_encoding);
- *
- * DESCRIPTION
- *
- *    Prepares the input string 'bin' of length 'bin_len' of encoding
- *    'bin_encoding' according to the stringrep profile 'profile_name'.
- *    Returns the prepared and allocated string into 'out'.  The 'out_len'
- *    indicates the length of the prepared string.  This returns the
- *    SilcStringprepStatus which indicates the status of the preparation.
- *    For example, if the input string contains prohibited characters
- *    (according to the used profile) this function will return error.
- *    The 'flags' however can be used to modify the behavior of this
- *    function.  Caller must free the returned 'out' string.
- *
- *    The output string will be encoded into the character encoding
- *    defined by the 'out_encoding'.  This allows caller to have for
- *    example the input string as locale specific string and output string
- *    as UTF-8 encoded string.
- *
- *    If the 'out' is NULL this function merely performs the preparation
- *    process, but does not return anything.  In this case this function
- *    could be used to for example verify that an input string that ought
- *    to have been prepared correctly was done so.
- *
- *    Available profile names:
- *
- *      SILC_IDENTIFIER_PREP            Prepares SILC identifier strings
- *      SILC_IDENTIFIER_CH_PREP         Prepares SILC channel name strings
- *      SILC_IDENTIFIERC_PREP           Casefolds identifier strings
- *      SILC_CASEFOLD_PREP              Casefolding and normalizing
- *
- ***/
-SilcStringprepStatus
-silc_stringprep(const unsigned char *bin, SilcUInt32 bin_len,
-               SilcStringEncoding bin_encoding,
-               const char *profile_name,
-               SilcStringprepFlags flags,
-               unsigned char **out, SilcUInt32 *out_len,
-               SilcStringEncoding out_encoding);
-
-#endif /* SILCSTRINGPREP_H */
diff --git a/lib/silcutil/silcstrutil.c b/lib/silcutil/silcstrutil.c
deleted file mode 100644 (file)
index 1133c88..0000000
+++ /dev/null
@@ -1,425 +0,0 @@
-/*
-
-  silcstrutil.c
-
-  Author: Pekka Riikonen <priikone@silcnet.org>
-
-  Copyright (C) 2002 - 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.
-
-*/
-/* $Id$ */
-
-#include "silc.h"
-#include "silcstrutil.h"
-
-static unsigned char pem_enc[64] =
-"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
-
-/* Encodes data into Base 64 encoding. Returns NULL terminated base 64 encoded
-   data string. */
-
-char *silc_base64_encode(unsigned char *data, SilcUInt32 len)
-{
-  int i, j;
-  SilcUInt32 bits, c, char_count;
-  char *pem;
-
-  char_count = 0;
-  bits = 0;
-  j = 0;
-
-  pem = silc_calloc(((len * 8 + 5) / 6) + 5, sizeof(*pem));
-
-  for (i = 0; i < len; i++) {
-    c = data[i];
-    bits += c;
-    char_count++;
-
-    if (char_count == 3) {
-      pem[j++] = pem_enc[bits  >> 18];
-      pem[j++] = pem_enc[(bits >> 12) & 0x3f];
-      pem[j++] = pem_enc[(bits >> 6)  & 0x3f];
-      pem[j++] = pem_enc[bits & 0x3f];
-      bits = 0;
-      char_count = 0;
-    } else {
-      bits <<= 8;
-    }
-  }
-
-  if (char_count != 0) {
-    bits <<= 16 - (8 * char_count);
-    pem[j++] = pem_enc[bits >> 18];
-    pem[j++] = pem_enc[(bits >> 12) & 0x3f];
-
-    if (char_count == 1) {
-      pem[j++] = '=';
-      pem[j] = '=';
-    } else {
-      pem[j++] = pem_enc[(bits >> 6) & 0x3f];
-      pem[j] = '=';
-    }
-  }
-
-  return pem;
-}
-
-/* Same as above but puts newline ('\n') every 72 characters. */
-
-char *silc_base64_encode_file(unsigned char *data, SilcUInt32 data_len)
-{
-  int i, j;
-  SilcUInt32 len, cols;
-  char *pem, *pem2;
-
-  pem = silc_base64_encode(data, data_len);
-  len = strlen(pem);
-
-  pem2 = silc_calloc(len + (len / 72) + 1, sizeof(*pem2));
-
-  for (i = 0, j = 0, cols = 1; i < len; i++, cols++) {
-    if (cols == 72) {
-      pem2[i] = '\n';
-      cols = 0;
-      len++;
-      continue;
-    }
-
-    pem2[i] = pem[j++];
-  }
-
-  silc_free(pem);
-  return pem2;
-}
-
-/* Decodes Base 64 into data. Returns the decoded data. */
-
-unsigned char *silc_base64_decode(unsigned char *base64,
-                                 SilcUInt32 base64_len,
-                                 SilcUInt32 *ret_len)
-{
-  int i, j;
-  SilcUInt32 len, c, char_count, bits;
-  unsigned char *data;
-  static char ialpha[256], decoder[256];
-
-  for (i = 64 - 1; i >= 0; i--) {
-    ialpha[pem_enc[i]] = 1;
-    decoder[pem_enc[i]] = i;
-  }
-
-  char_count = 0;
-  bits = 0;
-  j = 0;
-
-  if (!base64_len)
-    len = strlen(base64);
-  else
-    len = base64_len;
-
-  data = silc_calloc(((len * 6) / 8), sizeof(*data));
-
-  for (i = 0; i < len; i++) {
-    c = base64[i];
-
-    if (c == '=')
-      break;
-
-    if (c > 127 || !ialpha[c])
-      continue;
-
-    bits += decoder[c];
-    char_count++;
-
-    if (char_count == 4) {
-      data[j++] = bits >> 16;
-      data[j++] = (bits >> 8) & 0xff;
-      data[j++] = bits & 0xff;
-      bits = 0;
-      char_count = 0;
-    } else {
-      bits <<= 6;
-    }
-  }
-
-  switch(char_count) {
-  case 1:
-    silc_free(data);
-    return NULL;
-    break;
-  case 2:
-    data[j++] = bits >> 10;
-    break;
-  case 3:
-    data[j++] = bits >> 16;
-    data[j++] = (bits >> 8) & 0xff;
-    break;
-  }
-
-  if (ret_len)
-    *ret_len = j;
-
-  return data;
-}
-
-/* Concatenates the `src' into `dest'.  If `src_len' is more than the
-   size of the `dest' (minus NULL at the end) the `src' will be
-   truncated to fit. */
-
-char *silc_strncat(char *dest, SilcUInt32 dest_size,
-                  const char *src, SilcUInt32 src_len)
-{
-  int len;
-
-  dest[dest_size - 1] = '\0';
-
-  len = dest_size - 1 - strlen(dest);
-  if (len < src_len) {
-    if (len > 0)
-      strncat(dest, src, len);
-  } else {
-    strncat(dest, src, src_len);
-  }
-
-  return dest;
-}
-
-/* Compares two strings. Strings may include wildcards '*' and '?'.
-   Returns TRUE if strings match. */
-
-int silc_string_compare(char *string1, char *string2)
-{
-  int i;
-  int slen1;
-  int slen2;
-  char *tmpstr1, *tmpstr2;
-
-  if (!string1 || !string2)
-    return FALSE;
-
-  slen1 = strlen(string1);
-  slen2 = strlen(string2);
-
-  /* See if they are same already */
-  if (!strncmp(string1, string2, slen2) && slen2 == slen1)
-    return TRUE;
-
-  if (slen2 < slen1)
-    if (!strchr(string1, '*'))
-      return FALSE;
-
-  /* Take copies of the original strings as we will change them */
-  tmpstr1 = silc_calloc(slen1 + 1, sizeof(char));
-  memcpy(tmpstr1, string1, slen1);
-  tmpstr2 = silc_calloc(slen2 + 1, sizeof(char));
-  memcpy(tmpstr2, string2, slen2);
-
-  for (i = 0; i < slen1; i++) {
-
-    /* * wildcard. Only one * wildcard is possible. */
-    if (tmpstr1[i] == '*')
-      if (!strncmp(tmpstr1, tmpstr2, i)) {
-       memset(tmpstr2, 0, slen2);
-       strncpy(tmpstr2, tmpstr1, i);
-       break;
-      }
-
-    /* ? wildcard */
-    if (tmpstr1[i] == '?') {
-      if (!strncmp(tmpstr1, tmpstr2, i)) {
-       if (!(slen1 < i + 1))
-         if (tmpstr1[i + 1] != '?' &&
-             tmpstr1[i + 1] != tmpstr2[i + 1])
-           continue;
-
-       if (!(slen1 < slen2))
-         tmpstr2[i] = '?';
-      }
-    }
-  }
-
-  /* if using *, remove it */
-  if (strchr(tmpstr1, '*'))
-    *strchr(tmpstr1, '*') = 0;
-
-  if (!strcmp(tmpstr1, tmpstr2)) {
-    memset(tmpstr1, 0, slen1);
-    memset(tmpstr2, 0, slen2);
-    silc_free(tmpstr1);
-    silc_free(tmpstr2);
-    return TRUE;
-  }
-
-  memset(tmpstr1, 0, slen1);
-  memset(tmpstr2, 0, slen2);
-  silc_free(tmpstr1);
-  silc_free(tmpstr2);
-  return FALSE;
-}
-
-/* Splits a string containing separator `ch' and returns an array of the
-   splitted strings. */
-
-char **silc_string_split(const char *string, char ch, int *ret_count)
-{
-  char **splitted = NULL, sep[1], *item, *cp;
-  int i = 0, len;
-
-  if (!string)
-    return NULL;
-  if (!ret_count)
-    return NULL;
-
-  splitted = silc_calloc(1, sizeof(*splitted));
-  if (!splitted)
-    return NULL;
-
-  if (!strchr(string, ch)) {
-    splitted[0] = silc_memdup(string, strlen(string));
-    *ret_count = 1;
-    return splitted;
-  }
-
-  sep[0] = ch;
-  cp = (char *)string;
-  while(cp) {
-    len = strcspn(cp, sep);
-    item = silc_memdup(cp, len);
-    if (!item) {
-      silc_free(splitted);
-      return NULL;
-    }
-
-    cp += len;
-    if (strlen(cp) == 0)
-      cp = NULL;
-    else
-      cp++;
-
-    splitted = silc_realloc(splitted, (i + 1) * sizeof(*splitted));
-    if (!splitted)
-      return NULL;
-    splitted[i++] = item;
-  }
-  *ret_count = i;
-
-  return splitted;
-}
-
-/* Inspects the `string' for wildcards and returns regex string that can
-   be used by the GNU regex library. A comma (`,') in the `string' means
-   that the string is list. */
-
-char *silc_string_regexify(const char *string)
-{
-  int i, len, count;
-  char *regex;
-
-  if (!string)
-    return NULL;
-
-  len = strlen(string);
-  count = 4;
-  for (i = 0; i < len; i++) {
-    if (string[i] == '*' || string[i] == '?')
-      count++;                 /* Will add '.' */
-    if (string[i] == ',')
-      count += 2;              /* Will add '|' and '^' */
-  }
-
-  regex = silc_calloc(len + count + 1, sizeof(*regex));
-  if (!regex)
-    return NULL;
-
-  count = 0;
-  regex[count++] = '(';
-  regex[count++] = '^';
-
-  for (i = 0; i < len; i++) {
-    if (string[i] == '*' || string[i] == '?') {
-      regex[count] = '.';
-      count++;
-    } else if (string[i] == ',') {
-      if (i + 2 == len)
-       continue;
-      regex[count++] = '|';
-      regex[count++] = '^';
-      continue;
-    }
-
-    regex[count++] = string[i];
-  }
-
-  regex[count++] = ')';
-  regex[count] = '$';
-
-  return regex;
-}
-
-/* Combines two regex strings into one regex string so that they can be
-   used as one by the GNU regex library. The `string2' is combine into
-   the `string1'. */
-
-char *silc_string_regex_combine(const char *string1, const char *string2)
-{
-  char *tmp;
-  int len1, len2;
-
-  if (!string1 || !string2)
-    return NULL;
-
-  len1 = strlen(string1);
-  len2 = strlen(string2);
-
-  tmp = silc_calloc(2 + len1 + len2, sizeof(*tmp));
-  strncat(tmp, string1, len1 - 2);
-  strncat(tmp, "|", 1);
-  strncat(tmp, string2 + 1, len2 - 1);
-
-  return tmp;
-}
-
-/* Matches the two strings and returns TRUE if the strings match. */
-
-int silc_string_regex_match(const char *regex, const char *string)
-{
-  regex_t preg;
-  int ret = FALSE;
-
-  if (regcomp(&preg, regex, REG_NOSUB | REG_EXTENDED) != 0)
-    return FALSE;
-
-  if (regexec(&preg, string, 0, NULL, 0) == 0)
-    ret = TRUE;
-
-  regfree(&preg);
-
-  return ret;
-}
-
-/* Do regex match to the two strings `string1' and `string2'. If the
-   `string2' matches the `string1' this returns TRUE. */
-
-int silc_string_match(const char *string1, const char *string2)
-{
-  char *s1;
-  int ret = FALSE;
-
-  if (!string1 || !string2)
-    return ret;
-
-  s1 = silc_string_regexify(string1);
-  ret = silc_string_regex_match(s1, string2);
-  silc_free(s1);
-
-  return ret;
-}
diff --git a/lib/silcutil/silcstrutil.h b/lib/silcutil/silcstrutil.h
deleted file mode 100644 (file)
index 0860bb3..0000000
+++ /dev/null
@@ -1,205 +0,0 @@
-/*
-
-  silcstrutil.h
-
-  Author: Pekka Riikonen <priikone@silcnet.org>
-
-  Copyright (C) 2002 - 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.
-
-*/
-
-/****h* silcutil/SILC String Utilities
- *
- * DESCRIPTION
- *
- * String manipulation utility routines.  These routines provides
- * various helper functions for encoding, decoding and otherwise
- * managing strings.
- *
- ***/
-
-#ifndef SILCSTRUTIL_H
-#define SILCSTRUTIL_H
-
-/****d* silcutil/SilcStrUtilAPI/SilcStringEncoding
- *
- * NAME
- *
- *    typedef enum { ... } SilcStringEncoding;
- *
- * DESCRIPTION
- *
- *    String encoding definitions used with various string manipulation
- *    routines.  By default, applications are suggested to use
- *    SILC_STRING_LOCALE since it encodes and decodes correctly according
- *    to local system language and character set (locale).
- *
- * SOURCE
- */
-typedef enum {
-  SILC_STRING_ASCII         = 0,  /* Any 8 bit ASCII encoding (default) */
-  SILC_STRING_ASCII_ESC     = 1,  /* 7 bit ASCII (>0x7f escaped) */
-  SILC_STRING_BMP           = 2,  /* 16 bit, UCS-2, BMP, ISO/IEC 10646 */
-  SILC_STRING_BMP_LSB       = 3,  /* BMP, least significant byte first */
-  SILC_STRING_UNIVERSAL     = 4,  /* 32 bit, UCS-4, Universal, ISO/IEC 10646 */
-  SILC_STRING_UNIVERSAL_LSB = 5,  /* Universal, least significant byte first */
-  SILC_STRING_LOCALE        = 6,  /* A locale specific conversion on
-                                    those platforms that support iconv().
-                                    Fallback is SILC_STRING_ASCII. */
-  SILC_STRING_UTF8          = 7,  /* UTF-8 encoding */
-  SILC_STRING_PRINTABLE     = 8,  /* Printable ASCII (no escaping) */
-  SILC_STRING_VISIBLE       = 9,  /* Visible ASCII string */
-  SILC_STRING_TELETEX       = 10, /* Teletex ASCII string */
-  SILC_STRING_NUMERICAL     = 11, /* Numerical ASCII string (digits) */
-  SILC_STRING_LDAP_DN       = 12, /* Strings for LDAP DNs, RFC 2253 */
-  SILC_STRING_UTF8_ESCAPE   = 12, /* Escaped UTF-8 as defined in RFC 2253 */
-
-  SILC_STRING_LANGUAGE      = 6,  /* _Deprecated_, use SILC_STRING_LOCALE. */
-} SilcStringEncoding;
-/***/
-
-/****f* silcutil/SilcStrUtilAPI/silc_base64_encode
- *
- * SYNOPSIS
- *
- *    char *silc_base64_encode(unsigned char *data, SilcUInt32 len);
- *
- * DESCRIPTION
- *
- *    Encodes data into Base 64 (PEM) encoding. Returns NULL terminated
- *    Base 64 encoded data string.
- *
- ***/
-char *silc_base64_encode(unsigned char *data, SilcUInt32 len);
-
-/****f* silcutil/SilcStrUtilAPI/silc_base64_encode_file
- *
- * SYNOPSIS
- *
- *    char *silc_base64_encode_file(unsigned char *data, SilcUInt32 data_len);
- *
- * DESCRIPTION
- *
- *    Same as silc_base64_encode() but puts newline ('\n') every 72
- *    characters.
- *
- ***/
-char *silc_base64_encode_file(unsigned char *data, SilcUInt32 data_len);
-
-/****f* silcutil/SilcStrUtilAPI/silc_base_decode
- *
- * SYNOPSIS
- *
- *    unsigned char *silc_base_decode(unsigned char *base64,
- *                                    SilcUInt32 base64_len,
- *                                    SilcUInt32 *ret_len);
- *
- * DESCRIPTION
- *
- *    Decodes Base 64 (PEM) into data. Returns the decoded data.
- *
- ***/
-unsigned char *silc_base64_decode(unsigned char *base64,
-                                 SilcUInt32 base64_len,
-                                 SilcUInt32 *ret_len);
-
-/****f* silcutil/SilcStrStrUtilAPI/silc_strncat
- *
- * SYNOPSIS
- *
- *    char *silc_strncat(char *dest, SilcUInt32 dest_size,
- *                       const char *src, SilcUInt32 src_len);
- *
- * DESCRIPTION
- *
- *    Concatenates the `src' into `dest'.  If `src_len' is more than the
- *    size of the `dest' (minus NULL at the end) the `src' will be
- *    truncated to fit.
- *
- ***/
-char *silc_strncat(char *dest, SilcUInt32 dest_size,
-                  const char *src, SilcUInt32 src_len);
-
-/****f* silcutil/SilcStrUtilAPI/silc_string_regexify
- *
- * SYNOPSIS
- *
- *    char *silc_string_regexify(const char *string);
- *
- * DESCRIPTION
- *
- *    Inspects the `string' for wildcards and returns regex string that can
- *    be used by the GNU regex library. A comma (`,') in the `string' means
- *    that the string is list.
- *
- ***/
-char *silc_string_regexify(const char *string);
-
-/****f* silcutil/SilcStrUtilAPI/silc_string_regex_match
- *
- * SYNOPSIS
- *
- *    int silc_string_regex_match(const char *regex, const char *string);
- *
- * DESCRIPTION
- *
- *    Matches the two strings and returns TRUE if the strings match.
- *
- ***/
-int silc_string_regex_match(const char *regex, const char *string);
-
-/****f* silcutil/SilcStrUtilAPI/silc_string_match
- *
- * SYNOPSIS
- *
- *    int silc_string_match(const char *string1, const char *string2);
- *
- * DESCRIPTION
- *
- *    Do regex match to the two strings `string1' and `string2'. If the
- *    `string2' matches the `string1' this returns TRUE.
- *
- ***/
-int silc_string_match(const char *string1, const char *string2);
-
-/****f* silcutil/SilcStrUtilAPI/silc_string_compare
- *
- * SYNOPSIS
- *
- *    int silc_string_compare(char *string1, char *string2);
- *
- * DESCRIPTION
- *
- *    Compares two strings. Strings may include wildcards '*' and '?'.
- *    Returns TRUE if strings match.
- *
- ***/
-int silc_string_compare(char *string1, char *string2);
-
-/****f* silcutil/SilcStrUtilAPI/silc_string_split
- *
- * SYNOPSIS
- *
- *    char **silc_string_split(const char *string, char ch, int *ret_count);
- *
- * DESCRIPTION
- *
- *    Splits a `string' that has a separator `ch' into an array of strings
- *    and returns the array.  The `ret_count' will contain the number of
- *    strings in the array.  Caller must free the strings and the array.
- *    Returns NULL on error.  If the string does not have `ch' separator
- *    this returns the `string' in the array.
- *
- ***/
-char **silc_string_split(const char *string, char ch, int *ret_count);
-
-#endif /* SILCSTRUTIL_H */
diff --git a/lib/silcutil/silcthread.h b/lib/silcutil/silcthread.h
deleted file mode 100644 (file)
index 3a4036f..0000000
+++ /dev/null
@@ -1,165 +0,0 @@
-/*
-
-  silcmutex.h
-
-  Author: Pekka Riikonen <priikone@silcnet.org>
-
-  Copyright (C) 2001 - 2005 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.
-
-*/
-
-/****h* silcutil/SILC Thread Interface
- *
- * DESCRIPTION
- *
- * Interface for SILC Thread implementation. This is platform independent
- * interface of threads for applications that need concurrent execution
- * with the application's main thread. The threads created with this
- * interface executes concurrently with the calling thread.
- *
- ***/
-
-#ifndef SILCTHREAD_H
-#define SILCTHREAD_H
-
-/* Prototypes */
-
-/****s* silcutil/SilcThreadAPI/SilcThread
- *
- * NAME
- *
- *    typedef struct SilcThreadStruct *SilcThread;
- *
- * DESCRIPTION
- *
- *    This context is the actual SILC Thread and is returned by
- *    the silc_thread_create functions, and given as arguments to
- *    some of the silc_thread_* functions. This context and its
- *    resources are released automatically when the thread exits.
- *
- ***/
-typedef void *SilcThread;
-
-/****f* silcutil/SilcThreadAPI/SilcThreadStart
- *
- * SYNOPSIS
- *
- *    typedef void *(*SilcThreadStart)(void *context);
- *
- * DESCRIPTION
- *
- *    A callback function that is called when the thread is created
- *    by the silc_thread_create function.  This returns the return value
- *    of the thread. If another thread is waiting this thread's
- *    destruction with silc_thread_wait the returned value is passed
- *    to that thread. The thread is destroyed when this function
- *    returns.
- *
- ***/
-typedef void *(*SilcThreadStart)(void *context);
-
-/****f* silcutil/SilcThreadAPI/silc_thread_create
- *
- * SYNOPSIS
- *
- *    SilcThread silc_thread_create(SilcThreadStart start_func,
- *                                  void *context, SilcBool waitable);
- * DESCRIPTION
- *
- *    Creates a new thread. The `start_func' with `context' will be
- *    called if the thread was created. This function returns a pointer
- *    to the thread or NULL if the thread could not be created.  All
- *    resources of the returned pointer is freed automatically when the
- *    thread exits.
- *
- *    If the `waitable' is set to TRUE then another thread can wait
- *    this thread's destruction with silc_thread_wait. If it is set to
- *    FALSE the thread is not waitable.
- *
- * NOTES
- *
- *    If the `waitable' is TRUE the thread's resources are not freed
- *    when it exits until another thread has issued silc_thread_wait.
- *    If the `waitable' is TRUE then another thread must always issue
- *    silc_thread_wait to avoid memory leaks.
- *
- *    On Symbian Cleanup Stack is created and new Active Scheduler is
- *    installed automatically for the created thread.  The thread also
- *    shares heap with the calling thread.
- *
- ***/
-SilcThread silc_thread_create(SilcThreadStart start_func, void *context,
-                             SilcBool waitable);
-
-/****f* silcutil/SilcThreadAPI/silc_thread_exit
- *
- * SYNOPSIS
- *
- *    void silc_thread_exit(void *exit_value);
- *
- * DESCRIPTION
- *
- *    Exits the current thread. This can be called to explicitly exit
- *    the thread with `exit_value'. Another way to exit (destroy) the
- *    current thread is to return from the SilcThreadStart function
- *    with exit value. The exit value is passed to another thread if it
- *    is waiting it with silc_thread_wait function.
- *
- ***/
-void silc_thread_exit(void *exit_value);
-
-/****f* silcutil/SilcThreadAPI/silc_thread_self
- *
- * SYNOPSIS
- *
- *    SilcThread silc_thread_self(void);
- *
- * DESCRIPTION
- *
- *    Returns a pointer to the current thread.
- *
- ***/
-SilcThread silc_thread_self(void);
-
-/****f* silcutil/SilcThreadAPI/silc_thread_wait
- *
- * SYNOPSIS
- *
- *    SilcBool silc_thread_wait(SilcThread thread, void **exit_value);
- *
- * DESCRIPTION
- *
- *    Waits until the thread indicated by `thread' finishes. This blocks
- *    the execution of the current thread. The thread is finished if it
- *    calls silc_thread_exit or is destroyed naturally. When the thread
- *    exits its exit value is saved to `exit_value' and TRUE is returned.
- *    If the `thread' is not waitable this will return immediately with
- *    FALSE value.
- *
- ***/
-SilcBool silc_thread_wait(SilcThread thread, void **exit_value);
-
-/****f* silcutil/SilcThreadAPI/silc_thread_yield
- *
- * SYNOPSIS
- *
- *    void silc_thread_yield(void);
- *
- * DESCRIPTION
- *
- *    Yield the processor.  The calling thread will yield the processor and
- *    give execution time for other threads, until its turn comes up again.
- *
- ***/
-void silc_thread_yield(void);
-
-#endif
diff --git a/lib/silcutil/silctime.c b/lib/silcutil/silctime.c
deleted file mode 100644 (file)
index 639724c..0000000
+++ /dev/null
@@ -1,406 +0,0 @@
-/*
-
-  silctime.c
-
-  Author: Pekka Riikonen <priikone@silcnet.org>
-
-  Copyright (C) 2003 - 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.
-
-*/
-
-#include "silc.h"
-
-/* Fills the SilcTime structure with correct values */
-
-static SilcBool silc_time_fill(SilcTime time,
-                              unsigned int year,
-                              unsigned int month,
-                              unsigned int day,
-                              unsigned int hour,
-                              unsigned int minute,
-                              unsigned int second,
-                              unsigned int msec)
-{
-  if (year > (1 << 15))
-    return FALSE;
-  if (month < 1 || month > 12)
-    return FALSE;
-  if (day < 1 || day > 31)
-    return FALSE;
-  if (hour > 23)
-    return FALSE;
-  if (minute > 60)
-    return FALSE;
-  if (second > 61)
-    return FALSE;
-  if (msec > 1000)
-    return FALSE;
-
-  time->year = year;
-  time->month = month;
-  time->day = day;
-  time->hour = hour;
-  time->minute = minute;
-  time->second = second;
-  time->msecond = msec;
-
-  return TRUE;
-}
-
-/* Return time since Epoch */
-
-SilcInt64 silc_time(void)
-{
-  return (SilcInt64)time(NULL);
-}
-
-/* Return time since Epoch in milliseconds */
-
-SilcInt64 silc_time_msec(void)
-{
-  struct timeval curtime;
-  silc_gettimeofday(&curtime);
-  return (curtime.tv_sec * (SilcUInt64)1000) +
-    (curtime.tv_usec / (SilcUInt64)1000);
-}
-
-/* Return time since Epoch in microseconds */
-
-SilcInt64 silc_time_usec(void)
-{
-  struct timeval curtime;
-  silc_gettimeofday(&curtime);
-  return (curtime.tv_sec * (SilcUInt64)1000000) + curtime.tv_usec;
-}
-
-/* Returns time as string */
-
-const char *silc_time_string(SilcInt64 time_val)
-{
-  time_t curtime;
-  char *return_time;
-
-  if (!time_val)
-    curtime = silc_time();
-  else
-    curtime = (time_t)time_val;
-  return_time = ctime(&curtime);
-  if (!return_time)
-    return NULL;
-  return_time[strlen(return_time) - 1] = '\0';
-
-  return (const char *)return_time;
-}
-
-/* Returns time as SilcTime structure */
-
-SilcBool silc_time_value(SilcInt64 time_val, SilcTime ret_time)
-{
-  struct tm *t;
-  unsigned int msec = 0;
-  time_t timeval;
-  SilcInt32 ctz = 0;
-
-  if (!ret_time)
-    return TRUE;
-
-  if (!time_val)
-    time_val = silc_time_msec();
-
-  msec = (SilcUInt64)time_val % (SilcUInt64)1000;
-  timeval = (time_t)((SilcUInt64)time_val / (SilcUInt64)1000);
-
-  t = localtime(&timeval);
-  if (!t)
-    return FALSE;
-
-  memset(ret_time, 0, sizeof(*ret_time));
-  if (!silc_time_fill(ret_time, t->tm_year + 1900, t->tm_mon + 1,
-                     t->tm_mday, t->tm_hour, t->tm_min,
-                     t->tm_sec, msec))
-    return FALSE;
-
-  ret_time->dst        = t->tm_isdst ? 1 : 0;
-
-#ifdef SILC_WIN32
-  ret_time->utc_east   = _timezone < 0 ? 1 : 0;
-  ret_time->utc_hour   = (ret_time->utc_east ? (-(_timezone)) / 3600 :
-                         _timezone / 3600);
-  ret_time->utc_minute = (ret_time->utc_east ? (-(_timezone)) % 3600 :
-                         _timezone % 3600);
-#else
-#if defined(HAVE_TIMEZONE)
-  ret_time->utc_east   = timezone < 0 ? 1 : 0;
-  ctz = timezone;
-  if (ret_time->dst)
-    ctz -= 3600;
-#elif defined(HAVE_TM_GMTOFF)
-  ret_time->utc_east   = t->tm_gmtoff > 0 ? 1 : 0;
-  ctz = -t->tm_gmtoff;
-#elif defined(HAVE___TM_GMTOFF)
-  ret_time->utc_east   = t->__tm_gmtoff > 0 ? 1 : 0;
-  ctz = -t->__tm_gmtoff;
-#elif defined(HAVE___TM_GMTOFF__)
-  ret_time->utc_east   = t->__tm_gmtoff__ > 0 ? 1 : 0;
-  ctz = -t->__tm_gmtoff__;
-#endif /* HAVE_TIMEZONE */
-
-  ret_time->utc_hour   = (ret_time->utc_east ? (-(ctz)) / 3600 : ctz / 3600);
-  ret_time->utc_minute = (ret_time->utc_east ? (-(ctz)) % 3600 : ctz % 3600);
-#endif /* SILC_WIN32 */
-
-  if (ret_time->utc_minute)
-    ret_time->utc_minute /= 60;
-
-  return TRUE;
-}
-
-/* Returns timezone */
-
-SilcBool silc_timezone(char *timezone, SilcUInt32 timezone_size)
-{
-  SilcTimeStruct curtime;
-
-  if (timezone_size < 6)
-    return FALSE;
-
-  if (!silc_time_value(0, &curtime))
-    return FALSE;
-
-  if (!curtime.utc_hour && curtime.utc_minute)
-    silc_snprintf(timezone, timezone_size, "Z");
-  else if (curtime.utc_minute)
-    silc_snprintf(timezone, timezone_size, "%c%02d:%02d",
-                 curtime.utc_east ? '+' : '-', curtime.utc_hour,
-                 curtime.utc_minute);
-  else
-    silc_snprintf(timezone, timezone_size, "%c%02d",
-                 curtime.utc_east ? '+' : '-', curtime.utc_hour);
-
-  return TRUE;
-}
-
-/* Returns time from universal time string into SilcTime */
-
-SilcBool silc_time_universal(const char *universal_time, SilcTime ret_time)
-{
-  int ret;
-  unsigned int year, month, day, hour = 0, minute = 0, second = 0;
-  unsigned char z = 0;
-
-  if (!ret_time)
-    return TRUE;
-  memset(ret_time, 0, sizeof(*ret_time));
-
-  /* Parse the time string */
-  ret = sscanf(universal_time, "%02u%02u%02u%02u%02u%02u%c", &year, &month,
-              &day, &hour, &minute, &second, &z);
-  if (ret < 3) {
-    SILC_LOG_DEBUG(("Invalid UTC time string"));
-    return FALSE;
-  }
-
-  /* Fill the SilcTime structure */
-  ret = silc_time_fill(ret_time, year, month, day, hour, minute, second, 0);
-  if (!ret) {
-    SILC_LOG_DEBUG(("Incorrect values in UTC time string"));
-    return FALSE;
-  }
-
-  /* Check timezone */
-  if (z == '-' || z == '+') {
-    ret = sscanf(universal_time + (ret * 2) + 1, "%02u%02u", &hour, &minute);
-    if (ret != 2) {
-      SILC_LOG_DEBUG(("Malformed UTC time string"));
-      return FALSE;
-    }
-
-    if (hour < 0 || hour > 23)
-      return FALSE;
-    if (minute < 0 || minute > 60)
-      return FALSE;
-
-    ret_time->utc_hour   = hour;
-    ret_time->utc_minute = minute;
-    ret_time->utc_east   = (z == '-') ? 0 : 1;
-  } else if (z != 'Z') {
-    SILC_LOG_DEBUG(("Invalid timezone"));
-    return FALSE;
-  }
-
-  /* UTC year must be fixed since it's represented only as YY not YYYY. */
-  ret_time->year += 1900;
-  if (ret_time->year < 1950)
-    ret_time->year += 100;
-
-  return TRUE;
-}
-
-/* Encode universal time string. */
-
-SilcBool silc_time_universal_string(SilcTime time_val, char *ret_string,
-                                   SilcUInt32 ret_string_size)
-{
-  int ret, len = 0;
-  memset(ret_string, 0, ret_string_size);
-  ret = silc_snprintf(ret_string, ret_string_size - 1,
-                "%02u%02u%02u%02u%02u%02u",
-                time_val->year % 100, time_val->month, time_val->day,
-                time_val->hour, time_val->minute, time_val->second);
-  if (ret < 0)
-    return FALSE;
-  len += ret;
-
-  if (!time_val->utc_hour && !time_val->utc_minute) {
-    ret = silc_snprintf(ret_string + len, ret_string_size - 1 - len, "Z");
-    if (ret < 0)
-      return FALSE;
-    len += ret;
-  } else {
-    ret = silc_snprintf(ret_string + len, ret_string_size - 1 - len,
-                  "%c%02u%02u", time_val->utc_east ? '+' : '-',
-                  time_val->utc_hour, time_val->utc_minute);
-    if (ret < 0)
-      return FALSE;
-    len += ret;
-  }
-
-  return TRUE;
-}
-
-/* Returns time from generalized time string into SilcTime */
-
-SilcBool silc_time_generalized(const char *generalized_time, SilcTime ret_time)
-{
-  int ret, i;
-  unsigned int year, month, day, hour = 0, minute = 0, second = 0;
-  unsigned int msecond = 0;
-  unsigned char z = 0;
-
-  if (!ret_time)
-    return TRUE;
-  memset(ret_time, 0, sizeof(*ret_time));
-
-  /* Parse the time string */
-  ret = sscanf(generalized_time, "%04u%02u%02u%02u%02u%02u", &year, &month,
-              &day, &hour, &minute, &second);
-  if (ret < 3) {
-    SILC_LOG_DEBUG(("Invalid generalized time string"));
-    return FALSE;
-  }
-
-  /* Fill the SilcTime structure */
-  ret = silc_time_fill(ret_time, year, month, day, hour, minute, second, 0);
-  if (!ret) {
-    SILC_LOG_DEBUG(("Incorrect values in generalized time string"));
-    return FALSE;
-  }
-
-  /* Check fractions of second and/or timezone */
-  i = ret * 4;
-  ret = sscanf(generalized_time + i, "%c", &z);
-  if (ret != 1) {
-    SILC_LOG_DEBUG(("Malformed generalized time string"));
-    return FALSE;
-  }
-
-  if (z == '.') {
-    /* Take fractions of second */
-    int l;
-    i++;
-    ret = sscanf(generalized_time + i, "%u%n", &msecond, &l);
-    if (ret != 1) {
-      SILC_LOG_DEBUG(("Malformed generalized time string"));
-      return FALSE;
-    }
-    while (l > 4) {
-      msecond /= 10;
-      l--;
-    }
-    ret_time->msecond = msecond;
-    i += l;
-
-    /* Read optional timezone */
-    if (strlen(generalized_time) < i)
-      sscanf(generalized_time + i, "%c", &z);
-  }
-
-  /* Check timezone if present */
-  if (z == '-' || z == '+') {
-    ret = sscanf(generalized_time + i + 1, "%02u%02u", &hour, &minute);
-    if (ret != 2) {
-      SILC_LOG_DEBUG(("Malformed UTC time string"));
-      return FALSE;
-    }
-
-    if (hour < 0 || hour > 23)
-      return FALSE;
-    if (minute < 0 || minute > 60)
-      return FALSE;
-
-    ret_time->utc_hour   = hour;
-    ret_time->utc_minute = minute;
-    ret_time->utc_east   = (z == '-') ? 0 : 1;
-  }
-
-  return TRUE;
-}
-
-/* Encode generalized time string */
-
-SilcBool silc_time_generalized_string(SilcTime time_val, char *ret_string,
-                                     SilcUInt32 ret_string_size)
-{
-  int len = 0, ret;
-  memset(ret_string, 0, ret_string_size);
-  ret = silc_snprintf(ret_string, ret_string_size - 1,
-                "%04u%02u%02u%02u%02u%02u",
-                time_val->year, time_val->month, time_val->day, time_val->hour,
-                time_val->minute, time_val->second);
-  if (ret < 0)
-    return FALSE;
-  len += ret;
-
-  if (time_val->msecond) {
-    ret = silc_snprintf(ret_string + len, ret_string_size - 1 - len,
-                  ".%lu", (unsigned long)time_val->msecond);
-    if (ret < 0)
-      return FALSE;
-    len += ret;
-  }
-
-  if (!time_val->utc_hour && !time_val->utc_minute) {
-    ret = silc_snprintf(ret_string + len, ret_string_size - 1 - len, "Z");
-    if (ret < 0)
-      return FALSE;
-    len += ret;
-  } else {
-    ret = silc_snprintf(ret_string + len, ret_string_size - 1 - len,
-                  "%c%02u%02u", time_val->utc_east ? '+' : '-',
-                  time_val->utc_hour, time_val->utc_minute);
-    if (ret < 0)
-      return FALSE;
-    len += ret;
-  }
-
-  return TRUE;
-}
-
-/* Return TRUE if `smaller' is smaller than `bigger'. */
-
-int silc_compare_timeval(struct timeval *t1, struct timeval *t2)
-{
-  SilcInt32 s = t1->tv_sec - t2->tv_sec;
-  if (!s)
-    return t1->tv_usec - t2->tv_usec;
-  return s;
-}
diff --git a/lib/silcutil/silctime.h b/lib/silcutil/silctime.h
deleted file mode 100644 (file)
index 6c22d90..0000000
+++ /dev/null
@@ -1,318 +0,0 @@
-/*
-
-  silctime.h
-
-  Author: Pekka Riikonen <priikone@silcnet.org>
-
-  Copyright (C) 2003 - 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.
-
-*/
-
-/****h* silcutil/SILC Time Interface
- *
- * DESCRIPTION
- *
- * This interface provides various utility functions for getting current
- * time and converting different time representations into the SilcTime
- * representation.
- *
- ***/
-
-#ifndef SILCTIME_H
-#define SILCTIME_H
-
-/****s* silcutil/SilcTimeAPI/SilcTime
- *
- * NAME
- *
- *    typedef struct { ... } *SilcTime, SilcTimeStruct;
- *
- * DESCRIPTION
- *
- *    This context represents time value.  It includes date and time
- *    down to millisecond precision.  The structure size is 64 bits.
- *
- * SOURCE
- *
- ***/
-typedef struct SilcTimeObject {
-  unsigned int year       : 15;           /* Year,     0 - 32768 */
-  unsigned int month      : 4;    /* Month,    1 - 12 */
-  unsigned int day        : 5;    /* Day,      1 - 31 */
-  unsigned int hour       : 5;    /* Hour,     0 - 23 */
-  unsigned int minute     : 6;    /* Minute,   0 - 59 */
-  unsigned int second     : 6;    /* Second,   0 - 61 */
-  unsigned int msecond    : 10;           /* Millisec, 0 - 1000 */
-  unsigned int utc_hour   : 5;    /* Offset to Zulu (UTC) hours */
-  unsigned int utc_minute : 6;    /* Offset to Zulu (UTC) minutes */
-  unsigned int utc_east   : 1;    /* Offset, 1 east (+), 0 west (-) */
-  unsigned int dst        : 1;    /* Set if daylight saving time */
-} *SilcTime, SilcTimeStruct;
-/***/
-
-/****f* silcutil/SilcTimeAPI/silc_time
- *
- * SYNOPSIS
- *
- *    SilcInt64 silc_time(void);
- *
- * DESCRIPTION
- *
- *    Returns the current time of the system since Epoch.  The returned
- *    value is seconds since Epoch (1.1.1970).  Returns -1 on error.
- *
- ***/
-SilcInt64 silc_time(void);
-
-/****f* silcutil/SilcTimeAPI/silc_time_msec
- *
- * SYNOPSIS
- *
- *    SilcInt64 silc_time_msec(void);
- *
- * DESCRIPTION
- *
- *    Returns the current time of the system since Epoch in millisecond
- *    resolution.  Returns - 1 on error.
- *
- ***/
-SilcInt64 silc_time_msec(void);
-
-/****f* silcutil/SilcTimeAPI/silc_time_usec
- *
- * SYNOPSIS
- *
- *    SilcInt64 silc_time_usec(void);
- *
- * DESCRIPTION
- *
- *    Returns the current time of the system since Epoch in microsecond
- *    resolution.  Returns - 1 on error.
- *
- ***/
-SilcInt64 silc_time_usec(void);
-
-/****f* silcutil/SilcTimeAPI/silc_time_string
- *
- * SYNOPSIS
- *
- *    const char *silc_time_string(SilcInt64 time_val_sec);
- *
- * DESCRIPTION
- *
- *    Returns time and date as string.  The caller must not free the string
- *    and next call to this function will delete the old string.  If the
- *    `time_val_sec' is zero (0) returns current time as string, otherwise the
- *    `time_val_sec' as string.  The `time_val_sec' is in seconds since Epoch.
- *    Returns NULL on error.
- *
- ***/
-const char *silc_time_string(SilcInt64 time_val_sec);
-
-/****f* silcutil/SilcTimeAPI/silc_time_value
- *
- * SYNOPSIS
- *
- *   SilcBool silc_time_value(SilcInt64 time_val_msec, SilcTime ret_time);
- *
- * DESCRIPTION
- *
- *    Returns time and date as SilcTime.  If the `time_val_msec' is zero (0)
- *    returns current time as SilcTime, otherwise the `time_val_msec' as
- *    SilcTime.  The `time_val_msec' is in milliseconds since Epoch.  Returns
- *    FALSE on error, TRUE otherwise.
- *
- ***/
-SilcBool silc_time_value(SilcInt64 time_val_msec, SilcTime ret_time);
-
-/****f* silcutil/SilcTimeAPI/silc_timezone
- *
- * SYNOPSIS
- *
- *    SilcBool silc_timezone(char *timezone, SilcUInt32 timezone_size);
- *
- * DESCRIPTION
- *
- *    Returns current timezone in Universal time format into the `timezone'
- *    buffer of size of `timezone_size'.  The possible values this function
- *    returns are: Z (For UTC timezone), +hh (UTC + hours) -hh (UTC - hours),
- *    +hh:mm (UTC + hours:minutes) or -hh:mm (UTC - hours:minutes).  The
- *    returned values are always offsets to UTC.
- *
- *    Returns FALSE on error, TRUE otherwise.
- *
- ***/
-SilcBool silc_timezone(char *timezone, SilcUInt32 timezone_size);
-
-/****f* silcutil/SilcTimeAPI/silc_time_universal
- *
- * SYNOPSIS
- *
- *    SilcBool silc_time_universal(const char *universal_time,
- *                                 SilcTime ret_time);
- *
- * DESCRIPTION
- *
- *    Returns time and date as SilcTime from `universal_time' string which
- *    format is "YYMMDDhhmmssZ", where YY is year, MM is month, DD is day,
- *    hh is hour, mm is minutes, ss is seconds and Z is timezone, which
- *    by default is Zulu (UTC).  Universal time is defined in ISO/EIC 8824-1.
- *
- *    Returns FALSE on error, TRUE otherwise.
- *
- * EXAMPLE
- *
- *    SilcTimeStruct ret_time;
- *
- *    time is 03/02/19 19:04:03 Zulu (UTC)
- *    silc_time_universal("030219190403Z", &ret_time);
- *
- ***/
-SilcBool silc_time_universal(const char *universal_time, SilcTime ret_time);
-
-/****f* silcutil/SilcTimeAPI/silc_time_universal_string
- *
- * SYNOPSIS
- *
- *    SilcBool silc_time_universal_string(SilcTime time_val, char *ret_string,
- *                                        SilcUInt32 ret_string_size);
- *
- * DESCRIPTION
- *
- *    Encodes the SilcTime `time' into the universal time format into the
- *    `ret_string' buffer.  Returns FALSE if the buffer is too small.
- *
- ***/
-SilcBool silc_time_universal_string(SilcTime time_val, char *ret_string,
-                                   SilcUInt32 ret_string_size);
-
-/****f* silcutil/SilcTimeAPI/silc_time_generalized
- *
- * SYNOPSIS
- *
- *    SilcBool silc_time_generalized(const char *generalized_time,
- *                                   SilcTime ret_time);
- *
- * DESCRIPTION
- *
- *    Returns time and date as SilcTime from `generalized_time' string which
- *    format is "YYYYMMDDhhmmss.ppZ", where YYYY is year, MM is month, DD
- *    is day, hh is hour, mm is minutes, ss is seconds which may have optional
- *    precision pp, and Z is timezone, which by default is Zulu (UTC).
- *    Generalized time is defined in ISO/EIC 8824-1.
- *
- *    Returns FALSE on error, TRUE otherwise.
- *
- * EXAMPLE
- *
- *    SilcTimeStruct ret_time;
- *
- *    time is 2003/02/19 19:04:03 Zulu (UTC)
- *    silc_time_generalized("20030219190403Z", &ret_time);
- *
- *    time is 2003/02/19 19:05:10.212 Zulu (UTC)
- *    silc_time_generalized("20030219190510.212Z", &ret_time);
- *
- ***/
-SilcBool
-silc_time_generalized(const char *generalized_time, SilcTime ret_time);
-
-/****f* silcutil/SilcTimeAPI/silc_time_generalized_string
- *
- * SYNOPSIS
- *
- *    SilcBool silc_time_generalized_string(SilcTime time_val,
- *                                          char *ret_string,
- *                                          SilcUInt32 ret_string_size);
- *
- * DESCRIPTION
- *
- *    Encodes the SilcTime `time' into the generalized time format into the
- *    `ret_string' buffer.  Returns FALSE if the buffer is too small.
- *
- ***/
-SilcBool silc_time_generalized_string(SilcTime time_val, char *ret_string,
-                                     SilcUInt32 ret_string_size);
-
-/****f* silcutil/SilcTimeAPI/silc_compare_timeval
- *
- * SYNOPSIS
- *
- *    int silc_compare_timeval(struct time_val *t1, struct time_val *t2);
- *
- * DESCRIPTION
- *
- *    Compares `t1' and `t2' time structures and returns less than zero,
- *    zero or more than zero when `t1' is smaller, equal or bigger than
- *    `t2', respectively.
- *
- ***/
-int silc_compare_timeval(struct timeval *t1, struct timeval *t2);
-
-/****f* silcutil/SilcTimeAPI/silc_gettimeofday
- *
- * SYNOPSIS
- *
- *    int silc_gettimeofday(struct timeval *p);
- *
- * DESCRIPTION
- *
- *    Return current time to struct timeval.  This function is system
- *    dependant.  Returns 0 on success and -1 on error.
- *
- ***/
-int silc_gettimeofday(struct timeval *p);
-
-/****f* silcutil/SilcTimeAPI/silc_usleep
- *
- * SYNOPSIS
- *
- *    void silc_usleep(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(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/silctypes.h b/lib/silcutil/silctypes.h
deleted file mode 100644 (file)
index d7f9797..0000000
+++ /dev/null
@@ -1,644 +0,0 @@
-/*
-
-  silctypes.h
-
-  Author: Pekka Riikonen <priikone@silcnet.org>
-
-  Copyright (C) 2002 - 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.
-
-*/
-
-/****h* silcutil/SILC Types
- *
- * DESCRIPTION
- *
- *    This header includes the most basic types used in the SILC source
- *    tree, such as arithmetic types and their manipulation macros.  This
- *    file is included in the silcincludes.h and is automatically available
- *    for application.
- *
- ***/
-
-#ifndef SILCTYPES_H
-#define SILCTYPES_H
-
-/****d* silcutil/SILCTypes/SilcBool
- *
- * NAME
- *
- *    typedef unigned char SilcBool;
- *
- * DESCRIPTION
- *
- *    Boolean value, and is always 8-bits.  Represents value 0 or 1.
- *
- ***/
-typedef unsigned char SilcBool;
-
-/* The bool macro is deprecated.  Use SilcBool instead. */
-#ifdef SILC_MACOSX
-#define bool _Bool
-#endif
-#ifndef __cplusplus
-#ifndef bool
-#define bool unsigned char
-#endif
-#endif
-
-/****d* silcutil/SILCTypes/TRUE
- *
- * NAME
- *
- *    #define TRUE ...
- *
- * DESCRIPTION
- *
- *    Boolean true value indicator.
- *
- * SOURCE
- */
-#ifndef TRUE
-#define TRUE 1
-#endif
-/***/
-
-/****d* silcutil/SILCTypes/FALSE
- *
- * NAME
- *
- *    #define FALSE ...
- *
- * DESCRIPTION
- *
- *    Boolean false value indicator.
- *
- * SOURCE
- */
-#ifndef FALSE
-#define FALSE 0
-#endif
-/***/
-
-/* Our offsetof macro */
-#define silc_offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)
-
-/* silc_likely and silc_unlikely GCC branch prediction macros. Use only if
-   you have profiled the code first. */
-#if __GNUC__ >= 3
-#define silc_likely(expr) __builtin_expect(!!(expr), 1)
-#define silc_unlikely(expr) __builtin_expect(!!(expr), 0)
-#else
-#define silc_likely(expr) (expr)
-#define silc_unlikely(expr) (expr)
-#endif /* __GNUC__ >= 3 */
-
-#if SILC_SIZEOF_SHORT > 2
-#error "size of the short must be 2 bytes"
-#endif
-
-/****d* silcutil/SILCTypes/SilcUInt8
- *
- * NAME
- *
- *    typedef unsigned char SilcUInt8;
- *
- * DESCRIPTION
- *
- *    8-bit unsigned integer.
- *
- * SOURCE
- */
-typedef unsigned char SilcUInt8;
-/***/
-
-/****d* silcutil/SILCTypes/SilcInt8
- *
- * NAME
- *
- *    typedef signed char SilcInt8;
- *
- * DESCRIPTION
- *
- *    8-bit signed integer.
- *
- * SOURCE
- */
-typedef signed char SilcInt8;
-/***/
-
-/****d* silcutil/SILCTypes/SilcUInt16
- *
- * NAME
- *
- *    typedef unsigned short SilcUInt16;
- *
- * DESCRIPTION
- *
- *    16-bit unsigned integer.  Guaranteed to be 16-bits.
- *
- * SOURCE
- */
-typedef unsigned short SilcUInt16;
-/***/
-
-/****d* silcutil/SILCTypes/SilcInt16
- *
- * NAME
- *
- *    typedef signed short SilcInt16;
- *
- * DESCRIPTION
- *
- *    16-bit signed integer.  Guaranteed to be 16-bits.
- *
- * SOURCE
- */
-typedef signed short SilcInt16;
-/***/
-
-/****d* silcutil/SILCTypes/SilcUInt32
- *
- * NAME
- *
- *    typedef unsigned long SilcUInt32;
- *
- * DESCRIPTION
- *
- *    32-bit unsigned integer.  Guaranteed to be 32-bits.
- *
- * SOURCE
- */
-#if SILC_SIZEOF_INT == 4
-typedef unsigned int SilcUInt32;
-typedef signed int SilcInt32;
-#else
-#if SILC_SIZEOF_LONG == 4
-typedef unsigned long SilcUInt32;
-typedef signed long SilcInt32;
-#else
-#if SILC_SIZEOF_LONG_LONG >= 4
-#ifndef WIN32
-typedef unsigned long long SilcUInt32;
-typedef signed long long SilcInt32;
-#endif
-#endif
-#endif
-#endif
-/***/
-
-/****d* silcutil/SILCTypes/SilcInt32
- *
- * NAME
- *
- *    typedef signed long SilcInt32;
- *
- * DESCRIPTION
- *
- *    32-bit signed integer.  Guaranteed to be 32-bits.
- *
- ***/
-
-/****d* silcutil/SILCTypes/SilcUInt64
- *
- * NAME
- *
- *    typedef unsigned long long SilcUInt64;
- *
- * DESCRIPTION
- *
- *    64-bit unsigned integer.  Guaranteed to be 64-bits on systems that
- *    support it.
- *
- * SOURCE
- */
-#if SILC_SIZEOF_LONG >= 8
-typedef unsigned long SilcUInt64;
-typedef signed long SilcInt64;
-#else
-#if SILC_SIZEOF_LONG_LONG >= 8
-#ifndef WIN32
-typedef unsigned long long SilcUInt64;
-typedef signed long long SilcInt64;
-#else
-typedef unsigned __int64 SilcUInt64;
-typedef signed __int64 SilcInt64;
-#endif
-#else
-typedef SilcUInt32 SilcUInt64;
-typedef SilcInt32 SilcInt64;
-#endif
-#endif
-/***/
-
-/****d* silcutil/SILCTypes/SilcInt64
- *
- * NAME
- *
- *    typedef signed long long SilcInt64;
- *
- * DESCRIPTION
- *
- *    64-bit signed integer.  Guaranteed to be 64-bits on systems that
- *    support it.
- *
- ***/
-
-#if SILC_SIZEOF_VOID_P < 4
-typedef SilcUInt32 * void *;
-#endif
-
-/****d* silcutil/SILCTypes/SilcSocket
- *
- * NAME
- *
- *    SilcSocket
- *
- * DESCRIPTION
- *
- *    Platform specific socket.  On POSIX compliant systems this is simply
- *    an integer, representing the socket. On other systems it is platform
- *    specific socket context.  Access it only through routines that can
- *    handle SilcSocket types, unless you know what you are doing.
- *
- * SOURCE
- */
-#if defined(SILC_UNIX)
-typedef int SilcSocket;
-#elif defined(SILC_WIN32)
-typedef SOCKET SilcSocket;
-#elif defined(SILC_SYMBIAN)
-typedef void * SilcSocket;
-#endif
-/***/
-
-/* Macros */
-
-#define SILC_GET_WORD(cp) ((SilcUInt32)(SilcUInt8)(cp)[0]) << 24       \
-                   | ((SilcUInt32)(SilcUInt8)(cp)[1] << 16)            \
-                   | ((SilcUInt32)(SilcUInt8)(cp)[2] << 8)             \
-                   | ((SilcUInt32)(SilcUInt8)(cp)[3])
-
-/****d* silcutil/SILCTypes/SILC_GET16_MSB
- *
- * NAME
- *
- *    #define SILC_GET16_MSB ...
- *
- * DESCRIPTION
- *
- *    Return two 8-bit bytes, most significant bytes first.
- *
- * SOURCE
- */
-#define SILC_GET16_MSB(l, cp)                          \
-do {                                                   \
-  (l) = ((SilcUInt32)(SilcUInt8)(cp)[0] << 8)          \
-    | ((SilcUInt32)(SilcUInt8)(cp)[1]);                        \
-} while(0)
-/***/
-
-/****d* silcutil/SILCTypes/SILC_GET32_MSB
- *
- * NAME
- *
- *    #define SILC_GET32_MSB ...
- *
- * DESCRIPTION
- *
- *    Return four 8-bit bytes, most significant bytes first.
- *
- * SOURCE
- */
-#define SILC_GET32_MSB(l, cp)                          \
-do {                                                   \
-  (l) = ((SilcUInt32)(SilcUInt8)(cp)[0]) << 24         \
-    | ((SilcUInt32)(SilcUInt8)(cp)[1] << 16)           \
-    | ((SilcUInt32)(SilcUInt8)(cp)[2] << 8)            \
-    | ((SilcUInt32)(SilcUInt8)(cp)[3]);                        \
-} while(0)
-/***/
-
-/****d* silcutil/SILCTypes/SILC_GET64_MSB
- *
- * NAME
- *
- *    #define SILC_GET64_MSB ...
- *
- * DESCRIPTION
- *
- *    Return eight 8-bit bytes, most significant bytes first.
- *
- * SOURCE
- */
-#define SILC_GET64_MSB(l, cp)                                  \
-do {                                                           \
-  (l) = ((((SilcUInt64)SILC_GET_WORD((cp))) << 32) |           \
-        ((SilcUInt64)SILC_GET_WORD((cp) + 4)));                \
-} while(0)
-/***/
-
-/****d* silcutil/SILCTypes/SILC_GET16_LSB
- *
- * NAME
- *
- *    #define SILC_GET16_MSB ...
- *
- * DESCRIPTION
- *
- *    Return two 8-bit bytes, least significant bytes first.
- *
- * SOURCE
- */
-#if defined(SILC_I486) && defined(__GNUC__)
-#define SILC_GET16_LSB(l, cp) (l) = (*(SilcUInt16 *)(cp))
-#else
-#define SILC_GET16_LSB(l, cp)                          \
-do {                                                   \
-  (l) = ((SilcUInt32)(SilcUInt8)(cp)[0])               \
-    | ((SilcUInt32)(SilcUInt8)(cp)[1] << 8);           \
-} while(0)
-#endif /* SILC_I486 && __GNUC__ */
-/***/
-
-/****d* silcutil/SILCTypes/SILC_GET32_LSB
- *
- * NAME
- *
- *    #define SILC_GET32_LSB ...
- *
- * DESCRIPTION
- *
- *    Return four 8-bit bytes, least significant bytes first.
- *
- * SOURCE
- */
-#if defined(SILC_I486) && defined(__GNUC__)
-#define SILC_GET32_LSB(l, cp) (l) = (*(SilcUInt32 *)(cp))
-#else
-#define SILC_GET32_LSB(l, cp)                          \
-do {                                                   \
-  (l) = ((SilcUInt32)(SilcUInt8)(cp)[0])               \
-    | ((SilcUInt32)(SilcUInt8)(cp)[1] << 8)            \
-    | ((SilcUInt32)(SilcUInt8)(cp)[2] << 16)           \
-    | ((SilcUInt32)(SilcUInt8)(cp)[3] << 24);          \
-} while(0)
-#endif /* SILC_I486 && __GNUC__ */
-
-/* Same as upper but XOR the result always. Special purpose macro. */
-#if defined(SILC_I486) && defined(__GNUC__)
-#define SILC_GET32_X_LSB(l, cp) (l) ^= (*(SilcUInt32 *)(cp))
-#else
-#define SILC_GET32_X_LSB(l, cp)                                \
-  (l) ^= ((SilcUInt32)(SilcUInt8)(cp)[0])              \
-    | ((SilcUInt32)(SilcUInt8)(cp)[1] << 8)            \
-    | ((SilcUInt32)(SilcUInt8)(cp)[2] << 16)           \
-    | ((SilcUInt32)(SilcUInt8)(cp)[3] << 24)
-#endif /* SILC_I486 && __GNUC__ */
-/***/
-
-/****d* silcutil/SILCTypes/SILC_PUT16_MSB
- *
- * NAME
- *
- *    #define SILC_PUT16_MSB ...
- *
- * DESCRIPTION
- *
- *    Put two 8-bit bytes, most significant bytes first.
- *
- * SOURCE
- */
-#define SILC_PUT16_MSB(l, cp)                  \
-do {                                           \
-  (cp)[0] = (SilcUInt8)((l) >> 8);             \
-  (cp)[1] = (SilcUInt8)(l);                    \
-} while(0)
-/***/
-
-/****d* silcutil/SILCTypes/SILC_PUT32_MSB
- *
- * NAME
- *
- *    #define SILC_PUT32_MSB ...
- *
- * DESCRIPTION
- *
- *    Put four 8-bit bytes, most significant bytes first.
- *
- * SOURCE
- */
-#define SILC_PUT32_MSB(l, cp)                  \
-do {                                           \
-  (cp)[0] = (SilcUInt8)((l) >> 24);            \
-  (cp)[1] = (SilcUInt8)((l) >> 16);            \
-  (cp)[2] = (SilcUInt8)((l) >> 8);             \
-  (cp)[3] = (SilcUInt8)(l);                    \
-} while(0)
-/***/
-
-/****d* silcutil/SILCTypes/SILC_PUT64_MSB
- *
- * NAME
- *
- *    #define SILC_PUT64_MSB ...
- *
- * DESCRIPTION
- *
- *    Put eight 8-bit bytes, most significant bytes first.
- *
- * SOURCE
- */
-#define SILC_PUT64_MSB(l, cp)                                  \
-do {                                                           \
-  SILC_PUT32_MSB((SilcUInt32)((SilcUInt64)(l) >> 32), (cp));   \
-  SILC_PUT32_MSB((SilcUInt32)(l), (cp) + 4);                   \
-} while(0)
-/***/
-
-/****d* silcutil/SILCTypes/SILC_PUT16_LSB
- *
- * NAME
- *
- *    #define SILC_PUT16_LSB ...
- *
- * DESCRIPTION
- *
- *    Put two 8-bit bytes, least significant bytes first.
- *
- * SOURCE
- */
-#if defined(SILC_I486) && defined(__GNUC__)
-#define SILC_PUT16_LSB(l, cp) (*(SilcUInt16 *)(cp)) = (l)
-#else
-#define SILC_PUT16_LSB(l, cp)                  \
-do  {                                          \
-  (cp)[0] = (SilcUInt8)(l);                    \
-  (cp)[1] = (SilcUInt8)((l) >> 8);             \
-} while(0)
-#endif /* SILC_I486 && __GNUC__ */
-/***/
-
-/****d* silcutil/SILCTypes/SILC_PUT32_LSB
- *
- * NAME
- *
- *    #define SILC_PUT32_LSB ...
- *
- * DESCRIPTION
- *
- *    Put four 8-bit bytes, least significant bytes first.
- *
- * SOURCE
- */
-#if defined(SILC_I486) && defined(__GNUC__)
-#define SILC_PUT32_LSB(l, cp) (*(SilcUInt32 *)(cp)) = (l)
-#else
-#define SILC_PUT32_LSB(l, cp)                  \
-do {                                           \
-  (cp)[0] = (SilcUInt8)(l);                    \
-  (cp)[1] = (SilcUInt8)((l) >> 8);             \
-  (cp)[2] = (SilcUInt8)((l) >> 16);            \
-  (cp)[3] = (SilcUInt8)((l) >> 24);            \
-} while(0)
-#endif /* SILC_I486 && __GNUC__ */
-/***/
-
-/****d* silcutil/SILCTypes/SILC_SWAB_16
- *
- * NAME
- *
- *    #define SILC_SWAB_16 ...
- *
- * DESCRIPTION
- *
- *    Swabs 16-bit unsigned integer byte order.
- *
- * SOURCE
- */
-#define SILC_SWAB_16(l)                                                \
-  ((SilcUInt16)(((SilcUInt16)(l) & (SilcUInt16)0x00FFU) << 8) |        \
-               (((SilcUInt16)(l) & (SilcUInt16)0xFF00U) >> 8))
-/***/
-
-/****d* silcutil/SILCTypes/SILC_SWAB_32
- *
- * NAME
- *
- *    #define SILC_SWAB_32 ...
- *
- * DESCRIPTION
- *
- *    Swabs 32-bit unsigned integer byte order.
- *
- * SOURCE
- */
-#define SILC_SWAB_32(l)                                                        \
-  ((SilcUInt32)(((SilcUInt32)(l) & (SilcUInt32)0x000000FFUL) << 24) |  \
-               (((SilcUInt32)(l) & (SilcUInt32)0x0000FF00UL) << 8)  |  \
-               (((SilcUInt32)(l) & (SilcUInt32)0x00FF0000UL) >> 8)  |  \
-               (((SilcUInt32)(l) & (SilcUInt32)0xFF000000UL) >> 24))
-/***/
-
-/****d* silcutil/SILCTypes/SILC_PTR_TO_32
- *
- * NAME
- *
- *    #define SILC_PTR_TO_32 ...
- *
- * DESCRIPTION
- *
- *    Type casts a pointer's value into a 32-bit integer.  Use this to
- *    avoid compiler warnings when type casting pointers to integers
- *    of different size.
- *
- * SOURCE
- */
-#if SILC_SIZEOF_VOID_P < 8
-#define SILC_PTR_TO_32(_ptr__) ((SilcUInt32)(_ptr__))
-#else
-#define SILC_PTR_TO_32(_ptr__)                                                 \
-  ((SilcUInt32)((SilcUInt64)(_ptr__) & (SilcUInt32)0xFFFFFFFFUL))
-#endif
-/***/
-
-/****d* silcutil/SILCTypes/SILC_PTR_TO_64
- *
- * NAME
- *
- *    #define SILC_PTR_TO_64 ...
- *
- * DESCRIPTION
- *
- *    Type casts a pointer's value into a 64-bit integer.  Use this to
- *    avoid compiler warnings when type casting pointers to integers
- *    of different size.
- *
- * SOURCE
- */
-#if SILC_SIZEOF_VOID_P < 8
-#define SILC_PTR_TO_64(_ptr__) ((SilcUInt64)((SilcUInt32)(_ptr__)))
-#else
-#define SILC_PTR_TO_64(_ptr__) ((SilcUInt64)((SilcUInt64)(_ptr__)))
-#endif
-/***/
-
-/****d* silcutil/SILCTypes/SILC_32_TO_PTR
- *
- * NAME
- *
- *    #define SILC_32_TO_PTR ...
- *
- * DESCRIPTION
- *
- *    Type casts a 32-bit integer value into a pointer.  Use this to
- *    avoid compiler warnings when type casting integers to pointers of
- *    different size.
- *
- * SOURCE
- */
-#if SILC_SIZEOF_VOID_P < 8
-#define SILC_32_TO_PTR(_ival__) ((void *)((SilcUInt32)(_ival__)))
-#else
-#define SILC_32_TO_PTR(_ival__) ((void *)((SilcUInt64)(_ival__)))
-#endif
-/***/
-
-/****d* silcutil/SILCTypes/SILC_64_TO_PTR
- *
- * NAME
- *
- *    #define SILC_64_TO_PTR ...
- *
- * DESCRIPTION
- *
- *    Type casts a 64-bit integer value into a pointer.  Use this to
- *    avoid compiler warnings when type casting integers to pointers of
- *    different size.
- *
- * SOURCE
- */
-#if SILC_SIZEOF_VOID_P < 8
-#define SILC_64_TO_PTR(_ival__)                                                \
-  ((void *)((SilcUInt32)((SilcUInt64)(_ival__) & (SilcUInt32)0xFFFFFFFFUL)))
-#else
-#define SILC_64_TO_PTR(_ival__) ((void *)((SilcUInt64)(_ival__)))
-#endif
-/***/
-
-typedef char __check_size1[sizeof(SilcInt8)   ==       1 ? 1 : -1];
-typedef char __check_size2[sizeof(SilcUInt8)  ==       1 ? 1 : -1];
-typedef char __check_size3[sizeof(SilcInt16)  ==       2 ? 1 : -1];
-typedef char __check_size4[sizeof(SilcUInt16) ==       2 ? 1 : -1];
-typedef char __check_size5[sizeof(SilcInt32)  ==       4 ? 1 : -1];
-typedef char __check_size6[sizeof(SilcUInt32) ==       4 ? 1 : -1];
-
-#endif /* SILCTYPES_H */
diff --git a/lib/silcutil/silcutf8.c b/lib/silcutil/silcutf8.c
deleted file mode 100644 (file)
index 1faf14c..0000000
+++ /dev/null
@@ -1,649 +0,0 @@
-/*
-
-  silcutf8.c
-
-  Author: Pekka Riikonen <priikone@silcnet.org>
-
-  Copyright (C) 2004 - 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.
-
-*/
-
-#include "silc.h"
-#include "silcutf8.h"
-
-/* Encodes the string `bin' of which encoding is `bin_encoding' to the
-   UTF-8 encoding into the buffer `utf8' which is of size of `utf8_size'.
-   Returns the length of the UTF-8 encoded string, or zero (0) on error.
-   By default `bin_encoding' is ASCII, and the caller needs to know the
-   encoding of the input string if it is anything else. */
-
-SilcUInt32 silc_utf8_encode(const unsigned char *bin, SilcUInt32 bin_len,
-                           SilcStringEncoding bin_encoding,
-                           unsigned char *utf8, SilcUInt32 utf8_size)
-{
-  SilcUInt32 enclen = 0, i, charval = 0;
-
-  if (!bin || !bin_len)
-    return 0;
-
-  if (bin_encoding == SILC_STRING_UTF8) {
-    if (!silc_utf8_valid(bin, bin_len))
-      return 0;
-    if (!utf8)
-      return bin_len;
-    if (bin_len > utf8_size)
-      return 0;
-    memcpy(utf8, bin, bin_len);
-    return bin_len;
-  }
-
-  /* The SILC_STRING_LDAP_DN is alredy UTF-8 but it may be escaped.  We
-     remove the escaping and we're done. */
-  if (bin_encoding == SILC_STRING_LDAP_DN ||
-      bin_encoding == SILC_STRING_UTF8_ESCAPE) {
-    unsigned char cv;
-
-    for (i = 0; i < bin_len; i++) {
-      if (bin[i] == '\\') {
-       if (i + 1 >= bin_len)
-         return 0;
-
-       /* If escaped character is any of the following no processing is
-          needed, otherwise it is a hex value and we need to read it. */
-       cv = bin[i + 1];
-       if (cv != ',' && cv != '+' && cv != '"' && cv != '\\' && cv != '<' &&
-           cv != '>' && cv != ';' && cv != ' ' && cv != '#') {
-         unsigned int hexval;
-         if (i + 2 >= bin_len)
-           return 0;
-         if (sscanf(&bin[i + 1], "%02X", &hexval) != 1)
-           return 0;
-         if (utf8) {
-           if (enclen + 1 > utf8_size)
-             return 0;
-           utf8[enclen] = (unsigned char)hexval;
-         }
-
-         i += 2;
-         enclen++;
-         continue;
-       }
-       i++;
-      }
-
-      if (utf8) {
-       if (enclen + 1 > utf8_size)
-         return 0;
-       utf8[enclen] = bin[i];
-      }
-      enclen++;
-    }
-
-    return enclen;
-  }
-
-  if (bin_encoding == SILC_STRING_LOCALE) {
-#if defined(HAVE_ICONV) && defined(HAVE_NL_LANGINFO) && defined(CODESET)
-    char *fromconv, *icp, *ocp;
-    iconv_t icd;
-    size_t inlen, outlen;
-
-    setlocale(LC_CTYPE, "");
-    fromconv = nl_langinfo(CODESET);
-    if (fromconv && strlen(fromconv)) {
-      icd = iconv_open("UTF-8", fromconv);
-      icp = (char *)bin;
-      ocp = (char *)utf8;
-      inlen = bin_len;
-      outlen = utf8_size;
-      if (icp && ocp && icd != (iconv_t)-1) {
-       if (iconv(icd, &icp, &inlen, &ocp, &outlen) != -1) {
-         utf8_size -= outlen;
-         iconv_close(icd);
-         return utf8_size;
-       }
-      }
-      if (icd != (iconv_t)-1)
-       iconv_close(icd);
-    }
-#endif
-
-    /* Fallback to 8-bit ASCII */
-    bin_encoding = SILC_STRING_ASCII;
-  }
-
-  for (i = 0; i < bin_len; i++) {
-    switch (bin_encoding) {
-    case SILC_STRING_ASCII:
-    case SILC_STRING_TELETEX:
-      charval = bin[i];
-      break;
-    case SILC_STRING_ASCII_ESC:
-      SILC_NOT_IMPLEMENTED("SILC_STRING_ASCII_ESC");
-      return 0;
-      break;
-    case SILC_STRING_BMP:
-      if (i + 1 >= bin_len)
-       return 0;
-      SILC_GET16_MSB(charval, bin + i);
-      i += 1;
-      break;
-    case SILC_STRING_BMP_LSB:
-      if (i + 1 >= bin_len)
-       return 0;
-      SILC_GET16_LSB(charval, bin + i);
-      i += 1;
-      break;
-    case SILC_STRING_UNIVERSAL:
-      if (i + 3 >= bin_len)
-       return 0;
-      SILC_GET32_MSB(charval, bin + i);
-      i += 3;
-      break;
-    case SILC_STRING_UNIVERSAL_LSB:
-      if (i + 3 >= bin_len)
-       return 0;
-      SILC_GET32_LSB(charval, bin + i);
-      i += 3;
-      break;
-    case SILC_STRING_PRINTABLE:
-    case SILC_STRING_VISIBLE:
-      if (!isprint(bin[i]))
-       return 0;
-      charval = bin[i];
-      break;
-    case SILC_STRING_NUMERICAL:
-      if (bin[i] != 0x20 && !isdigit(bin[i]))
-       return 0;
-      charval = bin[i];
-      break;
-    default:
-      return 0;
-      break;
-    }
-
-    if (charval < 0x80) {
-      if (utf8) {
-       if (enclen > utf8_size)
-         return 0;
-
-       utf8[enclen] = (unsigned char)charval;
-      }
-      enclen++;
-    } else if (charval < 0x800) {
-      if (utf8) {
-       if (enclen + 2 > utf8_size)
-         return 0;
-
-       utf8[enclen    ] = (unsigned char )(((charval >> 6)  & 0x1f) | 0xc0);
-       utf8[enclen + 1] = (unsigned char )((charval & 0x3f) | 0x80);
-      }
-      enclen += 2;
-    } else if (charval < 0x10000) {
-      if (utf8) {
-       if (enclen + 3 > utf8_size)
-         return 0;
-
-       utf8[enclen    ] = (unsigned char )(((charval >> 12) & 0xf)  | 0xe0);
-       utf8[enclen + 1] = (unsigned char )(((charval >> 6)  & 0x3f) | 0x80);
-       utf8[enclen + 2] = (unsigned char )((charval & 0x3f) | 0x80);
-      }
-      enclen += 3;
-    } else if (charval < 0x200000) {
-      if (utf8) {
-       if (enclen + 4 > utf8_size)
-         return 0;
-
-       utf8[enclen    ] = (unsigned char )(((charval >> 18) & 0x7)  | 0xf0);
-       utf8[enclen + 1] = (unsigned char )(((charval >> 12) & 0x3f) | 0x80);
-       utf8[enclen + 2] = (unsigned char )(((charval >> 6)  & 0x3f) | 0x80);
-       utf8[enclen + 3] = (unsigned char )((charval & 0x3f) | 0x80);
-      }
-      enclen += 4;
-    } else if (charval < 0x4000000) {
-      if (utf8) {
-       if (enclen + 5 > utf8_size)
-         return 0;
-
-       utf8[enclen    ] = (unsigned char )(((charval >> 24) & 0x3)  | 0xf8);
-       utf8[enclen + 1] = (unsigned char )(((charval >> 18) & 0x3f) | 0x80);
-       utf8[enclen + 2] = (unsigned char )(((charval >> 12) & 0x3f) | 0x80);
-       utf8[enclen + 3] = (unsigned char )(((charval >> 6)  & 0x3f) | 0x80);
-       utf8[enclen + 4] = (unsigned char )((charval & 0x3f) | 0x80);
-      }
-      enclen += 5;
-    } else {
-      if (utf8) {
-       if (enclen + 6 > utf8_size)
-         return 0;
-
-       utf8[enclen    ] = (unsigned char )(((charval >> 30) & 0x1)  | 0xfc);
-       utf8[enclen + 1] = (unsigned char )(((charval >> 24) & 0x3f) | 0x80);
-       utf8[enclen + 2] = (unsigned char )(((charval >> 18) & 0x3f) | 0x80);
-       utf8[enclen + 3] = (unsigned char )(((charval >> 12) & 0x3f) | 0x80);
-       utf8[enclen + 4] = (unsigned char )(((charval >> 6)  & 0x3f) | 0x80);
-       utf8[enclen + 5] = (unsigned char )((charval & 0x3f) | 0x80);
-      }
-      enclen += 6;
-    }
-  }
-
-  return enclen;
-}
-
-/* Decodes UTF-8 encoded string `utf8' to string of which encoding is
-   to be `bin_encoding', into the `bin' buffer of size of `bin_size'.
-   Returns the length of the decoded buffer, or zero (0) on error.
-   By default `bin_encoding' is ASCII, and the caller needs to know to
-   which encoding the output string is to be encoded if ASCII is not
-   desired. */
-
-SilcUInt32 silc_utf8_decode(const unsigned char *utf8, SilcUInt32 utf8_len,
-                           SilcStringEncoding bin_encoding,
-                           unsigned char *bin, SilcUInt32 bin_size)
-{
-  SilcUInt32 enclen = 0, i, charval, bytes;
-
-  if (!utf8 || !utf8_len)
-    return 0;
-
-  if (bin_encoding == SILC_STRING_UTF8) {
-    if (!silc_utf8_valid(utf8, utf8_len) ||
-       utf8_len > bin_size)
-      return 0;
-    memcpy(bin, utf8, utf8_len);
-    return utf8_len;
-  }
-
-  if (bin_encoding == SILC_STRING_LOCALE) {
-#if defined(HAVE_ICONV) && defined(HAVE_NL_LANGINFO) && defined(CODESET)
-    char *toconv, *icp, *ocp;
-    iconv_t icd;
-    size_t inlen, outlen;
-
-    setlocale(LC_CTYPE, "");
-    toconv = nl_langinfo(CODESET);
-    if (toconv && strlen(toconv)) {
-      icd = iconv_open(toconv, "UTF-8");
-      icp = (char *)utf8;
-      ocp = (char *)bin;
-      inlen = utf8_len;
-      outlen = bin_size;
-      if (icp && ocp && icd != (iconv_t)-1) {
-       if (iconv(icd, &icp, &inlen, &ocp, &outlen) != -1) {
-         bin_size -= outlen;
-         iconv_close(icd);
-         return bin_size;
-       }
-      }
-      if (icd != (iconv_t)-1)
-       iconv_close(icd);
-    }
-#endif
-
-    /* Fallback to 8-bit ASCII */
-    bin_encoding = SILC_STRING_ASCII;
-  }
-
-  for (i = 0; i < utf8_len; i++) {
-    if ((utf8[i] & 0x80) == 0x00) {
-      charval = utf8[i] & 0x7f;
-      bytes = 1;
-    } else if ((utf8[i] & 0xe0) == 0xc0) {
-      if (i + 1 >= utf8_len)
-       return 0;
-
-      if ((utf8[i + 1] & 0xc0) != 0x80)
-        return 0;
-
-      charval = (utf8[i++] & 0x1f) << 6;
-      charval |= utf8[i] & 0x3f;
-      if (charval < 0x80)
-        return 0;
-      bytes = 2;
-    } else if ((utf8[i] & 0xf0) == 0xe0) {
-      if (i + 2 >= utf8_len)
-       return 0;
-
-      if (((utf8[i + 1] & 0xc0) != 0x80) ||
-         ((utf8[i + 2] & 0xc0) != 0x80))
-        return 0;
-
-      /* Surrogates not allowed (D800-DFFF) */
-      if (utf8[i] == 0xed &&
-         utf8[i + 1] >= 0xa0 && utf8[i + 1] <= 0xbf &&
-         utf8[i + 2] >= 0x80 && utf8[i + 2] <= 0xbf)
-       return 0;
-
-      charval = (utf8[i++]  & 0xf)  << 12;
-      charval |= (utf8[i++] & 0x3f) << 6;
-      charval |= utf8[i] & 0x3f;
-      if (charval < 0x800)
-        return 0;
-      bytes = 3;
-    } else if ((utf8[i] & 0xf8) == 0xf0) {
-      if (i + 3 >= utf8_len)
-       return 0;
-
-      if (((utf8[i + 1] & 0xc0) != 0x80) ||
-         ((utf8[i + 2] & 0xc0) != 0x80) ||
-         ((utf8[i + 3] & 0xc0) != 0x80))
-        return 0;
-
-      charval = ((SilcUInt32)(utf8[i++] & 0x7)) << 18;
-      charval |= (utf8[i++] & 0x3f) << 12;
-      charval |= (utf8[i++] & 0x3f) << 6;
-      charval |= utf8[i] & 0x3f;
-      if (charval < 0x10000)
-        return 0;
-      bytes = 4;
-    } else if ((utf8[i] & 0xfc) == 0xf8) {
-      if (i + 4 >= utf8_len)
-       return 0;
-
-      if (((utf8[i + 1] & 0xc0) != 0x80) ||
-         ((utf8[i + 2] & 0xc0) != 0x80) ||
-         ((utf8[i + 3] & 0xc0) != 0x80) ||
-         ((utf8[i + 4] & 0xc0) != 0x80))
-        return 0;
-
-      charval = ((SilcUInt32)(utf8[i++]  & 0x3))  << 24;
-      charval |= ((SilcUInt32)(utf8[i++] & 0x3f)) << 18;
-      charval |= ((SilcUInt32)(utf8[i++] & 0x3f)) << 12;
-      charval |= (utf8[i++] & 0x3f) << 6;
-      charval |= utf8[i] & 0x3f;
-      if (charval < 0x200000)
-        return 0;
-      bytes = 5;
-    } else if ((utf8[i] & 0xfe) == 0xfc) {
-      if (i + 5 >= utf8_len)
-       return 0;
-
-      if (((utf8[i + 1] & 0xc0) != 0x80) ||
-         ((utf8[i + 2] & 0xc0) != 0x80) ||
-         ((utf8[i + 3] & 0xc0) != 0x80) ||
-         ((utf8[i + 4] & 0xc0) != 0x80) ||
-         ((utf8[i + 5] & 0xc0) != 0x80))
-        return 0;
-
-      charval = ((SilcUInt32)(utf8[i++]  & 0x1))  << 30;
-      charval |= ((SilcUInt32)(utf8[i++] & 0x3f)) << 24;
-      charval |= ((SilcUInt32)(utf8[i++] & 0x3f)) << 18;
-      charval |= ((SilcUInt32)(utf8[i++] & 0x3f)) << 12;
-      charval |= (utf8[i++] & 0x3f) << 6;
-      charval |= utf8[i] & 0x3f;
-      if (charval < 0x4000000)
-        return 0;
-      bytes = 6;
-    } else {
-      return 0;
-    }
-
-    switch (bin_encoding) {
-    case SILC_STRING_ASCII:
-    case SILC_STRING_PRINTABLE:
-    case SILC_STRING_VISIBLE:
-    case SILC_STRING_TELETEX:
-    case SILC_STRING_NUMERICAL:
-      if (bin) {
-        if (enclen + 1 > bin_size)
-          return 0;
-
-        bin[enclen] = (unsigned char)charval;
-      }
-      enclen++;
-      break;
-    case SILC_STRING_ASCII_ESC:
-      SILC_NOT_IMPLEMENTED("SILC_STRING_ASCII_ESC");
-      return 0;
-      break;
-    case SILC_STRING_BMP:
-      if (bin) {
-        if (enclen + 2 > bin_size)
-          return 0;
-       SILC_PUT16_MSB(charval, bin + enclen);
-      }
-      enclen += 2;
-      break;
-    case SILC_STRING_BMP_LSB:
-      if (bin) {
-        if (enclen + 2 > bin_size)
-          return 0;
-       SILC_PUT16_LSB(charval, bin + enclen);
-      }
-      enclen += 2;
-      break;
-    case SILC_STRING_UNIVERSAL:
-      if (bin) {
-        if (enclen + 4 > bin_size)
-          return 0;
-       SILC_PUT32_MSB(charval, bin + enclen);
-      }
-      enclen += 4;
-      break;
-    case SILC_STRING_UNIVERSAL_LSB:
-      if (bin) {
-        if (enclen + 4 > bin_size)
-          return 0;
-       SILC_PUT32_LSB(charval, bin + enclen);
-      }
-      enclen += 4;
-      break;
-    case SILC_STRING_LDAP_DN:
-      {
-        int k;
-       unsigned char cv;
-
-       /* Non-printable UTF-8 characters will be escaped, printable will
-          be as is.  We take the bytes directly from the original data. */
-       for (k = 0; k < bytes; k++) {
-         cv = utf8[(i - (bytes - 1)) + k];
-
-         /* If string starts with space or # escape it */
-         if (!enclen && (cv == '#' || cv == ' ')) {
-           if (bin) {
-             if (enclen + 2 > bin_size)
-               return 0;
-             bin[enclen] = '\\';
-             bin[enclen + 1] = cv;
-           }
-           enclen += 2;
-           continue;
-         }
-
-         /* If string ends with space escape it */
-         if (i == utf8_len - 1 && cv == ' ') {
-           if (bin) {
-             if (enclen + 2 > bin_size)
-               return 0;
-             bin[enclen] = '\\';
-             bin[enclen + 1] = cv;
-           }
-           enclen += 2;
-           continue;
-         }
-
-         /* If character is any of following then escape */
-         if (cv == ',' || cv == '+' || cv == '"' || cv == '\\' || cv == '<' ||
-             cv == '>' || cv == ';') {
-           if (bin) {
-             if (enclen + 2 > bin_size)
-               return 0;
-             bin[enclen] = '\\';
-             bin[enclen + 1] = cv;
-           }
-           enclen += 2;
-           continue;
-         }
-
-         /* If character is not printable escape it with hex character */
-         if (!isprint((int)cv)) {
-           if (bin) {
-             if (enclen + 3 > bin_size)
-               return 0;
-             bin[enclen] = '\\';
-             silc_snprintf(bin + enclen + 1, 3, "%02X", cv);
-           }
-           enclen += 3;
-           continue;
-         }
-
-         if (bin) {
-           if (enclen + 1 > bin_size)
-             return 0;
-           bin[enclen] = cv;
-         }
-         enclen++;
-       }
-      }
-      break;
-    default:
-      return 0;
-      break;
-    }
-  }
-
-  return enclen;
-}
-
-/* UTF-8 to wide characters */
-
-SilcUInt32 silc_utf8_c2w(const unsigned char *utf8, SilcUInt32 utf8_len,
-                        SilcUInt16 *utf8_wide, SilcUInt32 utf8_wide_size)
-{
-  unsigned char *tmp;
-  SilcUInt32 tmp_len;
-  int i, k;
-
-  tmp_len = silc_utf8_decoded_len(utf8, utf8_len, SILC_STRING_BMP);
-  if (!tmp_len)
-    return 0;
-
-  if (utf8_wide_size < tmp_len / 2)
-    return 0;
-
-  memset(utf8_wide, 0, utf8_wide_size * 2);
-
-  tmp = silc_malloc(tmp_len);
-  if (!tmp)
-    return 0;
-
-  silc_utf8_decode(utf8, utf8_len, SILC_STRING_BMP, tmp, tmp_len);
-
-  for (i = 0, k = 0; i < tmp_len; i += 2, k++)
-    SILC_GET16_MSB(utf8_wide[k], tmp + i);
-
-  silc_free(tmp);
-  return k + 1;
-}
-
-/* Wide characters to UTF-8 */
-
-SilcUInt32 silc_utf8_w2c(const SilcUInt16 *wide_str,
-                        SilcUInt32 wide_str_len,
-                        unsigned char *utf8, SilcUInt32 utf8_size)
-
-{
-  unsigned char *tmp;
-  SilcUInt32 tmp_len;
-  int i, k;
-
-  if (utf8_size < wide_str_len * 2)
-    return 0;
-
-  memset(utf8, 0, utf8_size);
-
-  tmp = silc_malloc(wide_str_len * 2);
-  if (!tmp)
-    return 0;
-
-  for (i = 0, k = 0; i < wide_str_len; i += 2, k++)
-    SILC_PUT16_MSB(wide_str[k], tmp + i);
-
-  tmp_len = silc_utf8_encode(tmp, wide_str_len * 2, SILC_STRING_BMP,
-                            utf8, utf8_size);
-
-  silc_free(tmp);
-  return tmp_len;
-}
-
-/* Returns the length of UTF-8 encoded string if the `bin' of
-   encoding of `bin_encoding' is encoded with silc_utf8_encode. */
-
-SilcUInt32 silc_utf8_encoded_len(const unsigned char *bin, SilcUInt32 bin_len,
-                                SilcStringEncoding bin_encoding)
-{
-  return silc_utf8_encode(bin, bin_len, bin_encoding, NULL, 0);
-}
-
-/* Returns the length of decoded string if the `bin' of encoding of
-   `bin_encoding' is decoded with silc_utf8_decode. */
-
-SilcUInt32 silc_utf8_decoded_len(const unsigned char *bin, SilcUInt32 bin_len,
-                                SilcStringEncoding bin_encoding)
-{
-  return silc_utf8_decode(bin, bin_len, bin_encoding, NULL, 0);
-}
-
-/* Returns TRUE if the `utf8' string of length of `utf8_len' is valid
-   UTF-8 encoded string, FALSE if it is not UTF-8 encoded string. */
-
-SilcBool silc_utf8_valid(const unsigned char *utf8, SilcUInt32 utf8_len)
-{
-  return silc_utf8_decode(utf8, utf8_len, 0, NULL, 0) != 0;
-}
-
-/* Pretty close strcasecmp */
-
-SilcBool silc_utf8_strcasecmp(const char *s1, const char *s2)
-{
-  if (s1 == s2)
-    return TRUE;
-  if (strlen(s1) != strlen(s2))
-    return FALSE;
-
-  return silc_utf8_strncasecmp(s1, s2, strlen(s1));
-}
-
-/* Pretty close strcasecmp */
-
-SilcBool silc_utf8_strncasecmp(const char *s1, const char *s2, SilcUInt32 n)
-{
-  unsigned char *s1u, *s2u;
-  SilcUInt32 s1u_len, s2u_len;
-  SilcStringprepStatus status;
-  SilcBool ret;
-
-  if (s1 == s2)
-    return TRUE;
-
-  /* Casefold and normalize */
-  status = silc_stringprep(s1, n, SILC_STRING_UTF8,
-                          SILC_IDENTIFIERC_PREP, 0, &s1u,
-                          &s1u_len, SILC_STRING_UTF8);
-  if (status != SILC_STRINGPREP_OK)
-    return FALSE;
-
-  /* Casefold and normalize */
-  status = silc_stringprep(s2, n, SILC_STRING_UTF8,
-                          SILC_IDENTIFIERC_PREP, 0, &s2u,
-                          &s2u_len, SILC_STRING_UTF8);
-  if (status != SILC_STRINGPREP_OK)
-    return FALSE;
-
-  ret = !memcmp(s1u, s2u, n);
-
-  silc_free(s1u);
-  silc_free(s2u);
-
-  return ret;
-}
diff --git a/lib/silcutil/silcutf8.h b/lib/silcutil/silcutf8.h
deleted file mode 100644 (file)
index 1f6fe4d..0000000
+++ /dev/null
@@ -1,211 +0,0 @@
-/*
-
-  silcutf8.h
-
-  Author: Pekka Riikonen <priikone@silcnet.org>
-
-  Copyright (C) 2004 - 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.
-
-*/
-
-/****h* silcutil/SILC UTF-8 Interface
- *
- * DESCRIPTION
- *
- * Interface for the UTF-8 Unicode encoding form.  These routines provides
- * applications full UTF-8 and Unicode support.  It supports UTF-8 encoding
- * to and decoding from myriad of other character encodings.
- *
- ***/
-
-#ifndef SILCUTF8_H
-#define SILCUTF8_H
-
-/****f* silcutil/SilcUTF8API/silc_utf8_encode
- *
- * SYNOPSIS
- *
- *    SilcUInt32 silc_utf8_encode(const unsigned char *bin, SilcUInt32 bin_len,
- *                                SilcStringEncoding bin_encoding,
- *                                unsigned char *utf8, SilcUInt32 utf8_size);
- *
- * DESCRIPTION
- *
- *    Encodes the string `bin' of which encoding is `bin_encoding' to the
- *    UTF-8 encoding into the buffer `utf8' which is of size of `utf8_size'.
- *    Returns the length of the UTF-8 encoded string, or zero (0) on error.
- *    By default `bin_encoding' is ASCII, and the caller needs to know the
- *    encoding of the input string if it is anything else.
- *
- ***/
-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
- *
- * SYNOPSIS
- *
- *    SilcUInt32 silc_utf8_decode(const unsigned char *utf8,
- *                                SilcUInt32 utf8_len,
- *                                SilcStringEncoding bin_encoding,
- *                                unsigned char *bin, SilcUInt32 bin_size);
- *
- * DESCRIPTION
- *
- *    Decodes UTF-8 encoded string `utf8' to string of which encoding is
- *    to be `bin_encoding', into the `bin' buffer of size of `bin_size'.
- *    Returns the length of the decoded buffer, or zero (0) on error.
- *    By default `bin_encoding' is ASCII, and the caller needs to know to
- *    which encoding the output string is to be encoded if ASCII is not
- *    desired.
- *
- ***/
-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
- *
- * SYNOPSIS
- *
- *    SilcUInt32 silc_utf8_c2w(const unsigned char *utf8,
- *                             SilcUInt32 utf8_len,
- *                             SilcUInt16 *utf8_wide,
- *                             SilcUInt32 utf8_wide_size);
- *
- * DESCRIPTION
- *
- *    Converts UTF-8 string into UTF-8 wide character string into the
- *    `utf8_wide' buffer of size of `utf8_wide_size' in characters.  Returns
- *    the length of the UTF-8 wide character string or 0 on error.  The
- *    returned length is in characters and not in bytes.  The byte length
- *    is twice the returned character length.
- *
- *    If there is extra space in `utf8_wide' this will NULL terminate the
- *    string automatically.
- *
- ***/
-SilcUInt32 silc_utf8_c2w(const unsigned char *utf8, SilcUInt32 utf8_len,
-                        SilcUInt16 *utf8_wide, SilcUInt32 utf8_wide_size);
-
-/****f* silcutil/SilcStrUtilAPI/silc_utf8_w2c
- *
- * SYNOPSIS
- *
- *    SilcUInt32 silc_utf8_w2c(const SilcUInt16 *wide_str,
- *                             SilcUInt32 wide_str_len,
- *                             unsigned char *utf8, SilcUInt32 utf8_size);
- *
- * DESCRIPTION
- *
- *    Converts UTF-8 wide character string into UTF-8 binary string into the
- *    `utf8' buffer of size of `utf8_size' in bytes.  Returns the length of
- *    the encoded UTF-8 string in bytes or 0 on error.
- *
- *    If there is extra space in `utf8' this will NULL terminate the string
- *    automatically.
- *
- ***/
-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
- *
- * SYNOPSIS
- *
- *    SilcUInt32 silc_utf8_encoded_len(const unsigned char *bin,
- *                                     SilcUInt32 bin_len,
- *                                     SilcStringEncoding bin_encoding);
- *
- * DESCRIPTION
- *
- *    Returns the length of UTF-8 encoded string if the `bin' of
- *    encoding of `bin_encoding' is encoded with silc_utf8_encode.
- *    Returns zero (0) on error.
- *
- ***/
-SilcUInt32 silc_utf8_encoded_len(const unsigned char *bin, SilcUInt32 bin_len,
-                                SilcStringEncoding bin_encoding);
-
-/****f* silcutil/SilcStrUtilAPI/silc_utf8_decoded_len
- *
- * SYNOPSIS
- *
- *    SilcUInt32 silc_utf8_decoded_len(const unsigned char *bin,
- *                                     SilcUInt32 bin_len,
- *                                     SilcStringEncoding bin_encoding);
- *
- * DESCRIPTION
- *
- *    Returns the length of decoded string if the `bin' of encoding of
- *    `bin_encoding' is decoded with silc_utf8_decode.  Returns zero (0)
- *    on error.
- *
- ***/
-SilcUInt32 silc_utf8_decoded_len(const unsigned char *bin, SilcUInt32 bin_len,
-                                SilcStringEncoding bin_encoding);
-
-/****f* silcutil/SilcStrUtilAPI/silc_utf8_valid
- *
- * SYNOPSIS
- *
- *    SilcBool silc_utf8_valid(const unsigned char *utf8, SilcUInt32 utf8_len);
- *
- * DESCRIPTION
- *
- *    Returns TRUE if the `utf8' string of length of `utf8_len' is valid
- *    UTF-8 encoded string, FALSE if it is not UTF-8 encoded string.
- *
- ***/
-SilcBool silc_utf8_valid(const unsigned char *utf8, SilcUInt32 utf8_len);
-
-/****f* silcutil/SilcStrUtilAPI/silc_utf8_strcasecmp
- *
- * SYNOPSIS
- *
- *    SilcBool silc_utf8_strcasecmp(const char *s1, const char *s2);
- *
- * DESCRIPTION
- *
- *    The silc_utf8_strcasecmp() function compares the two strings s1 and s2,
- *    ignoring the case of the characters.  It returns TRUE if the strings
- *    match and FALSE if they differ.
- *
- *    This functions expects NULL terminated UTF-8 strings.  The strings
- *    will be casefolded and normalized before comparing.  Certain special
- *    Unicode characters will be ignored when comparing.
- *
- ***/
-SilcBool silc_utf8_strcasecmp(const char *s1, const char *s2);
-
-/****f* silcutil/SilcStrUtilAPI/silc_utf8_strncasecmp
- *
- * SYNOPSIS
- *
- *    SilcBool silc_utf8_strcasecmp(const char *s1, const char *s2,
- *                                  SilcUInt32 n);
- *
- * DESCRIPTION
- *
- *    The silc_utf8_strcasecmp() function compares the two strings s1 and s2,
- *    ignoring the case of the characters.  It returns TRUE if the strings
- *    match and FALSE if they differ.
- *
- *    This functions expects NULL terminated UTF-8 strings.  The strings
- *    will be casefolded and normalized before comparing.  Certain special
- *    Unicode characters will be ignored when comparing.
- *
- ***/
-SilcBool silc_utf8_strncasecmp(const char *s1, const char *s2, SilcUInt32 n);
-
-#endif /* SILCUTF8_H */
diff --git a/lib/silcutil/silcutil.c b/lib/silcutil/silcutil.c
deleted file mode 100644 (file)
index 0cb176e..0000000
+++ /dev/null
@@ -1,623 +0,0 @@
-/*
-
-  silcutil.c
-
-  Author: Pekka Riikonen <priikone@silcnet.org>
-
-  Copyright (C) 1997 - 2007 Pekka Riikonen
-
-  This program is free software; you can redistribute it and/or modify
-  it under the terms of the GNU General Public License as published by
-  the Free Software Foundation; version 2 of the License.
-
-  This program is distributed in the hope that it will be useful,
-  but WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-  GNU General Public License for more details.
-
-*/
-/*
- * These are general utility functions that doesn't belong to any specific
- * group of routines.
- */
-/* $Id$ */
-
-#include "silc.h"
-
-/* Gets line from a buffer. Stops reading when a newline or EOF occurs.
-   This doesn't remove the newline sign from the destination buffer. The
-   argument begin is returned and should be passed again for the function. */
-
-int silc_gets(char *dest, int destlen, const char *src, int srclen, int begin)
-{
-  static int start = 0;
-  int i;
-
-  memset(dest, 0, destlen);
-
-  if (begin != start)
-    start = 0;
-
-  i = 0;
-  for ( ; start <= srclen; i++, start++) {
-    if (i > destlen)
-      return -1;
-
-    dest[i] = src[start];
-
-    if (dest[i] == EOF)
-      return EOF;
-
-    if (dest[i] == '\n')
-      break;
-  }
-  start++;
-
-  return start;
-}
-
-/* Checks line for illegal characters. Return -1 when illegal character
-   were found. This is used to check for bad lines when reading data from
-   for example a configuration file. */
-
-int silc_check_line(char *buf)
-{
-  /* Illegal characters in line */
-  if (strchr(buf, '#')) return -1;
-  if (strchr(buf, '\'')) return -1;
-  if (strchr(buf, '\\')) return -1;
-  if (strchr(buf, '\r')) return -1;
-  if (strchr(buf, '\a')) return -1;
-  if (strchr(buf, '\b')) return -1;
-  if (strchr(buf, '\f')) return -1;
-
-  /* Empty line */
-  if (buf[0] == '\n')
-    return -1;
-
-  return 0;
-}
-
-/* Converts string to capital characters. */
-
-SilcBool silc_to_upper(const char *string, char *dest, SilcUInt32 dest_size)
-{
-  int i;
-
-  if (strlen(string) > dest_size)
-    return FALSE;
-
-  for (i = 0; i < strlen(string); i++)
-    dest[i] = (char)toupper((int)string[i]);
-
-  return TRUE;
-}
-
-/* Converts string to lower letter characters. */
-
-SilcBool silc_to_lower(const char *string, char *dest, SilcUInt32 dest_size)
-{
-  int i;
-
-  if (strlen(string) > dest_size)
-    return FALSE;
-
-  for (i = 0; i < strlen(string); i++)
-    dest[i] = (char)tolower((int)string[i]);
-
-  return TRUE;
-}
-
-/* Parse userfqdn string which is in user@fqdn format. */
-
-int silc_parse_userfqdn(const char *string,
-                       char *user, SilcUInt32 user_size,
-                       char *fqdn, SilcUInt32 fqdn_size)
-{
-  SilcUInt32 tlen;
-
-  if (!user && !fqdn)
-    return 0;
-
-  if (user)
-    memset(user, 0, user_size);
-  if (user)
-    memset(fqdn, 0, fqdn_size);
-
-  if (!string)
-    return 0;
-
-  if (string[0] == '@') {
-    if (user)
-      silc_strncat(user, user_size, string, strlen(string));
-
-    return 1;
-  }
-
-  if (strchr(string, '@')) {
-    tlen = strcspn(string, "@");
-
-    if (user)
-      silc_strncat(user, user_size, string, tlen);
-
-    if (fqdn)
-      silc_strncat(fqdn, fqdn_size, string + tlen + 1,
-                  strlen(string) - tlen - 1);
-
-    return 2;
-  }
-
-  if (user)
-    silc_strncat(user, user_size, string, strlen(string));
-
-  return 1;
-}
-
-/* Parses command line. At most `max_args' is taken. Rest of the line
-   will be allocated as the last argument if there are more than `max_args'
-   arguments in the line. Note that the command name is counted as one
-   argument and is saved. */
-
-void silc_parse_command_line(unsigned char *buffer,
-                            unsigned char ***parsed,
-                            SilcUInt32 **parsed_lens,
-                            SilcUInt32 **parsed_types,
-                            SilcUInt32 *parsed_num,
-                            SilcUInt32 max_args)
-{
-  int i, len = 0;
-  int argc = 0;
-  const char *cp = buffer;
-  char *tmp;
-
-  *parsed = silc_calloc(1, sizeof(**parsed));
-  *parsed_lens = silc_calloc(1, sizeof(**parsed_lens));
-
-  /* Get the command first */
-  len = strcspn(cp, " ");
-  tmp = silc_calloc(strlen(cp) + 1, sizeof(*tmp));
-  if (!tmp)
-    return;
-  silc_to_upper(cp, tmp, strlen(cp));
-  (*parsed)[0] = silc_calloc(len + 1, sizeof(char));
-  memcpy((*parsed)[0], tmp, len);
-  silc_free(tmp);
-  (*parsed_lens)[0] = len;
-  cp += len;
-  while (*cp == ' ')
-    cp++;
-  argc++;
-
-  /* Parse arguments */
-  if (strchr(cp, ' ') || strlen(cp) != 0) {
-    for (i = 1; i < max_args; i++) {
-
-      if (i != max_args - 1)
-       len = strcspn(cp, " ");
-      else
-       len = strlen(cp);
-      while (len && cp[len - 1] == ' ')
-       len--;
-      if (!len)
-       break;
-
-      *parsed = silc_realloc(*parsed, sizeof(**parsed) * (argc + 1));
-      *parsed_lens = silc_realloc(*parsed_lens,
-                                 sizeof(**parsed_lens) * (argc + 1));
-      (*parsed)[argc] = silc_calloc(len + 1, sizeof(char));
-      memcpy((*parsed)[argc], cp, len);
-      (*parsed_lens)[argc] = len;
-      argc++;
-
-      cp += len;
-      if (strlen(cp) == 0)
-       break;
-      else
-       while (*cp == ' ')
-         cp++;
-    }
-  }
-
-  /* Save argument types. Protocol defines all argument types but
-     this implementation makes sure that they are always in correct
-     order hence this simple code. */
-  *parsed_types = silc_calloc(argc, sizeof(**parsed_types));
-  for (i = 0; i < argc; i++)
-    (*parsed_types)[i] = i;
-
-  *parsed_num = argc;
-}
-
-/* Formats arguments to a string and returns it after allocating memory
-   for it. It must be remembered to free it later. */
-
-char *silc_format(char *fmt, ...)
-{
-  va_list args;
-  char buf[8192];
-
-  memset(buf, 0, sizeof(buf));
-  va_start(args, fmt);
-  silc_vsnprintf(buf, sizeof(buf) - 1, fmt, args);
-  va_end(args);
-
-  return strdup(buf);
-}
-
-/* Basic has function to hash strings. May be used with the SilcHashTable.
-   Note that this lowers the characters of the string (with tolower()) so
-   this is used usually with nicknames, channel and server names to provide
-   case insensitive keys. */
-
-SilcUInt32 silc_hash_string(void *key, void *user_context)
-{
-  char *s = (char *)key;
-  SilcUInt32 h = 0, g;
-
-  while (*s != '\0') {
-    h = (h << 4) + tolower((int)*s);
-    if ((g = h & 0xf0000000)) {
-      h = h ^ (g >> 24);
-      h = h ^ g;
-    }
-    s++;
-  }
-
-  return h;
-}
-
-/* Hash UTF-8 string */
-
-SilcUInt32 silc_hash_utf8_string(void *key, void *user_context)
-{
-  unsigned char *s = (unsigned char *)key;
-  SilcUInt32 h = 0, g;
-
-  while (*s != '\0') {
-    h = (h << 4) + *s;
-    if ((g = h & 0xf0000000)) {
-      h = h ^ (g >> 24);
-      h = h ^ g;
-    }
-    s++;
-  }
-
-  return h;
-}
-
-/* Basic hash function to hash integers. May be used with the SilcHashTable. */
-
-SilcUInt32 silc_hash_uint(void *key, void *user_context)
-{
-  return SILC_PTR_TO_32(key);
-}
-
-/* Basic hash funtion to hash pointers. May be used with the SilcHashTable. */
-
-SilcUInt32 silc_hash_ptr(void *key, void *user_context)
-{
-  return SILC_PTR_TO_32(key);
-}
-
-/* Hash a ID. The `user_context' is the ID type. */
-
-SilcUInt32 silc_hash_id(void *key, void *user_context)
-{
-  SilcIdType id_type = (SilcIdType)SILC_PTR_TO_32(user_context);
-  SilcUInt32 h = 0;
-  int i;
-
-  switch (id_type) {
-  case SILC_ID_CLIENT:
-    {
-      SilcClientID *id = (SilcClientID *)key;
-
-      /* The client ID is hashed by hashing the hash of the ID
-        (which is a truncated MD5 hash of the nickname) so that we
-        can access the entry from the cache with both Client ID but
-        with just a hash from the ID as well. */
-      return silc_hash_client_id_hash(id->hash, NULL);
-    }
-    break;
-  case SILC_ID_SERVER:
-    {
-      SilcServerID *id = (SilcServerID *)key;
-
-      h = id->port * id->rnd;
-      for (i = 0; i < id->ip.data_len; i++)
-       h ^= id->ip.data[i];
-
-      return h;
-    }
-    break;
-  case SILC_ID_CHANNEL:
-    {
-      SilcChannelID *id = (SilcChannelID *)key;
-
-      h = id->port * id->rnd;
-      for (i = 0; i < id->ip.data_len; i++)
-       h ^= id->ip.data[i];
-
-      return h;
-    }
-    break;
-  default:
-    break;
-  }
-
-  return h;
-}
-
-/* Hash Client ID's hash. */
-
-SilcUInt32 silc_hash_client_id_hash(void *key, void *user_context)
-{
-  int i;
-  unsigned char *hash = key;
-  SilcUInt32 h = 0, g;
-
-  for (i = 0; i < CLIENTID_HASH_LEN; i++) {
-    h = (h << 4) + hash[i];
-    if ((g = h & 0xf0000000)) {
-      h = h ^ (g >> 24);
-      h = h ^ g;
-    }
-  }
-
-  return h;
-}
-
-/* Hash binary data. The `user_context' is the data length. */
-
-SilcUInt32 silc_hash_data(void *key, void *user_context)
-{
-  SilcUInt32 len = SILC_PTR_TO_32(user_context), h = 0;
-  unsigned char *data = (unsigned char *)key;
-  int i;
-
-  h = (data[0] * data[len - 1] + 1) * len;
-  for (i = 0; i < len; i++)
-    h ^= data[i];
-
-  return h;
-}
-
-/* Hash public key of any type. */
-
-SilcUInt32 silc_hash_public_key(void *key, void *user_context)
-{
-  SilcPublicKey public_key = key;
-  unsigned char *pk;
-  SilcUInt32 pk_len;
-  SilcUInt32 hash = 0;
-
-  pk = silc_pkcs_public_key_encode(public_key, &pk_len);
-  if (!pk)
-    return hash;
-
-  hash = silc_hash_data(pk, SILC_32_TO_PTR(pk_len));
-  silc_free(pk);
-
-  return hash;
-}
-
-/* Compares two strings. It may be used as SilcHashTable comparison
-   function. */
-
-SilcBool silc_hash_string_compare(void *key1, void *key2, void *user_context)
-{
-  return !strcasecmp((char *)key1, (char *)key2);
-}
-
-/* Compares two ID's. May be used as SilcHashTable comparison function.
-   The Client ID's compares only the hash of the Client ID not any other
-   part of the Client ID. Other ID's are fully compared. */
-
-SilcBool silc_hash_id_compare(void *key1, void *key2, void *user_context)
-{
-  SilcIdType id_type = (SilcIdType)SILC_PTR_TO_32(user_context);
-  return (id_type == SILC_ID_CLIENT ?
-         SILC_ID_COMPARE_HASH((SilcClientID *)key1, (SilcClientID *)key2) :
-         SILC_ID_COMPARE_TYPE(key1, key2, id_type));
-}
-
-/* Compares two ID's. Compares full IDs. */
-
-SilcBool silc_hash_id_compare_full(void *key1, void *key2, void *user_context)
-{
-  SilcIdType id_type = (SilcIdType)SILC_PTR_TO_32(user_context);
-  return SILC_ID_COMPARE_TYPE(key1, key2, id_type);
-}
-
-/* Compare two Client ID's entirely and not just the hash from the ID. */
-
-SilcBool silc_hash_client_id_compare(void *key1, void *key2,
-                                    void *user_context)
-{
-  return SILC_ID_COMPARE_TYPE(key1, key2, SILC_ID_CLIENT);
-}
-
-/* Compares binary data. May be used as SilcHashTable comparison function. */
-
-SilcBool silc_hash_data_compare(void *key1, void *key2, void *user_context)
-{
-  SilcUInt32 len = SILC_PTR_TO_32(user_context);
-  return !memcmp(key1, key2, len);
-}
-
-/* Compares UTF-8 string. */
-
-SilcBool silc_hash_utf8_compare(void *key1, void *key2, void *user_context)
-{
-  int l1 = strlen((char *)key1);
-  int l2 = strlen((char *)key2);
-  if (l1 != l2)
-    return FALSE;
-  return !memcmp(key1, key2, l2);
-}
-
-/* Compares two SILC Public keys. It may be used as SilcHashTable
-   comparison function. */
-
-SilcBool silc_hash_public_key_compare(void *key1, void *key2,
-                                     void *user_context)
-{
-  return silc_pkcs_public_key_compare(key1, key2);
-}
-
-/* Creates fingerprint from data, usually used with SHA1 digests */
-
-char *silc_fingerprint(const unsigned char *data, SilcUInt32 data_len)
-{
-  unsigned char *fingerprint, *cp;
-  unsigned int len, blocks, i;
-
-  if (!data || !data_len)
-    return NULL;
-
-  if (data_len >= 256)
-    data_len = 255;
-
-  /* Align and calculate total length */
-  len = ((data_len + 19) / 20) * 20;
-  blocks = (len / 10);
-  len = (len * 2) + ((blocks - 1) * 2) + (4 * blocks) + 2 + 1;
-
-  cp = fingerprint = silc_calloc(len, sizeof(*fingerprint));
-  if (!cp)
-    return NULL;
-
-  for (i = 0; i < data_len; i++) {
-    silc_snprintf(cp, len, "%02X", data[i]);
-    cp += 2;
-    len -= 2;
-
-    if ((i + 1) % 2 == 0)
-      silc_snprintf(cp++, len--, " ");
-    if ((i + 1) % 10 == 0)
-      silc_snprintf(cp++, len--, " ");
-  }
-  i--;
-  if ((i + 1) % 10 == 0)
-    *(--cp) = '\0';
-  if ((i + 1) % 2 == 0)
-    *(--cp) = '\0';
-
-  return fingerprint;
-}
-
-/* Return TRUE if the `data' is ASCII string. */
-
-SilcBool silc_string_is_ascii(const unsigned char *data, SilcUInt32 data_len)
-{
-  int i;
-
-  for (i = 0; i < data_len; i++) {
-    if (!isascii(data[i]))
-      return FALSE;
-  }
-
-  return TRUE;
-}
-
-/* Displays input prompt on command line and takes input data from user */
-
-char *silc_get_input(const char *prompt, SilcBool echo_off)
-{
-#ifdef SILC_UNIX
-  int fd;
-  char input[2048];
-
-  if (echo_off) {
-    char *ret = NULL;
-#ifdef HAVE_TERMIOS_H
-    struct termios to;
-    struct termios to_old;
-
-    fd = open("/dev/tty", O_RDONLY);
-    if (fd < 0) {
-      fprintf(stderr, "silc: %s\n", strerror(errno));
-      return NULL;
-    }
-
-    signal(SIGINT, SIG_IGN);
-
-    /* Get terminal info */
-    tcgetattr(fd, &to);
-    to_old = to;
-
-    /* Echo OFF, and assure we can prompt and get input */
-    to.c_lflag &= ~(ECHO | ECHOE | ECHOK | ECHONL);
-    to.c_lflag |= ICANON;
-    to.c_cc[VMIN] = 255;
-    tcsetattr(fd, TCSANOW, &to);
-
-    memset(input, 0, sizeof(input));
-
-    printf("%s", prompt);
-    fflush(stdout);
-
-  read_again1:
-    if ((read(fd, input, sizeof(input))) < 0) {
-      if (errno == EAGAIN || errno == EINTR)
-       goto read_again1;
-      fprintf(stderr, "silc: %s\n", strerror(errno));
-      signal(SIGINT, SIG_DFL);
-      tcsetattr(fd, TCSANOW, &to_old);
-      return NULL;
-    }
-
-    if (strlen(input) <= 1) {
-      signal(SIGINT, SIG_DFL);
-      tcsetattr(fd, TCSANOW, &to_old);
-      return NULL;
-    }
-
-    if (strchr(input, '\n'))
-      *strchr(input, '\n') = '\0';
-
-    /* Restore old terminfo */
-    tcsetattr(fd, TCSANOW, &to_old);
-    signal(SIGINT, SIG_DFL);
-
-    ret = silc_memdup(input, strlen(input));
-    memset(input, 0, sizeof(input));
-#endif /* HAVE_TERMIOS_H */
-    return ret;
-  } else {
-    fd = open("/dev/tty", O_RDONLY);
-    if (fd < 0) {
-      fprintf(stderr, "silc: %s\n", strerror(errno));
-      return NULL;
-    }
-
-    memset(input, 0, sizeof(input));
-
-    printf("%s", prompt);
-    fflush(stdout);
-
-    signal(SIGINT, SIG_IGN);
-
-  read_again2:
-    if ((read(fd, input, sizeof(input))) < 0) {
-      if (errno == EAGAIN || errno == EINTR)
-       goto read_again2;
-      fprintf(stderr, "silc: %s\n", strerror(errno));
-      signal(SIGINT, SIG_DFL);
-      return NULL;
-    }
-
-    signal(SIGINT, SIG_DFL);
-
-    if (strlen(input) <= 1)
-      return NULL;
-
-    if (strchr(input, '\n'))
-      *strchr(input, '\n') = '\0';
-
-    return strdup(input);
-  }
-#else
-  return NULL;
-#endif /* SILC_UNIX */
-}
diff --git a/lib/silcutil/silcutil.h b/lib/silcutil/silcutil.h
deleted file mode 100644 (file)
index 142297c..0000000
+++ /dev/null
@@ -1,465 +0,0 @@
-/*
-
-  silcutil.h
-
-  Author: Pekka Riikonen <priikone@silcnet.org>
-
-  Copyright (C) 1997 - 2006 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.
-
-*/
-
-/****h* silcutil/SILC Utilities
- *
- * DESCRIPTION
- *
- *    Utility functions.
- *
- ***/
-
-#ifndef SILCUTIL_H
-#define SILCUTIL_H
-
-/****f* silcutil/SilcUtilAPI/silc_gets
- *
- * SYNOPSIS
- *
- *    int silc_gets(char *dest, int destlen, const char *src, int srclen,
- *                  int begin);
- *
- * DESCRIPTION
- *
- *    Gets line from a buffer. Stops reading when a newline or EOF occurs.
- *    This doesn't remove the newline sign from the destination buffer. The
- *    argument begin is returned and should be passed again for the function.
- *
- ***/
-int silc_gets(char *dest, int destlen, const char *src, int srclen, int begin);
-
-/****f* silcutil/SilcUtilAPI/silc_check_line
- *
- * SYNOPSIS
- *
- *    int silc_check_line(char *buf);
- *
- * DESCRIPTION
- *
- *    Checks line for illegal characters. Return -1 when illegal character
- *    were found. This is used to check for bad lines when reading data from
- *    for example a configuration file.
- *
- ***/
-int silc_check_line(char *buf);
-
-/****f* silcutil/SilcUtilAPI/silc_to_upper
- *
- * SYNOPSIS
- *
- *    SilcBool silc_to_upper(const char *string, char *dest,
- *                           SilcUInt32 dest_size);
- *
- * DESCRIPTION
- *
- *    Converts string to capital characters.
- *
- ***/
-SilcBool silc_to_upper(const char *string, char *dest, SilcUInt32 dest_size);
-
-/****f* silcutil/SilcUtilAPI/silc_to_lower
- *
- * SYNOPSIS
- *
- *    SilcBool silc_to_lower(const char *string, char *dest,
- *                           SilcUInt32 dest_size);
- *
- * DESCRIPTION
- *
- *    Converts string to capital characters.
- *
- ***/
-SilcBool silc_to_lower(const char *string, char *dest, SilcUInt32 dest_size);
-
-/****f* silcutil/SilcUtilAPI/silc_parse_userfqdn
- *
- * SYNOPSIS
- *
- *    int silc_parse_userfqdn(const char *string,
- *                            char *user, SilcUInt32 user_size,
- *                            char *fqdn, SilcUInt32 fqdn_size);
- *
- * DESCRIPTION
- *
- *    Parse userfqdn string which is in user@fqdn format.  Returns 0 on
- *    error, 1 if `user' was filled and 2 if both `user' and `fqdn'
- *    was filled.
- *
- ***/
-int silc_parse_userfqdn(const char *string,
-                       char *user, SilcUInt32 user_size,
-                       char *fqdn, SilcUInt32 fqdn_size);
-
-/****f* silcutil/SilcUtilAPI/silc_parse_command_line
- *
- * SYNOPSIS
- *
- *    void silc_parse_command_line(unsigned char *buffer,
- *                                 unsigned char ***parsed,
- *                                 SilcUInt32 **parsed_lens,
- *                                 SilcUInt32 **parsed_types,
- *                                 SilcUInt32 *parsed_num,
- *                                 SilcUInt32 max_args);
- *
- * DESCRIPTION
- *
- *    Parses command line. At most `max_args' is taken. Rest of the line
- *    will be allocated as the last argument if there are more than `max_args'
- *    arguments in the line. Note that the command name is counted as one
- *    argument and is saved.
- *
- ***/
-void silc_parse_command_line(unsigned char *buffer,
-                            unsigned char ***parsed,
-                            SilcUInt32 **parsed_lens,
-                            SilcUInt32 **parsed_types,
-                            SilcUInt32 *parsed_num,
-                            SilcUInt32 max_args);
-
-/****f* silcutil/SilcUtilAPI/silc_format
- *
- * SYNOPSIS
- *
- *    char *silc_format(char *fmt, ...);
- *
- * DESCRIPTION
- *
- *    Formats arguments to a string and returns it after allocating memory
- *    for it. It must be remembered to free it later.
- *
- ***/
-char *silc_format(char *fmt, ...);
-
-/****f* silcutil/SilcUtilAPI/silc_hash_string
- *
- * SYNOPSIS
- *
- *    SilcUInt32 silc_hash_string(void *key, void *user_context);
- *
- * DESCRIPTION
- *
- *    Basic has function to hash strings. May be used with the SilcHashTable.
- *    Note that this lowers the characters of the string (with tolower()) so
- *    this is used usually with nicknames, channel and server names to provide
- *    case insensitive keys.
- *
- ***/
-SilcUInt32 silc_hash_string(void *key, void *user_context);
-
-/****f* silcutil/SilcUtilAPI/silc_hash_utf8_string
- *
- * SYNOPSIS
- *
- *    SilcUInt32 silc_hash_utf8_string(void *key, void *user_context);
- *
- * DESCRIPTION
- *
- *    Basic has function to hash UTF-8 strings. May be used with the
- *    SilcHashTable.  Used with identifier strings.  The key is
- *    expected to be casefolded.
- *
- ***/
-SilcUInt32 silc_hash_utf8_string(void *key, void *user_context);
-
-/****f* silcutil/SilcUtilAPI/silc_hash_uint
- *
- * SYNOPSIS
- *
- *    SilcUInt32 silc_hash_uint(void *key, void *user_context);
- *
- * DESCRIPTION
- *
- *    Basic hash function to hash integers. May be used with the SilcHashTable.
- *
- ***/
-SilcUInt32 silc_hash_uint(void *key, void *user_context);
-
-/****f* silcutil/SilcUtilAPI/silc_hash_ptr
- *
- * SYNOPSIS
- *
- *    SilcUInt32 silc_hash_ptr(void *key, void *user_context);
- *
- * DESCRIPTION
- *
- *    Basic hash funtion to hash pointers. May be used with the SilcHashTable.
- *
- ***/
-SilcUInt32 silc_hash_ptr(void *key, void *user_context);
-
-/****f* silcutil/SilcUtilAPI/silc_hash_id
- *
- * SYNOPSIS
- *
- *    SilcUInt32 silc_hash_id(void *key, void *user_context);
- *
- * DESCRIPTION
- *
- *    Hash a ID. The `user_context' is the ID type.
- *
- ***/
-SilcUInt32 silc_hash_id(void *key, void *user_context);
-
-/****f* silcutil/SilcUtilAPI/silc_hash_client_id_hash
- *
- * SYNOPSIS
- *
- *    SilcUInt32 silc_hash_client_id_hash(void *key, void *user_context)
- *
- * DESCRIPTION
- *
- *    Hash Client ID's hash.
- *
- ***/
-SilcUInt32 silc_hash_client_id_hash(void *key, void *user_context);
-
-/****f* silcutil/SilcUtilAPI/silc_hash_data
- *
- * SYNOPSIS
- *
- *    SilcUInt32 silc_hash_data(void *key, void *user_context);
- *
- * DESCRIPTION
- *
- *    Hash binary data. The `user_context' is the data length.
- *
- ***/
-SilcUInt32 silc_hash_data(void *key, void *user_context);
-
-/****f* silcutil/SilcUtilAPI/silc_hash_public_key
- *
- * SYNOPSIS
- *
- *    SilcUInt32 silc_hash_public_key(void *key, void *user_context);
- *
- * DESCRIPTION
- *
- *    Hash public key of any type.
- *
- ***/
-SilcUInt32 silc_hash_public_key(void *key, void *user_context);
-
-/****f* silcutil/SilcUtilAPI/silc_hash_string_compare
- *
- * SYNOPSIS
- *
- *    SilcBool silc_hash_string_compare(void *key1, void *key2,
- *                                  void *user_context);
- *
- * DESCRIPTION
- *
- *    Compares two strings. It may be used as SilcHashTable comparison
- *    function.
- *
- ***/
-SilcBool silc_hash_string_compare(void *key1, void *key2, void *user_context);
-
-/****f* silcutil/SilcUtilAPI/silc_hash_id_compare
- *
- * SYNOPSIS
- *
- *    SilcBool silc_hash_id_compare(void *key1, void *key2,
- *                                  void *user_context);
- *
- * DESCRIPTION
- *
- *    Compares two ID's. May be used as SilcHashTable comparison function.
- *    The Client ID's compares only the hash of the Client ID not any other
- *    part of the Client ID. Other ID's are fully compared.
- *
- ***/
-SilcBool silc_hash_id_compare(void *key1, void *key2, void *user_context);
-
-/****f* silcutil/SilcUtilAPI/silc_hash_id_compare_full
- *
- * SYNOPSIS
- *
- *    SilcBool silc_hash_id_compare_full(void *key1, void *key2,
- *                                       void *user_context)
- *
- * DESCRIPTION
- *
- *    Compares two ID's. May be used as SilcHashTable comparison function.
- *    To compare full ID's instead of only partial, like the
- *    silc_hash_id_compare does, use this function.
- *
- ***/
-SilcBool silc_hash_id_compare_full(void *key1, void *key2, void *user_context);
-
-/****f* silcutil/SilcUtilAPI/silc_hash_client_id_compare
- *
- * SYNOPSIS
- *
- *    SilcBool silc_hash_client_id_compare(void *key1, void *key2,
- *                                         void *user_context);
- *
- * DESCRIPTION
- *
- *    Compare two Client ID's entirely and not just the hash from the ID.
- *
- ***/
-SilcBool silc_hash_client_id_compare(void *key1, void *key2,
-                                    void *user_context);
-
-/****f* silcutil/SilcUtilAPI/silc_hash_data_compare
- *
- * SYNOPSIS
- *
- *    SilcBool silc_hash_data_compare(void *key1, void *key2,
- *                                    void *user_context);
- *
- * DESCRIPTION
- *
- *    Compares binary data. May be used as SilcHashTable comparison function.
- *
- ***/
-SilcBool silc_hash_data_compare(void *key1, void *key2, void *user_context);
-
-/****f* silcutil/SilcUtilAPI/silc_hash_utf8_compare
- *
- * SYNOPSIS
- *
- *    SilcBool silc_hash_utf8_compare(void *key1, void *key2,
- *                                    void *user_context);
- *
- * DESCRIPTION
- *
- *    Compares UTF-8 strings.  Casefolded and NULL terminated strings are
- *    expected.  May be used as SilcHashTable comparison function.
- *
- ***/
-SilcBool silc_hash_utf8_compare(void *key1, void *key2, void *user_context);
-
-/****f* silcutil/SilcUtilAPI/silc_hash_public_key_compare
- *
- * SYNOPSIS
- *
- *    SilcBool silc_hash_public_key_compare(void *key1, void *key2,
- *                                          void *user_context);
- *
- * DESCRIPTION
- *
- *    Compares two SILC Public keys. It may be used as SilcHashTable
- *    comparison function.
- *
- ***/
-SilcBool silc_hash_public_key_compare(void *key1, void *key2,
-                                     void *user_context);
-
-/****f* silcutil/SilcUtilAPI/silc_fingerprint
- *
- * SYNOPSIS
- *
- *    char *silc_fingerprint(const unsigned char *data, SilcUInt32 data_len);
- *
- * DESCRIPTION
- *
- *    Return a textual representation of the fingerprint in *data, the
- *    caller must free the returned string.
- *
- ***/
-char *silc_fingerprint(const unsigned char *data, SilcUInt32 data_len);
-
-/****f* silcutil/SilcUtilAPI/silc_string_is_ascii
- *
- * SYNOPSIS
- *
- *    SilcBool silc_string_is_ascii(const unsigned char *data,
- *                              SilcUInt32 data_len);
- *
- * DESCRIPTION
- *
- *    Return TRUE if the `data' is ASCII string.
- *
- ***/
-SilcBool silc_string_is_ascii(const unsigned char *data, SilcUInt32 data_len);
-
-/****f* silcutil/SilcUtilAPI/silc_get_input
- *
- * SYNOPSIS
- *
- *    char *silc_get_input(const char *prompt, SilcBool echo_off);
- *
- * DESCRIPTION
- *
- *    Displays input prompt on command line and takes input data from user.
- *
- ***/
-char *silc_get_input(const char *prompt, SilcBool echo_off);
-
-/* System dependant prototypes */
-
-/****f* silcutil/SilcUtilAPI/silc_get_username
- *
- * SYNOPSIS
- *
- *    char *silc_get_username();
- *
- * DESCRIPTION
- *
- *    Returns the username of the user. If the global variable LOGNAME
- *    does not exists we will get the name from the passwd file.  The
- *    caller must free the returned name.
- *
- *    This function is system dependant.
- *
- ***/
-char *silc_get_username();
-
-/****f* silcutil/SilcUtilAPI/silc_get_real_name
- *
- * SYNOPSIS
- *
- *    char *silc_get_real_name();
- *
- * DESCRIPTION
- *
- *    Returns the real name of ther user from the passwd file.  The
- *    caller must free the returned name.
- *
- *    This function is system dependant.
- *
- ***/
-char *silc_get_real_name();
-
-/****f* silcutil/SilcUtilAPI/silc_va_copy
- *
- * SYNOPSIS
- *
- *    void silc_va_copy(va_list dest, va_list src);
- *
- * DESCRIPTION
- *
- *    Copies variable argument list.  This must be called in case the
- *    variable argument list must be evaluated multiple times.  For each
- *    evaluation the list must be copied and va_end must be called for
- *    each copied list.
- *
- ***/
-#if defined(HAVE_VA_COPY)
-#define silc_va_copy(dest, src) va_copy(dest, src);
-#elif defined(HAVE___VA_COPY)
-#define silc_va_copy(dest, src) __va_copy(dest, src);
-#elif defined(SILC_VA_COPY_ARRAY)
-#define silc_va_copy(dest, src) memmove(dest, src, sizeof(va_list));
-#else
-#define silc_va_copy(dest, src) dest = src;
-#endif
-
-#endif /* !SILCUTIL_H */
diff --git a/lib/silcutil/stacktrace.c b/lib/silcutil/stacktrace.c
deleted file mode 100644 (file)
index 9f335e4..0000000
+++ /dev/null
@@ -1,233 +0,0 @@
-/*
-
-  stacktrace.c
-
-  Author: Pekka Riikonen <priikone@silcnet.org>
-
-  Copyright (C) 2002, 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.
-
-*/
-
-#include "silc.h"
-
-#ifdef SILC_STACKTRACE
-
-static void *st_blocks = NULL;
-static unsigned long st_blocks_count = 0;
-static SilcBool dump = FALSE;
-static SilcBool malloc_check = FALSE;
-
-#ifdef SILC_DEBUG
-#define SILC_ST_DEPTH 15
-#else
-#define SILC_ST_DEPTH 8
-#endif /* SILC_DEBUG */
-
-/* Memory block with stack trace */
-typedef struct SilcStBlockStruct {
-  unsigned int dumpped  : 1;   /* Block is dumpped */
-  unsigned int depth    : 8;   /* Depth of stack trace */
-  unsigned int line     : 23;  /* Allocation line in program */
-  void *stack[SILC_ST_DEPTH];  /* Stack trace */
-  const char *file;            /* Allocation file in program */
-  unsigned long size;          /* Allocated memory size */
-  struct SilcStBlockStruct *next;
-  struct SilcStBlockStruct *prev;
-} *SilcStBlock;
-
-/* Get current frame pointer */
-#define SILC_ST_GET_FP(ret_fp)                 \
-do {                                           \
-  register void *cfp;                          \
-  asm volatile ("movl %%ebp, %0" : "=r" (cfp));        \
-  (ret_fp) = cfp;                              \
-} while(0);
-
-#define SILC_ST_GET_SIZE(size) ((size + sizeof(struct SilcStBlockStruct)))
-#define SILC_ST_GET_STACK(p) ((SilcStBlock)(((unsigned char *)p) -     \
-                           sizeof(struct SilcStBlockStruct)))
-#define SILC_ST_GET_PTR(p) (((unsigned char *)p) +             \
-                           sizeof(struct SilcStBlockStruct))
-
-void silc_st_stacktrace(SilcStBlock stack)
-{
-  void *fp;
-
-  if (!dump) {
-    atexit(silc_st_dump);
-    dump = TRUE;
-  }
-
-  if (!malloc_check) {
-    /* Linux libc malloc check */
-    setenv("MALLOC_CHECK_", "2", 1);
-
-    /* NetBSD malloc check */
-    setenv("MALLOC_OPTIONS", "AJ", 1);
-
-    malloc_check = TRUE;
-  }
-
-  /* Save the stack */
-  SILC_ST_GET_FP(fp);
-  for (stack->depth = 0; fp; stack->depth++) {
-    if (stack->depth == SILC_ST_DEPTH)
-      break;
-
-    /* Get program pointer and frame pointer from this frame */
-    stack->stack[stack->depth] = *((void **)(((unsigned char *)fp) + 4));
-    fp = *((void **)fp);
-  }
-}
-
-void *silc_st_malloc(size_t size, const char *file, int line)
-{
-  SilcStBlock stack = (SilcStBlock)malloc(SILC_ST_GET_SIZE(size));
-  assert(stack != NULL);
-
-  stack->dumpped = 0;
-  stack->file = file;
-  stack->line = line;
-  stack->size = size;
-  silc_st_stacktrace(stack);
-
-  stack->next = st_blocks;
-  stack->prev = NULL;
-  if (st_blocks)
-    ((SilcStBlock)st_blocks)->prev = stack;
-  st_blocks = stack;
-  st_blocks_count++;
-
-  return SILC_ST_GET_PTR(stack);
-}
-
-void *silc_st_calloc(size_t items, size_t size, const char *file, int line)
-{
-  void *addr = (void *)silc_st_malloc(items * size, file, line);
-  memset(addr, 0, items * size);
-  return addr;
-}
-
-void *silc_st_realloc(void *ptr, size_t size, const char *file, int line)
-{
-  SilcStBlock stack;
-
-  if (!ptr)
-    return silc_st_malloc(size, file, line);
-
-  stack = SILC_ST_GET_STACK(ptr);
-  if (stack->size >= size) {
-    stack->size = size;
-    return ptr;
-  } else {
-    void *addr = (void *)silc_st_malloc(size, file, line);
-    memcpy(addr, ptr, stack->size);
-    silc_st_free(ptr, file, line);
-    return addr;
-  }
-}
-
-void silc_st_free(void *ptr, const char *file, int line)
-{
-  SilcStBlock stack;
-
-  if (!ptr)
-    return;
-
-  stack = SILC_ST_GET_STACK(ptr);
-  if (stack->next)
-    stack->next->prev = stack->prev;
-  if (stack->prev)
-    stack->prev->next = stack->next;
-  else
-    st_blocks = stack->next;
-
-  st_blocks_count--;
-
-  memset(stack, 'F', SILC_ST_GET_SIZE(stack->size));
-  free(stack);
-}
-
-void *silc_st_memdup(const void *ptr, size_t size, const char *file, int line)
-{
-  unsigned char *addr = (unsigned char *)silc_st_malloc(size + 1, file, line);
-  memcpy((void *)addr, ptr, size);
-  addr[size] = '\0';
-  return (void *)addr;
-}
-
-void *silc_st_strdup(const char *string, const char *file, int line)
-{
-  return silc_st_memdup(string, strlen(string), file, line);
-}
-
-/* Dumps the stack into file if there are leaks.  The file can be read
-   with a special stacktrace tool. */
-
-void silc_st_dump(void)
-{
-  SilcStBlock stack, s;
-  unsigned long leaks = 0, blocks, bytes;
-  FILE *fp = NULL;
-  int i;
-
-  for (stack = st_blocks; stack; stack = stack->next) {
-    bytes = blocks = 0;
-
-    if (stack->dumpped)
-      continue;
-
-    leaks++;
-
-    if (!fp) {
-      fp = fopen("stacktrace.log", "wb");
-      if (!fp)
-       fp = stderr;
-    }
-
-    for (s = stack; s; s = s->next) {
-      if (s->file == stack->file && s->line == stack->line &&
-         s->depth == stack->depth &&
-         !memcmp(s->stack, stack->stack,
-                 (s->depth * sizeof(stack->stack[0])))) {
-       blocks++;
-       bytes += s->size;
-       s->dumpped = 1;
-      }
-    }
-
-    if (blocks) {
-      fprintf(fp, "<stacktrace>%s:%d: #blocks=%lu, bytes=%lu\n",
-             stack->file, stack->line, blocks, bytes);
-      for (i = 0; i < stack->depth; i++)
-       fprintf(fp, "\tpc=%p\n", stack->stack[i]);
-    }
-  }
-
-  if (!leaks) {
-    fprintf(stderr, "\nNo memory leaks\n");
-  } else {
-    fprintf(stderr,
-           "-----------------------------------------\n"
-           "-----------------------------------------\n"
-           " Memory leaks dumped to 'stacktrace.log'\n"
-           " Leaks: %lu leaks, %lu blocks\n"
-           "-----------------------------------------\n"
-           "-----------------------------------------\n",
-           leaks, st_blocks_count);
-  }
-
-  if (fp && fp != stderr)
-    fclose(fp);
-}
-
-#endif /* SILC_STACKTRACE */
diff --git a/lib/silcutil/stacktrace.h b/lib/silcutil/stacktrace.h
deleted file mode 100644 (file)
index bfe8ae0..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
-
-  stacktrace.h 
-
-  Author: Pekka Riikonen <priikone@silcnet.org>
-
-  Copyright (C) 2002 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 STACKTRACE_H
-#define STACKTRACE_H
-
-#ifndef SILCMEMORY_H
-#error "Do not include internal header file directly"
-#endif
-
-#if defined(__GNUC__) && defined(__i386__)
-
-#undef strdup
-#define silc_malloc(s)      silc_st_malloc((s), __FILE__, __LINE__)
-#define silc_calloc(i, s)   silc_st_calloc((i), (s), __FILE__, __LINE__)
-#define silc_realloc(p, s)  silc_st_realloc((p), (s), __FILE__, __LINE__)
-#define silc_free(p)        silc_st_free((p), __FILE__, __LINE__)
-#define silc_memdup(p, s)   silc_st_memdup((p), (s), __FILE__, __LINE__)
-#define strdup(s)           silc_st_strdup((s), __FILE__, __LINE__)
-
-void *silc_st_malloc(size_t size, const char *file, int line);
-void *silc_st_calloc(size_t items, size_t size, const char *file, int line);
-void *silc_st_realloc(void *ptr, size_t size, const char *file, int line);
-void silc_st_free(void *ptr, const char *file, int line);
-void *silc_st_memdup(const void *ptr, size_t size, const char *file, int line);
-void *silc_st_strdup(const char *string, const char *file, int line);
-void silc_st_dump(void);
-
-#else
-#error "memory allocation stack trace not supported on this platform"
-#endif /* __GNUC__ && __i386__ */
-
-#endif /* STACKTRACE_H */
diff --git a/lib/silcutil/symbian/.cvsignore b/lib/silcutil/symbian/.cvsignore
deleted file mode 100644 (file)
index 282522d..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-Makefile
-Makefile.in
diff --git a/lib/silcutil/symbian/Makefile.am b/lib/silcutil/symbian/Makefile.am
deleted file mode 100644 (file)
index 5fdf67c..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-#
-#  Makefile.am
-#
-#  Author: Pekka Riikonen <priikone@silcnet.org>
-#
-#  Copyright (C) 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; either version 2 of the License, or
-#  (at your option) any later version.
-#
-#  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.
-#
-
-AUTOMAKE_OPTIONS = 1.0 no-dependencies foreign
-
-EXTRA_DIST = *.cpp *.h
-
-include $(top_srcdir)/Makefile.defines.in
diff --git a/lib/silcutil/symbian/silcsymbiannet.cpp b/lib/silcutil/symbian/silcsymbiannet.cpp
deleted file mode 100644 (file)
index 69fba82..0000000
+++ /dev/null
@@ -1,807 +0,0 @@
-/*
-
-  silcsymbiannet.cpp
-
-  Author: Pekka Riikonen <priikone@silcnet.org>
-
-  Copyright (C) 2006 - 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.
-
-*/
-
-#include "silc.h"
-#include "silcsymbiansocketstream.h"
-
-/************************ Static utility functions **************************/
-
-static SilcBool silc_net_set_sockaddr(TInetAddr *addr, const char *ip_addr,
-                                      int port)
-{
-  /* Check for IPv4 and IPv6 addresses */
-  if (ip_addr) {
-    if (!silc_net_is_ip(ip_addr)) {
-      SILC_LOG_ERROR(("%s is not IP address", ip_addr));
-      return FALSE;
-    }
-
-    if (silc_net_is_ip4(ip_addr)) {
-      /* IPv4 address */
-      unsigned char buf[4];
-      TUint32 a;
-
-      if (!silc_net_addr2bin(ip_addr, buf, sizeof(buf)))
-        return FALSE;
-
-      SILC_GET32_MSB(a, buf);
-      addr->SetAddress(a);
-      addr->SetPort(port);
-    } else {
-#ifdef HAVE_IPV6
-      SILC_LOG_ERROR(("IPv6 not supported"));
-      return FALSE;
-#else
-      SILC_LOG_ERROR(("Operating System does not support IPv6"));
-      return FALSE;
-#endif
-    }
-  } else {
-    addr->SetAddress(0);
-    addr->SetPort(port);
-  }
-
-  return TRUE;
-}
-
-/****************************** TCP Listener ********************************/
-
-class SilcSymbianTCPListener;
-
-extern "C" {
-
-/* Deliver new stream to upper layer */
-
-static void silc_net_accept_stream(SilcSocketStreamStatus status,
-                                  SilcStream stream, void *context)
-{
-  SilcNetListener listener = (SilcNetListener)context;
-
-  /* In case of error, the socket has been destroyed already via
-     silc_stream_destroy. */
-  if (status != SILC_SOCKET_OK)
-    return;
-
-  listener->callback(SILC_NET_OK, stream, listener->context);
-}
-
-} /* extern "C" */
-
-/* TCP Listener class */
-
-class SilcSymbianTCPListener : public CActive {
-public:
-  /* Constructor */
-  SilcSymbianTCPListener() : CActive(CActive::EPriorityStandard)
-  {
-    CActiveScheduler::Add(this);
-  }
-
-  /* Destructor */
-  ~SilcSymbianTCPListener()
-  {
-    Cancel();
-  }
-
-  /* Listen for connection */
-  void Listen()
-  {
-    SILC_LOG_DEBUG(("Listen()"));
-
-    new_conn = new RSocket;
-    if (!new_conn)
-      return;
-    if (new_conn->Open(ss) != KErrNone) {
-      Listen();
-      return;
-    }
-
-    /* Start listenning */
-    sock.Accept(*new_conn, iStatus);
-    SetActive();
-  }
-
-  /* Listener callback */
-  virtual void RunL()
-  {
-    SILC_LOG_DEBUG(("RunL(), iStatus=%d", iStatus));
-
-    if (iStatus != KErrNone) {
-      if (new_conn)
-       delete new_conn;
-      new_conn = NULL;
-      Listen();
-      return;
-    }
-
-    SILC_LOG_DEBUG(("Accept new connection"));
-
-    /* Set socket options */
-    new_conn->SetOpt(KSoReuseAddr, KSolInetIp, 1);
-
-    /* Create socket stream */
-    silc_socket_tcp_stream_create(
-                       (SilcSocket)silc_create_symbian_socket(new_conn, NULL),
-                       listener->lookup, listener->require_fqdn,
-                       listener->schedule, silc_net_accept_stream,
-                       (void *)listener);
-    new_conn = NULL;
-
-    /* Continue listenning */
-    Listen();
-  }
-
-  /* Cancel */
-  virtual void DoCancel()
-  {
-    sock.CancelAll();
-    ss.Close();
-    if (new_conn)
-      delete new_conn;
-  }
-
-  RSocket *new_conn;
-  RSocket sock;
-  RSocketServ ss;
-  SilcNetListener listener;
-};
-
-extern "C" {
-
-/* Create TCP listener */
-
-SilcNetListener
-silc_net_tcp_create_listener(const char **local_ip_addr,
-                            SilcUInt32 local_ip_count, int port,
-                            SilcBool lookup, SilcBool require_fqdn,
-                            SilcSchedule schedule,
-                            SilcNetCallback callback, void *context)
-{
-  SilcNetListener listener = NULL;
-  SilcSymbianTCPListener *l = NULL;
-  TInetAddr server;
-  TInt ret;
-  int i;
-
-  SILC_LOG_DEBUG(("Creating TCP listener"));
-
-  if (port < 0 || !schedule || !callback)
-    goto err;
-
-  listener = (SilcNetListener)silc_calloc(1, sizeof(*listener));
-  if (!listener) {
-    callback(SILC_NET_NO_MEMORY, NULL, context);
-    return NULL;
-  }
-  listener->schedule = schedule;
-  listener->callback = callback;
-  listener->context = context;
-  listener->require_fqdn = require_fqdn;
-  listener->lookup = lookup;
-
-  if (local_ip_count > 0) {
-    listener->socks = (SilcSocket *)silc_calloc(local_ip_count,
-                                               sizeof(*listener->socks));
-    if (!listener->socks) {
-      callback(SILC_NET_NO_MEMORY, NULL, context);
-      return NULL;
-    }
-  } else {
-    listener->socks = (SilcSocket *)silc_calloc(1, sizeof(*listener->socks));
-    if (!listener->socks) {
-      callback(SILC_NET_NO_MEMORY, NULL, context);
-      return NULL;
-    }
-
-    local_ip_count = 1;
-  }
-
-  /* Bind to local addresses */
-  for (i = 0; i < local_ip_count; i++) {
-    SILC_LOG_DEBUG(("Binding to local address %s",
-                   local_ip_addr ? local_ip_addr[i] : "0.0.0.0"));
-
-    l = new SilcSymbianTCPListener;
-    if (!l)
-      goto err;
-
-    /* Connect to socket server */
-    ret = l->ss.Connect();
-    if (ret != KErrNone)
-      goto err;
-
-#ifdef SILC_THREADS
-    /* Make our socket shareable between threads */
-    l->ss.ShareAuto();
-#endif /* SILC_THREADS */
-
-    /* Set listener address */
-    if (!silc_net_set_sockaddr(&server, local_ip_addr[i], port))
-      goto err;
-
-    /* Create the socket */
-    ret = l->sock.Open(l->ss, KAfInet, KSockStream, KProtocolInetTcp);
-    if (ret != KErrNone) {
-      SILC_LOG_ERROR(("Cannot create socket, error %d", ret));
-      goto err;
-    }
-
-    /* Set the socket options */
-    ret = l->sock.SetOpt(KSoReuseAddr, KSolInetIp, 1);
-    if (ret != KErrNone) {
-      SILC_LOG_ERROR(("Cannot set socket options, error %d", ret));
-      goto err;
-    }
-
-    /* Bind the listener socket */
-    ret = l->sock.Bind(server);
-    if (ret != KErrNone) {
-      SILC_LOG_DEBUG(("Cannot bind socket, error %d", ret));
-      goto err;
-    }
-
-    /* Specify that we are listenning */
-    ret = l->sock.Listen(5);
-    if (ret != KErrNone) {
-      SILC_LOG_ERROR(("Cannot set socket listenning, error %d", ret));
-      goto err;
-    }
-    l->Listen();
-
-    l->listener = listener;
-    listener->socks[i] = (SilcSocket)l;
-    listener->socks_count++;
-  }
-
-  SILC_LOG_DEBUG(("TCP listener created"));
-
-  return listener;
-
- err:
-  if (l)
-    delete l;
-  if (callback)
-    callback(SILC_NET_ERROR, NULL, context);
-  if (listener)
-    silc_net_close_listener(listener);
-  return NULL;
-}
-
-/* Close network listener */
-
-void silc_net_close_listener(SilcNetListener listener)
-{
-  int i;
-
-  SILC_LOG_DEBUG(("Closing network listener"));
-
-  if (!listener)
-    return;
-
-  for (i = 0; i < listener->socks_count; i++) {
-    SilcSymbianTCPListener *l = (SilcSymbianTCPListener *)listener->socks[i];
-    l->sock.CancelAll();
-    l->sock.Close();
-    l->ss.Close();
-    if (l->new_conn)
-      delete l->new_conn;
-    delete l;
-  }
-
-  silc_free(listener->socks);
-  silc_free(listener);
-}
-
-
-/**************************** TCP/IP connecting *****************************/
-
-static void silc_net_connect_stream(SilcSocketStreamStatus status,
-           SilcStream stream, void *context);
-
-} /* extern "C" */
-
-/* TCP connecting class */
-
-class SilcSymbianTCPConnect : public CActive {
-public:
-  /* Constructor */
-  SilcSymbianTCPConnect() : CActive(CActive::EPriorityStandard)
-  {
-    CActiveScheduler::Add(this);
-  }
-
-  /* Destructor */
-  ~SilcSymbianTCPConnect()
-  {
-    silc_free(remote);
-    if (op)
-      silc_async_free(op);
-    Cancel();
-  }
-
-  /* Connect to remote host */
-  void Connect(TSockAddr &addr)
-  {
-    SILC_LOG_DEBUG(("Connect()"));
-    sock->Connect(addr, iStatus);
-    SetActive();
-  }
-
-  /* Connection callback */
-  virtual void RunL()
-  {
-    SILC_LOG_DEBUG(("RunL(), iStatus=%d", iStatus));
-
-    if (iStatus != KErrNone) {
-      if (callback)
-       callback(SILC_NET_ERROR, NULL, context);
-      sock->CancelConnect();
-      delete sock;
-      ss->Close();
-      delete ss;
-      sock = NULL;
-      ss = NULL;
-      delete this;
-      return;
-    }
-
-    SILC_LOG_DEBUG(("Connected to host %s on %d", remote_ip, port));
-
-    /* Create stream */
-    if (callback) {
-      silc_socket_tcp_stream_create(
-                            (SilcSocket)silc_create_symbian_socket(sock, ss),
-                            TRUE, FALSE, schedule, silc_net_connect_stream,
-                            (void *)this);
-      sock = NULL;
-      ss = NULL;
-    } else {
-      sock->Close();
-      delete sock;
-      ss->Close();
-      delete ss;
-      sock = NULL;
-      ss = NULL;
-      delete this;
-    }
-  }
-
-  /* Cancel */
-  virtual void DoCancel()
-  {
-    if (ss) {
-      ss->Close();
-      delete ss;
-    }
-    if (sock) {
-      sock->CancelConnect();
-      delete sock;
-    }
-  }
-
-  RSocket *sock;
-  RSocketServ *ss;
-  char *remote;
-  char remote_ip[64];
-  int port;
-  SilcAsyncOperation op;
-  SilcSchedule schedule;
-  SilcNetCallback callback;
-  void *context;
-};
-
-extern "C" {
-
-/* TCP stream creation callback */
-
-static void silc_net_connect_stream(SilcSocketStreamStatus status,
-                                   SilcStream stream, void *context)
-{
-  SilcSymbianTCPConnect *conn = (SilcSymbianTCPConnect *)context;
-  SilcNetStatus net_status = SILC_NET_OK;
-
-  SILC_LOG_DEBUG(("Socket stream creation status %d", status));
-
-  if (status != SILC_SOCKET_OK) {
-    /* In case of error, the socket has been destroyed already via
-       silc_stream_destroy. */
-    if (status == SILC_SOCKET_UNKNOWN_IP)
-      net_status = SILC_NET_UNKNOWN_IP;
-    else if (status == SILC_SOCKET_UNKNOWN_HOST)
-      net_status = SILC_NET_UNKNOWN_HOST;
-    else
-      net_status = SILC_NET_ERROR;
-  }
-
-  /* Call connection callback */
-  if (conn->callback)
-    conn->callback(net_status, stream, conn->context);
-  else if (stream)
-    silc_stream_destroy(stream);
-
-  delete conn;
-}
-
-/* Connecting abort callback */
-
-static void silc_net_connect_abort(SilcAsyncOperation op, void *context)
-{
-  SilcSymbianTCPConnect *conn = (SilcSymbianTCPConnect *)context;
-
-  /* Abort */
-  conn->callback = NULL;
-  conn->op = NULL;
-  if (conn->sock)
-    conn->sock->CancelConnect();
-}
-
-/* Create TCP/IP connection */
-
-SilcAsyncOperation silc_net_tcp_connect(const char *local_ip_addr,
-                                       const char *remote_ip_addr,
-                                       int remote_port,
-                                       SilcSchedule schedule,
-                                       SilcNetCallback callback,
-                                       void *context)
-{
-  SilcSymbianTCPConnect *conn;
-  TInetAddr local, remote;
-  SilcNetStatus status;
-  TInt ret;
-
-  if (!remote_ip_addr || remote_port < 1 || !schedule || !callback)
-    return NULL;
-
-  SILC_LOG_DEBUG(("Creating connection to host %s port %d",
-                 remote_ip_addr, remote_port));
-
-  conn = new SilcSymbianTCPConnect;
-  if (!conn) {
-    callback(SILC_NET_NO_MEMORY, NULL, context);
-    return NULL;
-  }
-  conn->schedule = schedule;
-  conn->callback = callback;
-  conn->context = context;
-  conn->port = remote_port;
-  conn->remote = strdup(remote_ip_addr);
-  if (!conn->remote) {
-    status = SILC_NET_NO_MEMORY;
-    goto err;
-  }
-
-  /* Allocate socket */
-  conn->sock = new RSocket;
-  if (!conn->sock) {
-    status = SILC_NET_NO_MEMORY;
-    goto err;
-  }
-
-  /* Allocate socket server */
-  conn->ss = new RSocketServ;
-  if (!conn->ss) {
-    status = SILC_NET_NO_MEMORY;
-    goto err;
-  }
-
-  /* Connect to socket server */
-  ret = conn->ss->Connect();
-  if (ret != KErrNone) {
-    SILC_LOG_ERROR(("Error connecting to socket server, error %d", ret));
-    status = SILC_NET_ERROR;
-    goto err;
-  }
-
-#ifdef SILC_THREADS
-  /* Make our socket shareable between threads */
-  conn->ss->ShareAuto();
-#endif /* SILC_THREADS */
-
-  /* Start async operation */
-  conn->op = silc_async_alloc(silc_net_connect_abort, NULL, (void *)conn);
-  if (!conn->op) {
-    status = SILC_NET_NO_MEMORY;
-    goto err;
-  }
-
-  /* Do host lookup */
-  if (!silc_net_gethostbyname(remote_ip_addr, FALSE, conn->remote_ip,
-                             sizeof(conn->remote_ip))) {
-    SILC_LOG_ERROR(("Network (%s) unreachable: could not resolve the "
-                   "host", conn->remote));
-    status = SILC_NET_HOST_UNREACHABLE;
-    goto err;
-  }
-
-  /* Create the connection socket */
-  ret = conn->sock->Open(*conn->ss, KAfInet, KSockStream, KProtocolInetTcp);
-  if (ret != KErrNone) {
-    SILC_LOG_ERROR(("Cannot create socket, error %d", ret));
-    status = SILC_NET_ERROR;
-    goto err;
-  }
-
-  /* Set appropriate options */
-  conn->sock->SetOpt(KSoTcpNoDelay, KSolInetTcp, 1);
-  conn->sock->SetOpt(KSoTcpKeepAlive, KSolInetTcp, 1);
-
-  /* Bind to the local address if provided */
-  if (local_ip_addr)
-    if (silc_net_set_sockaddr(&local, local_ip_addr, 0))
-      conn->sock->Bind(local);
-
-  /* Connect to the host */
-  if (!silc_net_set_sockaddr(&remote, conn->remote_ip, remote_port)) {
-    SILC_LOG_ERROR(("Cannot connect (cannot set address)"));
-    status = SILC_NET_ERROR;
-    goto err;
-  }
-  conn->Connect(remote);
-
-  SILC_LOG_DEBUG(("Connection operation in progress"));
-
-  return conn->op;
-
- err:
-  if (conn->ss) {
-    conn->ss->Close();
-    delete conn->ss;
-  }
-  if (conn->sock)
-    delete conn->sock;
-  if (conn->remote)
-    silc_free(conn->remote);
-  if (conn->op)
-    silc_async_free(conn->op);
-  callback(status, NULL, context);
-  delete conn;
-  return NULL;
-}
-
-/****************************** UDP routines ********************************/
-
-/* Create UDP/IP connection */
-
-SilcStream silc_net_udp_connect(const char *local_ip_addr, int local_port,
-                               const char *remote_ip_addr, int remote_port,
-                               SilcSchedule schedule)
-{
-  SilcSymbianSocket *s;
-  SilcStream stream;
-  TInetAddr local, remote;
-  TRequestStatus status;
-  RSocket *sock = NULL;
-  RSocketServ *ss = NULL;
-  TInt ret;
-
-  SILC_LOG_DEBUG(("Creating UDP stream"));
-
-  if (!schedule)
-    goto err;
-
-  SILC_LOG_DEBUG(("Binding to local address %s",
-                 local_ip_addr ? local_ip_addr : "0.0.0.0"));
-
-  sock = new RSocket;
-  if (!sock)
-    goto err;
-
-  ss = new RSocketServ;
-  if (!ss)
-    goto err;
-
-  /* Open socket server */
-  ret = ss->Connect();
-  if (ret != KErrNone)
-    goto err;
-
-#ifdef SILC_THREADS
-  /* Make our socket shareable between threads */
-  ss->ShareAuto();
-#endif /* SILC_THREADS */
-
-  /* Get local bind address */
-  if (!silc_net_set_sockaddr(&local, local_ip_addr, local_port))
-    goto err;
-
-  /* Create the socket */
-  ret = sock->Open(*ss, KAfInet, KSockDatagram, KProtocolInetUdp);
-  if (ret != KErrNone) {
-    SILC_LOG_ERROR(("Cannot create socket"));
-    goto err;
-  }
-
-  /* Set the socket options */
-  sock->SetOpt(KSoReuseAddr, KSolInetIp, 1);
-
-  /* Bind the listener socket */
-  ret = sock->Bind(local);
-  if (ret != KErrNone) {
-    SILC_LOG_DEBUG(("Cannot bind socket"));
-    goto err;
-  }
-
-  /* Set to connected state if remote address is provided. */
-  if (remote_ip_addr && remote_port) {
-    if (silc_net_set_sockaddr(&remote, remote_ip_addr, remote_port)) {
-      sock->Connect(remote, status);
-      if (status != KErrNone) {
-       SILC_LOG_DEBUG(("Cannot connect UDP stream"));
-       goto err;
-      }
-    }
-  }
-
-  /* Encapsulate into socket stream */
-  s = silc_create_symbian_socket(sock, ss);
-  if (!s)
-    goto err;
-  stream =
-    silc_socket_udp_stream_create((SilcSocket)s, local_ip_addr ?
-                                 silc_net_is_ip6(local_ip_addr) : FALSE,
-                                 remote_ip_addr ? TRUE : FALSE, schedule);
-  if (!stream)
-    goto err;
-
-  SILC_LOG_DEBUG(("UDP stream created, fd=%d", sock));
-  return stream;
-
- err:
-  if (sock)
-    delete sock;
-  if (ss) {
-    ss->Close();
-    delete ss;
-  }
-  return NULL;
-}
-
-/* Sets socket to non-blocking mode */
-
-int silc_net_set_socket_nonblock(SilcSocket sock)
-{
-  /* Nothing to do in Symbian where blocking socket mode is asynchronous
-     already (ie. non-blocking). */
-  return 0;
-}
-
-/* Converts the IP number string from numbers-and-dots notation to
-   binary form. */
-
-SilcBool silc_net_addr2bin(const char *addr, void *bin, SilcUInt32 bin_len)
-{
-  int ret = 0;
-  struct in_addr tmp;
-
-  ret = inet_aton(addr, &tmp);
-  if (bin_len < 4)
-    return FALSE;
-
-  memcpy(bin, (unsigned char *)&tmp.s_addr, 4);
-
-  return ret != 0;
-}
-
-/* Get remote host and IP from socket */
-
-SilcBool silc_net_check_host_by_sock(SilcSocket sock, char **hostname,
-                                    char **ip)
-{
-  SilcSymbianSocket *s = (SilcSymbianSocket *)sock;
-  TInetAddr addr;
-  char host[256];
-  TBuf<64> tmp;
-
-  if (hostname)
-    *hostname = NULL;
-  *ip = NULL;
-
-  s->sock->RemoteName(addr);
-  addr.Output(tmp);
-
-  *ip = (char *)silc_memdup(tmp.Ptr(), tmp.Length());
-  if (*ip == NULL)
-    return FALSE;
-
-  /* Do reverse lookup if we want hostname too. */
-  if (hostname) {
-    /* Get host by address */
-    if (!silc_net_gethostbyaddr(*ip, host, sizeof(host)))
-      return FALSE;
-
-    *hostname = (char *)silc_memdup(host, strlen(host));
-    SILC_LOG_DEBUG(("Resolved hostname `%s'", *hostname));
-
-    /* Reverse */
-    if (!silc_net_gethostbyname(*hostname, TRUE, host, sizeof(host)))
-      return FALSE;
-
-    if (strcmp(*ip, host))
-      return FALSE;
-  }
-
-  SILC_LOG_DEBUG(("Resolved IP address `%s'", *ip));
-  return TRUE;
-}
-
-/* Get local host and IP from socket */
-
-SilcBool silc_net_check_local_by_sock(SilcSocket sock, char **hostname,
-                                     char **ip)
-{
-  SilcSymbianSocket *s = (SilcSymbianSocket *)sock;
-  TInetAddr addr;
-  char host[256];
-  TBuf<64> tmp;
-
-  if (hostname)
-    *hostname = NULL;
-  *ip = NULL;
-
-  s->sock->LocalName(addr);
-  addr.Output(tmp);
-
-  *ip = (char *)silc_memdup(tmp.Ptr(), tmp.Length());
-  if (*ip == NULL)
-    return FALSE;
-
-  /* Do reverse lookup if we want hostname too. */
-  if (hostname) {
-    /* Get host by address */
-    if (!silc_net_gethostbyaddr(*ip, host, sizeof(host)))
-      return FALSE;
-
-    *hostname = (char *)silc_memdup(host, strlen(host));
-    SILC_LOG_DEBUG(("Resolved hostname `%s'", *hostname));
-
-    /* Reverse */
-    if (!silc_net_gethostbyname(*hostname, TRUE, host, sizeof(host)))
-      return FALSE;
-
-    if (strcmp(*ip, host))
-      return FALSE;
-  }
-
-  SILC_LOG_DEBUG(("Resolved IP address `%s'", *ip));
-  return TRUE;
-}
-
-/* Get remote port from socket */
-
-SilcUInt16 silc_net_get_remote_port(SilcSocket sock)
-{
-  SilcSymbianSocket *s = (SilcSymbianSocket *)sock;
-  TInetAddr addr;
-
-  s->sock->RemoteName(addr);
-  return (SilcUInt16)addr.Port();
-}
-
-/* Get local port from socket */
-
-SilcUInt16 silc_net_get_local_port(SilcSocket sock)
-{
-  SilcSymbianSocket *s = (SilcSymbianSocket *)sock;
-  TInetAddr addr;
-
-  s->sock->LocalName(addr);
-  return (SilcUInt16)addr.Port();
-}
-
-} /* extern "C" */
diff --git a/lib/silcutil/symbian/silcsymbianscheduler.cpp b/lib/silcutil/symbian/silcsymbianscheduler.cpp
deleted file mode 100644 (file)
index 631a0a9..0000000
+++ /dev/null
@@ -1,309 +0,0 @@
-/*
-
-  silcsymbianscheduler.cpp
-
-  Author: Pekka Riikonen <priikone@silcnet.org>
-
-  Copyright (C) 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.
-
-*/
-
-#include "silc.h"
-#include <e32base.h>
-
-/* The SILC Scheduler for Symbian handles only timeout tasks.  Fd tasks are
-   not handled by the SILC Scheduler at all but are handled by the Symbian's
-   Active Scheduler.  Fd and socket stream callbacks are delivered back
-   to caller in their respective class implementatios.
-
-   The SILC Scheduler in Symbian works by creating CActiveSchedulerWait
-   when silc_schedule() is called.  This will block the calling thread just
-   like silc_schedule is supposed to do.  Under that Active Scheduler we
-   run our SilcSymbianScheduler timer which will handle the actual SILC
-   Scheduler by calling silc_schedule_one at correct times.  The timeout
-   values are selected by the SILC Scheduler itself when silc_schedule_one
-   is called.  After that call returns we go back to the Active Scheduler
-   to dispatch other active objects and to wait for next timeout.
-
-   Wakeup of the scheduler works by simply cancelling the outstanding timeout
-   and issuing a zero timeout to call the silc_schedule_one again.
-
-   If user directly calls silc_schedule_one it behaves same as on other
-   platforms. */
-
-class SilcSymbianScheduler;
-class SilcSymbianSchedulerWakeup;
-
-typedef struct {
-  SilcSymbianScheduler *timer;
-  SilcSymbianSchedulerWakeup *wakeup;
-} *SilcSymbianInternal;
-
-/* SILC scheduler timer class.  This handles the actual SILC Scheduler
-   by calling silc_schedule_one and scheduling the scheduler timeouts. */
-class SilcSymbianScheduler : public CTimer {
-public:
-  /* Constructor */
-  SilcSymbianScheduler() : CTimer(CActive::EPriorityStandard)
-  {
-    CTimer::ConstructL();
-    CActiveScheduler::Add(this);
-    After(0);
-  }
-
-  /* Destructor */
-  ~SilcSymbianScheduler()
-  {
-    Cancel();
-  }
-
-  /* Timeout callback */
-  virtual void RunL()
-  {
-    if (!silc_schedule_one(schedule, -1))
-      s->AsyncStop();
-  }
-
-  CActiveSchedulerWait *s;
-  SilcSchedule schedule;
-};
-
-/* Scheduler wakeup class */
-class SilcSymbianSchedulerWakeup : public CActive {
-public:
-  /* Constructor */
-  SilcSymbianSchedulerWakeup() : CActive(CActive::EPriorityStandard)
-  {
-    CActiveScheduler::Add(this);
-    iStatus = KRequestPending;
-    SetActive();
-  }
-
-  /* Destructor */
-  ~SilcSymbianSchedulerWakeup()
-  {
-    Cancel();
-  }
-
-  /* Wakeup.  This is called with scheduler locked. */
-  void Wakeup(TThreadId thread_id)
-  {
-    if (wake_signal)
-      return;
-    wake_signal = TRUE;
-
-    TRequestStatus *status = &iStatus;
-    if (id != thread_id)
-      thread.RequestComplete(status, KErrNone);
-    else
-      User::RequestComplete(status, KErrNone);
-  }
-
-  /* Timeout callback */
-  virtual void RunL()
-  {
-    SILC_LOG_DEBUG(("Wakeup scheduler"));
-
-    /* We need to synchronize with calls to Wakeup() */
-    silc_mutex_lock(schedule->lock);
-
-    /* Wakeup scheduler */
-    timer->Cancel();
-    timer->After(0);
-    wake_signal = FALSE;
-
-    iStatus = KRequestPending;
-    SetActive();
-
-    silc_mutex_unlock(schedule->lock);
-  }
-
-  virtual void DoCancel()
-  {
-    wake_signal = TRUE;
-  }
-
-  RThread thread;
-  TThreadId id;
-  SilcSymbianScheduler *timer;
-  SilcSchedule schedule;
-  unsigned int wake_signal  : 1;
-};
-
-extern "C" {
-
-/* Symbian's silc_schedule call.  We start Active Scheduler here and start
-   our SILC Scheduler.  The calling thread will block here. */
-
-void silc_schedule(SilcSchedule schedule)
-{
-  SilcSymbianInternal internal = (SilcSymbianInternal)schedule->internal;
-  CActiveSchedulerWait *s;
-
-  SILC_LOG_DEBUG(("Running scheduler"));
-
-  /* Create Active Scheduler */
-  s = new CActiveSchedulerWait;
-  SILC_ASSERT(s);
-
-  /* Start SILC Scheduler */
-  internal->timer = new SilcSymbianScheduler;
-  SILC_ASSERT(internal->timer);
-  internal->timer->schedule = schedule;
-  internal->timer->s = s;
-  internal->wakeup = new SilcSymbianSchedulerWakeup;
-  SILC_ASSERT(internal->wakeup);
-  internal->wakeup->id = RThread().Id();
-  internal->wakeup->thread.Open(internal->wakeup->id);
-  internal->wakeup->timer = internal->timer;
-  internal->wakeup->schedule = schedule;
-
-  /* Start Active Scheduler */
-  s->Start();
-
-  delete internal->wakeup;
-  delete internal->timer;
-  delete s;
-}
-
-int silc_poll(SilcSchedule schedule, void *context)
-{
-  SilcSymbianInternal internal = (SilcSymbianInternal)context;
-  int timeout = -1;
-  TTime at_timeout;
-
-  /* When user is using silc_schedule_one we don't have our timer set,
-     so just return immediately. */
-  if (!internal->timer)
-    return 0;
-
-  /* Schedule next timeout */
-  if (schedule->has_timeout)
-    timeout = ((schedule->timeout.tv_sec * 1000) +
-               (schedule->timeout.tv_usec / 1000));
-
-  if (!timeout)
-    return 0;
-
-  if (timeout == -1)
-    return -2;
-
-  /* Set the timeout value */
-  at_timeout.HomeTime();
-  while (timeout > 2100 * 1000) {
-    at_timeout += (TTimeIntervalMicroSeconds32)(2100 * 1000 * 1000);
-    timeout -= (2100 * 1000);
-  }
-  at_timeout += (TTimeIntervalMicroSeconds32)(timeout * 1000);
-
-  /* Schedule the timeout */
-  if (internal->timer->IsActive())
-    internal->timer->Cancel();
-  internal->timer->At(at_timeout);
-
-  /* Return special "ignore" value.  Causes the scheduler to just break
-     the scheduler iteration and return back to its caller. */
-  return -2;
-}
-
-SilcBool silc_schedule_internal_schedule_fd(SilcSchedule schedule,
-                                           void *context,
-                                           SilcTaskFd task,
-                                           SilcTaskEvent event_mask)
-{
-  /* Nothing to do */
-  return TRUE;
-}
-
-void *silc_schedule_internal_init(SilcSchedule schedule,
-                                 void *app_context)
-{
-  SilcSymbianInternal internal;
-
-  internal = (SilcSymbianInternal)silc_calloc(1, sizeof(*internal));
-  if (!internal)
-    return NULL;
-
-  return internal;
-}
-
-void silc_schedule_internal_uninit(SilcSchedule schedule, void *context)
-{
-  SilcSymbianInternal internal = (SilcSymbianInternal)context;
-  silc_free(internal);
-}
-
-void silc_schedule_internal_wakeup(SilcSchedule schedule, void *context)
-{
-#ifdef SILC_THREADS
-  SilcSymbianInternal internal = (SilcSymbianInternal)context;
-  TThreadId id;
-
-  if (!internal->timer)
-    return;
-
-  id = RThread().Id();
-  internal->wakeup->Wakeup(id);
-#endif /* SILC_THREADS */
-}
-
-void silc_schedule_internal_signal_register(SilcSchedule schedule,
-                                           void *context,
-                                           SilcUInt32 sig,
-                                            SilcTaskCallback callback,
-                                            void *callback_context)
-{
-  /* Nothing to do */
-}
-
-void silc_schedule_internal_signal_unregister(SilcSchedule schedule,
-                                             void *context,
-                                             SilcUInt32 sig)
-{
-  /* Nothing to do */
-}
-
-void silc_schedule_internal_signals_call(SilcSchedule schedule, void *context)
-{
-  /* Nothing to do */
-}
-
-void silc_schedule_internal_signals_block(SilcSchedule schedule, void *context)
-{
-  /* Nothing to do */
-}
-
-void silc_schedule_internal_signals_unblock(SilcSchedule schedule,
-                                           void *context)
-{
-  /* Nothing to do */
-}
-
-#ifdef __WINSCW__
-EXPORT_C const SilcScheduleOps schedule_ops =
-#else
-const SilcScheduleOps schedule_ops =
-#endif /* __WINSCW__ */
-{
-  silc_schedule_internal_init,
-  silc_schedule_internal_uninit,
-  silc_poll,
-  silc_schedule_internal_schedule_fd,
-  silc_schedule_internal_wakeup,
-  silc_schedule_internal_signal_register,
-  silc_schedule_internal_signal_unregister,
-  silc_schedule_internal_signals_call,
-  silc_schedule_internal_signals_block,
-  silc_schedule_internal_signals_unblock,
-};
-
-} /* extern "C" */
diff --git a/lib/silcutil/symbian/silcsymbiansocketstream.cpp b/lib/silcutil/symbian/silcsymbiansocketstream.cpp
deleted file mode 100644 (file)
index b236278..0000000
+++ /dev/null
@@ -1,484 +0,0 @@
-
-/*
-
-  silcsymbiansocketstream.cpp
-
-  Author: Pekka Riikonen <priikone@silcnet.org>
-
-  Copyright (C) 2006 - 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.
-
-*/
-
-/* In this implementation the sockets are in blocking mode, except that
-   on Symbian the blocking mode is actually asynchronous, which semantically
-   translates into non-blocking mode.  The non-blocking mode just is not
-   explicitly set because it would require us also to explicitly poll for the
-   socket, which is done automatically by the Active Scheduler in blocking
-   mode. */
-
-#include "silc.h"
-#include "silcsymbiansocketstream.h"
-
-/***************************** Socket Classes *******************************/
-
-/* Socket stream sender */
-
-class SilcSymbianSocketSend : public CActive {
-public:
-  /* Constructor */
-  SilcSymbianSocketSend() : CActive(CActive::EPriorityStandard)
-  {
-    CActiveScheduler::Add(this);
-  }
-
-  /* Destructor */
-  ~SilcSymbianSocketSend()
-  {
-    Cancel();
-  }
-
-  /* Send data */
-  void Send(const TDesC8& buf, TSockXfrLength& ret_len)
-  {
-    SILC_LOG_DEBUG(("Send()"));
-    s->sock->Send(buf, 0, iStatus, ret_len);
-    if (!IsActive())
-      SetActive();
-  }
-
-  /* Send data */
-  void Send(const TDesC8& buf, TSockXfrLength& ret_len,
-           const char *remote_ip, int remote_port)
-  {
-    TInetAddr remote;
-    TBuf<64> tmp;
-
-    SILC_LOG_DEBUG(("Send()"));
-
-    remote = TInetAddr(remote_port);
-    tmp = (TText *)remote_ip;
-    if (remote.Input(tmp) == KErrNone) {
-      s->sock->SendTo(buf, remote, 0, iStatus, ret_len);
-      if (!IsActive())
-        SetActive();
-    }
-  }
-
-  /* Sending callback */
-  virtual void RunL()
-  {
-    SILC_LOG_DEBUG(("RunL(), iStatus=%d", iStatus));
-
-    if (iStatus != KErrNone) {
-      if (iStatus == KErrEof)
-       s->eof = 1;
-      else
-       s->error = 1;
-      return;
-    }
-
-    /* Call stream callback */
-    if (s->would_block) {
-      s->would_block = 0;
-      if (s->stream && s->stream->notifier)
-       s->stream->notifier(s->stream, SILC_STREAM_CAN_WRITE,
-                           s->stream->notifier_context);
-    }
-  }
-
-  /* Cancel */
-  virtual void DoCancel()
-  {
-    s->sock->CancelWrite();
-  }
-
-  SilcSymbianSocket *s;
-};
-
-/* Socket stream receiver */
-
-class SilcSymbianSocketReceive : public CActive {
-public:
-  /* Constructor */
-  SilcSymbianSocketReceive() : CActive(CActive::EPriorityStandard)
-  {
-    CActiveScheduler::Add(this);
-  }
-
-  /* Destructor */
-  ~SilcSymbianSocketReceive()
-  {
-    Cancel();
-  }
-
-  /* Read data */
-  void Read()
-  {
-    SILC_LOG_DEBUG(("Read()"));
-
-    if (s->stream && s->stream->connected)
-      s->sock->RecvOneOrMore(inbuf, 0, iStatus, read_len);
-    else
-      s->sock->RecvFrom(inbuf, remote, 0, iStatus);
-
-    if (!IsActive())
-      SetActive();
-  }
-
-  /* Reading callback */
-  virtual void RunL()
-  {
-    SILC_LOG_DEBUG(("RunL(), iStatus=%d", iStatus));
-
-    if (iStatus != KErrNone) {
-      if (iStatus == KErrEof)
-       s->eof = 1;
-      else
-       s->error = 1;
-
-      /* Call stream callback */
-      if (s->stream && s->stream->notifier)
-       s->stream->notifier(s->stream, SILC_STREAM_CAN_READ,
-                           s->stream->notifier_context);
-      return;
-    }
-
-    if (!s->stream || s->stream->connected)
-      inbuf_len = read_len();
-    else
-      inbuf_len = inbuf.Length();
-
-    if (inbuf_len) {
-      inbuf_ptr = inbuf.Ptr();
-      while (inbuf_ptr) {
-       /* Call stream callback until all has been read */
-       if (s->stream && s->stream->notifier)
-         s->stream->notifier(s->stream, SILC_STREAM_CAN_READ,
-                             s->stream->notifier_context);
-      }
-    }
-
-    /* Read more */
-    Read();
-  }
-
-  /* Cancel */
-  virtual void DoCancel()
-  {
-    s->sock->CancelRecv();
-  }
-
-  TBuf8<8192> inbuf;
-  const unsigned char *inbuf_ptr;
-  TInt inbuf_len;
-  TSockXfrLength read_len;
-  SilcSymbianSocket *s;
-  TInetAddr remote;
-};
-
-/* Creates symbian socket stream context */
-
-SilcSymbianSocket *silc_create_symbian_socket(RSocket *sock,
-                                             RSocketServ *ss)
-{
-  SilcSymbianSocket *stream;
-
-  stream = (SilcSymbianSocket *)silc_calloc(1, sizeof(*stream));
-  if (!stream)
-    return NULL;
-  stream->sock = sock;
-  stream->ss = ss;
-
-  SILC_LOG_DEBUG(("Create new Symbian socket %p", stream));
-
-  stream->send = new SilcSymbianSocketSend;
-  if (!stream->send) {
-    silc_free(stream);
-    return NULL;
-  }
-  stream->send->s = stream;
-
-  stream->receive = new SilcSymbianSocketReceive;
-  if (!stream->receive) {
-    delete stream->send;
-    silc_free(stream);
-    return NULL;
-  }
-  stream->receive->s = stream;
-  stream->receive->inbuf_ptr = NULL;
-  stream->receive->inbuf_len = 0;
-
-  return stream;
-}
-
-/***************************** SILC Stream API ******************************/
-
-extern "C" {
-
-/* Stream read operation */
-
-int silc_socket_stream_read(SilcStream stream, unsigned char *buf,
-                           SilcUInt32 buf_len)
-{
-  SilcSocketStream socket_stream = (SilcSocketStream)stream;
-  SilcSymbianSocket *s = (SilcSymbianSocket *)socket_stream->sock;
-  SilcSymbianSocketReceive *recv = s->receive;
-  int len;
-
-  SILC_LOG_DEBUG(("Reading from sock %p", s));
-
-  if (s->error || !s->stream) {
-    SILC_LOG_DEBUG(("Error reading from sock %p", s));
-    return -2;
-  }
-  if (s->eof) {
-    SILC_LOG_DEBUG(("EOF from sock %p", s));
-    return 0;
-  }
-  if (!recv->inbuf_len || !recv->inbuf_ptr) {
-    SILC_LOG_DEBUG(("Cannot read now from sock %p", s));
-    return -1;
-  }
-
-  len = recv->inbuf_len;
-  if (buf_len < len)
-    len = buf_len;
-
-  /* Copy the read data */
-  memcpy(buf, recv->inbuf_ptr, len);
-
-  if (len < recv->inbuf_len) {
-    recv->inbuf_ptr += len;
-    recv->inbuf_len -= len;
-  } else {
-    recv->inbuf_ptr = NULL;
-    recv->inbuf_len = 0;
-  }
-
-  SILC_LOG_DEBUG(("Read %d bytes", len));
-
-  return len;
-}
-
-/* Stream write operation */
-
-int silc_socket_stream_write(SilcStream stream, const unsigned char *data,
-                            SilcUInt32 data_len)
-{
-  SilcSocketStream socket_stream = (SilcSocketStream)stream;
-  SilcSymbianSocket *s = (SilcSymbianSocket *)socket_stream->sock;
-  SilcSymbianSocketSend *send = s->send;
-  TSockXfrLength ret_len;
-  TPtrC8 write_buf(data, data_len);
-
-  SILC_LOG_DEBUG(("Writing to sock %p", s));
-
-  if (s->error || !s->stream) {
-    SILC_LOG_DEBUG(("Error writing to sock %p", s));
-    return -2;
-  }
-  if (s->eof) {
-    SILC_LOG_DEBUG(("EOF from sock %p", s));
-    return 0;
-  }
-  if (s->would_block) {
-    SILC_LOG_DEBUG(("Cannot write now to sock %p", s));
-    return -1;
-  }
-
-  /* Send data */
-  send->Send(write_buf, ret_len);
-  if (send->iStatus.Int() != KErrNone) {
-    if (send->iStatus.Int() == KErrEof) {
-      SILC_LOG_DEBUG(("EOF from sock %p", s));
-      return 0;
-    }
-    SILC_LOG_DEBUG(("Error writing to sock %p, error %d", s,
-                   send->iStatus.Int()));
-    return -2;
-  }
-
-  if (!ret_len())
-    return -1;
-
-  s->would_block = 0;
-  if (ret_len() < data_len)
-    s->would_block = 1;
-
-  SILC_LOG_DEBUG(("Wrote %d bytes", ret_len()));
-
-  return ret_len();
-}
-
-/* Receive UDP packet, connected socket. */
-
-int silc_socket_udp_stream_read(SilcStream stream, unsigned char *buf,
-                               SilcUInt32 buf_len)
-{
-  return silc_net_udp_receive(stream, NULL, 0, NULL, buf, buf_len);
-}
-
-/* Send UDP packet, connected socket. */
-
-int silc_socket_udp_stream_write(SilcStream stream, const unsigned char *data,
-                                SilcUInt32 data_len)
-{
-  SilcSocketStream sock = (SilcSocketStream)stream;
-
-  /* In connectionless state check if remote IP and port is provided */
-  if (!sock->connected && sock->ip && sock->port)
-    return silc_net_udp_send(stream, sock->ip, sock->port, data, data_len);
-
-  /* In connected state use normal writing to socket. */
-  return silc_socket_stream_write(stream, data, data_len);
-}
-
-/* Receive UDP packet, connectionless socket */
-
-int silc_net_udp_receive(SilcStream stream, char *remote_ip_addr,
-                        SilcUInt32 remote_ip_addr_size, int *remote_port,
-                        unsigned char *buf, SilcUInt32 buf_len)
-{
-  SilcSocketStream socket_stream = (SilcSocketStream)stream;
-  SilcSymbianSocket *s = (SilcSymbianSocket *)socket_stream->sock;
-  SilcSymbianSocketReceive *recv = s->receive;
-  int len;
-
-  if (s->eof)
-    return 0;
-  if (!recv->inbuf_len || !recv->inbuf_ptr)
-    return -1;
-
-  len = recv->inbuf_len;
-  if (buf_len < len)
-    len = buf_len;
-
-  /* Copy the read data */
-  memcpy(buf, recv->inbuf_ptr, len);
-
-  if (len < recv->inbuf_len) {
-    recv->inbuf_ptr += len;
-    recv->inbuf_len -= len;
-  } else {
-    recv->inbuf_ptr = NULL;
-    recv->inbuf_len = 0;
-  }
-
-  if (remote_ip_addr && remote_ip_addr_size && remote_port) {
-    TBuf<64> ip;
-    recv->remote.Output(ip);
-    silc_strncat(remote_ip_addr, remote_ip_addr_size, (const char *)ip.Ptr(),
-                ip.Length());
-    *remote_port = recv->remote.Port();
-  }
-
-  return len;
-}
-
-/* Send UDP packet, connectionless socket  */
-
-int silc_net_udp_send(SilcStream stream,
-                     const char *remote_ip_addr, int remote_port,
-                     const unsigned char *data, SilcUInt32 data_len)
-{
-  SilcSocketStream socket_stream = (SilcSocketStream)stream;
-  SilcSymbianSocket *s = (SilcSymbianSocket *)socket_stream->sock;
-  SilcSymbianSocketSend *send = s->send;
-  TSockXfrLength ret_len;
-  TPtrC8 write_buf(data, data_len);
-
-  if (s->would_block)
-    return -1;
-  if (s->eof)
-    return 0;
-
-  /* Send data */
-  send->Send(write_buf, ret_len, remote_ip_addr, remote_port);
-  if (send->iStatus.Int() != KErrNone) {
-    if (send->iStatus.Int() == KErrEof)
-      return 0;
-    return -2;
-  }
-
-  if (!ret_len())
-    return -1;
-
-  s->would_block = 0;
-  if (ret_len() < data_len)
-    s->would_block = 1;
-
-  return ret_len();
-}
-
-/* Closes socket */
-
-SilcBool silc_socket_stream_close(SilcStream stream)
-{
-  SilcSocketStream socket_stream = (SilcSocketStream)stream;
-  SilcSymbianSocket *s = (SilcSymbianSocket *)socket_stream->sock;
-  s->sock->Close();
-
-  return TRUE;
-}
-
-/* Destroys the stream */
-
-void silc_socket_stream_destroy(SilcStream stream)
-{
-  SilcSocketStream socket_stream = (SilcSocketStream)stream;
-  SilcSymbianSocket *s = (SilcSymbianSocket *)socket_stream->sock;
-
-  SILC_LOG_DEBUG(("Destroying sock %p", s));
-
-  silc_socket_stream_close(stream);
-  silc_free(socket_stream->ip);
-  silc_free(socket_stream->hostname);
-  silc_free(socket_stream);
-  delete s->send;
-  delete s->receive;
-  delete s->sock;
-  if (s->ss) {
-    s->ss->Close();
-    delete s->ss;
-  }
-  silc_free(s);
-}
-
-/* Sets stream notification callback for the stream */
-
-SilcBool silc_socket_stream_notifier(SilcStream stream,
-                                    SilcSchedule schedule,
-                                    SilcStreamNotifier callback,
-                                    void *context)
-{
-  SilcSocketStream socket_stream = (SilcSocketStream)stream;
-  SilcSymbianSocket *s = (SilcSymbianSocket *)socket_stream->sock;
-
-  SILC_LOG_DEBUG(("Setting stream notifier for sock %p", s));
-
-  if (callback)
-    s->stream = socket_stream;
-  else
-    s->stream = NULL;
-
-  socket_stream->notifier = callback;
-  socket_stream->notifier_context = context;
-  socket_stream->schedule = schedule;
-
-  /* Schedule for receiving data by doing one read operation */
-  if (callback)
-    s->receive->Read();
-
-  return TRUE;
-}
-
-} /* extern "C" */
diff --git a/lib/silcutil/symbian/silcsymbiansocketstream.h b/lib/silcutil/symbian/silcsymbiansocketstream.h
deleted file mode 100644 (file)
index c0ff2a4..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-/*\r
-\r
-  silcsymbiansocketstream.h\r
-\r
-  Author: Pekka Riikonen <priikone@silcnet.org>\r
-\r
-  Copyright (C) 2006 Pekka Riikonen\r
-\r
-  This program is free software; you can redistribute it and/or modify\r
-  it under the terms of the GNU General Public License as published by\r
-  the Free Software Foundation; version 2 of the License.\r
-\r
-  This program is distributed in the hope that it will be useful,\r
-  but WITHOUT ANY WARRANTY; without even the implied warranty of\r
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
-  GNU General Public License for more details.\r
-\r
-*/\r
-\r
-#ifndef SILCSYMBIANSOCKETSTREAM_H\r
-#define SILCSYMBIANSOCKETSTREAM_H\r
-\r
-#include <e32std.h>\r
-#include <es_sock.h>\r
-#include <in_sock.h>\r
-\r
-class SilcSymbianSocketSend;\r
-class SilcSymbianSocketReceive;\r
-\r
-/* Symbian Socket context */\r
-typedef struct {\r
-  SilcSymbianSocketSend *send;\r
-  SilcSymbianSocketReceive *receive;\r
-  RSocket *sock;\r
-  RSocketServ *ss;\r
-  SilcSocketStream stream;\r
-  unsigned int eof          : 1;\r
-  unsigned int error        : 1;\r
-  unsigned int would_block  : 1;\r
-} SilcSymbianSocket;\r
-\r
-/* Creates symbian socket context.  This will steal the `sock' and `ss'. */\r
-SilcSymbianSocket *silc_create_symbian_socket(RSocket *sock,\r
-                                             RSocketServ *ss);\r
-\r
-#endif /* SILCSYMBIANSOCKETSTREAM_H */\r
diff --git a/lib/silcutil/symbian/silcsymbianthread.cpp b/lib/silcutil/symbian/silcsymbianthread.cpp
deleted file mode 100644 (file)
index f3aa6f2..0000000
+++ /dev/null
@@ -1,412 +0,0 @@
-/*
-
-  silcsymbianthread.cpp
-
-  Author: Pekka Riikonen <priikone@silcnet.org>
-
-  Copyright (C) 2006 - 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.
-
-*/
-
-#include "silc.h"
-#include <e32base.h>
-#include <e32std.h>
-
-/**************************** SILC Thread API *******************************/
-
-extern "C" {
-
-/* Thread structure for Symbian */
-struct SilcSymbianThread {
-#ifdef SILC_THREADS
-  SilcThreadStart start_func;
-  void *context;
-  SilcBool waitable;
-#else
-  void *tmp;
-#endif
-};
-
-/* The actual thread function */
-
-static TInt silc_thread_start(TAny *context)
-{
-#ifdef SILC_THREADS
-  SilcSymbianThread *tc = (SilcSymbianThread *)context;
-  SilcThreadStart start_func = tc->start_func;
-  void *user_context = tc->context;
-  SilcBool waitable = tc->waitable;
-  void *ret = NULL;
-
-  silc_free(tc);
-
-  CTrapCleanup *cs = CTrapCleanup::New();
-  if (cs) {
-    CActiveScheduler *s = new CActiveScheduler;
-    if(s) {
-      CActiveScheduler::Install(s);
-
-      /* Call the thread function */
-      TRAPD(ret_val, ret = start_func(user_context));
-
-      delete s;
-    }
-    delete cs;
-  }
-
-  silc_thread_exit(ret);
-
-#endif
-  return KErrNone;
-}
-
-/* Executed new thread */
-
-SilcThread silc_thread_create(SilcThreadStart start_func, void *context,
-                             SilcBool waitable)
-{
-#ifdef SILC_THREADS
-  SilcSymbianThread *tc;
-  RThread *thread;
-  TInt ret;
-  char tmp[24];
-  SilcUInt16 wname[24];
-
-  SILC_LOG_DEBUG(("Creating new thread"));
-
-  tc = (SilcSymbianThread *)silc_calloc(1, sizeof(*tc));
-  if (!tc)
-    return NULL;
-  tc->start_func = start_func;
-  tc->context = context;
-  tc->waitable = waitable;
-
-  /* Allocate thread */
-  thread = new RThread;
-  if (!thread) {
-    silc_free(tc);
-    return NULL;
-  }
-
-  /* Create the thread */
-  silc_snprintf(tmp, sizeof(tmp), "thread-%p", tc);
-  silc_utf8_c2w((const unsigned char *)tmp, strlen(tmp), wname,
-               sizeof(wname) / sizeof(wname[0]));
-  TBuf<24> name((unsigned short *)wname);
-  name.PtrZ();
-  ret = thread->Create(name, silc_thread_start, 8192, NULL, tc);
-  if (ret != KErrNone) {
-    SILC_LOG_ERROR(("Could not create new thread, error %d", ret));
-    delete thread;
-    silc_free(tc);
-    return NULL;
-  }
-
-  /* Start the thread */
-  thread->Resume();
-
-  /* Close our instance to the thread */
-  thread->Close();
-
-  return (SilcThread)thread;
-#else
-  /* Call thread callback immediately */
-  (*start_func)(context);
-  return NULL;
-#endif
-}
-
-/* Exits current thread */
-
-void silc_thread_exit(void *exit_value)
-{
-#ifdef SILC_THREADS
-  RThread().Kill((TInt)exit_value);
-#endif
-}
-
-/* Returns current thread context */
-
-SilcThread silc_thread_self(void)
-{
-#ifdef SILC_THREADS
-  RThread thread = RThread();
-  return (SilcThread)&thread;
-#else
-  return NULL;
-#endif
-}
-
-/* Blocks calling thread to wait for `thread' to finish. */
-
-SilcBool silc_thread_wait(SilcThread thread, void **exit_value)
-{
-#ifdef SILC_THREADS
-  TRequestStatus req;
-  RThread *t = (RThread *)thread;
-  t->Logon(req);
-  User::WaitForAnyRequest();
-  return TRUE;
-#else
-  return FALSE;
-#endif
-}
-
-/* Yield processor */
-
-void silc_thread_yield(void)
-{
-#ifdef SILC_THREADS
-  User::After(1);
-#endif /* SILC_THREADS */
-}
-
-/***************************** SILC Mutex API *******************************/
-
-/* SILC Mutex structure */
-struct SilcMutexStruct {
-#ifdef SILC_THREADS
-  RMutex *mutex;
-#endif /* SILC_THREADS */
-  unsigned int locked : 1;
-};
-
-SilcBool silc_mutex_alloc(SilcMutex *mutex)
-{
-#ifdef SILC_THREADS
-  *mutex = (SilcMutex)silc_calloc(1, sizeof(**mutex));
-  if (*mutex == NULL)
-    return FALSE;
-  (*mutex)->mutex = new RMutex();
-  if (!(*mutex)->mutex) {
-    silc_free(*mutex);
-    return FALSE;
-  }
-  if ((*mutex)->mutex->CreateLocal() != KErrNone) {
-    delete (*mutex)->mutex;
-    silc_free(*mutex);
-    return FALSE;
-  }
-  (*mutex)->locked = FALSE;
-  return TRUE;
-#else
-  return FALSE;
-#endif /* SILC_THREADS */
-}
-
-void silc_mutex_free(SilcMutex mutex)
-{
-#ifdef SILC_THREADS
-  if (mutex) {
-    mutex->mutex->Close();
-    delete mutex->mutex;
-    silc_free(mutex);
-  }
-#endif /* SILC_THREADS */
-}
-
-void silc_mutex_lock(SilcMutex mutex)
-{
-#ifdef SILC_THREADS
-  if (mutex) {
-    mutex->mutex->Wait();
-    mutex->locked = TRUE;
-  }
-#endif /* SILC_THREADS */
-}
-
-void silc_mutex_unlock(SilcMutex mutex)
-{
-#ifdef SILC_THREADS
-  if (mutex) {
-    mutex->mutex->Signal();
-    mutex->locked = FALSE;
-  }
-#endif /* SILC_THREADS */
-}
-
-void silc_mutex_assert_locked(SilcMutex mutex)
-{
-#ifdef SILC_THREADS
-  if (mutex)
-    SILC_ASSERT(mutex->locked);
-#endif /* SILC_THREADS */
-}
-
-/***************************** SILC Rwlock API *****************************/
-
-/* SILC read/write lock structure */
-struct SilcRwLockStruct {
-#ifdef SILC_THREADS
-  SilcMutex mutex;
-  SilcCond cond;
-#endif /* SILC_THREADS */
-  unsigned int readers : 31;
-  unsigned int locked  : 1;
-};
-
-SilcBool silc_rwlock_alloc(SilcRwLock *rwlock)
-{
-#ifdef SILC_THREADS
-  *rwlock = (SilcRwLock)silc_calloc(1, sizeof(**rwlock));
-  if (!(*rwlock))
-    return FALSE;
-  if (!silc_mutex_alloc(&(*rwlock)->mutex)) {
-    silc_free(*rwlock);
-    return FALSE;
-  }
-  if (!silc_cond_alloc(&(*rwlock)->cond)) {
-    silc_mutex_free((*rwlock)->mutex);
-    silc_free(*rwlock);
-    return FALSE;
-  }
-  return TRUE;
-#else
-  return FALSE;
-#endif /* SILC_THREADS */
-}
-
-void silc_rwlock_free(SilcRwLock rwlock)
-{
-#ifdef SILC_THREADS
-  if (rwlock) {
-    silc_mutex_free(rwlock->mutex);
-    silc_cond_free(rwlock->cond);
-    silc_free(rwlock);
-  }
-#endif /* SILC_THREADS */
-}
-
-void silc_rwlock_rdlock(SilcRwLock rwlock)
-{
-#ifdef SILC_THREADS
-  if (rwlock) {
-    silc_mutex_lock(rwlock->mutex);
-    rwlock->readers++;
-    silc_mutex_unlock(rwlock->mutex);
-  }
-#endif /* SILC_THREADS */
-}
-
-void silc_rwlock_wrlock(SilcRwLock rwlock)
-{
-#ifdef SILC_THREADS
-  if (rwlock) {
-    silc_mutex_lock(rwlock->mutex);
-    while (rwlock->readers > 0)
-      silc_cond_wait(rwlock->cond, rwlock->mutex);
-    rwlock->locked = TRUE;
-  }
-#endif /* SILC_THREADS */
-}
-
-void silc_rwlock_unlock(SilcRwLock rwlock)
-{
-#ifdef SILC_THREADS
-  if (rwlock) {
-    if (rwlock->locked) {
-      /* Unlock writer */
-      rwlock->locked = FALSE;
-      silc_mutex_unlock(rwlock->mutex);
-      return;
-    }
-
-    /* Unlock reader */
-    silc_mutex_lock(rwlock->mutex);
-    rwlock->readers--;
-    silc_cond_broadcast(rwlock->cond);
-    silc_mutex_unlock(rwlock->mutex);
-  }
-#endif /* SILC_THREADS */
-}
-
-/****************************** SILC Cond API *******************************/
-
-/* SILC Conditional Variable context */
-struct SilcCondStruct {
-#ifdef SILC_THREADS
-  RCondVar *cond;
-#else
-  void *tmp;
-#endif /* SILC_THREADS*/
-};
-
-SilcBool silc_cond_alloc(SilcCond *cond)
-{
-#ifdef SILC_THREADS
-  *cond = (SilcCond)silc_calloc(1, sizeof(**cond));
-  if (*cond == NULL)
-    return FALSE;
-  (*cond)->cond = new RCondVar();
-  if (!(*cond)->cond) {
-    silc_free(*cond);
-    return FALSE;
-  }
-  if ((*cond)->cond->CreateLocal() != KErrNone) {
-    delete (*cond)->cond;
-    silc_free(*cond);
-    return FALSE;
-  }
-  return TRUE;
-#else
-  return FALSE;
-#endif /* SILC_THREADS*/
-}
-
-void silc_cond_free(SilcCond cond)
-{
-#ifdef SILC_THREADS
-  cond->cond->Close();
-  delete cond->cond;
-  silc_free(cond);
-#endif /* SILC_THREADS*/
-}
-
-void silc_cond_signal(SilcCond cond)
-{
-#ifdef SILC_THREADS
-  cond->cond->Signal();
-#endif /* SILC_THREADS*/
-}
-
-void silc_cond_broadcast(SilcCond cond)
-{
-#ifdef SILC_THREADS
-  cond->cond->Broadcast();
-#endif /* SILC_THREADS*/
-}
-
-void silc_cond_wait(SilcCond cond, SilcMutex mutex)
-{
-#ifdef SILC_THREADS
-  cond->cond->Wait(*mutex->mutex);
-#endif /* SILC_THREADS*/
-}
-
-SilcBool silc_cond_timedwait(SilcCond cond, SilcMutex mutex,
-                            int timeout)
-{
-#ifdef SILC_THREADS
-  TInt ret;
-  if (timeout) {
-    ret = cond->cond->TimedWait(*mutex->mutex, (TInt)timeout * 1000);
-    if (ret != KErrNone)
-      SILC_LOG_DEBUG(("TimedWait returned %d", ret));
-    return ret != KErrTimedOut;
-  }
-  return (cond->cond->Wait(*mutex->mutex) == KErrNone);
-#else
-  return FALSE;
-#endif /* SILC_THREADS*/
-}
-
-} /* extern "C" */
diff --git a/lib/silcutil/symbian/silcsymbianutil.cpp b/lib/silcutil/symbian/silcsymbianutil.cpp
deleted file mode 100644 (file)
index 691ec67..0000000
+++ /dev/null
@@ -1,99 +0,0 @@
-/*
-
-  silcsymbianutil.cpp
-
-  Author: Pekka Riikonen <priikone@silcnet.org>
-
-  Copyright (C) 2006 - 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.
-
-*/
-
-#include "silc.h"
-#include <e32std.h>
-#include <e32svr.h>
-
-extern "C" {
-
-/* Returns the username of the user. */
-
-char *silc_get_username()
-{
-#if 0
-  char *logname = NULL;
-
-  logname = getlogin();
-  if (!logname) {
-    struct passwd *pw;
-
-    pw = getpwuid(getuid());
-    if (!pw)
-      return strdup("User");
-
-    logname = pw->pw_name;
-  }
-
-  return strdup(logname);
-#else
-  return strdup("Symbian");
-#endif /* 0 */
-}
-
-/* Returns the real name of ther user. */
-
-char *silc_get_real_name()
-{
-#if 0
-  char *realname = NULL;
-  struct passwd *pw;
-
-  pw = getpwuid(getuid());
-  if (!pw)
-    return strdup("No Name");
-
-  if (strchr(pw->pw_gecos, ','))
-    *strchr(pw->pw_gecos, ',') = 0;
-
-  if (!strlen(pw->pw_gecos))
-    return strdup("No Name");
-
-  realname = strdup(pw->pw_gecos);
-
-  return realname;
-#else
-  return strdup("Lastname");
-#endif /* 0 */
-}
-
-/* Return current time to struct timeval. */
-
-int silc_gettimeofday(struct timeval *p)
-{
-  return gettimeofday(p, NULL);
-}
-
-int silc_file_set_nonblock(int fd)
-{
-  return 0;
-}
-
-void silc_symbian_usleep(long microseconds)
-{
-  User::After(microseconds / 1000);
-}
-
-void silc_symbian_debug(const char *function, int line, char *string)
-{
-  fprintf(stderr, "%s:%d: %s\n", function, line, string);
-  // RDebug::Print(_L("%s:%d: %s"), function, line, string);
-}
-
-} /* extern "C" */
diff --git a/lib/silcutil/tests/Makefile.am b/lib/silcutil/tests/Makefile.am
deleted file mode 100644 (file)
index f08893d..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-#
-#  Makefile.am
-#
-#  Author: Pekka Riikonen <priikone@silcnet.org>
-#
-#  Copyright (C) 2004 - 2005 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.
-#
-
-AUTOMAKE_OPTIONS = 1.0 no-dependencies foreign
-
-bin_PROGRAMS =         test_silcstrutil test_silcstringprep test_silchashtable \
-       test_silclist test_silcfsm test_silcasync test_silcschedule \
-       test_silcnet test_silcstack test_silcmime test_silcfdstream \
-       test_silcatomic test_silcmutex test_silctime
-
-test_silcstrutil_SOURCES = test_silcstrutil.c
-test_silcstringprep_SOURCES = test_silcstringprep.c
-test_silchashtable_SOURCES = test_silchashtable.c
-test_silclist_SOURCES = test_silclist.c
-test_silcmime_SOURCES = test_silcmime.c
-test_silcfsm_SOURCES = test_silcfsm.c
-test_silcasync_SOURCES = test_silcasync.c
-test_silcschedule_SOURCES = test_silcschedule.c
-test_silcnet_SOURCES = test_silcnet.c
-test_silcstack_SOURCES = test_silcstack.c
-test_silcfdstream_SOURCES = test_silcfdstream.c
-test_silcatomic_SOURCES = test_silcatomic.c
-test_silcmutex_SOURCES = test_silcmutex.c
-test_silctime_SOURCES = test_silctime.c
-
-LIBS = $(SILC_COMMON_LIBS)
-LDADD = -L.. -L../.. -lsilc
-
-include $(top_srcdir)/Makefile.defines.in
diff --git a/lib/silcutil/tests/test_silcasync.c b/lib/silcutil/tests/test_silcasync.c
deleted file mode 100644 (file)
index ca68c7d..0000000
+++ /dev/null
@@ -1,158 +0,0 @@
-/* SilcAsyncOperation tests */
-
-#include "silc.h"
-#include "silcfsm.h"
-#include "silcasync.h"
-
-typedef void (*Callback)(void *context);
-
-SilcSchedule schedule;
-
-typedef struct {
-  SilcFSM fsm;
-  SilcFSMEventStruct sema;
-  SilcAsyncOperation op;
-  Callback cb;
-  void *cb_context;
-  SilcBool aborted;
-} *Foo;
-
-SILC_FSM_STATE(test_st_start);
-SILC_FSM_STATE(test_st_second);
-SILC_FSM_STATE(test_st_finish);
-
-SILC_TASK_CALLBACK(async_call_timeout)
-{
-  Foo f = context;
-  SILC_LOG_DEBUG(("******Async call cb, continuing FSM"));
-  silc_async_free(f->op);
-  f->cb(f->cb_context);
-}
-
-static void async_abort(SilcAsyncOperation op, void *context)
-{
-  Foo f = context;
-  SILC_LOG_DEBUG(("Async operation aborted"));
-  silc_schedule_task_del_by_context(schedule, f);
-  silc_schedule_task_del_by_callback(schedule, async_call_timeout);
-  f->aborted = TRUE;
-}
-
-static SilcAsyncOperation async_call(Callback cb, void *context)
-{
-  Foo f = context;
-
-  SILC_LOG_DEBUG(("Async call"));
-
-  f->cb = cb;
-  f->cb_context = context;
-  f->op = silc_async_alloc(async_abort, NULL, f);
-
-  silc_schedule_task_add(schedule, 0, async_call_timeout, f, 2, 1,
-                        SILC_TASK_TIMEOUT);
-
-  return f->op;
-}
-
-static void async_call_cb(void *context)
-{
-  Foo f = context;
-  SILC_LOG_DEBUG(("*******Callback, signal and continue to next state"));
-  f->op = NULL;
-  SILC_FSM_EVENT_SIGNAL(&f->sema);
-  SILC_FSM_CALL_CONTINUE(f->fsm);
-}
-
-SILC_FSM_STATE(test_st_start)
-{
-  Foo f = fsm_context;
-
-  SILC_LOG_DEBUG(("test_st_start"));
-
-  silc_fsm_event_init(&f->sema, fsm);
-
-  /** Wait async callback */
-  SILC_LOG_DEBUG(("Call async call"));
-  silc_fsm_next_later(fsm, test_st_second, 1, 0);
-  SILC_FSM_CALL((f->op = async_call(async_call_cb, f)));
-}
-
-SILC_FSM_STATE(test_st_second)
-{
-  Foo f = fsm_context;
-  SilcBool timedout;
-
-  SILC_LOG_DEBUG(("test_st_second"));
-
-  SILC_FSM_EVENT_TIMEDWAIT(&f->sema, 0, 1, &timedout);
-
-  if (timedout == TRUE) {
-    SILC_LOG_DEBUG(("Sema timedout, aborting async operation"));
-    if (f->op)
-      silc_async_abort(f->op, NULL, NULL);
-  }
-
-  /** Finish */
-  silc_fsm_next_later(fsm, test_st_finish, 2, 0);
-  return SILC_FSM_WAIT;
-}
-
-SILC_FSM_STATE(test_st_finish)
-{
-  SILC_LOG_DEBUG(("test_st_finish"));
-
-  SILC_LOG_DEBUG(("Finish machine"));
-  return SILC_FSM_FINISH;
-}
-
-static void destructor(SilcFSM fsm, void *fsm_context,
-                      void *destructor_context)
-{
-  SILC_LOG_DEBUG(("FSM destructor, stopping scheduler"));
-  silc_fsm_free(fsm);
-  silc_schedule_stop(schedule);
-}
-
-int main(int argc, char **argv)
-{
-  SilcBool success = FALSE;
-  SilcFSM fsm;
-  Foo f;
-
-  if (argc > 1 && !strcmp(argv[1], "-d")) {
-    silc_log_debug(TRUE);
-    silc_log_debug_hexdump(TRUE);
-    silc_log_set_debug_string("*async*");
-  }
-
-  SILC_LOG_DEBUG(("Allocating scheduler"));
-  schedule = silc_schedule_init(0, NULL);
-
-  f = silc_calloc(1, sizeof(*f));
-  if (!f)
-    goto err;
-
-  SILC_LOG_DEBUG(("Allocating FSM context"));
-  fsm = silc_fsm_alloc(f, destructor, NULL, schedule);
-  if (!fsm)
-    goto err;
-  silc_fsm_start(fsm, test_st_start);
-  f->fsm = fsm;
-
-  SILC_LOG_DEBUG(("Running scheduler"));
-  silc_schedule(schedule);
-
-  if (!f->aborted)
-    goto err;
-
-  silc_schedule_uninit(schedule);
-  silc_free(f);
-
-  success = TRUE;
-
- err:
-  SILC_LOG_DEBUG(("Testing was %s", success ? "SUCCESS" : "FAILURE"));
-  fprintf(stderr, "Testing was %s\n", success ? "SUCCESS" : "FAILURE");
-
-  return success;
-}
diff --git a/lib/silcutil/tests/test_silcatomic.c b/lib/silcutil/tests/test_silcatomic.c
deleted file mode 100644 (file)
index 23105f4..0000000
+++ /dev/null
@@ -1,119 +0,0 @@
-/* atomic operation tests */
-
-#include "silc.h"
-#include "silcatomic.h"
-
-int main(int argc, char **argv)
-{
-  SilcBool success = FALSE;
-  SilcAtomic32 ref32;
-  SilcAtomic16 ref16;
-  SilcAtomic8 ref8;
-  SilcAtomicPointer refptr;
-  SilcUInt8 ret8;
-  SilcUInt16 ret16;
-  SilcUInt32 ret32;
-
-  if (argc > 1 && !strcmp(argv[1], "-d")) {
-    silc_log_debug(TRUE);
-    silc_log_debug_hexdump(TRUE);
-    silc_log_set_debug_string("*atomic*");
-  }
-
-  silc_atomic_init8(&ref8, 1);
-  silc_atomic_init16(&ref16, 1);
-  silc_atomic_init32(&ref32, 1);
-  silc_atomic_init_pointer(&refptr, SILC_32_TO_PTR(0xdeadbeef));
-
-  ret8 = silc_atomic_add_int8(&ref8, 7);
-  SILC_LOG_DEBUG(("ref8: 1 + 7 = %d (8)", ret8));
-  ret8 = silc_atomic_add_int8(&ref8, 3);
-  SILC_LOG_DEBUG(("ref8: 8 + 3 = %d (11)", ret8));
-  ret8 = silc_atomic_sub_int8(&ref8, 10);
-  SILC_LOG_DEBUG(("ref8: 11 - 10 = %d (1)", ret8));
-
-  ret16 = silc_atomic_add_int16(&ref16, 1);
-  SILC_LOG_DEBUG(("ref16: 1 + 1 = %d (2)", ret16));
-  ret16 = silc_atomic_add_int16(&ref16, 31020);
-  SILC_LOG_DEBUG(("ref16: 2 + 31020 = %d (31022)", ret16));
-  ret16 = silc_atomic_add_int16(&ref16, 34000);
-  SILC_LOG_DEBUG(("ref16: 31022 + 34000 = %d (65022)", ret16));
-  ret16 = silc_atomic_sub_int16(&ref16, 0);
-  SILC_LOG_DEBUG(("ref16: 65022 - 0 = %d (65022)", ret16));
-  ret16 = silc_atomic_sub_int16(&ref16, (SilcInt16)0xffff);
-  SILC_LOG_DEBUG(("ref16: 65022 - 0xffff = %d (65023) (underflow)", ret16));
-
-  SILC_LOG_DEBUG(("Current value: %d (-513)",
-                 (SilcInt16)silc_atomic_get_int16(&ref16)));
-
-  SILC_LOG_DEBUG(("Swapping -513 with 57392"));
-  if (!silc_atomic_cas16(&ref16, silc_atomic_get_int16(&ref16), 57392))
-    goto err;
-  SILC_LOG_DEBUG(("Current value: %d (57392)",
-                 silc_atomic_get_int16(&ref16)));
-  SILC_LOG_DEBUG(("Swapping 57392 with -500"));
-  if (!silc_atomic_cas16(&ref16, silc_atomic_get_int16(&ref16), -500))
-    goto err;
-  SILC_LOG_DEBUG(("Current value: %d (-500)",
-                 (SilcInt16)silc_atomic_get_int16(&ref16)));
-
-  ret32 = silc_atomic_add_int32(&ref32, 1);
-  SILC_LOG_DEBUG(("ref32: 1 + 1 = %d (2)", ret32));
-  ret32 = silc_atomic_add_int32(&ref32, 310200);
-  SILC_LOG_DEBUG(("ref32: 2 + 310200 = %d (310202)", ret32));
-  ret32 = silc_atomic_add_int32(&ref32, 34000000);
-  SILC_LOG_DEBUG(("ref32: 310202 + 34000000 = %d (34310202)", ret32));
-  ret32 = silc_atomic_sub_int32(&ref32, 0);
-  SILC_LOG_DEBUG(("ref32: 34310202 - 0 = %d (34310202)", ret32));
-  ret32 = silc_atomic_sub_int32(&ref32, 0xfffffff);
-  SILC_LOG_DEBUG(("ref32: 34310202 - 0xfffffff = %d (-234125253) "
-                 "(underflow)", ret32));
-
-  SILC_LOG_DEBUG(("Current value: %d (-234125253)",
-                 silc_atomic_get_int32(&ref32)));
-
-  SILC_LOG_DEBUG(("Swapping -234125253 with 76327681"));
-  if (!silc_atomic_cas32(&ref32, silc_atomic_get_int32(&ref32), 76327681))
-    goto err;
-  SILC_LOG_DEBUG(("Current value: %d (76327681)",
-                 silc_atomic_get_int32(&ref32)));
-
-  SILC_LOG_DEBUG(("Current ptr: %p (0xdeadbeef)",
-                 silc_atomic_get_pointer(&refptr)));
-  SILC_LOG_DEBUG(("Swapping %p with NULL", silc_atomic_get_pointer(&refptr)));
-  if (!silc_atomic_cas_pointer(&refptr,
-                              silc_atomic_get_pointer(&refptr), NULL))
-    goto err;
-  SILC_LOG_DEBUG(("Current ptr: %p (NULL)",
-                 silc_atomic_get_pointer(&refptr)));
-
-  SILC_LOG_DEBUG(("Setting val 34322111 (32-bit)"));
-  silc_atomic_set_int32(&ref32, 34322111);
-  if (silc_atomic_get_int32(&ref32) != 34322111)
-    goto err;
-  SILC_LOG_DEBUG(("Setting val 1432211119 (32-bit)"));
-  silc_atomic_set_int32(&ref32, 1432211119);
-  if (silc_atomic_get_int32(&ref32) != 1432211119)
-    goto err;
-  SILC_LOG_DEBUG(("Setting val 23422 (16-bit)"));
-  silc_atomic_set_int16(&ref16, 23422);
-  if (silc_atomic_get_int16(&ref16) != 23422)
-    goto err;
-  SILC_LOG_DEBUG(("Setting val 124 (8-bit)"));
-  silc_atomic_set_int8(&ref8, 124);
-  if (silc_atomic_get_int8(&ref8) != 124)
-    goto err;
-
-  silc_atomic_uninit8(&ref8);
-  silc_atomic_uninit16(&ref16);
-  silc_atomic_uninit32(&ref32);
-  silc_atomic_uninit_pointer(&refptr);
-
-  success = TRUE;
-
- err:
-  SILC_LOG_DEBUG(("Testing was %s", success ? "SUCCESS" : "FAILURE"));
-  fprintf(stderr, "Testing was %s\n", success ? "SUCCESS" : "FAILURE");
-
-  return success;
-}
diff --git a/lib/silcutil/tests/test_silcfdstream.c b/lib/silcutil/tests/test_silcfdstream.c
deleted file mode 100644 (file)
index e4d53a5..0000000
+++ /dev/null
@@ -1,231 +0,0 @@
-/* SILC FD Stream tests */
-
-#include "silc.h"
-
-SilcBool success = FALSE;
-SilcSchedule schedule;
-SilcStream stream;
-char buf1[10240];
-int buf1_len = sizeof(buf1);
-
-static void stream_notifier(SilcStream stream, SilcStreamStatus status,
-                           void *context)
-{
-  SILC_LOG_DEBUG(("Notifier"));
-
-  /* XXX we probably never get here with this test program */
-
-  silc_fsm_continue(context);
-}
-
-static void stream_notifier2(SilcStream stream, SilcStreamStatus status,
-                            void *context)
-{
-  SILC_LOG_DEBUG(("Notifier"));
-
-  /* XXX we probably never get here with this test program */
-
-  silc_fsm_continue(context);
-}
-
-SILC_FSM_STATE(st_end)
-{
-  unlink("/tmp/test_silcfdstream");
-  unlink("/tmp/test_silcfdstream_copy");
-  return SILC_FSM_FINISH;
-}
-
-SILC_FSM_STATE(st_readwrite)
-{
-  int ret, i, k, fd1, fd2;
-  char *cp;
-
-  SILC_LOG_DEBUG(("Opening two files, one for reading, one for writing"));
-
-  SILC_LOG_DEBUG(("Open file /tmp/test_silcfdstream for reading"));
-  fd1 = silc_file_open("/tmp/test_silcfdstream", O_RDONLY);
-  if (fd1 < 0) {
-    SILC_LOG_DEBUG(("Error opening file"));
-    goto err;
-  }
-
-  SILC_LOG_DEBUG(("Open file /tmp/test_silcfdstream_copy for writing"));
-  unlink("/tmp/test_silcfdstream_copy");
-  fd2 = silc_file_open("/tmp/test_silcfdstream_copy", O_CREAT | O_WRONLY);
-  if (fd2 < 0) {
-    SILC_LOG_DEBUG(("Error opening file"));
-    goto err;
-  }
-
-  SILC_LOG_DEBUG(("Creating FD stream (two fds)"));
-  stream = silc_fd_stream_create2(fd1, fd2);
-  if (!stream) {
-    SILC_LOG_DEBUG(("Error creating stream"));
-    goto err;
-  }
-
-  silc_stream_set_notifier(stream, schedule, stream_notifier2, fsm);
-
-  /* Stream between the fiels */
-  SILC_LOG_DEBUG(("Read/write 3 bytes at a time"));
-  memset(buf1, 0, sizeof(buf1));
-  while ((ret = silc_stream_read(stream, buf1, 3)) > 0) {
-    k = ret;
-    cp = buf1;
-    while (k > 0) {
-      i = silc_stream_write(stream, cp, k);
-
-      if (i == 0) {
-        SILC_LOG_DEBUG(("EOF"));
-        goto err;
-      }
-
-      if (i == -1) {
-        SILC_LOG_DEBUG(("Would block, write later"));
-        silc_fsm_next(fsm, st_end);
-        return SILC_FSM_WAIT;
-      }
-
-      if (i == -2) {
-        SILC_LOG_DEBUG(("Error: %s", strerror(silc_fd_stream_get_error(stream))));
-        goto err;
-      }
-
-      k -= i;
-      cp += i;
-    }
-  }
-
-  if (ret == -1) {
-    SILC_LOG_DEBUG(("Would block, read later"));
-    silc_fsm_next(fsm, st_end);
-    return SILC_FSM_WAIT;
-  }
-
-  if (ret == -2) {
-    SILC_LOG_DEBUG(("Error: %s", strerror(silc_fd_stream_get_error(stream))));
-    goto err;
-  }
-
-  if (ret == 0) {
-    SILC_LOG_DEBUG(("EOF, ok"));
-    success = TRUE;
-    SILC_LOG_DEBUG(("Closing stream"));
-    silc_stream_close(stream);
-    SILC_LOG_DEBUG(("Destroying stream"));
-    silc_stream_destroy(stream);
-  }
-
-  silc_fsm_next(fsm, st_end);
-  return SILC_FSM_CONTINUE;
-
- err:
-  silc_fsm_next(fsm, st_end);
-  return SILC_FSM_CONTINUE;
-}
-
-SILC_FSM_STATE(st_write)
-{
-  int ret, i, k;
-  char *cp;
-
-  /* Simple writing example */
-  SILC_LOG_DEBUG(("Open file /tmp/test_silcfdstream for writing"));
-  SILC_LOG_DEBUG(("Creating FD stream"));
-  unlink("/tmp/test_silcfdstream");
-  stream = silc_fd_stream_file("/tmp/test_silcfdstream", FALSE, TRUE);
-  if (!stream) {
-    SILC_LOG_DEBUG(("Error creating stream"));
-    goto err;
-  }
-
-  silc_stream_set_notifier(stream, schedule, stream_notifier, fsm);
-
-  memset(buf1, 0, sizeof(buf1));
-  for (i = 0; i < sizeof(buf1); i++)
-    buf1[i] = i;
-
-  SILC_LOG_DEBUG(("Writing data"));
-  k = buf1_len;
-  cp = buf1;
-  while (k > 0) {
-    ret = silc_stream_write(stream, cp, k);
-
-    if (ret == 0) {
-      SILC_LOG_DEBUG(("EOF"));
-      goto err;
-    }
-
-    if (ret == -1) {
-      SILC_LOG_DEBUG(("Would block, write later"));
-      silc_fsm_next(fsm, st_readwrite);
-      return SILC_FSM_WAIT;
-    }
-
-    if (ret == -2) {
-      SILC_LOG_DEBUG(("Error: %s", strerror(silc_fd_stream_get_error(stream))));
-      goto err;
-    }
-
-    k -= ret;
-    cp += ret;
-  }
-
-  SILC_LOG_DEBUG(("Closing stream"));
-  silc_stream_close(stream);
-
-  SILC_LOG_DEBUG(("Destroying stream"));
-  silc_stream_destroy(stream);
-
-  SILC_LOG_DEBUG(("Continue to next state"));
-  silc_fsm_next(fsm, st_readwrite);
-  return SILC_FSM_CONTINUE;
-
- err:
-  silc_fsm_next(fsm, st_end);
-  return SILC_FSM_CONTINUE;
-}
-
-static void fsm_dest(SilcFSM fsm, void *fsm_context, void *context)
-{
-  silc_fsm_free(fsm);
-  silc_schedule_stop(schedule);
-}
-
-int main(int argc, char **argv)
-{
-  SilcFSM fsm;
-
-  if (argc > 1 && !strcmp(argv[1], "-d")) {
-    silc_log_debug(TRUE);
-    silc_log_debug_hexdump(TRUE);
-    silc_log_set_debug_string("*fdstream*");
-  }
-
-  SILC_LOG_DEBUG(("Allocating scheduler"));
-  schedule = silc_schedule_init(0, NULL);
-  if (!schedule)
-    goto err;
-
-  SILC_LOG_DEBUG(("Allocating FSM"));
-  fsm = silc_fsm_alloc(NULL, fsm_dest, NULL, schedule);
-  if (!fsm)
-    goto err;
-
-  silc_fsm_start(fsm, st_write);
-
-  SILC_LOG_DEBUG(("Running scheduler"));
-  silc_schedule(schedule);
-
-  if (!success)
-    goto err;
-
-  silc_schedule_uninit(schedule);
-  success = TRUE;
-
- err:
-  SILC_LOG_DEBUG(("Testing was %s", success ? "SUCCESS" : "FAILURE"));
-  fprintf(stderr, "Testing was %s\n", success ? "SUCCESS" : "FAILURE");
-
-  return success;
-}
diff --git a/lib/silcutil/tests/test_silcfsm.c b/lib/silcutil/tests/test_silcfsm.c
deleted file mode 100644 (file)
index f041630..0000000
+++ /dev/null
@@ -1,486 +0,0 @@
-/* SILC FSM tests */
-
-#include "silc.h"
-#include "silcfsm.h"
-
-typedef void (*Callback)(void *context);
-
-#define NUM_THREADS 200
-
-typedef struct FooStruct *Foo;
-
-typedef struct {
-  SilcFSMThreadStruct thread;
-  SilcFSMEventStruct sema;
-  SilcBool finished;
-  int rounds;
-  Foo f;
-} T;
-
-struct FooStruct {
-  SilcBool error;
-  SilcFSM fsm;
-  SilcFSMThreadStruct thread;
-  int timeout;
-  SilcFSMEventStruct sema;
-  SilcFSMEventStruct wait2;
-  SilcSchedule schedule;
-  Callback cb;
-  void *cb_context;
-  T threads[NUM_THREADS];
-  T threads2[NUM_THREADS];
-  int c;
-  int got_wait1 : 1;
-  int got_wait2 : 1;
-};
-
-SILC_FSM_STATE(test_st_start);
-SILC_FSM_STATE(test_st_second);
-SILC_FSM_STATE(test_st_second_timeout);
-SILC_FSM_STATE(test_st_third);
-SILC_FSM_STATE(test_st_fourth);
-SILC_FSM_STATE(test_st_fifth);
-SILC_FSM_STATE(test_st_sixth);
-SILC_FSM_STATE(test_st_seventh);
-SILC_FSM_STATE(test_st_eighth);
-SILC_FSM_STATE(test_st_ninth);
-SILC_FSM_STATE(test_st_tenth);
-SILC_FSM_STATE(test_st_finish);
-
-SILC_FSM_STATE(test_st_wait1);
-SILC_FSM_STATE(test_st_wait2);
-SILC_FSM_STATE(test_st_signal1);
-SILC_FSM_STATE(test_st_signal1_check);
-
-SILC_FSM_STATE(test_thread_st_start);
-SILC_FSM_STATE(test_thread_st_finish);
-SILC_FSM_STATE(test_thread2_st_start);
-SILC_FSM_STATE(test_thread2_st_finish);
-SILC_FSM_STATE(test_thread3_st_start);
-SILC_FSM_STATE(test_thread4_st_start);
-
-static void test_fsm_destr(SilcFSMThread thread, void *thread_context,
-                          void *user_context)
-{
-  silc_fsm_free(thread);
-}
-
-SILC_TASK_CALLBACK(async_call_timeout)
-{
-  Foo f = context;
-  SILC_LOG_DEBUG(("Async call cb, continuing FSM"));
-  f->cb(f->cb_context);
-}
-
-static void async_call(Callback cb, void *context)
-{
-  Foo f = context;
-  f->cb = cb;
-  f->cb_context = context;
-  SILC_LOG_DEBUG(("Async call"));
-  silc_schedule_task_add(f->schedule, 0, async_call_timeout, f, 0, 200000,
-                        SILC_TASK_TIMEOUT);
-}
-
-SILC_FSM_STATE(test_st_start)
-{
-  SILC_LOG_DEBUG(("test_st_start"));
-
-  /** Move to second state */
-  SILC_LOG_DEBUG(("Move to next state"));
-  silc_fsm_next(fsm, test_st_second);
-  return SILC_FSM_CONTINUE;
-}
-
-SILC_FSM_STATE(test_st_second)
-{
-  SILC_LOG_DEBUG(("test_st_second"));
-
-  /** Move to second timeout state, timeout */
-  SILC_LOG_DEBUG(("Move to next state with 2 second timeout"));
-  silc_fsm_next_later(fsm, test_st_second_timeout, 2, 0);
-  return SILC_FSM_WAIT;
-}
-
-SILC_TASK_CALLBACK(test_second_timeout)
-{
-  Foo f = context;
-  SILC_LOG_DEBUG(("test_second_timeout"));
-
-  SILC_LOG_DEBUG(("Interrupt 3 second wait and continue immediately"));
-  f->c++;
-  silc_fsm_next(f->fsm, test_st_third);
-  silc_fsm_continue(f->fsm);
-}
-
-SILC_FSM_STATE(test_st_second_timeout)
-{
-  Foo f = fsm_context;
-
-  SILC_LOG_DEBUG(("test_st_second_timeout"));
-
-  /** Move to third state, timeout */
-  SILC_LOG_DEBUG(("Move to next state with 3 second timeout"));
-  SILC_LOG_DEBUG(("The timeout will be interrupted with silc_fsm_continue"));
-  silc_fsm_next_later(fsm, test_st_third, 3, 0);
-  silc_schedule_task_add_timeout(silc_fsm_get_schedule(fsm),
-                                test_second_timeout, f, 2, 500000);
-  return SILC_FSM_WAIT;
-}
-
-static void async_call_cb(void *context)
-{
-  Foo f = context;
-  SILC_LOG_DEBUG(("Callback, continue to next state"));
-  SILC_FSM_CALL_CONTINUE(f->fsm);
-}
-
-SILC_FSM_STATE(test_st_third)
-{
-  Foo f = fsm_context;
-
-  SILC_LOG_DEBUG(("test_st_third"));
-
-  f->c++;
-  assert(f->c == 2);
-
-  f->fsm = fsm;
-
-  /** Wait async callback*/
-  SILC_LOG_DEBUG(("Call async call"));
-  silc_fsm_next(fsm, test_st_fourth);
-  SILC_FSM_CALL(async_call(async_call_cb, f));
-}
-
-SILC_FSM_STATE(test_st_fourth)
-{
-  Foo f = fsm_context;
-  SilcFSMThread t;
-
-  SILC_LOG_DEBUG(("test_st_fourth"));
-
-  f->timeout = 1;
-
-  SILC_LOG_DEBUG(("Creating FSM thread"));
-  silc_fsm_thread_init(&f->thread, fsm, f, NULL, NULL, FALSE);
-  SILC_LOG_DEBUG(("Starting thread"));
-  /*** Start thread */
-  silc_fsm_start(&f->thread, test_thread_st_start);
-
-  SILC_LOG_DEBUG(("Creating two waiting threads"));
-  silc_fsm_event_init(&f->wait2, fsm);
-  t = silc_fsm_thread_alloc(fsm, f, test_fsm_destr, NULL, FALSE);
-  silc_fsm_start(t, test_st_wait1);
-  t = silc_fsm_thread_alloc(fsm, f, test_fsm_destr, NULL, FALSE);
-  silc_fsm_start(t, test_st_wait2);
-
-  SILC_LOG_DEBUG(("Create signaller thread"));
-  t = silc_fsm_thread_alloc(fsm, f, test_fsm_destr, NULL, FALSE);
-  silc_fsm_start(t, test_st_signal1);
-
-  /** Waiting thread to terminate */
-  SILC_LOG_DEBUG(("Waiting for thread to terminate"));
-  silc_fsm_next(fsm, test_st_fifth);
-  SILC_FSM_THREAD_WAIT(&f->thread);
-}
-
-SILC_FSM_STATE(test_st_wait1)
-{
-  Foo f = fsm_context;
-
-  SILC_LOG_DEBUG(("Waiter 1"));
-  SILC_FSM_EVENT_WAIT(&f->wait2);
-  SILC_LOG_DEBUG(("Waiter 1 signalled"));
-  f->got_wait1 = 1;
-  return SILC_FSM_FINISH;
-}
-
-SILC_FSM_STATE(test_st_wait2)
-{
-  Foo f = fsm_context;
-
-  SILC_LOG_DEBUG(("Waiter 2"));
-  SILC_FSM_EVENT_WAIT(&f->wait2);
-  SILC_LOG_DEBUG(("Waiter 2 signalled"));
-  f->got_wait2 = 1;
-  return SILC_FSM_FINISH;
-}
-
-SILC_FSM_STATE(test_st_signal1)
-{
-  Foo f = fsm_context;
-
-  SILC_LOG_DEBUG(("Signaller 1"));
-  SILC_FSM_EVENT_SIGNAL(&f->wait2);
-  silc_fsm_next_later(fsm, test_st_signal1_check, 0, 500000); 
-  return SILC_FSM_WAIT;;
-}
-
-SILC_FSM_STATE(test_st_signal1_check)
-{
-  Foo f = fsm_context;
-
-  SILC_LOG_DEBUG(("Signal check"));
-  assert(f->got_wait1 && f->got_wait2);
-  return SILC_FSM_FINISH;
-}
-
-SILC_FSM_STATE(test_thread_st_start)
-{
-  Foo f = fsm_context;
-
-  SILC_LOG_DEBUG(("test_thread_st_start"));
-
-  /** Move to final state, timeout */
-  SILC_LOG_DEBUG(("Move to final state with %d second timeout", f->timeout));
-  silc_fsm_next_later(fsm, test_thread_st_finish, f->timeout, 0);
-  return SILC_FSM_WAIT;
-}
-
-SILC_FSM_STATE(test_thread_st_finish)
-{
-  SILC_LOG_DEBUG(("test_thread_st_finish"));
-
-  SILC_LOG_DEBUG(("Finishing the thread"));
-  return SILC_FSM_FINISH;
-}
-
-SILC_FSM_STATE(test_st_fifth)
-{
-  Foo f = fsm_context;
-  SILC_LOG_DEBUG(("test_st_fifth"));
-
-  SILC_LOG_DEBUG(("Thread terminated, start new real thread"));
-
-  f->timeout = 7;
-
-  SILC_LOG_DEBUG(("Creating FSM event"));
-  silc_fsm_event_init(&f->sema, fsm);
-
-  SILC_LOG_DEBUG(("Creating FSM thread"));
-  silc_fsm_thread_init(&f->thread, fsm, f, NULL, NULL, TRUE);
-  SILC_LOG_DEBUG(("Starting thread"));
-  silc_fsm_start(&f->thread, test_thread2_st_start);
-
-  /** Waiting thread to terminate, timeout */
-  SILC_LOG_DEBUG(("Waiting for thread to terminate for 5 seconds"));
-  silc_fsm_next(fsm, test_st_sixth);
-  SILC_FSM_EVENT_TIMEDWAIT(&f->sema, 5, 0, NULL);
-  return SILC_FSM_CONTINUE;
-}
-
-SILC_FSM_STATE(test_thread2_st_start)
-{
-  Foo f = fsm_context;
-
-  SILC_LOG_DEBUG(("test_thread2_st_start"));
-
-  /** Move to final state, timeout */
-  SILC_LOG_DEBUG(("Move to final state with %d second timeout", f->timeout));
-  silc_fsm_next_later(fsm, test_thread2_st_finish, f->timeout, 0);
-  return SILC_FSM_WAIT;
-}
-
-SILC_FSM_STATE(test_thread2_st_finish)
-{
-  Foo f = fsm_context;
-  SILC_LOG_DEBUG(("test_thread2_st_finish"));
-
-  SILC_LOG_DEBUG(("Post semaphore"));
-  SILC_FSM_EVENT_SIGNAL(&f->sema);
-
-  SILC_LOG_DEBUG(("Finishing the thread"));
-  return SILC_FSM_FINISH;
-}
-
-SILC_FSM_STATE(test_st_sixth)
-{
-  SILC_LOG_DEBUG(("test_st_sixth"));
-
-  SILC_LOG_DEBUG(("Thread wait timedout, OK"));
-
-  /** Move to next state, timeout */
-  SILC_LOG_DEBUG(("Continue to next state with 4 second timeout"));
-  silc_fsm_next_later(fsm, test_st_seventh, 4, 0);
-  return SILC_FSM_WAIT;
-}
-
-SILC_FSM_STATE(test_thread3_st_start)
-{
-  T *t = fsm_context;
-
-  if (t->rounds == 0) {
-    SILC_FSM_EVENT_SIGNAL(&t->sema);
-    return SILC_FSM_FINISH;
-  }
-
-  t->rounds--;
-
-  /** Call in recursive */
-  silc_fsm_next(fsm, test_thread3_st_start);
-  return SILC_FSM_CONTINUE;
-}
-
-SILC_FSM_STATE(test_st_seventh)
-{
-  Foo f = fsm_context;
-  int i;
-
-  SILC_LOG_DEBUG(("test_st_seventh"));
-
-
-  SILC_LOG_DEBUG(("Creating %d FSM threads", NUM_THREADS));
-  for (i = 0; i < NUM_THREADS; i++) {
-    f->threads[i].rounds = 10;
-    f->threads[i].f = f;
-    silc_fsm_event_init(&f->threads[i].sema, fsm);
-    silc_fsm_thread_init(&f->threads[i].thread, fsm,
-                        &f->threads[i], NULL, NULL, FALSE);
-    silc_fsm_start(&f->threads[i].thread, test_thread3_st_start);
-  }
-
-  /** Move to wait threads */
-  silc_fsm_next(fsm, test_st_eighth);
-  return SILC_FSM_CONTINUE;
-}
-
-SILC_FSM_STATE(test_st_eighth)
-{
-  Foo f = fsm_context;
-  int i;
-
-  for (i = 0; i < NUM_THREADS; i++) {
-    if (f->threads[i].finished == FALSE) {
-      SILC_FSM_EVENT_WAIT(&f->threads[i].sema);
-      f->threads[i].finished = TRUE;
-    }
-  }
-
-  SILC_LOG_DEBUG(("All %d threads terminated", NUM_THREADS));
-
-  /** Move to next thread */
-  silc_fsm_next(fsm, test_st_ninth);
-  return SILC_FSM_CONTINUE;
-}
-
-SILC_FSM_STATE(test_thread4_st_start)
-{
-  T *t = fsm_context;
-
-  if (t->rounds == 0) {
-    SILC_FSM_EVENT_SIGNAL(&t->sema);
-    return SILC_FSM_FINISH;
-  }
-
-  t->rounds--;
-
-  /** Call in recursive */
-  silc_fsm_next(fsm, test_thread4_st_start);
-  return SILC_FSM_CONTINUE;
-}
-
-SILC_FSM_STATE(test_st_ninth)
-{
-  Foo f = fsm_context;
-  int i;
-
-  SILC_LOG_DEBUG(("test_st_ninth"));
-
-  SILC_LOG_DEBUG(("Creating FSM event"));
-  silc_fsm_event_init(&f->sema, fsm);
-
-  SILC_LOG_DEBUG(("Creating %d real FSM threads", NUM_THREADS));
-  for (i = 0; i < NUM_THREADS; i++) {
-    f->threads2[i].rounds = 10;
-    f->threads2[i].f = f;
-    silc_fsm_event_init(&f->threads2[i].sema, fsm);
-    silc_fsm_thread_init(&f->threads2[i].thread, fsm,
-                        &f->threads2[i], NULL, NULL, TRUE);
-    silc_fsm_start(&f->threads2[i].thread, test_thread4_st_start);
-  }
-
-  /** Move to wait threads */
-  silc_fsm_next(fsm, test_st_tenth);
-  return SILC_FSM_CONTINUE;
-}
-
-SILC_FSM_STATE(test_st_tenth)
-{
-  Foo f = fsm_context;
-  int i;
-
-  for (i = 0; i < NUM_THREADS; i++)
-    if (f->threads2[i].finished == FALSE) {
-      SILC_FSM_EVENT_WAIT(&f->threads2[i].sema);
-      f->threads2[i].finished = TRUE;
-    }
-
-  SILC_LOG_DEBUG(("All %d real threads terminated", NUM_THREADS));
-
-  /** Finished successfully */
-  silc_fsm_next_later(fsm, test_st_finish, 2, 0);
-  return SILC_FSM_WAIT;
-}
-
-SILC_FSM_STATE(test_st_finish)
-{
-  SILC_LOG_DEBUG(("test_st_finish"));
-
-  SILC_LOG_DEBUG(("Finish machine"));
-  return SILC_FSM_FINISH;
-}
-
-static void destructor(SilcFSM fsm, void *fsm_context,
-                      void *destructor_context)
-{
-  Foo f = destructor_context;
-  SILC_LOG_DEBUG(("FSM destructor, stopping scheduler"));
-  silc_fsm_free(fsm);
-  silc_schedule_stop(f->schedule);
-}
-
-int main(int argc, char **argv)
-{
-  SilcBool success = FALSE;
-  SilcSchedule schedule;
-  SilcFSM fsm;
-  Foo f;
-
-  if (argc > 1 && !strcmp(argv[1], "-d")) {
-    silc_log_debug(TRUE);
-    silc_log_debug_hexdump(TRUE);
-    silc_log_quick(TRUE);
-    silc_log_set_debug_string("*fsm*,*async*");
-  }
-
-  SILC_LOG_DEBUG(("Allocating scheduler"));
-  schedule = silc_schedule_init(0, NULL);
-
-  f = silc_calloc(1, sizeof(*f));
-  if (!f)
-    goto err;
-  f->schedule = schedule;
-
-  SILC_LOG_DEBUG(("Allocating FSM context"));
-  f->fsm = fsm = silc_fsm_alloc(f, destructor, f, schedule);
-  if (!fsm)
-    goto err;
-  silc_fsm_start(fsm, test_st_start);
-
-  SILC_LOG_DEBUG(("Running scheduler"));
-  silc_schedule(schedule);
-
-  if (f->error)
-    goto err;
-
-  silc_schedule_uninit(schedule);
-  silc_free(f);
-
-  success = TRUE;
-
- err:
-  SILC_LOG_DEBUG(("Testing was %s", success ? "SUCCESS" : "FAILURE"));
-  fprintf(stderr, "Testing was %s\n", success ? "SUCCESS" : "FAILURE");
-
-  return success;
-}
diff --git a/lib/silcutil/tests/test_silchashtable.c b/lib/silcutil/tests/test_silchashtable.c
deleted file mode 100644 (file)
index 622fc45..0000000
+++ /dev/null
@@ -1,298 +0,0 @@
-/* Hash table tests */
-
-#include "silc.h"
-
-typedef struct entry_struct {
-  char name[8];
-  int val;
-} *entry;
-
-SilcBool dump = FALSE;
-SilcBool auto_rehash = TRUE;
-int count = 2000;
-SilcHashTable t = NULL;
-
-SilcUInt32 hash_entry(void *key, void *user_context)
-{
-  entry e = key;
-  return e->val + silc_hash_string(e->name, NULL);
-}
-
-SilcBool hash_compare(void *key1, void *key2, void *user_context)
-{
-  entry e = key1;
-  entry e2 = key2;
-  if (e->val == e2->val && !strcmp(e->name, e2->name))
-    return TRUE;
-  return FALSE;
-}
-
-void hash_destructor(void *key, void *context, void *user_context)
-{
-  entry e = key;
-  char *name = context;
-  if (dump)
-    SILC_LOG_DEBUG(("e=%p, e->val=%d, e->name=%s, context=%s",
-                   e, e->val, e->name, name));
-  memset(e, 'F', sizeof(*e));
-  silc_free(e);
-}
-
-SilcBool add_entries()
-{
-  entry e;
-  int i;
-
-  SILC_LOG_DEBUG(("Adding %d entries", count));
-
-  for (i = 0; i < count; i++) {
-    e = silc_calloc(1, sizeof(*e));
-    if (!e)
-      return FALSE;
-    silc_snprintf(e->name, sizeof(e->name), "%d", i);
-    e->val = i;
-
-    silc_hash_table_add(t, (void *)e, (void *)e->name);
-  }
-
-  SILC_LOG_DEBUG(("Hash table entry count: %d", silc_hash_table_count(t)));
-
-  return TRUE;
-}
-
-SilcBool del_entries_with_list()
-{
-  SilcHashTableList htl;
-  entry e;
-  char *name;
-
-  SILC_LOG_DEBUG(("Deleting entries with SilcHashTableList"));
-
-  silc_hash_table_list(t, &htl);
-  while (silc_hash_table_get(&htl, (void **)&e, (void **)&name)) {
-    if (!silc_hash_table_del(t, e))
-      return FALSE;
-  }
-  silc_hash_table_list_reset(&htl);
-
-  SILC_LOG_DEBUG(("Hash table entry count: %d", silc_hash_table_count(t)));
-
-  return TRUE;
-}
-
-void del_foreach(void *key, void *context, void *user_context)
-{
-  entry e = key;
-  char *name = context;
-  if (dump)
-    SILC_LOG_DEBUG(("del_foreach found e=%p, e->val=%d, e->name=%s, context=%s",
-                   e, e->val, e->name, name));
-  silc_hash_table_del(t, key);
-}
-
-SilcBool del_n_entries_foreach()
-{
-  struct entry_struct f;
-  int i;
-
-  SILC_LOG_DEBUG(("Deleting keys 0-%d with foreach", count));
-
-  for (i = 0; i < count; i++) {
-    memset(&f, 0, sizeof(f));
-    silc_snprintf(f.name, sizeof(f.name), "%d", i);
-    f.val = i;
-
-    silc_hash_table_find_foreach(t, &f, del_foreach, NULL);
-  }
-
-  return TRUE;
-}
-
-SilcBool del_entries_foreach()
-{
-  SILC_LOG_DEBUG(("Deleting all entries with foreach"));
-  silc_hash_table_foreach(t, del_foreach, NULL);
-  return TRUE;
-}
-
-SilcBool alloc_table()
-{
-  SILC_LOG_DEBUG(("Allocating hash table with %d entries (%s)",
-                 count, auto_rehash ? "auto rehash" : "no auto rehash"));
-
-  t = silc_hash_table_alloc(0, hash_entry, NULL,
-                           hash_compare, NULL,
-                           hash_destructor, NULL, auto_rehash);
-
-  if (!add_entries())
-    return FALSE;
-
-  SILC_LOG_DEBUG(("Hash table size: %d", silc_hash_table_size(t)));
-
-  if (silc_hash_table_count(t) != count) {
-    SILC_LOG_DEBUG(("Wrong table count %d", count));
-    return FALSE;
-  }
-
-  return TRUE;
-}
-
-SilcBool delete_table_with_list()
-{
-
-  SILC_LOG_DEBUG(("Deleting entries with SilcHashTableList"));
-
-  if (!del_entries_with_list())
-    return FALSE;
-
-  SILC_LOG_DEBUG(("Hash table size: %d", silc_hash_table_size(t)));
-
-  if (silc_hash_table_count(t) != 0) {
-    SILC_LOG_DEBUG(("Wrong table count %d != 0", count));
-    return FALSE;
-  }
-
-  silc_hash_table_free(t);
-  t = NULL;
-
-  return TRUE;
-}
-
-SilcBool find_entries()
-{
-  struct entry_struct f;
-  entry e;
-  char *name;
-  int i;
-
-  SILC_LOG_DEBUG(("Finding %d entries", count));
-
-  for (i = 0; i < count; i++) {
-    memset(&f, 0, sizeof(f));
-    silc_snprintf(f.name, sizeof(f.name), "%d", i);
-    f.val = i;
-
-    /* Find */
-    if (!silc_hash_table_find(t, &f, (void **)&e, (void **)&name))
-      return FALSE;
-
-    /* Find itself with context */
-    if (!silc_hash_table_find_by_context(t, e, e->name, NULL))
-      return FALSE;
-  }
-
-  return TRUE;
-}
-
-SilcBool dump_table()
-{
-  SilcHashTableList htl;
-  entry e;
-  char *name;
-  SilcBool dumpped = FALSE;
-
-  SILC_LOG_DEBUG(("Dumping hash table entries"));
-
-  silc_hash_table_list(t, &htl);
-  while (silc_hash_table_get(&htl, (void **)&e, (void **)&name)) {
-    dumpped = TRUE;
-    if (dump)
-      SILC_LOG_DEBUG(("e=%p, e->val=%d, e->name=%s, context=%s",
-                     e, e->val, e->name, name));
-  }
-  silc_hash_table_list_reset(&htl);
-
-  return dumpped;
-}
-
-int main(int argc, char **argv)
-{
-  SilcBool success = FALSE;
-  int i;
-
-  if (argc > 1 && !strcmp(argv[1], "-d")) {
-    silc_log_debug(TRUE);
-    silc_log_debug_hexdump(TRUE);
-    silc_log_quick(TRUE);
-    silc_log_set_debug_string("*table*");
-  }
-
-  if (argc > 1 && !strcmp(argv[1], "-D")) {
-    silc_log_debug(TRUE);
-    dump = TRUE;
-    silc_log_set_debug_string("*table*");
-  }
-
-  if (!alloc_table())
-    goto err;
-  if (!dump_table())
-    goto err;
-  if (!delete_table_with_list())
-    goto err;
-
-  count = 1387;
-  auto_rehash = FALSE;
-  if (!alloc_table())
-    goto err;
-  if (!dump_table())
-    goto err;
-  SILC_LOG_DEBUG(("rehash"));
-  silc_hash_table_rehash(t, 0);
-  SILC_LOG_DEBUG(("Hash table entry count: %d", silc_hash_table_count(t)));
-  SILC_LOG_DEBUG(("Hash table size: %d", silc_hash_table_size(t)));
-  if (!delete_table_with_list())
-    goto err;
-
-  count = 999;
-  auto_rehash = TRUE;
-  if (!alloc_table())
-    goto err;
-  count = 17999;
-  if (!add_entries())
-    goto err;
-  SILC_LOG_DEBUG(("rehash"));
-  silc_hash_table_rehash(t, 0);
-  SILC_LOG_DEBUG(("Hash table entry count: %d", silc_hash_table_count(t)));
-  SILC_LOG_DEBUG(("Hash table size: %d", silc_hash_table_size(t)));
-  if (!del_entries_with_list())
-    goto err;
-  SILC_LOG_DEBUG(("rehash"));
-  silc_hash_table_rehash(t, 0);
-  SILC_LOG_DEBUG(("Hash table entry count: %d", silc_hash_table_count(t)));
-  SILC_LOG_DEBUG(("Hash table size: %d", silc_hash_table_size(t)));
-  count = 999;
-  if (!add_entries())
-    goto err;
-  /* Adding duplicates */
-  for (i = 0; i < 30; i++) {
-    count = 50;
-    if (!add_entries())
-      goto err;
-  }
-  count = 700;
-  if (!find_entries())
-    goto err;
-  count = 500;
-  if (!del_n_entries_foreach())
-    goto err;
-  count = 999;
-  if (!add_entries())
-    goto err;
-  count = 700;
-  if (!find_entries())
-    goto err;
-  if (!dump_table())
-    goto err;
-  if (!del_entries_foreach())
-    goto err;
-  if (!delete_table_with_list())
-    goto err;
-
-  success = TRUE;
-
- err:
-  SILC_LOG_DEBUG(("Testing was %s", success ? "SUCCESS" : "FAILURE"));
-  fprintf(stderr, "Testing was %s\n", success ? "SUCCESS" : "FAILURE");
-
-  return success;
-}
diff --git a/lib/silcutil/tests/test_silclist.c b/lib/silcutil/tests/test_silclist.c
deleted file mode 100644 (file)
index 5fca744..0000000
+++ /dev/null
@@ -1,165 +0,0 @@
-/* SilcList tests */
-
-#include "silc.h"
-
-struct foo {
-  int i;
-  struct foo *next;
-  struct foo *prev;
-};
-
-int main(int argc, char **argv)
-{
-  SilcBool success = FALSE;
-  SilcList list;
-  struct foo *f, *f1, *f2, *f3, *f4;
-
-  if (argc > 1 && !strcmp(argv[1], "-d")) {
-    silc_log_debug(TRUE);
-    silc_log_debug_hexdump(TRUE);
-    silc_log_set_debug_string("*list*");
-  }
-
-  silc_list_init_prev(list, struct foo, next, prev);
-  f1 = silc_calloc(1, sizeof(*f1));
-  if (!f1)
-    goto err;
-  f1->i = 1;
-  f2 = silc_calloc(1, sizeof(*f2));
-  if (!f2)
-    goto err;
-  f2->i = 2;
-  f3 = silc_calloc(1, sizeof(*f3));
-  if (!f3)
-    goto err;
-  f3->i = 3;
-  f4 = silc_calloc(1, sizeof(*f4));
-  if (!f4)
-    goto err;
-  f4->i = 4;
-
-  SILC_LOG_DEBUG(("Add one entry"));
-  silc_list_add(list, f1);
-  silc_list_start(list);
-  while ((f = silc_list_get(list)) != SILC_LIST_END) {
-    SILC_LOG_DEBUG(("entry %d, %p, next=%p, prev=%p", f->i, f, f->next, 
-                  f->prev));
-  }
-  SILC_LOG_DEBUG(("Delete the entry"));
-  silc_list_del(list, f1);  
-  silc_list_start(list);
-  while ((f = silc_list_get(list)) != SILC_LIST_END)
-    goto err;
-  SILC_LOG_DEBUG(("head=%p", list.head));
-  SILC_LOG_DEBUG(("Re-add the entry"));
-  silc_list_add(list, f1);
-  silc_list_start(list);
-  while ((f = silc_list_get(list)) != SILC_LIST_END) {
-    SILC_LOG_DEBUG(("entry %d, %p, next=%p, prev=%p", f->i, f, f->next, 
-                  f->prev));
-  }
-  SILC_LOG_DEBUG(("Delete the entry"));
-  silc_list_del(list, f1);  
-  silc_list_start(list);
-  while ((f = silc_list_get(list)) != SILC_LIST_END)
-    goto err;
-
-  SILC_LOG_DEBUG(("insert f4=%p at head"));
-  silc_list_insert(list, NULL, f4);
-  silc_list_start(list);
-  while ((f = silc_list_get(list)) != SILC_LIST_END) {
-    SILC_LOG_DEBUG(("entry %d, %p, next=%p, prev=%p", f->i, f, f->next, 
-                  f->prev));
-  }
-
-  SILC_LOG_DEBUG(("Deleting f4=%p", f4));
-  silc_list_del(list, f4);
-
-  SILC_LOG_DEBUG(("Add f1, f2, f3"));
-  silc_list_add(list, f1);
-  silc_list_add(list, f2);
-  silc_list_add(list, f3);
-
-  SILC_LOG_DEBUG(("f1=%p", f1));
-  SILC_LOG_DEBUG(("f2=%p", f2));
-  SILC_LOG_DEBUG(("f3=%p", f3));
-
-  silc_list_start(list);
-  while ((f = silc_list_get(list)) != SILC_LIST_END) {
-    SILC_LOG_DEBUG(("entry %d, %p, next=%p, prev=%p", f->i, f, f->next, 
-                  f->prev));
-  }
-
-  SILC_LOG_DEBUG(("insert f4=%p between f1=%p and f2=%p", f4, f1, f2));
-  silc_list_insert(list, f1, f4);
-  silc_list_start(list);
-  while ((f = silc_list_get(list)) != SILC_LIST_END) {
-    SILC_LOG_DEBUG(("entry %d, %p, next=%p, prev=%p", f->i, f, f->next, 
-                  f->prev));
-  }
-
-  SILC_LOG_DEBUG(("Deleting f4=%p", f4));
-  silc_list_del(list, f4);
-
-  SILC_LOG_DEBUG(("insert f4=%p between f3=%p and tail", f4, f3));
-  silc_list_insert(list, f3, f4);
-  silc_list_start(list);
-  while ((f = silc_list_get(list)) != SILC_LIST_END) {
-    SILC_LOG_DEBUG(("entry %d, %p, next=%p, prev=%p", f->i, f, f->next, 
-                  f->prev));
-  }
-
-  SILC_LOG_DEBUG(("Deleting f4=%p", f4));
-  silc_list_del(list, f4);
-
-  SILC_LOG_DEBUG(("insert f4=%p at head"));
-  silc_list_insert(list, NULL, f4);
-  silc_list_start(list);
-  while ((f = silc_list_get(list)) != SILC_LIST_END) {
-    SILC_LOG_DEBUG(("entry %d, %p, next=%p, prev=%p", f->i, f, f->next, 
-                  f->prev));
-  }
-
-  silc_list_start(list);
-  silc_list_del(list, f1);
-  while ((f = silc_list_get(list)) != SILC_LIST_END) {
-    SILC_LOG_DEBUG(("entry %d, %p, next=%p, prev=%p", f->i, f, f->next, 
-                  f->prev));
-  }
-  silc_list_del(list, f3);
-  while ((f = silc_list_get(list)) != SILC_LIST_END) {
-    SILC_LOG_DEBUG(("entry %d, %p, next=%p, prev=%p", f->i, f, f->next, 
-                  f->prev));
-  }
-  silc_list_del(list, f2);
-  while ((f = silc_list_get(list)) != SILC_LIST_END) {
-    SILC_LOG_DEBUG(("entry %d, %p, next=%p, prev=%p", f->i, f, f->next, 
-                  f->prev));
-  }
-
-  silc_list_add(list, f1);
-  silc_list_add(list, f2);
-  silc_list_add(list, f3);
-
-  silc_list_start(list);
-  while ((f = silc_list_get(list)) != SILC_LIST_END) {
-    SILC_LOG_DEBUG(("entry %d, %p, next=%p, prev=%p", f->i, f, f->next, 
-                  f->prev));
-  }
-
-  silc_list_del(list, f2);
-
-  silc_list_start(list);
-  while ((f = silc_list_get(list)) != SILC_LIST_END) {
-    SILC_LOG_DEBUG(("entry %d, %p, next=%p, prev=%p", f->i, f, f->next, 
-                  f->prev));
-  }
-
-  success = TRUE;
-
- err:
-  SILC_LOG_DEBUG(("Testing was %s", success ? "SUCCESS" : "FAILURE"));
-  fprintf(stderr, "Testing was %s\n", success ? "SUCCESS" : "FAILURE");
-
-  return success;
-}
diff --git a/lib/silcutil/tests/test_silcmime.c b/lib/silcutil/tests/test_silcmime.c
deleted file mode 100644 (file)
index 6ebcecd..0000000
+++ /dev/null
@@ -1,282 +0,0 @@
-/* SilcMime tests */
-
-#include "silc.h"
-#include "silcmime.h"
-
-int main(int argc, char **argv)
-{
-  SilcBool success = FALSE;
-  SilcMime mime, part, part2;
-  SilcMimeAssembler ass;
-  int i;
-  char tmp[500];
-  unsigned char *enc;
-  SilcUInt32 enc_len;
-  SilcDList frag;
-  SilcBuffer buf;
-  const char *mtype;
-
-  if (argc > 1 && !strcmp(argv[1], "-d")) {
-    silc_log_debug(TRUE);
-    silc_log_debug_hexdump(TRUE);
-    silc_log_set_debug_string("*mime*");
-  }
-
-  /* 
-   * Simple MIME test
-   */
-  SILC_LOG_DEBUG(("Allocating MIME message context"));
-  mime = silc_mime_alloc();
-  if (!mime)
-    goto err;
-  SILC_LOG_DEBUG(("Adding MIME fields"));
-  SILC_LOG_DEBUG(("Adding MIME-Version: 1.0"));
-  silc_mime_add_field(mime, "MIME-Version", "1.0");
-  SILC_LOG_DEBUG(("Adding Content-Type: foo/bar"));
-  silc_mime_add_field(mime, "Content-Type", "foo/bar");
-  SILC_LOG_DEBUG(("Adding Content-Transfer-Encoding: binary"));
-  silc_mime_add_field(mime, "Content-Transfer-Encoding", "binary");
-  SILC_LOG_DEBUG(("Adding FOO: BaR"));
-  silc_mime_add_field(mime, "FOO", "BaR");
-  SILC_LOG_DEBUG(("Adding MIME data, 100 A's + 1 B"));
-  for (i = 0; i < 100; i++)
-    tmp[i] = 'A';
-  tmp[100] = 'B';
-  silc_mime_add_data(mime, tmp, 101);
-  SILC_LOG_DEBUG(("Encoding MIME context"));
-  enc = silc_mime_encode(mime, &enc_len);
-  if (!enc)
-    goto err;
-  SILC_LOG_DEBUG(("Encoded MIME message: \n%s", enc));
-  silc_mime_free(mime);
-  SILC_LOG_DEBUG(("Decoding MIME message"));
-  mime = silc_mime_decode(NULL, enc, enc_len);
-  if (!mime)
-    goto err;
-  SILC_LOG_DEBUG(("Re-encoding MIME context"));
-  silc_free(enc);
-  enc = silc_mime_encode(mime, &enc_len);
-  if (!enc)
-    goto err;
-  SILC_LOG_DEBUG(("Re-encoded MIME message: \n%s", enc));
-  silc_free(enc);
-  silc_mime_free(mime);
-
-  /*
-   * Empty data area, only headers present
-   */
-  SILC_LOG_DEBUG(("Allocating MIME message context"));
-  mime = silc_mime_alloc();
-  if (!mime)
-    goto err;
-  SILC_LOG_DEBUG(("Adding Content-Transfer-Encoding: binary"));
-  silc_mime_add_field(mime, "Content-Transfer-Encoding", "binary");
-  SILC_LOG_DEBUG(("No data area, only header present"));
-  SILC_LOG_DEBUG(("Encoding MIME context"));
-  enc = silc_mime_encode(mime, &enc_len);
-  if (!enc)
-    goto err;
-  SILC_LOG_DEBUG(("Encoded MIME message: \n%s", enc));
-  silc_mime_free(mime);
-  SILC_LOG_DEBUG(("Decoding MIME message"));
-  mime = silc_mime_decode(NULL, enc, enc_len);
-  if (!mime)
-    goto err;
-  SILC_LOG_DEBUG(("Re-encoding MIME context"));
-  silc_free(enc);
-  enc = silc_mime_encode(mime, &enc_len);
-  if (!enc)
-    goto err;
-  SILC_LOG_HEXDUMP(("Re-encoded MIME message:"), enc, enc_len);
-  silc_free(enc);
-  silc_mime_free(mime);
-
-  /*
-   * Multipart test, with nesting
-   */
-  SILC_LOG_DEBUG(("Allocating MIME message context"));
-  mime = silc_mime_alloc();
-  if (!mime)
-    goto err;
-  SILC_LOG_DEBUG(("Adding MIME-Version: 1.0"));
-  silc_mime_add_field(mime, "MIME-Version", "1.0");
-  SILC_LOG_DEBUG(("Adding Content-Transfer-Encoding: binary"));
-  silc_mime_add_field(mime, "Content-Transfer-Encoding", "binary");
-  SILC_LOG_DEBUG(("Marking as multipart MIME message"));
-  silc_mime_set_multipart(mime, "mixed", "boundary");
-  SILC_LOG_DEBUG(("Adding FOO: BaR"));
-  silc_mime_add_field(mime, "FOO", "BaR");
-  SILC_LOG_DEBUG(("Allocating part"));
-  part = silc_mime_alloc();
-  if (!part)
-    goto err;
-  SILC_LOG_DEBUG(("Adding MIME fields"));
-  SILC_LOG_DEBUG(("Adding Content-Type: foo/bar"));
-  silc_mime_add_field(part, "Content-Type", "foo/bar");
-  SILC_LOG_DEBUG(("Adding MIME data, 100 A's + 1 B"));
-  for (i = 0; i < 100; i++)
-    tmp[i] = 'A';
-  tmp[100] = 'B';
-  silc_mime_add_data(part, tmp, 101);
-  SILC_LOG_DEBUG(("Adding part to MIME message"));
-  if (!silc_mime_add_multipart(mime, part))
-    goto err;
-  SILC_LOG_DEBUG(("Allocating part"));
-  part = silc_mime_alloc();
-  if (!part)
-    goto err;
-  SILC_LOG_DEBUG(("Adding Content-Type: image/foobar"));
-  silc_mime_add_field(part, "Content-Type", "image/foobar");
-  SILC_LOG_DEBUG(("Adding MIME data, 50 A's + 1 B"));
-  for (i = 0; i < 50; i++)
-    tmp[i] = 'A';
-  tmp[50] = 'B';
-  silc_mime_add_data(part, tmp, 51);
-  SILC_LOG_DEBUG(("Adding part to MIME message"));
-  if (!silc_mime_add_multipart(mime, part))
-    goto err;
-  SILC_LOG_DEBUG(("Allocating part"));
-  part = silc_mime_alloc();
-  if (!part)
-    goto err;
-  SILC_LOG_DEBUG(("Adding MIME data (NO HEADERS), 10 A's + 1 B"));
-  for (i = 0; i < 10; i++)
-    tmp[i] = 'A';
-  tmp[10] = 'B';
-  silc_mime_add_data(part, tmp, 11);
-  SILC_LOG_DEBUG(("Adding part to MIME message"));
-  if (!silc_mime_add_multipart(mime, part))
-    goto err;
-  SILC_LOG_DEBUG(("Allocating part"));
-  part = silc_mime_alloc();
-  if (!part)
-    goto err;
-  SILC_LOG_DEBUG(("Adding Content-Type: image/foobar"));
-  SILC_LOG_DEBUG(("No data area, only header"));
-  silc_mime_add_field(part, "Content-Type", "image/foobar");
-  SILC_LOG_DEBUG(("Adding part to MIME message"));
-  if (!silc_mime_add_multipart(mime, part))
-    goto err;
-  SILC_LOG_DEBUG(("Allocating part"));
-  part = silc_mime_alloc();
-  if (!part)
-    goto err;
-  SILC_LOG_DEBUG(("Adding part to MIME message"));
-  if (!silc_mime_add_multipart(mime, part))
-    goto err;
-  silc_mime_set_multipart(part, "mixed", "booooooooundary");
-  SILC_LOG_DEBUG(("Allocating part for nested multipart"));
-  part2 = silc_mime_alloc();
-  if (!part)
-    goto err;
-  SILC_LOG_DEBUG(("Adding Content-Type: foo/nested"));
-  silc_mime_add_field(part2, "Content-Type", "foo/nested");
-  SILC_LOG_DEBUG(("Adding MIME data, 150 A's + 1 B"));
-  for (i = 0; i < 150; i++)
-    tmp[i] = 'A';
-  tmp[150] = 'B';
-  silc_mime_add_data(part2, tmp, 151);
-  SILC_LOG_DEBUG(("Adding part to another part message"));
-  if (!silc_mime_add_multipart(part, part2))
-    goto err;
-  SILC_LOG_DEBUG(("Encoding MIME context"));
-  enc = silc_mime_encode(mime, &enc_len);
-  if (!enc)
-    goto err;
-  SILC_LOG_DEBUG(("Encoded MIME message: \n%s", enc));
-  silc_mime_free(mime);
-  SILC_LOG_DEBUG(("Decoding MIME message"));
-  mime = silc_mime_decode(NULL, enc, enc_len);
-  if (!mime)
-    goto err;
-  SILC_LOG_DEBUG(("Re-encoding MIME context"));
-  silc_free(enc);
-  enc = silc_mime_encode(mime, &enc_len);
-  if (!enc)
-    goto err;
-  SILC_LOG_DEBUG(("Re-encoded MIME message: \n%s", enc));
-  silc_free(enc);
-  SILC_LOG_DEBUG(("Get multiparts"));
-  frag = silc_mime_get_multiparts(mime, &mtype);
-  if (!frag)
-    goto err;
-  SILC_LOG_DEBUG(("Multipart type '%s'", mtype));
-  silc_dlist_start(frag);
-  while ((part = silc_dlist_get(frag)) != SILC_LIST_END) {
-    SILC_LOG_DEBUG(("Encoding MIME part"));
-    enc = silc_mime_encode(part, &enc_len);
-    if (!enc)
-        goto err;
-    if (silc_mime_is_multipart(part))
-        SILC_LOG_DEBUG(("Is multipart"));
-    SILC_LOG_DEBUG(("Encoded MIME part: \n%s", enc));
-    silc_free(enc);
-  }
-  silc_mime_free(mime);
-
-  /*
-   * Fragmentation test
-   */
-  SILC_LOG_DEBUG(("Allocating MIME assembler"));
-  ass = silc_mime_assembler_alloc();
-  if (!ass)
-    goto err;
-  SILC_LOG_DEBUG(("Allocating MIME message context"));
-  mime = silc_mime_alloc();
-  if (!mime)
-    goto err;
-  SILC_LOG_DEBUG(("Adding MIME fields"));
-  SILC_LOG_DEBUG(("Adding MIME-Version: 1.0"));
-  silc_mime_add_field(mime, "MIME-Version", "1.0");
-  SILC_LOG_DEBUG(("Adding Content-Type: foo/bar"));
-  silc_mime_add_field(mime, "Content-Type", "foo/bar");
-  SILC_LOG_DEBUG(("Adding Content-Transfer-Encoding: binary"));
-  silc_mime_add_field(mime, "Content-Transfer-Encoding", "binary");
-  SILC_LOG_DEBUG(("Adding FOO: BaR"));
-  silc_mime_add_field(mime, "FOO", "BaR");
-  SILC_LOG_DEBUG(("Adding MIME data, 300 A's + 1 B"));
-  for (i = 0; i < 300; i++)
-    tmp[i] = 'A';
-  tmp[300] = 'B';
-  silc_mime_add_data(mime, tmp, 301);
-  SILC_LOG_DEBUG(("Encoding MIME context"));
-  enc = silc_mime_encode(mime, &enc_len);
-  if (!enc)
-    goto err;
-  SILC_LOG_DEBUG(("Encoded MIME message: \n%s", enc));
-  silc_free(enc);
-  SILC_LOG_DEBUG(("Fragment MIME message in 100 byte chunks"));
-  frag = silc_mime_encode_partial(mime, 100);
-  if (!frag)
-    goto err;
-  silc_dlist_start(frag);
-  while ((buf = silc_dlist_get(frag)) != SILC_LIST_END)
-    SILC_LOG_DEBUG(("Fragment \n%s", buf->data, silc_buffer_len(buf)));
-  SILC_LOG_DEBUG(("Defragment"));
-  silc_dlist_start(frag);
-  while ((buf = silc_dlist_get(frag)) != SILC_LIST_END) {
-    part = silc_mime_decode(NULL, buf->data, silc_buffer_len(buf));
-    if (!silc_mime_is_partial(part))
-        goto err;
-    part = silc_mime_assemble(ass, part);
-    if (part) {
-      SILC_LOG_DEBUG(("Defragmentation completed"));
-      SILC_LOG_DEBUG(("Encoding MIME context"));
-      enc = silc_mime_encode(mime, &enc_len);
-      if (!enc)
-        SILC_LOG_DEBUG(("Error encoding"));
-      SILC_LOG_DEBUG(("Encoded MIME message: \n%s", enc));
-      silc_free(enc);
-    }
-  }
-  silc_mime_partial_free(frag);
-  silc_mime_assembler_free(ass);
-
-  success = TRUE;
-
- err:
-  SILC_LOG_DEBUG(("Testing was %s", success ? "SUCCESS" : "FAILURE"));
-  fprintf(stderr, "Testing was %s\n", success ? "SUCCESS" : "FAILURE");
-
-  return success;
-}
diff --git a/lib/silcutil/tests/test_silcmutex.c b/lib/silcutil/tests/test_silcmutex.c
deleted file mode 100644 (file)
index 4b1a732..0000000
+++ /dev/null
@@ -1,222 +0,0 @@
-/* Locking performance tests.  Gives locsk&unlocks/second. */
-/* Version 1.0 */
-
-#include "silc.h"
-
-typedef struct {
-  SilcThread thread;
-  SilcInt64 time;
-} Context;
-
-#define MAX_ROUND 8
-#define MAX_MUL 4
-#define MAX_THREADS 4
-#define MAX_LOCKS 471234567
-
-SilcMutex mutex;
-SilcUInt64 cpu_freq = 0;
-int max_locks, max_locks2;
-
-/* RDTSC */
-#ifdef SILC_I486
-static __inline__ unsigned long long rdtsc(void)
-{
-  unsigned long long int x;
-  __asm__ volatile (".byte 0x0f, 0x31" : "=A" (x));
-  return x;
-}
-
-#elif SILC_X86_64
-typedef unsigned long long int unsigned long long;
-static __inline__ unsigned long long rdtsc(void)
-{
-  unsigned hi, lo;
-  __asm__ __volatile__ ("rdtsc" : "=a"(lo), "=d"(hi));
-  return ( (unsigned long long)lo)|( ((unsigned long long)hi)<<32 );
-}
-
-#elif SILC_POWERPC
-typedef unsigned long long int unsigned long long;
-static __inline__ unsigned long long rdtsc(void)
-{
-  unsigned long long int result = 0;
-  unsigned long int upper, lower,tmp;
-  __asm__ volatile(
-                "0:                  \n"
-                "\tmftbu   %0           \n"
-                "\tmftb    %1           \n"
-                "\tmftbu   %2           \n"
-                "\tcmpw    %2,%0        \n"
-                "\tbne     0b         \n"
-                : "=r"(upper),"=r"(lower),"=r"(tmp)
-                );
-  result = upper;
-  result = result << 32;
-  result = result | lower;
-
-  return result;
-}
-#endif
-
-void *mutex_thread(void *context)
-{
-  Context *c = context;
-  SilcInt64 s;
-  register int i;
-
-  s = rdtsc();
-  for (i = 0; i < max_locks; i++) {
-    silc_mutex_lock(mutex);
-    silc_mutex_unlock(mutex);
-  }
-  c->time = rdtsc() - s;
-  c->time /= cpu_freq;
-
-  return NULL;
-}
-
-SilcUInt64 hval;
-SilcUInt64 hval2;
-SilcUInt64 hval3;
-
-void *mutex_thread_hold(void *context)
-{
-  Context *c = context;
-  SilcInt64 s;
-  register int i;
-
-  s = rdtsc();
-  for (i = 0; i < max_locks / 4; i++) {
-    silc_mutex_lock(mutex);
-    hval2 = i;
-    hval3 = 0;
-    hval++;
-    hval3 = hval2 + i;
-    hval += hval2;
-    hval3 += hval;
-    if (silc_unlikely(hval3 != hval2 + i + hval)) {
-      fprintf(stderr, "MUTEX CORRUPT 1\n");
-      exit(1);
-    }
-    if (silc_unlikely(hval2 != i)) {
-      fprintf(stderr, "MUTEX CORRUPT 2 (%llu != %d)\n", hval2, i);
-      exit(1);
-    }
-    silc_mutex_unlock(mutex);
-  }
-  c->time = rdtsc() - s;
-  c->time /= cpu_freq;
-
-  return NULL;
-}
-
-int main(int argc, char **argv)
-{
-  Context c[MAX_THREADS * MAX_MUL];
-  SilcInt64 val;
-  int k, i, j, o = 0;
-  SilcBool success;
-
-  if (argc <= 1) {
-    fprintf(stderr, "Usage: ./test_silcmutex <cpu_freq_mhz>\n");
-    fprintf(stderr, "Example: ./test_silcmutex 3000\n");
-    exit(1);
-  }
-  cpu_freq = (SilcUInt64)atoi(argv[1]);
-  cpu_freq *= 1000;    /* Will give us milliseconds */
-
-  max_locks = MAX_LOCKS;
-
-  fprintf(stderr, "lock/unlock per second\n");
-
-  for (j = 0; j < MAX_ROUND; j++) {
-    for (i = 0; i < 1; i++)
-      c[i].thread = silc_thread_create(mutex_thread, &c[i], TRUE);
-
-    val = 0;
-    for (i = 0; i < 1; i++) {
-      silc_thread_wait(c[i].thread, NULL);
-      val += c[i].time;
-    }
-    fprintf(stderr, "%llu mutex lock/unlock per second (%d threads)\n",
-                     (1000LL * max_locks * 1) / val, 1);
-
-    if (o == 0) {
-      /* If MAX_LOCKS is too large for this CPU, optimize.  We don't want to
-        wait a whole day for this test. */
-      if ((SilcInt64)(max_locks / 10) >
-         (SilcInt64)((1000LL * max_locks) / val))
-       max_locks /= 10;
-      o = 1;
-    }
-  }
-  puts("");
-
-  max_locks2 = max_locks;
-  for (k = 0; k < MAX_MUL; k++) {
-    sleep(16);
-    max_locks = max_locks2 / (k + 1);
-    for (j = 0; j < MAX_ROUND; j++) {
-      for (i = 0; i < MAX_THREADS * (k + 1); i++)
-       c[i].thread = silc_thread_create(mutex_thread, &c[i], TRUE);
-
-      val = 0;
-      for (i = 0; i < MAX_THREADS * (k + 1); i++) {
-       silc_thread_wait(c[i].thread, NULL);
-       val += c[i].time;
-      }
-      fprintf(stderr, "%llu mutex lock/unlock per second (%d threads)\n",
-                     (1000LL * max_locks * (MAX_THREADS * (k + 1))) / val,
-                     MAX_THREADS * (k + 1));
-    }
-    puts("");
-  }
-  max_locks = max_locks2;
-
-  fprintf(stderr, "Spinning/holding lock, lock/unlock per second\n");
-
-  max_locks /= 2;
-  sleep(5);
-  for (j = 0; j < MAX_ROUND / 2; j++) {
-    for (i = 0; i < 1; i++)
-      c[i].thread = silc_thread_create(mutex_thread_hold, &c[i], TRUE);
-
-    val = 0;
-    for (i = 0; i < 1; i++) {
-      silc_thread_wait(c[i].thread, NULL);
-      val += c[i].time;
-    }
-    fprintf(stderr, "%llu mutex lock/unlock per second (%d threads)\n",
-                      (1000LL * (max_locks / 4) * 1) / val, 1);
-  }
-  puts("");
-
-  max_locks2 = max_locks;
-  max_locks2 /= 2;
-  for (k = 0; k < MAX_MUL; k++) {
-    sleep(2);
-    max_locks = max_locks2 / (k + 1);
-    for (j = 0; j < MAX_ROUND / 2; j++) {
-      hval = hval2 = 1;
-      for (i = 0; i < MAX_THREADS * (k + 1); i++)
-        c[i].thread = silc_thread_create(mutex_thread_hold, &c[i], TRUE);
-
-      val = 0;
-      for (i = 0; i < MAX_THREADS * (k + 1); i++) {
-        silc_thread_wait(c[i].thread, NULL);
-        val += c[i].time;
-      }
-      fprintf(stderr, "%llu mutex lock/unlock per second (%d threads)\n",
-                      (1000LL * (max_locks / 4) *
-                       (MAX_THREADS * (k + 1))) / val,
-                      MAX_THREADS * (k + 1));
-    }
-    puts("");
-  }
-
-  success = TRUE;
-
-  fprintf(stderr, "Testing was %s\n", success ? "SUCCESS" : "FAILURE");
-
-  return success;
-}
diff --git a/lib/silcutil/tests/test_silcnet.c b/lib/silcutil/tests/test_silcnet.c
deleted file mode 100644 (file)
index 2931bd7..0000000
+++ /dev/null
@@ -1,204 +0,0 @@
-/* SILC Net API tests */
-
-#include "silc.h"
-
-SilcSchedule schedule;
-
-typedef struct {
-  SilcFSM fsm;
-  SilcFSMEventStruct sema;
-  SilcFSMThreadStruct thread;
-  SilcNetListener server;
-  SilcStream client_stream;
-  SilcNetStatus client_status;
-  SilcStream server_stream;
-  SilcNetStatus server_status;
-  SilcBool success;
-} *Foo;
-
-SILC_FSM_STATE(test_st_start);
-SILC_FSM_STATE(test_st_second);
-SILC_FSM_STATE(test_st_finish);
-
-SILC_FSM_STATE(test_st_connect);
-SILC_FSM_STATE(test_st_connected);
-
-static void test_accept_connection(SilcNetStatus status, SilcStream stream,
-                                  void *context)
-{
-  Foo f = context;
-  SILC_LOG_DEBUG(("Accepted new connection"));
-  f->client_status = status;
-  f->client_stream = stream;
-  SILC_FSM_EVENT_SIGNAL(&f->sema);
-}
-
-static void test_connected(SilcNetStatus status, SilcStream stream,
-                          void *context)
-{
-  Foo f = context;
-  SILC_LOG_DEBUG(("Connected to server"));
-  f->server_status = status;
-  f->server_stream = stream;
-  SILC_FSM_CALL_CONTINUE(&f->thread);
-}
-
-SILC_FSM_STATE(test_st_connect)
-{
-  Foo f = fsm_context;
-
-  SILC_LOG_DEBUG(("test_st_connect"));
-  SILC_LOG_DEBUG(("Connecting to server"));
-
-  silc_fsm_next(fsm, test_st_connected);
-  SILC_FSM_CALL(silc_net_tcp_connect(NULL, "localhost", 5000,
-                                    silc_fsm_get_schedule(fsm),
-                                    test_connected, f));
-}
-
-SILC_FSM_STATE(test_st_connected)
-{
-  Foo f = fsm_context;
-  const char *host, *ip;
-  SilcUInt16 port;
-
-  SILC_LOG_DEBUG(("test_st_connected"));
-
-  if (f->server_status != SILC_NET_OK) {
-    SILC_LOG_DEBUG(("Creating connection failed"));
-    return SILC_FSM_FINISH;
-  }
-
-  silc_socket_stream_get_info(f->server_stream, NULL, &host, &ip, &port);
-  SILC_LOG_DEBUG(("Connected to server %s, %s:%d", host, ip, port));
-
-  return SILC_FSM_FINISH;
-}
-
-SILC_FSM_STATE(test_st_start)
-{
-  Foo f = fsm_context;
-
-  SILC_LOG_DEBUG(("test_st_start"));
-
-  SILC_LOG_DEBUG(("Creating network listener"));
-  f->server = silc_net_tcp_create_listener(NULL, 0, 5000, TRUE, TRUE,
-                                    silc_fsm_get_schedule(fsm),
-                                    test_accept_connection, f);
-  if (!f->server) {
-    /** Creating network listener failed */
-    SILC_LOG_DEBUG(("Listener creation failed"));
-    silc_fsm_next(fsm, test_st_finish);
-    return SILC_FSM_CONTINUE;
-  }
-
-  /* Create thread to connect to the listener */
-  silc_fsm_thread_init(&f->thread, fsm, f, NULL, NULL, FALSE);
-  silc_fsm_start(&f->thread, test_st_connect);
-
-  /** Start waiting connection */
-  SILC_LOG_DEBUG(("Start waiting for incoming connections"));
-  silc_fsm_event_init(&f->sema, fsm);
-  silc_fsm_next(fsm, test_st_second);
-  return SILC_FSM_CONTINUE;
-}
-
-SILC_FSM_STATE(test_st_second)
-{
-  Foo f = fsm_context;
-  const char *ip, *host;
-  SilcUInt16 port;
-
-  SILC_LOG_DEBUG(("test_st_second"));
-
-  SILC_FSM_EVENT_WAIT(&f->sema);
-
-  if (f->client_status != SILC_NET_OK) {
-    /** Accepting new connection failed */
-    SILC_LOG_DEBUG(("Accepting failed %d", f->client_status));
-    silc_fsm_next(fsm, test_st_finish);
-    return SILC_FSM_CONTINUE;
-  }
-
-  silc_socket_stream_get_info(f->client_stream, NULL, &host, &ip, &port);
-  SILC_LOG_DEBUG(("Accepted new connection %s, %s:%d", host, ip, port));
-
-  /** Wait thread to terminate */
-  f->success = TRUE;
-  silc_fsm_next(fsm, test_st_finish);
-  SILC_FSM_THREAD_WAIT(&f->thread);
-}
-
-SILC_FSM_STATE(test_st_finish)
-{
-  Foo f = fsm_context;
-
-  SILC_LOG_DEBUG(("test_st_finish"));
-
-  if (f->server_stream) {
-    silc_stream_close(f->server_stream);
-    silc_stream_destroy(f->server_stream);
-  }
-  if (f->client_stream) {
-    silc_stream_close(f->client_stream);
-    silc_stream_destroy(f->client_stream);
-  }
-
-  SILC_LOG_DEBUG(("Closing network listener"));
-  silc_net_close_listener(f->server);
-
-  SILC_LOG_DEBUG(("Finish machine"));
-  return SILC_FSM_FINISH;
-}
-
-static void destructor(SilcFSM fsm, void *fsm_context,
-                      void *destructor_context)
-{
-  SILC_LOG_DEBUG(("FSM destructor, stopping scheduler"));
-  silc_fsm_free(fsm);
-  silc_schedule_stop(schedule);
-}
-
-int main(int argc, char **argv)
-{
-  SilcBool success = FALSE;
-  SilcFSM fsm;
-  Foo f;
-
-  if (argc > 1 && !strcmp(argv[1], "-d")) {
-    silc_log_debug(TRUE);
-    silc_log_debug_hexdump(TRUE);
-    silc_log_set_debug_string("*net*,*stream*");
-  }
-
-  SILC_LOG_DEBUG(("Allocating scheduler"));
-  schedule = silc_schedule_init(0, NULL);
-
-  f = silc_calloc(1, sizeof(*f));
-  if (!f)
-    goto err;
-
-  SILC_LOG_DEBUG(("Allocating FSM context"));
-  fsm = silc_fsm_alloc(f, destructor, NULL, schedule);
-  if (!fsm)
-    goto err;
-  silc_fsm_start(fsm, test_st_start);
-  f->fsm = fsm;
-
-  SILC_LOG_DEBUG(("Running scheduler"));
-  silc_schedule(schedule);
-
-  if (!f->success)
-    goto err;
-
-  silc_schedule_uninit(schedule);
-  silc_free(f);
-
-  success = TRUE;
-
- err:
-  SILC_LOG_DEBUG(("Testing was %s", success ? "SUCCESS" : "FAILURE"));
-  fprintf(stderr, "Testing was %s\n", success ? "SUCCESS" : "FAILURE");
-
-  return success;
-}
diff --git a/lib/silcutil/tests/test_silcschedule.c b/lib/silcutil/tests/test_silcschedule.c
deleted file mode 100644 (file)
index 204f632..0000000
+++ /dev/null
@@ -1,122 +0,0 @@
-/* SilcSchedule tests */
-
-#include "silc.h"
-
-typedef void (*Callback)(void *context);
-
-#define NUM_TTASK 200
-#ifdef FD_SETSIZE
-#define NUM_FTASK FD_SETSIZE
-#else
-#define NUM_FTASK 250
-#endif
-
-SilcSchedule schedule;
-
-void notify_cb(SilcSchedule schedule, SilcBool added, SilcTask task,
-              SilcBool fd_task, SilcUInt32 fd, long sec, long usec,
-              void *context)
-{
-  SILC_LOG_DEBUG(("Notify cb, %s %s task, fd %d, sec %d usec %d",
-                 added ? "added" : "deleted", fd_task ? "fd" :"timeout",
-                 fd, sec, usec));
-}
-
-SILC_TASK_CALLBACK(foo)
-{
-
-}
-
-SILC_TASK_CALLBACK(timeout)
-{
-  int i = (int)context;
-  SILC_LOG_DEBUG(("Timeout task %d", i));
-}
-
-SILC_TASK_CALLBACK(cont2)
-{
-#ifdef SILC_DEBUG
-  silc_schedule_stats(schedule);
-#endif /* SILC_DEBUG */
-
-  SILC_LOG_DEBUG(("Adding %d fd tasks", NUM_FTASK - 10));
-
-#if 0
-  for (i = 0; i < NUM_FTASK - 10; i++)
-    silc_schedule_task_add_fd(schedule, i + 5, foo, (void *)(i + 5));
-#endif
-}
-
-SILC_TASK_CALLBACK(cont)
-{
-  int i;
-
-#ifdef SILC_DEBUG
-  silc_schedule_stats(schedule);
-#endif /* SILC_DEBUG */
-
-  SILC_LOG_DEBUG(("Adding %d timeout tasks", NUM_TTASK / 3));
-  for (i = 0; i < NUM_TTASK / 3; i++)
-    silc_schedule_task_add_timeout(schedule, timeout, (void *)i, 0, 0);
-
-  silc_schedule_task_add_timeout(schedule, cont2, (void *)i, 0, 100);
-}
-
-SILC_TASK_CALLBACK(start)
-{
-  int i;
-
-  SILC_LOG_DEBUG(("Adding %d timeout tasks", NUM_TTASK));
-
-#if 0
-  for (i = 0; i < NUM_TTASK; i++)
-    silc_schedule_task_add_timeout(schedule, timeout, (void *)i,
-       i + (i & 9999), (i * 720391) & 999999);
-#endif
-
-  for (i = 0; i < NUM_TTASK; i++)
-    silc_schedule_task_add_timeout(schedule, timeout, (void *)i, 0, 1);
-
-  silc_schedule_task_add_timeout(schedule, cont, (void *)i, 0, 100);
-}
-
-SILC_TASK_CALLBACK(interrupt)
-{
-  SILC_LOG_DEBUG(("SIGINT signal"));
-  silc_schedule_stop(schedule);
-}
-
-int main(int argc, char **argv)
-{
-  SilcBool success = FALSE;
-
-  if (argc > 1 && !strcmp(argv[1], "-d")) {
-    silc_log_debug(TRUE);
-    silc_log_quick(TRUE);
-    silc_log_debug_hexdump(TRUE);
-    silc_log_set_debug_string("*sched*,*hash*");
-  }
-
-  SILC_LOG_DEBUG(("Allocating scheduler"));
-  schedule = silc_schedule_init(NUM_FTASK, NULL);
-  if (!schedule)
-    goto err;
-  silc_schedule_set_notify(schedule, notify_cb, NULL);
-
-  silc_schedule_task_add_signal(schedule, SIGINT, interrupt, NULL);
-
-  silc_schedule_task_add_timeout(schedule, start, NULL, 1, 0);
-
-  SILC_LOG_DEBUG(("Running scheduler"));
-  silc_schedule(schedule);
-
-  silc_schedule_uninit(schedule);
-
-  success = TRUE;
-
- err:
-  SILC_LOG_DEBUG(("Testing was %s", success ? "SUCCESS" : "FAILURE"));
-  fprintf(stderr, "Testing was %s\n", success ? "SUCCESS" : "FAILURE");
-
-  return success;
-}
diff --git a/lib/silcutil/tests/test_silcstack.c b/lib/silcutil/tests/test_silcstack.c
deleted file mode 100644 (file)
index c2416c6..0000000
+++ /dev/null
@@ -1,106 +0,0 @@
-/* SilcStack tests */
-
-#include "silc.h"
-
-#define NUM_ALLS 300
-
-int main(int argc, char **argv)
-{
-  SilcBool success = FALSE;
-  SilcStack stack;
-  void *ptr, *ptr2;
-  int i;
-
-  if (argc > 1 && !strcmp(argv[1], "-d")) {
-    silc_log_debug(TRUE);
-    silc_log_debug_hexdump(TRUE);
-    silc_log_quick(TRUE);
-    silc_log_set_debug_string("*stack*");
-  }
-
-  SILC_LOG_DEBUG(("Allocating stack of default size (1024 bytes)"));
-  stack = silc_stack_alloc(0);
-  if (!stack)
-    goto err;
-  silc_stack_stats(stack);
-
-  SILC_LOG_DEBUG(("Allocating 2048 bytes from stack"));
-  ptr = silc_smalloc(stack, 2048);
-  if (!ptr)
-    goto err;
-  silc_stack_stats(stack);
-
-  SILC_LOG_DEBUG(("Freeing the stack"));
-  silc_stack_free(stack);
-
-  SILC_LOG_DEBUG(("Allocating stack of default size (1024 bytes)"));
-  stack = silc_stack_alloc(0);
-  if (!stack)
-    goto err;
-  silc_stack_stats(stack);
-
-  SILC_LOG_DEBUG(("Pushing and allocating %d times", NUM_ALLS));
-  if (!silc_stack_push(stack, NULL))
-    goto err;
-  for (i = 0; i < NUM_ALLS; i++) {
-    ptr2 = silc_smalloc(stack, (i + 1) * 7);
-    if (!ptr2)
-      goto err;
-  }
-  silc_stack_stats(stack);
-  silc_stack_pop(stack);
-  SILC_LOG_DEBUG(("Popping"));
-  silc_stack_stats(stack);
-
-  SILC_LOG_DEBUG(("Pushing and allocating %d times", NUM_ALLS));
-  if (!silc_stack_push(stack, NULL))
-    goto err;
-  for (i = 0; i < NUM_ALLS; i++) {
-    ptr2 = silc_smalloc(stack, (i + 1) * 7);
-    if (!ptr2)
-      goto err;
-  }
-  silc_stack_stats(stack);
-  silc_stack_pop(stack);
-  SILC_LOG_DEBUG(("Popping"));
-  silc_stack_stats(stack);
-
-  SILC_LOG_DEBUG(("Pushing %d times", NUM_ALLS / 2));
-  for (i = 0; i < NUM_ALLS / 2; i++) {
-    if (!silc_stack_push(stack, NULL))
-      goto err;
-    ptr2 = silc_smalloc(stack, (i + 1) * 7);
-    if (!ptr2)
-      goto err;
-  }
-  silc_stack_stats(stack);
-  SILC_LOG_DEBUG(("Popping %d times", NUM_ALLS / 2));
-  for (i = 0; i < NUM_ALLS / 2; i++)
-    silc_stack_pop(stack);
-  silc_stack_stats(stack);
-
-  SILC_LOG_DEBUG(("Pushing and reallocating %d times", NUM_ALLS / 10));
-  ptr2 = NULL;
-  if (!silc_stack_push(stack, NULL))
-    goto err;
-  for (i = 0; i < NUM_ALLS / 10; i++) {
-    ptr2 = silc_srealloc(stack, (i * 7), ptr2, (i + 1) * 7);
-    if (!ptr2)
-      goto err;
-  }
-  silc_stack_stats(stack);
-  silc_stack_pop(stack);
-  SILC_LOG_DEBUG(("Popping"));
-  silc_stack_stats(stack);
-
-  SILC_LOG_DEBUG(("Freeing the stack"));
-  silc_stack_free(stack);
-
-  success = TRUE;
-
- err:
-  SILC_LOG_DEBUG(("Testing was %s", success ? "SUCCESS" : "FAILURE"));
-  fprintf(stderr, "Testing was %s\n", success ? "SUCCESS" : "FAILURE");
-
-  return success;
-}
diff --git a/lib/silcutil/tests/test_silcstringprep.c b/lib/silcutil/tests/test_silcstringprep.c
deleted file mode 100644 (file)
index 62c0be2..0000000
+++ /dev/null
@@ -1,167 +0,0 @@
-/* Stringprep tests */
-
-#include "silc.h"
-
-typedef struct {
-  const char *comment;
-  const char *in;
-  const char *out;
-  int ret;
-  int enc;
-} test_st;
-
-const test_st tests[] = {
-  {"Prohibited *",
-   "foo*", "", SILC_STRINGPREP_ERR_PROHIBITED},
-  {"Prohibited ?",
-   "?foo", "", SILC_STRINGPREP_ERR_PROHIBITED},
-  {"Prohibited ,",
-   "f,f", "", SILC_STRINGPREP_ERR_PROHIBITED},
-  {"Prohibited !",
-   "!", "", SILC_STRINGPREP_ERR_PROHIBITED},
-  {"Prohibited @",
-   "foo@faa", "", SILC_STRINGPREP_ERR_PROHIBITED},
-  {"Normal casefold",
-   "Foobbeli-BofJFlkJDF", "foobbeli-bofjflkjdf"},
-  {"Nothing",
-   "sauna.silcnet.org", "sauna.silcnet.org"},
-  {"Nothing with #",
-   "#silc", "#silc"},
-  {"Locale test",
-   "Päivää", "päivää", 0, SILC_STRING_LOCALE},
-  {"Locale test2",
-   "#öäöö/&#\\#(&(&#(.äöäÄÖäÄÖÄÖ^'", 
-   "#öäöö/&#\\#(&(&#(.äöääöääöäö^'", 0, SILC_STRING_LOCALE},
-
-  /* Some libidn tests */
-  {"Map to nothing",
-   "foo\xC2\xAD\xCD\x8F\xE1\xA0\x86\xE1\xA0\x8B"
-   "bar" "\xE2\x80\x8B\xE2\x81\xA0" "baz\xEF\xB8\x80\xEF\xB8\x88"
-   "\xEF\xB8\x8F\xEF\xBB\xBF", "foobarbaz"},
-  {"Case folding ASCII U+0043 U+0041 U+0046 U+0045", "CAFE", "cafe"},
-  {"Case folding 8bit U+00DF (german sharp s)", "\xC3\x9F", "ss"},
-  {"Case folding U+0130 (turkish capital I with dot)",
-   "\xC4\xB0", "i\xcc\x87"},
-  {"ASCII space character U+0020", "\x20", "\x20",
-   SILC_STRINGPREP_ERR_PROHIBITED},
-  {"ASCII control characters U+0010 U+007F", "\x10\x7F", "\x10\x7F",
-   SILC_STRINGPREP_ERR_PROHIBITED},
-};
-
-const test_st tests_norm[] = {
-  {"Casefold 1",
-   "Pekka Riikonen", "pekka riikonen"},
-  {"Casefold 2",
-   "PEKKA RIIKONEN", "pekka riikonen"},
-  {"Casefold 3",
-   "pekka riikonen", "pekka riikonen"},
-  {"Casefold 4",
-   "#ksPPPAA", "#kspppaa"},
-  {"Normal casefold",
-   "Foobbeli-BofJFlkJDF", "foobbeli-bofjflkjdf"},
-  {"Nothing",
-   "sauna.silcnet.org", "sauna.silcnet.org"},
-  {"Locale test",
-   "Päivää", "päivää", 0, SILC_STRING_LOCALE},
-  {"Locale test2",
-   "#öäöö/&#\\#(&(&#(.äöäÄÖäÄÖÄÖ^'", 
-   "#öäöö/&#\\#(&(&#(.äöääöääöäö^'", 0, SILC_STRING_LOCALE},
-};
-
-int main(int argc, char **argv)
-{
-  SilcBool success = FALSE;
-  int i, enc;
-  unsigned char *out = NULL;
-  SilcUInt32 out_len;
-  SilcStringprepStatus ret;
-
-  if (argc > 1 && !strcmp(argv[1], "-d")) {
-    silc_log_debug(TRUE);
-    silc_log_debug_hexdump(TRUE);
-    silc_log_quick(TRUE);
-    silc_log_set_debug_string("*stringprep*,*utf8*");
-  }
-
-  SILC_LOG_DEBUG(("--- Identifier string tests"));
-
-  for (i = 0; i < sizeof(tests) / sizeof(tests[0]); i++) {
-    SILC_LOG_DEBUG(("Test case %d", i));
-    SILC_LOG_DEBUG((" %d: %s", i, tests[i].comment));
-    SILC_LOG_DEBUG((" %d: in: %s", i, tests[i].in));
-    SILC_LOG_DEBUG((" %d: out: %s", i, tests[i].out));
-    SILC_LOG_DEBUG((" %d: ret: %d", i, tests[i].ret));
-
-    if (!tests[i].enc)
-      enc = SILC_STRING_UTF8;
-    else
-      enc = tests[i].enc;
-    ret = silc_stringprep(tests[i].in, strlen(tests[i].in),
-                         enc, SILC_IDENTIFIER_PREP, 0,
-                         &out, &out_len, enc);
-    if (ret != SILC_STRINGPREP_OK) {
-      if (tests[i].ret != SILC_STRINGPREP_OK) {
-        SILC_LOG_DEBUG((" %d: Expected ret %d", i, ret));
-      } else {
-        SILC_LOG_DEBUG(("%d: Error: %d", i, ret));
-        goto err;
-      }
-    } else {
-      SILC_LOG_DEBUG((" %d: prepared out: %s", i, out));
-      SILC_LOG_HEXDUMP((" %d: prepared dump", i), out, out_len);
-      if (memcmp(out, tests[i].out, out_len)) {
-        SILC_LOG_DEBUG((" %d: Output mismatch", i));
-        goto err;
-      }
-    }
-    SILC_LOG_DEBUG((" %d: Output match", i));
-
-    silc_free(out);
-    out = NULL;
-  }
-
-  SILC_LOG_DEBUG(("--- Casefold tests"));
-
-  for (i = 0; i < sizeof(tests_norm) / sizeof(tests_norm[0]); i++) {
-    SILC_LOG_DEBUG(("Test case %d", i));
-    SILC_LOG_DEBUG((" %d: %s", i, tests_norm[i].comment));
-    SILC_LOG_DEBUG((" %d: in: %s", i, tests_norm[i].in));
-    SILC_LOG_DEBUG((" %d: out: %s", i, tests_norm[i].out));
-    SILC_LOG_DEBUG((" %d: ret: %d", i, tests_norm[i].ret));
-
-    if (!tests_norm[i].enc)
-      enc = SILC_STRING_UTF8;
-    else
-      enc = tests_norm[i].enc;
-    ret = silc_stringprep(tests_norm[i].in, strlen(tests_norm[i].in),
-                         enc, SILC_CASEFOLD_PREP, 0,
-                         &out, &out_len, enc);
-    if (ret != SILC_STRINGPREP_OK) {
-      if (tests_norm[i].ret != SILC_STRINGPREP_OK) {
-        SILC_LOG_DEBUG((" %d: Expected ret %d", i, ret));
-      } else {
-        SILC_LOG_DEBUG(("%d: Error: %d", i, ret));
-        goto err;
-      }
-    } else {
-      SILC_LOG_DEBUG((" %d: prepared out: %s", i, out));
-      SILC_LOG_HEXDUMP((" %d: prepared dump", i), out, out_len);
-      if (memcmp(out, tests_norm[i].out, out_len)) {
-        SILC_LOG_DEBUG((" %d: Output mismatch", i));
-        goto err;
-      }
-    }
-    SILC_LOG_DEBUG((" %d: Output match", i));
-
-    silc_free(out);
-    out = NULL;
-  }
-
-  success = TRUE;
-
- err:
-  SILC_LOG_DEBUG(("Testing was %s", success ? "SUCCESS" : "FAILURE"));
-  fprintf(stderr, "Testing was %s\n", success ? "SUCCESS" : "FAILURE");
-
-  return success;
-}
diff --git a/lib/silcutil/tests/test_silcstrutil.c b/lib/silcutil/tests/test_silcstrutil.c
deleted file mode 100644 (file)
index 0673199..0000000
+++ /dev/null
@@ -1,172 +0,0 @@
-/* UTF-8 decoding tests */
-/* Other string util tests too */
-
-#include "silc.h"
-
-#define utf8fail(n, data, len)                 \
-const unsigned char u##n[] = (data);           \
-int u##n##l = len;
-
-#define utf8failc(n)                                                         \
-do {                                                                         \
-  if (!silc_utf8_valid(u##n, u##n##l))                                       \
-    SILC_LOG_DEBUG(("%d: not valid UTF-8, correctly detected, no error", n)); \
-  else {                                                                     \
-    SILC_LOG_DEBUG(("%d: parser did not detect malformed UTF-8, error", n));  \
-    goto err;                                                                \
-  }                                                                          \
-} while(0)
-
-/* UTF-8 Test vectors that MUST fail */
-utf8fail(1, "\x80", 1);
-utf8fail(2, "\xbf", 1);
-utf8fail(3, "\xfe", 1);
-utf8fail(4, "\xff", 1);
-utf8fail(5, "\xfe\xfe\xff\xff", 4);
-utf8fail(6, "\xc0\xa0", 2);
-utf8fail(7, "\xe0\x80\xaf", 3);
-utf8fail(8, "\xf0\x80\x80\xaf", 4);
-utf8fail(9, "\xf8\x80\x80\x80\xaf", 5);
-utf8fail(10, "\xfc\x80\x80\x80\x80\xaf", 6);
-utf8fail(11, "\xc0\x80", 2);
-utf8fail(12, "\xe0\x80\x80", 3);
-utf8fail(13, "\xf0\x80\x80\x80", 4);
-utf8fail(14, "\xf8\x80\x80\x80\x80", 5);
-utf8fail(15, "\xfc\x80\x80\x80\x80\x80", 6);
-utf8fail(16, "\xc1\xbf", 2);
-utf8fail(17, "\xe0\x9f\xbf", 3);
-utf8fail(18, "\xf0\x8f\xbf\xbf", 4);
-utf8fail(19, "\xf8\x87\xbf\xbf\xbf", 5);
-utf8fail(20, "\xfc\x83\xbf\xbf\xbf\xbf", 6);
-utf8fail(21, "\xed\xa0\x80", 3);
-utf8fail(22, "\xed\xad\xbf", 3);
-utf8fail(23, "\xed\xae\x80", 3);
-utf8fail(24, "\xed\xaf\xbf", 3);
-utf8fail(25, "\xed\xb0\x80", 3);
-utf8fail(26, "\xed\xbe\x80", 3);
-utf8fail(27, "\xed\xbf\xbf", 3);
-utf8fail(28, "\xfc\x20\xfd\x20", 4);
-utf8fail(29, "\xf8\xf9\xfa\xfb", 4);
-utf8fail(30, "\xf0\x20\xf9\x20\xfa\x20\xfb\x20", 8);
-
-int main(int argc, char **argv)
-{
-  SilcBool success = FALSE;
-  unsigned char *s1, *s2, *s3, *s4;
-  int l, opt;
-
-  while ((opt = getopt(argc, argv, "hVd")) != EOF) {
-      switch(opt) {
-        case 'h':
-          printf("usage: test_silcstrutil\n");
-         exit(0);
-          break;
-        case 'V':
-          printf("Secure Internet Live Conferencing\n");
-          exit(0);
-          break;
-        case 'd':
-          silc_log_debug(TRUE);
-         silc_log_debug_hexdump(TRUE);
-         silc_log_quick(TRUE);
-          if (optarg)
-            silc_log_set_debug_string(optarg);
-         else
-           silc_log_set_debug_string("*strutil*");
-          break;
-       default:
-         exit(1);
-         break;
-      }
-  }
-
-  /* Failure tests */
-  utf8failc(1);  utf8failc(2);
-  utf8failc(3);  utf8failc(4);
-  utf8failc(5);  utf8failc(6);
-  utf8failc(7);  utf8failc(8);
-  utf8failc(9);  utf8failc(10);
-  utf8failc(11);  utf8failc(12);
-  utf8failc(13);  utf8failc(14);
-  utf8failc(15);  utf8failc(16);
-  utf8failc(17);  utf8failc(18);
-  utf8failc(19);  utf8failc(20);
-  utf8failc(21);  utf8failc(22);
-  utf8failc(23);  utf8failc(24);
-  utf8failc(25);  utf8failc(26);
-  utf8failc(27);  utf8failc(28);
-  utf8failc(29);  utf8failc(30);
-
-  /* LDAP DN simple test */
-  s1 = "#&?*Pekka, \\Riikonen, <foobar@foobar.com>\xc4\x8d\\ ";
-  SILC_LOG_DEBUG(("s1 = %s", s1));
-
-  /* To LDAP DN */
-  l = silc_utf8_decoded_len(s1, strlen(s1), SILC_STRING_LDAP_DN);
-  if (!l)
-    goto err;
-  s3 = silc_calloc(l + 1, sizeof(*s3));
-  silc_utf8_decode(s1, strlen(s1), SILC_STRING_LDAP_DN, s3, l);
-  SILC_LOG_DEBUG(("ldapdn = %s", s3));
-
-  /* To UTF-8 */
-  l = silc_utf8_encoded_len(s3, strlen(s3), SILC_STRING_LDAP_DN);
-  if (!l)
-    goto err;  
-  s4 = silc_calloc(l + 1, sizeof(*s4));
-  silc_utf8_encode(s3, strlen(s3), SILC_STRING_LDAP_DN, s4, l);
-  SILC_LOG_DEBUG(("utf8 = %s", s4));
-
-  if (memcmp(s4, s1, strlen(s4))) {
-    SILC_LOG_DEBUG(("UTF-8 mismatch"));
-    goto err;
-  }
-  silc_free(s3);
-  silc_free(s4);
-
-  /* UTF-8 strcasecmp test */
-  SILC_LOG_DEBUG(("silc_utf8_strcasecmp test"));
-  s1 = "Päivää vuan Yrjö";
-  s2 = "PÄIVÄÄ VUAN YRJÖ";
-  l = silc_utf8_encoded_len(s1, strlen(s1), SILC_STRING_LOCALE);
-  if (!l)
-    goto err;  
-  s3 = silc_calloc(l + 1, sizeof(*s3));
-  silc_utf8_encode(s1, strlen(s1), SILC_STRING_LOCALE, s3, l);
-
-  l = silc_utf8_encoded_len(s2, strlen(s2), SILC_STRING_LOCALE);
-  if (!l)
-    goto err;  
-  s4 = silc_calloc(l + 1, sizeof(*s4));
-  silc_utf8_encode(s2, strlen(s2), SILC_STRING_LOCALE, s4, l);
-
-  SILC_LOG_DEBUG(("%s == %s", s3, s4));
-  if (!silc_utf8_strcasecmp(s3, s4)) {
-    SILC_LOG_DEBUG(("mismatch"));
-    goto err;
-  }
-  SILC_LOG_DEBUG(("match"));
-
-  silc_free(s3);
-  silc_free(s4);
-
-  /* Regex test */
-  SILC_LOG_DEBUG(("Simple regex test"));
-  s1 = "foo,bar,silc,com";
-  SILC_LOG_DEBUG(("Find 'silc' from %s", s1));
-  if (!silc_string_match(s1, "silc"))
-    goto err;
-  SILC_LOG_DEBUG(("Regex match"));
-  SILC_LOG_DEBUG(("Find 'foobar' from %s", s1));
-  if (silc_string_match(s1, "foobar"))
-    goto err;
-  SILC_LOG_DEBUG(("Regex not found (Ok)"));
-
-  success = TRUE;
-
- err:
-  SILC_LOG_DEBUG(("Testing was %s", success ? "SUCCESS" : "FAILURE"));
-  fprintf(stderr, "Testing was %s\n", success ? "SUCCESS" : "FAILURE");
-
-  return success;
-}
diff --git a/lib/silcutil/tests/test_silctime.c b/lib/silcutil/tests/test_silctime.c
deleted file mode 100644 (file)
index bcfa713..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-/* SilcTime tests */
-
-#include "silc.h"
-
-int main(int argc, char **argv)
-{
-  SilcBool success = FALSE;
-  SilcTimeStruct curtime;
-
-  if (argc > 1 && !strcmp(argv[1], "-d")) {
-    silc_log_debug(TRUE);
-    silc_log_quick(TRUE);
-    silc_log_debug_hexdump(TRUE);
-    silc_log_set_debug_string("*time*");
-  }
-
-  SILC_LOG_DEBUG(("Get current time"));
-  if (!silc_time_value(0, &curtime))
-    goto err;
-  SILC_LOG_DEBUG(("year      : %d", curtime.year));
-  SILC_LOG_DEBUG(("month     : %d", curtime.month));
-  SILC_LOG_DEBUG(("day       : %d", curtime.day));
-  SILC_LOG_DEBUG(("hour      : %d", curtime.hour));
-  SILC_LOG_DEBUG(("minute    : %d", curtime.minute));
-  SILC_LOG_DEBUG(("second    : %d", curtime.second));
-  SILC_LOG_DEBUG(("msecond   : %d", curtime.msecond));
-  SILC_LOG_DEBUG(("utc_hour  : %d", curtime.utc_hour));
-  SILC_LOG_DEBUG(("utc_min   : %d", curtime.utc_minute));
-  SILC_LOG_DEBUG(("utc_east  : %d", curtime.utc_east));
-  SILC_LOG_DEBUG(("dst       : %d", curtime.dst));
-
-  success = TRUE;
-
- err:
-  SILC_LOG_DEBUG(("Testing was %s", success ? "SUCCESS" : "FAILURE"));
-  fprintf(stderr, "Testing was %s\n", success ? "SUCCESS" : "FAILURE");
-
-  return success;
-}
diff --git a/lib/silcutil/unix/.cvsignore b/lib/silcutil/unix/.cvsignore
deleted file mode 100644 (file)
index 282522d..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-Makefile
-Makefile.in
diff --git a/lib/silcutil/unix/Makefile.am b/lib/silcutil/unix/Makefile.am
deleted file mode 100644 (file)
index bb9719e..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-#
-#  Makefile.am
-#
-#  Author: Pekka Riikonen <priikone@silcnet.org>
-#
-#  Copyright (C) 2001 - 2006 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; either version 2 of the License, or
-#  (at your option) any later version.
-#
-#  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.
-#
-
-AUTOMAKE_OPTIONS = 1.0 no-dependencies foreign
-
-noinst_LTLIBRARIES = libsilcunixutil.la
-
-libsilcunixutil_la_SOURCES =   \
-       silcunixschedule.c      \
-       silcunixnet.c           \
-       silcunixutil.c          \
-       silcunixsocketstream.c  \
-       silcunixthread.c
-
-include $(top_srcdir)/Makefile.defines.in
diff --git a/lib/silcutil/unix/silcunixnet.c b/lib/silcutil/unix/silcunixnet.c
deleted file mode 100644 (file)
index 2332672..0000000
+++ /dev/null
@@ -1,839 +0,0 @@
-/*
-
-  silcunixnet.c
-
-  Author: Pekka Riikonen <priikone@silcnet.org>
-
-  Copyright (C) 1997 - 2007 Pekka Riikonen
-
-  This program is free software; you can redistribute it and/or modify
-  it under the terms of the GNU General Public License as published by
-  the Free Software Foundation; version 2 of the License.
-
-  This program is distributed in the hope that it will be useful,
-  but WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-  GNU General Public License for more details.
-
-*/
-/* $Id$ */
-
-#include "silc.h"
-#include "silcnet.h"
-
-/************************** Types and definitions ***************************/
-
-#ifdef HAVE_IPV6
-#define SIZEOF_SOCKADDR(so) ((so).sa.sa_family == AF_INET6 ?   \
-  sizeof(so.sin6) : sizeof(so.sin))
-#else
-#define SIZEOF_SOCKADDR(so) (sizeof(so.sin))
-#endif
-
-typedef union {
-  struct sockaddr sa;
-  struct sockaddr_in sin;
-#ifdef HAVE_IPV6
-  struct sockaddr_in6 sin6;
-#endif
-} SilcSockaddr;
-
-/************************ Static utility functions **************************/
-
-static SilcBool silc_net_set_sockaddr(SilcSockaddr *addr, const char *ip_addr,
-                                     int port)
-{
-  int len;
-
-  memset(addr, 0, sizeof(*addr));
-
-  /* Check for IPv4 and IPv6 addresses */
-  if (ip_addr) {
-    if (!silc_net_is_ip(ip_addr)) {
-      SILC_LOG_ERROR(("%s is not IP address", ip_addr));
-      return FALSE;
-    }
-
-    if (silc_net_is_ip4(ip_addr)) {
-      /* IPv4 address */
-      len = sizeof(addr->sin.sin_addr);
-      silc_net_addr2bin(ip_addr,
-                       (unsigned char *)&addr->sin.sin_addr.s_addr, len);
-      addr->sin.sin_family = AF_INET;
-      addr->sin.sin_port = port ? htons(port) : 0;
-    } else {
-#ifdef HAVE_IPV6
-      /* IPv6 address */
-      len = sizeof(addr->sin6.sin6_addr);
-      silc_net_addr2bin(ip_addr,
-                       (unsigned char *)&addr->sin6.sin6_addr, len);
-      addr->sin6.sin6_family = AF_INET6;
-      addr->sin6.sin6_port = port ? htons(port) : 0;
-#else
-      SILC_LOG_ERROR(("IPv6 support is not compiled in"));
-      return FALSE;
-#endif
-    }
-  } else {
-    /* Any address */
-    addr->sin.sin_family = AF_INET;
-    addr->sin.sin_addr.s_addr = INADDR_ANY;
-    if (port)
-      addr->sin.sin_port = htons(port);
-  }
-
-  return TRUE;
-}
-
-/****************************** TCP Listener ********************************/
-
-/* Deliver new stream to upper layer */
-
-static void silc_net_accept_stream(SilcSocketStreamStatus status,
-                                  SilcStream stream, void *context)
-{
-  SilcNetListener listener = context;
-
-  if (status != SILC_SOCKET_OK)
-    return;
-
-  listener->callback(SILC_NET_OK, stream, listener->context);
-}
-
-/* Accept incoming connection and notify upper layer */
-
-SILC_TASK_CALLBACK(silc_net_accept)
-{
-  SilcNetListener listener = context;
-  int sock;
-
-  SILC_LOG_DEBUG(("Accepting new connection"));
-
-  sock = silc_net_accept_connection(fd);
-  if (sock < 0)
-    return;
-
-  /* Set socket options */
-  silc_net_set_socket_opt(sock, SOL_SOCKET, SO_REUSEADDR, 1);
-
-  /* Create socket stream */
-  silc_socket_tcp_stream_create(sock, listener->lookup,
-                               listener->require_fqdn, schedule,
-                               silc_net_accept_stream, listener);
-}
-
-/* Create TCP network listener */
-
-SilcNetListener
-silc_net_tcp_create_listener(const char **local_ip_addr,
-                            SilcUInt32 local_ip_count, int port,
-                            SilcBool lookup, SilcBool require_fqdn,
-                            SilcSchedule schedule,
-                            SilcNetCallback callback, void *context)
-{
-  SilcNetListener listener = NULL;
-  SilcSockaddr server;
-  int i, sock, rval;
-  const char *ipany = "0.0.0.0";
-
-  SILC_LOG_DEBUG(("Creating TCP listener"));
-
-  if (port < 0 || !schedule || !callback)
-    goto err;
-
-  listener = silc_calloc(1, sizeof(*listener));
-  if (!listener)
-    return NULL;
-  listener->schedule = schedule;
-  listener->callback = callback;
-  listener->context = context;
-  listener->require_fqdn = require_fqdn;
-  listener->lookup = lookup;
-
-  if (local_ip_count > 0) {
-    listener->socks = silc_calloc(local_ip_count, sizeof(*listener->socks));
-    if (!listener->socks)
-      return NULL;
-  } else {
-    listener->socks = silc_calloc(1, sizeof(*listener->socks));
-    if (!listener->socks)
-      return NULL;
-
-    local_ip_count = 1;
-  }
-
-  /* Bind to local addresses */
-  for (i = 0; i < local_ip_count; i++) {
-    SILC_LOG_DEBUG(("Binding to local address %s:%d",
-                   local_ip_addr ? local_ip_addr[i] : ipany, port));
-
-    /* Set sockaddr for server */
-    if (!silc_net_set_sockaddr(&server,
-                              local_ip_addr ? local_ip_addr[i] : ipany,
-                              port))
-      goto err;
-
-    /* Create the socket */
-    sock = socket(server.sin.sin_family, SOCK_STREAM, 0);
-    if (sock < 0) {
-      SILC_LOG_ERROR(("Cannot create socket: %s", strerror(errno)));
-      goto err;
-    }
-
-    /* Set the socket options */
-    rval = silc_net_set_socket_opt(sock, SOL_SOCKET, SO_REUSEADDR, 1);
-    if (rval < 0) {
-      SILC_LOG_ERROR(("Cannot set socket options: %s", strerror(errno)));
-      close(sock);
-      goto err;
-    }
-
-    /* Bind the listener socket */
-    rval = bind(sock, &server.sa, SIZEOF_SOCKADDR(server));
-    if (rval < 0) {
-      SILC_LOG_ERROR(("Cannot bind socket: %s", strerror(errno)));
-      close(sock);
-      goto err;
-    }
-
-    /* Specify that we are listenning */
-    rval = listen(sock, 64);
-    if (rval < 0) {
-      SILC_LOG_ERROR(("Cannot set socket listenning: %s", strerror(errno)));
-      close(sock);
-      goto err;
-    }
-
-    /* Set the server socket to non-blocking mode */
-    silc_net_set_socket_nonblock(sock);
-
-    /* Schedule for incoming connections */
-    silc_schedule_task_add_fd(schedule, sock, silc_net_accept, listener);
-
-    SILC_LOG_DEBUG(("TCP listener created, fd=%d", sock));
-    listener->socks[i] = sock;
-    listener->socks_count++;
-  }
-
-  return listener;
-
- err:
-  if (listener)
-    silc_net_close_listener(listener);
-  return NULL;
-}
-
-/* Close network listener */
-
-void silc_net_close_listener(SilcNetListener listener)
-{
-  int i;
-
-  SILC_LOG_DEBUG(("Closing network listener"));
-
-  for (i = 0; i < listener->socks_count; i++) {
-    silc_schedule_task_del_by_fd(listener->schedule, listener->socks[i]);
-    shutdown(listener->socks[i], 2);
-    close(listener->socks[i]);
-  }
-
-  silc_free(listener->socks);
-  silc_free(listener);
-}
-
-/******************************* UDP Stream *********************************/
-
-/* Create UDP stream */
-
-SilcStream
-silc_net_udp_connect(const char *local_ip_addr, int local_port,
-                    const char *remote_ip_addr, int remote_port,
-                    SilcSchedule schedule)
-{
-  SilcStream stream;
-  SilcSockaddr server;
-  int sock = -1, rval;
-  const char *ipany = "0.0.0.0";
-
-  SILC_LOG_DEBUG(("Creating UDP stream"));
-
-  if (!schedule)
-    goto err;
-
-  /* Bind to local addresses */
-  SILC_LOG_DEBUG(("Binding to local address %s",
-                 local_ip_addr ? local_ip_addr : ipany));
-
-  /* Set sockaddr for server */
-  if (!silc_net_set_sockaddr(&server, local_ip_addr ? local_ip_addr : ipany,
-                            local_port))
-    goto err;
-
-  /* Create the socket */
-  sock = socket(server.sin.sin_family, SOCK_DGRAM, 0);
-  if (sock < 0) {
-    SILC_LOG_ERROR(("Cannot create socket: %s", strerror(errno)));
-    goto err;
-  }
-
-  /* Set the socket options */
-  rval = silc_net_set_socket_opt(sock, SOL_SOCKET, SO_REUSEADDR, 1);
-  if (rval < 0) {
-    SILC_LOG_ERROR(("Cannot set socket options: %s", strerror(errno)));
-    goto err;
-  }
-#ifdef SO_REUSEPORT
-  rval = silc_net_set_socket_opt(sock, SOL_SOCKET, SO_REUSEPORT, 1);
-  if (rval < 0) {
-    SILC_LOG_ERROR(("Cannot set socket options: %s", strerror(errno)));
-    goto err;
-  }
-#endif /* SO_REUSEPORT */
-
-  /* Bind the listener socket */
-  rval = bind(sock, &server.sa, SIZEOF_SOCKADDR(server));
-  if (rval < 0) {
-    SILC_LOG_DEBUG(("Cannot bind socket: %s", strerror(errno)));
-    goto err;
-  }
-
-  /* Set to connected state if remote address is provided. */
-  if (remote_ip_addr && remote_port) {
-    if (!silc_net_set_sockaddr(&server, remote_ip_addr, remote_port))
-      goto err;
-
-    rval = connect(sock, &server.sa, SIZEOF_SOCKADDR(server));
-    if (rval < 0) {
-      SILC_LOG_DEBUG(("Cannot connect UDP stream: %s", strerror(errno)));
-      goto err;
-    }
-  }
-
-  /* Set send and receive buffer size */
-#ifdef SO_SNDBUF
-  rval = silc_net_set_socket_opt(sock, SOL_SOCKET, SO_SNDBUF, 765535);
-  if (rval < 0) {
-    rval = silc_net_set_socket_opt(sock, SOL_SOCKET, SO_SNDBUF, 65535);
-    if (rval < 0) {
-      SILC_LOG_ERROR(("Cannot set socket options: %s", strerror(errno)));
-      goto err;
-    }
-  }
-#endif /* SO_SNDBUF */
-#ifdef SO_RCVBUF
-  rval = silc_net_set_socket_opt(sock, SOL_SOCKET, SO_RCVBUF, 765535);
-  if (rval < 0) {
-    rval = silc_net_set_socket_opt(sock, SOL_SOCKET, SO_RCVBUF, 65535);
-    if (rval < 0) {
-      SILC_LOG_ERROR(("Cannot set socket options: %s", strerror(errno)));
-      goto err;
-    }
-  }
-#endif /* SO_RCVBUF */
-
-  /* Encapsulate into socket stream */
-  stream =
-    silc_socket_udp_stream_create(sock, local_ip_addr ?
-                                 silc_net_is_ip6(local_ip_addr) : FALSE,
-                                 remote_ip_addr ? TRUE : FALSE, schedule);
-  if (!stream)
-    goto err;
-
-  SILC_LOG_DEBUG(("UDP stream created, fd=%d", sock));
-  return stream;
-
- err:
-  if (sock != -1)
-    close(sock);
-  return NULL;
-}
-
-/* Receive UDP packet */
-
-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)
-{
-  SilcSocketStream sock = stream;
-  SilcSockaddr s;
-  struct sockaddr *from;
-  int len, flen;
-
-  SILC_LOG_DEBUG(("Reading data from UDP socket %d", sock->sock));
-
-  if (remote_ip_addr && remote_port) {
-    if (sock->ipv6) {
-#ifdef HAVE_IPV6
-      from = (struct sockaddr *)&s.sin6;
-      flen = sizeof(s.sin6);
-#endif /* HAVE_IPV6 */
-    } else {
-      from = (struct sockaddr *)&s.sin;
-      flen = sizeof(s.sin);
-    }
-    len = recvfrom(sock->sock, ret_data, data_size, 0, from, &flen);
-  } else
-    len = recv(sock->sock, ret_data, data_size, 0);
-
-  if (len < 0) {
-    if (errno == EAGAIN || errno == EINTR) {
-      SILC_LOG_DEBUG(("Could not read immediately, will do it later"));
-      silc_schedule_set_listen_fd(sock->schedule, sock->sock,
-                                 SILC_TASK_READ, FALSE);
-      return -1;
-    }
-    SILC_LOG_DEBUG(("Cannot read from UDP socket: %d:%s",
-                   sock->sock, strerror(errno)));
-    silc_schedule_unset_listen_fd(sock->schedule, sock->sock);
-    sock->sock_error = errno;
-    return -2;
-  }
-
-  SILC_LOG_DEBUG(("Read %d bytes", len));
-
-  if (!len)
-    silc_schedule_unset_listen_fd(sock->schedule, sock->sock);
-
-  /* Return remote address */
-  if (remote_ip_addr && remote_port) {
-    if (sock->ipv6) {
-#ifdef HAVE_IPV6
-      *remote_port = ntohs(s.sin6.sin6_port);
-      inet_ntop(AF_INET6, &s.sin6.sin6_addr, remote_ip_addr,
-               remote_ip_addr_size);
-#else
-      *remote_port = 0;
-#endif /* HAVE_IPV6 */
-    } else {
-      *remote_port = ntohs(s.sin.sin_port);
-      inet_ntop(AF_INET, &s.sin.sin_addr, remote_ip_addr,
-               remote_ip_addr_size);
-    }
-
-    SILC_LOG_DEBUG(("UDP packet from %s:%d", remote_ip_addr, *remote_port));
-  }
-
-  return len;
-}
-
-/* Send UDP packet */
-
-int silc_net_udp_send(SilcStream stream,
-                     const char *remote_ip_addr, int remote_port,
-                     const unsigned char *data, SilcUInt32 data_len)
-{
-  SilcSocketStream sock = stream;
-  SilcSockaddr remote;
-  int ret;
-
-  SILC_LOG_DEBUG(("Sending data to UDP socket %d", sock->sock));
-
-  /* Set sockaddr */
-  if (!silc_net_set_sockaddr(&remote, remote_ip_addr, remote_port))
-    return -2;
-
-  /* Send */
-  ret = sendto(sock->sock, data, data_len, 0, &remote.sa,
-              SIZEOF_SOCKADDR(remote));
-  if (ret < 0) {
-    if (errno == EAGAIN || errno == EINTR) {
-      SILC_LOG_DEBUG(("Could not send immediately, will do it later"));
-      silc_schedule_set_listen_fd(sock->schedule, sock->sock,
-                                 SILC_TASK_READ | SILC_TASK_WRITE, FALSE);
-      return -1;
-    }
-    SILC_LOG_DEBUG(("Cannot send to UDP socket: %s", strerror(errno)));
-    silc_schedule_unset_listen_fd(sock->schedule, sock->sock);
-    sock->sock_error = errno;
-    return -2;
-  }
-
-  SILC_LOG_DEBUG(("Sent data %d bytes", ret));
-  if (silc_schedule_get_fd_events(sock->schedule, sock->sock) &
-      SILC_TASK_WRITE)
-    silc_schedule_set_listen_fd(sock->schedule, sock->sock,
-                               SILC_TASK_READ, FALSE);
-
-  return ret;
-}
-
-/******************************* TCP Stream *********************************/
-
-/* Asynchronous TCP/IP connecting */
-
-typedef struct {
-  SilcNetStatus status;
-  SilcSocketStreamStatus stream_status;
-  SilcStream stream;
-  SilcFSMStruct fsm;
-  SilcFSMEventStruct event;
-  SilcAsyncOperation op;
-  SilcAsyncOperation sop;
-  char *local_ip;
-  char *remote;
-  char ip_addr[64];
-  int sock;
-  SilcNetCallback callback;
-  void *context;
-  unsigned int port     : 24;
-  unsigned int retry    : 7;
-  unsigned int aborted  : 1;
-} *SilcNetConnect;
-
-SILC_FSM_STATE(silc_net_connect_st_start);
-SILC_FSM_STATE(silc_net_connect_st_connected);
-SILC_FSM_STATE(silc_net_connect_st_stream);
-SILC_FSM_STATE(silc_net_connect_st_finish);
-
-SILC_TASK_CALLBACK(silc_net_connect_wait)
-{
-  SilcNetConnect conn = context;
-  SILC_FSM_EVENT_SIGNAL(&conn->event);
-}
-
-SILC_FSM_STATE(silc_net_connect_st_start)
-{
-  SilcNetConnect conn = fsm_context;
-  int sock, rval;
-  SilcSockaddr desthost;
-  SilcBool prefer_ipv6 = TRUE;
-
-  if (conn->aborted) {
-    /** Aborted */
-    silc_fsm_next(fsm, silc_net_connect_st_finish);
-    return SILC_FSM_CONTINUE;
-  }
-
-  /* Do host lookup */
- retry:
-  if (!silc_net_gethostbyname(conn->remote, prefer_ipv6,
-                             conn->ip_addr, sizeof(conn->ip_addr))) {
-    SILC_LOG_ERROR(("Network (%s) unreachable: could not resolve the "
-                   "host", conn->remote));
-
-    /** Network unreachable */
-    conn->status = SILC_NET_HOST_UNREACHABLE;
-    silc_fsm_next(fsm, silc_net_connect_st_finish);
-    return SILC_FSM_CONTINUE;
-  }
-
-  /* Set sockaddr for this connection */
-  if (!silc_net_set_sockaddr(&desthost, conn->ip_addr, conn->port)) {
-    /** Sockaddr failed */
-    silc_fsm_next(fsm, silc_net_connect_st_finish);
-    return SILC_FSM_CONTINUE;
-  }
-
-  /* Create the connection socket */
-  sock = socket(desthost.sin.sin_family, SOCK_STREAM, 0);
-  if (sock < 0) {
-    /* If address is IPv6, then fallback to IPv4 and see whether we can do
-       better with that on socket creation. */
-    if (prefer_ipv6 && silc_net_is_ip6(conn->ip_addr)) {
-      prefer_ipv6 = FALSE;
-      goto retry;
-    }
-
-    /** Cannot create socket */
-    SILC_LOG_ERROR(("Cannot create socket: %s", strerror(errno)));
-    silc_fsm_next(fsm, silc_net_connect_st_finish);
-    return SILC_FSM_CONTINUE;
-  }
-
-  /* Bind to the local address if provided */
-  if (conn->local_ip) {
-    SilcSockaddr local;
-
-    /* Set sockaddr for local listener, and try to bind it. */
-    if (silc_net_set_sockaddr(&local, conn->local_ip, 0))
-      bind(sock, &local.sa, SIZEOF_SOCKADDR(local));
-  }
-
-  /* Set the socket to non-blocking mode */
-  silc_net_set_socket_nonblock(sock);
-
-  /* Connect to the host */
-  rval = connect(sock, &desthost.sa, SIZEOF_SOCKADDR(desthost));
-  if (rval < 0) {
-    if (errno != EINPROGRESS) {
-      shutdown(sock, 2);
-      close(sock);
-
-      /* Retry using an IPv4 adress, if IPv6 didn't work */
-      if (prefer_ipv6 && silc_net_is_ip6(conn->ip_addr)) {
-        prefer_ipv6 = FALSE;
-        goto retry;
-      }
-
-      /** Cannot connect to remote host */
-      SILC_LOG_ERROR(("Cannot connect to remote host: %s", strerror(errno)));
-      silc_fsm_next(fsm, silc_net_connect_st_finish);
-      return SILC_FSM_CONTINUE;
-    }
-  }
-
-  /* Set appropriate options */
-#if defined(TCP_NODELAY)
-  silc_net_set_socket_opt(sock, IPPROTO_TCP, TCP_NODELAY, 1);
-#endif
-  silc_net_set_socket_opt(sock, SOL_SOCKET, SO_KEEPALIVE, 1);
-
-  SILC_LOG_DEBUG(("Connection operation in progress"));
-
-  conn->sock = sock;
-
-  /** Wait for connection */
-  silc_fsm_next(fsm, silc_net_connect_st_connected);
-  silc_fsm_event_init(&conn->event, fsm);
-  silc_schedule_task_add_fd(silc_fsm_get_schedule(fsm), sock,
-                           silc_net_connect_wait, conn);
-  silc_schedule_set_listen_fd(silc_fsm_get_schedule(fsm), sock,
-                             SILC_TASK_WRITE, FALSE);
-  SILC_FSM_EVENT_WAIT(&conn->event);
-  return SILC_FSM_CONTINUE;
-}
-
-static void silc_net_connect_wait_stream(SilcSocketStreamStatus status,
-                                        SilcStream stream, void *context)
-{
-  SilcNetConnect conn = context;
-  conn->sop = NULL;
-  conn->stream_status = status;
-  conn->stream = stream;
-  SILC_FSM_CALL_CONTINUE(&conn->fsm);
-}
-
-SILC_FSM_STATE(silc_net_connect_st_connected)
-{
-  SilcNetConnect conn = fsm_context;
-  SilcSchedule schedule = silc_fsm_get_schedule(fsm);
-  int opt = EINVAL, optlen = sizeof(opt), ret;
-
-  if (conn->aborted) {
-    /** Aborted */
-    silc_schedule_unset_listen_fd(schedule, conn->sock);
-    silc_schedule_task_del_by_fd(schedule, conn->sock);
-    silc_fsm_next(fsm, silc_net_connect_st_finish);
-    return SILC_FSM_CONTINUE;
-  }
-
-  ret = silc_net_get_socket_opt(conn->sock, SOL_SOCKET, SO_ERROR,
-                               &opt, &optlen);
-
-  silc_schedule_unset_listen_fd(schedule, conn->sock);
-  silc_schedule_task_del_by_fd(schedule, conn->sock);
-
-  if (ret != 0 || opt != 0) {
-    if (conn->retry) {
-      /** Retry connecting */
-      SILC_LOG_DEBUG(("Retry connecting"));
-      conn->retry--;
-      silc_net_close_connection(conn->sock);
-      silc_fsm_next(fsm, silc_net_connect_st_start);
-      return SILC_FSM_CONTINUE;
-    }
-
-#if defined(ECONNREFUSED)
-    if (opt == ECONNREFUSED)
-      conn->status = SILC_NET_CONNECTION_REFUSED;
-#endif /* ECONNREFUSED */
-#if defined(ETIMEDOUT)
-    if (opt == ETIMEDOUT)
-      conn->status = SILC_NET_CONNECTION_TIMEOUT;
-#endif /* ETIMEDOUT */
-#if defined(ENETUNREACH)
-    if (opt == ENETUNREACH)
-      conn->status = SILC_NET_HOST_UNREACHABLE;
-#endif /* ENETUNREACH */
-
-    /** Connecting failed */
-    SILC_LOG_DEBUG(("Connecting failed, error %s", strerror(opt)));
-    silc_fsm_next(fsm, silc_net_connect_st_finish);
-    return SILC_FSM_CONTINUE;
-  }
-
-  SILC_LOG_DEBUG(("TCP connection established"));
-
-  /** Connection created */
-  silc_fsm_next(fsm, silc_net_connect_st_stream);
-  SILC_FSM_CALL((conn->sop = silc_socket_tcp_stream_create(
-                                    conn->sock, TRUE, FALSE, schedule,
-                                    silc_net_connect_wait_stream, conn)));
-}
-
-SILC_FSM_STATE(silc_net_connect_st_stream)
-{
-  SilcNetConnect conn = fsm_context;
-
-  if (conn->aborted) {
-    /** Aborted */
-    silc_fsm_next(fsm, silc_net_connect_st_finish);
-    return SILC_FSM_CONTINUE;
-  }
-
-  if (conn->stream_status != SILC_SOCKET_OK) {
-    /** Stream creation failed */
-    if (conn->stream_status == SILC_SOCKET_UNKNOWN_IP)
-      conn->status = SILC_NET_UNKNOWN_IP;
-    else if (conn->stream_status == SILC_SOCKET_UNKNOWN_HOST)
-      conn->status = SILC_NET_UNKNOWN_HOST;
-    else
-      conn->status = SILC_NET_ERROR;
-    silc_fsm_next(fsm, silc_net_connect_st_finish);
-    return SILC_FSM_CONTINUE;
-  }
-
-  /** Stream created successfully */
-  SILC_LOG_DEBUG(("Connected successfully, sock %d", conn->sock));
-  conn->status = SILC_NET_OK;
-  silc_fsm_next(fsm, silc_net_connect_st_finish);
-  return SILC_FSM_CONTINUE;
-}
-
-SILC_FSM_STATE(silc_net_connect_st_finish)
-{
-  SilcNetConnect conn = fsm_context;
-
-  /* Deliver error or new stream */
-  if (!conn->aborted) {
-    conn->callback(conn->status, conn->stream, conn->context);
-    if (conn->op)
-      silc_async_free(conn->op);
-  }
-
-  if (conn->sock && conn->status != SILC_NET_OK)
-    silc_net_close_connection(conn->sock);
-
-  return SILC_FSM_FINISH;
-}
-
-static void silc_net_connect_abort(SilcAsyncOperation op, void *context)
-{
-  SilcNetConnect conn = context;
-  conn->aborted = TRUE;
-
-  /* Abort underlaying stream creation too */
-  if (conn->sop) {
-    silc_async_abort(conn->sop, NULL, NULL);
-    conn->sop = NULL;
-  }
-}
-
-static void silc_net_connect_destructor(SilcFSM fsm, void *fsm_context,
-                                       void *destructor_context)
-{
-  SilcNetConnect conn = fsm_context;
-  silc_free(conn->local_ip);
-  silc_free(conn->remote);
-  silc_free(conn);
-}
-
-/* Create asynchronous TCP/IP connection. */
-
-SilcAsyncOperation silc_net_tcp_connect(const char *local_ip_addr,
-                                       const char *remote_ip_addr,
-                                       int remote_port,
-                                       SilcSchedule schedule,
-                                       SilcNetCallback callback,
-                                       void *context)
-{
-  SilcNetConnect conn;
-
-  if (!remote_ip_addr || remote_port < 1 || !schedule || !callback)
-    return NULL;
-
-  SILC_LOG_DEBUG(("Creating connection to host %s port %d",
-                 remote_ip_addr, remote_port));
-
-  conn = silc_calloc(1, sizeof(*conn));
-  if (!conn) {
-    callback(SILC_NET_NO_MEMORY, NULL, context);
-    return NULL;
-  }
-
-  /* Start async operation */
-  conn->op = silc_async_alloc(silc_net_connect_abort, NULL, conn);
-  if (!conn->op) {
-    silc_free(conn);
-    callback(SILC_NET_NO_MEMORY, NULL, context);
-    return NULL;
-  }
-
-  if (local_ip_addr)
-    conn->local_ip = strdup(local_ip_addr);
-  conn->remote = strdup(remote_ip_addr);
-  if (!conn->remote) {
-    silc_async_free(conn->op);
-    silc_free(conn->local_ip);
-    silc_free(conn);
-    callback(SILC_NET_NO_MEMORY, NULL, context);
-    return NULL;
-  }
-  conn->port = remote_port;
-  conn->callback = callback;
-  conn->context = context;
-  conn->retry = 1;
-  conn->status = SILC_NET_ERROR;
-
-  silc_fsm_init(&conn->fsm, conn, silc_net_connect_destructor, NULL, schedule);
-  silc_fsm_start(&conn->fsm, silc_net_connect_st_start);
-
-  return conn->op;
-}
-
-/* Closes the connection by closing the socket connection. */
-
-void silc_net_close_connection(int sock)
-{
-  SILC_LOG_DEBUG(("Closing sock %d", sock));
-  close(sock);
-}
-
-/* Set's the socket to non-blocking mode. */
-
-int silc_net_set_socket_nonblock(SilcSocket sock)
-{
-  return fcntl((int)sock, F_SETFL, fcntl(sock, F_GETFL, 0) | O_NONBLOCK);
-}
-
-/* Converts the IP number string from numbers-and-dots notation to
-   binary form. */
-
-SilcBool silc_net_addr2bin(const char *addr, void *bin, SilcUInt32 bin_len)
-{
-  int ret = 0;
-
-  if (silc_net_is_ip4(addr)) {
-    /* IPv4 address */
-    struct in_addr tmp;
-    ret = inet_aton(addr, &tmp);
-    if (bin_len < 4)
-      return FALSE;
-
-    memcpy(bin, (unsigned char *)&tmp.s_addr, 4);
-#ifdef HAVE_IPV6
-  } else {
-    struct addrinfo hints, *ai;
-    SilcSockaddr *s;
-
-    /* IPv6 address */
-    if (bin_len < 16)
-      return FALSE;
-
-    memset(&hints, 0, sizeof(hints));
-    hints.ai_family = AF_INET6;
-    if (getaddrinfo(addr, NULL, &hints, &ai))
-      return FALSE;
-
-    if (ai) {
-      s = (SilcSockaddr *)ai->ai_addr;
-      memcpy(bin, &s->sin6.sin6_addr, sizeof(s->sin6.sin6_addr));
-      freeaddrinfo(ai);
-    }
-
-    ret = TRUE;
-#endif /* HAVE_IPV6 */
-  }
-
-  return ret != 0;
-}
diff --git a/lib/silcutil/unix/silcunixschedule.c b/lib/silcutil/unix/silcunixschedule.c
deleted file mode 100644 (file)
index 80e8fbf..0000000
+++ /dev/null
@@ -1,617 +0,0 @@
-/*
-
-  silcunixschedule.c
-
-  Author: Pekka Riikonen <priikone@silcnet.org>
-
-  Copyright (C) 1998 - 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.
-
-*/
-/* $Id$ */
-
-#include "silc.h"
-
-#if defined(HAVE_EPOLL_WAIT)
-#include <sys/epoll.h>
-#elif defined(HAVE_POLL) && defined(HAVE_SETRLIMIT) && defined(RLIMIT_NOFILE)
-#include <poll.h>
-#endif
-
-const SilcScheduleOps schedule_ops;
-
-/* Internal context. */
-typedef struct {
-#if defined(HAVE_EPOLL_WAIT)
-  struct epoll_event *fds;
-  SilcUInt32 fds_count;
-  int epfd;
-#elif defined(HAVE_POLL) && defined(HAVE_SETRLIMIT) && defined(RLIMIT_NOFILE)
-  struct rlimit nofile;
-  struct pollfd *fds;
-  SilcUInt32 fds_count;
-#endif /* HAVE_POLL && HAVE_SETRLIMIT && RLIMIT_NOFILE */
-  void *app_context;
-  int wakeup_pipe[2];
-  SilcTask wakeup_task;
-  sigset_t signals;
-  sigset_t signals_blocked;
-} *SilcUnixScheduler;
-
-typedef struct {
-  SilcUInt32 sig;
-  SilcTaskCallback callback;
-  void *context;
-  SilcBool call;
-  SilcSchedule schedule;
-} SilcUnixSignal;
-
-#define SIGNAL_COUNT 32
-SilcUnixSignal signal_call[SIGNAL_COUNT];
-
-#if defined(HAVE_EPOLL_WAIT)
-
-/* Linux's fast epoll system (level triggered) */
-
-int silc_epoll(SilcSchedule schedule, void *context)
-{
-  SilcUnixScheduler internal = context;
-  SilcTaskFd task;
-  struct epoll_event *fds = internal->fds;
-  SilcUInt32 fds_count = internal->fds_count;
-  int ret, i, timeout = -1;
-
-  /* Allocate larger fd table if needed */
-  i = silc_hash_table_count(schedule->fd_queue);
-  if (i > fds_count) {
-    fds = silc_realloc(internal->fds, sizeof(*internal->fds) *
-                      (fds_count + (i / 2)));
-    if (silc_likely(fds)) {
-      internal->fds = fds;
-      internal->fds_count = fds_count = fds_count + (i / 2);
-    }
-  }
-
-  if (schedule->has_timeout)
-    timeout = ((schedule->timeout.tv_sec * 1000) +
-              (schedule->timeout.tv_usec / 1000));
-
-  SILC_SCHEDULE_UNLOCK(schedule);
-  ret = epoll_wait(internal->epfd, fds, fds_count, timeout);
-  SILC_SCHEDULE_LOCK(schedule);
-  if (ret <= 0)
-    return ret;
-
-  silc_list_init(schedule->fd_dispatch, struct SilcTaskStruct, next);
-
-  for (i = 0; i < ret; i++) {
-    task = fds[i].data.ptr;
-    task->revents = 0;
-    if (!task->header.valid || !task->events) {
-      epoll_ctl(internal->epfd, EPOLL_CTL_DEL, task->fd, &fds[i]);
-      continue;
-    }
-    if (fds[i].events & (EPOLLIN | EPOLLPRI | EPOLLHUP | EPOLLERR))
-      task->revents |= SILC_TASK_READ;
-    if (fds[i].events & EPOLLOUT)
-      task->revents |= SILC_TASK_WRITE;
-    silc_list_add(schedule->fd_dispatch, task);
-  }
-
-  return ret;
-}
-
-#elif defined(HAVE_POLL) && defined(HAVE_SETRLIMIT) && defined(RLIMIT_NOFILE)
-
-/* Calls normal poll() system call. */
-
-int silc_poll(SilcSchedule schedule, void *context)
-{
-  SilcUnixScheduler internal = context;
-  SilcHashTableList htl;
-  SilcTaskFd task;
-  struct pollfd *fds = internal->fds;
-  SilcUInt32 fds_count = internal->fds_count;
-  int fd, ret, i = 0, timeout = -1;
-  void *fdp;
-
-  silc_hash_table_list(schedule->fd_queue, &htl);
-  while (silc_hash_table_get(&htl, &fdp, (void *)&task)) {
-    if (!task->events)
-      continue;
-    fd = SILC_PTR_TO_32(fdp);
-
-    /* Allocate larger fd table if needed */
-    if (i >= fds_count) {
-      struct rlimit nofile;
-
-      fds = silc_realloc(internal->fds, sizeof(*internal->fds) *
-                        (fds_count + (fds_count / 2)));
-      if (silc_unlikely(!fds))
-       break;
-      internal->fds = fds;
-      internal->fds_count = fds_count = fds_count + (fds_count / 2);
-      internal->nofile.rlim_cur = fds_count;
-      if (fds_count > internal->nofile.rlim_max)
-       internal->nofile.rlim_max = fds_count;
-      if (setrlimit(RLIMIT_NOFILE, &nofile) < 0)
-       break;
-    }
-
-    fds[i].fd = fd;
-    fds[i].events = 0;
-    task->revents = fds[i].revents = 0;
-
-    if (task->events & SILC_TASK_READ)
-      fds[i].events |= (POLLIN | POLLPRI);
-    if (task->events & SILC_TASK_WRITE)
-      fds[i].events |= POLLOUT;
-    i++;
-  }
-  silc_hash_table_list_reset(&htl);
-  silc_list_init(schedule->fd_dispatch, struct SilcTaskStruct, next);
-
-  if (schedule->has_timeout)
-    timeout = ((schedule->timeout.tv_sec * 1000) +
-              (schedule->timeout.tv_usec / 1000));
-
-  fds_count = i;
-  SILC_SCHEDULE_UNLOCK(schedule);
-  ret = poll(fds, fds_count, timeout);
-  SILC_SCHEDULE_LOCK(schedule);
-  if (ret <= 0)
-    return ret;
-
-  for (i = 0; i < fds_count; i++) {
-    if (!fds[i].revents)
-      continue;
-    if (!silc_hash_table_find(schedule->fd_queue, SILC_32_TO_PTR(fds[i].fd),
-                             NULL, (void *)&task))
-      continue;
-    if (!task->header.valid || !task->events)
-      continue;
-
-    fd = fds[i].revents;
-    if (fd & (POLLIN | POLLPRI | POLLERR | POLLHUP | POLLNVAL))
-      task->revents |= SILC_TASK_READ;
-    if (fd & POLLOUT)
-      task->revents |= SILC_TASK_WRITE;
-    silc_list_add(schedule->fd_dispatch, task);
-  }
-
-  return ret;
-}
-
-#else
-
-/* Calls normal select() system call. */
-
-int silc_select(SilcSchedule schedule, void *context)
-{
-  SilcHashTableList htl;
-  SilcTaskFd task;
-  fd_set in, out;
-  int fd, max_fd = 0, ret;
-  void *fdp;
-
-  FD_ZERO(&in);
-  FD_ZERO(&out);
-
-  silc_hash_table_list(schedule->fd_queue, &htl);
-  while (silc_hash_table_get(&htl, &fdp, (void *)&task)) {
-    if (!task->events)
-      continue;
-    fd = SILC_PTR_TO_32(fdp);
-
-#ifdef FD_SETSIZE
-    if (fd >= FD_SETSIZE)
-      break;
-#endif /* FD_SETSIZE */
-
-    if (fd > max_fd)
-      max_fd = fd;
-
-    if (task->events & SILC_TASK_READ)
-      FD_SET(fd, &in);
-    if (task->events & SILC_TASK_WRITE)
-      FD_SET(fd, &out);
-
-    task->revents = 0;
-  }
-  silc_hash_table_list_reset(&htl);
-  silc_list_init(schedule->fd_dispatch, struct SilcTaskStruct, next);
-
-  SILC_SCHEDULE_UNLOCK(schedule);
-  ret = select(max_fd + 1, &in, &out, NULL, (schedule->has_timeout ?
-                                            &schedule->timeout : NULL));
-  SILC_SCHEDULE_LOCK(schedule);
-  if (ret <= 0)
-    return ret;
-
-  silc_hash_table_list(schedule->fd_queue, &htl);
-  while (silc_hash_table_get(&htl, &fdp, (void *)&task)) {
-    if (!task->header.valid || !task->events)
-      continue;
-    fd = SILC_PTR_TO_32(fdp);
-
-#ifdef FD_SETSIZE
-    if (fd >= FD_SETSIZE)
-      break;
-#endif /* FD_SETSIZE */
-
-    if (FD_ISSET(fd, &in))
-      task->revents |= SILC_TASK_READ;
-    if (FD_ISSET(fd, &out))
-      task->revents |= SILC_TASK_WRITE;
-    silc_list_add(schedule->fd_dispatch, task);
-  }
-  silc_hash_table_list_reset(&htl);
-
-  return ret;
-}
-
-#endif /* HAVE_POLL && HAVE_SETRLIMIT && RLIMIT_NOFILE */
-
-/* Schedule `task' with events `event_mask'. Zero `event_mask' unschedules. */
-
-SilcBool silc_schedule_internal_schedule_fd(SilcSchedule schedule,
-                                           void *context,
-                                           SilcTaskFd task,
-                                           SilcTaskEvent event_mask)
-{
-#if defined(HAVE_EPOLL_WAIT)
-  SilcUnixScheduler internal = (SilcUnixScheduler)context;
-  struct epoll_event event;
-
-  if (!internal)
-    return TRUE;
-
-  SILC_LOG_DEBUG(("Scheduling fd %lu, mask %x", task->fd, event_mask));
-
-  memset(&event, 0, sizeof(event));
-  if (event_mask & SILC_TASK_READ)
-    event.events |= (EPOLLIN | EPOLLPRI);
-  if (event_mask & SILC_TASK_WRITE)
-    event.events |= EPOLLOUT;
-
-  /* Zero mask unschedules task */
-  if (silc_unlikely(!event.events)) {
-    if (epoll_ctl(internal->epfd, EPOLL_CTL_DEL, task->fd, &event)) {
-      SILC_LOG_DEBUG(("epoll_ctl (DEL): %s", strerror(errno)));
-      return FALSE;
-    }
-    task->scheduled = FALSE;
-    return TRUE;
-  }
-
-  /* Schedule the task */
-  if (silc_unlikely(!task->scheduled)) {
-    event.data.ptr = task;
-    if (epoll_ctl(internal->epfd, EPOLL_CTL_ADD, task->fd, &event)) {
-      SILC_LOG_DEBUG(("epoll_ctl (ADD): %s", strerror(errno)));
-      return FALSE;
-    }
-    task->scheduled = TRUE;
-    return TRUE;
-  }
-
-  /* Schedule for specific mask */
-  event.data.ptr = task;
-  if (epoll_ctl(internal->epfd, EPOLL_CTL_MOD, task->fd, &event)) {
-    SILC_LOG_DEBUG(("epoll_ctl (MOD): %s", strerror(errno)));
-    return FALSE;
-  }
-#endif /* HAVE_EPOLL_WAIT */
-  return TRUE;
-}
-
-#ifdef SILC_THREADS
-
-SILC_TASK_CALLBACK(silc_schedule_wakeup_cb)
-{
-  SilcUnixScheduler internal = (SilcUnixScheduler)context;
-  unsigned char c;
-
-  SILC_LOG_DEBUG(("Wokeup"));
-
-  (void)read(internal->wakeup_pipe[0], &c, 1);
-}
-
-SILC_TASK_CALLBACK(silc_schedule_wakeup_init)
-{
-  SilcUnixScheduler internal = schedule->internal;
-
-  internal->wakeup_task =
-    silc_schedule_task_add(schedule, internal->wakeup_pipe[0],
-                          silc_schedule_wakeup_cb, internal,
-                          0, 0, SILC_TASK_FD);
-  if (!internal->wakeup_task) {
-    SILC_LOG_WARNING(("Could not add a wakeup task, threads won't work"));
-    close(internal->wakeup_pipe[0]);
-    return;
-  }
-  silc_schedule_internal_schedule_fd(schedule, internal,
-                                    (SilcTaskFd)internal->wakeup_task,
-                                    SILC_TASK_READ);
-}
-#endif /* SILC_THREADS */
-
-/* Initializes the platform specific scheduler.  This for example initializes
-   the wakeup mechanism of the scheduler.  In multi-threaded environment
-   the scheduler needs to be woken up when tasks are added or removed from
-   the task queues.  Returns context to the platform specific scheduler. */
-
-void *silc_schedule_internal_init(SilcSchedule schedule,
-                                 void *app_context)
-{
-  SilcUnixScheduler internal;
-  int i;
-
-  internal = silc_calloc(1, sizeof(*internal));
-  if (!internal)
-    return NULL;
-
-#if defined(HAVE_EPOLL_WAIT)
-  internal->epfd = epoll_create(4);
-  if (internal->epfd < 0) {
-    SILC_LOG_ERROR(("epoll_create() failed: %s", strerror(errno)));
-    return NULL;
-  }
-  internal->fds = silc_calloc(4, sizeof(*internal->fds));
-  if (!internal->fds) {
-    close(internal->epfd);
-    return NULL;
-  }
-  internal->fds_count = 4;
-#elif defined(HAVE_POLL) && defined(HAVE_SETRLIMIT) && defined(RLIMIT_NOFILE)
-  getrlimit(RLIMIT_NOFILE, &internal->nofile);
-
-  if (schedule->max_tasks > 0) {
-    internal->nofile.rlim_cur = schedule->max_tasks;
-    if (schedule->max_tasks > internal->nofile.rlim_max)
-      internal->nofile.rlim_max = schedule->max_tasks;
-    setrlimit(RLIMIT_NOFILE, &internal->nofile);
-    getrlimit(RLIMIT_NOFILE, &internal->nofile);
-    schedule->max_tasks = internal->nofile.rlim_max;
-  }
-
-  internal->fds = silc_calloc(internal->nofile.rlim_cur,
-                             sizeof(*internal->fds));
-  if (!internal->fds)
-    return NULL;
-  internal->fds_count = internal->nofile.rlim_cur;
-#endif /* HAVE_POLL && HAVE_SETRLIMIT && RLIMIT_NOFILE */
-
-  sigemptyset(&internal->signals);
-
-#ifdef SILC_THREADS
-  if (pipe(internal->wakeup_pipe)) {
-    SILC_LOG_ERROR(("pipe() fails: %s", strerror(errno)));
-    silc_free(internal);
-    return NULL;
-  }
-
-  silc_schedule_task_add_timeout(schedule, silc_schedule_wakeup_init,
-                                internal, 0, 0);
-#endif /* SILC_THREADS */
-
-  internal->app_context = app_context;
-
-  for (i = 0; i < SIGNAL_COUNT; i++) {
-    signal_call[i].sig = 0;
-    signal_call[i].call = FALSE;
-    signal_call[i].schedule = schedule;
-  }
-
-  return (void *)internal;
-}
-
-void silc_schedule_internal_signals_block(SilcSchedule schedule,
-                                         void *context);
-void silc_schedule_internal_signals_unblock(SilcSchedule schedule,
-                                           void *context);
-
-/* Uninitializes the platform specific scheduler context. */
-
-void silc_schedule_internal_uninit(SilcSchedule schedule, void *context)
-{
-  SilcUnixScheduler internal = (SilcUnixScheduler)context;
-
-  if (!internal)
-    return;
-
-#ifdef SILC_THREADS
-  close(internal->wakeup_pipe[0]);
-  close(internal->wakeup_pipe[1]);
-#endif
-
-#if defined(HAVE_EPOLL_WAIT)
-  close(internal->epfd);
-  silc_free(internal->fds);
-#elif defined(HAVE_POLL) && defined(HAVE_SETRLIMIT) && defined(RLIMIT_NOFILE)
-  silc_free(internal->fds);
-#endif /* HAVE_POLL && HAVE_SETRLIMIT && RLIMIT_NOFILE */
-
-  silc_free(internal);
-}
-
-/* Wakes up the scheduler */
-
-void silc_schedule_internal_wakeup(SilcSchedule schedule, void *context)
-{
-#ifdef SILC_THREADS
-  SilcUnixScheduler internal = (SilcUnixScheduler)context;
-
-  if (!internal || !internal->wakeup_task)
-    return;
-
-  SILC_LOG_DEBUG(("Wakeup"));
-
-  (void)write(internal->wakeup_pipe[1], "!", 1);
-#endif
-}
-
-/* Signal handler */
-
-static void silc_schedule_internal_sighandler(int signal)
-{
-  int i;
-
-  SILC_LOG_DEBUG(("Start"));
-
-  for (i = 0; i < SIGNAL_COUNT; i++) {
-    if (signal_call[i].sig == signal) {
-      signal_call[i].call = TRUE;
-      signal_call[i].schedule->signal_tasks = TRUE;
-      SILC_LOG_DEBUG(("Scheduling signal %d to be called",
-                     signal_call[i].sig));
-      break;
-    }
-  }
-}
-
-void silc_schedule_internal_signal_register(SilcSchedule schedule,
-                                           void *context,
-                                           SilcUInt32 sig,
-                                            SilcTaskCallback callback,
-                                            void *callback_context)
-{
-  SilcUnixScheduler internal = (SilcUnixScheduler)context;
-  int i;
-
-  if (!internal)
-    return;
-
-  SILC_LOG_DEBUG(("Registering signal %d", sig));
-
-  silc_schedule_internal_signals_block(schedule, context);
-
-  for (i = 0; i < SIGNAL_COUNT; i++) {
-    if (!signal_call[i].sig) {
-      signal_call[i].sig = sig;
-      signal_call[i].callback = callback;
-      signal_call[i].context = callback_context;
-      signal_call[i].schedule = schedule;
-      signal_call[i].call = FALSE;
-      signal(sig, silc_schedule_internal_sighandler);
-      break;
-    }
-  }
-
-  silc_schedule_internal_signals_unblock(schedule, context);
-  sigaddset(&internal->signals, sig);
-}
-
-void silc_schedule_internal_signal_unregister(SilcSchedule schedule,
-                                             void *context,
-                                             SilcUInt32 sig)
-{
-  SilcUnixScheduler internal = (SilcUnixScheduler)context;
-  int i;
-
-  if (!internal)
-    return;
-
-  SILC_LOG_DEBUG(("Unregistering signal %d", sig));
-
-  silc_schedule_internal_signals_block(schedule, context);
-
-  for (i = 0; i < SIGNAL_COUNT; i++) {
-    if (signal_call[i].sig == sig) {
-      signal_call[i].sig = 0;
-      signal_call[i].callback = NULL;
-      signal_call[i].context = NULL;
-      signal_call[i].schedule = NULL;
-      signal_call[i].call = FALSE;
-      signal(sig, SIG_DFL);
-    }
-  }
-
-  silc_schedule_internal_signals_unblock(schedule, context);
-  sigdelset(&internal->signals, sig);
-}
-
-/* Call all signals */
-
-void silc_schedule_internal_signals_call(SilcSchedule schedule, void *context)
-{
-  SilcUnixScheduler internal = (SilcUnixScheduler)context;
-  int i;
-
-  SILC_LOG_DEBUG(("Start"));
-
-  if (!internal)
-    return;
-
-  silc_schedule_internal_signals_block(schedule, context);
-
-  for (i = 0; i < SIGNAL_COUNT; i++) {
-    if (signal_call[i].call &&
-        signal_call[i].callback) {
-      SILC_LOG_DEBUG(("Calling signal %d callback",
-                     signal_call[i].sig));
-      silc_schedule_internal_signals_unblock(schedule, context);
-      signal_call[i].callback(schedule, internal->app_context,
-                             SILC_TASK_INTERRUPT,
-                             signal_call[i].sig,
-                             signal_call[i].context);
-      signal_call[i].call = FALSE;
-      silc_schedule_internal_signals_block(schedule, context);
-    }
-  }
-
-  silc_schedule_internal_signals_unblock(schedule, context);
-}
-
-/* Block registered signals in scheduler. */
-
-void silc_schedule_internal_signals_block(SilcSchedule schedule, void *context)
-{
-  SilcUnixScheduler internal = (SilcUnixScheduler)context;
-
-  if (!internal)
-    return;
-
-  sigprocmask(SIG_BLOCK, &internal->signals, &internal->signals_blocked);
-}
-
-/* Unblock registered signals in schedule. */
-
-void silc_schedule_internal_signals_unblock(SilcSchedule schedule,
-                                           void *context)
-{
-  SilcUnixScheduler internal = (SilcUnixScheduler)context;
-
-  if (!internal)
-    return;
-
-  sigprocmask(SIG_SETMASK, &internal->signals_blocked, NULL);
-}
-
-const SilcScheduleOps schedule_ops =
-{
-  silc_schedule_internal_init,
-  silc_schedule_internal_uninit,
-#if defined(HAVE_EPOLL_WAIT)
-  silc_epoll,
-#elif defined(HAVE_POLL) && defined(HAVE_SETRLIMIT) && defined(RLIMIT_NOFILE)
-  silc_poll,
-#else
-  silc_select,
-#endif /* HAVE_POLL && HAVE_SETRLIMIT && RLIMIT_NOFILE */
-  silc_schedule_internal_schedule_fd,
-  silc_schedule_internal_wakeup,
-  silc_schedule_internal_signal_register,
-  silc_schedule_internal_signal_unregister,
-  silc_schedule_internal_signals_call,
-  silc_schedule_internal_signals_block,
-  silc_schedule_internal_signals_unblock,
-};
diff --git a/lib/silcutil/unix/silcunixsocketstream.c b/lib/silcutil/unix/silcunixsocketstream.c
deleted file mode 100644 (file)
index 60d458d..0000000
+++ /dev/null
@@ -1,344 +0,0 @@
-/*
-
-  silcunixsocketstream.c
-
-  Author: Pekka Riikonen <priikone@silcnet.org>
-
-  Copyright (C) 1997 - 2008 Pekka Riikonen
-
-  This program is free software; you can redistribute it and/or modify
-  it under the terms of the GNU General Public License as published by
-  the Free Software Foundation; version 2 of the License.
-
-  This program is distributed in the hope that it will be useful,
-  but WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-  GNU General Public License for more details.
-
-*/
-/* $Id$ */
-
-#include "silc.h"
-
-/************************ Static utility functions **************************/
-
-/* The IO process callback that calls the notifier callback to upper layer. */
-
-SILC_TASK_CALLBACK(silc_socket_stream_io)
-{
-  SilcSocketStream stream = context;
-
-  if (silc_unlikely(!stream->notifier))
-    return;
-
-  switch (type) {
-  case SILC_TASK_READ:
-    stream->notifier(stream, SILC_STREAM_CAN_READ, stream->notifier_context);
-    break;
-
-  case SILC_TASK_WRITE:
-    stream->notifier(stream, SILC_STREAM_CAN_WRITE, stream->notifier_context);
-    break;
-
-  default:
-    break;
-  }
-}
-
-/**************************** Stream Operations *****************************/
-
-/* QoS read handler, this will call the read and write events to indicate
-   that data is available again after a timeout. */
-
-SILC_TASK_CALLBACK(silc_socket_read_qos)
-{
-  SilcSocketQos qos = context;
-  qos->applied = TRUE;
-  silc_schedule_set_listen_fd(qos->sock->schedule, qos->sock->sock,
-                             (SILC_TASK_READ | SILC_TASK_WRITE), TRUE);
-  qos->applied = FALSE;
-  silc_schedule_set_listen_fd(qos->sock->schedule, qos->sock->sock,
-                             SILC_TASK_READ, FALSE);
-}
-
-/* Stream read operation */
-
-int silc_socket_stream_read(SilcStream stream, unsigned char *buf,
-                           SilcUInt32 buf_len)
-{
-  SilcSocketStream sock = stream;
-  int len = 0;
-  struct timeval curtime;
-  unsigned char *qosbuf;
-
-  SILC_LOG_DEBUG(("Reading data from socket %d", sock->sock));
-
-  /* Handle the simple non-QoS reading. */
-  if (!sock->qos) {
-    len = read(sock->sock, buf, buf_len);
-    if (len < 0) {
-      if (errno == EAGAIN || errno == EINTR) {
-       SILC_LOG_DEBUG(("Could not read immediately, will do it later"));
-       silc_schedule_set_listen_fd(sock->schedule, sock->sock,
-                                   silc_schedule_get_fd_events(sock->schedule,
-                                                               sock->sock) |
-                                   SILC_TASK_READ, FALSE);
-       return -1;
-      }
-      SILC_LOG_DEBUG(("Cannot read from socket: %d:%s",
-                     sock->sock, strerror(errno)));
-      silc_schedule_unset_listen_fd(sock->schedule, sock->sock);
-      sock->sock_error = errno;
-      return -2;
-    }
-
-    SILC_LOG_DEBUG(("Read %d bytes", len));
-
-    if (!len)
-      silc_schedule_unset_listen_fd(sock->schedule, sock->sock);
-
-    return len;
-  }
-
-  /* We have QoS set, and reading is done via the QoS system. */
-  qosbuf = sock->qos->buffer;
-
-  /* If QoS was applied, return the data that was pending. */
-  if (sock->qos->applied && sock->qos->data_len) {
-    memcpy(buf, qosbuf, sock->qos->data_len);
-    len = sock->qos->data_len;
-    sock->qos->data_len = 0;
-    return len;
-  }
-
-  /* If we have active QoS data pending, return with no data */
-  if (sock->qos->data_len) {
-    silc_schedule_unset_listen_fd(sock->schedule, sock->sock);
-    return -1;
-  }
-
-  /* Read the data from the socket.  The qosbuf size is always the max
-     read limit size. */
-  len = (buf_len < sock->qos->read_limit_bytes ? buf_len :
-        sock->qos->read_limit_bytes);
-  len = read(sock->sock, qosbuf, len);
-  if (len < 0) {
-    if (errno == EAGAIN || errno == EINTR) {
-      SILC_LOG_DEBUG(("Could not read immediately, will do it later"));
-      silc_schedule_set_listen_fd(sock->schedule, sock->sock,
-                                 silc_schedule_get_fd_events(sock->schedule,
-                                                             sock->sock) |
-                                 SILC_TASK_READ, FALSE);
-      return -1;
-    }
-    SILC_LOG_DEBUG(("Cannot read from socket: %d:%s",
-                   sock->sock, strerror(errno)));
-    silc_schedule_unset_listen_fd(sock->schedule, sock->sock);
-    silc_schedule_task_del_by_context(sock->schedule, sock->qos);
-    sock->qos->data_len = 0;
-    sock->sock_error = errno;
-    return -2;
-  }
-
-  SILC_LOG_DEBUG(("Read %d bytes", len));
-
-  if (!len) {
-    silc_schedule_unset_listen_fd(sock->schedule, sock->sock);
-    silc_schedule_task_del_by_context(sock->schedule, sock->qos);
-    sock->qos->data_len = 0;
-    return 0;
-  }
-
-  /* If we have passed the rate time limit, set our new time limit,
-     and zero the rate limit.  This limits reads per second. */
-  silc_gettimeofday(&curtime);
-  if (silc_compare_timeval(&curtime, &sock->qos->next_limit) > 0) {
-    curtime.tv_sec++;
-    sock->qos->next_limit = curtime;
-    sock->qos->cur_rate = 0;
-  }
-  sock->qos->cur_rate++;
-
-  /* If we are not within rate limit apply QoS for the read data */
-  if (sock->qos->cur_rate > sock->qos->read_rate) {
-    silc_schedule_task_add_timeout(sock->schedule, silc_socket_read_qos,
-                                  sock->qos, sock->qos->limit_sec,
-                                  sock->qos->limit_usec);
-    sock->qos->data_len = len;
-
-    /* Rate limit kicked in, do not return data yet */
-    silc_schedule_unset_listen_fd(sock->schedule, sock->sock);
-    return -1;
-  }
-
-  /* Return the data from the QoS buffer */
-  memcpy(buf, qosbuf, len);
-  return len;
-}
-
-/* Stream write operation */
-
-int silc_socket_stream_write(SilcStream stream, const unsigned char *data,
-                            SilcUInt32 data_len)
-{
-  SilcSocketStream sock = stream;
-  int ret;
-
-  SILC_LOG_DEBUG(("Writing data to socket %d", sock->sock));
-
-  ret = write(sock->sock, data, data_len);
-  if (ret < 0) {
-    if (errno == EAGAIN || errno == EINTR) {
-      SILC_LOG_DEBUG(("Could not write immediately, will do it later"));
-      silc_schedule_set_listen_fd(sock->schedule, sock->sock,
-                                 SILC_TASK_READ | SILC_TASK_WRITE, FALSE);
-      return -1;
-    }
-    SILC_LOG_DEBUG(("Cannot write to socket: %s", strerror(errno)));
-    silc_schedule_unset_listen_fd(sock->schedule, sock->sock);
-    sock->sock_error = errno;
-    return -2;
-  }
-
-  SILC_LOG_DEBUG(("Wrote data %d bytes", ret));
-  if (silc_schedule_get_fd_events(sock->schedule, sock->sock) &
-      SILC_TASK_WRITE)
-    silc_schedule_set_listen_fd(sock->schedule, sock->sock,
-                               SILC_TASK_READ, FALSE);
-
-  return ret;
-}
-
-/* Receive UDP packet.  QoS is not supported. */
-
-int silc_socket_udp_stream_read(SilcStream stream, unsigned char *buf,
-                               SilcUInt32 buf_len)
-{
-  return silc_net_udp_receive(stream, NULL, 0, NULL, buf, buf_len);
-}
-
-/* Send UDP packet.  This always succeeds. */
-
-int silc_socket_udp_stream_write(SilcStream stream, const unsigned char *data,
-                                SilcUInt32 data_len)
-{
-  SilcSocketStream sock = stream;
-
-  /* In connectionless state check if remote IP and port is provided */
-  if (!sock->connected && sock->ip && sock->port)
-    return silc_net_udp_send(stream, sock->ip, sock->port, data, data_len);
-
-  /* In connected state use normal writing to socket. */
-  return silc_socket_stream_write(stream, data, data_len);
-}
-
-#if 0
-/* Returns human readable socket error message */
-
-SilcBool silc_socket_get_error(SilcStream sock, char *error,
-                              SilcUInt32 error_len)
-{
-  char *err;
-
-  if (!sock->sock_error)
-    return FALSE;
-
-  err = strerror(sock->sock_error);
-  if (strlen(err) > error_len)
-    return FALSE;
-
-  memset(error, 0, error_len);
-  memcpy(error, err, strlen(err));
-  return TRUE;
-}
-#endif
-
-/* Closes socket */
-
-SilcBool silc_socket_stream_close(SilcStream stream)
-{
-  SilcSocketStream socket_stream = stream;
-
-  if (socket_stream->schedule) {
-    silc_schedule_unset_listen_fd(socket_stream->schedule,
-                                 socket_stream->sock);
-    silc_schedule_task_del_by_fd(socket_stream->schedule,
-                                socket_stream->sock);
-  }
-  silc_net_close_connection(socket_stream->sock);
-
-  return TRUE;
-}
-
-/* Destroys the stream */
-
-void silc_socket_stream_destroy(SilcStream stream)
-{
-  SilcSocketStream socket_stream = stream;
-
-  silc_socket_stream_close(socket_stream);
-  silc_free(socket_stream->ip);
-  silc_free(socket_stream->hostname);
-  if (socket_stream->schedule)
-    silc_schedule_task_del_by_fd(socket_stream->schedule, socket_stream->sock);
-
-  if (socket_stream->qos) {
-    silc_schedule_task_del_by_context(socket_stream->schedule,
-                                     socket_stream->qos);
-    if (socket_stream->qos->buffer) {
-      memset(socket_stream->qos->buffer, 0,
-            socket_stream->qos->read_limit_bytes);
-      silc_free(socket_stream->qos->buffer);
-    }
-    silc_free(socket_stream->qos);
-  }
-
-  if (socket_stream->schedule)
-    silc_schedule_wakeup(socket_stream->schedule);
-
-  silc_free(socket_stream);
-}
-
-/* Sets stream notification callback for the stream */
-
-SilcBool silc_socket_stream_notifier(SilcStream stream,
-                                    SilcSchedule schedule,
-                                    SilcStreamNotifier callback,
-                                    void *context)
-{
-  SilcSocketStream socket_stream = stream;
-
-  SILC_LOG_DEBUG(("Setting stream notifier callback"));
-
-  socket_stream->notifier = callback;
-  socket_stream->notifier_context = context;
-  socket_stream->schedule = schedule;
-
-  if (socket_stream->notifier && socket_stream->schedule) {
-    /* Set the socket to non-blocking mode */
-    silc_net_set_socket_nonblock(socket_stream->sock);
-
-    /* Add the socket to scheduler.  Safe to call if already added. */
-    if (!silc_schedule_task_add_fd(socket_stream->schedule,
-                                  socket_stream->sock,
-                                  silc_socket_stream_io, socket_stream))
-      return FALSE;
-
-    /* Initially set socket for reading */
-    if (!silc_schedule_set_listen_fd(socket_stream->schedule,
-                                    socket_stream->sock,
-                                    SILC_TASK_READ, FALSE))
-      return FALSE;
-  } else if (socket_stream->schedule) {
-    /* Unschedule the socket */
-    silc_schedule_unset_listen_fd(socket_stream->schedule,
-                                 socket_stream->sock);
-    silc_schedule_task_del_by_fd(socket_stream->schedule,
-                                socket_stream->sock);
-  }
-
-  if (socket_stream->schedule)
-    silc_schedule_wakeup(socket_stream->schedule);
-
-  return TRUE;
-}
diff --git a/lib/silcutil/unix/silcunixthread.c b/lib/silcutil/unix/silcunixthread.c
deleted file mode 100644 (file)
index bd551c2..0000000
+++ /dev/null
@@ -1,297 +0,0 @@
-/*
-
-  silcunixthread.c
-
-  Author: Pekka Riikonen <priikone@silcnet.org>
-
-  Copyright (C) 2001 - 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.
-
-*/
-/* $Id$ */
-
-#include "silc.h"
-
-/**************************** SILC Thread API *******************************/
-
-SilcThread silc_thread_create(SilcThreadStart start_func, void *context,
-                             SilcBool waitable)
-{
-#ifdef SILC_THREADS
-  pthread_attr_t attr;
-  pthread_t thread;
-  int ret;
-
-  SILC_LOG_DEBUG(("Creating new thread"));
-
-  if (!start_func)
-    return NULL;
-
-  if (pthread_attr_init(&attr)) {
-    SILC_LOG_ERROR(("Thread error: %s", strerror(errno)));
-    return NULL;
-  }
-
-  if (pthread_attr_setdetachstate(&attr,
-                                 waitable ? PTHREAD_CREATE_JOINABLE :
-                                 PTHREAD_CREATE_DETACHED)) {
-    SILC_LOG_ERROR(("Thread error: %s", strerror(errno)));
-    pthread_attr_destroy(&attr);
-    return NULL;
-  }
-
-  ret = pthread_create(&thread, &attr, (void * (*)(void *))start_func,
-                      context);
-  if (ret) {
-    SILC_LOG_ERROR(("Thread error: %s", strerror(errno)));
-    pthread_attr_destroy(&attr);
-    return NULL;
-  }
-
-  pthread_attr_destroy(&attr);
-
-  SILC_LOG_DEBUG(("Created thread %p", (SilcThread)thread));
-
-  return (SilcThread)thread;
-#else
-  /* Call thread callback immediately */
-  (*start_func)(context);
-  return NULL;
-#endif
-}
-
-void silc_thread_exit(void *exit_value)
-{
-#ifdef SILC_THREADS
-  pthread_exit(exit_value);
-#endif
-}
-
-SilcThread silc_thread_self(void)
-{
-#ifdef SILC_THREADS
-  pthread_t self = pthread_self();
-  return (SilcThread)self;
-#else
-  return NULL;
-#endif
-}
-
-SilcBool silc_thread_wait(SilcThread thread, void **exit_value)
-{
-#ifdef SILC_THREADS
-  SILC_LOG_DEBUG(("Waiting for thread %p", thread));
-  if (!pthread_join(*(pthread_t *)thread, exit_value))
-    return TRUE;
-  return FALSE;
-#else
-  return FALSE;
-#endif
-}
-
-void silc_thread_yield(void)
-{
-#ifdef SILC_THREADS
-#ifdef HAVE_SCHED_YIELD
-  sched_yield();
-#endif /* HAVE_SCHED_YIELD */
-#endif /* SILC_THREADS */
-}
-
-/***************************** SILC Mutex API *******************************/
-
-/* SILC Mutex structure */
-struct SilcMutexStruct {
-#ifdef SILC_THREADS
-  pthread_mutex_t mutex;
-#endif /* SILC_THREADS */
-  unsigned int locked : 1;
-};
-
-SilcBool silc_mutex_alloc(SilcMutex *mutex)
-{
-#ifdef SILC_THREADS
-  *mutex = silc_calloc(1, sizeof(**mutex));
-  if (*mutex == NULL)
-    return FALSE;
-  pthread_mutex_init(&(*mutex)->mutex, NULL);
-  (*mutex)->locked = FALSE;
-  return TRUE;
-#else
-  return FALSE;
-#endif /* SILC_THREADS */
-}
-
-void silc_mutex_free(SilcMutex mutex)
-{
-#ifdef SILC_THREADS
-  if (mutex) {
-    pthread_mutex_destroy(&mutex->mutex);
-    silc_free(mutex);
-  }
-#endif /* SILC_THREADS */
-}
-
-void silc_mutex_lock(SilcMutex mutex)
-{
-#ifdef SILC_THREADS
-  if (mutex) {
-    SILC_VERIFY(pthread_mutex_lock(&mutex->mutex) == 0);
-    mutex->locked = TRUE;
-  }
-#endif /* SILC_THREADS */
-}
-
-void silc_mutex_unlock(SilcMutex mutex)
-{
-#ifdef SILC_THREADS
-  if (mutex) {
-    SILC_VERIFY(pthread_mutex_unlock(&mutex->mutex) == 0);
-    mutex->locked = FALSE;
-  }
-#endif /* SILC_THREADS */
-}
-
-void silc_mutex_assert_locked(SilcMutex mutex)
-{
-#ifdef SILC_THREADS
-  if (mutex)
-    SILC_VERIFY(mutex->locked);
-#endif /* SILC_THREADS */
-}
-
-/***************************** SILC Rwlock API ******************************/
-
-/* SILC read/write lock structure */
-struct SilcRwLockStruct {
-#ifdef SILC_THREADS
-  pthread_rwlock_t rwlock;
-#else
-  void *tmp;
-#endif /* SILC_THREADS */
-};
-
-SilcBool silc_rwlock_alloc(SilcRwLock *rwlock)
-{
-#ifdef SILC_THREADS
-  *rwlock = silc_calloc(1, sizeof(**rwlock));
-  if (*rwlock == NULL)
-    return FALSE;
-  pthread_rwlock_init(&(*rwlock)->rwlock, NULL);
-  return TRUE;
-#else
-  return FALSE;
-#endif /* SILC_THREADS */
-}
-
-void silc_rwlock_free(SilcRwLock rwlock)
-{
-#ifdef SILC_THREADS
-  if (rwlock) {
-    pthread_rwlock_destroy(&rwlock->rwlock);
-    silc_free(rwlock);
-  }
-#endif /* SILC_THREADS */
-}
-
-void silc_rwlock_rdlock(SilcRwLock rwlock)
-{
-#ifdef SILC_THREADS
-  if (rwlock)
-    pthread_rwlock_rdlock(&rwlock->rwlock);
-#endif /* SILC_THREADS */
-}
-
-void silc_rwlock_wrlock(SilcRwLock rwlock)
-{
-#ifdef SILC_THREADS
-  if (rwlock)
-    SILC_VERIFY(pthread_rwlock_wrlock(&rwlock->rwlock) == 0);
-#endif /* SILC_THREADS */
-}
-
-void silc_rwlock_unlock(SilcRwLock rwlock)
-{
-#ifdef SILC_THREADS
-  if (rwlock)
-    SILC_VERIFY(pthread_rwlock_unlock(&rwlock->rwlock) == 0);
-#endif /* SILC_THREADS */
-}
-
-/****************************** SILC Cond API *******************************/
-
-/* SILC Conditional Variable context */
-struct SilcCondStruct {
-#ifdef SILC_THREADS
-  pthread_cond_t cond;
-#else
-  void *tmp;
-#endif /* SILC_THREADS*/
-};
-
-SilcBool silc_cond_alloc(SilcCond *cond)
-{
-#ifdef SILC_THREADS
-  *cond = silc_calloc(1, sizeof(**cond));
-  if (*cond == NULL)
-    return FALSE;
-  pthread_cond_init(&(*cond)->cond, NULL);
-  return TRUE;
-#else
-  return FALSE;
-#endif /* SILC_THREADS*/
-}
-
-void silc_cond_free(SilcCond cond)
-{
-#ifdef SILC_THREADS
-  pthread_cond_destroy(&cond->cond);
-  silc_free(cond);
-#endif /* SILC_THREADS*/
-}
-
-void silc_cond_signal(SilcCond cond)
-{
-#ifdef SILC_THREADS
-  pthread_cond_signal(&cond->cond);
-#endif /* SILC_THREADS*/
-}
-
-void silc_cond_broadcast(SilcCond cond)
-{
-#ifdef SILC_THREADS
-  pthread_cond_broadcast(&cond->cond);
-#endif /* SILC_THREADS*/
-}
-
-void silc_cond_wait(SilcCond cond, SilcMutex mutex)
-{
-#ifdef SILC_THREADS
-  pthread_cond_wait(&cond->cond, &mutex->mutex);
-#endif /* SILC_THREADS*/
-}
-
-SilcBool silc_cond_timedwait(SilcCond cond, SilcMutex mutex,
-                            int timeout)
-{
-#ifdef SILC_THREADS
-  struct timespec t;
-  if (timeout) {
-    t.tv_sec = timeout / 1000;
-    t.tv_nsec = (timeout % 1000) * 1000;
-    return pthread_cond_timedwait(&cond->cond, &mutex->mutex, &t) == 0;
-  }
-
-  return pthread_cond_wait(&cond->cond, &mutex->mutex) == 0;
-#else
-  return FALSE;
-#endif /* SILC_THREADS*/
-}
diff --git a/lib/silcutil/unix/silcunixutil.c b/lib/silcutil/unix/silcunixutil.c
deleted file mode 100644 (file)
index 4b37ea5..0000000
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
-
-  silcunixutil.c
-
-  Author: Pekka Riikonen <priikone@silcnet.org>
-
-  Copyright (C) 1997 - 2007 Pekka Riikonen
-
-  This program is free software; you can redistribute it and/or modify
-  it under the terms of the GNU General Public License as published by
-  the Free Software Foundation; version 2 of the License.
-
-  This program is distributed in the hope that it will be useful,
-  but WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-  GNU General Public License for more details.
-
-*/
-
-#include "silc.h"
-
-/* Returns the username of the user. If the global variable LOGNAME
-   does not exists we will get the name from the password file. */
-
-char *silc_get_username()
-{
-  char *logname = NULL;
-
-  logname = getenv("LOGNAME");
-  if (!logname) {
-    logname = getlogin();
-    if (!logname) {
-      struct passwd *pw;
-
-      pw = getpwuid(getuid());
-      if (!pw)
-       return strdup("foo");
-
-      logname = pw->pw_name;
-    }
-  }
-
-  return strdup(logname);
-}
-
-/* Returns the real name of ther user. */
-
-char *silc_get_real_name()
-{
-  char *realname = NULL;
-  struct passwd *pw;
-
-  pw = getpwuid(getuid());
-  if (!pw)
-    return strdup("No Name");
-
-  if (strchr(pw->pw_gecos, ','))
-    *strchr(pw->pw_gecos, ',') = 0;
-
-  if (!strlen(pw->pw_gecos))
-    return strdup("No Name");
-
-  realname = strdup(pw->pw_gecos);
-
-  return realname;
-}
-
-/* Return current time to struct timeval. */
-
-int silc_gettimeofday(struct timeval *p)
-{
-  return gettimeofday(p, NULL);
-}
-
-int silc_file_set_nonblock(int fd)
-{
-  return fcntl(fd, F_SETFL, fcntl(fd, F_GETFL, 0) | O_NONBLOCK);
-}
diff --git a/lib/silcutil/win32/.cvsignore b/lib/silcutil/win32/.cvsignore
deleted file mode 100644 (file)
index 282522d..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-Makefile
-Makefile.in
diff --git a/lib/silcutil/win32/Makefile.am b/lib/silcutil/win32/Makefile.am
deleted file mode 100644 (file)
index 1199c93..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-#
-#  Makefile.am
-#
-#  Author: Pekka Riikonen <priikone@silcnet.org>
-#
-#  Copyright (C) 2001 - 2006 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; either version 2 of the License, or
-#  (at your option) any later version.
-#
-#  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.
-#
-
-AUTOMAKE_OPTIONS = 1.0 no-dependencies foreign
-
-noinst_LTLIBRARIES = libsilcwin32util.la
-
-libsilcwin32util_la_SOURCES =  \
-       silcwin32net.c          \
-       silcwin32schedule.c     \
-       silcwin32socketstream.c \
-       silcwin32util.c         \
-       silcwin32thread.c
-
-include $(top_srcdir)/Makefile.defines.in
diff --git a/lib/silcutil/win32/silcwin32net.c b/lib/silcutil/win32/silcwin32net.c
deleted file mode 100644 (file)
index 7d4e733..0000000
+++ /dev/null
@@ -1,797 +0,0 @@
-/*
-
-  silcwin32net.c
-
-  Author: Pekka Riikonen <priikone@silcnet.org>
-
-  Copyright (C) 1997 - 2007 Pekka Riikonen
-
-  This program is free software; you can redistribute it and/or modify
-  it under the terms of the GNU General Public License as published by
-  the Free Software Foundation; version 2 of the License.
-
-  This program is distributed in the hope that it will be useful,
-  but WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-  GNU General Public License for more details.
-
-*/
-/* $Id$ */
-
-#include "silc.h"
-
-/************************** Types and definitions ***************************/
-
-#ifdef HAVE_IPV6
-#define SIZEOF_SOCKADDR(so) ((so).sa.sa_family == AF_INET6 ?   \
-  sizeof(so.sin6) : sizeof(so.sin))
-#else
-#define SIZEOF_SOCKADDR(so) (sizeof(so.sin))
-#endif
-
-typedef union {
-  struct sockaddr sa;
-  struct sockaddr_in sin;
-#ifdef HAVE_IPV6
-  struct sockaddr_in6 sin6;
-#endif
-} SilcSockaddr;
-
-
-/************************ Static utility functions **************************/
-
-static SilcBool silc_net_set_sockaddr(SilcSockaddr *addr, const char *ip_addr,
-                                     int port)
-{
-  int len;
-
-  memset(addr, 0, sizeof(*addr));
-
-  /* Check for IPv4 and IPv6 addresses */
-  if (ip_addr) {
-    if (!silc_net_is_ip(ip_addr)) {
-      SILC_LOG_ERROR(("%s is not IP address", ip_addr));
-      return FALSE;
-    }
-
-    if (silc_net_is_ip4(ip_addr)) {
-      /* IPv4 address */
-      len = sizeof(addr->sin.sin_addr);
-      if (!silc_net_addr2bin(ip_addr,
-                            (unsigned char *)&addr->sin.sin_addr.s_addr,
-                            len))
-       return FALSE;
-      addr->sin.sin_family = AF_INET;
-      addr->sin.sin_port = port ? htons(port) : 0;
-    } else {
-#ifdef HAVE_IPV6
-      /* IPv6 address */
-      len = sizeof(addr->sin6.sin6_addr);
-      if (!silc_net_addr2bin(ip_addr,
-                            (unsigned char *)&addr->sin6.sin6_addr, len))
-       return FALSE;
-      addr->sin6.sin6_family = AF_INET6;
-      addr->sin6.sin6_port = port ? htons(port) : 0;
-#else
-      SILC_LOG_ERROR(("Operating System does not support IPv6"));
-      return FALSE;
-#endif
-    }
-  } else {
-    /* Any address */
-    addr->sin.sin_family = AF_INET;
-    addr->sin.sin_addr.s_addr = INADDR_ANY;
-    if (port)
-      addr->sin.sin_port = htons(port);
-  }
-
-  return TRUE;
-}
-
-
-/****************************** TCP Listener ********************************/
-
-/* Deliver new stream to upper layer */
-
-static void silc_net_accept_stream(SilcSocketStreamStatus status,
-                                  SilcStream stream, void *context)
-{
-  SilcNetListener listener = context;
-
-  if (status != SILC_SOCKET_OK)
-    return;
-
-  listener->callback(SILC_NET_OK, stream, listener->context);
-}
-
-/* Accept incoming connection and notify upper layer */
-
-SILC_TASK_CALLBACK(silc_net_accept)
-{
-  SilcNetListener listener = context;
-  int sock;
-
-  SILC_LOG_DEBUG(("Accepting new connection"));
-
-  sock = silc_net_accept_connection(fd);
-  if (sock == INVALID_SOCKET)
-    return;
-
-  /* Set socket options */
-  silc_net_set_socket_opt(sock, SOL_SOCKET, SO_REUSEADDR, 1);
-
-  /* Create socket stream */
-  silc_socket_tcp_stream_create(sock, listener->lookup,
-                               listener->require_fqdn, schedule,
-                               silc_net_accept_stream, listener);
-}
-
-/* Create TCP network listener */
-
-SilcNetListener
-silc_net_tcp_create_listener(const char **local_ip_addr,
-                            SilcUInt32 local_ip_count, int port,
-                            SilcBool lookup, SilcBool require_fqdn,
-                            SilcSchedule schedule,
-                            SilcNetCallback callback, void *context)
-{
-  SilcNetListener listener = NULL;
-  SOCKET sock;
-  SilcSockaddr server;
-  int i, rval;
-  const char *ipany = "0.0.0.0";
-
-  SILC_LOG_DEBUG(("Creating TCP listener"));
-
-  if (port < 0 || !schedule || !callback)
-    goto err;
-
-  listener = silc_calloc(1, sizeof(*listener));
-  if (!listener)
-    return NULL;
-  listener->schedule = schedule;
-  listener->callback = callback;
-  listener->context = context;
-  listener->require_fqdn = require_fqdn;
-  listener->lookup = lookup;
-
-  if (local_ip_count > 0) {
-    listener->socks = silc_calloc(local_ip_count, sizeof(*listener->socks));
-    if (!listener->socks)
-      return NULL;
-  } else {
-    listener->socks = silc_calloc(1, sizeof(*listener->socks));
-    if (!listener->socks)
-      return NULL;
-
-    local_ip_count = 1;
-  }
-
-  /* Bind to local addresses */
-  for (i = 0; i < local_ip_count; i++) {
-    SILC_LOG_DEBUG(("Binding to local address %s",
-                   local_ip_addr ? local_ip_addr[i] : ipany));
-
-    /* Set sockaddr for server */
-    if (!silc_net_set_sockaddr(&server,
-                              local_ip_addr ? local_ip_addr[i] : ipany,
-                              port))
-      goto err;
-
-    /* Create the socket */
-    sock = socket(server.sin.sin_family, SOCK_STREAM, 0);
-    if (sock == INVALID_SOCKET) {
-      SILC_LOG_ERROR(("Cannot create socket, error %d", WSAGetLastError()));
-      goto err;
-    }
-
-    /* Set the socket options */
-    rval = silc_net_set_socket_opt(sock, SOL_SOCKET, SO_REUSEADDR, 1);
-    if (rval == SOCKET_ERROR) {
-      SILC_LOG_ERROR(("Cannot set socket options, error %d",
-                    WSAGetLastError()));
-      closesocket(sock);
-      goto err;
-    }
-
-    /* Bind the listener socket */
-    rval = bind(sock, &server.sa, SIZEOF_SOCKADDR(server));
-    if (rval == SOCKET_ERROR) {
-      SILC_LOG_ERROR(("Cannot bind socket, error %d", WSAGetLastError()));
-      closesocket(sock);
-      goto err;
-    }
-
-    /* Specify that we are listenning */
-    rval = listen(sock, SOMAXCONN);
-    if (rval == SOCKET_ERROR) {
-      SILC_LOG_ERROR(("Cannot set socket listenning, error %d",
-                    WSAGetLastError()));
-      closesocket(sock);
-      goto err;
-    }
-
-    /* Schedule for incoming connections */
-    silc_schedule_task_add_fd(schedule, sock, silc_net_accept, listener);
-
-    SILC_LOG_DEBUG(("TCP listener created, fd=%d", sock));
-    listener->socks[i] = sock;
-    listener->socks_count++;
-  }
-
-  return listener;
-
- err:
-  if (listener)
-    silc_net_close_listener(listener);
-  return NULL;
-}
-
-/* Close network listener */
-
-void silc_net_close_listener(SilcNetListener listener)
-{
-  int i;
-
-  SILC_LOG_DEBUG(("Closing network listener"));
-
-  if (!listener)
-    return;
-
-  for (i = 0; i < listener->socks_count; i++) {
-    silc_schedule_task_del_by_fd(listener->schedule, listener->socks[i]);
-    shutdown(listener->socks[i], 2);
-    closesocket(listener->socks[i]);
-  }
-
-  silc_free(listener->socks);
-  silc_free(listener);
-}
-
-/******************************* UDP Stream *********************************/
-
-/* Create UDP stream */
-
-SilcStream
-silc_net_udp_connect(const char *local_ip_addr, int local_port,
-                    const char *remote_ip_addr, int remote_port,
-                    SilcSchedule schedule)
-{
-  SilcStream stream;
-  SilcSockaddr server;
-  SOCKET sock;
-  int rval;
-  const char *ipany = "0.0.0.0";
-
-  SILC_LOG_DEBUG(("Creating UDP stream"));
-
-  if (!schedule)
-    goto err;
-
-  /* Bind to local addresses */
-  SILC_LOG_DEBUG(("Binding to local address %s",
-                 local_ip_addr ? local_ip_addr : ipany));
-
-  /* Set sockaddr for server */
-  if (!silc_net_set_sockaddr(&server, local_ip_addr ? local_ip_addr : ipany,
-                            local_port))
-    goto err;
-
-  /* Create the socket */
-  sock = socket(server.sin.sin_family, SOCK_DGRAM, 0);
-  if (sock == INVALID_SOCKET) {
-    SILC_LOG_ERROR(("Cannot create socket"));
-    goto err;
-  }
-
-  /* Set the socket options */
-  rval = silc_net_set_socket_opt(sock, SOL_SOCKET, SO_REUSEADDR, 1);
-  if (rval == SOCKET_ERROR) {
-    SILC_LOG_ERROR(("Cannot set socket options"));
-    goto err;
-  }
-#ifdef SO_REUSEPORT
-  rval = silc_net_set_socket_opt(sock, SOL_SOCKET, SO_REUSEPORT, 1);
-  if (rval == SOCKET_ERROR) {
-    SILC_LOG_ERROR(("Cannot set socket options"));
-    goto err;
-  }
-#endif /* SO_REUSEPORT */
-
-  /* Bind the listener socket */
-  rval = bind(sock, &server.sa, SIZEOF_SOCKADDR(server));
-  if (rval == SOCKET_ERROR) {
-    SILC_LOG_DEBUG(("Cannot bind socket"));
-    goto err;
-  }
-
-  /* Set to connected state if remote address is provided. */
-  if (remote_ip_addr && remote_port) {
-    if (!silc_net_set_sockaddr(&server, remote_ip_addr, remote_port))
-      goto err;
-
-    rval = connect(sock, &server.sa, SIZEOF_SOCKADDR(server));
-    if (rval == SOCKET_ERROR) {
-      SILC_LOG_DEBUG(("Cannot connect UDP stream"));
-      goto err;
-    }
-  }
-
-  /* Encapsulate into socket stream */
-  stream =
-    silc_socket_udp_stream_create(sock, local_ip_addr ?
-                                 silc_net_is_ip6(local_ip_addr) : FALSE,
-                                 remote_ip_addr ? TRUE : FALSE, schedule);
-  if (!stream)
-    goto err;
-
-  SILC_LOG_DEBUG(("UDP stream created, fd=%d", sock));
-  return stream;
-
- err:
-  if (sock != -1)
-    close(sock);
-  return NULL;
-}
-
-/* Receive UDP packet */
-
-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)
-{
-  SilcSocketStream sock = stream;
-  SilcSockaddr s;
-  struct sockaddr *from;
-  int len, flen, err;
-
-  SILC_LOG_DEBUG(("Reading data from UDP socket %d", sock->sock));
-
-  if (remote_ip_addr && remote_port) {
-    if (sock->ipv6) {
-#ifdef HAVE_IPV6
-      from = (struct sockaddr *)&s.sin6;
-      flen = sizeof(s.sin6);
-#endif /* HAVE_IPV6 */
-    } else {
-      from = (struct sockaddr *)&s.sin;
-      flen = sizeof(s.sin);
-    }
-    len = recvfrom(sock->sock, ret_data, data_size, 0, from, &flen);
-  } else
-    len = recv(sock->sock, ret_data, data_size, 0);
-
-  if (len == SOCKET_ERROR) {
-    err = WSAGetLastError();
-    if (err == WSAEWOULDBLOCK) {
-      SILC_LOG_DEBUG(("Could not read immediately, will do it later"));
-      silc_schedule_set_listen_fd(sock->schedule, sock->sock,
-                                 SILC_TASK_READ, FALSE);
-      return -1;
-    }
-    SILC_LOG_DEBUG(("Cannot read from UDP socket: %d", sock->sock));
-    silc_schedule_unset_listen_fd(sock->schedule, sock->sock);
-    sock->sock_error = err;
-    return -2;
-  }
-
-  SILC_LOG_DEBUG(("Read %d bytes", len));
-
-  if (!len)
-    silc_schedule_unset_listen_fd(sock->schedule, sock->sock);
-
-  /* Return remote address */
-  if (remote_ip_addr && remote_port) {
-    if (sock->ipv6) {
-#ifdef HAVE_IPV6
-      *remote_port = ntohs(s.sin6.sin6_port);
-      inet_ntop(AF_INET6, &s.sin6.sin6_addr, remote_ip_addr,
-               remote_ip_addr_size);
-#endif /* HAVE_IPV6 */
-    } else {
-      const char *ip = inet_ntoa(s.sin.sin_addr);
-      if (ip)
-       silc_snprintf(remote_ip_addr, remote_ip_addr_size, ip);
-      *remote_port = ntohs(s.sin.sin_port);
-    }
-
-    SILC_LOG_DEBUG(("UDP packet from %s:%d", remote_ip_addr, *remote_port));
-  }
-
-  return len;
-}
-
-/* Send UDP packet */
-
-int silc_net_udp_send(SilcStream stream,
-                     const char *remote_ip_addr, int remote_port,
-                     const unsigned char *data, SilcUInt32 data_len)
-{
-  SilcSocketStream sock = stream;
-  SilcSockaddr remote;
-  int ret, err;
-
-  SILC_LOG_DEBUG(("Sending data to UDP socket %d", sock->sock));
-
-  /* Set sockaddr */
-  if (!silc_net_set_sockaddr(&remote, remote_ip_addr, remote_port))
-    return -2;
-
-  /* Send */
-  ret = sendto(sock->sock, data, data_len, 0, &remote.sa,
-              SIZEOF_SOCKADDR(remote));
-  if (ret == SOCKET_ERROR) {
-    err = WSAGetLastError();
-    if (err == WSAEWOULDBLOCK) {
-      SILC_LOG_DEBUG(("Could not send immediately, will do it later"));
-      silc_schedule_set_listen_fd(sock->schedule, sock->sock,
-                                 SILC_TASK_READ | SILC_TASK_WRITE, FALSE);
-      return -1;
-    }
-    SILC_LOG_DEBUG(("Cannot send to UDP socket: %s", strerror(errno)));
-    silc_schedule_unset_listen_fd(sock->schedule, sock->sock);
-    sock->sock_error = err;
-    return -2;
-  }
-
-  SILC_LOG_DEBUG(("Sent data %d bytes", ret));
-  if (silc_schedule_get_fd_events(sock->schedule, sock->sock) &
-      SILC_TASK_WRITE)
-    silc_schedule_set_listen_fd(sock->schedule, sock->sock,
-                               SILC_TASK_READ, FALSE);
-
-  return ret;
-}
-
-
-/******************************* TCP Stream *********************************/
-
-typedef struct {
-  SilcNetStatus status;
-  SilcSocketStreamStatus stream_status;
-  SilcStream stream;
-  SilcFSMStruct fsm;
-  SilcFSMThreadStruct thread;
-  SilcAsyncOperation op;
-  SilcAsyncOperation sop;
-  char *local_ip;
-  char *remote;
-  char ip_addr[64];
-  int sock;
-  SilcNetCallback callback;
-  void *context;
-  unsigned int port     : 24;
-  unsigned int retry    : 7;
-  unsigned int aborted  : 1;
-} *SilcNetConnect;
-
-SILC_FSM_STATE(silc_net_connect_st_start);
-SILC_FSM_STATE(silc_net_connect_st_stream);
-SILC_FSM_STATE(silc_net_connect_st_finish);
-
-static void silc_net_connect_wait_stream(SilcSocketStreamStatus status,
-                                        SilcStream stream, void *context)
-{
-  SilcNetConnect conn = context;
-  conn->sop = NULL;
-  conn->stream_status = status;
-  conn->stream = stream;
-  SILC_FSM_CALL_CONTINUE(&conn->thread);
-}
-
-/* Start connecting.  Create a real thread where we connect. */
-
-SILC_FSM_STATE(silc_net_connect_st_thread)
-{
-  SilcNetConnect conn = fsm_context;
-
-  /* Connect in real thread so as to not block the application. */
-  silc_fsm_thread_init(&conn->thread, fsm, conn, NULL, NULL, TRUE);
-  silc_fsm_start(&conn->thread, silc_net_connect_st_start);
-
-  /* Wait for the thread to finish */
-  silc_fsm_next(fsm, silc_net_connect_st_finish);
-  SILC_FSM_THREAD_WAIT(&conn->thread);
-}
-
-/* Connecting thread */
-
-SILC_FSM_STATE(silc_net_connect_st_start)
-{
-  SilcNetConnect conn = fsm_context;
-  SOCKET sock;
-  int rval, err;
-  SilcSockaddr desthost;
-  SilcBool prefer_ipv6 = TRUE;
-
-  if (conn->aborted)
-    return SILC_FSM_FINISH;
-
-  /* Do host lookup */
- retry:
-  if (!silc_net_gethostbyname(conn->remote, prefer_ipv6,
-                             conn->ip_addr, sizeof(conn->ip_addr))) {
-    SILC_LOG_ERROR(("Network (%s) unreachable: could not resolve the "
-                   "host, error %d", conn->remote, WSAGetLastError()));
-
-    /** Network unreachable */
-    conn->status = SILC_NET_HOST_UNREACHABLE;
-    return SILC_FSM_FINISH;
-  }
-
-  /* Set sockaddr for this connection */
-  if (!silc_net_set_sockaddr(&desthost, conn->ip_addr, conn->port))
-    return SILC_FSM_FINISH;
-
-  /* Create the connection socket */
-  sock = socket(desthost.sin.sin_family, SOCK_STREAM, 0);
-  if (sock == INVALID_SOCKET) {
-    /* If address is IPv6, then fallback to IPv4 and see whether we can do
-       better with that on socket creation. */
-    if (prefer_ipv6 && silc_net_is_ip6(conn->ip_addr)) {
-      prefer_ipv6 = FALSE;
-      goto retry;
-    }
-
-    /** Cannot create socket */
-    SILC_LOG_ERROR(("Cannot create socket, error %d", WSAGetLastError()));
-    return SILC_FSM_FINISH;
-  }
-
-  /* Bind to the local address if provided */
-  if (conn->local_ip) {
-    SilcSockaddr local;
-
-    /* Set sockaddr for local listener, and try to bind it. */
-    if (silc_net_set_sockaddr(&local, conn->local_ip, 0))
-      bind(sock, &local.sa, SIZEOF_SOCKADDR(local));
-  }
-
-  /* Connect to the host */
-  rval = connect(sock, &desthost.sa, SIZEOF_SOCKADDR(desthost));
-  err = WSAGetLastError();
-  if (rval == SOCKET_ERROR) {
-    if (err != WSAEWOULDBLOCK) {
-      shutdown(sock, 2);
-      closesocket(sock);
-
-      /* Retry using an IPv4 address, if IPv6 didn't work */
-      if (prefer_ipv6 && silc_net_is_ip6(conn->ip_addr)) {
-       prefer_ipv6 = FALSE;
-       goto retry;
-      }
-
-      switch (err) {
-      case WSAETIMEDOUT:
-       conn->status = SILC_NET_CONNECTION_TIMEOUT;
-       break;
-      case WSAECONNREFUSED:
-       conn->status = SILC_NET_CONNECTION_REFUSED;
-       break;
-      case WSAEHOSTUNREACH:
-       conn->status = SILC_NET_HOST_UNREACHABLE;
-       break;
-      default:
-       break;
-      }
-
-      SILC_LOG_ERROR(("Cannot connect to remote host, error %d",
-                     WSAGetLastError()));
-      return SILC_FSM_FINISH;
-    }
-  }
-
-  /* Set the socket to non-blocking mode */
-  silc_net_set_socket_nonblock(sock);
-
-  /* Set appropriate options */
-#if defined(TCP_NODELAY)
-  silc_net_set_socket_opt(sock, IPPROTO_TCP, TCP_NODELAY, 1);
-#endif
-  silc_net_set_socket_opt(sock, SOL_SOCKET, SO_KEEPALIVE, 1);
-
-  SILC_LOG_DEBUG(("TCP connection established"));
-
-  conn->sock = sock;
-
-  /** Connection created */
-  silc_fsm_next(fsm, silc_net_connect_st_stream);
-  SILC_FSM_CALL((conn->sop = silc_socket_tcp_stream_create(
-                                    conn->sock, TRUE, FALSE,
-                                    silc_fsm_get_schedule(&conn->fsm),
-                                    silc_net_connect_wait_stream, conn)));
-}
-
-/* TCP socket stream created */
-
-SILC_FSM_STATE(silc_net_connect_st_stream)
-{
-  SilcNetConnect conn = fsm_context;
-
-  if (conn->aborted)
-    return SILC_FSM_FINISH;
-
-  if (conn->stream_status != SILC_SOCKET_OK) {
-    /** Stream creation failed */
-    if (conn->stream_status == SILC_SOCKET_UNKNOWN_IP)
-      conn->status = SILC_NET_UNKNOWN_IP;
-    else if (conn->stream_status == SILC_SOCKET_UNKNOWN_HOST)
-      conn->status = SILC_NET_UNKNOWN_HOST;
-    else
-      conn->status = SILC_NET_ERROR;
-
-    return SILC_FSM_FINISH;
-  }
-
-  /** Stream created successfully */
-  SILC_LOG_DEBUG(("Connected successfully, sock %d", conn->sock));
-  conn->status = SILC_NET_OK;
-  return SILC_FSM_FINISH;
-}
-
-SILC_FSM_STATE(silc_net_connect_st_finish)
-{
-  SilcNetConnect conn = fsm_context;
-
-  /* Deliver error or new stream */
-  if (!conn->aborted) {
-    conn->callback(conn->status, conn->stream, conn->context);
-    if (conn->op)
-      silc_async_free(conn->op);
-  }
-
-  return SILC_FSM_FINISH;
-}
-
-static void silc_net_connect_abort(SilcAsyncOperation op, void *context)
-{
-  SilcNetConnect conn = context;
-  conn->aborted = TRUE;
-
-  /* Abort underlaying stream creation too */
-  if (conn->sop) {
-    silc_async_abort(conn->sop, NULL, NULL);
-    conn->sop = NULL;
-  }
-}
-
-static void silc_net_connect_destructor(SilcFSM fsm, void *fsm_context,
-                                       void *destructor_context)
-{
-  SilcNetConnect conn = fsm_context;
-  silc_free(conn->local_ip);
-  silc_free(conn->remote);
-  silc_free(conn);
-}
-
-/* Create asynchronous TCP/IP connection. */
-
-SilcAsyncOperation silc_net_tcp_connect(const char *local_ip_addr,
-                                       const char *remote_ip_addr,
-                                       int remote_port,
-                                       SilcSchedule schedule,
-                                       SilcNetCallback callback,
-                                       void *context)
-{
-  SilcNetConnect conn;
-
-  if (!remote_ip_addr || remote_port < 1 || !schedule || !callback)
-    return NULL;
-
-  SILC_LOG_DEBUG(("Creating connection to host %s port %d",
-                 remote_ip_addr, remote_port));
-
-  conn = silc_calloc(1, sizeof(*conn));
-  if (!conn) {
-    callback(SILC_NET_NO_MEMORY, NULL, context);
-    return NULL;
-  }
-
-  /* Start async operation */
-  conn->op = silc_async_alloc(silc_net_connect_abort, NULL, conn);
-  if (!conn->op) {
-    silc_free(conn);
-    callback(SILC_NET_NO_MEMORY, NULL, context);
-    return NULL;
-  }
-
-  if (local_ip_addr)
-    conn->local_ip = strdup(local_ip_addr);
-  conn->remote = strdup(remote_ip_addr);
-  if (!conn->remote) {
-    silc_async_free(conn->op);
-    silc_free(conn->local_ip);
-    silc_free(conn);
-    callback(SILC_NET_NO_MEMORY, NULL, context);
-    return NULL;
-  }
-  conn->port = remote_port;
-  conn->callback = callback;
-  conn->context = context;
-  conn->retry = 1;
-  conn->status = SILC_NET_ERROR;
-
-  silc_fsm_init(&conn->fsm, conn, silc_net_connect_destructor, NULL, schedule);
-  silc_fsm_start(&conn->fsm, silc_net_connect_st_thread);
-
-  return conn->op;
-}
-
-/* Closes the connection by closing the socket connection. */
-
-void silc_net_close_connection(int sock)
-{
-  SILC_LOG_DEBUG(("Closing sock %d", sock));
-  closesocket(sock);
-}
-
-/* Converts the IP number string from numbers-and-dots notation to
-   binary form. */
-
-SilcBool silc_net_addr2bin(const char *addr, void *bin, SilcUInt32 bin_len)
-{
-  if (silc_net_is_ip4(addr)) {
-    /* IPv4 address */
-    int i = 0, c = 0, d = 0, len = strlen(addr);
-    unsigned char ret[4];
-
-    memset(ret, 0, sizeof(ret));
-    while (len-- > 0) {
-      if (addr[i++] == '.') {
-       ret[c++] = d;
-       d = 0;
-       if (c > 3)
-         return FALSE;
-       continue;
-      }
-
-      if (!isdigit((int)addr[i - 1]))
-       return FALSE;
-
-      d = 10 * d + addr[i - 1] - '0';
-      if (d > 255)
-       return FALSE;
-    }
-    if (c != 3)
-      return FALSE;
-    ret[c] = d;
-
-    if (bin_len < sizeof(ret))
-      return FALSE;
-
-    memcpy(bin, ret, sizeof(ret));
-    return TRUE;
-  } else {
-#ifdef HAVE_IPV6
-    struct addrinfo hints, *ai;
-    SilcSockaddr *s;
-
-    /* IPv6 address */
-    if (bin_len < 16)
-      return FALSE;
-
-    memset(&hints, 0, sizeof(hints));
-    hints.ai_family = AF_INET6;
-    if (getaddrinfo(addr, NULL, &hints, &ai))
-      return FALSE;
-
-    if (ai) {
-      s = (SilcSockaddr *)ai->ai_addr;
-      memcpy(bin, &s->sin6.sin6_addr, sizeof(s->sin6.sin6_addr));
-      freeaddrinfo(ai);
-    }
-
-    return TRUE;
-#else
-    return FALSE;
-#endif /* HAVE_IPV6 */
-  }
-}
-
-/* Set socket to non-blocking mode. */
-
-int silc_net_set_socket_nonblock(SilcSocket sock)
-{
-  unsigned long on = 1;
-  return ioctlsocket(sock, FIONBIO, &on);
-}
diff --git a/lib/silcutil/win32/silcwin32schedule.c b/lib/silcutil/win32/silcwin32schedule.c
deleted file mode 100644 (file)
index 0a05052..0000000
+++ /dev/null
@@ -1,398 +0,0 @@
-/*
-
-  silcwin32schedule.c
-
-  Author: Pekka Riikonen <priikone@silcnet.org>
-
-  Copyright (C) 2001 - 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.
-
-*/
-/* $Id$ */
-
-#include "silc.h"
-
-const SilcScheduleOps schedule_ops;
-
-#define SILC_WM_EVENT WM_USER + 1
-
-typedef struct {
-  HWND window;                 /* Hidden window for receiving socket events */
-  WNDCLASS wclass;             /* Window class */
-  HANDLE wakeup_sema;          /* Scheduler wakeup semaphore */
-  unsigned int in_schedule   : 1;
-} *SilcWin32Scheduler;
-
-/* Our select() call.  This simply waits for some events to happen.  It also
-   dispatches window messages so it can be used as the main loop of Windows
-   application.  This doesn't wait for fds or sockets but does receive
-   notifications via wakeup semaphore when event occurs on some fd or socket.
-   The fds and sockets are scheduled via WSAAsyncSelect. */
-
-int silc_select(SilcSchedule schedule, void *context)
-{
-  SilcWin32Scheduler internal = (SilcWin32Scheduler)context;
-  HANDLE handles[MAXIMUM_WAIT_OBJECTS];
-  DWORD ready, curtime;
-  LONG timeo = INFINITE;
-  UINT timer;
-  MSG msg;
-  int nhandles = 0;
-
-  if (!internal->in_schedule) {
-    internal->in_schedule = TRUE;
-    silc_list_init(schedule->fd_dispatch, struct SilcTaskStruct, next);
-  }
-
-  /* Add wakeup semaphore to events */
-  handles[nhandles++] = internal->wakeup_sema;
-
-  /* Get timeout */
-  if (schedule->has_timeout)
-    timeo = ((schedule->timeout.tv_sec * 1000) +
-            (schedule->timeout.tv_usec / 1000));
-
-  SILC_SCHEDULE_UNLOCK(schedule);
- retry:
-  curtime = GetTickCount();
-  ready = MsgWaitForMultipleObjects(nhandles, handles, FALSE, timeo,
-                                   QS_ALLINPUT);
-
-  if (ready == WAIT_FAILED) {
-    /* Wait failed with error */
-    SILC_LOG_WARNING(("WaitForMultipleObjects() failed"));
-    SILC_SCHEDULE_LOCK(schedule);
-    internal->in_schedule = FALSE;
-    return -1;
-
-  } else if (ready >= WAIT_ABANDONED_0 &&
-            ready < WAIT_ABANDONED_0 + nhandles) {
-    /* Signal abandoned */
-    SILC_LOG_WARNING(("WaitForMultipleObjects() failed (ABANDONED)"));
-    SILC_SCHEDULE_LOCK(schedule);
-    internal->in_schedule = FALSE;
-    return -1;
-
-  } else if (ready == WAIT_TIMEOUT) {
-    /* Timeout */
-    SILC_LOG_DEBUG(("Timeout"));
-    SILC_SCHEDULE_LOCK(schedule);
-    internal->in_schedule = FALSE;
-    return 0;
-
-  } else if (ready == WAIT_OBJECT_0 + nhandles) {
-    /* Windows messages. The MSDN online says that if the application
-       creates a window then its main loop (and we're assuming that
-       it is our SILC Scheduler) must handle the Windows messages, so do
-       it here as the MSDN suggests. */
-    SILC_LOG_DEBUG(("Dispatch window messages"));
-    while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) {
-      TranslateMessage(&msg);
-      DispatchMessage(&msg);
-    }
-
-    /* If timeout is set then we must update the timeout since we won't
-       return and we will give the wait another try. */
-    if (timeo != INFINITE) {
-      timeo -= GetTickCount() - curtime;
-      curtime = GetTickCount();
-      if (timeo < 0)
-       timeo = 0;
-    }
-
-    /* Give the wait another try */
-    goto retry;
-
-  } else if (ready >= WAIT_OBJECT_0 && ready < WAIT_OBJECT_0 + nhandles) {
-    /* Some event occurred. */
-    SILC_LOG_DEBUG(("Dispatch events"));
-    SILC_SCHEDULE_LOCK(schedule);
-    internal->in_schedule = FALSE;
-    return silc_list_count(schedule->fd_dispatch) + 1;
-  }
-
-  internal->in_schedule = FALSE;
-  return -1;
-}
-
-/* Window callback.  We get here when some event occurs on file descriptor
-   or socket that has been scheduled.  We add them to dispatch queue and
-   notify the scheduler to handle them. */
-
-static LRESULT CALLBACK
-silc_schedule_wnd_proc(HWND hwnd, UINT wMsg, WPARAM wParam, LPARAM lParam)
-{
-  SilcSchedule schedule = (SilcSchedule)GetWindowLongPtr(hwnd, GWL_USERDATA);
-  SilcWin32Scheduler internal;
-  SilcUInt32 fd;
-  SilcTaskFd task;
-
-  switch (wMsg) {
-  case SILC_WM_EVENT:
-    internal = (SilcWin32Scheduler)schedule->internal;
-    fd = (SilcUInt32)wParam;
-
-    SILC_LOG_DEBUG(("SILC_WM_EVENT fd %d", fd));
-    SILC_SCHEDULE_LOCK(schedule);
-
-    if (!internal->in_schedule) {
-      /* We are not in scheduler so set up the dispatch queue now */
-      internal->in_schedule = TRUE;
-      silc_list_init(schedule->fd_dispatch, struct SilcTaskStruct, next);
-    }
-
-    /* Find task by fd */
-    if (!silc_hash_table_find(schedule->fd_queue, SILC_32_TO_PTR(fd),
-                             NULL, (void *)&task)) {
-      SILC_SCHEDULE_UNLOCK(schedule);
-      break;
-    }
-
-    /* Ignore the event if the task is not valid anymore */
-    if (!task->header.valid || !task->events) {
-      SILC_SCHEDULE_UNLOCK(schedule);
-      break;
-    }
-    task->revents = 0;
-
-    /* Handle event */
-    switch (WSAGETSELECTEVENT(lParam)) {
-    case FD_READ:
-    case FD_OOB:
-      SILC_LOG_DEBUG(("FD_READ"));
-      task->revents |= SILC_TASK_READ;
-      silc_list_add(schedule->fd_dispatch, task);
-      break;
-
-    case FD_WRITE:
-      SILC_LOG_DEBUG(("FD_WRITE"));
-      task->revents |= SILC_TASK_WRITE;
-      silc_list_add(schedule->fd_dispatch, task);
-      break;
-
-    case FD_ACCEPT:
-      SILC_LOG_DEBUG(("FD_ACCEPT"));
-      task->revents |= SILC_TASK_READ;
-      silc_list_add(schedule->fd_dispatch, task);
-      break;
-
-    default:
-      break;
-    }
-
-    /* Wakeup scheduler */
-    ReleaseSemaphore(internal->wakeup_sema, 1, NULL);
-
-    SILC_SCHEDULE_UNLOCK(schedule);
-    return TRUE;
-    break;
-
-  default:
-    break;
-  }
-
-  return DefWindowProc(hwnd, wMsg, wParam, lParam);
-}
-
-/* Init Winsock2. */
-
-static SilcBool silc_net_win32_init(void)
-{
-  int ret, sopt = SO_SYNCHRONOUS_NONALERT;
-  WSADATA wdata;
-  WORD ver = MAKEWORD(2, 2);
-
-  ret = WSAStartup(ver, &wdata);
-  if (ret)
-    return FALSE;
-
-  /* Allow using the SOCKET's as file descriptors so that we can poll
-     them with SILC Scheduler. */
-  ret = setsockopt(INVALID_SOCKET, SOL_SOCKET, SO_OPENTYPE, (char *)&sopt,
-                  sizeof(sopt));
-  if (ret)
-    return FALSE;
-
-  return TRUE;
-}
-
-/* Uninit Winsock2 */
-
-static void silc_net_win32_uninit(void)
-{
-  WSACleanup();
-}
-
-/* Initializes the platform specific scheduler.  This for example initializes
-   the wakeup mechanism of the scheduler.  In multi-threaded environment
-   the scheduler needs to be wakenup when tasks are added or removed from
-   the task queues.  Returns context to the platform specific scheduler. */
-
-void *silc_schedule_internal_init(SilcSchedule schedule, void *app_context)
-{
-  SilcWin32Scheduler internal;
-  char n[32];
-
-  /* Initialize Winsock */
-  silc_net_win32_init();
-
-  internal = silc_calloc(1, sizeof(*internal));
-  if (!internal)
-    return NULL;
-
-  schedule->max_tasks = MAXIMUM_WAIT_OBJECTS;
-
-  /* Create hidden window.  We need window so that we can use WSAAsyncSelect
-     to set socket events.  */
-  silc_snprintf(n, sizeof(n), "SilcSchedule-%p", schedule);
-  internal->wclass.lpfnWndProc = silc_schedule_wnd_proc;
-  internal->wclass.cbWndExtra = sizeof(schedule);
-  internal->wclass.lpszClassName = (CHAR *)strdup(n);
-  RegisterClass(&internal->wclass);
-  internal->window = CreateWindow((CHAR *)internal->wclass.lpszClassName, "",
-                                 0, 0, 0, 0, 0, NULL, NULL, NULL, NULL);
-  if (!internal->window) {
-    SILC_LOG_ERROR(("Could not create hidden window for scheduler"));
-    DestroyWindow(internal->window);
-    UnregisterClass((CHAR *)n, NULL);
-    silc_free(internal);
-    return NULL;
-  }
-
-  /* Set the scheduler as the window's context */
-  SetWindowLongPtr(internal->window, GWL_USERDATA, (void *)schedule);
-  SetWindowPos(internal->window, HWND_BOTTOM, 0, 0, 0, 0, SWP_FRAMECHANGED);
-
-  internal->wakeup_sema = CreateSemaphore(NULL, 0, 100, NULL);
-  if (!internal->wakeup_sema) {
-    SILC_LOG_ERROR(("Could not create wakeup semaphore for scheduler"));
-    silc_free(internal);
-    return NULL;
-  }
-
-  return (void *)internal;
-}
-
-/* Uninitializes the platform specific scheduler context. */
-
-void silc_schedule_internal_uninit(SilcSchedule schedule, void *context)
-{
-  SilcWin32Scheduler internal = (SilcWin32Scheduler)context;
-  char n[32];
-
-  if (!internal)
-    return;
-
-  silc_snprintf(n, sizeof(n), "SilcSchedule-%p", schedule);
-  DestroyWindow(internal->window);
-  UnregisterClass((CHAR *)n, NULL);
-
-  CloseHandle(internal->wakeup_sema);
-  silc_net_win32_uninit();
-
-  silc_free(internal);
-}
-
-/* Schedule `task' with events `event_mask'. Zero `event_mask' unschedules. */
-
-SilcBool silc_schedule_internal_schedule_fd(SilcSchedule schedule,
-                                           void *context,
-                                           SilcTaskFd task,
-                                           SilcTaskEvent event_mask)
-{
-  SilcWin32Scheduler internal = (SilcWin32Scheduler)context;
-  int events = 0;
-
-  if (!internal)
-    return TRUE;
-
-  SILC_LOG_DEBUG(("Scheduling fd %d for events %d", task->fd, event_mask));
-
-  if (event_mask & SILC_TASK_READ)
-    events |= FD_READ | FD_ACCEPT | FD_OOB;
-  if (event_mask & SILC_TASK_WRITE)
-    events |= FD_WRITE;
-
-  /* Schedule for events.  The silc_schedule_wnd_proc will be called to
-     deliver the events for this fd. */
-  WSAAsyncSelect(task->fd, internal->window, SILC_WM_EVENT, events);
-  task->revents = 0;
-
-  return TRUE;
-}
-
-/* Wakes up the scheduler */
-
-void silc_schedule_internal_wakeup(SilcSchedule schedule, void *context)
-{
-#ifdef SILC_THREADS
-  SilcWin32Scheduler internal = (SilcWin32Scheduler)context;
-  ReleaseSemaphore(internal->wakeup_sema, 1, NULL);
-#endif /* SILC_THREADS */
-}
-
-/* Register signal */
-
-void silc_schedule_internal_signal_register(SilcSchedule schedule,
-                                           void *context,
-                                            SilcUInt32 signal,
-                                            SilcTaskCallback callback,
-                                            void *callback_context)
-{
-
-}
-
-/* Unregister signal */
-
-void silc_schedule_internal_signal_unregister(SilcSchedule schedule,
-                                             void *context,
-                                              SilcUInt32 signal)
-{
-
-}
-
-/* Call all signals */
-
-void silc_schedule_internal_signals_call(SilcSchedule schedule,
-                                        void *context)
-{
-
-}
-
-/* Block registered signals in scheduler. */
-
-void silc_schedule_internal_signals_block(SilcSchedule schedule,
-                                         void *context)
-{
-
-}
-
-/* Unblock registered signals in schedule. */
-
-void silc_schedule_internal_signals_unblock(SilcSchedule schedule,
-                                           void *context)
-{
-
-}
-
-const SilcScheduleOps schedule_ops =
-{
-  silc_schedule_internal_init,
-  silc_schedule_internal_uninit,
-  silc_select,
-  silc_schedule_internal_schedule_fd,
-  silc_schedule_internal_wakeup,
-  silc_schedule_internal_signal_register,
-  silc_schedule_internal_signal_unregister,
-  silc_schedule_internal_signals_call,
-  silc_schedule_internal_signals_block,
-  silc_schedule_internal_signals_unblock,
-};
diff --git a/lib/silcutil/win32/silcwin32socketstream.c b/lib/silcutil/win32/silcwin32socketstream.c
deleted file mode 100644 (file)
index ac12c82..0000000
+++ /dev/null
@@ -1,232 +0,0 @@
-/*
-
-  silcwin32socketstream.c
-
-  Author: Pekka Riikonen <priikone@silcnet.org>
-
-  Copyright (C) 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.
-
-*/
-
-#include "silc.h"
-
-/************************ Static utility functions **************************/
-
-/* The IO process callback that calls the notifier callback to upper layer. */
-
-SILC_TASK_CALLBACK(silc_socket_stream_io)
-{
-  SilcSocketStream stream = context;
-
-  if (!stream->notifier)
-    return;
-
-  switch (type) {
-  case SILC_TASK_READ:
-    stream->notifier(stream, SILC_STREAM_CAN_READ, stream->notifier_context);
-    break;
-
-  case SILC_TASK_WRITE:
-    stream->notifier(stream, SILC_STREAM_CAN_WRITE, stream->notifier_context);
-    break;
-
-  default:
-    break;
-  }
-}
-
-/**************************** Stream Operations *****************************/
-
-/* Stream read operation */
-
-int silc_socket_stream_read(SilcStream stream, unsigned char *buf,
-                           SilcUInt32 buf_len)
-{
-  SilcSocketStream sock = stream;
-  SOCKET fd = sock->sock;
-  int len, argp;
-
-  SILC_LOG_DEBUG(("Reading data from socket %d", fd));
-
-  /* Check whether there is data available, without calling recv(). */
-  ioctlsocket(fd, FIONREAD, (unsigned long *)&argp);
-  if (argp == 0) {
-    /* Is this kludge or what? Without this thing this contraption
-       does not work at all!?. */
-    SleepEx(1, TRUE);
-    SILC_LOG_DEBUG(("Could not read immediately, will do it later"));
-    silc_schedule_set_listen_fd(sock->schedule, sock->sock,
-                               silc_schedule_get_fd_events(sock->schedule,
-                                                           sock->sock) |
-                               SILC_TASK_READ, FALSE);
-    return -1;
-  }
-
-  /* Read the data from the socket. */
-  len = recv(fd, buf, buf_len, 0);
-  if (len == SOCKET_ERROR) {
-    len = WSAGetLastError();
-    if (len == WSAEWOULDBLOCK || len == WSAEINTR) {
-      SILC_LOG_DEBUG(("Could not read immediately, will do it later"));
-      silc_schedule_set_listen_fd(sock->schedule, sock->sock,
-                                 silc_schedule_get_fd_events(sock->schedule,
-                                                             sock->sock) |
-                                 SILC_TASK_READ, FALSE);
-      return -1;
-    }
-    SILC_LOG_DEBUG(("Cannot read from socket: %d", sock->sock));
-    silc_schedule_unset_listen_fd(sock->schedule, sock->sock);
-    sock->sock_error = len;
-    return -2;
-  }
-
-  SILC_LOG_DEBUG(("Read %d bytes", len));
-
-  if (!len)
-    silc_schedule_unset_listen_fd(sock->schedule, sock->sock);
-
-  return len;
-}
-
-/* Stream write operation */
-
-int silc_socket_stream_write(SilcStream stream, const unsigned char *data,
-                            SilcUInt32 data_len)
-{
-  SilcSocketStream sock = stream;
-  SOCKET fd = sock->sock;
-  int ret;
-
-  SILC_LOG_DEBUG(("Writing data to socket %d", fd));
-
-  ret = send(fd, data, data_len,  0);
-  if (ret == SOCKET_ERROR) {
-    ret = WSAGetLastError();
-    if (ret == WSAEWOULDBLOCK) {
-      SILC_LOG_DEBUG(("Could not write immediately, will do it later"));
-      silc_schedule_set_listen_fd(sock->schedule, sock->sock,
-                                 SILC_TASK_READ | SILC_TASK_WRITE, FALSE);
-      return -1;
-    }
-    SILC_LOG_DEBUG(("Cannot write to socket"));
-    silc_schedule_unset_listen_fd(sock->schedule, sock->sock);
-    sock->sock_error = ret;
-    return -2;
-  }
-
-  SILC_LOG_DEBUG(("Wrote data %d bytes", ret));
-  if (silc_schedule_get_fd_events(sock->schedule, sock->sock) &
-      SILC_TASK_WRITE)
-    silc_schedule_set_listen_fd(sock->schedule, sock->sock,
-                               SILC_TASK_READ, FALSE);
-
-  return ret;
-}
-
-/* Receive UDP packet.  QoS is not supported. */
-
-int silc_socket_udp_stream_read(SilcStream stream, unsigned char *buf,
-                               SilcUInt32 buf_len)
-{
-  return silc_net_udp_receive(stream, NULL, 0, NULL, buf, buf_len);
-}
-
-/* Send UDP packet.  This always succeeds. */
-
-int silc_socket_udp_stream_write(SilcStream stream, const unsigned char *data,
-                                SilcUInt32 data_len)
-{
-  SilcSocketStream sock = stream;
-
-  /* In connectionless state check if remote IP and port is provided */
-  if (!sock->connected && sock->ip && sock->port)
-    return silc_net_udp_send(stream, sock->ip, sock->port, data, data_len);
-
-  /* In connected state use normal writing to socket. */
-  return silc_socket_stream_write(stream, data, data_len);
-}
-
-/* Closes socket */
-
-SilcBool silc_socket_stream_close(SilcStream stream)
-{
-  SilcSocketStream socket_stream = stream;
-
-  if (socket_stream->schedule) {
-    silc_schedule_unset_listen_fd(socket_stream->schedule,
-                                 socket_stream->sock);
-    silc_schedule_task_del_by_fd(socket_stream->schedule,
-                                socket_stream->sock);
-  }
-  silc_net_close_connection(socket_stream->sock);
-
-  return TRUE;
-}
-
-/* Destroys the stream */
-
-void silc_socket_stream_destroy(SilcStream stream)
-{
-  SilcSocketStream socket_stream = stream;
-
-  silc_socket_stream_close(socket_stream);
-  silc_free(socket_stream->ip);
-  silc_free(socket_stream->hostname);
-  if (socket_stream->schedule)
-    silc_schedule_task_del_by_fd(socket_stream->schedule, socket_stream->sock);
-
-  if (socket_stream->schedule)
-    silc_schedule_wakeup(socket_stream->schedule);
-
-  silc_free(socket_stream);
-}
-
-/* Sets stream notification callback for the stream */
-
-SilcBool silc_socket_stream_notifier(SilcStream stream,
-                                    SilcSchedule schedule,
-                                    SilcStreamNotifier callback,
-                                    void *context)
-{
-  SilcSocketStream socket_stream = stream;
-
-  SILC_LOG_DEBUG(("Setting stream notifier callback"));
-
-  socket_stream->notifier = callback;
-  socket_stream->notifier_context = context;
-  socket_stream->schedule = schedule;
-
-  if (socket_stream->notifier && socket_stream->schedule) {
-    /* Add the socket to scheduler.  Safe to call if already added. */
-    if (!silc_schedule_task_add_fd(socket_stream->schedule,
-                                  socket_stream->sock,
-                                  silc_socket_stream_io, socket_stream))
-      return FALSE;
-
-    /* Initially set socket for reading */
-    if (!silc_schedule_set_listen_fd(socket_stream->schedule,
-                                    socket_stream->sock,
-                                    SILC_TASK_READ, FALSE))
-      return FALSE;
-  } else if (socket_stream->schedule) {
-    /* Unschedule the socket */
-    silc_schedule_unset_listen_fd(socket_stream->schedule,
-                                 socket_stream->sock);
-    silc_schedule_task_del_by_fd(socket_stream->schedule,
-                                socket_stream->sock);
-  }
-
-  if (socket_stream->schedule)
-    silc_schedule_wakeup(socket_stream->schedule);
-
-  return TRUE;
-}
diff --git a/lib/silcutil/win32/silcwin32thread.c b/lib/silcutil/win32/silcwin32thread.c
deleted file mode 100644 (file)
index 15b1ca8..0000000
+++ /dev/null
@@ -1,393 +0,0 @@
-/*
-
-  silcwin32thread.c
-
-  Author: Pekka Riikonen <priikone@silcnet.org>
-
-  Copyright (C) 2001 - 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.
-
-*/
-/* $Id$ */
-
-#include "silc.h"
-
-/**************************** SILC Thread API *******************************/
-
-#ifdef SILC_THREADS
-
-/* Thread structure for WIN32 */
-typedef struct {
-  HANDLE thread;
-  SilcThreadStart start_func;
-  void *context;
-  SilcBool waitable;
-} *SilcWin32Thread;
-
-static DWORD silc_thread_tls;
-
-/* Actual routine that is called by WIN32 when the thread is created.
-   We will call the start_func from here. When this returns the thread
-   is destroyed. */
-
-unsigned __stdcall silc_thread_win32_start(void *context)
-{
-  SilcWin32Thread thread = (SilcWin32Thread)context;
-
-  silc_thread_tls = TlsAlloc();
-  if (silc_thread_tls != TLS_OUT_OF_INDEXES)
-    TlsSetValue(silc_thread_tls, context);
-
-  silc_thread_exit(thread->start_func(thread->context));
-
-  return 0;
-}
-#endif
-
-SilcThread silc_thread_create(SilcThreadStart start_func, void *context,
-                             SilcBool waitable)
-{
-#ifdef SILC_THREADS
-  SilcWin32Thread thread;
-  unsigned id;
-
-  SILC_LOG_DEBUG(("Creating new thread"));
-
-  thread = silc_calloc(1, sizeof(*thread));
-  thread->start_func = start_func;
-  thread->context = context;
-  thread->waitable = waitable;
-  thread->thread =
-    _beginthreadex(NULL, 0, (LPTHREAD_START_ROUTINE)silc_thread_win32_start,
-                  (void *)thread, 0, &id);
-
-  if (!thread->thread) {
-    SILC_LOG_ERROR(("Could not create new thread"));
-    silc_free(thread);
-    return NULL;
-  }
-
-  return (SilcThread)thread;
-#else
-  /* Call thread callback immediately */
-  (*start_func)(context);
-  return NULL;
-#endif
-}
-
-void silc_thread_exit(void *exit_value)
-{
-#ifdef SILC_THREADS
-  SilcWin32Thread thread = TlsGetValue(silc_thread_tls);
-
-  if (thread) {
-    /* If the thread is waitable the memory is freed only in silc_thread_wait
-       by another thread. If not waitable, free it now. */
-    if (!thread->waitable)
-      silc_free(thread);
-  }
-
-  TlsFree(silc_thread_tls);
-  _endthreadex(0);
-#endif
-}
-
-SilcThread silc_thread_self(void)
-{
-#ifdef SILC_THREADS
-  SilcWin32Thread self = TlsGetValue(silc_thread_tls);
-
-  if (!self) {
-    /* This should only happen for the main thread. */
-    HANDLE handle = GetCurrentThread ();
-    HANDLE process = GetCurrentProcess ();
-    self = silc_calloc(1, sizeof(*self));
-    DuplicateHandle(process, handle, process,
-                   &self->thread, 0, FALSE,
-                   DUPLICATE_SAME_ACCESS);
-    TlsSetValue(silc_thread_tls, self);
-  }
-
-  return (SilcThread)self;
-#else
-  return NULL;
-#endif
-}
-
-SilcBool silc_thread_wait(SilcThread thread, void **exit_value)
-{
-#ifdef SILC_THREADS
-  SilcWin32Thread self = (SilcWin32Thread)thread;
-
-  SILC_LOG_DEBUG(("Waiting for thread %p", self));
-
-  if (!self->waitable)
-    return FALSE;
-
-  /* The thread is waitable thus we will free all memory after the
-     WaitForSingleObject returns, the thread is destroyed after that. */
-  WaitForSingleObject(self->thread, INFINITE);
-  CloseHandle(self->thread);
-
-  if (exit_value)
-    *exit_value = NULL;
-
-  return TRUE;
-#else
-  return FALSE;
-#endif
-}
-
-void silc_thread_yield(void)
-{
-#ifdef SILC_THREADS
-  SleepEx (0,0);
-#endif /* SILC_THREADS */
-}
-
-
-/***************************** SILC Mutex API *******************************/
-
-/* SILC Mutex structure */
-struct SilcMutexStruct {
-#ifdef SILC_THREADS
-  CRITICAL_SECTION mutex;
-#endif /* SILC_THREADS */
-  unsigned int locked : 1;
-};
-
-SilcBool silc_mutex_alloc(SilcMutex *mutex)
-{
-#ifdef SILC_THREADS
-  *mutex = silc_calloc(1, sizeof(**mutex));
-  if (!(*mutex))
-    return FALSE;
-  InitializeCriticalSection(&((*mutex)->mutex));
-  return TRUE;
-#else
-  return FALSE;
-#endif /* SILC_THREADS */
-}
-
-void silc_mutex_free(SilcMutex mutex)
-{
-#ifdef SILC_THREADS
-  if (mutex) {
-    DeleteCriticalSection(&mutex->mutex);
-    silc_free(mutex);
-  }
-#endif /* SILC_THREADS */
-}
-
-void silc_mutex_lock(SilcMutex mutex)
-{
-#ifdef SILC_THREADS
-  if (mutex) {
-    EnterCriticalSection(&mutex->mutex);
-    SILC_ASSERT(mutex->locked == FALSE);
-    mutex->locked = TRUE;
-  }
-#endif /* SILC_THREADS */
-}
-
-void silc_mutex_unlock(SilcMutex mutex)
-{
-#ifdef SILC_THREADS
-  if (mutex) {
-    SILC_ASSERT(mutex->locked == TRUE);
-    mutex->locked = FALSE;
-    LeaveCriticalSection(&mutex->mutex);
-  }
-#endif /* SILC_THREADS */
-}
-
-void silc_mutex_assert_locked(SilcMutex mutex)
-{
-#ifdef SILC_THREADS
-  if (mutex)
-    SILC_ASSERT(mutex->locked);
-#endif /* SILC_THREADS */
-}
-
-
-/***************************** SILC Rwlock API ******************************/
-
-/* SILC read/write lock structure */
-struct SilcRwLockStruct {
-#ifdef SILC_THREADS
-  SilcMutex mutex;
-  SilcCond cond;
-#endif /* SILC_THREADS */
-  unsigned int readers : 31;
-  unsigned int locked  : 1;
-};
-
-SilcBool silc_rwlock_alloc(SilcRwLock *rwlock)
-{
-#ifdef SILC_THREADS
-  *rwlock = silc_calloc(1, sizeof(**rwlock));
-  if (!(*rwlock))
-    return FALSE;
-  if (!silc_mutex_alloc(&(*rwlock)->mutex)) {
-    silc_free(*rwlock);
-    return FALSE;
-  }
-  if (!silc_cond_alloc(&(*rwlock)->cond)) {
-    silc_mutex_free((*rwlock)->mutex);
-    silc_free(*rwlock);
-    return FALSE;
-  }
-  return TRUE;
-#else
-  return FALSE;
-#endif /* SILC_THREADS */
-}
-
-void silc_rwlock_free(SilcRwLock rwlock)
-{
-#ifdef SILC_THREADS
-  if (rwlock) {
-    silc_mutex_free(rwlock->mutex);
-    silc_cond_free(rwlock->cond);
-    silc_free(rwlock);
-  }
-#endif /* SILC_THREADS */
-}
-
-void silc_rwlock_rdlock(SilcRwLock rwlock)
-{
-#ifdef SILC_THREADS
-  if (rwlock) {
-    silc_mutex_lock(rwlock->mutex);
-    rwlock->readers++;
-    silc_mutex_unlock(rwlock->mutex);
-  }
-#endif /* SILC_THREADS */
-}
-
-void silc_rwlock_wrlock(SilcRwLock rwlock)
-{
-#ifdef SILC_THREADS
-  if (rwlock) {
-    silc_mutex_lock(rwlock->mutex);
-    while (rwlock->readers > 0)
-      silc_cond_wait(rwlock->cond, rwlock->mutex);
-    rwlock->locked = TRUE;
-  }
-#endif /* SILC_THREADS */
-}
-
-void silc_rwlock_unlock(SilcRwLock rwlock)
-{
-#ifdef SILC_THREADS
-  if (rwlock) {
-    if (rwlock->locked) {
-      /* Unlock writer */
-      rwlock->locked = FALSE;
-      silc_mutex_unlock(rwlock->mutex);
-      return;
-    }
-
-    /* Unlock reader */
-    silc_mutex_lock(rwlock->mutex);
-    rwlock->readers--;
-    silc_cond_broadcast(rwlock->cond);
-    silc_mutex_unlock(rwlock->mutex);
-  }
-#endif /* SILC_THREADS */
-}
-
-
-/**************************** SILC Cond API ******************************/
-
-/* SILC Conditional Variable context */
-struct SilcCondStruct {
-#ifdef SILC_THREADS
-  HANDLE event;
-#endif /* SILC_THREADS*/
-  unsigned int waiters : 23;
-  unsigned int signal  : 1;
-};
-
-SilcBool silc_cond_alloc(SilcCond *cond)
-{
-#ifdef SILC_THREADS
-  *cond = silc_calloc(1, sizeof(**cond));
-  if (*cond == NULL)
-    return FALSE;
-  (*cond)->event = CreateEvent(NULL, TRUE, FALSE, NULL);
-  return TRUE;
-#else
-  return FALSE;
-#endif /* SILC_THREADS*/
-}
-
-void silc_cond_free(SilcCond cond)
-{
-#ifdef SILC_THREADS
-  CloseHandle(cond->event);
-  silc_free(cond);
-#endif /* SILC_THREADS*/
-}
-
-void silc_cond_signal(SilcCond cond)
-{
-#ifdef SILC_THREADS
-  cond->signal = TRUE;
-  SetEvent(cond->event);
-#endif /* SILC_THREADS*/
-}
-
-void silc_cond_broadcast(SilcCond cond)
-{
-#ifdef SILC_THREADS
-  cond->signal = TRUE;
-  SetEvent(cond->event);
-#endif /* SILC_THREADS*/
-}
-
-void silc_cond_wait(SilcCond cond, SilcMutex mutex)
-{
-#ifdef SILC_THREADS
-  silc_cond_timedwait(cond, mutex, 0);
-#endif /* SILC_THREADS*/
-}
-
-SilcBool silc_cond_timedwait(SilcCond cond, SilcMutex mutex,
-                            int timeout)
-{
-#ifdef SILC_THREADS
-  DWORD ret, t = INFINITE;
-
-  if (timeout)
-    t = timeout;
-
-  while (TRUE) {
-    cond->waiters++;
-    silc_mutex_unlock(mutex);
-
-    ret = WaitForSingleObject(cond->event, t);
-
-    silc_mutex_lock(mutex);
-    cond->waiters--;
-
-    if (ret != WAIT_OBJECT_0)
-      return FALSE;
-
-    if (cond->signal) {
-      cond->signal = FALSE;
-      ResetEvent(cond->event);
-      break;
-    }
-  }
-#endif /* SILC_THREADS*/
-  return TRUE;
-}
diff --git a/lib/silcutil/win32/silcwin32util.c b/lib/silcutil/win32/silcwin32util.c
deleted file mode 100644 (file)
index 1e6549b..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
-
-  silcwin32util.c
-
-  Author: Pekka Riikonen <priikone@silcnet.org>
-
-  Copyright (C) 2001 - 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.
-
-*/
-/* $Id$ */
-
-#include "silc.h"
-
-#define FILETIME_1970 0x019db1ded53e8000
-const BYTE DWLEN = sizeof(DWORD) * 8;
-
-/* Return current time in struct timeval. Code ripped from some xntp
-   implementation. */
-
-int silc_gettimeofday(struct timeval *tv)
-{
-  FILETIME ft;
-  __int64 usec;
-
-  GetSystemTimeAsFileTime(&ft);
-  usec = (__int64) ft.dwHighDateTime << DWLEN | ft.dwLowDateTime;
-  usec = (usec - FILETIME_1970) / 10;
-  tv->tv_sec  = (long) (usec / 1000000);
-  tv->tv_usec = (long) (usec % 1000000);
-
-  return 0;
-}
-
-char *silc_get_username(void)
-{
-  DWORD maxlen = 128;
-  char username[128];
-  GetUserName(username, &maxlen);
-  return strdup(username);
-}
-
-char *silc_get_real_name(void)
-{
-  return silc_get_username();
-}
-
-int silc_file_set_nonblock(int fd)
-{
-  return 0;
-}
diff --git a/lib/zlib/ChangeLog b/lib/zlib/ChangeLog
deleted file mode 100644 (file)
index bf2e3f9..0000000
+++ /dev/null
@@ -1,481 +0,0 @@
-
-               ChangeLog file for zlib
-
-Changes in 1.1.4 (11 March 2002)
-- ZFREE was repeated on same allocation on some error conditions.
-  This creates a security problem described in
-  http://www.zlib.org/advisory-2002-03-11.txt
-- Returned incorrect error (Z_MEM_ERROR) on some invalid data
-- Avoid accesses before window for invalid distances with inflate window
-  less than 32K.
-- force windowBits > 8 to avoid a bug in the encoder for a window size
-  of 256 bytes. (A complete fix will be available in 1.1.5).
-       
-Changes in 1.1.3 (9 July 1998)
-- fix "an inflate input buffer bug that shows up on rare but persistent
-  occasions" (Mark)
-- fix gzread and gztell for concatenated .gz files (Didier Le Botlan)
-- fix gzseek(..., SEEK_SET) in write mode
-- fix crc check after a gzeek (Frank Faubert)
-- fix miniunzip when the last entry in a zip file is itself a zip file
-  (J Lillge)
-- add contrib/asm586 and contrib/asm686 (Brian Raiter)
-  See http://www.muppetlabs.com/~breadbox/software/assembly.html
-- add support for Delphi 3 in contrib/delphi (Bob Dellaca)
-- add support for C++Builder 3 and Delphi 3 in contrib/delphi2 (Davide Moretti)
-- do not exit prematurely in untgz if 0 at start of block (Magnus Holmgren)
-- use macro EXTERN instead of extern to support DLL for BeOS (Sander Stoks)
-- added a FAQ file
-
-- Support gzdopen on Mac with Metrowerks (Jason Linhart)
-- Do not redefine Byte on Mac (Brad Pettit & Jason Linhart)
-- define SEEK_END too if SEEK_SET is not defined (Albert Chin-A-Young)
-- avoid some warnings with Borland C (Tom Tanner)
-- fix a problem in contrib/minizip/zip.c for 16-bit MSDOS (Gilles Vollant)
-- emulate utime() for WIN32 in contrib/untgz  (Gilles Vollant)
-- allow several arguments to configure (Tim Mooney, Frodo Looijaard)
-- use libdir and includedir in Makefile.in (Tim Mooney)
-- support shared libraries on OSF1 V4 (Tim Mooney)
-- remove so_locations in "make clean"  (Tim Mooney)
-- fix maketree.c compilation error (Glenn, Mark)
-- Python interface to zlib now in Python 1.5 (Jeremy Hylton)
-- new Makefile.riscos (Rich Walker)
-- initialize static descriptors in trees.c for embedded targets (Nick Smith)
-- use "foo-gz" in example.c for RISCOS and VMS (Nick Smith)
-- add the OS/2 files in Makefile.in too (Andrew Zabolotny)
-- fix fdopen and halloc macros for Microsoft C 6.0 (Tom Lane)
-- fix maketree.c to allow clean compilation of inffixed.h (Mark)
-- fix parameter check in deflateCopy (Gunther Nikl)
-- cleanup trees.c, use compressed_len only in debug mode (Christian Spieler)
-- Many portability patches by Christian Spieler:
-  . zutil.c, zutil.h: added "const" for zmem*
-  . Make_vms.com: fixed some typos
-  . Make_vms.com: msdos/Makefile.*: removed zutil.h from some dependency lists
-  . msdos/Makefile.msc: remove "default rtl link library" info from obj files
-  . msdos/Makefile.*: use model-dependent name for the built zlib library
-  . msdos/Makefile.emx, nt/Makefile.emx, nt/Makefile.gcc:
-     new makefiles, for emx (DOS/OS2), emx&rsxnt and mingw32 (Windows 9x / NT)
-- use define instead of typedef for Bytef also for MSC small/medium (Tom Lane)
-- replace __far with _far for better portability (Christian Spieler, Tom Lane)
-- fix test for errno.h in configure (Tim Newsham)
-
-Changes in 1.1.2 (19 March 98)
-- added contrib/minzip, mini zip and unzip based on zlib (Gilles Vollant)
-  See http://www.winimage.com/zLibDll/unzip.html
-- preinitialize the inflate tables for fixed codes, to make the code
-  completely thread safe (Mark)
-- some simplifications and slight speed-up to the inflate code (Mark)
-- fix gzeof on non-compressed files (Allan Schrum)
-- add -std1 option in configure for OSF1 to fix gzprintf (Martin Mokrejs)
-- use default value of 4K for Z_BUFSIZE for 16-bit MSDOS (Tim Wegner + Glenn)
-- added os2/Makefile.def and os2/zlib.def (Andrew Zabolotny)
-- add shared lib support for UNIX_SV4.2MP (MATSUURA Takanori)
-- do not wrap extern "C" around system includes (Tom Lane)
-- mention zlib binding for TCL in README (Andreas Kupries)
-- added amiga/Makefile.pup for Amiga powerUP SAS/C PPC (Andreas Kleinert)
-- allow "make install prefix=..." even after configure (Glenn Randers-Pehrson)
-- allow "configure --prefix $HOME" (Tim Mooney)
-- remove warnings in example.c and gzio.c (Glenn Randers-Pehrson)
-- move Makefile.sas to amiga/Makefile.sas
-
-Changes in 1.1.1 (27 Feb 98)
-- fix macros _tr_tally_* in deflate.h for debug mode  (Glenn Randers-Pehrson)
-- remove block truncation heuristic which had very marginal effect for zlib
-  (smaller lit_bufsize than in gzip 1.2.4) and degraded a little the
-  compression ratio on some files. This also allows inlining _tr_tally for
-  matches in deflate_slow.
-- added msdos/Makefile.w32 for WIN32 Microsoft Visual C++ (Bob Frazier)
-
-Changes in 1.1.0 (24 Feb 98)
-- do not return STREAM_END prematurely in inflate (John Bowler)
-- revert to the zlib 1.0.8 inflate to avoid the gcc 2.8.0 bug (Jeremy Buhler)
-- compile with -DFASTEST to get compression code optimized for speed only
-- in minigzip, try mmap'ing the input file first (Miguel Albrecht)
-- increase size of I/O buffers in minigzip.c and gzio.c (not a big gain
-  on Sun but significant on HP)
-
-- add a pointer to experimental unzip library in README (Gilles Vollant)
-- initialize variable gcc in configure (Chris Herborth)
-
-Changes in 1.0.9 (17 Feb 1998)
-- added gzputs and gzgets functions
-- do not clear eof flag in gzseek (Mark Diekhans)
-- fix gzseek for files in transparent mode (Mark Diekhans)
-- do not assume that vsprintf returns the number of bytes written (Jens Krinke)
-- replace EXPORT with ZEXPORT to avoid conflict with other programs
-- added compress2 in zconf.h, zlib.def, zlib.dnt
-- new asm code from Gilles Vollant in contrib/asm386
-- simplify the inflate code (Mark):
- . Replace ZALLOC's in huft_build() with single ZALLOC in inflate_blocks_new()
- . ZALLOC the length list in inflate_trees_fixed() instead of using stack
- . ZALLOC the value area for huft_build() instead of using stack
- . Simplify Z_FINISH check in inflate()
-
-- Avoid gcc 2.8.0 comparison bug a little differently than zlib 1.0.8
-- in inftrees.c, avoid cc -O bug on HP (Farshid Elahi)
-- in zconf.h move the ZLIB_DLL stuff earlier to avoid problems with
-  the declaration of FAR (Gilles VOllant)
-- install libz.so* with mode 755 (executable) instead of 644 (Marc Lehmann)
-- read_buf buf parameter of type Bytef* instead of charf*
-- zmemcpy parameters are of type Bytef*, not charf* (Joseph Strout)
-- do not redeclare unlink in minigzip.c for WIN32 (John Bowler)
-- fix check for presence of directories in "make install" (Ian Willis)
-
-Changes in 1.0.8 (27 Jan 1998)
-- fixed offsets in contrib/asm386/gvmat32.asm (Gilles Vollant)
-- fix gzgetc and gzputc for big endian systems (Markus Oberhumer)
-- added compress2() to allow setting the compression level
-- include sys/types.h to get off_t on some systems (Marc Lehmann & QingLong)
-- use constant arrays for the static trees in trees.c instead of computing
-  them at run time (thanks to Ken Raeburn for this suggestion). To create
-  trees.h, compile with GEN_TREES_H and run "make test".
-- check return code of example in "make test" and display result
-- pass minigzip command line options to file_compress
-- simplifying code of inflateSync to avoid gcc 2.8 bug
-
-- support CC="gcc -Wall" in configure -s (QingLong)
-- avoid a flush caused by ftell in gzopen for write mode (Ken Raeburn)
-- fix test for shared library support to avoid compiler warnings
-- zlib.lib -> zlib.dll in msdos/zlib.rc (Gilles Vollant)
-- check for TARGET_OS_MAC in addition to MACOS (Brad Pettit)
-- do not use fdopen for Metrowerks on Mac (Brad Pettit))
-- add checks for gzputc and gzputc in example.c
-- avoid warnings in gzio.c and deflate.c (Andreas Kleinert)
-- use const for the CRC table (Ken Raeburn)
-- fixed "make uninstall" for shared libraries
-- use Tracev instead of Trace in infblock.c
-- in example.c use correct compressed length for test_sync
-- suppress +vnocompatwarnings in configure for HPUX (not always supported)
-
-Changes in 1.0.7 (20 Jan 1998)
-- fix gzseek which was broken in write mode
-- return error for gzseek to negative absolute position
-- fix configure for Linux (Chun-Chung Chen)
-- increase stack space for MSC (Tim Wegner)
-- get_crc_table and inflateSyncPoint are EXPORTed (Gilles Vollant)
-- define EXPORTVA for gzprintf (Gilles Vollant)
-- added man page zlib.3 (Rick Rodgers)
-- for contrib/untgz, fix makedir() and improve Makefile
-
-- check gzseek in write mode in example.c
-- allocate extra buffer for seeks only if gzseek is actually called
-- avoid signed/unsigned comparisons (Tim Wegner, Gilles Vollant)
-- add inflateSyncPoint in zconf.h
-- fix list of exported functions in nt/zlib.dnt and mdsos/zlib.def
-
-Changes in 1.0.6 (19 Jan 1998)
-- add functions gzprintf, gzputc, gzgetc, gztell, gzeof, gzseek, gzrewind and
-  gzsetparams (thanks to Roland Giersig and Kevin Ruland for some of this code)
-- Fix a deflate bug occuring only with compression level 0 (thanks to
-  Andy Buckler for finding this one).
-- In minigzip, pass transparently also the first byte for .Z files.
-- return Z_BUF_ERROR instead of Z_OK if output buffer full in uncompress()
-- check Z_FINISH in inflate (thanks to Marc Schluper)
-- Implement deflateCopy (thanks to Adam Costello)
-- make static libraries by default in configure, add --shared option.
-- move MSDOS or Windows specific files to directory msdos
-- suppress the notion of partial flush to simplify the interface
-  (but the symbol Z_PARTIAL_FLUSH is kept for compatibility with 1.0.4)
-- suppress history buffer provided by application to simplify the interface
-  (this feature was not implemented anyway in 1.0.4)
-- next_in and avail_in must be initialized before calling inflateInit or
-  inflateInit2
-- add EXPORT in all exported functions (for Windows DLL)
-- added Makefile.nt (thanks to Stephen Williams)
-- added the unsupported "contrib" directory:
-   contrib/asm386/ by Gilles Vollant <info@winimage.com>
-       386 asm code replacing longest_match().
-   contrib/iostream/ by Kevin Ruland <kevin@rodin.wustl.edu>
-        A C++ I/O streams interface to the zlib gz* functions
-   contrib/iostream2/  by Tyge Løvset <Tyge.Lovset@cmr.no>
-       Another C++ I/O streams interface
-   contrib/untgz/  by "Pedro A. Aranda Guti\irrez" <paag@tid.es>
-       A very simple tar.gz file extractor using zlib
-   contrib/visual-basic.txt by Carlos Rios <c_rios@sonda.cl>
-        How to use compress(), uncompress() and the gz* functions from VB.
-- pass params -f (filtered data), -h (huffman only), -1 to -9 (compression
-  level) in minigzip (thanks to Tom Lane)
-
-- use const for rommable constants in deflate
-- added test for gzseek and gztell in example.c
-- add undocumented function inflateSyncPoint() (hack for Paul Mackerras)
-- add undocumented function zError to convert error code to string
-  (for Tim Smithers)
-- Allow compilation of gzio with -DNO_DEFLATE to avoid the compression code.
-- Use default memcpy for Symantec MSDOS compiler.
-- Add EXPORT keyword for check_func (needed for Windows DLL)
-- add current directory to LD_LIBRARY_PATH for "make test"
-- create also a link for libz.so.1
-- added support for FUJITSU UXP/DS (thanks to Toshiaki Nomura)
-- use $(SHAREDLIB) instead of libz.so in Makefile.in (for HPUX)
-- added -soname for Linux in configure (Chun-Chung Chen,
-- assign numbers to the exported functions in zlib.def (for Windows DLL)
-- add advice in zlib.h for best usage of deflateSetDictionary
-- work around compiler bug on Atari (cast Z_NULL in call of s->checkfn)
-- allow compilation with ANSI keywords only enabled for TurboC in large model
-- avoid "versionString"[0] (Borland bug)
-- add NEED_DUMMY_RETURN for Borland
-- use variable z_verbose for tracing in debug mode (L. Peter Deutsch).
-- allow compilation with CC
-- defined STDC for OS/2 (David Charlap)        
-- limit external names to 8 chars for MVS (Thomas Lund)
-- in minigzip.c, use static buffers only for 16-bit systems
-- fix suffix check for "minigzip -d foo.gz"
-- do not return an error for the 2nd of two consecutive gzflush() (Felix Lee)
-- use _fdopen instead of fdopen for MSC >= 6.0 (Thomas Fanslau)
-- added makelcc.bat for lcc-win32 (Tom St Denis)
-- in Makefile.dj2, use copy and del instead of install and rm (Frank Donahoe)
-- Avoid expanded $Id$. Use "rcs -kb" or "cvs admin -kb" to avoid Id expansion.
-- check for unistd.h in configure (for off_t)
-- remove useless check parameter in inflate_blocks_free
-- avoid useless assignment of s->check to itself in inflate_blocks_new
-- do not flush twice in gzclose (thanks to Ken Raeburn)
-- rename FOPEN as F_OPEN to avoid clash with /usr/include/sys/file.h
-- use NO_ERRNO_H instead of enumeration of operating systems with errno.h
-- work around buggy fclose on pipes for HP/UX
-- support zlib DLL with BORLAND C++ 5.0 (thanks to Glenn Randers-Pehrson)
-- fix configure if CC is already equal to gcc
-
-Changes in 1.0.5 (3 Jan 98)
-- Fix inflate to terminate gracefully when fed corrupted or invalid data
-- Use const for rommable constants in inflate
-- Eliminate memory leaks on error conditions in inflate
-- Removed some vestigial code in inflate
-- Update web address in README
-  
-Changes in 1.0.4 (24 Jul 96)
-- In very rare conditions, deflate(s, Z_FINISH) could fail to produce an EOF
-  bit, so the decompressor could decompress all the correct data but went
-  on to attempt decompressing extra garbage data. This affected minigzip too.
-- zlibVersion and gzerror return const char* (needed for DLL)
-- port to RISCOS (no fdopen, no multiple dots, no unlink, no fileno)
-- use z_error only for DEBUG (avoid problem with DLLs)
-
-Changes in 1.0.3 (2 Jul 96)
-- use z_streamp instead of z_stream *, which is now a far pointer in MSDOS
-  small and medium models; this makes the library incompatible with previous
-  versions for these models. (No effect in large model or on other systems.)
-- return OK instead of BUF_ERROR if previous deflate call returned with
-  avail_out as zero but there is nothing to do
-- added memcmp for non STDC compilers
-- define NO_DUMMY_DECL for more Mac compilers (.h files merged incorrectly)
-- define __32BIT__ if __386__ or i386 is defined (pb. with Watcom and SCO)
-- better check for 16-bit mode MSC (avoids problem with Symantec)
-
-Changes in 1.0.2 (23 May 96)
-- added Windows DLL support
-- added a function zlibVersion (for the DLL support)
-- fixed declarations using Bytef in infutil.c (pb with MSDOS medium model)
-- Bytef is define's instead of typedef'd only for Borland C
-- avoid reading uninitialized memory in example.c
-- mention in README that the zlib format is now RFC1950
-- updated Makefile.dj2
-- added algorithm.doc
-
-Changes in 1.0.1 (20 May 96) [1.0 skipped to avoid confusion]
-- fix array overlay in deflate.c which sometimes caused bad compressed data
-- fix inflate bug with empty stored block
-- fix MSDOS medium model which was broken in 0.99
-- fix deflateParams() which could generated bad compressed data.
-- Bytef is define'd instead of typedef'ed (work around Borland bug)
-- added an INDEX file
-- new makefiles for DJGPP (Makefile.dj2), 32-bit Borland (Makefile.b32),
-  Watcom (Makefile.wat), Amiga SAS/C (Makefile.sas)
-- speed up adler32 for modern machines without auto-increment
-- added -ansi for IRIX in configure
-- static_init_done in trees.c is an int
-- define unlink as delete for VMS
-- fix configure for QNX
-- add configure branch for SCO and HPUX
-- avoid many warnings (unused variables, dead assignments, etc...)
-- no fdopen for BeOS
-- fix the Watcom fix for 32 bit mode (define FAR as empty)
-- removed redefinition of Byte for MKWERKS
-- work around an MWKERKS bug (incorrect merge of all .h files)
-
-Changes in 0.99 (27 Jan 96)
-- allow preset dictionary shared between compressor and decompressor
-- allow compression level 0 (no compression)
-- add deflateParams in zlib.h: allow dynamic change of compression level
-  and compression strategy.
-- test large buffers and deflateParams in example.c
-- add optional "configure" to build zlib as a shared library
-- suppress Makefile.qnx, use configure instead
-- fixed deflate for 64-bit systems (detected on Cray)
-- fixed inflate_blocks for 64-bit systems (detected on Alpha)
-- declare Z_DEFLATED in zlib.h (possible parameter for deflateInit2)
-- always return Z_BUF_ERROR when deflate() has nothing to do
-- deflateInit and inflateInit are now macros to allow version checking
-- prefix all global functions and types with z_ with -DZ_PREFIX
-- make falloc completely reentrant (inftrees.c)
-- fixed very unlikely race condition in ct_static_init
-- free in reverse order of allocation to help memory manager
-- use zlib-1.0/* instead of zlib/* inside the tar.gz
-- make zlib warning-free with "gcc -O3 -Wall -Wwrite-strings -Wpointer-arith
-  -Wconversion -Wstrict-prototypes -Wmissing-prototypes"
-- allow gzread on concatenated .gz files
-- deflateEnd now returns Z_DATA_ERROR if it was premature
-- deflate is finally (?) fully deterministic (no matches beyond end of input)
-- Document Z_SYNC_FLUSH
-- add uninstall in Makefile
-- Check for __cpluplus in zlib.h
-- Better test in ct_align for partial flush
-- avoid harmless warnings for Borland C++
-- initialize hash_head in deflate.c
-- avoid warning on fdopen (gzio.c) for HP cc -Aa
-- include stdlib.h for STDC compilers
-- include errno.h for Cray
-- ignore error if ranlib doesn't exist
-- call ranlib twice for NeXTSTEP
-- use exec_prefix instead of prefix for libz.a
-- renamed ct_* as _tr_* to avoid conflict with applications
-- clear z->msg in inflateInit2 before any error return
-- initialize opaque in example.c, gzio.c, deflate.c and inflate.c
-- fixed typo in zconf.h (_GNUC__ => __GNUC__)
-- check for WIN32 in zconf.h and zutil.c (avoid farmalloc in 32-bit mode)
-- fix typo in Make_vms.com (f$trnlnm -> f$getsyi)
-- in fcalloc, normalize pointer if size > 65520 bytes
-- don't use special fcalloc for 32 bit Borland C++
-- use STDC instead of __GO32__ to avoid redeclaring exit, calloc, etc...
-- use Z_BINARY instead of BINARY
-- document that gzclose after gzdopen will close the file
-- allow "a" as mode in gzopen.
-- fix error checking in gzread
-- allow skipping .gz extra-field on pipes
-- added reference to Perl interface in README
-- put the crc table in FAR data (I dislike more and more the medium model :)
-- added get_crc_table
-- added a dimension to all arrays (Borland C can't count).
-- workaround Borland C bug in declaration of inflate_codes_new & inflate_fast
-- guard against multiple inclusion of *.h (for precompiled header on Mac)
-- Watcom C pretends to be Microsoft C small model even in 32 bit mode.
-- don't use unsized arrays to avoid silly warnings by Visual C++:
-     warning C4746: 'inflate_mask' : unsized array treated as  '__far'
-     (what's wrong with far data in far model?).
-- define enum out of inflate_blocks_state to allow compilation with C++
-
-Changes in 0.95 (16 Aug 95)
-- fix MSDOS small and medium model (now easier to adapt to any compiler)
-- inlined send_bits
-- fix the final (:-) bug for deflate with flush (output was correct but
-  not completely flushed in rare occasions).
-- default window size is same for compression and decompression
-  (it's now sufficient to set MAX_WBITS in zconf.h).
-- voidp -> voidpf and voidnp -> voidp (for consistency with other
-  typedefs and because voidnp was not near in large model).
-
-Changes in 0.94 (13 Aug 95)
-- support MSDOS medium model
-- fix deflate with flush (could sometimes generate bad output)
-- fix deflateReset (zlib header was incorrectly suppressed)
-- added support for VMS
-- allow a compression level in gzopen()
-- gzflush now calls fflush
-- For deflate with flush, flush even if no more input is provided.
-- rename libgz.a as libz.a
-- avoid complex expression in infcodes.c triggering Turbo C bug
-- work around a problem with gcc on Alpha (in INSERT_STRING)
-- don't use inline functions (problem with some gcc versions)
-- allow renaming of Byte, uInt, etc... with #define.
-- avoid warning about (unused) pointer before start of array in deflate.c
-- avoid various warnings in gzio.c, example.c, infblock.c, adler32.c, zutil.c
-- avoid reserved word 'new' in trees.c
-
-Changes in 0.93 (25 June 95)
-- temporarily disable inline functions
-- make deflate deterministic
-- give enough lookahead for PARTIAL_FLUSH
-- Set binary mode for stdin/stdout in minigzip.c for OS/2
-- don't even use signed char in inflate (not portable enough)
-- fix inflate memory leak for segmented architectures
-
-Changes in 0.92 (3 May 95)
-- don't assume that char is signed (problem on SGI)
-- Clear bit buffer when starting a stored block
-- no memcpy on Pyramid
-- suppressed inftest.c
-- optimized fill_window, put longest_match inline for gcc
-- optimized inflate on stored blocks.
-- untabify all sources to simplify patches
-
-Changes in 0.91 (2 May 95)
-- Default MEM_LEVEL is 8 (not 9 for Unix) as documented in zlib.h
-- Document the memory requirements in zconf.h
-- added "make install"
-- fix sync search logic in inflateSync
-- deflate(Z_FULL_FLUSH) now works even if output buffer too short
-- after inflateSync, don't scare people with just "lo world"
-- added support for DJGPP
-
-Changes in 0.9 (1 May 95)
-- don't assume that zalloc clears the allocated memory (the TurboC bug
-  was Mark's bug after all :)
-- let again gzread copy uncompressed data unchanged (was working in 0.71)
-- deflate(Z_FULL_FLUSH), inflateReset and inflateSync are now fully implemented
-- added a test of inflateSync in example.c
-- moved MAX_WBITS to zconf.h because users might want to change that.
-- document explicitly that zalloc(64K) on MSDOS must return a normalized
-  pointer (zero offset)
-- added Makefiles for Microsoft C, Turbo C, Borland C++
-- faster crc32()
-
-Changes in 0.8 (29 April 95)
-- added fast inflate (inffast.c)
-- deflate(Z_FINISH) now returns Z_STREAM_END when done. Warning: this
-  is incompatible with previous versions of zlib which returned Z_OK.
-- work around a TurboC compiler bug (bad code for b << 0, see infutil.h)
-  (actually that was not a compiler bug, see 0.81 above)
-- gzread no longer reads one extra byte in certain cases
-- In gzio destroy(), don't reference a freed structure
-- avoid many warnings for MSDOS
-- avoid the ERROR symbol which is used by MS Windows
-
-Changes in 0.71 (14 April 95)
-- Fixed more MSDOS compilation problems :( There is still a bug with
-  TurboC large model.
-
-Changes in 0.7 (14 April 95)
-- Added full inflate support.
-- Simplified the crc32() interface. The pre- and post-conditioning
-  (one's complement) is now done inside crc32(). WARNING: this is
-  incompatible with previous versions; see zlib.h for the new usage.
-
-Changes in 0.61 (12 April 95)
-- workaround for a bug in TurboC. example and minigzip now work on MSDOS.
-
-Changes in 0.6 (11 April 95)
-- added minigzip.c
-- added gzdopen to reopen a file descriptor as gzFile
-- added transparent reading of non-gziped files in gzread.
-- fixed bug in gzread (don't read crc as data)
-- fixed bug in destroy (gzio.c) (don't return Z_STREAM_END for gzclose).
-- don't allocate big arrays in the stack (for MSDOS)
-- fix some MSDOS compilation problems
-
-Changes in 0.5:
-- do real compression in deflate.c. Z_PARTIAL_FLUSH is supported but
-  not yet Z_FULL_FLUSH.
-- support decompression but only in a single step (forced Z_FINISH)
-- added opaque object for zalloc and zfree.
-- added deflateReset and inflateReset
-- added a variable zlib_version for consistency checking.
-- renamed the 'filter' parameter of deflateInit2 as 'strategy'.
-  Added Z_FILTERED and Z_HUFFMAN_ONLY constants.
-
-Changes in 0.4:
-- avoid "zip" everywhere, use zlib instead of ziplib.
-- suppress Z_BLOCK_FLUSH, interpret Z_PARTIAL_FLUSH as block flush
-  if compression method == 8.
-- added adler32 and crc32
-- renamed deflateOptions as deflateInit2, call one or the other but not both
-- added the method parameter for deflateInit2.
-- added inflateInit2
-- simplied considerably deflateInit and inflateInit by not supporting
-  user-provided history buffer. This is supported only in deflateInit2
-  and inflateInit2.
-
-Changes in 0.3:
-- prefix all macro names with Z_
-- use Z_FINISH instead of deflateEnd to finish compression.
-- added Z_HUFFMAN_ONLY
-- added gzerror()
diff --git a/lib/zlib/FAQ b/lib/zlib/FAQ
deleted file mode 100644 (file)
index 47a7d60..0000000
+++ /dev/null
@@ -1,100 +0,0 @@
-
-               Frequently Asked Questions about zlib
-
-
-If your question is not there, please check the zlib home page 
-http://www.zlib.org which may have more recent information.
-The lastest zlib FAQ is at http://www.gzip.org/zlib/zlib_faq.html
-
-
- 1. Is zlib Y2K-compliant?
-
-    Yes. zlib doesn't handle dates.
-
- 2. Where can I get a Windows DLL version?
-
-    The zlib sources can be compiled without change to produce a DLL. If you
-    want a precompiled DLL, see http://www.winimage.com/zLibDll/ . Questions
-    about the zlib DLL should be sent to Gilles Vollant (info@winimage.com).
-
- 3. Where can I get a Visual Basic interface to zlib?
-
-    See
-        * http://www.winimage.com/zLibDll/cmp-z-it.zip
-        * http://www.dogma.net/markn/articles/zlibtool/zlibtool.htm
-        * contrib/visual-basic.txt in the zlib distribution
-
- 4. compress() returns Z_BUF_ERROR
-
-    Make sure that before the call of compress, the length of the compressed
-    buffer is equal to the total size of the compressed buffer and not
-    zero. For Visual Basic, check that this parameter is passed by reference
-    ("as any"), not by value ("as long").
-
- 5. deflate() or inflate() returns Z_BUF_ERROR
-
-    Before making the call, make sure that avail_in and avail_out are not
-    zero. When setting the parameter flush equal to Z_FINISH, also make sure
-    that avail_out is big enough to allow processing all pending input.
-
- 6. Where's the zlib documentation (man pages, etc.)?
-
-    It's in zlib.h for the moment, and Francis S. Lin has converted it to a
-    web page zlib.html. Volunteers to transform this to Unix-style man pages,
-    please contact Jean-loup Gailly (jloup@gzip.org). Examples of zlib usage
-    are in the files example.c and minigzip.c.
-
- 7. Why don't you use GNU autoconf or libtool or ...?
-
-    Because we would like to keep zlib as a very small and simple
-    package. zlib is rather portable and doesn't need much configuration.
-
- 8. I found a bug in zlib.
-
-    Most of the time, such problems are due to an incorrect usage of
-    zlib. Please try to reproduce the problem with a small program and send
-    the corresponding source to us at zlib@gzip.org . Do not send
-    multi-megabyte data files without prior agreement.
-
- 9. Why do I get "undefined reference to gzputc"?
-
-    If "make test" produces something like
-
-       example.o(.text+0x154): undefined reference to `gzputc'
-      
-    check that you don't have old files libz.* in /usr/lib, /usr/local/lib or
-    /usr/X11R6/lib. Remove any old versions, then do "make install".
-
-10. I need a Delphi interface to zlib.
-
-    See the directories contrib/delphi and contrib/delphi2 in the zlib
-    distribution.
-
-11. Can zlib handle .zip archives?
-
-    See the directory contrib/minizip in the zlib distribution.
-
-12. Can zlib handle .Z files?
-
-    No, sorry. You have to spawn an uncompress or gunzip subprocess, or adapt
-    the code of uncompress on your own.
-
-13. How can I make a Unix shared library?
-
-    make clean
-    ./configure -s
-    make
-
-14. Why does "make test" fail on Mac OS X?
-
-    Mac OS X already includes zlib as a shared library, and so -lz links the
-    shared library instead of the one that the "make" compiled. For zlib
-    1.1.3, the two are incompatible due to different compile-time
-    options. Simply change the -lz in the Makefile to libz.a, and it will use
-    the compiled library instead of the shared one and the "make test" will
-    succeed.
-
-15. I have a question about OttoPDF
-
-    We are not the authors of OttoPDF. The real author is on the OttoPDF web
-    site Joel Hainley jhainley@myndkryme.com.
diff --git a/lib/zlib/INDEX b/lib/zlib/INDEX
deleted file mode 100644 (file)
index 8a24576..0000000
+++ /dev/null
@@ -1,86 +0,0 @@
-ChangeLog              history of changes
-INDEX                  this file
-FAQ                    Frequently Asked Questions about zlib
-Make_vms.com           script for Vax/VMS
-Makefile               makefile for Unix (generated by configure)
-Makefile.in            makefile for Unix (template for configure)
-Makefile.riscos        makefile for RISCOS
-README                 guess what
-algorithm.txt          description of the (de)compression algorithm
-configure              configure script for Unix
-descrip.mms            makefile for Vax/VMS
-zlib.3                 mini man page for zlib (volunteers to write full
-                       man pages from zlib.h welcome. write to jloup@gzip.org)
-
-amiga/Makefile.sas     makefile for Amiga SAS/C
-amiga/Makefile.pup      makefile for Amiga powerUP SAS/C PPC
-
-msdos/Makefile.w32      makefile for Microsoft Visual C++ 32-bit
-msdos/Makefile.b32     makefile for Borland C++   32-bit
-msdos/Makefile.bor     makefile for Borland C/C++ 16-bit
-msdos/Makefile.dj2     makefile for DJGPP 2.x
-msdos/Makefile.emx     makefile for EMX 0.9c (32-bit DOS/OS2)
-msdos/Makefile.msc     makefile for Microsoft C 16-bit
-msdos/Makefile.tc      makefile for Turbo C
-msdos/Makefile.wat     makefile for Watcom C
-msdos/zlib.def         definition file for Windows DLL
-msdos/zlib.rc          definition file for Windows DLL
-
-nt/Makefile.nt         makefile for Windows NT
-nt/zlib.dnt            definition file for Windows NT DLL
-nt/Makefile.emx                makefile for EMX 0.9c/RSXNT 1.41 (Win32 Intel)
-nt/Makefile.gcc                makefile for Windows NT using GCC (mingw32)
-
-
-               zlib public header files (must be kept):
-zconf.h
-zlib.h
-
-               private source files used to build the zlib library:
-adler32.c
-compress.c
-crc32.c
-deflate.c
-deflate.h
-gzio.c
-infblock.c
-infblock.h
-infcodes.c
-infcodes.h
-inffast.c
-inffast.h
-inflate.c
-inftrees.c
-inftrees.h
-infutil.c
-infutil.h
-maketree.c
-trees.c
-uncompr.c
-zutil.c
-zutil.h
-
-               source files for sample programs:
-example.c
-minigzip.c
-
-               unsupported contribution by third parties
-
-contrib/asm386/ by Gilles Vollant <info@winimage.com>
-       386 asm code replacing longest_match().
-
-contrib/minizip/ by Gilles Vollant <info@winimage.com>
-       Mini zip and unzip based on zlib
-        See http://www.winimage.com/zLibDll/unzip.html
-
-contrib/iostream/ by Kevin Ruland <kevin@rodin.wustl.edu>
-        A C++ I/O streams interface to the zlib gz* functions
-
-contrib/iostream2/  by Tyge Løvset <Tyge.Lovset@cmr.no>
-       Another C++ I/O streams interface
-
-contrib/untgz/  by "Pedro A. Aranda Guti\irrez" <paag@tid.es>
-       A very simple tar.gz extractor using zlib
-
-contrib/visual-basic.txt by Carlos Rios <c_rios@sonda.cl>
-        How to use compress(), uncompress() and the gz* functions from VB.
diff --git a/lib/zlib/Make_vms.com b/lib/zlib/Make_vms.com
deleted file mode 100644 (file)
index 1c57e8f..0000000
+++ /dev/null
@@ -1,115 +0,0 @@
-$! make libz under VMS
-$! written by Martin P.J. Zinser <m.zinser@gsi.de>
-$!
-$! Look for the compiler used
-$!
-$ ccopt = ""
-$ if f$getsyi("HW_MODEL").ge.1024
-$ then
-$  ccopt = "/prefix=all"+ccopt
-$  comp  = "__decc__=1"
-$  if f$trnlnm("SYS").eqs."" then define sys sys$library:
-$ else
-$  if f$search("SYS$SYSTEM:DECC$COMPILER.EXE").eqs.""
-$   then
-$    comp  = "__vaxc__=1"
-$    if f$trnlnm("SYS").eqs."" then define sys sys$library:
-$   else
-$    if f$trnlnm("SYS").eqs."" then define sys decc$library_include:
-$    ccopt = "/decc/prefix=all"+ccopt
-$    comp  = "__decc__=1"
-$  endif
-$ endif
-$!
-$! Build the thing plain or with mms
-$!
-$ write sys$output "Compiling Zlib sources ..."
-$ if f$search("SYS$SYSTEM:MMS.EXE").eqs.""
-$  then
-$   dele example.obj;*,minigzip.obj;*
-$   CALL MAKE adler32.OBJ "CC ''CCOPT' adler32" -
-                adler32.c zlib.h zconf.h
-$   CALL MAKE compress.OBJ "CC ''CCOPT' compress" -
-                compress.c zlib.h zconf.h
-$   CALL MAKE crc32.OBJ "CC ''CCOPT' crc32" -
-                crc32.c zlib.h zconf.h
-$   CALL MAKE deflate.OBJ "CC ''CCOPT' deflate" -
-                deflate.c deflate.h zutil.h zlib.h zconf.h
-$   CALL MAKE gzio.OBJ "CC ''CCOPT' gzio" -
-                gzio.c zutil.h zlib.h zconf.h
-$   CALL MAKE infblock.OBJ "CC ''CCOPT' infblock" -
-                infblock.c zutil.h zlib.h zconf.h infblock.h
-$   CALL MAKE infcodes.OBJ "CC ''CCOPT' infcodes" -
-                infcodes.c zutil.h zlib.h zconf.h inftrees.h
-$   CALL MAKE inffast.OBJ "CC ''CCOPT' inffast" -
-                inffast.c zutil.h zlib.h zconf.h inffast.h
-$   CALL MAKE inflate.OBJ "CC ''CCOPT' inflate" -
-                inflate.c zutil.h zlib.h zconf.h infblock.h
-$   CALL MAKE inftrees.OBJ "CC ''CCOPT' inftrees" -
-                inftrees.c zutil.h zlib.h zconf.h inftrees.h
-$   CALL MAKE infutil.OBJ "CC ''CCOPT' infutil" -
-                infutil.c zutil.h zlib.h zconf.h inftrees.h infutil.h
-$   CALL MAKE trees.OBJ "CC ''CCOPT' trees" -
-                trees.c deflate.h zutil.h zlib.h zconf.h
-$   CALL MAKE uncompr.OBJ "CC ''CCOPT' uncompr" -
-                uncompr.c zlib.h zconf.h
-$   CALL MAKE zutil.OBJ "CC ''CCOPT' zutil" -
-                zutil.c zutil.h zlib.h zconf.h
-$   write sys$output "Building Zlib ..."
-$   CALL MAKE libz.OLB "lib/crea libz.olb *.obj" *.OBJ
-$   write sys$output "Building example..."
-$   CALL MAKE example.OBJ "CC ''CCOPT' example" -
-                example.c zlib.h zconf.h
-$   call make example.exe "LINK example,libz.olb/lib" example.obj libz.olb
-$   write sys$output "Building minigzip..."
-$   CALL MAKE minigzip.OBJ "CC ''CCOPT' minigzip" -
-                minigzip.c zlib.h zconf.h
-$   call make minigzip.exe - 
-                "LINK minigzip,libz.olb/lib,x11vms:xvmsutils.olb/lib" - 
-                minigzip.obj libz.olb
-$  else
-$   mms/macro=('comp')
-$  endif
-$ write sys$output "Zlib build completed"
-$ exit
-$!
-$!
-$MAKE: SUBROUTINE   !SUBROUTINE TO CHECK DEPENDENCIES
-$ V = 'F$Verify(0)
-$! P1 = What we are trying to make
-$! P2 = Command to make it
-$! P3 - P8  What it depends on
-$
-$ If F$Search(P1) .Eqs. "" Then Goto Makeit
-$ Time = F$CvTime(F$File(P1,"RDT"))
-$arg=3
-$Loop:
-$       Argument = P'arg
-$       If Argument .Eqs. "" Then Goto Exit
-$       El=0
-$Loop2:
-$       File = F$Element(El," ",Argument)
-$       If File .Eqs. " " Then Goto Endl
-$       AFile = ""
-$Loop3:
-$       OFile = AFile
-$       AFile = F$Search(File)
-$       If AFile .Eqs. "" .Or. AFile .Eqs. OFile Then Goto NextEl
-$       If F$CvTime(F$File(AFile,"RDT")) .Ges. Time Then Goto Makeit
-$       Goto Loop3
-$NextEL:
-$       El = El + 1
-$       Goto Loop2
-$EndL:
-$ arg=arg+1
-$ If arg .Le. 8 Then Goto Loop
-$ Goto Exit
-$
-$Makeit:
-$ VV=F$VERIFY(0)
-$ write sys$output P2
-$ 'P2
-$ VV='F$Verify(VV)
-$Exit:
-$ If V Then Set Verify
-$ENDSUBROUTINE
diff --git a/lib/zlib/Makefile b/lib/zlib/Makefile
deleted file mode 100644 (file)
index 4f6faba..0000000
+++ /dev/null
@@ -1,175 +0,0 @@
-# Makefile for zlib
-# Copyright (C) 1995-2002 Jean-loup Gailly.
-# For conditions of distribution and use, see copyright notice in zlib.h 
-
-# To compile and test, type:
-#   ./configure; make test
-# The call of configure is optional if you don't have special requirements
-# If you wish to build zlib as a shared library, use: ./configure -s
-
-# To install /usr/local/lib/libz.* and /usr/local/include/zlib.h, type:
-#    make install
-# To install in $HOME instead of /usr/local, use:
-#    make install prefix=$HOME
-
-CC=gcc
-
-CFLAGS=-fPIC -O3 -DHAVE_UNISTD_H -DUSE_MMAP
-#CFLAGS=-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7
-#CFLAGS=-g -DDEBUG
-#CFLAGS=-O3 -Wall -Wwrite-strings -Wpointer-arith -Wconversion \
-#           -Wstrict-prototypes -Wmissing-prototypes
-
-LDFLAGS=-L. -lz
-LDSHARED=gcc -shared -Wl,-soname,libz.so.1
-CPP=gcc -E
-
-VER=1.1.4
-LIBS=libz.so.1.1.4
-SHAREDLIB=libz.so
-
-AR=ar rc
-RANLIB=ranlib
-TAR=tar
-SHELL=/bin/sh
-
-prefix = /usr/local
-exec_prefix = ${prefix}
-libdir = ${exec_prefix}/lib
-includedir = ${prefix}/include
-
-OBJS = adler32.o compress.o crc32.o gzio.o uncompr.o deflate.o trees.o \
-       zutil.o inflate.o infblock.o inftrees.o infcodes.o infutil.o inffast.o
-
-OBJA =
-# to use the asm code: make OBJA=match.o
-
-TEST_OBJS = example.o minigzip.o
-
-DISTFILES = README FAQ INDEX ChangeLog configure Make*[a-z0-9] *.[ch] *.mms \
-  algorithm.txt zlib.3 zlib.html \
-  msdos/Make*[a-z0-9] msdos/zlib.def msdos/zlib.rc \
-  nt/Make*[a-z0-9] nt/zlib.dnt amiga/Make*.??? os2/M*.os2 os2/zlib.def \
-  contrib/RE*.contrib contrib/*.txt contrib/asm386/*.asm contrib/asm386/*.c \
-  contrib/asm386/*.bat contrib/asm386/zlibvc.d?? contrib/asm[56]86/*.?86 \
-  contrib/asm[56]86/*.S contrib/iostream/*.cpp \
-  contrib/iostream/*.h  contrib/iostream2/*.h contrib/iostream2/*.cpp \
-  contrib/untgz/Makefile contrib/untgz/*.c contrib/untgz/*.w32 \
-  contrib/minizip/[CM]*[pe] contrib/minizip/*.[ch] contrib/minizip/*.[td]?? \
-  contrib/delphi*/*.???
-
-all: example minigzip
-
-test: all
-       @LD_LIBRARY_PATH=.:$(LD_LIBRARY_PATH) ; export LD_LIBRARY_PATH; \
-       echo hello world | ./minigzip | ./minigzip -d || \
-         echo '                *** minigzip test FAILED ***' ; \
-       if ./example; then \
-         echo '                *** zlib test OK ***'; \
-       else \
-         echo '                *** zlib test FAILED ***'; \
-       fi
-
-libz.a: $(OBJS) $(OBJA)
-       $(AR) $@ $(OBJS) $(OBJA)
-       -@ ($(RANLIB) $@ || true) >/dev/null 2>&1
-
-match.o: match.S
-       $(CPP) match.S > _match.s
-       $(CC) -c _match.s
-       mv _match.o match.o
-       rm -f _match.s
-
-$(SHAREDLIB).$(VER): $(OBJS)
-       $(LDSHARED) -o $@ $(OBJS)
-       rm -f $(SHAREDLIB) $(SHAREDLIB).1
-       ln -s $@ $(SHAREDLIB)
-       ln -s $@ $(SHAREDLIB).1
-
-example: example.o $(LIBS)
-       $(CC) $(CFLAGS) -o $@ example.o $(LDFLAGS)
-
-minigzip: minigzip.o $(LIBS)
-       $(CC) $(CFLAGS) -o $@ minigzip.o $(LDFLAGS)
-
-install: $(LIBS)
-       -@if [ ! -d $(includedir)  ]; then mkdir $(includedir); fi
-       -@if [ ! -d $(libdir) ]; then mkdir $(libdir); fi
-       cp zlib.h zconf.h $(includedir)
-       chmod 644 $(includedir)/zlib.h $(includedir)/zconf.h
-       cp $(LIBS) $(libdir)
-       cd $(libdir); chmod 755 $(LIBS)
-       -@(cd $(libdir); $(RANLIB) libz.a || true) >/dev/null 2>&1
-       cd $(libdir); if test -f $(SHAREDLIB).$(VER); then \
-         rm -f $(SHAREDLIB) $(SHAREDLIB).1; \
-         ln -s $(SHAREDLIB).$(VER) $(SHAREDLIB); \
-         ln -s $(SHAREDLIB).$(VER) $(SHAREDLIB).1; \
-         (ldconfig || true)  >/dev/null 2>&1; \
-       fi
-# The ranlib in install is needed on NeXTSTEP which checks file times
-# ldconfig is for Linux
-
-uninstall:
-       cd $(includedir); \
-       v=$(VER); \
-       if test -f zlib.h; then \
-         v=`sed -n '/VERSION "/s/.*"\(.*\)".*/\1/p' < zlib.h`; \
-          rm -f zlib.h zconf.h; \
-       fi; \
-       cd $(libdir); rm -f libz.a; \
-       if test -f $(SHAREDLIB).$$v; then \
-         rm -f $(SHAREDLIB).$$v $(SHAREDLIB) $(SHAREDLIB).1; \
-       fi
-
-clean:
-       rm -f *.o *~ example minigzip libz.a libz.so* foo.gz so_locations \
-          _match.s maketree
-
-distclean:     clean
-
-zip:
-       mv Makefile Makefile~; cp -p Makefile.in Makefile
-       rm -f test.c ztest*.c contrib/minizip/test.zip
-       v=`sed -n -e 's/\.//g' -e '/VERSION "/s/.*"\(.*\)".*/\1/p' < zlib.h`;\
-       zip -ul9 zlib$$v $(DISTFILES)
-       mv Makefile~ Makefile
-
-dist:
-       mv Makefile Makefile~; cp -p Makefile.in Makefile
-       rm -f test.c ztest*.c contrib/minizip/test.zip
-       d=zlib-`sed -n '/VERSION "/s/.*"\(.*\)".*/\1/p' < zlib.h`;\
-       rm -f $$d.tar.gz; \
-       if test ! -d ../$$d; then rm -f ../$$d; ln -s `pwd` ../$$d; fi; \
-       files=""; \
-       for f in $(DISTFILES); do files="$$files $$d/$$f"; done; \
-       cd ..; \
-       GZIP=-9 $(TAR) chofz $$d/$$d.tar.gz $$files; \
-       if test ! -d $$d; then rm -f $$d; fi
-       mv Makefile~ Makefile
-
-tags:  
-       etags *.[ch]
-
-depend:
-       makedepend -- $(CFLAGS) -- *.[ch]
-
-# DO NOT DELETE THIS LINE -- make depend depends on it.
-
-adler32.o: zlib.h zconf.h
-compress.o: zlib.h zconf.h
-crc32.o: zlib.h zconf.h
-deflate.o: deflate.h zutil.h zlib.h zconf.h
-example.o: zlib.h zconf.h
-gzio.o: zutil.h zlib.h zconf.h
-infblock.o: infblock.h inftrees.h infcodes.h infutil.h zutil.h zlib.h zconf.h
-infcodes.o: zutil.h zlib.h zconf.h
-infcodes.o: inftrees.h infblock.h infcodes.h infutil.h inffast.h
-inffast.o: zutil.h zlib.h zconf.h inftrees.h
-inffast.o: infblock.h infcodes.h infutil.h inffast.h
-inflate.o: zutil.h zlib.h zconf.h infblock.h
-inftrees.o: zutil.h zlib.h zconf.h inftrees.h
-infutil.o: zutil.h zlib.h zconf.h infblock.h inftrees.h infcodes.h infutil.h
-minigzip.o:  zlib.h zconf.h 
-trees.o: deflate.h zutil.h zlib.h zconf.h trees.h
-uncompr.o: zlib.h zconf.h
-zutil.o: zutil.h zlib.h zconf.h  
diff --git a/lib/zlib/Makefile.in b/lib/zlib/Makefile.in
deleted file mode 100644 (file)
index 531562b..0000000
+++ /dev/null
@@ -1,175 +0,0 @@
-# Makefile for zlib
-# Copyright (C) 1995-2002 Jean-loup Gailly.
-# For conditions of distribution and use, see copyright notice in zlib.h 
-
-# To compile and test, type:
-#   ./configure; make test
-# The call of configure is optional if you don't have special requirements
-# If you wish to build zlib as a shared library, use: ./configure -s
-
-# To install /usr/local/lib/libz.* and /usr/local/include/zlib.h, type:
-#    make install
-# To install in $HOME instead of /usr/local, use:
-#    make install prefix=$HOME
-
-CC=cc
-
-CFLAGS=-O
-#CFLAGS=-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7
-#CFLAGS=-g -DDEBUG
-#CFLAGS=-O3 -Wall -Wwrite-strings -Wpointer-arith -Wconversion \
-#           -Wstrict-prototypes -Wmissing-prototypes
-
-LDFLAGS=-L. -lz
-LDSHARED=$(CC)
-CPP=$(CC) -E
-
-VER=1.1.4
-LIBS=libz.a
-SHAREDLIB=libz.so
-
-AR=ar rc
-RANLIB=ranlib
-TAR=tar
-SHELL=/bin/sh
-
-prefix = /usr/local
-exec_prefix = ${prefix}
-libdir = ${exec_prefix}/lib
-includedir = ${prefix}/include
-
-OBJS = adler32.o compress.o crc32.o gzio.o uncompr.o deflate.o trees.o \
-       zutil.o inflate.o infblock.o inftrees.o infcodes.o infutil.o inffast.o
-
-OBJA =
-# to use the asm code: make OBJA=match.o
-
-TEST_OBJS = example.o minigzip.o
-
-DISTFILES = README FAQ INDEX ChangeLog configure Make*[a-z0-9] *.[ch] *.mms \
-  algorithm.txt zlib.3 zlib.html \
-  msdos/Make*[a-z0-9] msdos/zlib.def msdos/zlib.rc \
-  nt/Make*[a-z0-9] nt/zlib.dnt amiga/Make*.??? os2/M*.os2 os2/zlib.def \
-  contrib/RE*.contrib contrib/*.txt contrib/asm386/*.asm contrib/asm386/*.c \
-  contrib/asm386/*.bat contrib/asm386/zlibvc.d?? contrib/asm[56]86/*.?86 \
-  contrib/asm[56]86/*.S contrib/iostream/*.cpp \
-  contrib/iostream/*.h  contrib/iostream2/*.h contrib/iostream2/*.cpp \
-  contrib/untgz/Makefile contrib/untgz/*.c contrib/untgz/*.w32 \
-  contrib/minizip/[CM]*[pe] contrib/minizip/*.[ch] contrib/minizip/*.[td]?? \
-  contrib/delphi*/*.???
-
-all: example minigzip
-
-test: all
-       @LD_LIBRARY_PATH=.:$(LD_LIBRARY_PATH) ; export LD_LIBRARY_PATH; \
-       echo hello world | ./minigzip | ./minigzip -d || \
-         echo '                *** minigzip test FAILED ***' ; \
-       if ./example; then \
-         echo '                *** zlib test OK ***'; \
-       else \
-         echo '                *** zlib test FAILED ***'; \
-       fi
-
-libz.a: $(OBJS) $(OBJA)
-       $(AR) $@ $(OBJS) $(OBJA)
-       -@ ($(RANLIB) $@ || true) >/dev/null 2>&1
-
-match.o: match.S
-       $(CPP) match.S > _match.s
-       $(CC) -c _match.s
-       mv _match.o match.o
-       rm -f _match.s
-
-$(SHAREDLIB).$(VER): $(OBJS)
-       $(LDSHARED) -o $@ $(OBJS)
-       rm -f $(SHAREDLIB) $(SHAREDLIB).1
-       ln -s $@ $(SHAREDLIB)
-       ln -s $@ $(SHAREDLIB).1
-
-example: example.o $(LIBS)
-       $(CC) $(CFLAGS) -o $@ example.o $(LDFLAGS)
-
-minigzip: minigzip.o $(LIBS)
-       $(CC) $(CFLAGS) -o $@ minigzip.o $(LDFLAGS)
-
-install: $(LIBS)
-       -@if [ ! -d $(includedir)  ]; then mkdir $(includedir); fi
-       -@if [ ! -d $(libdir) ]; then mkdir $(libdir); fi
-       cp zlib.h zconf.h $(includedir)
-       chmod 644 $(includedir)/zlib.h $(includedir)/zconf.h
-       cp $(LIBS) $(libdir)
-       cd $(libdir); chmod 755 $(LIBS)
-       -@(cd $(libdir); $(RANLIB) libz.a || true) >/dev/null 2>&1
-       cd $(libdir); if test -f $(SHAREDLIB).$(VER); then \
-         rm -f $(SHAREDLIB) $(SHAREDLIB).1; \
-         ln -s $(SHAREDLIB).$(VER) $(SHAREDLIB); \
-         ln -s $(SHAREDLIB).$(VER) $(SHAREDLIB).1; \
-         (ldconfig || true)  >/dev/null 2>&1; \
-       fi
-# The ranlib in install is needed on NeXTSTEP which checks file times
-# ldconfig is for Linux
-
-uninstall:
-       cd $(includedir); \
-       v=$(VER); \
-       if test -f zlib.h; then \
-         v=`sed -n '/VERSION "/s/.*"\(.*\)".*/\1/p' < zlib.h`; \
-          rm -f zlib.h zconf.h; \
-       fi; \
-       cd $(libdir); rm -f libz.a; \
-       if test -f $(SHAREDLIB).$$v; then \
-         rm -f $(SHAREDLIB).$$v $(SHAREDLIB) $(SHAREDLIB).1; \
-       fi
-
-clean:
-       rm -f *.o *~ example minigzip libz.a libz.so* foo.gz so_locations \
-          _match.s maketree
-
-distclean:     clean
-
-zip:
-       mv Makefile Makefile~; cp -p Makefile.in Makefile
-       rm -f test.c ztest*.c contrib/minizip/test.zip
-       v=`sed -n -e 's/\.//g' -e '/VERSION "/s/.*"\(.*\)".*/\1/p' < zlib.h`;\
-       zip -ul9 zlib$$v $(DISTFILES)
-       mv Makefile~ Makefile
-
-dist:
-       mv Makefile Makefile~; cp -p Makefile.in Makefile
-       rm -f test.c ztest*.c contrib/minizip/test.zip
-       d=zlib-`sed -n '/VERSION "/s/.*"\(.*\)".*/\1/p' < zlib.h`;\
-       rm -f $$d.tar.gz; \
-       if test ! -d ../$$d; then rm -f ../$$d; ln -s `pwd` ../$$d; fi; \
-       files=""; \
-       for f in $(DISTFILES); do files="$$files $$d/$$f"; done; \
-       cd ..; \
-       GZIP=-9 $(TAR) chofz $$d/$$d.tar.gz $$files; \
-       if test ! -d $$d; then rm -f $$d; fi
-       mv Makefile~ Makefile
-
-tags:  
-       etags *.[ch]
-
-depend:
-       makedepend -- $(CFLAGS) -- *.[ch]
-
-# DO NOT DELETE THIS LINE -- make depend depends on it.
-
-adler32.o: zlib.h zconf.h
-compress.o: zlib.h zconf.h
-crc32.o: zlib.h zconf.h
-deflate.o: deflate.h zutil.h zlib.h zconf.h
-example.o: zlib.h zconf.h
-gzio.o: zutil.h zlib.h zconf.h
-infblock.o: infblock.h inftrees.h infcodes.h infutil.h zutil.h zlib.h zconf.h
-infcodes.o: zutil.h zlib.h zconf.h
-infcodes.o: inftrees.h infblock.h infcodes.h infutil.h inffast.h
-inffast.o: zutil.h zlib.h zconf.h inftrees.h
-inffast.o: infblock.h infcodes.h infutil.h inffast.h
-inflate.o: zutil.h zlib.h zconf.h infblock.h
-inftrees.o: zutil.h zlib.h zconf.h inftrees.h
-infutil.o: zutil.h zlib.h zconf.h infblock.h inftrees.h infcodes.h infutil.h
-minigzip.o:  zlib.h zconf.h 
-trees.o: deflate.h zutil.h zlib.h zconf.h trees.h
-uncompr.o: zlib.h zconf.h
-zutil.o: zutil.h zlib.h zconf.h  
diff --git a/lib/zlib/Makefile.riscos b/lib/zlib/Makefile.riscos
deleted file mode 100644 (file)
index d97f449..0000000
+++ /dev/null
@@ -1,151 +0,0 @@
-# Project:   zlib_1_03
-# Patched for zlib 1.1.2 rw@shadow.org.uk 19980430
-# test works out-of-the-box, installs `somewhere' on demand
-
-# Toolflags:
-CCflags = -c -depend !Depend -IC: -g -throwback  -DRISCOS  -fah 
-C++flags = -c -depend !Depend -IC: -throwback
-Linkflags = -aif -c++ -o $@ 
-ObjAsmflags = -throwback -NoCache -depend !Depend
-CMHGflags = 
-LibFileflags = -c -l -o $@ 
-Squeezeflags = -o $@
-
-# change the line below to where _you_ want the library installed.
-libdest = lib:zlib
-
-# Final targets:
-@.lib:   @.o.adler32 @.o.compress @.o.crc32 @.o.deflate @.o.gzio \
-        @.o.infblock @.o.infcodes @.o.inffast @.o.inflate @.o.inftrees @.o.infutil @.o.trees \
-        @.o.uncompr @.o.zutil 
-        LibFile $(LibFileflags) @.o.adler32 @.o.compress @.o.crc32 @.o.deflate \
-        @.o.gzio @.o.infblock @.o.infcodes @.o.inffast @.o.inflate @.o.inftrees @.o.infutil \
-        @.o.trees @.o.uncompr @.o.zutil 
-test:   @.minigzip @.example @.lib
-       @copy @.lib @.libc  A~C~DF~L~N~P~Q~RS~TV
-       @echo running tests: hang on.
-       @/@.minigzip -f -9 libc
-       @/@.minigzip -d libc-gz
-       @/@.minigzip -f -1 libc
-       @/@.minigzip -d libc-gz
-       @/@.minigzip -h -9 libc
-       @/@.minigzip -d libc-gz
-       @/@.minigzip -h -1 libc
-       @/@.minigzip -d libc-gz
-       @/@.minigzip -9 libc
-       @/@.minigzip -d libc-gz
-       @/@.minigzip -1 libc
-       @/@.minigzip -d libc-gz
-       @diff @.lib @.libc
-       @echo that should have reported '@.lib and @.libc identical' if you have diff.
-       @/@.example @.fred @.fred
-       @echo that will have given lots of hello!'s.
-
-@.minigzip:   @.o.minigzip @.lib C:o.Stubs 
-        Link $(Linkflags) @.o.minigzip @.lib C:o.Stubs 
-@.example:   @.o.example @.lib C:o.Stubs 
-        Link $(Linkflags) @.o.example @.lib C:o.Stubs
-
-install: @.lib
-       cdir $(libdest)
-       cdir $(libdest).h
-       @copy @.h.zlib $(libdest).h.zlib A~C~DF~L~N~P~Q~RS~TV
-       @copy @.h.zconf $(libdest).h.zconf A~C~DF~L~N~P~Q~RS~TV
-       @copy @.lib $(libdest).lib  A~C~DF~L~N~P~Q~RS~TV
-       @echo okay, installed zlib in $(libdest)
-
-clean:; remove @.minigzip
-       remove @.example
-       remove @.libc
-       -wipe @.o.* F~r~cV
-       remove @.fred
-
-# User-editable dependencies:
-.c.o:
-        cc $(ccflags) -o $@ $<
-
-# Static dependencies:
-
-# Dynamic dependencies:
-o.example:     c.example
-o.example:     h.zlib
-o.example:     h.zconf
-o.minigzip:    c.minigzip
-o.minigzip:    h.zlib
-o.minigzip:    h.zconf
-o.adler32:     c.adler32
-o.adler32:     h.zlib
-o.adler32:     h.zconf
-o.compress:    c.compress
-o.compress:    h.zlib
-o.compress:    h.zconf
-o.crc32:       c.crc32
-o.crc32:       h.zlib
-o.crc32:       h.zconf
-o.deflate:     c.deflate
-o.deflate:     h.deflate
-o.deflate:     h.zutil
-o.deflate:     h.zlib
-o.deflate:     h.zconf
-o.gzio:        c.gzio
-o.gzio:        h.zutil
-o.gzio:        h.zlib
-o.gzio:        h.zconf
-o.infblock:    c.infblock
-o.infblock:    h.zutil
-o.infblock:    h.zlib
-o.infblock:    h.zconf
-o.infblock:    h.infblock
-o.infblock:    h.inftrees
-o.infblock:    h.infcodes
-o.infblock:    h.infutil
-o.infcodes:    c.infcodes
-o.infcodes:    h.zutil
-o.infcodes:    h.zlib
-o.infcodes:    h.zconf
-o.infcodes:    h.inftrees
-o.infcodes:    h.infblock
-o.infcodes:    h.infcodes
-o.infcodes:    h.infutil
-o.infcodes:    h.inffast
-o.inffast:     c.inffast
-o.inffast:     h.zutil
-o.inffast:     h.zlib
-o.inffast:     h.zconf
-o.inffast:     h.inftrees
-o.inffast:     h.infblock
-o.inffast:     h.infcodes
-o.inffast:     h.infutil
-o.inffast:     h.inffast
-o.inflate:     c.inflate
-o.inflate:     h.zutil
-o.inflate:     h.zlib
-o.inflate:     h.zconf
-o.inflate:     h.infblock
-o.inftrees:    c.inftrees
-o.inftrees:    h.zutil
-o.inftrees:    h.zlib
-o.inftrees:    h.zconf
-o.inftrees:    h.inftrees
-o.inftrees:    h.inffixed
-o.infutil:     c.infutil
-o.infutil:     h.zutil
-o.infutil:     h.zlib
-o.infutil:     h.zconf
-o.infutil:     h.infblock
-o.infutil:     h.inftrees
-o.infutil:     h.infcodes
-o.infutil:     h.infutil
-o.trees:       c.trees
-o.trees:       h.deflate
-o.trees:       h.zutil
-o.trees:       h.zlib
-o.trees:       h.zconf
-o.trees:       h.trees
-o.uncompr:     c.uncompr
-o.uncompr:     h.zlib
-o.uncompr:     h.zconf
-o.zutil:       c.zutil
-o.zutil:       h.zutil
-o.zutil:       h.zlib
-o.zutil:       h.zconf
diff --git a/lib/zlib/README b/lib/zlib/README
deleted file mode 100644 (file)
index 29d6714..0000000
+++ /dev/null
@@ -1,147 +0,0 @@
-zlib 1.1.4 is a general purpose data compression library.  All the code
-is thread safe.  The data format used by the zlib library
-is described by RFCs (Request for Comments) 1950 to 1952 in the files 
-http://www.ietf.org/rfc/rfc1950.txt (zlib format), rfc1951.txt (deflate
-format) and rfc1952.txt (gzip format). These documents are also available in
-other formats from ftp://ftp.uu.net/graphics/png/documents/zlib/zdoc-index.html
-
-All functions of the compression library are documented in the file zlib.h
-(volunteer to write man pages welcome, contact jloup@gzip.org). A usage
-example of the library is given in the file example.c which also tests that
-the library is working correctly. Another example is given in the file
-minigzip.c. The compression library itself is composed of all source files
-except example.c and minigzip.c.
-
-To compile all files and run the test program, follow the instructions
-given at the top of Makefile. In short "make test; make install"
-should work for most machines. For Unix: "./configure; make test; make install"
-For MSDOS, use one of the special makefiles such as Makefile.msc.
-For VMS, use Make_vms.com or descrip.mms.
-
-Questions about zlib should be sent to <zlib@gzip.org>, or to
-Gilles Vollant <info@winimage.com> for the Windows DLL version.
-The zlib home page is http://www.zlib.org or http://www.gzip.org/zlib/
-Before reporting a problem, please check this site to verify that
-you have the latest version of zlib; otherwise get the latest version and
-check whether the problem still exists or not.
-
-PLEASE read the zlib FAQ http://www.gzip.org/zlib/zlib_faq.html
-before asking for help.
-
-Mark Nelson <markn@ieee.org> wrote an article about zlib for the Jan. 1997
-issue of  Dr. Dobb's Journal; a copy of the article is available in
-http://dogma.net/markn/articles/zlibtool/zlibtool.htm
-
-The changes made in version 1.1.4 are documented in the file ChangeLog.
-The only changes made since 1.1.3 are bug corrections:
-
-- ZFREE was repeated on same allocation on some error conditions.
-  This creates a security problem described in
-  http://www.zlib.org/advisory-2002-03-11.txt
-- Returned incorrect error (Z_MEM_ERROR) on some invalid data
-- Avoid accesses before window for invalid distances with inflate window
-  less than 32K.
-- force windowBits > 8 to avoid a bug in the encoder for a window size
-  of 256 bytes. (A complete fix will be available in 1.1.5).
-
-The beta version 1.1.5beta includes many more changes. A new official
-version 1.1.5 will be released as soon as extensive testing has been
-completed on it.
-
-
-Unsupported third party contributions are provided in directory "contrib".
-
-A Java implementation of zlib is available in the Java Development Kit
-http://www.javasoft.com/products/JDK/1.1/docs/api/Package-java.util.zip.html
-See the zlib home page http://www.zlib.org for details.
-
-A Perl interface to zlib written by Paul Marquess <pmarquess@bfsec.bt.co.uk>
-is in the CPAN (Comprehensive Perl Archive Network) sites
-http://www.cpan.org/modules/by-module/Compress/
-
-A Python interface to zlib written by A.M. Kuchling <amk@magnet.com>
-is available in Python 1.5 and later versions, see
-http://www.python.org/doc/lib/module-zlib.html
-
-A zlib binding for TCL written by Andreas Kupries <a.kupries@westend.com>
-is availlable at http://www.westend.com/~kupries/doc/trf/man/man.html
-
-An experimental package to read and write files in .zip format,
-written on top of zlib by Gilles Vollant <info@winimage.com>, is
-available at http://www.winimage.com/zLibDll/unzip.html
-and also in the contrib/minizip directory of zlib.
-
-
-Notes for some targets:
-
-- To build a Windows DLL version, include in a DLL project zlib.def, zlib.rc
-  and all .c files except example.c and minigzip.c; compile with -DZLIB_DLL
-  The zlib DLL support was initially done by Alessandro Iacopetti and is
-  now maintained by Gilles Vollant <info@winimage.com>. Check the zlib DLL
-  home page at http://www.winimage.com/zLibDll
-
-  From Visual Basic, you can call the DLL functions which do not take
-  a structure as argument: compress, uncompress and all gz* functions.
-  See contrib/visual-basic.txt for more information, or get
-  http://www.tcfb.com/dowseware/cmp-z-it.zip
-
-- For 64-bit Irix, deflate.c must be compiled without any optimization.
-  With -O, one libpng test fails. The test works in 32 bit mode (with
-  the -n32 compiler flag). The compiler bug has been reported to SGI.
-
-- zlib doesn't work with gcc 2.6.3 on a DEC 3000/300LX under OSF/1 2.1   
-  it works when compiled with cc.
-
-- on Digital Unix 4.0D (formely OSF/1) on AlphaServer, the cc option -std1
-  is necessary to get gzprintf working correctly. This is done by configure.
-
-- zlib doesn't work on HP-UX 9.05 with some versions of /bin/cc. It works
-  with other compilers. Use "make test" to check your compiler.
-
-- gzdopen is not supported on RISCOS, BEOS and by some Mac compilers.
-
-- For Turbo C the small model is supported only with reduced performance to
-  avoid any far allocation; it was tested with -DMAX_WBITS=11 -DMAX_MEM_LEVEL=3
-
-- For PalmOs, see http://www.cs.uit.no/~perm/PASTA/pilot/software.html
-  Per Harald Myrvang <perm@stud.cs.uit.no>
-
-
-Acknowledgments:
-
-  The deflate format used by zlib was defined by Phil Katz. The deflate
-  and zlib specifications were written by L. Peter Deutsch. Thanks to all the
-  people who reported problems and suggested various improvements in zlib;
-  they are too numerous to cite here.
-
-Copyright notice:
-
- (C) 1995-2002 Jean-loup Gailly and Mark Adler
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-
-  Jean-loup Gailly        Mark Adler
-  jloup@gzip.org          madler@alumni.caltech.edu
-
-If you use the zlib library in a product, we would appreciate *not*
-receiving lengthy legal documents to sign. The sources are provided
-for free but without warranty of any kind.  The library has been
-entirely written by Jean-loup Gailly and Mark Adler; it does not
-include third-party code.
-
-If you redistribute modified sources, we would appreciate that you include
-in the file ChangeLog history information documenting your changes.
diff --git a/lib/zlib/adler32.c b/lib/zlib/adler32.c
deleted file mode 100644 (file)
index fae88b6..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-/* adler32.c -- compute the Adler-32 checksum of a data stream
- * Copyright (C) 1995-2002 Mark Adler
- * For conditions of distribution and use, see copyright notice in zlib.h 
- */
-
-/* @(#) $Id$ */
-
-#include "zlib.h"
-
-#define BASE 65521L /* largest prime smaller than 65536 */
-#define NMAX 5552
-/* NMAX is the largest n such that 255n(n+1)/2 + (n+1)(BASE-1) <= 2^32-1 */
-
-#define DO1(buf,i)  {s1 += buf[i]; s2 += s1;}
-#define DO2(buf,i)  DO1(buf,i); DO1(buf,i+1);
-#define DO4(buf,i)  DO2(buf,i); DO2(buf,i+2);
-#define DO8(buf,i)  DO4(buf,i); DO4(buf,i+4);
-#define DO16(buf)   DO8(buf,0); DO8(buf,8);
-
-/* ========================================================================= */
-uLong ZEXPORT adler32(adler, buf, len)
-    uLong adler;
-    const Bytef *buf;
-    uInt len;
-{
-    unsigned long s1 = adler & 0xffff;
-    unsigned long s2 = (adler >> 16) & 0xffff;
-    int k;
-
-    if (buf == Z_NULL) return 1L;
-
-    while (len > 0) {
-        k = len < NMAX ? len : NMAX;
-        len -= k;
-        while (k >= 16) {
-            DO16(buf);
-           buf += 16;
-            k -= 16;
-        }
-        if (k != 0) do {
-            s1 += *buf++;
-           s2 += s1;
-        } while (--k);
-        s1 %= BASE;
-        s2 %= BASE;
-    }
-    return (s2 << 16) | s1;
-}
diff --git a/lib/zlib/algorithm.txt b/lib/zlib/algorithm.txt
deleted file mode 100644 (file)
index cdc830b..0000000
+++ /dev/null
@@ -1,213 +0,0 @@
-1. Compression algorithm (deflate)
-
-The deflation algorithm used by gzip (also zip and zlib) is a variation of
-LZ77 (Lempel-Ziv 1977, see reference below). It finds duplicated strings in
-the input data.  The second occurrence of a string is replaced by a
-pointer to the previous string, in the form of a pair (distance,
-length).  Distances are limited to 32K bytes, and lengths are limited
-to 258 bytes. When a string does not occur anywhere in the previous
-32K bytes, it is emitted as a sequence of literal bytes.  (In this
-description, `string' must be taken as an arbitrary sequence of bytes,
-and is not restricted to printable characters.)
-
-Literals or match lengths are compressed with one Huffman tree, and
-match distances are compressed with another tree. The trees are stored
-in a compact form at the start of each block. The blocks can have any
-size (except that the compressed data for one block must fit in
-available memory). A block is terminated when deflate() determines that
-it would be useful to start another block with fresh trees. (This is
-somewhat similar to the behavior of LZW-based _compress_.)
-
-Duplicated strings are found using a hash table. All input strings of
-length 3 are inserted in the hash table. A hash index is computed for
-the next 3 bytes. If the hash chain for this index is not empty, all
-strings in the chain are compared with the current input string, and
-the longest match is selected.
-
-The hash chains are searched starting with the most recent strings, to
-favor small distances and thus take advantage of the Huffman encoding.
-The hash chains are singly linked. There are no deletions from the
-hash chains, the algorithm simply discards matches that are too old.
-
-To avoid a worst-case situation, very long hash chains are arbitrarily
-truncated at a certain length, determined by a runtime option (level
-parameter of deflateInit). So deflate() does not always find the longest
-possible match but generally finds a match which is long enough.
-
-deflate() also defers the selection of matches with a lazy evaluation
-mechanism. After a match of length N has been found, deflate() searches for
-a longer match at the next input byte. If a longer match is found, the
-previous match is truncated to a length of one (thus producing a single
-literal byte) and the process of lazy evaluation begins again. Otherwise,
-the original match is kept, and the next match search is attempted only N
-steps later.
-
-The lazy match evaluation is also subject to a runtime parameter. If
-the current match is long enough, deflate() reduces the search for a longer
-match, thus speeding up the whole process. If compression ratio is more
-important than speed, deflate() attempts a complete second search even if
-the first match is already long enough.
-
-The lazy match evaluation is not performed for the fastest compression
-modes (level parameter 1 to 3). For these fast modes, new strings
-are inserted in the hash table only when no match was found, or
-when the match is not too long. This degrades the compression ratio
-but saves time since there are both fewer insertions and fewer searches.
-
-
-2. Decompression algorithm (inflate)
-
-2.1 Introduction
-
-The real question is, given a Huffman tree, how to decode fast.  The most
-important realization is that shorter codes are much more common than
-longer codes, so pay attention to decoding the short codes fast, and let
-the long codes take longer to decode.
-
-inflate() sets up a first level table that covers some number of bits of
-input less than the length of longest code.  It gets that many bits from the
-stream, and looks it up in the table.  The table will tell if the next
-code is that many bits or less and how many, and if it is, it will tell
-the value, else it will point to the next level table for which inflate()
-grabs more bits and tries to decode a longer code.
-
-How many bits to make the first lookup is a tradeoff between the time it
-takes to decode and the time it takes to build the table.  If building the
-table took no time (and if you had infinite memory), then there would only
-be a first level table to cover all the way to the longest code.  However,
-building the table ends up taking a lot longer for more bits since short
-codes are replicated many times in such a table.  What inflate() does is
-simply to make the number of bits in the first table a variable, and set it
-for the maximum speed.
-
-inflate() sends new trees relatively often, so it is possibly set for a
-smaller first level table than an application that has only one tree for
-all the data.  For inflate, which has 286 possible codes for the
-literal/length tree, the size of the first table is nine bits.  Also the
-distance trees have 30 possible values, and the size of the first table is
-six bits.  Note that for each of those cases, the table ended up one bit
-longer than the ``average'' code length, i.e. the code length of an
-approximately flat code which would be a little more than eight bits for
-286 symbols and a little less than five bits for 30 symbols.  It would be
-interesting to see if optimizing the first level table for other
-applications gave values within a bit or two of the flat code size.
-
-
-2.2 More details on the inflate table lookup
-
-Ok, you want to know what this cleverly obfuscated inflate tree actually  
-looks like.  You are correct that it's not a Huffman tree.  It is simply a  
-lookup table for the first, let's say, nine bits of a Huffman symbol.  The  
-symbol could be as short as one bit or as long as 15 bits.  If a particular  
-symbol is shorter than nine bits, then that symbol's translation is duplicated
-in all those entries that start with that symbol's bits.  For example, if the  
-symbol is four bits, then it's duplicated 32 times in a nine-bit table.  If a  
-symbol is nine bits long, it appears in the table once.
-
-If the symbol is longer than nine bits, then that entry in the table points  
-to another similar table for the remaining bits.  Again, there are duplicated  
-entries as needed.  The idea is that most of the time the symbol will be short
-and there will only be one table look up.  (That's whole idea behind data  
-compression in the first place.)  For the less frequent long symbols, there  
-will be two lookups.  If you had a compression method with really long  
-symbols, you could have as many levels of lookups as is efficient.  For  
-inflate, two is enough.
-
-So a table entry either points to another table (in which case nine bits in  
-the above example are gobbled), or it contains the translation for the symbol  
-and the number of bits to gobble.  Then you start again with the next  
-ungobbled bit.
-
-You may wonder: why not just have one lookup table for how ever many bits the  
-longest symbol is?  The reason is that if you do that, you end up spending  
-more time filling in duplicate symbol entries than you do actually decoding.   
-At least for deflate's output that generates new trees every several 10's of  
-kbytes.  You can imagine that filling in a 2^15 entry table for a 15-bit code  
-would take too long if you're only decoding several thousand symbols.  At the  
-other extreme, you could make a new table for every bit in the code.  In fact,
-that's essentially a Huffman tree.  But then you spend two much time  
-traversing the tree while decoding, even for short symbols.
-
-So the number of bits for the first lookup table is a trade of the time to  
-fill out the table vs. the time spent looking at the second level and above of
-the table.
-
-Here is an example, scaled down:
-
-The code being decoded, with 10 symbols, from 1 to 6 bits long:
-
-A: 0
-B: 10
-C: 1100
-D: 11010
-E: 11011
-F: 11100
-G: 11101
-H: 11110
-I: 111110
-J: 111111
-
-Let's make the first table three bits long (eight entries):
-
-000: A,1
-001: A,1
-010: A,1
-011: A,1
-100: B,2
-101: B,2
-110: -> table X (gobble 3 bits)
-111: -> table Y (gobble 3 bits)
-
-Each entry is what the bits decode to and how many bits that is, i.e. how  
-many bits to gobble.  Or the entry points to another table, with the number of
-bits to gobble implicit in the size of the table.
-
-Table X is two bits long since the longest code starting with 110 is five bits
-long:
-
-00: C,1
-01: C,1
-10: D,2
-11: E,2
-
-Table Y is three bits long since the longest code starting with 111 is six  
-bits long:
-
-000: F,2
-001: F,2
-010: G,2
-011: G,2
-100: H,2
-101: H,2
-110: I,3
-111: J,3
-
-So what we have here are three tables with a total of 20 entries that had to  
-be constructed.  That's compared to 64 entries for a single table.  Or  
-compared to 16 entries for a Huffman tree (six two entry tables and one four  
-entry table).  Assuming that the code ideally represents the probability of  
-the symbols, it takes on the average 1.25 lookups per symbol.  That's compared
-to one lookup for the single table, or 1.66 lookups per symbol for the  
-Huffman tree.
-
-There, I think that gives you a picture of what's going on.  For inflate, the  
-meaning of a particular symbol is often more than just a letter.  It can be a  
-byte (a "literal"), or it can be either a length or a distance which  
-indicates a base value and a number of bits to fetch after the code that is  
-added to the base value.  Or it might be the special end-of-block code.  The  
-data structures created in inftrees.c try to encode all that information  
-compactly in the tables.
-
-
-Jean-loup Gailly        Mark Adler
-jloup@gzip.org          madler@alumni.caltech.edu
-
-
-References:
-
-[LZ77] Ziv J., Lempel A., ``A Universal Algorithm for Sequential Data
-Compression,'' IEEE Transactions on Information Theory, Vol. 23, No. 3,
-pp. 337-343.
-
-``DEFLATE Compressed Data Format Specification'' available in
-ftp://ds.internic.net/rfc/rfc1951.txt
diff --git a/lib/zlib/amiga/Makefile.pup b/lib/zlib/amiga/Makefile.pup
deleted file mode 100644 (file)
index 6cfad1d..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
-# Amiga powerUP (TM) Makefile
-# makefile for libpng and SAS C V6.58/7.00 PPC compiler
-# Copyright (C) 1998 by Andreas R. Kleinert
-
-CC       = scppc
-CFLAGS   = NOSTKCHK NOSINT OPTIMIZE OPTGO OPTPEEP OPTINLOCAL OPTINL \
-           OPTLOOP OPTRDEP=8 OPTDEP=8 OPTCOMP=8
-LIBNAME  = libzip.a
-AR       = ppc-amigaos-ar
-AR_FLAGS = cr
-RANLIB   = ppc-amigaos-ranlib
-LDFLAGS  = -r -o
-LDLIBS   = LIB:scppc.a
-LN       = ppc-amigaos-ld
-RM       = delete quiet
-
-OBJS = adler32.o compress.o crc32.o gzio.o uncompr.o deflate.o trees.o \
-       zutil.o inflate.o infblock.o inftrees.o infcodes.o infutil.o inffast.o
-
-TEST_OBJS = example.o minigzip.o
-
-all: example minigzip
-
-test: all
-        example
-        echo hello world | minigzip | minigzip -d
-
-$(LIBNAME): $(OBJS)
-            $(AR) $(AR_FLAGS) $@ $(OBJS)
-            $(RANLIB) $@
-
-example: example.o $(LIBNAME)
-        $(LN) $(LDFLAGS) example LIB:c_ppc.o example.o $(LIBNAME) $(LDLIBS) LIB:end.o
-
-minigzip: minigzip.o $(LIBNAME)
-        $(LN) $(LDFLAGS) minigzip LIB:c_ppc.o minigzip.o $(LIBNAME) $(LDLIBS) LIB:end.o
-
-clean:
-        $(RM) *.o example minigzip $(LIBNAME) foo.gz
-
-zip:
-        zip -ul9 zlib README ChangeLog Makefile Make????.??? Makefile.?? \
-          descrip.mms *.[ch]
-
-tgz:
-        cd ..; tar cfz zlib/zlib.tgz zlib/README zlib/ChangeLog zlib/Makefile \
-          zlib/Make????.??? zlib/Makefile.?? zlib/descrip.mms zlib/*.[ch]
-
-# DO NOT DELETE THIS LINE -- make depend depends on it.
-
-adler32.o: zutil.h zlib.h zconf.h
-compress.o: zlib.h zconf.h
-crc32.o: zutil.h zlib.h zconf.h
-deflate.o: deflate.h zutil.h zlib.h zconf.h
-example.o: zlib.h zconf.h
-gzio.o: zutil.h zlib.h zconf.h
-infblock.o: zutil.h zlib.h zconf.h infblock.h inftrees.h infcodes.h infutil.h
-infcodes.o: zutil.h zlib.h zconf.h inftrees.h infutil.h infcodes.h inffast.h
-inffast.o: zutil.h zlib.h zconf.h inftrees.h infutil.h inffast.h
-inflate.o: zutil.h zlib.h zconf.h infblock.h
-inftrees.o: zutil.h zlib.h zconf.h inftrees.h
-infutil.o: zutil.h zlib.h zconf.h inftrees.h infutil.h
-minigzip.o: zlib.h zconf.h
-trees.o: deflate.h zutil.h zlib.h zconf.h
-uncompr.o: zlib.h zconf.h
-zutil.o: zutil.h zlib.h zconf.h
diff --git a/lib/zlib/amiga/Makefile.sas b/lib/zlib/amiga/Makefile.sas
deleted file mode 100644 (file)
index 5323e82..0000000
+++ /dev/null
@@ -1,64 +0,0 @@
-# SMakefile for zlib
-# Modified from the standard UNIX Makefile Copyright Jean-loup Gailly
-# Osma Ahvenlampi <Osma.Ahvenlampi@hut.fi>
-# Amiga, SAS/C 6.56 & Smake
-
-CC=sc
-CFLAGS=OPT
-#CFLAGS=OPT CPU=68030
-#CFLAGS=DEBUG=LINE
-LDFLAGS=LIB z.lib
-
-SCOPTIONS=OPTSCHED OPTINLINE OPTALIAS OPTTIME OPTINLOCAL STRMERGE \
-       NOICONS PARMS=BOTH NOSTACKCHECK UTILLIB NOVERSION ERRORREXX 
-
-OBJS = adler32.o compress.o crc32.o gzio.o uncompr.o deflate.o trees.o \
-       zutil.o inflate.o infblock.o inftrees.o infcodes.o infutil.o inffast.o
-
-TEST_OBJS = example.o minigzip.o
-
-all: SCOPTIONS example minigzip
-
-test: all
-       `cd`/example
-       echo hello world | minigzip | minigzip -d 
-
-install: z.lib
-       copy zlib.h zconf.h INCLUDE: clone
-       copy z.lib LIB: clone
-
-z.lib: $(OBJS)
-       oml z.lib r $(OBJS)
-
-example: example.o z.lib
-       $(CC) $(CFLAGS) LINK TO $@ example.o $(LDFLAGS)
-
-minigzip: minigzip.o z.lib
-       $(CC) $(CFLAGS) LINK TO $@ minigzip.o $(LDFLAGS)
-
-clean:
-       -delete force quiet *.o example minigzip z.lib foo.gz *.lnk SCOPTIONS
-
-SCOPTIONS: Smakefile
-        copy to $@ <from <
-$(SCOPTIONS)
-<
-
-# DO NOT DELETE THIS LINE -- make depend depends on it.
-
-adler32.o: zutil.h zlib.h zconf.h
-compress.o: zlib.h zconf.h
-crc32.o: zutil.h zlib.h zconf.h
-deflate.o: deflate.h zutil.h zlib.h zconf.h
-example.o: zlib.h zconf.h
-gzio.o: zutil.h zlib.h zconf.h
-infblock.o: zutil.h zlib.h zconf.h infblock.h inftrees.h infcodes.h infutil.h
-infcodes.o: zutil.h zlib.h zconf.h inftrees.h infutil.h infcodes.h inffast.h
-inffast.o: zutil.h zlib.h zconf.h inftrees.h infutil.h inffast.h
-inflate.o: zutil.h zlib.h zconf.h infblock.h
-inftrees.o: zutil.h zlib.h zconf.h inftrees.h
-infutil.o: zutil.h zlib.h zconf.h inftrees.h infutil.h
-minigzip.o: zlib.h zconf.h
-trees.o: deflate.h zutil.h zlib.h zconf.h
-uncompr.o: zlib.h zconf.h
-zutil.o: zutil.h zlib.h zconf.h
diff --git a/lib/zlib/compress.c b/lib/zlib/compress.c
deleted file mode 100644 (file)
index 814bd9d..0000000
+++ /dev/null
@@ -1,68 +0,0 @@
-/* compress.c -- compress a memory buffer
- * Copyright (C) 1995-2002 Jean-loup Gailly.
- * For conditions of distribution and use, see copyright notice in zlib.h 
- */
-
-/* @(#) $Id$ */
-
-#include "zlib.h"
-
-/* ===========================================================================
-     Compresses the source buffer into the destination buffer. The level
-   parameter has the same meaning as in deflateInit.  sourceLen is the byte
-   length of the source buffer. Upon entry, destLen is the total size of the
-   destination buffer, which must be at least 0.1% larger than sourceLen plus
-   12 bytes. Upon exit, destLen is the actual size of the compressed buffer.
-
-     compress2 returns Z_OK if success, Z_MEM_ERROR if there was not enough
-   memory, Z_BUF_ERROR if there was not enough room in the output buffer,
-   Z_STREAM_ERROR if the level parameter is invalid.
-*/
-int ZEXPORT compress2 (dest, destLen, source, sourceLen, level)
-    Bytef *dest;
-    uLongf *destLen;
-    const Bytef *source;
-    uLong sourceLen;
-    int level;
-{
-    z_stream stream;
-    int err;
-
-    stream.next_in = (Bytef*)source;
-    stream.avail_in = (uInt)sourceLen;
-#ifdef MAXSEG_64K
-    /* Check for source > 64K on 16-bit machine: */
-    if ((uLong)stream.avail_in != sourceLen) return Z_BUF_ERROR;
-#endif
-    stream.next_out = dest;
-    stream.avail_out = (uInt)*destLen;
-    if ((uLong)stream.avail_out != *destLen) return Z_BUF_ERROR;
-
-    stream.zalloc = (alloc_func)0;
-    stream.zfree = (free_func)0;
-    stream.opaque = (voidpf)0;
-
-    err = deflateInit(&stream, level);
-    if (err != Z_OK) return err;
-
-    err = deflate(&stream, Z_FINISH);
-    if (err != Z_STREAM_END) {
-        deflateEnd(&stream);
-        return err == Z_OK ? Z_BUF_ERROR : err;
-    }
-    *destLen = stream.total_out;
-
-    err = deflateEnd(&stream);
-    return err;
-}
-
-/* ===========================================================================
- */
-int ZEXPORT compress (dest, destLen, source, sourceLen)
-    Bytef *dest;
-    uLongf *destLen;
-    const Bytef *source;
-    uLong sourceLen;
-{
-    return compress2(dest, destLen, source, sourceLen, Z_DEFAULT_COMPRESSION);
-}
diff --git a/lib/zlib/configure b/lib/zlib/configure
deleted file mode 100755 (executable)
index e894235..0000000
+++ /dev/null
@@ -1,212 +0,0 @@
-#!/bin/sh
-# configure script for zlib. This script is needed only if
-# you wish to build a shared library and your system supports them,
-# of if you need special compiler, flags or install directory.
-# Otherwise, you can just use directly "make test; make install"
-#
-# To create a shared library, use "configure --shared"; by default a static
-# library is created. If the primitive shared library support provided here
-# does not work, use ftp://prep.ai.mit.edu/pub/gnu/libtool-*.tar.gz
-#
-# To impose specific compiler or flags or install directory, use for example:
-#    prefix=$HOME CC=cc CFLAGS="-O4" ./configure
-# or for csh/tcsh users:
-#    (setenv prefix $HOME; setenv CC cc; setenv CFLAGS "-O4"; ./configure)
-# LDSHARED is the command to be used to create a shared library
-
-# Incorrect settings of CC or CFLAGS may prevent creating a shared library.
-# If you have problems, try without defining CC and CFLAGS before reporting
-# an error.
-
-LIBS=libz.a
-SHAREDLIB=libz.so
-VER=`sed -n -e '/VERSION "/s/.*"\(.*\)".*/\1/p' < zlib.h`
-AR=${AR-"ar rc"}
-RANLIB=${RANLIB-"ranlib"}
-prefix=${prefix-/usr/local}
-exec_prefix=${exec_prefix-'${prefix}'}
-libdir=${libdir-'${exec_prefix}/lib'}
-includedir=${includedir-'${prefix}/include'}
-shared_ext='.so'
-shared=0
-gcc=0
-old_cc="$CC"
-old_cflags="$CFLAGS"
-
-while test $# -ge 1
-do
-case "$1" in
-    -h* | --h*)
-      echo 'usage:'
-      echo '  configure [--shared] [--prefix=PREFIX]  [--exec_prefix=EXPREFIX]'
-      echo '     [--libdir=LIBDIR] [--includedir=INCLUDEDIR]'
-        exit 0;;
-    -p*=* | --p*=*) prefix=`echo $1 | sed 's/[-a-z_]*=//'`; shift;;
-    -e*=* | --e*=*) exec_prefix=`echo $1 | sed 's/[-a-z_]*=//'`; shift;;
-    -l*=* | --libdir=*) libdir=`echo $1 | sed 's/[-a-z_]*=//'`; shift;;
-    -i*=* | --includedir=*) includedir=`echo $1 | sed 's/[-a-z_]*=//'`;shift;;
-    -p* | --p*) prefix="$2"; shift; shift;;
-    -e* | --e*) exec_prefix="$2"; shift; shift;;
-    -l* | --l*) libdir="$2"; shift; shift;;
-    -i* | --i*) includedir="$2"; shift; shift;;
-    -s* | --s*) shared=1; shift;;
-    esac
-done
-
-test=ztest$$
-cat > $test.c <<EOF
-extern int getchar();
-int hello() {return getchar();}
-EOF
-
-test -z "$CC" && echo Checking for gcc...
-cc=${CC-gcc}
-cflags=${CFLAGS-"-O3"}
-# to force the asm version use: CFLAGS="-O3 -DASMV" ./configure
-case "$cc" in
-  *gcc*) gcc=1;;
-esac
-
-if test "$gcc" -eq 1 && ($cc -c $cflags $test.c) 2>/dev/null; then
-  CC="$cc"
-  SFLAGS=${CFLAGS-"-fPIC -O3"}
-  CFLAGS="$cflags"
-  case `(uname -s || echo unknown) 2>/dev/null` in
-  Linux | linux) LDSHARED=${LDSHARED-"gcc -shared -Wl,-soname,libz.so.1"};;
-  *)             LDSHARED=${LDSHARED-"gcc -shared"};;
-  esac
-else
-  # find system name and corresponding cc options
-  CC=${CC-cc}
-  case `(uname -sr || echo unknown) 2>/dev/null` in
-  HP-UX*)    SFLAGS=${CFLAGS-"-O +z"}
-            CFLAGS=${CFLAGS-"-O"}
-#           LDSHARED=${LDSHARED-"ld -b +vnocompatwarnings"}
-            LDSHARED=${LDSHARED-"ld -b"}
-            shared_ext='.sl'
-            SHAREDLIB='libz.sl';;
-  IRIX*)     SFLAGS=${CFLAGS-"-ansi -O2 -rpath ."}
-            CFLAGS=${CFLAGS-"-ansi -O2"}
-            LDSHARED=${LDSHARED-"cc -shared"};;
-  OSF1\ V4*) SFLAGS=${CFLAGS-"-O -std1"}
-            CFLAGS=${CFLAGS-"-O -std1"}
-            LDSHARED=${LDSHARED-"cc -shared  -Wl,-soname,$SHAREDLIB -Wl,-msym -Wl,-rpath,$(libdir) -Wl,-set_version,${VER}:1.0"};;
-  OSF1*)     SFLAGS=${CFLAGS-"-O -std1"}
-            CFLAGS=${CFLAGS-"-O -std1"}
-            LDSHARED=${LDSHARED-"cc -shared"};;
-  QNX*)      SFLAGS=${CFLAGS-"-4 -O"}
-             CFLAGS=${CFLAGS-"-4 -O"}
-            LDSHARED=${LDSHARED-"cc"}
-             RANLIB=${RANLIB-"true"}
-             AR="cc -A";;
-  SCO_SV\ 3.2*) SFLAGS=${CFLAGS-"-O3 -dy -KPIC "}
-            CFLAGS=${CFLAGS-"-O3"}
-            LDSHARED=${LDSHARED-"cc -dy -KPIC -G"};;
-  SunOS\ 5*) SFLAGS=${CFLAGS-"-fast -xcg89 -KPIC -R."}
-             CFLAGS=${CFLAGS-"-fast -xcg89"}
-            LDSHARED=${LDSHARED-"cc -G"};;
-  SunOS\ 4*) SFLAGS=${CFLAGS-"-O2 -PIC"}
-            CFLAGS=${CFLAGS-"-O2"}
-            LDSHARED=${LDSHARED-"ld"};;
-  UNIX_System_V\ 4.2.0) 
-            SFLAGS=${CFLAGS-"-KPIC -O"}
-            CFLAGS=${CFLAGS-"-O"}
-            LDSHARED=${LDSHARED-"cc -G"};;
-  UNIX_SV\ 4.2MP)
-            SFLAGS=${CFLAGS-"-Kconform_pic -O"}
-            CFLAGS=${CFLAGS-"-O"}
-            LDSHARED=${LDSHARED-"cc -G"};;
-  # send working options for other systems to support@gzip.org
-  *)         SFLAGS=${CFLAGS-"-O"}
-            CFLAGS=${CFLAGS-"-O"}
-            LDSHARED=${LDSHARED-"cc -shared"};;
-  esac
-fi
-
-if test $shared -eq 1; then
-  echo Checking for shared library support...
-  # we must test in two steps (cc then ld), required at least on SunOS 4.x
-  if test "`($CC -c $SFLAGS $test.c) 2>&1`" = "" &&
-     test "`($LDSHARED -o $test$shared_ext $test.o) 2>&1`" = ""; then
-    CFLAGS="$SFLAGS"
-    LIBS="$SHAREDLIB.$VER"
-    echo Building shared library $SHAREDLIB.$VER with $CC.
-  elif test -z "$old_cc" -a -z "$old_cflags"; then
-    echo No shared library suppport.
-    shared=0;
-  else
-    echo 'No shared library suppport; try without defining CC and CFLAGS'
-    shared=0;
-  fi
-fi
-if test $shared -eq 0; then
-  LDSHARED="$CC"
-  echo Building static library $LIBS version $VER with $CC.
-fi
-
-cat > $test.c <<EOF
-#include <unistd.h>
-int main() { return 0; }
-EOF
-if test "`($CC -c $CFLAGS $test.c) 2>&1`" = ""; then
-  CFLAGS="$CFLAGS -DHAVE_UNISTD_H"
-  echo "Checking for unistd.h... Yes."
-else
-  echo "Checking for unistd.h... No."
-fi
-
-cat > $test.c <<EOF
-#include <errno.h>
-int main() { return 0; }
-EOF
-if test "`($CC -c $CFLAGS $test.c) 2>&1`" = ""; then
-  echo "Checking for errno.h...         Yes."
-else
-  echo "Checking for errno.h...         No."
-  CFLAGS="$CFLAGS -DNO_ERRNO_H"
-fi
-
-cat > $test.c <<EOF
-#include <sys/types.h>
-#include <sys/mman.h>
-#include <sys/stat.h>
-caddr_t hello() {
-  return mmap((caddr_t)0, (off_t)0, PROT_READ, MAP_SHARED, 0, (off_t)0); 
-}
-EOF
-if test "`($CC -c $CFLAGS $test.c) 2>&1`" = ""; then
-  CFLAGS="$CFLAGS -DUSE_MMAP"
-  echo Checking for mmap support... Yes.
-else
-  echo Checking for mmap support... No.
-fi
-
-CPP=${CPP-"$CC -E"}
-case $CFLAGS in
-  *ASMV*)
-    if test "`nm $test.o | grep _hello`" = ""; then
-      CPP="$CPP -DNO_UNDERLINE"
-      echo Checking for underline in external names... No.
-    else
-      echo Checking for underline in external names... Yes.
-    fi;;
-esac
-
-rm -f $test.[co] $test$shared_ext
-
-# udpate Makefile
-sed < Makefile.in "
-/^CC *=/s%=.*%=$CC%
-/^CFLAGS *=/s%=.*%=$CFLAGS%
-/^CPP *=/s%=.*%=$CPP%
-/^LDSHARED *=/s%=.*%=$LDSHARED%
-/^LIBS *=/s%=.*%=$LIBS%
-/^SHAREDLIB *=/s%=.*%=$SHAREDLIB%
-/^AR *=/s%=.*%=$AR%
-/^RANLIB *=/s%=.*%=$RANLIB%
-/^VER *=/s%=.*%=$VER%
-/^prefix *=/s%=.*%=$prefix%
-/^exec_prefix *=/s%=.*%=$exec_prefix%
-/^libdir *=/s%=.*%=$libdir%
-/^includedir *=/s%=.*%=$includedir%
-" > Makefile
diff --git a/lib/zlib/contrib/README.contrib b/lib/zlib/contrib/README.contrib
deleted file mode 100644 (file)
index 7ad191c..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-All files under this contrib directory are UNSUPPORTED. There were
-provided by users of zlib and were not tested by the authors of zlib.
-Use at your own risk. Please contact the authors of the contributions
-for help about these, not the zlib authors. Thanks.
-
-
-asm386/     by Gilles Vollant <info@winimage.com>
-       386 asm code replacing longest_match(), for Visual C++ 4.2 and ML 6.11c
-
-asm586/ and asm686/    by Brian Raiter <breadbox@muppetlabs.com> 
-        asm code for Pentium and Pentium Pro
-        See http://www.muppetlabs.com/~breadbox/software/assembly.html
-
-delphi/      by Bob Dellaca <bobdl@xtra.co.nz>
-       Support for Delphi
-
-delphi2/     by Davide Moretti <dave@rimini.com>
-        Another support for C++Builder and Delphi
-
-minizip/    by Gilles Vollant <info@winimage.com>
-       Mini zip and unzip based on zlib
-        See http://www.winimage.com/zLibDll/unzip.html
-
-iostream/   by Kevin Ruland <kevin@rodin.wustl.edu>
-        A C++ I/O streams interface to the zlib gz* functions
-
-iostream2/  by Tyge Løvset <Tyge.Lovset@cmr.no>
-       Another C++ I/O streams interface
-
-untgz/      by "Pedro A. Aranda Guti\irrez" <paag@tid.es>
-       A very simple tar.gz file extractor using zlib
-
-visual-basic.txt by Carlos Rios <c_rios@sonda.cl>
-        How to use compress(), uncompress() and the gz* functions from VB.
diff --git a/lib/zlib/contrib/asm386/gvmat32.asm b/lib/zlib/contrib/asm386/gvmat32.asm
deleted file mode 100644 (file)
index 28d527f..0000000
+++ /dev/null
@@ -1,559 +0,0 @@
-;
-; gvmat32.asm -- Asm portion of the optimized longest_match for 32 bits x86
-; Copyright (C) 1995-1996 Jean-loup Gailly and Gilles Vollant.
-; File written by Gilles Vollant, by modifiying the longest_match
-;  from Jean-loup Gailly in deflate.c
-; It need wmask == 0x7fff
-;     (assembly code is faster with a fixed wmask)
-;
-; For Visual C++ 4.2 and ML 6.11c (version in directory \MASM611C of Win95 DDK)
-;   I compile with : "ml /coff /Zi /c gvmat32.asm"
-;
-
-;uInt longest_match_7fff(s, cur_match)
-;    deflate_state *s;
-;    IPos cur_match;                             /* current match */
-
-        NbStack         equ     76
-        cur_match       equ     dword ptr[esp+NbStack-0]
-        str_s           equ     dword ptr[esp+NbStack-4]
-; 5 dword on top (ret,ebp,esi,edi,ebx)
-        adrret          equ     dword ptr[esp+NbStack-8]
-        pushebp         equ     dword ptr[esp+NbStack-12]
-        pushedi         equ     dword ptr[esp+NbStack-16]
-        pushesi         equ     dword ptr[esp+NbStack-20]
-        pushebx         equ     dword ptr[esp+NbStack-24]
-
-        chain_length    equ     dword ptr [esp+NbStack-28]
-        limit           equ     dword ptr [esp+NbStack-32]
-        best_len        equ     dword ptr [esp+NbStack-36]
-        window          equ     dword ptr [esp+NbStack-40]
-        prev            equ     dword ptr [esp+NbStack-44]
-        scan_start      equ      word ptr [esp+NbStack-48]
-        wmask           equ     dword ptr [esp+NbStack-52]
-        match_start_ptr equ     dword ptr [esp+NbStack-56]
-        nice_match      equ     dword ptr [esp+NbStack-60]
-        scan            equ     dword ptr [esp+NbStack-64]
-
-        windowlen       equ     dword ptr [esp+NbStack-68]
-        match_start     equ     dword ptr [esp+NbStack-72]
-        strend          equ     dword ptr [esp+NbStack-76]
-        NbStackAdd      equ     (NbStack-24)
-
-    .386p
-
-    name    gvmatch
-    .MODEL  FLAT
-
-
-
-;  all the +4 offsets are due to the addition of pending_buf_size (in zlib
-;  in the deflate_state structure since the asm code was first written
-;  (if you compile with zlib 1.0.4 or older, remove the +4).
-;  Note : these value are good with a 8 bytes boundary pack structure
-    dep_chain_length    equ     70h+4
-    dep_window          equ     2ch+4
-    dep_strstart        equ     60h+4
-    dep_prev_length     equ     6ch+4
-    dep_nice_match      equ     84h+4
-    dep_w_size          equ     20h+4
-    dep_prev            equ     34h+4
-    dep_w_mask          equ     28h+4
-    dep_good_match      equ     80h+4
-    dep_match_start     equ     64h+4
-    dep_lookahead       equ     68h+4
-
-
-_TEXT                   segment
-
-IFDEF NOUNDERLINE
-                        public  longest_match_7fff
-;                        public  match_init
-ELSE
-                        public  _longest_match_7fff
-;                        public  _match_init
-ENDIF
-
-    MAX_MATCH           equ     258
-    MIN_MATCH           equ     3
-    MIN_LOOKAHEAD       equ     (MAX_MATCH+MIN_MATCH+1)
-
-
-
-IFDEF NOUNDERLINE
-;match_init      proc near
-;                ret
-;match_init      endp
-ELSE
-;_match_init     proc near
-;                ret
-;_match_init     endp
-ENDIF
-
-
-IFDEF NOUNDERLINE
-longest_match_7fff   proc near
-ELSE
-_longest_match_7fff  proc near
-ENDIF
-
-        mov     edx,[esp+4]
-
-
-
-        push    ebp
-        push    edi
-        push    esi
-        push    ebx
-
-        sub     esp,NbStackAdd
-
-; initialize or check the variables used in match.asm.
-        mov     ebp,edx
-
-; chain_length = s->max_chain_length
-; if (prev_length>=good_match) chain_length >>= 2
-        mov     edx,[ebp+dep_chain_length]
-        mov     ebx,[ebp+dep_prev_length]
-        cmp     [ebp+dep_good_match],ebx
-        ja      noshr
-        shr     edx,2
-noshr:
-; we increment chain_length because in the asm, the --chain_lenght is in the beginning of the loop
-        inc     edx
-        mov     edi,[ebp+dep_nice_match]
-        mov     chain_length,edx
-        mov     eax,[ebp+dep_lookahead]
-        cmp     eax,edi
-; if ((uInt)nice_match > s->lookahead) nice_match = s->lookahead;
-        jae     nolookaheadnicematch
-        mov     edi,eax
-nolookaheadnicematch:
-; best_len = s->prev_length
-        mov     best_len,ebx
-
-; window = s->window
-        mov     esi,[ebp+dep_window]
-        mov     ecx,[ebp+dep_strstart]
-        mov     window,esi
-
-        mov     nice_match,edi
-; scan = window + strstart
-        add     esi,ecx
-        mov     scan,esi
-; dx = *window
-        mov     dx,word ptr [esi]
-; bx = *(window+best_len-1)
-        mov     bx,word ptr [esi+ebx-1]
-        add     esi,MAX_MATCH-1
-; scan_start = *scan
-        mov     scan_start,dx
-; strend = scan + MAX_MATCH-1
-        mov     strend,esi
-; bx = scan_end = *(window+best_len-1)
-
-;    IPos limit = s->strstart > (IPos)MAX_DIST(s) ?
-;        s->strstart - (IPos)MAX_DIST(s) : NIL;
-
-        mov     esi,[ebp+dep_w_size]
-        sub     esi,MIN_LOOKAHEAD
-; here esi = MAX_DIST(s)
-        sub     ecx,esi
-        ja      nodist
-        xor     ecx,ecx
-nodist:
-        mov     limit,ecx
-
-; prev = s->prev
-        mov     edx,[ebp+dep_prev]
-        mov     prev,edx
-
-;
-        mov     edx,dword ptr [ebp+dep_match_start]
-        mov     bp,scan_start
-        mov     eax,cur_match
-        mov     match_start,edx
-
-        mov     edx,window
-        mov     edi,edx
-        add     edi,best_len
-        mov     esi,prev
-        dec     edi
-; windowlen = window + best_len -1
-        mov     windowlen,edi
-
-        jmp     beginloop2
-        align   4
-
-; here, in the loop
-;       eax = ax = cur_match
-;       ecx = limit
-;        bx = scan_end
-;        bp = scan_start
-;       edi = windowlen (window + best_len -1)
-;       esi = prev
-
-
-;// here; chain_length <=16
-normalbeg0add16:
-        add     chain_length,16
-        jz      exitloop
-normalbeg0:
-        cmp     word ptr[edi+eax],bx
-        je      normalbeg2noroll
-rcontlabnoroll:
-; cur_match = prev[cur_match & wmask]
-        and     eax,7fffh
-        mov     ax,word ptr[esi+eax*2]
-; if cur_match > limit, go to exitloop
-        cmp     ecx,eax
-        jnb     exitloop
-; if --chain_length != 0, go to exitloop
-        dec     chain_length
-        jnz     normalbeg0
-        jmp     exitloop
-
-normalbeg2noroll:
-; if (scan_start==*(cur_match+window)) goto normalbeg2
-        cmp     bp,word ptr[edx+eax]
-        jne     rcontlabnoroll
-        jmp     normalbeg2
-
-contloop3:
-        mov     edi,windowlen
-
-; cur_match = prev[cur_match & wmask]
-        and     eax,7fffh
-        mov     ax,word ptr[esi+eax*2]
-; if cur_match > limit, go to exitloop
-        cmp     ecx,eax
-jnbexitloopshort1:
-        jnb     exitloop
-; if --chain_length != 0, go to exitloop
-
-
-; begin the main loop
-beginloop2:
-        sub     chain_length,16+1
-; if chain_length <=16, don't use the unrolled loop
-        jna     normalbeg0add16
-
-do16:
-        cmp     word ptr[edi+eax],bx
-        je      normalbeg2dc0
-
-maccn   MACRO   lab
-        and     eax,7fffh
-        mov     ax,word ptr[esi+eax*2]
-        cmp     ecx,eax
-        jnb     exitloop
-        cmp     word ptr[edi+eax],bx
-        je      lab
-        ENDM
-
-rcontloop0:
-        maccn   normalbeg2dc1
-
-rcontloop1:
-        maccn   normalbeg2dc2
-
-rcontloop2:
-        maccn   normalbeg2dc3
-
-rcontloop3:
-        maccn   normalbeg2dc4
-
-rcontloop4:
-        maccn   normalbeg2dc5
-
-rcontloop5:
-        maccn   normalbeg2dc6
-
-rcontloop6:
-        maccn   normalbeg2dc7
-
-rcontloop7:
-        maccn   normalbeg2dc8
-
-rcontloop8:
-        maccn   normalbeg2dc9
-
-rcontloop9:
-        maccn   normalbeg2dc10
-
-rcontloop10:
-        maccn   short normalbeg2dc11
-
-rcontloop11:
-        maccn   short normalbeg2dc12
-
-rcontloop12:
-        maccn   short normalbeg2dc13
-
-rcontloop13:
-        maccn   short normalbeg2dc14
-
-rcontloop14:
-        maccn   short normalbeg2dc15
-
-rcontloop15:
-        and     eax,7fffh
-        mov     ax,word ptr[esi+eax*2]
-        cmp     ecx,eax
-        jnb     exitloop
-
-        sub     chain_length,16
-        ja      do16
-        jmp     normalbeg0add16
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-
-normbeg MACRO   rcontlab,valsub
-; if we are here, we know that *(match+best_len-1) == scan_end
-        cmp     bp,word ptr[edx+eax]
-; if (match != scan_start) goto rcontlab
-        jne     rcontlab
-; calculate the good chain_length, and we'll compare scan and match string
-        add     chain_length,16-valsub
-        jmp     iseq
-        ENDM
-
-
-normalbeg2dc11:
-        normbeg rcontloop11,11
-
-normalbeg2dc12:
-        normbeg short rcontloop12,12
-
-normalbeg2dc13:
-        normbeg short rcontloop13,13
-
-normalbeg2dc14:
-        normbeg short rcontloop14,14
-
-normalbeg2dc15:
-        normbeg short rcontloop15,15
-
-normalbeg2dc10:
-        normbeg rcontloop10,10
-
-normalbeg2dc9:
-        normbeg rcontloop9,9
-
-normalbeg2dc8:
-        normbeg rcontloop8,8
-
-normalbeg2dc7:
-        normbeg rcontloop7,7
-
-normalbeg2dc6:
-        normbeg rcontloop6,6
-
-normalbeg2dc5:
-        normbeg rcontloop5,5
-
-normalbeg2dc4:
-        normbeg rcontloop4,4
-
-normalbeg2dc3:
-        normbeg rcontloop3,3
-
-normalbeg2dc2:
-        normbeg rcontloop2,2
-
-normalbeg2dc1:
-        normbeg rcontloop1,1
-
-normalbeg2dc0:
-        normbeg rcontloop0,0
-
-
-; we go in normalbeg2 because *(ushf*)(match+best_len-1) == scan_end
-
-normalbeg2:
-        mov     edi,window
-
-        cmp     bp,word ptr[edi+eax]
-        jne     contloop3                   ; if *(ushf*)match != scan_start, continue
-
-iseq:
-; if we are here, we know that *(match+best_len-1) == scan_end
-; and (match == scan_start)
-
-        mov     edi,edx
-        mov     esi,scan                    ; esi = scan
-        add     edi,eax                     ; edi = window + cur_match = match
-
-        mov     edx,[esi+3]                 ; compare manually dword at match+3
-        xor     edx,[edi+3]                 ; and scan +3
-
-        jz      begincompare                ; if equal, go to long compare
-
-; we will determine the unmatch byte and calculate len (in esi)
-        or      dl,dl
-        je      eq1rr
-        mov     esi,3
-        jmp     trfinval
-eq1rr:
-        or      dx,dx
-        je      eq1
-
-        mov     esi,4
-        jmp     trfinval
-eq1:
-        and     edx,0ffffffh
-        jz      eq11
-        mov     esi,5
-        jmp     trfinval
-eq11:
-        mov     esi,6
-        jmp     trfinval
-
-begincompare:
-        ; here we now scan and match begin same
-        add     edi,6
-        add     esi,6
-        mov     ecx,(MAX_MATCH-(2+4))/4     ; scan for at most MAX_MATCH bytes
-        repe    cmpsd                       ; loop until mismatch
-
-        je      trfin                       ; go to trfin if not unmatch
-; we determine the unmatch byte
-        sub     esi,4
-        mov     edx,[edi-4]
-        xor     edx,[esi]
-
-        or      dl,dl
-        jnz     trfin
-        inc     esi
-
-        or      dx,dx
-        jnz     trfin
-        inc     esi
-
-        and     edx,0ffffffh
-        jnz     trfin
-        inc     esi
-
-trfin:
-        sub     esi,scan          ; esi = len
-trfinval:
-; here we have finised compare, and esi contain len of equal string
-        cmp     esi,best_len        ; if len > best_len, go newbestlen
-        ja      short newbestlen
-; now we restore edx, ecx and esi, for the big loop
-        mov     esi,prev
-        mov     ecx,limit
-        mov     edx,window
-        jmp     contloop3
-
-newbestlen:
-        mov     best_len,esi        ; len become best_len
-
-        mov     match_start,eax     ; save new position as match_start
-        cmp     esi,nice_match      ; if best_len >= nice_match, exit
-        jae     exitloop
-        mov     ecx,scan
-        mov     edx,window          ; restore edx=window
-        add     ecx,esi
-        add     esi,edx
-
-        dec     esi
-        mov     windowlen,esi       ; windowlen = window + best_len-1
-        mov     bx,[ecx-1]          ; bx = *(scan+best_len-1) = scan_end
-
-; now we restore ecx and esi, for the big loop :
-        mov     esi,prev
-        mov     ecx,limit
-        jmp     contloop3
-
-exitloop:
-; exit : s->match_start=match_start
-        mov     ebx,match_start
-        mov     ebp,str_s
-        mov     ecx,best_len
-        mov     dword ptr [ebp+dep_match_start],ebx        
-        mov     eax,dword ptr [ebp+dep_lookahead]
-        cmp     ecx,eax
-        ja      minexlo
-        mov     eax,ecx
-minexlo:
-; return min(best_len,s->lookahead)
-        
-; restore stack and register ebx,esi,edi,ebp
-        add     esp,NbStackAdd
-
-        pop     ebx
-        pop     esi
-        pop     edi
-        pop     ebp
-        ret
-InfoAuthor:
-; please don't remove this string !
-; Your are free use gvmat32 in any fre or commercial apps if you don't remove the string in the binary!
-        db     0dh,0ah,"GVMat32 optimised assembly code written 1996-98 by Gilles Vollant",0dh,0ah
-
-
-
-IFDEF NOUNDERLINE
-longest_match_7fff   endp
-ELSE
-_longest_match_7fff  endp
-ENDIF
-
-
-IFDEF NOUNDERLINE
-cpudetect32     proc near
-ELSE
-_cpudetect32    proc near
-ENDIF
-
-
-       pushfd                  ; push original EFLAGS
-       pop     eax             ; get original EFLAGS
-       mov     ecx, eax        ; save original EFLAGS
-       xor     eax, 40000h     ; flip AC bit in EFLAGS
-       push    eax             ; save new EFLAGS value on stack
-       popfd                   ; replace current EFLAGS value
-       pushfd                  ; get new EFLAGS
-       pop     eax             ; store new EFLAGS in EAX
-       xor     eax, ecx        ; can\92t toggle AC bit, processor=80386
-       jz      end_cpu_is_386  ; jump if 80386 processor
-       push    ecx
-       popfd                   ; restore AC bit in EFLAGS first
-
-       pushfd
-       pushfd
-       pop     ecx
-                       
-       mov     eax, ecx        ; get original EFLAGS
-       xor     eax, 200000h    ; flip ID bit in EFLAGS
-       push    eax             ; save new EFLAGS value on stack
-       popfd                   ; replace current EFLAGS value
-       pushfd                  ; get new EFLAGS
-       pop             eax                 ; store new EFLAGS in EAX
-       popfd                   ; restore original EFLAGS
-       xor             eax, ecx        ; can\92t toggle ID bit,
-       je              is_old_486              ; processor=old
-
-       mov     eax,1
-       db      0fh,0a2h        ;CPUID   
-
-exitcpudetect:
-       ret
-
-end_cpu_is_386:
-       mov     eax,0300h
-       jmp     exitcpudetect
-
-is_old_486:
-       mov     eax,0400h
-       jmp     exitcpudetect
-
-IFDEF NOUNDERLINE
-cpudetect32     endp
-ELSE
-_cpudetect32    endp
-ENDIF
-
-_TEXT   ends
-end
diff --git a/lib/zlib/contrib/asm386/gvmat32c.c b/lib/zlib/contrib/asm386/gvmat32c.c
deleted file mode 100644 (file)
index d853bb7..0000000
+++ /dev/null
@@ -1,200 +0,0 @@
-/* gvmat32.c -- C portion of the optimized longest_match for 32 bits x86
- * Copyright (C) 1995-1996 Jean-loup Gailly and Gilles Vollant.
- * File written by Gilles Vollant, by modifiying the longest_match
- *  from Jean-loup Gailly in deflate.c
- *  it prepare all parameters and call the assembly longest_match_gvasm
- *  longest_match execute standard C code is wmask != 0x7fff
- *     (assembly code is faster with a fixed wmask)
- *
- */
-
-#include "deflate.h"
-
-#undef FAR
-#include <windows.h>
-
-#ifdef ASMV
-#define NIL 0
-
-#define UNALIGNED_OK
-
-
-/* if your C compiler don't add underline before function name,
-               define ADD_UNDERLINE_ASMFUNC */
-#ifdef ADD_UNDERLINE_ASMFUNC
-#define longest_match_7fff _longest_match_7fff
-#endif
-
-
-
-void match_init()
-{
-}
-
-unsigned long cpudetect32();
-
-uInt longest_match_c(
-    deflate_state *s,
-    IPos cur_match);                             /* current match */
-
-
-uInt longest_match_7fff(
-    deflate_state *s,
-    IPos cur_match);                             /* current match */
-
-uInt longest_match(
-    deflate_state *s,
-    IPos cur_match)                             /* current match */
-{
-       static uInt iIsPPro=2;
-
-    if ((s->w_mask == 0x7fff) && (iIsPPro==0))
-        return longest_match_7fff(s,cur_match);
-
-       if (iIsPPro==2)
-               iIsPPro = (((cpudetect32()/0x100)&0xf)>=6) ? 1 : 0;
-
-       return longest_match_c(s,cur_match);
-}
-
-
-
-uInt longest_match_c(s, cur_match)
-    deflate_state *s;
-    IPos cur_match;                             /* current match */
-{
-    unsigned chain_length = s->max_chain_length;/* max hash chain length */
-    register Bytef *scan = s->window + s->strstart; /* current string */
-    register Bytef *match;                       /* matched string */
-    register int len;                           /* length of current match */
-    int best_len = s->prev_length;              /* best match length so far */
-    int nice_match = s->nice_match;             /* stop if match long enough */
-    IPos limit = s->strstart > (IPos)MAX_DIST(s) ?
-        s->strstart - (IPos)MAX_DIST(s) : NIL;
-    /* Stop when cur_match becomes <= limit. To simplify the code,
-     * we prevent matches with the string of window index 0.
-     */
-    Posf *prev = s->prev;
-    uInt wmask = s->w_mask;
-
-#ifdef UNALIGNED_OK
-    /* Compare two bytes at a time. Note: this is not always beneficial.
-     * Try with and without -DUNALIGNED_OK to check.
-     */
-    register Bytef *strend = s->window + s->strstart + MAX_MATCH - 1;
-    register ush scan_start = *(ushf*)scan;
-    register ush scan_end   = *(ushf*)(scan+best_len-1);
-#else
-    register Bytef *strend = s->window + s->strstart + MAX_MATCH;
-    register Byte scan_end1  = scan[best_len-1];
-    register Byte scan_end   = scan[best_len];
-#endif
-
-    /* The code is optimized for HASH_BITS >= 8 and MAX_MATCH-2 multiple of 16.
-     * It is easy to get rid of this optimization if necessary.
-     */
-    Assert(s->hash_bits >= 8 && MAX_MATCH == 258, "Code too clever");
-
-    /* Do not waste too much time if we already have a good match: */
-    if (s->prev_length >= s->good_match) {
-        chain_length >>= 2;
-    }
-    /* Do not look for matches beyond the end of the input. This is necessary
-     * to make deflate deterministic.
-     */
-    if ((uInt)nice_match > s->lookahead) nice_match = s->lookahead;
-
-    Assert((ulg)s->strstart <= s->window_size-MIN_LOOKAHEAD, "need lookahead");
-
-    do {
-        Assert(cur_match < s->strstart, "no future");
-        match = s->window + cur_match;
-
-        /* Skip to next match if the match length cannot increase
-         * or if the match length is less than 2:
-         */
-#if (defined(UNALIGNED_OK) && MAX_MATCH == 258)
-        /* This code assumes sizeof(unsigned short) == 2. Do not use
-         * UNALIGNED_OK if your compiler uses a different size.
-         */
-        if (*(ushf*)(match+best_len-1) != scan_end ||
-            *(ushf*)match != scan_start) continue;
-
-        /* It is not necessary to compare scan[2] and match[2] since they are
-         * always equal when the other bytes match, given that the hash keys
-         * are equal and that HASH_BITS >= 8. Compare 2 bytes at a time at
-         * strstart+3, +5, ... up to strstart+257. We check for insufficient
-         * lookahead only every 4th comparison; the 128th check will be made
-         * at strstart+257. If MAX_MATCH-2 is not a multiple of 8, it is
-         * necessary to put more guard bytes at the end of the window, or
-         * to check more often for insufficient lookahead.
-         */
-        Assert(scan[2] == match[2], "scan[2]?");
-        scan++, match++;
-        do {
-        } while (*(ushf*)(scan+=2) == *(ushf*)(match+=2) &&
-                 *(ushf*)(scan+=2) == *(ushf*)(match+=2) &&
-                 *(ushf*)(scan+=2) == *(ushf*)(match+=2) &&
-                 *(ushf*)(scan+=2) == *(ushf*)(match+=2) &&
-                 scan < strend);
-        /* The funny "do {}" generates better code on most compilers */
-
-        /* Here, scan <= window+strstart+257 */
-        Assert(scan <= s->window+(unsigned)(s->window_size-1), "wild scan");
-        if (*scan == *match) scan++;
-
-        len = (MAX_MATCH - 1) - (int)(strend-scan);
-        scan = strend - (MAX_MATCH-1);
-
-#else /* UNALIGNED_OK */
-
-        if (match[best_len]   != scan_end  ||
-            match[best_len-1] != scan_end1 ||
-            *match            != *scan     ||
-            *++match          != scan[1])      continue;
-
-        /* The check at best_len-1 can be removed because it will be made
-         * again later. (This heuristic is not always a win.)
-         * It is not necessary to compare scan[2] and match[2] since they
-         * are always equal when the other bytes match, given that
-         * the hash keys are equal and that HASH_BITS >= 8.
-         */
-        scan += 2, match++;
-        Assert(*scan == *match, "match[2]?");
-
-        /* We check for insufficient lookahead only every 8th comparison;
-         * the 256th check will be made at strstart+258.
-         */
-        do {
-        } while (*++scan == *++match && *++scan == *++match &&
-                 *++scan == *++match && *++scan == *++match &&
-                 *++scan == *++match && *++scan == *++match &&
-                 *++scan == *++match && *++scan == *++match &&
-                 scan < strend);
-
-        Assert(scan <= s->window+(unsigned)(s->window_size-1), "wild scan");
-
-        len = MAX_MATCH - (int)(strend - scan);
-        scan = strend - MAX_MATCH;
-
-#endif /* UNALIGNED_OK */
-
-        if (len > best_len) {
-            s->match_start = cur_match;
-            best_len = len;
-            if (len >= nice_match) break;
-#ifdef UNALIGNED_OK
-            scan_end = *(ushf*)(scan+best_len-1);
-#else
-            scan_end1  = scan[best_len-1];
-            scan_end   = scan[best_len];
-#endif
-        }
-    } while ((cur_match = prev[cur_match & wmask]) > limit
-             && --chain_length != 0);
-
-    if ((uInt)best_len <= s->lookahead) return (uInt)best_len;
-    return s->lookahead;
-}
-
-#endif /* ASMV */
diff --git a/lib/zlib/contrib/asm386/mkgvmt32.bat b/lib/zlib/contrib/asm386/mkgvmt32.bat
deleted file mode 100644 (file)
index 6c5ffd7..0000000
+++ /dev/null
@@ -1 +0,0 @@
-c:\masm611\bin\ml /coff /Zi /c /Flgvmat32.lst gvmat32.asm
diff --git a/lib/zlib/contrib/asm386/zlibvc.def b/lib/zlib/contrib/asm386/zlibvc.def
deleted file mode 100644 (file)
index 7e9d60d..0000000
+++ /dev/null
@@ -1,74 +0,0 @@
-LIBRARY                "zlib"
-
-DESCRIPTION    '"""zlib data compression library"""'
-
-
-VERSION                1.11
-
-
-HEAPSIZE       1048576,8192
-
-EXPORTS
-    adler32                        @1
-    compress                       @2
-    crc32                          @3
-    deflate                        @4
-    deflateCopy                    @5
-    deflateEnd                     @6
-    deflateInit2_                  @7
-    deflateInit_                   @8
-    deflateParams                  @9
-    deflateReset                   @10
-    deflateSetDictionary           @11
-    gzclose                        @12
-    gzdopen                        @13
-    gzerror                        @14
-    gzflush                        @15
-    gzopen                         @16
-    gzread                         @17
-    gzwrite                        @18
-    inflate                        @19
-    inflateEnd                     @20
-    inflateInit2_                  @21
-    inflateInit_                   @22
-    inflateReset                   @23
-    inflateSetDictionary           @24
-    inflateSync                    @25
-    uncompress                     @26
-    zlibVersion                    @27
-    gzprintf                       @28
-    gzputc                         @29
-    gzgetc                         @30
-    gzseek                         @31
-    gzrewind                       @32
-    gztell                         @33
-    gzeof                          @34
-    gzsetparams                    @35
-    zError                         @36
-    inflateSyncPoint               @37
-    get_crc_table                  @38
-    compress2                      @39
-    gzputs                         @40
-    gzgets                         @41
-
-       unzOpen                       @61
-       unzClose                      @62
-       unzGetGlobalInfo              @63
-       unzGetCurrentFileInfo         @64
-       unzGoToFirstFile              @65
-       unzGoToNextFile               @66
-       unzOpenCurrentFile            @67
-       unzReadCurrentFile            @68
-       unztell                       @70
-       unzeof                        @71
-       unzCloseCurrentFile           @72
-       unzGetGlobalComment           @73
-       unzStringFileNameCompare      @74
-       unzLocateFile                 @75
-       unzGetLocalExtrafield         @76
-
-       zipOpen                       @80
-       zipOpenNewFileInZip           @81
-       zipWriteInFileInZip           @82
-       zipCloseFileInZip             @83
-       zipClose                      @84
diff --git a/lib/zlib/contrib/asm386/zlibvc.dsp b/lib/zlib/contrib/asm386/zlibvc.dsp
deleted file mode 100644 (file)
index a70d4d4..0000000
+++ /dev/null
@@ -1,651 +0,0 @@
-# Microsoft Developer Studio Project File - Name="zlibvc" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 5.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
-# TARGTYPE "Win32 (ALPHA) Dynamic-Link Library" 0x0602
-
-CFG=zlibvc - Win32 Release
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE 
-!MESSAGE NMAKE /f "zlibvc.mak".
-!MESSAGE 
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE 
-!MESSAGE NMAKE /f "zlibvc.mak" CFG="zlibvc - Win32 Release"
-!MESSAGE 
-!MESSAGE Possible choices for configuration are:
-!MESSAGE 
-!MESSAGE "zlibvc - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE "zlibvc - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE "zlibvc - Win32 ReleaseAxp" (based on\
- "Win32 (ALPHA) Dynamic-Link Library")
-!MESSAGE "zlibvc - Win32 ReleaseWithoutAsm" (based on\
- "Win32 (x86) Dynamic-Link Library")
-!MESSAGE "zlibvc - Win32 ReleaseWithoutCrtdll" (based on\
- "Win32 (x86) Dynamic-Link Library")
-!MESSAGE 
-
-# Begin Project
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-
-!IF  "$(CFG)" == "zlibvc - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir ".\Release"
-# PROP BASE Intermediate_Dir ".\Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir ".\Release"
-# PROP Intermediate_Dir ".\Release"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-CPP=cl.exe
-# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /c
-# ADD CPP /nologo /MT /W3 /GX /O2 /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_WINDLL" /D "_WIN32" /D "BUILD_ZLIBDLL" /D "ZLIB_DLL" /D "DYNAMIC_CRC_TABLE" /D "ASMV" /FAcs /FR /FD /c
-# SUBTRACT CPP /YX
-MTL=midl.exe
-# ADD BASE MTL /nologo /D "NDEBUG" /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-RSC=rc.exe
-# ADD BASE RSC /l 0x40c /d "NDEBUG"
-# ADD RSC /l 0x40c /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386
-# ADD LINK32 gvmat32.obj kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib crtdll.lib /nologo /subsystem:windows /dll /map /machine:I386 /nodefaultlib /out:".\Release\zlib.dll"
-# SUBTRACT LINK32 /pdb:none
-
-!ELSEIF  "$(CFG)" == "zlibvc - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir ".\Debug"
-# PROP BASE Intermediate_Dir ".\Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir ".\Debug"
-# PROP Intermediate_Dir ".\Debug"
-# PROP Target_Dir ""
-CPP=cl.exe
-# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /c
-# ADD CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "_WINDLL" /D "_WIN32" /D "BUILD_ZLIBDLL" /D "ZLIB_DLL" /FD /c
-# SUBTRACT CPP /YX
-MTL=midl.exe
-# ADD BASE MTL /nologo /D "_DEBUG" /win32
-# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-RSC=rc.exe
-# ADD BASE RSC /l 0x40c /d "_DEBUG"
-# ADD RSC /l 0x40c /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /subsystem:windows /dll /debug /machine:I386 /out:".\Debug\zlib.dll"
-
-!ELSEIF  "$(CFG)" == "zlibvc - Win32 ReleaseAxp"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "zlibvc__"
-# PROP BASE Intermediate_Dir "zlibvc__"
-# PROP BASE Ignore_Export_Lib 0
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "zlibvc__"
-# PROP Intermediate_Dir "zlibvc__"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-MTL=midl.exe
-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-CPP=cl.exe
-# ADD BASE CPP /nologo /MT /Gt0 /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_WIN32" /D "BUILD_ZLIBDLL" /D "ZLIB_DLL" /D "DYNAMIC_CRC_TABLE" /FAcs /FR /YX /FD /c
-# ADD CPP /nologo /MT /Gt0 /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_WIN32" /D "BUILD_ZLIBDLL" /D "ZLIB_DLL" /D "DYNAMIC_CRC_TABLE" /FAcs /FR /FD /c
-# SUBTRACT CPP /YX
-RSC=rc.exe
-# ADD BASE RSC /l 0x40c /d "NDEBUG"
-# ADD RSC /l 0x40c /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 crtdll.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /subsystem:windows /dll /map /machine:ALPHA /nodefaultlib /out:".\Release\zlib.dll"
-# SUBTRACT BASE LINK32 /pdb:none
-# ADD LINK32 crtdll.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /subsystem:windows /dll /map /machine:ALPHA /nodefaultlib /out:"zlibvc__\zlib.dll"
-# SUBTRACT LINK32 /pdb:none
-
-!ELSEIF  "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "zlibvc_0"
-# PROP BASE Intermediate_Dir "zlibvc_0"
-# PROP BASE Ignore_Export_Lib 0
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "zlibvc_0"
-# PROP Intermediate_Dir "zlibvc_0"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-CPP=cl.exe
-# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_WINDLL" /D "_WIN32" /D "BUILD_ZLIBDLL" /D "ZLIB_DLL" /D "DYNAMIC_CRC_TABLE" /FAcs /FR /YX /FD /c
-# ADD CPP /nologo /MT /W3 /GX /O2 /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_WINDLL" /D "_WIN32" /D "BUILD_ZLIBDLL" /D "ZLIB_DLL" /D "DYNAMIC_CRC_TABLE" /FAcs /FR /FD /c
-# SUBTRACT CPP /YX
-MTL=midl.exe
-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-RSC=rc.exe
-# ADD BASE RSC /l 0x40c /d "NDEBUG"
-# ADD RSC /l 0x40c /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib crtdll.lib /nologo /subsystem:windows /dll /map /machine:I386 /nodefaultlib /out:".\Release\zlib.dll"
-# SUBTRACT BASE LINK32 /pdb:none
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib crtdll.lib /nologo /subsystem:windows /dll /map /machine:I386 /nodefaultlib /out:".\zlibvc_0\zlib.dll"
-# SUBTRACT LINK32 /pdb:none
-
-!ELSEIF  "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "zlibvc_1"
-# PROP BASE Intermediate_Dir "zlibvc_1"
-# PROP BASE Ignore_Export_Lib 0
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "zlibvc_1"
-# PROP Intermediate_Dir "zlibvc_1"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-CPP=cl.exe
-# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_WINDLL" /D "_WIN32" /D "BUILD_ZLIBDLL" /D "ZLIB_DLL" /D "DYNAMIC_CRC_TABLE" /D "ASMV" /FAcs /FR /YX /FD /c
-# ADD CPP /nologo /MT /W3 /GX /O2 /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_WINDLL" /D "_WIN32" /D "BUILD_ZLIBDLL" /D "ZLIB_DLL" /D "DYNAMIC_CRC_TABLE" /D "ASMV" /FAcs /FR /FD /c
-# SUBTRACT CPP /YX
-MTL=midl.exe
-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-RSC=rc.exe
-# ADD BASE RSC /l 0x40c /d "NDEBUG"
-# ADD RSC /l 0x40c /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 gvmat32.obj kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib crtdll.lib /nologo /subsystem:windows /dll /map /machine:I386 /nodefaultlib /out:".\Release\zlib.dll"
-# SUBTRACT BASE LINK32 /pdb:none
-# ADD LINK32 gvmat32.obj kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib crtdll.lib /nologo /subsystem:windows /dll /map /machine:I386 /nodefaultlib /out:".\zlibvc_1\zlib.dll"
-# SUBTRACT LINK32 /pdb:none
-
-!ENDIF 
-
-# Begin Target
-
-# Name "zlibvc - Win32 Release"
-# Name "zlibvc - Win32 Debug"
-# Name "zlibvc - Win32 ReleaseAxp"
-# Name "zlibvc - Win32 ReleaseWithoutAsm"
-# Name "zlibvc - Win32 ReleaseWithoutCrtdll"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;hpj;bat;for;f90"
-# Begin Source File
-
-SOURCE=.\adler32.c
-
-!IF  "$(CFG)" == "zlibvc - Win32 Release"
-
-!ELSEIF  "$(CFG)" == "zlibvc - Win32 Debug"
-
-!ELSEIF  "$(CFG)" == "zlibvc - Win32 ReleaseAxp"
-
-DEP_CPP_ADLER=\
-       ".\zconf.h"\
-       ".\zlib.h"\
-       
-
-!ELSEIF  "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm"
-
-!ELSEIF  "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll"
-
-!ENDIF 
-
-# End Source File
-# Begin Source File
-
-SOURCE=.\compress.c
-
-!IF  "$(CFG)" == "zlibvc - Win32 Release"
-
-!ELSEIF  "$(CFG)" == "zlibvc - Win32 Debug"
-
-!ELSEIF  "$(CFG)" == "zlibvc - Win32 ReleaseAxp"
-
-DEP_CPP_COMPR=\
-       ".\zconf.h"\
-       ".\zlib.h"\
-       
-
-!ELSEIF  "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm"
-
-!ELSEIF  "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll"
-
-!ENDIF 
-
-# End Source File
-# Begin Source File
-
-SOURCE=.\crc32.c
-
-!IF  "$(CFG)" == "zlibvc - Win32 Release"
-
-!ELSEIF  "$(CFG)" == "zlibvc - Win32 Debug"
-
-!ELSEIF  "$(CFG)" == "zlibvc - Win32 ReleaseAxp"
-
-DEP_CPP_CRC32=\
-       ".\zconf.h"\
-       ".\zlib.h"\
-       
-
-!ELSEIF  "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm"
-
-!ELSEIF  "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll"
-
-!ENDIF 
-
-# End Source File
-# Begin Source File
-
-SOURCE=.\deflate.c
-
-!IF  "$(CFG)" == "zlibvc - Win32 Release"
-
-!ELSEIF  "$(CFG)" == "zlibvc - Win32 Debug"
-
-!ELSEIF  "$(CFG)" == "zlibvc - Win32 ReleaseAxp"
-
-DEP_CPP_DEFLA=\
-       ".\deflate.h"\
-       ".\zconf.h"\
-       ".\zlib.h"\
-       ".\zutil.h"\
-       
-
-!ELSEIF  "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm"
-
-!ELSEIF  "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll"
-
-!ENDIF 
-
-# End Source File
-# Begin Source File
-
-SOURCE=.\gvmat32c.c
-
-!IF  "$(CFG)" == "zlibvc - Win32 Release"
-
-!ELSEIF  "$(CFG)" == "zlibvc - Win32 Debug"
-
-!ELSEIF  "$(CFG)" == "zlibvc - Win32 ReleaseAxp"
-
-!ELSEIF  "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm"
-
-!ELSEIF  "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll"
-
-!ENDIF 
-
-# End Source File
-# Begin Source File
-
-SOURCE=.\gzio.c
-
-!IF  "$(CFG)" == "zlibvc - Win32 Release"
-
-!ELSEIF  "$(CFG)" == "zlibvc - Win32 Debug"
-
-!ELSEIF  "$(CFG)" == "zlibvc - Win32 ReleaseAxp"
-
-DEP_CPP_GZIO_=\
-       ".\zconf.h"\
-       ".\zlib.h"\
-       ".\zutil.h"\
-       
-
-!ELSEIF  "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm"
-
-!ELSEIF  "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll"
-
-!ENDIF 
-
-# End Source File
-# Begin Source File
-
-SOURCE=.\infblock.c
-
-!IF  "$(CFG)" == "zlibvc - Win32 Release"
-
-!ELSEIF  "$(CFG)" == "zlibvc - Win32 Debug"
-
-!ELSEIF  "$(CFG)" == "zlibvc - Win32 ReleaseAxp"
-
-DEP_CPP_INFBL=\
-       ".\infblock.h"\
-       ".\infcodes.h"\
-       ".\inftrees.h"\
-       ".\infutil.h"\
-       ".\zconf.h"\
-       ".\zlib.h"\
-       ".\zutil.h"\
-       
-
-!ELSEIF  "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm"
-
-!ELSEIF  "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll"
-
-!ENDIF 
-
-# End Source File
-# Begin Source File
-
-SOURCE=.\infcodes.c
-
-!IF  "$(CFG)" == "zlibvc - Win32 Release"
-
-!ELSEIF  "$(CFG)" == "zlibvc - Win32 Debug"
-
-!ELSEIF  "$(CFG)" == "zlibvc - Win32 ReleaseAxp"
-
-DEP_CPP_INFCO=\
-       ".\infblock.h"\
-       ".\infcodes.h"\
-       ".\inffast.h"\
-       ".\inftrees.h"\
-       ".\infutil.h"\
-       ".\zconf.h"\
-       ".\zlib.h"\
-       ".\zutil.h"\
-       
-
-!ELSEIF  "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm"
-
-!ELSEIF  "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll"
-
-!ENDIF 
-
-# End Source File
-# Begin Source File
-
-SOURCE=.\inffast.c
-
-!IF  "$(CFG)" == "zlibvc - Win32 Release"
-
-!ELSEIF  "$(CFG)" == "zlibvc - Win32 Debug"
-
-!ELSEIF  "$(CFG)" == "zlibvc - Win32 ReleaseAxp"
-
-DEP_CPP_INFFA=\
-       ".\infblock.h"\
-       ".\infcodes.h"\
-       ".\inffast.h"\
-       ".\inftrees.h"\
-       ".\infutil.h"\
-       ".\zconf.h"\
-       ".\zlib.h"\
-       ".\zutil.h"\
-       
-
-!ELSEIF  "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm"
-
-!ELSEIF  "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll"
-
-!ENDIF 
-
-# End Source File
-# Begin Source File
-
-SOURCE=.\inflate.c
-
-!IF  "$(CFG)" == "zlibvc - Win32 Release"
-
-!ELSEIF  "$(CFG)" == "zlibvc - Win32 Debug"
-
-!ELSEIF  "$(CFG)" == "zlibvc - Win32 ReleaseAxp"
-
-DEP_CPP_INFLA=\
-       ".\infblock.h"\
-       ".\zconf.h"\
-       ".\zlib.h"\
-       ".\zutil.h"\
-       
-
-!ELSEIF  "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm"
-
-!ELSEIF  "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll"
-
-!ENDIF 
-
-# End Source File
-# Begin Source File
-
-SOURCE=.\inftrees.c
-
-!IF  "$(CFG)" == "zlibvc - Win32 Release"
-
-!ELSEIF  "$(CFG)" == "zlibvc - Win32 Debug"
-
-!ELSEIF  "$(CFG)" == "zlibvc - Win32 ReleaseAxp"
-
-DEP_CPP_INFTR=\
-       ".\inftrees.h"\
-       ".\zconf.h"\
-       ".\zlib.h"\
-       ".\zutil.h"\
-       
-
-!ELSEIF  "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm"
-
-!ELSEIF  "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll"
-
-!ENDIF 
-
-# End Source File
-# Begin Source File
-
-SOURCE=.\infutil.c
-
-!IF  "$(CFG)" == "zlibvc - Win32 Release"
-
-!ELSEIF  "$(CFG)" == "zlibvc - Win32 Debug"
-
-!ELSEIF  "$(CFG)" == "zlibvc - Win32 ReleaseAxp"
-
-DEP_CPP_INFUT=\
-       ".\infblock.h"\
-       ".\infcodes.h"\
-       ".\inftrees.h"\
-       ".\infutil.h"\
-       ".\zconf.h"\
-       ".\zlib.h"\
-       ".\zutil.h"\
-       
-
-!ELSEIF  "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm"
-
-!ELSEIF  "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll"
-
-!ENDIF 
-
-# End Source File
-# Begin Source File
-
-SOURCE=.\trees.c
-
-!IF  "$(CFG)" == "zlibvc - Win32 Release"
-
-!ELSEIF  "$(CFG)" == "zlibvc - Win32 Debug"
-
-!ELSEIF  "$(CFG)" == "zlibvc - Win32 ReleaseAxp"
-
-DEP_CPP_TREES=\
-       ".\deflate.h"\
-       ".\zconf.h"\
-       ".\zlib.h"\
-       ".\zutil.h"\
-       
-
-!ELSEIF  "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm"
-
-!ELSEIF  "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll"
-
-!ENDIF 
-
-# End Source File
-# Begin Source File
-
-SOURCE=.\uncompr.c
-
-!IF  "$(CFG)" == "zlibvc - Win32 Release"
-
-!ELSEIF  "$(CFG)" == "zlibvc - Win32 Debug"
-
-!ELSEIF  "$(CFG)" == "zlibvc - Win32 ReleaseAxp"
-
-DEP_CPP_UNCOM=\
-       ".\zconf.h"\
-       ".\zlib.h"\
-       
-
-!ELSEIF  "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm"
-
-!ELSEIF  "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll"
-
-!ENDIF 
-
-# End Source File
-# Begin Source File
-
-SOURCE=.\unzip.c
-
-!IF  "$(CFG)" == "zlibvc - Win32 Release"
-
-!ELSEIF  "$(CFG)" == "zlibvc - Win32 Debug"
-
-!ELSEIF  "$(CFG)" == "zlibvc - Win32 ReleaseAxp"
-
-!ELSEIF  "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm"
-
-!ELSEIF  "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll"
-
-!ENDIF 
-
-# End Source File
-# Begin Source File
-
-SOURCE=.\zip.c
-
-!IF  "$(CFG)" == "zlibvc - Win32 Release"
-
-!ELSEIF  "$(CFG)" == "zlibvc - Win32 Debug"
-
-!ELSEIF  "$(CFG)" == "zlibvc - Win32 ReleaseAxp"
-
-!ELSEIF  "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm"
-
-!ELSEIF  "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll"
-
-!ENDIF 
-
-# End Source File
-# Begin Source File
-
-SOURCE=.\zlib.rc
-# End Source File
-# Begin Source File
-
-SOURCE=.\zlibvc.def
-# End Source File
-# Begin Source File
-
-SOURCE=.\zutil.c
-
-!IF  "$(CFG)" == "zlibvc - Win32 Release"
-
-!ELSEIF  "$(CFG)" == "zlibvc - Win32 Debug"
-
-!ELSEIF  "$(CFG)" == "zlibvc - Win32 ReleaseAxp"
-
-DEP_CPP_ZUTIL=\
-       ".\zconf.h"\
-       ".\zlib.h"\
-       ".\zutil.h"\
-       
-
-!ELSEIF  "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm"
-
-!ELSEIF  "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll"
-
-!ENDIF 
-
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl;fi;fd"
-# Begin Source File
-
-SOURCE=.\deflate.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\infblock.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\infcodes.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\inffast.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\inftrees.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\infutil.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\zconf.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\zlib.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\zutil.h
-# End Source File
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;cnt;rtf;gif;jpg;jpeg;jpe"
-# End Group
-# End Target
-# End Project
diff --git a/lib/zlib/contrib/asm386/zlibvc.dsw b/lib/zlib/contrib/asm386/zlibvc.dsw
deleted file mode 100644 (file)
index 493cd87..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-Microsoft Developer Studio Workspace File, Format Version 5.00
-# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
-
-###############################################################################
-
-Project: "zlibstat"=.\zlibstat.dsp - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
-}}}
-
-###############################################################################
-
-Project: "zlibvc"=.\zlibvc.dsp - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
-}}}
-
-###############################################################################
-
-Global:
-
-Package=<5>
-{{{
-}}}
-
-Package=<3>
-{{{
-}}}
-
-###############################################################################
-
diff --git a/lib/zlib/contrib/asm586/README.586 b/lib/zlib/contrib/asm586/README.586
deleted file mode 100644 (file)
index 6bb78f3..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-This is a patched version of zlib modified to use
-Pentium-optimized assembly code in the deflation algorithm. The files
-changed/added by this patch are:
-
-README.586
-match.S
-
-The effectiveness of these modifications is a bit marginal, as the the
-program's bottleneck seems to be mostly L1-cache contention, for which
-there is no real way to work around without rewriting the basic
-algorithm. The speedup on average is around 5-10% (which is generally
-less than the amount of variance between subsequent executions).
-However, when used at level 9 compression, the cache contention can
-drop enough for the assembly version to achieve 10-20% speedup (and
-sometimes more, depending on the amount of overall redundancy in the
-files). Even here, though, cache contention can still be the limiting
-factor, depending on the nature of the program using the zlib library.
-This may also mean that better improvements will be seen on a Pentium
-with MMX, which suffers much less from L1-cache contention, but I have
-not yet verified this.
-
-Note that this code has been tailored for the Pentium in particular,
-and will not perform well on the Pentium Pro (due to the use of a
-partial register in the inner loop).
-
-If you are using an assembler other than GNU as, you will have to
-translate match.S to use your assembler's syntax. (Have fun.)
-
-Brian Raiter
-breadbox@muppetlabs.com
-April, 1998
-
-
-Added for zlib 1.1.3:
-
-The patches come from
-http://www.muppetlabs.com/~breadbox/software/assembly.html
-
-To compile zlib with this asm file, copy match.S to the zlib directory
-then do:
-
-CFLAGS="-O3 -DASMV" ./configure
-make OBJA=match.o
diff --git a/lib/zlib/contrib/asm586/match.S b/lib/zlib/contrib/asm586/match.S
deleted file mode 100644 (file)
index 8f16140..0000000
+++ /dev/null
@@ -1,354 +0,0 @@
-/* match.s -- Pentium-optimized version of longest_match()
- * Written for zlib 1.1.2
- * Copyright (C) 1998 Brian Raiter <breadbox@muppetlabs.com>
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License.
- */
-
-#ifndef NO_UNDERLINE
-#define        match_init      _match_init
-#define        longest_match   _longest_match
-#endif
-
-#define        MAX_MATCH       (258)
-#define        MIN_MATCH       (3)
-#define        MIN_LOOKAHEAD   (MAX_MATCH + MIN_MATCH + 1)
-#define        MAX_MATCH_8     ((MAX_MATCH + 7) & ~7)
-
-/* stack frame offsets */
-
-#define        wmask                   0       /* local copy of s->wmask       */
-#define        window                  4       /* local copy of s->window      */
-#define        windowbestlen           8       /* s->window + bestlen          */
-#define        chainlenscanend         12      /* high word: current chain len */
-                                       /* low word: last bytes sought  */
-#define        scanstart               16      /* first two bytes of string    */
-#define        scanalign               20      /* dword-misalignment of string */
-#define        nicematch               24      /* a good enough match size     */
-#define        bestlen                 28      /* size of best match so far    */
-#define        scan                    32      /* ptr to string wanting match  */
-
-#define        LocalVarsSize           (36)
-/*     saved ebx               36 */
-/*     saved edi               40 */
-/*     saved esi               44 */
-/*     saved ebp               48 */
-/*     return address          52 */
-#define        deflatestate            56      /* the function arguments       */
-#define        curmatch                60
-
-/* Offsets for fields in the deflate_state structure. These numbers
- * are calculated from the definition of deflate_state, with the
- * assumption that the compiler will dword-align the fields. (Thus,
- * changing the definition of deflate_state could easily cause this
- * program to crash horribly, without so much as a warning at
- * compile time. Sigh.)
- */
-#define        dsWSize                 36
-#define        dsWMask                 44
-#define        dsWindow                48
-#define        dsPrev                  56
-#define        dsMatchLen              88
-#define        dsPrevMatch             92
-#define        dsStrStart              100
-#define        dsMatchStart            104
-#define        dsLookahead             108
-#define        dsPrevLen               112
-#define        dsMaxChainLen           116
-#define        dsGoodMatch             132
-#define        dsNiceMatch             136
-
-
-.file "match.S"
-
-.globl match_init, longest_match
-
-.text
-
-/* uInt longest_match(deflate_state *deflatestate, IPos curmatch) */
-
-longest_match:
-
-/* Save registers that the compiler may be using, and adjust %esp to   */
-/* make room for our stack frame.                                      */
-
-               pushl   %ebp
-               pushl   %edi
-               pushl   %esi
-               pushl   %ebx
-               subl    $LocalVarsSize, %esp
-
-/* Retrieve the function arguments. %ecx will hold cur_match           */
-/* throughout the entire function. %edx will hold the pointer to the   */
-/* deflate_state structure during the function's setup (before         */
-/* entering the main loop).                                            */
-
-               movl    deflatestate(%esp), %edx
-               movl    curmatch(%esp), %ecx
-
-/* if ((uInt)nice_match > s->lookahead) nice_match = s->lookahead;     */
-
-               movl    dsNiceMatch(%edx), %eax
-               movl    dsLookahead(%edx), %ebx
-               cmpl    %eax, %ebx
-               jl      LookaheadLess
-               movl    %eax, %ebx
-LookaheadLess: movl    %ebx, nicematch(%esp)
-
-/* register Bytef *scan = s->window + s->strstart;                     */
-
-               movl    dsWindow(%edx), %esi
-               movl    %esi, window(%esp)
-               movl    dsStrStart(%edx), %ebp
-               lea     (%esi,%ebp), %edi
-               movl    %edi, scan(%esp)
-
-/* Determine how many bytes the scan ptr is off from being             */
-/* dword-aligned.                                                      */
-
-               movl    %edi, %eax
-               negl    %eax
-               andl    $3, %eax
-               movl    %eax, scanalign(%esp)
-
-/* IPos limit = s->strstart > (IPos)MAX_DIST(s) ?                      */
-/*     s->strstart - (IPos)MAX_DIST(s) : NIL;                          */
-
-               movl    dsWSize(%edx), %eax
-               subl    $MIN_LOOKAHEAD, %eax
-               subl    %eax, %ebp
-               jg      LimitPositive
-               xorl    %ebp, %ebp
-LimitPositive:
-
-/* unsigned chain_length = s->max_chain_length;                                */
-/* if (s->prev_length >= s->good_match) {                              */
-/*     chain_length >>= 2;                                             */
-/* }                                                                   */
-
-               movl    dsPrevLen(%edx), %eax
-               movl    dsGoodMatch(%edx), %ebx
-               cmpl    %ebx, %eax
-               movl    dsMaxChainLen(%edx), %ebx
-               jl      LastMatchGood
-               shrl    $2, %ebx
-LastMatchGood:
-
-/* chainlen is decremented once beforehand so that the function can    */
-/* use the sign flag instead of the zero flag for the exit test.       */
-/* It is then shifted into the high word, to make room for the scanend */
-/* scanend value, which it will always accompany.                      */
-
-               decl    %ebx
-               shll    $16, %ebx
-
-/* int best_len = s->prev_length;                                      */
-
-               movl    dsPrevLen(%edx), %eax
-               movl    %eax, bestlen(%esp)
-
-/* Store the sum of s->window + best_len in %esi locally, and in %esi. */
-
-               addl    %eax, %esi
-               movl    %esi, windowbestlen(%esp)
-
-/* register ush scan_start = *(ushf*)scan;                             */
-/* register ush scan_end   = *(ushf*)(scan+best_len-1);                        */
-
-               movw    (%edi), %bx
-               movw    %bx, scanstart(%esp)
-               movw    -1(%edi,%eax), %bx
-               movl    %ebx, chainlenscanend(%esp)
-
-/* Posf *prev = s->prev;                                               */
-/* uInt wmask = s->w_mask;                                             */
-
-               movl    dsPrev(%edx), %edi
-               movl    dsWMask(%edx), %edx
-               mov     %edx, wmask(%esp)
-
-/* Jump into the main loop.                                            */
-
-               jmp     LoopEntry
-
-.balign 16
-
-/* do {
- *     match = s->window + cur_match;
- *     if (*(ushf*)(match+best_len-1) != scan_end ||
- *         *(ushf*)match != scan_start) continue;
- *     [...]
- * } while ((cur_match = prev[cur_match & wmask]) > limit
- *          && --chain_length != 0);
- *
- * Here is the inner loop of the function. The function will spend the
- * majority of its time in this loop, and majority of that time will
- * be spent in the first ten instructions.
- *
- * Within this loop:
- * %ebx = chainlenscanend - i.e., ((chainlen << 16) | scanend)
- * %ecx = curmatch
- * %edx = curmatch & wmask
- * %esi = windowbestlen - i.e., (window + bestlen)
- * %edi = prev
- * %ebp = limit
- *
- * Two optimization notes on the choice of instructions:
- *
- * The first instruction uses a 16-bit address, which costs an extra,
- * unpairable cycle. This is cheaper than doing a 32-bit access and
- * zeroing the high word, due to the 3-cycle misalignment penalty which
- * would occur half the time. This also turns out to be cheaper than
- * doing two separate 8-bit accesses, as the memory is so rarely in the
- * L1 cache.
- *
- * The window buffer, however, apparently spends a lot of time in the
- * cache, and so it is faster to retrieve the word at the end of the
- * match string with two 8-bit loads. The instructions that test the
- * word at the beginning of the match string, however, are executed
- * much less frequently, and there it was cheaper to use 16-bit
- * instructions, which avoided the necessity of saving off and
- * subsequently reloading one of the other registers.
- */
-LookupLoop:
-                                                       /* 1 U & V  */
-               movw    (%edi,%edx,2), %cx              /* 2 U pipe */
-               movl    wmask(%esp), %edx               /* 2 V pipe */
-               cmpl    %ebp, %ecx                      /* 3 U pipe */
-               jbe     LeaveNow                        /* 3 V pipe */
-               subl    $0x00010000, %ebx               /* 4 U pipe */
-               js      LeaveNow                        /* 4 V pipe */
-LoopEntry:     movb    -1(%esi,%ecx), %al              /* 5 U pipe */
-               andl    %ecx, %edx                      /* 5 V pipe */
-               cmpb    %bl, %al                        /* 6 U pipe */
-               jnz     LookupLoop                      /* 6 V pipe */
-               movb    (%esi,%ecx), %ah
-               cmpb    %bh, %ah
-               jnz     LookupLoop
-               movl    window(%esp), %eax
-               movw    (%eax,%ecx), %ax
-               cmpw    scanstart(%esp), %ax
-               jnz     LookupLoop
-
-/* Store the current value of chainlen.                                        */
-
-               movl    %ebx, chainlenscanend(%esp)
-
-/* Point %edi to the string under scrutiny, and %esi to the string we  */
-/* are hoping to match it up with. In actuality, %esi and %edi are     */
-/* both pointed (MAX_MATCH_8 - scanalign) bytes ahead, and %edx is     */
-/* initialized to -(MAX_MATCH_8 - scanalign).                          */
-
-               movl    window(%esp), %esi
-               movl    scan(%esp), %edi
-               addl    %ecx, %esi
-               movl    scanalign(%esp), %eax
-               movl    $(-MAX_MATCH_8), %edx
-               lea     MAX_MATCH_8(%edi,%eax), %edi
-               lea     MAX_MATCH_8(%esi,%eax), %esi
-
-/* Test the strings for equality, 8 bytes at a time. At the end,
- * adjust %edx so that it is offset to the exact byte that mismatched.
- *
- * We already know at this point that the first three bytes of the
- * strings match each other, and they can be safely passed over before
- * starting the compare loop. So what this code does is skip over 0-3
- * bytes, as much as necessary in order to dword-align the %edi
- * pointer. (%esi will still be misaligned three times out of four.)
- *
- * It should be confessed that this loop usually does not represent
- * much of the total running time. Replacing it with a more
- * straightforward "rep cmpsb" would not drastically degrade
- * performance.
- */
-LoopCmps:
-               movl    (%esi,%edx), %eax
-               movl    (%edi,%edx), %ebx
-               xorl    %ebx, %eax
-               jnz     LeaveLoopCmps
-               movl    4(%esi,%edx), %eax
-               movl    4(%edi,%edx), %ebx
-               xorl    %ebx, %eax
-               jnz     LeaveLoopCmps4
-               addl    $8, %edx
-               jnz     LoopCmps
-               jmp     LenMaximum
-LeaveLoopCmps4:        addl    $4, %edx
-LeaveLoopCmps: testl   $0x0000FFFF, %eax
-               jnz     LenLower
-               addl    $2, %edx
-               shrl    $16, %eax
-LenLower:      subb    $1, %al
-               adcl    $0, %edx
-
-/* Calculate the length of the match. If it is longer than MAX_MATCH,  */
-/* then automatically accept it as the best possible match and leave.  */
-
-               lea     (%edi,%edx), %eax
-               movl    scan(%esp), %edi
-               subl    %edi, %eax
-               cmpl    $MAX_MATCH, %eax
-               jge     LenMaximum
-
-/* If the length of the match is not longer than the best match we     */
-/* have so far, then forget it and return to the lookup loop.          */
-
-               movl    deflatestate(%esp), %edx
-               movl    bestlen(%esp), %ebx
-               cmpl    %ebx, %eax
-               jg      LongerMatch
-               movl    chainlenscanend(%esp), %ebx
-               movl    windowbestlen(%esp), %esi
-               movl    dsPrev(%edx), %edi
-               movl    wmask(%esp), %edx
-               andl    %ecx, %edx
-               jmp     LookupLoop
-
-/*         s->match_start = cur_match;                                 */
-/*         best_len = len;                                             */
-/*         if (len >= nice_match) break;                               */
-/*         scan_end = *(ushf*)(scan+best_len-1);                       */
-
-LongerMatch:   movl    nicematch(%esp), %ebx
-               movl    %eax, bestlen(%esp)
-               movl    %ecx, dsMatchStart(%edx)
-               cmpl    %ebx, %eax
-               jge     LeaveNow
-               movl    window(%esp), %esi
-               addl    %eax, %esi
-               movl    %esi, windowbestlen(%esp)
-               movl    chainlenscanend(%esp), %ebx
-               movw    -1(%edi,%eax), %bx
-               movl    dsPrev(%edx), %edi
-               movl    %ebx, chainlenscanend(%esp)
-               movl    wmask(%esp), %edx
-               andl    %ecx, %edx
-               jmp     LookupLoop
-
-/* Accept the current string, with the maximum possible length.                */
-
-LenMaximum:    movl    deflatestate(%esp), %edx
-               movl    $MAX_MATCH, bestlen(%esp)
-               movl    %ecx, dsMatchStart(%edx)
-
-/* if ((uInt)best_len <= s->lookahead) return (uInt)best_len;          */
-/* return s->lookahead;                                                        */
-
-LeaveNow:
-               movl    deflatestate(%esp), %edx
-               movl    bestlen(%esp), %ebx
-               movl    dsLookahead(%edx), %eax
-               cmpl    %eax, %ebx
-               jg      LookaheadRet
-               movl    %ebx, %eax
-LookaheadRet:
-
-/* Restore the stack and return from whence we came.                   */
-
-               addl    $LocalVarsSize, %esp
-               popl    %ebx
-               popl    %esi
-               popl    %edi
-               popl    %ebp
-match_init:    ret
diff --git a/lib/zlib/contrib/asm686/README.686 b/lib/zlib/contrib/asm686/README.686
deleted file mode 100644 (file)
index a593f23..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-This is a patched version of zlib, modified to use
-Pentium-Pro-optimized assembly code in the deflation algorithm. The
-files changed/added by this patch are:
-
-README.686
-match.S
-
-The speedup that this patch provides varies, depending on whether the
-compiler used to build the original version of zlib falls afoul of the
-PPro's speed traps. My own tests show a speedup of around 10-20% at
-the default compression level, and 20-30% using -9, against a version
-compiled using gcc 2.7.2.3. Your mileage may vary.
-
-Note that this code has been tailored for the PPro/PII in particular,
-and will not perform particuarly well on a Pentium.
-
-If you are using an assembler other than GNU as, you will have to
-translate match.S to use your assembler's syntax. (Have fun.)
-
-Brian Raiter
-breadbox@muppetlabs.com
-April, 1998
-
-
-Added for zlib 1.1.3:
-
-The patches come from
-http://www.muppetlabs.com/~breadbox/software/assembly.html
-
-To compile zlib with this asm file, copy match.S to the zlib directory
-then do:
-
-CFLAGS="-O3 -DASMV" ./configure
-make OBJA=match.o
diff --git a/lib/zlib/contrib/asm686/match.S b/lib/zlib/contrib/asm686/match.S
deleted file mode 100644 (file)
index 8e86c33..0000000
+++ /dev/null
@@ -1,327 +0,0 @@
-/* match.s -- Pentium-Pro-optimized version of longest_match()
- * Written for zlib 1.1.2
- * Copyright (C) 1998 Brian Raiter <breadbox@muppetlabs.com>
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License.
- */
-
-#ifndef NO_UNDERLINE
-#define        match_init      _match_init
-#define        longest_match   _longest_match
-#endif
-
-#define        MAX_MATCH       (258)
-#define        MIN_MATCH       (3)
-#define        MIN_LOOKAHEAD   (MAX_MATCH + MIN_MATCH + 1)
-#define        MAX_MATCH_8     ((MAX_MATCH + 7) & ~7)
-
-/* stack frame offsets */
-
-#define        chainlenwmask           0       /* high word: current chain len */
-                                       /* low word: s->wmask           */
-#define        window                  4       /* local copy of s->window      */
-#define        windowbestlen           8       /* s->window + bestlen          */
-#define        scanstart               16      /* first two bytes of string    */
-#define        scanend                 12      /* last two bytes of string     */
-#define        scanalign               20      /* dword-misalignment of string */
-#define        nicematch               24      /* a good enough match size     */
-#define        bestlen                 28      /* size of best match so far    */
-#define        scan                    32      /* ptr to string wanting match  */
-
-#define        LocalVarsSize           (36)
-/*     saved ebx               36 */
-/*     saved edi               40 */
-/*     saved esi               44 */
-/*     saved ebp               48 */
-/*     return address          52 */
-#define        deflatestate            56      /* the function arguments       */
-#define        curmatch                60
-
-/* Offsets for fields in the deflate_state structure. These numbers
- * are calculated from the definition of deflate_state, with the
- * assumption that the compiler will dword-align the fields. (Thus,
- * changing the definition of deflate_state could easily cause this
- * program to crash horribly, without so much as a warning at
- * compile time. Sigh.)
- */
-#define        dsWSize                 36
-#define        dsWMask                 44
-#define        dsWindow                48
-#define        dsPrev                  56
-#define        dsMatchLen              88
-#define        dsPrevMatch             92
-#define        dsStrStart              100
-#define        dsMatchStart            104
-#define        dsLookahead             108
-#define        dsPrevLen               112
-#define        dsMaxChainLen           116
-#define        dsGoodMatch             132
-#define        dsNiceMatch             136
-
-
-.file "match.S"
-
-.globl match_init, longest_match
-
-.text
-
-/* uInt longest_match(deflate_state *deflatestate, IPos curmatch) */
-
-longest_match:
-
-/* Save registers that the compiler may be using, and adjust %esp to   */
-/* make room for our stack frame.                                      */
-
-               pushl   %ebp
-               pushl   %edi
-               pushl   %esi
-               pushl   %ebx
-               subl    $LocalVarsSize, %esp
-
-/* Retrieve the function arguments. %ecx will hold cur_match           */
-/* throughout the entire function. %edx will hold the pointer to the   */
-/* deflate_state structure during the function's setup (before         */
-/* entering the main loop).                                            */
-
-               movl    deflatestate(%esp), %edx
-               movl    curmatch(%esp), %ecx
-
-/* uInt wmask = s->w_mask;                                             */
-/* unsigned chain_length = s->max_chain_length;                                */
-/* if (s->prev_length >= s->good_match) {                              */
-/*     chain_length >>= 2;                                             */
-/* }                                                                   */
-
-               movl    dsPrevLen(%edx), %eax
-               movl    dsGoodMatch(%edx), %ebx
-               cmpl    %ebx, %eax
-               movl    dsWMask(%edx), %eax
-               movl    dsMaxChainLen(%edx), %ebx
-               jl      LastMatchGood
-               shrl    $2, %ebx
-LastMatchGood:
-
-/* chainlen is decremented once beforehand so that the function can    */
-/* use the sign flag instead of the zero flag for the exit test.       */
-/* It is then shifted into the high word, to make room for the wmask   */
-/* value, which it will always accompany.                              */
-
-               decl    %ebx
-               shll    $16, %ebx
-               orl     %eax, %ebx
-               movl    %ebx, chainlenwmask(%esp)
-
-/* if ((uInt)nice_match > s->lookahead) nice_match = s->lookahead;     */
-
-               movl    dsNiceMatch(%edx), %eax
-               movl    dsLookahead(%edx), %ebx
-               cmpl    %eax, %ebx
-               jl      LookaheadLess
-               movl    %eax, %ebx
-LookaheadLess: movl    %ebx, nicematch(%esp)
-
-/* register Bytef *scan = s->window + s->strstart;                     */
-
-               movl    dsWindow(%edx), %esi
-               movl    %esi, window(%esp)
-               movl    dsStrStart(%edx), %ebp
-               lea     (%esi,%ebp), %edi
-               movl    %edi, scan(%esp)
-
-/* Determine how many bytes the scan ptr is off from being             */
-/* dword-aligned.                                                      */
-
-               movl    %edi, %eax
-               negl    %eax
-               andl    $3, %eax
-               movl    %eax, scanalign(%esp)
-
-/* IPos limit = s->strstart > (IPos)MAX_DIST(s) ?                      */
-/*     s->strstart - (IPos)MAX_DIST(s) : NIL;                          */
-
-               movl    dsWSize(%edx), %eax
-               subl    $MIN_LOOKAHEAD, %eax
-               subl    %eax, %ebp
-               jg      LimitPositive
-               xorl    %ebp, %ebp
-LimitPositive:
-
-/* int best_len = s->prev_length;                                      */
-
-               movl    dsPrevLen(%edx), %eax
-               movl    %eax, bestlen(%esp)
-
-/* Store the sum of s->window + best_len in %esi locally, and in %esi. */
-
-               addl    %eax, %esi
-               movl    %esi, windowbestlen(%esp)
-
-/* register ush scan_start = *(ushf*)scan;                             */
-/* register ush scan_end   = *(ushf*)(scan+best_len-1);                        */
-/* Posf *prev = s->prev;                                               */
-
-               movzwl  (%edi), %ebx
-               movl    %ebx, scanstart(%esp)
-               movzwl  -1(%edi,%eax), %ebx
-               movl    %ebx, scanend(%esp)
-               movl    dsPrev(%edx), %edi
-
-/* Jump into the main loop.                                            */
-
-               movl    chainlenwmask(%esp), %edx
-               jmp     LoopEntry
-
-.balign 16
-
-/* do {
- *     match = s->window + cur_match;
- *     if (*(ushf*)(match+best_len-1) != scan_end ||
- *         *(ushf*)match != scan_start) continue;
- *     [...]
- * } while ((cur_match = prev[cur_match & wmask]) > limit
- *          && --chain_length != 0);
- *
- * Here is the inner loop of the function. The function will spend the
- * majority of its time in this loop, and majority of that time will
- * be spent in the first ten instructions.
- *
- * Within this loop:
- * %ebx = scanend
- * %ecx = curmatch
- * %edx = chainlenwmask - i.e., ((chainlen << 16) | wmask)
- * %esi = windowbestlen - i.e., (window + bestlen)
- * %edi = prev
- * %ebp = limit
- */
-LookupLoop:
-               andl    %edx, %ecx
-               movzwl  (%edi,%ecx,2), %ecx
-               cmpl    %ebp, %ecx
-               jbe     LeaveNow
-               subl    $0x00010000, %edx
-               js      LeaveNow
-LoopEntry:     movzwl  -1(%esi,%ecx), %eax
-               cmpl    %ebx, %eax
-               jnz     LookupLoop
-               movl    window(%esp), %eax
-               movzwl  (%eax,%ecx), %eax
-               cmpl    scanstart(%esp), %eax
-               jnz     LookupLoop
-
-/* Store the current value of chainlen.                                        */
-
-               movl    %edx, chainlenwmask(%esp)
-
-/* Point %edi to the string under scrutiny, and %esi to the string we  */
-/* are hoping to match it up with. In actuality, %esi and %edi are     */
-/* both pointed (MAX_MATCH_8 - scanalign) bytes ahead, and %edx is     */
-/* initialized to -(MAX_MATCH_8 - scanalign).                          */
-
-               movl    window(%esp), %esi
-               movl    scan(%esp), %edi
-               addl    %ecx, %esi
-               movl    scanalign(%esp), %eax
-               movl    $(-MAX_MATCH_8), %edx
-               lea     MAX_MATCH_8(%edi,%eax), %edi
-               lea     MAX_MATCH_8(%esi,%eax), %esi
-
-/* Test the strings for equality, 8 bytes at a time. At the end,
- * adjust %edx so that it is offset to the exact byte that mismatched.
- *
- * We already know at this point that the first three bytes of the
- * strings match each other, and they can be safely passed over before
- * starting the compare loop. So what this code does is skip over 0-3
- * bytes, as much as necessary in order to dword-align the %edi
- * pointer. (%esi will still be misaligned three times out of four.)
- *
- * It should be confessed that this loop usually does not represent
- * much of the total running time. Replacing it with a more
- * straightforward "rep cmpsb" would not drastically degrade
- * performance.
- */
-LoopCmps:
-               movl    (%esi,%edx), %eax
-               xorl    (%edi,%edx), %eax
-               jnz     LeaveLoopCmps
-               movl    4(%esi,%edx), %eax
-               xorl    4(%edi,%edx), %eax
-               jnz     LeaveLoopCmps4
-               addl    $8, %edx
-               jnz     LoopCmps
-               jmp     LenMaximum
-LeaveLoopCmps4:        addl    $4, %edx
-LeaveLoopCmps: testl   $0x0000FFFF, %eax
-               jnz     LenLower
-               addl    $2, %edx
-               shrl    $16, %eax
-LenLower:      subb    $1, %al
-               adcl    $0, %edx
-
-/* Calculate the length of the match. If it is longer than MAX_MATCH,  */
-/* then automatically accept it as the best possible match and leave.  */
-
-               lea     (%edi,%edx), %eax
-               movl    scan(%esp), %edi
-               subl    %edi, %eax
-               cmpl    $MAX_MATCH, %eax
-               jge     LenMaximum
-
-/* If the length of the match is not longer than the best match we     */
-/* have so far, then forget it and return to the lookup loop.          */
-
-               movl    deflatestate(%esp), %edx
-               movl    bestlen(%esp), %ebx
-               cmpl    %ebx, %eax
-               jg      LongerMatch
-               movl    windowbestlen(%esp), %esi
-               movl    dsPrev(%edx), %edi
-               movl    scanend(%esp), %ebx
-               movl    chainlenwmask(%esp), %edx
-               jmp     LookupLoop
-
-/*         s->match_start = cur_match;                                 */
-/*         best_len = len;                                             */
-/*         if (len >= nice_match) break;                               */
-/*         scan_end = *(ushf*)(scan+best_len-1);                       */
-
-LongerMatch:   movl    nicematch(%esp), %ebx
-               movl    %eax, bestlen(%esp)
-               movl    %ecx, dsMatchStart(%edx)
-               cmpl    %ebx, %eax
-               jge     LeaveNow
-               movl    window(%esp), %esi
-               addl    %eax, %esi
-               movl    %esi, windowbestlen(%esp)
-               movzwl  -1(%edi,%eax), %ebx
-               movl    dsPrev(%edx), %edi
-               movl    %ebx, scanend(%esp)
-               movl    chainlenwmask(%esp), %edx
-               jmp     LookupLoop
-
-/* Accept the current string, with the maximum possible length.                */
-
-LenMaximum:    movl    deflatestate(%esp), %edx
-               movl    $MAX_MATCH, bestlen(%esp)
-               movl    %ecx, dsMatchStart(%edx)
-
-/* if ((uInt)best_len <= s->lookahead) return (uInt)best_len;          */
-/* return s->lookahead;                                                        */
-
-LeaveNow:
-               movl    deflatestate(%esp), %edx
-               movl    bestlen(%esp), %ebx
-               movl    dsLookahead(%edx), %eax
-               cmpl    %eax, %ebx
-               jg      LookaheadRet
-               movl    %ebx, %eax
-LookaheadRet:
-
-/* Restore the stack and return from whence we came.                   */
-
-               addl    $LocalVarsSize, %esp
-               popl    %ebx
-               popl    %esi
-               popl    %edi
-               popl    %ebp
-match_init:    ret
diff --git a/lib/zlib/contrib/delphi/zlib.mak b/lib/zlib/contrib/delphi/zlib.mak
deleted file mode 100644 (file)
index ba557e2..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-# Makefile for zlib32bd.lib
-# ------------- Borland C++ 4.5 -------------
-
-# The (32-bit) zlib32bd.lib made with this makefile is intended for use 
-# in making the (32-bit) DLL, png32bd.dll. It uses the "stdcall" calling 
-# convention.
-
-CFLAGS= -ps -O2 -C -K -N- -k- -d -3 -r- -w-par -w-aus -WDE
-CC=f:\bc45\bin\bcc32
-LIBFLAGS= /C
-LIB=f:\bc45\bin\tlib
-ZLIB=zlib32bd.lib
-
-.autodepend
-.c.obj:
-        $(CC) -c $(CFLAGS) $<
-
-OBJ1=adler32.obj compress.obj crc32.obj deflate.obj gzio.obj infblock.obj 
-OBJ2=infcodes.obj inflate.obj inftrees.obj infutil.obj inffast.obj 
-OBJ3=trees.obj uncompr.obj zutil.obj
-pOBJ1=+adler32.obj+compress.obj+crc32.obj+deflate.obj+gzio.obj+infblock.obj 
-pOBJ2=+infcodes.obj+inflate.obj+inftrees.obj+infutil.obj+inffast.obj 
-pOBJ3=+trees.obj+uncompr.obj+zutil.obj
-
-all: $(ZLIB)
-
-$(ZLIB): $(OBJ1) $(OBJ2) $(OBJ3)
-        @if exist $@ del $@
-        $(LIB) @&&|
-$@ $(LIBFLAGS) &
-$(pOBJ1) &
-$(pOBJ2) &
-$(pOBJ3)
-|
-
-# End of makefile for zlib32bd.lib
diff --git a/lib/zlib/contrib/delphi/zlibdef.pas b/lib/zlib/contrib/delphi/zlibdef.pas
deleted file mode 100644 (file)
index 4f96b7d..0000000
+++ /dev/null
@@ -1,169 +0,0 @@
-unit zlibdef;
-
-interface
-
-uses
-  Windows;
-
-const
-  ZLIB_VERSION = '1.1.3';
-
-type
-  voidpf = Pointer;
-  int    = Integer;
-  uInt   = Cardinal;
-  pBytef = PChar;
-  uLong  = Cardinal;
-
-  alloc_func = function(opaque: voidpf; items, size: uInt): voidpf;
-                    stdcall;
-  free_func  = procedure(opaque, address: voidpf);
-                    stdcall;
-
-  internal_state = Pointer;
-
-  z_streamp = ^z_stream;
-  z_stream = packed record
-    next_in: pBytef;          // next input byte
-    avail_in: uInt;           // number of bytes available at next_in
-    total_in: uLong;          // total nb of input bytes read so far
-
-    next_out: pBytef;         // next output byte should be put there
-    avail_out: uInt;          // remaining free space at next_out
-    total_out: uLong;         // total nb of bytes output so far
-
-    msg: PChar;               // last error message, NULL if no error
-    state: internal_state;    // not visible by applications
-
-    zalloc: alloc_func;       // used to allocate the internal state
-    zfree: free_func;         // used to free the internal state
-    opaque: voidpf;           // private data object passed to zalloc and zfree
-
-    data_type: int;           // best guess about the data type: ascii or binary
-    adler: uLong;             // adler32 value of the uncompressed data
-    reserved: uLong;          // reserved for future use
-    end;
-
-const
-  Z_NO_FLUSH      = 0;
-  Z_SYNC_FLUSH    = 2;
-  Z_FULL_FLUSH    = 3;
-  Z_FINISH        = 4;
-
-  Z_OK            = 0;
-  Z_STREAM_END    = 1;
-
-  Z_NO_COMPRESSION         =  0;
-  Z_BEST_SPEED             =  1;
-  Z_BEST_COMPRESSION       =  9;
-  Z_DEFAULT_COMPRESSION    = -1;
-
-  Z_FILTERED            = 1;
-  Z_HUFFMAN_ONLY        = 2;
-  Z_DEFAULT_STRATEGY    = 0;
-
-  Z_BINARY   = 0;
-  Z_ASCII    = 1;
-  Z_UNKNOWN  = 2;
-
-  Z_DEFLATED    = 8;
-
-  MAX_MEM_LEVEL = 9;
-
-function adler32(adler: uLong; const buf: pBytef; len: uInt): uLong;
-             stdcall;
-function crc32(crc: uLong; const buf: pBytef; len: uInt): uLong;
-             stdcall;
-function deflate(strm: z_streamp; flush: int): int;
-             stdcall;
-function deflateCopy(dest, source: z_streamp): int;
-             stdcall;
-function deflateEnd(strm: z_streamp): int;
-             stdcall;
-function deflateInit2_(strm: z_streamp; level, method,
-                       windowBits, memLevel, strategy: int;
-                       const version: PChar; stream_size: int): int;
-             stdcall;
-function deflateInit_(strm: z_streamp; level: int;
-                      const version: PChar; stream_size: int): int;
-             stdcall;
-function deflateParams(strm: z_streamp; level, strategy: int): int;
-             stdcall;
-function deflateReset(strm: z_streamp): int;
-             stdcall;
-function deflateSetDictionary(strm: z_streamp;
-                              const dictionary: pBytef;
-                              dictLength: uInt): int;
-             stdcall;
-function inflate(strm: z_streamp; flush: int): int;
-             stdcall;
-function inflateEnd(strm: z_streamp): int;
-             stdcall;
-function inflateInit2_(strm: z_streamp; windowBits: int;
-                       const version: PChar; stream_size: int): int;
-             stdcall;
-function inflateInit_(strm: z_streamp; const version: PChar;
-                      stream_size: int): int;
-             stdcall;
-function inflateReset(strm: z_streamp): int;
-             stdcall;
-function inflateSetDictionary(strm: z_streamp;
-                              const dictionary: pBytef;
-                              dictLength: uInt): int;
-             stdcall;
-function inflateSync(strm: z_streamp): int;
-             stdcall;
-
-function deflateInit(strm: z_streamp; level: int): int;
-function deflateInit2(strm: z_streamp; level, method, windowBits,
-                      memLevel, strategy: int): int;
-function inflateInit(strm: z_streamp): int;
-function inflateInit2(strm: z_streamp; windowBits: int): int;
-
-implementation
-
-function deflateInit(strm: z_streamp; level: int): int;
-begin
-  Result := deflateInit_(strm, level, ZLIB_VERSION, sizeof(z_stream));
-end;
-
-function deflateInit2(strm: z_streamp; level, method, windowBits,
-                      memLevel, strategy: int): int;
-begin
-  Result := deflateInit2_(strm, level, method, windowBits, memLevel,
-                          strategy, ZLIB_VERSION, sizeof(z_stream));
-end;
-
-function inflateInit(strm: z_streamp): int;
-begin
-  Result := inflateInit_(strm, ZLIB_VERSION, sizeof(z_stream));
-end;
-
-function inflateInit2(strm: z_streamp; windowBits: int): int;
-begin
-  Result := inflateInit2_(strm, windowBits, ZLIB_VERSION,
-                          sizeof(z_stream));
-end;
-
-const
-  zlibDLL = 'png32bd.dll';
-
-function adler32; external zlibDLL;
-function crc32; external zlibDLL;
-function deflate; external zlibDLL;
-function deflateCopy; external zlibDLL;
-function deflateEnd; external zlibDLL;
-function deflateInit2_; external zlibDLL;
-function deflateInit_; external zlibDLL;
-function deflateParams; external zlibDLL;
-function deflateReset; external zlibDLL;
-function deflateSetDictionary; external zlibDLL;
-function inflate; external zlibDLL;
-function inflateEnd; external zlibDLL;
-function inflateInit2_; external zlibDLL;
-function inflateInit_; external zlibDLL;
-function inflateReset; external zlibDLL;
-function inflateSetDictionary; external zlibDLL;
-function inflateSync; external zlibDLL;
-
-end.
diff --git a/lib/zlib/contrib/delphi2/d_zlib.bpr b/lib/zlib/contrib/delphi2/d_zlib.bpr
deleted file mode 100644 (file)
index 78bb254..0000000
+++ /dev/null
@@ -1,224 +0,0 @@
-# ---------------------------------------------------------------------------
-!if !$d(BCB)
-BCB = $(MAKEDIR)\..
-!endif
-
-# ---------------------------------------------------------------------------
-# IDE SECTION
-# ---------------------------------------------------------------------------
-# The following section of the project makefile is managed by the BCB IDE.
-# It is recommended to use the IDE to change any of the values in this
-# section.
-# ---------------------------------------------------------------------------
-
-VERSION = BCB.03
-# ---------------------------------------------------------------------------
-PROJECT = d_zlib.lib
-OBJFILES = d_zlib.obj adler32.obj deflate.obj infblock.obj infcodes.obj inffast.obj \
-  inflate.obj inftrees.obj infutil.obj trees.obj
-RESFILES =
-RESDEPEN = $(RESFILES)
-LIBFILES =
-LIBRARIES = VCL35.lib
-SPARELIBS = VCL35.lib
-DEFFILE =
-PACKAGES = VCLX35.bpi VCL35.bpi VCLDB35.bpi VCLDBX35.bpi ibsmp35.bpi bcbsmp35.bpi \
-  dclocx35.bpi QRPT35.bpi TEEUI35.bpi TEEDB35.bpi TEE35.bpi DSS35.bpi \
-  NMFAST35.bpi INETDB35.bpi INET35.bpi VCLMID35.bpi
-# ---------------------------------------------------------------------------
-PATHCPP = .;
-PATHASM = .;
-PATHPAS = .;
-PATHRC = .;
-DEBUGLIBPATH = $(BCB)\lib\debug
-RELEASELIBPATH = $(BCB)\lib\release
-# ---------------------------------------------------------------------------
-CFLAG1 = -O2 -Ve -d -k- -vi
-CFLAG2 = -I$(BCB)\include;$(BCB)\include\vcl -H=$(BCB)\lib\vcl35.csm
-CFLAG3 = -ff -pr -5
-PFLAGS = -U;$(DEBUGLIBPATH) -I$(BCB)\include;$(BCB)\include\vcl -H -W -$I- -v -JPHN -M
-RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl 
-AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn
-LFLAGS =
-IFLAGS = -g -Gn
-# ---------------------------------------------------------------------------
-ALLOBJ = c0w32.obj $(OBJFILES)
-ALLRES = $(RESFILES)
-ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mt.lib
-# ---------------------------------------------------------------------------
-!!ifdef IDEOPTIONS
-
-[Version Info]
-IncludeVerInfo=0
-AutoIncBuild=0
-MajorVer=1
-MinorVer=0
-Release=0
-Build=0
-Debug=0
-PreRelease=0
-Special=0
-Private=0
-DLL=0
-Locale=1040
-CodePage=1252
-
-[Version Info Keys]
-CompanyName=
-FileDescription=
-FileVersion=1.0.0.0
-InternalName=
-LegalCopyright=
-LegalTrademarks=
-OriginalFilename=
-ProductName=
-ProductVersion=1.0.0.0
-Comments=
-
-[HistoryLists\hlIncludePath]
-Count=2
-Item0=$(BCB)\include
-Item1=$(BCB)\include;$(BCB)\include\vcl
-
-[HistoryLists\hlLibraryPath]
-Count=1
-Item0=$(BCB)\lib\obj;$(BCB)\lib
-
-[HistoryLists\hlDebugSourcePath]
-Count=1
-Item0=$(BCB)\source\vcl
-
-[Debugging]
-DebugSourceDirs=
-
-[Parameters]
-RunParams=
-HostApplication=
-
-!endif
-
- ---------------------------------------------------------------------------
-# MAKE SECTION
-# ---------------------------------------------------------------------------
-# This section of the project file is not used by the BCB IDE.  It is for
-# the benefit of building from the command-line using the MAKE utility.
-# ---------------------------------------------------------------------------
-
-.autodepend
-# ---------------------------------------------------------------------------
-!if !$d(BCC32)
-BCC32 = bcc32
-!endif
-
-!if !$d(DCC32)
-DCC32 = dcc32
-!endif
-
-!if !$d(TASM32)
-TASM32 = tasm32
-!endif
-
-!if !$d(LINKER)
-LINKER = TLib
-!endif
-
-!if !$d(BRCC32)
-BRCC32 = brcc32
-!endif
-# ---------------------------------------------------------------------------
-!if $d(PATHCPP)
-.PATH.CPP = $(PATHCPP)
-.PATH.C   = $(PATHCPP)
-!endif
-
-!if $d(PATHPAS)
-.PATH.PAS = $(PATHPAS)
-!endif
-
-!if $d(PATHASM)
-.PATH.ASM = $(PATHASM)
-!endif
-
-!if $d(PATHRC)
-.PATH.RC  = $(PATHRC)
-!endif
-# ---------------------------------------------------------------------------
-!ifdef IDEOPTIONS
-
-[Version Info]
-IncludeVerInfo=0
-AutoIncBuild=0
-MajorVer=1
-MinorVer=0
-Release=0
-Build=0
-Debug=0
-PreRelease=0
-Special=0
-Private=0
-DLL=0
-Locale=1040
-CodePage=1252
-
-[Version Info Keys]
-CompanyName=
-FileDescription=
-FileVersion=1.0.0.0
-InternalName=
-LegalCopyright=
-LegalTrademarks=
-OriginalFilename=
-ProductName=
-ProductVersion=1.0.0.0
-Comments=
-
-[HistoryLists\hlIncludePath]
-Count=2
-Item0=$(BCB)\include;$(BCB)\include\vcl
-Item1=$(BCB)\include
-
-[HistoryLists\hlLibraryPath]
-Count=1
-Item0=$(BCB)\lib\obj;$(BCB)\lib
-
-[HistoryLists\hlDebugSourcePath]
-Count=1
-Item0=$(BCB)\source\vcl
-
-[Debugging]
-DebugSourceDirs=
-
-[Parameters]
-RunParams=
-HostApplication=
-
-!endif
-
-$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE)
-    $(BCB)\BIN\$(LINKER) @&&!
-    $(LFLAGS) $(IFLAGS) +
-    $(ALLOBJ), +
-    $(PROJECT),, +
-    $(ALLLIB), +
-    $(DEFFILE), +
-    $(ALLRES)
-!
-# ---------------------------------------------------------------------------
-.pas.hpp:
-    $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< }
-
-.pas.obj:
-    $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< }
-
-.cpp.obj:
-    $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< }
-
-.c.obj:
-    $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< }
-
-.asm.obj:
-    $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@
-
-.rc.res:
-    $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $<
-# ---------------------------------------------------------------------------
diff --git a/lib/zlib/contrib/delphi2/d_zlib.cpp b/lib/zlib/contrib/delphi2/d_zlib.cpp
deleted file mode 100644 (file)
index f5dea59..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-#include <condefs.h>
-#pragma hdrstop
-//---------------------------------------------------------------------------
-USEUNIT("adler32.c");
-USEUNIT("deflate.c");
-USEUNIT("infblock.c");
-USEUNIT("infcodes.c");
-USEUNIT("inffast.c");
-USEUNIT("inflate.c");
-USEUNIT("inftrees.c");
-USEUNIT("infutil.c");
-USEUNIT("trees.c");
-//---------------------------------------------------------------------------
-#define Library
-
-// To add a file to the library use the Project menu 'Add to Project'.
-
diff --git a/lib/zlib/contrib/delphi2/readme.txt b/lib/zlib/contrib/delphi2/readme.txt
deleted file mode 100644 (file)
index cbd3162..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-These are files used to compile zlib under Borland C++ Builder 3.
-
-zlib.bpg is the main project group that can be loaded in the BCB IDE and
-loads all other *.bpr projects
-
-zlib.bpr is a project used to create a static zlib.lib library with C calling
-convention for functions.
-
-zlib32.bpr creates a zlib32.dll dynamic link library with Windows standard
-calling convention.
-
-d_zlib.bpr creates a set of .obj files with register calling convention.
-These files are used by zlib.pas to create a Delphi unit containing zlib.
-The d_zlib.lib file generated isn't useful and can be deleted.
-
-zlib.cpp, zlib32.cpp and d_zlib.cpp are used by the above projects.
-
diff --git a/lib/zlib/contrib/delphi2/zlib.bpg b/lib/zlib/contrib/delphi2/zlib.bpg
deleted file mode 100644 (file)
index b6c9acd..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-#------------------------------------------------------------------------------
-VERSION = BWS.01
-#------------------------------------------------------------------------------
-!ifndef ROOT
-ROOT = $(MAKEDIR)\..
-!endif
-#------------------------------------------------------------------------------
-MAKE = $(ROOT)\bin\make.exe -$(MAKEFLAGS) -f$**
-DCC = $(ROOT)\bin\dcc32.exe $**
-BRCC = $(ROOT)\bin\brcc32.exe $**
-#------------------------------------------------------------------------------
-PROJECTS = zlib zlib32 d_zlib
-#------------------------------------------------------------------------------
-default: $(PROJECTS)
-#------------------------------------------------------------------------------
-
-zlib: zlib.bpr
-  $(MAKE)
-
-zlib32: zlib32.bpr
-  $(MAKE)
-
-d_zlib: d_zlib.bpr
-  $(MAKE)
-
-
diff --git a/lib/zlib/contrib/delphi2/zlib.bpr b/lib/zlib/contrib/delphi2/zlib.bpr
deleted file mode 100644 (file)
index cf3945b..0000000
+++ /dev/null
@@ -1,225 +0,0 @@
-# ---------------------------------------------------------------------------
-!if !$d(BCB)
-BCB = $(MAKEDIR)\..
-!endif
-
-# ---------------------------------------------------------------------------
-# IDE SECTION
-# ---------------------------------------------------------------------------
-# The following section of the project makefile is managed by the BCB IDE.
-# It is recommended to use the IDE to change any of the values in this
-# section.
-# ---------------------------------------------------------------------------
-
-VERSION = BCB.03
-# ---------------------------------------------------------------------------
-PROJECT = zlib.lib
-OBJFILES = zlib.obj adler32.obj compress.obj crc32.obj deflate.obj gzio.obj infblock.obj \
-  infcodes.obj inffast.obj inflate.obj inftrees.obj infutil.obj trees.obj \
-  uncompr.obj zutil.obj
-RESFILES =
-RESDEPEN = $(RESFILES)
-LIBFILES =
-LIBRARIES = VCL35.lib
-SPARELIBS = VCL35.lib
-DEFFILE =
-PACKAGES = VCLX35.bpi VCL35.bpi VCLDB35.bpi VCLDBX35.bpi ibsmp35.bpi bcbsmp35.bpi \
-  dclocx35.bpi QRPT35.bpi TEEUI35.bpi TEEDB35.bpi TEE35.bpi DSS35.bpi \
-  NMFAST35.bpi INETDB35.bpi INET35.bpi VCLMID35.bpi
-# ---------------------------------------------------------------------------
-PATHCPP = .;
-PATHASM = .;
-PATHPAS = .;
-PATHRC = .;
-DEBUGLIBPATH = $(BCB)\lib\debug
-RELEASELIBPATH = $(BCB)\lib\release
-# ---------------------------------------------------------------------------
-CFLAG1 = -O2 -Ve -d -k- -vi
-CFLAG2 = -I$(BCB)\include;$(BCB)\include\vcl -H=$(BCB)\lib\vcl35.csm
-CFLAG3 = -ff -5
-PFLAGS = -U;$(DEBUGLIBPATH) -I$(BCB)\include;$(BCB)\include\vcl -H -W -$I- -v -JPHN -M
-RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl 
-AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn
-LFLAGS =
-IFLAGS = -g -Gn
-# ---------------------------------------------------------------------------
-ALLOBJ = c0w32.obj $(OBJFILES)
-ALLRES = $(RESFILES)
-ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mt.lib
-# ---------------------------------------------------------------------------
-!!ifdef IDEOPTIONS
-
-[Version Info]
-IncludeVerInfo=0
-AutoIncBuild=0
-MajorVer=1
-MinorVer=0
-Release=0
-Build=0
-Debug=0
-PreRelease=0
-Special=0
-Private=0
-DLL=0
-Locale=1040
-CodePage=1252
-
-[Version Info Keys]
-CompanyName=
-FileDescription=
-FileVersion=1.0.0.0
-InternalName=
-LegalCopyright=
-LegalTrademarks=
-OriginalFilename=
-ProductName=
-ProductVersion=1.0.0.0
-Comments=
-
-[HistoryLists\hlIncludePath]
-Count=2
-Item0=$(BCB)\include
-Item1=$(BCB)\include;$(BCB)\include\vcl
-
-[HistoryLists\hlLibraryPath]
-Count=1
-Item0=$(BCB)\lib\obj;$(BCB)\lib
-
-[HistoryLists\hlDebugSourcePath]
-Count=1
-Item0=$(BCB)\source\vcl
-
-[Debugging]
-DebugSourceDirs=
-
-[Parameters]
-RunParams=
-HostApplication=
-
-!endif
-
- ---------------------------------------------------------------------------
-# MAKE SECTION
-# ---------------------------------------------------------------------------
-# This section of the project file is not used by the BCB IDE.  It is for
-# the benefit of building from the command-line using the MAKE utility.
-# ---------------------------------------------------------------------------
-
-.autodepend
-# ---------------------------------------------------------------------------
-!if !$d(BCC32)
-BCC32 = bcc32
-!endif
-
-!if !$d(DCC32)
-DCC32 = dcc32
-!endif
-
-!if !$d(TASM32)
-TASM32 = tasm32
-!endif
-
-!if !$d(LINKER)
-LINKER = TLib
-!endif
-
-!if !$d(BRCC32)
-BRCC32 = brcc32
-!endif
-# ---------------------------------------------------------------------------
-!if $d(PATHCPP)
-.PATH.CPP = $(PATHCPP)
-.PATH.C   = $(PATHCPP)
-!endif
-
-!if $d(PATHPAS)
-.PATH.PAS = $(PATHPAS)
-!endif
-
-!if $d(PATHASM)
-.PATH.ASM = $(PATHASM)
-!endif
-
-!if $d(PATHRC)
-.PATH.RC  = $(PATHRC)
-!endif
-# ---------------------------------------------------------------------------
-!ifdef IDEOPTIONS
-
-[Version Info]
-IncludeVerInfo=0
-AutoIncBuild=0
-MajorVer=1
-MinorVer=0
-Release=0
-Build=0
-Debug=0
-PreRelease=0
-Special=0
-Private=0
-DLL=0
-Locale=1040
-CodePage=1252
-
-[Version Info Keys]
-CompanyName=
-FileDescription=
-FileVersion=1.0.0.0
-InternalName=
-LegalCopyright=
-LegalTrademarks=
-OriginalFilename=
-ProductName=
-ProductVersion=1.0.0.0
-Comments=
-
-[HistoryLists\hlIncludePath]
-Count=2
-Item0=$(BCB)\include;$(BCB)\include\vcl
-Item1=$(BCB)\include
-
-[HistoryLists\hlLibraryPath]
-Count=1
-Item0=$(BCB)\lib\obj;$(BCB)\lib
-
-[HistoryLists\hlDebugSourcePath]
-Count=1
-Item0=$(BCB)\source\vcl
-
-[Debugging]
-DebugSourceDirs=
-
-[Parameters]
-RunParams=
-HostApplication=
-
-!endif
-
-$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE)
-    $(BCB)\BIN\$(LINKER) @&&!
-    $(LFLAGS) $(IFLAGS) +
-    $(ALLOBJ), +
-    $(PROJECT),, +
-    $(ALLLIB), +
-    $(DEFFILE), +
-    $(ALLRES)
-!
-# ---------------------------------------------------------------------------
-.pas.hpp:
-    $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< }
-
-.pas.obj:
-    $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< }
-
-.cpp.obj:
-    $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< }
-
-.c.obj:
-    $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< }
-
-.asm.obj:
-    $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@
-
-.rc.res:
-    $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $<
-# ---------------------------------------------------------------------------
diff --git a/lib/zlib/contrib/delphi2/zlib.cpp b/lib/zlib/contrib/delphi2/zlib.cpp
deleted file mode 100644 (file)
index bf6953b..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-#include <condefs.h>
-#pragma hdrstop
-//---------------------------------------------------------------------------
-USEUNIT("adler32.c");
-USEUNIT("compress.c");
-USEUNIT("crc32.c");
-USEUNIT("deflate.c");
-USEUNIT("gzio.c");
-USEUNIT("infblock.c");
-USEUNIT("infcodes.c");
-USEUNIT("inffast.c");
-USEUNIT("inflate.c");
-USEUNIT("inftrees.c");
-USEUNIT("infutil.c");
-USEUNIT("trees.c");
-USEUNIT("uncompr.c");
-USEUNIT("zutil.c");
-//---------------------------------------------------------------------------
-#define Library
-
-// To add a file to the library use the Project menu 'Add to Project'.
-
diff --git a/lib/zlib/contrib/delphi2/zlib.pas b/lib/zlib/contrib/delphi2/zlib.pas
deleted file mode 100644 (file)
index 10ae4ca..0000000
+++ /dev/null
@@ -1,534 +0,0 @@
-{*******************************************************}
-{                                                       }
-{       Delphi Supplemental Components                  }
-{       ZLIB Data Compression Interface Unit            }
-{                                                       }
-{       Copyright (c) 1997 Borland International        }
-{                                                       }
-{*******************************************************}
-
-{ Modified for zlib 1.1.3 by Davide Moretti <dave@rimini.com }
-
-unit zlib;
-
-interface
-
-uses Sysutils, Classes;
-
-type
-  TAlloc = function (AppData: Pointer; Items, Size: Integer): Pointer;
-  TFree = procedure (AppData, Block: Pointer);
-
-  // Internal structure.  Ignore.
-  TZStreamRec = packed record
-    next_in: PChar;       // next input byte
-    avail_in: Integer;    // number of bytes available at next_in
-    total_in: Integer;    // total nb of input bytes read so far
-
-    next_out: PChar;      // next output byte should be put here
-    avail_out: Integer;   // remaining free space at next_out
-    total_out: Integer;   // total nb of bytes output so far
-
-    msg: PChar;           // last error message, NULL if no error
-    internal: Pointer;    // not visible by applications
-
-    zalloc: TAlloc;       // used to allocate the internal state
-    zfree: TFree;         // used to free the internal state
-    AppData: Pointer;     // private data object passed to zalloc and zfree
-
-    data_type: Integer;   //  best guess about the data type: ascii or binary
-    adler: Integer;       // adler32 value of the uncompressed data
-    reserved: Integer;    // reserved for future use
-  end;
-
-  // Abstract ancestor class
-  TCustomZlibStream = class(TStream)
-  private
-    FStrm: TStream;
-    FStrmPos: Integer;
-    FOnProgress: TNotifyEvent;
-    FZRec: TZStreamRec;
-    FBuffer: array [Word] of Char;
-  protected
-    procedure Progress(Sender: TObject); dynamic;
-    property OnProgress: TNotifyEvent read FOnProgress write FOnProgress;
-    constructor Create(Strm: TStream);
-  end;
-
-{ TCompressionStream compresses data on the fly as data is written to it, and
-  stores the compressed data to another stream.
-
-  TCompressionStream is write-only and strictly sequential. Reading from the
-  stream will raise an exception. Using Seek to move the stream pointer
-  will raise an exception.
-
-  Output data is cached internally, written to the output stream only when
-  the internal output buffer is full.  All pending output data is flushed
-  when the stream is destroyed.
-
-  The Position property returns the number of uncompressed bytes of
-  data that have been written to the stream so far.
-
-  CompressionRate returns the on-the-fly percentage by which the original
-  data has been compressed:  (1 - (CompressedBytes / UncompressedBytes)) * 100
-  If raw data size = 100 and compressed data size = 25, the CompressionRate
-  is 75%
-
-  The OnProgress event is called each time the output buffer is filled and
-  written to the output stream.  This is useful for updating a progress
-  indicator when you are writing a large chunk of data to the compression
-  stream in a single call.}
-
-
-  TCompressionLevel = (clNone, clFastest, clDefault, clMax);
-
-  TCompressionStream = class(TCustomZlibStream)
-  private
-    function GetCompressionRate: Single;
-  public
-    constructor Create(CompressionLevel: TCompressionLevel; Dest: TStream);
-    destructor Destroy; override;
-    function Read(var Buffer; Count: Longint): Longint; override;
-    function Write(const Buffer; Count: Longint): Longint; override;
-    function Seek(Offset: Longint; Origin: Word): Longint; override;
-    property CompressionRate: Single read GetCompressionRate;
-    property OnProgress;
-  end;
-
-{ TDecompressionStream decompresses data on the fly as data is read from it.
-
-  Compressed data comes from a separate source stream.  TDecompressionStream
-  is read-only and unidirectional; you can seek forward in the stream, but not
-  backwards.  The special case of setting the stream position to zero is
-  allowed.  Seeking forward decompresses data until the requested position in
-  the uncompressed data has been reached.  Seeking backwards, seeking relative
-  to the end of the stream, requesting the size of the stream, and writing to
-  the stream will raise an exception.
-
-  The Position property returns the number of bytes of uncompressed data that
-  have been read from the stream so far.
-
-  The OnProgress event is called each time the internal input buffer of
-  compressed data is exhausted and the next block is read from the input stream.
-  This is useful for updating a progress indicator when you are reading a
-  large chunk of data from the decompression stream in a single call.}
-
-  TDecompressionStream = class(TCustomZlibStream)
-  public
-    constructor Create(Source: TStream);
-    destructor Destroy; override;
-    function Read(var Buffer; Count: Longint): Longint; override;
-    function Write(const Buffer; Count: Longint): Longint; override;
-    function Seek(Offset: Longint; Origin: Word): Longint; override;
-    property OnProgress;
-  end;
-
-
-
-{ CompressBuf compresses data, buffer to buffer, in one call.
-   In: InBuf = ptr to compressed data
-       InBytes = number of bytes in InBuf
-  Out: OutBuf = ptr to newly allocated buffer containing decompressed data
-       OutBytes = number of bytes in OutBuf   }
-procedure CompressBuf(const InBuf: Pointer; InBytes: Integer;
-                      out OutBuf: Pointer; out OutBytes: Integer);
-
-
-{ DecompressBuf decompresses data, buffer to buffer, in one call.
-   In: InBuf = ptr to compressed data
-       InBytes = number of bytes in InBuf
-       OutEstimate = zero, or est. size of the decompressed data
-  Out: OutBuf = ptr to newly allocated buffer containing decompressed data
-       OutBytes = number of bytes in OutBuf   }
-procedure DecompressBuf(const InBuf: Pointer; InBytes: Integer;
- OutEstimate: Integer; out OutBuf: Pointer; out OutBytes: Integer);
-
-const
-  zlib_version = '1.1.3';
-
-type
-  EZlibError = class(Exception);
-  ECompressionError = class(EZlibError);
-  EDecompressionError = class(EZlibError);
-
-function adler32(adler: Integer; buf: PChar; len: Integer): Integer;
-
-implementation
-
-const
-  Z_NO_FLUSH      = 0;
-  Z_PARTIAL_FLUSH = 1;
-  Z_SYNC_FLUSH    = 2;
-  Z_FULL_FLUSH    = 3;
-  Z_FINISH        = 4;
-
-  Z_OK            = 0;
-  Z_STREAM_END    = 1;
-  Z_NEED_DICT     = 2;
-  Z_ERRNO         = (-1);
-  Z_STREAM_ERROR  = (-2);
-  Z_DATA_ERROR    = (-3);
-  Z_MEM_ERROR     = (-4);
-  Z_BUF_ERROR     = (-5);
-  Z_VERSION_ERROR = (-6);
-
-  Z_NO_COMPRESSION       =   0;
-  Z_BEST_SPEED           =   1;
-  Z_BEST_COMPRESSION     =   9;
-  Z_DEFAULT_COMPRESSION  = (-1);
-
-  Z_FILTERED            = 1;
-  Z_HUFFMAN_ONLY        = 2;
-  Z_DEFAULT_STRATEGY    = 0;
-
-  Z_BINARY   = 0;
-  Z_ASCII    = 1;
-  Z_UNKNOWN  = 2;
-
-  Z_DEFLATED = 8;
-
-  _z_errmsg: array[0..9] of PChar = (
-    'need dictionary',      // Z_NEED_DICT      (2)
-    'stream end',           // Z_STREAM_END     (1)
-    '',                     // Z_OK             (0)
-    'file error',           // Z_ERRNO          (-1)
-    'stream error',         // Z_STREAM_ERROR   (-2)
-    'data error',           // Z_DATA_ERROR     (-3)
-    'insufficient memory',  // Z_MEM_ERROR      (-4)
-    'buffer error',         // Z_BUF_ERROR      (-5)
-    'incompatible version', // Z_VERSION_ERROR  (-6)
-    ''
-  );
-
-{$L deflate.obj}
-{$L inflate.obj}
-{$L inftrees.obj}
-{$L trees.obj}
-{$L adler32.obj}
-{$L infblock.obj}
-{$L infcodes.obj}
-{$L infutil.obj}
-{$L inffast.obj}
-
-procedure _tr_init; external;
-procedure _tr_tally; external;
-procedure _tr_flush_block; external;
-procedure _tr_align; external;
-procedure _tr_stored_block; external;
-function adler32; external;
-procedure inflate_blocks_new; external;
-procedure inflate_blocks; external;
-procedure inflate_blocks_reset; external;
-procedure inflate_blocks_free; external;
-procedure inflate_set_dictionary; external;
-procedure inflate_trees_bits; external;
-procedure inflate_trees_dynamic; external;
-procedure inflate_trees_fixed; external;
-procedure inflate_codes_new; external;
-procedure inflate_codes; external;
-procedure inflate_codes_free; external;
-procedure _inflate_mask; external;
-procedure inflate_flush; external;
-procedure inflate_fast; external;
-
-procedure _memset(P: Pointer; B: Byte; count: Integer);cdecl;
-begin
-  FillChar(P^, count, B);
-end;
-
-procedure _memcpy(dest, source: Pointer; count: Integer);cdecl;
-begin
-  Move(source^, dest^, count);
-end;
-
-
-
-// deflate compresses data
-function deflateInit_(var strm: TZStreamRec; level: Integer; version: PChar;
-  recsize: Integer): Integer; external;
-function deflate(var strm: TZStreamRec; flush: Integer): Integer; external;
-function deflateEnd(var strm: TZStreamRec): Integer; external;
-
-// inflate decompresses data
-function inflateInit_(var strm: TZStreamRec; version: PChar;
-  recsize: Integer): Integer; external;
-function inflate(var strm: TZStreamRec; flush: Integer): Integer; external;
-function inflateEnd(var strm: TZStreamRec): Integer; external;
-function inflateReset(var strm: TZStreamRec): Integer; external;
-
-
-function zcalloc(AppData: Pointer; Items, Size: Integer): Pointer;
-begin
-  GetMem(Result, Items*Size);
-end;
-
-procedure zcfree(AppData, Block: Pointer);
-begin
-  FreeMem(Block);
-end;
-
-function zlibCheck(code: Integer): Integer;
-begin
-  Result := code;
-  if code < 0 then
-    raise EZlibError.Create('error');    //!!
-end;
-
-function CCheck(code: Integer): Integer;
-begin
-  Result := code;
-  if code < 0 then
-    raise ECompressionError.Create('error'); //!!
-end;
-
-function DCheck(code: Integer): Integer;
-begin
-  Result := code;
-  if code < 0 then
-    raise EDecompressionError.Create('error');  //!!
-end;
-
-procedure CompressBuf(const InBuf: Pointer; InBytes: Integer;
-                      out OutBuf: Pointer; out OutBytes: Integer);
-var
-  strm: TZStreamRec;
-  P: Pointer;
-begin
-  FillChar(strm, sizeof(strm), 0);
-  OutBytes := ((InBytes + (InBytes div 10) + 12) + 255) and not 255;
-  GetMem(OutBuf, OutBytes);
-  try
-    strm.next_in := InBuf;
-    strm.avail_in := InBytes;
-    strm.next_out := OutBuf;
-    strm.avail_out := OutBytes;
-    CCheck(deflateInit_(strm, Z_BEST_COMPRESSION, zlib_version, sizeof(strm)));
-    try
-      while CCheck(deflate(strm, Z_FINISH)) <> Z_STREAM_END do
-      begin
-        P := OutBuf;
-        Inc(OutBytes, 256);
-        ReallocMem(OutBuf, OutBytes);
-        strm.next_out := PChar(Integer(OutBuf) + (Integer(strm.next_out) - Integer(P)));
-        strm.avail_out := 256;
-      end;
-    finally
-      CCheck(deflateEnd(strm));
-    end;
-    ReallocMem(OutBuf, strm.total_out);
-    OutBytes := strm.total_out;
-  except
-    FreeMem(OutBuf);
-    raise
-  end;
-end;
-
-
-procedure DecompressBuf(const InBuf: Pointer; InBytes: Integer;
-  OutEstimate: Integer; out OutBuf: Pointer; out OutBytes: Integer);
-var
-  strm: TZStreamRec;
-  P: Pointer;
-  BufInc: Integer;
-begin
-  FillChar(strm, sizeof(strm), 0);
-  BufInc := (InBytes + 255) and not 255;
-  if OutEstimate = 0 then
-    OutBytes := BufInc
-  else
-    OutBytes := OutEstimate;
-  GetMem(OutBuf, OutBytes);
-  try
-    strm.next_in := InBuf;
-    strm.avail_in := InBytes;
-    strm.next_out := OutBuf;
-    strm.avail_out := OutBytes;
-    DCheck(inflateInit_(strm, zlib_version, sizeof(strm)));
-    try
-      while DCheck(inflate(strm, Z_FINISH)) <> Z_STREAM_END do
-      begin
-        P := OutBuf;
-        Inc(OutBytes, BufInc);
-        ReallocMem(OutBuf, OutBytes);
-        strm.next_out := PChar(Integer(OutBuf) + (Integer(strm.next_out) - Integer(P)));
-        strm.avail_out := BufInc;
-      end;
-    finally
-      DCheck(inflateEnd(strm));
-    end;
-    ReallocMem(OutBuf, strm.total_out);
-    OutBytes := strm.total_out;
-  except
-    FreeMem(OutBuf);
-    raise
-  end;
-end;
-
-
-// TCustomZlibStream
-
-constructor TCustomZLibStream.Create(Strm: TStream);
-begin
-  inherited Create;
-  FStrm := Strm;
-  FStrmPos := Strm.Position;
-end;
-
-procedure TCustomZLibStream.Progress(Sender: TObject);
-begin
-  if Assigned(FOnProgress) then FOnProgress(Sender);
-end;
-
-
-// TCompressionStream
-
-constructor TCompressionStream.Create(CompressionLevel: TCompressionLevel;
-  Dest: TStream);
-const
-  Levels: array [TCompressionLevel] of ShortInt =
-    (Z_NO_COMPRESSION, Z_BEST_SPEED, Z_DEFAULT_COMPRESSION, Z_BEST_COMPRESSION);
-begin
-  inherited Create(Dest);
-  FZRec.next_out := FBuffer;
-  FZRec.avail_out := sizeof(FBuffer);
-  CCheck(deflateInit_(FZRec, Levels[CompressionLevel], zlib_version, sizeof(FZRec)));
-end;
-
-destructor TCompressionStream.Destroy;
-begin
-  FZRec.next_in := nil;
-  FZRec.avail_in := 0;
-  try
-    if FStrm.Position <> FStrmPos then FStrm.Position := FStrmPos;
-    while (CCheck(deflate(FZRec, Z_FINISH)) <> Z_STREAM_END)
-      and (FZRec.avail_out = 0) do
-    begin
-      FStrm.WriteBuffer(FBuffer, sizeof(FBuffer));
-      FZRec.next_out := FBuffer;
-      FZRec.avail_out := sizeof(FBuffer);
-    end;
-    if FZRec.avail_out < sizeof(FBuffer) then
-      FStrm.WriteBuffer(FBuffer, sizeof(FBuffer) - FZRec.avail_out);
-  finally
-    deflateEnd(FZRec);
-  end;
-  inherited Destroy;
-end;
-
-function TCompressionStream.Read(var Buffer; Count: Longint): Longint;
-begin
-  raise ECompressionError.Create('Invalid stream operation');
-end;
-
-function TCompressionStream.Write(const Buffer; Count: Longint): Longint;
-begin
-  FZRec.next_in := @Buffer;
-  FZRec.avail_in := Count;
-  if FStrm.Position <> FStrmPos then FStrm.Position := FStrmPos;
-  while (FZRec.avail_in > 0) do
-  begin
-    CCheck(deflate(FZRec, 0));
-    if FZRec.avail_out = 0 then
-    begin
-      FStrm.WriteBuffer(FBuffer, sizeof(FBuffer));
-      FZRec.next_out := FBuffer;
-      FZRec.avail_out := sizeof(FBuffer);
-      FStrmPos := FStrm.Position;
-      Progress(Self);
-    end;
-  end;
-  Result := Count;
-end;
-
-function TCompressionStream.Seek(Offset: Longint; Origin: Word): Longint;
-begin
-  if (Offset = 0) and (Origin = soFromCurrent) then
-    Result := FZRec.total_in
-  else
-    raise ECompressionError.Create('Invalid stream operation');
-end;
-
-function TCompressionStream.GetCompressionRate: Single;
-begin
-  if FZRec.total_in = 0 then
-    Result := 0
-  else
-    Result := (1.0 - (FZRec.total_out / FZRec.total_in)) * 100.0;
-end;
-
-
-// TDecompressionStream
-
-constructor TDecompressionStream.Create(Source: TStream);
-begin
-  inherited Create(Source);
-  FZRec.next_in := FBuffer;
-  FZRec.avail_in := 0;
-  DCheck(inflateInit_(FZRec, zlib_version, sizeof(FZRec)));
-end;
-
-destructor TDecompressionStream.Destroy;
-begin
-  inflateEnd(FZRec);
-  inherited Destroy;
-end;
-
-function TDecompressionStream.Read(var Buffer; Count: Longint): Longint;
-begin
-  FZRec.next_out := @Buffer;
-  FZRec.avail_out := Count;
-  if FStrm.Position <> FStrmPos then FStrm.Position := FStrmPos;
-  while (FZRec.avail_out > 0) do
-  begin
-    if FZRec.avail_in = 0 then
-    begin
-      FZRec.avail_in := FStrm.Read(FBuffer, sizeof(FBuffer));
-      if FZRec.avail_in = 0 then
-        begin
-          Result := Count - FZRec.avail_out;
-          Exit;
-        end;
-      FZRec.next_in := FBuffer;
-      FStrmPos := FStrm.Position;
-      Progress(Self);
-    end;
-    DCheck(inflate(FZRec, 0));
-  end;
-  Result := Count;
-end;
-
-function TDecompressionStream.Write(const Buffer; Count: Longint): Longint;
-begin
-  raise EDecompressionError.Create('Invalid stream operation');
-end;
-
-function TDecompressionStream.Seek(Offset: Longint; Origin: Word): Longint;
-var
-  I: Integer;
-  Buf: array [0..4095] of Char;
-begin
-  if (Offset = 0) and (Origin = soFromBeginning) then
-  begin
-    DCheck(inflateReset(FZRec));
-    FZRec.next_in := FBuffer;
-    FZRec.avail_in := 0;
-    FStrm.Position := 0;
-    FStrmPos := 0;
-  end
-  else if ( (Offset >= 0) and (Origin = soFromCurrent)) or
-          ( ((Offset - FZRec.total_out) > 0) and (Origin = soFromBeginning)) then
-  begin
-    if Origin = soFromBeginning then Dec(Offset, FZRec.total_out);
-    if Offset > 0 then
-    begin
-      for I := 1 to Offset div sizeof(Buf) do
-        ReadBuffer(Buf, sizeof(Buf));
-      ReadBuffer(Buf, Offset mod sizeof(Buf));
-    end;
-  end
-  else
-    raise EDecompressionError.Create('Invalid stream operation');
-  Result := FZRec.total_out;
-end;
-
-end.
diff --git a/lib/zlib/contrib/delphi2/zlib32.bpr b/lib/zlib/contrib/delphi2/zlib32.bpr
deleted file mode 100644 (file)
index cabcec4..0000000
+++ /dev/null
@@ -1,174 +0,0 @@
-# ---------------------------------------------------------------------------
-!if !$d(BCB)
-BCB = $(MAKEDIR)\..
-!endif
-
-# ---------------------------------------------------------------------------
-# IDE SECTION
-# ---------------------------------------------------------------------------
-# The following section of the project makefile is managed by the BCB IDE.
-# It is recommended to use the IDE to change any of the values in this
-# section.
-# ---------------------------------------------------------------------------
-
-VERSION = BCB.03
-# ---------------------------------------------------------------------------
-PROJECT = zlib32.dll
-OBJFILES = zlib32.obj adler32.obj compress.obj crc32.obj deflate.obj gzio.obj infblock.obj \
-  infcodes.obj inffast.obj inflate.obj inftrees.obj infutil.obj trees.obj \
-  uncompr.obj zutil.obj
-RESFILES =
-RESDEPEN = $(RESFILES)
-LIBFILES =
-LIBRARIES = 
-SPARELIBS = 
-DEFFILE =
-PACKAGES = VCLX35.bpi VCL35.bpi VCLDB35.bpi VCLDBX35.bpi ibsmp35.bpi bcbsmp35.bpi \
-  dclocx35.bpi QRPT35.bpi TEEUI35.bpi TEEDB35.bpi TEE35.bpi DSS35.bpi \
-  NMFAST35.bpi INETDB35.bpi INET35.bpi VCLMID35.bpi
-# ---------------------------------------------------------------------------
-PATHCPP = .;
-PATHASM = .;
-PATHPAS = .;
-PATHRC = .;
-DEBUGLIBPATH = $(BCB)\lib\debug
-RELEASELIBPATH = $(BCB)\lib\release
-# ---------------------------------------------------------------------------
-CFLAG1 = -WD -O2 -Ve -d -k- -vi -c -tWD
-CFLAG2 = -D_NO_VCL;ZLIB_DLL -I$(BCB)\include
-CFLAG3 = -ff -5
-PFLAGS = -D_NO_VCL;ZLIB_DLL -U$(BCB)\lib;$(RELEASELIBPATH) -I$(BCB)\include -$I- -v \
-  -JPHN -M
-RFLAGS = -D_NO_VCL;ZLIB_DLL -i$(BCB)\include
-AFLAGS = /i$(BCB)\include /d_NO_VCL /dZLIB_DLL /mx /w2 /zn
-LFLAGS = -L$(BCB)\lib;$(RELEASELIBPATH) -aa -Tpd -x -Gi
-IFLAGS = -Gn -g
-# ---------------------------------------------------------------------------
-ALLOBJ = c0d32.obj $(OBJFILES)
-ALLRES = $(RESFILES)
-ALLLIB = $(LIBFILES)  import32.lib cw32mt.lib
-# ---------------------------------------------------------------------------
-!ifdef IDEOPTIONS
-
-[Version Info]
-IncludeVerInfo=0
-AutoIncBuild=0
-MajorVer=1
-MinorVer=0
-Release=0
-Build=0
-Debug=0
-PreRelease=0
-Special=0
-Private=0
-DLL=1
-Locale=1040
-CodePage=1252
-
-[Version Info Keys]
-CompanyName=
-FileDescription=DLL (GUI)
-FileVersion=1.0.0.0
-InternalName=
-LegalCopyright=
-LegalTrademarks=
-OriginalFilename=
-ProductName=
-ProductVersion=1.0.0.0
-Comments=
-
-[HistoryLists\hlIncludePath]
-Count=1
-Item0=$(BCB)\include
-
-[HistoryLists\hlLibraryPath]
-Count=1
-Item0=$(BCB)\lib
-
-[HistoryLists\hlConditionals]
-Count=1
-Item0=_NO_VCL;ZLIB_DLL
-
-[Debugging]
-DebugSourceDirs=
-
-[Parameters]
-RunParams=
-HostApplication=
-
-!endif
-
-# ---------------------------------------------------------------------------
-# MAKE SECTION
-# ---------------------------------------------------------------------------
-# This section of the project file is not used by the BCB IDE.  It is for
-# the benefit of building from the command-line using the MAKE utility.
-# ---------------------------------------------------------------------------
-
-.autodepend
-# ---------------------------------------------------------------------------
-!if !$d(BCC32)
-BCC32 = bcc32
-!endif
-
-!if !$d(DCC32)
-DCC32 = dcc32
-!endif
-
-!if !$d(TASM32)
-TASM32 = tasm32
-!endif
-
-!if !$d(LINKER)
-LINKER = ilink32
-!endif
-
-!if !$d(BRCC32)
-BRCC32 = brcc32
-!endif
-# ---------------------------------------------------------------------------
-!if $d(PATHCPP)
-.PATH.CPP = $(PATHCPP)
-.PATH.C   = $(PATHCPP)
-!endif
-
-!if $d(PATHPAS)
-.PATH.PAS = $(PATHPAS)
-!endif
-
-!if $d(PATHASM)
-.PATH.ASM = $(PATHASM)
-!endif
-
-!if $d(PATHRC)
-.PATH.RC  = $(PATHRC)
-!endif
-# ---------------------------------------------------------------------------
-$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE)
-    $(BCB)\BIN\$(LINKER) @&&!
-    $(LFLAGS) $(IFLAGS) +
-    $(ALLOBJ), +
-    $(PROJECT),, +
-    $(ALLLIB), +
-    $(DEFFILE), +
-    $(ALLRES)
-!
-# ---------------------------------------------------------------------------
-.pas.hpp:
-    $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< }
-
-.pas.obj:
-    $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< }
-
-.cpp.obj:
-    $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< }
-
-.c.obj:
-    $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< }
-
-.asm.obj:
-    $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@
-
-.rc.res:
-    $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $<
-# ---------------------------------------------------------------------------
diff --git a/lib/zlib/contrib/delphi2/zlib32.cpp b/lib/zlib/contrib/delphi2/zlib32.cpp
deleted file mode 100644 (file)
index 7372f6b..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-
-#include <windows.h>
-#pragma hdrstop
-#include <condefs.h>
-
-
-//---------------------------------------------------------------------------
-//   Important note about DLL memory management in a VCL DLL:
-//
-//
-//
-// If your DLL uses VCL and exports any functions that pass VCL String objects
-// (or structs/classes containing nested Strings) as parameter or function
-// results, you will need to build both your DLL project and any EXE projects
-// that use your DLL with the dynamic RTL (the RTL DLL).  This will change your
-// DLL and its calling EXE's to use BORLNDMM.DLL as their memory manager. In
-// these cases, the file BORLNDMM.DLL should be deployed along with your DLL
-// and the RTL DLL (CP3240MT.DLL). To avoid the requiring BORLNDMM.DLL in
-// these situations, pass string information using "char *" or ShortString
-// parameters and then link with the static RTL.
-//
-//---------------------------------------------------------------------------
-USEUNIT("adler32.c");
-USEUNIT("compress.c");
-USEUNIT("crc32.c");
-USEUNIT("deflate.c");
-USEUNIT("gzio.c");
-USEUNIT("infblock.c");
-USEUNIT("infcodes.c");
-USEUNIT("inffast.c");
-USEUNIT("inflate.c");
-USEUNIT("inftrees.c");
-USEUNIT("infutil.c");
-USEUNIT("trees.c");
-USEUNIT("uncompr.c");
-USEUNIT("zutil.c");
-//---------------------------------------------------------------------------
-#pragma argsused
-int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*)
-{
-        return 1;
-}
diff --git a/lib/zlib/contrib/iostream/test.cpp b/lib/zlib/contrib/iostream/test.cpp
deleted file mode 100644 (file)
index 7d265b3..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-
-#include "zfstream.h"
-
-int main() {
-
-  // Construct a stream object with this filebuffer.  Anything sent
-  // to this stream will go to standard out.
-  gzofstream os( 1, ios::out );
-
-  // This text is getting compressed and sent to stdout.
-  // To prove this, run 'test | zcat'.
-  os << "Hello, Mommy" << endl;
-
-  os << setcompressionlevel( Z_NO_COMPRESSION );
-  os << "hello, hello, hi, ho!" << endl;
-
-  setcompressionlevel( os, Z_DEFAULT_COMPRESSION )
-    << "I'm compressing again" << endl;
-
-  os.close();
-
-  return 0;
-
-}
diff --git a/lib/zlib/contrib/iostream/zfstream.cpp b/lib/zlib/contrib/iostream/zfstream.cpp
deleted file mode 100644 (file)
index a690bbe..0000000
+++ /dev/null
@@ -1,329 +0,0 @@
-
-#include <memory.h>
-#include "zfstream.h"
-
-gzfilebuf::gzfilebuf() :
-  file(NULL),
-  mode(0),
-  own_file_descriptor(0)
-{ }
-
-gzfilebuf::~gzfilebuf() {
-
-  sync();
-  if ( own_file_descriptor )
-    close();
-
-}
-
-gzfilebuf *gzfilebuf::open( const char *name,
-                           int io_mode ) {
-
-  if ( is_open() )
-    return NULL;
-
-  char char_mode[10];
-  char *p;
-  memset(char_mode,'\0',10);
-  p = char_mode;
-
-  if ( io_mode & ios::in ) {
-    mode = ios::in;
-    *p++ = 'r';
-  } else if ( io_mode & ios::app ) {
-    mode = ios::app;
-    *p++ = 'a';
-  } else {
-    mode = ios::out;
-    *p++ = 'w';
-  }
-
-  if ( io_mode & ios::binary ) {
-    mode |= ios::binary;
-    *p++ = 'b';
-  }
-
-  // Hard code the compression level
-  if ( io_mode & (ios::out|ios::app )) {
-    *p++ = '9';
-  }
-
-  if ( (file = gzopen(name, char_mode)) == NULL )
-    return NULL;
-
-  own_file_descriptor = 1;
-
-  return this;
-
-}
-
-gzfilebuf *gzfilebuf::attach( int file_descriptor,
-                             int io_mode ) {
-
-  if ( is_open() )
-    return NULL;
-
-  char char_mode[10];
-  char *p;
-  memset(char_mode,'\0',10);
-  p = char_mode;
-
-  if ( io_mode & ios::in ) {
-    mode = ios::in;
-    *p++ = 'r';
-  } else if ( io_mode & ios::app ) {
-    mode = ios::app;
-    *p++ = 'a';
-  } else {
-    mode = ios::out;
-    *p++ = 'w';
-  }
-
-  if ( io_mode & ios::binary ) {
-    mode |= ios::binary;
-    *p++ = 'b';
-  }
-
-  // Hard code the compression level
-  if ( io_mode & (ios::out|ios::app )) {
-    *p++ = '9';
-  }
-
-  if ( (file = gzdopen(file_descriptor, char_mode)) == NULL )
-    return NULL;
-
-  own_file_descriptor = 0;
-
-  return this;
-
-}
-
-gzfilebuf *gzfilebuf::close() {
-
-  if ( is_open() ) {
-
-    sync();
-    gzclose( file );
-    file = NULL;
-
-  }
-
-  return this;
-
-}
-
-int gzfilebuf::setcompressionlevel( short comp_level ) {
-
-  return gzsetparams(file, comp_level, -2);
-
-}
-
-int gzfilebuf::setcompressionstrategy( short comp_strategy ) {
-
-  return gzsetparams(file, -2, comp_strategy);
-
-}
-
-
-streampos gzfilebuf::seekoff( streamoff off, ios::seek_dir dir, int which ) {
-
-  return streampos(EOF);
-
-}
-
-int gzfilebuf::underflow() {
-
-  // If the file hasn't been opened for reading, error.
-  if ( !is_open() || !(mode & ios::in) )
-    return EOF;
-
-  // if a buffer doesn't exists, allocate one.
-  if ( !base() ) {
-
-    if ( (allocate()) == EOF )
-      return EOF;
-    setp(0,0);
-
-  } else {
-
-    if ( in_avail() )
-      return (unsigned char) *gptr();
-
-    if ( out_waiting() ) {
-      if ( flushbuf() == EOF )
-       return EOF;
-    }
-
-  }
-
-  // Attempt to fill the buffer.
-
-  int result = fillbuf();
-  if ( result == EOF ) {
-    // disable get area
-    setg(0,0,0);
-    return EOF;
-  }
-
-  return (unsigned char) *gptr();
-
-}
-
-int gzfilebuf::overflow( int c ) {
-
-  if ( !is_open() || !(mode & ios::out) )
-    return EOF;
-
-  if ( !base() ) {
-    if ( allocate() == EOF )
-      return EOF;
-    setg(0,0,0);
-  } else {
-    if (in_avail()) {
-       return EOF;
-    }
-    if (out_waiting()) {
-      if (flushbuf() == EOF)
-       return EOF;
-    }
-  }
-
-  int bl = blen();
-  setp( base(), base() + bl);
-
-  if ( c != EOF ) {
-
-    *pptr() = c;
-    pbump(1);
-
-  }
-
-  return 0;
-
-}
-
-int gzfilebuf::sync() {
-
-  if ( !is_open() )
-    return EOF;
-
-  if ( out_waiting() )
-    return flushbuf();
-
-  return 0;
-
-}
-
-int gzfilebuf::flushbuf() {
-
-  int n;
-  char *q;
-
-  q = pbase();
-  n = pptr() - q;
-
-  if ( gzwrite( file, q, n) < n )
-    return EOF;
-
-  setp(0,0);
-
-  return 0;
-
-}
-
-int gzfilebuf::fillbuf() {
-
-  int required;
-  char *p;
-
-  p = base();
-
-  required = blen();
-
-  int t = gzread( file, p, required );
-
-  if ( t <= 0) return EOF;
-
-  setg( base(), base(), base()+t);
-
-  return t;
-
-}
-
-gzfilestream_common::gzfilestream_common() :
-  ios( gzfilestream_common::rdbuf() )
-{ }
-
-gzfilestream_common::~gzfilestream_common()
-{ }
-
-void gzfilestream_common::attach( int fd, int io_mode ) {
-
-  if ( !buffer.attach( fd, io_mode) )
-    clear( ios::failbit | ios::badbit );
-  else
-    clear();
-
-}
-
-void gzfilestream_common::open( const char *name, int io_mode ) {
-
-  if ( !buffer.open( name, io_mode ) )
-    clear( ios::failbit | ios::badbit );
-  else
-    clear();
-
-}
-
-void gzfilestream_common::close() {
-
-  if ( !buffer.close() )
-    clear( ios::failbit | ios::badbit );
-
-}
-
-gzfilebuf *gzfilestream_common::rdbuf() {
-
-  return &buffer;
-
-}
-     
-gzifstream::gzifstream() :
-  ios( gzfilestream_common::rdbuf() )
-{
-  clear( ios::badbit );
-}
-
-gzifstream::gzifstream( const char *name, int io_mode ) :
-  ios( gzfilestream_common::rdbuf() )
-{
-  gzfilestream_common::open( name, io_mode );
-}
-
-gzifstream::gzifstream( int fd, int io_mode ) :
-  ios( gzfilestream_common::rdbuf() )
-{
-  gzfilestream_common::attach( fd, io_mode );
-}
-
-gzifstream::~gzifstream() { }
-
-gzofstream::gzofstream() :
-  ios( gzfilestream_common::rdbuf() )
-{
-  clear( ios::badbit );
-}
-
-gzofstream::gzofstream( const char *name, int io_mode ) :
-  ios( gzfilestream_common::rdbuf() )
-{
-  gzfilestream_common::open( name, io_mode );
-}
-
-gzofstream::gzofstream( int fd, int io_mode ) :
-  ios( gzfilestream_common::rdbuf() )
-{
-  gzfilestream_common::attach( fd, io_mode );
-}
-
-gzofstream::~gzofstream() { }
diff --git a/lib/zlib/contrib/iostream/zfstream.h b/lib/zlib/contrib/iostream/zfstream.h
deleted file mode 100644 (file)
index c87fa08..0000000
+++ /dev/null
@@ -1,142 +0,0 @@
-
-#ifndef _zfstream_h
-#define _zfstream_h
-
-#include <fstream.h>
-#include "zlib.h"
-
-class gzfilebuf : public streambuf {
-
-public:
-
-  gzfilebuf( );
-  virtual ~gzfilebuf();
-
-  gzfilebuf *open( const char *name, int io_mode );
-  gzfilebuf *attach( int file_descriptor, int io_mode );
-  gzfilebuf *close();
-
-  int setcompressionlevel( short comp_level );
-  int setcompressionstrategy( short comp_strategy );
-
-  inline int is_open() const { return (file !=NULL); }
-
-  virtual streampos seekoff( streamoff, ios::seek_dir, int );
-
-  virtual int sync();
-
-protected:
-
-  virtual int underflow();
-  virtual int overflow( int = EOF );
-
-private:
-
-  gzFile file;
-  short mode;
-  short own_file_descriptor;
-
-  int flushbuf();
-  int fillbuf();
-
-};
-
-class gzfilestream_common : virtual public ios {
-
-  friend class gzifstream;
-  friend class gzofstream;
-  friend gzofstream &setcompressionlevel( gzofstream &, int );
-  friend gzofstream &setcompressionstrategy( gzofstream &, int );
-
-public:
-  virtual ~gzfilestream_common();
-
-  void attach( int fd, int io_mode );
-  void open( const char *name, int io_mode );
-  void close();
-
-protected:
-  gzfilestream_common();
-
-private:
-  gzfilebuf *rdbuf();
-
-  gzfilebuf buffer;
-
-};
-
-class gzifstream : public gzfilestream_common, public istream {
-
-public:
-
-  gzifstream();
-  gzifstream( const char *name, int io_mode = ios::in );
-  gzifstream( int fd, int io_mode = ios::in );
-
-  virtual ~gzifstream();
-
-};
-
-class gzofstream : public gzfilestream_common, public ostream {
-
-public:
-
-  gzofstream();
-  gzofstream( const char *name, int io_mode = ios::out );
-  gzofstream( int fd, int io_mode = ios::out );
-
-  virtual ~gzofstream();
-
-};
-
-template<class T> class gzomanip {
-  friend gzofstream &operator<<(gzofstream &, const gzomanip<T> &);
-public:
-  gzomanip(gzofstream &(*f)(gzofstream &, T), T v) : func(f), val(v) { }
-private:
-  gzofstream &(*func)(gzofstream &, T);
-  T val;
-};
-
-template<class T> gzofstream &operator<<(gzofstream &s,
-                                        const gzomanip<T> &m) {
-  return (*m.func)(s, m.val);
-  
-}
-
-inline gzofstream &setcompressionlevel( gzofstream &s, int l ) {
-  (s.rdbuf())->setcompressionlevel(l);
-  return s;
-}
-
-inline gzofstream &setcompressionstrategy( gzofstream &s, int l ) {
-  (s.rdbuf())->setcompressionstrategy(l);
-  return s;
-}
-
-inline gzomanip<int> setcompressionlevel(int l)
-{
-  return gzomanip<int>(&setcompressionlevel,l);
-}
-
-inline gzomanip<int> setcompressionstrategy(int l)
-{
-  return gzomanip<int>(&setcompressionstrategy,l);
-}
-
-#endif
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/lib/zlib/contrib/iostream2/zstream.h b/lib/zlib/contrib/iostream2/zstream.h
deleted file mode 100644 (file)
index 861ef2b..0000000
+++ /dev/null
@@ -1,307 +0,0 @@
-/*
- *
- * Copyright (c) 1997
- * Christian Michelsen Research AS
- * Advanced Computing
- * Fantoftvegen 38, 5036 BERGEN, Norway
- * http://www.cmr.no
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation.  Christian Michelsen Research AS makes no
- * representations about the suitability of this software for any
- * purpose.  It is provided "as is" without express or implied warranty.
- *
- */
-
-#ifndef ZSTREAM__H
-#define ZSTREAM__H
-
-/*
- * zstream.h - C++ interface to the 'zlib' general purpose compression library
- * $Id$
- */
-
-#include <strstream.h>
-#include <string.h>
-#include <stdio.h>
-#include "zlib.h"
-
-#if defined(_WIN32)
-#   include <fcntl.h>
-#   include <io.h>
-#   define SET_BINARY_MODE(file) setmode(fileno(file), O_BINARY)
-#else
-#   define SET_BINARY_MODE(file)
-#endif
-
-class zstringlen {
-public:
-    zstringlen(class izstream&);
-    zstringlen(class ozstream&, const char*);
-    size_t value() const { return val.word; }
-private:
-    struct Val { unsigned char byte; size_t word; } val;
-};
-
-//  ----------------------------- izstream -----------------------------
-
-class izstream
-{
-    public:
-        izstream() : m_fp(0) {}
-        izstream(FILE* fp) : m_fp(0) { open(fp); }
-        izstream(const char* name) : m_fp(0) { open(name); }
-        ~izstream() { close(); }
-
-        /* Opens a gzip (.gz) file for reading.
-         * open() can be used to read a file which is not in gzip format;
-         * in this case read() will directly read from the file without
-         * decompression. errno can be checked to distinguish two error
-         * cases (if errno is zero, the zlib error is Z_MEM_ERROR).
-         */
-        void open(const char* name) {
-            if (m_fp) close();
-            m_fp = ::gzopen(name, "rb");
-        }
-
-        void open(FILE* fp) {
-            SET_BINARY_MODE(fp);
-            if (m_fp) close();
-            m_fp = ::gzdopen(fileno(fp), "rb");
-        }
-
-        /* Flushes all pending input if necessary, closes the compressed file
-         * and deallocates all the (de)compression state. The return value is
-         * the zlib error number (see function error() below).
-         */
-        int close() {
-            int r = ::gzclose(m_fp);
-            m_fp = 0; return r;
-        }
-
-        /* Binary read the given number of bytes from the compressed file.
-         */
-        int read(void* buf, size_t len) {
-            return ::gzread(m_fp, buf, len);
-        }
-
-        /* Returns the error message for the last error which occurred on the
-         * given compressed file. errnum is set to zlib error number. If an
-         * error occurred in the file system and not in the compression library,
-         * errnum is set to Z_ERRNO and the application may consult errno
-         * to get the exact error code.
-         */
-        const char* error(int* errnum) {
-            return ::gzerror(m_fp, errnum);
-        }
-
-        gzFile fp() { return m_fp; }
-
-    private:
-        gzFile m_fp;
-};
-
-/*
- * Binary read the given (array of) object(s) from the compressed file.
- * If the input file was not in gzip format, read() copies the objects number
- * of bytes into the buffer.
- * returns the number of uncompressed bytes actually read
- * (0 for end of file, -1 for error).
- */
-template <class T, class Items>
-inline int read(izstream& zs, T* x, Items items) {
-    return ::gzread(zs.fp(), x, items*sizeof(T));
-}
-
-/*
- * Binary input with the '>' operator.
- */
-template <class T>
-inline izstream& operator>(izstream& zs, T& x) {
-    ::gzread(zs.fp(), &x, sizeof(T));
-    return zs;
-}
-
-
-inline zstringlen::zstringlen(izstream& zs) {
-    zs > val.byte;
-    if (val.byte == 255) zs > val.word;
-    else val.word = val.byte;
-}
-
-/*
- * Read length of string + the string with the '>' operator.
- */
-inline izstream& operator>(izstream& zs, char* x) {
-    zstringlen len(zs);
-    ::gzread(zs.fp(), x, len.value());
-    x[len.value()] = '\0';
-    return zs;
-}
-
-inline char* read_string(izstream& zs) {
-    zstringlen len(zs);
-    char* x = new char[len.value()+1];
-    ::gzread(zs.fp(), x, len.value());
-    x[len.value()] = '\0';
-    return x;
-}
-
-// ----------------------------- ozstream -----------------------------
-
-class ozstream
-{
-    public:
-        ozstream() : m_fp(0), m_os(0) {
-        }
-        ozstream(FILE* fp, int level = Z_DEFAULT_COMPRESSION)
-            : m_fp(0), m_os(0) {
-            open(fp, level);
-        }
-        ozstream(const char* name, int level = Z_DEFAULT_COMPRESSION)
-            : m_fp(0), m_os(0) {
-            open(name, level);
-        }
-        ~ozstream() {
-            close();
-        }
-
-        /* Opens a gzip (.gz) file for writing.
-         * The compression level parameter should be in 0..9
-         * errno can be checked to distinguish two error cases
-         * (if errno is zero, the zlib error is Z_MEM_ERROR).
-         */
-        void open(const char* name, int level = Z_DEFAULT_COMPRESSION) {
-            char mode[4] = "wb\0";
-            if (level != Z_DEFAULT_COMPRESSION) mode[2] = '0'+level;
-            if (m_fp) close();
-            m_fp = ::gzopen(name, mode);
-        }
-
-        /* open from a FILE pointer.
-         */
-        void open(FILE* fp, int level = Z_DEFAULT_COMPRESSION) {
-            SET_BINARY_MODE(fp);
-            char mode[4] = "wb\0";
-            if (level != Z_DEFAULT_COMPRESSION) mode[2] = '0'+level;
-            if (m_fp) close();
-            m_fp = ::gzdopen(fileno(fp), mode);
-        }
-
-        /* Flushes all pending output if necessary, closes the compressed file
-         * and deallocates all the (de)compression state. The return value is
-         * the zlib error number (see function error() below).
-         */
-        int close() {
-            if (m_os) {
-                ::gzwrite(m_fp, m_os->str(), m_os->pcount());
-                delete[] m_os->str(); delete m_os; m_os = 0;
-            }
-            int r = ::gzclose(m_fp); m_fp = 0; return r;
-        }
-
-        /* Binary write the given number of bytes into the compressed file.
-         */
-        int write(const void* buf, size_t len) {
-            return ::gzwrite(m_fp, (voidp) buf, len);
-        }
-
-        /* Flushes all pending output into the compressed file. The parameter
-         * _flush is as in the deflate() function. The return value is the zlib
-         * error number (see function gzerror below). flush() returns Z_OK if
-         * the flush_ parameter is Z_FINISH and all output could be flushed.
-         * flush() should be called only when strictly necessary because it can
-         * degrade compression.
-         */
-        int flush(int _flush) {
-            os_flush();
-            return ::gzflush(m_fp, _flush);
-        }
-
-        /* Returns the error message for the last error which occurred on the
-         * given compressed file. errnum is set to zlib error number. If an
-         * error occurred in the file system and not in the compression library,
-         * errnum is set to Z_ERRNO and the application may consult errno
-         * to get the exact error code.
-         */
-        const char* error(int* errnum) {
-            return ::gzerror(m_fp, errnum);
-        }
-
-        gzFile fp() { return m_fp; }
-
-        ostream& os() {
-            if (m_os == 0) m_os = new ostrstream;
-            return *m_os;
-        }
-
-        void os_flush() {
-            if (m_os && m_os->pcount()>0) {
-                ostrstream* oss = new ostrstream;
-                oss->fill(m_os->fill());
-                oss->flags(m_os->flags());
-                oss->precision(m_os->precision());
-                oss->width(m_os->width());
-                ::gzwrite(m_fp, m_os->str(), m_os->pcount());
-                delete[] m_os->str(); delete m_os; m_os = oss;
-            }
-        }
-
-    private:
-        gzFile m_fp;
-        ostrstream* m_os;
-};
-
-/*
- * Binary write the given (array of) object(s) into the compressed file.
- * returns the number of uncompressed bytes actually written
- * (0 in case of error).
- */
-template <class T, class Items>
-inline int write(ozstream& zs, const T* x, Items items) {
-    return ::gzwrite(zs.fp(), (voidp) x, items*sizeof(T));
-}
-
-/*
- * Binary output with the '<' operator.
- */
-template <class T>
-inline ozstream& operator<(ozstream& zs, const T& x) {
-    ::gzwrite(zs.fp(), (voidp) &x, sizeof(T));
-    return zs;
-}
-
-inline zstringlen::zstringlen(ozstream& zs, const char* x) {
-    val.byte = 255;  val.word = ::strlen(x);
-    if (val.word < 255) zs < (val.byte = val.word);
-    else zs < val;
-}
-
-/*
- * Write length of string + the string with the '<' operator.
- */
-inline ozstream& operator<(ozstream& zs, const char* x) {
-    zstringlen len(zs, x);
-    ::gzwrite(zs.fp(), (voidp) x, len.value());
-    return zs;
-}
-
-#ifdef _MSC_VER
-inline ozstream& operator<(ozstream& zs, char* const& x) {
-    return zs < (const char*) x;
-}
-#endif
-
-/*
- * Ascii write with the << operator;
- */
-template <class T>
-inline ostream& operator<<(ozstream& zs, const T& x) {
-    zs.os_flush();
-    return zs.os() << x;
-}
-
-#endif
diff --git a/lib/zlib/contrib/iostream2/zstream_test.cpp b/lib/zlib/contrib/iostream2/zstream_test.cpp
deleted file mode 100644 (file)
index 5bbd56c..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-#include "zstream.h"
-#include <math.h>
-#include <stdlib.h>
-#include <iomanip.h>
-
-void main() {
-       char h[256] = "Hello";
-       char* g = "Goodbye";
-       ozstream out("temp.gz");
-    out < "This works well" < h < g;
-    out.close();
-
-    izstream in("temp.gz"); // read it back
-    char *x = read_string(in), *y = new char[256], z[256];
-    in > y > z;
-    in.close();
-    cout << x << endl << y << endl << z << endl;
-
-    out.open("temp.gz"); // try ascii output; zcat temp.gz to see the results
-    out << setw(50) << setfill('#') << setprecision(20) << x << endl << y << endl << z << endl;
-    out << z << endl << y << endl << x << endl;
-    out << 1.1234567890123456789 << endl;
-
-    delete[] x; delete[] y;
-}
diff --git a/lib/zlib/contrib/minizip/ChangeLogUnzip b/lib/zlib/contrib/minizip/ChangeLogUnzip
deleted file mode 100644 (file)
index 9987c54..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-Change in 0.15: (19 Mar 98)
-- fix memory leak in minizip.c
-
-Change in 0.14: (10 Mar 98)
-- fix bugs in minizip.c sample for zipping big file
-- fix problem in month in date handling
-- fix bug in unzlocal_GetCurrentFileInfoInternal in unzip.c for 
-    comment handling
-
-Change in 0.13: (6 Mar 98)
-- fix bugs in zip.c
-- add real minizip sample
-
-Change in 0.12: (4 Mar 98)
-- add zip.c and zip.h for creates .zip file
-- fix change_file_date in miniunz.c for Unix (Jean-loup Gailly)
-- fix miniunz.c for file without specific record for directory
-
-Change in 0.11: (3 Mar 98)
-- fix bug in unzGetCurrentFileInfo for get extra field and comment
-- enhance miniunz sample, remove the bad unztst.c sample
-
-Change in 0.10: (2 Mar 98)
-- fix bug in unzReadCurrentFile
-- rename unzip* to unz* function and structure
-- remove Windows-like hungary notation variable name
-- modify some structure in unzip.h
-- add somes comment in source
-- remove unzipGetcCurrentFile function
-- replace ZUNZEXPORT by ZEXPORT
-- add unzGetLocalExtrafield for get the local extrafield info
-- add a new sample, miniunz.c
-
-Change in 0.4: (25 Feb 98)
-- suppress the type unzipFileInZip. 
-  Only on file in the zipfile can be open at the same time
-- fix somes typo in code
-- added tm_unz structure in unzip_file_info (date/time in readable format)
diff --git a/lib/zlib/contrib/minizip/Makefile b/lib/zlib/contrib/minizip/Makefile
deleted file mode 100644 (file)
index a1dfc16..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-CC=cc
-CFLAGS=-O -I../..
-
-UNZ_OBJS = miniunz.o unzip.o ../../libz.a
-ZIP_OBJS = minizip.o zip.o   ../../libz.a
-
-.c.o:
-       $(CC) -c $(CFLAGS) $*.c
-
-all: miniunz minizip
-
-miniunz:  $(UNZ_OBJS)
-       $(CC) $(CFLAGS) -o $@ $(UNZ_OBJS)
-
-minizip:  $(ZIP_OBJS)
-       $(CC) $(CFLAGS) -o $@ $(ZIP_OBJS)
-
-test:  miniunz minizip
-       ./minizip test readme.txt
-       ./miniunz -l test.zip
-       mv readme.txt readme.old
-       ./miniunz test.zip
-
-clean:
-       /bin/rm -f *.o *~ minizip miniunz
diff --git a/lib/zlib/contrib/minizip/miniunz.c b/lib/zlib/contrib/minizip/miniunz.c
deleted file mode 100644 (file)
index f3b7832..0000000
+++ /dev/null
@@ -1,508 +0,0 @@
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <time.h>
-#include <errno.h>
-#include <fcntl.h>
-
-#ifdef unix
-# include <unistd.h>
-# include <utime.h>
-#else
-# include <direct.h>
-# include <io.h>
-#endif
-
-#include "unzip.h"
-
-#define CASESENSITIVITY (0)
-#define WRITEBUFFERSIZE (8192)
-
-/*
-  mini unzip, demo of unzip package
-
-  usage :
-  Usage : miniunz [-exvlo] file.zip [file_to_extract]
-
-  list the file in the zipfile, and print the content of FILE_ID.ZIP or README.TXT
-    if it exists
-*/
-
-
-/* change_file_date : change the date/time of a file
-    filename : the filename of the file where date/time must be modified
-    dosdate : the new date at the MSDos format (4 bytes)
-    tmu_date : the SAME new date at the tm_unz format */
-void change_file_date(filename,dosdate,tmu_date)
-       const char *filename;
-       uLong dosdate;
-       tm_unz tmu_date;
-{
-#ifdef WIN32
-  HANDLE hFile;
-  FILETIME ftm,ftLocal,ftCreate,ftLastAcc,ftLastWrite;
-
-  hFile = CreateFile(filename,GENERIC_READ | GENERIC_WRITE,
-                      0,NULL,OPEN_EXISTING,0,NULL);
-  GetFileTime(hFile,&ftCreate,&ftLastAcc,&ftLastWrite);
-  DosDateTimeToFileTime((WORD)(dosdate>>16),(WORD)dosdate,&ftLocal);
-  LocalFileTimeToFileTime(&ftLocal,&ftm);
-  SetFileTime(hFile,&ftm,&ftLastAcc,&ftm);
-  CloseHandle(hFile);
-#else
-#ifdef unix
-  struct utimbuf ut;
-  struct tm newdate;
-  newdate.tm_sec = tmu_date.tm_sec;
-  newdate.tm_min=tmu_date.tm_min;
-  newdate.tm_hour=tmu_date.tm_hour;
-  newdate.tm_mday=tmu_date.tm_mday;
-  newdate.tm_mon=tmu_date.tm_mon;
-  if (tmu_date.tm_year > 1900)
-      newdate.tm_year=tmu_date.tm_year - 1900;
-  else
-      newdate.tm_year=tmu_date.tm_year ;
-  newdate.tm_isdst=-1;
-
-  ut.actime=ut.modtime=mktime(&newdate);
-  utime(filename,&ut);
-#endif
-#endif
-}
-
-
-/* mymkdir and change_file_date are not 100 % portable
-   As I don't know well Unix, I wait feedback for the unix portion */
-
-int mymkdir(dirname)
-       const char* dirname;
-{
-    int ret=0;
-#ifdef WIN32
-       ret = mkdir(dirname);
-#else
-#ifdef unix
-       ret = mkdir (dirname,0775);
-#endif
-#endif
-       return ret;
-}
-
-int makedir (newdir)
-    char *newdir;
-{
-  char *buffer ;
-  char *p;
-  int  len = strlen(newdir);  
-
-  if (len <= 0) 
-    return 0;
-
-  buffer = (char*)malloc(len+1);
-  strcpy(buffer,newdir);
-  
-  if (buffer[len-1] == '/') {
-    buffer[len-1] = '\0';
-  }
-  if (mymkdir(buffer) == 0)
-    {
-      free(buffer);
-      return 1;
-    }
-
-  p = buffer+1;
-  while (1)
-    {
-      char hold;
-
-      while(*p && *p != '\\' && *p != '/')
-        p++;
-      hold = *p;
-      *p = 0;
-      if ((mymkdir(buffer) == -1) && (errno == ENOENT))
-        {
-          printf("couldn't create directory %s\n",buffer);
-          free(buffer);
-          return 0;
-        }
-      if (hold == 0)
-        break;
-      *p++ = hold;
-    }
-  free(buffer);
-  return 1;
-}
-
-void do_banner()
-{
-       printf("MiniUnz 0.15, demo of zLib + Unz package written by Gilles Vollant\n");
-       printf("more info at http://wwww.winimage/zLibDll/unzip.htm\n\n");
-}
-
-void do_help()
-{      
-       printf("Usage : miniunz [-exvlo] file.zip [file_to_extract]\n\n") ;
-}
-
-
-int do_list(uf)
-       unzFile uf;
-{
-       uLong i;
-       unz_global_info gi;
-       int err;
-
-       err = unzGetGlobalInfo (uf,&gi);
-       if (err!=UNZ_OK)
-               printf("error %d with zipfile in unzGetGlobalInfo \n",err);
-    printf(" Length  Method   Size  Ratio   Date    Time   CRC-32     Name\n");
-    printf(" ------  ------   ----  -----   ----    ----   ------     ----\n");
-       for (i=0;i<gi.number_entry;i++)
-       {
-               char filename_inzip[256];
-               unz_file_info file_info;
-               uLong ratio=0;
-               const char *string_method;
-               err = unzGetCurrentFileInfo(uf,&file_info,filename_inzip,sizeof(filename_inzip),NULL,0,NULL,0);
-               if (err!=UNZ_OK)
-               {
-                       printf("error %d with zipfile in unzGetCurrentFileInfo\n",err);
-                       break;
-               }
-               if (file_info.uncompressed_size>0)
-                       ratio = (file_info.compressed_size*100)/file_info.uncompressed_size;
-
-               if (file_info.compression_method==0)
-                       string_method="Stored";
-               else
-               if (file_info.compression_method==Z_DEFLATED)
-               {
-                       uInt iLevel=(uInt)((file_info.flag & 0x6)/2);
-                       if (iLevel==0)
-                         string_method="Defl:N";
-                       else if (iLevel==1)
-                         string_method="Defl:X";
-                       else if ((iLevel==2) || (iLevel==3))
-                         string_method="Defl:F"; /* 2:fast , 3 : extra fast*/
-               }
-               else
-                       string_method="Unkn. ";
-
-               printf("%7lu  %6s %7lu %3lu%%  %2.2lu-%2.2lu-%2.2lu  %2.2lu:%2.2lu  %8.8lx   %s\n",
-                           file_info.uncompressed_size,string_method,file_info.compressed_size,
-                               ratio,
-                               (uLong)file_info.tmu_date.tm_mon + 1,
-                (uLong)file_info.tmu_date.tm_mday,
-                               (uLong)file_info.tmu_date.tm_year % 100,
-                               (uLong)file_info.tmu_date.tm_hour,(uLong)file_info.tmu_date.tm_min,
-                               (uLong)file_info.crc,filename_inzip);
-               if ((i+1)<gi.number_entry)
-               {
-                       err = unzGoToNextFile(uf);
-                       if (err!=UNZ_OK)
-                       {
-                               printf("error %d with zipfile in unzGoToNextFile\n",err);
-                               break;
-                       }
-               }
-       }
-
-       return 0;
-}
-
-
-int do_extract_currentfile(uf,popt_extract_without_path,popt_overwrite)
-       unzFile uf;
-       const int* popt_extract_without_path;
-    int* popt_overwrite;
-{
-       char filename_inzip[256];
-       char* filename_withoutpath;
-       char* p;
-    int err=UNZ_OK;
-    FILE *fout=NULL;
-    void* buf;
-    uInt size_buf;
-       
-       unz_file_info file_info;
-       uLong ratio=0;
-       err = unzGetCurrentFileInfo(uf,&file_info,filename_inzip,sizeof(filename_inzip),NULL,0,NULL,0);
-
-       if (err!=UNZ_OK)
-       {
-               printf("error %d with zipfile in unzGetCurrentFileInfo\n",err);
-               return err;
-       }
-
-    size_buf = WRITEBUFFERSIZE;
-    buf = (void*)malloc(size_buf);
-    if (buf==NULL)
-    {
-        printf("Error allocating memory\n");
-        return UNZ_INTERNALERROR;
-    }
-
-       p = filename_withoutpath = filename_inzip;
-       while ((*p) != '\0')
-       {
-               if (((*p)=='/') || ((*p)=='\\'))
-                       filename_withoutpath = p+1;
-               p++;
-       }
-
-       if ((*filename_withoutpath)=='\0')
-       {
-               if ((*popt_extract_without_path)==0)
-               {
-                       printf("creating directory: %s\n",filename_inzip);
-                       mymkdir(filename_inzip);
-               }
-       }
-       else
-       {
-               const char* write_filename;
-               int skip=0;
-
-               if ((*popt_extract_without_path)==0)
-                       write_filename = filename_inzip;
-               else
-                       write_filename = filename_withoutpath;
-
-               err = unzOpenCurrentFile(uf);
-               if (err!=UNZ_OK)
-               {
-                       printf("error %d with zipfile in unzOpenCurrentFile\n",err);
-               }
-
-               if (((*popt_overwrite)==0) && (err==UNZ_OK))
-               {
-                       char rep;
-                       FILE* ftestexist;
-                       ftestexist = fopen(write_filename,"rb");
-                       if (ftestexist!=NULL)
-                       {
-                               fclose(ftestexist);
-                               do
-                               {
-                                       char answer[128];
-                                       printf("The file %s exist. Overwrite ? [y]es, [n]o, [A]ll: ",write_filename);
-                                       scanf("%1s",answer);
-                                       rep = answer[0] ;
-                                       if ((rep>='a') && (rep<='z'))
-                                               rep -= 0x20;
-                               }
-                               while ((rep!='Y') && (rep!='N') && (rep!='A'));
-                       }
-
-                       if (rep == 'N')
-                               skip = 1;
-
-                       if (rep == 'A')
-                               *popt_overwrite=1;
-               }
-
-               if ((skip==0) && (err==UNZ_OK))
-               {
-                       fout=fopen(write_filename,"wb");
-
-            /* some zipfile don't contain directory alone before file */
-            if ((fout==NULL) && ((*popt_extract_without_path)==0) && 
-                                (filename_withoutpath!=(char*)filename_inzip))
-            {
-                char c=*(filename_withoutpath-1);
-                *(filename_withoutpath-1)='\0';
-                makedir(write_filename);
-                *(filename_withoutpath-1)=c;
-                fout=fopen(write_filename,"wb");
-            }
-
-                       if (fout==NULL)
-                       {
-                               printf("error opening %s\n",write_filename);
-                       }
-               }
-
-               if (fout!=NULL)
-               {
-                       printf(" extracting: %s\n",write_filename);
-
-                       do
-                       {
-                               err = unzReadCurrentFile(uf,buf,size_buf);
-                               if (err<0)      
-                               {
-                                       printf("error %d with zipfile in unzReadCurrentFile\n",err);
-                                       break;
-                               }
-                               if (err>0)
-                                       if (fwrite(buf,err,1,fout)!=1)
-                                       {
-                                               printf("error in writing extracted file\n");
-                        err=UNZ_ERRNO;
-                                               break;
-                                       }
-                       }
-                       while (err>0);
-                       fclose(fout);
-                       if (err==0) 
-                               change_file_date(write_filename,file_info.dosDate,
-                                                    file_info.tmu_date);
-               }
-
-        if (err==UNZ_OK)
-        {
-                   err = unzCloseCurrentFile (uf);
-                   if (err!=UNZ_OK)
-                   {
-                           printf("error %d with zipfile in unzCloseCurrentFile\n",err);
-                   }
-        }
-        else
-            unzCloseCurrentFile(uf); /* don't lose the error */       
-       }
-
-    free(buf);    
-    return err;
-}
-
-
-int do_extract(uf,opt_extract_without_path,opt_overwrite)
-       unzFile uf;
-       int opt_extract_without_path;
-    int opt_overwrite;
-{
-       uLong i;
-       unz_global_info gi;
-       int err;
-       FILE* fout=NULL;        
-
-       err = unzGetGlobalInfo (uf,&gi);
-       if (err!=UNZ_OK)
-               printf("error %d with zipfile in unzGetGlobalInfo \n",err);
-
-       for (i=0;i<gi.number_entry;i++)
-       {
-        if (do_extract_currentfile(uf,&opt_extract_without_path,
-                                      &opt_overwrite) != UNZ_OK)
-            break;
-
-               if ((i+1)<gi.number_entry)
-               {
-                       err = unzGoToNextFile(uf);
-                       if (err!=UNZ_OK)
-                       {
-                               printf("error %d with zipfile in unzGoToNextFile\n",err);
-                               break;
-                       }
-               }
-       }
-
-       return 0;
-}
-
-int do_extract_onefile(uf,filename,opt_extract_without_path,opt_overwrite)
-       unzFile uf;
-       const char* filename;
-       int opt_extract_without_path;
-    int opt_overwrite;
-{
-    int err = UNZ_OK;
-    if (unzLocateFile(uf,filename,CASESENSITIVITY)!=UNZ_OK)
-    {
-        printf("file %s not found in the zipfile\n",filename);
-        return 2;
-    }
-
-    if (do_extract_currentfile(uf,&opt_extract_without_path,
-                                      &opt_overwrite) == UNZ_OK)
-        return 0;
-    else
-        return 1;
-}
-
-
-int main(argc,argv)
-       int argc;
-       char *argv[];
-{
-       const char *zipfilename=NULL;
-    const char *filename_to_extract=NULL;
-       int i;
-       int opt_do_list=0;
-       int opt_do_extract=1;
-       int opt_do_extract_withoutpath=0;
-       int opt_overwrite=0;
-       char filename_try[512];
-       unzFile uf=NULL;
-
-       do_banner();
-       if (argc==1)
-       {
-               do_help();
-               exit(0);
-       }
-       else
-       {
-               for (i=1;i<argc;i++)
-               {
-                       if ((*argv[i])=='-')
-                       {
-                               const char *p=argv[i]+1;
-                               
-                               while ((*p)!='\0')
-                               {                       
-                                       char c=*(p++);;
-                                       if ((c=='l') || (c=='L'))
-                                               opt_do_list = 1;
-                                       if ((c=='v') || (c=='V'))
-                                               opt_do_list = 1;
-                                       if ((c=='x') || (c=='X'))
-                                               opt_do_extract = 1;
-                                       if ((c=='e') || (c=='E'))
-                                               opt_do_extract = opt_do_extract_withoutpath = 1;
-                                       if ((c=='o') || (c=='O'))
-                                               opt_overwrite=1;
-                               }
-                       }
-                       else
-            {
-                               if (zipfilename == NULL)
-                                       zipfilename = argv[i];
-                else if (filename_to_extract==NULL)
-                        filename_to_extract = argv[i] ;
-            }
-               }
-       }
-
-       if (zipfilename!=NULL)
-       {
-               strcpy(filename_try,zipfilename);
-               uf = unzOpen(zipfilename);
-               if (uf==NULL)
-               {
-                       strcat(filename_try,".zip");
-                       uf = unzOpen(filename_try);
-               }
-       }
-
-       if (uf==NULL)
-       {
-               printf("Cannot open %s or %s.zip\n",zipfilename,zipfilename);
-               exit (1);
-       }
-    printf("%s opened\n",filename_try);
-
-       if (opt_do_list==1)
-               return do_list(uf);
-       else if (opt_do_extract==1)
-    {
-        if (filename_to_extract == NULL)
-                   return do_extract(uf,opt_do_extract_withoutpath,opt_overwrite);
-        else
-            return do_extract_onefile(uf,filename_to_extract,
-                                      opt_do_extract_withoutpath,opt_overwrite);
-    }
-       unzCloseCurrentFile(uf);
-
-       return 0;  /* to avoid warning */
-}
diff --git a/lib/zlib/contrib/minizip/minizip.c b/lib/zlib/contrib/minizip/minizip.c
deleted file mode 100644 (file)
index 5e492d2..0000000
+++ /dev/null
@@ -1,302 +0,0 @@
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <time.h>
-#include <errno.h>
-#include <fcntl.h>
-
-#ifdef unix
-# include <unistd.h>
-# include <utime.h>
-# include <sys/types.h>
-# include <sys/stat.h>
-#else
-# include <direct.h>
-# include <io.h>
-#endif
-
-#include "zip.h"
-
-
-#define WRITEBUFFERSIZE (16384)
-#define MAXFILENAME (256)
-
-#ifdef WIN32
-uLong filetime(f, tmzip, dt)
-    char *f;                /* name of file to get info on */
-    tm_zip *tmzip;             /* return value: access, modific. and creation times */
-    uLong *dt;             /* dostime */
-{
-  int ret = 0;
-  {
-      FILETIME ftLocal;
-      HANDLE hFind;
-      WIN32_FIND_DATA  ff32;
-
-      hFind = FindFirstFile(f,&ff32);
-      if (hFind != INVALID_HANDLE_VALUE)
-      {
-        FileTimeToLocalFileTime(&(ff32.ftLastWriteTime),&ftLocal);
-        FileTimeToDosDateTime(&ftLocal,((LPWORD)dt)+1,((LPWORD)dt)+0);
-        FindClose(hFind);
-        ret = 1;
-      }
-  }
-  return ret;
-}
-#else
-#ifdef unix
-uLong filetime(f, tmzip, dt)
-    char *f;                /* name of file to get info on */
-    tm_zip *tmzip;             /* return value: access, modific. and creation times */
-    uLong *dt;             /* dostime */
-{
-  int ret=0;
-  struct stat s;        /* results of stat() */
-  struct tm* filedate;
-  time_t tm_t=0;
-  
-  if (strcmp(f,"-")!=0)
-  {
-    char name[MAXFILENAME];
-    int len = strlen(f);
-    strcpy(name, f);
-    if (name[len - 1] == '/')
-      name[len - 1] = '\0';
-    /* not all systems allow stat'ing a file with / appended */
-    if (stat(name,&s)==0)
-    {
-      tm_t = s.st_mtime;
-      ret = 1;
-    }
-  }
-  filedate = localtime(&tm_t);
-
-  tmzip->tm_sec  = filedate->tm_sec;
-  tmzip->tm_min  = filedate->tm_min;
-  tmzip->tm_hour = filedate->tm_hour;
-  tmzip->tm_mday = filedate->tm_mday;
-  tmzip->tm_mon  = filedate->tm_mon ;
-  tmzip->tm_year = filedate->tm_year;
-
-  return ret;
-}
-#else
-uLong filetime(f, tmzip, dt)
-    char *f;                /* name of file to get info on */
-    tm_zip *tmzip;             /* return value: access, modific. and creation times */
-    uLong *dt;             /* dostime */
-{
-    return 0;
-}
-#endif
-#endif
-
-
-
-
-int check_exist_file(filename)
-    const char* filename;
-{
-       FILE* ftestexist;
-    int ret = 1;
-       ftestexist = fopen(filename,"rb");
-       if (ftestexist==NULL)
-        ret = 0;
-    else
-        fclose(ftestexist);
-    return ret;
-}
-
-void do_banner()
-{
-       printf("MiniZip 0.15, demo of zLib + Zip package written by Gilles Vollant\n");
-       printf("more info at http://wwww.winimage/zLibDll/unzip.htm\n\n");
-}
-
-void do_help()
-{      
-       printf("Usage : minizip [-o] file.zip [files_to_add]\n\n") ;
-}
-
-int main(argc,argv)
-       int argc;
-       char *argv[];
-{
-       int i;
-       int opt_overwrite=0;
-    int opt_compress_level=Z_DEFAULT_COMPRESSION;
-    int zipfilenamearg = 0;
-       char filename_try[MAXFILENAME];
-    int zipok;
-    int err=0;
-    int size_buf=0;
-    void* buf=NULL,
-
-
-       do_banner();
-       if (argc==1)
-       {
-               do_help();
-               exit(0);
-        return 0;
-       }
-       else
-       {
-               for (i=1;i<argc;i++)
-               {
-                       if ((*argv[i])=='-')
-                       {
-                               const char *p=argv[i]+1;
-                               
-                               while ((*p)!='\0')
-                               {                       
-                                       char c=*(p++);;
-                                       if ((c=='o') || (c=='O'))
-                                               opt_overwrite = 1;
-                    if ((c>='0') && (c<='9'))
-                        opt_compress_level = c-'0';
-                               }
-                       }
-                       else
-                               if (zipfilenamearg == 0)
-                    zipfilenamearg = i ;
-               }
-       }
-
-    size_buf = WRITEBUFFERSIZE;
-    buf = (void*)malloc(size_buf);
-    if (buf==NULL)
-    {
-        printf("Error allocating memory\n");
-        return ZIP_INTERNALERROR;
-    }
-
-       if (zipfilenamearg==0)
-        zipok=0;
-    else
-       {
-        int i,len;
-        int dot_found=0;
-
-        zipok = 1 ;
-               strcpy(filename_try,argv[zipfilenamearg]);
-        len=strlen(filename_try);
-        for (i=0;i<len;i++)
-            if (filename_try[i]=='.')
-                dot_found=1;
-
-        if (dot_found==0)
-            strcat(filename_try,".zip");
-
-        if (opt_overwrite==0)
-            if (check_exist_file(filename_try)!=0)
-                       {
-                char rep;
-                               do
-                               {
-                                       char answer[128];
-                                       printf("The file %s exist. Overwrite ? [y]es, [n]o : ",filename_try);
-                                       scanf("%1s",answer);
-                                       rep = answer[0] ;
-                                       if ((rep>='a') && (rep<='z'))
-                                               rep -= 0x20;
-                               }
-                               while ((rep!='Y') && (rep!='N'));
-                if (rep=='N')
-                    zipok = 0;
-                       }
-    }
-
-    if (zipok==1)
-    {
-        zipFile zf;
-        int errclose;
-        zf = zipOpen(filename_try,0);
-        if (zf == NULL)
-        {
-            printf("error opening %s\n",filename_try);
-            err= ZIP_ERRNO;
-        }
-        else 
-            printf("creating %s\n",filename_try);
-
-        for (i=zipfilenamearg+1;(i<argc) && (err==ZIP_OK);i++)
-        {
-            if (((*(argv[i]))!='-') && ((*(argv[i]))!='/'))
-            {
-                FILE * fin;
-                int size_read;
-                const char* filenameinzip = argv[i];
-                zip_fileinfo zi;
-
-                zi.tmz_date.tm_sec = zi.tmz_date.tm_min = zi.tmz_date.tm_hour = 
-                zi.tmz_date.tm_mday = zi.tmz_date.tm_min = zi.tmz_date.tm_year = 0;
-                zi.dosDate = 0;
-                zi.internal_fa = 0;
-                zi.external_fa = 0;
-                filetime(filenameinzip,&zi.tmz_date,&zi.dosDate);
-
-
-                err = zipOpenNewFileInZip(zf,filenameinzip,&zi,
-                                 NULL,0,NULL,0,NULL /* comment*/,
-                                 (opt_compress_level != 0) ? Z_DEFLATED : 0,
-                                 opt_compress_level);
-
-                if (err != ZIP_OK)
-                    printf("error in opening %s in zipfile\n",filenameinzip);
-                else
-                {
-                    fin = fopen(filenameinzip,"rb");
-                    if (fin==NULL)
-                    {
-                        err=ZIP_ERRNO;
-                        printf("error in opening %s for reading\n",filenameinzip);
-                    }
-                }
-
-                if (err == ZIP_OK)
-                    do
-                    {
-                        err = ZIP_OK;
-                        size_read = fread(buf,1,size_buf,fin);
-                        if (size_read < size_buf)
-                            if (feof(fin)==0)
-                        {
-                            printf("error in reading %s\n",filenameinzip);
-                            err = ZIP_ERRNO;
-                        }
-
-                        if (size_read>0)
-                        {
-                            err = zipWriteInFileInZip (zf,buf,size_read);
-                            if (err<0)
-                            {
-                                printf("error in writing %s in the zipfile\n",
-                                                 filenameinzip);
-                            }
-                                
-                        }
-                    } while ((err == ZIP_OK) && (size_read>0));
-
-                fclose(fin);
-                if (err<0)
-                    err=ZIP_ERRNO;
-                else
-                {                    
-                    err = zipCloseFileInZip(zf);
-                    if (err!=ZIP_OK)
-                        printf("error in closing %s in the zipfile\n",
-                                    filenameinzip);
-                }
-            }
-        }
-        errclose = zipClose(zf,NULL);
-        if (errclose != ZIP_OK)
-            printf("error in closing %s\n",filename_try);
-   }
-
-    free(buf);
-    exit(0);
-       return 0;  /* to avoid warning */
-}
diff --git a/lib/zlib/contrib/minizip/readme.txt b/lib/zlib/contrib/minizip/readme.txt
deleted file mode 100644 (file)
index 1fc023c..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-
-UnZip 0.15 additionnal library
-
-
-  This unzip package allow extract file from .ZIP file, compatible with 
-PKZip 2.04g, WinZip, InfoZip tools and compatible.
-
-  Multi volume ZipFile (span) are not supported, and old compression used by old 
-PKZip 1.x are not supported.
-
-See probdesc.zip from PKWare for specification of .ZIP format.
-
-What is Unzip
-  The Zlib library support the deflate compression and the creation of gzip (.gz) 
-file. Zlib is free and small.
-  The .Zip format, which can contain several compressed files (.gz can containt
-only one file) is a very popular format. This is why I've written a package for reading file compressed in Zipfile.
-
-Using Unzip package
-
-You need source of Zlib (get zlib111.zip and read zlib.h).
-Get unzlb015.zip and read unzip.h (whith documentation of unzip functions)
-
-The Unzip package is only two file : unzip.h and unzip.c. But it use the Zlib 
-  files.
-unztst.c is a simple sample program, which list file in a zipfile and display
-  README.TXT or FILE_ID.DIZ (if these files are found).
-miniunz.c is a mini unzip program.
-
-I'm also currenlyt writing a zipping portion (zip.h, zip.c and test with minizip.c)
-
-Please email me for feedback.
-I hope my source is compatible with Unix system, but I need your help for be sure
-
-Latest revision : Mar 04th, 1998
-
-Check http://www.winimage.com/zLibDll/unzip.html for up to date info.
diff --git a/lib/zlib/contrib/minizip/unzip.c b/lib/zlib/contrib/minizip/unzip.c
deleted file mode 100644 (file)
index ff71a47..0000000
+++ /dev/null
@@ -1,1294 +0,0 @@
-/* unzip.c -- IO on .zip files using zlib 
-   Version 0.15 beta, Mar 19th, 1998,
-
-   Read unzip.h for more info
-*/
-
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include "zlib.h"
-#include "unzip.h"
-
-#ifdef STDC
-#  include <stddef.h>
-#  include <string.h>
-#  include <stdlib.h>
-#endif
-#ifdef NO_ERRNO_H
-    extern int errno;
-#else
-#   include <errno.h>
-#endif
-
-
-#ifndef local
-#  define local static
-#endif
-/* compile with -Dlocal if your debugger can't find static symbols */
-
-
-
-#if !defined(unix) && !defined(CASESENSITIVITYDEFAULT_YES) && \
-                      !defined(CASESENSITIVITYDEFAULT_NO)
-#define CASESENSITIVITYDEFAULT_NO
-#endif
-
-
-#ifndef UNZ_BUFSIZE
-#define UNZ_BUFSIZE (16384)
-#endif
-
-#ifndef UNZ_MAXFILENAMEINZIP
-#define UNZ_MAXFILENAMEINZIP (256)
-#endif
-
-#ifndef ALLOC
-# define ALLOC(size) (malloc(size))
-#endif
-#ifndef TRYFREE
-# define TRYFREE(p) {if (p) free(p);}
-#endif
-
-#define SIZECENTRALDIRITEM (0x2e)
-#define SIZEZIPLOCALHEADER (0x1e)
-
-
-/* I've found an old Unix (a SunOS 4.1.3_U1) without all SEEK_* defined.... */
-
-#ifndef SEEK_CUR
-#define SEEK_CUR    1
-#endif
-
-#ifndef SEEK_END
-#define SEEK_END    2
-#endif
-
-#ifndef SEEK_SET
-#define SEEK_SET    0
-#endif
-
-const char unz_copyright[] =
-   " unzip 0.15 Copyright 1998 Gilles Vollant ";
-
-/* unz_file_info_interntal contain internal info about a file in zipfile*/
-typedef struct unz_file_info_internal_s
-{
-    uLong offset_curfile;/* relative offset of local header 4 bytes */
-} unz_file_info_internal;
-
-
-/* file_in_zip_read_info_s contain internal information about a file in zipfile,
-    when reading and decompress it */
-typedef struct
-{
-       char  *read_buffer;         /* internal buffer for compressed data */
-       z_stream stream;            /* zLib stream structure for inflate */
-
-       uLong pos_in_zipfile;       /* position in byte on the zipfile, for fseek*/
-       uLong stream_initialised;   /* flag set if stream structure is initialised*/
-
-       uLong offset_local_extrafield;/* offset of the local extra field */
-       uInt  size_local_extrafield;/* size of the local extra field */
-       uLong pos_local_extrafield;   /* position in the local extra field in read*/
-
-       uLong crc32;                /* crc32 of all data uncompressed */
-       uLong crc32_wait;           /* crc32 we must obtain after decompress all */
-       uLong rest_read_compressed; /* number of byte to be decompressed */
-       uLong rest_read_uncompressed;/*number of byte to be obtained after decomp*/
-       FILE* file;                 /* io structore of the zipfile */
-       uLong compression_method;   /* compression method (0==store) */
-       uLong byte_before_the_zipfile;/* byte before the zipfile, (>0 for sfx)*/
-} file_in_zip_read_info_s;
-
-
-/* unz_s contain internal information about the zipfile
-*/
-typedef struct
-{
-       FILE* file;                 /* io structore of the zipfile */
-       unz_global_info gi;       /* public global information */
-       uLong byte_before_the_zipfile;/* byte before the zipfile, (>0 for sfx)*/
-       uLong num_file;             /* number of the current file in the zipfile*/
-       uLong pos_in_central_dir;   /* pos of the current file in the central dir*/
-       uLong current_file_ok;      /* flag about the usability of the current file*/
-       uLong central_pos;          /* position of the beginning of the central dir*/
-
-       uLong size_central_dir;     /* size of the central directory  */
-       uLong offset_central_dir;   /* offset of start of central directory with
-                                                                  respect to the starting disk number */
-
-       unz_file_info cur_file_info; /* public info about the current file in zip*/
-       unz_file_info_internal cur_file_info_internal; /* private info about it*/
-    file_in_zip_read_info_s* pfile_in_zip_read; /* structure about the current
-                                           file if we are decompressing it */
-} unz_s;
-
-
-/* ===========================================================================
-     Read a byte from a gz_stream; update next_in and avail_in. Return EOF
-   for end of file.
-   IN assertion: the stream s has been sucessfully opened for reading.
-*/
-
-
-local int unzlocal_getByte(fin,pi)
-       FILE *fin;
-       int *pi;
-{
-    unsigned char c;
-       int err = fread(&c, 1, 1, fin);
-    if (err==1)
-    {
-        *pi = (int)c;
-        return UNZ_OK;
-    }
-    else
-    {
-        if (ferror(fin)) 
-            return UNZ_ERRNO;
-        else
-            return UNZ_EOF;
-    }
-}
-
-
-/* ===========================================================================
-   Reads a long in LSB order from the given gz_stream. Sets 
-*/
-local int unzlocal_getShort (fin,pX)
-       FILE* fin;
-    uLong *pX;
-{
-    uLong x ;
-    int i;
-    int err;
-
-    err = unzlocal_getByte(fin,&i);
-    x = (uLong)i;
-    
-    if (err==UNZ_OK)
-        err = unzlocal_getByte(fin,&i);
-    x += ((uLong)i)<<8;
-   
-    if (err==UNZ_OK)
-        *pX = x;
-    else
-        *pX = 0;
-    return err;
-}
-
-local int unzlocal_getLong (fin,pX)
-       FILE* fin;
-    uLong *pX;
-{
-    uLong x ;
-    int i;
-    int err;
-
-    err = unzlocal_getByte(fin,&i);
-    x = (uLong)i;
-    
-    if (err==UNZ_OK)
-        err = unzlocal_getByte(fin,&i);
-    x += ((uLong)i)<<8;
-
-    if (err==UNZ_OK)
-        err = unzlocal_getByte(fin,&i);
-    x += ((uLong)i)<<16;
-
-    if (err==UNZ_OK)
-        err = unzlocal_getByte(fin,&i);
-    x += ((uLong)i)<<24;
-   
-    if (err==UNZ_OK)
-        *pX = x;
-    else
-        *pX = 0;
-    return err;
-}
-
-
-/* My own strcmpi / strcasecmp */
-local int strcmpcasenosensitive_internal (fileName1,fileName2)
-       const char* fileName1;
-       const char* fileName2;
-{
-       for (;;)
-       {
-               char c1=*(fileName1++);
-               char c2=*(fileName2++);
-               if ((c1>='a') && (c1<='z'))
-                       c1 -= 0x20;
-               if ((c2>='a') && (c2<='z'))
-                       c2 -= 0x20;
-               if (c1=='\0')
-                       return ((c2=='\0') ? 0 : -1);
-               if (c2=='\0')
-                       return 1;
-               if (c1<c2)
-                       return -1;
-               if (c1>c2)
-                       return 1;
-       }
-}
-
-
-#ifdef  CASESENSITIVITYDEFAULT_NO
-#define CASESENSITIVITYDEFAULTVALUE 2
-#else
-#define CASESENSITIVITYDEFAULTVALUE 1
-#endif
-
-#ifndef STRCMPCASENOSENTIVEFUNCTION
-#define STRCMPCASENOSENTIVEFUNCTION strcmpcasenosensitive_internal
-#endif
-
-/* 
-   Compare two filename (fileName1,fileName2).
-   If iCaseSenisivity = 1, comparision is case sensitivity (like strcmp)
-   If iCaseSenisivity = 2, comparision is not case sensitivity (like strcmpi
-                                                                or strcasecmp)
-   If iCaseSenisivity = 0, case sensitivity is defaut of your operating system
-        (like 1 on Unix, 2 on Windows)
-
-*/
-extern int ZEXPORT unzStringFileNameCompare (fileName1,fileName2,iCaseSensitivity)
-       const char* fileName1;
-       const char* fileName2;
-       int iCaseSensitivity;
-{
-       if (iCaseSensitivity==0)
-               iCaseSensitivity=CASESENSITIVITYDEFAULTVALUE;
-
-       if (iCaseSensitivity==1)
-               return strcmp(fileName1,fileName2);
-
-       return STRCMPCASENOSENTIVEFUNCTION(fileName1,fileName2);
-} 
-
-#define BUFREADCOMMENT (0x400)
-
-/*
-  Locate the Central directory of a zipfile (at the end, just before
-    the global comment)
-*/
-local uLong unzlocal_SearchCentralDir(fin)
-       FILE *fin;
-{
-       unsigned char* buf;
-       uLong uSizeFile;
-       uLong uBackRead;
-       uLong uMaxBack=0xffff; /* maximum size of global comment */
-       uLong uPosFound=0;
-       
-       if (fseek(fin,0,SEEK_END) != 0)
-               return 0;
-
-
-       uSizeFile = ftell( fin );
-       
-       if (uMaxBack>uSizeFile)
-               uMaxBack = uSizeFile;
-
-       buf = (unsigned char*)ALLOC(BUFREADCOMMENT+4);
-       if (buf==NULL)
-               return 0;
-
-       uBackRead = 4;
-       while (uBackRead<uMaxBack)
-       {
-               uLong uReadSize,uReadPos ;
-               int i;
-               if (uBackRead+BUFREADCOMMENT>uMaxBack) 
-                       uBackRead = uMaxBack;
-               else
-                       uBackRead+=BUFREADCOMMENT;
-               uReadPos = uSizeFile-uBackRead ;
-               
-               uReadSize = ((BUFREADCOMMENT+4) < (uSizeFile-uReadPos)) ? 
-                     (BUFREADCOMMENT+4) : (uSizeFile-uReadPos);
-               if (fseek(fin,uReadPos,SEEK_SET)!=0)
-                       break;
-
-               if (fread(buf,(uInt)uReadSize,1,fin)!=1)
-                       break;
-
-                for (i=(int)uReadSize-3; (i--)>0;)
-                       if (((*(buf+i))==0x50) && ((*(buf+i+1))==0x4b) && 
-                               ((*(buf+i+2))==0x05) && ((*(buf+i+3))==0x06))
-                       {
-                               uPosFound = uReadPos+i;
-                               break;
-                       }
-
-               if (uPosFound!=0)
-                       break;
-       }
-       TRYFREE(buf);
-       return uPosFound;
-}
-
-/*
-  Open a Zip file. path contain the full pathname (by example,
-     on a Windows NT computer "c:\\test\\zlib109.zip" or on an Unix computer
-        "zlib/zlib109.zip".
-        If the zipfile cannot be opened (file don't exist or in not valid), the
-          return value is NULL.
-     Else, the return value is a unzFile Handle, usable with other function
-          of this unzip package.
-*/
-extern unzFile ZEXPORT unzOpen (path)
-       const char *path;
-{
-       unz_s us;
-       unz_s *s;
-       uLong central_pos,uL;
-       FILE * fin ;
-
-       uLong number_disk;          /* number of the current dist, used for 
-                                                                  spaning ZIP, unsupported, always 0*/
-       uLong number_disk_with_CD;  /* number the the disk with central dir, used
-                                                                  for spaning ZIP, unsupported, always 0*/
-       uLong number_entry_CD;      /* total number of entries in
-                                      the central dir 
-                                      (same than number_entry on nospan) */
-
-       int err=UNZ_OK;
-
-    if (unz_copyright[0]!=' ')
-        return NULL;
-
-    fin=fopen(path,"rb");
-       if (fin==NULL)
-               return NULL;
-
-       central_pos = unzlocal_SearchCentralDir(fin);
-       if (central_pos==0)
-               err=UNZ_ERRNO;
-
-       if (fseek(fin,central_pos,SEEK_SET)!=0)
-               err=UNZ_ERRNO;
-
-       /* the signature, already checked */
-       if (unzlocal_getLong(fin,&uL)!=UNZ_OK)
-               err=UNZ_ERRNO;
-
-       /* number of this disk */
-       if (unzlocal_getShort(fin,&number_disk)!=UNZ_OK)
-               err=UNZ_ERRNO;
-
-       /* number of the disk with the start of the central directory */
-       if (unzlocal_getShort(fin,&number_disk_with_CD)!=UNZ_OK)
-               err=UNZ_ERRNO;
-
-       /* total number of entries in the central dir on this disk */
-       if (unzlocal_getShort(fin,&us.gi.number_entry)!=UNZ_OK)
-               err=UNZ_ERRNO;
-
-       /* total number of entries in the central dir */
-       if (unzlocal_getShort(fin,&number_entry_CD)!=UNZ_OK)
-               err=UNZ_ERRNO;
-
-       if ((number_entry_CD!=us.gi.number_entry) ||
-               (number_disk_with_CD!=0) ||
-               (number_disk!=0))
-               err=UNZ_BADZIPFILE;
-
-       /* size of the central directory */
-       if (unzlocal_getLong(fin,&us.size_central_dir)!=UNZ_OK)
-               err=UNZ_ERRNO;
-
-       /* offset of start of central directory with respect to the 
-             starting disk number */
-       if (unzlocal_getLong(fin,&us.offset_central_dir)!=UNZ_OK)
-               err=UNZ_ERRNO;
-
-       /* zipfile comment length */
-       if (unzlocal_getShort(fin,&us.gi.size_comment)!=UNZ_OK)
-               err=UNZ_ERRNO;
-
-       if ((central_pos<us.offset_central_dir+us.size_central_dir) && 
-               (err==UNZ_OK))
-               err=UNZ_BADZIPFILE;
-
-       if (err!=UNZ_OK)
-       {
-               fclose(fin);
-               return NULL;
-       }
-
-       us.file=fin;
-       us.byte_before_the_zipfile = central_pos -
-                                   (us.offset_central_dir+us.size_central_dir);
-       us.central_pos = central_pos;
-    us.pfile_in_zip_read = NULL;
-       
-
-       s=(unz_s*)ALLOC(sizeof(unz_s));
-       *s=us;
-       unzGoToFirstFile((unzFile)s);   
-       return (unzFile)s;      
-}
-
-
-/*
-  Close a ZipFile opened with unzipOpen.
-  If there is files inside the .Zip opened with unzipOpenCurrentFile (see later),
-    these files MUST be closed with unzipCloseCurrentFile before call unzipClose.
-  return UNZ_OK if there is no problem. */
-extern int ZEXPORT unzClose (file)
-       unzFile file;
-{
-       unz_s* s;
-       if (file==NULL)
-               return UNZ_PARAMERROR;
-       s=(unz_s*)file;
-
-    if (s->pfile_in_zip_read!=NULL)
-        unzCloseCurrentFile(file);
-
-       fclose(s->file);
-       TRYFREE(s);
-       return UNZ_OK;
-}
-
-
-/*
-  Write info about the ZipFile in the *pglobal_info structure.
-  No preparation of the structure is needed
-  return UNZ_OK if there is no problem. */
-extern int ZEXPORT unzGetGlobalInfo (file,pglobal_info)
-       unzFile file;
-       unz_global_info *pglobal_info;
-{
-       unz_s* s;
-       if (file==NULL)
-               return UNZ_PARAMERROR;
-       s=(unz_s*)file;
-       *pglobal_info=s->gi;
-       return UNZ_OK;
-}
-
-
-/*
-   Translate date/time from Dos format to tm_unz (readable more easilty)
-*/
-local void unzlocal_DosDateToTmuDate (ulDosDate, ptm)
-    uLong ulDosDate;
-    tm_unz* ptm;
-{
-    uLong uDate;
-    uDate = (uLong)(ulDosDate>>16);
-    ptm->tm_mday = (uInt)(uDate&0x1f) ;
-    ptm->tm_mon =  (uInt)((((uDate)&0x1E0)/0x20)-1) ;
-    ptm->tm_year = (uInt)(((uDate&0x0FE00)/0x0200)+1980) ;
-
-    ptm->tm_hour = (uInt) ((ulDosDate &0xF800)/0x800);
-    ptm->tm_min =  (uInt) ((ulDosDate&0x7E0)/0x20) ;
-    ptm->tm_sec =  (uInt) (2*(ulDosDate&0x1f)) ;
-}
-
-/*
-  Get Info about the current file in the zipfile, with internal only info
-*/
-local int unzlocal_GetCurrentFileInfoInternal OF((unzFile file,
-                                                  unz_file_info *pfile_info,
-                                                  unz_file_info_internal 
-                                                  *pfile_info_internal,
-                                                  char *szFileName,
-                                                                                                 uLong fileNameBufferSize,
-                                                  void *extraField,
-                                                                                                 uLong extraFieldBufferSize,
-                                                  char *szComment,
-                                                                                                 uLong commentBufferSize));
-
-local int unzlocal_GetCurrentFileInfoInternal (file,
-                                              pfile_info,
-                                              pfile_info_internal,
-                                              szFileName, fileNameBufferSize,
-                                              extraField, extraFieldBufferSize,
-                                              szComment,  commentBufferSize)
-       unzFile file;
-       unz_file_info *pfile_info;
-       unz_file_info_internal *pfile_info_internal;
-       char *szFileName;
-       uLong fileNameBufferSize;
-       void *extraField;
-       uLong extraFieldBufferSize;
-       char *szComment;
-       uLong commentBufferSize;
-{
-       unz_s* s;
-       unz_file_info file_info;
-       unz_file_info_internal file_info_internal;
-       int err=UNZ_OK;
-       uLong uMagic;
-       long lSeek=0;
-
-       if (file==NULL)
-               return UNZ_PARAMERROR;
-       s=(unz_s*)file;
-       if (fseek(s->file,s->pos_in_central_dir+s->byte_before_the_zipfile,SEEK_SET)!=0)
-               err=UNZ_ERRNO;
-
-
-       /* we check the magic */
-       if (err==UNZ_OK)
-               if (unzlocal_getLong(s->file,&uMagic) != UNZ_OK)
-                       err=UNZ_ERRNO;
-               else if (uMagic!=0x02014b50)
-                       err=UNZ_BADZIPFILE;
-
-       if (unzlocal_getShort(s->file,&file_info.version) != UNZ_OK)
-               err=UNZ_ERRNO;
-
-       if (unzlocal_getShort(s->file,&file_info.version_needed) != UNZ_OK)
-               err=UNZ_ERRNO;
-
-       if (unzlocal_getShort(s->file,&file_info.flag) != UNZ_OK)
-               err=UNZ_ERRNO;
-
-       if (unzlocal_getShort(s->file,&file_info.compression_method) != UNZ_OK)
-               err=UNZ_ERRNO;
-
-       if (unzlocal_getLong(s->file,&file_info.dosDate) != UNZ_OK)
-               err=UNZ_ERRNO;
-
-    unzlocal_DosDateToTmuDate(file_info.dosDate,&file_info.tmu_date);
-
-       if (unzlocal_getLong(s->file,&file_info.crc) != UNZ_OK)
-               err=UNZ_ERRNO;
-
-       if (unzlocal_getLong(s->file,&file_info.compressed_size) != UNZ_OK)
-               err=UNZ_ERRNO;
-
-       if (unzlocal_getLong(s->file,&file_info.uncompressed_size) != UNZ_OK)
-               err=UNZ_ERRNO;
-
-       if (unzlocal_getShort(s->file,&file_info.size_filename) != UNZ_OK)
-               err=UNZ_ERRNO;
-
-       if (unzlocal_getShort(s->file,&file_info.size_file_extra) != UNZ_OK)
-               err=UNZ_ERRNO;
-
-       if (unzlocal_getShort(s->file,&file_info.size_file_comment) != UNZ_OK)
-               err=UNZ_ERRNO;
-
-       if (unzlocal_getShort(s->file,&file_info.disk_num_start) != UNZ_OK)
-               err=UNZ_ERRNO;
-
-       if (unzlocal_getShort(s->file,&file_info.internal_fa) != UNZ_OK)
-               err=UNZ_ERRNO;
-
-       if (unzlocal_getLong(s->file,&file_info.external_fa) != UNZ_OK)
-               err=UNZ_ERRNO;
-
-       if (unzlocal_getLong(s->file,&file_info_internal.offset_curfile) != UNZ_OK)
-               err=UNZ_ERRNO;
-
-       lSeek+=file_info.size_filename;
-       if ((err==UNZ_OK) && (szFileName!=NULL))
-       {
-               uLong uSizeRead ;
-               if (file_info.size_filename<fileNameBufferSize)
-               {
-                       *(szFileName+file_info.size_filename)='\0';
-                       uSizeRead = file_info.size_filename;
-               }
-               else
-                       uSizeRead = fileNameBufferSize;
-
-               if ((file_info.size_filename>0) && (fileNameBufferSize>0))
-                       if (fread(szFileName,(uInt)uSizeRead,1,s->file)!=1)
-                               err=UNZ_ERRNO;
-               lSeek -= uSizeRead;
-       }
-
-       
-       if ((err==UNZ_OK) && (extraField!=NULL))
-       {
-               uLong uSizeRead ;
-               if (file_info.size_file_extra<extraFieldBufferSize)
-                       uSizeRead = file_info.size_file_extra;
-               else
-                       uSizeRead = extraFieldBufferSize;
-
-               if (lSeek!=0)
-                       if (fseek(s->file,lSeek,SEEK_CUR)==0)
-                               lSeek=0;
-                       else
-                               err=UNZ_ERRNO;
-               if ((file_info.size_file_extra>0) && (extraFieldBufferSize>0))
-                       if (fread(extraField,(uInt)uSizeRead,1,s->file)!=1)
-                               err=UNZ_ERRNO;
-               lSeek += file_info.size_file_extra - uSizeRead;
-       }
-       else
-               lSeek+=file_info.size_file_extra; 
-
-       
-       if ((err==UNZ_OK) && (szComment!=NULL))
-       {
-               uLong uSizeRead ;
-               if (file_info.size_file_comment<commentBufferSize)
-               {
-                       *(szComment+file_info.size_file_comment)='\0';
-                       uSizeRead = file_info.size_file_comment;
-               }
-               else
-                       uSizeRead = commentBufferSize;
-
-               if (lSeek!=0)
-                       if (fseek(s->file,lSeek,SEEK_CUR)==0)
-                               lSeek=0;
-                       else
-                               err=UNZ_ERRNO;
-               if ((file_info.size_file_comment>0) && (commentBufferSize>0))
-                       if (fread(szComment,(uInt)uSizeRead,1,s->file)!=1)
-                               err=UNZ_ERRNO;
-               lSeek+=file_info.size_file_comment - uSizeRead;
-       }
-       else
-               lSeek+=file_info.size_file_comment;
-
-       if ((err==UNZ_OK) && (pfile_info!=NULL))
-               *pfile_info=file_info;
-
-       if ((err==UNZ_OK) && (pfile_info_internal!=NULL))
-               *pfile_info_internal=file_info_internal;
-
-       return err;
-}
-
-
-
-/*
-  Write info about the ZipFile in the *pglobal_info structure.
-  No preparation of the structure is needed
-  return UNZ_OK if there is no problem.
-*/
-extern int ZEXPORT unzGetCurrentFileInfo (file,
-                                                  pfile_info,
-                                                  szFileName, fileNameBufferSize,
-                                                  extraField, extraFieldBufferSize,
-                                                  szComment,  commentBufferSize)
-       unzFile file;
-       unz_file_info *pfile_info;
-       char *szFileName;
-       uLong fileNameBufferSize;
-       void *extraField;
-       uLong extraFieldBufferSize;
-       char *szComment;
-       uLong commentBufferSize;
-{
-       return unzlocal_GetCurrentFileInfoInternal(file,pfile_info,NULL,
-                                                                                               szFileName,fileNameBufferSize,
-                                                                                               extraField,extraFieldBufferSize,
-                                                                                               szComment,commentBufferSize);
-}
-
-/*
-  Set the current file of the zipfile to the first file.
-  return UNZ_OK if there is no problem
-*/
-extern int ZEXPORT unzGoToFirstFile (file)
-       unzFile file;
-{
-       int err=UNZ_OK;
-       unz_s* s;
-       if (file==NULL)
-               return UNZ_PARAMERROR;
-       s=(unz_s*)file;
-       s->pos_in_central_dir=s->offset_central_dir;
-       s->num_file=0;
-       err=unzlocal_GetCurrentFileInfoInternal(file,&s->cur_file_info,
-                                                                                        &s->cur_file_info_internal,
-                                                                                        NULL,0,NULL,0,NULL,0);
-       s->current_file_ok = (err == UNZ_OK);
-       return err;
-}
-
-
-/*
-  Set the current file of the zipfile to the next file.
-  return UNZ_OK if there is no problem
-  return UNZ_END_OF_LIST_OF_FILE if the actual file was the latest.
-*/
-extern int ZEXPORT unzGoToNextFile (file)
-       unzFile file;
-{
-       unz_s* s;       
-       int err;
-
-       if (file==NULL)
-               return UNZ_PARAMERROR;
-       s=(unz_s*)file;
-       if (!s->current_file_ok)
-               return UNZ_END_OF_LIST_OF_FILE;
-       if (s->num_file+1==s->gi.number_entry)
-               return UNZ_END_OF_LIST_OF_FILE;
-
-       s->pos_in_central_dir += SIZECENTRALDIRITEM + s->cur_file_info.size_filename +
-                       s->cur_file_info.size_file_extra + s->cur_file_info.size_file_comment ;
-       s->num_file++;
-       err = unzlocal_GetCurrentFileInfoInternal(file,&s->cur_file_info,
-                                                                                          &s->cur_file_info_internal,
-                                                                                          NULL,0,NULL,0,NULL,0);
-       s->current_file_ok = (err == UNZ_OK);
-       return err;
-}
-
-
-/*
-  Try locate the file szFileName in the zipfile.
-  For the iCaseSensitivity signification, see unzipStringFileNameCompare
-
-  return value :
-  UNZ_OK if the file is found. It becomes the current file.
-  UNZ_END_OF_LIST_OF_FILE if the file is not found
-*/
-extern int ZEXPORT unzLocateFile (file, szFileName, iCaseSensitivity)
-       unzFile file;
-       const char *szFileName;
-       int iCaseSensitivity;
-{
-       unz_s* s;       
-       int err;
-
-       
-       uLong num_fileSaved;
-       uLong pos_in_central_dirSaved;
-
-
-       if (file==NULL)
-               return UNZ_PARAMERROR;
-
-    if (strlen(szFileName)>=UNZ_MAXFILENAMEINZIP)
-        return UNZ_PARAMERROR;
-
-       s=(unz_s*)file;
-       if (!s->current_file_ok)
-               return UNZ_END_OF_LIST_OF_FILE;
-
-       num_fileSaved = s->num_file;
-       pos_in_central_dirSaved = s->pos_in_central_dir;
-
-       err = unzGoToFirstFile(file);
-
-       while (err == UNZ_OK)
-       {
-               char szCurrentFileName[UNZ_MAXFILENAMEINZIP+1];
-               unzGetCurrentFileInfo(file,NULL,
-                                                               szCurrentFileName,sizeof(szCurrentFileName)-1,
-                                                               NULL,0,NULL,0);
-               if (unzStringFileNameCompare(szCurrentFileName,
-                                                                               szFileName,iCaseSensitivity)==0)
-                       return UNZ_OK;
-               err = unzGoToNextFile(file);
-       }
-
-       s->num_file = num_fileSaved ;
-       s->pos_in_central_dir = pos_in_central_dirSaved ;
-       return err;
-}
-
-
-/*
-  Read the local header of the current zipfile
-  Check the coherency of the local header and info in the end of central
-        directory about this file
-  store in *piSizeVar the size of extra info in local header
-        (filename and size of extra field data)
-*/
-local int unzlocal_CheckCurrentFileCoherencyHeader (s,piSizeVar,
-                                                                                                       poffset_local_extrafield,
-                                                                                                       psize_local_extrafield)
-       unz_s* s;
-       uInt* piSizeVar;
-       uLong *poffset_local_extrafield;
-       uInt  *psize_local_extrafield;
-{
-       uLong uMagic,uData,uFlags;
-       uLong size_filename;
-       uLong size_extra_field;
-       int err=UNZ_OK;
-
-       *piSizeVar = 0;
-       *poffset_local_extrafield = 0;
-       *psize_local_extrafield = 0;
-
-       if (fseek(s->file,s->cur_file_info_internal.offset_curfile +
-                                                               s->byte_before_the_zipfile,SEEK_SET)!=0)
-               return UNZ_ERRNO;
-
-
-       if (err==UNZ_OK)
-               if (unzlocal_getLong(s->file,&uMagic) != UNZ_OK)
-                       err=UNZ_ERRNO;
-               else if (uMagic!=0x04034b50)
-                       err=UNZ_BADZIPFILE;
-
-       if (unzlocal_getShort(s->file,&uData) != UNZ_OK)
-               err=UNZ_ERRNO;
-/*
-       else if ((err==UNZ_OK) && (uData!=s->cur_file_info.wVersion))
-               err=UNZ_BADZIPFILE;
-*/
-       if (unzlocal_getShort(s->file,&uFlags) != UNZ_OK)
-               err=UNZ_ERRNO;
-
-       if (unzlocal_getShort(s->file,&uData) != UNZ_OK)
-               err=UNZ_ERRNO;
-       else if ((err==UNZ_OK) && (uData!=s->cur_file_info.compression_method))
-               err=UNZ_BADZIPFILE;
-
-    if ((err==UNZ_OK) && (s->cur_file_info.compression_method!=0) &&
-                         (s->cur_file_info.compression_method!=Z_DEFLATED))
-        err=UNZ_BADZIPFILE;
-
-       if (unzlocal_getLong(s->file,&uData) != UNZ_OK) /* date/time */
-               err=UNZ_ERRNO;
-
-       if (unzlocal_getLong(s->file,&uData) != UNZ_OK) /* crc */
-               err=UNZ_ERRNO;
-       else if ((err==UNZ_OK) && (uData!=s->cur_file_info.crc) &&
-                                     ((uFlags & 8)==0))
-               err=UNZ_BADZIPFILE;
-
-       if (unzlocal_getLong(s->file,&uData) != UNZ_OK) /* size compr */
-               err=UNZ_ERRNO;
-       else if ((err==UNZ_OK) && (uData!=s->cur_file_info.compressed_size) &&
-                                                         ((uFlags & 8)==0))
-               err=UNZ_BADZIPFILE;
-
-       if (unzlocal_getLong(s->file,&uData) != UNZ_OK) /* size uncompr */
-               err=UNZ_ERRNO;
-       else if ((err==UNZ_OK) && (uData!=s->cur_file_info.uncompressed_size) && 
-                                                         ((uFlags & 8)==0))
-               err=UNZ_BADZIPFILE;
-
-
-       if (unzlocal_getShort(s->file,&size_filename) != UNZ_OK)
-               err=UNZ_ERRNO;
-       else if ((err==UNZ_OK) && (size_filename!=s->cur_file_info.size_filename))
-               err=UNZ_BADZIPFILE;
-
-       *piSizeVar += (uInt)size_filename;
-
-       if (unzlocal_getShort(s->file,&size_extra_field) != UNZ_OK)
-               err=UNZ_ERRNO;
-       *poffset_local_extrafield= s->cur_file_info_internal.offset_curfile +
-                                                                       SIZEZIPLOCALHEADER + size_filename;
-       *psize_local_extrafield = (uInt)size_extra_field;
-
-       *piSizeVar += (uInt)size_extra_field;
-
-       return err;
-}
-                                                                                               
-/*
-  Open for reading data the current file in the zipfile.
-  If there is no error and the file is opened, the return value is UNZ_OK.
-*/
-extern int ZEXPORT unzOpenCurrentFile (file)
-       unzFile file;
-{
-       int err=UNZ_OK;
-       int Store;
-       uInt iSizeVar;
-       unz_s* s;
-       file_in_zip_read_info_s* pfile_in_zip_read_info;
-       uLong offset_local_extrafield;  /* offset of the local extra field */
-       uInt  size_local_extrafield;    /* size of the local extra field */
-
-       if (file==NULL)
-               return UNZ_PARAMERROR;
-       s=(unz_s*)file;
-       if (!s->current_file_ok)
-               return UNZ_PARAMERROR;
-
-    if (s->pfile_in_zip_read != NULL)
-        unzCloseCurrentFile(file);
-
-       if (unzlocal_CheckCurrentFileCoherencyHeader(s,&iSizeVar,
-                               &offset_local_extrafield,&size_local_extrafield)!=UNZ_OK)
-               return UNZ_BADZIPFILE;
-
-       pfile_in_zip_read_info = (file_in_zip_read_info_s*)
-                                                                           ALLOC(sizeof(file_in_zip_read_info_s));
-       if (pfile_in_zip_read_info==NULL)
-               return UNZ_INTERNALERROR;
-
-       pfile_in_zip_read_info->read_buffer=(char*)ALLOC(UNZ_BUFSIZE);
-       pfile_in_zip_read_info->offset_local_extrafield = offset_local_extrafield;
-       pfile_in_zip_read_info->size_local_extrafield = size_local_extrafield;
-       pfile_in_zip_read_info->pos_local_extrafield=0;
-
-       if (pfile_in_zip_read_info->read_buffer==NULL)
-       {
-               TRYFREE(pfile_in_zip_read_info);
-               return UNZ_INTERNALERROR;
-       }
-
-       pfile_in_zip_read_info->stream_initialised=0;
-       
-       if ((s->cur_file_info.compression_method!=0) &&
-        (s->cur_file_info.compression_method!=Z_DEFLATED))
-               err=UNZ_BADZIPFILE;
-       Store = s->cur_file_info.compression_method==0;
-
-       pfile_in_zip_read_info->crc32_wait=s->cur_file_info.crc;
-       pfile_in_zip_read_info->crc32=0;
-       pfile_in_zip_read_info->compression_method =
-            s->cur_file_info.compression_method;
-       pfile_in_zip_read_info->file=s->file;
-       pfile_in_zip_read_info->byte_before_the_zipfile=s->byte_before_the_zipfile;
-
-    pfile_in_zip_read_info->stream.total_out = 0;
-
-       if (!Store)
-       {
-         pfile_in_zip_read_info->stream.zalloc = (alloc_func)0;
-         pfile_in_zip_read_info->stream.zfree = (free_func)0;
-         pfile_in_zip_read_info->stream.opaque = (voidpf)0; 
-      
-         err=inflateInit2(&pfile_in_zip_read_info->stream, -MAX_WBITS);
-         if (err == Z_OK)
-           pfile_in_zip_read_info->stream_initialised=1;
-        /* windowBits is passed < 0 to tell that there is no zlib header.
-         * Note that in this case inflate *requires* an extra "dummy" byte
-         * after the compressed stream in order to complete decompression and
-         * return Z_STREAM_END. 
-         * In unzip, i don't wait absolutely Z_STREAM_END because I known the 
-         * size of both compressed and uncompressed data
-         */
-       }
-       pfile_in_zip_read_info->rest_read_compressed = 
-            s->cur_file_info.compressed_size ;
-       pfile_in_zip_read_info->rest_read_uncompressed = 
-            s->cur_file_info.uncompressed_size ;
-
-       
-       pfile_in_zip_read_info->pos_in_zipfile = 
-            s->cur_file_info_internal.offset_curfile + SIZEZIPLOCALHEADER + 
-                         iSizeVar;
-       
-       pfile_in_zip_read_info->stream.avail_in = (uInt)0;
-
-
-       s->pfile_in_zip_read = pfile_in_zip_read_info;
-    return UNZ_OK;
-}
-
-
-/*
-  Read bytes from the current file.
-  buf contain buffer where data must be copied
-  len the size of buf.
-
-  return the number of byte copied if somes bytes are copied
-  return 0 if the end of file was reached
-  return <0 with error code if there is an error
-    (UNZ_ERRNO for IO error, or zLib error for uncompress error)
-*/
-extern int ZEXPORT unzReadCurrentFile  (file, buf, len)
-       unzFile file;
-       voidp buf;
-       unsigned len;
-{
-       int err=UNZ_OK;
-       uInt iRead = 0;
-       unz_s* s;
-       file_in_zip_read_info_s* pfile_in_zip_read_info;
-       if (file==NULL)
-               return UNZ_PARAMERROR;
-       s=(unz_s*)file;
-    pfile_in_zip_read_info=s->pfile_in_zip_read;
-
-       if (pfile_in_zip_read_info==NULL)
-               return UNZ_PARAMERROR;
-
-
-       if ((pfile_in_zip_read_info->read_buffer == NULL))
-               return UNZ_END_OF_LIST_OF_FILE;
-       if (len==0)
-               return 0;
-
-       pfile_in_zip_read_info->stream.next_out = (Bytef*)buf;
-
-       pfile_in_zip_read_info->stream.avail_out = (uInt)len;
-       
-       if (len>pfile_in_zip_read_info->rest_read_uncompressed)
-               pfile_in_zip_read_info->stream.avail_out = 
-                 (uInt)pfile_in_zip_read_info->rest_read_uncompressed;
-
-       while (pfile_in_zip_read_info->stream.avail_out>0)
-       {
-               if ((pfile_in_zip_read_info->stream.avail_in==0) &&
-            (pfile_in_zip_read_info->rest_read_compressed>0))
-               {
-                       uInt uReadThis = UNZ_BUFSIZE;
-                       if (pfile_in_zip_read_info->rest_read_compressed<uReadThis)
-                               uReadThis = (uInt)pfile_in_zip_read_info->rest_read_compressed;
-                       if (uReadThis == 0)
-                               return UNZ_EOF;
-                       if (fseek(pfile_in_zip_read_info->file,
-                      pfile_in_zip_read_info->pos_in_zipfile + 
-                         pfile_in_zip_read_info->byte_before_the_zipfile,SEEK_SET)!=0)
-                               return UNZ_ERRNO;
-                       if (fread(pfile_in_zip_read_info->read_buffer,uReadThis,1,
-                         pfile_in_zip_read_info->file)!=1)
-                               return UNZ_ERRNO;
-                       pfile_in_zip_read_info->pos_in_zipfile += uReadThis;
-
-                       pfile_in_zip_read_info->rest_read_compressed-=uReadThis;
-                       
-                       pfile_in_zip_read_info->stream.next_in = 
-                (Bytef*)pfile_in_zip_read_info->read_buffer;
-                       pfile_in_zip_read_info->stream.avail_in = (uInt)uReadThis;
-               }
-
-               if (pfile_in_zip_read_info->compression_method==0)
-               {
-                       uInt uDoCopy,i ;
-                       if (pfile_in_zip_read_info->stream.avail_out < 
-                            pfile_in_zip_read_info->stream.avail_in)
-                               uDoCopy = pfile_in_zip_read_info->stream.avail_out ;
-                       else
-                               uDoCopy = pfile_in_zip_read_info->stream.avail_in ;
-                               
-                       for (i=0;i<uDoCopy;i++)
-                               *(pfile_in_zip_read_info->stream.next_out+i) =
-                        *(pfile_in_zip_read_info->stream.next_in+i);
-                                       
-                       pfile_in_zip_read_info->crc32 = crc32(pfile_in_zip_read_info->crc32,
-                                                               pfile_in_zip_read_info->stream.next_out,
-                                                               uDoCopy);
-                       pfile_in_zip_read_info->rest_read_uncompressed-=uDoCopy;
-                       pfile_in_zip_read_info->stream.avail_in -= uDoCopy;
-                       pfile_in_zip_read_info->stream.avail_out -= uDoCopy;
-                       pfile_in_zip_read_info->stream.next_out += uDoCopy;
-                       pfile_in_zip_read_info->stream.next_in += uDoCopy;
-            pfile_in_zip_read_info->stream.total_out += uDoCopy;
-                       iRead += uDoCopy;
-               }
-               else
-               {
-                       uLong uTotalOutBefore,uTotalOutAfter;
-                       const Bytef *bufBefore;
-                       uLong uOutThis;
-                       int flush=Z_SYNC_FLUSH;
-
-                       uTotalOutBefore = pfile_in_zip_read_info->stream.total_out;
-                       bufBefore = pfile_in_zip_read_info->stream.next_out;
-
-                       /*
-                       if ((pfile_in_zip_read_info->rest_read_uncompressed ==
-                                pfile_in_zip_read_info->stream.avail_out) &&
-                               (pfile_in_zip_read_info->rest_read_compressed == 0))
-                               flush = Z_FINISH;
-                       */
-                       err=inflate(&pfile_in_zip_read_info->stream,flush);
-
-                       uTotalOutAfter = pfile_in_zip_read_info->stream.total_out;
-                       uOutThis = uTotalOutAfter-uTotalOutBefore;
-                       
-                       pfile_in_zip_read_info->crc32 = 
-                crc32(pfile_in_zip_read_info->crc32,bufBefore,
-                        (uInt)(uOutThis));
-
-                       pfile_in_zip_read_info->rest_read_uncompressed -=
-                uOutThis;
-
-                       iRead += (uInt)(uTotalOutAfter - uTotalOutBefore);
-            
-                       if (err==Z_STREAM_END)
-                               return (iRead==0) ? UNZ_EOF : iRead;
-                       if (err!=Z_OK) 
-                               break;
-               }
-       }
-
-       if (err==Z_OK)
-               return iRead;
-       return err;
-}
-
-
-/*
-  Give the current position in uncompressed data
-*/
-extern z_off_t ZEXPORT unztell (file)
-       unzFile file;
-{
-       unz_s* s;
-       file_in_zip_read_info_s* pfile_in_zip_read_info;
-       if (file==NULL)
-               return UNZ_PARAMERROR;
-       s=(unz_s*)file;
-    pfile_in_zip_read_info=s->pfile_in_zip_read;
-
-       if (pfile_in_zip_read_info==NULL)
-               return UNZ_PARAMERROR;
-
-       return (z_off_t)pfile_in_zip_read_info->stream.total_out;
-}
-
-
-/*
-  return 1 if the end of file was reached, 0 elsewhere 
-*/
-extern int ZEXPORT unzeof (file)
-       unzFile file;
-{
-       unz_s* s;
-       file_in_zip_read_info_s* pfile_in_zip_read_info;
-       if (file==NULL)
-               return UNZ_PARAMERROR;
-       s=(unz_s*)file;
-    pfile_in_zip_read_info=s->pfile_in_zip_read;
-
-       if (pfile_in_zip_read_info==NULL)
-               return UNZ_PARAMERROR;
-       
-       if (pfile_in_zip_read_info->rest_read_uncompressed == 0)
-               return 1;
-       else
-               return 0;
-}
-
-
-
-/*
-  Read extra field from the current file (opened by unzOpenCurrentFile)
-  This is the local-header version of the extra field (sometimes, there is
-    more info in the local-header version than in the central-header)
-
-  if buf==NULL, it return the size of the local extra field that can be read
-
-  if buf!=NULL, len is the size of the buffer, the extra header is copied in
-       buf.
-  the return value is the number of bytes copied in buf, or (if <0) 
-       the error code
-*/
-extern int ZEXPORT unzGetLocalExtrafield (file,buf,len)
-       unzFile file;
-       voidp buf;
-       unsigned len;
-{
-       unz_s* s;
-       file_in_zip_read_info_s* pfile_in_zip_read_info;
-       uInt read_now;
-       uLong size_to_read;
-
-       if (file==NULL)
-               return UNZ_PARAMERROR;
-       s=(unz_s*)file;
-    pfile_in_zip_read_info=s->pfile_in_zip_read;
-
-       if (pfile_in_zip_read_info==NULL)
-               return UNZ_PARAMERROR;
-
-       size_to_read = (pfile_in_zip_read_info->size_local_extrafield - 
-                               pfile_in_zip_read_info->pos_local_extrafield);
-
-       if (buf==NULL)
-               return (int)size_to_read;
-       
-       if (len>size_to_read)
-               read_now = (uInt)size_to_read;
-       else
-               read_now = (uInt)len ;
-
-       if (read_now==0)
-               return 0;
-       
-       if (fseek(pfile_in_zip_read_info->file,
-              pfile_in_zip_read_info->offset_local_extrafield + 
-                         pfile_in_zip_read_info->pos_local_extrafield,SEEK_SET)!=0)
-               return UNZ_ERRNO;
-
-       if (fread(buf,(uInt)size_to_read,1,pfile_in_zip_read_info->file)!=1)
-               return UNZ_ERRNO;
-
-       return (int)read_now;
-}
-
-/*
-  Close the file in zip opened with unzipOpenCurrentFile
-  Return UNZ_CRCERROR if all the file was read but the CRC is not good
-*/
-extern int ZEXPORT unzCloseCurrentFile (file)
-       unzFile file;
-{
-       int err=UNZ_OK;
-
-       unz_s* s;
-       file_in_zip_read_info_s* pfile_in_zip_read_info;
-       if (file==NULL)
-               return UNZ_PARAMERROR;
-       s=(unz_s*)file;
-    pfile_in_zip_read_info=s->pfile_in_zip_read;
-
-       if (pfile_in_zip_read_info==NULL)
-               return UNZ_PARAMERROR;
-
-
-       if (pfile_in_zip_read_info->rest_read_uncompressed == 0)
-       {
-               if (pfile_in_zip_read_info->crc32 != pfile_in_zip_read_info->crc32_wait)
-                       err=UNZ_CRCERROR;
-       }
-
-
-       TRYFREE(pfile_in_zip_read_info->read_buffer);
-       pfile_in_zip_read_info->read_buffer = NULL;
-       if (pfile_in_zip_read_info->stream_initialised)
-               inflateEnd(&pfile_in_zip_read_info->stream);
-
-       pfile_in_zip_read_info->stream_initialised = 0;
-       TRYFREE(pfile_in_zip_read_info);
-
-    s->pfile_in_zip_read=NULL;
-
-       return err;
-}
-
-
-/*
-  Get the global comment string of the ZipFile, in the szComment buffer.
-  uSizeBuf is the size of the szComment buffer.
-  return the number of byte copied or an error code <0
-*/
-extern int ZEXPORT unzGetGlobalComment (file, szComment, uSizeBuf)
-       unzFile file;
-       char *szComment;
-       uLong uSizeBuf;
-{
-       int err=UNZ_OK;
-       unz_s* s;
-       uLong uReadThis ;
-       if (file==NULL)
-               return UNZ_PARAMERROR;
-       s=(unz_s*)file;
-
-       uReadThis = uSizeBuf;
-       if (uReadThis>s->gi.size_comment)
-               uReadThis = s->gi.size_comment;
-
-       if (fseek(s->file,s->central_pos+22,SEEK_SET)!=0)
-               return UNZ_ERRNO;
-
-       if (uReadThis>0)
-    {
-      *szComment='\0';
-         if (fread(szComment,(uInt)uReadThis,1,s->file)!=1)
-               return UNZ_ERRNO;
-    }
-
-       if ((szComment != NULL) && (uSizeBuf > s->gi.size_comment))
-               *(szComment+s->gi.size_comment)='\0';
-       return (int)uReadThis;
-}
diff --git a/lib/zlib/contrib/minizip/unzip.def b/lib/zlib/contrib/minizip/unzip.def
deleted file mode 100644 (file)
index f6ede89..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-       unzOpen                       @61
-       unzClose                      @62
-       unzGetGlobalInfo              @63
-       unzGetCurrentFileInfo         @64
-       unzGoToFirstFile              @65
-       unzGoToNextFile               @66
-       unzOpenCurrentFile            @67
-       unzReadCurrentFile            @68
-       unztell                       @70
-       unzeof                        @71
-       unzCloseCurrentFile           @72
-       unzGetGlobalComment           @73
-       unzStringFileNameCompare      @74
-       unzLocateFile                 @75
-       unzGetLocalExtrafield         @76
diff --git a/lib/zlib/contrib/minizip/unzip.h b/lib/zlib/contrib/minizip/unzip.h
deleted file mode 100644 (file)
index 76692cb..0000000
+++ /dev/null
@@ -1,275 +0,0 @@
-/* unzip.h -- IO for uncompress .zip files using zlib 
-   Version 0.15 beta, Mar 19th, 1998,
-
-   Copyright (C) 1998 Gilles Vollant
-
-   This unzip package allow extract file from .ZIP file, compatible with PKZip 2.04g
-     WinZip, InfoZip tools and compatible.
-   Encryption and multi volume ZipFile (span) are not supported.
-   Old compressions used by old PKZip 1.x are not supported
-
-   THIS IS AN ALPHA VERSION. AT THIS STAGE OF DEVELOPPEMENT, SOMES API OR STRUCTURE
-   CAN CHANGE IN FUTURE VERSION !!
-   I WAIT FEEDBACK at mail info@winimage.com
-   Visit also http://www.winimage.com/zLibDll/unzip.htm for evolution
-
-   Condition of use and distribution are the same than zlib :
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-
-
-*/
-/* for more info about .ZIP format, see 
-      ftp://ftp.cdrom.com/pub/infozip/doc/appnote-970311-iz.zip
-   PkWare has also a specification at :
-      ftp://ftp.pkware.com/probdesc.zip */
-
-#ifndef _unz_H
-#define _unz_H
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifndef _ZLIB_H
-#include "zlib.h"
-#endif
-
-#if defined(STRICTUNZIP) || defined(STRICTZIPUNZIP)
-/* like the STRICT of WIN32, we define a pointer that cannot be converted
-    from (void*) without cast */
-typedef struct TagunzFile__ { int unused; } unzFile__; 
-typedef unzFile__ *unzFile;
-#else
-typedef voidp unzFile;
-#endif
-
-
-#define UNZ_OK                                  (0)
-#define UNZ_END_OF_LIST_OF_FILE (-100)
-#define UNZ_ERRNO               (Z_ERRNO)
-#define UNZ_EOF                 (0)
-#define UNZ_PARAMERROR                  (-102)
-#define UNZ_BADZIPFILE                  (-103)
-#define UNZ_INTERNALERROR               (-104)
-#define UNZ_CRCERROR                    (-105)
-
-/* tm_unz contain date/time info */
-typedef struct tm_unz_s 
-{
-       uInt tm_sec;            /* seconds after the minute - [0,59] */
-       uInt tm_min;            /* minutes after the hour - [0,59] */
-       uInt tm_hour;           /* hours since midnight - [0,23] */
-       uInt tm_mday;           /* day of the month - [1,31] */
-       uInt tm_mon;            /* months since January - [0,11] */
-       uInt tm_year;           /* years - [1980..2044] */
-} tm_unz;
-
-/* unz_global_info structure contain global data about the ZIPfile
-   These data comes from the end of central dir */
-typedef struct unz_global_info_s
-{
-       uLong number_entry;         /* total number of entries in
-                                      the central dir on this disk */
-       uLong size_comment;         /* size of the global comment of the zipfile */
-} unz_global_info;
-
-
-/* unz_file_info contain information about a file in the zipfile */
-typedef struct unz_file_info_s
-{
-    uLong version;              /* version made by                 2 bytes */
-    uLong version_needed;       /* version needed to extract       2 bytes */
-    uLong flag;                 /* general purpose bit flag        2 bytes */
-    uLong compression_method;   /* compression method              2 bytes */
-    uLong dosDate;              /* last mod file date in Dos fmt   4 bytes */
-    uLong crc;                  /* crc-32                          4 bytes */
-    uLong compressed_size;      /* compressed size                 4 bytes */ 
-    uLong uncompressed_size;    /* uncompressed size               4 bytes */ 
-    uLong size_filename;        /* filename length                 2 bytes */
-    uLong size_file_extra;      /* extra field length              2 bytes */
-    uLong size_file_comment;    /* file comment length             2 bytes */
-
-    uLong disk_num_start;       /* disk number start               2 bytes */
-    uLong internal_fa;          /* internal file attributes        2 bytes */
-    uLong external_fa;          /* external file attributes        4 bytes */
-
-    tm_unz tmu_date;
-} unz_file_info;
-
-extern int ZEXPORT unzStringFileNameCompare OF ((const char* fileName1,
-                                                                                                const char* fileName2,
-                                                                                                int iCaseSensitivity));
-/*
-   Compare two filename (fileName1,fileName2).
-   If iCaseSenisivity = 1, comparision is case sensitivity (like strcmp)
-   If iCaseSenisivity = 2, comparision is not case sensitivity (like strcmpi
-                                                               or strcasecmp)
-   If iCaseSenisivity = 0, case sensitivity is defaut of your operating system
-       (like 1 on Unix, 2 on Windows)
-*/
-
-
-extern unzFile ZEXPORT unzOpen OF((const char *path));
-/*
-  Open a Zip file. path contain the full pathname (by example,
-     on a Windows NT computer "c:\\zlib\\zlib111.zip" or on an Unix computer
-        "zlib/zlib111.zip".
-        If the zipfile cannot be opened (file don't exist or in not valid), the
-          return value is NULL.
-     Else, the return value is a unzFile Handle, usable with other function
-          of this unzip package.
-*/
-
-extern int ZEXPORT unzClose OF((unzFile file));
-/*
-  Close a ZipFile opened with unzipOpen.
-  If there is files inside the .Zip opened with unzOpenCurrentFile (see later),
-    these files MUST be closed with unzipCloseCurrentFile before call unzipClose.
-  return UNZ_OK if there is no problem. */
-
-extern int ZEXPORT unzGetGlobalInfo OF((unzFile file,
-                                       unz_global_info *pglobal_info));
-/*
-  Write info about the ZipFile in the *pglobal_info structure.
-  No preparation of the structure is needed
-  return UNZ_OK if there is no problem. */
-
-
-extern int ZEXPORT unzGetGlobalComment OF((unzFile file,
-                                                                                  char *szComment,
-                                          uLong uSizeBuf));
-/*
-  Get the global comment string of the ZipFile, in the szComment buffer.
-  uSizeBuf is the size of the szComment buffer.
-  return the number of byte copied or an error code <0
-*/
-
-
-/***************************************************************************/
-/* Unzip package allow you browse the directory of the zipfile */
-
-extern int ZEXPORT unzGoToFirstFile OF((unzFile file));
-/*
-  Set the current file of the zipfile to the first file.
-  return UNZ_OK if there is no problem
-*/
-
-extern int ZEXPORT unzGoToNextFile OF((unzFile file));
-/*
-  Set the current file of the zipfile to the next file.
-  return UNZ_OK if there is no problem
-  return UNZ_END_OF_LIST_OF_FILE if the actual file was the latest.
-*/
-
-extern int ZEXPORT unzLocateFile OF((unzFile file, 
-                                    const char *szFileName,
-                                    int iCaseSensitivity));
-/*
-  Try locate the file szFileName in the zipfile.
-  For the iCaseSensitivity signification, see unzStringFileNameCompare
-
-  return value :
-  UNZ_OK if the file is found. It becomes the current file.
-  UNZ_END_OF_LIST_OF_FILE if the file is not found
-*/
-
-
-extern int ZEXPORT unzGetCurrentFileInfo OF((unzFile file,
-                                            unz_file_info *pfile_info,
-                                            char *szFileName,
-                                            uLong fileNameBufferSize,
-                                            void *extraField,
-                                            uLong extraFieldBufferSize,
-                                            char *szComment,
-                                            uLong commentBufferSize));
-/*
-  Get Info about the current file
-  if pfile_info!=NULL, the *pfile_info structure will contain somes info about
-           the current file
-  if szFileName!=NULL, the filemane string will be copied in szFileName
-                       (fileNameBufferSize is the size of the buffer)
-  if extraField!=NULL, the extra field information will be copied in extraField
-                       (extraFieldBufferSize is the size of the buffer).
-                       This is the Central-header version of the extra field
-  if szComment!=NULL, the comment string of the file will be copied in szComment
-                       (commentBufferSize is the size of the buffer)
-*/
-
-/***************************************************************************/
-/* for reading the content of the current zipfile, you can open it, read data
-   from it, and close it (you can close it before reading all the file)
-   */
-
-extern int ZEXPORT unzOpenCurrentFile OF((unzFile file));
-/*
-  Open for reading data the current file in the zipfile.
-  If there is no error, the return value is UNZ_OK.
-*/
-
-extern int ZEXPORT unzCloseCurrentFile OF((unzFile file));
-/*
-  Close the file in zip opened with unzOpenCurrentFile
-  Return UNZ_CRCERROR if all the file was read but the CRC is not good
-*/
-
-                                                                                               
-extern int ZEXPORT unzReadCurrentFile OF((unzFile file, 
-                                         voidp buf,
-                                         unsigned len));
-/*
-  Read bytes from the current file (opened by unzOpenCurrentFile)
-  buf contain buffer where data must be copied
-  len the size of buf.
-
-  return the number of byte copied if somes bytes are copied
-  return 0 if the end of file was reached
-  return <0 with error code if there is an error
-    (UNZ_ERRNO for IO error, or zLib error for uncompress error)
-*/
-
-extern z_off_t ZEXPORT unztell OF((unzFile file));
-/*
-  Give the current position in uncompressed data
-*/
-
-extern int ZEXPORT unzeof OF((unzFile file));
-/*
-  return 1 if the end of file was reached, 0 elsewhere 
-*/
-
-extern int ZEXPORT unzGetLocalExtrafield OF((unzFile file,
-                                                                                        voidp buf,
-                                                                                        unsigned len));
-/*
-  Read extra field from the current file (opened by unzOpenCurrentFile)
-  This is the local-header version of the extra field (sometimes, there is
-    more info in the local-header version than in the central-header)
-
-  if buf==NULL, it return the size of the local extra field
-
-  if buf!=NULL, len is the size of the buffer, the extra header is copied in
-       buf.
-  the return value is the number of bytes copied in buf, or (if <0) 
-       the error code
-*/
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _unz_H */
diff --git a/lib/zlib/contrib/minizip/zip.c b/lib/zlib/contrib/minizip/zip.c
deleted file mode 100644 (file)
index 0cae64a..0000000
+++ /dev/null
@@ -1,718 +0,0 @@
-/* zip.c -- IO on .zip files using zlib 
-   Version 0.15 beta, Mar 19th, 1998,
-
-   Read zip.h for more info
-*/
-
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include "zlib.h"
-#include "zip.h"
-
-#ifdef STDC
-#  include <stddef.h>
-#  include <string.h>
-#  include <stdlib.h>
-#endif
-#ifdef NO_ERRNO_H
-    extern int errno;
-#else
-#   include <errno.h>
-#endif
-
-
-#ifndef local
-#  define local static
-#endif
-/* compile with -Dlocal if your debugger can't find static symbols */
-
-#ifndef VERSIONMADEBY
-# define VERSIONMADEBY   (0x0) /* platform depedent */
-#endif
-
-#ifndef Z_BUFSIZE
-#define Z_BUFSIZE (16384)
-#endif
-
-#ifndef Z_MAXFILENAMEINZIP
-#define Z_MAXFILENAMEINZIP (256)
-#endif
-
-#ifndef ALLOC
-# define ALLOC(size) (malloc(size))
-#endif
-#ifndef TRYFREE
-# define TRYFREE(p) {if (p) free(p);}
-#endif
-
-/*
-#define SIZECENTRALDIRITEM (0x2e)
-#define SIZEZIPLOCALHEADER (0x1e)
-*/
-
-/* I've found an old Unix (a SunOS 4.1.3_U1) without all SEEK_* defined.... */
-
-#ifndef SEEK_CUR
-#define SEEK_CUR    1
-#endif
-
-#ifndef SEEK_END
-#define SEEK_END    2
-#endif
-
-#ifndef SEEK_SET
-#define SEEK_SET    0
-#endif
-
-const char zip_copyright[] =
-   " zip 0.15 Copyright 1998 Gilles Vollant ";
-
-
-#define SIZEDATA_INDATABLOCK (4096-(4*4))
-
-#define LOCALHEADERMAGIC    (0x04034b50)
-#define CENTRALHEADERMAGIC  (0x02014b50)
-#define ENDHEADERMAGIC      (0x06054b50)
-
-#define FLAG_LOCALHEADER_OFFSET (0x06)
-#define CRC_LOCALHEADER_OFFSET  (0x0e)
-
-#define SIZECENTRALHEADER (0x2e) /* 46 */
-
-typedef struct linkedlist_datablock_internal_s
-{
-  struct linkedlist_datablock_internal_s* next_datablock;
-  uLong  avail_in_this_block;
-  uLong  filled_in_this_block;
-  uLong  unused; /* for future use and alignement */
-  unsigned char data[SIZEDATA_INDATABLOCK];
-} linkedlist_datablock_internal;
-
-typedef struct linkedlist_data_s
-{
-    linkedlist_datablock_internal* first_block;
-    linkedlist_datablock_internal* last_block;
-} linkedlist_data;
-
-
-typedef struct
-{
-       z_stream stream;            /* zLib stream structure for inflate */
-    int  stream_initialised;    /* 1 is stream is initialised */
-    uInt pos_in_buffered_data;  /* last written byte in buffered_data */
-
-    uLong pos_local_header;     /* offset of the local header of the file 
-                                     currenty writing */
-    char* central_header;       /* central header data for the current file */
-    uLong size_centralheader;   /* size of the central header for cur file */
-    uLong flag;                 /* flag of the file currently writing */
-
-    int  method;                /* compression method of file currenty wr.*/
-    Byte buffered_data[Z_BUFSIZE];/* buffer contain compressed data to be writ*/
-    uLong dosDate;
-    uLong crc32;
-} curfile_info;
-
-typedef struct
-{
-    FILE * filezip;
-    linkedlist_data central_dir;/* datablock with central dir in construction*/
-    int  in_opened_file_inzip;  /* 1 if a file in the zip is currently writ.*/
-    curfile_info ci;            /* info on the file curretly writing */
-
-    uLong begin_pos;            /* position of the beginning of the zipfile */
-    uLong number_entry;
-} zip_internal;
-
-local linkedlist_datablock_internal* allocate_new_datablock()
-{
-    linkedlist_datablock_internal* ldi;
-    ldi = (linkedlist_datablock_internal*)
-                 ALLOC(sizeof(linkedlist_datablock_internal));
-    if (ldi!=NULL)
-    {
-        ldi->next_datablock = NULL ;
-        ldi->filled_in_this_block = 0 ;
-        ldi->avail_in_this_block = SIZEDATA_INDATABLOCK ;
-    }
-    return ldi;
-}
-
-local void free_datablock(ldi)
-    linkedlist_datablock_internal* ldi;
-{
-    while (ldi!=NULL)
-    {
-        linkedlist_datablock_internal* ldinext = ldi->next_datablock;
-        TRYFREE(ldi);
-        ldi = ldinext;
-    }
-}
-
-local void init_linkedlist(ll)
-    linkedlist_data* ll;
-{
-    ll->first_block = ll->last_block = NULL;
-}
-
-local void free_linkedlist(ll)
-    linkedlist_data* ll;
-{
-    free_datablock(ll->first_block);
-    ll->first_block = ll->last_block = NULL;
-}
-
-
-local int add_data_in_datablock(ll,buf,len)
-    linkedlist_data* ll;    
-    const void* buf;
-    uLong len;
-{
-    linkedlist_datablock_internal* ldi;
-    const unsigned char* from_copy;
-
-    if (ll==NULL)
-        return ZIP_INTERNALERROR;
-
-    if (ll->last_block == NULL)
-    {
-        ll->first_block = ll->last_block = allocate_new_datablock();
-        if (ll->first_block == NULL)
-            return ZIP_INTERNALERROR;
-    }
-
-    ldi = ll->last_block;
-    from_copy = (unsigned char*)buf;
-
-    while (len>0)
-    {
-        uInt copy_this;
-        uInt i;
-        unsigned char* to_copy;
-
-        if (ldi->avail_in_this_block==0)
-        {
-            ldi->next_datablock = allocate_new_datablock();
-            if (ldi->next_datablock == NULL)
-                return ZIP_INTERNALERROR;
-            ldi = ldi->next_datablock ;
-            ll->last_block = ldi;
-        }
-
-        if (ldi->avail_in_this_block < len)
-            copy_this = (uInt)ldi->avail_in_this_block;
-        else
-            copy_this = (uInt)len;
-
-        to_copy = &(ldi->data[ldi->filled_in_this_block]);
-
-        for (i=0;i<copy_this;i++)
-            *(to_copy+i)=*(from_copy+i);
-
-        ldi->filled_in_this_block += copy_this;
-        ldi->avail_in_this_block -= copy_this;
-        from_copy += copy_this ;
-        len -= copy_this;
-    }
-    return ZIP_OK;
-}
-
-
-local int write_datablock(fout,ll)
-    FILE * fout;
-    linkedlist_data* ll;    
-{
-    linkedlist_datablock_internal* ldi;
-    ldi = ll->first_block;
-    while (ldi!=NULL)
-    {
-        if (ldi->filled_in_this_block > 0)
-            if (fwrite(ldi->data,(uInt)ldi->filled_in_this_block,1,fout)!=1)
-                return ZIP_ERRNO;
-        ldi = ldi->next_datablock;
-    }
-    return ZIP_OK;
-}
-
-/****************************************************************************/
-
-/* ===========================================================================
-   Outputs a long in LSB order to the given file
-   nbByte == 1, 2 or 4 (byte, short or long)
-*/
-
-local int ziplocal_putValue OF((FILE *file, uLong x, int nbByte));
-local int ziplocal_putValue (file, x, nbByte)
-    FILE *file;
-    uLong x;
-    int nbByte;
-{
-    unsigned char buf[4];
-    int n;
-    for (n = 0; n < nbByte; n++) {
-        buf[n] = (unsigned char)(x & 0xff);
-        x >>= 8;
-    }
-    if (fwrite(buf,nbByte,1,file)!=1)
-        return ZIP_ERRNO;
-    else
-        return ZIP_OK;
-}
-
-local void ziplocal_putValue_inmemory OF((void* dest, uLong x, int nbByte));
-local void ziplocal_putValue_inmemory (dest, x, nbByte)
-    void* dest;
-    uLong x;
-    int nbByte;
-{
-    unsigned char* buf=(unsigned char*)dest;
-    int n;
-    for (n = 0; n < nbByte; n++) {
-        buf[n] = (unsigned char)(x & 0xff);
-        x >>= 8;
-    }
-}
-/****************************************************************************/
-
-
-local uLong ziplocal_TmzDateToDosDate(ptm,dosDate)
-    tm_zip* ptm;
-    uLong dosDate;
-{
-    uLong year = (uLong)ptm->tm_year;
-    if (year>1980)
-        year-=1980;
-    else if (year>80)
-        year-=80;
-    return
-      (uLong) (((ptm->tm_mday) + (32 * (ptm->tm_mon+1)) + (512 * year)) << 16) |
-        ((ptm->tm_sec/2) + (32* ptm->tm_min) + (2048 * (uLong)ptm->tm_hour));
-}
-
-
-/****************************************************************************/
-
-extern zipFile ZEXPORT zipOpen (pathname, append)
-    const char *pathname;
-    int append;
-{
-    zip_internal ziinit;
-    zip_internal* zi;
-
-    ziinit.filezip = fopen(pathname,(append == 0) ? "wb" : "ab");
-    if (ziinit.filezip == NULL)
-        return NULL;
-    ziinit.begin_pos = ftell(ziinit.filezip);
-    ziinit.in_opened_file_inzip = 0;
-    ziinit.ci.stream_initialised = 0;
-    ziinit.number_entry = 0;
-    init_linkedlist(&(ziinit.central_dir));
-
-
-    zi = (zip_internal*)ALLOC(sizeof(zip_internal));
-    if (zi==NULL)
-    {
-        fclose(ziinit.filezip);
-        return NULL;
-    }
-
-    *zi = ziinit;
-    return (zipFile)zi;
-}
-
-extern int ZEXPORT zipOpenNewFileInZip (file, filename, zipfi, 
-                                        extrafield_local, size_extrafield_local,
-                                        extrafield_global, size_extrafield_global,
-                                        comment, method, level)
-    zipFile file;
-    const char* filename;
-    const zip_fileinfo* zipfi;
-    const void* extrafield_local;
-    uInt size_extrafield_local;
-    const void* extrafield_global;
-    uInt size_extrafield_global;
-    const char* comment;
-    int method;
-    int level;
-{
-    zip_internal* zi;
-    uInt size_filename;
-    uInt size_comment;
-    uInt i;
-    int err = ZIP_OK;
-
-    if (file == NULL)
-        return ZIP_PARAMERROR;
-    if ((method!=0) && (method!=Z_DEFLATED))
-        return ZIP_PARAMERROR;
-
-    zi = (zip_internal*)file;
-
-    if (zi->in_opened_file_inzip == 1)
-    {
-        err = zipCloseFileInZip (file);
-        if (err != ZIP_OK)
-            return err;
-    }
-
-
-    if (filename==NULL)
-        filename="-";
-
-    if (comment==NULL)
-        size_comment = 0;
-    else
-        size_comment = strlen(comment);
-
-    size_filename = strlen(filename);
-
-    if (zipfi == NULL)
-        zi->ci.dosDate = 0;
-    else
-    {
-        if (zipfi->dosDate != 0)
-            zi->ci.dosDate = zipfi->dosDate;
-        else zi->ci.dosDate = ziplocal_TmzDateToDosDate(&zipfi->tmz_date,zipfi->dosDate);
-    }
-
-    zi->ci.flag = 0;
-    if ((level==8) || (level==9))
-      zi->ci.flag |= 2;
-    if ((level==2))
-      zi->ci.flag |= 4;
-    if ((level==1))
-      zi->ci.flag |= 6;
-
-    zi->ci.crc32 = 0;
-    zi->ci.method = method;
-    zi->ci.stream_initialised = 0;
-    zi->ci.pos_in_buffered_data = 0;
-    zi->ci.pos_local_header = ftell(zi->filezip);
-    zi->ci.size_centralheader = SIZECENTRALHEADER + size_filename + 
-                                      size_extrafield_global + size_comment;
-    zi->ci.central_header = (char*)ALLOC((uInt)zi->ci.size_centralheader);
-
-    ziplocal_putValue_inmemory(zi->ci.central_header,(uLong)CENTRALHEADERMAGIC,4);
-    /* version info */
-    ziplocal_putValue_inmemory(zi->ci.central_header+4,(uLong)VERSIONMADEBY,2);
-    ziplocal_putValue_inmemory(zi->ci.central_header+6,(uLong)20,2);
-    ziplocal_putValue_inmemory(zi->ci.central_header+8,(uLong)zi->ci.flag,2);
-    ziplocal_putValue_inmemory(zi->ci.central_header+10,(uLong)zi->ci.method,2);
-    ziplocal_putValue_inmemory(zi->ci.central_header+12,(uLong)zi->ci.dosDate,4);
-    ziplocal_putValue_inmemory(zi->ci.central_header+16,(uLong)0,4); /*crc*/
-    ziplocal_putValue_inmemory(zi->ci.central_header+20,(uLong)0,4); /*compr size*/
-    ziplocal_putValue_inmemory(zi->ci.central_header+24,(uLong)0,4); /*uncompr size*/
-    ziplocal_putValue_inmemory(zi->ci.central_header+28,(uLong)size_filename,2);
-    ziplocal_putValue_inmemory(zi->ci.central_header+30,(uLong)size_extrafield_global,2);
-    ziplocal_putValue_inmemory(zi->ci.central_header+32,(uLong)size_comment,2);
-    ziplocal_putValue_inmemory(zi->ci.central_header+34,(uLong)0,2); /*disk nm start*/
-
-    if (zipfi==NULL)
-        ziplocal_putValue_inmemory(zi->ci.central_header+36,(uLong)0,2); 
-    else
-        ziplocal_putValue_inmemory(zi->ci.central_header+36,(uLong)zipfi->internal_fa,2); 
-
-    if (zipfi==NULL)
-        ziplocal_putValue_inmemory(zi->ci.central_header+38,(uLong)0,4); 
-    else
-        ziplocal_putValue_inmemory(zi->ci.central_header+38,(uLong)zipfi->external_fa,4);
-
-    ziplocal_putValue_inmemory(zi->ci.central_header+42,(uLong)zi->ci.pos_local_header,4);
-
-    for (i=0;i<size_filename;i++)
-        *(zi->ci.central_header+SIZECENTRALHEADER+i) = *(filename+i);
-
-    for (i=0;i<size_extrafield_global;i++)
-        *(zi->ci.central_header+SIZECENTRALHEADER+size_filename+i) =
-              *(((const char*)extrafield_global)+i);
-
-    for (i=0;i<size_comment;i++)
-        *(zi->ci.central_header+SIZECENTRALHEADER+size_filename+
-              size_extrafield_global+i) = *(filename+i);
-    if (zi->ci.central_header == NULL)
-        return ZIP_INTERNALERROR;
-
-    /* write the local header */
-    err = ziplocal_putValue(zi->filezip,(uLong)LOCALHEADERMAGIC,4);
-
-    if (err==ZIP_OK)
-        err = ziplocal_putValue(zi->filezip,(uLong)20,2);/* version needed to extract */
-    if (err==ZIP_OK)
-        err = ziplocal_putValue(zi->filezip,(uLong)zi->ci.flag,2);
-
-    if (err==ZIP_OK)
-        err = ziplocal_putValue(zi->filezip,(uLong)zi->ci.method,2);
-
-    if (err==ZIP_OK)
-        err = ziplocal_putValue(zi->filezip,(uLong)zi->ci.dosDate,4);
-
-    if (err==ZIP_OK)
-        err = ziplocal_putValue(zi->filezip,(uLong)0,4); /* crc 32, unknown */
-    if (err==ZIP_OK)
-        err = ziplocal_putValue(zi->filezip,(uLong)0,4); /* compressed size, unknown */
-    if (err==ZIP_OK)
-        err = ziplocal_putValue(zi->filezip,(uLong)0,4); /* uncompressed size, unknown */
-
-    if (err==ZIP_OK)
-        err = ziplocal_putValue(zi->filezip,(uLong)size_filename,2);
-
-    if (err==ZIP_OK)
-        err = ziplocal_putValue(zi->filezip,(uLong)size_extrafield_local,2);
-
-    if ((err==ZIP_OK) && (size_filename>0))
-        if (fwrite(filename,(uInt)size_filename,1,zi->filezip)!=1)
-                err = ZIP_ERRNO;
-
-    if ((err==ZIP_OK) && (size_extrafield_local>0))
-        if (fwrite(extrafield_local,(uInt)size_extrafield_local,1,zi->filezip)
-                                                                           !=1)
-                err = ZIP_ERRNO;
-
-    zi->ci.stream.avail_in = (uInt)0;
-    zi->ci.stream.avail_out = (uInt)Z_BUFSIZE;
-    zi->ci.stream.next_out = zi->ci.buffered_data;
-    zi->ci.stream.total_in = 0;
-    zi->ci.stream.total_out = 0;
-
-    if ((err==ZIP_OK) && (zi->ci.method == Z_DEFLATED))
-    {
-        zi->ci.stream.zalloc = (alloc_func)0;
-        zi->ci.stream.zfree = (free_func)0;
-        zi->ci.stream.opaque = (voidpf)0;
-
-        err = deflateInit2(&zi->ci.stream, level,
-               Z_DEFLATED, -MAX_WBITS, DEF_MEM_LEVEL, 0);
-
-        if (err==Z_OK)
-            zi->ci.stream_initialised = 1;
-    }
-
-
-    if (err==Z_OK)
-        zi->in_opened_file_inzip = 1;
-    return err;
-}
-
-extern int ZEXPORT zipWriteInFileInZip (file, buf, len)
-    zipFile file;
-    const voidp buf;
-    unsigned len;
-{
-    zip_internal* zi;
-    int err=ZIP_OK;
-
-    if (file == NULL)
-        return ZIP_PARAMERROR;
-    zi = (zip_internal*)file;
-
-    if (zi->in_opened_file_inzip == 0)
-        return ZIP_PARAMERROR;
-
-    zi->ci.stream.next_in = buf;
-    zi->ci.stream.avail_in = len;
-    zi->ci.crc32 = crc32(zi->ci.crc32,buf,len);
-
-    while ((err==ZIP_OK) && (zi->ci.stream.avail_in>0))
-    {
-        if (zi->ci.stream.avail_out == 0)
-        {
-            if (fwrite(zi->ci.buffered_data,(uInt)zi->ci.pos_in_buffered_data,1,zi->filezip)
-                                                                           !=1)
-                err = ZIP_ERRNO;
-            zi->ci.pos_in_buffered_data = 0;
-            zi->ci.stream.avail_out = (uInt)Z_BUFSIZE;
-            zi->ci.stream.next_out = zi->ci.buffered_data;
-        }
-
-        if (zi->ci.method == Z_DEFLATED)
-        {
-            uLong uTotalOutBefore = zi->ci.stream.total_out;
-            err=deflate(&zi->ci.stream,  Z_NO_FLUSH);
-            zi->ci.pos_in_buffered_data += (uInt)(zi->ci.stream.total_out - uTotalOutBefore) ;
-
-        }
-        else
-        {
-            uInt copy_this,i;
-            if (zi->ci.stream.avail_in < zi->ci.stream.avail_out)
-                copy_this = zi->ci.stream.avail_in;
-            else
-                copy_this = zi->ci.stream.avail_out;
-            for (i=0;i<copy_this;i++)
-                *(((char*)zi->ci.stream.next_out)+i) =
-                    *(((const char*)zi->ci.stream.next_in)+i);
-            {
-                zi->ci.stream.avail_in -= copy_this;
-                zi->ci.stream.avail_out-= copy_this;
-                zi->ci.stream.next_in+= copy_this;
-                zi->ci.stream.next_out+= copy_this;
-                zi->ci.stream.total_in+= copy_this;
-                zi->ci.stream.total_out+= copy_this;
-                zi->ci.pos_in_buffered_data += copy_this;
-            }
-        }
-    }
-
-    return 0;
-}
-
-extern int ZEXPORT zipCloseFileInZip (file)
-    zipFile file;
-{
-    zip_internal* zi;
-    int err=ZIP_OK;
-
-    if (file == NULL)
-        return ZIP_PARAMERROR;
-    zi = (zip_internal*)file;
-
-    if (zi->in_opened_file_inzip == 0)    
-        return ZIP_PARAMERROR;
-    zi->ci.stream.avail_in = 0;
-    
-    if (zi->ci.method == Z_DEFLATED)
-        while (err==ZIP_OK)
-    {
-        uLong uTotalOutBefore;
-        if (zi->ci.stream.avail_out == 0)
-        {
-            if (fwrite(zi->ci.buffered_data,(uInt)zi->ci.pos_in_buffered_data,1,zi->filezip)
-                                                                           !=1)
-                err = ZIP_ERRNO;
-            zi->ci.pos_in_buffered_data = 0;
-            zi->ci.stream.avail_out = (uInt)Z_BUFSIZE;
-            zi->ci.stream.next_out = zi->ci.buffered_data;
-        }
-        uTotalOutBefore = zi->ci.stream.total_out;
-        err=deflate(&zi->ci.stream,  Z_FINISH);
-        zi->ci.pos_in_buffered_data += (uInt)(zi->ci.stream.total_out - uTotalOutBefore) ;
-    }
-
-    if (err==Z_STREAM_END)
-        err=ZIP_OK; /* this is normal */
-
-    if ((zi->ci.pos_in_buffered_data>0) && (err==ZIP_OK))
-        if (fwrite(zi->ci.buffered_data,(uInt)zi->ci.pos_in_buffered_data,1,zi->filezip)
-                                                                       !=1)
-            err = ZIP_ERRNO;
-
-    if ((zi->ci.method == Z_DEFLATED) && (err==ZIP_OK))
-    {
-        err=deflateEnd(&zi->ci.stream);
-        zi->ci.stream_initialised = 0;
-    }
-
-    ziplocal_putValue_inmemory(zi->ci.central_header+16,(uLong)zi->ci.crc32,4); /*crc*/
-    ziplocal_putValue_inmemory(zi->ci.central_header+20,
-                                (uLong)zi->ci.stream.total_out,4); /*compr size*/
-    ziplocal_putValue_inmemory(zi->ci.central_header+24,
-                                (uLong)zi->ci.stream.total_in,4); /*uncompr size*/
-
-    if (err==ZIP_OK)
-        err = add_data_in_datablock(&zi->central_dir,zi->ci.central_header,
-                                       (uLong)zi->ci.size_centralheader);
-    free(zi->ci.central_header);
-
-    if (err==ZIP_OK)
-    {
-        long cur_pos_inzip = ftell(zi->filezip);
-           if (fseek(zi->filezip,
-                  zi->ci.pos_local_header + 14,SEEK_SET)!=0)
-                   err = ZIP_ERRNO;
-
-        if (err==ZIP_OK)
-            err = ziplocal_putValue(zi->filezip,(uLong)zi->ci.crc32,4); /* crc 32, unknown */
-
-        if (err==ZIP_OK) /* compressed size, unknown */
-            err = ziplocal_putValue(zi->filezip,(uLong)zi->ci.stream.total_out,4); 
-
-        if (err==ZIP_OK) /* uncompressed size, unknown */
-            err = ziplocal_putValue(zi->filezip,(uLong)zi->ci.stream.total_in,4);
-
-           if (fseek(zi->filezip,
-                  cur_pos_inzip,SEEK_SET)!=0)
-                   err = ZIP_ERRNO;
-    }
-
-    zi->number_entry ++;
-    zi->in_opened_file_inzip = 0;
-
-    return err;
-}
-
-extern int ZEXPORT zipClose (file, global_comment)
-    zipFile file;
-    const char* global_comment;
-{
-    zip_internal* zi;
-    int err = 0;
-    uLong size_centraldir = 0;
-    uLong centraldir_pos_inzip ;
-    uInt size_global_comment;
-    if (file == NULL)
-        return ZIP_PARAMERROR;
-    zi = (zip_internal*)file;
-
-    if (zi->in_opened_file_inzip == 1)
-    {
-        err = zipCloseFileInZip (file);
-    }
-
-    if (global_comment==NULL)
-        size_global_comment = 0;
-    else
-        size_global_comment = strlen(global_comment);
-
-
-    centraldir_pos_inzip = ftell(zi->filezip);
-    if (err==ZIP_OK)
-    {
-        linkedlist_datablock_internal* ldi = zi->central_dir.first_block ;
-        while (ldi!=NULL)
-        {
-            if ((err==ZIP_OK) && (ldi->filled_in_this_block>0))
-                if (fwrite(ldi->data,(uInt)ldi->filled_in_this_block,
-                                        1,zi->filezip) !=1 )
-                    err = ZIP_ERRNO;
-
-            size_centraldir += ldi->filled_in_this_block;
-            ldi = ldi->next_datablock;
-        }
-    }
-    free_datablock(zi->central_dir.first_block);
-
-    if (err==ZIP_OK) /* Magic End */
-        err = ziplocal_putValue(zi->filezip,(uLong)ENDHEADERMAGIC,4);
-
-    if (err==ZIP_OK) /* number of this disk */
-        err = ziplocal_putValue(zi->filezip,(uLong)0,2);
-
-    if (err==ZIP_OK) /* number of the disk with the start of the central directory */
-        err = ziplocal_putValue(zi->filezip,(uLong)0,2);
-
-    if (err==ZIP_OK) /* total number of entries in the central dir on this disk */
-        err = ziplocal_putValue(zi->filezip,(uLong)zi->number_entry,2);
-
-    if (err==ZIP_OK) /* total number of entries in the central dir */
-        err = ziplocal_putValue(zi->filezip,(uLong)zi->number_entry,2);
-
-    if (err==ZIP_OK) /* size of the central directory */
-        err = ziplocal_putValue(zi->filezip,(uLong)size_centraldir,4);
-
-    if (err==ZIP_OK) /* offset of start of central directory with respect to the 
-                               starting disk number */
-        err = ziplocal_putValue(zi->filezip,(uLong)centraldir_pos_inzip ,4);
-
-    if (err==ZIP_OK) /* zipfile comment length */
-        err = ziplocal_putValue(zi->filezip,(uLong)size_global_comment,2);
-
-    if ((err==ZIP_OK) && (size_global_comment>0))
-        if (fwrite(global_comment,(uInt)size_global_comment,1,zi->filezip) !=1 )
-                err = ZIP_ERRNO;
-    fclose(zi->filezip);
-    TRYFREE(zi);
-
-    return err;
-}
diff --git a/lib/zlib/contrib/minizip/zip.def b/lib/zlib/contrib/minizip/zip.def
deleted file mode 100644 (file)
index 5d5079f..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-       zipOpen                       @80
-       zipOpenNewFileInZip           @81
-       zipWriteInFileInZip           @82
-       zipCloseFileInZip             @83
-       zipClose                      @84
diff --git a/lib/zlib/contrib/minizip/zip.h b/lib/zlib/contrib/minizip/zip.h
deleted file mode 100644 (file)
index 678260b..0000000
+++ /dev/null
@@ -1,150 +0,0 @@
-/* zip.h -- IO for compress .zip files using zlib 
-   Version 0.15 alpha, Mar 19th, 1998,
-
-   Copyright (C) 1998 Gilles Vollant
-
-   This unzip package allow creates .ZIP file, compatible with PKZip 2.04g
-     WinZip, InfoZip tools and compatible.
-   Encryption and multi volume ZipFile (span) are not supported.
-   Old compressions used by old PKZip 1.x are not supported
-
-  For uncompress .zip file, look at unzip.h
-
-   THIS IS AN ALPHA VERSION. AT THIS STAGE OF DEVELOPPEMENT, SOMES API OR STRUCTURE
-   CAN CHANGE IN FUTURE VERSION !!
-   I WAIT FEEDBACK at mail info@winimage.com
-   Visit also http://www.winimage.com/zLibDll/zip.htm for evolution
-
-   Condition of use and distribution are the same than zlib :
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-
-
-*/
-
-/* for more info about .ZIP format, see 
-      ftp://ftp.cdrom.com/pub/infozip/doc/appnote-970311-iz.zip
-   PkWare has also a specification at :
-      ftp://ftp.pkware.com/probdesc.zip
-*/
-
-#ifndef _zip_H
-#define _zip_H
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifndef _ZLIB_H
-#include "zlib.h"
-#endif
-
-#if defined(STRICTZIP) || defined(STRICTZIPUNZIP)
-/* like the STRICT of WIN32, we define a pointer that cannot be converted
-    from (void*) without cast */
-typedef struct TagzipFile__ { int unused; } zipFile__; 
-typedef zipFile__ *zipFile;
-#else
-typedef voidp zipFile;
-#endif
-
-#define ZIP_OK                                  (0)
-#define ZIP_ERRNO               (Z_ERRNO)
-#define ZIP_PARAMERROR                  (-102)
-#define ZIP_INTERNALERROR               (-104)
-
-/* tm_zip contain date/time info */
-typedef struct tm_zip_s 
-{
-       uInt tm_sec;            /* seconds after the minute - [0,59] */
-       uInt tm_min;            /* minutes after the hour - [0,59] */
-       uInt tm_hour;           /* hours since midnight - [0,23] */
-       uInt tm_mday;           /* day of the month - [1,31] */
-       uInt tm_mon;            /* months since January - [0,11] */
-       uInt tm_year;           /* years - [1980..2044] */
-} tm_zip;
-
-typedef struct
-{
-       tm_zip      tmz_date;       /* date in understandable format           */
-    uLong       dosDate;       /* if dos_date == 0, tmu_date is used      */
-/*    uLong       flag;        */   /* general purpose bit flag        2 bytes */
-
-    uLong       internal_fa;    /* internal file attributes        2 bytes */
-    uLong       external_fa;    /* external file attributes        4 bytes */
-} zip_fileinfo;
-
-extern zipFile ZEXPORT zipOpen OF((const char *pathname, int append));
-/*
-  Create a zipfile.
-        pathname contain on Windows NT a filename like "c:\\zlib\\zlib111.zip" or on
-          an Unix computer "zlib/zlib111.zip".
-        if the file pathname exist and append=1, the zip will be created at the end
-          of the file. (useful if the file contain a self extractor code)
-        If the zipfile cannot be opened, the return value is NULL.
-     Else, the return value is a zipFile Handle, usable with other function
-          of this zip package.
-
-
-*/
-
-extern int ZEXPORT zipOpenNewFileInZip OF((zipFile file,
-                                          const char* filename,
-                                          const zip_fileinfo* zipfi,
-                                          const void* extrafield_local,
-                                          uInt size_extrafield_local,
-                                          const void* extrafield_global,
-                                          uInt size_extrafield_global,
-                                          const char* comment,
-                                          int method,
-                                          int level));
-/*
-  Open a file in the ZIP for writing.
-  filename : the filename in zip (if NULL, '-' without quote will be used
-  *zipfi contain supplemental information
-  if extrafield_local!=NULL and size_extrafield_local>0, extrafield_local
-    contains the extrafield data the the local header
-  if extrafield_global!=NULL and size_extrafield_global>0, extrafield_global
-    contains the extrafield data the the local header
-  if comment != NULL, comment contain the comment string
-  method contain the compression method (0 for store, Z_DEFLATED for deflate)
-  level contain the level of compression (can be Z_DEFAULT_COMPRESSION)
-*/
-
-extern int ZEXPORT zipWriteInFileInZip OF((zipFile file,
-                                          const voidp buf,
-                                          unsigned len));
-/*
-  Write data in the zipfile
-*/
-
-extern int ZEXPORT zipCloseFileInZip OF((zipFile file));
-/*
-  Close the current file in the zipfile
-*/
-
-extern int ZEXPORT zipClose OF((zipFile file,
-                               const char* global_comment));
-/*
-  Close the zipfile
-*/
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _zip_H */
diff --git a/lib/zlib/contrib/minizip/zlibvc.def b/lib/zlib/contrib/minizip/zlibvc.def
deleted file mode 100644 (file)
index 7e9d60d..0000000
+++ /dev/null
@@ -1,74 +0,0 @@
-LIBRARY                "zlib"
-
-DESCRIPTION    '"""zlib data compression library"""'
-
-
-VERSION                1.11
-
-
-HEAPSIZE       1048576,8192
-
-EXPORTS
-    adler32                        @1
-    compress                       @2
-    crc32                          @3
-    deflate                        @4
-    deflateCopy                    @5
-    deflateEnd                     @6
-    deflateInit2_                  @7
-    deflateInit_                   @8
-    deflateParams                  @9
-    deflateReset                   @10
-    deflateSetDictionary           @11
-    gzclose                        @12
-    gzdopen                        @13
-    gzerror                        @14
-    gzflush                        @15
-    gzopen                         @16
-    gzread                         @17
-    gzwrite                        @18
-    inflate                        @19
-    inflateEnd                     @20
-    inflateInit2_                  @21
-    inflateInit_                   @22
-    inflateReset                   @23
-    inflateSetDictionary           @24
-    inflateSync                    @25
-    uncompress                     @26
-    zlibVersion                    @27
-    gzprintf                       @28
-    gzputc                         @29
-    gzgetc                         @30
-    gzseek                         @31
-    gzrewind                       @32
-    gztell                         @33
-    gzeof                          @34
-    gzsetparams                    @35
-    zError                         @36
-    inflateSyncPoint               @37
-    get_crc_table                  @38
-    compress2                      @39
-    gzputs                         @40
-    gzgets                         @41
-
-       unzOpen                       @61
-       unzClose                      @62
-       unzGetGlobalInfo              @63
-       unzGetCurrentFileInfo         @64
-       unzGoToFirstFile              @65
-       unzGoToNextFile               @66
-       unzOpenCurrentFile            @67
-       unzReadCurrentFile            @68
-       unztell                       @70
-       unzeof                        @71
-       unzCloseCurrentFile           @72
-       unzGetGlobalComment           @73
-       unzStringFileNameCompare      @74
-       unzLocateFile                 @75
-       unzGetLocalExtrafield         @76
-
-       zipOpen                       @80
-       zipOpenNewFileInZip           @81
-       zipWriteInFileInZip           @82
-       zipCloseFileInZip             @83
-       zipClose                      @84
diff --git a/lib/zlib/contrib/minizip/zlibvc.dsp b/lib/zlib/contrib/minizip/zlibvc.dsp
deleted file mode 100644 (file)
index a70d4d4..0000000
+++ /dev/null
@@ -1,651 +0,0 @@
-# Microsoft Developer Studio Project File - Name="zlibvc" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 5.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
-# TARGTYPE "Win32 (ALPHA) Dynamic-Link Library" 0x0602
-
-CFG=zlibvc - Win32 Release
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE 
-!MESSAGE NMAKE /f "zlibvc.mak".
-!MESSAGE 
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE 
-!MESSAGE NMAKE /f "zlibvc.mak" CFG="zlibvc - Win32 Release"
-!MESSAGE 
-!MESSAGE Possible choices for configuration are:
-!MESSAGE 
-!MESSAGE "zlibvc - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE "zlibvc - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE "zlibvc - Win32 ReleaseAxp" (based on\
- "Win32 (ALPHA) Dynamic-Link Library")
-!MESSAGE "zlibvc - Win32 ReleaseWithoutAsm" (based on\
- "Win32 (x86) Dynamic-Link Library")
-!MESSAGE "zlibvc - Win32 ReleaseWithoutCrtdll" (based on\
- "Win32 (x86) Dynamic-Link Library")
-!MESSAGE 
-
-# Begin Project
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-
-!IF  "$(CFG)" == "zlibvc - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir ".\Release"
-# PROP BASE Intermediate_Dir ".\Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir ".\Release"
-# PROP Intermediate_Dir ".\Release"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-CPP=cl.exe
-# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /c
-# ADD CPP /nologo /MT /W3 /GX /O2 /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_WINDLL" /D "_WIN32" /D "BUILD_ZLIBDLL" /D "ZLIB_DLL" /D "DYNAMIC_CRC_TABLE" /D "ASMV" /FAcs /FR /FD /c
-# SUBTRACT CPP /YX
-MTL=midl.exe
-# ADD BASE MTL /nologo /D "NDEBUG" /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-RSC=rc.exe
-# ADD BASE RSC /l 0x40c /d "NDEBUG"
-# ADD RSC /l 0x40c /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386
-# ADD LINK32 gvmat32.obj kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib crtdll.lib /nologo /subsystem:windows /dll /map /machine:I386 /nodefaultlib /out:".\Release\zlib.dll"
-# SUBTRACT LINK32 /pdb:none
-
-!ELSEIF  "$(CFG)" == "zlibvc - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir ".\Debug"
-# PROP BASE Intermediate_Dir ".\Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir ".\Debug"
-# PROP Intermediate_Dir ".\Debug"
-# PROP Target_Dir ""
-CPP=cl.exe
-# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /c
-# ADD CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "_WINDLL" /D "_WIN32" /D "BUILD_ZLIBDLL" /D "ZLIB_DLL" /FD /c
-# SUBTRACT CPP /YX
-MTL=midl.exe
-# ADD BASE MTL /nologo /D "_DEBUG" /win32
-# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-RSC=rc.exe
-# ADD BASE RSC /l 0x40c /d "_DEBUG"
-# ADD RSC /l 0x40c /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /subsystem:windows /dll /debug /machine:I386 /out:".\Debug\zlib.dll"
-
-!ELSEIF  "$(CFG)" == "zlibvc - Win32 ReleaseAxp"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "zlibvc__"
-# PROP BASE Intermediate_Dir "zlibvc__"
-# PROP BASE Ignore_Export_Lib 0
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "zlibvc__"
-# PROP Intermediate_Dir "zlibvc__"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-MTL=midl.exe
-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-CPP=cl.exe
-# ADD BASE CPP /nologo /MT /Gt0 /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_WIN32" /D "BUILD_ZLIBDLL" /D "ZLIB_DLL" /D "DYNAMIC_CRC_TABLE" /FAcs /FR /YX /FD /c
-# ADD CPP /nologo /MT /Gt0 /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_WIN32" /D "BUILD_ZLIBDLL" /D "ZLIB_DLL" /D "DYNAMIC_CRC_TABLE" /FAcs /FR /FD /c
-# SUBTRACT CPP /YX
-RSC=rc.exe
-# ADD BASE RSC /l 0x40c /d "NDEBUG"
-# ADD RSC /l 0x40c /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 crtdll.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /subsystem:windows /dll /map /machine:ALPHA /nodefaultlib /out:".\Release\zlib.dll"
-# SUBTRACT BASE LINK32 /pdb:none
-# ADD LINK32 crtdll.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /subsystem:windows /dll /map /machine:ALPHA /nodefaultlib /out:"zlibvc__\zlib.dll"
-# SUBTRACT LINK32 /pdb:none
-
-!ELSEIF  "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "zlibvc_0"
-# PROP BASE Intermediate_Dir "zlibvc_0"
-# PROP BASE Ignore_Export_Lib 0
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "zlibvc_0"
-# PROP Intermediate_Dir "zlibvc_0"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-CPP=cl.exe
-# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_WINDLL" /D "_WIN32" /D "BUILD_ZLIBDLL" /D "ZLIB_DLL" /D "DYNAMIC_CRC_TABLE" /FAcs /FR /YX /FD /c
-# ADD CPP /nologo /MT /W3 /GX /O2 /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_WINDLL" /D "_WIN32" /D "BUILD_ZLIBDLL" /D "ZLIB_DLL" /D "DYNAMIC_CRC_TABLE" /FAcs /FR /FD /c
-# SUBTRACT CPP /YX
-MTL=midl.exe
-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-RSC=rc.exe
-# ADD BASE RSC /l 0x40c /d "NDEBUG"
-# ADD RSC /l 0x40c /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib crtdll.lib /nologo /subsystem:windows /dll /map /machine:I386 /nodefaultlib /out:".\Release\zlib.dll"
-# SUBTRACT BASE LINK32 /pdb:none
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib crtdll.lib /nologo /subsystem:windows /dll /map /machine:I386 /nodefaultlib /out:".\zlibvc_0\zlib.dll"
-# SUBTRACT LINK32 /pdb:none
-
-!ELSEIF  "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "zlibvc_1"
-# PROP BASE Intermediate_Dir "zlibvc_1"
-# PROP BASE Ignore_Export_Lib 0
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "zlibvc_1"
-# PROP Intermediate_Dir "zlibvc_1"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-CPP=cl.exe
-# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_WINDLL" /D "_WIN32" /D "BUILD_ZLIBDLL" /D "ZLIB_DLL" /D "DYNAMIC_CRC_TABLE" /D "ASMV" /FAcs /FR /YX /FD /c
-# ADD CPP /nologo /MT /W3 /GX /O2 /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_WINDLL" /D "_WIN32" /D "BUILD_ZLIBDLL" /D "ZLIB_DLL" /D "DYNAMIC_CRC_TABLE" /D "ASMV" /FAcs /FR /FD /c
-# SUBTRACT CPP /YX
-MTL=midl.exe
-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-RSC=rc.exe
-# ADD BASE RSC /l 0x40c /d "NDEBUG"
-# ADD RSC /l 0x40c /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 gvmat32.obj kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib crtdll.lib /nologo /subsystem:windows /dll /map /machine:I386 /nodefaultlib /out:".\Release\zlib.dll"
-# SUBTRACT BASE LINK32 /pdb:none
-# ADD LINK32 gvmat32.obj kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib crtdll.lib /nologo /subsystem:windows /dll /map /machine:I386 /nodefaultlib /out:".\zlibvc_1\zlib.dll"
-# SUBTRACT LINK32 /pdb:none
-
-!ENDIF 
-
-# Begin Target
-
-# Name "zlibvc - Win32 Release"
-# Name "zlibvc - Win32 Debug"
-# Name "zlibvc - Win32 ReleaseAxp"
-# Name "zlibvc - Win32 ReleaseWithoutAsm"
-# Name "zlibvc - Win32 ReleaseWithoutCrtdll"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;hpj;bat;for;f90"
-# Begin Source File
-
-SOURCE=.\adler32.c
-
-!IF  "$(CFG)" == "zlibvc - Win32 Release"
-
-!ELSEIF  "$(CFG)" == "zlibvc - Win32 Debug"
-
-!ELSEIF  "$(CFG)" == "zlibvc - Win32 ReleaseAxp"
-
-DEP_CPP_ADLER=\
-       ".\zconf.h"\
-       ".\zlib.h"\
-       
-
-!ELSEIF  "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm"
-
-!ELSEIF  "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll"
-
-!ENDIF 
-
-# End Source File
-# Begin Source File
-
-SOURCE=.\compress.c
-
-!IF  "$(CFG)" == "zlibvc - Win32 Release"
-
-!ELSEIF  "$(CFG)" == "zlibvc - Win32 Debug"
-
-!ELSEIF  "$(CFG)" == "zlibvc - Win32 ReleaseAxp"
-
-DEP_CPP_COMPR=\
-       ".\zconf.h"\
-       ".\zlib.h"\
-       
-
-!ELSEIF  "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm"
-
-!ELSEIF  "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll"
-
-!ENDIF 
-
-# End Source File
-# Begin Source File
-
-SOURCE=.\crc32.c
-
-!IF  "$(CFG)" == "zlibvc - Win32 Release"
-
-!ELSEIF  "$(CFG)" == "zlibvc - Win32 Debug"
-
-!ELSEIF  "$(CFG)" == "zlibvc - Win32 ReleaseAxp"
-
-DEP_CPP_CRC32=\
-       ".\zconf.h"\
-       ".\zlib.h"\
-       
-
-!ELSEIF  "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm"
-
-!ELSEIF  "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll"
-
-!ENDIF 
-
-# End Source File
-# Begin Source File
-
-SOURCE=.\deflate.c
-
-!IF  "$(CFG)" == "zlibvc - Win32 Release"
-
-!ELSEIF  "$(CFG)" == "zlibvc - Win32 Debug"
-
-!ELSEIF  "$(CFG)" == "zlibvc - Win32 ReleaseAxp"
-
-DEP_CPP_DEFLA=\
-       ".\deflate.h"\
-       ".\zconf.h"\
-       ".\zlib.h"\
-       ".\zutil.h"\
-       
-
-!ELSEIF  "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm"
-
-!ELSEIF  "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll"
-
-!ENDIF 
-
-# End Source File
-# Begin Source File
-
-SOURCE=.\gvmat32c.c
-
-!IF  "$(CFG)" == "zlibvc - Win32 Release"
-
-!ELSEIF  "$(CFG)" == "zlibvc - Win32 Debug"
-
-!ELSEIF  "$(CFG)" == "zlibvc - Win32 ReleaseAxp"
-
-!ELSEIF  "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm"
-
-!ELSEIF  "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll"
-
-!ENDIF 
-
-# End Source File
-# Begin Source File
-
-SOURCE=.\gzio.c
-
-!IF  "$(CFG)" == "zlibvc - Win32 Release"
-
-!ELSEIF  "$(CFG)" == "zlibvc - Win32 Debug"
-
-!ELSEIF  "$(CFG)" == "zlibvc - Win32 ReleaseAxp"
-
-DEP_CPP_GZIO_=\
-       ".\zconf.h"\
-       ".\zlib.h"\
-       ".\zutil.h"\
-       
-
-!ELSEIF  "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm"
-
-!ELSEIF  "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll"
-
-!ENDIF 
-
-# End Source File
-# Begin Source File
-
-SOURCE=.\infblock.c
-
-!IF  "$(CFG)" == "zlibvc - Win32 Release"
-
-!ELSEIF  "$(CFG)" == "zlibvc - Win32 Debug"
-
-!ELSEIF  "$(CFG)" == "zlibvc - Win32 ReleaseAxp"
-
-DEP_CPP_INFBL=\
-       ".\infblock.h"\
-       ".\infcodes.h"\
-       ".\inftrees.h"\
-       ".\infutil.h"\
-       ".\zconf.h"\
-       ".\zlib.h"\
-       ".\zutil.h"\
-       
-
-!ELSEIF  "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm"
-
-!ELSEIF  "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll"
-
-!ENDIF 
-
-# End Source File
-# Begin Source File
-
-SOURCE=.\infcodes.c
-
-!IF  "$(CFG)" == "zlibvc - Win32 Release"
-
-!ELSEIF  "$(CFG)" == "zlibvc - Win32 Debug"
-
-!ELSEIF  "$(CFG)" == "zlibvc - Win32 ReleaseAxp"
-
-DEP_CPP_INFCO=\
-       ".\infblock.h"\
-       ".\infcodes.h"\
-       ".\inffast.h"\
-       ".\inftrees.h"\
-       ".\infutil.h"\
-       ".\zconf.h"\
-       ".\zlib.h"\
-       ".\zutil.h"\
-       
-
-!ELSEIF  "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm"
-
-!ELSEIF  "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll"
-
-!ENDIF 
-
-# End Source File
-# Begin Source File
-
-SOURCE=.\inffast.c
-
-!IF  "$(CFG)" == "zlibvc - Win32 Release"
-
-!ELSEIF  "$(CFG)" == "zlibvc - Win32 Debug"
-
-!ELSEIF  "$(CFG)" == "zlibvc - Win32 ReleaseAxp"
-
-DEP_CPP_INFFA=\
-       ".\infblock.h"\
-       ".\infcodes.h"\
-       ".\inffast.h"\
-       ".\inftrees.h"\
-       ".\infutil.h"\
-       ".\zconf.h"\
-       ".\zlib.h"\
-       ".\zutil.h"\
-       
-
-!ELSEIF  "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm"
-
-!ELSEIF  "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll"
-
-!ENDIF 
-
-# End Source File
-# Begin Source File
-
-SOURCE=.\inflate.c
-
-!IF  "$(CFG)" == "zlibvc - Win32 Release"
-
-!ELSEIF  "$(CFG)" == "zlibvc - Win32 Debug"
-
-!ELSEIF  "$(CFG)" == "zlibvc - Win32 ReleaseAxp"
-
-DEP_CPP_INFLA=\
-       ".\infblock.h"\
-       ".\zconf.h"\
-       ".\zlib.h"\
-       ".\zutil.h"\
-       
-
-!ELSEIF  "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm"
-
-!ELSEIF  "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll"
-
-!ENDIF 
-
-# End Source File
-# Begin Source File
-
-SOURCE=.\inftrees.c
-
-!IF  "$(CFG)" == "zlibvc - Win32 Release"
-
-!ELSEIF  "$(CFG)" == "zlibvc - Win32 Debug"
-
-!ELSEIF  "$(CFG)" == "zlibvc - Win32 ReleaseAxp"
-
-DEP_CPP_INFTR=\
-       ".\inftrees.h"\
-       ".\zconf.h"\
-       ".\zlib.h"\
-       ".\zutil.h"\
-       
-
-!ELSEIF  "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm"
-
-!ELSEIF  "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll"
-
-!ENDIF 
-
-# End Source File
-# Begin Source File
-
-SOURCE=.\infutil.c
-
-!IF  "$(CFG)" == "zlibvc - Win32 Release"
-
-!ELSEIF  "$(CFG)" == "zlibvc - Win32 Debug"
-
-!ELSEIF  "$(CFG)" == "zlibvc - Win32 ReleaseAxp"
-
-DEP_CPP_INFUT=\
-       ".\infblock.h"\
-       ".\infcodes.h"\
-       ".\inftrees.h"\
-       ".\infutil.h"\
-       ".\zconf.h"\
-       ".\zlib.h"\
-       ".\zutil.h"\
-       
-
-!ELSEIF  "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm"
-
-!ELSEIF  "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll"
-
-!ENDIF 
-
-# End Source File
-# Begin Source File
-
-SOURCE=.\trees.c
-
-!IF  "$(CFG)" == "zlibvc - Win32 Release"
-
-!ELSEIF  "$(CFG)" == "zlibvc - Win32 Debug"
-
-!ELSEIF  "$(CFG)" == "zlibvc - Win32 ReleaseAxp"
-
-DEP_CPP_TREES=\
-       ".\deflate.h"\
-       ".\zconf.h"\
-       ".\zlib.h"\
-       ".\zutil.h"\
-       
-
-!ELSEIF  "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm"
-
-!ELSEIF  "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll"
-
-!ENDIF 
-
-# End Source File
-# Begin Source File
-
-SOURCE=.\uncompr.c
-
-!IF  "$(CFG)" == "zlibvc - Win32 Release"
-
-!ELSEIF  "$(CFG)" == "zlibvc - Win32 Debug"
-
-!ELSEIF  "$(CFG)" == "zlibvc - Win32 ReleaseAxp"
-
-DEP_CPP_UNCOM=\
-       ".\zconf.h"\
-       ".\zlib.h"\
-       
-
-!ELSEIF  "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm"
-
-!ELSEIF  "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll"
-
-!ENDIF 
-
-# End Source File
-# Begin Source File
-
-SOURCE=.\unzip.c
-
-!IF  "$(CFG)" == "zlibvc - Win32 Release"
-
-!ELSEIF  "$(CFG)" == "zlibvc - Win32 Debug"
-
-!ELSEIF  "$(CFG)" == "zlibvc - Win32 ReleaseAxp"
-
-!ELSEIF  "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm"
-
-!ELSEIF  "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll"
-
-!ENDIF 
-
-# End Source File
-# Begin Source File
-
-SOURCE=.\zip.c
-
-!IF  "$(CFG)" == "zlibvc - Win32 Release"
-
-!ELSEIF  "$(CFG)" == "zlibvc - Win32 Debug"
-
-!ELSEIF  "$(CFG)" == "zlibvc - Win32 ReleaseAxp"
-
-!ELSEIF  "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm"
-
-!ELSEIF  "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll"
-
-!ENDIF 
-
-# End Source File
-# Begin Source File
-
-SOURCE=.\zlib.rc
-# End Source File
-# Begin Source File
-
-SOURCE=.\zlibvc.def
-# End Source File
-# Begin Source File
-
-SOURCE=.\zutil.c
-
-!IF  "$(CFG)" == "zlibvc - Win32 Release"
-
-!ELSEIF  "$(CFG)" == "zlibvc - Win32 Debug"
-
-!ELSEIF  "$(CFG)" == "zlibvc - Win32 ReleaseAxp"
-
-DEP_CPP_ZUTIL=\
-       ".\zconf.h"\
-       ".\zlib.h"\
-       ".\zutil.h"\
-       
-
-!ELSEIF  "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm"
-
-!ELSEIF  "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll"
-
-!ENDIF 
-
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl;fi;fd"
-# Begin Source File
-
-SOURCE=.\deflate.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\infblock.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\infcodes.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\inffast.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\inftrees.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\infutil.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\zconf.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\zlib.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\zutil.h
-# End Source File
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;cnt;rtf;gif;jpg;jpeg;jpe"
-# End Group
-# End Target
-# End Project
diff --git a/lib/zlib/contrib/minizip/zlibvc.dsw b/lib/zlib/contrib/minizip/zlibvc.dsw
deleted file mode 100644 (file)
index 493cd87..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-Microsoft Developer Studio Workspace File, Format Version 5.00
-# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
-
-###############################################################################
-
-Project: "zlibstat"=.\zlibstat.dsp - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
-}}}
-
-###############################################################################
-
-Project: "zlibvc"=.\zlibvc.dsp - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
-}}}
-
-###############################################################################
-
-Global:
-
-Package=<5>
-{{{
-}}}
-
-Package=<3>
-{{{
-}}}
-
-###############################################################################
-
diff --git a/lib/zlib/contrib/untgz/Makefile b/lib/zlib/contrib/untgz/Makefile
deleted file mode 100644 (file)
index 409b4bd..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-CC=cc
-CFLAGS=-g
-
-untgz: untgz.o  ../../libz.a
-       $(CC) $(CFLAGS) -o untgz  untgz.o -L../.. -lz
-
-untgz.o: untgz.c ../../zlib.h
-       $(CC) $(CFLAGS) -c -I../.. untgz.c
-
-../../libz.a:
-       cd ../..; make
-
-clean:
-       rm -f untgz untgz.o *~
diff --git a/lib/zlib/contrib/untgz/makefile.w32 b/lib/zlib/contrib/untgz/makefile.w32
deleted file mode 100644 (file)
index c99dc28..0000000
+++ /dev/null
@@ -1,63 +0,0 @@
-# Makefile for zlib.  Modified for mingw32
-# For conditions of distribution and use, see copyright notice in zlib.h 
-
-# To compile, 
-# 
-#   make -fmakefile.w32
-# 
-
-CC=gcc
-
-# Generate dependencies (see end of the file)
-
-CPPFLAGS=-MMD 
-
-#CFLAGS=-MMD -O
-#CFLAGS=-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7
-#CFLAGS=-MMD -g -DDEBUG
-CFLAGS=-O3 $(BUTT) -Wall -Wwrite-strings -Wpointer-arith -Wconversion \
-             -Wstrict-prototypes -Wmissing-prototypes
-
-# If cp.exe is not found, replace with copy /Y .
-CP=cp -f
-
-# The default value of RM is "rm -f."  
-# If "rm.exe" is not found, uncomment:
-# RM=del
-
-LD=gcc
-LDLIBS=-L. -lz
-LDFLAGS=-s
-
-
-INCL=zlib.h zconf.h
-LIBS=libz.a
-
-AR=ar rcs
-
-OBJS = adler32.o compress.o crc32.o gzio.o uncompr.o deflate.o trees.o \
-       zutil.o inflate.o infblock.o inftrees.o infcodes.o infutil.o \
-       inffast.o
-
-TEST_OBJS = minigzip.o untgz.o
-
-all: minigzip.exe untgz.exe
-
-rebuild:       clean   all
-
-libz.a: $(OBJS)
-       $(AR) $@ $(OBJS)
-
-%.exe : %.o $(LIBS)
-       $(LD) $(LDFLAGS) -o $@ $< $(LDLIBS)
-
-.PHONY : clean
-
-clean:
-       $(RM) *.d *.o *.exe libz.a foo.gz
-
-DEPS := $(wildcard *.d)
-ifneq ($(DEPS),)
-include $(DEPS)
-endif
-
diff --git a/lib/zlib/contrib/untgz/untgz.c b/lib/zlib/contrib/untgz/untgz.c
deleted file mode 100644 (file)
index 4a431ff..0000000
+++ /dev/null
@@ -1,522 +0,0 @@
-/*
- * untgz.c -- Display contents and/or extract file from
- * a gzip'd TAR file
- * written by "Pedro A. Aranda Guti\irrez" <paag@tid.es>
- * adaptation to Unix by Jean-loup Gailly <jloup@gzip.org>
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <time.h>
-#include <errno.h>
-#include <fcntl.h>
-#ifdef unix
-# include <unistd.h>
-#else
-# include <direct.h>
-# include <io.h>
-#endif
-
-#include "zlib.h"
-
-#ifdef WIN32
-#  ifndef F_OK
-#    define F_OK (0)
-#  endif
-#  ifdef _MSC_VER
-#    define mkdir(dirname,mode) _mkdir(dirname)
-#    define strdup(str)         _strdup(str)
-#    define unlink(fn)          _unlink(fn)
-#    define access(path,mode)   _access(path,mode)
-#  else
-#    define mkdir(dirname,mode) _mkdir(dirname)
-#  endif
-#else
-#  include <utime.h>
-#endif
-
-
-/* Values used in typeflag field.  */
-
-#define REGTYPE         '0'            /* regular file */
-#define AREGTYPE '\0'          /* regular file */
-#define LNKTYPE  '1'           /* link */
-#define SYMTYPE  '2'           /* reserved */
-#define CHRTYPE  '3'           /* character special */
-#define BLKTYPE  '4'           /* block special */
-#define DIRTYPE  '5'           /* directory */
-#define FIFOTYPE '6'           /* FIFO special */
-#define CONTTYPE '7'           /* reserved */
-
-#define BLOCKSIZE 512
-
-struct tar_header
-{                              /* byte offset */
-  char name[100];              /*   0 */
-  char mode[8];                        /* 100 */
-  char uid[8];                 /* 108 */
-  char gid[8];                 /* 116 */
-  char size[12];               /* 124 */
-  char mtime[12];              /* 136 */
-  char chksum[8];              /* 148 */
-  char typeflag;               /* 156 */
-  char linkname[100];          /* 157 */
-  char magic[6];               /* 257 */
-  char version[2];             /* 263 */
-  char uname[32];              /* 265 */
-  char gname[32];              /* 297 */
-  char devmajor[8];            /* 329 */
-  char devminor[8];            /* 337 */
-  char prefix[155];            /* 345 */
-                               /* 500 */
-};
-
-union tar_buffer {
-  char               buffer[BLOCKSIZE];
-  struct tar_header  header;
-};
-
-enum { TGZ_EXTRACT = 0, TGZ_LIST };
-
-static char *TGZfname  OF((const char *));
-void TGZnotfound       OF((const char *));
-
-int getoct             OF((char *, int));
-char *strtime          OF((time_t *));
-int ExprMatch          OF((char *,char *));
-
-int makedir            OF((char *));
-int matchname          OF((int,int,char **,char *));
-
-void error             OF((const char *));
-int  tar               OF((gzFile, int, int, int, char **));
-
-void help              OF((int));
-int main               OF((int, char **));
-
-char *prog;
-
-/* This will give a benign warning */
-
-static char *TGZprefix[] = { "\0", ".tgz", ".tar.gz", ".tar", NULL };
-
-/* Return the real name of the TGZ archive */
-/* or NULL if it does not exist. */
-
-static char *TGZfname OF((const char *fname))
-{
-  static char buffer[1024];
-  int origlen,i;
-  
-  strcpy(buffer,fname);
-  origlen = strlen(buffer);
-
-  for (i=0; TGZprefix[i]; i++)
-    {
-       strcpy(buffer+origlen,TGZprefix[i]);
-       if (access(buffer,F_OK) == 0)
-         return buffer;
-    }
-  return NULL;
-}
-
-/* error message for the filename */
-
-void TGZnotfound OF((const char *fname))
-{
-  int i;
-
-  fprintf(stderr,"%s : couldn't find ",prog);
-  for (i=0;TGZprefix[i];i++)
-    fprintf(stderr,(TGZprefix[i+1]) ? "%s%s, " : "or %s%s\n",
-            fname,
-            TGZprefix[i]);
-  exit(1);
-}
-
-
-/* help functions */
-
-int getoct(char *p,int width)
-{
-  int result = 0;
-  char c;
-  
-  while (width --)
-    {
-      c = *p++;
-      if (c == ' ')
-       continue;
-      if (c == 0)
-       break;
-      result = result * 8 + (c - '0');
-    }
-  return result;
-}
-
-char *strtime (time_t *t)
-{
-  struct tm   *local;
-  static char result[32];
-
-  local = localtime(t);
-  sprintf(result,"%2d/%02d/%4d %02d:%02d:%02d",
-         local->tm_mday, local->tm_mon+1, local->tm_year+1900,
-         local->tm_hour, local->tm_min,   local->tm_sec);
-  return result;
-}
-
-
-/* regular expression matching */
-
-#define ISSPECIAL(c) (((c) == '*') || ((c) == '/'))
-
-int ExprMatch(char *string,char *expr)
-{
-  while (1)
-    {
-      if (ISSPECIAL(*expr))
-       {
-         if (*expr == '/')
-           {
-             if (*string != '\\' && *string != '/')
-               return 0;
-             string ++; expr++;
-           }
-         else if (*expr == '*')
-           {
-             if (*expr ++ == 0)
-               return 1;
-             while (*++string != *expr)
-               if (*string == 0)
-                 return 0;
-           }
-       }
-      else
-       {
-         if (*string != *expr)
-           return 0;
-         if (*expr++ == 0)
-           return 1;
-         string++;
-       }
-    }
-}
-
-/* recursive make directory */
-/* abort if you get an ENOENT errno somewhere in the middle */
-/* e.g. ignore error "mkdir on existing directory" */
-/* */
-/* return 1 if OK */
-/*        0 on error */
-
-int makedir (char *newdir)
-{
-  char *buffer = strdup(newdir);
-  char *p;
-  int  len = strlen(buffer);
-  
-  if (len <= 0) {
-    free(buffer);
-    return 0;
-  }
-  if (buffer[len-1] == '/') {
-    buffer[len-1] = '\0';
-  }
-  if (mkdir(buffer, 0775) == 0)
-    {
-      free(buffer);
-      return 1;
-    }
-
-  p = buffer+1;
-  while (1)
-    {
-      char hold;
-      
-      while(*p && *p != '\\' && *p != '/')
-       p++;
-      hold = *p;
-      *p = 0;
-      if ((mkdir(buffer, 0775) == -1) && (errno == ENOENT))
-       {
-         fprintf(stderr,"%s: couldn't create directory %s\n",prog,buffer);
-         free(buffer);
-         return 0;
-       }
-      if (hold == 0)
-       break;
-      *p++ = hold;
-    }
-  free(buffer);
-  return 1;
-}
-
-int matchname (int arg,int argc,char **argv,char *fname)
-{
-  if (arg == argc)             /* no arguments given (untgz tgzarchive) */
-    return 1;
-
-  while (arg < argc)
-    if (ExprMatch(fname,argv[arg++]))
-      return 1;
-
-  return 0; /* ignore this for the moment being */
-}
-
-
-/* Tar file list or extract */
-
-int tar (gzFile in,int action,int arg,int argc,char **argv)
-{
-  union  tar_buffer buffer;
-  int    len;
-  int    err;
-  int    getheader = 1;
-  int    remaining = 0;
-  FILE   *outfile = NULL;
-  char   fname[BLOCKSIZE];
-  time_t tartime;
-  
-  if (action == TGZ_LIST)
-    printf("     day      time     size                       file\n"
-          " ---------- -------- --------- -------------------------------------\n");
-  while (1)
-    {
-      len = gzread(in, &buffer, BLOCKSIZE);
-      if (len < 0)
-       error (gzerror(in, &err));
-      /*
-       * Always expect complete blocks to process
-       * the tar information.
-       */
-      if (len != BLOCKSIZE)
-       error("gzread: incomplete block read");
-      
-      /*
-       * If we have to get a tar header
-       */
-      if (getheader == 1)
-       {
-         /*
-          * if we met the end of the tar
-          * or the end-of-tar block,
-          * we are done
-          */
-         if ((len == 0)  || (buffer.header.name[0]== 0)) break;
-
-         tartime = (time_t)getoct(buffer.header.mtime,12);
-         strcpy(fname,buffer.header.name);
-         
-         switch (buffer.header.typeflag)
-           {
-           case DIRTYPE:
-             if (action == TGZ_LIST)
-               printf(" %s     <dir> %s\n",strtime(&tartime),fname);
-             if (action == TGZ_EXTRACT)
-               makedir(fname);
-             break;
-           case REGTYPE:
-           case AREGTYPE:
-             remaining = getoct(buffer.header.size,12);
-             if (action == TGZ_LIST)
-               printf(" %s %9d %s\n",strtime(&tartime),remaining,fname);
-             if (action == TGZ_EXTRACT)
-               {
-                 if ((remaining) && (matchname(arg,argc,argv,fname)))
-                   {
-                     outfile = fopen(fname,"wb");
-                     if (outfile == NULL) {
-                       /* try creating directory */
-                       char *p = strrchr(fname, '/');
-                       if (p != NULL) {
-                         *p = '\0';
-                         makedir(fname);
-                         *p = '/';
-                         outfile = fopen(fname,"wb");
-                       }
-                     }
-                     fprintf(stderr,
-                             "%s %s\n",
-                             (outfile) ? "Extracting" : "Couldn't create",
-                             fname);
-                   }
-                 else
-                   outfile = NULL;
-               }
-             /*
-              * could have no contents
-              */
-             getheader = (remaining) ? 0 : 1;
-             break;
-           default:
-             if (action == TGZ_LIST)
-               printf(" %s     <---> %s\n",strtime(&tartime),fname);
-             break;
-           }
-       }
-      else
-       {
-         unsigned int bytes = (remaining > BLOCKSIZE) ? BLOCKSIZE : remaining;
-
-         if ((action == TGZ_EXTRACT) && (outfile != NULL))
-           {
-             if (fwrite(&buffer,sizeof(char),bytes,outfile) != bytes)
-               {
-                 fprintf(stderr,"%s : error writing %s skipping...\n",prog,fname);
-                 fclose(outfile);
-                 unlink(fname);
-               }
-           }
-         remaining -= bytes;
-         if (remaining == 0)
-           {
-             getheader = 1;
-             if ((action == TGZ_EXTRACT) && (outfile != NULL))
-               {
-#ifdef WIN32
-                 HANDLE hFile;
-                 FILETIME ftm,ftLocal;
-                 SYSTEMTIME st;
-                 struct tm localt;
-                 fclose(outfile);
-
-                 localt = *localtime(&tartime);
-
-                 hFile = CreateFile(fname, GENERIC_READ | GENERIC_WRITE,
-                                    0, NULL, OPEN_EXISTING, 0, NULL);
-                 
-                 st.wYear = (WORD)localt.tm_year+1900;
-                 st.wMonth = (WORD)localt.tm_mon;
-                 st.wDayOfWeek = (WORD)localt.tm_wday;
-                 st.wDay = (WORD)localt.tm_mday;
-                 st.wHour = (WORD)localt.tm_hour;
-                 st.wMinute = (WORD)localt.tm_min;
-                 st.wSecond = (WORD)localt.tm_sec;
-                 st.wMilliseconds = 0;
-                 SystemTimeToFileTime(&st,&ftLocal);
-                 LocalFileTimeToFileTime(&ftLocal,&ftm);
-                 SetFileTime(hFile,&ftm,NULL,&ftm);
-                 CloseHandle(hFile);
-
-                 outfile = NULL;
-#else
-                 struct utimbuf settime;
-
-                 settime.actime = settime.modtime = tartime;
-
-                 fclose(outfile);
-                 outfile = NULL;
-                 utime(fname,&settime);
-#endif
-               }
-           }
-       }
-    }
-  
-  if (gzclose(in) != Z_OK)
-    error("failed gzclose");
-
-  return 0;
-}
-
-
-/* =========================================================== */
-
-void help(int exitval)
-{
-  fprintf(stderr,
-         "untgz v 0.1\n"
-         " an sample application of zlib 1.0.4\n\n"
-          "Usage : untgz TGZfile            to extract all files\n"
-          "        untgz TGZfile fname ...  to extract selected files\n"
-          "        untgz -l TGZfile         to list archive contents\n"
-          "        untgz -h                 to display this help\n\n");
-  exit(exitval);
-}
-
-void error(const char *msg)
-{
-    fprintf(stderr, "%s: %s\n", prog, msg);
-    exit(1);
-}
-
-
-/* ====================================================================== */
-
-int _CRT_glob = 0;     /* disable globbing of the arguments */
-
-int main(int argc,char **argv)
-{
-    int        action = TGZ_EXTRACT;
-    int        arg = 1;
-    char       *TGZfile;
-    gzFile     *f;
-    
-
-    prog = strrchr(argv[0],'\\');
-    if (prog == NULL)
-      {
-       prog = strrchr(argv[0],'/');
-       if (prog == NULL)
-         {
-           prog = strrchr(argv[0],':');
-           if (prog == NULL)
-             prog = argv[0];
-           else
-             prog++;
-         }
-       else
-         prog++;
-      }
-    else
-      prog++;
-    
-    if (argc == 1)
-      help(0);
-
-    if (strcmp(argv[arg],"-l") == 0)
-      {
-       action = TGZ_LIST;
-       if (argc == ++arg)
-         help(0);
-      }
-    else if (strcmp(argv[arg],"-h") == 0)
-      {
-       help(0);
-      }
-
-    if ((TGZfile = TGZfname(argv[arg])) == NULL)
-      TGZnotfound(argv[arg]);            
-
-    ++arg;
-    if ((action == TGZ_LIST) && (arg != argc))
-      help(1);
-
-/*
- *  Process the TGZ file
- */
-    switch(action)
-      {
-      case TGZ_LIST:
-      case TGZ_EXTRACT:
-       f = gzopen(TGZfile,"rb");
-       if (f == NULL)
-         {
-           fprintf(stderr,"%s: Couldn't gzopen %s\n",
-                   prog,
-                   TGZfile);
-           return 1;
-         }
-       exit(tar(f, action, arg, argc, argv));
-      break;
-       
-      default:
-       error("Unknown option!");
-       exit(1);
-      }
-
-    return 0;
-}
diff --git a/lib/zlib/contrib/visual-basic.txt b/lib/zlib/contrib/visual-basic.txt
deleted file mode 100644 (file)
index 10fb44b..0000000
+++ /dev/null
@@ -1,69 +0,0 @@
-See below some functions declarations for Visual Basic.
-
-Frequently Asked Question:
-
-Q: Each time I use the compress function I get the -5 error (not enough
-   room in the output buffer).
-
-A: Make sure that the length of the compressed buffer is passed by
-   reference ("as any"), not by value ("as long"). Also check that
-   before the call of compress this length is equal to the total size of
-   the compressed buffer and not zero.
-
-
-From: "Jon Caruana" <jon-net@usa.net>
-Subject: Re: How to port zlib declares to vb?
-Date: Mon, 28 Oct 1996 18:33:03 -0600
-
-Got the answer! (I haven't had time to check this but it's what I got, and
-looks correct):
-
-He has the following routines working:
-        compress
-        uncompress
-        gzopen
-        gzwrite
-        gzread
-        gzclose
-
-Declares follow: (Quoted from Carlos Rios <c_rios@sonda.cl>, in Vb4 form)
-
-#If Win16 Then   'Use Win16 calls.
-Declare Function compress Lib "ZLIB.DLL" (ByVal compr As
-        String, comprLen As Any, ByVal buf As String, ByVal buflen
-        As Long) As Integer
-Declare Function uncompress Lib "ZLIB.DLL" (ByVal uncompr
-        As String, uncomprLen As Any, ByVal compr As String, ByVal
-        lcompr As Long) As Integer
-Declare Function gzopen Lib "ZLIB.DLL" (ByVal filePath As
-        String, ByVal mode As String) As Long
-Declare Function gzread Lib "ZLIB.DLL" (ByVal file As
-        Long, ByVal uncompr As String, ByVal uncomprLen As Integer)
-        As Integer
-Declare Function gzwrite Lib "ZLIB.DLL" (ByVal file As
-        Long, ByVal uncompr As String, ByVal uncomprLen As Integer)
-        As Integer
-Declare Function gzclose Lib "ZLIB.DLL" (ByVal file As
-        Long) As Integer
-#Else
-Declare Function compress Lib "ZLIB32.DLL"
-        (ByVal compr As String, comprLen As Any, ByVal buf As
-        String, ByVal buflen As Long) As Integer
-Declare Function uncompress Lib "ZLIB32.DLL"
-        (ByVal uncompr As String, uncomprLen As Any, ByVal compr As
-        String, ByVal lcompr As Long) As Long
-Declare Function gzopen Lib "ZLIB32.DLL"
-        (ByVal file As String, ByVal mode As String) As Long
-Declare Function gzread Lib "ZLIB32.DLL"
-        (ByVal file As Long, ByVal uncompr As String, ByVal
-        uncomprLen As Long) As Long
-Declare Function gzwrite Lib "ZLIB32.DLL"
-        (ByVal file As Long, ByVal uncompr As String, ByVal
-        uncomprLen As Long) As Long
-Declare Function gzclose Lib "ZLIB32.DLL"
-        (ByVal file As Long) As Long
-#End If
-
--Jon Caruana
-jon-net@usa.net
-Microsoft Sitebuilder Network Level 1 Member - HTML Writer's Guild Member
diff --git a/lib/zlib/crc32.c b/lib/zlib/crc32.c
deleted file mode 100644 (file)
index 60deca2..0000000
+++ /dev/null
@@ -1,162 +0,0 @@
-/* crc32.c -- compute the CRC-32 of a data stream
- * Copyright (C) 1995-2002 Mark Adler
- * For conditions of distribution and use, see copyright notice in zlib.h 
- */
-
-/* @(#) $Id$ */
-
-#include "zlib.h"
-
-#define local static
-
-#ifdef DYNAMIC_CRC_TABLE
-
-local int crc_table_empty = 1;
-local uLongf crc_table[256];
-local void make_crc_table OF((void));
-
-/*
-  Generate a table for a byte-wise 32-bit CRC calculation on the polynomial:
-  x^32+x^26+x^23+x^22+x^16+x^12+x^11+x^10+x^8+x^7+x^5+x^4+x^2+x+1.
-
-  Polynomials over GF(2) are represented in binary, one bit per coefficient,
-  with the lowest powers in the most significant bit.  Then adding polynomials
-  is just exclusive-or, and multiplying a polynomial by x is a right shift by
-  one.  If we call the above polynomial p, and represent a byte as the
-  polynomial q, also with the lowest power in the most significant bit (so the
-  byte 0xb1 is the polynomial x^7+x^3+x+1), then the CRC is (q*x^32) mod p,
-  where a mod b means the remainder after dividing a by b.
-
-  This calculation is done using the shift-register method of multiplying and
-  taking the remainder.  The register is initialized to zero, and for each
-  incoming bit, x^32 is added mod p to the register if the bit is a one (where
-  x^32 mod p is p+x^32 = x^26+...+1), and the register is multiplied mod p by
-  x (which is shifting right by one and adding x^32 mod p if the bit shifted
-  out is a one).  We start with the highest power (least significant bit) of
-  q and repeat for all eight bits of q.
-
-  The table is simply the CRC of all possible eight bit values.  This is all
-  the information needed to generate CRC's on data a byte at a time for all
-  combinations of CRC register values and incoming bytes.
-*/
-local void make_crc_table()
-{
-  uLong c;
-  int n, k;
-  uLong poly;            /* polynomial exclusive-or pattern */
-  /* terms of polynomial defining this crc (except x^32): */
-  static const Byte p[] = {0,1,2,4,5,7,8,10,11,12,16,22,23,26};
-
-  /* make exclusive-or pattern from polynomial (0xedb88320L) */
-  poly = 0L;
-  for (n = 0; n < sizeof(p)/sizeof(Byte); n++)
-    poly |= 1L << (31 - p[n]);
-  for (n = 0; n < 256; n++)
-  {
-    c = (uLong)n;
-    for (k = 0; k < 8; k++)
-      c = c & 1 ? poly ^ (c >> 1) : c >> 1;
-    crc_table[n] = c;
-  }
-  crc_table_empty = 0;
-}
-#else
-/* ========================================================================
- * Table of CRC-32's of all single-byte values (made by make_crc_table)
- */
-local const uLongf crc_table[256] = {
-  0x00000000L, 0x77073096L, 0xee0e612cL, 0x990951baL, 0x076dc419L,
-  0x706af48fL, 0xe963a535L, 0x9e6495a3L, 0x0edb8832L, 0x79dcb8a4L,
-  0xe0d5e91eL, 0x97d2d988L, 0x09b64c2bL, 0x7eb17cbdL, 0xe7b82d07L,
-  0x90bf1d91L, 0x1db71064L, 0x6ab020f2L, 0xf3b97148L, 0x84be41deL,
-  0x1adad47dL, 0x6ddde4ebL, 0xf4d4b551L, 0x83d385c7L, 0x136c9856L,
-  0x646ba8c0L, 0xfd62f97aL, 0x8a65c9ecL, 0x14015c4fL, 0x63066cd9L,
-  0xfa0f3d63L, 0x8d080df5L, 0x3b6e20c8L, 0x4c69105eL, 0xd56041e4L,
-  0xa2677172L, 0x3c03e4d1L, 0x4b04d447L, 0xd20d85fdL, 0xa50ab56bL,
-  0x35b5a8faL, 0x42b2986cL, 0xdbbbc9d6L, 0xacbcf940L, 0x32d86ce3L,
-  0x45df5c75L, 0xdcd60dcfL, 0xabd13d59L, 0x26d930acL, 0x51de003aL,
-  0xc8d75180L, 0xbfd06116L, 0x21b4f4b5L, 0x56b3c423L, 0xcfba9599L,
-  0xb8bda50fL, 0x2802b89eL, 0x5f058808L, 0xc60cd9b2L, 0xb10be924L,
-  0x2f6f7c87L, 0x58684c11L, 0xc1611dabL, 0xb6662d3dL, 0x76dc4190L,
-  0x01db7106L, 0x98d220bcL, 0xefd5102aL, 0x71b18589L, 0x06b6b51fL,
-  0x9fbfe4a5L, 0xe8b8d433L, 0x7807c9a2L, 0x0f00f934L, 0x9609a88eL,
-  0xe10e9818L, 0x7f6a0dbbL, 0x086d3d2dL, 0x91646c97L, 0xe6635c01L,
-  0x6b6b51f4L, 0x1c6c6162L, 0x856530d8L, 0xf262004eL, 0x6c0695edL,
-  0x1b01a57bL, 0x8208f4c1L, 0xf50fc457L, 0x65b0d9c6L, 0x12b7e950L,
-  0x8bbeb8eaL, 0xfcb9887cL, 0x62dd1ddfL, 0x15da2d49L, 0x8cd37cf3L,
-  0xfbd44c65L, 0x4db26158L, 0x3ab551ceL, 0xa3bc0074L, 0xd4bb30e2L,
-  0x4adfa541L, 0x3dd895d7L, 0xa4d1c46dL, 0xd3d6f4fbL, 0x4369e96aL,
-  0x346ed9fcL, 0xad678846L, 0xda60b8d0L, 0x44042d73L, 0x33031de5L,
-  0xaa0a4c5fL, 0xdd0d7cc9L, 0x5005713cL, 0x270241aaL, 0xbe0b1010L,
-  0xc90c2086L, 0x5768b525L, 0x206f85b3L, 0xb966d409L, 0xce61e49fL,
-  0x5edef90eL, 0x29d9c998L, 0xb0d09822L, 0xc7d7a8b4L, 0x59b33d17L,
-  0x2eb40d81L, 0xb7bd5c3bL, 0xc0ba6cadL, 0xedb88320L, 0x9abfb3b6L,
-  0x03b6e20cL, 0x74b1d29aL, 0xead54739L, 0x9dd277afL, 0x04db2615L,
-  0x73dc1683L, 0xe3630b12L, 0x94643b84L, 0x0d6d6a3eL, 0x7a6a5aa8L,
-  0xe40ecf0bL, 0x9309ff9dL, 0x0a00ae27L, 0x7d079eb1L, 0xf00f9344L,
-  0x8708a3d2L, 0x1e01f268L, 0x6906c2feL, 0xf762575dL, 0x806567cbL,
-  0x196c3671L, 0x6e6b06e7L, 0xfed41b76L, 0x89d32be0L, 0x10da7a5aL,
-  0x67dd4accL, 0xf9b9df6fL, 0x8ebeeff9L, 0x17b7be43L, 0x60b08ed5L,
-  0xd6d6a3e8L, 0xa1d1937eL, 0x38d8c2c4L, 0x4fdff252L, 0xd1bb67f1L,
-  0xa6bc5767L, 0x3fb506ddL, 0x48b2364bL, 0xd80d2bdaL, 0xaf0a1b4cL,
-  0x36034af6L, 0x41047a60L, 0xdf60efc3L, 0xa867df55L, 0x316e8eefL,
-  0x4669be79L, 0xcb61b38cL, 0xbc66831aL, 0x256fd2a0L, 0x5268e236L,
-  0xcc0c7795L, 0xbb0b4703L, 0x220216b9L, 0x5505262fL, 0xc5ba3bbeL,
-  0xb2bd0b28L, 0x2bb45a92L, 0x5cb36a04L, 0xc2d7ffa7L, 0xb5d0cf31L,
-  0x2cd99e8bL, 0x5bdeae1dL, 0x9b64c2b0L, 0xec63f226L, 0x756aa39cL,
-  0x026d930aL, 0x9c0906a9L, 0xeb0e363fL, 0x72076785L, 0x05005713L,
-  0x95bf4a82L, 0xe2b87a14L, 0x7bb12baeL, 0x0cb61b38L, 0x92d28e9bL,
-  0xe5d5be0dL, 0x7cdcefb7L, 0x0bdbdf21L, 0x86d3d2d4L, 0xf1d4e242L,
-  0x68ddb3f8L, 0x1fda836eL, 0x81be16cdL, 0xf6b9265bL, 0x6fb077e1L,
-  0x18b74777L, 0x88085ae6L, 0xff0f6a70L, 0x66063bcaL, 0x11010b5cL,
-  0x8f659effL, 0xf862ae69L, 0x616bffd3L, 0x166ccf45L, 0xa00ae278L,
-  0xd70dd2eeL, 0x4e048354L, 0x3903b3c2L, 0xa7672661L, 0xd06016f7L,
-  0x4969474dL, 0x3e6e77dbL, 0xaed16a4aL, 0xd9d65adcL, 0x40df0b66L,
-  0x37d83bf0L, 0xa9bcae53L, 0xdebb9ec5L, 0x47b2cf7fL, 0x30b5ffe9L,
-  0xbdbdf21cL, 0xcabac28aL, 0x53b39330L, 0x24b4a3a6L, 0xbad03605L,
-  0xcdd70693L, 0x54de5729L, 0x23d967bfL, 0xb3667a2eL, 0xc4614ab8L,
-  0x5d681b02L, 0x2a6f2b94L, 0xb40bbe37L, 0xc30c8ea1L, 0x5a05df1bL,
-  0x2d02ef8dL
-};
-#endif
-
-/* =========================================================================
- * This function can be used by asm versions of crc32()
- */
-const uLongf * ZEXPORT get_crc_table()
-{
-#ifdef DYNAMIC_CRC_TABLE
-  if (crc_table_empty) make_crc_table();
-#endif
-  return (const uLongf *)crc_table;
-}
-
-/* ========================================================================= */
-#define DO1(buf) crc = crc_table[((int)crc ^ (*buf++)) & 0xff] ^ (crc >> 8);
-#define DO2(buf)  DO1(buf); DO1(buf);
-#define DO4(buf)  DO2(buf); DO2(buf);
-#define DO8(buf)  DO4(buf); DO4(buf);
-
-/* ========================================================================= */
-uLong ZEXPORT crc32(crc, buf, len)
-    uLong crc;
-    const Bytef *buf;
-    uInt len;
-{
-    if (buf == Z_NULL) return 0L;
-#ifdef DYNAMIC_CRC_TABLE
-    if (crc_table_empty)
-      make_crc_table();
-#endif
-    crc = crc ^ 0xffffffffL;
-    while (len >= 8)
-    {
-      DO8(buf);
-      len -= 8;
-    }
-    if (len) do {
-      DO1(buf);
-    } while (--len);
-    return crc ^ 0xffffffffL;
-}
diff --git a/lib/zlib/deflate.c b/lib/zlib/deflate.c
deleted file mode 100644 (file)
index 16ebdad..0000000
+++ /dev/null
@@ -1,1350 +0,0 @@
-/* deflate.c -- compress data using the deflation algorithm
- * Copyright (C) 1995-2002 Jean-loup Gailly.
- * For conditions of distribution and use, see copyright notice in zlib.h 
- */
-
-/*
- *  ALGORITHM
- *
- *      The "deflation" process depends on being able to identify portions
- *      of the input text which are identical to earlier input (within a
- *      sliding window trailing behind the input currently being processed).
- *
- *      The most straightforward technique turns out to be the fastest for
- *      most input files: try all possible matches and select the longest.
- *      The key feature of this algorithm is that insertions into the string
- *      dictionary are very simple and thus fast, and deletions are avoided
- *      completely. Insertions are performed at each input character, whereas
- *      string matches are performed only when the previous match ends. So it
- *      is preferable to spend more time in matches to allow very fast string
- *      insertions and avoid deletions. The matching algorithm for small
- *      strings is inspired from that of Rabin & Karp. A brute force approach
- *      is used to find longer strings when a small match has been found.
- *      A similar algorithm is used in comic (by Jan-Mark Wams) and freeze
- *      (by Leonid Broukhis).
- *         A previous version of this file used a more sophisticated algorithm
- *      (by Fiala and Greene) which is guaranteed to run in linear amortized
- *      time, but has a larger average cost, uses more memory and is patented.
- *      However the F&G algorithm may be faster for some highly redundant
- *      files if the parameter max_chain_length (described below) is too large.
- *
- *  ACKNOWLEDGEMENTS
- *
- *      The idea of lazy evaluation of matches is due to Jan-Mark Wams, and
- *      I found it in 'freeze' written by Leonid Broukhis.
- *      Thanks to many people for bug reports and testing.
- *
- *  REFERENCES
- *
- *      Deutsch, L.P.,"DEFLATE Compressed Data Format Specification".
- *      Available in ftp://ds.internic.net/rfc/rfc1951.txt
- *
- *      A description of the Rabin and Karp algorithm is given in the book
- *         "Algorithms" by R. Sedgewick, Addison-Wesley, p252.
- *
- *      Fiala,E.R., and Greene,D.H.
- *         Data Compression with Finite Windows, Comm.ACM, 32,4 (1989) 490-595
- *
- */
-
-/* @(#) $Id$ */
-
-#include "deflate.h"
-
-const char deflate_copyright[] =
-   " deflate 1.1.4 Copyright 1995-2002 Jean-loup Gailly ";
-/*
-  If you use the zlib library in a product, an acknowledgment is welcome
-  in the documentation of your product. If for some reason you cannot
-  include such an acknowledgment, I would appreciate that you keep this
-  copyright string in the executable of your product.
- */
-
-/* ===========================================================================
- *  Function prototypes.
- */
-typedef enum {
-    need_more,      /* block not completed, need more input or more output */
-    block_done,     /* block flush performed */
-    finish_started, /* finish started, need only more output at next deflate */
-    finish_done     /* finish done, accept no more input or output */
-} block_state;
-
-typedef block_state (*compress_func) OF((deflate_state *s, int flush));
-/* Compression function. Returns the block state after the call. */
-
-local void fill_window    OF((deflate_state *s));
-local block_state deflate_stored OF((deflate_state *s, int flush));
-local block_state deflate_fast   OF((deflate_state *s, int flush));
-local block_state deflate_slow   OF((deflate_state *s, int flush));
-local void lm_init        OF((deflate_state *s));
-local void putShortMSB    OF((deflate_state *s, uInt b));
-local void flush_pending  OF((z_streamp strm));
-local int read_buf        OF((z_streamp strm, Bytef *buf, unsigned size));
-#ifdef ASMV
-      void match_init OF((void)); /* asm code initialization */
-      uInt longest_match  OF((deflate_state *s, IPos cur_match));
-#else
-local uInt longest_match  OF((deflate_state *s, IPos cur_match));
-#endif
-
-#ifdef DEBUG
-local  void check_match OF((deflate_state *s, IPos start, IPos match,
-                            int length));
-#endif
-
-/* ===========================================================================
- * Local data
- */
-
-#define NIL 0
-/* Tail of hash chains */
-
-#ifndef TOO_FAR
-#  define TOO_FAR 4096
-#endif
-/* Matches of length 3 are discarded if their distance exceeds TOO_FAR */
-
-#define MIN_LOOKAHEAD (MAX_MATCH+MIN_MATCH+1)
-/* Minimum amount of lookahead, except at the end of the input file.
- * See deflate.c for comments about the MIN_MATCH+1.
- */
-
-/* Values for max_lazy_match, good_match and max_chain_length, depending on
- * the desired pack level (0..9). The values given below have been tuned to
- * exclude worst case performance for pathological files. Better values may be
- * found for specific files.
- */
-typedef struct config_s {
-   ush good_length; /* reduce lazy search above this match length */
-   ush max_lazy;    /* do not perform lazy search above this match length */
-   ush nice_length; /* quit search above this match length */
-   ush max_chain;
-   compress_func func;
-} config;
-
-local const config configuration_table[10] = {
-/*      good lazy nice chain */
-/* 0 */ {0,    0,  0,    0, deflate_stored},  /* store only */
-/* 1 */ {4,    4,  8,    4, deflate_fast}, /* maximum speed, no lazy matches */
-/* 2 */ {4,    5, 16,    8, deflate_fast},
-/* 3 */ {4,    6, 32,   32, deflate_fast},
-
-/* 4 */ {4,    4, 16,   16, deflate_slow},  /* lazy matches */
-/* 5 */ {8,   16, 32,   32, deflate_slow},
-/* 6 */ {8,   16, 128, 128, deflate_slow},
-/* 7 */ {8,   32, 128, 256, deflate_slow},
-/* 8 */ {32, 128, 258, 1024, deflate_slow},
-/* 9 */ {32, 258, 258, 4096, deflate_slow}}; /* maximum compression */
-
-/* Note: the deflate() code requires max_lazy >= MIN_MATCH and max_chain >= 4
- * For deflate_fast() (levels <= 3) good is ignored and lazy has a different
- * meaning.
- */
-
-#define EQUAL 0
-/* result of memcmp for equal strings */
-
-struct static_tree_desc_s {int dummy;}; /* for buggy compilers */
-
-/* ===========================================================================
- * Update a hash value with the given input byte
- * IN  assertion: all calls to to UPDATE_HASH are made with consecutive
- *    input characters, so that a running hash key can be computed from the
- *    previous key instead of complete recalculation each time.
- */
-#define UPDATE_HASH(s,h,c) (h = (((h)<<s->hash_shift) ^ (c)) & s->hash_mask)
-
-
-/* ===========================================================================
- * Insert string str in the dictionary and set match_head to the previous head
- * of the hash chain (the most recent string with same hash key). Return
- * the previous length of the hash chain.
- * If this file is compiled with -DFASTEST, the compression level is forced
- * to 1, and no hash chains are maintained.
- * IN  assertion: all calls to to INSERT_STRING are made with consecutive
- *    input characters and the first MIN_MATCH bytes of str are valid
- *    (except for the last MIN_MATCH-1 bytes of the input file).
- */
-#ifdef FASTEST
-#define INSERT_STRING(s, str, match_head) \
-   (UPDATE_HASH(s, s->ins_h, s->window[(str) + (MIN_MATCH-1)]), \
-    match_head = s->head[s->ins_h], \
-    s->head[s->ins_h] = (Pos)(str))
-#else
-#define INSERT_STRING(s, str, match_head) \
-   (UPDATE_HASH(s, s->ins_h, s->window[(str) + (MIN_MATCH-1)]), \
-    s->prev[(str) & s->w_mask] = match_head = s->head[s->ins_h], \
-    s->head[s->ins_h] = (Pos)(str))
-#endif
-
-/* ===========================================================================
- * Initialize the hash table (avoiding 64K overflow for 16 bit systems).
- * prev[] will be initialized on the fly.
- */
-#define CLEAR_HASH(s) \
-    s->head[s->hash_size-1] = NIL; \
-    zmemzero((Bytef *)s->head, (unsigned)(s->hash_size-1)*sizeof(*s->head));
-
-/* ========================================================================= */
-int ZEXPORT deflateInit_(strm, level, version, stream_size)
-    z_streamp strm;
-    int level;
-    const char *version;
-    int stream_size;
-{
-    return deflateInit2_(strm, level, Z_DEFLATED, MAX_WBITS, DEF_MEM_LEVEL,
-                        Z_DEFAULT_STRATEGY, version, stream_size);
-    /* To do: ignore strm->next_in if we use it as window */
-}
-
-/* ========================================================================= */
-int ZEXPORT deflateInit2_(strm, level, method, windowBits, memLevel, strategy,
-                 version, stream_size)
-    z_streamp strm;
-    int  level;
-    int  method;
-    int  windowBits;
-    int  memLevel;
-    int  strategy;
-    const char *version;
-    int stream_size;
-{
-    deflate_state *s;
-    int noheader = 0;
-    static const char* my_version = ZLIB_VERSION;
-
-    ushf *overlay;
-    /* We overlay pending_buf and d_buf+l_buf. This works since the average
-     * output size for (length,distance) codes is <= 24 bits.
-     */
-
-    if (version == Z_NULL || version[0] != my_version[0] ||
-        stream_size != sizeof(z_stream)) {
-       return Z_VERSION_ERROR;
-    }
-    if (strm == Z_NULL) return Z_STREAM_ERROR;
-
-    strm->msg = Z_NULL;
-    if (strm->zalloc == Z_NULL) {
-       strm->zalloc = zcalloc;
-       strm->opaque = (voidpf)0;
-    }
-    if (strm->zfree == Z_NULL) strm->zfree = zcfree;
-
-    if (level == Z_DEFAULT_COMPRESSION) level = 6;
-#ifdef FASTEST
-    level = 1;
-#endif
-
-    if (windowBits < 0) { /* undocumented feature: suppress zlib header */
-        noheader = 1;
-        windowBits = -windowBits;
-    }
-    if (memLevel < 1 || memLevel > MAX_MEM_LEVEL || method != Z_DEFLATED ||
-        windowBits < 9 || windowBits > 15 || level < 0 || level > 9 ||
-       strategy < 0 || strategy > Z_HUFFMAN_ONLY) {
-        return Z_STREAM_ERROR;
-    }
-    s = (deflate_state *) ZALLOC(strm, 1, sizeof(deflate_state));
-    if (s == Z_NULL) return Z_MEM_ERROR;
-    strm->state = (struct internal_state FAR *)s;
-    s->strm = strm;
-
-    s->noheader = noheader;
-    s->w_bits = windowBits;
-    s->w_size = 1 << s->w_bits;
-    s->w_mask = s->w_size - 1;
-
-    s->hash_bits = memLevel + 7;
-    s->hash_size = 1 << s->hash_bits;
-    s->hash_mask = s->hash_size - 1;
-    s->hash_shift =  ((s->hash_bits+MIN_MATCH-1)/MIN_MATCH);
-
-    s->window = (Bytef *) ZALLOC(strm, s->w_size, 2*sizeof(Byte));
-    s->prev   = (Posf *)  ZALLOC(strm, s->w_size, sizeof(Pos));
-    s->head   = (Posf *)  ZALLOC(strm, s->hash_size, sizeof(Pos));
-
-    s->lit_bufsize = 1 << (memLevel + 6); /* 16K elements by default */
-
-    overlay = (ushf *) ZALLOC(strm, s->lit_bufsize, sizeof(ush)+2);
-    s->pending_buf = (uchf *) overlay;
-    s->pending_buf_size = (ulg)s->lit_bufsize * (sizeof(ush)+2L);
-
-    if (s->window == Z_NULL || s->prev == Z_NULL || s->head == Z_NULL ||
-        s->pending_buf == Z_NULL) {
-        strm->msg = (char*)ERR_MSG(Z_MEM_ERROR);
-        deflateEnd (strm);
-        return Z_MEM_ERROR;
-    }
-    s->d_buf = overlay + s->lit_bufsize/sizeof(ush);
-    s->l_buf = s->pending_buf + (1+sizeof(ush))*s->lit_bufsize;
-
-    s->level = level;
-    s->strategy = strategy;
-    s->method = (Byte)method;
-
-    return deflateReset(strm);
-}
-
-/* ========================================================================= */
-int ZEXPORT deflateSetDictionary (strm, dictionary, dictLength)
-    z_streamp strm;
-    const Bytef *dictionary;
-    uInt  dictLength;
-{
-    deflate_state *s;
-    uInt length = dictLength;
-    uInt n;
-    IPos hash_head = 0;
-
-    if (strm == Z_NULL || strm->state == Z_NULL || dictionary == Z_NULL ||
-        strm->state->status != INIT_STATE) return Z_STREAM_ERROR;
-
-    s = strm->state;
-    strm->adler = adler32(strm->adler, dictionary, dictLength);
-
-    if (length < MIN_MATCH) return Z_OK;
-    if (length > MAX_DIST(s)) {
-       length = MAX_DIST(s);
-#ifndef USE_DICT_HEAD
-       dictionary += dictLength - length; /* use the tail of the dictionary */
-#endif
-    }
-    zmemcpy(s->window, dictionary, length);
-    s->strstart = length;
-    s->block_start = (long)length;
-
-    /* Insert all strings in the hash table (except for the last two bytes).
-     * s->lookahead stays null, so s->ins_h will be recomputed at the next
-     * call of fill_window.
-     */
-    s->ins_h = s->window[0];
-    UPDATE_HASH(s, s->ins_h, s->window[1]);
-    for (n = 0; n <= length - MIN_MATCH; n++) {
-       INSERT_STRING(s, n, hash_head);
-    }
-    if (hash_head) hash_head = 0;  /* to make compiler happy */
-    return Z_OK;
-}
-
-/* ========================================================================= */
-int ZEXPORT deflateReset (strm)
-    z_streamp strm;
-{
-    deflate_state *s;
-    
-    if (strm == Z_NULL || strm->state == Z_NULL ||
-        strm->zalloc == Z_NULL || strm->zfree == Z_NULL) return Z_STREAM_ERROR;
-
-    strm->total_in = strm->total_out = 0;
-    strm->msg = Z_NULL; /* use zfree if we ever allocate msg dynamically */
-    strm->data_type = Z_UNKNOWN;
-
-    s = (deflate_state *)strm->state;
-    s->pending = 0;
-    s->pending_out = s->pending_buf;
-
-    if (s->noheader < 0) {
-        s->noheader = 0; /* was set to -1 by deflate(..., Z_FINISH); */
-    }
-    s->status = s->noheader ? BUSY_STATE : INIT_STATE;
-    strm->adler = 1;
-    s->last_flush = Z_NO_FLUSH;
-
-    _tr_init(s);
-    lm_init(s);
-
-    return Z_OK;
-}
-
-/* ========================================================================= */
-int ZEXPORT deflateParams(strm, level, strategy)
-    z_streamp strm;
-    int level;
-    int strategy;
-{
-    deflate_state *s;
-    compress_func func;
-    int err = Z_OK;
-
-    if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;
-    s = strm->state;
-
-    if (level == Z_DEFAULT_COMPRESSION) {
-       level = 6;
-    }
-    if (level < 0 || level > 9 || strategy < 0 || strategy > Z_HUFFMAN_ONLY) {
-       return Z_STREAM_ERROR;
-    }
-    func = configuration_table[s->level].func;
-
-    if (func != configuration_table[level].func && strm->total_in != 0) {
-       /* Flush the last buffer: */
-       err = deflate(strm, Z_PARTIAL_FLUSH);
-    }
-    if (s->level != level) {
-       s->level = level;
-       s->max_lazy_match   = configuration_table[level].max_lazy;
-       s->good_match       = configuration_table[level].good_length;
-       s->nice_match       = configuration_table[level].nice_length;
-       s->max_chain_length = configuration_table[level].max_chain;
-    }
-    s->strategy = strategy;
-    return err;
-}
-
-/* =========================================================================
- * Put a short in the pending buffer. The 16-bit value is put in MSB order.
- * IN assertion: the stream state is correct and there is enough room in
- * pending_buf.
- */
-local void putShortMSB (s, b)
-    deflate_state *s;
-    uInt b;
-{
-    put_byte(s, (Byte)(b >> 8));
-    put_byte(s, (Byte)(b & 0xff));
-}   
-
-/* =========================================================================
- * Flush as much pending output as possible. All deflate() output goes
- * through this function so some applications may wish to modify it
- * to avoid allocating a large strm->next_out buffer and copying into it.
- * (See also read_buf()).
- */
-local void flush_pending(strm)
-    z_streamp strm;
-{
-    unsigned len = strm->state->pending;
-
-    if (len > strm->avail_out) len = strm->avail_out;
-    if (len == 0) return;
-
-    zmemcpy(strm->next_out, strm->state->pending_out, len);
-    strm->next_out  += len;
-    strm->state->pending_out  += len;
-    strm->total_out += len;
-    strm->avail_out  -= len;
-    strm->state->pending -= len;
-    if (strm->state->pending == 0) {
-        strm->state->pending_out = strm->state->pending_buf;
-    }
-}
-
-/* ========================================================================= */
-int ZEXPORT deflate (strm, flush)
-    z_streamp strm;
-    int flush;
-{
-    int old_flush; /* value of flush param for previous deflate call */
-    deflate_state *s;
-
-    if (strm == Z_NULL || strm->state == Z_NULL ||
-       flush > Z_FINISH || flush < 0) {
-        return Z_STREAM_ERROR;
-    }
-    s = strm->state;
-
-    if (strm->next_out == Z_NULL ||
-        (strm->next_in == Z_NULL && strm->avail_in != 0) ||
-       (s->status == FINISH_STATE && flush != Z_FINISH)) {
-        ERR_RETURN(strm, Z_STREAM_ERROR);
-    }
-    if (strm->avail_out == 0) ERR_RETURN(strm, Z_BUF_ERROR);
-
-    s->strm = strm; /* just in case */
-    old_flush = s->last_flush;
-    s->last_flush = flush;
-
-    /* Write the zlib header */
-    if (s->status == INIT_STATE) {
-
-        uInt header = (Z_DEFLATED + ((s->w_bits-8)<<4)) << 8;
-        uInt level_flags = (s->level-1) >> 1;
-
-        if (level_flags > 3) level_flags = 3;
-        header |= (level_flags << 6);
-       if (s->strstart != 0) header |= PRESET_DICT;
-        header += 31 - (header % 31);
-
-        s->status = BUSY_STATE;
-        putShortMSB(s, header);
-
-       /* Save the adler32 of the preset dictionary: */
-       if (s->strstart != 0) {
-           putShortMSB(s, (uInt)(strm->adler >> 16));
-           putShortMSB(s, (uInt)(strm->adler & 0xffff));
-       }
-       strm->adler = 1L;
-    }
-
-    /* Flush as much pending output as possible */
-    if (s->pending != 0) {
-        flush_pending(strm);
-        if (strm->avail_out == 0) {
-           /* Since avail_out is 0, deflate will be called again with
-            * more output space, but possibly with both pending and
-            * avail_in equal to zero. There won't be anything to do,
-            * but this is not an error situation so make sure we
-            * return OK instead of BUF_ERROR at next call of deflate:
-             */
-           s->last_flush = -1;
-           return Z_OK;
-       }
-
-    /* Make sure there is something to do and avoid duplicate consecutive
-     * flushes. For repeated and useless calls with Z_FINISH, we keep
-     * returning Z_STREAM_END instead of Z_BUFF_ERROR.
-     */
-    } else if (strm->avail_in == 0 && flush <= old_flush &&
-              flush != Z_FINISH) {
-        ERR_RETURN(strm, Z_BUF_ERROR);
-    }
-
-    /* User must not provide more input after the first FINISH: */
-    if (s->status == FINISH_STATE && strm->avail_in != 0) {
-        ERR_RETURN(strm, Z_BUF_ERROR);
-    }
-
-    /* Start a new block or continue the current one.
-     */
-    if (strm->avail_in != 0 || s->lookahead != 0 ||
-        (flush != Z_NO_FLUSH && s->status != FINISH_STATE)) {
-        block_state bstate;
-
-       bstate = (*(configuration_table[s->level].func))(s, flush);
-
-        if (bstate == finish_started || bstate == finish_done) {
-            s->status = FINISH_STATE;
-        }
-        if (bstate == need_more || bstate == finish_started) {
-           if (strm->avail_out == 0) {
-               s->last_flush = -1; /* avoid BUF_ERROR next call, see above */
-           }
-           return Z_OK;
-           /* If flush != Z_NO_FLUSH && avail_out == 0, the next call
-            * of deflate should use the same flush parameter to make sure
-            * that the flush is complete. So we don't have to output an
-            * empty block here, this will be done at next call. This also
-            * ensures that for a very small output buffer, we emit at most
-            * one empty block.
-            */
-       }
-        if (bstate == block_done) {
-            if (flush == Z_PARTIAL_FLUSH) {
-                _tr_align(s);
-            } else { /* FULL_FLUSH or SYNC_FLUSH */
-                _tr_stored_block(s, (char*)0, 0L, 0);
-                /* For a full flush, this empty block will be recognized
-                 * as a special marker by inflate_sync().
-                 */
-                if (flush == Z_FULL_FLUSH) {
-                    CLEAR_HASH(s);             /* forget history */
-                }
-            }
-            flush_pending(strm);
-           if (strm->avail_out == 0) {
-             s->last_flush = -1; /* avoid BUF_ERROR at next call, see above */
-             return Z_OK;
-           }
-        }
-    }
-    Assert(strm->avail_out > 0, "bug2");
-
-    if (flush != Z_FINISH) return Z_OK;
-    if (s->noheader) return Z_STREAM_END;
-
-    /* Write the zlib trailer (adler32) */
-    putShortMSB(s, (uInt)(strm->adler >> 16));
-    putShortMSB(s, (uInt)(strm->adler & 0xffff));
-    flush_pending(strm);
-    /* If avail_out is zero, the application will call deflate again
-     * to flush the rest.
-     */
-    s->noheader = -1; /* write the trailer only once! */
-    return s->pending != 0 ? Z_OK : Z_STREAM_END;
-}
-
-/* ========================================================================= */
-int ZEXPORT deflateEnd (strm)
-    z_streamp strm;
-{
-    int status;
-
-    if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;
-
-    status = strm->state->status;
-    if (status != INIT_STATE && status != BUSY_STATE &&
-       status != FINISH_STATE) {
-      return Z_STREAM_ERROR;
-    }
-
-    /* Deallocate in reverse order of allocations: */
-    TRY_FREE(strm, strm->state->pending_buf);
-    TRY_FREE(strm, strm->state->head);
-    TRY_FREE(strm, strm->state->prev);
-    TRY_FREE(strm, strm->state->window);
-
-    ZFREE(strm, strm->state);
-    strm->state = Z_NULL;
-
-    return status == BUSY_STATE ? Z_DATA_ERROR : Z_OK;
-}
-
-/* =========================================================================
- * Copy the source state to the destination state.
- * To simplify the source, this is not supported for 16-bit MSDOS (which
- * doesn't have enough memory anyway to duplicate compression states).
- */
-int ZEXPORT deflateCopy (dest, source)
-    z_streamp dest;
-    z_streamp source;
-{
-#ifdef MAXSEG_64K
-    return Z_STREAM_ERROR;
-#else
-    deflate_state *ds;
-    deflate_state *ss;
-    ushf *overlay;
-
-
-    if (source == Z_NULL || dest == Z_NULL || source->state == Z_NULL) {
-        return Z_STREAM_ERROR;
-    }
-
-    ss = source->state;
-
-    *dest = *source;
-
-    ds = (deflate_state *) ZALLOC(dest, 1, sizeof(deflate_state));
-    if (ds == Z_NULL) return Z_MEM_ERROR;
-    dest->state = (struct internal_state FAR *) ds;
-    *ds = *ss;
-    ds->strm = dest;
-
-    ds->window = (Bytef *) ZALLOC(dest, ds->w_size, 2*sizeof(Byte));
-    ds->prev   = (Posf *)  ZALLOC(dest, ds->w_size, sizeof(Pos));
-    ds->head   = (Posf *)  ZALLOC(dest, ds->hash_size, sizeof(Pos));
-    overlay = (ushf *) ZALLOC(dest, ds->lit_bufsize, sizeof(ush)+2);
-    ds->pending_buf = (uchf *) overlay;
-
-    if (ds->window == Z_NULL || ds->prev == Z_NULL || ds->head == Z_NULL ||
-        ds->pending_buf == Z_NULL) {
-        deflateEnd (dest);
-        return Z_MEM_ERROR;
-    }
-    /* following zmemcpy do not work for 16-bit MSDOS */
-    zmemcpy(ds->window, ss->window, ds->w_size * 2 * sizeof(Byte));
-    zmemcpy(ds->prev, ss->prev, ds->w_size * sizeof(Pos));
-    zmemcpy(ds->head, ss->head, ds->hash_size * sizeof(Pos));
-    zmemcpy(ds->pending_buf, ss->pending_buf, (uInt)ds->pending_buf_size);
-
-    ds->pending_out = ds->pending_buf + (ss->pending_out - ss->pending_buf);
-    ds->d_buf = overlay + ds->lit_bufsize/sizeof(ush);
-    ds->l_buf = ds->pending_buf + (1+sizeof(ush))*ds->lit_bufsize;
-
-    ds->l_desc.dyn_tree = ds->dyn_ltree;
-    ds->d_desc.dyn_tree = ds->dyn_dtree;
-    ds->bl_desc.dyn_tree = ds->bl_tree;
-
-    return Z_OK;
-#endif
-}
-
-/* ===========================================================================
- * Read a new buffer from the current input stream, update the adler32
- * and total number of bytes read.  All deflate() input goes through
- * this function so some applications may wish to modify it to avoid
- * allocating a large strm->next_in buffer and copying from it.
- * (See also flush_pending()).
- */
-local int read_buf(strm, buf, size)
-    z_streamp strm;
-    Bytef *buf;
-    unsigned size;
-{
-    unsigned len = strm->avail_in;
-
-    if (len > size) len = size;
-    if (len == 0) return 0;
-
-    strm->avail_in  -= len;
-
-    if (!strm->state->noheader) {
-        strm->adler = adler32(strm->adler, strm->next_in, len);
-    }
-    zmemcpy(buf, strm->next_in, len);
-    strm->next_in  += len;
-    strm->total_in += len;
-
-    return (int)len;
-}
-
-/* ===========================================================================
- * Initialize the "longest match" routines for a new zlib stream
- */
-local void lm_init (s)
-    deflate_state *s;
-{
-    s->window_size = (ulg)2L*s->w_size;
-
-    CLEAR_HASH(s);
-
-    /* Set the default configuration parameters:
-     */
-    s->max_lazy_match   = configuration_table[s->level].max_lazy;
-    s->good_match       = configuration_table[s->level].good_length;
-    s->nice_match       = configuration_table[s->level].nice_length;
-    s->max_chain_length = configuration_table[s->level].max_chain;
-
-    s->strstart = 0;
-    s->block_start = 0L;
-    s->lookahead = 0;
-    s->match_length = s->prev_length = MIN_MATCH-1;
-    s->match_available = 0;
-    s->ins_h = 0;
-#ifdef ASMV
-    match_init(); /* initialize the asm code */
-#endif
-}
-
-/* ===========================================================================
- * Set match_start to the longest match starting at the given string and
- * return its length. Matches shorter or equal to prev_length are discarded,
- * in which case the result is equal to prev_length and match_start is
- * garbage.
- * IN assertions: cur_match is the head of the hash chain for the current
- *   string (strstart) and its distance is <= MAX_DIST, and prev_length >= 1
- * OUT assertion: the match length is not greater than s->lookahead.
- */
-#ifndef ASMV
-/* For 80x86 and 680x0, an optimized version will be provided in match.asm or
- * match.S. The code will be functionally equivalent.
- */
-#ifndef FASTEST
-local uInt longest_match(s, cur_match)
-    deflate_state *s;
-    IPos cur_match;                             /* current match */
-{
-    unsigned chain_length = s->max_chain_length;/* max hash chain length */
-    register Bytef *scan = s->window + s->strstart; /* current string */
-    register Bytef *match;                       /* matched string */
-    register int len;                           /* length of current match */
-    int best_len = s->prev_length;              /* best match length so far */
-    int nice_match = s->nice_match;             /* stop if match long enough */
-    IPos limit = s->strstart > (IPos)MAX_DIST(s) ?
-        s->strstart - (IPos)MAX_DIST(s) : NIL;
-    /* Stop when cur_match becomes <= limit. To simplify the code,
-     * we prevent matches with the string of window index 0.
-     */
-    Posf *prev = s->prev;
-    uInt wmask = s->w_mask;
-
-#ifdef UNALIGNED_OK
-    /* Compare two bytes at a time. Note: this is not always beneficial.
-     * Try with and without -DUNALIGNED_OK to check.
-     */
-    register Bytef *strend = s->window + s->strstart + MAX_MATCH - 1;
-    register ush scan_start = *(ushf*)scan;
-    register ush scan_end   = *(ushf*)(scan+best_len-1);
-#else
-    register Bytef *strend = s->window + s->strstart + MAX_MATCH;
-    register Byte scan_end1  = scan[best_len-1];
-    register Byte scan_end   = scan[best_len];
-#endif
-
-    /* The code is optimized for HASH_BITS >= 8 and MAX_MATCH-2 multiple of 16.
-     * It is easy to get rid of this optimization if necessary.
-     */
-    Assert(s->hash_bits >= 8 && MAX_MATCH == 258, "Code too clever");
-
-    /* Do not waste too much time if we already have a good match: */
-    if (s->prev_length >= s->good_match) {
-        chain_length >>= 2;
-    }
-    /* Do not look for matches beyond the end of the input. This is necessary
-     * to make deflate deterministic.
-     */
-    if ((uInt)nice_match > s->lookahead) nice_match = s->lookahead;
-
-    Assert((ulg)s->strstart <= s->window_size-MIN_LOOKAHEAD, "need lookahead");
-
-    do {
-        Assert(cur_match < s->strstart, "no future");
-        match = s->window + cur_match;
-
-        /* Skip to next match if the match length cannot increase
-         * or if the match length is less than 2:
-         */
-#if (defined(UNALIGNED_OK) && MAX_MATCH == 258)
-        /* This code assumes sizeof(unsigned short) == 2. Do not use
-         * UNALIGNED_OK if your compiler uses a different size.
-         */
-        if (*(ushf*)(match+best_len-1) != scan_end ||
-            *(ushf*)match != scan_start) continue;
-
-        /* It is not necessary to compare scan[2] and match[2] since they are
-         * always equal when the other bytes match, given that the hash keys
-         * are equal and that HASH_BITS >= 8. Compare 2 bytes at a time at
-         * strstart+3, +5, ... up to strstart+257. We check for insufficient
-         * lookahead only every 4th comparison; the 128th check will be made
-         * at strstart+257. If MAX_MATCH-2 is not a multiple of 8, it is
-         * necessary to put more guard bytes at the end of the window, or
-         * to check more often for insufficient lookahead.
-         */
-        Assert(scan[2] == match[2], "scan[2]?");
-        scan++, match++;
-        do {
-        } while (*(ushf*)(scan+=2) == *(ushf*)(match+=2) &&
-                 *(ushf*)(scan+=2) == *(ushf*)(match+=2) &&
-                 *(ushf*)(scan+=2) == *(ushf*)(match+=2) &&
-                 *(ushf*)(scan+=2) == *(ushf*)(match+=2) &&
-                 scan < strend);
-        /* The funny "do {}" generates better code on most compilers */
-
-        /* Here, scan <= window+strstart+257 */
-        Assert(scan <= s->window+(unsigned)(s->window_size-1), "wild scan");
-        if (*scan == *match) scan++;
-
-        len = (MAX_MATCH - 1) - (int)(strend-scan);
-        scan = strend - (MAX_MATCH-1);
-
-#else /* UNALIGNED_OK */
-
-        if (match[best_len]   != scan_end  ||
-            match[best_len-1] != scan_end1 ||
-            *match            != *scan     ||
-            *++match          != scan[1])      continue;
-
-        /* The check at best_len-1 can be removed because it will be made
-         * again later. (This heuristic is not always a win.)
-         * It is not necessary to compare scan[2] and match[2] since they
-         * are always equal when the other bytes match, given that
-         * the hash keys are equal and that HASH_BITS >= 8.
-         */
-        scan += 2, match++;
-        Assert(*scan == *match, "match[2]?");
-
-        /* We check for insufficient lookahead only every 8th comparison;
-         * the 256th check will be made at strstart+258.
-         */
-        do {
-        } while (*++scan == *++match && *++scan == *++match &&
-                 *++scan == *++match && *++scan == *++match &&
-                 *++scan == *++match && *++scan == *++match &&
-                 *++scan == *++match && *++scan == *++match &&
-                 scan < strend);
-
-        Assert(scan <= s->window+(unsigned)(s->window_size-1), "wild scan");
-
-        len = MAX_MATCH - (int)(strend - scan);
-        scan = strend - MAX_MATCH;
-
-#endif /* UNALIGNED_OK */
-
-        if (len > best_len) {
-            s->match_start = cur_match;
-            best_len = len;
-            if (len >= nice_match) break;
-#ifdef UNALIGNED_OK
-            scan_end = *(ushf*)(scan+best_len-1);
-#else
-            scan_end1  = scan[best_len-1];
-            scan_end   = scan[best_len];
-#endif
-        }
-    } while ((cur_match = prev[cur_match & wmask]) > limit
-             && --chain_length != 0);
-
-    if ((uInt)best_len <= s->lookahead) return (uInt)best_len;
-    return s->lookahead;
-}
-
-#else /* FASTEST */
-/* ---------------------------------------------------------------------------
- * Optimized version for level == 1 only
- */
-local uInt longest_match(s, cur_match)
-    deflate_state *s;
-    IPos cur_match;                             /* current match */
-{
-    register Bytef *scan = s->window + s->strstart; /* current string */
-    register Bytef *match;                       /* matched string */
-    register int len;                           /* length of current match */
-    register Bytef *strend = s->window + s->strstart + MAX_MATCH;
-
-    /* The code is optimized for HASH_BITS >= 8 and MAX_MATCH-2 multiple of 16.
-     * It is easy to get rid of this optimization if necessary.
-     */
-    Assert(s->hash_bits >= 8 && MAX_MATCH == 258, "Code too clever");
-
-    Assert((ulg)s->strstart <= s->window_size-MIN_LOOKAHEAD, "need lookahead");
-
-    Assert(cur_match < s->strstart, "no future");
-
-    match = s->window + cur_match;
-
-    /* Return failure if the match length is less than 2:
-     */
-    if (match[0] != scan[0] || match[1] != scan[1]) return MIN_MATCH-1;
-
-    /* The check at best_len-1 can be removed because it will be made
-     * again later. (This heuristic is not always a win.)
-     * It is not necessary to compare scan[2] and match[2] since they
-     * are always equal when the other bytes match, given that
-     * the hash keys are equal and that HASH_BITS >= 8.
-     */
-    scan += 2, match += 2;
-    Assert(*scan == *match, "match[2]?");
-
-    /* We check for insufficient lookahead only every 8th comparison;
-     * the 256th check will be made at strstart+258.
-     */
-    do {
-    } while (*++scan == *++match && *++scan == *++match &&
-            *++scan == *++match && *++scan == *++match &&
-            *++scan == *++match && *++scan == *++match &&
-            *++scan == *++match && *++scan == *++match &&
-            scan < strend);
-
-    Assert(scan <= s->window+(unsigned)(s->window_size-1), "wild scan");
-
-    len = MAX_MATCH - (int)(strend - scan);
-
-    if (len < MIN_MATCH) return MIN_MATCH - 1;
-
-    s->match_start = cur_match;
-    return len <= s->lookahead ? len : s->lookahead;
-}
-#endif /* FASTEST */
-#endif /* ASMV */
-
-#ifdef DEBUG
-/* ===========================================================================
- * Check that the match at match_start is indeed a match.
- */
-local void check_match(s, start, match, length)
-    deflate_state *s;
-    IPos start, match;
-    int length;
-{
-    /* check that the match is indeed a match */
-    if (zmemcmp(s->window + match,
-                s->window + start, length) != EQUAL) {
-        fprintf(stderr, " start %u, match %u, length %d\n",
-               start, match, length);
-        do {
-           fprintf(stderr, "%c%c", s->window[match++], s->window[start++]);
-       } while (--length != 0);
-        z_error("invalid match");
-    }
-    if (z_verbose > 1) {
-        fprintf(stderr,"\\[%d,%d]", start-match, length);
-        do { putc(s->window[start++], stderr); } while (--length != 0);
-    }
-}
-#else
-#  define check_match(s, start, match, length)
-#endif
-
-/* ===========================================================================
- * Fill the window when the lookahead becomes insufficient.
- * Updates strstart and lookahead.
- *
- * IN assertion: lookahead < MIN_LOOKAHEAD
- * OUT assertions: strstart <= window_size-MIN_LOOKAHEAD
- *    At least one byte has been read, or avail_in == 0; reads are
- *    performed for at least two bytes (required for the zip translate_eol
- *    option -- not supported here).
- */
-local void fill_window(s)
-    deflate_state *s;
-{
-    register unsigned n, m;
-    register Posf *p;
-    unsigned more;    /* Amount of free space at the end of the window. */
-    uInt wsize = s->w_size;
-
-    do {
-        more = (unsigned)(s->window_size -(ulg)s->lookahead -(ulg)s->strstart);
-
-        /* Deal with !@#$% 64K limit: */
-        if (more == 0 && s->strstart == 0 && s->lookahead == 0) {
-            more = wsize;
-
-        } else if (more == (unsigned)(-1)) {
-            /* Very unlikely, but possible on 16 bit machine if strstart == 0
-             * and lookahead == 1 (input done one byte at time)
-             */
-            more--;
-
-        /* If the window is almost full and there is insufficient lookahead,
-         * move the upper half to the lower one to make room in the upper half.
-         */
-        } else if (s->strstart >= wsize+MAX_DIST(s)) {
-
-            zmemcpy(s->window, s->window+wsize, (unsigned)wsize);
-            s->match_start -= wsize;
-            s->strstart    -= wsize; /* we now have strstart >= MAX_DIST */
-            s->block_start -= (long) wsize;
-
-            /* Slide the hash table (could be avoided with 32 bit values
-               at the expense of memory usage). We slide even when level == 0
-               to keep the hash table consistent if we switch back to level > 0
-               later. (Using level 0 permanently is not an optimal usage of
-               zlib, so we don't care about this pathological case.)
-             */
-           n = s->hash_size;
-           p = &s->head[n];
-           do {
-               m = *--p;
-               *p = (Pos)(m >= wsize ? m-wsize : NIL);
-           } while (--n);
-
-           n = wsize;
-#ifndef FASTEST
-           p = &s->prev[n];
-           do {
-               m = *--p;
-               *p = (Pos)(m >= wsize ? m-wsize : NIL);
-               /* If n is not on any hash chain, prev[n] is garbage but
-                * its value will never be used.
-                */
-           } while (--n);
-#endif
-            more += wsize;
-        }
-        if (s->strm->avail_in == 0) return;
-
-        /* If there was no sliding:
-         *    strstart <= WSIZE+MAX_DIST-1 && lookahead <= MIN_LOOKAHEAD - 1 &&
-         *    more == window_size - lookahead - strstart
-         * => more >= window_size - (MIN_LOOKAHEAD-1 + WSIZE + MAX_DIST-1)
-         * => more >= window_size - 2*WSIZE + 2
-         * In the BIG_MEM or MMAP case (not yet supported),
-         *   window_size == input_size + MIN_LOOKAHEAD  &&
-         *   strstart + s->lookahead <= input_size => more >= MIN_LOOKAHEAD.
-         * Otherwise, window_size == 2*WSIZE so more >= 2.
-         * If there was sliding, more >= WSIZE. So in all cases, more >= 2.
-         */
-        Assert(more >= 2, "more < 2");
-
-        n = read_buf(s->strm, s->window + s->strstart + s->lookahead, more);
-        s->lookahead += n;
-
-        /* Initialize the hash value now that we have some input: */
-        if (s->lookahead >= MIN_MATCH) {
-            s->ins_h = s->window[s->strstart];
-            UPDATE_HASH(s, s->ins_h, s->window[s->strstart+1]);
-#if MIN_MATCH != 3
-            Call UPDATE_HASH() MIN_MATCH-3 more times
-#endif
-        }
-        /* If the whole input has less than MIN_MATCH bytes, ins_h is garbage,
-         * but this is not important since only literal bytes will be emitted.
-         */
-
-    } while (s->lookahead < MIN_LOOKAHEAD && s->strm->avail_in != 0);
-}
-
-/* ===========================================================================
- * Flush the current block, with given end-of-file flag.
- * IN assertion: strstart is set to the end of the current match.
- */
-#define FLUSH_BLOCK_ONLY(s, eof) { \
-   _tr_flush_block(s, (s->block_start >= 0L ? \
-                   (charf *)&s->window[(unsigned)s->block_start] : \
-                   (charf *)Z_NULL), \
-               (ulg)((long)s->strstart - s->block_start), \
-               (eof)); \
-   s->block_start = s->strstart; \
-   flush_pending(s->strm); \
-   Tracev((stderr,"[FLUSH]")); \
-}
-
-/* Same but force premature exit if necessary. */
-#define FLUSH_BLOCK(s, eof) { \
-   FLUSH_BLOCK_ONLY(s, eof); \
-   if (s->strm->avail_out == 0) return (eof) ? finish_started : need_more; \
-}
-
-/* ===========================================================================
- * Copy without compression as much as possible from the input stream, return
- * the current block state.
- * This function does not insert new strings in the dictionary since
- * uncompressible data is probably not useful. This function is used
- * only for the level=0 compression option.
- * NOTE: this function should be optimized to avoid extra copying from
- * window to pending_buf.
- */
-local block_state deflate_stored(s, flush)
-    deflate_state *s;
-    int flush;
-{
-    /* Stored blocks are limited to 0xffff bytes, pending_buf is limited
-     * to pending_buf_size, and each stored block has a 5 byte header:
-     */
-    ulg max_block_size = 0xffff;
-    ulg max_start;
-
-    if (max_block_size > s->pending_buf_size - 5) {
-        max_block_size = s->pending_buf_size - 5;
-    }
-
-    /* Copy as much as possible from input to output: */
-    for (;;) {
-        /* Fill the window as much as possible: */
-        if (s->lookahead <= 1) {
-
-            Assert(s->strstart < s->w_size+MAX_DIST(s) ||
-                  s->block_start >= (long)s->w_size, "slide too late");
-
-            fill_window(s);
-            if (s->lookahead == 0 && flush == Z_NO_FLUSH) return need_more;
-
-            if (s->lookahead == 0) break; /* flush the current block */
-        }
-       Assert(s->block_start >= 0L, "block gone");
-
-       s->strstart += s->lookahead;
-       s->lookahead = 0;
-
-       /* Emit a stored block if pending_buf will be full: */
-       max_start = s->block_start + max_block_size;
-        if (s->strstart == 0 || (ulg)s->strstart >= max_start) {
-           /* strstart == 0 is possible when wraparound on 16-bit machine */
-           s->lookahead = (uInt)(s->strstart - max_start);
-           s->strstart = (uInt)max_start;
-            FLUSH_BLOCK(s, 0);
-       }
-       /* Flush if we may have to slide, otherwise block_start may become
-         * negative and the data will be gone:
-         */
-        if (s->strstart - (uInt)s->block_start >= MAX_DIST(s)) {
-            FLUSH_BLOCK(s, 0);
-       }
-    }
-    FLUSH_BLOCK(s, flush == Z_FINISH);
-    return flush == Z_FINISH ? finish_done : block_done;
-}
-
-/* ===========================================================================
- * Compress as much as possible from the input stream, return the current
- * block state.
- * This function does not perform lazy evaluation of matches and inserts
- * new strings in the dictionary only for unmatched strings or for short
- * matches. It is used only for the fast compression options.
- */
-local block_state deflate_fast(s, flush)
-    deflate_state *s;
-    int flush;
-{
-    IPos hash_head = NIL; /* head of the hash chain */
-    int bflush;           /* set if current block must be flushed */
-
-    for (;;) {
-        /* Make sure that we always have enough lookahead, except
-         * at the end of the input file. We need MAX_MATCH bytes
-         * for the next match, plus MIN_MATCH bytes to insert the
-         * string following the next match.
-         */
-        if (s->lookahead < MIN_LOOKAHEAD) {
-            fill_window(s);
-            if (s->lookahead < MIN_LOOKAHEAD && flush == Z_NO_FLUSH) {
-               return need_more;
-           }
-            if (s->lookahead == 0) break; /* flush the current block */
-        }
-
-        /* Insert the string window[strstart .. strstart+2] in the
-         * dictionary, and set hash_head to the head of the hash chain:
-         */
-        if (s->lookahead >= MIN_MATCH) {
-            INSERT_STRING(s, s->strstart, hash_head);
-        }
-
-        /* Find the longest match, discarding those <= prev_length.
-         * At this point we have always match_length < MIN_MATCH
-         */
-        if (hash_head != NIL && s->strstart - hash_head <= MAX_DIST(s)) {
-            /* To simplify the code, we prevent matches with the string
-             * of window index 0 (in particular we have to avoid a match
-             * of the string with itself at the start of the input file).
-             */
-            if (s->strategy != Z_HUFFMAN_ONLY) {
-                s->match_length = longest_match (s, hash_head);
-            }
-            /* longest_match() sets match_start */
-        }
-        if (s->match_length >= MIN_MATCH) {
-            check_match(s, s->strstart, s->match_start, s->match_length);
-
-            _tr_tally_dist(s, s->strstart - s->match_start,
-                           s->match_length - MIN_MATCH, bflush);
-
-            s->lookahead -= s->match_length;
-
-            /* Insert new strings in the hash table only if the match length
-             * is not too large. This saves time but degrades compression.
-             */
-#ifndef FASTEST
-            if (s->match_length <= s->max_insert_length &&
-                s->lookahead >= MIN_MATCH) {
-                s->match_length--; /* string at strstart already in hash table */
-                do {
-                    s->strstart++;
-                    INSERT_STRING(s, s->strstart, hash_head);
-                    /* strstart never exceeds WSIZE-MAX_MATCH, so there are
-                     * always MIN_MATCH bytes ahead.
-                     */
-                } while (--s->match_length != 0);
-                s->strstart++; 
-            } else
-#endif
-           {
-                s->strstart += s->match_length;
-                s->match_length = 0;
-                s->ins_h = s->window[s->strstart];
-                UPDATE_HASH(s, s->ins_h, s->window[s->strstart+1]);
-#if MIN_MATCH != 3
-                Call UPDATE_HASH() MIN_MATCH-3 more times
-#endif
-                /* If lookahead < MIN_MATCH, ins_h is garbage, but it does not
-                 * matter since it will be recomputed at next deflate call.
-                 */
-            }
-        } else {
-            /* No match, output a literal byte */
-            Tracevv((stderr,"%c", s->window[s->strstart]));
-            _tr_tally_lit (s, s->window[s->strstart], bflush);
-            s->lookahead--;
-            s->strstart++; 
-        }
-        if (bflush) FLUSH_BLOCK(s, 0);
-    }
-    FLUSH_BLOCK(s, flush == Z_FINISH);
-    return flush == Z_FINISH ? finish_done : block_done;
-}
-
-/* ===========================================================================
- * Same as above, but achieves better compression. We use a lazy
- * evaluation for matches: a match is finally adopted only if there is
- * no better match at the next window position.
- */
-local block_state deflate_slow(s, flush)
-    deflate_state *s;
-    int flush;
-{
-    IPos hash_head = NIL;    /* head of hash chain */
-    int bflush;              /* set if current block must be flushed */
-
-    /* Process the input block. */
-    for (;;) {
-        /* Make sure that we always have enough lookahead, except
-         * at the end of the input file. We need MAX_MATCH bytes
-         * for the next match, plus MIN_MATCH bytes to insert the
-         * string following the next match.
-         */
-        if (s->lookahead < MIN_LOOKAHEAD) {
-            fill_window(s);
-            if (s->lookahead < MIN_LOOKAHEAD && flush == Z_NO_FLUSH) {
-               return need_more;
-           }
-            if (s->lookahead == 0) break; /* flush the current block */
-        }
-
-        /* Insert the string window[strstart .. strstart+2] in the
-         * dictionary, and set hash_head to the head of the hash chain:
-         */
-        if (s->lookahead >= MIN_MATCH) {
-            INSERT_STRING(s, s->strstart, hash_head);
-        }
-
-        /* Find the longest match, discarding those <= prev_length.
-         */
-        s->prev_length = s->match_length, s->prev_match = s->match_start;
-        s->match_length = MIN_MATCH-1;
-
-        if (hash_head != NIL && s->prev_length < s->max_lazy_match &&
-            s->strstart - hash_head <= MAX_DIST(s)) {
-            /* To simplify the code, we prevent matches with the string
-             * of window index 0 (in particular we have to avoid a match
-             * of the string with itself at the start of the input file).
-             */
-            if (s->strategy != Z_HUFFMAN_ONLY) {
-                s->match_length = longest_match (s, hash_head);
-            }
-            /* longest_match() sets match_start */
-
-            if (s->match_length <= 5 && (s->strategy == Z_FILTERED ||
-                 (s->match_length == MIN_MATCH &&
-                  s->strstart - s->match_start > TOO_FAR))) {
-
-                /* If prev_match is also MIN_MATCH, match_start is garbage
-                 * but we will ignore the current match anyway.
-                 */
-                s->match_length = MIN_MATCH-1;
-            }
-        }
-        /* If there was a match at the previous step and the current
-         * match is not better, output the previous match:
-         */
-        if (s->prev_length >= MIN_MATCH && s->match_length <= s->prev_length) {
-            uInt max_insert = s->strstart + s->lookahead - MIN_MATCH;
-            /* Do not insert strings in hash table beyond this. */
-
-            check_match(s, s->strstart-1, s->prev_match, s->prev_length);
-
-            _tr_tally_dist(s, s->strstart -1 - s->prev_match,
-                          s->prev_length - MIN_MATCH, bflush);
-
-            /* Insert in hash table all strings up to the end of the match.
-             * strstart-1 and strstart are already inserted. If there is not
-             * enough lookahead, the last two strings are not inserted in
-             * the hash table.
-             */
-            s->lookahead -= s->prev_length-1;
-            s->prev_length -= 2;
-            do {
-                if (++s->strstart <= max_insert) {
-                    INSERT_STRING(s, s->strstart, hash_head);
-                }
-            } while (--s->prev_length != 0);
-            s->match_available = 0;
-            s->match_length = MIN_MATCH-1;
-            s->strstart++;
-
-            if (bflush) FLUSH_BLOCK(s, 0);
-
-        } else if (s->match_available) {
-            /* If there was no match at the previous position, output a
-             * single literal. If there was a match but the current match
-             * is longer, truncate the previous match to a single literal.
-             */
-            Tracevv((stderr,"%c", s->window[s->strstart-1]));
-           _tr_tally_lit(s, s->window[s->strstart-1], bflush);
-           if (bflush) {
-                FLUSH_BLOCK_ONLY(s, 0);
-            }
-            s->strstart++;
-            s->lookahead--;
-            if (s->strm->avail_out == 0) return need_more;
-        } else {
-            /* There is no previous match to compare with, wait for
-             * the next step to decide.
-             */
-            s->match_available = 1;
-            s->strstart++;
-            s->lookahead--;
-        }
-    }
-    Assert (flush != Z_NO_FLUSH, "no flush?");
-    if (s->match_available) {
-        Tracevv((stderr,"%c", s->window[s->strstart-1]));
-        _tr_tally_lit(s, s->window[s->strstart-1], bflush);
-        s->match_available = 0;
-    }
-    FLUSH_BLOCK(s, flush == Z_FINISH);
-    return flush == Z_FINISH ? finish_done : block_done;
-}
diff --git a/lib/zlib/deflate.h b/lib/zlib/deflate.h
deleted file mode 100644 (file)
index b99a48a..0000000
+++ /dev/null
@@ -1,318 +0,0 @@
-/* deflate.h -- internal compression state
- * Copyright (C) 1995-2002 Jean-loup Gailly
- * For conditions of distribution and use, see copyright notice in zlib.h 
- */
-
-/* WARNING: this file should *not* be used by applications. It is
-   part of the implementation of the compression library and is
-   subject to change. Applications should only use zlib.h.
- */
-
-/* @(#) $Id$ */
-
-#ifndef _DEFLATE_H
-#define _DEFLATE_H
-
-#include "zutil.h"
-
-/* ===========================================================================
- * Internal compression state.
- */
-
-#define LENGTH_CODES 29
-/* number of length codes, not counting the special END_BLOCK code */
-
-#define LITERALS  256
-/* number of literal bytes 0..255 */
-
-#define L_CODES (LITERALS+1+LENGTH_CODES)
-/* number of Literal or Length codes, including the END_BLOCK code */
-
-#define D_CODES   30
-/* number of distance codes */
-
-#define BL_CODES  19
-/* number of codes used to transfer the bit lengths */
-
-#define HEAP_SIZE (2*L_CODES+1)
-/* maximum heap size */
-
-#define MAX_BITS 15
-/* All codes must not exceed MAX_BITS bits */
-
-#define INIT_STATE    42
-#define BUSY_STATE   113
-#define FINISH_STATE 666
-/* Stream status */
-
-
-/* Data structure describing a single value and its code string. */
-typedef struct ct_data_s {
-    union {
-        ush  freq;       /* frequency count */
-        ush  code;       /* bit string */
-    } fc;
-    union {
-        ush  dad;        /* father node in Huffman tree */
-        ush  len;        /* length of bit string */
-    } dl;
-} FAR ct_data;
-
-#define Freq fc.freq
-#define Code fc.code
-#define Dad  dl.dad
-#define Len  dl.len
-
-typedef struct static_tree_desc_s  static_tree_desc;
-
-typedef struct tree_desc_s {
-    ct_data *dyn_tree;           /* the dynamic tree */
-    int     max_code;            /* largest code with non zero frequency */
-    static_tree_desc *stat_desc; /* the corresponding static tree */
-} FAR tree_desc;
-
-typedef ush Pos;
-typedef Pos FAR Posf;
-typedef unsigned IPos;
-
-/* A Pos is an index in the character window. We use short instead of int to
- * save space in the various tables. IPos is used only for parameter passing.
- */
-
-typedef struct internal_state {
-    z_streamp strm;      /* pointer back to this zlib stream */
-    int   status;        /* as the name implies */
-    Bytef *pending_buf;  /* output still pending */
-    ulg   pending_buf_size; /* size of pending_buf */
-    Bytef *pending_out;  /* next pending byte to output to the stream */
-    int   pending;       /* nb of bytes in the pending buffer */
-    int   noheader;      /* suppress zlib header and adler32 */
-    Byte  data_type;     /* UNKNOWN, BINARY or ASCII */
-    Byte  method;        /* STORED (for zip only) or DEFLATED */
-    int   last_flush;    /* value of flush param for previous deflate call */
-
-                /* used by deflate.c: */
-
-    uInt  w_size;        /* LZ77 window size (32K by default) */
-    uInt  w_bits;        /* log2(w_size)  (8..16) */
-    uInt  w_mask;        /* w_size - 1 */
-
-    Bytef *window;
-    /* Sliding window. Input bytes are read into the second half of the window,
-     * and move to the first half later to keep a dictionary of at least wSize
-     * bytes. With this organization, matches are limited to a distance of
-     * wSize-MAX_MATCH bytes, but this ensures that IO is always
-     * performed with a length multiple of the block size. Also, it limits
-     * the window size to 64K, which is quite useful on MSDOS.
-     * To do: use the user input buffer as sliding window.
-     */
-
-    ulg window_size;
-    /* Actual size of window: 2*wSize, except when the user input buffer
-     * is directly used as sliding window.
-     */
-
-    Posf *prev;
-    /* Link to older string with same hash index. To limit the size of this
-     * array to 64K, this link is maintained only for the last 32K strings.
-     * An index in this array is thus a window index modulo 32K.
-     */
-
-    Posf *head; /* Heads of the hash chains or NIL. */
-
-    uInt  ins_h;          /* hash index of string to be inserted */
-    uInt  hash_size;      /* number of elements in hash table */
-    uInt  hash_bits;      /* log2(hash_size) */
-    uInt  hash_mask;      /* hash_size-1 */
-
-    uInt  hash_shift;
-    /* Number of bits by which ins_h must be shifted at each input
-     * step. It must be such that after MIN_MATCH steps, the oldest
-     * byte no longer takes part in the hash key, that is:
-     *   hash_shift * MIN_MATCH >= hash_bits
-     */
-
-    long block_start;
-    /* Window position at the beginning of the current output block. Gets
-     * negative when the window is moved backwards.
-     */
-
-    uInt match_length;           /* length of best match */
-    IPos prev_match;             /* previous match */
-    int match_available;         /* set if previous match exists */
-    uInt strstart;               /* start of string to insert */
-    uInt match_start;            /* start of matching string */
-    uInt lookahead;              /* number of valid bytes ahead in window */
-
-    uInt prev_length;
-    /* Length of the best match at previous step. Matches not greater than this
-     * are discarded. This is used in the lazy match evaluation.
-     */
-
-    uInt max_chain_length;
-    /* To speed up deflation, hash chains are never searched beyond this
-     * length.  A higher limit improves compression ratio but degrades the
-     * speed.
-     */
-
-    uInt max_lazy_match;
-    /* Attempt to find a better match only when the current match is strictly
-     * smaller than this value. This mechanism is used only for compression
-     * levels >= 4.
-     */
-#   define max_insert_length  max_lazy_match
-    /* Insert new strings in the hash table only if the match length is not
-     * greater than this length. This saves time but degrades compression.
-     * max_insert_length is used only for compression levels <= 3.
-     */
-
-    int level;    /* compression level (1..9) */
-    int strategy; /* favor or force Huffman coding*/
-
-    uInt good_match;
-    /* Use a faster search when the previous match is longer than this */
-
-    int nice_match; /* Stop searching when current match exceeds this */
-
-                /* used by trees.c: */
-    /* Didn't use ct_data typedef below to supress compiler warning */
-    struct ct_data_s dyn_ltree[HEAP_SIZE];   /* literal and length tree */
-    struct ct_data_s dyn_dtree[2*D_CODES+1]; /* distance tree */
-    struct ct_data_s bl_tree[2*BL_CODES+1];  /* Huffman tree for bit lengths */
-
-    struct tree_desc_s l_desc;               /* desc. for literal tree */
-    struct tree_desc_s d_desc;               /* desc. for distance tree */
-    struct tree_desc_s bl_desc;              /* desc. for bit length tree */
-
-    ush bl_count[MAX_BITS+1];
-    /* number of codes at each bit length for an optimal tree */
-
-    int heap[2*L_CODES+1];      /* heap used to build the Huffman trees */
-    int heap_len;               /* number of elements in the heap */
-    int heap_max;               /* element of largest frequency */
-    /* The sons of heap[n] are heap[2*n] and heap[2*n+1]. heap[0] is not used.
-     * The same heap array is used to build all trees.
-     */
-
-    uch depth[2*L_CODES+1];
-    /* Depth of each subtree used as tie breaker for trees of equal frequency
-     */
-
-    uchf *l_buf;          /* buffer for literals or lengths */
-
-    uInt  lit_bufsize;
-    /* Size of match buffer for literals/lengths.  There are 4 reasons for
-     * limiting lit_bufsize to 64K:
-     *   - frequencies can be kept in 16 bit counters
-     *   - if compression is not successful for the first block, all input
-     *     data is still in the window so we can still emit a stored block even
-     *     when input comes from standard input.  (This can also be done for
-     *     all blocks if lit_bufsize is not greater than 32K.)
-     *   - if compression is not successful for a file smaller than 64K, we can
-     *     even emit a stored file instead of a stored block (saving 5 bytes).
-     *     This is applicable only for zip (not gzip or zlib).
-     *   - creating new Huffman trees less frequently may not provide fast
-     *     adaptation to changes in the input data statistics. (Take for
-     *     example a binary file with poorly compressible code followed by
-     *     a highly compressible string table.) Smaller buffer sizes give
-     *     fast adaptation but have of course the overhead of transmitting
-     *     trees more frequently.
-     *   - I can't count above 4
-     */
-
-    uInt last_lit;      /* running index in l_buf */
-
-    ushf *d_buf;
-    /* Buffer for distances. To simplify the code, d_buf and l_buf have
-     * the same number of elements. To use different lengths, an extra flag
-     * array would be necessary.
-     */
-
-    ulg opt_len;        /* bit length of current block with optimal trees */
-    ulg static_len;     /* bit length of current block with static trees */
-    uInt matches;       /* number of string matches in current block */
-    int last_eob_len;   /* bit length of EOB code for last block */
-
-#ifdef DEBUG
-    ulg compressed_len; /* total bit length of compressed file mod 2^32 */
-    ulg bits_sent;      /* bit length of compressed data sent mod 2^32 */
-#endif
-
-    ush bi_buf;
-    /* Output buffer. bits are inserted starting at the bottom (least
-     * significant bits).
-     */
-    int bi_valid;
-    /* Number of valid bits in bi_buf.  All bits above the last valid bit
-     * are always zero.
-     */
-
-} FAR deflate_state;
-
-/* Output a byte on the stream.
- * IN assertion: there is enough room in pending_buf.
- */
-#define put_byte(s, c) {s->pending_buf[s->pending++] = (c);}
-
-
-#define MIN_LOOKAHEAD (MAX_MATCH+MIN_MATCH+1)
-/* Minimum amount of lookahead, except at the end of the input file.
- * See deflate.c for comments about the MIN_MATCH+1.
- */
-
-#define MAX_DIST(s)  ((s)->w_size-MIN_LOOKAHEAD)
-/* In order to simplify the code, particularly on 16 bit machines, match
- * distances are limited to MAX_DIST instead of WSIZE.
- */
-
-        /* in trees.c */
-void _tr_init         OF((deflate_state *s));
-int  _tr_tally        OF((deflate_state *s, unsigned dist, unsigned lc));
-void _tr_flush_block  OF((deflate_state *s, charf *buf, ulg stored_len,
-                         int eof));
-void _tr_align        OF((deflate_state *s));
-void _tr_stored_block OF((deflate_state *s, charf *buf, ulg stored_len,
-                          int eof));
-
-#define d_code(dist) \
-   ((dist) < 256 ? _dist_code[dist] : _dist_code[256+((dist)>>7)])
-/* Mapping from a distance to a distance code. dist is the distance - 1 and
- * must not have side effects. _dist_code[256] and _dist_code[257] are never
- * used.
- */
-
-#ifndef DEBUG
-/* Inline versions of _tr_tally for speed: */
-
-#if defined(GEN_TREES_H) || !defined(STDC)
-  extern uch _length_code[];
-  extern uch _dist_code[];
-#else
-  extern const uch _length_code[];
-  extern const uch _dist_code[];
-#endif
-
-# define _tr_tally_lit(s, c, flush) \
-  { uch cc = (c); \
-    s->d_buf[s->last_lit] = 0; \
-    s->l_buf[s->last_lit++] = cc; \
-    s->dyn_ltree[cc].Freq++; \
-    flush = (s->last_lit == s->lit_bufsize-1); \
-   }
-# define _tr_tally_dist(s, distance, length, flush) \
-  { uch len = (length); \
-    ush dist = (distance); \
-    s->d_buf[s->last_lit] = dist; \
-    s->l_buf[s->last_lit++] = len; \
-    dist--; \
-    s->dyn_ltree[_length_code[len]+LITERALS+1].Freq++; \
-    s->dyn_dtree[d_code(dist)].Freq++; \
-    flush = (s->last_lit == s->lit_bufsize-1); \
-  }
-#else
-# define _tr_tally_lit(s, c, flush) flush = _tr_tally(s, 0, c)
-# define _tr_tally_dist(s, distance, length, flush) \
-              flush = _tr_tally(s, distance, length) 
-#endif
-
-#endif
diff --git a/lib/zlib/descrip.mms b/lib/zlib/descrip.mms
deleted file mode 100644 (file)
index 9d36459..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-# descrip.mms: MMS description file for building zlib on VMS
-# written by Martin P.J. Zinser <m.zinser@gsi.de>
-
-cc_defs = 
-c_deb = 
-
-.ifdef __DECC__
-pref = /prefix=all
-.endif
-
-OBJS = adler32.obj, compress.obj, crc32.obj, gzio.obj, uncompr.obj,\
-       deflate.obj, trees.obj, zutil.obj, inflate.obj, infblock.obj,\
-       inftrees.obj, infcodes.obj, infutil.obj, inffast.obj
-
-CFLAGS= $(C_DEB) $(CC_DEFS) $(PREF)
-
-all : example.exe minigzip.exe
-        @ write sys$output " Example applications available"
-libz.olb : libz.olb($(OBJS))
-       @ write sys$output " libz available"
-
-example.exe : example.obj libz.olb
-              link example,libz.olb/lib
-
-minigzip.exe : minigzip.obj libz.olb
-              link minigzip,libz.olb/lib,x11vms:xvmsutils.olb/lib
-
-clean : 
-       delete *.obj;*,libz.olb;*
-
-
-# Other dependencies.
-adler32.obj : zutil.h zlib.h zconf.h
-compress.obj : zlib.h zconf.h
-crc32.obj : zutil.h zlib.h zconf.h
-deflate.obj : deflate.h zutil.h zlib.h zconf.h
-example.obj : zlib.h zconf.h
-gzio.obj : zutil.h zlib.h zconf.h
-infblock.obj : zutil.h zlib.h zconf.h infblock.h inftrees.h infcodes.h infutil.h
-infcodes.obj : zutil.h zlib.h zconf.h inftrees.h infutil.h infcodes.h inffast.h
-inffast.obj : zutil.h zlib.h zconf.h inftrees.h infutil.h inffast.h
-inflate.obj : zutil.h zlib.h zconf.h infblock.h
-inftrees.obj : zutil.h zlib.h zconf.h inftrees.h
-infutil.obj : zutil.h zlib.h zconf.h inftrees.h infutil.h
-minigzip.obj : zlib.h zconf.h
-trees.obj : deflate.h zutil.h zlib.h zconf.h
-uncompr.obj : zlib.h zconf.h
-zutil.obj : zutil.h zlib.h zconf.h
diff --git a/lib/zlib/example.c b/lib/zlib/example.c
deleted file mode 100644 (file)
index e7e3673..0000000
+++ /dev/null
@@ -1,556 +0,0 @@
-/* example.c -- usage example of the zlib compression library
- * Copyright (C) 1995-2002 Jean-loup Gailly.
- * For conditions of distribution and use, see copyright notice in zlib.h 
- */
-
-/* @(#) $Id$ */
-
-#include <stdio.h>
-#include "zlib.h"
-
-#ifdef STDC
-#  include <string.h>
-#  include <stdlib.h>
-#else
-   extern void exit  OF((int));
-#endif
-
-#if defined(VMS) || defined(RISCOS)
-#  define TESTFILE "foo-gz"
-#else
-#  define TESTFILE "foo.gz"
-#endif
-
-#define CHECK_ERR(err, msg) { \
-    if (err != Z_OK) { \
-        fprintf(stderr, "%s error: %d\n", msg, err); \
-        exit(1); \
-    } \
-}
-
-const char hello[] = "hello, hello!";
-/* "hello world" would be more standard, but the repeated "hello"
- * stresses the compression code better, sorry...
- */
-
-const char dictionary[] = "hello";
-uLong dictId; /* Adler32 value of the dictionary */
-
-void test_compress      OF((Byte *compr, uLong comprLen,
-                           Byte *uncompr, uLong uncomprLen));
-void test_gzio          OF((const char *out, const char *in, 
-                           Byte *uncompr, int uncomprLen));
-void test_deflate       OF((Byte *compr, uLong comprLen));
-void test_inflate       OF((Byte *compr, uLong comprLen,
-                           Byte *uncompr, uLong uncomprLen));
-void test_large_deflate OF((Byte *compr, uLong comprLen,
-                           Byte *uncompr, uLong uncomprLen));
-void test_large_inflate OF((Byte *compr, uLong comprLen,
-                           Byte *uncompr, uLong uncomprLen));
-void test_flush         OF((Byte *compr, uLong *comprLen));
-void test_sync          OF((Byte *compr, uLong comprLen,
-                           Byte *uncompr, uLong uncomprLen));
-void test_dict_deflate  OF((Byte *compr, uLong comprLen));
-void test_dict_inflate  OF((Byte *compr, uLong comprLen,
-                           Byte *uncompr, uLong uncomprLen));
-int  main               OF((int argc, char *argv[]));
-
-/* ===========================================================================
- * Test compress() and uncompress()
- */
-void test_compress(compr, comprLen, uncompr, uncomprLen)
-    Byte *compr, *uncompr;
-    uLong comprLen, uncomprLen;
-{
-    int err;
-    uLong len = strlen(hello)+1;
-
-    err = compress(compr, &comprLen, (const Bytef*)hello, len);
-    CHECK_ERR(err, "compress");
-
-    strcpy((char*)uncompr, "garbage");
-
-    err = uncompress(uncompr, &uncomprLen, compr, comprLen);
-    CHECK_ERR(err, "uncompress");
-
-    if (strcmp((char*)uncompr, hello)) {
-        fprintf(stderr, "bad uncompress\n");
-       exit(1);
-    } else {
-        printf("uncompress(): %s\n", (char *)uncompr);
-    }
-}
-
-/* ===========================================================================
- * Test read/write of .gz files
- */
-void test_gzio(out, in, uncompr, uncomprLen)
-    const char *out; /* compressed output file */
-    const char *in;  /* compressed input file */
-    Byte *uncompr;
-    int  uncomprLen;
-{
-    int err;
-    int len = strlen(hello)+1;
-    gzFile file;
-    z_off_t pos;
-
-    file = gzopen(out, "wb");
-    if (file == NULL) {
-        fprintf(stderr, "gzopen error\n");
-        exit(1);
-    }
-    gzputc(file, 'h');
-    if (gzputs(file, "ello") != 4) {
-        fprintf(stderr, "gzputs err: %s\n", gzerror(file, &err));
-       exit(1);
-    }
-    if (gzprintf(file, ", %s!", "hello") != 8) {
-        fprintf(stderr, "gzprintf err: %s\n", gzerror(file, &err));
-       exit(1);
-    }
-    gzseek(file, 1L, SEEK_CUR); /* add one zero byte */
-    gzclose(file);
-
-    file = gzopen(in, "rb");
-    if (file == NULL) {
-        fprintf(stderr, "gzopen error\n");
-    }
-    strcpy((char*)uncompr, "garbage");
-
-    uncomprLen = gzread(file, uncompr, (unsigned)uncomprLen);
-    if (uncomprLen != len) {
-        fprintf(stderr, "gzread err: %s\n", gzerror(file, &err));
-       exit(1);
-    }
-    if (strcmp((char*)uncompr, hello)) {
-        fprintf(stderr, "bad gzread: %s\n", (char*)uncompr);
-       exit(1);
-    } else {
-        printf("gzread(): %s\n", (char *)uncompr);
-    }
-
-    pos = gzseek(file, -8L, SEEK_CUR);
-    if (pos != 6 || gztell(file) != pos) {
-       fprintf(stderr, "gzseek error, pos=%ld, gztell=%ld\n",
-               (long)pos, (long)gztell(file));
-       exit(1);
-    }
-
-    if (gzgetc(file) != ' ') {
-       fprintf(stderr, "gzgetc error\n");
-       exit(1);
-    }
-
-    gzgets(file, (char*)uncompr, uncomprLen);
-    uncomprLen = strlen((char*)uncompr);
-    if (uncomprLen != 6) { /* "hello!" */
-        fprintf(stderr, "gzgets err after gzseek: %s\n", gzerror(file, &err));
-       exit(1);
-    }
-    if (strcmp((char*)uncompr, hello+7)) {
-        fprintf(stderr, "bad gzgets after gzseek\n");
-       exit(1);
-    } else {
-        printf("gzgets() after gzseek: %s\n", (char *)uncompr);
-    }
-
-    gzclose(file);
-}
-
-/* ===========================================================================
- * Test deflate() with small buffers
- */
-void test_deflate(compr, comprLen)
-    Byte *compr;
-    uLong comprLen;
-{
-    z_stream c_stream; /* compression stream */
-    int err;
-    int len = strlen(hello)+1;
-
-    c_stream.zalloc = (alloc_func)0;
-    c_stream.zfree = (free_func)0;
-    c_stream.opaque = (voidpf)0;
-
-    err = deflateInit(&c_stream, Z_DEFAULT_COMPRESSION);
-    CHECK_ERR(err, "deflateInit");
-
-    c_stream.next_in  = (Bytef*)hello;
-    c_stream.next_out = compr;
-
-    while (c_stream.total_in != (uLong)len && c_stream.total_out < comprLen) {
-        c_stream.avail_in = c_stream.avail_out = 1; /* force small buffers */
-        err = deflate(&c_stream, Z_NO_FLUSH);
-        CHECK_ERR(err, "deflate");
-    }
-    /* Finish the stream, still forcing small buffers: */
-    for (;;) {
-        c_stream.avail_out = 1;
-        err = deflate(&c_stream, Z_FINISH);
-        if (err == Z_STREAM_END) break;
-        CHECK_ERR(err, "deflate");
-    }
-
-    err = deflateEnd(&c_stream);
-    CHECK_ERR(err, "deflateEnd");
-}
-
-/* ===========================================================================
- * Test inflate() with small buffers
- */
-void test_inflate(compr, comprLen, uncompr, uncomprLen)
-    Byte *compr, *uncompr;
-    uLong comprLen, uncomprLen;
-{
-    int err;
-    z_stream d_stream; /* decompression stream */
-
-    strcpy((char*)uncompr, "garbage");
-
-    d_stream.zalloc = (alloc_func)0;
-    d_stream.zfree = (free_func)0;
-    d_stream.opaque = (voidpf)0;
-
-    d_stream.next_in  = compr;
-    d_stream.avail_in = 0;
-    d_stream.next_out = uncompr;
-
-    err = inflateInit(&d_stream);
-    CHECK_ERR(err, "inflateInit");
-
-    while (d_stream.total_out < uncomprLen && d_stream.total_in < comprLen) {
-        d_stream.avail_in = d_stream.avail_out = 1; /* force small buffers */
-        err = inflate(&d_stream, Z_NO_FLUSH);
-        if (err == Z_STREAM_END) break;
-        CHECK_ERR(err, "inflate");
-    }
-
-    err = inflateEnd(&d_stream);
-    CHECK_ERR(err, "inflateEnd");
-
-    if (strcmp((char*)uncompr, hello)) {
-        fprintf(stderr, "bad inflate\n");
-       exit(1);
-    } else {
-        printf("inflate(): %s\n", (char *)uncompr);
-    }
-}
-
-/* ===========================================================================
- * Test deflate() with large buffers and dynamic change of compression level
- */
-void test_large_deflate(compr, comprLen, uncompr, uncomprLen)
-    Byte *compr, *uncompr;
-    uLong comprLen, uncomprLen;
-{
-    z_stream c_stream; /* compression stream */
-    int err;
-
-    c_stream.zalloc = (alloc_func)0;
-    c_stream.zfree = (free_func)0;
-    c_stream.opaque = (voidpf)0;
-
-    err = deflateInit(&c_stream, Z_BEST_SPEED);
-    CHECK_ERR(err, "deflateInit");
-
-    c_stream.next_out = compr;
-    c_stream.avail_out = (uInt)comprLen;
-
-    /* At this point, uncompr is still mostly zeroes, so it should compress
-     * very well:
-     */
-    c_stream.next_in = uncompr;
-    c_stream.avail_in = (uInt)uncomprLen;
-    err = deflate(&c_stream, Z_NO_FLUSH);
-    CHECK_ERR(err, "deflate");
-    if (c_stream.avail_in != 0) {
-        fprintf(stderr, "deflate not greedy\n");
-       exit(1);
-    }
-
-    /* Feed in already compressed data and switch to no compression: */
-    deflateParams(&c_stream, Z_NO_COMPRESSION, Z_DEFAULT_STRATEGY);
-    c_stream.next_in = compr;
-    c_stream.avail_in = (uInt)comprLen/2;
-    err = deflate(&c_stream, Z_NO_FLUSH);
-    CHECK_ERR(err, "deflate");
-
-    /* Switch back to compressing mode: */
-    deflateParams(&c_stream, Z_BEST_COMPRESSION, Z_FILTERED);
-    c_stream.next_in = uncompr;
-    c_stream.avail_in = (uInt)uncomprLen;
-    err = deflate(&c_stream, Z_NO_FLUSH);
-    CHECK_ERR(err, "deflate");
-
-    err = deflate(&c_stream, Z_FINISH);
-    if (err != Z_STREAM_END) {
-        fprintf(stderr, "deflate should report Z_STREAM_END\n");
-       exit(1);
-    }
-    err = deflateEnd(&c_stream);
-    CHECK_ERR(err, "deflateEnd");
-}
-
-/* ===========================================================================
- * Test inflate() with large buffers
- */
-void test_large_inflate(compr, comprLen, uncompr, uncomprLen)
-    Byte *compr, *uncompr;
-    uLong comprLen, uncomprLen;
-{
-    int err;
-    z_stream d_stream; /* decompression stream */
-
-    strcpy((char*)uncompr, "garbage");
-
-    d_stream.zalloc = (alloc_func)0;
-    d_stream.zfree = (free_func)0;
-    d_stream.opaque = (voidpf)0;
-
-    d_stream.next_in  = compr;
-    d_stream.avail_in = (uInt)comprLen;
-
-    err = inflateInit(&d_stream);
-    CHECK_ERR(err, "inflateInit");
-
-    for (;;) {
-        d_stream.next_out = uncompr;            /* discard the output */
-       d_stream.avail_out = (uInt)uncomprLen;
-        err = inflate(&d_stream, Z_NO_FLUSH);
-        if (err == Z_STREAM_END) break;
-        CHECK_ERR(err, "large inflate");
-    }
-
-    err = inflateEnd(&d_stream);
-    CHECK_ERR(err, "inflateEnd");
-
-    if (d_stream.total_out != 2*uncomprLen + comprLen/2) {
-        fprintf(stderr, "bad large inflate: %ld\n", d_stream.total_out);
-       exit(1);
-    } else {
-        printf("large_inflate(): OK\n");
-    }
-}
-
-/* ===========================================================================
- * Test deflate() with full flush
- */
-void test_flush(compr, comprLen)
-    Byte *compr;
-    uLong *comprLen;
-{
-    z_stream c_stream; /* compression stream */
-    int err;
-    int len = strlen(hello)+1;
-
-    c_stream.zalloc = (alloc_func)0;
-    c_stream.zfree = (free_func)0;
-    c_stream.opaque = (voidpf)0;
-
-    err = deflateInit(&c_stream, Z_DEFAULT_COMPRESSION);
-    CHECK_ERR(err, "deflateInit");
-
-    c_stream.next_in  = (Bytef*)hello;
-    c_stream.next_out = compr;
-    c_stream.avail_in = 3;
-    c_stream.avail_out = (uInt)*comprLen;
-    err = deflate(&c_stream, Z_FULL_FLUSH);
-    CHECK_ERR(err, "deflate");
-
-    compr[3]++; /* force an error in first compressed block */
-    c_stream.avail_in = len - 3;
-
-    err = deflate(&c_stream, Z_FINISH);
-    if (err != Z_STREAM_END) {
-        CHECK_ERR(err, "deflate");
-    }
-    err = deflateEnd(&c_stream);
-    CHECK_ERR(err, "deflateEnd");
-
-    *comprLen = c_stream.total_out;
-}
-
-/* ===========================================================================
- * Test inflateSync()
- */
-void test_sync(compr, comprLen, uncompr, uncomprLen)
-    Byte *compr, *uncompr;
-    uLong comprLen, uncomprLen;
-{
-    int err;
-    z_stream d_stream; /* decompression stream */
-
-    strcpy((char*)uncompr, "garbage");
-
-    d_stream.zalloc = (alloc_func)0;
-    d_stream.zfree = (free_func)0;
-    d_stream.opaque = (voidpf)0;
-
-    d_stream.next_in  = compr;
-    d_stream.avail_in = 2; /* just read the zlib header */
-
-    err = inflateInit(&d_stream);
-    CHECK_ERR(err, "inflateInit");
-
-    d_stream.next_out = uncompr;
-    d_stream.avail_out = (uInt)uncomprLen;
-
-    inflate(&d_stream, Z_NO_FLUSH);
-    CHECK_ERR(err, "inflate");
-
-    d_stream.avail_in = (uInt)comprLen-2;   /* read all compressed data */
-    err = inflateSync(&d_stream);           /* but skip the damaged part */
-    CHECK_ERR(err, "inflateSync");
-
-    err = inflate(&d_stream, Z_FINISH);
-    if (err != Z_DATA_ERROR) {
-        fprintf(stderr, "inflate should report DATA_ERROR\n");
-        /* Because of incorrect adler32 */
-       exit(1);
-    }
-    err = inflateEnd(&d_stream);
-    CHECK_ERR(err, "inflateEnd");
-
-    printf("after inflateSync(): hel%s\n", (char *)uncompr);
-}
-
-/* ===========================================================================
- * Test deflate() with preset dictionary
- */
-void test_dict_deflate(compr, comprLen)
-    Byte *compr;
-    uLong comprLen;
-{
-    z_stream c_stream; /* compression stream */
-    int err;
-
-    c_stream.zalloc = (alloc_func)0;
-    c_stream.zfree = (free_func)0;
-    c_stream.opaque = (voidpf)0;
-
-    err = deflateInit(&c_stream, Z_BEST_COMPRESSION);
-    CHECK_ERR(err, "deflateInit");
-
-    err = deflateSetDictionary(&c_stream,
-                              (const Bytef*)dictionary, sizeof(dictionary));
-    CHECK_ERR(err, "deflateSetDictionary");
-
-    dictId = c_stream.adler;
-    c_stream.next_out = compr;
-    c_stream.avail_out = (uInt)comprLen;
-
-    c_stream.next_in = (Bytef*)hello;
-    c_stream.avail_in = (uInt)strlen(hello)+1;
-
-    err = deflate(&c_stream, Z_FINISH);
-    if (err != Z_STREAM_END) {
-        fprintf(stderr, "deflate should report Z_STREAM_END\n");
-       exit(1);
-    }
-    err = deflateEnd(&c_stream);
-    CHECK_ERR(err, "deflateEnd");
-}
-
-/* ===========================================================================
- * Test inflate() with a preset dictionary
- */
-void test_dict_inflate(compr, comprLen, uncompr, uncomprLen)
-    Byte *compr, *uncompr;
-    uLong comprLen, uncomprLen;
-{
-    int err;
-    z_stream d_stream; /* decompression stream */
-
-    strcpy((char*)uncompr, "garbage");
-
-    d_stream.zalloc = (alloc_func)0;
-    d_stream.zfree = (free_func)0;
-    d_stream.opaque = (voidpf)0;
-
-    d_stream.next_in  = compr;
-    d_stream.avail_in = (uInt)comprLen;
-
-    err = inflateInit(&d_stream);
-    CHECK_ERR(err, "inflateInit");
-
-    d_stream.next_out = uncompr;
-    d_stream.avail_out = (uInt)uncomprLen;
-
-    for (;;) {
-        err = inflate(&d_stream, Z_NO_FLUSH);
-        if (err == Z_STREAM_END) break;
-       if (err == Z_NEED_DICT) {
-           if (d_stream.adler != dictId) {
-               fprintf(stderr, "unexpected dictionary");
-               exit(1);
-           }
-           err = inflateSetDictionary(&d_stream, (const Bytef*)dictionary,
-                                      sizeof(dictionary));
-       }
-        CHECK_ERR(err, "inflate with dict");
-    }
-
-    err = inflateEnd(&d_stream);
-    CHECK_ERR(err, "inflateEnd");
-
-    if (strcmp((char*)uncompr, hello)) {
-        fprintf(stderr, "bad inflate with dict\n");
-       exit(1);
-    } else {
-        printf("inflate with dictionary: %s\n", (char *)uncompr);
-    }
-}
-
-/* ===========================================================================
- * Usage:  example [output.gz  [input.gz]]
- */
-
-int main(argc, argv)
-    int argc;
-    char *argv[];
-{
-    Byte *compr, *uncompr;
-    uLong comprLen = 10000*sizeof(int); /* don't overflow on MSDOS */
-    uLong uncomprLen = comprLen;
-    static const char* myVersion = ZLIB_VERSION;
-
-    if (zlibVersion()[0] != myVersion[0]) {
-        fprintf(stderr, "incompatible zlib version\n");
-        exit(1);
-
-    } else if (strcmp(zlibVersion(), ZLIB_VERSION) != 0) {
-        fprintf(stderr, "warning: different zlib version\n");
-    }
-
-    compr    = (Byte*)calloc((uInt)comprLen, 1);
-    uncompr  = (Byte*)calloc((uInt)uncomprLen, 1);
-    /* compr and uncompr are cleared to avoid reading uninitialized
-     * data and to ensure that uncompr compresses well.
-     */
-    if (compr == Z_NULL || uncompr == Z_NULL) {
-        printf("out of memory\n");
-       exit(1);
-    }
-    test_compress(compr, comprLen, uncompr, uncomprLen);
-
-    test_gzio((argc > 1 ? argv[1] : TESTFILE),
-              (argc > 2 ? argv[2] : TESTFILE),
-             uncompr, (int)uncomprLen);
-
-    test_deflate(compr, comprLen);
-    test_inflate(compr, comprLen, uncompr, uncomprLen);
-
-    test_large_deflate(compr, comprLen, uncompr, uncomprLen);
-    test_large_inflate(compr, comprLen, uncompr, uncomprLen);
-
-    test_flush(compr, &comprLen);
-    test_sync(compr, comprLen, uncompr, uncomprLen);
-    comprLen = uncomprLen;
-
-    test_dict_deflate(compr, comprLen);
-    test_dict_inflate(compr, comprLen, uncompr, uncomprLen);
-
-    exit(0);
-    return 0; /* to avoid warning */
-}
diff --git a/lib/zlib/gzio.c b/lib/zlib/gzio.c
deleted file mode 100644 (file)
index 09e0a20..0000000
+++ /dev/null
@@ -1,875 +0,0 @@
-/* gzio.c -- IO on .gz files
- * Copyright (C) 1995-2002 Jean-loup Gailly.
- * For conditions of distribution and use, see copyright notice in zlib.h
- *
- * Compile this file with -DNO_DEFLATE to avoid the compression code.
- */
-
-/* @(#) $Id$ */
-
-#include <stdio.h>
-
-#include "zutil.h"
-
-struct internal_state {int dummy;}; /* for buggy compilers */
-
-#ifndef Z_BUFSIZE
-#  ifdef MAXSEG_64K
-#    define Z_BUFSIZE 4096 /* minimize memory usage for 16-bit DOS */
-#  else
-#    define Z_BUFSIZE 16384
-#  endif
-#endif
-#ifndef Z_PRINTF_BUFSIZE
-#  define Z_PRINTF_BUFSIZE 4096
-#endif
-
-#define ALLOC(size) malloc(size)
-#define TRYFREE(p) {if (p) free(p);}
-
-static int gz_magic[2] = {0x1f, 0x8b}; /* gzip magic header */
-
-/* gzip flag byte */
-#define ASCII_FLAG   0x01 /* bit 0 set: file probably ascii text */
-#define HEAD_CRC     0x02 /* bit 1 set: header CRC present */
-#define EXTRA_FIELD  0x04 /* bit 2 set: extra field present */
-#define ORIG_NAME    0x08 /* bit 3 set: original file name present */
-#define COMMENT      0x10 /* bit 4 set: file comment present */
-#define RESERVED     0xE0 /* bits 5..7: reserved */
-
-typedef struct gz_stream {
-    z_stream stream;
-    int      z_err;   /* error code for last stream operation */
-    int      z_eof;   /* set if end of input file */
-    FILE     *file;   /* .gz file */
-    Byte     *inbuf;  /* input buffer */
-    Byte     *outbuf; /* output buffer */
-    uLong    crc;     /* crc32 of uncompressed data */
-    char     *msg;    /* error message */
-    char     *path;   /* path name for debugging only */
-    int      transparent; /* 1 if input file is not a .gz file */
-    char     mode;    /* 'w' or 'r' */
-    long     startpos; /* start of compressed data in file (header skipped) */
-} gz_stream;
-
-
-local gzFile gz_open      OF((const char *path, const char *mode, int  fd));
-local int do_flush        OF((gzFile file, int flush));
-local int    get_byte     OF((gz_stream *s));
-local void   check_header OF((gz_stream *s));
-local int    destroy      OF((gz_stream *s));
-local void   putLong      OF((FILE *file, uLong x));
-local uLong  getLong      OF((gz_stream *s));
-
-/* ===========================================================================
-     Opens a gzip (.gz) file for reading or writing. The mode parameter
-   is as in fopen ("rb" or "wb"). The file is given either by file descriptor
-   or path name (if fd == -1).
-     gz_open return NULL if the file could not be opened or if there was
-   insufficient memory to allocate the (de)compression state; errno
-   can be checked to distinguish the two cases (if errno is zero, the
-   zlib error is Z_MEM_ERROR).
-*/
-local gzFile gz_open (path, mode, fd)
-    const char *path;
-    const char *mode;
-    int  fd;
-{
-    int err;
-    int level = Z_DEFAULT_COMPRESSION; /* compression level */
-    int strategy = Z_DEFAULT_STRATEGY; /* compression strategy */
-    char *p = (char*)mode;
-    gz_stream *s;
-    char fmode[80]; /* copy of mode, without the compression level */
-    char *m = fmode;
-
-    if (!path || !mode) return Z_NULL;
-
-    s = (gz_stream *)ALLOC(sizeof(gz_stream));
-    if (!s) return Z_NULL;
-
-    s->stream.zalloc = (alloc_func)0;
-    s->stream.zfree = (free_func)0;
-    s->stream.opaque = (voidpf)0;
-    s->stream.next_in = s->inbuf = Z_NULL;
-    s->stream.next_out = s->outbuf = Z_NULL;
-    s->stream.avail_in = s->stream.avail_out = 0;
-    s->file = NULL;
-    s->z_err = Z_OK;
-    s->z_eof = 0;
-    s->crc = crc32(0L, Z_NULL, 0);
-    s->msg = NULL;
-    s->transparent = 0;
-
-    s->path = (char*)ALLOC(strlen(path)+1);
-    if (s->path == NULL) {
-        return destroy(s), (gzFile)Z_NULL;
-    }
-    strcpy(s->path, path); /* do this early for debugging */
-
-    s->mode = '\0';
-    do {
-        if (*p == 'r') s->mode = 'r';
-        if (*p == 'w' || *p == 'a') s->mode = 'w';
-        if (*p >= '0' && *p <= '9') {
-           level = *p - '0';
-       } else if (*p == 'f') {
-         strategy = Z_FILTERED;
-       } else if (*p == 'h') {
-         strategy = Z_HUFFMAN_ONLY;
-       } else {
-           *m++ = *p; /* copy the mode */
-       }
-    } while (*p++ && m != fmode + sizeof(fmode));
-    if (s->mode == '\0') return destroy(s), (gzFile)Z_NULL;
-    
-    if (s->mode == 'w') {
-#ifdef NO_DEFLATE
-        err = Z_STREAM_ERROR;
-#else
-        err = deflateInit2(&(s->stream), level,
-                           Z_DEFLATED, -MAX_WBITS, DEF_MEM_LEVEL, strategy);
-        /* windowBits is passed < 0 to suppress zlib header */
-
-        s->stream.next_out = s->outbuf = (Byte*)ALLOC(Z_BUFSIZE);
-#endif
-        if (err != Z_OK || s->outbuf == Z_NULL) {
-            return destroy(s), (gzFile)Z_NULL;
-        }
-    } else {
-        s->stream.next_in  = s->inbuf = (Byte*)ALLOC(Z_BUFSIZE);
-
-        err = inflateInit2(&(s->stream), -MAX_WBITS);
-        /* windowBits is passed < 0 to tell that there is no zlib header.
-         * Note that in this case inflate *requires* an extra "dummy" byte
-         * after the compressed stream in order to complete decompression and
-         * return Z_STREAM_END. Here the gzip CRC32 ensures that 4 bytes are
-         * present after the compressed stream.
-         */
-        if (err != Z_OK || s->inbuf == Z_NULL) {
-            return destroy(s), (gzFile)Z_NULL;
-        }
-    }
-    s->stream.avail_out = Z_BUFSIZE;
-
-    errno = 0;
-    s->file = fd < 0 ? F_OPEN(path, fmode) : (FILE*)fdopen(fd, fmode);
-
-    if (s->file == NULL) {
-        return destroy(s), (gzFile)Z_NULL;
-    }
-    if (s->mode == 'w') {
-        /* Write a very simple .gz header:
-         */
-        fprintf(s->file, "%c%c%c%c%c%c%c%c%c%c", gz_magic[0], gz_magic[1],
-             Z_DEFLATED, 0 /*flags*/, 0,0,0,0 /*time*/, 0 /*xflags*/, OS_CODE);
-       s->startpos = 10L;
-       /* We use 10L instead of ftell(s->file) to because ftell causes an
-         * fflush on some systems. This version of the library doesn't use
-         * startpos anyway in write mode, so this initialization is not
-         * necessary.
-         */
-    } else {
-       check_header(s); /* skip the .gz header */
-       s->startpos = (ftell(s->file) - s->stream.avail_in);
-    }
-    
-    return (gzFile)s;
-}
-
-/* ===========================================================================
-     Opens a gzip (.gz) file for reading or writing.
-*/
-gzFile ZEXPORT gzopen (path, mode)
-    const char *path;
-    const char *mode;
-{
-    return gz_open (path, mode, -1);
-}
-
-/* ===========================================================================
-     Associate a gzFile with the file descriptor fd. fd is not dup'ed here
-   to mimic the behavio(u)r of fdopen.
-*/
-gzFile ZEXPORT gzdopen (fd, mode)
-    int fd;
-    const char *mode;
-{
-    char name[20];
-
-    if (fd < 0) return (gzFile)Z_NULL;
-    sprintf(name, "<fd:%d>", fd); /* for debugging */
-
-    return gz_open (name, mode, fd);
-}
-
-/* ===========================================================================
- * Update the compression level and strategy
- */
-int ZEXPORT gzsetparams (file, level, strategy)
-    gzFile file;
-    int level;
-    int strategy;
-{
-    gz_stream *s = (gz_stream*)file;
-
-    if (s == NULL || s->mode != 'w') return Z_STREAM_ERROR;
-
-    /* Make room to allow flushing */
-    if (s->stream.avail_out == 0) {
-
-       s->stream.next_out = s->outbuf;
-       if (fwrite(s->outbuf, 1, Z_BUFSIZE, s->file) != Z_BUFSIZE) {
-           s->z_err = Z_ERRNO;
-       }
-       s->stream.avail_out = Z_BUFSIZE;
-    }
-
-    return deflateParams (&(s->stream), level, strategy);
-}
-
-/* ===========================================================================
-     Read a byte from a gz_stream; update next_in and avail_in. Return EOF
-   for end of file.
-   IN assertion: the stream s has been sucessfully opened for reading.
-*/
-local int get_byte(s)
-    gz_stream *s;
-{
-    if (s->z_eof) return EOF;
-    if (s->stream.avail_in == 0) {
-       errno = 0;
-       s->stream.avail_in = fread(s->inbuf, 1, Z_BUFSIZE, s->file);
-       if (s->stream.avail_in == 0) {
-           s->z_eof = 1;
-           if (ferror(s->file)) s->z_err = Z_ERRNO;
-           return EOF;
-       }
-       s->stream.next_in = s->inbuf;
-    }
-    s->stream.avail_in--;
-    return *(s->stream.next_in)++;
-}
-
-/* ===========================================================================
-      Check the gzip header of a gz_stream opened for reading. Set the stream
-    mode to transparent if the gzip magic header is not present; set s->err
-    to Z_DATA_ERROR if the magic header is present but the rest of the header
-    is incorrect.
-    IN assertion: the stream s has already been created sucessfully;
-       s->stream.avail_in is zero for the first time, but may be non-zero
-       for concatenated .gz files.
-*/
-local void check_header(s)
-    gz_stream *s;
-{
-    int method; /* method byte */
-    int flags;  /* flags byte */
-    uInt len;
-    int c;
-
-    /* Check the gzip magic header */
-    for (len = 0; len < 2; len++) {
-       c = get_byte(s);
-       if (c != gz_magic[len]) {
-           if (len != 0) s->stream.avail_in++, s->stream.next_in--;
-           if (c != EOF) {
-               s->stream.avail_in++, s->stream.next_in--;
-               s->transparent = 1;
-           }
-           s->z_err = s->stream.avail_in != 0 ? Z_OK : Z_STREAM_END;
-           return;
-       }
-    }
-    method = get_byte(s);
-    flags = get_byte(s);
-    if (method != Z_DEFLATED || (flags & RESERVED) != 0) {
-       s->z_err = Z_DATA_ERROR;
-       return;
-    }
-
-    /* Discard time, xflags and OS code: */
-    for (len = 0; len < 6; len++) (void)get_byte(s);
-
-    if ((flags & EXTRA_FIELD) != 0) { /* skip the extra field */
-       len  =  (uInt)get_byte(s);
-       len += ((uInt)get_byte(s))<<8;
-       /* len is garbage if EOF but the loop below will quit anyway */
-       while (len-- != 0 && get_byte(s) != EOF) ;
-    }
-    if ((flags & ORIG_NAME) != 0) { /* skip the original file name */
-       while ((c = get_byte(s)) != 0 && c != EOF) ;
-    }
-    if ((flags & COMMENT) != 0) {   /* skip the .gz file comment */
-       while ((c = get_byte(s)) != 0 && c != EOF) ;
-    }
-    if ((flags & HEAD_CRC) != 0) {  /* skip the header crc */
-       for (len = 0; len < 2; len++) (void)get_byte(s);
-    }
-    s->z_err = s->z_eof ? Z_DATA_ERROR : Z_OK;
-}
-
- /* ===========================================================================
- * Cleanup then free the given gz_stream. Return a zlib error code.
-   Try freeing in the reverse order of allocations.
- */
-local int destroy (s)
-    gz_stream *s;
-{
-    int err = Z_OK;
-
-    if (!s) return Z_STREAM_ERROR;
-
-    TRYFREE(s->msg);
-
-    if (s->stream.state != NULL) {
-       if (s->mode == 'w') {
-#ifdef NO_DEFLATE
-           err = Z_STREAM_ERROR;
-#else
-           err = deflateEnd(&(s->stream));
-#endif
-       } else if (s->mode == 'r') {
-           err = inflateEnd(&(s->stream));
-       }
-    }
-    if (s->file != NULL && fclose(s->file)) {
-#ifdef ESPIPE
-       if (errno != ESPIPE) /* fclose is broken for pipes in HP/UX */
-#endif
-           err = Z_ERRNO;
-    }
-    if (s->z_err < 0) err = s->z_err;
-
-    TRYFREE(s->inbuf);
-    TRYFREE(s->outbuf);
-    TRYFREE(s->path);
-    TRYFREE(s);
-    return err;
-}
-
-/* ===========================================================================
-     Reads the given number of uncompressed bytes from the compressed file.
-   gzread returns the number of bytes actually read (0 for end of file).
-*/
-int ZEXPORT gzread (file, buf, len)
-    gzFile file;
-    voidp buf;
-    unsigned len;
-{
-    gz_stream *s = (gz_stream*)file;
-    Bytef *start = (Bytef*)buf; /* starting point for crc computation */
-    Byte  *next_out; /* == stream.next_out but not forced far (for MSDOS) */
-
-    if (s == NULL || s->mode != 'r') return Z_STREAM_ERROR;
-
-    if (s->z_err == Z_DATA_ERROR || s->z_err == Z_ERRNO) return -1;
-    if (s->z_err == Z_STREAM_END) return 0;  /* EOF */
-
-    next_out = (Byte*)buf;
-    s->stream.next_out = (Bytef*)buf;
-    s->stream.avail_out = len;
-
-    while (s->stream.avail_out != 0) {
-
-       if (s->transparent) {
-           /* Copy first the lookahead bytes: */
-           uInt n = s->stream.avail_in;
-           if (n > s->stream.avail_out) n = s->stream.avail_out;
-           if (n > 0) {
-               zmemcpy(s->stream.next_out, s->stream.next_in, n);
-               next_out += n;
-               s->stream.next_out = next_out;
-               s->stream.next_in   += n;
-               s->stream.avail_out -= n;
-               s->stream.avail_in  -= n;
-           }
-           if (s->stream.avail_out > 0) {
-               s->stream.avail_out -= fread(next_out, 1, s->stream.avail_out,
-                                            s->file);
-           }
-           len -= s->stream.avail_out;
-           s->stream.total_in  += (uLong)len;
-           s->stream.total_out += (uLong)len;
-            if (len == 0) s->z_eof = 1;
-           return (int)len;
-       }
-        if (s->stream.avail_in == 0 && !s->z_eof) {
-
-            errno = 0;
-            s->stream.avail_in = fread(s->inbuf, 1, Z_BUFSIZE, s->file);
-            if (s->stream.avail_in == 0) {
-                s->z_eof = 1;
-               if (ferror(s->file)) {
-                   s->z_err = Z_ERRNO;
-                   break;
-               }
-            }
-            s->stream.next_in = s->inbuf;
-        }
-        s->z_err = inflate(&(s->stream), Z_NO_FLUSH);
-
-       if (s->z_err == Z_STREAM_END) {
-           /* Check CRC and original size */
-           s->crc = crc32(s->crc, start, (uInt)(s->stream.next_out - start));
-           start = s->stream.next_out;
-
-           if (getLong(s) != s->crc) {
-               s->z_err = Z_DATA_ERROR;
-           } else {
-               (void)getLong(s);
-                /* The uncompressed length returned by above getlong() may
-                 * be different from s->stream.total_out) in case of
-                * concatenated .gz files. Check for such files:
-                */
-               check_header(s);
-               if (s->z_err == Z_OK) {
-                   uLong total_in = s->stream.total_in;
-                   uLong total_out = s->stream.total_out;
-
-                   inflateReset(&(s->stream));
-                   s->stream.total_in = total_in;
-                   s->stream.total_out = total_out;
-                   s->crc = crc32(0L, Z_NULL, 0);
-               }
-           }
-       }
-       if (s->z_err != Z_OK || s->z_eof) break;
-    }
-    s->crc = crc32(s->crc, start, (uInt)(s->stream.next_out - start));
-
-    return (int)(len - s->stream.avail_out);
-}
-
-
-/* ===========================================================================
-      Reads one byte from the compressed file. gzgetc returns this byte
-   or -1 in case of end of file or error.
-*/
-int ZEXPORT gzgetc(file)
-    gzFile file;
-{
-    unsigned char c;
-
-    return gzread(file, &c, 1) == 1 ? c : -1;
-}
-
-
-/* ===========================================================================
-      Reads bytes from the compressed file until len-1 characters are
-   read, or a newline character is read and transferred to buf, or an
-   end-of-file condition is encountered.  The string is then terminated
-   with a null character.
-      gzgets returns buf, or Z_NULL in case of error.
-
-      The current implementation is not optimized at all.
-*/
-char * ZEXPORT gzgets(file, buf, len)
-    gzFile file;
-    char *buf;
-    int len;
-{
-    char *b = buf;
-    if (buf == Z_NULL || len <= 0) return Z_NULL;
-
-    while (--len > 0 && gzread(file, buf, 1) == 1 && *buf++ != '\n') ;
-    *buf = '\0';
-    return b == buf && len > 0 ? Z_NULL : b;
-}
-
-
-#ifndef NO_DEFLATE
-/* ===========================================================================
-     Writes the given number of uncompressed bytes into the compressed file.
-   gzwrite returns the number of bytes actually written (0 in case of error).
-*/
-int ZEXPORT gzwrite (file, buf, len)
-    gzFile file;
-    const voidp buf;
-    unsigned len;
-{
-    gz_stream *s = (gz_stream*)file;
-
-    if (s == NULL || s->mode != 'w') return Z_STREAM_ERROR;
-
-    s->stream.next_in = (Bytef*)buf;
-    s->stream.avail_in = len;
-
-    while (s->stream.avail_in != 0) {
-
-        if (s->stream.avail_out == 0) {
-
-            s->stream.next_out = s->outbuf;
-            if (fwrite(s->outbuf, 1, Z_BUFSIZE, s->file) != Z_BUFSIZE) {
-                s->z_err = Z_ERRNO;
-                break;
-            }
-            s->stream.avail_out = Z_BUFSIZE;
-        }
-        s->z_err = deflate(&(s->stream), Z_NO_FLUSH);
-        if (s->z_err != Z_OK) break;
-    }
-    s->crc = crc32(s->crc, (const Bytef *)buf, len);
-
-    return (int)(len - s->stream.avail_in);
-}
-
-/* ===========================================================================
-     Converts, formats, and writes the args to the compressed file under
-   control of the format string, as in fprintf. gzprintf returns the number of
-   uncompressed bytes actually written (0 in case of error).
-*/
-#ifdef STDC
-#include <stdarg.h>
-
-int ZEXPORTVA gzprintf (gzFile file, const char *format, /* args */ ...)
-{
-    char buf[Z_PRINTF_BUFSIZE];
-    va_list va;
-    int len;
-
-    va_start(va, format);
-#ifdef HAS_vsnprintf
-    (void)vsnprintf(buf, sizeof(buf), format, va);
-#else
-    (void)vsprintf(buf, format, va);
-#endif
-    va_end(va);
-    len = strlen(buf); /* some *sprintf don't return the nb of bytes written */
-    if (len <= 0) return 0;
-
-    return gzwrite(file, buf, (unsigned)len);
-}
-#else /* not ANSI C */
-
-int ZEXPORTVA gzprintf (file, format, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10,
-                      a11, a12, a13, a14, a15, a16, a17, a18, a19, a20)
-    gzFile file;
-    const char *format;
-    int a1, a2, a3, a4, a5, a6, a7, a8, a9, a10,
-       a11, a12, a13, a14, a15, a16, a17, a18, a19, a20;
-{
-    char buf[Z_PRINTF_BUFSIZE];
-    int len;
-
-#ifdef HAS_snprintf
-    snprintf(buf, sizeof(buf), format, a1, a2, a3, a4, a5, a6, a7, a8,
-            a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19, a20);
-#else
-    sprintf(buf, format, a1, a2, a3, a4, a5, a6, a7, a8,
-           a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19, a20);
-#endif
-    len = strlen(buf); /* old sprintf doesn't return the nb of bytes written */
-    if (len <= 0) return 0;
-
-    return gzwrite(file, buf, len);
-}
-#endif
-
-/* ===========================================================================
-      Writes c, converted to an unsigned char, into the compressed file.
-   gzputc returns the value that was written, or -1 in case of error.
-*/
-int ZEXPORT gzputc(file, c)
-    gzFile file;
-    int c;
-{
-    unsigned char cc = (unsigned char) c; /* required for big endian systems */
-
-    return gzwrite(file, &cc, 1) == 1 ? (int)cc : -1;
-}
-
-
-/* ===========================================================================
-      Writes the given null-terminated string to the compressed file, excluding
-   the terminating null character.
-      gzputs returns the number of characters written, or -1 in case of error.
-*/
-int ZEXPORT gzputs(file, s)
-    gzFile file;
-    const char *s;
-{
-    return gzwrite(file, (char*)s, (unsigned)strlen(s));
-}
-
-
-/* ===========================================================================
-     Flushes all pending output into the compressed file. The parameter
-   flush is as in the deflate() function.
-*/
-local int do_flush (file, flush)
-    gzFile file;
-    int flush;
-{
-    uInt len;
-    int done = 0;
-    gz_stream *s = (gz_stream*)file;
-
-    if (s == NULL || s->mode != 'w') return Z_STREAM_ERROR;
-
-    s->stream.avail_in = 0; /* should be zero already anyway */
-
-    for (;;) {
-        len = Z_BUFSIZE - s->stream.avail_out;
-
-        if (len != 0) {
-            if ((uInt)fwrite(s->outbuf, 1, len, s->file) != len) {
-                s->z_err = Z_ERRNO;
-                return Z_ERRNO;
-            }
-            s->stream.next_out = s->outbuf;
-            s->stream.avail_out = Z_BUFSIZE;
-        }
-        if (done) break;
-        s->z_err = deflate(&(s->stream), flush);
-
-       /* Ignore the second of two consecutive flushes: */
-       if (len == 0 && s->z_err == Z_BUF_ERROR) s->z_err = Z_OK;
-
-        /* deflate has finished flushing only when it hasn't used up
-         * all the available space in the output buffer: 
-         */
-        done = (s->stream.avail_out != 0 || s->z_err == Z_STREAM_END);
-        if (s->z_err != Z_OK && s->z_err != Z_STREAM_END) break;
-    }
-    return  s->z_err == Z_STREAM_END ? Z_OK : s->z_err;
-}
-
-int ZEXPORT gzflush (file, flush)
-     gzFile file;
-     int flush;
-{
-    gz_stream *s = (gz_stream*)file;
-    int err = do_flush (file, flush);
-
-    if (err) return err;
-    fflush(s->file);
-    return  s->z_err == Z_STREAM_END ? Z_OK : s->z_err;
-}
-#endif /* NO_DEFLATE */
-
-/* ===========================================================================
-      Sets the starting position for the next gzread or gzwrite on the given
-   compressed file. The offset represents a number of bytes in the
-      gzseek returns the resulting offset location as measured in bytes from
-   the beginning of the uncompressed stream, or -1 in case of error.
-      SEEK_END is not implemented, returns error.
-      In this version of the library, gzseek can be extremely slow.
-*/
-z_off_t ZEXPORT gzseek (file, offset, whence)
-    gzFile file;
-    z_off_t offset;
-    int whence;
-{
-    gz_stream *s = (gz_stream*)file;
-
-    if (s == NULL || whence == SEEK_END ||
-       s->z_err == Z_ERRNO || s->z_err == Z_DATA_ERROR) {
-       return -1L;
-    }
-    
-    if (s->mode == 'w') {
-#ifdef NO_DEFLATE
-       return -1L;
-#else
-       if (whence == SEEK_SET) {
-           offset -= s->stream.total_in;
-       }
-       if (offset < 0) return -1L;
-
-       /* At this point, offset is the number of zero bytes to write. */
-       if (s->inbuf == Z_NULL) {
-           s->inbuf = (Byte*)ALLOC(Z_BUFSIZE); /* for seeking */
-           zmemzero(s->inbuf, Z_BUFSIZE);
-       }
-       while (offset > 0)  {
-           uInt size = Z_BUFSIZE;
-           if (offset < Z_BUFSIZE) size = (uInt)offset;
-
-           size = gzwrite(file, s->inbuf, size);
-           if (size == 0) return -1L;
-
-           offset -= size;
-       }
-       return (z_off_t)s->stream.total_in;
-#endif
-    }
-    /* Rest of function is for reading only */
-
-    /* compute absolute position */
-    if (whence == SEEK_CUR) {
-       offset += s->stream.total_out;
-    }
-    if (offset < 0) return -1L;
-
-    if (s->transparent) {
-       /* map to fseek */
-       s->stream.avail_in = 0;
-       s->stream.next_in = s->inbuf;
-        if (fseek(s->file, offset, SEEK_SET) < 0) return -1L;
-
-       s->stream.total_in = s->stream.total_out = (uLong)offset;
-       return offset;
-    }
-
-    /* For a negative seek, rewind and use positive seek */
-    if ((uLong)offset >= s->stream.total_out) {
-       offset -= s->stream.total_out;
-    } else if (gzrewind(file) < 0) {
-       return -1L;
-    }
-    /* offset is now the number of bytes to skip. */
-
-    if (offset != 0 && s->outbuf == Z_NULL) {
-       s->outbuf = (Byte*)ALLOC(Z_BUFSIZE);
-    }
-    while (offset > 0)  {
-       int size = Z_BUFSIZE;
-       if (offset < Z_BUFSIZE) size = (int)offset;
-
-       size = gzread(file, s->outbuf, (uInt)size);
-       if (size <= 0) return -1L;
-       offset -= size;
-    }
-    return (z_off_t)s->stream.total_out;
-}
-
-/* ===========================================================================
-     Rewinds input file. 
-*/
-int ZEXPORT gzrewind (file)
-    gzFile file;
-{
-    gz_stream *s = (gz_stream*)file;
-    
-    if (s == NULL || s->mode != 'r') return -1;
-
-    s->z_err = Z_OK;
-    s->z_eof = 0;
-    s->stream.avail_in = 0;
-    s->stream.next_in = s->inbuf;
-    s->crc = crc32(0L, Z_NULL, 0);
-       
-    if (s->startpos == 0) { /* not a compressed file */
-       rewind(s->file);
-       return 0;
-    }
-
-    (void) inflateReset(&s->stream);
-    return fseek(s->file, s->startpos, SEEK_SET);
-}
-
-/* ===========================================================================
-     Returns the starting position for the next gzread or gzwrite on the
-   given compressed file. This position represents a number of bytes in the
-   uncompressed data stream.
-*/
-z_off_t ZEXPORT gztell (file)
-    gzFile file;
-{
-    return gzseek(file, 0L, SEEK_CUR);
-}
-
-/* ===========================================================================
-     Returns 1 when EOF has previously been detected reading the given
-   input stream, otherwise zero.
-*/
-int ZEXPORT gzeof (file)
-    gzFile file;
-{
-    gz_stream *s = (gz_stream*)file;
-    
-    return (s == NULL || s->mode != 'r') ? 0 : s->z_eof;
-}
-
-/* ===========================================================================
-   Outputs a long in LSB order to the given file
-*/
-local void putLong (file, x)
-    FILE *file;
-    uLong x;
-{
-    int n;
-    for (n = 0; n < 4; n++) {
-        fputc((int)(x & 0xff), file);
-        x >>= 8;
-    }
-}
-
-/* ===========================================================================
-   Reads a long in LSB order from the given gz_stream. Sets z_err in case
-   of error.
-*/
-local uLong getLong (s)
-    gz_stream *s;
-{
-    uLong x = (uLong)get_byte(s);
-    int c;
-
-    x += ((uLong)get_byte(s))<<8;
-    x += ((uLong)get_byte(s))<<16;
-    c = get_byte(s);
-    if (c == EOF) s->z_err = Z_DATA_ERROR;
-    x += ((uLong)c)<<24;
-    return x;
-}
-
-/* ===========================================================================
-     Flushes all pending output if necessary, closes the compressed file
-   and deallocates all the (de)compression state.
-*/
-int ZEXPORT gzclose (file)
-    gzFile file;
-{
-    int err;
-    gz_stream *s = (gz_stream*)file;
-
-    if (s == NULL) return Z_STREAM_ERROR;
-
-    if (s->mode == 'w') {
-#ifdef NO_DEFLATE
-       return Z_STREAM_ERROR;
-#else
-        err = do_flush (file, Z_FINISH);
-        if (err != Z_OK) return destroy((gz_stream*)file);
-
-        putLong (s->file, s->crc);
-        putLong (s->file, s->stream.total_in);
-#endif
-    }
-    return destroy((gz_stream*)file);
-}
-
-/* ===========================================================================
-     Returns the error message for the last error which occured on the
-   given compressed file. errnum is set to zlib error number. If an
-   error occured in the file system and not in the compression library,
-   errnum is set to Z_ERRNO and the application may consult errno
-   to get the exact error code.
-*/
-const char*  ZEXPORT gzerror (file, errnum)
-    gzFile file;
-    int *errnum;
-{
-    char *m;
-    gz_stream *s = (gz_stream*)file;
-
-    if (s == NULL) {
-        *errnum = Z_STREAM_ERROR;
-        return (const char*)ERR_MSG(Z_STREAM_ERROR);
-    }
-    *errnum = s->z_err;
-    if (*errnum == Z_OK) return (const char*)"";
-
-    m =  (char*)(*errnum == Z_ERRNO ? zstrerror(errno) : s->stream.msg);
-
-    if (m == NULL || *m == '\0') m = (char*)ERR_MSG(s->z_err);
-
-    TRYFREE(s->msg);
-    s->msg = (char*)ALLOC(strlen(s->path) + strlen(m) + 3);
-    strcpy(s->msg, s->path);
-    strcat(s->msg, ": ");
-    strcat(s->msg, m);
-    return (const char*)s->msg;
-}
diff --git a/lib/zlib/infblock.c b/lib/zlib/infblock.c
deleted file mode 100644 (file)
index dd7a6d4..0000000
+++ /dev/null
@@ -1,403 +0,0 @@
-/* infblock.c -- interpret and process block types to last block
- * Copyright (C) 1995-2002 Mark Adler
- * For conditions of distribution and use, see copyright notice in zlib.h 
- */
-
-#include "zutil.h"
-#include "infblock.h"
-#include "inftrees.h"
-#include "infcodes.h"
-#include "infutil.h"
-
-struct inflate_codes_state {int dummy;}; /* for buggy compilers */
-
-/* simplify the use of the inflate_huft type with some defines */
-#define exop word.what.Exop
-#define bits word.what.Bits
-
-/* Table for deflate from PKZIP's appnote.txt. */
-local const uInt border[] = { /* Order of the bit length code lengths */
-        16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15};
-
-/*
-   Notes beyond the 1.93a appnote.txt:
-
-   1. Distance pointers never point before the beginning of the output
-      stream.
-   2. Distance pointers can point back across blocks, up to 32k away.
-   3. There is an implied maximum of 7 bits for the bit length table and
-      15 bits for the actual data.
-   4. If only one code exists, then it is encoded using one bit.  (Zero
-      would be more efficient, but perhaps a little confusing.)  If two
-      codes exist, they are coded using one bit each (0 and 1).
-   5. There is no way of sending zero distance codes--a dummy must be
-      sent if there are none.  (History: a pre 2.0 version of PKZIP would
-      store blocks with no distance codes, but this was discovered to be
-      too harsh a criterion.)  Valid only for 1.93a.  2.04c does allow
-      zero distance codes, which is sent as one code of zero bits in
-      length.
-   6. There are up to 286 literal/length codes.  Code 256 represents the
-      end-of-block.  Note however that the static length tree defines
-      288 codes just to fill out the Huffman codes.  Codes 286 and 287
-      cannot be used though, since there is no length base or extra bits
-      defined for them.  Similarily, there are up to 30 distance codes.
-      However, static trees define 32 codes (all 5 bits) to fill out the
-      Huffman codes, but the last two had better not show up in the data.
-   7. Unzip can check dynamic Huffman blocks for complete code sets.
-      The exception is that a single code would not be complete (see #4).
-   8. The five bits following the block type is really the number of
-      literal codes sent minus 257.
-   9. Length codes 8,16,16 are interpreted as 13 length codes of 8 bits
-      (1+6+6).  Therefore, to output three times the length, you output
-      three codes (1+1+1), whereas to output four times the same length,
-      you only need two codes (1+3).  Hmm.
-  10. In the tree reconstruction algorithm, Code = Code + Increment
-      only if BitLength(i) is not zero.  (Pretty obvious.)
-  11. Correction: 4 Bits: # of Bit Length codes - 4     (4 - 19)
-  12. Note: length code 284 can represent 227-258, but length code 285
-      really is 258.  The last length deserves its own, short code
-      since it gets used a lot in very redundant files.  The length
-      258 is special since 258 - 3 (the min match length) is 255.
-  13. The literal/length and distance code bit lengths are read as a
-      single stream of lengths.  It is possible (and advantageous) for
-      a repeat code (16, 17, or 18) to go across the boundary between
-      the two sets of lengths.
- */
-
-
-void inflate_blocks_reset(s, z, c)
-inflate_blocks_statef *s;
-z_streamp z;
-uLongf *c;
-{
-  if (c != Z_NULL)
-    *c = s->check;
-  if (s->mode == BTREE || s->mode == DTREE)
-    ZFREE(z, s->sub.trees.blens);
-  if (s->mode == CODES)
-    inflate_codes_free(s->sub.decode.codes, z);
-  s->mode = TYPE;
-  s->bitk = 0;
-  s->bitb = 0;
-  s->read = s->write = s->window;
-  if (s->checkfn != Z_NULL)
-    z->adler = s->check = (*s->checkfn)(0L, (const Bytef *)Z_NULL, 0);
-  Tracev((stderr, "inflate:   blocks reset\n"));
-}
-
-
-inflate_blocks_statef *inflate_blocks_new(z, c, w)
-z_streamp z;
-check_func c;
-uInt w;
-{
-  inflate_blocks_statef *s;
-
-  if ((s = (inflate_blocks_statef *)ZALLOC
-       (z,1,sizeof(struct inflate_blocks_state))) == Z_NULL)
-    return s;
-  if ((s->hufts =
-       (inflate_huft *)ZALLOC(z, sizeof(inflate_huft), MANY)) == Z_NULL)
-  {
-    ZFREE(z, s);
-    return Z_NULL;
-  }
-  if ((s->window = (Bytef *)ZALLOC(z, 1, w)) == Z_NULL)
-  {
-    ZFREE(z, s->hufts);
-    ZFREE(z, s);
-    return Z_NULL;
-  }
-  s->end = s->window + w;
-  s->checkfn = c;
-  s->mode = TYPE;
-  Tracev((stderr, "inflate:   blocks allocated\n"));
-  inflate_blocks_reset(s, z, Z_NULL);
-  return s;
-}
-
-
-int inflate_blocks(s, z, r)
-inflate_blocks_statef *s;
-z_streamp z;
-int r;
-{
-  uInt t;               /* temporary storage */
-  uLong b;              /* bit buffer */
-  uInt k;               /* bits in bit buffer */
-  Bytef *p;             /* input data pointer */
-  uInt n;               /* bytes available there */
-  Bytef *q;             /* output window write pointer */
-  uInt m;               /* bytes to end of window or read pointer */
-
-  /* copy input/output information to locals (UPDATE macro restores) */
-  LOAD
-
-  /* process input based on current state */
-  while (1) switch (s->mode)
-  {
-    case TYPE:
-      NEEDBITS(3)
-      t = (uInt)b & 7;
-      s->last = t & 1;
-      switch (t >> 1)
-      {
-        case 0:                         /* stored */
-          Tracev((stderr, "inflate:     stored block%s\n",
-                 s->last ? " (last)" : ""));
-          DUMPBITS(3)
-          t = k & 7;                    /* go to byte boundary */
-          DUMPBITS(t)
-          s->mode = LENS;               /* get length of stored block */
-          break;
-        case 1:                         /* fixed */
-          Tracev((stderr, "inflate:     fixed codes block%s\n",
-                 s->last ? " (last)" : ""));
-          {
-            uInt bl, bd;
-            inflate_huft *tl, *td;
-
-            inflate_trees_fixed(&bl, &bd, &tl, &td, z);
-            s->sub.decode.codes = inflate_codes_new(bl, bd, tl, td, z);
-            if (s->sub.decode.codes == Z_NULL)
-            {
-              r = Z_MEM_ERROR;
-              LEAVE
-            }
-          }
-          DUMPBITS(3)
-          s->mode = CODES;
-          break;
-        case 2:                         /* dynamic */
-          Tracev((stderr, "inflate:     dynamic codes block%s\n",
-                 s->last ? " (last)" : ""));
-          DUMPBITS(3)
-          s->mode = TABLE;
-          break;
-        case 3:                         /* illegal */
-          DUMPBITS(3)
-          s->mode = BAD;
-          z->msg = (char*)"invalid block type";
-          r = Z_DATA_ERROR;
-          LEAVE
-      }
-      break;
-    case LENS:
-      NEEDBITS(32)
-      if ((((~b) >> 16) & 0xffff) != (b & 0xffff))
-      {
-        s->mode = BAD;
-        z->msg = (char*)"invalid stored block lengths";
-        r = Z_DATA_ERROR;
-        LEAVE
-      }
-      s->sub.left = (uInt)b & 0xffff;
-      b = k = 0;                      /* dump bits */
-      Tracev((stderr, "inflate:       stored length %u\n", s->sub.left));
-      s->mode = s->sub.left ? STORED : (s->last ? DRY : TYPE);
-      break;
-    case STORED:
-      if (n == 0)
-        LEAVE
-      NEEDOUT
-      t = s->sub.left;
-      if (t > n) t = n;
-      if (t > m) t = m;
-      zmemcpy(q, p, t);
-      p += t;  n -= t;
-      q += t;  m -= t;
-      if ((s->sub.left -= t) != 0)
-        break;
-      Tracev((stderr, "inflate:       stored end, %lu total out\n",
-              z->total_out + (q >= s->read ? q - s->read :
-              (s->end - s->read) + (q - s->window))));
-      s->mode = s->last ? DRY : TYPE;
-      break;
-    case TABLE:
-      NEEDBITS(14)
-      s->sub.trees.table = t = (uInt)b & 0x3fff;
-#ifndef PKZIP_BUG_WORKAROUND
-      if ((t & 0x1f) > 29 || ((t >> 5) & 0x1f) > 29)
-      {
-        s->mode = BAD;
-        z->msg = (char*)"too many length or distance symbols";
-        r = Z_DATA_ERROR;
-        LEAVE
-      }
-#endif
-      t = 258 + (t & 0x1f) + ((t >> 5) & 0x1f);
-      if ((s->sub.trees.blens = (uIntf*)ZALLOC(z, t, sizeof(uInt))) == Z_NULL)
-      {
-        r = Z_MEM_ERROR;
-        LEAVE
-      }
-      DUMPBITS(14)
-      s->sub.trees.index = 0;
-      Tracev((stderr, "inflate:       table sizes ok\n"));
-      s->mode = BTREE;
-    case BTREE:
-      while (s->sub.trees.index < 4 + (s->sub.trees.table >> 10))
-      {
-        NEEDBITS(3)
-        s->sub.trees.blens[border[s->sub.trees.index++]] = (uInt)b & 7;
-        DUMPBITS(3)
-      }
-      while (s->sub.trees.index < 19)
-        s->sub.trees.blens[border[s->sub.trees.index++]] = 0;
-      s->sub.trees.bb = 7;
-      t = inflate_trees_bits(s->sub.trees.blens, &s->sub.trees.bb,
-                             &s->sub.trees.tb, s->hufts, z);
-      if (t != Z_OK)
-      {
-        r = t;
-        if (r == Z_DATA_ERROR)
-        {
-          ZFREE(z, s->sub.trees.blens);
-          s->mode = BAD;
-        }
-        LEAVE
-      }
-      s->sub.trees.index = 0;
-      Tracev((stderr, "inflate:       bits tree ok\n"));
-      s->mode = DTREE;
-    case DTREE:
-      while (t = s->sub.trees.table,
-             s->sub.trees.index < 258 + (t & 0x1f) + ((t >> 5) & 0x1f))
-      {
-        inflate_huft *h;
-        uInt i, j, c;
-
-        t = s->sub.trees.bb;
-        NEEDBITS(t)
-        h = s->sub.trees.tb + ((uInt)b & inflate_mask[t]);
-        t = h->bits;
-        c = h->base;
-        if (c < 16)
-        {
-          DUMPBITS(t)
-          s->sub.trees.blens[s->sub.trees.index++] = c;
-        }
-        else /* c == 16..18 */
-        {
-          i = c == 18 ? 7 : c - 14;
-          j = c == 18 ? 11 : 3;
-          NEEDBITS(t + i)
-          DUMPBITS(t)
-          j += (uInt)b & inflate_mask[i];
-          DUMPBITS(i)
-          i = s->sub.trees.index;
-          t = s->sub.trees.table;
-          if (i + j > 258 + (t & 0x1f) + ((t >> 5) & 0x1f) ||
-              (c == 16 && i < 1))
-          {
-            ZFREE(z, s->sub.trees.blens);
-            s->mode = BAD;
-            z->msg = (char*)"invalid bit length repeat";
-            r = Z_DATA_ERROR;
-            LEAVE
-          }
-          c = c == 16 ? s->sub.trees.blens[i - 1] : 0;
-          do {
-            s->sub.trees.blens[i++] = c;
-          } while (--j);
-          s->sub.trees.index = i;
-        }
-      }
-      s->sub.trees.tb = Z_NULL;
-      {
-        uInt bl, bd;
-        inflate_huft *tl, *td;
-        inflate_codes_statef *c;
-
-        bl = 9;         /* must be <= 9 for lookahead assumptions */
-        bd = 6;         /* must be <= 9 for lookahead assumptions */
-        t = s->sub.trees.table;
-        t = inflate_trees_dynamic(257 + (t & 0x1f), 1 + ((t >> 5) & 0x1f),
-                                  s->sub.trees.blens, &bl, &bd, &tl, &td,
-                                  s->hufts, z);
-        if (t != Z_OK)
-        {
-          if (t == (uInt)Z_DATA_ERROR)
-          {
-            ZFREE(z, s->sub.trees.blens);
-            s->mode = BAD;
-          }
-          r = t;
-          LEAVE
-        }
-        Tracev((stderr, "inflate:       trees ok\n"));
-        if ((c = inflate_codes_new(bl, bd, tl, td, z)) == Z_NULL)
-        {
-          r = Z_MEM_ERROR;
-          LEAVE
-        }
-        s->sub.decode.codes = c;
-      }
-      ZFREE(z, s->sub.trees.blens);
-      s->mode = CODES;
-    case CODES:
-      UPDATE
-      if ((r = inflate_codes(s, z, r)) != Z_STREAM_END)
-        return inflate_flush(s, z, r);
-      r = Z_OK;
-      inflate_codes_free(s->sub.decode.codes, z);
-      LOAD
-      Tracev((stderr, "inflate:       codes end, %lu total out\n",
-              z->total_out + (q >= s->read ? q - s->read :
-              (s->end - s->read) + (q - s->window))));
-      if (!s->last)
-      {
-        s->mode = TYPE;
-        break;
-      }
-      s->mode = DRY;
-    case DRY:
-      FLUSH
-      if (s->read != s->write)
-        LEAVE
-      s->mode = DONE;
-    case DONE:
-      r = Z_STREAM_END;
-      LEAVE
-    case BAD:
-      r = Z_DATA_ERROR;
-      LEAVE
-    default:
-      r = Z_STREAM_ERROR;
-      LEAVE
-  }
-}
-
-
-int inflate_blocks_free(s, z)
-inflate_blocks_statef *s;
-z_streamp z;
-{
-  inflate_blocks_reset(s, z, Z_NULL);
-  ZFREE(z, s->window);
-  ZFREE(z, s->hufts);
-  ZFREE(z, s);
-  Tracev((stderr, "inflate:   blocks freed\n"));
-  return Z_OK;
-}
-
-
-void inflate_set_dictionary(s, d, n)
-inflate_blocks_statef *s;
-const Bytef *d;
-uInt  n;
-{
-  zmemcpy(s->window, d, n);
-  s->read = s->write = s->window + n;
-}
-
-
-/* Returns true if inflate is currently at the end of a block generated
- * by Z_SYNC_FLUSH or Z_FULL_FLUSH. 
- * IN assertion: s != Z_NULL
- */
-int inflate_blocks_sync_point(s)
-inflate_blocks_statef *s;
-{
-  return s->mode == LENS;
-}
diff --git a/lib/zlib/infblock.h b/lib/zlib/infblock.h
deleted file mode 100644 (file)
index 173b226..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-/* infblock.h -- header to use infblock.c
- * Copyright (C) 1995-2002 Mark Adler
- * For conditions of distribution and use, see copyright notice in zlib.h 
- */
-
-/* WARNING: this file should *not* be used by applications. It is
-   part of the implementation of the compression library and is
-   subject to change. Applications should only use zlib.h.
- */
-
-struct inflate_blocks_state;
-typedef struct inflate_blocks_state FAR inflate_blocks_statef;
-
-extern inflate_blocks_statef * inflate_blocks_new OF((
-    z_streamp z,
-    check_func c,               /* check function */
-    uInt w));                   /* window size */
-
-extern int inflate_blocks OF((
-    inflate_blocks_statef *,
-    z_streamp ,
-    int));                      /* initial return code */
-
-extern void inflate_blocks_reset OF((
-    inflate_blocks_statef *,
-    z_streamp ,
-    uLongf *));                  /* check value on output */
-
-extern int inflate_blocks_free OF((
-    inflate_blocks_statef *,
-    z_streamp));
-
-extern void inflate_set_dictionary OF((
-    inflate_blocks_statef *s,
-    const Bytef *d,  /* dictionary */
-    uInt  n));       /* dictionary length */
-
-extern int inflate_blocks_sync_point OF((
-    inflate_blocks_statef *s));
diff --git a/lib/zlib/infcodes.c b/lib/zlib/infcodes.c
deleted file mode 100644 (file)
index 9abe541..0000000
+++ /dev/null
@@ -1,251 +0,0 @@
-/* infcodes.c -- process literals and length/distance pairs
- * Copyright (C) 1995-2002 Mark Adler
- * For conditions of distribution and use, see copyright notice in zlib.h 
- */
-
-#include "zutil.h"
-#include "inftrees.h"
-#include "infblock.h"
-#include "infcodes.h"
-#include "infutil.h"
-#include "inffast.h"
-
-/* simplify the use of the inflate_huft type with some defines */
-#define exop word.what.Exop
-#define bits word.what.Bits
-
-typedef enum {        /* waiting for "i:"=input, "o:"=output, "x:"=nothing */
-      START,    /* x: set up for LEN */
-      LEN,      /* i: get length/literal/eob next */
-      LENEXT,   /* i: getting length extra (have base) */
-      DIST,     /* i: get distance next */
-      DISTEXT,  /* i: getting distance extra */
-      COPY,     /* o: copying bytes in window, waiting for space */
-      LIT,      /* o: got literal, waiting for output space */
-      WASH,     /* o: got eob, possibly still output waiting */
-      END,      /* x: got eob and all data flushed */
-      BADCODE}  /* x: got error */
-inflate_codes_mode;
-
-/* inflate codes private state */
-struct inflate_codes_state {
-
-  /* mode */
-  inflate_codes_mode mode;      /* current inflate_codes mode */
-
-  /* mode dependent information */
-  uInt len;
-  union {
-    struct {
-      inflate_huft *tree;       /* pointer into tree */
-      uInt need;                /* bits needed */
-    } code;             /* if LEN or DIST, where in tree */
-    uInt lit;           /* if LIT, literal */
-    struct {
-      uInt get;                 /* bits to get for extra */
-      uInt dist;                /* distance back to copy from */
-    } copy;             /* if EXT or COPY, where and how much */
-  } sub;                /* submode */
-
-  /* mode independent information */
-  Byte lbits;           /* ltree bits decoded per branch */
-  Byte dbits;           /* dtree bits decoder per branch */
-  inflate_huft *ltree;          /* literal/length/eob tree */
-  inflate_huft *dtree;          /* distance tree */
-
-};
-
-
-inflate_codes_statef *inflate_codes_new(bl, bd, tl, td, z)
-uInt bl, bd;
-inflate_huft *tl;
-inflate_huft *td; /* need separate declaration for Borland C++ */
-z_streamp z;
-{
-  inflate_codes_statef *c;
-
-  if ((c = (inflate_codes_statef *)
-       ZALLOC(z,1,sizeof(struct inflate_codes_state))) != Z_NULL)
-  {
-    c->mode = START;
-    c->lbits = (Byte)bl;
-    c->dbits = (Byte)bd;
-    c->ltree = tl;
-    c->dtree = td;
-    Tracev((stderr, "inflate:       codes new\n"));
-  }
-  return c;
-}
-
-
-int inflate_codes(s, z, r)
-inflate_blocks_statef *s;
-z_streamp z;
-int r;
-{
-  uInt j;               /* temporary storage */
-  inflate_huft *t;      /* temporary pointer */
-  uInt e;               /* extra bits or operation */
-  uLong b;              /* bit buffer */
-  uInt k;               /* bits in bit buffer */
-  Bytef *p;             /* input data pointer */
-  uInt n;               /* bytes available there */
-  Bytef *q;             /* output window write pointer */
-  uInt m;               /* bytes to end of window or read pointer */
-  Bytef *f;             /* pointer to copy strings from */
-  inflate_codes_statef *c = s->sub.decode.codes;  /* codes state */
-
-  /* copy input/output information to locals (UPDATE macro restores) */
-  LOAD
-
-  /* process input and output based on current state */
-  while (1) switch (c->mode)
-  {             /* waiting for "i:"=input, "o:"=output, "x:"=nothing */
-    case START:         /* x: set up for LEN */
-#ifndef SLOW
-      if (m >= 258 && n >= 10)
-      {
-        UPDATE
-        r = inflate_fast(c->lbits, c->dbits, c->ltree, c->dtree, s, z);
-        LOAD
-        if (r != Z_OK)
-        {
-          c->mode = r == Z_STREAM_END ? WASH : BADCODE;
-          break;
-        }
-      }
-#endif /* !SLOW */
-      c->sub.code.need = c->lbits;
-      c->sub.code.tree = c->ltree;
-      c->mode = LEN;
-    case LEN:           /* i: get length/literal/eob next */
-      j = c->sub.code.need;
-      NEEDBITS(j)
-      t = c->sub.code.tree + ((uInt)b & inflate_mask[j]);
-      DUMPBITS(t->bits)
-      e = (uInt)(t->exop);
-      if (e == 0)               /* literal */
-      {
-        c->sub.lit = t->base;
-        Tracevv((stderr, t->base >= 0x20 && t->base < 0x7f ?
-                 "inflate:         literal '%c'\n" :
-                 "inflate:         literal 0x%02x\n", t->base));
-        c->mode = LIT;
-        break;
-      }
-      if (e & 16)               /* length */
-      {
-        c->sub.copy.get = e & 15;
-        c->len = t->base;
-        c->mode = LENEXT;
-        break;
-      }
-      if ((e & 64) == 0)        /* next table */
-      {
-        c->sub.code.need = e;
-        c->sub.code.tree = t + t->base;
-        break;
-      }
-      if (e & 32)               /* end of block */
-      {
-        Tracevv((stderr, "inflate:         end of block\n"));
-        c->mode = WASH;
-        break;
-      }
-      c->mode = BADCODE;        /* invalid code */
-      z->msg = (char*)"invalid literal/length code";
-      r = Z_DATA_ERROR;
-      LEAVE
-    case LENEXT:        /* i: getting length extra (have base) */
-      j = c->sub.copy.get;
-      NEEDBITS(j)
-      c->len += (uInt)b & inflate_mask[j];
-      DUMPBITS(j)
-      c->sub.code.need = c->dbits;
-      c->sub.code.tree = c->dtree;
-      Tracevv((stderr, "inflate:         length %u\n", c->len));
-      c->mode = DIST;
-    case DIST:          /* i: get distance next */
-      j = c->sub.code.need;
-      NEEDBITS(j)
-      t = c->sub.code.tree + ((uInt)b & inflate_mask[j]);
-      DUMPBITS(t->bits)
-      e = (uInt)(t->exop);
-      if (e & 16)               /* distance */
-      {
-        c->sub.copy.get = e & 15;
-        c->sub.copy.dist = t->base;
-        c->mode = DISTEXT;
-        break;
-      }
-      if ((e & 64) == 0)        /* next table */
-      {
-        c->sub.code.need = e;
-        c->sub.code.tree = t + t->base;
-        break;
-      }
-      c->mode = BADCODE;        /* invalid code */
-      z->msg = (char*)"invalid distance code";
-      r = Z_DATA_ERROR;
-      LEAVE
-    case DISTEXT:       /* i: getting distance extra */
-      j = c->sub.copy.get;
-      NEEDBITS(j)
-      c->sub.copy.dist += (uInt)b & inflate_mask[j];
-      DUMPBITS(j)
-      Tracevv((stderr, "inflate:         distance %u\n", c->sub.copy.dist));
-      c->mode = COPY;
-    case COPY:          /* o: copying bytes in window, waiting for space */
-      f = q - c->sub.copy.dist;
-      while (f < s->window)             /* modulo window size-"while" instead */
-        f += s->end - s->window;        /* of "if" handles invalid distances */
-      while (c->len)
-      {
-        NEEDOUT
-        OUTBYTE(*f++)
-        if (f == s->end)
-          f = s->window;
-        c->len--;
-      }
-      c->mode = START;
-      break;
-    case LIT:           /* o: got literal, waiting for output space */
-      NEEDOUT
-      OUTBYTE(c->sub.lit)
-      c->mode = START;
-      break;
-    case WASH:          /* o: got eob, possibly more output */
-      if (k > 7)        /* return unused byte, if any */
-      {
-        Assert(k < 16, "inflate_codes grabbed too many bytes")
-        k -= 8;
-        n++;
-        p--;            /* can always return one */
-      }
-      FLUSH
-      if (s->read != s->write)
-        LEAVE
-      c->mode = END;
-    case END:
-      r = Z_STREAM_END;
-      LEAVE
-    case BADCODE:       /* x: got error */
-      r = Z_DATA_ERROR;
-      LEAVE
-    default:
-      r = Z_STREAM_ERROR;
-      LEAVE
-  }
-#ifdef NEED_DUMMY_RETURN
-  return Z_STREAM_ERROR;  /* Some dumb compilers complain without this */
-#endif
-}
-
-
-void inflate_codes_free(c, z)
-inflate_codes_statef *c;
-z_streamp z;
-{
-  ZFREE(z, c);
-  Tracev((stderr, "inflate:       codes free\n"));
-}
diff --git a/lib/zlib/infcodes.h b/lib/zlib/infcodes.h
deleted file mode 100644 (file)
index 46821a0..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-/* infcodes.h -- header to use infcodes.c
- * Copyright (C) 1995-2002 Mark Adler
- * For conditions of distribution and use, see copyright notice in zlib.h 
- */
-
-/* WARNING: this file should *not* be used by applications. It is
-   part of the implementation of the compression library and is
-   subject to change. Applications should only use zlib.h.
- */
-
-struct inflate_codes_state;
-typedef struct inflate_codes_state FAR inflate_codes_statef;
-
-extern inflate_codes_statef *inflate_codes_new OF((
-    uInt, uInt,
-    inflate_huft *, inflate_huft *,
-    z_streamp ));
-
-extern int inflate_codes OF((
-    inflate_blocks_statef *,
-    z_streamp ,
-    int));
-
-extern void inflate_codes_free OF((
-    inflate_codes_statef *,
-    z_streamp ));
-
diff --git a/lib/zlib/inffast.c b/lib/zlib/inffast.c
deleted file mode 100644 (file)
index aa7f1d4..0000000
+++ /dev/null
@@ -1,183 +0,0 @@
-/* inffast.c -- process literals and length/distance pairs fast
- * Copyright (C) 1995-2002 Mark Adler
- * For conditions of distribution and use, see copyright notice in zlib.h 
- */
-
-#include "zutil.h"
-#include "inftrees.h"
-#include "infblock.h"
-#include "infcodes.h"
-#include "infutil.h"
-#include "inffast.h"
-
-struct inflate_codes_state {int dummy;}; /* for buggy compilers */
-
-/* simplify the use of the inflate_huft type with some defines */
-#define exop word.what.Exop
-#define bits word.what.Bits
-
-/* macros for bit input with no checking and for returning unused bytes */
-#define GRABBITS(j) {while(k<(j)){b|=((uLong)NEXTBYTE)<<k;k+=8;}}
-#define UNGRAB {c=z->avail_in-n;c=(k>>3)<c?k>>3:c;n+=c;p-=c;k-=c<<3;}
-
-/* Called with number of bytes left to write in window at least 258
-   (the maximum string length) and number of input bytes available
-   at least ten.  The ten bytes are six bytes for the longest length/
-   distance pair plus four bytes for overloading the bit buffer. */
-
-int inflate_fast(bl, bd, tl, td, s, z)
-uInt bl, bd;
-inflate_huft *tl;
-inflate_huft *td; /* need separate declaration for Borland C++ */
-inflate_blocks_statef *s;
-z_streamp z;
-{
-  inflate_huft *t;      /* temporary pointer */
-  uInt e;               /* extra bits or operation */
-  uLong b;              /* bit buffer */
-  uInt k;               /* bits in bit buffer */
-  Bytef *p;             /* input data pointer */
-  uInt n;               /* bytes available there */
-  Bytef *q;             /* output window write pointer */
-  uInt m;               /* bytes to end of window or read pointer */
-  uInt ml;              /* mask for literal/length tree */
-  uInt md;              /* mask for distance tree */
-  uInt c;               /* bytes to copy */
-  uInt d;               /* distance back to copy from */
-  Bytef *r;             /* copy source pointer */
-
-  /* load input, output, bit values */
-  LOAD
-
-  /* initialize masks */
-  ml = inflate_mask[bl];
-  md = inflate_mask[bd];
-
-  /* do until not enough input or output space for fast loop */
-  do {                          /* assume called with m >= 258 && n >= 10 */
-    /* get literal/length code */
-    GRABBITS(20)                /* max bits for literal/length code */
-    if ((e = (t = tl + ((uInt)b & ml))->exop) == 0)
-    {
-      DUMPBITS(t->bits)
-      Tracevv((stderr, t->base >= 0x20 && t->base < 0x7f ?
-                "inflate:         * literal '%c'\n" :
-                "inflate:         * literal 0x%02x\n", t->base));
-      *q++ = (Byte)t->base;
-      m--;
-      continue;
-    }
-    do {
-      DUMPBITS(t->bits)
-      if (e & 16)
-      {
-        /* get extra bits for length */
-        e &= 15;
-        c = t->base + ((uInt)b & inflate_mask[e]);
-        DUMPBITS(e)
-        Tracevv((stderr, "inflate:         * length %u\n", c));
-
-        /* decode distance base of block to copy */
-        GRABBITS(15);           /* max bits for distance code */
-        e = (t = td + ((uInt)b & md))->exop;
-        do {
-          DUMPBITS(t->bits)
-          if (e & 16)
-          {
-            /* get extra bits to add to distance base */
-            e &= 15;
-            GRABBITS(e)         /* get extra bits (up to 13) */
-            d = t->base + ((uInt)b & inflate_mask[e]);
-            DUMPBITS(e)
-            Tracevv((stderr, "inflate:         * distance %u\n", d));
-
-            /* do the copy */
-            m -= c;
-            r = q - d;
-            if (r < s->window)                  /* wrap if needed */
-            {
-              do {
-                r += s->end - s->window;        /* force pointer in window */
-              } while (r < s->window);          /* covers invalid distances */
-              e = s->end - r;
-              if (c > e)
-              {
-                c -= e;                         /* wrapped copy */
-                do {
-                    *q++ = *r++;
-                } while (--e);
-                r = s->window;
-                do {
-                    *q++ = *r++;
-                } while (--c);
-              }
-              else                              /* normal copy */
-              {
-                *q++ = *r++;  c--;
-                *q++ = *r++;  c--;
-                do {
-                    *q++ = *r++;
-                } while (--c);
-              }
-            }
-            else                                /* normal copy */
-            {
-              *q++ = *r++;  c--;
-              *q++ = *r++;  c--;
-              do {
-                *q++ = *r++;
-              } while (--c);
-            }
-            break;
-          }
-          else if ((e & 64) == 0)
-          {
-            t += t->base;
-            e = (t += ((uInt)b & inflate_mask[e]))->exop;
-          }
-          else
-          {
-            z->msg = (char*)"invalid distance code";
-            UNGRAB
-            UPDATE
-            return Z_DATA_ERROR;
-          }
-        } while (1);
-        break;
-      }
-      if ((e & 64) == 0)
-      {
-        t += t->base;
-        if ((e = (t += ((uInt)b & inflate_mask[e]))->exop) == 0)
-        {
-          DUMPBITS(t->bits)
-          Tracevv((stderr, t->base >= 0x20 && t->base < 0x7f ?
-                    "inflate:         * literal '%c'\n" :
-                    "inflate:         * literal 0x%02x\n", t->base));
-          *q++ = (Byte)t->base;
-          m--;
-          break;
-        }
-      }
-      else if (e & 32)
-      {
-        Tracevv((stderr, "inflate:         * end of block\n"));
-        UNGRAB
-        UPDATE
-        return Z_STREAM_END;
-      }
-      else
-      {
-        z->msg = (char*)"invalid literal/length code";
-        UNGRAB
-        UPDATE
-        return Z_DATA_ERROR;
-      }
-    } while (1);
-  } while (m >= 258 && n >= 10);
-
-  /* not enough input or output--restore pointers and return */
-  UNGRAB
-  UPDATE
-  return Z_OK;
-}
diff --git a/lib/zlib/inffast.h b/lib/zlib/inffast.h
deleted file mode 100644 (file)
index a31a4bb..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-/* inffast.h -- header to use inffast.c
- * Copyright (C) 1995-2002 Mark Adler
- * For conditions of distribution and use, see copyright notice in zlib.h 
- */
-
-/* WARNING: this file should *not* be used by applications. It is
-   part of the implementation of the compression library and is
-   subject to change. Applications should only use zlib.h.
- */
-
-extern int inflate_fast OF((
-    uInt,
-    uInt,
-    inflate_huft *,
-    inflate_huft *,
-    inflate_blocks_statef *,
-    z_streamp ));
diff --git a/lib/zlib/inffixed.h b/lib/zlib/inffixed.h
deleted file mode 100644 (file)
index 77f7e76..0000000
+++ /dev/null
@@ -1,151 +0,0 @@
-/* inffixed.h -- table for decoding fixed codes
- * Generated automatically by the maketree.c program
- */
-
-/* WARNING: this file should *not* be used by applications. It is
-   part of the implementation of the compression library and is
-   subject to change. Applications should only use zlib.h.
- */
-
-local uInt fixed_bl = 9;
-local uInt fixed_bd = 5;
-local inflate_huft fixed_tl[] = {
-    {{{96,7}},256}, {{{0,8}},80}, {{{0,8}},16}, {{{84,8}},115},
-    {{{82,7}},31}, {{{0,8}},112}, {{{0,8}},48}, {{{0,9}},192},
-    {{{80,7}},10}, {{{0,8}},96}, {{{0,8}},32}, {{{0,9}},160},
-    {{{0,8}},0}, {{{0,8}},128}, {{{0,8}},64}, {{{0,9}},224},
-    {{{80,7}},6}, {{{0,8}},88}, {{{0,8}},24}, {{{0,9}},144},
-    {{{83,7}},59}, {{{0,8}},120}, {{{0,8}},56}, {{{0,9}},208},
-    {{{81,7}},17}, {{{0,8}},104}, {{{0,8}},40}, {{{0,9}},176},
-    {{{0,8}},8}, {{{0,8}},136}, {{{0,8}},72}, {{{0,9}},240},
-    {{{80,7}},4}, {{{0,8}},84}, {{{0,8}},20}, {{{85,8}},227},
-    {{{83,7}},43}, {{{0,8}},116}, {{{0,8}},52}, {{{0,9}},200},
-    {{{81,7}},13}, {{{0,8}},100}, {{{0,8}},36}, {{{0,9}},168},
-    {{{0,8}},4}, {{{0,8}},132}, {{{0,8}},68}, {{{0,9}},232},
-    {{{80,7}},8}, {{{0,8}},92}, {{{0,8}},28}, {{{0,9}},152},
-    {{{84,7}},83}, {{{0,8}},124}, {{{0,8}},60}, {{{0,9}},216},
-    {{{82,7}},23}, {{{0,8}},108}, {{{0,8}},44}, {{{0,9}},184},
-    {{{0,8}},12}, {{{0,8}},140}, {{{0,8}},76}, {{{0,9}},248},
-    {{{80,7}},3}, {{{0,8}},82}, {{{0,8}},18}, {{{85,8}},163},
-    {{{83,7}},35}, {{{0,8}},114}, {{{0,8}},50}, {{{0,9}},196},
-    {{{81,7}},11}, {{{0,8}},98}, {{{0,8}},34}, {{{0,9}},164},
-    {{{0,8}},2}, {{{0,8}},130}, {{{0,8}},66}, {{{0,9}},228},
-    {{{80,7}},7}, {{{0,8}},90}, {{{0,8}},26}, {{{0,9}},148},
-    {{{84,7}},67}, {{{0,8}},122}, {{{0,8}},58}, {{{0,9}},212},
-    {{{82,7}},19}, {{{0,8}},106}, {{{0,8}},42}, {{{0,9}},180},
-    {{{0,8}},10}, {{{0,8}},138}, {{{0,8}},74}, {{{0,9}},244},
-    {{{80,7}},5}, {{{0,8}},86}, {{{0,8}},22}, {{{192,8}},0},
-    {{{83,7}},51}, {{{0,8}},118}, {{{0,8}},54}, {{{0,9}},204},
-    {{{81,7}},15}, {{{0,8}},102}, {{{0,8}},38}, {{{0,9}},172},
-    {{{0,8}},6}, {{{0,8}},134}, {{{0,8}},70}, {{{0,9}},236},
-    {{{80,7}},9}, {{{0,8}},94}, {{{0,8}},30}, {{{0,9}},156},
-    {{{84,7}},99}, {{{0,8}},126}, {{{0,8}},62}, {{{0,9}},220},
-    {{{82,7}},27}, {{{0,8}},110}, {{{0,8}},46}, {{{0,9}},188},
-    {{{0,8}},14}, {{{0,8}},142}, {{{0,8}},78}, {{{0,9}},252},
-    {{{96,7}},256}, {{{0,8}},81}, {{{0,8}},17}, {{{85,8}},131},
-    {{{82,7}},31}, {{{0,8}},113}, {{{0,8}},49}, {{{0,9}},194},
-    {{{80,7}},10}, {{{0,8}},97}, {{{0,8}},33}, {{{0,9}},162},
-    {{{0,8}},1}, {{{0,8}},129}, {{{0,8}},65}, {{{0,9}},226},
-    {{{80,7}},6}, {{{0,8}},89}, {{{0,8}},25}, {{{0,9}},146},
-    {{{83,7}},59}, {{{0,8}},121}, {{{0,8}},57}, {{{0,9}},210},
-    {{{81,7}},17}, {{{0,8}},105}, {{{0,8}},41}, {{{0,9}},178},
-    {{{0,8}},9}, {{{0,8}},137}, {{{0,8}},73}, {{{0,9}},242},
-    {{{80,7}},4}, {{{0,8}},85}, {{{0,8}},21}, {{{80,8}},258},
-    {{{83,7}},43}, {{{0,8}},117}, {{{0,8}},53}, {{{0,9}},202},
-    {{{81,7}},13}, {{{0,8}},101}, {{{0,8}},37}, {{{0,9}},170},
-    {{{0,8}},5}, {{{0,8}},133}, {{{0,8}},69}, {{{0,9}},234},
-    {{{80,7}},8}, {{{0,8}},93}, {{{0,8}},29}, {{{0,9}},154},
-    {{{84,7}},83}, {{{0,8}},125}, {{{0,8}},61}, {{{0,9}},218},
-    {{{82,7}},23}, {{{0,8}},109}, {{{0,8}},45}, {{{0,9}},186},
-    {{{0,8}},13}, {{{0,8}},141}, {{{0,8}},77}, {{{0,9}},250},
-    {{{80,7}},3}, {{{0,8}},83}, {{{0,8}},19}, {{{85,8}},195},
-    {{{83,7}},35}, {{{0,8}},115}, {{{0,8}},51}, {{{0,9}},198},
-    {{{81,7}},11}, {{{0,8}},99}, {{{0,8}},35}, {{{0,9}},166},
-    {{{0,8}},3}, {{{0,8}},131}, {{{0,8}},67}, {{{0,9}},230},
-    {{{80,7}},7}, {{{0,8}},91}, {{{0,8}},27}, {{{0,9}},150},
-    {{{84,7}},67}, {{{0,8}},123}, {{{0,8}},59}, {{{0,9}},214},
-    {{{82,7}},19}, {{{0,8}},107}, {{{0,8}},43}, {{{0,9}},182},
-    {{{0,8}},11}, {{{0,8}},139}, {{{0,8}},75}, {{{0,9}},246},
-    {{{80,7}},5}, {{{0,8}},87}, {{{0,8}},23}, {{{192,8}},0},
-    {{{83,7}},51}, {{{0,8}},119}, {{{0,8}},55}, {{{0,9}},206},
-    {{{81,7}},15}, {{{0,8}},103}, {{{0,8}},39}, {{{0,9}},174},
-    {{{0,8}},7}, {{{0,8}},135}, {{{0,8}},71}, {{{0,9}},238},
-    {{{80,7}},9}, {{{0,8}},95}, {{{0,8}},31}, {{{0,9}},158},
-    {{{84,7}},99}, {{{0,8}},127}, {{{0,8}},63}, {{{0,9}},222},
-    {{{82,7}},27}, {{{0,8}},111}, {{{0,8}},47}, {{{0,9}},190},
-    {{{0,8}},15}, {{{0,8}},143}, {{{0,8}},79}, {{{0,9}},254},
-    {{{96,7}},256}, {{{0,8}},80}, {{{0,8}},16}, {{{84,8}},115},
-    {{{82,7}},31}, {{{0,8}},112}, {{{0,8}},48}, {{{0,9}},193},
-    {{{80,7}},10}, {{{0,8}},96}, {{{0,8}},32}, {{{0,9}},161},
-    {{{0,8}},0}, {{{0,8}},128}, {{{0,8}},64}, {{{0,9}},225},
-    {{{80,7}},6}, {{{0,8}},88}, {{{0,8}},24}, {{{0,9}},145},
-    {{{83,7}},59}, {{{0,8}},120}, {{{0,8}},56}, {{{0,9}},209},
-    {{{81,7}},17}, {{{0,8}},104}, {{{0,8}},40}, {{{0,9}},177},
-    {{{0,8}},8}, {{{0,8}},136}, {{{0,8}},72}, {{{0,9}},241},
-    {{{80,7}},4}, {{{0,8}},84}, {{{0,8}},20}, {{{85,8}},227},
-    {{{83,7}},43}, {{{0,8}},116}, {{{0,8}},52}, {{{0,9}},201},
-    {{{81,7}},13}, {{{0,8}},100}, {{{0,8}},36}, {{{0,9}},169},
-    {{{0,8}},4}, {{{0,8}},132}, {{{0,8}},68}, {{{0,9}},233},
-    {{{80,7}},8}, {{{0,8}},92}, {{{0,8}},28}, {{{0,9}},153},
-    {{{84,7}},83}, {{{0,8}},124}, {{{0,8}},60}, {{{0,9}},217},
-    {{{82,7}},23}, {{{0,8}},108}, {{{0,8}},44}, {{{0,9}},185},
-    {{{0,8}},12}, {{{0,8}},140}, {{{0,8}},76}, {{{0,9}},249},
-    {{{80,7}},3}, {{{0,8}},82}, {{{0,8}},18}, {{{85,8}},163},
-    {{{83,7}},35}, {{{0,8}},114}, {{{0,8}},50}, {{{0,9}},197},
-    {{{81,7}},11}, {{{0,8}},98}, {{{0,8}},34}, {{{0,9}},165},
-    {{{0,8}},2}, {{{0,8}},130}, {{{0,8}},66}, {{{0,9}},229},
-    {{{80,7}},7}, {{{0,8}},90}, {{{0,8}},26}, {{{0,9}},149},
-    {{{84,7}},67}, {{{0,8}},122}, {{{0,8}},58}, {{{0,9}},213},
-    {{{82,7}},19}, {{{0,8}},106}, {{{0,8}},42}, {{{0,9}},181},
-    {{{0,8}},10}, {{{0,8}},138}, {{{0,8}},74}, {{{0,9}},245},
-    {{{80,7}},5}, {{{0,8}},86}, {{{0,8}},22}, {{{192,8}},0},
-    {{{83,7}},51}, {{{0,8}},118}, {{{0,8}},54}, {{{0,9}},205},
-    {{{81,7}},15}, {{{0,8}},102}, {{{0,8}},38}, {{{0,9}},173},
-    {{{0,8}},6}, {{{0,8}},134}, {{{0,8}},70}, {{{0,9}},237},
-    {{{80,7}},9}, {{{0,8}},94}, {{{0,8}},30}, {{{0,9}},157},
-    {{{84,7}},99}, {{{0,8}},126}, {{{0,8}},62}, {{{0,9}},221},
-    {{{82,7}},27}, {{{0,8}},110}, {{{0,8}},46}, {{{0,9}},189},
-    {{{0,8}},14}, {{{0,8}},142}, {{{0,8}},78}, {{{0,9}},253},
-    {{{96,7}},256}, {{{0,8}},81}, {{{0,8}},17}, {{{85,8}},131},
-    {{{82,7}},31}, {{{0,8}},113}, {{{0,8}},49}, {{{0,9}},195},
-    {{{80,7}},10}, {{{0,8}},97}, {{{0,8}},33}, {{{0,9}},163},
-    {{{0,8}},1}, {{{0,8}},129}, {{{0,8}},65}, {{{0,9}},227},
-    {{{80,7}},6}, {{{0,8}},89}, {{{0,8}},25}, {{{0,9}},147},
-    {{{83,7}},59}, {{{0,8}},121}, {{{0,8}},57}, {{{0,9}},211},
-    {{{81,7}},17}, {{{0,8}},105}, {{{0,8}},41}, {{{0,9}},179},
-    {{{0,8}},9}, {{{0,8}},137}, {{{0,8}},73}, {{{0,9}},243},
-    {{{80,7}},4}, {{{0,8}},85}, {{{0,8}},21}, {{{80,8}},258},
-    {{{83,7}},43}, {{{0,8}},117}, {{{0,8}},53}, {{{0,9}},203},
-    {{{81,7}},13}, {{{0,8}},101}, {{{0,8}},37}, {{{0,9}},171},
-    {{{0,8}},5}, {{{0,8}},133}, {{{0,8}},69}, {{{0,9}},235},
-    {{{80,7}},8}, {{{0,8}},93}, {{{0,8}},29}, {{{0,9}},155},
-    {{{84,7}},83}, {{{0,8}},125}, {{{0,8}},61}, {{{0,9}},219},
-    {{{82,7}},23}, {{{0,8}},109}, {{{0,8}},45}, {{{0,9}},187},
-    {{{0,8}},13}, {{{0,8}},141}, {{{0,8}},77}, {{{0,9}},251},
-    {{{80,7}},3}, {{{0,8}},83}, {{{0,8}},19}, {{{85,8}},195},
-    {{{83,7}},35}, {{{0,8}},115}, {{{0,8}},51}, {{{0,9}},199},
-    {{{81,7}},11}, {{{0,8}},99}, {{{0,8}},35}, {{{0,9}},167},
-    {{{0,8}},3}, {{{0,8}},131}, {{{0,8}},67}, {{{0,9}},231},
-    {{{80,7}},7}, {{{0,8}},91}, {{{0,8}},27}, {{{0,9}},151},
-    {{{84,7}},67}, {{{0,8}},123}, {{{0,8}},59}, {{{0,9}},215},
-    {{{82,7}},19}, {{{0,8}},107}, {{{0,8}},43}, {{{0,9}},183},
-    {{{0,8}},11}, {{{0,8}},139}, {{{0,8}},75}, {{{0,9}},247},
-    {{{80,7}},5}, {{{0,8}},87}, {{{0,8}},23}, {{{192,8}},0},
-    {{{83,7}},51}, {{{0,8}},119}, {{{0,8}},55}, {{{0,9}},207},
-    {{{81,7}},15}, {{{0,8}},103}, {{{0,8}},39}, {{{0,9}},175},
-    {{{0,8}},7}, {{{0,8}},135}, {{{0,8}},71}, {{{0,9}},239},
-    {{{80,7}},9}, {{{0,8}},95}, {{{0,8}},31}, {{{0,9}},159},
-    {{{84,7}},99}, {{{0,8}},127}, {{{0,8}},63}, {{{0,9}},223},
-    {{{82,7}},27}, {{{0,8}},111}, {{{0,8}},47}, {{{0,9}},191},
-    {{{0,8}},15}, {{{0,8}},143}, {{{0,8}},79}, {{{0,9}},255}
-  };
-local inflate_huft fixed_td[] = {
-    {{{80,5}},1}, {{{87,5}},257}, {{{83,5}},17}, {{{91,5}},4097},
-    {{{81,5}},5}, {{{89,5}},1025}, {{{85,5}},65}, {{{93,5}},16385},
-    {{{80,5}},3}, {{{88,5}},513}, {{{84,5}},33}, {{{92,5}},8193},
-    {{{82,5}},9}, {{{90,5}},2049}, {{{86,5}},129}, {{{192,5}},24577},
-    {{{80,5}},2}, {{{87,5}},385}, {{{83,5}},25}, {{{91,5}},6145},
-    {{{81,5}},7}, {{{89,5}},1537}, {{{85,5}},97}, {{{93,5}},24577},
-    {{{80,5}},4}, {{{88,5}},769}, {{{84,5}},49}, {{{92,5}},12289},
-    {{{82,5}},13}, {{{90,5}},3073}, {{{86,5}},193}, {{{192,5}},24577}
-  };
diff --git a/lib/zlib/inflate.c b/lib/zlib/inflate.c
deleted file mode 100644 (file)
index dfb2e86..0000000
+++ /dev/null
@@ -1,366 +0,0 @@
-/* inflate.c -- zlib interface to inflate modules
- * Copyright (C) 1995-2002 Mark Adler
- * For conditions of distribution and use, see copyright notice in zlib.h 
- */
-
-#include "zutil.h"
-#include "infblock.h"
-
-struct inflate_blocks_state {int dummy;}; /* for buggy compilers */
-
-typedef enum {
-      METHOD,   /* waiting for method byte */
-      FLAG,     /* waiting for flag byte */
-      DICT4,    /* four dictionary check bytes to go */
-      DICT3,    /* three dictionary check bytes to go */
-      DICT2,    /* two dictionary check bytes to go */
-      DICT1,    /* one dictionary check byte to go */
-      DICT0,    /* waiting for inflateSetDictionary */
-      BLOCKS,   /* decompressing blocks */
-      CHECK4,   /* four check bytes to go */
-      CHECK3,   /* three check bytes to go */
-      CHECK2,   /* two check bytes to go */
-      CHECK1,   /* one check byte to go */
-      DONE,     /* finished check, done */
-      BAD}      /* got an error--stay here */
-inflate_mode;
-
-/* inflate private state */
-struct internal_state {
-
-  /* mode */
-  inflate_mode  mode;   /* current inflate mode */
-
-  /* mode dependent information */
-  union {
-    uInt method;        /* if FLAGS, method byte */
-    struct {
-      uLong was;                /* computed check value */
-      uLong need;               /* stream check value */
-    } check;            /* if CHECK, check values to compare */
-    uInt marker;        /* if BAD, inflateSync's marker bytes count */
-  } sub;        /* submode */
-
-  /* mode independent information */
-  int  nowrap;          /* flag for no wrapper */
-  uInt wbits;           /* log2(window size)  (8..15, defaults to 15) */
-  inflate_blocks_statef 
-    *blocks;            /* current inflate_blocks state */
-
-};
-
-
-int ZEXPORT inflateReset(z)
-z_streamp z;
-{
-  if (z == Z_NULL || z->state == Z_NULL)
-    return Z_STREAM_ERROR;
-  z->total_in = z->total_out = 0;
-  z->msg = Z_NULL;
-  z->state->mode = z->state->nowrap ? BLOCKS : METHOD;
-  inflate_blocks_reset(z->state->blocks, z, Z_NULL);
-  Tracev((stderr, "inflate: reset\n"));
-  return Z_OK;
-}
-
-
-int ZEXPORT inflateEnd(z)
-z_streamp z;
-{
-  if (z == Z_NULL || z->state == Z_NULL || z->zfree == Z_NULL)
-    return Z_STREAM_ERROR;
-  if (z->state->blocks != Z_NULL)
-    inflate_blocks_free(z->state->blocks, z);
-  ZFREE(z, z->state);
-  z->state = Z_NULL;
-  Tracev((stderr, "inflate: end\n"));
-  return Z_OK;
-}
-
-
-int ZEXPORT inflateInit2_(z, w, version, stream_size)
-z_streamp z;
-int w;
-const char *version;
-int stream_size;
-{
-  if (version == Z_NULL || version[0] != ZLIB_VERSION[0] ||
-      stream_size != sizeof(z_stream))
-      return Z_VERSION_ERROR;
-
-  /* initialize state */
-  if (z == Z_NULL)
-    return Z_STREAM_ERROR;
-  z->msg = Z_NULL;
-  if (z->zalloc == Z_NULL)
-  {
-    z->zalloc = zcalloc;
-    z->opaque = (voidpf)0;
-  }
-  if (z->zfree == Z_NULL) z->zfree = zcfree;
-  if ((z->state = (struct internal_state FAR *)
-       ZALLOC(z,1,sizeof(struct internal_state))) == Z_NULL)
-    return Z_MEM_ERROR;
-  z->state->blocks = Z_NULL;
-
-  /* handle undocumented nowrap option (no zlib header or check) */
-  z->state->nowrap = 0;
-  if (w < 0)
-  {
-    w = - w;
-    z->state->nowrap = 1;
-  }
-
-  /* set window size */
-  if (w < 8 || w > 15)
-  {
-    inflateEnd(z);
-    return Z_STREAM_ERROR;
-  }
-  z->state->wbits = (uInt)w;
-
-  /* create inflate_blocks state */
-  if ((z->state->blocks =
-      inflate_blocks_new(z, z->state->nowrap ? Z_NULL : adler32, (uInt)1 << w))
-      == Z_NULL)
-  {
-    inflateEnd(z);
-    return Z_MEM_ERROR;
-  }
-  Tracev((stderr, "inflate: allocated\n"));
-
-  /* reset state */
-  inflateReset(z);
-  return Z_OK;
-}
-
-
-int ZEXPORT inflateInit_(z, version, stream_size)
-z_streamp z;
-const char *version;
-int stream_size;
-{
-  return inflateInit2_(z, DEF_WBITS, version, stream_size);
-}
-
-
-#define NEEDBYTE {if(z->avail_in==0)return r;r=f;}
-#define NEXTBYTE (z->avail_in--,z->total_in++,*z->next_in++)
-
-int ZEXPORT inflate(z, f)
-z_streamp z;
-int f;
-{
-  int r;
-  uInt b;
-
-  if (z == Z_NULL || z->state == Z_NULL || z->next_in == Z_NULL)
-    return Z_STREAM_ERROR;
-  f = f == Z_FINISH ? Z_BUF_ERROR : Z_OK;
-  r = Z_BUF_ERROR;
-  while (1) switch (z->state->mode)
-  {
-    case METHOD:
-      NEEDBYTE
-      if (((z->state->sub.method = NEXTBYTE) & 0xf) != Z_DEFLATED)
-      {
-        z->state->mode = BAD;
-        z->msg = (char*)"unknown compression method";
-        z->state->sub.marker = 5;       /* can't try inflateSync */
-        break;
-      }
-      if ((z->state->sub.method >> 4) + 8 > z->state->wbits)
-      {
-        z->state->mode = BAD;
-        z->msg = (char*)"invalid window size";
-        z->state->sub.marker = 5;       /* can't try inflateSync */
-        break;
-      }
-      z->state->mode = FLAG;
-    case FLAG:
-      NEEDBYTE
-      b = NEXTBYTE;
-      if (((z->state->sub.method << 8) + b) % 31)
-      {
-        z->state->mode = BAD;
-        z->msg = (char*)"incorrect header check";
-        z->state->sub.marker = 5;       /* can't try inflateSync */
-        break;
-      }
-      Tracev((stderr, "inflate: zlib header ok\n"));
-      if (!(b & PRESET_DICT))
-      {
-        z->state->mode = BLOCKS;
-        break;
-      }
-      z->state->mode = DICT4;
-    case DICT4:
-      NEEDBYTE
-      z->state->sub.check.need = (uLong)NEXTBYTE << 24;
-      z->state->mode = DICT3;
-    case DICT3:
-      NEEDBYTE
-      z->state->sub.check.need += (uLong)NEXTBYTE << 16;
-      z->state->mode = DICT2;
-    case DICT2:
-      NEEDBYTE
-      z->state->sub.check.need += (uLong)NEXTBYTE << 8;
-      z->state->mode = DICT1;
-    case DICT1:
-      NEEDBYTE
-      z->state->sub.check.need += (uLong)NEXTBYTE;
-      z->adler = z->state->sub.check.need;
-      z->state->mode = DICT0;
-      return Z_NEED_DICT;
-    case DICT0:
-      z->state->mode = BAD;
-      z->msg = (char*)"need dictionary";
-      z->state->sub.marker = 0;       /* can try inflateSync */
-      return Z_STREAM_ERROR;
-    case BLOCKS:
-      r = inflate_blocks(z->state->blocks, z, r);
-      if (r == Z_DATA_ERROR)
-      {
-        z->state->mode = BAD;
-        z->state->sub.marker = 0;       /* can try inflateSync */
-        break;
-      }
-      if (r == Z_OK)
-        r = f;
-      if (r != Z_STREAM_END)
-        return r;
-      r = f;
-      inflate_blocks_reset(z->state->blocks, z, &z->state->sub.check.was);
-      if (z->state->nowrap)
-      {
-        z->state->mode = DONE;
-        break;
-      }
-      z->state->mode = CHECK4;
-    case CHECK4:
-      NEEDBYTE
-      z->state->sub.check.need = (uLong)NEXTBYTE << 24;
-      z->state->mode = CHECK3;
-    case CHECK3:
-      NEEDBYTE
-      z->state->sub.check.need += (uLong)NEXTBYTE << 16;
-      z->state->mode = CHECK2;
-    case CHECK2:
-      NEEDBYTE
-      z->state->sub.check.need += (uLong)NEXTBYTE << 8;
-      z->state->mode = CHECK1;
-    case CHECK1:
-      NEEDBYTE
-      z->state->sub.check.need += (uLong)NEXTBYTE;
-
-      if (z->state->sub.check.was != z->state->sub.check.need)
-      {
-        z->state->mode = BAD;
-        z->msg = (char*)"incorrect data check";
-        z->state->sub.marker = 5;       /* can't try inflateSync */
-        break;
-      }
-      Tracev((stderr, "inflate: zlib check ok\n"));
-      z->state->mode = DONE;
-    case DONE:
-      return Z_STREAM_END;
-    case BAD:
-      return Z_DATA_ERROR;
-    default:
-      return Z_STREAM_ERROR;
-  }
-#ifdef NEED_DUMMY_RETURN
-  return Z_STREAM_ERROR;  /* Some dumb compilers complain without this */
-#endif
-}
-
-
-int ZEXPORT inflateSetDictionary(z, dictionary, dictLength)
-z_streamp z;
-const Bytef *dictionary;
-uInt  dictLength;
-{
-  uInt length = dictLength;
-
-  if (z == Z_NULL || z->state == Z_NULL || z->state->mode != DICT0)
-    return Z_STREAM_ERROR;
-
-  if (adler32(1L, dictionary, dictLength) != z->adler) return Z_DATA_ERROR;
-  z->adler = 1L;
-
-  if (length >= ((uInt)1<<z->state->wbits))
-  {
-    length = (1<<z->state->wbits)-1;
-    dictionary += dictLength - length;
-  }
-  inflate_set_dictionary(z->state->blocks, dictionary, length);
-  z->state->mode = BLOCKS;
-  return Z_OK;
-}
-
-
-int ZEXPORT inflateSync(z)
-z_streamp z;
-{
-  uInt n;       /* number of bytes to look at */
-  Bytef *p;     /* pointer to bytes */
-  uInt m;       /* number of marker bytes found in a row */
-  uLong r, w;   /* temporaries to save total_in and total_out */
-
-  /* set up */
-  if (z == Z_NULL || z->state == Z_NULL)
-    return Z_STREAM_ERROR;
-  if (z->state->mode != BAD)
-  {
-    z->state->mode = BAD;
-    z->state->sub.marker = 0;
-  }
-  if ((n = z->avail_in) == 0)
-    return Z_BUF_ERROR;
-  p = z->next_in;
-  m = z->state->sub.marker;
-
-  /* search */
-  while (n && m < 4)
-  {
-    static const Byte mark[4] = {0, 0, 0xff, 0xff};
-    if (*p == mark[m])
-      m++;
-    else if (*p)
-      m = 0;
-    else
-      m = 4 - m;
-    p++, n--;
-  }
-
-  /* restore */
-  z->total_in += p - z->next_in;
-  z->next_in = p;
-  z->avail_in = n;
-  z->state->sub.marker = m;
-
-  /* return no joy or set up to restart on a new block */
-  if (m != 4)
-    return Z_DATA_ERROR;
-  r = z->total_in;  w = z->total_out;
-  inflateReset(z);
-  z->total_in = r;  z->total_out = w;
-  z->state->mode = BLOCKS;
-  return Z_OK;
-}
-
-
-/* Returns true if inflate is currently at the end of a block generated
- * by Z_SYNC_FLUSH or Z_FULL_FLUSH. This function is used by one PPP
- * implementation to provide an additional safety check. PPP uses Z_SYNC_FLUSH
- * but removes the length bytes of the resulting empty stored block. When
- * decompressing, PPP checks that at the end of input packet, inflate is
- * waiting for these length bytes.
- */
-int ZEXPORT inflateSyncPoint(z)
-z_streamp z;
-{
-  if (z == Z_NULL || z->state == Z_NULL || z->state->blocks == Z_NULL)
-    return Z_STREAM_ERROR;
-  return inflate_blocks_sync_point(z->state->blocks);
-}
diff --git a/lib/zlib/inftrees.c b/lib/zlib/inftrees.c
deleted file mode 100644 (file)
index 4c32ca3..0000000
+++ /dev/null
@@ -1,454 +0,0 @@
-/* inftrees.c -- generate Huffman trees for efficient decoding
- * Copyright (C) 1995-2002 Mark Adler
- * For conditions of distribution and use, see copyright notice in zlib.h 
- */
-
-#include "zutil.h"
-#include "inftrees.h"
-
-#if !defined(BUILDFIXED) && !defined(STDC)
-#  define BUILDFIXED   /* non ANSI compilers may not accept inffixed.h */
-#endif
-
-const char inflate_copyright[] =
-   " inflate 1.1.4 Copyright 1995-2002 Mark Adler ";
-/*
-  If you use the zlib library in a product, an acknowledgment is welcome
-  in the documentation of your product. If for some reason you cannot
-  include such an acknowledgment, I would appreciate that you keep this
-  copyright string in the executable of your product.
- */
-struct internal_state  {int dummy;}; /* for buggy compilers */
-
-/* simplify the use of the inflate_huft type with some defines */
-#define exop word.what.Exop
-#define bits word.what.Bits
-
-
-local int huft_build OF((
-    uIntf *,            /* code lengths in bits */
-    uInt,               /* number of codes */
-    uInt,               /* number of "simple" codes */
-    const uIntf *,      /* list of base values for non-simple codes */
-    const uIntf *,      /* list of extra bits for non-simple codes */
-    inflate_huft * FAR*,/* result: starting table */
-    uIntf *,            /* maximum lookup bits (returns actual) */
-    inflate_huft *,     /* space for trees */
-    uInt *,             /* hufts used in space */
-    uIntf * ));         /* space for values */
-
-/* Tables for deflate from PKZIP's appnote.txt. */
-local const uInt cplens[31] = { /* Copy lengths for literal codes 257..285 */
-        3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31,
-        35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0};
-        /* see note #13 above about 258 */
-local const uInt cplext[31] = { /* Extra bits for literal codes 257..285 */
-        0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2,
-        3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0, 112, 112}; /* 112==invalid */
-local const uInt cpdist[30] = { /* Copy offsets for distance codes 0..29 */
-        1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193,
-        257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145,
-        8193, 12289, 16385, 24577};
-local const uInt cpdext[30] = { /* Extra bits for distance codes */
-        0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6,
-        7, 7, 8, 8, 9, 9, 10, 10, 11, 11,
-        12, 12, 13, 13};
-
-/*
-   Huffman code decoding is performed using a multi-level table lookup.
-   The fastest way to decode is to simply build a lookup table whose
-   size is determined by the longest code.  However, the time it takes
-   to build this table can also be a factor if the data being decoded
-   is not very long.  The most common codes are necessarily the
-   shortest codes, so those codes dominate the decoding time, and hence
-   the speed.  The idea is you can have a shorter table that decodes the
-   shorter, more probable codes, and then point to subsidiary tables for
-   the longer codes.  The time it costs to decode the longer codes is
-   then traded against the time it takes to make longer tables.
-
-   This results of this trade are in the variables lbits and dbits
-   below.  lbits is the number of bits the first level table for literal/
-   length codes can decode in one step, and dbits is the same thing for
-   the distance codes.  Subsequent tables are also less than or equal to
-   those sizes.  These values may be adjusted either when all of the
-   codes are shorter than that, in which case the longest code length in
-   bits is used, or when the shortest code is *longer* than the requested
-   table size, in which case the length of the shortest code in bits is
-   used.
-
-   There are two different values for the two tables, since they code a
-   different number of possibilities each.  The literal/length table
-   codes 286 possible values, or in a flat code, a little over eight
-   bits.  The distance table codes 30 possible values, or a little less
-   than five bits, flat.  The optimum values for speed end up being
-   about one bit more than those, so lbits is 8+1 and dbits is 5+1.
-   The optimum values may differ though from machine to machine, and
-   possibly even between compilers.  Your mileage may vary.
- */
-
-
-/* If BMAX needs to be larger than 16, then h and x[] should be uLong. */
-#define BMAX 15         /* maximum bit length of any code */
-
-local int huft_build(b, n, s, d, e, t, m, hp, hn, v)
-uIntf *b;               /* code lengths in bits (all assumed <= BMAX) */
-uInt n;                 /* number of codes (assumed <= 288) */
-uInt s;                 /* number of simple-valued codes (0..s-1) */
-const uIntf *d;         /* list of base values for non-simple codes */
-const uIntf *e;         /* list of extra bits for non-simple codes */
-inflate_huft * FAR *t;  /* result: starting table */
-uIntf *m;               /* maximum lookup bits, returns actual */
-inflate_huft *hp;       /* space for trees */
-uInt *hn;               /* hufts used in space */
-uIntf *v;               /* working area: values in order of bit length */
-/* Given a list of code lengths and a maximum table size, make a set of
-   tables to decode that set of codes.  Return Z_OK on success, Z_BUF_ERROR
-   if the given code set is incomplete (the tables are still built in this
-   case), or Z_DATA_ERROR if the input is invalid. */
-{
-
-  uInt a;                       /* counter for codes of length k */
-  uInt c[BMAX+1];               /* bit length count table */
-  uInt f;                       /* i repeats in table every f entries */
-  int g;                        /* maximum code length */
-  int h;                        /* table level */
-  register uInt i;              /* counter, current code */
-  register uInt j;              /* counter */
-  register int k;               /* number of bits in current code */
-  int l;                        /* bits per table (returned in m) */
-  uInt mask;                    /* (1 << w) - 1, to avoid cc -O bug on HP */
-  register uIntf *p;            /* pointer into c[], b[], or v[] */
-  inflate_huft *q;              /* points to current table */
-  struct inflate_huft_s r;      /* table entry for structure assignment */
-  inflate_huft *u[BMAX];        /* table stack */
-  register int w;               /* bits before this table == (l * h) */
-  uInt x[BMAX+1];               /* bit offsets, then code stack */
-  uIntf *xp;                    /* pointer into x */
-  int y;                        /* number of dummy codes added */
-  uInt z;                       /* number of entries in current table */
-
-
-  /* Generate counts for each bit length */
-  p = c;
-#define C0 *p++ = 0;
-#define C2 C0 C0 C0 C0
-#define C4 C2 C2 C2 C2
-  C4                            /* clear c[]--assume BMAX+1 is 16 */
-  p = b;  i = n;
-  do {
-    c[*p++]++;                  /* assume all entries <= BMAX */
-  } while (--i);
-  if (c[0] == n)                /* null input--all zero length codes */
-  {
-    *t = (inflate_huft *)Z_NULL;
-    *m = 0;
-    return Z_OK;
-  }
-
-
-  /* Find minimum and maximum length, bound *m by those */
-  l = *m;
-  for (j = 1; j <= BMAX; j++)
-    if (c[j])
-      break;
-  k = j;                        /* minimum code length */
-  if ((uInt)l < j)
-    l = j;
-  for (i = BMAX; i; i--)
-    if (c[i])
-      break;
-  g = i;                        /* maximum code length */
-  if ((uInt)l > i)
-    l = i;
-  *m = l;
-
-
-  /* Adjust last length count to fill out codes, if needed */
-  for (y = 1 << j; j < i; j++, y <<= 1)
-    if ((y -= c[j]) < 0)
-      return Z_DATA_ERROR;
-  if ((y -= c[i]) < 0)
-    return Z_DATA_ERROR;
-  c[i] += y;
-
-
-  /* Generate starting offsets into the value table for each length */
-  x[1] = j = 0;
-  p = c + 1;  xp = x + 2;
-  while (--i) {                 /* note that i == g from above */
-    *xp++ = (j += *p++);
-  }
-
-
-  /* Make a table of values in order of bit lengths */
-  p = b;  i = 0;
-  do {
-    if ((j = *p++) != 0)
-      v[x[j]++] = i;
-  } while (++i < n);
-  n = x[g];                     /* set n to length of v */
-
-
-  /* Generate the Huffman codes and for each, make the table entries */
-  x[0] = i = 0;                 /* first Huffman code is zero */
-  p = v;                        /* grab values in bit order */
-  h = -1;                       /* no tables yet--level -1 */
-  w = -l;                       /* bits decoded == (l * h) */
-  u[0] = (inflate_huft *)Z_NULL;        /* just to keep compilers happy */
-  q = (inflate_huft *)Z_NULL;   /* ditto */
-  z = 0;                        /* ditto */
-
-  /* go through the bit lengths (k already is bits in shortest code) */
-  for (; k <= g; k++)
-  {
-    a = c[k];
-    while (a--)
-    {
-      /* here i is the Huffman code of length k bits for value *p */
-      /* make tables up to required level */
-      while (k > w + l)
-      {
-        h++;
-        w += l;                 /* previous table always l bits */
-
-        /* compute minimum size table less than or equal to l bits */
-        z = g - w;
-        z = z > (uInt)l ? l : z;        /* table size upper limit */
-        if ((f = 1 << (j = k - w)) > a + 1)     /* try a k-w bit table */
-        {                       /* too few codes for k-w bit table */
-          f -= a + 1;           /* deduct codes from patterns left */
-          xp = c + k;
-          if (j < z)
-            while (++j < z)     /* try smaller tables up to z bits */
-            {
-              if ((f <<= 1) <= *++xp)
-                break;          /* enough codes to use up j bits */
-              f -= *xp;         /* else deduct codes from patterns */
-            }
-        }
-        z = 1 << j;             /* table entries for j-bit table */
-
-        /* allocate new table */
-        if (*hn + z > MANY)     /* (note: doesn't matter for fixed) */
-          return Z_DATA_ERROR;  /* overflow of MANY */
-        u[h] = q = hp + *hn;
-        *hn += z;
-
-        /* connect to last table, if there is one */
-        if (h)
-        {
-          x[h] = i;             /* save pattern for backing up */
-          r.bits = (Byte)l;     /* bits to dump before this table */
-          r.exop = (Byte)j;     /* bits in this table */
-          j = i >> (w - l);
-          r.base = (uInt)(q - u[h-1] - j);   /* offset to this table */
-          u[h-1][j] = r;        /* connect to last table */
-        }
-        else
-          *t = q;               /* first table is returned result */
-      }
-
-      /* set up table entry in r */
-      r.bits = (Byte)(k - w);
-      if (p >= v + n)
-        r.exop = 128 + 64;      /* out of values--invalid code */
-      else if (*p < s)
-      {
-        r.exop = (Byte)(*p < 256 ? 0 : 32 + 64);     /* 256 is end-of-block */
-        r.base = *p++;          /* simple code is just the value */
-      }
-      else
-      {
-        r.exop = (Byte)(e[*p - s] + 16 + 64);/* non-simple--look up in lists */
-        r.base = d[*p++ - s];
-      }
-
-      /* fill code-like entries with r */
-      f = 1 << (k - w);
-      for (j = i >> w; j < z; j += f)
-        q[j] = r;
-
-      /* backwards increment the k-bit code i */
-      for (j = 1 << (k - 1); i & j; j >>= 1)
-        i ^= j;
-      i ^= j;
-
-      /* backup over finished tables */
-      mask = (1 << w) - 1;      /* needed on HP, cc -O bug */
-      while ((i & mask) != x[h])
-      {
-        h--;                    /* don't need to update q */
-        w -= l;
-        mask = (1 << w) - 1;
-      }
-    }
-  }
-
-
-  /* Return Z_BUF_ERROR if we were given an incomplete table */
-  return y != 0 && g != 1 ? Z_BUF_ERROR : Z_OK;
-}
-
-
-int inflate_trees_bits(c, bb, tb, hp, z)
-uIntf *c;               /* 19 code lengths */
-uIntf *bb;              /* bits tree desired/actual depth */
-inflate_huft * FAR *tb; /* bits tree result */
-inflate_huft *hp;       /* space for trees */
-z_streamp z;            /* for messages */
-{
-  int r;
-  uInt hn = 0;          /* hufts used in space */
-  uIntf *v;             /* work area for huft_build */
-
-  if ((v = (uIntf*)ZALLOC(z, 19, sizeof(uInt))) == Z_NULL)
-    return Z_MEM_ERROR;
-  r = huft_build(c, 19, 19, (uIntf*)Z_NULL, (uIntf*)Z_NULL,
-                 tb, bb, hp, &hn, v);
-  if (r == Z_DATA_ERROR)
-    z->msg = (char*)"oversubscribed dynamic bit lengths tree";
-  else if (r == Z_BUF_ERROR || *bb == 0)
-  {
-    z->msg = (char*)"incomplete dynamic bit lengths tree";
-    r = Z_DATA_ERROR;
-  }
-  ZFREE(z, v);
-  return r;
-}
-
-
-int inflate_trees_dynamic(nl, nd, c, bl, bd, tl, td, hp, z)
-uInt nl;                /* number of literal/length codes */
-uInt nd;                /* number of distance codes */
-uIntf *c;               /* that many (total) code lengths */
-uIntf *bl;              /* literal desired/actual bit depth */
-uIntf *bd;              /* distance desired/actual bit depth */
-inflate_huft * FAR *tl; /* literal/length tree result */
-inflate_huft * FAR *td; /* distance tree result */
-inflate_huft *hp;       /* space for trees */
-z_streamp z;            /* for messages */
-{
-  int r;
-  uInt hn = 0;          /* hufts used in space */
-  uIntf *v;             /* work area for huft_build */
-
-  /* allocate work area */
-  if ((v = (uIntf*)ZALLOC(z, 288, sizeof(uInt))) == Z_NULL)
-    return Z_MEM_ERROR;
-
-  /* build literal/length tree */
-  r = huft_build(c, nl, 257, cplens, cplext, tl, bl, hp, &hn, v);
-  if (r != Z_OK || *bl == 0)
-  {
-    if (r == Z_DATA_ERROR)
-      z->msg = (char*)"oversubscribed literal/length tree";
-    else if (r != Z_MEM_ERROR)
-    {
-      z->msg = (char*)"incomplete literal/length tree";
-      r = Z_DATA_ERROR;
-    }
-    ZFREE(z, v);
-    return r;
-  }
-
-  /* build distance tree */
-  r = huft_build(c + nl, nd, 0, cpdist, cpdext, td, bd, hp, &hn, v);
-  if (r != Z_OK || (*bd == 0 && nl > 257))
-  {
-    if (r == Z_DATA_ERROR)
-      z->msg = (char*)"oversubscribed distance tree";
-    else if (r == Z_BUF_ERROR) {
-#ifdef PKZIP_BUG_WORKAROUND
-      r = Z_OK;
-    }
-#else
-      z->msg = (char*)"incomplete distance tree";
-      r = Z_DATA_ERROR;
-    }
-    else if (r != Z_MEM_ERROR)
-    {
-      z->msg = (char*)"empty distance tree with lengths";
-      r = Z_DATA_ERROR;
-    }
-    ZFREE(z, v);
-    return r;
-#endif
-  }
-
-  /* done */
-  ZFREE(z, v);
-  return Z_OK;
-}
-
-
-/* build fixed tables only once--keep them here */
-#ifdef BUILDFIXED
-local int fixed_built = 0;
-#define FIXEDH 544      /* number of hufts used by fixed tables */
-local inflate_huft fixed_mem[FIXEDH];
-local uInt fixed_bl;
-local uInt fixed_bd;
-local inflate_huft *fixed_tl;
-local inflate_huft *fixed_td;
-#else
-#include "inffixed.h"
-#endif
-
-
-int inflate_trees_fixed(bl, bd, tl, td, z)
-uIntf *bl;               /* literal desired/actual bit depth */
-uIntf *bd;               /* distance desired/actual bit depth */
-inflate_huft * FAR *tl;  /* literal/length tree result */
-inflate_huft * FAR *td;  /* distance tree result */
-z_streamp z;             /* for memory allocation */
-{
-#ifdef BUILDFIXED
-  /* build fixed tables if not already */
-  if (!fixed_built)
-  {
-    int k;              /* temporary variable */
-    uInt f = 0;         /* number of hufts used in fixed_mem */
-    uIntf *c;           /* length list for huft_build */
-    uIntf *v;           /* work area for huft_build */
-
-    /* allocate memory */
-    if ((c = (uIntf*)ZALLOC(z, 288, sizeof(uInt))) == Z_NULL)
-      return Z_MEM_ERROR;
-    if ((v = (uIntf*)ZALLOC(z, 288, sizeof(uInt))) == Z_NULL)
-    {
-      ZFREE(z, c);
-      return Z_MEM_ERROR;
-    }
-
-    /* literal table */
-    for (k = 0; k < 144; k++)
-      c[k] = 8;
-    for (; k < 256; k++)
-      c[k] = 9;
-    for (; k < 280; k++)
-      c[k] = 7;
-    for (; k < 288; k++)
-      c[k] = 8;
-    fixed_bl = 9;
-    huft_build(c, 288, 257, cplens, cplext, &fixed_tl, &fixed_bl,
-               fixed_mem, &f, v);
-
-    /* distance table */
-    for (k = 0; k < 30; k++)
-      c[k] = 5;
-    fixed_bd = 5;
-    huft_build(c, 30, 0, cpdist, cpdext, &fixed_td, &fixed_bd,
-               fixed_mem, &f, v);
-
-    /* done */
-    ZFREE(z, v);
-    ZFREE(z, c);
-    fixed_built = 1;
-  }
-#endif
-  *bl = fixed_bl;
-  *bd = fixed_bd;
-  *tl = fixed_tl;
-  *td = fixed_td;
-  return Z_OK;
-}
diff --git a/lib/zlib/inftrees.h b/lib/zlib/inftrees.h
deleted file mode 100644 (file)
index 04b73b7..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-/* inftrees.h -- header to use inftrees.c
- * Copyright (C) 1995-2002 Mark Adler
- * For conditions of distribution and use, see copyright notice in zlib.h 
- */
-
-/* WARNING: this file should *not* be used by applications. It is
-   part of the implementation of the compression library and is
-   subject to change. Applications should only use zlib.h.
- */
-
-/* Huffman code lookup table entry--this entry is four bytes for machines
-   that have 16-bit pointers (e.g. PC's in the small or medium model). */
-
-typedef struct inflate_huft_s FAR inflate_huft;
-
-struct inflate_huft_s {
-  union {
-    struct {
-      Byte Exop;        /* number of extra bits or operation */
-      Byte Bits;        /* number of bits in this code or subcode */
-    } what;
-    uInt pad;           /* pad structure to a power of 2 (4 bytes for */
-  } word;               /*  16-bit, 8 bytes for 32-bit int's) */
-  uInt base;            /* literal, length base, distance base,
-                           or table offset */
-};
-
-/* Maximum size of dynamic tree.  The maximum found in a long but non-
-   exhaustive search was 1004 huft structures (850 for length/literals
-   and 154 for distances, the latter actually the result of an
-   exhaustive search).  The actual maximum is not known, but the
-   value below is more than safe. */
-#define MANY 1440
-
-extern int inflate_trees_bits OF((
-    uIntf *,                    /* 19 code lengths */
-    uIntf *,                    /* bits tree desired/actual depth */
-    inflate_huft * FAR *,       /* bits tree result */
-    inflate_huft *,             /* space for trees */
-    z_streamp));                /* for messages */
-
-extern int inflate_trees_dynamic OF((
-    uInt,                       /* number of literal/length codes */
-    uInt,                       /* number of distance codes */
-    uIntf *,                    /* that many (total) code lengths */
-    uIntf *,                    /* literal desired/actual bit depth */
-    uIntf *,                    /* distance desired/actual bit depth */
-    inflate_huft * FAR *,       /* literal/length tree result */
-    inflate_huft * FAR *,       /* distance tree result */
-    inflate_huft *,             /* space for trees */
-    z_streamp));                /* for messages */
-
-extern int inflate_trees_fixed OF((
-    uIntf *,                    /* literal desired/actual bit depth */
-    uIntf *,                    /* distance desired/actual bit depth */
-    inflate_huft * FAR *,       /* literal/length tree result */
-    inflate_huft * FAR *,       /* distance tree result */
-    z_streamp));                /* for memory allocation */
diff --git a/lib/zlib/infutil.c b/lib/zlib/infutil.c
deleted file mode 100644 (file)
index 9a07622..0000000
+++ /dev/null
@@ -1,87 +0,0 @@
-/* inflate_util.c -- data and routines common to blocks and codes
- * Copyright (C) 1995-2002 Mark Adler
- * For conditions of distribution and use, see copyright notice in zlib.h 
- */
-
-#include "zutil.h"
-#include "infblock.h"
-#include "inftrees.h"
-#include "infcodes.h"
-#include "infutil.h"
-
-struct inflate_codes_state {int dummy;}; /* for buggy compilers */
-
-/* And'ing with mask[n] masks the lower n bits */
-uInt inflate_mask[17] = {
-    0x0000,
-    0x0001, 0x0003, 0x0007, 0x000f, 0x001f, 0x003f, 0x007f, 0x00ff,
-    0x01ff, 0x03ff, 0x07ff, 0x0fff, 0x1fff, 0x3fff, 0x7fff, 0xffff
-};
-
-
-/* copy as much as possible from the sliding window to the output area */
-int inflate_flush(s, z, r)
-inflate_blocks_statef *s;
-z_streamp z;
-int r;
-{
-  uInt n;
-  Bytef *p;
-  Bytef *q;
-
-  /* local copies of source and destination pointers */
-  p = z->next_out;
-  q = s->read;
-
-  /* compute number of bytes to copy as far as end of window */
-  n = (uInt)((q <= s->write ? s->write : s->end) - q);
-  if (n > z->avail_out) n = z->avail_out;
-  if (n && r == Z_BUF_ERROR) r = Z_OK;
-
-  /* update counters */
-  z->avail_out -= n;
-  z->total_out += n;
-
-  /* update check information */
-  if (s->checkfn != Z_NULL)
-    z->adler = s->check = (*s->checkfn)(s->check, q, n);
-
-  /* copy as far as end of window */
-  zmemcpy(p, q, n);
-  p += n;
-  q += n;
-
-  /* see if more to copy at beginning of window */
-  if (q == s->end)
-  {
-    /* wrap pointers */
-    q = s->window;
-    if (s->write == s->end)
-      s->write = s->window;
-
-    /* compute bytes to copy */
-    n = (uInt)(s->write - q);
-    if (n > z->avail_out) n = z->avail_out;
-    if (n && r == Z_BUF_ERROR) r = Z_OK;
-
-    /* update counters */
-    z->avail_out -= n;
-    z->total_out += n;
-
-    /* update check information */
-    if (s->checkfn != Z_NULL)
-      z->adler = s->check = (*s->checkfn)(s->check, q, n);
-
-    /* copy */
-    zmemcpy(p, q, n);
-    p += n;
-    q += n;
-  }
-
-  /* update pointers */
-  z->next_out = p;
-  s->read = q;
-
-  /* done */
-  return r;
-}
diff --git a/lib/zlib/infutil.h b/lib/zlib/infutil.h
deleted file mode 100644 (file)
index 4401df8..0000000
+++ /dev/null
@@ -1,98 +0,0 @@
-/* infutil.h -- types and macros common to blocks and codes
- * Copyright (C) 1995-2002 Mark Adler
- * For conditions of distribution and use, see copyright notice in zlib.h 
- */
-
-/* WARNING: this file should *not* be used by applications. It is
-   part of the implementation of the compression library and is
-   subject to change. Applications should only use zlib.h.
- */
-
-#ifndef _INFUTIL_H
-#define _INFUTIL_H
-
-typedef enum {
-      TYPE,     /* get type bits (3, including end bit) */
-      LENS,     /* get lengths for stored */
-      STORED,   /* processing stored block */
-      TABLE,    /* get table lengths */
-      BTREE,    /* get bit lengths tree for a dynamic block */
-      DTREE,    /* get length, distance trees for a dynamic block */
-      CODES,    /* processing fixed or dynamic block */
-      DRY,      /* output remaining window bytes */
-      DONE,     /* finished last block, done */
-      BAD}      /* got a data error--stuck here */
-inflate_block_mode;
-
-/* inflate blocks semi-private state */
-struct inflate_blocks_state {
-
-  /* mode */
-  inflate_block_mode  mode;     /* current inflate_block mode */
-
-  /* mode dependent information */
-  union {
-    uInt left;          /* if STORED, bytes left to copy */
-    struct {
-      uInt table;               /* table lengths (14 bits) */
-      uInt index;               /* index into blens (or border) */
-      uIntf *blens;             /* bit lengths of codes */
-      uInt bb;                  /* bit length tree depth */
-      inflate_huft *tb;         /* bit length decoding tree */
-    } trees;            /* if DTREE, decoding info for trees */
-    struct {
-      inflate_codes_statef 
-         *codes;
-    } decode;           /* if CODES, current state */
-  } sub;                /* submode */
-  uInt last;            /* true if this block is the last block */
-
-  /* mode independent information */
-  uInt bitk;            /* bits in bit buffer */
-  uLong bitb;           /* bit buffer */
-  inflate_huft *hufts;  /* single malloc for tree space */
-  Bytef *window;        /* sliding window */
-  Bytef *end;           /* one byte after sliding window */
-  Bytef *read;          /* window read pointer */
-  Bytef *write;         /* window write pointer */
-  check_func checkfn;   /* check function */
-  uLong check;          /* check on output */
-
-};
-
-
-/* defines for inflate input/output */
-/*   update pointers and return */
-#define UPDBITS {s->bitb=b;s->bitk=k;}
-#define UPDIN {z->avail_in=n;z->total_in+=p-z->next_in;z->next_in=p;}
-#define UPDOUT {s->write=q;}
-#define UPDATE {UPDBITS UPDIN UPDOUT}
-#define LEAVE {UPDATE return inflate_flush(s,z,r);}
-/*   get bytes and bits */
-#define LOADIN {p=z->next_in;n=z->avail_in;b=s->bitb;k=s->bitk;}
-#define NEEDBYTE {if(n)r=Z_OK;else LEAVE}
-#define NEXTBYTE (n--,*p++)
-#define NEEDBITS(j) {while(k<(j)){NEEDBYTE;b|=((uLong)NEXTBYTE)<<k;k+=8;}}
-#define DUMPBITS(j) {b>>=(j);k-=(j);}
-/*   output bytes */
-#define WAVAIL (uInt)(q<s->read?s->read-q-1:s->end-q)
-#define LOADOUT {q=s->write;m=(uInt)WAVAIL;}
-#define WRAP {if(q==s->end&&s->read!=s->window){q=s->window;m=(uInt)WAVAIL;}}
-#define FLUSH {UPDOUT r=inflate_flush(s,z,r); LOADOUT}
-#define NEEDOUT {if(m==0){WRAP if(m==0){FLUSH WRAP if(m==0) LEAVE}}r=Z_OK;}
-#define OUTBYTE(a) {*q++=(Byte)(a);m--;}
-/*   load local pointers */
-#define LOAD {LOADIN LOADOUT}
-
-/* masks for lower bits (size given to avoid silly warnings with Visual C++) */
-extern uInt inflate_mask[17];
-
-/* copy as much as possible from the sliding window to the output area */
-extern int inflate_flush OF((
-    inflate_blocks_statef *,
-    z_streamp ,
-    int));
-
-struct internal_state      {int dummy;}; /* for buggy compilers */
-
-#endif
diff --git a/lib/zlib/maketree.c b/lib/zlib/maketree.c
deleted file mode 100644 (file)
index a16d4b1..0000000
+++ /dev/null
@@ -1,85 +0,0 @@
-/* maketree.c -- make inffixed.h table for decoding fixed codes
- * Copyright (C) 1995-2002 Mark Adler
- * For conditions of distribution and use, see copyright notice in zlib.h 
- */
-
-/* WARNING: this file should *not* be used by applications. It is
-   part of the implementation of the compression library and is
-   subject to change. Applications should only use zlib.h.
- */
-
-/* This program is included in the distribution for completeness.
-   You do not need to compile or run this program since inffixed.h
-   is already included in the distribution.  To use this program
-   you need to compile zlib with BUILDFIXED defined and then compile
-   and link this program with the zlib library.  Then the output of
-   this program can be piped to inffixed.h. */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include "zutil.h"
-#include "inftrees.h"
-
-/* simplify the use of the inflate_huft type with some defines */
-#define exop word.what.Exop
-#define bits word.what.Bits
-
-/* generate initialization table for an inflate_huft structure array */
-void maketree(uInt b, inflate_huft *t)
-{
-  int i, e;
-
-  i = 0;
-  while (1)
-  {
-    e = t[i].exop;
-    if (e && (e & (16+64)) == 0)        /* table pointer */
-    {
-      fprintf(stderr, "maketree: cannot initialize sub-tables!\n");
-      exit(1);
-    }
-    if (i % 4 == 0)
-      printf("\n   ");
-    printf(" {{{%u,%u}},%u}", t[i].exop, t[i].bits, t[i].base);
-    if (++i == (1<<b))
-      break;
-    putchar(',');
-  }
-  puts("");
-}
-
-/* create the fixed tables in C initialization syntax */
-void main(void)
-{
-  int r;
-  uInt bl, bd;
-  inflate_huft *tl, *td;
-  z_stream z;
-
-  z.zalloc = zcalloc;
-  z.opaque = (voidpf)0;
-  z.zfree = zcfree;
-  r = inflate_trees_fixed(&bl, &bd, &tl, &td, &z);
-  if (r)
-  {
-    fprintf(stderr, "inflate_trees_fixed error %d\n", r);
-    return;
-  }
-  puts("/* inffixed.h -- table for decoding fixed codes");
-  puts(" * Generated automatically by the maketree.c program");
-  puts(" */");
-  puts("");
-  puts("/* WARNING: this file should *not* be used by applications. It is");
-  puts("   part of the implementation of the compression library and is");
-  puts("   subject to change. Applications should only use zlib.h.");
-  puts(" */");
-  puts("");
-  printf("local uInt fixed_bl = %d;\n", bl);
-  printf("local uInt fixed_bd = %d;\n", bd);
-  printf("local inflate_huft fixed_tl[] = {");
-  maketree(bl, tl);
-  puts("  };");
-  printf("local inflate_huft fixed_td[] = {");
-  maketree(bd, td);
-  puts("  };");
-}
diff --git a/lib/zlib/minigzip.c b/lib/zlib/minigzip.c
deleted file mode 100644 (file)
index 97b7c2d..0000000
+++ /dev/null
@@ -1,320 +0,0 @@
-/* minigzip.c -- simulate gzip using the zlib compression library
- * Copyright (C) 1995-2002 Jean-loup Gailly.
- * For conditions of distribution and use, see copyright notice in zlib.h 
- */
-
-/*
- * minigzip is a minimal implementation of the gzip utility. This is
- * only an example of using zlib and isn't meant to replace the
- * full-featured gzip. No attempt is made to deal with file systems
- * limiting names to 14 or 8+3 characters, etc... Error checking is
- * very limited. So use minigzip only for testing; use gzip for the
- * real thing. On MSDOS, use only on file names without extension
- * or in pipe mode.
- */
-
-/* @(#) $Id$ */
-
-#include <stdio.h>
-#include "zlib.h"
-
-#ifdef STDC
-#  include <string.h>
-#  include <stdlib.h>
-#else
-   extern void exit  OF((int));
-#endif
-
-#ifdef USE_MMAP
-#  include <sys/types.h>
-#  include <sys/mman.h>
-#  include <sys/stat.h>
-#endif
-
-#if defined(MSDOS) || defined(OS2) || defined(WIN32)
-#  include <fcntl.h>
-#  include <io.h>
-#  define SET_BINARY_MODE(file) setmode(fileno(file), O_BINARY)
-#else
-#  define SET_BINARY_MODE(file)
-#endif
-
-#ifdef VMS
-#  define unlink delete
-#  define GZ_SUFFIX "-gz"
-#endif
-#ifdef RISCOS
-#  define unlink remove
-#  define GZ_SUFFIX "-gz"
-#  define fileno(file) file->__file
-#endif
-#if defined(__MWERKS__) && __dest_os != __be_os && __dest_os != __win32_os
-#  include <unix.h> /* for fileno */
-#endif
-
-#ifndef WIN32 /* unlink already in stdio.h for WIN32 */
-  extern int unlink OF((const char *));
-#endif
-
-#ifndef GZ_SUFFIX
-#  define GZ_SUFFIX ".gz"
-#endif
-#define SUFFIX_LEN (sizeof(GZ_SUFFIX)-1)
-
-#define BUFLEN      16384
-#define MAX_NAME_LEN 1024
-
-#ifdef MAXSEG_64K
-#  define local static
-   /* Needed for systems with limitation on stack size. */
-#else
-#  define local
-#endif
-
-char *prog;
-
-void error            OF((const char *msg));
-void gz_compress      OF((FILE   *in, gzFile out));
-#ifdef USE_MMAP
-int  gz_compress_mmap OF((FILE   *in, gzFile out));
-#endif
-void gz_uncompress    OF((gzFile in, FILE   *out));
-void file_compress    OF((char  *file, char *mode));
-void file_uncompress  OF((char  *file));
-int  main             OF((int argc, char *argv[]));
-
-/* ===========================================================================
- * Display error message and exit
- */
-void error(msg)
-    const char *msg;
-{
-    fprintf(stderr, "%s: %s\n", prog, msg);
-    exit(1);
-}
-
-/* ===========================================================================
- * Compress input to output then close both files.
- */
-
-void gz_compress(in, out)
-    FILE   *in;
-    gzFile out;
-{
-    local char buf[BUFLEN];
-    int len;
-    int err;
-
-#ifdef USE_MMAP
-    /* Try first compressing with mmap. If mmap fails (minigzip used in a
-     * pipe), use the normal fread loop.
-     */
-    if (gz_compress_mmap(in, out) == Z_OK) return;
-#endif
-    for (;;) {
-        len = fread(buf, 1, sizeof(buf), in);
-        if (ferror(in)) {
-            perror("fread");
-            exit(1);
-        }
-        if (len == 0) break;
-
-        if (gzwrite(out, buf, (unsigned)len) != len) error(gzerror(out, &err));
-    }
-    fclose(in);
-    if (gzclose(out) != Z_OK) error("failed gzclose");
-}
-
-#ifdef USE_MMAP /* MMAP version, Miguel Albrecht <malbrech@eso.org> */
-
-/* Try compressing the input file at once using mmap. Return Z_OK if
- * if success, Z_ERRNO otherwise.
- */
-int gz_compress_mmap(in, out)
-    FILE   *in;
-    gzFile out;
-{
-    int len;
-    int err;
-    int ifd = fileno(in);
-    caddr_t buf;    /* mmap'ed buffer for the entire input file */
-    off_t buf_len;  /* length of the input file */
-    struct stat sb;
-
-    /* Determine the size of the file, needed for mmap: */
-    if (fstat(ifd, &sb) < 0) return Z_ERRNO;
-    buf_len = sb.st_size;
-    if (buf_len <= 0) return Z_ERRNO;
-
-    /* Now do the actual mmap: */
-    buf = mmap((caddr_t) 0, buf_len, PROT_READ, MAP_SHARED, ifd, (off_t)0); 
-    if (buf == (caddr_t)(-1)) return Z_ERRNO;
-
-    /* Compress the whole file at once: */
-    len = gzwrite(out, (char *)buf, (unsigned)buf_len);
-
-    if (len != (int)buf_len) error(gzerror(out, &err));
-
-    munmap(buf, buf_len);
-    fclose(in);
-    if (gzclose(out) != Z_OK) error("failed gzclose");
-    return Z_OK;
-}
-#endif /* USE_MMAP */
-
-/* ===========================================================================
- * Uncompress input to output then close both files.
- */
-void gz_uncompress(in, out)
-    gzFile in;
-    FILE   *out;
-{
-    local char buf[BUFLEN];
-    int len;
-    int err;
-
-    for (;;) {
-        len = gzread(in, buf, sizeof(buf));
-        if (len < 0) error (gzerror(in, &err));
-        if (len == 0) break;
-
-        if ((int)fwrite(buf, 1, (unsigned)len, out) != len) {
-           error("failed fwrite");
-       }
-    }
-    if (fclose(out)) error("failed fclose");
-
-    if (gzclose(in) != Z_OK) error("failed gzclose");
-}
-
-
-/* ===========================================================================
- * Compress the given file: create a corresponding .gz file and remove the
- * original.
- */
-void file_compress(file, mode)
-    char  *file;
-    char  *mode;
-{
-    local char outfile[MAX_NAME_LEN];
-    FILE  *in;
-    gzFile out;
-
-    strcpy(outfile, file);
-    strcat(outfile, GZ_SUFFIX);
-
-    in = fopen(file, "rb");
-    if (in == NULL) {
-        perror(file);
-        exit(1);
-    }
-    out = gzopen(outfile, mode);
-    if (out == NULL) {
-        fprintf(stderr, "%s: can't gzopen %s\n", prog, outfile);
-        exit(1);
-    }
-    gz_compress(in, out);
-
-    unlink(file);
-}
-
-
-/* ===========================================================================
- * Uncompress the given file and remove the original.
- */
-void file_uncompress(file)
-    char  *file;
-{
-    local char buf[MAX_NAME_LEN];
-    char *infile, *outfile;
-    FILE  *out;
-    gzFile in;
-    int len = strlen(file);
-
-    strcpy(buf, file);
-
-    if (len > SUFFIX_LEN && strcmp(file+len-SUFFIX_LEN, GZ_SUFFIX) == 0) {
-        infile = file;
-        outfile = buf;
-        outfile[len-3] = '\0';
-    } else {
-        outfile = file;
-        infile = buf;
-        strcat(infile, GZ_SUFFIX);
-    }
-    in = gzopen(infile, "rb");
-    if (in == NULL) {
-        fprintf(stderr, "%s: can't gzopen %s\n", prog, infile);
-        exit(1);
-    }
-    out = fopen(outfile, "wb");
-    if (out == NULL) {
-        perror(file);
-        exit(1);
-    }
-
-    gz_uncompress(in, out);
-
-    unlink(infile);
-}
-
-
-/* ===========================================================================
- * Usage:  minigzip [-d] [-f] [-h] [-1 to -9] [files...]
- *   -d : decompress
- *   -f : compress with Z_FILTERED
- *   -h : compress with Z_HUFFMAN_ONLY
- *   -1 to -9 : compression level
- */
-
-int main(argc, argv)
-    int argc;
-    char *argv[];
-{
-    int uncompr = 0;
-    gzFile file;
-    char outmode[20];
-
-    strcpy(outmode, "wb6 ");
-
-    prog = argv[0];
-    argc--, argv++;
-
-    while (argc > 0) {
-      if (strcmp(*argv, "-d") == 0)
-       uncompr = 1;
-      else if (strcmp(*argv, "-f") == 0)
-       outmode[3] = 'f';
-      else if (strcmp(*argv, "-h") == 0)
-       outmode[3] = 'h';
-      else if ((*argv)[0] == '-' && (*argv)[1] >= '1' && (*argv)[1] <= '9' &&
-              (*argv)[2] == 0)
-       outmode[2] = (*argv)[1];
-      else
-       break;
-      argc--, argv++;
-    }
-    if (argc == 0) {
-        SET_BINARY_MODE(stdin);
-        SET_BINARY_MODE(stdout);
-        if (uncompr) {
-            file = gzdopen(fileno(stdin), "rb");
-            if (file == NULL) error("can't gzdopen stdin");
-            gz_uncompress(file, stdout);
-        } else {
-            file = gzdopen(fileno(stdout), outmode);
-            if (file == NULL) error("can't gzdopen stdout");
-            gz_compress(stdin, file);
-        }
-    } else {
-        do {
-            if (uncompr) {
-                file_uncompress(*argv);
-            } else {
-                file_compress(*argv, outmode);
-            }
-        } while (argv++, --argc);
-    }
-    exit(0);
-    return 0; /* to avoid warning */
-}
diff --git a/lib/zlib/msdos/Makefile.b32 b/lib/zlib/msdos/Makefile.b32
deleted file mode 100644 (file)
index f476da9..0000000
+++ /dev/null
@@ -1,104 +0,0 @@
-# Makefile for zlib
-# Borland C++   
-
-# This version of the zlib makefile was adapted by Chris Young for use
-# with Borland C 4.5x with the Dos Power Pack for a 32-bit protected mode
-# flat memory model.  It was created for use with POV-Ray ray tracer and
-# you may choose to edit the CFLAGS to suit your needs but the
-# switches -WX and -DMSDOS are required.
-# -- Chris Young 76702.1655@compuserve.com
-
-# To use, do "make -fmakefile.b32"
-
-# See zconf.h for details about the memory requirements.
-
-# ------------- Borland C++ -------------
-MODEL=-WX 
-CFLAGS= $(MODEL) -P-C -K -N- -k- -d -3 -r- -v- -f -DMSDOS
-CC=bcc32
-LD=bcc32
-LIB=tlib
-LDFLAGS= $(MODEL)
-O=.obj
-
-# variables
-OBJ1 = adler32$(O) compress$(O) crc32$(O) gzio$(O) uncompr$(O) deflate$(O) \
-  trees$(O)
-OBJP1 = adler32$(O)+compress$(O)+crc32$(O)+gzio$(O)+uncompr$(O)+deflate$(O)+\
-  trees$(O)
-OBJ2 = zutil$(O) inflate$(O) infblock$(O) inftrees$(O) infcodes$(O) \
-  infutil$(O) inffast$(O)
-OBJP2 = zutil$(O)+inflate$(O)+infblock$(O)+inftrees$(O)+infcodes$(O)+\
-  infutil$(O)+inffast$(O)
-
-all: test
-
-adler32.obj: adler32.c zlib.h zconf.h
-       $(CC) -c $(CFLAGS) $*.c
-
-compress.obj: compress.c zlib.h zconf.h
-       $(CC) -c $(CFLAGS) $*.c
-
-crc32.obj: crc32.c zlib.h zconf.h
-       $(CC) -c $(CFLAGS) $*.c
-
-deflate.obj: deflate.c deflate.h zutil.h zlib.h zconf.h
-       $(CC) -c $(CFLAGS) $*.c
-
-gzio.obj: gzio.c zutil.h zlib.h zconf.h
-       $(CC) -c $(CFLAGS) $*.c
-
-infblock.obj: infblock.c zutil.h zlib.h zconf.h infblock.h inftrees.h\
-   infcodes.h infutil.h
-       $(CC) -c $(CFLAGS) $*.c
-
-infcodes.obj: infcodes.c zutil.h zlib.h zconf.h inftrees.h infutil.h\
-   infcodes.h inffast.h
-       $(CC) -c $(CFLAGS) $*.c
-
-inflate.obj: inflate.c zutil.h zlib.h zconf.h infblock.h
-       $(CC) -c $(CFLAGS) $*.c
-
-inftrees.obj: inftrees.c zutil.h zlib.h zconf.h inftrees.h
-       $(CC) -c $(CFLAGS) $*.c
-
-infutil.obj: infutil.c zutil.h zlib.h zconf.h inftrees.h infutil.h
-       $(CC) -c $(CFLAGS) $*.c
-
-inffast.obj: inffast.c zutil.h zlib.h zconf.h inftrees.h infutil.h inffast.h
-       $(CC) -c $(CFLAGS) $*.c
-
-trees.obj: trees.c deflate.h zutil.h zlib.h zconf.h
-       $(CC) -c $(CFLAGS) $*.c
-
-uncompr.obj: uncompr.c zlib.h zconf.h
-       $(CC) -c $(CFLAGS) $*.c
-
-zutil.obj: zutil.c zutil.h zlib.h zconf.h
-       $(CC) -c $(CFLAGS) $*.c
-
-example.obj: example.c zlib.h zconf.h
-       $(CC) -c $(CFLAGS) $*.c
-
-minigzip.obj: minigzip.c zlib.h zconf.h
-       $(CC) -c $(CFLAGS) $*.c
-
-# we must cut the command line to fit in the MS/DOS 128 byte limit:
-zlib.lib: $(OBJ1) $(OBJ2)
-       del zlib.lib
-       $(LIB) zlib +$(OBJP1)
-       $(LIB) zlib +$(OBJP2)
-
-example.exe: example.obj zlib.lib
-       $(LD) $(LDFLAGS) example.obj zlib.lib
-
-minigzip.exe: minigzip.obj zlib.lib
-       $(LD) $(LDFLAGS) minigzip.obj zlib.lib
-
-test: example.exe minigzip.exe
-       example
-       echo hello world | minigzip | minigzip -d 
-
-#clean:
-#      del *.obj
-#      del *.exe
diff --git a/lib/zlib/msdos/Makefile.bor b/lib/zlib/msdos/Makefile.bor
deleted file mode 100644 (file)
index f5651b4..0000000
+++ /dev/null
@@ -1,125 +0,0 @@
-# Makefile for zlib
-# Borland C++   ************ UNTESTED ***********
-
-# To use, do "make -fmakefile.bor"
-# To compile in small model, set below: MODEL=s
-
-# WARNING: the small model is supported but only for small values of
-# MAX_WBITS and MAX_MEM_LEVEL. For example:
-#    -DMAX_WBITS=11 -DDEF_WBITS=11 -DMAX_MEM_LEVEL=3
-# If you wish to reduce the memory requirements (default 256K for big
-# objects plus a few K), you can add to the LOC macro below:
-#   -DMAX_MEM_LEVEL=7 -DMAX_WBITS=14
-# See zconf.h for details about the memory requirements.
-
-# ------------- Turbo C++, Borland C++ -------------
-
-#    Optional nonstandard preprocessor flags (e.g. -DMAX_MEM_LEVEL=7)
-#    should be added to the environment via "set LOCAL_ZLIB=-DFOO" or added
-#    to the declaration of LOC here:
-LOC = $(LOCAL_ZLIB)
-
-# Type for CPU required: 0: 8086, 1: 80186, 2: 80286, 3: 80386, etc.
-CPU_TYP = 0
-
-# Memory model: one of s, m, c, l (small, medium, compact, large)
-MODEL=l
-
-CC=bcc
-#   replace bcc with tcc for Turbo C++ 1.0, with bcc32 for the 32 bit version
-LD=$(CC)
-AR=tlib
-
-# compiler flags
-CFLAGS=-O2 -Z -m$(MODEL) $(LOC)
-#   replace "-O2" by "-O -G -a -d" for Turbo C++ 1.0
-
-LDFLAGS=-m$(MODEL)
-
-O=.obj
-
-# variables
-OBJ1 = adler32$(O) compress$(O) crc32$(O) gzio$(O) uncompr$(O) deflate$(O) \
-  trees$(O)
-OBJP1 = adler32$(O)+compress$(O)+crc32$(O)+gzio$(O)+uncompr$(O)+deflate$(O)+\
-  trees$(O)
-OBJ2 = zutil$(O) inflate$(O) infblock$(O) inftrees$(O) infcodes$(O) \
-  infutil$(O) inffast$(O)
-OBJP2 = zutil$(O)+inflate$(O)+infblock$(O)+inftrees$(O)+infcodes$(O)+\
-  infutil$(O)+inffast$(O)
-
-ZLIB_H = zlib.h zconf.h
-ZUTIL_H = zutil.h $(ZLIB_H)
-
-ZLIB_LIB = zlib_$(MODEL).lib
-
-all: test
-
-# individual dependencies and action rules:
-adler32.obj: adler32.c $(ZLIB_H)
-       $(CC) -c $(CFLAGS) $*.c
-
-compress.obj: compress.c $(ZLIB_H)
-       $(CC) -c $(CFLAGS) $*.c
-
-crc32.obj: crc32.c $(ZLIB_H)
-       $(CC) -c $(CFLAGS) $*.c
-
-deflate.obj: deflate.c deflate.h $(ZUTIL_H)
-       $(CC) -c $(CFLAGS) $*.c
-
-gzio.obj: gzio.c $(ZUTIL_H)
-       $(CC) -c $(CFLAGS) $*.c
-
-infblock.obj: infblock.c $(ZUTIL_H) infblock.h inftrees.h infcodes.h infutil.h
-       $(CC) -c $(CFLAGS) $*.c
-
-infcodes.obj: infcodes.c $(ZUTIL_H) inftrees.h infutil.h infcodes.h inffast.h
-       $(CC) -c $(CFLAGS) $*.c
-
-inflate.obj: inflate.c $(ZUTIL_H) infblock.h
-       $(CC) -c $(CFLAGS) $*.c
-
-inftrees.obj: inftrees.c $(ZUTIL_H) inftrees.h
-       $(CC) -c $(CFLAGS) $*.c
-
-infutil.obj: infutil.c $(ZUTIL_H) inftrees.h infutil.h
-       $(CC) -c $(CFLAGS) $*.c
-
-inffast.obj: inffast.c $(ZUTIL_H) inftrees.h infutil.h inffast.h
-       $(CC) -c $(CFLAGS) $*.c
-
-trees.obj: trees.c deflate.h $(ZUTIL_H)
-       $(CC) -c $(CFLAGS) $*.c
-
-uncompr.obj: uncompr.c $(ZLIB_H)
-       $(CC) -c $(CFLAGS) $*.c
-
-zutil.obj: zutil.c $(ZUTIL_H)
-       $(CC) -c $(CFLAGS) $*.c
-
-example.obj: example.c $(ZLIB_H)
-       $(CC) -c $(CFLAGS) $*.c
-
-minigzip.obj: minigzip.c $(ZLIB_H)
-       $(CC) -c $(CFLAGS) $*.c
-
-# we must cut the command line to fit in the MS/DOS 128 byte limit:
-$(ZLIB_LIB): $(OBJ1) $(OBJ2)
-       del $(ZLIB_LIB)
-       $(AR) $(ZLIB_LIB) +$(OBJP1)
-       $(AR) $(ZLIB_LIB) +$(OBJP2)
-
-example.exe: example.obj $(ZLIB_LIB)
-       $(LD) $(LDFLAGS) example.obj $(ZLIB_LIB)
-
-minigzip.exe: minigzip.obj $(ZLIB_LIB)
-       $(LD) $(LDFLAGS) minigzip.obj $(ZLIB_LIB)
-
-test: example.exe minigzip.exe
-       example
-       echo hello world | minigzip | minigzip -d 
-
-#clean:
-#      del *.obj
-#      del *.exe
diff --git a/lib/zlib/msdos/Makefile.dj2 b/lib/zlib/msdos/Makefile.dj2
deleted file mode 100644 (file)
index 0ab431c..0000000
+++ /dev/null
@@ -1,100 +0,0 @@
-# Makefile for zlib.  Modified for djgpp v2.0 by F. J. Donahoe, 3/15/96.
-# Copyright (C) 1995-1998 Jean-loup Gailly.
-# For conditions of distribution and use, see copyright notice in zlib.h 
-
-# To compile, or to compile and test, type:
-# 
-#   make -fmakefile.dj2;  make test -fmakefile.dj2
-# 
-# To install libz.a, zconf.h and zlib.h in the djgpp directories, type:
-# 
-#    make install -fmakefile.dj2
-# 
-# after first defining LIBRARY_PATH and INCLUDE_PATH in djgpp.env as
-# in the sample below if the pattern of the DJGPP distribution is to
-# be followed.  Remember that, while <sp>'es around <=> are ignored in
-# makefiles, they are *not* in batch files or in djgpp.env.
-# - - - - -
-# [make]
-# INCLUDE_PATH=%\>;INCLUDE_PATH%%\DJDIR%\include
-# LIBRARY_PATH=%\>;LIBRARY_PATH%%\DJDIR%\lib
-# BUTT=-m486
-# - - - - -
-# Alternately, these variables may be defined below, overriding the values
-# in djgpp.env, as
-# INCLUDE_PATH=c:\usr\include
-# LIBRARY_PATH=c:\usr\lib
-
-CC=gcc
-
-#CFLAGS=-MMD -O
-#CFLAGS=-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7
-#CFLAGS=-MMD -g -DDEBUG
-CFLAGS=-MMD -O3 $(BUTT) -Wall -Wwrite-strings -Wpointer-arith -Wconversion \
-             -Wstrict-prototypes -Wmissing-prototypes
-
-# If cp.exe is available, replace "copy /Y" with "cp -fp" .
-CP=copy /Y
-# If gnu install.exe is available, replace $(CP) with ginstall.
-INSTALL=$(CP)
-# The default value of RM is "rm -f."  If "rm.exe" is found, comment out:
-RM=del
-LDLIBS=-L. -lz
-LD=$(CC) -s -o
-LDSHARED=$(CC)
-
-INCL=zlib.h zconf.h
-LIBS=libz.a
-
-AR=ar rcs
-
-prefix=/usr/local
-exec_prefix = $(prefix)
-
-OBJS = adler32.o compress.o crc32.o gzio.o uncompr.o deflate.o trees.o \
-       zutil.o inflate.o infblock.o inftrees.o infcodes.o infutil.o inffast.o
-
-TEST_OBJS = example.o minigzip.o
-
-all: example.exe minigzip.exe
-
-test: all
-       ./example
-       echo hello world | .\minigzip | .\minigzip -d 
-
-%.o : %.c
-       $(CC) $(CFLAGS) -c $< -o $@
-
-libz.a: $(OBJS)
-       $(AR) $@ $(OBJS)
-
-%.exe : %.o $(LIBS)
-       $(LD) $@ $< $(LDLIBS)
-
-# INCLUDE_PATH and LIBRARY_PATH were set for [make] in djgpp.env .
-
-.PHONY : uninstall clean
-
-install: $(INCL) $(LIBS)
-       -@if not exist $(INCLUDE_PATH)\nul mkdir $(INCLUDE_PATH)
-       -@if not exist $(LIBRARY_PATH)\nul mkdir $(LIBRARY_PATH)
-       $(INSTALL) zlib.h $(INCLUDE_PATH)
-       $(INSTALL) zconf.h $(INCLUDE_PATH)
-       $(INSTALL) libz.a $(LIBRARY_PATH)
-
-uninstall:
-       $(RM) $(INCLUDE_PATH)\zlib.h
-       $(RM) $(INCLUDE_PATH)\zconf.h
-       $(RM) $(LIBRARY_PATH)\libz.a
-
-clean:
-       $(RM) *.d
-       $(RM) *.o
-       $(RM) *.exe
-       $(RM) libz.a
-       $(RM) foo.gz
-
-DEPS := $(wildcard *.d)
-ifneq ($(DEPS),)
-include $(DEPS)
-endif
diff --git a/lib/zlib/msdos/Makefile.emx b/lib/zlib/msdos/Makefile.emx
deleted file mode 100644 (file)
index 0e5e5cc..0000000
+++ /dev/null
@@ -1,69 +0,0 @@
-# Makefile for zlib.  Modified for emx 0.9c by Chr. Spieler, 6/17/98.
-# Copyright (C) 1995-1998 Jean-loup Gailly.
-# For conditions of distribution and use, see copyright notice in zlib.h 
-
-# To compile, or to compile and test, type:
-# 
-#   make -fmakefile.emx;  make test -fmakefile.emx
-# 
-
-CC=gcc
-
-#CFLAGS=-MMD -O
-#CFLAGS=-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7
-#CFLAGS=-MMD -g -DDEBUG
-CFLAGS=-MMD -O3 $(BUTT) -Wall -Wwrite-strings -Wpointer-arith -Wconversion \
-             -Wstrict-prototypes -Wmissing-prototypes
-
-# If cp.exe is available, replace "copy /Y" with "cp -fp" .
-CP=copy /Y
-# If gnu install.exe is available, replace $(CP) with ginstall.
-INSTALL=$(CP)
-# The default value of RM is "rm -f."  If "rm.exe" is found, comment out:
-RM=del
-LDLIBS=-L. -lzlib
-LD=$(CC) -s -o
-LDSHARED=$(CC)
-
-INCL=zlib.h zconf.h
-LIBS=zlib.a
-
-AR=ar rcs
-
-prefix=/usr/local
-exec_prefix = $(prefix)
-
-OBJS = adler32.o compress.o crc32.o gzio.o uncompr.o deflate.o trees.o \
-       zutil.o inflate.o infblock.o inftrees.o infcodes.o infutil.o inffast.o
-
-TEST_OBJS = example.o minigzip.o
-
-all: example.exe minigzip.exe
-
-test: all
-       ./example
-       echo hello world | .\minigzip | .\minigzip -d 
-
-%.o : %.c
-       $(CC) $(CFLAGS) -c $< -o $@
-
-zlib.a: $(OBJS)
-       $(AR) $@ $(OBJS)
-
-%.exe : %.o $(LIBS)
-       $(LD) $@ $< $(LDLIBS)
-
-
-.PHONY : clean
-
-clean:
-       $(RM) *.d
-       $(RM) *.o
-       $(RM) *.exe
-       $(RM) zlib.a
-       $(RM) foo.gz
-
-DEPS := $(wildcard *.d)
-ifneq ($(DEPS),)
-include $(DEPS)
-endif
diff --git a/lib/zlib/msdos/Makefile.msc b/lib/zlib/msdos/Makefile.msc
deleted file mode 100644 (file)
index 562201d..0000000
+++ /dev/null
@@ -1,121 +0,0 @@
-# Makefile for zlib
-# Microsoft C 5.1 or later
-
-# To use, do "make makefile.msc"
-# To compile in small model, set below: MODEL=S
-
-# If you wish to reduce the memory requirements (default 256K for big
-# objects plus a few K), you can add to the LOC macro below:
-#   -DMAX_MEM_LEVEL=7 -DMAX_WBITS=14
-# See zconf.h for details about the memory requirements.
-
-# ------------- Microsoft C 5.1 and later -------------
-
-#    Optional nonstandard preprocessor flags (e.g. -DMAX_MEM_LEVEL=7)
-#    should be added to the environment via "set LOCAL_ZLIB=-DFOO" or added
-#    to the declaration of LOC here:
-LOC = $(LOCAL_ZLIB)
-
-# Type for CPU required: 0: 8086, 1: 80186, 2: 80286, 3: 80386, etc.
-CPU_TYP = 0
-
-# Memory model: one of S, M, C, L (small, medium, compact, large)
-MODEL=L
-
-CC=cl
-CFLAGS=-nologo -A$(MODEL) -G$(CPU_TYP) -W3 -Oait -Gs $(LOC)
-#-Ox generates bad code with MSC 5.1
-LIB_CFLAGS=-Zl $(CFLAGS)
-
-LD=link
-LDFLAGS=/noi/e/st:0x1500/noe/farcall/packcode
-# "/farcall/packcode" are only useful for `large code' memory models
-# but should be a "no-op" for small code models.
-
-O=.obj
-
-# variables
-OBJ1 = adler32$(O) compress$(O) crc32$(O) gzio$(O) uncompr$(O) deflate$(O) \
-  trees$(O)
-OBJP1 = adler32$(O)+compress$(O)+crc32$(O)+gzio$(O)+uncompr$(O)+deflate$(O)+\
-  trees$(O)
-OBJ2 = zutil$(O) inflate$(O) infblock$(O) inftrees$(O) infcodes$(O) \
-  infutil$(O) inffast$(O)
-OBJP2 = zutil$(O)+inflate$(O)+infblock$(O)+inftrees$(O)+infcodes$(O)+\
-  infutil$(O)+inffast$(O)
-
-ZLIB_H = zlib.h zconf.h
-ZUTIL_H = zutil.h $(ZLIB_H)
-
-ZLIB_LIB = zlib_$(MODEL).lib
-
-all:  $(ZLIB_LIB) example.exe minigzip.exe
-
-# individual dependencies and action rules:
-adler32.obj: adler32.c $(ZLIB_H)
-       $(CC) -c $(LIB_CFLAGS) $*.c
-
-compress.obj: compress.c $(ZLIB_H)
-       $(CC) -c $(LIB_CFLAGS) $*.c
-
-crc32.obj: crc32.c $(ZLIB_H)
-       $(CC) -c $(LIB_CFLAGS) $*.c
-
-deflate.obj: deflate.c deflate.h $(ZUTIL_H)
-       $(CC) -c $(LIB_CFLAGS) $*.c
-
-gzio.obj: gzio.c $(ZUTIL_H)
-       $(CC) -c $(LIB_CFLAGS) $*.c
-
-infblock.obj: infblock.c $(ZUTIL_H) infblock.h inftrees.h infcodes.h infutil.h
-       $(CC) -c $(LIB_CFLAGS) $*.c
-
-infcodes.obj: infcodes.c $(ZUTIL_H) inftrees.h infutil.h infcodes.h inffast.h
-       $(CC) -c $(LIB_CFLAGS) $*.c
-
-inflate.obj: inflate.c $(ZUTIL_H) infblock.h
-       $(CC) -c $(LIB_CFLAGS) $*.c
-
-inftrees.obj: inftrees.c $(ZUTIL_H) inftrees.h
-       $(CC) -c $(LIB_CFLAGS) $*.c
-
-infutil.obj: infutil.c $(ZUTIL_H) inftrees.h infutil.h
-       $(CC) -c $(LIB_CFLAGS) $*.c
-
-inffast.obj: inffast.c $(ZUTIL_H) inftrees.h infutil.h inffast.h
-       $(CC) -c $(LIB_CFLAGS) $*.c
-
-trees.obj: trees.c deflate.h $(ZUTIL_H)
-       $(CC) -c $(LIB_CFLAGS) $*.c
-
-uncompr.obj: uncompr.c $(ZLIB_H)
-       $(CC) -c $(LIB_CFLAGS) $*.c
-
-zutil.obj: zutil.c $(ZUTIL_H)
-       $(CC) -c $(LIB_CFLAGS) $*.c
-
-example.obj: example.c $(ZLIB_H)
-       $(CC) -c $(CFLAGS) $*.c
-
-minigzip.obj: minigzip.c $(ZLIB_H)
-       $(CC) -c $(CFLAGS) $*.c
-
-# we must cut the command line to fit in the MS/DOS 128 byte limit:
-$(ZLIB_LIB): $(OBJ1) $(OBJ2)
-       if exist $(ZLIB_LIB) del $(ZLIB_LIB)
-       lib $(ZLIB_LIB) $(OBJ1);
-       lib $(ZLIB_LIB) $(OBJ2);
-
-example.exe: example.obj $(ZLIB_LIB)
-       $(LD) $(LDFLAGS) example.obj,,,$(ZLIB_LIB);
-
-minigzip.exe: minigzip.obj $(ZLIB_LIB)
-       $(LD) $(LDFLAGS) minigzip.obj,,,$(ZLIB_LIB);
-
-test: example.exe minigzip.exe
-       example
-       echo hello world | minigzip | minigzip -d 
-
-#clean:
-#      del *.obj
-#      del *.exe
diff --git a/lib/zlib/msdos/Makefile.tc b/lib/zlib/msdos/Makefile.tc
deleted file mode 100644 (file)
index 63e0550..0000000
+++ /dev/null
@@ -1,108 +0,0 @@
-# Makefile for zlib
-# TurboC 2.0
-
-# To use, do "make -fmakefile.tc"
-# To compile in small model, set below: MODEL=-ms
-
-# WARNING: the small model is supported but only for small values of
-# MAX_WBITS and MAX_MEM_LEVEL. For example:
-#    -DMAX_WBITS=11 -DMAX_MEM_LEVEL=3
-# If you wish to reduce the memory requirements (default 256K for big
-# objects plus a few K), you can add to CFLAGS below:
-#   -DMAX_MEM_LEVEL=7 -DMAX_WBITS=14
-# See zconf.h for details about the memory requirements.
-
-# ------------- Turbo C 2.0 -------------
-MODEL=l
-# CFLAGS=-O2 -G -Z -m$(MODEL) -DMAX_WBITS=11 -DMAX_MEM_LEVEL=3
-CFLAGS=-O2 -G -Z -m$(MODEL)
-CC=tcc -I\tc\include
-LD=tcc -L\tc\lib
-AR=tlib
-LDFLAGS=-m$(MODEL) -f-
-O=.obj
-
-# variables
-OBJ1 = adler32$(O) compress$(O) crc32$(O) gzio$(O) uncompr$(O) deflate$(O) \
-  trees$(O)
-OBJP1 = adler32$(O)+compress$(O)+crc32$(O)+gzio$(O)+uncompr$(O)+deflate$(O)+\
-  trees$(O)
-OBJ2 = zutil$(O) inflate$(O) infblock$(O) inftrees$(O) infcodes$(O) \
-  infutil$(O) inffast$(O)
-OBJP2 = zutil$(O)+inflate$(O)+infblock$(O)+inftrees$(O)+infcodes$(O)+\
-  infutil$(O)+inffast$(O)
-
-ZLIB_H = zlib.h zconf.h
-ZUTIL_H = zutil.h $(ZLIB_H)
-
-ZLIB_LIB = zlib_$(MODEL).lib
-
-all: test
-
-adler32.obj: adler32.c $(ZLIB_H)
-       $(CC) -c $(CFLAGS) $*.c
-
-compress.obj: compress.c $(ZLIB_H)
-       $(CC) -c $(CFLAGS) $*.c
-
-crc32.obj: crc32.c $(ZLIB_H)
-       $(CC) -c $(CFLAGS) $*.c
-
-deflate.obj: deflate.c deflate.h $(ZUTIL_H)
-       $(CC) -c $(CFLAGS) $*.c
-
-gzio.obj: gzio.c $(ZUTIL_H)
-       $(CC) -c $(CFLAGS) $*.c
-
-infblock.obj: infblock.c $(ZUTIL_H) infblock.h inftrees.h infcodes.h infutil.h
-       $(CC) -c $(CFLAGS) $*.c
-
-infcodes.obj: infcodes.c $(ZUTIL_H) inftrees.h infutil.h infcodes.h inffast.h
-       $(CC) -c $(CFLAGS) $*.c
-
-inflate.obj: inflate.c $(ZUTIL_H) infblock.h
-       $(CC) -c $(CFLAGS) $*.c
-
-inftrees.obj: inftrees.c $(ZUTIL_H) inftrees.h
-       $(CC) -c $(CFLAGS) $*.c
-
-infutil.obj: infutil.c $(ZUTIL_H) inftrees.h infutil.h
-       $(CC) -c $(CFLAGS) $*.c
-
-inffast.obj: inffast.c $(ZUTIL_H) inftrees.h infutil.h inffast.h
-       $(CC) -c $(CFLAGS) $*.c
-
-trees.obj: trees.c deflate.h $(ZUTIL_H)
-       $(CC) -c $(CFLAGS) $*.c
-
-uncompr.obj: uncompr.c $(ZLIB_H)
-       $(CC) -c $(CFLAGS) $*.c
-
-zutil.obj: zutil.c $(ZUTIL_H)
-       $(CC) -c $(CFLAGS) $*.c
-
-example.obj: example.c $(ZLIB_H)
-       $(CC) -c $(CFLAGS) $*.c
-
-minigzip.obj: minigzip.c $(ZLIB_H)
-       $(CC) -c $(CFLAGS) $*.c
-
-# we must cut the command line to fit in the MS/DOS 128 byte limit:
-$(ZLIB_LIB): $(OBJ1) $(OBJ2)
-       del $(ZLIB_LIB)
-       $(AR) $(ZLIB_LIB) +$(OBJP1)
-       $(AR) $(ZLIB_LIB) +$(OBJP2)
-
-example.exe: example.obj $(ZLIB_LIB)
-       $(LD) $(LDFLAGS) -eexample.exe example.obj $(ZLIB_LIB)
-
-minigzip.exe: minigzip.obj $(ZLIB_LIB)
-       $(LD) $(LDFLAGS) -eminigzip.exe minigzip.obj $(ZLIB_LIB)
-
-test: example.exe minigzip.exe
-       example
-       echo hello world | minigzip | minigzip -d 
-
-#clean:
-#      del *.obj
-#      del *.exe
diff --git a/lib/zlib/msdos/Makefile.w32 b/lib/zlib/msdos/Makefile.w32
deleted file mode 100644 (file)
index 0a05fa9..0000000
+++ /dev/null
@@ -1,97 +0,0 @@
-# Makefile for zlib
-# Microsoft 32-bit Visual C++ 4.0 or later (may work on earlier versions)
-
-# To use, do "nmake /f makefile.w32"
-
-# If you wish to reduce the memory requirements (default 256K for big
-# objects plus a few K), you can add to CFLAGS below: 
-#   -DMAX_MEM_LEVEL=7 -DMAX_WBITS=14
-# See zconf.h for details about the memory requirements.
-
-# ------------- Microsoft Visual C++ 4.0 and later -------------
-MODEL=
-CFLAGS=-Ox -GA3s -nologo -W3
-CC=cl
-LD=link
-LDFLAGS=
-O=.obj
-
-# variables
-OBJ1 = adler32$(O) compress$(O) crc32$(O) gzio$(O) uncompr$(O) deflate$(O) \
-  trees$(O)
-OBJP1 = adler32$(O)+compress$(O)+crc32$(O)+gzio$(O)+uncompr$(O)+deflate$(O)+\
-  trees$(O)
-OBJ2 = zutil$(O) inflate$(O) infblock$(O) inftrees$(O) infcodes$(O) \
-  infutil$(O) inffast$(O)
-OBJP2 = zutil$(O)+inflate$(O)+infblock$(O)+inftrees$(O)+infcodes$(O)+\
-  infutil$(O)+inffast$(O)
-
-all:  zlib.lib example.exe minigzip.exe
-
-adler32.obj: adler32.c zlib.h zconf.h
-  $(CC) -c $(CFLAGS) $*.c
-
-compress.obj: compress.c zlib.h zconf.h
-  $(CC) -c $(CFLAGS) $*.c
-
-crc32.obj: crc32.c zlib.h zconf.h
-  $(CC) -c $(CFLAGS) $*.c
-
-deflate.obj: deflate.c deflate.h zutil.h zlib.h zconf.h
-  $(CC) -c $(CFLAGS) $*.c
-
-gzio.obj: gzio.c zutil.h zlib.h zconf.h
-  $(CC) -c $(CFLAGS) $*.c
-
-infblock.obj: infblock.c zutil.h zlib.h zconf.h infblock.h inftrees.h\
-   infcodes.h infutil.h
-  $(CC) -c $(CFLAGS) $*.c
-
-infcodes.obj: infcodes.c zutil.h zlib.h zconf.h inftrees.h infutil.h\
-   infcodes.h inffast.h
-  $(CC) -c $(CFLAGS) $*.c
-
-inflate.obj: inflate.c zutil.h zlib.h zconf.h infblock.h
-  $(CC) -c $(CFLAGS) $*.c
-
-inftrees.obj: inftrees.c zutil.h zlib.h zconf.h inftrees.h
-  $(CC) -c $(CFLAGS) $*.c
-
-infutil.obj: infutil.c zutil.h zlib.h zconf.h inftrees.h infutil.h
-  $(CC) -c $(CFLAGS) $*.c
-
-inffast.obj: inffast.c zutil.h zlib.h zconf.h inftrees.h infutil.h inffast.h
-  $(CC) -c $(CFLAGS) $*.c
-
-trees.obj: trees.c deflate.h zutil.h zlib.h zconf.h
-  $(CC) -c $(CFLAGS) $*.c
-
-uncompr.obj: uncompr.c zlib.h zconf.h
-  $(CC) -c $(CFLAGS) $*.c
-
-zutil.obj: zutil.c zutil.h zlib.h zconf.h
-  $(CC) -c $(CFLAGS) $*.c
-
-example.obj: example.c zlib.h zconf.h
-  $(CC) -c $(CFLAGS) $*.c
-
-minigzip.obj: minigzip.c zlib.h zconf.h
-  $(CC) -c $(CFLAGS) $*.c
-
-zlib.lib: $(OBJ1) $(OBJ2)
-  if exist zlib.lib del zlib.lib
-  lib /OUT:zlib.lib $(OBJ1) $(OBJ2)
-
-example.exe: example.obj zlib.lib
-  $(LD) $(LDFLAGS) example.obj zlib.lib /OUT:example.exe /SUBSYSTEM:CONSOLE
-
-minigzip.exe: minigzip.obj zlib.lib
-  $(LD) $(LDFLAGS) minigzip.obj zlib.lib /OUT:minigzip.exe /SUBSYSTEM:CONSOLE
-
-test: example.exe minigzip.exe
-  example
-  echo hello world | minigzip | minigzip -d 
-
-#clean:
-#  del *.obj
-#  del *.exe
diff --git a/lib/zlib/msdos/Makefile.wat b/lib/zlib/msdos/Makefile.wat
deleted file mode 100644 (file)
index 44bf860..0000000
+++ /dev/null
@@ -1,103 +0,0 @@
-# Makefile for zlib
-# Watcom 10a
-
-# This version of the zlib makefile was adapted by Chris Young for use
-# with Watcom 10a 32-bit protected mode flat memory model.  It was created 
-# for use with POV-Ray ray tracer and you may choose to edit the CFLAGS to 
-# suit your needs but the -DMSDOS is required.
-# -- Chris Young 76702.1655@compuserve.com
-
-# To use, do "wmake -f makefile.wat"
-
-# See zconf.h for details about the memory requirements.
-
-# ------------- Watcom 10a -------------
-MODEL=-mf 
-CFLAGS= $(MODEL) -fpi87 -fp5 -zp4 -5r -w5 -oneatx -DMSDOS
-CC=wcc386
-LD=wcl386
-LIB=wlib -b -c 
-LDFLAGS= 
-O=.obj
-
-# variables
-OBJ1=adler32$(O) compress$(O) crc32$(O) gzio$(O) uncompr$(O) deflate$(O) 
-OBJ2=trees$(O) zutil$(O) inflate$(O) infblock$(O) inftrees$(O) infcodes$(O) 
-OBJ3=infutil$(O) inffast$(O)
-OBJP1=adler32$(O)+compress$(O)+crc32$(O)+gzio$(O)+uncompr$(O)+deflate$(O)
-OBJP2=trees$(O)+zutil$(O)+inflate$(O)+infblock$(O)+inftrees$(O)+infcodes$(O)
-OBJP3=infutil$(O)+inffast$(O)
-
-all: test
-
-adler32.obj: adler32.c zlib.h zconf.h
-       $(CC) $(CFLAGS) $*.c
-
-compress.obj: compress.c zlib.h zconf.h
-       $(CC) $(CFLAGS) $*.c
-
-crc32.obj: crc32.c zlib.h zconf.h
-       $(CC) $(CFLAGS) $*.c
-
-deflate.obj: deflate.c deflate.h zutil.h zlib.h zconf.h
-       $(CC) $(CFLAGS) $*.c
-
-gzio.obj: gzio.c zutil.h zlib.h zconf.h
-       $(CC) $(CFLAGS) $*.c
-
-infblock.obj: infblock.c zutil.h zlib.h zconf.h infblock.h inftrees.h &
-  infcodes.h infutil.h
-       $(CC) $(CFLAGS) $*.c
-
-infcodes.obj: infcodes.c zutil.h zlib.h zconf.h inftrees.h infutil.h &
-  infcodes.h inffast.h
-       $(CC) $(CFLAGS) $*.c
-
-inflate.obj: inflate.c zutil.h zlib.h zconf.h infblock.h
-       $(CC) $(CFLAGS) $*.c
-
-inftrees.obj: inftrees.c zutil.h zlib.h zconf.h inftrees.h
-       $(CC) $(CFLAGS) $*.c
-
-infutil.obj: infutil.c zutil.h zlib.h zconf.h inftrees.h infutil.h
-       $(CC) $(CFLAGS) $*.c
-
-inffast.obj: inffast.c zutil.h zlib.h zconf.h inftrees.h infutil.h inffast.h
-       $(CC) $(CFLAGS) $*.c
-
-trees.obj: trees.c deflate.h zutil.h zlib.h zconf.h
-       $(CC) $(CFLAGS) $*.c
-
-uncompr.obj: uncompr.c zlib.h zconf.h
-       $(CC) $(CFLAGS) $*.c
-
-zutil.obj: zutil.c zutil.h zlib.h zconf.h
-       $(CC) $(CFLAGS) $*.c
-
-example.obj: example.c zlib.h zconf.h
-       $(CC) $(CFLAGS) $*.c
-
-minigzip.obj: minigzip.c zlib.h zconf.h
-       $(CC) $(CFLAGS) $*.c
-
-# we must cut the command line to fit in the MS/DOS 128 byte limit:
-zlib.lib: $(OBJ1) $(OBJ2) $(OBJ3) 
-       del zlib.lib
-       $(LIB) zlib.lib +$(OBJP1)
-       $(LIB) zlib.lib +$(OBJP2)
-       $(LIB) zlib.lib +$(OBJP3)
-
-example.exe: example.obj zlib.lib
-       $(LD) $(LDFLAGS) example.obj zlib.lib
-
-minigzip.exe: minigzip.obj zlib.lib
-       $(LD) $(LDFLAGS) minigzip.obj zlib.lib
-
-test: minigzip.exe example.exe
-       example
-       echo hello world | minigzip | minigzip -d >test
-       type test
-
-#clean:
-#      del *.obj
-#      del *.exe
diff --git a/lib/zlib/msdos/zlib.def b/lib/zlib/msdos/zlib.def
deleted file mode 100644 (file)
index 6c04412..0000000
+++ /dev/null
@@ -1,60 +0,0 @@
-LIBRARY                "zlib"
-
-DESCRIPTION    '"""zlib data compression library"""'
-
-EXETYPE                NT
-
-SUBSYSTEM      WINDOWS
-
-STUB           'WINSTUB.EXE'
-
-VERSION                1.13
-
-CODE            EXECUTE READ
-
-DATA            READ WRITE
-
-HEAPSIZE       1048576,4096
-
-EXPORTS
-    adler32                        @1
-    compress                       @2
-    crc32                          @3
-    deflate                        @4
-    deflateCopy                    @5
-    deflateEnd                     @6
-    deflateInit2_                  @7
-    deflateInit_                   @8
-    deflateParams                  @9
-    deflateReset                   @10
-    deflateSetDictionary           @11
-    gzclose                        @12
-    gzdopen                        @13
-    gzerror                        @14
-    gzflush                        @15
-    gzopen                         @16
-    gzread                         @17
-    gzwrite                        @18
-    inflate                        @19
-    inflateEnd                     @20
-    inflateInit2_                  @21
-    inflateInit_                   @22
-    inflateReset                   @23
-    inflateSetDictionary           @24
-    inflateSync                    @25
-    uncompress                     @26
-    zlibVersion                    @27
-    gzprintf                       @28
-    gzputc                         @29
-    gzgetc                         @30
-    gzseek                         @31
-    gzrewind                       @32
-    gztell                         @33
-    gzeof                          @34
-    gzsetparams                    @35
-    zError                         @36
-    inflateSyncPoint               @37
-    get_crc_table                  @38
-    compress2                      @39
-    gzputs                         @40
-    gzgets                         @41
diff --git a/lib/zlib/msdos/zlib.rc b/lib/zlib/msdos/zlib.rc
deleted file mode 100644 (file)
index 556d4ff..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-#include <windows.h>
-
-#define IDR_VERSION1  1
-IDR_VERSION1   VERSIONINFO     MOVEABLE IMPURE LOADONCALL DISCARDABLE
-  FILEVERSION   1,1,3,0
-  PRODUCTVERSION 1,1,3,0
-  FILEFLAGSMASK        VS_FFI_FILEFLAGSMASK
-  FILEFLAGS    0
-  FILEOS       VOS_DOS_WINDOWS32
-  FILETYPE     VFT_DLL
-  FILESUBTYPE  0       // not used
-BEGIN
-  BLOCK "StringFileInfo"
-  BEGIN
-    BLOCK "040904E4"
-    //language ID = U.S. English, char set = Windows, Multilingual
-
-    BEGIN
-      VALUE "FileDescription", "zlib data compression library\0"
-      VALUE "FileVersion",     "1.1.3\0"
-      VALUE "InternalName",    "zlib\0"
-      VALUE "OriginalFilename",        "zlib.dll\0"
-      VALUE "ProductName",     "ZLib.DLL\0"
-      VALUE "Comments","DLL support by Alessandro Iacopetti & Gilles Vollant\0"
-      VALUE "LegalCopyright", "(C) 1995-1998 Jean-loup Gailly & Mark Adler\0"
-    END
-  END
-  BLOCK "VarFileInfo"
-  BEGIN
-    VALUE "Translation", 0x0409, 1252
-  END
-END
diff --git a/lib/zlib/nt/Makefile.emx b/lib/zlib/nt/Makefile.emx
deleted file mode 100644 (file)
index 2d475b1..0000000
+++ /dev/null
@@ -1,138 +0,0 @@
-# Makefile for zlib.  Modified for emx/rsxnt by Chr. Spieler, 6/16/98.
-# Copyright (C) 1995-1998 Jean-loup Gailly.
-# For conditions of distribution and use, see copyright notice in zlib.h 
-
-# To compile, or to compile and test, type:
-# 
-#   make -fmakefile.emx;  make test -fmakefile.emx
-# 
-
-CC=gcc -Zwin32
-
-#CFLAGS=-MMD -O
-#CFLAGS=-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7
-#CFLAGS=-MMD -g -DDEBUG
-CFLAGS=-MMD -O3 $(BUTT) -Wall -Wwrite-strings -Wpointer-arith -Wconversion \
-             -Wstrict-prototypes -Wmissing-prototypes
-
-# If cp.exe is available, replace "copy /Y" with "cp -fp" .
-CP=copy /Y
-# If gnu install.exe is available, replace $(CP) with ginstall.
-INSTALL=$(CP)
-# The default value of RM is "rm -f."  If "rm.exe" is found, comment out:
-RM=del
-LDLIBS=-L. -lzlib
-LD=$(CC) -s -o
-LDSHARED=$(CC)
-
-INCL=zlib.h zconf.h
-LIBS=zlib.a
-
-AR=ar rcs
-
-prefix=/usr/local
-exec_prefix = $(prefix)
-
-OBJS = adler32.o compress.o crc32.o gzio.o uncompr.o deflate.o trees.o \
-       zutil.o inflate.o infblock.o inftrees.o infcodes.o infutil.o inffast.o
-
-TEST_OBJS = example.o minigzip.o
-
-all: example.exe minigzip.exe
-
-test: all
-       ./example
-       echo hello world | .\minigzip | .\minigzip -d 
-
-%.o : %.c
-       $(CC) $(CFLAGS) -c $< -o $@
-
-zlib.a: $(OBJS)
-       $(AR) $@ $(OBJS)
-
-%.exe : %.o $(LIBS)
-       $(LD) $@ $< $(LDLIBS)
-
-
-.PHONY : clean
-
-clean:
-       $(RM) *.d
-       $(RM) *.o
-       $(RM) *.exe
-       $(RM) zlib.a
-       $(RM) foo.gz
-
-DEPS := $(wildcard *.d)
-ifneq ($(DEPS),)
-include $(DEPS)
-endif
-# Makefile for zlib.  Modified for emx 0.9c by Chr. Spieler, 6/17/98.
-# Copyright (C) 1995-1998 Jean-loup Gailly.
-# For conditions of distribution and use, see copyright notice in zlib.h 
-
-# To compile, or to compile and test, type:
-# 
-#   make -fmakefile.emx;  make test -fmakefile.emx
-# 
-
-CC=gcc
-
-#CFLAGS=-MMD -O
-#CFLAGS=-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7
-#CFLAGS=-MMD -g -DDEBUG
-CFLAGS=-MMD -O3 $(BUTT) -Wall -Wwrite-strings -Wpointer-arith -Wconversion \
-             -Wstrict-prototypes -Wmissing-prototypes
-
-# If cp.exe is available, replace "copy /Y" with "cp -fp" .
-CP=copy /Y
-# If gnu install.exe is available, replace $(CP) with ginstall.
-INSTALL=$(CP)
-# The default value of RM is "rm -f."  If "rm.exe" is found, comment out:
-RM=del
-LDLIBS=-L. -lzlib
-LD=$(CC) -s -o
-LDSHARED=$(CC)
-
-INCL=zlib.h zconf.h
-LIBS=zlib.a
-
-AR=ar rcs
-
-prefix=/usr/local
-exec_prefix = $(prefix)
-
-OBJS = adler32.o compress.o crc32.o gzio.o uncompr.o deflate.o trees.o \
-       zutil.o inflate.o infblock.o inftrees.o infcodes.o infutil.o inffast.o
-
-TEST_OBJS = example.o minigzip.o
-
-all: example.exe minigzip.exe
-
-test: all
-       ./example
-       echo hello world | .\minigzip | .\minigzip -d 
-
-%.o : %.c
-       $(CC) $(CFLAGS) -c $< -o $@
-
-zlib.a: $(OBJS)
-       $(AR) $@ $(OBJS)
-
-%.exe : %.o $(LIBS)
-       $(LD) $@ $< $(LDLIBS)
-
-
-.PHONY : clean
-
-clean:
-       $(RM) *.d
-       $(RM) *.o
-       $(RM) *.exe
-       $(RM) zlib.a
-       $(RM) foo.gz
-
-DEPS := $(wildcard *.d)
-ifneq ($(DEPS),)
-include $(DEPS)
-endif
diff --git a/lib/zlib/nt/Makefile.gcc b/lib/zlib/nt/Makefile.gcc
deleted file mode 100644 (file)
index cdd652f..0000000
+++ /dev/null
@@ -1,87 +0,0 @@
-# Makefile for zlib.  Modified for mingw32 by C. Spieler, 6/16/98.
-# (This Makefile is directly derived from Makefile.dj2)
-# Copyright (C) 1995-1998 Jean-loup Gailly.
-# For conditions of distribution and use, see copyright notice in zlib.h 
-
-# To compile, or to compile and test, type:
-# 
-#   make -fmakefile.gcc;  make test -fmakefile.gcc
-# 
-# To install libz.a, zconf.h and zlib.h in the mingw32 directories, type:
-# 
-#    make install -fmakefile.gcc
-# 
-
-CC=gcc
-
-#CFLAGS=-MMD -O
-#CFLAGS=-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7
-#CFLAGS=-MMD -g -DDEBUG
-CFLAGS=-MMD -O3 $(BUTT) -Wall -Wwrite-strings -Wpointer-arith -Wconversion \
-             -Wstrict-prototypes -Wmissing-prototypes
-
-# If cp.exe is available, replace "copy /Y" with "cp -fp" .
-CP=copy /Y
-# If gnu install.exe is available, replace $(CP) with ginstall.
-INSTALL=$(CP)
-# The default value of RM is "rm -f."  If "rm.exe" is found, comment out:
-RM=del
-LDLIBS=-L. -lz
-LD=$(CC) -s -o
-LDSHARED=$(CC)
-
-INCL=zlib.h zconf.h
-LIBS=libz.a
-
-AR=ar rcs
-
-prefix=/usr/local
-exec_prefix = $(prefix)
-
-OBJS = adler32.o compress.o crc32.o gzio.o uncompr.o deflate.o trees.o \
-       zutil.o inflate.o infblock.o inftrees.o infcodes.o infutil.o inffast.o
-
-TEST_OBJS = example.o minigzip.o
-
-all: example.exe minigzip.exe
-
-test: all
-       ./example
-       echo hello world | .\minigzip | .\minigzip -d 
-
-%.o : %.c
-       $(CC) $(CFLAGS) -c $< -o $@
-
-libz.a: $(OBJS)
-       $(AR) $@ $(OBJS)
-
-%.exe : %.o $(LIBS)
-       $(LD) $@ $< $(LDLIBS)
-
-# INCLUDE_PATH and LIBRARY_PATH were set for [make] in djgpp.env .
-
-.PHONY : uninstall clean
-
-install: $(INCL) $(LIBS)
-       -@if not exist $(INCLUDE_PATH)\nul mkdir $(INCLUDE_PATH)
-       -@if not exist $(LIBRARY_PATH)\nul mkdir $(LIBRARY_PATH)
-       $(INSTALL) zlib.h $(INCLUDE_PATH)
-       $(INSTALL) zconf.h $(INCLUDE_PATH)
-       $(INSTALL) libz.a $(LIBRARY_PATH)
-
-uninstall:
-       $(RM) $(INCLUDE_PATH)\zlib.h
-       $(RM) $(INCLUDE_PATH)\zconf.h
-       $(RM) $(LIBRARY_PATH)\libz.a
-
-clean:
-       $(RM) *.d
-       $(RM) *.o
-       $(RM) *.exe
-       $(RM) libz.a
-       $(RM) foo.gz
-
-DEPS := $(wildcard *.d)
-ifneq ($(DEPS),)
-include $(DEPS)
-endif
diff --git a/lib/zlib/nt/Makefile.nt b/lib/zlib/nt/Makefile.nt
deleted file mode 100644 (file)
index b250f2a..0000000
+++ /dev/null
@@ -1,88 +0,0 @@
-# Makefile for zlib
-
-!include <ntwin32.mak>
-
-CC=cl
-LD=link
-CFLAGS=-O -nologo
-LDFLAGS=
-O=.obj
-
-# variables
-OBJ1 = adler32$(O) compress$(O) crc32$(O) gzio$(O) uncompr$(O) deflate$(O) \
-  trees$(O)
-OBJ2 = zutil$(O) inflate$(O) infblock$(O) inftrees$(O) infcodes$(O) \
-  infutil$(O) inffast$(O)
-
-all:  zlib.dll example.exe minigzip.exe
-
-adler32.obj: adler32.c zutil.h zlib.h zconf.h
-       $(CC) -c $(cvarsdll) $(CFLAGS) $*.c
-
-compress.obj: compress.c zlib.h zconf.h
-       $(CC) -c $(cvarsdll) $(CFLAGS) $*.c
-
-crc32.obj: crc32.c zutil.h zlib.h zconf.h
-       $(CC) -c $(cvarsdll) $(CFLAGS) $*.c
-
-deflate.obj: deflate.c deflate.h zutil.h zlib.h zconf.h
-       $(CC) -c $(cvarsdll) $(CFLAGS) $*.c
-
-gzio.obj: gzio.c zutil.h zlib.h zconf.h
-       $(CC) -c $(cvarsdll) $(CFLAGS) $*.c
-
-infblock.obj: infblock.c zutil.h zlib.h zconf.h infblock.h inftrees.h\
-   infcodes.h infutil.h
-       $(CC) -c $(cvarsdll) $(CFLAGS) $*.c
-
-infcodes.obj: infcodes.c zutil.h zlib.h zconf.h inftrees.h infutil.h\
-   infcodes.h inffast.h
-       $(CC) -c $(cvarsdll) $(CFLAGS) $*.c
-
-inflate.obj: inflate.c zutil.h zlib.h zconf.h infblock.h
-       $(CC) -c $(cvarsdll) $(CFLAGS) $*.c
-
-inftrees.obj: inftrees.c zutil.h zlib.h zconf.h inftrees.h
-       $(CC) -c $(cvarsdll) $(CFLAGS) $*.c
-
-infutil.obj: infutil.c zutil.h zlib.h zconf.h inftrees.h infutil.h
-       $(CC) -c $(cvarsdll) $(CFLAGS) $*.c
-
-inffast.obj: inffast.c zutil.h zlib.h zconf.h inftrees.h infutil.h inffast.h
-       $(CC) -c $(cvarsdll) $(CFLAGS) $*.c
-
-trees.obj: trees.c deflate.h zutil.h zlib.h zconf.h
-       $(CC) -c $(cvarsdll) $(CFLAGS) $*.c
-
-uncompr.obj: uncompr.c zlib.h zconf.h
-       $(CC) -c $(cvarsdll) $(CFLAGS) $*.c
-
-zutil.obj: zutil.c zutil.h zlib.h zconf.h
-       $(CC) -c $(cvarsdll) $(CFLAGS) $*.c
-
-example.obj: example.c zlib.h zconf.h
-       $(CC) -c $(cvarsdll) $(CFLAGS) $*.c
-
-minigzip.obj: minigzip.c zlib.h zconf.h
-       $(CC) -c $(cvarsdll) $(CFLAGS) $*.c
-
-zlib.dll: $(OBJ1) $(OBJ2) zlib.dnt
-       link $(dlllflags) -out:$@ -def:zlib.dnt $(OBJ1) $(OBJ2) $(guilibsdll)
-
-zlib.lib: zlib.dll
-
-example.exe: example.obj zlib.lib
-       $(LD) $(LDFLAGS) example.obj zlib.lib
-
-minigzip.exe: minigzip.obj zlib.lib
-       $(LD) $(LDFLAGS) minigzip.obj zlib.lib
-
-test: example.exe minigzip.exe
-       example
-       echo hello world | minigzip | minigzip -d 
-
-clean:
-       del *.obj
-       del *.exe
-       del *.dll
-       del *.lib
diff --git a/lib/zlib/nt/zlib.dnt b/lib/zlib/nt/zlib.dnt
deleted file mode 100644 (file)
index 7f9475c..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-LIBRARY                zlib.dll
-EXETYPE WINDOWS
-CODE            PRELOAD MOVEABLE DISCARDABLE
-DATA            PRELOAD MOVEABLE MULTIPLE
-
-EXPORTS
-    adler32                        @1
-    compress                       @2
-    crc32                          @3
-    deflate                        @4
-    deflateCopy                    @5
-    deflateEnd                     @6
-    deflateInit2_                  @7
-    deflateInit_                   @8
-    deflateParams                  @9
-    deflateReset                   @10
-    deflateSetDictionary           @11
-    gzclose                        @12
-    gzdopen                        @13
-    gzerror                        @14
-    gzflush                        @15
-    gzopen                         @16
-    gzread                         @17
-    gzwrite                        @18
-    inflate                        @19
-    inflateEnd                     @20
-    inflateInit2_                  @21
-    inflateInit_                   @22
-    inflateReset                   @23
-    inflateSetDictionary           @24
-    inflateSync                    @25
-    uncompress                     @26
-    zlibVersion                    @27
-    gzprintf                       @28
-    gzputc                         @29
-    gzgetc                         @30
-    gzseek                         @31
-    gzrewind                       @32
-    gztell                         @33
-    gzeof                          @34
-    gzsetparams                    @35
-    zError                         @36
-    inflateSyncPoint               @37
-    get_crc_table                  @38
-    compress2                      @39
-    gzputs                         @40
-    gzgets                         @41
diff --git a/lib/zlib/os2/Makefile.os2 b/lib/zlib/os2/Makefile.os2
deleted file mode 100644 (file)
index 4f56947..0000000
+++ /dev/null
@@ -1,136 +0,0 @@
-# Makefile for zlib under OS/2 using GCC (PGCC)
-# For conditions of distribution and use, see copyright notice in zlib.h 
-
-# To compile and test, type:
-#   cp Makefile.os2 ..
-#   cd ..
-#   make -f Makefile.os2 test
-
-# This makefile will build a static library z.lib, a shared library
-# z.dll and a import library zdll.lib. You can use either z.lib or
-# zdll.lib by specifying either -lz or -lzdll on gcc's command line
-
-CC=gcc -Zomf -s
-
-CFLAGS=-O6 -Wall
-#CFLAGS=-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7
-#CFLAGS=-g -DDEBUG
-#CFLAGS=-O3 -Wall -Wwrite-strings -Wpointer-arith -Wconversion \
-#           -Wstrict-prototypes -Wmissing-prototypes
-
-#################### BUG WARNING: #####################
-## infcodes.c hits a bug in pgcc-1.0, so you have to use either
-## -O# where # <= 4 or one of (-fno-ommit-frame-pointer or -fno-force-mem)
-## This bug is reportedly fixed in pgcc >1.0, but this was not tested
-CFLAGS+=-fno-force-mem
-
-LDFLAGS=-s -L. -lzdll -Zcrtdll
-LDSHARED=$(CC) -s -Zomf -Zdll -Zcrtdll
-
-VER=1.1.0
-ZLIB=z.lib
-SHAREDLIB=z.dll
-SHAREDLIBIMP=zdll.lib
-LIBS=$(ZLIB) $(SHAREDLIB) $(SHAREDLIBIMP)
-
-AR=emxomfar cr
-IMPLIB=emximp
-RANLIB=echo
-TAR=tar
-SHELL=bash
-
-prefix=/usr/local
-exec_prefix = $(prefix)
-
-OBJS = adler32.o compress.o crc32.o gzio.o uncompr.o deflate.o trees.o \
-       zutil.o inflate.o infblock.o inftrees.o infcodes.o infutil.o inffast.o
-
-TEST_OBJS = example.o minigzip.o
-
-DISTFILES = README INDEX ChangeLog configure Make*[a-z0-9] *.[ch] descrip.mms \
-  algorithm.txt zlib.3 msdos/Make*[a-z0-9] msdos/zlib.def msdos/zlib.rc \
-  nt/Makefile.nt nt/zlib.dnt  contrib/README.contrib contrib/*.txt \
-  contrib/asm386/*.asm contrib/asm386/*.c \
-  contrib/asm386/*.bat contrib/asm386/zlibvc.d?? contrib/iostream/*.cpp \
-  contrib/iostream/*.h  contrib/iostream2/*.h contrib/iostream2/*.cpp \
-  contrib/untgz/Makefile contrib/untgz/*.c contrib/untgz/*.w32
-
-all: example.exe minigzip.exe
-
-test: all
-       @LD_LIBRARY_PATH=.:$(LD_LIBRARY_PATH) ; export LD_LIBRARY_PATH; \
-       echo hello world | ./minigzip | ./minigzip -d || \
-         echo '                *** minigzip test FAILED ***' ; \
-       if ./example; then \
-         echo '                *** zlib test OK ***'; \
-       else \
-         echo '                *** zlib test FAILED ***'; \
-       fi
-
-$(ZLIB): $(OBJS)
-       $(AR) $@ $(OBJS)
-       -@ ($(RANLIB) $@ || true) >/dev/null 2>&1
-
-$(SHAREDLIB): $(OBJS) os2/z.def
-       $(LDSHARED) -o $@ $^
-
-$(SHAREDLIBIMP): os2/z.def
-       $(IMPLIB) -o $@ $^
-
-example.exe: example.o $(LIBS)
-       $(CC) $(CFLAGS) -o $@ example.o $(LDFLAGS)
-
-minigzip.exe: minigzip.o $(LIBS)
-       $(CC) $(CFLAGS) -o $@ minigzip.o $(LDFLAGS)
-
-clean:
-       rm -f *.o *~ example minigzip libz.a libz.so* foo.gz
-
-distclean:     clean
-
-zip:
-       mv Makefile Makefile~; cp -p Makefile.in Makefile
-       rm -f test.c ztest*.c
-       v=`sed -n -e 's/\.//g' -e '/VERSION "/s/.*"\(.*\)".*/\1/p' < zlib.h`;\
-       zip -ul9 zlib$$v $(DISTFILES)
-       mv Makefile~ Makefile
-
-dist:
-       mv Makefile Makefile~; cp -p Makefile.in Makefile
-       rm -f test.c ztest*.c
-       d=zlib-`sed -n '/VERSION "/s/.*"\(.*\)".*/\1/p' < zlib.h`;\
-       rm -f $$d.tar.gz; \
-       if test ! -d ../$$d; then rm -f ../$$d; ln -s `pwd` ../$$d; fi; \
-       files=""; \
-       for f in $(DISTFILES); do files="$$files $$d/$$f"; done; \
-       cd ..; \
-       GZIP=-9 $(TAR) chofz $$d/$$d.tar.gz $$files; \
-       if test ! -d $$d; then rm -f $$d; fi
-       mv Makefile~ Makefile
-
-tags:  
-       etags *.[ch]
-
-depend:
-       makedepend -- $(CFLAGS) -- *.[ch]
-
-# DO NOT DELETE THIS LINE -- make depend depends on it.
-
-adler32.o: zlib.h zconf.h
-compress.o: zlib.h zconf.h
-crc32.o: zlib.h zconf.h
-deflate.o: deflate.h zutil.h zlib.h zconf.h
-example.o: zlib.h zconf.h
-gzio.o: zutil.h zlib.h zconf.h
-infblock.o: infblock.h inftrees.h infcodes.h infutil.h zutil.h zlib.h zconf.h
-infcodes.o: zutil.h zlib.h zconf.h
-infcodes.o: inftrees.h infblock.h infcodes.h infutil.h inffast.h
-inffast.o: zutil.h zlib.h zconf.h inftrees.h
-inffast.o: infblock.h infcodes.h infutil.h inffast.h
-inflate.o: zutil.h zlib.h zconf.h infblock.h
-inftrees.o: zutil.h zlib.h zconf.h inftrees.h
-infutil.o: zutil.h zlib.h zconf.h infblock.h inftrees.h infcodes.h infutil.h
-minigzip.o:  zlib.h zconf.h 
-trees.o: deflate.h zutil.h zlib.h zconf.h trees.h
-uncompr.o: zlib.h zconf.h
-zutil.o: zutil.h zlib.h zconf.h  
diff --git a/lib/zlib/os2/zlib.def b/lib/zlib/os2/zlib.def
deleted file mode 100644 (file)
index 4c753f1..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-;
-; Slightly modified version of ../nt/zlib.dnt :-)
-;
-
-LIBRARY                Z
-DESCRIPTION    "Zlib compression library for OS/2"
-CODE           PRELOAD MOVEABLE DISCARDABLE
-DATA           PRELOAD MOVEABLE MULTIPLE
-
-EXPORTS
-    adler32
-    compress
-    crc32
-    deflate
-    deflateCopy
-    deflateEnd
-    deflateInit2_
-    deflateInit_
-    deflateParams
-    deflateReset
-    deflateSetDictionary
-    gzclose
-    gzdopen
-    gzerror
-    gzflush
-    gzopen
-    gzread
-    gzwrite
-    inflate
-    inflateEnd
-    inflateInit2_
-    inflateInit_
-    inflateReset
-    inflateSetDictionary
-    inflateSync
-    uncompress
-    zlibVersion
-    gzprintf
-    gzputc
-    gzgetc
-    gzseek
-    gzrewind
-    gztell
-    gzeof
-    gzsetparams
-    zError
-    inflateSyncPoint
-    get_crc_table
-    compress2
-    gzputs
-    gzgets
diff --git a/lib/zlib/trees.c b/lib/zlib/trees.c
deleted file mode 100644 (file)
index 0a98405..0000000
+++ /dev/null
@@ -1,1214 +0,0 @@
-/* trees.c -- output deflated data using Huffman coding
- * Copyright (C) 1995-2002 Jean-loup Gailly
- * For conditions of distribution and use, see copyright notice in zlib.h 
- */
-
-/*
- *  ALGORITHM
- *
- *      The "deflation" process uses several Huffman trees. The more
- *      common source values are represented by shorter bit sequences.
- *
- *      Each code tree is stored in a compressed form which is itself
- * a Huffman encoding of the lengths of all the code strings (in
- * ascending order by source values).  The actual code strings are
- * reconstructed from the lengths in the inflate process, as described
- * in the deflate specification.
- *
- *  REFERENCES
- *
- *      Deutsch, L.P.,"'Deflate' Compressed Data Format Specification".
- *      Available in ftp.uu.net:/pub/archiving/zip/doc/deflate-1.1.doc
- *
- *      Storer, James A.
- *          Data Compression:  Methods and Theory, pp. 49-50.
- *          Computer Science Press, 1988.  ISBN 0-7167-8156-5.
- *
- *      Sedgewick, R.
- *          Algorithms, p290.
- *          Addison-Wesley, 1983. ISBN 0-201-06672-6.
- */
-
-/* @(#) $Id$ */
-
-/* #define GEN_TREES_H */
-
-#include "deflate.h"
-
-#ifdef DEBUG
-#  include <ctype.h>
-#endif
-
-/* ===========================================================================
- * Constants
- */
-
-#define MAX_BL_BITS 7
-/* Bit length codes must not exceed MAX_BL_BITS bits */
-
-#define END_BLOCK 256
-/* end of block literal code */
-
-#define REP_3_6      16
-/* repeat previous bit length 3-6 times (2 bits of repeat count) */
-
-#define REPZ_3_10    17
-/* repeat a zero length 3-10 times  (3 bits of repeat count) */
-
-#define REPZ_11_138  18
-/* repeat a zero length 11-138 times  (7 bits of repeat count) */
-
-local const int extra_lbits[LENGTH_CODES] /* extra bits for each length code */
-   = {0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0};
-
-local const int extra_dbits[D_CODES] /* extra bits for each distance code */
-   = {0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13};
-
-local const int extra_blbits[BL_CODES]/* extra bits for each bit length code */
-   = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7};
-
-local const uch bl_order[BL_CODES]
-   = {16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15};
-/* The lengths of the bit length codes are sent in order of decreasing
- * probability, to avoid transmitting the lengths for unused bit length codes.
- */
-
-#define Buf_size (8 * 2*sizeof(char))
-/* Number of bits used within bi_buf. (bi_buf might be implemented on
- * more than 16 bits on some systems.)
- */
-
-/* ===========================================================================
- * Local data. These are initialized only once.
- */
-
-#define DIST_CODE_LEN  512 /* see definition of array dist_code below */
-
-#if defined(GEN_TREES_H) || !defined(STDC)
-/* non ANSI compilers may not accept trees.h */
-
-local ct_data static_ltree[L_CODES+2];
-/* The static literal tree. Since the bit lengths are imposed, there is no
- * need for the L_CODES extra codes used during heap construction. However
- * The codes 286 and 287 are needed to build a canonical tree (see _tr_init
- * below).
- */
-
-local ct_data static_dtree[D_CODES];
-/* The static distance tree. (Actually a trivial tree since all codes use
- * 5 bits.)
- */
-
-uch _dist_code[DIST_CODE_LEN];
-/* Distance codes. The first 256 values correspond to the distances
- * 3 .. 258, the last 256 values correspond to the top 8 bits of
- * the 15 bit distances.
- */
-
-uch _length_code[MAX_MATCH-MIN_MATCH+1];
-/* length code for each normalized match length (0 == MIN_MATCH) */
-
-local int base_length[LENGTH_CODES];
-/* First normalized length for each code (0 = MIN_MATCH) */
-
-local int base_dist[D_CODES];
-/* First normalized distance for each code (0 = distance of 1) */
-
-#else
-#  include "trees.h"
-#endif /* GEN_TREES_H */
-
-struct static_tree_desc_s {
-    const ct_data *static_tree;  /* static tree or NULL */
-    const intf *extra_bits;      /* extra bits for each code or NULL */
-    int     extra_base;          /* base index for extra_bits */
-    int     elems;               /* max number of elements in the tree */
-    int     max_length;          /* max bit length for the codes */
-};
-
-local static_tree_desc  static_l_desc =
-{static_ltree, extra_lbits, LITERALS+1, L_CODES, MAX_BITS};
-
-local static_tree_desc  static_d_desc =
-{static_dtree, extra_dbits, 0,          D_CODES, MAX_BITS};
-
-local static_tree_desc  static_bl_desc =
-{(const ct_data *)0, extra_blbits, 0,   BL_CODES, MAX_BL_BITS};
-
-/* ===========================================================================
- * Local (static) routines in this file.
- */
-
-local void tr_static_init OF((void));
-local void init_block     OF((deflate_state *s));
-local void pqdownheap     OF((deflate_state *s, ct_data *tree, int k));
-local void gen_bitlen     OF((deflate_state *s, tree_desc *desc));
-local void gen_codes      OF((ct_data *tree, int max_code, ushf *bl_count));
-local void build_tree     OF((deflate_state *s, tree_desc *desc));
-local void scan_tree      OF((deflate_state *s, ct_data *tree, int max_code));
-local void send_tree      OF((deflate_state *s, ct_data *tree, int max_code));
-local int  build_bl_tree  OF((deflate_state *s));
-local void send_all_trees OF((deflate_state *s, int lcodes, int dcodes,
-                              int blcodes));
-local void compress_block OF((deflate_state *s, ct_data *ltree,
-                              ct_data *dtree));
-local void set_data_type  OF((deflate_state *s));
-local unsigned bi_reverse OF((unsigned value, int length));
-local void bi_windup      OF((deflate_state *s));
-local void bi_flush       OF((deflate_state *s));
-local void copy_block     OF((deflate_state *s, charf *buf, unsigned len,
-                              int header));
-
-#ifdef GEN_TREES_H
-local void gen_trees_header OF((void));
-#endif
-
-#ifndef DEBUG
-#  define send_code(s, c, tree) send_bits(s, tree[c].Code, tree[c].Len)
-   /* Send a code of the given tree. c and tree must not have side effects */
-
-#else /* DEBUG */
-#  define send_code(s, c, tree) \
-     { if (z_verbose>2) fprintf(stderr,"\ncd %3d ",(c)); \
-       send_bits(s, tree[c].Code, tree[c].Len); }
-#endif
-
-/* ===========================================================================
- * Output a short LSB first on the stream.
- * IN assertion: there is enough room in pendingBuf.
- */
-#define put_short(s, w) { \
-    put_byte(s, (uch)((w) & 0xff)); \
-    put_byte(s, (uch)((ush)(w) >> 8)); \
-}
-
-/* ===========================================================================
- * Send a value on a given number of bits.
- * IN assertion: length <= 16 and value fits in length bits.
- */
-#ifdef DEBUG
-local void send_bits      OF((deflate_state *s, int value, int length));
-
-local void send_bits(s, value, length)
-    deflate_state *s;
-    int value;  /* value to send */
-    int length; /* number of bits */
-{
-    Tracevv((stderr," l %2d v %4x ", length, value));
-    Assert(length > 0 && length <= 15, "invalid length");
-    s->bits_sent += (ulg)length;
-
-    /* If not enough room in bi_buf, use (valid) bits from bi_buf and
-     * (16 - bi_valid) bits from value, leaving (width - (16-bi_valid))
-     * unused bits in value.
-     */
-    if (s->bi_valid > (int)Buf_size - length) {
-        s->bi_buf |= (value << s->bi_valid);
-        put_short(s, s->bi_buf);
-        s->bi_buf = (ush)value >> (Buf_size - s->bi_valid);
-        s->bi_valid += length - Buf_size;
-    } else {
-        s->bi_buf |= value << s->bi_valid;
-        s->bi_valid += length;
-    }
-}
-#else /* !DEBUG */
-
-#define send_bits(s, value, length) \
-{ int len = length;\
-  if (s->bi_valid > (int)Buf_size - len) {\
-    int val = value;\
-    s->bi_buf |= (val << s->bi_valid);\
-    put_short(s, s->bi_buf);\
-    s->bi_buf = (ush)val >> (Buf_size - s->bi_valid);\
-    s->bi_valid += len - Buf_size;\
-  } else {\
-    s->bi_buf |= (value) << s->bi_valid;\
-    s->bi_valid += len;\
-  }\
-}
-#endif /* DEBUG */
-
-
-#define MAX(a,b) (a >= b ? a : b)
-/* the arguments must not have side effects */
-
-/* ===========================================================================
- * Initialize the various 'constant' tables.
- */
-local void tr_static_init()
-{
-#if defined(GEN_TREES_H) || !defined(STDC)
-    static int static_init_done = 0;
-    int n;        /* iterates over tree elements */
-    int bits;     /* bit counter */
-    int length;   /* length value */
-    int code;     /* code value */
-    int dist;     /* distance index */
-    ush bl_count[MAX_BITS+1];
-    /* number of codes at each bit length for an optimal tree */
-
-    if (static_init_done) return;
-
-    /* For some embedded targets, global variables are not initialized: */
-    static_l_desc.static_tree = static_ltree;
-    static_l_desc.extra_bits = extra_lbits;
-    static_d_desc.static_tree = static_dtree;
-    static_d_desc.extra_bits = extra_dbits;
-    static_bl_desc.extra_bits = extra_blbits;
-
-    /* Initialize the mapping length (0..255) -> length code (0..28) */
-    length = 0;
-    for (code = 0; code < LENGTH_CODES-1; code++) {
-        base_length[code] = length;
-        for (n = 0; n < (1<<extra_lbits[code]); n++) {
-            _length_code[length++] = (uch)code;
-        }
-    }
-    Assert (length == 256, "tr_static_init: length != 256");
-    /* Note that the length 255 (match length 258) can be represented
-     * in two different ways: code 284 + 5 bits or code 285, so we
-     * overwrite length_code[255] to use the best encoding:
-     */
-    _length_code[length-1] = (uch)code;
-
-    /* Initialize the mapping dist (0..32K) -> dist code (0..29) */
-    dist = 0;
-    for (code = 0 ; code < 16; code++) {
-        base_dist[code] = dist;
-        for (n = 0; n < (1<<extra_dbits[code]); n++) {
-            _dist_code[dist++] = (uch)code;
-        }
-    }
-    Assert (dist == 256, "tr_static_init: dist != 256");
-    dist >>= 7; /* from now on, all distances are divided by 128 */
-    for ( ; code < D_CODES; code++) {
-        base_dist[code] = dist << 7;
-        for (n = 0; n < (1<<(extra_dbits[code]-7)); n++) {
-            _dist_code[256 + dist++] = (uch)code;
-        }
-    }
-    Assert (dist == 256, "tr_static_init: 256+dist != 512");
-
-    /* Construct the codes of the static literal tree */
-    for (bits = 0; bits <= MAX_BITS; bits++) bl_count[bits] = 0;
-    n = 0;
-    while (n <= 143) static_ltree[n++].Len = 8, bl_count[8]++;
-    while (n <= 255) static_ltree[n++].Len = 9, bl_count[9]++;
-    while (n <= 279) static_ltree[n++].Len = 7, bl_count[7]++;
-    while (n <= 287) static_ltree[n++].Len = 8, bl_count[8]++;
-    /* Codes 286 and 287 do not exist, but we must include them in the
-     * tree construction to get a canonical Huffman tree (longest code
-     * all ones)
-     */
-    gen_codes((ct_data *)static_ltree, L_CODES+1, bl_count);
-
-    /* The static distance tree is trivial: */
-    for (n = 0; n < D_CODES; n++) {
-        static_dtree[n].Len = 5;
-        static_dtree[n].Code = bi_reverse((unsigned)n, 5);
-    }
-    static_init_done = 1;
-
-#  ifdef GEN_TREES_H
-    gen_trees_header();
-#  endif
-#endif /* defined(GEN_TREES_H) || !defined(STDC) */
-}
-
-/* ===========================================================================
- * Genererate the file trees.h describing the static trees.
- */
-#ifdef GEN_TREES_H
-#  ifndef DEBUG
-#    include <stdio.h>
-#  endif
-
-#  define SEPARATOR(i, last, width) \
-      ((i) == (last)? "\n};\n\n" :    \
-       ((i) % (width) == (width)-1 ? ",\n" : ", "))
-
-void gen_trees_header()
-{
-    FILE *header = fopen("trees.h", "w");
-    int i;
-
-    Assert (header != NULL, "Can't open trees.h");
-    fprintf(header,
-           "/* header created automatically with -DGEN_TREES_H */\n\n");
-
-    fprintf(header, "local const ct_data static_ltree[L_CODES+2] = {\n");
-    for (i = 0; i < L_CODES+2; i++) {
-       fprintf(header, "{{%3u},{%3u}}%s", static_ltree[i].Code,
-               static_ltree[i].Len, SEPARATOR(i, L_CODES+1, 5));
-    }
-
-    fprintf(header, "local const ct_data static_dtree[D_CODES] = {\n");
-    for (i = 0; i < D_CODES; i++) {
-       fprintf(header, "{{%2u},{%2u}}%s", static_dtree[i].Code,
-               static_dtree[i].Len, SEPARATOR(i, D_CODES-1, 5));
-    }
-
-    fprintf(header, "const uch _dist_code[DIST_CODE_LEN] = {\n");
-    for (i = 0; i < DIST_CODE_LEN; i++) {
-       fprintf(header, "%2u%s", _dist_code[i],
-               SEPARATOR(i, DIST_CODE_LEN-1, 20));
-    }
-
-    fprintf(header, "const uch _length_code[MAX_MATCH-MIN_MATCH+1]= {\n");
-    for (i = 0; i < MAX_MATCH-MIN_MATCH+1; i++) {
-       fprintf(header, "%2u%s", _length_code[i],
-               SEPARATOR(i, MAX_MATCH-MIN_MATCH, 20));
-    }
-
-    fprintf(header, "local const int base_length[LENGTH_CODES] = {\n");
-    for (i = 0; i < LENGTH_CODES; i++) {
-       fprintf(header, "%1u%s", base_length[i],
-               SEPARATOR(i, LENGTH_CODES-1, 20));
-    }
-
-    fprintf(header, "local const int base_dist[D_CODES] = {\n");
-    for (i = 0; i < D_CODES; i++) {
-       fprintf(header, "%5u%s", base_dist[i],
-               SEPARATOR(i, D_CODES-1, 10));
-    }
-
-    fclose(header);
-}
-#endif /* GEN_TREES_H */
-
-/* ===========================================================================
- * Initialize the tree data structures for a new zlib stream.
- */
-void _tr_init(s)
-    deflate_state *s;
-{
-    tr_static_init();
-
-    s->l_desc.dyn_tree = s->dyn_ltree;
-    s->l_desc.stat_desc = &static_l_desc;
-
-    s->d_desc.dyn_tree = s->dyn_dtree;
-    s->d_desc.stat_desc = &static_d_desc;
-
-    s->bl_desc.dyn_tree = s->bl_tree;
-    s->bl_desc.stat_desc = &static_bl_desc;
-
-    s->bi_buf = 0;
-    s->bi_valid = 0;
-    s->last_eob_len = 8; /* enough lookahead for inflate */
-#ifdef DEBUG
-    s->compressed_len = 0L;
-    s->bits_sent = 0L;
-#endif
-
-    /* Initialize the first block of the first file: */
-    init_block(s);
-}
-
-/* ===========================================================================
- * Initialize a new block.
- */
-local void init_block(s)
-    deflate_state *s;
-{
-    int n; /* iterates over tree elements */
-
-    /* Initialize the trees. */
-    for (n = 0; n < L_CODES;  n++) s->dyn_ltree[n].Freq = 0;
-    for (n = 0; n < D_CODES;  n++) s->dyn_dtree[n].Freq = 0;
-    for (n = 0; n < BL_CODES; n++) s->bl_tree[n].Freq = 0;
-
-    s->dyn_ltree[END_BLOCK].Freq = 1;
-    s->opt_len = s->static_len = 0L;
-    s->last_lit = s->matches = 0;
-}
-
-#define SMALLEST 1
-/* Index within the heap array of least frequent node in the Huffman tree */
-
-
-/* ===========================================================================
- * Remove the smallest element from the heap and recreate the heap with
- * one less element. Updates heap and heap_len.
- */
-#define pqremove(s, tree, top) \
-{\
-    top = s->heap[SMALLEST]; \
-    s->heap[SMALLEST] = s->heap[s->heap_len--]; \
-    pqdownheap(s, tree, SMALLEST); \
-}
-
-/* ===========================================================================
- * Compares to subtrees, using the tree depth as tie breaker when
- * the subtrees have equal frequency. This minimizes the worst case length.
- */
-#define smaller(tree, n, m, depth) \
-   (tree[n].Freq < tree[m].Freq || \
-   (tree[n].Freq == tree[m].Freq && depth[n] <= depth[m]))
-
-/* ===========================================================================
- * Restore the heap property by moving down the tree starting at node k,
- * exchanging a node with the smallest of its two sons if necessary, stopping
- * when the heap property is re-established (each father smaller than its
- * two sons).
- */
-local void pqdownheap(s, tree, k)
-    deflate_state *s;
-    ct_data *tree;  /* the tree to restore */
-    int k;               /* node to move down */
-{
-    int v = s->heap[k];
-    int j = k << 1;  /* left son of k */
-    while (j <= s->heap_len) {
-        /* Set j to the smallest of the two sons: */
-        if (j < s->heap_len &&
-            smaller(tree, s->heap[j+1], s->heap[j], s->depth)) {
-            j++;
-        }
-        /* Exit if v is smaller than both sons */
-        if (smaller(tree, v, s->heap[j], s->depth)) break;
-
-        /* Exchange v with the smallest son */
-        s->heap[k] = s->heap[j];  k = j;
-
-        /* And continue down the tree, setting j to the left son of k */
-        j <<= 1;
-    }
-    s->heap[k] = v;
-}
-
-/* ===========================================================================
- * Compute the optimal bit lengths for a tree and update the total bit length
- * for the current block.
- * IN assertion: the fields freq and dad are set, heap[heap_max] and
- *    above are the tree nodes sorted by increasing frequency.
- * OUT assertions: the field len is set to the optimal bit length, the
- *     array bl_count contains the frequencies for each bit length.
- *     The length opt_len is updated; static_len is also updated if stree is
- *     not null.
- */
-local void gen_bitlen(s, desc)
-    deflate_state *s;
-    tree_desc *desc;    /* the tree descriptor */
-{
-    ct_data *tree        = desc->dyn_tree;
-    int max_code         = desc->max_code;
-    const ct_data *stree = desc->stat_desc->static_tree;
-    const intf *extra    = desc->stat_desc->extra_bits;
-    int base             = desc->stat_desc->extra_base;
-    int max_length       = desc->stat_desc->max_length;
-    int h;              /* heap index */
-    int n, m;           /* iterate over the tree elements */
-    int bits;           /* bit length */
-    int xbits;          /* extra bits */
-    ush f;              /* frequency */
-    int overflow = 0;   /* number of elements with bit length too large */
-
-    for (bits = 0; bits <= MAX_BITS; bits++) s->bl_count[bits] = 0;
-
-    /* In a first pass, compute the optimal bit lengths (which may
-     * overflow in the case of the bit length tree).
-     */
-    tree[s->heap[s->heap_max]].Len = 0; /* root of the heap */
-
-    for (h = s->heap_max+1; h < HEAP_SIZE; h++) {
-        n = s->heap[h];
-        bits = tree[tree[n].Dad].Len + 1;
-        if (bits > max_length) bits = max_length, overflow++;
-        tree[n].Len = (ush)bits;
-        /* We overwrite tree[n].Dad which is no longer needed */
-
-        if (n > max_code) continue; /* not a leaf node */
-
-        s->bl_count[bits]++;
-        xbits = 0;
-        if (n >= base) xbits = extra[n-base];
-        f = tree[n].Freq;
-        s->opt_len += (ulg)f * (bits + xbits);
-        if (stree) s->static_len += (ulg)f * (stree[n].Len + xbits);
-    }
-    if (overflow == 0) return;
-
-    Trace((stderr,"\nbit length overflow\n"));
-    /* This happens for example on obj2 and pic of the Calgary corpus */
-
-    /* Find the first bit length which could increase: */
-    do {
-        bits = max_length-1;
-        while (s->bl_count[bits] == 0) bits--;
-        s->bl_count[bits]--;      /* move one leaf down the tree */
-        s->bl_count[bits+1] += 2; /* move one overflow item as its brother */
-        s->bl_count[max_length]--;
-        /* The brother of the overflow item also moves one step up,
-         * but this does not affect bl_count[max_length]
-         */
-        overflow -= 2;
-    } while (overflow > 0);
-
-    /* Now recompute all bit lengths, scanning in increasing frequency.
-     * h is still equal to HEAP_SIZE. (It is simpler to reconstruct all
-     * lengths instead of fixing only the wrong ones. This idea is taken
-     * from 'ar' written by Haruhiko Okumura.)
-     */
-    for (bits = max_length; bits != 0; bits--) {
-        n = s->bl_count[bits];
-        while (n != 0) {
-            m = s->heap[--h];
-            if (m > max_code) continue;
-            if (tree[m].Len != (unsigned) bits) {
-                Trace((stderr,"code %d bits %d->%d\n", m, tree[m].Len, bits));
-                s->opt_len += ((long)bits - (long)tree[m].Len)
-                              *(long)tree[m].Freq;
-                tree[m].Len = (ush)bits;
-            }
-            n--;
-        }
-    }
-}
-
-/* ===========================================================================
- * Generate the codes for a given tree and bit counts (which need not be
- * optimal).
- * IN assertion: the array bl_count contains the bit length statistics for
- * the given tree and the field len is set for all tree elements.
- * OUT assertion: the field code is set for all tree elements of non
- *     zero code length.
- */
-local void gen_codes (tree, max_code, bl_count)
-    ct_data *tree;             /* the tree to decorate */
-    int max_code;              /* largest code with non zero frequency */
-    ushf *bl_count;            /* number of codes at each bit length */
-{
-    ush next_code[MAX_BITS+1]; /* next code value for each bit length */
-    ush code = 0;              /* running code value */
-    int bits;                  /* bit index */
-    int n;                     /* code index */
-
-    /* The distribution counts are first used to generate the code values
-     * without bit reversal.
-     */
-    for (bits = 1; bits <= MAX_BITS; bits++) {
-        next_code[bits] = code = (code + bl_count[bits-1]) << 1;
-    }
-    /* Check that the bit counts in bl_count are consistent. The last code
-     * must be all ones.
-     */
-    Assert (code + bl_count[MAX_BITS]-1 == (1<<MAX_BITS)-1,
-            "inconsistent bit counts");
-    Tracev((stderr,"\ngen_codes: max_code %d ", max_code));
-
-    for (n = 0;  n <= max_code; n++) {
-        int len = tree[n].Len;
-        if (len == 0) continue;
-        /* Now reverse the bits */
-        tree[n].Code = bi_reverse(next_code[len]++, len);
-
-        Tracecv(tree != static_ltree, (stderr,"\nn %3d %c l %2d c %4x (%x) ",
-             n, (isgraph(n) ? n : ' '), len, tree[n].Code, next_code[len]-1));
-    }
-}
-
-/* ===========================================================================
- * Construct one Huffman tree and assigns the code bit strings and lengths.
- * Update the total bit length for the current block.
- * IN assertion: the field freq is set for all tree elements.
- * OUT assertions: the fields len and code are set to the optimal bit length
- *     and corresponding code. The length opt_len is updated; static_len is
- *     also updated if stree is not null. The field max_code is set.
- */
-local void build_tree(s, desc)
-    deflate_state *s;
-    tree_desc *desc; /* the tree descriptor */
-{
-    ct_data *tree         = desc->dyn_tree;
-    const ct_data *stree  = desc->stat_desc->static_tree;
-    int elems             = desc->stat_desc->elems;
-    int n, m;          /* iterate over heap elements */
-    int max_code = -1; /* largest code with non zero frequency */
-    int node;          /* new node being created */
-
-    /* Construct the initial heap, with least frequent element in
-     * heap[SMALLEST]. The sons of heap[n] are heap[2*n] and heap[2*n+1].
-     * heap[0] is not used.
-     */
-    s->heap_len = 0, s->heap_max = HEAP_SIZE;
-
-    for (n = 0; n < elems; n++) {
-        if (tree[n].Freq != 0) {
-            s->heap[++(s->heap_len)] = max_code = n;
-            s->depth[n] = 0;
-        } else {
-            tree[n].Len = 0;
-        }
-    }
-
-    /* The pkzip format requires that at least one distance code exists,
-     * and that at least one bit should be sent even if there is only one
-     * possible code. So to avoid special checks later on we force at least
-     * two codes of non zero frequency.
-     */
-    while (s->heap_len < 2) {
-        node = s->heap[++(s->heap_len)] = (max_code < 2 ? ++max_code : 0);
-        tree[node].Freq = 1;
-        s->depth[node] = 0;
-        s->opt_len--; if (stree) s->static_len -= stree[node].Len;
-        /* node is 0 or 1 so it does not have extra bits */
-    }
-    desc->max_code = max_code;
-
-    /* The elements heap[heap_len/2+1 .. heap_len] are leaves of the tree,
-     * establish sub-heaps of increasing lengths:
-     */
-    for (n = s->heap_len/2; n >= 1; n--) pqdownheap(s, tree, n);
-
-    /* Construct the Huffman tree by repeatedly combining the least two
-     * frequent nodes.
-     */
-    node = elems;              /* next internal node of the tree */
-    do {
-        pqremove(s, tree, n);  /* n = node of least frequency */
-        m = s->heap[SMALLEST]; /* m = node of next least frequency */
-
-        s->heap[--(s->heap_max)] = n; /* keep the nodes sorted by frequency */
-        s->heap[--(s->heap_max)] = m;
-
-        /* Create a new node father of n and m */
-        tree[node].Freq = tree[n].Freq + tree[m].Freq;
-        s->depth[node] = (uch) (MAX(s->depth[n], s->depth[m]) + 1);
-        tree[n].Dad = tree[m].Dad = (ush)node;
-#ifdef DUMP_BL_TREE
-        if (tree == s->bl_tree) {
-            fprintf(stderr,"\nnode %d(%d), sons %d(%d) %d(%d)",
-                    node, tree[node].Freq, n, tree[n].Freq, m, tree[m].Freq);
-        }
-#endif
-        /* and insert the new node in the heap */
-        s->heap[SMALLEST] = node++;
-        pqdownheap(s, tree, SMALLEST);
-
-    } while (s->heap_len >= 2);
-
-    s->heap[--(s->heap_max)] = s->heap[SMALLEST];
-
-    /* At this point, the fields freq and dad are set. We can now
-     * generate the bit lengths.
-     */
-    gen_bitlen(s, (tree_desc *)desc);
-
-    /* The field len is now set, we can generate the bit codes */
-    gen_codes ((ct_data *)tree, max_code, s->bl_count);
-}
-
-/* ===========================================================================
- * Scan a literal or distance tree to determine the frequencies of the codes
- * in the bit length tree.
- */
-local void scan_tree (s, tree, max_code)
-    deflate_state *s;
-    ct_data *tree;   /* the tree to be scanned */
-    int max_code;    /* and its largest code of non zero frequency */
-{
-    int n;                     /* iterates over all tree elements */
-    int prevlen = -1;          /* last emitted length */
-    int curlen;                /* length of current code */
-    int nextlen = tree[0].Len; /* length of next code */
-    int count = 0;             /* repeat count of the current code */
-    int max_count = 7;         /* max repeat count */
-    int min_count = 4;         /* min repeat count */
-
-    if (nextlen == 0) max_count = 138, min_count = 3;
-    tree[max_code+1].Len = (ush)0xffff; /* guard */
-
-    for (n = 0; n <= max_code; n++) {
-        curlen = nextlen; nextlen = tree[n+1].Len;
-        if (++count < max_count && curlen == nextlen) {
-            continue;
-        } else if (count < min_count) {
-            s->bl_tree[curlen].Freq += count;
-        } else if (curlen != 0) {
-            if (curlen != prevlen) s->bl_tree[curlen].Freq++;
-            s->bl_tree[REP_3_6].Freq++;
-        } else if (count <= 10) {
-            s->bl_tree[REPZ_3_10].Freq++;
-        } else {
-            s->bl_tree[REPZ_11_138].Freq++;
-        }
-        count = 0; prevlen = curlen;
-        if (nextlen == 0) {
-            max_count = 138, min_count = 3;
-        } else if (curlen == nextlen) {
-            max_count = 6, min_count = 3;
-        } else {
-            max_count = 7, min_count = 4;
-        }
-    }
-}
-
-/* ===========================================================================
- * Send a literal or distance tree in compressed form, using the codes in
- * bl_tree.
- */
-local void send_tree (s, tree, max_code)
-    deflate_state *s;
-    ct_data *tree; /* the tree to be scanned */
-    int max_code;       /* and its largest code of non zero frequency */
-{
-    int n;                     /* iterates over all tree elements */
-    int prevlen = -1;          /* last emitted length */
-    int curlen;                /* length of current code */
-    int nextlen = tree[0].Len; /* length of next code */
-    int count = 0;             /* repeat count of the current code */
-    int max_count = 7;         /* max repeat count */
-    int min_count = 4;         /* min repeat count */
-
-    /* tree[max_code+1].Len = -1; */  /* guard already set */
-    if (nextlen == 0) max_count = 138, min_count = 3;
-
-    for (n = 0; n <= max_code; n++) {
-        curlen = nextlen; nextlen = tree[n+1].Len;
-        if (++count < max_count && curlen == nextlen) {
-            continue;
-        } else if (count < min_count) {
-            do { send_code(s, curlen, s->bl_tree); } while (--count != 0);
-
-        } else if (curlen != 0) {
-            if (curlen != prevlen) {
-                send_code(s, curlen, s->bl_tree); count--;
-            }
-            Assert(count >= 3 && count <= 6, " 3_6?");
-            send_code(s, REP_3_6, s->bl_tree); send_bits(s, count-3, 2);
-
-        } else if (count <= 10) {
-            send_code(s, REPZ_3_10, s->bl_tree); send_bits(s, count-3, 3);
-
-        } else {
-            send_code(s, REPZ_11_138, s->bl_tree); send_bits(s, count-11, 7);
-        }
-        count = 0; prevlen = curlen;
-        if (nextlen == 0) {
-            max_count = 138, min_count = 3;
-        } else if (curlen == nextlen) {
-            max_count = 6, min_count = 3;
-        } else {
-            max_count = 7, min_count = 4;
-        }
-    }
-}
-
-/* ===========================================================================
- * Construct the Huffman tree for the bit lengths and return the index in
- * bl_order of the last bit length code to send.
- */
-local int build_bl_tree(s)
-    deflate_state *s;
-{
-    int max_blindex;  /* index of last bit length code of non zero freq */
-
-    /* Determine the bit length frequencies for literal and distance trees */
-    scan_tree(s, (ct_data *)s->dyn_ltree, s->l_desc.max_code);
-    scan_tree(s, (ct_data *)s->dyn_dtree, s->d_desc.max_code);
-
-    /* Build the bit length tree: */
-    build_tree(s, (tree_desc *)(&(s->bl_desc)));
-    /* opt_len now includes the length of the tree representations, except
-     * the lengths of the bit lengths codes and the 5+5+4 bits for the counts.
-     */
-
-    /* Determine the number of bit length codes to send. The pkzip format
-     * requires that at least 4 bit length codes be sent. (appnote.txt says
-     * 3 but the actual value used is 4.)
-     */
-    for (max_blindex = BL_CODES-1; max_blindex >= 3; max_blindex--) {
-        if (s->bl_tree[bl_order[max_blindex]].Len != 0) break;
-    }
-    /* Update opt_len to include the bit length tree and counts */
-    s->opt_len += 3*(max_blindex+1) + 5+5+4;
-    Tracev((stderr, "\ndyn trees: dyn %ld, stat %ld",
-            s->opt_len, s->static_len));
-
-    return max_blindex;
-}
-
-/* ===========================================================================
- * Send the header for a block using dynamic Huffman trees: the counts, the
- * lengths of the bit length codes, the literal tree and the distance tree.
- * IN assertion: lcodes >= 257, dcodes >= 1, blcodes >= 4.
- */
-local void send_all_trees(s, lcodes, dcodes, blcodes)
-    deflate_state *s;
-    int lcodes, dcodes, blcodes; /* number of codes for each tree */
-{
-    int rank;                    /* index in bl_order */
-
-    Assert (lcodes >= 257 && dcodes >= 1 && blcodes >= 4, "not enough codes");
-    Assert (lcodes <= L_CODES && dcodes <= D_CODES && blcodes <= BL_CODES,
-            "too many codes");
-    Tracev((stderr, "\nbl counts: "));
-    send_bits(s, lcodes-257, 5); /* not +255 as stated in appnote.txt */
-    send_bits(s, dcodes-1,   5);
-    send_bits(s, blcodes-4,  4); /* not -3 as stated in appnote.txt */
-    for (rank = 0; rank < blcodes; rank++) {
-        Tracev((stderr, "\nbl code %2d ", bl_order[rank]));
-        send_bits(s, s->bl_tree[bl_order[rank]].Len, 3);
-    }
-    Tracev((stderr, "\nbl tree: sent %ld", s->bits_sent));
-
-    send_tree(s, (ct_data *)s->dyn_ltree, lcodes-1); /* literal tree */
-    Tracev((stderr, "\nlit tree: sent %ld", s->bits_sent));
-
-    send_tree(s, (ct_data *)s->dyn_dtree, dcodes-1); /* distance tree */
-    Tracev((stderr, "\ndist tree: sent %ld", s->bits_sent));
-}
-
-/* ===========================================================================
- * Send a stored block
- */
-void _tr_stored_block(s, buf, stored_len, eof)
-    deflate_state *s;
-    charf *buf;       /* input block */
-    ulg stored_len;   /* length of input block */
-    int eof;          /* true if this is the last block for a file */
-{
-    send_bits(s, (STORED_BLOCK<<1)+eof, 3);  /* send block type */
-#ifdef DEBUG
-    s->compressed_len = (s->compressed_len + 3 + 7) & (ulg)~7L;
-    s->compressed_len += (stored_len + 4) << 3;
-#endif
-    copy_block(s, buf, (unsigned)stored_len, 1); /* with header */
-}
-
-/* ===========================================================================
- * Send one empty static block to give enough lookahead for inflate.
- * This takes 10 bits, of which 7 may remain in the bit buffer.
- * The current inflate code requires 9 bits of lookahead. If the
- * last two codes for the previous block (real code plus EOB) were coded
- * on 5 bits or less, inflate may have only 5+3 bits of lookahead to decode
- * the last real code. In this case we send two empty static blocks instead
- * of one. (There are no problems if the previous block is stored or fixed.)
- * To simplify the code, we assume the worst case of last real code encoded
- * on one bit only.
- */
-void _tr_align(s)
-    deflate_state *s;
-{
-    send_bits(s, STATIC_TREES<<1, 3);
-    send_code(s, END_BLOCK, static_ltree);
-#ifdef DEBUG
-    s->compressed_len += 10L; /* 3 for block type, 7 for EOB */
-#endif
-    bi_flush(s);
-    /* Of the 10 bits for the empty block, we have already sent
-     * (10 - bi_valid) bits. The lookahead for the last real code (before
-     * the EOB of the previous block) was thus at least one plus the length
-     * of the EOB plus what we have just sent of the empty static block.
-     */
-    if (1 + s->last_eob_len + 10 - s->bi_valid < 9) {
-        send_bits(s, STATIC_TREES<<1, 3);
-        send_code(s, END_BLOCK, static_ltree);
-#ifdef DEBUG
-        s->compressed_len += 10L;
-#endif
-        bi_flush(s);
-    }
-    s->last_eob_len = 7;
-}
-
-/* ===========================================================================
- * Determine the best encoding for the current block: dynamic trees, static
- * trees or store, and output the encoded block to the zip file.
- */
-void _tr_flush_block(s, buf, stored_len, eof)
-    deflate_state *s;
-    charf *buf;       /* input block, or NULL if too old */
-    ulg stored_len;   /* length of input block */
-    int eof;          /* true if this is the last block for a file */
-{
-    ulg opt_lenb, static_lenb; /* opt_len and static_len in bytes */
-    int max_blindex = 0;  /* index of last bit length code of non zero freq */
-
-    /* Build the Huffman trees unless a stored block is forced */
-    if (s->level > 0) {
-
-        /* Check if the file is ascii or binary */
-       if (s->data_type == Z_UNKNOWN) set_data_type(s);
-
-       /* Construct the literal and distance trees */
-       build_tree(s, (tree_desc *)(&(s->l_desc)));
-       Tracev((stderr, "\nlit data: dyn %ld, stat %ld", s->opt_len,
-               s->static_len));
-
-       build_tree(s, (tree_desc *)(&(s->d_desc)));
-       Tracev((stderr, "\ndist data: dyn %ld, stat %ld", s->opt_len,
-               s->static_len));
-       /* At this point, opt_len and static_len are the total bit lengths of
-        * the compressed block data, excluding the tree representations.
-        */
-
-       /* Build the bit length tree for the above two trees, and get the index
-        * in bl_order of the last bit length code to send.
-        */
-       max_blindex = build_bl_tree(s);
-
-       /* Determine the best encoding. Compute first the block length in bytes*/
-       opt_lenb = (s->opt_len+3+7)>>3;
-       static_lenb = (s->static_len+3+7)>>3;
-
-       Tracev((stderr, "\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u ",
-               opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,
-               s->last_lit));
-
-       if (static_lenb <= opt_lenb) opt_lenb = static_lenb;
-
-    } else {
-        Assert(buf != (char*)0, "lost buf");
-       opt_lenb = static_lenb = stored_len + 5; /* force a stored block */
-    }
-
-#ifdef FORCE_STORED
-    if (buf != (char*)0) { /* force stored block */
-#else
-    if (stored_len+4 <= opt_lenb && buf != (char*)0) {
-                       /* 4: two words for the lengths */
-#endif
-        /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.
-         * Otherwise we can't have processed more than WSIZE input bytes since
-         * the last block flush, because compression would have been
-         * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to
-         * transform a block into a stored block.
-         */
-        _tr_stored_block(s, buf, stored_len, eof);
-
-#ifdef FORCE_STATIC
-    } else if (static_lenb >= 0) { /* force static trees */
-#else
-    } else if (static_lenb == opt_lenb) {
-#endif
-        send_bits(s, (STATIC_TREES<<1)+eof, 3);
-        compress_block(s, (ct_data *)static_ltree, (ct_data *)static_dtree);
-#ifdef DEBUG
-        s->compressed_len += 3 + s->static_len;
-#endif
-    } else {
-        send_bits(s, (DYN_TREES<<1)+eof, 3);
-        send_all_trees(s, s->l_desc.max_code+1, s->d_desc.max_code+1,
-                       max_blindex+1);
-        compress_block(s, (ct_data *)s->dyn_ltree, (ct_data *)s->dyn_dtree);
-#ifdef DEBUG
-        s->compressed_len += 3 + s->opt_len;
-#endif
-    }
-    Assert (s->compressed_len == s->bits_sent, "bad compressed size");
-    /* The above check is made mod 2^32, for files larger than 512 MB
-     * and uLong implemented on 32 bits.
-     */
-    init_block(s);
-
-    if (eof) {
-        bi_windup(s);
-#ifdef DEBUG
-        s->compressed_len += 7;  /* align on byte boundary */
-#endif
-    }
-    Tracev((stderr,"\ncomprlen %lu(%lu) ", s->compressed_len>>3,
-           s->compressed_len-7*eof));
-}
-
-/* ===========================================================================
- * Save the match info and tally the frequency counts. Return true if
- * the current block must be flushed.
- */
-int _tr_tally (s, dist, lc)
-    deflate_state *s;
-    unsigned dist;  /* distance of matched string */
-    unsigned lc;    /* match length-MIN_MATCH or unmatched char (if dist==0) */
-{
-    s->d_buf[s->last_lit] = (ush)dist;
-    s->l_buf[s->last_lit++] = (uch)lc;
-    if (dist == 0) {
-        /* lc is the unmatched char */
-        s->dyn_ltree[lc].Freq++;
-    } else {
-        s->matches++;
-        /* Here, lc is the match length - MIN_MATCH */
-        dist--;             /* dist = match distance - 1 */
-        Assert((ush)dist < (ush)MAX_DIST(s) &&
-               (ush)lc <= (ush)(MAX_MATCH-MIN_MATCH) &&
-               (ush)d_code(dist) < (ush)D_CODES,  "_tr_tally: bad match");
-
-        s->dyn_ltree[_length_code[lc]+LITERALS+1].Freq++;
-        s->dyn_dtree[d_code(dist)].Freq++;
-    }
-
-#ifdef TRUNCATE_BLOCK
-    /* Try to guess if it is profitable to stop the current block here */
-    if ((s->last_lit & 0x1fff) == 0 && s->level > 2) {
-        /* Compute an upper bound for the compressed length */
-        ulg out_length = (ulg)s->last_lit*8L;
-        ulg in_length = (ulg)((long)s->strstart - s->block_start);
-        int dcode;
-        for (dcode = 0; dcode < D_CODES; dcode++) {
-            out_length += (ulg)s->dyn_dtree[dcode].Freq *
-                (5L+extra_dbits[dcode]);
-        }
-        out_length >>= 3;
-        Tracev((stderr,"\nlast_lit %u, in %ld, out ~%ld(%ld%%) ",
-               s->last_lit, in_length, out_length,
-               100L - out_length*100L/in_length));
-        if (s->matches < s->last_lit/2 && out_length < in_length/2) return 1;
-    }
-#endif
-    return (s->last_lit == s->lit_bufsize-1);
-    /* We avoid equality with lit_bufsize because of wraparound at 64K
-     * on 16 bit machines and because stored blocks are restricted to
-     * 64K-1 bytes.
-     */
-}
-
-/* ===========================================================================
- * Send the block data compressed using the given Huffman trees
- */
-local void compress_block(s, ltree, dtree)
-    deflate_state *s;
-    ct_data *ltree; /* literal tree */
-    ct_data *dtree; /* distance tree */
-{
-    unsigned dist;      /* distance of matched string */
-    int lc;             /* match length or unmatched char (if dist == 0) */
-    unsigned lx = 0;    /* running index in l_buf */
-    unsigned code;      /* the code to send */
-    int extra;          /* number of extra bits to send */
-
-    if (s->last_lit != 0) do {
-        dist = s->d_buf[lx];
-        lc = s->l_buf[lx++];
-        if (dist == 0) {
-            send_code(s, lc, ltree); /* send a literal byte */
-            Tracecv(isgraph(lc), (stderr," '%c' ", lc));
-        } else {
-            /* Here, lc is the match length - MIN_MATCH */
-            code = _length_code[lc];
-            send_code(s, code+LITERALS+1, ltree); /* send the length code */
-            extra = extra_lbits[code];
-            if (extra != 0) {
-                lc -= base_length[code];
-                send_bits(s, lc, extra);       /* send the extra length bits */
-            }
-            dist--; /* dist is now the match distance - 1 */
-            code = d_code(dist);
-            Assert (code < D_CODES, "bad d_code");
-
-            send_code(s, code, dtree);       /* send the distance code */
-            extra = extra_dbits[code];
-            if (extra != 0) {
-                dist -= base_dist[code];
-                send_bits(s, dist, extra);   /* send the extra distance bits */
-            }
-        } /* literal or match pair ? */
-
-        /* Check that the overlay between pending_buf and d_buf+l_buf is ok: */
-        Assert(s->pending < s->lit_bufsize + 2*lx, "pendingBuf overflow");
-
-    } while (lx < s->last_lit);
-
-    send_code(s, END_BLOCK, ltree);
-    s->last_eob_len = ltree[END_BLOCK].Len;
-}
-
-/* ===========================================================================
- * Set the data type to ASCII or BINARY, using a crude approximation:
- * binary if more than 20% of the bytes are <= 6 or >= 128, ascii otherwise.
- * IN assertion: the fields freq of dyn_ltree are set and the total of all
- * frequencies does not exceed 64K (to fit in an int on 16 bit machines).
- */
-local void set_data_type(s)
-    deflate_state *s;
-{
-    int n = 0;
-    unsigned ascii_freq = 0;
-    unsigned bin_freq = 0;
-    while (n < 7)        bin_freq += s->dyn_ltree[n++].Freq;
-    while (n < 128)    ascii_freq += s->dyn_ltree[n++].Freq;
-    while (n < LITERALS) bin_freq += s->dyn_ltree[n++].Freq;
-    s->data_type = (Byte)(bin_freq > (ascii_freq >> 2) ? Z_BINARY : Z_ASCII);
-}
-
-/* ===========================================================================
- * Reverse the first len bits of a code, using straightforward code (a faster
- * method would use a table)
- * IN assertion: 1 <= len <= 15
- */
-local unsigned bi_reverse(code, len)
-    unsigned code; /* the value to invert */
-    int len;       /* its bit length */
-{
-    register unsigned res = 0;
-    do {
-        res |= code & 1;
-        code >>= 1, res <<= 1;
-    } while (--len > 0);
-    return res >> 1;
-}
-
-/* ===========================================================================
- * Flush the bit buffer, keeping at most 7 bits in it.
- */
-local void bi_flush(s)
-    deflate_state *s;
-{
-    if (s->bi_valid == 16) {
-        put_short(s, s->bi_buf);
-        s->bi_buf = 0;
-        s->bi_valid = 0;
-    } else if (s->bi_valid >= 8) {
-        put_byte(s, (Byte)s->bi_buf);
-        s->bi_buf >>= 8;
-        s->bi_valid -= 8;
-    }
-}
-
-/* ===========================================================================
- * Flush the bit buffer and align the output on a byte boundary
- */
-local void bi_windup(s)
-    deflate_state *s;
-{
-    if (s->bi_valid > 8) {
-        put_short(s, s->bi_buf);
-    } else if (s->bi_valid > 0) {
-        put_byte(s, (Byte)s->bi_buf);
-    }
-    s->bi_buf = 0;
-    s->bi_valid = 0;
-#ifdef DEBUG
-    s->bits_sent = (s->bits_sent+7) & ~7;
-#endif
-}
-
-/* ===========================================================================
- * Copy a stored block, storing first the length and its
- * one's complement if requested.
- */
-local void copy_block(s, buf, len, header)
-    deflate_state *s;
-    charf    *buf;    /* the input data */
-    unsigned len;     /* its length */
-    int      header;  /* true if block header must be written */
-{
-    bi_windup(s);        /* align on byte boundary */
-    s->last_eob_len = 8; /* enough lookahead for inflate */
-
-    if (header) {
-        put_short(s, (ush)len);   
-        put_short(s, (ush)~len);
-#ifdef DEBUG
-        s->bits_sent += 2*16;
-#endif
-    }
-#ifdef DEBUG
-    s->bits_sent += (ulg)len<<3;
-#endif
-    while (len--) {
-        put_byte(s, *buf++);
-    }
-}
diff --git a/lib/zlib/trees.h b/lib/zlib/trees.h
deleted file mode 100644 (file)
index 72facf9..0000000
+++ /dev/null
@@ -1,128 +0,0 @@
-/* header created automatically with -DGEN_TREES_H */
-
-local const ct_data static_ltree[L_CODES+2] = {
-{{ 12},{  8}}, {{140},{  8}}, {{ 76},{  8}}, {{204},{  8}}, {{ 44},{  8}},
-{{172},{  8}}, {{108},{  8}}, {{236},{  8}}, {{ 28},{  8}}, {{156},{  8}},
-{{ 92},{  8}}, {{220},{  8}}, {{ 60},{  8}}, {{188},{  8}}, {{124},{  8}},
-{{252},{  8}}, {{  2},{  8}}, {{130},{  8}}, {{ 66},{  8}}, {{194},{  8}},
-{{ 34},{  8}}, {{162},{  8}}, {{ 98},{  8}}, {{226},{  8}}, {{ 18},{  8}},
-{{146},{  8}}, {{ 82},{  8}}, {{210},{  8}}, {{ 50},{  8}}, {{178},{  8}},
-{{114},{  8}}, {{242},{  8}}, {{ 10},{  8}}, {{138},{  8}}, {{ 74},{  8}},
-{{202},{  8}}, {{ 42},{  8}}, {{170},{  8}}, {{106},{  8}}, {{234},{  8}},
-{{ 26},{  8}}, {{154},{  8}}, {{ 90},{  8}}, {{218},{  8}}, {{ 58},{  8}},
-{{186},{  8}}, {{122},{  8}}, {{250},{  8}}, {{  6},{  8}}, {{134},{  8}},
-{{ 70},{  8}}, {{198},{  8}}, {{ 38},{  8}}, {{166},{  8}}, {{102},{  8}},
-{{230},{  8}}, {{ 22},{  8}}, {{150},{  8}}, {{ 86},{  8}}, {{214},{  8}},
-{{ 54},{  8}}, {{182},{  8}}, {{118},{  8}}, {{246},{  8}}, {{ 14},{  8}},
-{{142},{  8}}, {{ 78},{  8}}, {{206},{  8}}, {{ 46},{  8}}, {{174},{  8}},
-{{110},{  8}}, {{238},{  8}}, {{ 30},{  8}}, {{158},{  8}}, {{ 94},{  8}},
-{{222},{  8}}, {{ 62},{  8}}, {{190},{  8}}, {{126},{  8}}, {{254},{  8}},
-{{  1},{  8}}, {{129},{  8}}, {{ 65},{  8}}, {{193},{  8}}, {{ 33},{  8}},
-{{161},{  8}}, {{ 97},{  8}}, {{225},{  8}}, {{ 17},{  8}}, {{145},{  8}},
-{{ 81},{  8}}, {{209},{  8}}, {{ 49},{  8}}, {{177},{  8}}, {{113},{  8}},
-{{241},{  8}}, {{  9},{  8}}, {{137},{  8}}, {{ 73},{  8}}, {{201},{  8}},
-{{ 41},{  8}}, {{169},{  8}}, {{105},{  8}}, {{233},{  8}}, {{ 25},{  8}},
-{{153},{  8}}, {{ 89},{  8}}, {{217},{  8}}, {{ 57},{  8}}, {{185},{  8}},
-{{121},{  8}}, {{249},{  8}}, {{  5},{  8}}, {{133},{  8}}, {{ 69},{  8}},
-{{197},{  8}}, {{ 37},{  8}}, {{165},{  8}}, {{101},{  8}}, {{229},{  8}},
-{{ 21},{  8}}, {{149},{  8}}, {{ 85},{  8}}, {{213},{  8}}, {{ 53},{  8}},
-{{181},{  8}}, {{117},{  8}}, {{245},{  8}}, {{ 13},{  8}}, {{141},{  8}},
-{{ 77},{  8}}, {{205},{  8}}, {{ 45},{  8}}, {{173},{  8}}, {{109},{  8}},
-{{237},{  8}}, {{ 29},{  8}}, {{157},{  8}}, {{ 93},{  8}}, {{221},{  8}},
-{{ 61},{  8}}, {{189},{  8}}, {{125},{  8}}, {{253},{  8}}, {{ 19},{  9}},
-{{275},{  9}}, {{147},{  9}}, {{403},{  9}}, {{ 83},{  9}}, {{339},{  9}},
-{{211},{  9}}, {{467},{  9}}, {{ 51},{  9}}, {{307},{  9}}, {{179},{  9}},
-{{435},{  9}}, {{115},{  9}}, {{371},{  9}}, {{243},{  9}}, {{499},{  9}},
-{{ 11},{  9}}, {{267},{  9}}, {{139},{  9}}, {{395},{  9}}, {{ 75},{  9}},
-{{331},{  9}}, {{203},{  9}}, {{459},{  9}}, {{ 43},{  9}}, {{299},{  9}},
-{{171},{  9}}, {{427},{  9}}, {{107},{  9}}, {{363},{  9}}, {{235},{  9}},
-{{491},{  9}}, {{ 27},{  9}}, {{283},{  9}}, {{155},{  9}}, {{411},{  9}},
-{{ 91},{  9}}, {{347},{  9}}, {{219},{  9}}, {{475},{  9}}, {{ 59},{  9}},
-{{315},{  9}}, {{187},{  9}}, {{443},{  9}}, {{123},{  9}}, {{379},{  9}},
-{{251},{  9}}, {{507},{  9}}, {{  7},{  9}}, {{263},{  9}}, {{135},{  9}},
-{{391},{  9}}, {{ 71},{  9}}, {{327},{  9}}, {{199},{  9}}, {{455},{  9}},
-{{ 39},{  9}}, {{295},{  9}}, {{167},{  9}}, {{423},{  9}}, {{103},{  9}},
-{{359},{  9}}, {{231},{  9}}, {{487},{  9}}, {{ 23},{  9}}, {{279},{  9}},
-{{151},{  9}}, {{407},{  9}}, {{ 87},{  9}}, {{343},{  9}}, {{215},{  9}},
-{{471},{  9}}, {{ 55},{  9}}, {{311},{  9}}, {{183},{  9}}, {{439},{  9}},
-{{119},{  9}}, {{375},{  9}}, {{247},{  9}}, {{503},{  9}}, {{ 15},{  9}},
-{{271},{  9}}, {{143},{  9}}, {{399},{  9}}, {{ 79},{  9}}, {{335},{  9}},
-{{207},{  9}}, {{463},{  9}}, {{ 47},{  9}}, {{303},{  9}}, {{175},{  9}},
-{{431},{  9}}, {{111},{  9}}, {{367},{  9}}, {{239},{  9}}, {{495},{  9}},
-{{ 31},{  9}}, {{287},{  9}}, {{159},{  9}}, {{415},{  9}}, {{ 95},{  9}},
-{{351},{  9}}, {{223},{  9}}, {{479},{  9}}, {{ 63},{  9}}, {{319},{  9}},
-{{191},{  9}}, {{447},{  9}}, {{127},{  9}}, {{383},{  9}}, {{255},{  9}},
-{{511},{  9}}, {{  0},{  7}}, {{ 64},{  7}}, {{ 32},{  7}}, {{ 96},{  7}},
-{{ 16},{  7}}, {{ 80},{  7}}, {{ 48},{  7}}, {{112},{  7}}, {{  8},{  7}},
-{{ 72},{  7}}, {{ 40},{  7}}, {{104},{  7}}, {{ 24},{  7}}, {{ 88},{  7}},
-{{ 56},{  7}}, {{120},{  7}}, {{  4},{  7}}, {{ 68},{  7}}, {{ 36},{  7}},
-{{100},{  7}}, {{ 20},{  7}}, {{ 84},{  7}}, {{ 52},{  7}}, {{116},{  7}},
-{{  3},{  8}}, {{131},{  8}}, {{ 67},{  8}}, {{195},{  8}}, {{ 35},{  8}},
-{{163},{  8}}, {{ 99},{  8}}, {{227},{  8}}
-};
-
-local const ct_data static_dtree[D_CODES] = {
-{{ 0},{ 5}}, {{16},{ 5}}, {{ 8},{ 5}}, {{24},{ 5}}, {{ 4},{ 5}},
-{{20},{ 5}}, {{12},{ 5}}, {{28},{ 5}}, {{ 2},{ 5}}, {{18},{ 5}},
-{{10},{ 5}}, {{26},{ 5}}, {{ 6},{ 5}}, {{22},{ 5}}, {{14},{ 5}},
-{{30},{ 5}}, {{ 1},{ 5}}, {{17},{ 5}}, {{ 9},{ 5}}, {{25},{ 5}},
-{{ 5},{ 5}}, {{21},{ 5}}, {{13},{ 5}}, {{29},{ 5}}, {{ 3},{ 5}},
-{{19},{ 5}}, {{11},{ 5}}, {{27},{ 5}}, {{ 7},{ 5}}, {{23},{ 5}}
-};
-
-const uch _dist_code[DIST_CODE_LEN] = {
- 0,  1,  2,  3,  4,  4,  5,  5,  6,  6,  6,  6,  7,  7,  7,  7,  8,  8,  8,  8,
- 8,  8,  8,  8,  9,  9,  9,  9,  9,  9,  9,  9, 10, 10, 10, 10, 10, 10, 10, 10,
-10, 10, 10, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
-11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
-12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 13, 13, 13, 13,
-13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
-13, 13, 13, 13, 13, 13, 13, 13, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
-14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
-14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
-14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 15, 15, 15, 15, 15, 15, 15, 15,
-15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
-15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
-15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  0,  0, 16, 17,
-18, 18, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 22, 22, 22, 22, 22, 22, 22, 22,
-23, 23, 23, 23, 23, 23, 23, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
-24, 24, 24, 24, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25,
-26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26,
-26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 27, 27, 27, 27, 27, 27, 27, 27,
-27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
-27, 27, 27, 27, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
-28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
-28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
-28, 28, 28, 28, 28, 28, 28, 28, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29,
-29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29,
-29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29,
-29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29
-};
-
-const uch _length_code[MAX_MATCH-MIN_MATCH+1]= {
- 0,  1,  2,  3,  4,  5,  6,  7,  8,  8,  9,  9, 10, 10, 11, 11, 12, 12, 12, 12,
-13, 13, 13, 13, 14, 14, 14, 14, 15, 15, 15, 15, 16, 16, 16, 16, 16, 16, 16, 16,
-17, 17, 17, 17, 17, 17, 17, 17, 18, 18, 18, 18, 18, 18, 18, 18, 19, 19, 19, 19,
-19, 19, 19, 19, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
-21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 22, 22, 22, 22,
-22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 23, 23, 23, 23, 23, 23, 23, 23,
-23, 23, 23, 23, 23, 23, 23, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
-24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
-25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25,
-25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 26, 26, 26, 26, 26, 26, 26, 26,
-26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26,
-26, 26, 26, 26, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
-27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 28
-};
-
-local const int base_length[LENGTH_CODES] = {
-0, 1, 2, 3, 4, 5, 6, 7, 8, 10, 12, 14, 16, 20, 24, 28, 32, 40, 48, 56,
-64, 80, 96, 112, 128, 160, 192, 224, 0
-};
-
-local const int base_dist[D_CODES] = {
-    0,     1,     2,     3,     4,     6,     8,    12,    16,    24,
-   32,    48,    64,    96,   128,   192,   256,   384,   512,   768,
- 1024,  1536,  2048,  3072,  4096,  6144,  8192, 12288, 16384, 24576
-};
-
diff --git a/lib/zlib/uncompr.c b/lib/zlib/uncompr.c
deleted file mode 100644 (file)
index a287714..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-/* uncompr.c -- decompress a memory buffer
- * Copyright (C) 1995-2002 Jean-loup Gailly.
- * For conditions of distribution and use, see copyright notice in zlib.h 
- */
-
-/* @(#) $Id$ */
-
-#include "zlib.h"
-
-/* ===========================================================================
-     Decompresses the source buffer into the destination buffer.  sourceLen is
-   the byte length of the source buffer. Upon entry, destLen is the total
-   size of the destination buffer, which must be large enough to hold the
-   entire uncompressed data. (The size of the uncompressed data must have
-   been saved previously by the compressor and transmitted to the decompressor
-   by some mechanism outside the scope of this compression library.)
-   Upon exit, destLen is the actual size of the compressed buffer.
-     This function can be used to decompress a whole file at once if the
-   input file is mmap'ed.
-
-     uncompress returns Z_OK if success, Z_MEM_ERROR if there was not
-   enough memory, Z_BUF_ERROR if there was not enough room in the output
-   buffer, or Z_DATA_ERROR if the input data was corrupted.
-*/
-int ZEXPORT uncompress (dest, destLen, source, sourceLen)
-    Bytef *dest;
-    uLongf *destLen;
-    const Bytef *source;
-    uLong sourceLen;
-{
-    z_stream stream;
-    int err;
-
-    stream.next_in = (Bytef*)source;
-    stream.avail_in = (uInt)sourceLen;
-    /* Check for source > 64K on 16-bit machine: */
-    if ((uLong)stream.avail_in != sourceLen) return Z_BUF_ERROR;
-
-    stream.next_out = dest;
-    stream.avail_out = (uInt)*destLen;
-    if ((uLong)stream.avail_out != *destLen) return Z_BUF_ERROR;
-
-    stream.zalloc = (alloc_func)0;
-    stream.zfree = (free_func)0;
-
-    err = inflateInit(&stream);
-    if (err != Z_OK) return err;
-
-    err = inflate(&stream, Z_FINISH);
-    if (err != Z_STREAM_END) {
-        inflateEnd(&stream);
-        return err == Z_OK ? Z_BUF_ERROR : err;
-    }
-    *destLen = stream.total_out;
-
-    err = inflateEnd(&stream);
-    return err;
-}
diff --git a/lib/zlib/zconf.h b/lib/zlib/zconf.h
deleted file mode 100644 (file)
index eb0ae2e..0000000
+++ /dev/null
@@ -1,279 +0,0 @@
-/* zconf.h -- configuration of the zlib compression library
- * Copyright (C) 1995-2002 Jean-loup Gailly.
- * For conditions of distribution and use, see copyright notice in zlib.h 
- */
-
-/* @(#) $Id$ */
-
-#ifndef _ZCONF_H
-#define _ZCONF_H
-
-/*
- * If you *really* need a unique prefix for all types and library functions,
- * compile with -DZ_PREFIX. The "standard" zlib should be compiled without it.
- */
-#ifdef Z_PREFIX
-#  define deflateInit_ z_deflateInit_
-#  define deflate      z_deflate
-#  define deflateEnd   z_deflateEnd
-#  define inflateInit_         z_inflateInit_
-#  define inflate      z_inflate
-#  define inflateEnd   z_inflateEnd
-#  define deflateInit2_        z_deflateInit2_
-#  define deflateSetDictionary z_deflateSetDictionary
-#  define deflateCopy  z_deflateCopy
-#  define deflateReset z_deflateReset
-#  define deflateParams        z_deflateParams
-#  define inflateInit2_        z_inflateInit2_
-#  define inflateSetDictionary z_inflateSetDictionary
-#  define inflateSync  z_inflateSync
-#  define inflateSyncPoint z_inflateSyncPoint
-#  define inflateReset z_inflateReset
-#  define compress     z_compress
-#  define compress2    z_compress2
-#  define uncompress   z_uncompress
-#  define adler32      z_adler32
-#  define crc32                z_crc32
-#  define get_crc_table z_get_crc_table
-
-#  define Byte         z_Byte
-#  define uInt         z_uInt
-#  define uLong                z_uLong
-#  define Bytef                z_Bytef
-#  define charf                z_charf
-#  define intf         z_intf
-#  define uIntf                z_uIntf
-#  define uLongf       z_uLongf
-#  define voidpf       z_voidpf
-#  define voidp                z_voidp
-#endif
-
-#if (defined(_WIN32) || defined(__WIN32__)) && !defined(WIN32)
-#  define WIN32
-#endif
-#if defined(__GNUC__) || defined(WIN32) || defined(__386__) || defined(i386)
-#  ifndef __32BIT__
-#    define __32BIT__
-#  endif
-#endif
-#if defined(__MSDOS__) && !defined(MSDOS)
-#  define MSDOS
-#endif
-
-/*
- * Compile with -DMAXSEG_64K if the alloc function cannot allocate more
- * than 64k bytes at a time (needed on systems with 16-bit int).
- */
-#if defined(MSDOS) && !defined(__32BIT__)
-#  define MAXSEG_64K
-#endif
-#ifdef MSDOS
-#  define UNALIGNED_OK
-#endif
-
-#if (defined(MSDOS) || defined(_WINDOWS) || defined(WIN32))  && !defined(STDC)
-#  define STDC
-#endif
-#if defined(__STDC__) || defined(__cplusplus) || defined(__OS2__)
-#  ifndef STDC
-#    define STDC
-#  endif
-#endif
-
-#ifndef STDC
-#  ifndef const /* cannot use !defined(STDC) && !defined(const) on Mac */
-#    define const
-#  endif
-#endif
-
-/* Some Mac compilers merge all .h files incorrectly: */
-#if defined(__MWERKS__) || defined(applec) ||defined(THINK_C) ||defined(__SC__)
-#  define NO_DUMMY_DECL
-#endif
-
-/* Old Borland C incorrectly complains about missing returns: */
-#if defined(__BORLANDC__) && (__BORLANDC__ < 0x500)
-#  define NEED_DUMMY_RETURN
-#endif
-
-
-/* Maximum value for memLevel in deflateInit2 */
-#ifndef MAX_MEM_LEVEL
-#  ifdef MAXSEG_64K
-#    define MAX_MEM_LEVEL 8
-#  else
-#    define MAX_MEM_LEVEL 9
-#  endif
-#endif
-
-/* Maximum value for windowBits in deflateInit2 and inflateInit2.
- * WARNING: reducing MAX_WBITS makes minigzip unable to extract .gz files
- * created by gzip. (Files created by minigzip can still be extracted by
- * gzip.)
- */
-#ifndef MAX_WBITS
-#  define MAX_WBITS   15 /* 32K LZ77 window */
-#endif
-
-/* The memory requirements for deflate are (in bytes):
-            (1 << (windowBits+2)) +  (1 << (memLevel+9))
- that is: 128K for windowBits=15  +  128K for memLevel = 8  (default values)
- plus a few kilobytes for small objects. For example, if you want to reduce
- the default memory requirements from 256K to 128K, compile with
-     make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7"
- Of course this will generally degrade compression (there's no free lunch).
-
-   The memory requirements for inflate are (in bytes) 1 << windowBits
- that is, 32K for windowBits=15 (default value) plus a few kilobytes
- for small objects.
-*/
-
-                        /* Type declarations */
-
-#ifndef OF /* function prototypes */
-#  ifdef STDC
-#    define OF(args)  args
-#  else
-#    define OF(args)  ()
-#  endif
-#endif
-
-/* The following definitions for FAR are needed only for MSDOS mixed
- * model programming (small or medium model with some far allocations).
- * This was tested only with MSC; for other MSDOS compilers you may have
- * to define NO_MEMCPY in zutil.h.  If you don't need the mixed model,
- * just define FAR to be empty.
- */
-#if (defined(M_I86SM) || defined(M_I86MM)) && !defined(__32BIT__)
-   /* MSC small or medium model */
-#  define SMALL_MEDIUM
-#  ifdef _MSC_VER
-#    define FAR _far
-#  else
-#    define FAR far
-#  endif
-#endif
-#if defined(__BORLANDC__) && (defined(__SMALL__) || defined(__MEDIUM__))
-#  ifndef __32BIT__
-#    define SMALL_MEDIUM
-#    define FAR _far
-#  endif
-#endif
-
-/* Compile with -DZLIB_DLL for Windows DLL support */
-#if defined(ZLIB_DLL)
-#  if defined(_WINDOWS) || defined(WINDOWS)
-#    ifdef FAR
-#      undef FAR
-#    endif
-#    include <windows.h>
-#    define ZEXPORT  WINAPI
-#    ifdef WIN32
-#      define ZEXPORTVA  WINAPIV
-#    else
-#      define ZEXPORTVA  FAR _cdecl _export
-#    endif
-#  endif
-#  if defined (__BORLANDC__)
-#    if (__BORLANDC__ >= 0x0500) && defined (WIN32)
-#      include <windows.h>
-#      define ZEXPORT __declspec(dllexport) WINAPI
-#      define ZEXPORTRVA __declspec(dllexport) WINAPIV
-#    else
-#      if defined (_Windows) && defined (__DLL__)
-#        define ZEXPORT _export
-#        define ZEXPORTVA _export
-#      endif
-#    endif
-#  endif
-#endif
-
-#if defined (__BEOS__)
-#  if defined (ZLIB_DLL)
-#    define ZEXTERN extern __declspec(dllexport)
-#  else
-#    define ZEXTERN extern __declspec(dllimport)
-#  endif
-#endif
-
-#ifndef ZEXPORT
-#  define ZEXPORT
-#endif
-#ifndef ZEXPORTVA
-#  define ZEXPORTVA
-#endif
-#ifndef ZEXTERN
-#  define ZEXTERN extern
-#endif
-
-#ifndef FAR
-#   define FAR
-#endif
-
-#if !defined(MACOS) && !defined(TARGET_OS_MAC)
-typedef unsigned char  Byte;  /* 8 bits */
-#endif
-typedef unsigned int   uInt;  /* 16 bits or more */
-typedef unsigned long  uLong; /* 32 bits or more */
-
-#ifdef SMALL_MEDIUM
-   /* Borland C/C++ and some old MSC versions ignore FAR inside typedef */
-#  define Bytef Byte FAR
-#else
-   typedef Byte  FAR Bytef;
-#endif
-typedef char  FAR charf;
-typedef int   FAR intf;
-typedef uInt  FAR uIntf;
-typedef uLong FAR uLongf;
-
-#ifdef STDC
-   typedef void FAR *voidpf;
-   typedef void     *voidp;
-#else
-   typedef Byte FAR *voidpf;
-   typedef Byte     *voidp;
-#endif
-
-#ifdef HAVE_UNISTD_H
-#  include <sys/types.h> /* for off_t */
-#  include <unistd.h>    /* for SEEK_* and off_t */
-#  define z_off_t  off_t
-#endif
-#ifndef SEEK_SET
-#  define SEEK_SET        0       /* Seek from beginning of file.  */
-#  define SEEK_CUR        1       /* Seek from current position.  */
-#  define SEEK_END        2       /* Set file pointer to EOF plus "offset" */
-#endif
-#ifndef z_off_t
-#  define  z_off_t long
-#endif
-
-/* MVS linker does not support external names larger than 8 bytes */
-#if defined(__MVS__)
-#   pragma map(deflateInit_,"DEIN")
-#   pragma map(deflateInit2_,"DEIN2")
-#   pragma map(deflateEnd,"DEEND")
-#   pragma map(inflateInit_,"ININ")
-#   pragma map(inflateInit2_,"ININ2")
-#   pragma map(inflateEnd,"INEND")
-#   pragma map(inflateSync,"INSY")
-#   pragma map(inflateSetDictionary,"INSEDI")
-#   pragma map(inflate_blocks,"INBL")
-#   pragma map(inflate_blocks_new,"INBLNE")
-#   pragma map(inflate_blocks_free,"INBLFR")
-#   pragma map(inflate_blocks_reset,"INBLRE")
-#   pragma map(inflate_codes_free,"INCOFR")
-#   pragma map(inflate_codes,"INCO")
-#   pragma map(inflate_fast,"INFA")
-#   pragma map(inflate_flush,"INFLU")
-#   pragma map(inflate_mask,"INMA")
-#   pragma map(inflate_set_dictionary,"INSEDI2")
-#   pragma map(inflate_copyright,"INCOPY")
-#   pragma map(inflate_trees_bits,"INTRBI")
-#   pragma map(inflate_trees_dynamic,"INTRDY")
-#   pragma map(inflate_trees_fixed,"INTRFI")
-#   pragma map(inflate_trees_free,"INTRFR")
-#endif
-
-#endif /* _ZCONF_H */
diff --git a/lib/zlib/zlib.3 b/lib/zlib/zlib.3
deleted file mode 100644 (file)
index 3a6e450..0000000
+++ /dev/null
@@ -1,107 +0,0 @@
-.TH ZLIB 3 "11 March 2002"
-.SH NAME
-zlib \- compression/decompression library
-.SH SYNOPSIS
-[see
-.I zlib.h
-for full description]
-.SH DESCRIPTION
-The
-.I zlib
-library is a general purpose data compression library.
-The code is thread safe.
-It provides in-memory compression and decompression functions,
-including integrity checks of the uncompressed data.
-This version of the library supports only one compression method (deflation)
-but other algorithms will be added later and will have the same stream interface.
-.LP
-Compression can be done in a single step if the buffers are large enough
-(for example if an input file is mmap'ed),
-or can be done by repeated calls of the compression function.
-In the latter case,
-the application must provide more input and/or consume the output
-(providing more output space) before each call.
-.LP
-The library also supports reading and writing files in
-.I gzip
-(.gz) format
-with an interface similar to that of stdio.
-.LP
-The library does not install any signal handler. The decoder checks
-the consistency of the compressed data, so the library should never
-crash even in case of corrupted input.
-.LP
-All functions of the compression library are documented in the file
-.IR zlib.h.
-The distribution source includes examples of use of the library
-the files
-.I example.c
-and
-.IR minigzip.c .
-.LP
-A Java implementation of
-.IR zlib
-is available in the Java Development Kit 1.1
-.IP
-http://www.javasoft.com/products/JDK/1.1/docs/api/Package-java.util.zip.html
-.LP
-A Perl interface to
-.IR zlib ,
-written by Paul Marquess (pmarquess@bfsec.bt.co.uk)
-is available at CPAN (Comprehensive Perl Archive Network) sites,
-such as:
-.IP
-ftp://ftp.cis.ufl.edu/pub/perl/CPAN/modules/by-module/Compress/Compress-Zlib*
-.LP
-A Python interface to
-.IR zlib
-written by A.M. Kuchling <amk@magnet.com>
-is available from the Python Software Association sites, such as:
-.IP
-ftp://ftp.python.org/pub/python/contrib/Encoding/zlib*.tar.gz
-.SH "SEE ALSO"
-Questions about zlib should be sent to:
-.IP
-zlib@quest.jpl.nasa.gov
-or, if this fails, to the author addresses given below.
-The zlib home page is:
-.IP
-http://www.cdrom.com/pub/infozip/zlib/
-.LP
-The data format used by the zlib library is described by RFC
-(Request for Comments) 1950 to 1952 in the files: 
-.IP
-ftp://ds.internic.net/rfc/rfc1950.txt (zlib format)
-.br
-rfc1951.txt (deflate format)
-.br
-rfc1952.txt (gzip format)
-.LP
-These documents are also available in other formats from:
-.IP
-ftp://ftp.uu.net/graphics/png/documents/zlib/zdoc-index.html
-.SH AUTHORS
-Version 1.1.4
-Copyright (C) 1995-2002 Jean-loup Gailly (jloup@gzip.org)
-and Mark Adler (madler@alumni.caltech.edu).
-.LP
-This software is provided "as-is,"
-without any express or implied warranty.
-In no event will the authors be held liable for any damages
-arising from the use of this software.
-See the distribution directory with respect to requirements
-governing redistribution.
-The deflate format used by
-.I zlib
-was defined by Phil Katz.
-The deflate and
-.I zlib
-specifications were written by L. Peter Deutsch.
-Thanks to all the people who reported problems and suggested various
-improvements in
-.IR zlib ;
-who are too numerous to cite here.
-.LP
-UNIX manual page by R. P. C. Rodgers,
-U.S. National Library of Medicine (rodgers@nlm.nih.gov).
-.\" end of man page
diff --git a/lib/zlib/zlib.h b/lib/zlib/zlib.h
deleted file mode 100644 (file)
index 52cb529..0000000
+++ /dev/null
@@ -1,893 +0,0 @@
-/* zlib.h -- interface of the 'zlib' general purpose compression library
-  version 1.1.4, March 11th, 2002
-
-  Copyright (C) 1995-2002 Jean-loup Gailly and Mark Adler
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-
-  Jean-loup Gailly        Mark Adler
-  jloup@gzip.org          madler@alumni.caltech.edu
-
-
-  The data format used by the zlib library is described by RFCs (Request for
-  Comments) 1950 to 1952 in the files ftp://ds.internic.net/rfc/rfc1950.txt
-  (zlib format), rfc1951.txt (deflate format) and rfc1952.txt (gzip format).
-*/
-
-#ifndef _ZLIB_H
-#define _ZLIB_H
-
-#include "zconf.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#define ZLIB_VERSION "1.1.4"
-
-/* 
-     The 'zlib' compression library provides in-memory compression and
-  decompression functions, including integrity checks of the uncompressed
-  data.  This version of the library supports only one compression method
-  (deflation) but other algorithms will be added later and will have the same
-  stream interface.
-
-     Compression can be done in a single step if the buffers are large
-  enough (for example if an input file is mmap'ed), or can be done by
-  repeated calls of the compression function.  In the latter case, the
-  application must provide more input and/or consume the output
-  (providing more output space) before each call.
-
-     The library also supports reading and writing files in gzip (.gz) format
-  with an interface similar to that of stdio.
-
-     The library does not install any signal handler. The decoder checks
-  the consistency of the compressed data, so the library should never
-  crash even in case of corrupted input.
-*/
-
-typedef voidpf (*alloc_func) OF((voidpf opaque, uInt items, uInt size));
-typedef void   (*free_func)  OF((voidpf opaque, voidpf address));
-
-struct internal_state;
-
-typedef struct z_stream_s {
-    Bytef    *next_in;  /* next input byte */
-    uInt     avail_in;  /* number of bytes available at next_in */
-    uLong    total_in;  /* total nb of input bytes read so far */
-
-    Bytef    *next_out; /* next output byte should be put there */
-    uInt     avail_out; /* remaining free space at next_out */
-    uLong    total_out; /* total nb of bytes output so far */
-
-    char     *msg;      /* last error message, NULL if no error */
-    struct internal_state FAR *state; /* not visible by applications */
-
-    alloc_func zalloc;  /* used to allocate the internal state */
-    free_func  zfree;   /* used to free the internal state */
-    voidpf     opaque;  /* private data object passed to zalloc and zfree */
-
-    int     data_type;  /* best guess about the data type: ascii or binary */
-    uLong   adler;      /* adler32 value of the uncompressed data */
-    uLong   reserved;   /* reserved for future use */
-} z_stream;
-
-typedef z_stream FAR *z_streamp;
-
-/*
-   The application must update next_in and avail_in when avail_in has
-   dropped to zero. It must update next_out and avail_out when avail_out
-   has dropped to zero. The application must initialize zalloc, zfree and
-   opaque before calling the init function. All other fields are set by the
-   compression library and must not be updated by the application.
-
-   The opaque value provided by the application will be passed as the first
-   parameter for calls of zalloc and zfree. This can be useful for custom
-   memory management. The compression library attaches no meaning to the
-   opaque value.
-
-   zalloc must return Z_NULL if there is not enough memory for the object.
-   If zlib is used in a multi-threaded application, zalloc and zfree must be
-   thread safe.
-
-   On 16-bit systems, the functions zalloc and zfree must be able to allocate
-   exactly 65536 bytes, but will not be required to allocate more than this
-   if the symbol MAXSEG_64K is defined (see zconf.h). WARNING: On MSDOS,
-   pointers returned by zalloc for objects of exactly 65536 bytes *must*
-   have their offset normalized to zero. The default allocation function
-   provided by this library ensures this (see zutil.c). To reduce memory
-   requirements and avoid any allocation of 64K objects, at the expense of
-   compression ratio, compile the library with -DMAX_WBITS=14 (see zconf.h).
-
-   The fields total_in and total_out can be used for statistics or
-   progress reports. After compression, total_in holds the total size of
-   the uncompressed data and may be saved for use in the decompressor
-   (particularly if the decompressor wants to decompress everything in
-   a single step).
-*/
-
-                        /* constants */
-
-#define Z_NO_FLUSH      0
-#define Z_PARTIAL_FLUSH 1 /* will be removed, use Z_SYNC_FLUSH instead */
-#define Z_SYNC_FLUSH    2
-#define Z_FULL_FLUSH    3
-#define Z_FINISH        4
-/* Allowed flush values; see deflate() below for details */
-
-#define Z_OK            0
-#define Z_STREAM_END    1
-#define Z_NEED_DICT     2
-#define Z_ERRNO        (-1)
-#define Z_STREAM_ERROR (-2)
-#define Z_DATA_ERROR   (-3)
-#define Z_MEM_ERROR    (-4)
-#define Z_BUF_ERROR    (-5)
-#define Z_VERSION_ERROR (-6)
-/* Return codes for the compression/decompression functions. Negative
- * values are errors, positive values are used for special but normal events.
- */
-
-#define Z_NO_COMPRESSION         0
-#define Z_BEST_SPEED             1
-#define Z_BEST_COMPRESSION       9
-#define Z_DEFAULT_COMPRESSION  (-1)
-/* compression levels */
-
-#define Z_FILTERED            1
-#define Z_HUFFMAN_ONLY        2
-#define Z_DEFAULT_STRATEGY    0
-/* compression strategy; see deflateInit2() below for details */
-
-#define Z_BINARY   0
-#define Z_ASCII    1
-#define Z_UNKNOWN  2
-/* Possible values of the data_type field */
-
-#define Z_DEFLATED   8
-/* The deflate compression method (the only one supported in this version) */
-
-#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
-
-#define zlib_version zlibVersion()
-/* for compatibility with versions < 1.0.2 */
-
-                        /* basic functions */
-
-ZEXTERN const char * ZEXPORT zlibVersion OF((void));
-/* The application can compare zlibVersion and ZLIB_VERSION for consistency.
-   If the first character differs, the library code actually used is
-   not compatible with the zlib.h header file used by the application.
-   This check is automatically made by deflateInit and inflateInit.
- */
-
-/* 
-ZEXTERN int ZEXPORT deflateInit OF((z_streamp strm, int level));
-
-     Initializes the internal stream state for compression. The fields
-   zalloc, zfree and opaque must be initialized before by the caller.
-   If zalloc and zfree are set to Z_NULL, deflateInit updates them to
-   use default allocation functions.
-
-     The compression level must be Z_DEFAULT_COMPRESSION, or between 0 and 9:
-   1 gives best speed, 9 gives best compression, 0 gives no compression at
-   all (the input data is simply copied a block at a time).
-   Z_DEFAULT_COMPRESSION requests a default compromise between speed and
-   compression (currently equivalent to level 6).
-
-     deflateInit returns Z_OK if success, Z_MEM_ERROR if there was not
-   enough memory, Z_STREAM_ERROR if level is not a valid compression level,
-   Z_VERSION_ERROR if the zlib library version (zlib_version) is incompatible
-   with the version assumed by the caller (ZLIB_VERSION).
-   msg is set to null if there is no error message.  deflateInit does not
-   perform any compression: this will be done by deflate().
-*/
-
-
-ZEXTERN int ZEXPORT deflate OF((z_streamp strm, int flush));
-/*
-    deflate compresses as much data as possible, and stops when the input
-  buffer becomes empty or the output buffer becomes full. It may introduce some
-  output latency (reading input without producing any output) except when
-  forced to flush.
-
-    The detailed semantics are as follows. deflate performs one or both of the
-  following actions:
-
-  - Compress more input starting at next_in and update next_in and avail_in
-    accordingly. If not all input can be processed (because there is not
-    enough room in the output buffer), next_in and avail_in are updated and
-    processing will resume at this point for the next call of deflate().
-
-  - Provide more output starting at next_out and update next_out and avail_out
-    accordingly. This action is forced if the parameter flush is non zero.
-    Forcing flush frequently degrades the compression ratio, so this parameter
-    should be set only when necessary (in interactive applications).
-    Some output may be provided even if flush is not set.
-
-  Before the call of deflate(), the application should ensure that at least
-  one of the actions is possible, by providing more input and/or consuming
-  more output, and updating avail_in or avail_out accordingly; avail_out
-  should never be zero before the call. The application can consume the
-  compressed output when it wants, for example when the output buffer is full
-  (avail_out == 0), or after each call of deflate(). If deflate returns Z_OK
-  and with zero avail_out, it must be called again after making room in the
-  output buffer because there might be more output pending.
-
-    If the parameter flush is set to Z_SYNC_FLUSH, all pending output is
-  flushed to the output buffer and the output is aligned on a byte boundary, so
-  that the decompressor can get all input data available so far. (In particular
-  avail_in is zero after the call if enough output space has been provided
-  before the call.)  Flushing may degrade compression for some compression
-  algorithms and so it should be used only when necessary.
-
-    If flush is set to Z_FULL_FLUSH, all output is flushed as with
-  Z_SYNC_FLUSH, and the compression state is reset so that decompression can
-  restart from this point if previous compressed data has been damaged or if
-  random access is desired. Using Z_FULL_FLUSH too often can seriously degrade
-  the compression.
-
-    If deflate returns with avail_out == 0, this function must be called again
-  with the same value of the flush parameter and more output space (updated
-  avail_out), until the flush is complete (deflate returns with non-zero
-  avail_out).
-
-    If the parameter flush is set to Z_FINISH, pending input is processed,
-  pending output is flushed and deflate returns with Z_STREAM_END if there
-  was enough output space; if deflate returns with Z_OK, this function must be
-  called again with Z_FINISH and more output space (updated avail_out) but no
-  more input data, until it returns with Z_STREAM_END or an error. After
-  deflate has returned Z_STREAM_END, the only possible operations on the
-  stream are deflateReset or deflateEnd.
-  
-    Z_FINISH can be used immediately after deflateInit if all the compression
-  is to be done in a single step. In this case, avail_out must be at least
-  0.1% larger than avail_in plus 12 bytes.  If deflate does not return
-  Z_STREAM_END, then it must be called again as described above.
-
-    deflate() sets strm->adler to the adler32 checksum of all input read
-  so far (that is, total_in bytes).
-
-    deflate() may update data_type if it can make a good guess about
-  the input data type (Z_ASCII or Z_BINARY). In doubt, the data is considered
-  binary. This field is only for information purposes and does not affect
-  the compression algorithm in any manner.
-
-    deflate() returns Z_OK if some progress has been made (more input
-  processed or more output produced), Z_STREAM_END if all input has been
-  consumed and all output has been produced (only when flush is set to
-  Z_FINISH), Z_STREAM_ERROR if the stream state was inconsistent (for example
-  if next_in or next_out was NULL), Z_BUF_ERROR if no progress is possible
-  (for example avail_in or avail_out was zero).
-*/
-
-
-ZEXTERN int ZEXPORT deflateEnd OF((z_streamp strm));
-/*
-     All dynamically allocated data structures for this stream are freed.
-   This function discards any unprocessed input and does not flush any
-   pending output.
-
-     deflateEnd returns Z_OK if success, Z_STREAM_ERROR if the
-   stream state was inconsistent, Z_DATA_ERROR if the stream was freed
-   prematurely (some input or output was discarded). In the error case,
-   msg may be set but then points to a static string (which must not be
-   deallocated).
-*/
-
-
-/* 
-ZEXTERN int ZEXPORT inflateInit OF((z_streamp strm));
-
-     Initializes the internal stream state for decompression. The fields
-   next_in, avail_in, zalloc, zfree and opaque must be initialized before by
-   the caller. If next_in is not Z_NULL and avail_in is large enough (the exact
-   value depends on the compression method), inflateInit determines the
-   compression method from the zlib header and allocates all data structures
-   accordingly; otherwise the allocation will be deferred to the first call of
-   inflate.  If zalloc and zfree are set to Z_NULL, inflateInit updates them to
-   use default allocation functions.
-
-     inflateInit returns Z_OK if success, Z_MEM_ERROR if there was not enough
-   memory, Z_VERSION_ERROR if the zlib library version is incompatible with the
-   version assumed by the caller.  msg is set to null if there is no error
-   message. inflateInit does not perform any decompression apart from reading
-   the zlib header if present: this will be done by inflate().  (So next_in and
-   avail_in may be modified, but next_out and avail_out are unchanged.)
-*/
-
-
-ZEXTERN int ZEXPORT inflate OF((z_streamp strm, int flush));
-/*
-    inflate decompresses as much data as possible, and stops when the input
-  buffer becomes empty or the output buffer becomes full. It may some
-  introduce some output latency (reading input without producing any output)
-  except when forced to flush.
-
-  The detailed semantics are as follows. inflate performs one or both of the
-  following actions:
-
-  - Decompress more input starting at next_in and update next_in and avail_in
-    accordingly. If not all input can be processed (because there is not
-    enough room in the output buffer), next_in is updated and processing
-    will resume at this point for the next call of inflate().
-
-  - Provide more output starting at next_out and update next_out and avail_out
-    accordingly.  inflate() provides as much output as possible, until there
-    is no more input data or no more space in the output buffer (see below
-    about the flush parameter).
-
-  Before the call of inflate(), the application should ensure that at least
-  one of the actions is possible, by providing more input and/or consuming
-  more output, and updating the next_* and avail_* values accordingly.
-  The application can consume the uncompressed output when it wants, for
-  example when the output buffer is full (avail_out == 0), or after each
-  call of inflate(). If inflate returns Z_OK and with zero avail_out, it
-  must be called again after making room in the output buffer because there
-  might be more output pending.
-
-    If the parameter flush is set to Z_SYNC_FLUSH, inflate flushes as much
-  output as possible to the output buffer. The flushing behavior of inflate is
-  not specified for values of the flush parameter other than Z_SYNC_FLUSH
-  and Z_FINISH, but the current implementation actually flushes as much output
-  as possible anyway.
-
-    inflate() should normally be called until it returns Z_STREAM_END or an
-  error. However if all decompression is to be performed in a single step
-  (a single call of inflate), the parameter flush should be set to
-  Z_FINISH. In this case all pending input is processed and all pending
-  output is flushed; avail_out must be large enough to hold all the
-  uncompressed data. (The size of the uncompressed data may have been saved
-  by the compressor for this purpose.) The next operation on this stream must
-  be inflateEnd to deallocate the decompression state. The use of Z_FINISH
-  is never required, but can be used to inform inflate that a faster routine
-  may be used for the single inflate() call.
-
-     If a preset dictionary is needed at this point (see inflateSetDictionary
-  below), inflate sets strm-adler to the adler32 checksum of the
-  dictionary chosen by the compressor and returns Z_NEED_DICT; otherwise 
-  it sets strm->adler to the adler32 checksum of all output produced
-  so far (that is, total_out bytes) and returns Z_OK, Z_STREAM_END or
-  an error code as described below. At the end of the stream, inflate()
-  checks that its computed adler32 checksum is equal to that saved by the
-  compressor and returns Z_STREAM_END only if the checksum is correct.
-
-    inflate() returns Z_OK if some progress has been made (more input processed
-  or more output produced), Z_STREAM_END if the end of the compressed data has
-  been reached and all uncompressed output has been produced, Z_NEED_DICT if a
-  preset dictionary is needed at this point, Z_DATA_ERROR if the input data was
-  corrupted (input stream not conforming to the zlib format or incorrect
-  adler32 checksum), Z_STREAM_ERROR if the stream structure was inconsistent
-  (for example if next_in or next_out was NULL), Z_MEM_ERROR if there was not
-  enough memory, Z_BUF_ERROR if no progress is possible or if there was not
-  enough room in the output buffer when Z_FINISH is used. In the Z_DATA_ERROR
-  case, the application may then call inflateSync to look for a good
-  compression block.
-*/
-
-
-ZEXTERN int ZEXPORT inflateEnd OF((z_streamp strm));
-/*
-     All dynamically allocated data structures for this stream are freed.
-   This function discards any unprocessed input and does not flush any
-   pending output.
-
-     inflateEnd returns Z_OK if success, Z_STREAM_ERROR if the stream state
-   was inconsistent. In the error case, msg may be set but then points to a
-   static string (which must not be deallocated).
-*/
-
-                        /* Advanced functions */
-
-/*
-    The following functions are needed only in some special applications.
-*/
-
-/*   
-ZEXTERN int ZEXPORT deflateInit2 OF((z_streamp strm,
-                                     int  level,
-                                     int  method,
-                                     int  windowBits,
-                                     int  memLevel,
-                                     int  strategy));
-
-     This is another version of deflateInit with more compression options. The
-   fields next_in, zalloc, zfree and opaque must be initialized before by
-   the caller.
-
-     The method parameter is the compression method. It must be Z_DEFLATED in
-   this version of the library.
-
-     The windowBits parameter is the base two logarithm of the window size
-   (the size of the history buffer).  It should be in the range 8..15 for this
-   version of the library. Larger values of this parameter result in better
-   compression at the expense of memory usage. The default value is 15 if
-   deflateInit is used instead.
-
-     The memLevel parameter specifies how much memory should be allocated
-   for the internal compression state. memLevel=1 uses minimum memory but
-   is slow and reduces compression ratio; memLevel=9 uses maximum memory
-   for optimal speed. The default value is 8. See zconf.h for total memory
-   usage as a function of windowBits and memLevel.
-
-     The strategy parameter is used to tune the compression algorithm. Use the
-   value Z_DEFAULT_STRATEGY for normal data, Z_FILTERED for data produced by a
-   filter (or predictor), or Z_HUFFMAN_ONLY to force Huffman encoding only (no
-   string match).  Filtered data consists mostly of small values with a
-   somewhat random distribution. In this case, the compression algorithm is
-   tuned to compress them better. The effect of Z_FILTERED is to force more
-   Huffman coding and less string matching; it is somewhat intermediate
-   between Z_DEFAULT and Z_HUFFMAN_ONLY. The strategy parameter only affects
-   the compression ratio but not the correctness of the compressed output even
-   if it is not set appropriately.
-
-      deflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough
-   memory, Z_STREAM_ERROR if a parameter is invalid (such as an invalid
-   method). msg is set to null if there is no error message.  deflateInit2 does
-   not perform any compression: this will be done by deflate().
-*/
-                            
-ZEXTERN int ZEXPORT deflateSetDictionary OF((z_streamp strm,
-                                             const Bytef *dictionary,
-                                             uInt  dictLength));
-/*
-     Initializes the compression dictionary from the given byte sequence
-   without producing any compressed output. This function must be called
-   immediately after deflateInit, deflateInit2 or deflateReset, before any
-   call of deflate. The compressor and decompressor must use exactly the same
-   dictionary (see inflateSetDictionary).
-
-     The dictionary should consist of strings (byte sequences) that are likely
-   to be encountered later in the data to be compressed, with the most commonly
-   used strings preferably put towards the end of the dictionary. Using a
-   dictionary is most useful when the data to be compressed is short and can be
-   predicted with good accuracy; the data can then be compressed better than
-   with the default empty dictionary.
-
-     Depending on the size of the compression data structures selected by
-   deflateInit or deflateInit2, a part of the dictionary may in effect be
-   discarded, for example if the dictionary is larger than the window size in
-   deflate or deflate2. Thus the strings most likely to be useful should be
-   put at the end of the dictionary, not at the front.
-
-     Upon return of this function, strm->adler is set to the Adler32 value
-   of the dictionary; the decompressor may later use this value to determine
-   which dictionary has been used by the compressor. (The Adler32 value
-   applies to the whole dictionary even if only a subset of the dictionary is
-   actually used by the compressor.)
-
-     deflateSetDictionary returns Z_OK if success, or Z_STREAM_ERROR if a
-   parameter is invalid (such as NULL dictionary) or the stream state is
-   inconsistent (for example if deflate has already been called for this stream
-   or if the compression method is bsort). deflateSetDictionary does not
-   perform any compression: this will be done by deflate().
-*/
-
-ZEXTERN int ZEXPORT deflateCopy OF((z_streamp dest,
-                                    z_streamp source));
-/*
-     Sets the destination stream as a complete copy of the source stream.
-
-     This function can be useful when several compression strategies will be
-   tried, for example when there are several ways of pre-processing the input
-   data with a filter. The streams that will be discarded should then be freed
-   by calling deflateEnd.  Note that deflateCopy duplicates the internal
-   compression state which can be quite large, so this strategy is slow and
-   can consume lots of memory.
-
-     deflateCopy returns Z_OK if success, Z_MEM_ERROR if there was not
-   enough memory, Z_STREAM_ERROR if the source stream state was inconsistent
-   (such as zalloc being NULL). msg is left unchanged in both source and
-   destination.
-*/
-
-ZEXTERN int ZEXPORT deflateReset OF((z_streamp strm));
-/*
-     This function is equivalent to deflateEnd followed by deflateInit,
-   but does not free and reallocate all the internal compression state.
-   The stream will keep the same compression level and any other attributes
-   that may have been set by deflateInit2.
-
-      deflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source
-   stream state was inconsistent (such as zalloc or state being NULL).
-*/
-
-ZEXTERN int ZEXPORT deflateParams OF((z_streamp strm,
-                                     int level,
-                                     int strategy));
-/*
-     Dynamically update the compression level and compression strategy.  The
-   interpretation of level and strategy is as in deflateInit2.  This can be
-   used to switch between compression and straight copy of the input data, or
-   to switch to a different kind of input data requiring a different
-   strategy. If the compression level is changed, the input available so far
-   is compressed with the old level (and may be flushed); the new level will
-   take effect only at the next call of deflate().
-
-     Before the call of deflateParams, the stream state must be set as for
-   a call of deflate(), since the currently available input may have to
-   be compressed and flushed. In particular, strm->avail_out must be non-zero.
-
-     deflateParams returns Z_OK if success, Z_STREAM_ERROR if the source
-   stream state was inconsistent or if a parameter was invalid, Z_BUF_ERROR
-   if strm->avail_out was zero.
-*/
-
-/*   
-ZEXTERN int ZEXPORT inflateInit2 OF((z_streamp strm,
-                                     int  windowBits));
-
-     This is another version of inflateInit with an extra parameter. The
-   fields next_in, avail_in, zalloc, zfree and opaque must be initialized
-   before by the caller.
-
-     The windowBits parameter is the base two logarithm of the maximum window
-   size (the size of the history buffer).  It should be in the range 8..15 for
-   this version of the library. The default value is 15 if inflateInit is used
-   instead. If a compressed stream with a larger window size is given as
-   input, inflate() will return with the error code Z_DATA_ERROR instead of
-   trying to allocate a larger window.
-
-      inflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough
-   memory, Z_STREAM_ERROR if a parameter is invalid (such as a negative
-   memLevel). msg is set to null if there is no error message.  inflateInit2
-   does not perform any decompression apart from reading the zlib header if
-   present: this will be done by inflate(). (So next_in and avail_in may be
-   modified, but next_out and avail_out are unchanged.)
-*/
-
-ZEXTERN int ZEXPORT inflateSetDictionary OF((z_streamp strm,
-                                             const Bytef *dictionary,
-                                             uInt  dictLength));
-/*
-     Initializes the decompression dictionary from the given uncompressed byte
-   sequence. This function must be called immediately after a call of inflate
-   if this call returned Z_NEED_DICT. The dictionary chosen by the compressor
-   can be determined from the Adler32 value returned by this call of
-   inflate. The compressor and decompressor must use exactly the same
-   dictionary (see deflateSetDictionary).
-
-     inflateSetDictionary returns Z_OK if success, Z_STREAM_ERROR if a
-   parameter is invalid (such as NULL dictionary) or the stream state is
-   inconsistent, Z_DATA_ERROR if the given dictionary doesn't match the
-   expected one (incorrect Adler32 value). inflateSetDictionary does not
-   perform any decompression: this will be done by subsequent calls of
-   inflate().
-*/
-
-ZEXTERN int ZEXPORT inflateSync OF((z_streamp strm));
-/* 
-    Skips invalid compressed data until a full flush point (see above the
-  description of deflate with Z_FULL_FLUSH) can be found, or until all
-  available input is skipped. No output is provided.
-
-    inflateSync returns Z_OK if a full flush point has been found, Z_BUF_ERROR
-  if no more input was provided, Z_DATA_ERROR if no flush point has been found,
-  or Z_STREAM_ERROR if the stream structure was inconsistent. In the success
-  case, the application may save the current current value of total_in which
-  indicates where valid compressed data was found. In the error case, the
-  application may repeatedly call inflateSync, providing more input each time,
-  until success or end of the input data.
-*/
-
-ZEXTERN int ZEXPORT inflateReset OF((z_streamp strm));
-/*
-     This function is equivalent to inflateEnd followed by inflateInit,
-   but does not free and reallocate all the internal decompression state.
-   The stream will keep attributes that may have been set by inflateInit2.
-
-      inflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source
-   stream state was inconsistent (such as zalloc or state being NULL).
-*/
-
-
-                        /* utility functions */
-
-/*
-     The following utility functions are implemented on top of the
-   basic stream-oriented functions. To simplify the interface, some
-   default options are assumed (compression level and memory usage,
-   standard memory allocation functions). The source code of these
-   utility functions can easily be modified if you need special options.
-*/
-
-ZEXTERN int ZEXPORT compress OF((Bytef *dest,   uLongf *destLen,
-                                 const Bytef *source, uLong sourceLen));
-/*
-     Compresses the source buffer into the destination buffer.  sourceLen is
-   the byte length of the source buffer. Upon entry, destLen is the total
-   size of the destination buffer, which must be at least 0.1% larger than
-   sourceLen plus 12 bytes. Upon exit, destLen is the actual size of the
-   compressed buffer.
-     This function can be used to compress a whole file at once if the
-   input file is mmap'ed.
-     compress returns Z_OK if success, Z_MEM_ERROR if there was not
-   enough memory, Z_BUF_ERROR if there was not enough room in the output
-   buffer.
-*/
-
-ZEXTERN int ZEXPORT compress2 OF((Bytef *dest,   uLongf *destLen,
-                                  const Bytef *source, uLong sourceLen,
-                                  int level));
-/*
-     Compresses the source buffer into the destination buffer. The level
-   parameter has the same meaning as in deflateInit.  sourceLen is the byte
-   length of the source buffer. Upon entry, destLen is the total size of the
-   destination buffer, which must be at least 0.1% larger than sourceLen plus
-   12 bytes. Upon exit, destLen is the actual size of the compressed buffer.
-
-     compress2 returns Z_OK if success, Z_MEM_ERROR if there was not enough
-   memory, Z_BUF_ERROR if there was not enough room in the output buffer,
-   Z_STREAM_ERROR if the level parameter is invalid.
-*/
-
-ZEXTERN int ZEXPORT uncompress OF((Bytef *dest,   uLongf *destLen,
-                                   const Bytef *source, uLong sourceLen));
-/*
-     Decompresses the source buffer into the destination buffer.  sourceLen is
-   the byte length of the source buffer. Upon entry, destLen is the total
-   size of the destination buffer, which must be large enough to hold the
-   entire uncompressed data. (The size of the uncompressed data must have
-   been saved previously by the compressor and transmitted to the decompressor
-   by some mechanism outside the scope of this compression library.)
-   Upon exit, destLen is the actual size of the compressed buffer.
-     This function can be used to decompress a whole file at once if the
-   input file is mmap'ed.
-
-     uncompress returns Z_OK if success, Z_MEM_ERROR if there was not
-   enough memory, Z_BUF_ERROR if there was not enough room in the output
-   buffer, or Z_DATA_ERROR if the input data was corrupted.
-*/
-
-
-typedef voidp gzFile;
-
-ZEXTERN gzFile ZEXPORT gzopen  OF((const char *path, const char *mode));
-/*
-     Opens a gzip (.gz) file for reading or writing. The mode parameter
-   is as in fopen ("rb" or "wb") but can also include a compression level
-   ("wb9") or a strategy: 'f' for filtered data as in "wb6f", 'h' for
-   Huffman only compression as in "wb1h". (See the description
-   of deflateInit2 for more information about the strategy parameter.)
-
-     gzopen can be used to read a file which is not in gzip format; in this
-   case gzread will directly read from the file without decompression.
-
-     gzopen returns NULL if the file could not be opened or if there was
-   insufficient memory to allocate the (de)compression state; errno
-   can be checked to distinguish the two cases (if errno is zero, the
-   zlib error is Z_MEM_ERROR).  */
-
-ZEXTERN gzFile ZEXPORT gzdopen  OF((int fd, const char *mode));
-/*
-     gzdopen() associates a gzFile with the file descriptor fd.  File
-   descriptors are obtained from calls like open, dup, creat, pipe or
-   fileno (in the file has been previously opened with fopen).
-   The mode parameter is as in gzopen.
-     The next call of gzclose on the returned gzFile will also close the
-   file descriptor fd, just like fclose(fdopen(fd), mode) closes the file
-   descriptor fd. If you want to keep fd open, use gzdopen(dup(fd), mode).
-     gzdopen returns NULL if there was insufficient memory to allocate
-   the (de)compression state.
-*/
-
-ZEXTERN int ZEXPORT gzsetparams OF((gzFile file, int level, int strategy));
-/*
-     Dynamically update the compression level or strategy. See the description
-   of deflateInit2 for the meaning of these parameters.
-     gzsetparams returns Z_OK if success, or Z_STREAM_ERROR if the file was not
-   opened for writing.
-*/
-
-ZEXTERN int ZEXPORT    gzread  OF((gzFile file, voidp buf, unsigned len));
-/*
-     Reads the given number of uncompressed bytes from the compressed file.
-   If the input file was not in gzip format, gzread copies the given number
-   of bytes into the buffer.
-     gzread returns the number of uncompressed bytes actually read (0 for
-   end of file, -1 for error). */
-
-ZEXTERN int ZEXPORT    gzwrite OF((gzFile file, 
-                                  const voidp buf, unsigned len));
-/*
-     Writes the given number of uncompressed bytes into the compressed file.
-   gzwrite returns the number of uncompressed bytes actually written
-   (0 in case of error).
-*/
-
-ZEXTERN int ZEXPORTVA   gzprintf OF((gzFile file, const char *format, ...));
-/*
-     Converts, formats, and writes the args to the compressed file under
-   control of the format string, as in fprintf. gzprintf returns the number of
-   uncompressed bytes actually written (0 in case of error).
-*/
-
-ZEXTERN int ZEXPORT gzputs OF((gzFile file, const char *s));
-/*
-      Writes the given null-terminated string to the compressed file, excluding
-   the terminating null character.
-      gzputs returns the number of characters written, or -1 in case of error.
-*/
-
-ZEXTERN char * ZEXPORT gzgets OF((gzFile file, char *buf, int len));
-/*
-      Reads bytes from the compressed file until len-1 characters are read, or
-   a newline character is read and transferred to buf, or an end-of-file
-   condition is encountered.  The string is then terminated with a null
-   character.
-      gzgets returns buf, or Z_NULL in case of error.
-*/
-
-ZEXTERN int ZEXPORT    gzputc OF((gzFile file, int c));
-/*
-      Writes c, converted to an unsigned char, into the compressed file.
-   gzputc returns the value that was written, or -1 in case of error.
-*/
-
-ZEXTERN int ZEXPORT    gzgetc OF((gzFile file));
-/*
-      Reads one byte from the compressed file. gzgetc returns this byte
-   or -1 in case of end of file or error.
-*/
-
-ZEXTERN int ZEXPORT    gzflush OF((gzFile file, int flush));
-/*
-     Flushes all pending output into the compressed file. The parameter
-   flush is as in the deflate() function. The return value is the zlib
-   error number (see function gzerror below). gzflush returns Z_OK if
-   the flush parameter is Z_FINISH and all output could be flushed.
-     gzflush should be called only when strictly necessary because it can
-   degrade compression.
-*/
-
-ZEXTERN z_off_t ZEXPORT    gzseek OF((gzFile file,
-                                     z_off_t offset, int whence));
-/* 
-      Sets the starting position for the next gzread or gzwrite on the
-   given compressed file. The offset represents a number of bytes in the
-   uncompressed data stream. The whence parameter is defined as in lseek(2);
-   the value SEEK_END is not supported.
-     If the file is opened for reading, this function is emulated but can be
-   extremely slow. If the file is opened for writing, only forward seeks are
-   supported; gzseek then compresses a sequence of zeroes up to the new
-   starting position.
-
-      gzseek returns the resulting offset location as measured in bytes from
-   the beginning of the uncompressed stream, or -1 in case of error, in
-   particular if the file is opened for writing and the new starting position
-   would be before the current position.
-*/
-
-ZEXTERN int ZEXPORT    gzrewind OF((gzFile file));
-/*
-     Rewinds the given file. This function is supported only for reading.
-
-   gzrewind(file) is equivalent to (int)gzseek(file, 0L, SEEK_SET)
-*/
-
-ZEXTERN z_off_t ZEXPORT    gztell OF((gzFile file));
-/*
-     Returns the starting position for the next gzread or gzwrite on the
-   given compressed file. This position represents a number of bytes in the
-   uncompressed data stream.
-
-   gztell(file) is equivalent to gzseek(file, 0L, SEEK_CUR)
-*/
-
-ZEXTERN int ZEXPORT gzeof OF((gzFile file));
-/*
-     Returns 1 when EOF has previously been detected reading the given
-   input stream, otherwise zero.
-*/
-
-ZEXTERN int ZEXPORT    gzclose OF((gzFile file));
-/*
-     Flushes all pending output if necessary, closes the compressed file
-   and deallocates all the (de)compression state. The return value is the zlib
-   error number (see function gzerror below).
-*/
-
-ZEXTERN const char * ZEXPORT gzerror OF((gzFile file, int *errnum));
-/*
-     Returns the error message for the last error which occurred on the
-   given compressed file. errnum is set to zlib error number. If an
-   error occurred in the file system and not in the compression library,
-   errnum is set to Z_ERRNO and the application may consult errno
-   to get the exact error code.
-*/
-
-                        /* checksum functions */
-
-/*
-     These functions are not related to compression but are exported
-   anyway because they might be useful in applications using the
-   compression library.
-*/
-
-ZEXTERN uLong ZEXPORT adler32 OF((uLong adler, const Bytef *buf, uInt len));
-
-/*
-     Update a running Adler-32 checksum with the bytes buf[0..len-1] and
-   return the updated checksum. If buf is NULL, this function returns
-   the required initial value for the checksum.
-   An Adler-32 checksum is almost as reliable as a CRC32 but can be computed
-   much faster. Usage example:
-
-     uLong adler = adler32(0L, Z_NULL, 0);
-
-     while (read_buffer(buffer, length) != EOF) {
-       adler = adler32(adler, buffer, length);
-     }
-     if (adler != original_adler) error();
-*/
-
-ZEXTERN uLong ZEXPORT crc32   OF((uLong crc, const Bytef *buf, uInt len));
-/*
-     Update a running crc with the bytes buf[0..len-1] and return the updated
-   crc. If buf is NULL, this function returns the required initial value
-   for the crc. Pre- and post-conditioning (one's complement) is performed
-   within this function so it shouldn't be done by the application.
-   Usage example:
-
-     uLong crc = crc32(0L, Z_NULL, 0);
-
-     while (read_buffer(buffer, length) != EOF) {
-       crc = crc32(crc, buffer, length);
-     }
-     if (crc != original_crc) error();
-*/
-
-
-                        /* various hacks, don't look :) */
-
-/* deflateInit and inflateInit are macros to allow checking the zlib version
- * and the compiler's view of z_stream:
- */
-ZEXTERN int ZEXPORT deflateInit_ OF((z_streamp strm, int level,
-                                     const char *version, int stream_size));
-ZEXTERN int ZEXPORT inflateInit_ OF((z_streamp strm,
-                                     const char *version, int stream_size));
-ZEXTERN int ZEXPORT deflateInit2_ OF((z_streamp strm, int  level, int  method,
-                                      int windowBits, int memLevel,
-                                      int strategy, const char *version,
-                                      int stream_size));
-ZEXTERN int ZEXPORT inflateInit2_ OF((z_streamp strm, int  windowBits,
-                                      const char *version, int stream_size));
-#define deflateInit(strm, level) \
-        deflateInit_((strm), (level),       ZLIB_VERSION, sizeof(z_stream))
-#define inflateInit(strm) \
-        inflateInit_((strm),                ZLIB_VERSION, sizeof(z_stream))
-#define deflateInit2(strm, level, method, windowBits, memLevel, strategy) \
-        deflateInit2_((strm),(level),(method),(windowBits),(memLevel),\
-                      (strategy),           ZLIB_VERSION, sizeof(z_stream))
-#define inflateInit2(strm, windowBits) \
-        inflateInit2_((strm), (windowBits), ZLIB_VERSION, sizeof(z_stream))
-
-
-#if !defined(_Z_UTIL_H) && !defined(NO_DUMMY_DECL)
-    struct internal_state {int dummy;}; /* hack for buggy compilers */
-#endif
-
-ZEXTERN const char   * ZEXPORT zError           OF((int err));
-ZEXTERN int            ZEXPORT inflateSyncPoint OF((z_streamp z));
-ZEXTERN const uLongf * ZEXPORT get_crc_table    OF((void));
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _ZLIB_H */
diff --git a/lib/zlib/zlib.html b/lib/zlib/zlib.html
deleted file mode 100644 (file)
index c343703..0000000
+++ /dev/null
@@ -1,971 +0,0 @@
-<html>
-<head>
- <title>
- zlib general purpose compression library version 1.1.4
- </title>
-</head>
-<body bgcolor="White" text="Black" vlink="Red" alink="Navy" link="Red">
-<!-- background="zlibbg.gif" -->
-
-<h1> zlib 1.1.4 Manual </h1>
-<hr>
-<a name="Contents"><h2>Contents</h2>
-<ol type="I">
-<li> <a href="#Prologue">Prologue</a>
-<li> <a href="#Introduction">Introduction</a>
-<li> <a href="#Utility functions">Utility functions</a>
-<li> <a href="#Basic functions">Basic functions</a>
-<li> <a href="#Advanced functions">Advanced functions</a>
-<li> <a href="#Constants">Constants</a>
-<li> <a href="#struct z_stream_s">struct z_stream_s</a>
-<li> <a href="#Checksum functions">Checksum functions</a>
-<li> <a href="#Misc">Misc</a>
-</ol>
-<hr>
-<a name="Prologue"><h2> Prologue </h2>
-  'zlib' general purpose compression library version 1.1.4, March 11th, 2002
-  <p>
-  Copyright (C) 1995-2002 Jean-loup Gailly and Mark Adler
-  <p>
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-  <p>
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-  <ol>
-   <li> The origin of this software must not be misrepresented ; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-   <li> Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-   <li> This notice may not be removed or altered from any source distribution.
-  </ol>
-
-  <dl>
-  <dt>Jean-loup Gailly        
-  <dd><a href="mailto:jloup@gzip.org">jloup@gzip.org</a>
-  <dt>Mark Adler
-  <dd><a href="mailto:madler@alumni.caltech.edu">madler@alumni.caltech.edu</a>
-  </dl>
-
-  The data format used by the zlib library is described by RFCs (Request for
-  Comments) 1950 to 1952 in the files
-  <a href="ftp://ds.internic.net/rfc/rfc1950.txt">
-  ftp://ds.internic.net/rfc/rfc1950.txt </a>
-  (zlib format), 
-  <a href="ftp://ds.internic.net/rfc/rfc1951.txt">
-  rfc1951.txt </a>
-  (<a href="#deflate">deflate</a> format) and 
-  <a href="ftp://ds.internic.net/rfc/rfc1952.txt">
-  rfc1952.txt </a>
-  (gzip format).
-  <p>
-  This manual is converted from zlib.h by 
-  <a href="mailto:piaip@csie.ntu.edu.tw"> piaip </a>
-  <p>
-  Visit <a href="http://ftp.cdrom.com/pub/infozip/zlib/">
-  http://ftp.cdrom.com/pub/infozip/zlib/</a> 
-  for the official zlib web page.
-  <p>
-
-<hr>
-<a name="Introduction"><h2> Introduction </h2>
-     The 'zlib' compression library provides in-memory compression and
-  decompression functions, including integrity checks of the uncompressed
-  data.  This version of the library supports only one compression method
-  (deflation) but other algorithms will be added later and will have the same
-  stream interface.
-  <p>
-
-     Compression can be done in a single step if the buffers are large
-  enough (for example if an input file is mmap'ed), or can be done by
-  repeated calls of the compression function.  In the latter case, the
-  application must provide more input and/or consume the output
-  (providing more output space) before each call.
-  <p>
-
-     The library also supports reading and writing files in gzip (.gz) format
-  with an interface similar to that of stdio.
-  <p>
-
-     The library does not install any signal handler. The decoder checks
-  the consistency of the compressed data, so the library should never
-  crash even in case of corrupted input.
-  <p>
-
-<hr>
-<a name="Utility functions"><h2> Utility functions </h2>
-     The following utility functions are implemented on top of the
-   <a href="#Basic functions">basic stream-oriented functions</a>. 
-   To simplify the interface, some
-   default options are assumed (compression level and memory usage,
-   standard memory allocation functions). The source code of these
-   utility functions can easily be modified if you need special options.
-<h3> Function list </h3>
-<ul>
-<li> int  <a href="#compress">compress</a> (Bytef *dest,   uLongf *destLen, const Bytef *source, uLong sourceLen);
-<li> int  <a href="#compress2">compress2</a> (Bytef *dest,   uLongf *destLen, const Bytef *source, uLong sourceLen, int level);
-<li> int  <a href="#uncompress">uncompress</a> (Bytef *dest,   uLongf *destLen, const Bytef *source, uLong sourceLen);
-<li> typedef voidp gzFile;
-<li>  gzFile  <a href="#gzopen">gzopen</a>  (const char *path, const char *mode);
-<li> gzFile  <a href="#gzdopen">gzdopen</a>  (int fd, const char *mode);
-<li> int  <a href="#gzsetparams">gzsetparams</a> (gzFile file, int level, int strategy);
-<li> int     <a href="#gzread">gzread</a>  (gzFile file, voidp buf, unsigned len);
-<li> int     <a href="#gzwrite">gzwrite</a> (gzFile file, const voidp buf, unsigned len);
-<li> int VA   <a href="#gzprintf">gzprintf</a> (gzFile file, const char *format, ...);
-<li> int  <a href="#gzputs">gzputs</a> (gzFile file, const char *s);
-<li> char *  <a href="#gzgets">gzgets</a> (gzFile file, char *buf, int len);
-<li> int     <a href="#gzputc">gzputc</a> (gzFile file, int c);
-<li> int     <a href="#gzgetc">gzgetc</a> (gzFile file);
-<li> int     <a href="#gzflush">gzflush</a> (gzFile file, int flush);
-<li> z_off_t     <a href="#gzseek">gzseek</a> (gzFile file, z_off_t offset, int whence);
-<li> z_off_t     <a href="#gztell">gztell</a> (gzFile file);
-<li> int     <a href="#gzrewind">gzrewind</a> (gzFile file);
-<li> int  <a href="#gzeof">gzeof</a> (gzFile file);
-<li> int     <a href="#gzclose">gzclose</a> (gzFile file);
-<li> const char *  <a href="#gzerror">gzerror</a> (gzFile file, int *errnum);
-</ul>
-<h3> Function description </h3>
-<dl>
-<font color="Blue"><dt> int  <a name="compress">compress</a> (Bytef *dest,   uLongf *destLen, const Bytef *source, uLong sourceLen);</font>
-<dd>
-     Compresses the source buffer into the destination buffer.  sourceLen is
-   the byte length of the source buffer. Upon entry, destLen is the total
-   size of the destination buffer, which must be at least 0.1% larger than
-   sourceLen plus 12 bytes. Upon exit, destLen is the actual size of the
-   compressed buffer.<p>
-     This function can be used to <a href="#compress">compress</a> a whole file at once if the
-   input file is mmap'ed.<p>
-     <a href="#compress">compress</a> returns <a href="#Z_OK">Z_OK</a> if success, <a href="#Z_MEM_ERROR">Z_MEM_ERROR</a> if there was not
-   enough memory, <a href="#Z_BUF_ERROR">Z_BUF_ERROR</a> if there was not enough room in the output
-   buffer.<p>
-
-<font color="Blue"><dt> int  <a name="compress2">compress2</a> (Bytef *dest,   uLongf *destLen, const Bytef *source, uLong sourceLen, int level);</font>
-<dd>
-     Compresses the source buffer into the destination buffer. The level
-   parameter has the same meaning as in <a href="#deflateInit">deflateInit</a>.  sourceLen is the byte
-   length of the source buffer. Upon entry, destLen is the total size of the
-   destination buffer, which must be at least 0.1% larger than sourceLen plus
-   12 bytes. Upon exit, destLen is the actual size of the compressed buffer.
-   <p>
-
-     <a href="#compress2">compress2</a> returns <a href="#Z_OK">Z_OK</a> if success, <a href="#Z_MEM_ERROR">Z_MEM_ERROR</a> if there was not enough
-   memory, <a href="#Z_BUF_ERROR">Z_BUF_ERROR</a> if there was not enough room in the output buffer,
-   <a href="#Z_STREAM_ERROR">Z_STREAM_ERROR</a> if the level parameter is invalid.
-   <p>
-
-<font color="Blue"><dt> int  <a name="uncompress">uncompress</a> (Bytef *dest,   uLongf *destLen, const Bytef *source, uLong sourceLen);</font>
-<dd>
-     Decompresses the source buffer into the destination buffer.  sourceLen is
-   the byte length of the source buffer. Upon entry, destLen is the total
-   size of the destination buffer, which must be large enough to hold the
-   entire uncompressed data. (The size of the uncompressed data must have
-   been saved previously by the compressor and transmitted to the decompressor
-   by some mechanism outside the scope of this compression library.)
-   Upon exit, destLen is the actual size of the compressed buffer. <p>
-     This function can be used to decompress a whole file at once if the
-   input file is mmap'ed.
-   <p>
-
-     <a href="#uncompress">uncompress</a> returns <a href="#Z_OK">Z_OK</a> if success, <a href="#Z_MEM_ERROR">Z_MEM_ERROR</a> if there was not
-   enough memory, <a href="#Z_BUF_ERROR">Z_BUF_ERROR</a> if there was not enough room in the output
-   buffer, or <a href="#Z_DATA_ERROR">Z_DATA_ERROR</a> if the input data was corrupted.
-   <p>
-
-<dt> typedef voidp gzFile;
-<dd> <p>
-
-<font color="Blue"><dt>  gzFile  <a name="gzopen">gzopen</a>  (const char *path, const char *mode);</font>
-<dd>
-     Opens a gzip (.gz) file for reading or writing. The mode parameter
-   is as in fopen ("rb" or "wb") but can also include a compression level
-   ("wb9") or a strategy: 'f' for filtered data as in "wb6f", 'h' for
-   Huffman only compression as in "wb1h". (See the description
-   of <a href="#deflateInit2">deflateInit2</a> for more information about the strategy parameter.)
-   <p>
-
-     <a href="#gzopen">gzopen</a> can be used to read a file which is not in gzip format ; in this
-   case <a href="#gzread">gzread</a> will directly read from the file without decompression.
-   <p>
-
-     <a href="#gzopen">gzopen</a> returns NULL if the file could not be opened or if there was
-   insufficient memory to allocate the (de)compression <a href="#state">state</a> ; errno
-   can be checked to distinguish the two cases (if errno is zero, the
-   zlib error is <a href="#Z_MEM_ERROR">Z_MEM_ERROR</a>).
-   <p>
-
-<font color="Blue"><dt> gzFile  <a name="gzdopen">gzdopen</a>  (int fd, const char *mode);</font>
-<dd>
-     <a href="#gzdopen">gzdopen</a>() associates a gzFile with the file descriptor fd.  File
-   descriptors are obtained from calls like open, dup, creat, pipe or
-   fileno (in the file has been previously opened with fopen).
-   The mode parameter is as in <a href="#gzopen">gzopen</a>.
-   <p>
-     The next call of <a href="#gzclose">gzclose</a> on the returned gzFile will also close the
-   file descriptor fd, just like fclose(fdopen(fd), mode) closes the file
-   descriptor fd. If you want to keep fd open, use <a href="#gzdopen">gzdopen</a>(dup(fd), mode).
-   <p>
-     <a href="#gzdopen">gzdopen</a> returns NULL if there was insufficient memory to allocate
-   the (de)compression <a href="#state">state</a>.
-   <p>
-
-<font color="Blue"><dt> int  <a name="gzsetparams">gzsetparams</a> (gzFile file, int level, int strategy);</font>
-<dd>
-     Dynamically update the compression level or strategy. See the description
-   of <a href="#deflateInit2">deflateInit2</a> for the meaning of these parameters.
-   <p>
-     <a href="#gzsetparams">gzsetparams</a> returns <a href="#Z_OK">Z_OK</a> if success, or <a href="#Z_STREAM_ERROR">Z_STREAM_ERROR</a> if the file was not
-   opened for writing.
-   <p>
-
-<font color="Blue"><dt> int     <a name="gzread">gzread</a>  (gzFile file, voidp buf, unsigned len);</font>
-<dd>
-     Reads the given number of uncompressed bytes from the compressed file.
-   If the input file was not in gzip format, <a href="#gzread">gzread</a> copies the given number
-   of bytes into the buffer.
-   <p>
-     <a href="#gzread">gzread</a> returns the number of uncompressed bytes actually read (0 for
-   end of file, -1 for error).
-   <p>
-
-<font color="Blue"><dt> int     <a name="gzwrite">gzwrite</a> (gzFile file, const voidp buf, unsigned len);</font>
-<dd>
-     Writes the given number of uncompressed bytes into the compressed file.
-   <a href="#gzwrite">gzwrite</a> returns the number of uncompressed bytes actually written
-   (0 in case of error).
-   <p>
-
-<font color="Blue"><dt> int VA   <a name="gzprintf">gzprintf</a> (gzFile file, const char *format, ...);</font>
-<dd>
-     Converts, formats, and writes the args to the compressed file under
-   control of the format string, as in fprintf. <a href="#gzprintf">gzprintf</a> returns the number of
-   uncompressed bytes actually written (0 in case of error).
-   <p>
-
-<font color="Blue"><dt> int  <a name="gzputs">gzputs</a> (gzFile file, const char *s);</font>
-<dd>
-      Writes the given null-terminated string to the compressed file, excluding
-   the terminating null character.
-   <p>
-      <a href="#gzputs">gzputs</a> returns the number of characters written, or -1 in case of error.
-      <p>
-
-<font color="Blue"><dt> char *  <a name="gzgets">gzgets</a> (gzFile file, char *buf, int len);</font>
-<dd>
-      Reads bytes from the compressed file until len-1 characters are read, or
-   a newline character is read and transferred to buf, or an end-of-file
-   condition is encountered.  The string is then terminated with a null
-   character.
-   <p>
-      <a href="#gzgets">gzgets</a> returns buf, or <a href="#Z_NULL">Z_NULL</a> in case of error.
-      <p>
-
-<font color="Blue"><dt> int     <a name="gzputc">gzputc</a> (gzFile file, int c);</font>
-<dd>
-      Writes c, converted to an unsigned char, into the compressed file.
-   <a href="#gzputc">gzputc</a> returns the value that was written, or -1 in case of error.
-   <p>
-
-<font color="Blue"><dt> int     <a name="gzgetc">gzgetc</a> (gzFile file);</font>
-<dd>
-      Reads one byte from the compressed file. <a href="#gzgetc">gzgetc</a> returns this byte
-   or -1 in case of end of file or error.
-   <p>
-
-<font color="Blue"><dt> int     <a name="gzflush">gzflush</a> (gzFile file, int flush);</font>
-<dd>
-     Flushes all pending output into the compressed file. The parameter
-   flush is as in the <a href="#deflate">deflate</a>() function. The return value is the zlib
-   error number (see function <a href="#gzerror">gzerror</a> below). <a href="#gzflush">gzflush</a> returns <a href="#Z_OK">Z_OK</a> if
-   the flush parameter is <a href="#Z_FINISH">Z_FINISH</a> and all output could be flushed.
-   <p>
-     <a href="#gzflush">gzflush</a> should be called only when strictly necessary because it can
-   degrade compression.
-   <p>
-
-<font color="Blue"><dt> z_off_t     <a name="gzseek">gzseek</a> (gzFile file, z_off_t offset, int whence);</font>
-<dd>
-      Sets the starting position for the next <a href="#gzread">gzread</a> or <a href="#gzwrite">gzwrite</a> on the
-   given compressed file. The offset represents a number of bytes in the
-   uncompressed data stream. The whence parameter is defined as in lseek(2);
-   the value SEEK_END is not supported.
-   <p>
-     If the file is opened for reading, this function is emulated but can be
-   extremely slow. If the file is opened for writing, only forward seeks are
-   supported ; <a href="#gzseek">gzseek</a> then compresses a sequence of zeroes up to the new
-   starting position.
-   <p>
-      <a href="#gzseek">gzseek</a> returns the resulting offset location as measured in bytes from
-   the beginning of the uncompressed stream, or -1 in case of error, in
-   particular if the file is opened for writing and the new starting position
-   would be before the current position.
-   <p>
-
-<font color="Blue"><dt> int     <a name="gzrewind">gzrewind</a> (gzFile file);</font>
-<dd>
-     Rewinds the given file. This function is supported only for reading.
-     <p>
-   <a href="#gzrewind">gzrewind</a>(file) is equivalent to (int)<a href="#gzseek">gzseek</a>(file, 0L, SEEK_SET)
-   <p>
-
-<font color="Blue"><dt> z_off_t     <a name="gztell">gztell</a> (gzFile file);</font>
-<dd>
-     Returns the starting position for the next <a href="#gzread">gzread</a> or <a href="#gzwrite">gzwrite</a> on the
-   given compressed file. This position represents a number of bytes in the
-   uncompressed data stream.
-   <p>
-
-   <a href="#gztell">gztell</a>(file) is equivalent to <a href="#gzseek">gzseek</a>(file, 0L, SEEK_CUR)
-   <p>
-
-<font color="Blue"><dt> int  <a name="gzeof">gzeof</a> (gzFile file);</font>
-<dd>
-     Returns 1 when EOF has previously been detected reading the given
-   input stream, otherwise zero.
-   <p>
-
-<font color="Blue"><dt> int     <a name="gzclose">gzclose</a> (gzFile file);</font>
-<dd>
-     Flushes all pending output if necessary, closes the compressed file
-   and deallocates all the (de)compression <a href="#state">state</a>. The return value is the zlib
-   error number (see function <a href="#gzerror">gzerror</a> below).
-   <p>
-
-<font color="Blue"><dt> const char *  <a name="gzerror">gzerror</a> (gzFile file, int *errnum);</font>
-<dd>
-     Returns the error message for the last error which occurred on the
-   given compressed file. errnum is set to zlib error number. If an
-   error occurred in the file system and not in the compression library,
-   errnum is set to <a href="#Z_ERRNO">Z_ERRNO</a> and the application may consult errno
-   to get the exact error code.
-   <p>
-</dl>
-<hr>
-<a name="Basic functions"><h2> Basic functions </h2>
-<h3> Function list </h3>
-<ul>
-<li>  const char *  <a href="#zlibVersion">zlibVersion</a> (void);
-<li>  int  <a href="#deflateInit">deflateInit</a> (<a href="#z_streamp">z_streamp</a> strm, int level);
-<li>  int  <a href="#deflate">deflate</a> (<a href="#z_streamp">z_streamp</a> strm, int flush);
-<li>  int  <a href="#deflateEnd">deflateEnd</a> (<a href="#z_streamp">z_streamp</a> strm);
-<li>  int  <a href="#inflateInit">inflateInit</a> (<a href="#z_streamp">z_streamp</a> strm);
-<li>  int  <a href="#inflate">inflate</a> (<a href="#z_streamp">z_streamp</a> strm, int flush);
-<li>  int  <a href="#inflateEnd">inflateEnd</a> (<a href="#z_streamp">z_streamp</a> strm);
-</ul>
-
-<h3> Function description </h3>
-<dl>
-<font color="Blue"><dt>  const char *  <a name="zlibVersion">zlibVersion</a> (void);</font>
-<dd> The application can compare <a href="#zlibVersion">zlibVersion</a> and ZLIB_VERSION for consistency.
-   If the first character differs, the library code actually used is
-   not compatible with the zlib.h header file used by the application.
-   This check is automatically made by <a href="#deflateInit">deflateInit</a> and <a href="#inflateInit">inflateInit</a>.
-   <p>
-
-<font color="Blue"><dt> int  <a name="deflateInit">deflateInit</a> (<a href="#z_streamp">z_streamp</a> strm, int level);</font>
-<dd>
-     Initializes the internal stream <a href="#state">state</a> for compression. The fields
-   <a href="#zalloc">zalloc</a>, <a href="#zfree">zfree</a> and <a href="#opaque">opaque</a> must be initialized before by the caller.
-   If <a href="#zalloc">zalloc</a> and <a href="#zfree">zfree</a> are set to <a href="#Z_NULL">Z_NULL</a>, <a href="#deflateInit">deflateInit</a> updates them to
-   use default allocation functions.
-   <p>
-
-     The compression level must be <a href="#Z_DEFAULT_COMPRESSION">Z_DEFAULT_COMPRESSION</a>, or between 0 and 9:
-   1 gives best speed, 9 gives best compression, 0 gives no compression at
-   all (the input data is simply copied a block at a time).
-   <p>
-
-   <a href="#Z_DEFAULT_COMPRESSION">Z_DEFAULT_COMPRESSION</a> requests a default compromise between speed and
-   compression (currently equivalent to level 6).
-   <p>
-
-     <a href="#deflateInit">deflateInit</a> returns <a href="#Z_OK">Z_OK</a> if success, <a href="#Z_MEM_ERROR">Z_MEM_ERROR</a> if there was not
-   enough memory, <a href="#Z_STREAM_ERROR">Z_STREAM_ERROR</a> if level is not a valid compression level,
-   <a href="#Z_VERSION_ERROR">Z_VERSION_ERROR</a> if the zlib library version (<a href="#zlib_version">zlib_version</a>) is incompatible
-   with the version assumed by the caller (ZLIB_VERSION).
-   <a href="#msg">msg</a> is set to null if there is no error message.  <a href="#deflateInit">deflateInit</a> does not
-   perform any compression: this will be done by <a href="#deflate">deflate</a>().
-   <p>
-
-<font color="Blue"><dt>  int  <a name="deflate">deflate</a> (<a href="#z_streamp">z_streamp</a> strm, int flush);</font>
-<dd>
-    <a href="#deflate">deflate</a> compresses as much data as possible, and stops when the input
-  buffer becomes empty or the output buffer becomes full. It may introduce some
-  output latency (reading input without producing any output) except when
-  forced to flush.<p>
-
-    The detailed semantics are as follows. <a href="#deflate">deflate</a> performs one or both of the
-  following actions:
-
-  <ul>
-  <li> Compress more input starting at <a href="#next_in">next_in</a> and update <a href="#next_in">next_in</a> and <a href="#avail_in">avail_in</a>
-    accordingly. If not all input can be processed (because there is not
-    enough room in the output buffer), <a href="#next_in">next_in</a> and <a href="#avail_in">avail_in</a> are updated and
-    processing will resume at this point for the next call of <a href="#deflate">deflate</a>().
-
-  <li> 
-    Provide more output starting at <a href="#next_out">next_out</a> and update <a href="#next_out">next_out</a> and <a href="#avail_out">avail_out</a>
-    accordingly. This action is forced if the parameter flush is non zero.
-    Forcing flush frequently degrades the compression ratio, so this parameter
-    should be set only when necessary (in interactive applications).
-    Some output may be provided even if flush is not set.
-  </ul> <p>
-
-  Before the call of <a href="#deflate">deflate</a>(), the application should ensure that at least
-  one of the actions is possible, by providing more input and/or consuming
-  more output, and updating <a href="#avail_in">avail_in</a> or <a href="#avail_out">avail_out</a> accordingly ; <a href="#avail_out">avail_out</a>
-  should never be zero before the call. The application can consume the
-  compressed output when it wants, for example when the output buffer is full
-  (<a href="#avail_out">avail_out</a> == 0), or after each call of <a href="#deflate">deflate</a>(). If <a href="#deflate">deflate</a> returns <a href="#Z_OK">Z_OK</a>
-  and with zero <a href="#avail_out">avail_out</a>, it must be called again after making room in the
-  output buffer because there might be more output pending.
-  <p>
-
-    If the parameter flush is set to <a href="#Z_SYNC_FLUSH">Z_SYNC_FLUSH</a>, all pending output is
-  flushed to the output buffer and the output is aligned on a byte boundary, so
-  that the decompressor can get all input data available so far. (In particular
-  <a href="#avail_in">avail_in</a> is zero after the call if enough output space has been provided
-  before the call.)  Flushing may degrade compression for some compression
-  algorithms and so it should be used only when necessary.
-  <p>
-
-    If flush is set to <a href="#Z_FULL_FLUSH">Z_FULL_FLUSH</a>, all output is flushed as with
-  <a href="#Z_SYNC_FLUSH">Z_SYNC_FLUSH</a>, and the compression <a href="#state">state</a> is reset so that decompression can
-  restart from this point if previous compressed data has been damaged or if
-  random access is desired. Using <a href="#Z_FULL_FLUSH">Z_FULL_FLUSH</a> too often can seriously degrade
-  the compression.
-  <p>
-
-    If <a href="#deflate">deflate</a> returns with <a href="#avail_out">avail_out</a> == 0, this function must be called again
-  with the same value of the flush parameter and more output space (updated
-  <a href="#avail_out">avail_out</a>), until the flush is complete (<a href="#deflate">deflate</a> returns with non-zero
-  <a href="#avail_out">avail_out</a>).
-  <p>
-
-    If the parameter flush is set to <a href="#Z_FINISH">Z_FINISH</a>, pending input is processed,
-  pending output is flushed and <a href="#deflate">deflate</a> returns with <a href="#Z_STREAM_END">Z_STREAM_END</a> if there
-  was enough output space ; if <a href="#deflate">deflate</a> returns with <a href="#Z_OK">Z_OK</a>, this function must be
-  called again with <a href="#Z_FINISH">Z_FINISH</a> and more output space (updated <a href="#avail_out">avail_out</a>) but no
-  more input data, until it returns with <a href="#Z_STREAM_END">Z_STREAM_END</a> or an error. After
-  <a href="#deflate">deflate</a> has returned <a href="#Z_STREAM_END">Z_STREAM_END</a>, the only possible operations on the
-  stream are <a href="#deflateReset">deflateReset</a> or <a href="#deflateEnd">deflateEnd</a>.
-  <p>
-  
-    <a href="#Z_FINISH">Z_FINISH</a> can be used immediately after <a href="#deflateInit">deflateInit</a> if all the compression
-  is to be done in a single step. In this case, <a href="#avail_out">avail_out</a> must be at least
-  0.1% larger than <a href="#avail_in">avail_in</a> plus 12 bytes.  If <a href="#deflate">deflate</a> does not return
-  <a href="#Z_STREAM_END">Z_STREAM_END</a>, then it must be called again as described above.
-  <p>
-
-    <a href="#deflate">deflate</a>() sets strm-&gt <a href="#adler">adler</a> to the <a href="#adler32">adler32</a> checksum of all input read
-  so far (that is, <a href="#total_in">total_in</a> bytes).
-  <p>
-
-    <a href="#deflate">deflate</a>() may update <a href="#data_type">data_type</a> if it can make a good guess about
-  the input data type (<a href="#Z_ASCII">Z_ASCII</a> or <a href="#Z_BINARY">Z_BINARY</a>). In doubt, the data is considered
-  binary. This field is only for information purposes and does not affect
-  the compression algorithm in any manner.
-  <p>
-
-    <a href="#deflate">deflate</a>() returns <a href="#Z_OK">Z_OK</a> if some progress has been made (more input
-  processed or more output produced), <a href="#Z_STREAM_END">Z_STREAM_END</a> if all input has been
-  consumed and all output has been produced (only when flush is set to
-  <a href="#Z_FINISH">Z_FINISH</a>), <a href="#Z_STREAM_ERROR">Z_STREAM_ERROR</a> if the stream <a href="#state">state</a> was inconsistent (for example
-  if <a href="#next_in">next_in</a> or <a href="#next_out">next_out</a> was NULL), <a href="#Z_BUF_ERROR">Z_BUF_ERROR</a> if no progress is possible
-  (for example <a href="#avail_in">avail_in</a> or <a href="#avail_out">avail_out</a> was zero).
-  <p>
-
-<font color="Blue"><dt>  int  <a name="deflateEnd">deflateEnd</a> (<a href="#z_streamp">z_streamp</a> strm);</font>
-<dd>
-     All dynamically allocated data structures for this stream are freed.
-   This function discards any unprocessed input and does not flush any
-   pending output.
-   <p>
-
-     <a href="#deflateEnd">deflateEnd</a> returns <a href="#Z_OK">Z_OK</a> if success, <a href="#Z_STREAM_ERROR">Z_STREAM_ERROR</a> if the
-   stream <a href="#state">state</a> was inconsistent, <a href="#Z_DATA_ERROR">Z_DATA_ERROR</a> if the stream was freed
-   prematurely (some input or output was discarded). In the error case,
-   <a href="#msg">msg</a> may be set but then points to a static string (which must not be
-   deallocated).
-   <p>
-
-<font color="Blue"><dt>  int  <a name="inflateInit">inflateInit</a> (<a href="#z_streamp">z_streamp</a> strm);</font>
-<dd>     
-       Initializes the internal stream <a href="#state">state</a> for decompression. The fields
-   <a href="#next_in">next_in</a>, <a href="#avail_in">avail_in</a>, <a href="#zalloc">zalloc</a>, <a href="#zfree">zfree</a> and <a href="#opaque">opaque</a> must be initialized before by
-   the caller. If <a href="#next_in">next_in</a> is not <a href="#Z_NULL">Z_NULL</a> and <a href="#avail_in">avail_in</a> is large enough (the exact
-   value depends on the compression method), <a href="#inflateInit">inflateInit</a> determines the
-   compression method from the zlib header and allocates all data structures
-   accordingly ; otherwise the allocation will be deferred to the first call of
-   <a href="#inflate">inflate</a>.  If <a href="#zalloc">zalloc</a> and <a href="#zfree">zfree</a> are set to <a href="#Z_NULL">Z_NULL</a>, <a href="#inflateInit">inflateInit</a> updates them to
-   use default allocation functions.
-   <p>
-
-     <a href="#inflateInit">inflateInit</a> returns <a href="#Z_OK">Z_OK</a> if success, <a href="#Z_MEM_ERROR">Z_MEM_ERROR</a> if there was not enough
-   memory, <a href="#Z_VERSION_ERROR">Z_VERSION_ERROR</a> if the zlib library version is incompatible with the
-   version assumed by the caller.  <a href="#msg">msg</a> is set to null if there is no error
-   message. <a href="#inflateInit">inflateInit</a> does not perform any decompression apart from reading
-   the zlib header if present: this will be done by <a href="#inflate">inflate</a>().  (So <a href="#next_in">next_in</a> and
-   <a href="#avail_in">avail_in</a> may be modified, but <a href="#next_out">next_out</a> and <a href="#avail_out">avail_out</a> are unchanged.)
-   <p>
-
-<font color="Blue"><dt>  int  <a name="inflate">inflate</a> (<a href="#z_streamp">z_streamp</a> strm, int flush);</font>
-<dd>
-    <a href="#inflate">inflate</a> decompresses as much data as possible, and stops when the input
-  buffer becomes empty or the output buffer becomes full. It may some
-  introduce some output latency (reading input without producing any output)
-  except when forced to flush.
-  <p>
-
-  The detailed semantics are as follows. <a href="#inflate">inflate</a> performs one or both of the
-  following actions:
-
-  <ul>
-  <li> Decompress more input starting at <a href="#next_in">next_in</a> and update <a href="#next_in">next_in</a> and <a href="#avail_in">avail_in</a>
-    accordingly. If not all input can be processed (because there is not
-    enough room in the output buffer), <a href="#next_in">next_in</a> is updated and processing
-    will resume at this point for the next call of <a href="#inflate">inflate</a>().
-
-  <li> Provide more output starting at <a href="#next_out">next_out</a> and update <a href="#next_out">next_out</a> and 
-    <a href="#avail_out">avail_out</a> accordingly.  <a href="#inflate">inflate</a>() provides as much output as possible, 
-    until there is no more input data or no more space in the output buffer 
-    (see below about the flush parameter).
-  </ul> <p>
-
-  Before the call of <a href="#inflate">inflate</a>(), the application should ensure that at least
-  one of the actions is possible, by providing more input and/or consuming
-  more output, and updating the next_* and avail_* values accordingly.
-  The application can consume the uncompressed output when it wants, for
-  example when the output buffer is full (<a href="#avail_out">avail_out</a> == 0), or after each
-  call of <a href="#inflate">inflate</a>(). If <a href="#inflate">inflate</a> returns <a href="#Z_OK">Z_OK</a> and with zero <a href="#avail_out">avail_out</a>, it
-  must be called again after making room in the output buffer because there
-  might be more output pending.
-  <p>
-
-    If the parameter flush is set to <a href="#Z_SYNC_FLUSH">Z_SYNC_FLUSH</a>, <a href="#inflate">inflate</a> flushes as much
-  output as possible to the output buffer. The flushing behavior of <a href="#inflate">inflate</a> is
-  not specified for values of the flush parameter other than <a href="#Z_SYNC_FLUSH">Z_SYNC_FLUSH</a>
-  and <a href="#Z_FINISH">Z_FINISH</a>, but the current implementation actually flushes as much output
-  as possible anyway.
-  <p>
-
-    <a href="#inflate">inflate</a>() should normally be called until it returns <a href="#Z_STREAM_END">Z_STREAM_END</a> or an
-  error. However if all decompression is to be performed in a single step
-  (a single call of <a href="#inflate">inflate</a>), the parameter flush should be set to
-  <a href="#Z_FINISH">Z_FINISH</a>. In this case all pending input is processed and all pending
-  output is flushed ; <a href="#avail_out">avail_out</a> must be large enough to hold all the
-  uncompressed data. (The size of the uncompressed data may have been saved
-  by the compressor for this purpose.) The next operation on this stream must
-  be <a href="#inflateEnd">inflateEnd</a> to deallocate the decompression <a href="#state">state</a>. The use of <a href="#Z_FINISH">Z_FINISH</a>
-  is never required, but can be used to inform <a href="#inflate">inflate</a> that a faster routine
-  may be used for the single <a href="#inflate">inflate</a>() call.
-  <p>
-
-     If a preset dictionary is needed at this point (see <a href="#inflateSetDictionary">inflateSetDictionary</a>
-  below), <a href="#inflate">inflate</a> sets strm-<a href="#adler">adler</a> to the <a href="#adler32">adler32</a> checksum of the
-  dictionary chosen by the compressor and returns <a href="#Z_NEED_DICT">Z_NEED_DICT</a> ; otherwise 
-  it sets strm-&gt <a href="#adler">adler</a> to the <a href="#adler32">adler32</a> checksum of all output produced
-  so far (that is, <a href="#total_out">total_out</a> bytes) and returns <a href="#Z_OK">Z_OK</a>, <a href="#Z_STREAM_END">Z_STREAM_END</a> or
-  an error code as described below. At the end of the stream, <a href="#inflate">inflate</a>()
-  checks that its computed <a href="#adler32">adler32</a> checksum is equal to that saved by the
-  compressor and returns <a href="#Z_STREAM_END">Z_STREAM_END</a> only if the checksum is correct.
-  <p>
-
-    <a href="#inflate">inflate</a>() returns <a href="#Z_OK">Z_OK</a> if some progress has been made (more input processed
-  or more output produced), <a href="#Z_STREAM_END">Z_STREAM_END</a> if the end of the compressed data has
-  been reached and all uncompressed output has been produced, <a href="#Z_NEED_DICT">Z_NEED_DICT</a> if a
-  preset dictionary is needed at this point, <a href="#Z_DATA_ERROR">Z_DATA_ERROR</a> if the input data was
-  corrupted (input stream not conforming to the zlib format or incorrect
-  <a href="#adler32">adler32</a> checksum), <a href="#Z_STREAM_ERROR">Z_STREAM_ERROR</a> if the stream structure was inconsistent
-  (for example if <a href="#next_in">next_in</a> or <a href="#next_out">next_out</a> was NULL), <a href="#Z_MEM_ERROR">Z_MEM_ERROR</a> if there was not
-  enough memory, <a href="#Z_BUF_ERROR">Z_BUF_ERROR</a> if no progress is possible or if there was not
-  enough room in the output buffer when <a href="#Z_FINISH">Z_FINISH</a> is used. In the <a href="#Z_DATA_ERROR">Z_DATA_ERROR</a>
-  case, the application may then call <a href="#inflateSync">inflateSync</a> to look for a good
-  compression block.
-  <p>
-
-<font color="Blue"><dt>  int  <a name="inflateEnd">inflateEnd</a> (<a href="#z_streamp">z_streamp</a> strm);</font>
-<dd>
-     All dynamically allocated data structures for this stream are freed.
-   This function discards any unprocessed input and does not flush any
-   pending output.
-   <p>
-
-     <a href="#inflateEnd">inflateEnd</a> returns <a href="#Z_OK">Z_OK</a> if success, <a href="#Z_STREAM_ERROR">Z_STREAM_ERROR</a> if the stream <a href="#state">state</a>
-   was inconsistent. In the error case, <a href="#msg">msg</a> may be set but then points to a
-   static string (which must not be deallocated).
-</dl>
-<hr>
-<a name="Advanced functions"><h2> Advanced functions </h2>
-    The following functions are needed only in some special applications.
-<h3> Function list </h3>
-<ul>
-<li>  int  <a href="#deflateInit2">deflateInit2</a> (<a href="#z_streamp">z_streamp</a> strm,
-<li> int  <a href="#deflateSetDictionary">deflateSetDictionary</a> (<a href="#z_streamp">z_streamp</a> strm, const Bytef *dictionary, uInt  dictLength);
-<li> int  <a href="#deflateCopy">deflateCopy</a> (<a href="#z_streamp">z_streamp</a> dest, <a href="#z_streamp">z_streamp</a> source);
-<li> int  <a href="#deflateReset">deflateReset</a> (<a href="#z_streamp">z_streamp</a> strm);
-<li> int  <a href="#deflateParams">deflateParams</a> (<a href="#z_streamp">z_streamp</a> strm, int level, int strategy);
-<li> int  <a href="#inflateInit2">inflateInit2</a> (<a href="#z_streamp">z_streamp</a> strm, int  windowBits);
-<li>  int  <a href="#inflateSetDictionary">inflateSetDictionary</a> (<a href="#z_streamp">z_streamp</a> strm, const Bytef *dictionary, uInt  dictLength);
-<li> int  <a href="#inflateSync">inflateSync</a> (<a href="#z_streamp">z_streamp</a> strm);
-<li> int  <a href="#inflateReset">inflateReset</a> (<a href="#z_streamp">z_streamp</a> strm);
-
-</ul>
-<h3> Function description </h3>
-<dl>
-<font color="Blue"><dt>  int  <a name="deflateInit2">deflateInit2</a> (<a href="#z_streamp">z_streamp</a> strm, int  level, int  method, int  windowBits, int  memLevel, int  strategy);</font>
-
-<dd> This is another version of <a href="#deflateInit">deflateInit</a> with more compression options. The
-   fields <a href="#next_in">next_in</a>, <a href="#zalloc">zalloc</a>, <a href="#zfree">zfree</a> and <a href="#opaque">opaque</a> must be initialized before by
-   the caller.<p>
-
-     The method parameter is the compression method. It must be <a href="#Z_DEFLATED">Z_DEFLATED</a> in
-   this version of the library.<p>
-
-     The windowBits parameter is the base two logarithm of the window size
-   (the size of the history buffer).  It should be in the range 8..15 for this
-   version of the library. Larger values of this parameter result in better
-   compression at the expense of memory usage. The default value is 15 if
-   <a href="#deflateInit">deflateInit</a> is used instead.<p>
-
-     The memLevel parameter specifies how much memory should be allocated
-   for the internal compression <a href="#state">state</a>. memLevel=1 uses minimum memory but
-   is slow and reduces compression ratio ; memLevel=9 uses maximum memory
-   for optimal speed. The default value is 8. See zconf.h for total memory
-   usage as a function of windowBits and memLevel.<p>
-
-     The strategy parameter is used to tune the compression algorithm. Use the
-   value <a href="#Z_DEFAULT_STRATEGY">Z_DEFAULT_STRATEGY</a> for normal data, <a href="#Z_FILTERED">Z_FILTERED</a> for data produced by a
-   filter (or predictor), or <a href="#Z_HUFFMAN_ONLY">Z_HUFFMAN_ONLY</a> to force Huffman encoding only (no
-   string match).  Filtered data consists mostly of small values with a
-   somewhat random distribution. In this case, the compression algorithm is
-   tuned to <a href="#compress">compress</a> them better. The effect of <a href="#Z_FILTERED">Z_FILTERED</a> is to force more
-   Huffman coding and less string matching ; it is somewhat intermediate
-   between Z_DEFAULT and <a href="#Z_HUFFMAN_ONLY">Z_HUFFMAN_ONLY</a>. The strategy parameter only affects
-   the compression ratio but not the correctness of the compressed output even
-   if it is not set appropriately.<p>
-
-      <a href="#deflateInit2">deflateInit2</a> returns <a href="#Z_OK">Z_OK</a> if success, <a href="#Z_MEM_ERROR">Z_MEM_ERROR</a> if there was not enough
-   memory, <a href="#Z_STREAM_ERROR">Z_STREAM_ERROR</a> if a parameter is invalid (such as an invalid
-   method). <a href="#msg">msg</a> is set to null if there is no error message.  <a href="#deflateInit2">deflateInit2</a> does
-   not perform any compression: this will be done by <a href="#deflate">deflate</a>().<p>
-                            
-<font color="Blue"><dt> int  <a name="deflateSetDictionary">deflateSetDictionary</a> (<a href="#z_streamp">z_streamp</a> strm, const Bytef *dictionary, uInt  dictLength);</font>
-<dd>
-     Initializes the compression dictionary from the given byte sequence
-   without producing any compressed output. This function must be called
-   immediately after <a href="#deflateInit">deflateInit</a>, <a href="#deflateInit2">deflateInit2</a> or <a href="#deflateReset">deflateReset</a>, before any
-   call of <a href="#deflate">deflate</a>. The compressor and decompressor must use exactly the same
-   dictionary (see <a href="#inflateSetDictionary">inflateSetDictionary</a>).<p>
-
-     The dictionary should consist of strings (byte sequences) that are likely
-   to be encountered later in the data to be compressed, with the most commonly
-   used strings preferably put towards the end of the dictionary. Using a
-   dictionary is most useful when the data to be compressed is short and can be
-   predicted with good accuracy ; the data can then be compressed better than
-   with the default empty dictionary.<p>
-
-     Depending on the size of the compression data structures selected by
-   <a href="#deflateInit">deflateInit</a> or <a href="#deflateInit2">deflateInit2</a>, a part of the dictionary may in effect be
-   discarded, for example if the dictionary is larger than the window size in
-   <a href="#deflate">deflate</a> or deflate2. Thus the strings most likely to be useful should be
-   put at the end of the dictionary, not at the front.<p>
-
-     Upon return of this function, strm-&gt <a href="#adler">adler</a> is set to the Adler32 value
-   of the dictionary ; the decompressor may later use this value to determine
-   which dictionary has been used by the compressor. (The Adler32 value
-   applies to the whole dictionary even if only a subset of the dictionary is
-   actually used by the compressor.)<p>
-
-     <a href="#deflateSetDictionary">deflateSetDictionary</a> returns <a href="#Z_OK">Z_OK</a> if success, or <a href="#Z_STREAM_ERROR">Z_STREAM_ERROR</a> if a
-   parameter is invalid (such as NULL dictionary) or the stream <a href="#state">state</a> is
-   inconsistent (for example if <a href="#deflate">deflate</a> has already been called for this stream
-   or if the compression method is bsort). <a href="#deflateSetDictionary">deflateSetDictionary</a> does not
-   perform any compression: this will be done by <a href="#deflate">deflate</a>().<p>
-
-<font color="Blue"><dt> int  <a name="deflateCopy">deflateCopy</a> (<a href="#z_streamp">z_streamp</a> dest, <a href="#z_streamp">z_streamp</a> source);</font>
-<dd>
-     Sets the destination stream as a complete copy of the source stream.<p>
-
-     This function can be useful when several compression strategies will be
-   tried, for example when there are several ways of pre-processing the input
-   data with a filter. The streams that will be discarded should then be freed
-   by calling <a href="#deflateEnd">deflateEnd</a>.  Note that <a href="#deflateCopy">deflateCopy</a> duplicates the internal
-   compression <a href="#state">state</a> which can be quite large, so this strategy is slow and
-   can consume lots of memory.<p>
-
-     <a href="#deflateCopy">deflateCopy</a> returns <a href="#Z_OK">Z_OK</a> if success, <a href="#Z_MEM_ERROR">Z_MEM_ERROR</a> if there was not
-   enough memory, <a href="#Z_STREAM_ERROR">Z_STREAM_ERROR</a> if the source stream <a href="#state">state</a> was inconsistent
-   (such as <a href="#zalloc">zalloc</a> being NULL). <a href="#msg">msg</a> is left unchanged in both source and
-   destination.<p>
-
-<font color="Blue"><dt> int  <a name="deflateReset">deflateReset</a> (<a href="#z_streamp">z_streamp</a> strm);</font>
-<dd>     This function is equivalent to <a href="#deflateEnd">deflateEnd</a> followed by <a href="#deflateInit">deflateInit</a>,
-   but does not free and reallocate all the internal compression <a href="#state">state</a>.
-   The stream will keep the same compression level and any other attributes
-   that may have been set by <a href="#deflateInit2">deflateInit2</a>.<p>
-
-      <a href="#deflateReset">deflateReset</a> returns <a href="#Z_OK">Z_OK</a> if success, or <a href="#Z_STREAM_ERROR">Z_STREAM_ERROR</a> if the source
-   stream <a href="#state">state</a> was inconsistent (such as <a href="#zalloc">zalloc</a> or <a href="#state">state</a> being NULL).<p>
-
-<font color="Blue"><dt> int  <a name="deflateParams">deflateParams</a> (<a href="#z_streamp">z_streamp</a> strm, int level, int strategy);</font>
-<dd>
-     Dynamically update the compression level and compression strategy.  The
-   interpretation of level and strategy is as in <a href="#deflateInit2">deflateInit2</a>.  This can be
-   used to switch between compression and straight copy of the input data, or
-   to switch to a different kind of input data requiring a different
-   strategy. If the compression level is changed, the input available so far
-   is compressed with the old level (and may be flushed); the new level will
-   take effect only at the next call of <a href="#deflate">deflate</a>().<p>
-
-     Before the call of <a href="#deflateParams">deflateParams</a>, the stream <a href="#state">state</a> must be set as for
-   a call of <a href="#deflate">deflate</a>(), since the currently available input may have to
-   be compressed and flushed. In particular, strm-&gt <a href="#avail_out">avail_out</a> must be 
-   non-zero.<p>
-
-     <a href="#deflateParams">deflateParams</a> returns <a href="#Z_OK">Z_OK</a> if success, <a href="#Z_STREAM_ERROR">Z_STREAM_ERROR</a> if the source
-   stream <a href="#state">state</a> was inconsistent or if a parameter was invalid, <a href="#Z_BUF_ERROR">Z_BUF_ERROR</a>
-   if strm-&gtavail_out was zero.<p>
-
-<font color="Blue"><dt> int  <a name="inflateInit2">inflateInit2</a> (<a href="#z_streamp">z_streamp</a> strm, int  windowBits);</font>
-
-<dd>     This is another version of <a href="#inflateInit">inflateInit</a> with an extra parameter. The
-   fields <a href="#next_in">next_in</a>, <a href="#avail_in">avail_in</a>, <a href="#zalloc">zalloc</a>, <a href="#zfree">zfree</a> and <a href="#opaque">opaque</a> must be initialized
-   before by the caller.<p>
-
-     The windowBits parameter is the base two logarithm of the maximum window
-   size (the size of the history buffer).  It should be in the range 8..15 for
-   this version of the library. The default value is 15 if <a href="#inflateInit">inflateInit</a> is used
-   instead. If a compressed stream with a larger window size is given as
-   input, <a href="#inflate">inflate</a>() will return with the error code <a href="#Z_DATA_ERROR">Z_DATA_ERROR</a> instead of
-   trying to allocate a larger window.<p>
-
-      <a href="#inflateInit2">inflateInit2</a> returns <a href="#Z_OK">Z_OK</a> if success, <a href="#Z_MEM_ERROR">Z_MEM_ERROR</a> if there was not enough
-   memory, <a href="#Z_STREAM_ERROR">Z_STREAM_ERROR</a> if a parameter is invalid (such as a negative
-   memLevel). <a href="#msg">msg</a> is set to null if there is no error message.  <a href="#inflateInit2">inflateInit2</a>
-   does not perform any decompression apart from reading the zlib header if
-   present: this will be done by <a href="#inflate">inflate</a>(). (So <a href="#next_in">next_in</a> and <a href="#avail_in">avail_in</a> may be
-   modified, but <a href="#next_out">next_out</a> and <a href="#avail_out">avail_out</a> are unchanged.)<p>
-
-<font color="Blue"><dt>  int  <a name="inflateSetDictionary">inflateSetDictionary</a> (<a href="#z_streamp">z_streamp</a> strm, const Bytef *dictionary, uInt  dictLength);</font>
-<dd>
-     Initializes the decompression dictionary from the given uncompressed byte
-   sequence. This function must be called immediately after a call of <a href="#inflate">inflate</a>
-   if this call returned <a href="#Z_NEED_DICT">Z_NEED_DICT</a>. The dictionary chosen by the compressor
-   can be determined from the Adler32 value returned by this call of
-   <a href="#inflate">inflate</a>. The compressor and decompressor must use exactly the same
-   dictionary (see <a href="#deflateSetDictionary">deflateSetDictionary</a>).<p>
-
-     <a href="#inflateSetDictionary">inflateSetDictionary</a> returns <a href="#Z_OK">Z_OK</a> if success, <a href="#Z_STREAM_ERROR">Z_STREAM_ERROR</a> if a
-   parameter is invalid (such as NULL dictionary) or the stream <a href="#state">state</a> is
-   inconsistent, <a href="#Z_DATA_ERROR">Z_DATA_ERROR</a> if the given dictionary doesn't match the
-   expected one (incorrect Adler32 value). <a href="#inflateSetDictionary">inflateSetDictionary</a> does not
-   perform any decompression: this will be done by subsequent calls of
-   <a href="#inflate">inflate</a>().<p>
-
-<font color="Blue"><dt> int  <a name="inflateSync">inflateSync</a> (<a href="#z_streamp">z_streamp</a> strm);</font>
-
-<dd>    Skips invalid compressed data until a full flush point (see above the
-  description of <a href="#deflate">deflate</a> with <a href="#Z_FULL_FLUSH">Z_FULL_FLUSH</a>) can be found, or until all
-  available input is skipped. No output is provided.<p>
-
-    <a href="#inflateSync">inflateSync</a> returns <a href="#Z_OK">Z_OK</a> if a full flush point has been found, <a href="#Z_BUF_ERROR">Z_BUF_ERROR</a>
-  if no more input was provided, <a href="#Z_DATA_ERROR">Z_DATA_ERROR</a> if no flush point has been found,
-  or <a href="#Z_STREAM_ERROR">Z_STREAM_ERROR</a> if the stream structure was inconsistent. In the success
-  case, the application may save the current current value of <a href="#total_in">total_in</a> which
-  indicates where valid compressed data was found. In the error case, the
-  application may repeatedly call <a href="#inflateSync">inflateSync</a>, providing more input each time,
-  until success or end of the input data.<p>
-
-<font color="Blue"><dt> int  <a name="inflateReset">inflateReset</a> (<a href="#z_streamp">z_streamp</a> strm);</font>
-<dd>
-     This function is equivalent to <a href="#inflateEnd">inflateEnd</a> followed by <a href="#inflateInit">inflateInit</a>,
-   but does not free and reallocate all the internal decompression <a href="#state">state</a>.
-   The stream will keep attributes that may have been set by <a href="#inflateInit2">inflateInit2</a>.
-   <p>
-
-      <a href="#inflateReset">inflateReset</a> returns <a href="#Z_OK">Z_OK</a> if success, or <a href="#Z_STREAM_ERROR">Z_STREAM_ERROR</a> if the source
-   stream <a href="#state">state</a> was inconsistent (such as <a href="#zalloc">zalloc</a> or <a href="#state">state</a> being NULL).
-   <p>
-</dl>
-
-<hr>
-<a name="Checksum functions"><h2> Checksum functions </h2>
-     These functions are not related to compression but are exported
-   anyway because they might be useful in applications using the
-   compression library.
-<h3> Function list </h3>
-<ul>
-<li> uLong  <a href="#adler32">adler32</a> (uLong <a href="#adler">adler</a>, const Bytef *buf, uInt len);
-<li> uLong  <a href="#crc32">crc32</a>   (uLong crc, const Bytef *buf, uInt len);
-</ul>
-<h3> Function description </h3>
-<dl>
-<font color="Blue"><dt> uLong  <a name="adler32">adler32</a> (uLong <a href="#adler">adler</a>, const Bytef *buf, uInt len);</font>
-<dd>
-     Update a running Adler-32 checksum with the bytes buf[0..len-1] and
-   return the updated checksum. If buf is NULL, this function returns
-   the required initial value for the checksum.
-   <p>
-   An Adler-32 checksum is almost as reliable as a CRC32 but can be computed
-   much faster. Usage example:
-   <pre>
-
-     uLong <a href="#adler">adler</a> = <a href="#adler32">adler32</a>(0L, <a href="#Z_NULL">Z_NULL</a>, 0);
-
-     while (read_buffer(buffer, length) != EOF) {
-       <a href="#adler">adler</a> = <a href="#adler32">adler32</a>(<a href="#adler">adler</a>, buffer, length);
-     }
-     if (<a href="#adler">adler</a> != original_adler) error();
-   </pre>
-
-<font color="Blue"><dt> uLong  <a name="crc32">crc32</a>   (uLong crc, const Bytef *buf, uInt len);</font>
-<dd>
-     Update a running crc with the bytes buf[0..len-1] and return the updated
-   crc. If buf is NULL, this function returns the required initial value
-   for the crc. Pre- and post-conditioning (one's complement) is performed
-   within this function so it shouldn't be done by the application.
-   Usage example:
-   <pre>
-
-     uLong crc = <a href="#crc32">crc32</a>(0L, <a href="#Z_NULL">Z_NULL</a>, 0);
-
-     while (read_buffer(buffer, length) != EOF) {
-       crc = <a href="#crc32">crc32</a>(crc, buffer, length);
-     }
-     if (crc != original_crc) error();
-   </pre>
-</dl>
-<hr>
-<a name="struct z_stream_s"><h2> struct z_stream_s </h2>
-<font color="Blue">
-<a name="z_stream_s">
-<pre>
-typedef struct z_stream_s {
-    Bytef    *<a name="next_in">next_in</a>;  /* next input byte */
-    uInt     <a name="avail_in">avail_in</a>;  /* number of bytes available at <a href="#next_in">next_in</a> */
-    uLong    <a name="total_in">total_in</a>;  /* total nb of input bytes read so far */
-
-    Bytef    *<a name="next_out">next_out</a>; /* next output byte should be put there */
-    uInt     <a name="avail_out">avail_out</a>; /* remaining free space at <a href="#next_out">next_out</a> */
-    uLong    <a name="total_out">total_out</a>; /* total nb of bytes output so far */
-
-    char     *<a name="msg">msg</a>;      /* last error message, NULL if no error */
-    struct internal_state FAR *<a name="state">state</a>; /* not visible by applications */
-
-    alloc_func <a name="zalloc">zalloc</a>;  /* used to allocate the internal <a href="#state">state</a> */
-    free_func  <a name="zfree">zfree</a>;   /* used to free the internal <a href="#state">state</a> */
-    voidpf     <a name="opaque">opaque</a>;  /* private data object passed to <a href="#zalloc">zalloc</a> and <a href="#zfree">zfree</a> */
-
-    int     <a name="data_type">data_type</a>;  /* best guess about the data type: ascii or binary */
-    uLong   <a name="adler">adler</a>;      /* <a href="#adler32">adler32</a> value of the uncompressed data */
-    uLong   <a name="reserved">reserved</a>;   /* <a href="#reserved">reserved</a> for future use */
-} <a href="#z_stream_s">z_stream</a> ;
-
-typedef <a href="#z_stream_s">z_stream</a> FAR * <a name="z_streamp">z_streamp</a>;  Ã¿ 
-</pre>
-</font>
-   The application must update <a href="#next_in">next_in</a> and <a href="#avail_in">avail_in</a> when <a href="#avail_in">avail_in</a> has
-   dropped to zero. It must update <a href="#next_out">next_out</a> and <a href="#avail_out">avail_out</a> when <a href="#avail_out">avail_out</a>
-   has dropped to zero. The application must initialize <a href="#zalloc">zalloc</a>, <a href="#zfree">zfree</a> and
-   <a href="#opaque">opaque</a> before calling the init function. All other fields are set by the
-   compression library and must not be updated by the application. <p>
-
-   The <a href="#opaque">opaque</a> value provided by the application will be passed as the first
-   parameter for calls of <a href="#zalloc">zalloc</a> and <a href="#zfree">zfree</a>. This can be useful for custom
-   memory management. The compression library attaches no meaning to the
-   <a href="#opaque">opaque</a> value. <p>
-
-   <a href="#zalloc">zalloc</a> must return <a href="#Z_NULL">Z_NULL</a> if there is not enough memory for the object.
-   If zlib is used in a multi-threaded application, <a href="#zalloc">zalloc</a> and <a href="#zfree">zfree</a> must be
-   thread safe. <p>
-
-   On 16-bit systems, the functions <a href="#zalloc">zalloc</a> and <a href="#zfree">zfree</a> must be able to allocate
-   exactly 65536 bytes, but will not be required to allocate more than this
-   if the symbol MAXSEG_64K is defined (see zconf.h). WARNING: On MSDOS,
-   pointers returned by <a href="#zalloc">zalloc</a> for objects of exactly 65536 bytes *must*
-   have their offset normalized to zero. The default allocation function
-   provided by this library ensures this (see zutil.c). To reduce memory
-   requirements and avoid any allocation of 64K objects, at the expense of
-   compression ratio, compile the library with -DMAX_WBITS=14 (see zconf.h).
-   <p>
-
-   The fields <a href="#total_in">total_in</a> and <a href="#total_out">total_out</a> can be used for statistics or
-   progress reports. After compression, <a href="#total_in">total_in</a> holds the total size of
-   the uncompressed data and may be saved for use in the decompressor
-   (particularly if the decompressor wants to decompress everything in
-   a single step). <p>
-
-<hr>
-<a name="Constants"><h2> Constants </h2>
-<font color="Blue">
-<pre>
-#define <a name="Z_NO_FLUSH">Z_NO_FLUSH</a>      0
-#define <a name="Z_PARTIAL_FLUSH">Z_PARTIAL_FLUSH</a> 1 
-       /* will be removed, use <a href="#Z_SYNC_FLUSH">Z_SYNC_FLUSH</a> instead */
-#define <a name="Z_SYNC_FLUSH">Z_SYNC_FLUSH</a>    2
-#define <a name="Z_FULL_FLUSH">Z_FULL_FLUSH</a>    3
-#define <a name="Z_FINISH">Z_FINISH</a>        4
-/* Allowed flush values ; see <a href="#deflate">deflate</a>() below for details */
-
-#define <a name="Z_OK">Z_OK</a>            0
-#define <a name="Z_STREAM_END">Z_STREAM_END</a>    1
-#define <a name="Z_NEED_DICT">Z_NEED_DICT</a>     2
-#define <a name="Z_ERRNO">Z_ERRNO</a>        (-1)
-#define <a name="Z_STREAM_ERROR">Z_STREAM_ERROR</a> (-2)
-#define <a name="Z_DATA_ERROR">Z_DATA_ERROR</a>   (-3)
-#define <a name="Z_MEM_ERROR">Z_MEM_ERROR</a>    (-4)
-#define <a name="Z_BUF_ERROR">Z_BUF_ERROR</a>    (-5)
-#define <a name="Z_VERSION_ERROR">Z_VERSION_ERROR</a> (-6)
-/* Return codes for the compression/decompression functions. Negative
- * values are errors, positive values are used for special but normal events.
- */
-
-#define <a name="Z_NO_COMPRESSION">Z_NO_COMPRESSION</a>         0
-#define <a name="Z_BEST_SPEED">Z_BEST_SPEED</a>             1
-#define <a name="Z_BEST_COMPRESSION">Z_BEST_COMPRESSION</a>       9
-#define <a name="Z_DEFAULT_COMPRESSION">Z_DEFAULT_COMPRESSION</a>  (-1)
-/* compression levels */
-
-#define <a name="Z_FILTERED">Z_FILTERED</a>            1
-#define <a name="Z_HUFFMAN_ONLY">Z_HUFFMAN_ONLY</a>        2
-#define <a name="Z_DEFAULT_STRATEGY">Z_DEFAULT_STRATEGY</a>    0
-/* compression strategy ; see <a href="#deflateInit2">deflateInit2</a>() below for details */
-
-#define <a name="Z_BINARY">Z_BINARY</a>   0
-#define <a name="Z_ASCII">Z_ASCII</a>    1
-#define <a name="Z_UNKNOWN">Z_UNKNOWN</a>  2
-/* Possible values of the <a href="#data_type">data_type</a> field */
-
-#define <a name="Z_DEFLATED">Z_DEFLATED</a>   8
-/* The <a href="#deflate">deflate</a> compression method (the only one supported in this version) */
-
-#define <a name="Z_NULL">Z_NULL</a>  0  /* for initializing <a href="#zalloc">zalloc</a>, <a href="#zfree">zfree</a>, <a href="#opaque">opaque</a> */
-
-#define <a name="zlib_version">zlib_version</a> <a href="#zlibVersion">zlibVersion</a>()
-/* for compatibility with versions less than 1.0.2 */
-</pre>
-</font>
-
-<hr>
-<a name="Misc"><h2> Misc </h2>
- <a href="#deflateInit">deflateInit</a> and <a href="#inflateInit">inflateInit</a> are macros to allow checking the zlib version
- and the compiler's view of <a href="#z_stream_s">z_stream</a>.
- <p>
- Other functions:
- <dl>
- <font color="Blue"><dt> const char   *  <a name="zError">zError</a>           (int err);</font>
- <font color="Blue"><dt> int             <a name="inflateSyncPoint">inflateSyncPoint</a> (<a href="#z_streamp">z_streamp</a> z);</font>
- <font color="Blue"><dt> const uLongf *  <a name="get_crc_table">get_crc_table</a>    (void);</font>
- </dl>
- <hr>
- <font size="-1">
- Last update: Wed Oct 13 20:42:34 1999<br>
- piapi@csie.ntu.edu.tw
- </font>
-
-</body>
-</html>
diff --git a/lib/zlib/zutil.c b/lib/zlib/zutil.c
deleted file mode 100644 (file)
index dfc38ec..0000000
+++ /dev/null
@@ -1,225 +0,0 @@
-/* zutil.c -- target dependent utility functions for the compression library
- * Copyright (C) 1995-2002 Jean-loup Gailly.
- * For conditions of distribution and use, see copyright notice in zlib.h 
- */
-
-/* @(#) $Id$ */
-
-#include "zutil.h"
-
-struct internal_state      {int dummy;}; /* for buggy compilers */
-
-#ifndef STDC
-extern void exit OF((int));
-#endif
-
-const char *z_errmsg[10] = {
-"need dictionary",     /* Z_NEED_DICT       2  */
-"stream end",          /* Z_STREAM_END      1  */
-"",                    /* Z_OK              0  */
-"file error",          /* Z_ERRNO         (-1) */
-"stream error",        /* Z_STREAM_ERROR  (-2) */
-"data error",          /* Z_DATA_ERROR    (-3) */
-"insufficient memory", /* Z_MEM_ERROR     (-4) */
-"buffer error",        /* Z_BUF_ERROR     (-5) */
-"incompatible version",/* Z_VERSION_ERROR (-6) */
-""};
-
-
-const char * ZEXPORT zlibVersion()
-{
-    return ZLIB_VERSION;
-}
-
-#ifdef DEBUG
-
-#  ifndef verbose
-#    define verbose 0
-#  endif
-int z_verbose = verbose;
-
-void z_error (m)
-    char *m;
-{
-    fprintf(stderr, "%s\n", m);
-    exit(1);
-}
-#endif
-
-/* exported to allow conversion of error code to string for compress() and
- * uncompress()
- */
-const char * ZEXPORT zError(err)
-    int err;
-{
-    return ERR_MSG(err);
-}
-
-
-#ifndef HAVE_MEMCPY
-
-void zmemcpy(dest, source, len)
-    Bytef* dest;
-    const Bytef* source;
-    uInt  len;
-{
-    if (len == 0) return;
-    do {
-        *dest++ = *source++; /* ??? to be unrolled */
-    } while (--len != 0);
-}
-
-int zmemcmp(s1, s2, len)
-    const Bytef* s1;
-    const Bytef* s2;
-    uInt  len;
-{
-    uInt j;
-
-    for (j = 0; j < len; j++) {
-        if (s1[j] != s2[j]) return 2*(s1[j] > s2[j])-1;
-    }
-    return 0;
-}
-
-void zmemzero(dest, len)
-    Bytef* dest;
-    uInt  len;
-{
-    if (len == 0) return;
-    do {
-        *dest++ = 0;  /* ??? to be unrolled */
-    } while (--len != 0);
-}
-#endif
-
-#ifdef __TURBOC__
-#if (defined( __BORLANDC__) || !defined(SMALL_MEDIUM)) && !defined(__32BIT__)
-/* Small and medium model in Turbo C are for now limited to near allocation
- * with reduced MAX_WBITS and MAX_MEM_LEVEL
- */
-#  define MY_ZCALLOC
-
-/* Turbo C malloc() does not allow dynamic allocation of 64K bytes
- * and farmalloc(64K) returns a pointer with an offset of 8, so we
- * must fix the pointer. Warning: the pointer must be put back to its
- * original form in order to free it, use zcfree().
- */
-
-#define MAX_PTR 10
-/* 10*64K = 640K */
-
-local int next_ptr = 0;
-
-typedef struct ptr_table_s {
-    voidpf org_ptr;
-    voidpf new_ptr;
-} ptr_table;
-
-local ptr_table table[MAX_PTR];
-/* This table is used to remember the original form of pointers
- * to large buffers (64K). Such pointers are normalized with a zero offset.
- * Since MSDOS is not a preemptive multitasking OS, this table is not
- * protected from concurrent access. This hack doesn't work anyway on
- * a protected system like OS/2. Use Microsoft C instead.
- */
-
-voidpf zcalloc (voidpf opaque, unsigned items, unsigned size)
-{
-    voidpf buf = opaque; /* just to make some compilers happy */
-    ulg bsize = (ulg)items*size;
-
-    /* If we allocate less than 65520 bytes, we assume that farmalloc
-     * will return a usable pointer which doesn't have to be normalized.
-     */
-    if (bsize < 65520L) {
-        buf = farmalloc(bsize);
-        if (*(ush*)&buf != 0) return buf;
-    } else {
-        buf = farmalloc(bsize + 16L);
-    }
-    if (buf == NULL || next_ptr >= MAX_PTR) return NULL;
-    table[next_ptr].org_ptr = buf;
-
-    /* Normalize the pointer to seg:0 */
-    *((ush*)&buf+1) += ((ush)((uch*)buf-0) + 15) >> 4;
-    *(ush*)&buf = 0;
-    table[next_ptr++].new_ptr = buf;
-    return buf;
-}
-
-void  zcfree (voidpf opaque, voidpf ptr)
-{
-    int n;
-    if (*(ush*)&ptr != 0) { /* object < 64K */
-        farfree(ptr);
-        return;
-    }
-    /* Find the original pointer */
-    for (n = 0; n < next_ptr; n++) {
-        if (ptr != table[n].new_ptr) continue;
-
-        farfree(table[n].org_ptr);
-        while (++n < next_ptr) {
-            table[n-1] = table[n];
-        }
-        next_ptr--;
-        return;
-    }
-    ptr = opaque; /* just to make some compilers happy */
-    Assert(0, "zcfree: ptr not found");
-}
-#endif
-#endif /* __TURBOC__ */
-
-
-#if defined(M_I86) && !defined(__32BIT__)
-/* Microsoft C in 16-bit mode */
-
-#  define MY_ZCALLOC
-
-#if (!defined(_MSC_VER) || (_MSC_VER <= 600))
-#  define _halloc  halloc
-#  define _hfree   hfree
-#endif
-
-voidpf zcalloc (voidpf opaque, unsigned items, unsigned size)
-{
-    if (opaque) opaque = 0; /* to make compiler happy */
-    return _halloc((long)items, size);
-}
-
-void  zcfree (voidpf opaque, voidpf ptr)
-{
-    if (opaque) opaque = 0; /* to make compiler happy */
-    _hfree(ptr);
-}
-
-#endif /* MSC */
-
-
-#ifndef MY_ZCALLOC /* Any system without a special alloc function */
-
-#ifndef STDC
-extern voidp  calloc OF((uInt items, uInt size));
-extern void   free   OF((voidpf ptr));
-#endif
-
-voidpf zcalloc (opaque, items, size)
-    voidpf opaque;
-    unsigned items;
-    unsigned size;
-{
-    if (opaque) items += size - size; /* make compiler happy */
-    return (voidpf)calloc(items, size);
-}
-
-void  zcfree (opaque, ptr)
-    voidpf opaque;
-    voidpf ptr;
-{
-    free(ptr);
-    if (opaque) return; /* make compiler happy */
-}
-
-#endif /* MY_ZCALLOC */
diff --git a/lib/zlib/zutil.h b/lib/zlib/zutil.h
deleted file mode 100644 (file)
index 718ebc1..0000000
+++ /dev/null
@@ -1,220 +0,0 @@
-/* zutil.h -- internal interface and configuration of the compression library
- * Copyright (C) 1995-2002 Jean-loup Gailly.
- * For conditions of distribution and use, see copyright notice in zlib.h
- */
-
-/* WARNING: this file should *not* be used by applications. It is
-   part of the implementation of the compression library and is
-   subject to change. Applications should only use zlib.h.
- */
-
-/* @(#) $Id$ */
-
-#ifndef _Z_UTIL_H
-#define _Z_UTIL_H
-
-#include "zlib.h"
-
-#ifdef STDC
-#  include <stddef.h>
-#  include <string.h>
-#  include <stdlib.h>
-#endif
-#ifdef NO_ERRNO_H
-    extern int errno;
-#else
-#   include <errno.h>
-#endif
-
-#ifndef local
-#  define local static
-#endif
-/* compile with -Dlocal if your debugger can't find static symbols */
-
-typedef unsigned char  uch;
-typedef uch FAR uchf;
-typedef unsigned short ush;
-typedef ush FAR ushf;
-typedef unsigned long  ulg;
-
-extern const char *z_errmsg[10]; /* indexed by 2-zlib_error */
-/* (size given to avoid silly warnings with Visual C++) */
-
-#define ERR_MSG(err) z_errmsg[Z_NEED_DICT-(err)]
-
-#define ERR_RETURN(strm,err) \
-  return (strm->msg = (char*)ERR_MSG(err), (err))
-/* To be used only when the state is known to be valid */
-
-        /* common constants */
-
-#ifndef DEF_WBITS
-#  define DEF_WBITS MAX_WBITS
-#endif
-/* default windowBits for decompression. MAX_WBITS is for compression only */
-
-#if MAX_MEM_LEVEL >= 8
-#  define DEF_MEM_LEVEL 8
-#else
-#  define DEF_MEM_LEVEL  MAX_MEM_LEVEL
-#endif
-/* default memLevel */
-
-#define STORED_BLOCK 0
-#define STATIC_TREES 1
-#define DYN_TREES    2
-/* The three kinds of block type */
-
-#define MIN_MATCH  3
-#define MAX_MATCH  258
-/* The minimum and maximum match lengths */
-
-#define PRESET_DICT 0x20 /* preset dictionary flag in zlib header */
-
-        /* target dependencies */
-
-#ifdef MSDOS
-#  define OS_CODE  0x00
-#  if defined(__TURBOC__) || defined(__BORLANDC__)
-#    if(__STDC__ == 1) && (defined(__LARGE__) || defined(__COMPACT__))
-       /* Allow compilation with ANSI keywords only enabled */
-       void _Cdecl farfree( void *block );
-       void *_Cdecl farmalloc( unsigned long nbytes );
-#    else
-#     include <alloc.h>
-#    endif
-#  else /* MSC or DJGPP */
-#    include <malloc.h>
-#  endif
-#endif
-
-#ifdef OS2
-#  define OS_CODE  0x06
-#endif
-
-#ifdef WIN32 /* Window 95 & Windows NT */
-#  define OS_CODE  0x0b
-#endif
-
-#if defined(VAXC) || defined(VMS)
-#  define OS_CODE  0x02
-#  define F_OPEN(name, mode) \
-     fopen((name), (mode), "mbc=60", "ctx=stm", "rfm=fix", "mrs=512")
-#endif
-
-#ifdef AMIGA
-#  define OS_CODE  0x01
-#endif
-
-#if defined(ATARI) || defined(atarist)
-#  define OS_CODE  0x05
-#endif
-
-#if defined(MACOS) || defined(TARGET_OS_MAC)
-#  define OS_CODE  0x07
-#  if defined(__MWERKS__) && __dest_os != __be_os && __dest_os != __win32_os
-#    include <unix.h> /* for fdopen */
-#  else
-#    ifndef fdopen
-#      define fdopen(fd,mode) NULL /* No fdopen() */
-#    endif
-#  endif
-#endif
-
-#ifdef __50SERIES /* Prime/PRIMOS */
-#  define OS_CODE  0x0F
-#endif
-
-#ifdef TOPS20
-#  define OS_CODE  0x0a
-#endif
-
-#if defined(_BEOS_) || defined(RISCOS)
-#  define fdopen(fd,mode) NULL /* No fdopen() */
-#endif
-
-#if (defined(_MSC_VER) && (_MSC_VER > 600))
-#  define fdopen(fd,type)  _fdopen(fd,type)
-#endif
-
-
-        /* Common defaults */
-
-#ifndef OS_CODE
-#  define OS_CODE  0x03  /* assume Unix */
-#endif
-
-#ifndef F_OPEN
-#  define F_OPEN(name, mode) fopen((name), (mode))
-#endif
-
-         /* functions */
-
-#ifdef HAVE_STRERROR
-   extern char *strerror OF((int));
-#  define zstrerror(errnum) strerror(errnum)
-#else
-#  define zstrerror(errnum) ""
-#endif
-
-#if defined(pyr)
-#  define NO_MEMCPY
-#endif
-#if defined(SMALL_MEDIUM) && !defined(_MSC_VER) && !defined(__SC__)
- /* Use our own functions for small and medium model with MSC <= 5.0.
-  * You may have to use the same strategy for Borland C (untested).
-  * The __SC__ check is for Symantec.
-  */
-#  define NO_MEMCPY
-#endif
-#if defined(STDC) && !defined(HAVE_MEMCPY) && !defined(NO_MEMCPY)
-#  define HAVE_MEMCPY
-#endif
-#ifdef HAVE_MEMCPY
-#  ifdef SMALL_MEDIUM /* MSDOS small or medium model */
-#    define zmemcpy _fmemcpy
-#    define zmemcmp _fmemcmp
-#    define zmemzero(dest, len) _fmemset(dest, 0, len)
-#  else
-#    define zmemcpy memcpy
-#    define zmemcmp memcmp
-#    define zmemzero(dest, len) memset(dest, 0, len)
-#  endif
-#else
-   extern void zmemcpy  OF((Bytef* dest, const Bytef* source, uInt len));
-   extern int  zmemcmp  OF((const Bytef* s1, const Bytef* s2, uInt len));
-   extern void zmemzero OF((Bytef* dest, uInt len));
-#endif
-
-/* Diagnostic functions */
-#ifdef DEBUG
-#  include <stdio.h>
-   extern int z_verbose;
-   extern void z_error    OF((char *m));
-#  define Assert(cond,msg) {if(!(cond)) z_error(msg);}
-#  define Trace(x) {if (z_verbose>=0) fprintf x ;}
-#  define Tracev(x) {if (z_verbose>0) fprintf x ;}
-#  define Tracevv(x) {if (z_verbose>1) fprintf x ;}
-#  define Tracec(c,x) {if (z_verbose>0 && (c)) fprintf x ;}
-#  define Tracecv(c,x) {if (z_verbose>1 && (c)) fprintf x ;}
-#else
-#  define Assert(cond,msg)
-#  define Trace(x)
-#  define Tracev(x)
-#  define Tracevv(x)
-#  define Tracec(c,x)
-#  define Tracecv(c,x)
-#endif
-
-
-typedef uLong (ZEXPORT *check_func) OF((uLong check, const Bytef *buf,
-                                      uInt len));
-voidpf zcalloc OF((voidpf opaque, unsigned items, unsigned size));
-void   zcfree  OF((voidpf opaque, voidpf ptr));
-
-#define ZALLOC(strm, items, size) \
-           (*((strm)->zalloc))((strm)->opaque, (items), (size))
-#define ZFREE(strm, addr)  (*((strm)->zfree))((strm)->opaque, (voidpf)(addr))
-#define TRY_FREE(s, p) {if (p) ZFREE(s, p);}
-
-#endif /* _Z_UTIL_H */
diff --git a/public_html/html/about.php b/public_html/html/about.php
deleted file mode 100644 (file)
index ba6becc..0000000
+++ /dev/null
@@ -1,92 +0,0 @@
-&nbsp;<br />
-<b><big>About SILC</big></b>
-<br />&nbsp;<br />
-SILC (Secure Internet Live Conferencing) is a protocol which provides
-secure conferencing services on the Internet over insecure channel. SILC 
-superficially resembles IRC, although they are very different internally.
-They both provide conferencing services and have almost the same set of
-commands. Other than that, they are nothing alike. The SILC is secure and 
-the network model is entirely different compared to IRC.
-<br />&nbsp;<br />
-SILC provides security services that any other conferencing protocol does
-not offer today. The most popular conferencing service, IRC, is entirely
-insecure. If you need secure place to talk to some person or to group of
-people over the Internet, IRC or any other conferencing service, for that 
-matter, cannot be used. Anyone can see the messages and their contents in 
-the IRC network. And the most worse case, some is able to change the 
-contents of the messages. Also, all the authentication data, such as, 
-passwords are sent plaintext in IRC.
-<br />&nbsp;<br />
-SILC is much more than just about `encrypting the traffic'. That is easy
-enough to do with IRC and SSL hybrids, but even then the entire network 
-cannot be secured, only part of it. SILC provides security services, such 
-as sending private messages entirely secure; no one can see the message 
-except you and the real receiver of the message. SILC also provides same 
-functionality for channels; no one except those clients joined to the 
-channel may see the messages destined to the channel. Communication 
-between client and server is also secured with session keys and all 
-commands, authentication data (such as passwords etc.) and other traffic 
-is entirely secured. The entire network, and all parts of it, is secured. 
-We are not aware of any other conferencing protocol providing same 
-features at the present time.
-<br />&nbsp;<br />
-SILC has secure key exchange protocol that is used to create the session
-keys for each connection. SILC also provides strong authentication based
-on either passwords or public key authentication. All authentication data
-is always encrypted in the SILC network. Each connection has their own
-session keys, all channels have channel specific keys, and all private
-messages can be secured with private message specific keys.
-<br />&nbsp;<br />
-
-<b>Distribution</b>
-<br />&nbsp;<br />
-The SILC is distributed currently in three different packages. The SILC 
-Client package, the SILC Server package and the SILC Toolkit package. Each 
-package has its intended audience.
-<br />&nbsp;<br />
-- SILC Client package is intended for end users who are looking for a good
-and full featured SILC client. The SILC Client package currently includes 
-Irssi-SILC client that supports all SILC features, themes and much more. 
-It is curses based but has a possibility of adding various other frontends 
-to it. The Irssi-SILC client's user interface is based on the Irssi client 
-(see <a href="http://irssi.org/" class="normal">Irssi project</a>).
-<br />&nbsp;<br />
-- SILC Server package is intended for system administrators who would like 
-to run their own SILC server or SILC router. The package includes the 
-actual server but not the client. If you are running a server and would 
-like to connect it to the silc.silcnet.org router you can contact us.
-<br />&nbsp;<br />
-- SILC Toolkit package is intended for developers and programmers who 
-would like to create their own SILC based applications or help in the 
-development of the SILC protocol. The actual development of the SILC is 
-done in the Toolkit and all the other packages are based on the Toolkit 
-releases. The Toolkit includes SILC Protocol Core library, SILC Crypto 
-library, SILC Key Exchange (SKE) library, SILC Math library, SILC Modules 
-(SIM) library, SILC Utility library, SILC Client library and few other
-libraries. It also includes the Irssi-SILC Client, another client as an 
-example how to program with the Toolkit and the SILC Server.
-<br />&nbsp;<br />
-
-<b>Licensing</b>
-<br />&nbsp;<br />
-SILC is an Open Source (or Free Software) project and it has been released
-under the <a href="?page=copying" class="normal">GNU General Public License</a>. The SILC is free to use and everyone
-is allowed to freely redistribute and change the SILC under the terms of the
-GNU GPL. While there is no guarantee for the product, SILC is made as secure
-as possible. The fact that the software and the protocol is open for public
-analysis is a good thing for end user.
-<br />&nbsp;<br />
-Specification of SILC protocol is available for anyone to look at. There
-exist four Internet Drafts that have been submitted to the <a
-href="http://www.ietf.org/" class="normal">IETF</a>. See <a
-href="?page=docs" class="normal">documentation page</a> for more information.
-<br />&nbsp;<br />
-
-<b>Contact</b>
-<br />&nbsp;<br />
-Feedback and comments are welcome. Bug reports should be sent to the 
-development mailing list.
-<br />&nbsp;<br />
-Development mailing list address: 
-<a href="mailto:silc-devel@lists.sourceforge.net" class="normal">
-silc-devel@lists.sourceforge.net</a>
diff --git a/public_html/html/contact.php b/public_html/html/contact.php
deleted file mode 100644 (file)
index bb2903a..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-&nbsp;<br />
-<b><big>Contact Us</big></b>
-<br />&nbsp;<br />
-You can contact us via email using the following email addresses.  If you 
-have questions or you need help with SILC we suggest reading the <a 
-href="?page=faq" class="normal">SILC FAQ</a> first.  Development related 
-questions can also be sent to the <a href="?page=lists" class="normal"> 
-silc-devel</a> mailing list.
-
-<br />&nbsp;<br />
-<b>Contact Us at info@silcnet.org</b>
-<br />&nbsp;<br />
-If you have generic questions or comments about SILC you can contact us at 
-<a href="mailto:info at silcnet.org" class="normal">info@silcnet.org</a>.
-
-<br />&nbsp;<br />
-<b>Server Linking Requests at server-links@silcnet.org</b>
-<br />&nbsp;<br />
-If you are SILC server administrator and would like to get your server 
-linked to the SILC Network, you can send your request for linking at 
-<a href="mailto:server-links at silcnet.org" class="normal"> 
-server-links@silcnet.org</a>.  Be sure to tell us about your server in the 
-email.  Also, it would be nice if you already have existing user base in 
-your server.
-
-<br />&nbsp;<br />
-<b>Contact Webmaster at webmaster@silcnet.org</b>
-<br />&nbsp;<br />
-You can reach our webmaster at <a href="mailto:webmaster at 
-silcnet.org" class="normal">webmaster@silcnet.org</a> address.  If you 
-have a comment about our web site, questions or suggestions to it you can 
-email them to the webmaster.
diff --git a/public_html/html/contribute.php b/public_html/html/contribute.php
deleted file mode 100644 (file)
index d6992df..0000000
+++ /dev/null
@@ -1,78 +0,0 @@
-&nbsp;<br />
-<b><big>Contributing</big></b>
-<br />&nbsp;<br />
-Developers are needed in SILC project. Everyone who has the time and
-ability is welcome to join the project.  We need C coders and technical
-writers (to write documentation). Feel free to start narrowing down the <a href="?page=todo" class="normal">TODO</a> list.
-<br />&nbsp;<br />
-Interested people are also welcome to give new ideas to the SILC protocol
-that is still in its draft phase. You should probably go and read the SILC
-protocol specification Internet Drafts to get the idea about what SILC
-actually is. The current software version might not give the whole picture
-of the SILC. The Internet Drafts are available in
-<a href="?page=docs" class="normal">documentation page.</a>
-<br />&nbsp;<br />
-Who wants to send code to the project should read the <a 
-href="docs/CodingStyle" class="normal">CodingStyle</a>
-documentation. New code must comply with the coding style conventions
-described in that document.
-<br />&nbsp;<br />
-There is anonymous CVS acccess for those who want to participate the
-development process. See the <a href="?page=cvs" class="normal">CVS page.</a>
-
-<br />&nbsp;<br />&nbsp;<br />
-<b>Submitting Patches to Mailing List</b>
-<br />&nbsp;<br />
-Please follow these instructions when you are submitting a patch to the 
-silc-devel mailing list.
-
-<br />&nbsp;<br />
- <table cellspacing="2" cellpadding="0" border="0">
-<tr><td valign="top"> - </td><td>
-Use the unified output format for the diff (diff -u)
-</td></tr>
-<tr><td valign="top"> - </td><td>
-Use diff, not cvs diff
-</td></tr>
-<tr><td valign="top"> - </td><td>
-Send the patch to the mailing list, and add those people that should know
-about it on CC:
-</td></tr>
-<tr><td valign="top"> - </td><td>
-Submit ready patches. If they are not ready then sending them to
-people who are involved in the development is preferred. The patch might 
-face several round trips so sending patches which are ready is preffered
-</td></tr>
-<tr><td valign="top"> - </td><td>
-Include the patch in the body of the email or attach it
-</td></tr>
-<tr><td valign="top"> - </td><td>
-Send separate patches for every bugfix or feature
-</td></tr>
-<tr><td valign="top"> - </td><td>
-If you think that your work is benefical to the development of the
-SILC and would like to be listed in the CREDITS file in SILC packages, you
-can submit patches for the CREDITS file too. Nobody will be added there
-without a patch, this way those who don't want to see their name there 
-won't get there
-</td></tr>
-<tr><td valign="top"> - </td><td>
-Do not submit bugs ;)
-</td></tr>
-</table>
-
-<br />&nbsp;<br />
-<b><big>Support</big></b>
-<br />&nbsp;<br />
-If you want to have a SILC Project's banner on your web site and support us
-this way, you can use the following banner or find some more at:  
-<a href="http://silcnet.org/salo/img/silc-banners.html" class="normal">
-http://silcnet.org/salo/img/silc-banners.html</a>.
-<br />&nbsp;<br />
-<table width="100%">
- <tr>
-  <td width="100%" align="center">
-   <img src="/img/silc-banner.gif" alt="SILC Secure Internet Live Conferencing" width="468" height="60">
-  </td>
- </tr>
-</table>
diff --git a/public_html/html/copying.php b/public_html/html/copying.php
deleted file mode 100644 (file)
index 2f2a308..0000000
+++ /dev/null
@@ -1,328 +0,0 @@
-&nbsp;<br />
-<b><big>Licensing of the SILC Software</big></b>
-<br />&nbsp;<br />
-The SILC is distributed currently as three different distributions; SILC 
-Client, SILC Server and SILC Toolkit.  Each of the distributions may have 
-different licenses and different licensing policy.  Currently the licenses 
-of these different distributions are as follows:
-<br />&nbsp;<br />
-- SILC Client: <a href="#gpl" class="normal">GNU General Public License</a><br />
-- SILC Server: <a href="#gpl" class="normal">GNU General Public License</a><br />
-- SILC Toolkit: <a href="#gpl" class="normal">GNU General Public License</a>
-<br />&nbsp;<br />
-If you have special licensing requirements, such as you are going to 
-distribute one of the SILC distributions as commercial product, or you 
-need to include one of the SILC distributions (such as SILC Toolkit) into 
-your commercial product, or you need to use some parts of the SILC 
-distributions (such as SILC Toolkit) within your commercial product,
-it is suggested that you would contact us to discuss the licensing policy 
-and other possible licensing methods for the SILC distributions.  Contact 
-us at <a href="mailto:info at silcnet.org" 
-class="normal">info@silcnet.org</a>.
-<br />&nbsp;<br />
-Note that these licenses apply only to the SILC software.  The actual SILC 
-protocol specification is open specification and is freely available from 
-this site and from the <a href="http://www.ietf.org" 
-class="normal">IETF</a>.
-
-<br />&nbsp;<br />&nbsp;<br />&nbsp;<br />
-<a name="gpl"></a>
-<b><big>GNU GENERAL PUBLIC LICENSE<br />
-Version 2, June 1991</big></b>
-<br />&nbsp;<br />
-Copyright (C) 1989, 1991 Free Software Foundation, Inc.<br />
-59 Temple Place - Suite 330, Boston, MA  02111-1307, USA
-<br />&nbsp;<br />
-Everyone is permitted to copy and distribute verbatim copies<br />
-of this license document, but changing it is not allowed.
-<br />&nbsp;<br />
-<b>Preamble</b>
-<br />&nbsp;<br />
-  The licenses for most software are designed to take away your
-freedom to share and change it.  By contrast, the GNU General Public
-License is intended to guarantee your freedom to share and change free
-software--to make sure the software is free for all its users.  This
-General Public License applies to most of the Free Software
-Foundation's software and to any other program whose authors commit to
-using it.  (Some other Free Software Foundation software is covered by
-the GNU Library General Public License instead.)  You can apply it to
-your programs, too.
-<br />&nbsp;<br />
-  When we speak of free software, we are referring to freedom, not
-price.  Our General Public Licenses are designed to make sure that you
-have the freedom to distribute copies of free software (and charge for
-this service if you wish), that you receive source code or can get it
-if you want it, that you can change the software or use pieces of it
-in new free programs; and that you know you can do these things.
-<br />&nbsp;<br />
-  To protect your rights, we need to make restrictions that forbid
-anyone to deny you these rights or to ask you to surrender the rights.
-These restrictions translate to certain responsibilities for you if you
-distribute copies of the software, or if you modify it.
-<br />&nbsp;<br />
-  For example, if you distribute copies of such a program, whether
-gratis or for a fee, you must give the recipients all the rights that
-you have.  You must make sure that they, too, receive or can get the
-source code.  And you must show them these terms so they know their
-rights.
-<br />&nbsp;<br />
-  We protect your rights with two steps: (1) copyright the software, and
-(2) offer you this license which gives you legal permission to copy,
-distribute and/or modify the software.
-<br />&nbsp;<br />
-  Also, for each author's protection and ours, we want to make certain
-that everyone understands that there is no warranty for this free
-software.  If the software is modified by someone else and passed on, we
-want its recipients to know that what they have is not the original, so
-that any problems introduced by others will not reflect on the original
-authors' reputations.
-<br />&nbsp;<br />
-  Finally, any free program is threatened constantly by software
-patents.  We wish to avoid the danger that redistributors of a free
-program will individually obtain patent licenses, in effect making the
-program proprietary.  To prevent this, we have made it clear that any
-patent must be licensed for everyone's free use or not licensed at all.
-<br />&nbsp;<br />
-  The precise terms and conditions for copying, distribution and
-modification follow.
-<br />&nbsp;<br />
-<b>TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION</b>
-<br />&nbsp;<br />
-<b>0.</b>
- This License applies to any program or other work which contains
-a notice placed by the copyright holder saying it may be distributed
-under the terms of this General Public License.  The "Program", below,
-refers to any such program or work, and a "work based on the Program"
-means either the Program or any derivative work under copyright law:
-that is to say, a work containing the Program or a portion of it,
-either verbatim or with modifications and/or translated into another
-language.  (Hereinafter, translation is included without limitation in
-the term "modification".)  Each licensee is addressed as "you".
-<br />&nbsp;<br />
-Activities other than copying, distribution and modification are not
-covered by this License; they are outside its scope.  The act of
-running the Program is not restricted, and the output from the Program
-is covered only if its contents constitute a work based on the
-Program (independent of having been made by running the Program).
-Whether that is true depends on what the Program does.
-<br />&nbsp;<br />
-<b>1.</b>
- You may copy and distribute verbatim copies of the Program's
-source code as you receive it, in any medium, provided that you
-conspicuously and appropriately publish on each copy an appropriate
-copyright notice and disclaimer of warranty; keep intact all the
-notices that refer to this License and to the absence of any warranty;
-and give any other recipients of the Program a copy of this License
-along with the Program.
-<br />&nbsp;<br />
-You may charge a fee for the physical act of transferring a copy, and
-you may at your option offer warranty protection in exchange for a fee.
-<br />&nbsp;<br />
-<b>2.</b>
- You may modify your copy or copies of the Program or any portion
-of it, thus forming a work based on the Program, and copy and
-distribute such modifications or work under the terms of Section 1
-above, provided that you also meet all of these conditions:
-<br />&nbsp;<br />
-<b>a)</b>
-     You must cause the modified files to carry prominent notices
-     stating that you changed the files and the date of any change.
-<br />&nbsp;<br />
-<b>b)</b>
-     You must cause any work that you distribute or publish, that in
-     whole or in part contains or is derived from the Program or any
-     part thereof, to be licensed as a whole at no charge to all third
-     parties under the terms of this License.
-<br />&nbsp;<br />
-<b>c)</b>
-     If the modified program normally reads commands interactively
-     when run, you must cause it, when started running for such
-     interactive use in the most ordinary way, to print or display an
-     announcement including an appropriate copyright notice and a
-     notice that there is no warranty (or else, saying that you provide
-     a warranty) and that users may redistribute the program under
-     these conditions, and telling the user how to view a copy of this
-     License.  (Exception: if the Program itself is interactive but
-     does not normally print such an announcement, your work based on
-     the Program is not required to print an announcement.)
-<br />&nbsp;<br />
-These requirements apply to the modified work as a whole.  If
-identifiable sections of that work are not derived from the Program,
-and can be reasonably considered independent and separate works in
-themselves, then this License, and its terms, do not apply to those
-sections when you distribute them as separate works.  But when you
-distribute the same sections as part of a whole which is a work based
-on the Program, the distribution of the whole must be on the terms of
-this License, whose permissions for other licensees extend to the
-entire whole, and thus to each and every part regardless of who wrote it.
-<br />&nbsp;<br />
-Thus, it is not the intent of this section to claim rights or contest
-your rights to work written entirely by you; rather, the intent is to
-exercise the right to control the distribution of derivative or
-collective works based on the Program.
-<br />&nbsp;<br />
-In addition, mere aggregation of another work not based on the Program
-with the Program (or with a work based on the Program) on a volume of
-a storage or distribution medium does not bring the other work under
-the scope of this License.
-<br />&nbsp;<br />
-<b>3.</b>
- You may copy and distribute the Program (or a work based on it,
-under Section 2) in object code or executable form under the terms of
-Sections 1 and 2 above provided that you also do one of the following:
-<br />&nbsp;<br />
-<b>a)</b>
-     Accompany it with the complete corresponding machine-readable
-     source code, which must be distributed under the terms of Sections
-     1 and 2 above on a medium customarily used for software interchange; or,
-<br />&nbsp;<br />
-<b>b)</b>
-     Accompany it with a written offer, valid for at least three
-     years, to give any third party, for a charge no more than your
-     cost of physically performing source distribution, a complete
-     machine-readable copy of the corresponding source code, to be
-     distributed under the terms of Sections 1 and 2 above on a medium
-     customarily used for software interchange; or,
-<br />&nbsp;<br />
-<b>c)</b>
-     Accompany it with the information you received as to the offer
-     to distribute corresponding source code.  (This alternative is
-     allowed only for noncommercial distribution and only if you
-     received the program in object code or executable form with such
-     an offer, in accord with Subsection b above.)
-<br />&nbsp;<br />
-The source code for a work means the preferred form of the work for
-making modifications to it.  For an executable work, complete source
-code means all the source code for all modules it contains, plus any
-associated interface definition files, plus the scripts used to
-control compilation and installation of the executable.  However, as a
-special exception, the source code distributed need not include
-anything that is normally distributed (in either source or binary
-form) with the major components (compiler, kernel, and so on) of the
-operating system on which the executable runs, unless that component
-itself accompanies the executable.
-<br />&nbsp;<br />
-If distribution of executable or object code is made by offering
-access to copy from a designated place, then offering equivalent
-access to copy the source code from the same place counts as
-distribution of the source code, even though third parties are not
-compelled to copy the source along with the object code.
-<br />&nbsp;<br />
-<b>4.</b>
- You may not copy, modify, sublicense, or distribute the Program
-except as expressly provided under this License.  Any attempt
-otherwise to copy, modify, sublicense or distribute the Program is
-void, and will automatically terminate your rights under this License.
-However, parties who have received copies, or rights, from you under
-this License will not have their licenses terminated so long as such
-parties remain in full compliance.
-<br />&nbsp;<br />
-<b>5.</b>
- You are not required to accept this License, since you have not
-signed it.  However, nothing else grants you permission to modify or
-distribute the Program or its derivative works.  These actions are
-prohibited by law if you do not accept this License.  Therefore, by
-modifying or distributing the Program (or any work based on the
-Program), you indicate your acceptance of this License to do so, and
-all its terms and conditions for copying, distributing or modifying
-the Program or works based on it.
-<br />&nbsp;<br />
-<b>6.</b>
- Each time you redistribute the Program (or any work based on the
-Program), the recipient automatically receives a license from the
-original licensor to copy, distribute or modify the Program subject to
-these terms and conditions.  You may not impose any further
-restrictions on the recipients' exercise of the rights granted herein.
-You are not responsible for enforcing compliance by third parties to
-this License.
-<br />&nbsp;<br />
-<b>7.</b>
- If, as a consequence of a court judgment or allegation of patent
-infringement or for any other reason (not limited to patent issues),
-conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License.  If you cannot
-distribute so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you
-may not distribute the Program at all.  For example, if a patent
-license would not permit royalty-free redistribution of the Program by
-all those who receive copies directly or indirectly through you, then
-the only way you could satisfy both it and this License would be to
-refrain entirely from distribution of the Program.
-<br />&nbsp;<br />
-If any portion of this section is held invalid or unenforceable under
-any particular circumstance, the balance of the section is intended to
-apply and the section as a whole is intended to apply in other
-circumstances.
-<br />&nbsp;<br />
-It is not the purpose of this section to induce you to infringe any
-patents or other property right claims or to contest validity of any
-such claims; this section has the sole purpose of protecting the
-integrity of the free software distribution system, which is
-implemented by public license practices.  Many people have made
-generous contributions to the wide range of software distributed
-through that system in reliance on consistent application of that
-system; it is up to the author/donor to decide if he or she is willing
-to distribute software through any other system and a licensee cannot
-impose that choice.
-<br />&nbsp;<br />
-This section is intended to make thoroughly clear what is believed to
-be a consequence of the rest of this License.
-<br />&nbsp;<br />
-<b>8.</b>
- If the distribution and/or use of the Program is restricted in
-certain countries either by patents or by copyrighted interfaces, the
-original copyright holder who places the Program under this License
-may add an explicit geographical distribution limitation excluding
-those countries, so that distribution is permitted only in or among
-countries not thus excluded.  In such case, this License incorporates
-the limitation as if written in the body of this License.
-<br />&nbsp;<br />
-<b>9.</b>
- The Free Software Foundation may publish revised and/or new versions
-of the General Public License from time to time.  Such new versions will
-be similar in spirit to the present version, but may differ in detail to
-address new problems or concerns.
-<br />&nbsp;<br />
-Each version is given a distinguishing version number.  If the Program
-specifies a version number of this License which applies to it and "any
-later version", you have the option of following the terms and conditions
-either of that version or of any later version published by the Free
-Software Foundation.  If the Program does not specify a version number of
-this License, you may choose any version ever published by the Free Software
-Foundation.
-<br />&nbsp;<br />
-<b>10.</b>
- If you wish to incorporate parts of the Program into other free
-programs whose distribution conditions are different, write to the author
-to ask for permission.  For software which is copyrighted by the Free
-Software Foundation, write to the Free Software Foundation; we sometimes
-make exceptions for this.  Our decision will be guided by the two goals
-of preserving the free status of all derivatives of our free software and
-of promoting the sharing and reuse of software generally.
-<br />&nbsp;<br />
-<b>NO WARRANTY</b>
-<br />&nbsp;<br />
-<b>11.</b>
- BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
-FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
-OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
-PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
-OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS
-TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
-PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
-REPAIR OR CORRECTION.
-<br />&nbsp;<br />
-<b>12.</b>
- IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
-REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
-INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
-OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
-TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
-YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
-PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
-POSSIBILITY OF SUCH DAMAGES.
-<br />&nbsp;<br />
-<b>END OF TERMS AND CONDITIONS</b>
diff --git a/public_html/html/counter.php b/public_html/html/counter.php
deleted file mode 100644 (file)
index e85d400..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-<?php
-
-function Hits() {
-
-// $datafile has to be writable by http server user uid
-// else hits count will not be increased, only printed out
-
-  $datafile = "COUNTER";
-
-  if (Is_Writable($datafile)) {
-    $fp = FOpen($datafile, "r+");
-    $writable = "true";
-  }
-  else
-    if (Is_Readable($datafile)) $fp = FOpen($datafile,"r");
-    else return;
-  
-  $hits = FGets($fp,255) + 1;
-  if(!$hits) $hits = 1;
-
-  if($writable) {
-    Rewind($fp);
-    FPuts($fp, $hits);
-  }
-
-  FClose($fp);
-  echo $hits." hits";
-}
-
-Hits();
-
-?>
diff --git a/public_html/html/cryptofaq.php b/public_html/html/cryptofaq.php
deleted file mode 100644 (file)
index c33f421..0000000
+++ /dev/null
@@ -1,631 +0,0 @@
-&nbsp;<br />
-<b><big>SILC Crypto FAQ</big></b>
-<br />&nbsp;<br />
-
-&nbsp;&nbsp;&nbsp;&nbsp;<a href="#f1_10" class="normal">
-1.1 What is this FAQ?</a><br />
-&nbsp;&nbsp;&nbsp;&nbsp;<a href="#f1_20" class="normal">
-1.2 I found incorrect information in the FAQ, who do I notify?</a><br />
-&nbsp;&nbsp;&nbsp;&nbsp;<a href="#f1_30" class="normal">
-1.3 Your FAQ does not answer my questions, where can I send my question?</a><br />
-&nbsp;&nbsp;&nbsp;&nbsp;<a href="#f1_40" class="normal">
-1.4 I have found a security problem in SILC protocol/implementation.  Who
-   should I notify?</a><br />
-&nbsp;&nbsp;&nbsp;&nbsp;<a href="#f1_50" class="normal">
-1.5 Does SILC support AES?</a><br />
-&nbsp;&nbsp;&nbsp;&nbsp;<a href="#f1_60" class="normal">
-1.6 Does SILC support DES or 3DES?</a><br />
-&nbsp;&nbsp;&nbsp;&nbsp;<a href="#f1_70" class="normal">
-1.7 What other algorithms SILC support?</a><br />
-&nbsp;&nbsp;&nbsp;&nbsp;<a href="#f1_80" class="normal">
-1.8 What encryption modes SILC support?</a><br />
-&nbsp;&nbsp;&nbsp;&nbsp;<a href="#f1_85" class="normal">
-1.9 Is CBC mode going to be replaced in SILC?</a><br />
-&nbsp;&nbsp;&nbsp;&nbsp;<a href="#f1_90" class="normal">
-1.10 What hash functions SILC support?</a><br />
-&nbsp;&nbsp;&nbsp;&nbsp;<a href="#f1_100" class="normal">
-1.11 What public key algorithms SILC support?</a><br />
-&nbsp;&nbsp;&nbsp;&nbsp;<a href="#f1_110" class="normal">
-1.12 Does SILC support PGP keys?</a><br />
-&nbsp;&nbsp;&nbsp;&nbsp;<a href="#f1_120" class="normal">
-1.13 Does SILC support SSH keys?</a><br />
-&nbsp;&nbsp;&nbsp;&nbsp;<a href="#f1_130" class="normal">
-1.14 Does SILC support X.509 certificates?</a><br />
-&nbsp;&nbsp;&nbsp;&nbsp;<a href="#f1_140" class="normal">
-1.15 So SILC can be used with other keys too instead of just SILC public 
-   keys?</a><br />
-&nbsp;&nbsp;&nbsp;&nbsp;<a href="#f1_140" class="normal">
-1.16 How the MAC is computed in SILC?</a><br />
-&nbsp;&nbsp;&nbsp;&nbsp;<a href="#f1_160" class="normal">
-1.17 Why SILC does not use PGP to encrypt messages?</a><br />
-&nbsp;&nbsp;&nbsp;&nbsp;<a href="#f1_170" class="normal">
-1.18 Why SILC does not use TLS/SSL to encrypt messages?</a><br />
-&nbsp;&nbsp;&nbsp;&nbsp;<a href="#f1_180" class="normal">
-1.19 Why SILC does not use SSH tunneling or IPSEC to encrypt messages?</a><br />
-&nbsp;&nbsp;&nbsp;&nbsp;<a href="#f1_190" class="normal">
-1.20 How is the transport in SILC protected then?</a><br />
-&nbsp;&nbsp;&nbsp;&nbsp;<a href="#f1_200" class="normal">
-1.21 Do I understand you correctly that TLS/SSL + PGP would be same as
-   SILCs own protection now?</a><br />
-&nbsp;&nbsp;&nbsp;&nbsp;<a href="#f1_210" class="normal">
-1.22 Are you also saying that a chat protocol using TLS/SSL alone is not 
-   actually sufficient (like IRC+SSL)?</a><br />
-&nbsp;&nbsp;&nbsp;&nbsp;<a href="#f1_220" class="normal">
-1.23 Are you also saying that a chat protocol using PGP alone is not
-   actually sufficient (like ICQ+PGP)?</a><br />
-&nbsp;&nbsp;&nbsp;&nbsp;<a href="#f1_230" class="normal">
-1.24 So chat protocol always needs both secured transport and secured 
-   messages, right?</a><br />
-&nbsp;&nbsp;&nbsp;&nbsp;<a href="#f1_240" class="normal">
-1.25 What is the purpose of the SILC key exchange (SKE) protocol?</a><br />
-&nbsp;&nbsp;&nbsp;&nbsp;<a href="#f1_250" class="normal">
-1.26 How does SKE protocol protect against man-in-the-middle attacks which can be used to attack Diffie-Hellman?</a><br />
-&nbsp;&nbsp;&nbsp;&nbsp;<a href="#f1_260" class="normal">
-1.27 Would have it been possible to use some other key exchange protocol
-   in SILC instead of developing SKE?</a><br />
-&nbsp;&nbsp;&nbsp;&nbsp;<a href="#f1_270" class="normal">
-1.28 Should I verify the public key of the server when I connect to it?</a><br />
-&nbsp;&nbsp;&nbsp;&nbsp;<a href="#f1_280" class="normal">
-1.29 Should I verify all other public keys in SILC?</a><br />
-&nbsp;&nbsp;&nbsp;&nbsp;<a href="#f1_290" class="normal">
-1.30 Why SILC does not used OpenSSL crypto library instead of its own?</a><br />
-&nbsp;&nbsp;&nbsp;&nbsp;<a href="#f1_300" class="normal">
-1.31 Is it possible to digitally sign messages in SILC?</a><br />
-&nbsp;&nbsp;&nbsp;&nbsp;<a href="#f1_310" class="normal">
-1.32 I am a Harry Hacker, and I want to crack your protocol.  What would be
-   the best way to attack SILC protocol?</a><br />
-&nbsp;&nbsp;&nbsp;&nbsp;<a href="#f1_320" class="normal">
-1.33 What could happen if a server in SILC network would become compromised?</a><br />
-&nbsp;&nbsp;&nbsp;&nbsp;<a href="#f1_330" class="normal">
-1.34 What could happen if a router would become compromised?</a><br />
-&nbsp;&nbsp;&nbsp;&nbsp;<a href="#f1_340" class="normal">
-1.35 Is my channel messages protected on compromised server or not?</a><br />
-&nbsp;&nbsp;&nbsp;&nbsp;<a href="#f1_350" class="normal">
-1.36 Is my private messages protected on compromised server or not?</a><br />
-&nbsp;&nbsp;&nbsp;&nbsp;<a href="#f1_360" class="normal">
-1.37 Should I then always use private keys for all messages?</a><br />
-&nbsp;&nbsp;&nbsp;&nbsp;<a href="#f1_370" class="normal">
-1.38 How likely is it that some server would become compromised?</a><br />
-&nbsp;&nbsp;&nbsp;&nbsp;<a href="#f1_380" class="normal">
-1.39 It is said SILC is designed security in mind from the day one. What does it mean?<a><br />
-&nbsp;&nbsp;&nbsp;&nbsp;<a href="#f1_390" class="normal">
-1.40 If someone joins/leaves the channel, how is assured that he cannot decrypt old/new channel messages?</a><br />
-
-<br />&nbsp;<br />
-
-<a name="f1_10"></a>
-<samp class="highlight">Q: What is this FAQ?</samp><br />
-A: This FAQ answers questions regarding cryptography and security in SILC
-   protocol and implementation.  It attempts to answer the most 
-   frequently asked questions that normal users ask.  It also try 
-   to be detailed enough to give precise answers for those who already 
-   understand a bit more about cryptography and security.  When we make 
-   claims or assumptions about security issues we always try to include 
-   the reference to the answer which then can be used to learn more about 
-   the specific security issue.  Also, all claims about SILC's security
-   are made only when we can prove them.
-<br />&nbsp;<br />
-
-<a name="f1_20"></a>
-<samp class="highlight">Q: I found incorrect information in the FAQ, who do I notify?</samp><br />
-A: If you think that some information is incorrect in this FAQ you may
-   send your comments to the 
-<a href="mailto:info@silcnet.org" class="normal">info@silcnet.org</a> email address.
-<br />&nbsp;<br />
-
-<a name="f1_30"></a>
-<samp class="highlight">Q: Your FAQ does not answer my questions, where can I send my question?</samp><br />
-A: If you have questions that you think should be part of this FAQ you
-   may send them to
-<a href="mailto:info@silcnet.org" class="normal">info@silcnet.org</a> email address.
-<br />&nbsp;<br />
-
-<a name="f1_40"></a>
-<samp class="highlight">Q: I have found a security problem in SILC protocol/implementation.  Who should I notify?</samp><br />
-A: If you find a security problem either in the protocol or in the
-   implementation we would appreciate it if you let us know about it first
-   before doing anything else.  You can send us email to 
-<a href="mailto:security@silcnet.org" class="normal">security@silcnet.org</a>
-   if you think you have found a security problem.
-<br />&nbsp;<br />
-
-<a name="f1_50"></a>
-<samp class="highlight">Q: Does SILC support AES?</samp><br />
-A: Yes, the AES with 256 bit encryption key is required in SILC protocol.  
-   The required encryption mode with AES is CBC.  SILC also supports other
-   algorithms but they are optional.
-<br />&nbsp;<br />
-
-<a name="f1_60"></a>
-<samp class="highlight">Q: Does SILC support DES or 3DES?</samp><br />
-A: Only the AES is required algorithm in SILC protocol.  DES or 3DES has 
-   not been added to the SILC specification.  However, the SILC key 
-   exchange protocol is very flexible and you can negotiate to use DES
-   or 3DES if you want, but officially SILC does not support DES or 3DES.
-<br />&nbsp;<br />
-
-<a name="f1_70"></a>
-<samp class="highlight">Q: What other algorithms SILC support?</samp><br />
-A: Like said, only the AES is required.  The protocol specification also
-   lists optional algorithms like Twofish, CAST, RC6, etc., and you can
-   negotiate other algorithms as well during the SILC key exchange 
-   protocol, if needed.
-<br />&nbsp;<br />
-
-<a name="f1_80"></a>
-<samp class="highlight">Q: What encryption modes SILC support?</samp><br />
-A: The required mode is currently CBC.  Other modes are optional.  
-   However, there has been discussion on adding additional required mode,
-   for example CTR mode.  In the future, SILC is also going to have
-   support for so called "authenticated encryption" modes as soon as
-   NIST finalizes its selection process for these modes.
-<br />&nbsp;<br />
-
-<a name="f1_85"></a>
-<samp class="highlight">Q: Is CBC mode going to be replaced in SILC?</samp><br />
-A: Even if new encryption mode like CTR is introduced to SILC protocol the 
-CBC mode will not likely go away.  Recently new attacks has been 
-introduced to the traditional CBC (IV is the previous ciphertext block),
-so looking additional modes for the future is wise.  Another possiblity
-is to change the CBC to be so called randomized CBC (all IVs are random), 
-however most likely this will not be done in SILC.  Rather, new modes will
-be introduced instead.
-<br />&nbsp;<br />
-
-<a name="f1_90"></a>
-<samp class="highlight">Q: What hash functions SILC support?</samp><br />
-A: The required hash function is SHA-1, but also the MD5 is added to the
-   specification as optional hash function.  The SHA-1 is also the 
-   required hash function when used as part of HMAC to provide integrity
-   protection for encrypted packets.
-<br />&nbsp;<br />
-
-<a name="f1_100"></a>
-<samp class="highlight">Q: What public key algorithms SILC support?</samp><br />
-A: The required public key algorithm is RSA, but optional support is
-   for DSS.  The RSA algorithm in SILC supports PKCS#1 standard.  During
-   the key exchange protocol also Diffie-Hellman public key algorithm
-   is used to exchange keys.  The Diffie-Hellman in SILC supports PKCS#3
-   standard.  Adding support for other algorithms like El Gamal is 
-   possible by negotiating them in SILC key exchange.
-<br />&nbsp;<br />
-
-<a name="f1_110"></a>
-<samp class="highlight">Q: Does SILC support PGP keys?</samp><br />
-A: PGP keys, or as they are officially called OpenPGP certificates are
-   supported in SILC protocol.  Current implementation however does not
-   yet have support for them.
-<br />&nbsp;<br />
-
-<a name="f1_120"></a>
-<samp class="highlight">Q: Does SILC support SSH keys?</samp><br />
-A: SSH2 public keys are supported in SILC protocol.  Current 
-   implementation however does not yet have support for them.
-<br />&nbsp;<br />
-
-<a name="f1_130"></a>
-<samp class="highlight">Q: Does SILC support X.509 certificates?</samp><br />
-A: Yes, X.509 certificates are supported in SILC protocol.  Current 
-   implementation however does not yet have support for them.  After the
-   support is added then adding support also for CRLs and also perhaps 
-   OCSP will be added to the implementation.
-<br />&nbsp;<br />
-
-<a name="f1_140"></a>
-<samp class="highlight">Q: So SILC can be used with other keys too instead of just SILC public keys?</samp><br />
-A: Yes, that's the purpose of having support for other public keys and
-   certificates.  The implementation most likely still wants to create
-   you a SILC key pair, but if you have for example PGP key pair that 
-   would be the one you are using in SILC.
-<br />&nbsp;<br />
-
-<a name="f1_150"></a>
-<samp class="highlight">Q: How the MAC is computed in SILC?</samp><br />
-A: The MAC for SILC packet in the secure binary packet protocol is 
-   computed always before encryption from the plaintext, and the MAC
-   is appended at the end of the SILC packet, and is never encrypted.
-   Also the channel message MAC is computed from plaintext when channel
-   message is sent.
-<br />&nbsp;<br />
-   In recent times there has been research on the MAC computation orders
-   and under formal analysis the MAC computation order Encrypt-and-MAC
-   (MAC is computed from plaintext) has been found to be vulnerable to 
-   various attacks.  The IPSEC (ESP) is using so called Encrypt-then-MAC
-   (MAC is computed from ciphertext) order and it was found to be the
-   only order which resisted all attacks.  However, the attacks has been 
-   highly theoretical and no practical attacks exist as of today.  
-   Also, other security protocols using same MAC computation order as SILC 
-   are for example SSH and TLS/SSL (Encrypt-and-MAC order).  SILC will not
-   be changing the MAC computation order, instead in the future so called
-   "authenticated encryption" modes will be used which provides both
-   privacy and integrity which renders the probable MAC order problem 
-   void.
-<br />&nbsp;<br />
-
-<a name="f1_160"></a>
-<samp class="highlight">Q: Why SILC does not use PGP to encrypt messages?</samp><br />
-A: We know it is hard to understand why PGP is not used to encrypt 
-   messages in SILC, but things in cryptography is never as simple as
-   they seem to be.  PGP alone is not suitable to be used and does not 
-   meet the security requirements in SILC, and therefore is not secure
-   enough to be used alone in SILC-like network 
-   <a href="http://www.counterpane.com/chotext.html" class="normal">[1]</a>,
-   <a href="http://www.counterpane.com/pgp-attack.html" class="normal">[2]</a>.
-<br />&nbsp;<br />
-
-   However, PGP can be used with SILC.  It is entirely possible to
-   use PGP to encrypt and/or sign messages in SILC, but as primary
-   protection PGP is not sufficient.
-<br />&nbsp;<br />
-
-<a name="f1_170"></a>
-<samp class="highlight">Q: Why SILC does not use TLS/SSL to encrypt messages?</samp><br />
-A: The transport layer alone cannot provide security for individual
-   messages which are not point to point in nature.  The TLS/SSL protects
-   only point to point traffic arbitrarily and using that to protect
-   for example private message which has no correlation to the actual
-   transport makes no sense.  The messages need to be protected
-   with message specific keys, for example channel messages are protected
-   with channel keys.  The transport in SILC is protected as well with
-   session keys (point to point), which would be analogous to using 
-   TLS/SSL, but there is no specific reason to use TLS/SSL for that in 
-   SILC.
-<br />&nbsp;<br />
-
-<a name="f1_180"></a>
-<samp class="highlight">Q: Why SILC does not use SSH tunneling or IPSEC to encrypt messages?</samp><br />
-A: For the same reasons as why it is not using TLS/SSL.
-<br />&nbsp;<br />
-
-<a name="f1_190"></a>
-<samp class="highlight">Q: How is the transport in SILC protected then?</samp><br />
-A: The transport is protected with session keys negotiated during the
-   SILC key exchange protocol.  SILC protocol defines secure binary packet
-   protocol, which provides encrypted and authenticated binary packets.
-   All data in SILC are sent using this secure binary packet protocol
-   and all packets are automatically encrypted.  This is analogous of
-   using TLS/SSL to protect the socket layer, except that SILC defines
-   the binary packet protocol itself.  Another example of protocol having 
-   its own secure binary packet protocol is SSH, and it is analogous to 
-   TLS/SSL too.
-<br />&nbsp;<br />
-
-   But note that protecting the transport is not sufficient enough to
-   protect individual messages.  Transport is just arbitrary data point
-   to point, where as channel message for example is a message from one
-   sender to many recipients and requires different kind of protection.
-   Protecting transport is one thing, and protecting messages end to end
-   is another.
-<br />&nbsp;<br />
-
-<a name="f1_200"></a>
-<samp class="highlight">Q: Do I understand you correctly that TLS/SSL + PGP would be same as SILCs own protection now?</samp><br />
-A: TLS/SSL + PGP + something else too, would be about same, but the end
-   result would be really ad hoc solution since these are separate,
-   external security protocols and not something designed to work 
-   together.  Also, at the time SILC was designed OpenPGP standard did
-   not exist so using it would have been out of question anyway.  Your 
-   favorite chat protocol does not suddenly become secure when you start 
-   slapping different security protocols on top of it.  It requires 
-   thorough planning and designing to work in secure manner.
-<br />&nbsp;<br />
-
-   SILC has been designed the security in mind from the day one and
-   for this reason securing the transport and providing end to end
-   security for private messages, channel messages and other messages
-   is integrated.  The end result would have not been as secure if
-   external protocols would have been just applied over insecure
-   chat protocol hoping for the best.  Now they are integrated and
-   designed to work together, and there is no need to apply external
-   security protocols.
-<br />&nbsp;<br />
-
-<a name="f1_210"></a>
-<samp class="highlight">Q: Are you also saying that a chat protocol using TLS/SSL alone is not actually sufficient (like IRC+SSL)?</samp><br />
-A: If it is used alone (no other protection), then basicly that's what I'm 
-   saying, but of course things are not that simple.  If the TLS/SSL is 
-   used correctly, that is, all points in the chat network are protected 
-   then it can provide security.  But if even one point in the chat 
-   network is not secured then the entire network can be considered 
-   compromised.  Also, if one server in the network is compromised then 
-   entire network and all messages are compromised since messages are not 
-   actually secure, only the transport.  Ask yourself this: If you remove 
-   the TLS/SSL, is your message secured or not?  If you answer no, then 
-   it doesn't provide sufficient security for chat networks.  Also, note 
-   that it does not provide message authentication, only packet data 
-   authentication, and that is not the same thing (a packet is point to 
-   point, a message is not).
-<br />&nbsp;<br />
-
-<a name="f1_220"></a>
-<samp class="highlight">Q: Are you also saying that a chat protocol using PGP alone is not actually sufficient (like ICQ+PGP)?</samp><br />
-A: Here I assume protocols that just protect the message with PGP, then
-   yes, that's what I am saying.  This is even more serious than
-   those using just TLS/SSL.  Why?  Because there is no packet protection 
-   at all, only message protection.  The message may be encrypted and 
-   authenticated but the packet is not.  This allows attacks like forgery 
-   attacks, plaintext and ciphertext tampering, reply and out of order 
-   delivery attacks, chosen ciphertext attacks, even adaptive chosen 
-   ciphertext attacks
-   <a href="http://www.counterpane.com/chotext.html" class="normal">[1]</a>,
-   <a href="http://www.counterpane.com/pgp-attack.html" class="normal">[2]</a>,
-   and many more.  Some of these attacks may be rendered ineffective by
-   doing the implementation carefully but the protocol remains broken
-   regardless.
-<br />&nbsp;<br />
-
-<a name="f1_230"></a>
-<samp class="highlight">Q: So chat protocol always needs both secured transport and secured messages, right?</samp><br />
-A: Yes, you got it now!  And SILC provides exactly that.  Its transport
-   is secured with the secure binary packet protocol and it provides
-   message encryption and authentication.
-<br />&nbsp;<br />
-
-<a name="f1_240"></a>
-<samp class="highlight">Q: What is the purpose of the SILC key exchange (SKE) protocol?</samp><br />
-A: The primary purpose of the SILC key exchange protocol is to create
-   session key for protecting the traffic between the client and the
-   server.  It is executed always when client connects to the server.
-   It can also be used to create other key material for other sessions,
-   like file transfer session.  The SKE use Diffie-Hellman for key
-   exchange algorithm, and supports digital signatures and mutual
-   authentication.  The SKE is based on SSH2, STS and OAKLEY key exchange
-   protocols.  The SKE is also used to negotiate the security properties
-   that are going to be used in the session.  These properties are
-   the encryption algorithm, HMAC, public key algorithm, hash
-   algorithm, key lengths, encryption modes, etc.
-<br />&nbsp;<br />
-
-<a name="f1_250"></a>
-<samp class="highlight">Q: The SILC key exchange protocol is using Diffie-Hellman.  How does it protect against man-in-the-middle attacks which can be used to attack Diffie-Hellman?</samp><br />
-A: Diffie-Hellman is known to be vulnerable to man-in-the-middle attack
-   when it is used alone.  For that reason it must not be used alone
-   ever.  In SILC key exchange (SKE) protocol digital signatures are
-   used to prevent the man-in-the-middle attacks.  Using digital 
-   signatures with Diffie-Hellman is the common way to avoid these
-   problems, and in addition it provides peer authentication at the
-   same time.  Other key exchange protocols which use Diffie-Hellman
-   with digital signatures too are IKE, SSH2, TLS/SSL, and many more.
-<br />&nbsp;<br />
-
-   Naturally, in the end the user and the application is responsible of
-   avoiding the man-in-the-middle attack; the public key of the remote
-   must be verified before trusting it.  If this is not done, then
-   the digital signatures makes no difference.  This is the case with
-   any key exchange protocol using digital signatures.
-<br />&nbsp;<br />
-
-<a name="f1_260"></a>
-<samp class="highlight">Q: Would have it been possible to use some other key exchange protocol in SILC instead of developing SKE?</samp><br />
-A: At the time SILC was developed the answer was simply no, it would have
-   not been possible.  The problem often is that security protocols tend
-   to develop their own key exchange protocols even though at least
-   theoretically it would be possible and wise to use protocol which
-   is proved secure.  In practice this is never done.  TLS/SSL has its
-   own key exchange, SSH has its own key exchange, and SILC has its
-   own key exchange.  When the Internet Key Exchange (IKE) protocol was
-   being developed it was our hope that it would have become general
-   purpose key exchange protocol but the reality was that it was tightly
-   developed for IPSEC instead.  The end result is that it would be
-   huge overkill to use IKE with any other protocol than IPSEC.
-<br />&nbsp;<br />
-
-<a name="f1_270"></a>
-<samp class="highlight">Q: Should I verify the public key of the server when I connect to it?</samp><br />
-A: Definitely yes.  Commonly in security protocols which does not use
-   certificates by default the public key is verified in the first time
-   it is received and then it is cached on local disk.  In SILC the same
-   thing is done.  When you connect the very first time to the server
-   you will be prompted to verify and accept the public key.  This is the
-   time when you should (must) verify the public key.  After accepting
-   the key it is saved locally and used later to do the verification 
-   automatically.  This is same as with SSH; you accept the SSH server
-   key the very first time and then cache it locally for later use.
-<br />&nbsp;<br />
-
-   The moral is this: you always must verify all public keys to be 
-   certain that man-in-the-middle attack is not in progress.  It is your 
-   risk to take if you do not verify the key.
-<br />&nbsp;<br />
-
-<a name="f1_280"></a>
-<samp class="highlight">Q: Should I verify all other public keys in SILC?</samp><br />
-A: Definitely yes.  You can receive public keys when you negotiate for
-   example private message key with some other client, and you must
-   verify the key before accepting it.  Reason are same as in previous
-   answer.
-<br />&nbsp;<br />
-
-<a name="f1_290"></a>
-<samp class="highlight">Q: Why SILC does not used OpenSSL crypto library instead of its own?</samp><br />
-A: The OpenSSL crypto library as you know it now did not even exist
-   when the SILC crypto library was developed in 1997.  The SSLeay
-   crypto library which was the predecessor of OpenSSL package did
-   exist but was not suitable for our use at the time.
-<br />&nbsp;<br />
-
-   Now that OpenSSL crypto library is popular, it still is not
-   sufficient enough for us.  SILC specification requires AES algorithm
-   but OpenSSL crypto library as of this writing (Oct 2002) still does not 
-   support it.  This alone makes the OpenSSL crypto library impossible
-   for us to use.
-<br />&nbsp;<br />
-
-   Also, we feel that using different crypto libraries and using the one
-   we have developed over the years is good in the end for everybody.  A
-   bug that would affect SILC may not then affect OpenSSL, and on the
-   other hand bug that would affect OpenSSL crypto library may not then
-   affect SILC.  Diversity also in crypto libraries is a good thing.
-<br />&nbsp;<br />
-
-   Finally, in our opinion SILC crypto library is equally good or even
-   better than OpenSSL crypto library.
-<br />&nbsp;<br />
-
-<a name="f1_300"></a>
-<samp class="highlight">Q: Is it possible to digitally sign messages in SILC?</samp><br />
-A: Yes, this is possible, however the detailed definition of how this is
-   done with different public keys/certificates has not yet been defined
-   as of this writing (Oct 2002).  The next protocol version 1.2 will 
-   define this and it will be added to the implementation immediately.
-<br />&nbsp;<br />
-
-<a name="f1_310"></a>
-<samp class="highlight">Q: I am a Harry Hacker, and I want to crack your protocol.  What would be the best way to attack SILC protocol?</samp><br />
-A: Hehe.  There is no simple answer to this question.  Designing a 
-   security protocol is extremely difficult.  It is actually more 
-   difficult than, say, designing an encryption algorithm.  Why?  Because 
-   security protocols tend to be so complex.  And even when they are
-   not complex they are always more complex than just one cryptographic
-   primitive like encryption algorithm.  Now, attacking cryptographic
-   algorithm to break the protocol is usually never the best way to
-   go about since the attacks against algorithms are usually just
-   theoretical and hard to mount.  Attacking the protocol as a whole may 
-   also be pretty difficult since the operations in the protocol are 
-   usually protected by those cryptographic primitives.  The best way of 
-   attacking any security protocol is usually to attack the 
-   implementation, since that's the number one source of problems in
-   security protocols.
-<br />&nbsp;<br />
-
-   However, I don't know whether you want to analyze the protocol 
-   itself, in an attempt to try to find security holes or weaknesses in
-   the protocol, or whether you want to just break the protocol.  If you
-   want to do the first, then the best way to go about is to learn all
-   the details about SILC protocol, how it works, how the implementation
-   is supposed to work, and what security measures are used in the 
-   protocol.  Then you start analyzing the protocol and trying to look
-   for obvious mistakes.  Then you can try to apply some attacks you know
-   about to the protocol and see what would happen.  If you want to
-   do the second then you probably need to get your hands dirty and
-   try to figure out ways to do it in practice by finding implementation
-   problems, design problems and applying attacks in practice to the
-   implementation you are using.  Also, always think big.  Protocols are
-   not used in a class jar, they are used by human beings in a real world
-   and you can break a protocol by not attacking the protocol at all, but 
-   by attacking something from the side.
-<br />&nbsp;<br />
-
-<a name="f1_320"></a>
-<samp class="highlight">Q: What could happen if a server in SILC network would become compromised?</samp><br />
-A: This is of course hypothetical but let's assume the entire server would
-   be in the hands of malicious attacker and he can control everything 
-   that happens in the server.  This would of course mean that the 
-   attacker has compromised the entire machine, not just SILC server.
-   He also would have replaced the original SILC server with tampered
-   version which the attacker can control.  It would not be nice 
-   situation.  First, all local connections to the server would be 
-   compromised since the server knows the session keys for local 
-   connections.  Second, all channels that the server has locally joined 
-   users would be compromised since the server knows those channel keys.  
-   However, other invite-only, private or secret channels would not be 
-   compromised since the attacker has no access to those channels.  Also 
-   channels that are using channel private keys would not be compromised.  
-   Third, all data and messages protected with session keys would be 
-   compromised.  However, all messages protected with private keys, like 
-   private message keys, and channel private keys would not be 
-   compromised since the server does not know these keys.
-<br />&nbsp;<br />
-
-   So it would not be pretty sight, but it's same with any security
-   protocol like SSH.  If SSH server is compromised then there's not
-   much you can do.  In SILC however you can still do something; you
-   can decide to use private keys to protect all messages.  Servers
-   do not know these keys so even if the server is compromised it would
-   be safe.  It cannot decrypt those messages.  So, in SILC there is 
-   always the fallback to something else.  This is important in security
-   protocols; how can you make the protocol secure even if it partially
-   fails?  Answer is by having fallbacks that are available if something
-   fails.  Fallback after the other.  As long it fallbacks to something
-   that provides security it is better than nothing.  Another problem
-   is of course that of how fast the protocol is able to recover from
-   these security failures.  This is more complicated matter however,
-   but naturally the compromised server need to be removed from the
-   network as soon as possible.  The protocol recovers then immediately.
-<br />&nbsp;<br />
-
-<a name="f1_330"></a>
-<samp class="highlight">Q: What could happen if a router would become compromised?</samp><br />
-A: The situation would be similar to having compromised server except
-   that router knows all locally (in the router, ie. in the cell) created
-   channels, so all local channels that are not using channel private 
-   keys would be compromised.  However, channels that are created on other
-   routers, and if there are no local users on those channels in the 
-   router, would not be compromised, since channel keys are cell specific.
-<br />&nbsp;<br />
-
-<a name="f1_340"></a>
-<samp class="highlight">Q: Is my channel messages protected on compromised server or not?</samp><br />
-A: If you are using channel private key then always yes.  If the 
-   compromised server does not know about the channel then always yes.
-   If you are not using channel private key, and the server knows the
-   current channel key then no, if the server is compromised.  But note
-   that if some server in the network is compromised it does not 
-   automatically mean that your channel messages are compromised.
-<br />&nbsp;<br />
-
-<a name="f1_350"></a>
-<samp class="highlight">Q: Is my private messages protected on compromised server or not?</samp><br />
-A: If you are using private message keys then always yes.  If you are not
-   using then no, if the server is compromised and the private message
-   passes through the compromised server.  Again, a compromised server
-   in network does not automatically mean that private message is 
-   compromised.  Also the structure of the network in SILC is designed
-   so that messages do not go to servers unless they really need to
-   do so (since there is no tree-like network structure, where messages
-   could pass through several servers).
-<br />&nbsp;<br />
-
-<a name="f1_360"></a>
-<samp class="highlight">Q: Should I then always use private keys for all messages?</samp><br />
-A: If you think that the network or server you are using is not something
-   you can trust in any degree then yes.  If the server is your company's
-   internal SILC server then I guess you may even trust it.  It is your
-   decision and you decide what is the acceptable level of risk you are
-   willing to take, and what is your required level of security.  For
-   private messages using private keys is trivial since you can 
-   automatically negotiate the keys with SKE.  Using channel private key
-   is however more complicated since all users in the channel need to 
-   know the key in order to be able to talk on the channel.  It may be
-   for example pre-shared key that all users on the channel know.
-<br />&nbsp;<br />
-
-<a name="f1_370"></a>
-<samp class="highlight">Q: How likely is it that some server would become compromised?</samp><br />
-A: Like said in last questions all these scenarios were hypothetical, and
-   if the server is not compromised then there are no problems of the
-   kind just discussed.  It is very hard to say how likely it is.  It is
-   unlikely, but a possibility.  Server administrators must keep the 
-   machine protected in general too, since if the machine is compromised 
-   a whole lot of other stuff is compromised too, not just SILC server.
-<br />&nbsp;<br />
-
-<a name="f1_380"></a>
-<samp class="highlight">Q: It is said SILC is designed security in mind
-from the day one. What does it mean?</samp><br />
-A: It means that when SILC was designed it was designed as security
-protocol, not as conferencing protocol which has security features.  It
-means that security was the top priority and security issues was analyzed
-when adding new features to the protocol.  It also means, that SILC was
-designed from attacker's point of view.  Instead of just adding security
-measures to the protocol we first analyzed attacks against the protocol
-(and other protocols) and then designed the SILC to resist the attacks.
-The protocol of course easily gets very complex and then analyzing gets 
-harder and harder, new attacks are discovered that we didn't know about,
-and for this reason the analyzing is constant and ongoing process.
-<br />&nbsp;<br />
-
-<a name="f1_390"></a>
-<samp class="highlight">Q: If someone joins/leaves the channel, how is 
-assured that he cannot decrypt old/new channel messages?</samp><br />
-A: Channel key is always regenerated when someone joins or leaves the
-channel.  This assures that it is not possible to decrypt channel messages
-before you have joined the channel, you cannot decrypt old channel 
-messages after you have joined the channel since they were encrypted with 
-different key, and you cannot decrypt channel message after leaving the 
-channel since all new messages will be encrypted with differnet key.  In 
-short, you will know the channel key only when you are joined on the 
-channel, and this is the only time when channel messages can be sent or 
-received.
-<br />&nbsp;<br />
-
diff --git a/public_html/html/cvs.php b/public_html/html/cvs.php
deleted file mode 100644 (file)
index 80a7eb6..0000000
+++ /dev/null
@@ -1,197 +0,0 @@
-&nbsp;<br />
-<b><big>Anonymous CVS access</big></b>
-<br />&nbsp;<br />
-Anonymous CVS access is now available to SILC CVS repository. The
-repository includes everything related to SILC project; source codes,
-documentation and even these web pages. The CVS access is of course public
-but it is intended for developers. After you have checked out the SILC
-source tree you should read README.CVS file from the source tree or rest
-of this web page.
-<br />&nbsp;<br />
-Also note that this is the closest to real time development you can get
-thus you cannot expect that the source tree would work or even compile.
-While it is our intention that the trunk would always at least compile
-there might be situations when it will not.
-
-<br />&nbsp;<br />
-
-<b>Browsing the Source Tree</b>
-<br />&nbsp;<br />
-If you want to browse the source tree using web browser before checking
-out the tree with CVS use following link:
-<br />&nbsp;<br />
-<a href="http://cvs.silcnet.org/" class="normal">Web Access to CVS repository
-</a>
-<br />&nbsp;<br />
-Note that this is not real-time access to the CVS repository. It is
-updated once a day. If you want real-time access then checkout the CVS
-repository.
-
-<br />&nbsp;<br />
-
-<b>Howto Checkout The Source Tree</b>
-<br />&nbsp;<br />
-The repository can be checked out by using anonymous pserver with CVS.
-<br />&nbsp;<br />
-For those who are using sh/ksh/bash/zsh the check out is done as follows:
-<br />&nbsp;<br />
-<tt class="highlight">
-export CVSROOT=:pserver:<?php printf("%s@%s:%s", $CVS_User, $CVS_Site, $CVS_Root); ?>
-<br />&nbsp;<br />
-cvs login<br />
-cvs co silc<br />
-cvs logout<br />
-</tt>
-
-<br />&nbsp;<br />
-For those who are using csh/tcsh the check out is done as follows:
-<br />&nbsp;<br />
-<tt class="highlight">
-setenv CVSROOT :pserver:<?php printf("%s@%s:%s", $CVS_User, $CVS_Site, $CVS_Root); ?>
-<br />&nbsp;<br />
-cvs login<br />
-cvs co silc<br />
-cvs logout<br />
-</tt>
-<br />&nbsp;<br />
-If you don't want to set $CVSROOT environment variable you can set the
-path to the cvs as command line option:
-<br />&nbsp;<br />
-<tt class="highlight">
-cvs -d:pserver:<?php printf("%s@%s:%s", $CVS_User, $CVS_Site, $CVS_Root); ?> login
-<br />
-cvs -d:pserver:<?php printf("%s@%s:%s", $CVS_User, $CVS_Site, $CVS_Root); ?> co silc
-<br />
-cvs -d:pserver:<?php printf("%s@%s:%s", $CVS_User, $CVS_Site, $CVS_Root); ?> logout
-</tt>
-<br />&nbsp;<br />
-Whatever method you will decide to use, after you have done cvs login you will
-be prompted for password:
-<br />&nbsp;<br />
-<b>CVS password: </b>silc
-<br />&nbsp;<br />
-Type the password "silc" and press &lt;ENTER&gt;
-<br />&nbsp;<br />
-The actual SILC source tree is checked out using the cvs co silc command,
-described above. This command will fetch the source tree and save it into
-directory named silc. SILC CVS repository currently does not have any
-branches thus this will check out the trunk. The size of the trunk is
-currently about 13 MB but will grow in the future.
-
-<br />&nbsp;<br />
-
-<b>What SILC Source Tree Includes</b>
-<br />&nbsp;<br />
-SILC Source tree includes a lot more stuff that appears in public
-distribution. The source tree includes, for example, internal scripts,
-configuration files, SILC webpages etc. These never appear on a public
-distribution.
-<br />&nbsp;<br />
-Following directories currently exist in SILC source tree.
-<br />&nbsp;<br />
-<tt class="highlight">
-doc/
-<br />&nbsp;<br />
-&nbsp; Includes all the SILC documentation. Few parts of the documentation<br />
-&nbsp; are generated when distribution is generated. The automatically<br />
-&nbsp; generated files should never be commited to CVS.<br />
-<br />&nbsp;<br />
-includes/
-<br />&nbsp;<br />
-&nbsp; Includes SILC include files.
-<br />&nbsp;<br />
-lib/
-<br />&nbsp;<br />
-&nbsp; Includes SILC libraries. There are maybe libraries in the CVS which<br />
-&nbsp; are not inclduded in public distribution.<br />
-<br />&nbsp;<br />
-public_html/
-<br />&nbsp;<br />
-&nbsp; Includes the official SILC web pages and everything related to them.<br />
-&nbsp; This directory will never appear in public distribution.<br />
-<br />&nbsp;<br />
-silc/
-<br />&nbsp;<br />
-&nbsp; Includes SILC client. There can be some extra files that will<br />
-&nbsp; never appear in public distribution, such as configuration files.<br />
-<br />&nbsp;<br />
-silcd/
-<br />&nbsp;<br />
-&nbsp; Includes SILC server. There can be some extra files that will<br />
-&nbsp; never appear in public distribution, such as configuration files.<br />
-</tt>
-
-<br />&nbsp;<br />
-
-<b>Howto Compile SILC Source Tree</b>
-<br />&nbsp;<br />
-After checkout from CVS the SILC source tree needs to be prepared for
-configuration and compilation. To compile the source tree, type:
-<br />&nbsp;<br />
-<tt class="highlight">
-./prepare<br />
-./configure --enable-debug<br />
-make<br />&nbsp;<br />
-note: on non-GNU/Linux operating systems GNU make (gmake) is prefered
-</tt>
-<br />&nbsp;<br />
-
-The ./prepare script is included in the source tree and it will never
-appears in public distribution. The script prepares the source tree
-by creating configuration scripts and Makefiles. The prepare must be
-run every time you made any changes to configuration scripts (however,
-making changes to Makefile.am's does not require running ./prepare).
-<br />&nbsp;<br />
-As a developer you should read the ./configure script's help by typing
-./configure --help and study all of its different options. Also you
-should configure the script with --enable-debug option as it compiles
-SILC with -g (debugging) option and it enables the SILC_LOG_DEBUG*
-scripts. Warning is due here:  The debugging produced by both cilent
-and server is very huge, thus it is common to test the programs as
-follows:
-<br />&nbsp;<br />
-<tt class="highlight">
-./silc -d "*" -f configfile 2&gt;log<br />
-./silcd -d "*" -f configfile 2&gt;log
-</tt>
-
-<br />&nbsp;<br />
-The -d option enables the debug printing.  The argument for the -d option
-is a string that is used to match the output debug.  The example "*" will
-match for everything, and all debugs will be printed.  If you want to
-limit the debugs you want to printout you can give for example a string
-like "*server*,*rng*" to match all functions, and filenames that has
-"server" or "rng" string in them.  Others will not be printed out.  You 
-can freely define regural expressions as debug string.
-
-<br />&nbsp;<br />
-
-<b>How to clean SILC Source Tree</b>
-<br />&nbsp;<br />
-To entirely clear the source tree to the state after it was checked out
-from CVS, type:
-<br />&nbsp;<br />
-<tt class="highlight">
-./prepare-clean
-</tt>
-<br />&nbsp;<br />
-
-This calls `make distclean' plus removes automatically generated files
-by hand. It also removes *.log files. However, it will not remove any
-other files you might have created.
-
-<br />&nbsp;<br />
-
-<b>Makefiles and configuration files</b>
-<br />&nbsp;<br />
-Developers should never directly write a Makefile. All Makefiles are
-always automatically generated by ./prepare and later by ./configure
-scripts. Instead, developers have to write Makefile.am files. There
-are plenty of examples what they should look like. If you changed
-Makefile.am during development you do not need to run ./prepare, just
-run normal make.
-<br />&nbsp;<br />
-Configuration files are the files that ./prepare automatically generates
-and which will be included into public distribution. ./prepare creates
-for example the ./configure script that is not commited to the CVS.
-`configure.in' is the file that developers have to edit to change ./configure
diff --git a/public_html/html/docs.php b/public_html/html/docs.php
deleted file mode 100644 (file)
index 0344e44..0000000
+++ /dev/null
@@ -1,139 +0,0 @@
-&nbsp;<br />
-<b><big>SILC Documentation</big></b>
-<br />&nbsp;<br />
-
-README file from packages: <a href="docs/README" class="normal">README</a>
-<br />&nbsp;<br />
-Software manual: <i>Coming later</i>
-
-<br />&nbsp;<br />&nbsp;<br />
-
-<b>Installation Instructions</b>
-<br />&nbsp;<br />
-General installation instructions are available in all SILC distributions 
-in the INSTALL file.
-<br />&nbsp;<br />
-<a href="?page=install" class="normal">Installation instructions</a>
-
-<br />&nbsp;<br />&nbsp;<br />
-
-<b><big>Technical Documentation</big></b>
-<br />&nbsp;<br />
-
-<b>SILC Toolkit Reference Manual</b>
-<br />&nbsp;<br />
-SILC Toolkit Reference Manual includes documentation for the SILC Toolkit 
-package.  It includes interface references to all interfaces found in 
-various SILC libraries.  The reference manual is automatically generated 
-from the source code.  Note that this version is preliminary and does not 
-include references to all interfaces.
-<br />&nbsp;<br />
-<a href="docs/toolkit/" class="normal">HTML version</a>, 
-<a href="docs/toolkit.html.tar.gz" class="normal">html.tar.gz</a>
-
-<br />&nbsp;<br />&nbsp;<br />
-
-<b>Coding Conventions</b>
-<br />&nbsp;<br />
-If you would like to submit code to the SILC Project we would like you to 
-first check out these coding conventions.  They are here for the benefit 
-of all who read the code and is involved in the development of the SILC.
-<br />&nbsp;<br />
-<a href="docs/CodingStyle" class="normal">CodingStyle</a>
-
-<br />&nbsp;<br />&nbsp;<br />
-
-<b><big>SILC Protocol Documentation</big></b>
-<br />&nbsp;<br />
-
-<b>SILC Protocol White Paper</b>
-<br />&nbsp;<br />
-SILC Protocol White Paper gives short but deep enough introduction to the 
-SILC Protocol. Note that this is for those who would like to know how the 
-protocol works. For more detailed description of the protocol we suggest 
-reading the protocol specifications.
-<br />&nbsp;<br />
-
-<a href="?page=whitepaper" class="normal">HTML version</a>,
-<a href="docs/silc_protocol.pdf.gz" class="normal">gzipped PDF</a>,
-<a href="docs/silc_protocol.ps.gz" class="normal">gzipped PostScript</a>
-
-<br />&nbsp;<br />&nbsp;<br />
-
-<b>SILC Protocol Internet Drafts</b>
-<br />&nbsp;<br />
-SILC Protocol is documented and four Internet Drafts exist. These 
-Internet Drafts are also available from the
-<a href="http://www.ietf.org/" class="normal">IETF</a>.
-<br />&nbsp;<br />
-
-<b>Secure Internet Live Conferencing (SILC), Protocol Specification</b>
-<br />&nbsp;<br />
-Abstract
-<br />&nbsp;<br />
-   This memo describes a Secure Internet Live Conferencing (SILC)
-   protocol which provides secure conferencing services over insecure
-   network channel. SILC is IRC [IRC] like protocol, however, it is
-   not equivalent to IRC and does not support IRC. Strong cryptographic
-   methods are used to protect SILC packets inside the SILC network.
-   Three other Internet Drafts relates very closely to this memo;
-   SILC Packet Protocol [SILC2], SILC Key Exchange and Authentication
-   Protocols [SILC3] and SILC Commands [SILC4].
-<br />&nbsp;<br />
-<a href="docs/draft-riikonen-silc-spec-04.txt" class="normal">
-draft-riikonen-silc-spec-04.txt</a>
-<br />&nbsp;<br />&nbsp;<br />
-
-<b>SILC Packet Protocol</b>
-<br />&nbsp;<br />
-Abstract
-<br />&nbsp;<br />
-   This memo describes a Packet Protocol used in the Secure Internet Live
-   Conferencing (SILC) protocol, specified in the Secure Internet Live
-   Conferencing, Protocol Specification Internet Draft [SILC1].  This
-   protocol describes the packet types and packet payloads which defines
-   the contents of the packets. It provides secure binary packet protocol
-   that assures that the content of the packets is secured and authenticated.
-<br />&nbsp;<br />
-<a href="docs/draft-riikonen-silc-pp-04.txt" class="normal">
-draft-riikonen-silc-pp-04.txt</a>
-<br />&nbsp;<br />&nbsp;<br />
-
-<b>SILC Key Exchange and Authentication Protocols</b>
-<br />&nbsp;<br />
-Abstract
-<br />&nbsp;<br />
-   This memo describes two protocols used in the Secure Internet Live  
-   Conferencing (SILC) protocol, specified in the Secure Internet Live 
-   Conferencing, Protocol Specification internet-draft [SILC1].  The   
-   SILC Key Exchange (SKE) protocol provides secure key exchange between
-   two parties resulting into shared secret key material. The protocol
-   is based on Diffie-Hellman key exchange algorithm and its functionality
-   is derived from several key exchange protocols. SKE uses best parts
-   of the SSH2 Key Exchange protocol, Station-To-Station (STS) protocol 
-   and the OAKLEY Key Determination protocol [OAKLEY].
-<br />&nbsp;<br />
-   The SILC Connection Authentication protocol provides user level
-   authentication used when creating connections in SILC network. The 
-   protocol is transparent to the authentication data which means that it
-   can be used to authenticate the user with, for example, passphrase  
-   (pre-shared-secret) or public key (and certificate).
-<br />&nbsp;<br />
-<a href="docs/draft-riikonen-silc-ke-auth-04.txt" class="normal">
-draft-riikonen-silc-ke-auth-04.txt</a>
-<br />&nbsp;<br />&nbsp;<br />
-
-<b>SILC Commands</b>
-<br />&nbsp;<br />
-Abstract
-<br />&nbsp;<br />
-   This memo describes the commands used in the Secure Internet Live
-   Conferencing (SILC) protocol, specified in the Secure Internet Live
-   Conferencing, Protocol Specification Internet Draft [SILC1].  The
-   SILC Commands are very important part of the SILC protocol.  Usually
-   the commands are used by SILC clients to manage the SILC session, but
-   also SILC servers may use the commands.  This memo specifies detailed
-   command messages and command reply messages.
-<br />&nbsp;<br />
-<a href="docs/draft-riikonen-silc-commands-02.txt" class="normal">
-draft-riikonen-silc-commands-02.txt</a>
diff --git a/public_html/html/download.php b/public_html/html/download.php
deleted file mode 100644 (file)
index 4d0485d..0000000
+++ /dev/null
@@ -1,349 +0,0 @@
-&nbsp;<br />
-<b><big>Download SILC</big></b>
-<br />&nbsp;<br />
-The SILC is distributed in three different packages; the SILC Client, the 
-SILC Server and the SILC Toolkit. The SILC Client is intended for end 
-users, the SILC Server for system administrators and the SILC Toolkit for 
-developers.
-<br />&nbsp;<br />
-Use a <a href="?page=mirrors" class="normal">mirror</a> near you for downloads.
-<br />&nbsp;<br /><br />
-
-
-<table width="600" cellspacing="2" cellpadding="2" border="0">
- <tr>
-  <td colspan="7" class="text">
-
-<b>SILC Client</b>
-<br />&nbsp;<br />
-<b>The latest version of the SILC client is <?php echo $Latest_Client; ?></b>
-<br />&nbsp;<br />
-The SILC Client package is inteded for end users who need only the SILC 
-client. The package includes the new Irssi-SILC client.
-<br />&nbsp;<br />
-
-  </td>
- </tr>
- <tr>
-  <td class="title340" colspan="2" align="center"><b>Package</b></td>
-  <td class="title50" align="center"><b>Version</b></td>
-  <td class="title60" align="center"><b>Size</b></td>
-  <td class="title100" colspan="2" align="center"><b>URL</b></td>
-  <td class="title50" align="center"><b>SUM</b></td>
- </tr>
- <tr>
-  <td class="sources60">&nbsp;Sources</td>
-  <td class="sources280">&nbsp;tar.gz</td>
-  <td class="sources50" align="center"><?php echo $Latest_Client; ?></td>
-  <td class="sources60" align="right"><?php echo div(FileSize("download/client/sources/silc-client-".$Latest_Client.".tar.gz"),1024); ?> kB&nbsp;</td>
-  <td class="sources50" align="center"><a href="download/client/sources/silc-client-<?php echo $Latest_Client; ?>.tar.gz" class="normal">HTTP</a></td>
-  <td class="sources50" align="center"><a href="ftp://<?php echo $FTP_Site.$FTP_Root ?>/client/sources/silc-client-<?php echo $Latest_Client; ?>.tar.gz" class="normal">FTP</a></td>
-  <td class="sources50" align="center"><a href="download/client/sources/silc-client-<?php echo $Latest_Client; ?>.tar.gz.md5" class="normal">MD5</a></td>
- </tr>
- <tr>
-  <td class="sources">&nbsp;Sources</td>
-  <td class="sources">&nbsp;tar.bz2</td>
-  <td class="sources" align="center"><?php echo $Latest_Client; ?></td>
-  <td class="sources" align="right"><?php echo div(FileSize("download/client/sources/silc-client-".$Latest_Client.".tar.bz2"),1024); ?> kB&nbsp;</td>
-  <td class="sources" align="center"><a href="download/client/sources/silc-client-<?php echo $Latest_Client; ?>.tar.bz2" class="normal">HTTP</a></td>
-  <td class="sources" align="center"><a href="ftp://<?php echo $FTP_Site.$FTP_Root ?>/client/sources/silc-client-<?php echo $Latest_Client; ?>.tar.bz2" class="normal">FTP</a></td>
-  <td class="sources" align="center"><a href="download/client/sources/silc-client-<?php echo $Latest_Client; ?>.tar.bz2.md5" class="normal">MD5</a></td>
- </tr>
- <tr>
-  <td class="sources">&nbsp;Sources</td>
-  <td class="sources">&nbsp;SRPM</td>
-  <td class="sources" align="center"><?php echo $Latest_RPM_Client_src; ?></td>
-  <td class="sources" align="right"><?php echo div(FileSize("download/client/rpm/SRPMS/silc-client-".$Latest_RPM_Client.".src.rpm"),1024); ?> kB&nbsp;</td>
-  <td class="sources" align="center"><a href="download/client/rpm/SRPMS/silc-client-<?php echo $Latest_RPM_Client_src; ?>.src.rpm" class="normal">HTTP</a></td>
-  <td class="sources" align="center"><a href="ftp://<?php echo $FTP_Site.$FTP_Root ?>/client/rpm/SRPMS/silc-client-<?php echo $Latest_RPM_Client_src; ?>.src.rpm" class="normal">FTP</a></td>
-  <td class="sources" align="center"><a href="download/client/rpm/SRPMS/silc-client-<?php echo $Latest_RPM_Client_src; ?>.src.rpm.md5" class="normal">MD5</a></td>
- </tr>
- <tr>
-  <td class="sources">&nbsp;Sources</td>
-  <td class="sources">&nbsp;deb-src (<a href="txt/debian.release.txt" class="normal">release notes</a>)</td>
-  <td class="sources" align="center"><?php echo $Latest_DEB_Client_src; ?></td>
-  <td class="sources" align="right"><?php echo div(FileSizeDEB("client",$Latest_DEB_Client_Base,$Latest_DEB_Client_src),1024); ?> kB&nbsp;</td>
-  <td class="sources" align="center"><a href="download/client/deb/<?php echo $Latest_DEB_Client_Base; ?>/" class="normal">HTTP</a></td>
-  <td class="sources" align="center"><a href="ftp://<?php echo $FTP_Site.$FTP_Root ?>/client/deb/<?php echo $Latest_DEB_Client_Base; ?>/" class="normal">FTP</a></td>
-  <td class="sources" align="center"><a href="download/client/deb/<?php echo $Latest_DEB_Client_Base."/silc-client_".$Latest_DEB_Client_src; ?>_i386.changes" class="normal">MD5</a></td>
- </tr>
- <tr>
-  <td class="sources">&nbsp;Sources</td>
-  <td class="sources">&nbsp;NetBSD pkgsrc</td>
-  <td class="sources" align="center"><?php echo $Latest_NetBSD_Client_src; ?></td>
-  <td class="sources" align="right"><?php echo div(FileSize("download/client/netbsd/pkgsrc/silc-client-".$Latest_NetBSD_Client_src.".tar.gz"),1024); ?> kB&nbsp;</td>
-  <td class="sources" align="center"><a href="download/client/netbsd/pkgsrc/silc-client-<?php echo $Latest_NetBSD_Client_src; ?>.tar.gz" class="normal">HTTP</a></td>
-  <td class="sources" align="center"><a href="ftp://<?php echo $FTP_Site.$FTP_Root ?>/client/netbsd/pkgsrc/silc-client-<?php echo $Latest_NetBSD_Client_src; ?>.tar.gz" class="normal">FTP</a></td>
-  <td class="sources" align="center"><a href="download/client/netbsd/pkgsrc/silc-client-<?php echo $Latest_NetBSD_Client_src; ?>.tar.gz.md5" class="normal">MD5</a></td>
- </tr>
- <tr>
-  <td class="sources">&nbsp;Sources</td>
-  <td class="sources">&nbsp;OpenBSD ports</td>
-  <td class="sources" align="center"><?php echo $Latest_OpenBSD_Client_src; ?></td>
-  <td class="sources" align="right"><?php echo div(FileSize("download/client/openbsd/ports/silc-client-".$Latest_OpenBSD_Client_src.".tar.gz"),1024); ?> kB&nbsp;</td>
-  <td class="sources" align="center"><a href="download/client/openbsd/ports/silc-client-<?php echo $Latest_OpenBSD_Client_src; ?>.tar.gz" class="normal">HTTP</a></td>
-  <td class="sources" align="center"><a href="ftp://<?php echo $FTP_Site.$FTP_Root ?>/client/openbsd/ports/silc-client-<?php echo $Latest_OpenBSD_Client_src; ?>.tar.gz" class="normal">FTP</a></td>
-  <td class="sources" align="center"><a href="download/client/openbsd/ports/silc-client-<?php echo $Latest_OpenBSD_Client_src; ?>.tar.gz.md5" class="normal">MD5</a></td>
- </tr>
- <tr>
-  <td class="binaries">&nbsp;Binaries</td>
-  <td class="binaries">&nbsp;RPM GNU/Linux i386 (<a href="txt/rpm-release-notes.html" class="normal">release notes</a>)</td>
-  <td class="binaries" align="center"><?php echo $Latest_RPM_Client; ?></td>
-  <td class="binaries" align="right"><?php echo div(FileSize("download/client/rpm/i386/silc-client-".$Latest_RPM_Client.".i386.rpm"),1024); ?> kB&nbsp;</td>
-  <td class="binaries"  align="center"><a href="download/client/rpm/i386/silc-client-<?php echo $Latest_RPM_Client; ?>.i386.rpm" class="normal">HTTP</a></td>
-  <td class="binaries" align="center"><a href="ftp://<?php echo $FTP_Site.$FTP_Root ?>/client/rpm/i386/silc-client-<?php echo $Latest_RPM_Client; ?>.i386.rpm" class="normal">FTP</a></td>
-  <td class="binaries"  align="center"><a href="download/client/rpm/i386/silc-client-<?php echo $Latest_RPM_Client; ?>.i386.rpm.md5" class="normal">MD5</a></td>
- </tr>
- <tr>
-  <td class="binaries">&nbsp;Binaries</td>
-  <td class="binaries">&nbsp;Debian GNU/Linux i386 (<a href="txt/debian.release.txt" class="normal">release notes</a>)</td>
-  <td class="binaries" align="center"><?php echo $Latest_DEB_Client; ?></td>
-  <td class="binaries" align="right"><?php echo div(FileSize("download/client/deb/".$Latest_DEB_Client_Base."/silc-client_".$Latest_DEB_Client."_i386.deb"),1024); ?> kB&nbsp;</td>
-  <td class="binaries"  align="center"><a href="download/client/deb/<?php echo $Latest_DEB_Client_Base."/silc-client_".$Latest_DEB_Client ?>_i386.deb" class="normal">HTTP</a></td>
-  <td class="binaries" align="center"><a href="ftp://<?php echo $FTP_Site.$FTP_Root ?>/client/deb/<?php echo $Latest_DEB_Client_Base."/silc-client_".$Latest_DEB_Client ?>_i386.deb" class="normal">FTP</a></td>
-  <td class="binaries" align="center"><a href="download/client/deb/<?php echo $Latest_DEB_Client_Base."/silc-client_".$Latest_DEB_Client; ?>_i386.changes" class="normal">MD5</a></td>
- </tr>
- <tr>
-  <td class="binaries">&nbsp;Binaries</td>
-  <td class="binaries">&nbsp;PKG Solaris 8 SPARC</td>
-  <td class="binaries" align="center"><?php echo $Latest_Solaris_Client; ?></td>
-  <td class="binaries" align="right"><?php echo div(FileSize("download/client/solaris/SPARC/SILCclie-".$Latest_Solaris_Client."-sol8-sparc-local.gz"),1024); ?> kB&nbsp;</td>
-  <td class="binaries"  align="center"><a href="download/client/solaris/SPARC/SILCclie-<?php echo $Latest_Solaris_Client; ?>-sol8-sparc-local.gz" class="normal">HTTP</a></td>
-  <td class="binaries" align="center"><a href="ftp://<?php echo $FTP_Site.$FTP_Root ?>/client/solaris/SPARC/SILCclie-<?php echo $Latest_Solaris_Client; ?>-sol8-sparc-local.gz" class="normal">FTP</a></td>
-  <td class="binaries"  align="center"><a href="download/client/solaris/SPARC/SILCclie-<?php echo $Latest_Solaris_Client; ?>-sol8-sparc-local.gz.md5" class="normal">MD5</a></td>
- </tr>
- <tr>
-  <td class="binaries">&nbsp;Binaries</td>
-  <td class="binaries">&nbsp;EXE Windows/Cygwin</td>
-  <td class="binaries" align="center"><?php echo $Latest_Windows_Client; ?></td>
-  <td class="binaries" align="right"><?php echo div(FileSize("download/client/cygwin/silc-".$Latest_Windows_Client.".exe.zip"),1024); ?> kB&nbsp;</td>
-  <td class="binaries"  align="center"><a href="download/client/cygwin/silc-<?php echo $Latest_Windows_Client; ?>.exe.zip" class="normal">HTTP</a></td>
-  <td class="binaries" align="center"><a href="ftp://<?php echo $FTP_Site.$FTP_Root ?>/client/cygwin/silc-<?php echo $Latest_Windows_Client; ?>.exe.zip" class="normal">FTP</a></td>
-  <td class="binaries"  align="center"><a href="download/client/cygwin/silc-<?php echo $Latest_Windows_Client; ?>.exe.zip.md5" class="normal">MD5</a></td>
- </tr>
- <tr>
-  <td colspan="7" class="text">
-&nbsp;<br />
-The SILC Client package is also available in official package bases in <a href="http://www.freebsd.org/ports/" class="normal">FreeBSD</a> (<a href="http://www.freebsd.org/cgi/cvsweb.cgi/ports/net/silc-client/" class="normal">ports/net/silc-client/</a>) and <a href="http://netbsd.org/Documentation/software/packages.html" class="normal">NetBSD</a> (<a href="http://cvsweb.netbsd.org/bsdweb.cgi/pkgsrc/chat/silc-client/" class="normal">pkgsrc/chat/silc-client/</a>).
-  </td>
- </tr>
-</table>
-
-<br />&nbsp;<br />
-
-
-<table width="600" cellspacing="2" cellpadding="2" border="0">
- <tr>
-  <td colspan="7" class="text">
-
-<b>SILC Server</b>
-<br />&nbsp;<br />
-<b>The latest version of the SILC server is <?php echo $Latest_Server; ?></b>
-<br />&nbsp;<br />
-The SILC Server package is intended for system administrators who wants to 
-setup their own SILC server or router. The package includes only the 
-server and not the client. People who is running SILC servers and are 
-interested to get the server linked to the new router on silc.silcnet.org 
-contact <a href="mailto:priikone at silcnet.org" class="normal">me</a> now.
-<br />&nbsp;<br />
-
-  </td>
- </tr>
- <tr>
-  <td class="title340" colspan="2" align="center"><b>Package</b></td>
-  <td class="title50" align="center"><b>Version</b></td>
-  <td class="title60" align="center"><b>Size</b></td>
-  <td class="title100" colspan="2" align="center"><b>URL</b></td>
-  <td class="title50" align="center"><b>SUM</b></td>
- </tr>
- <tr>
-  <td class="sources60">&nbsp;Sources</td>
-  <td class="sources280">&nbsp;tar.gz</td>
-  <td class="sources50" align="center"><?php echo $Latest_Server; ?></td>
-  <td class="sources60" align="right"><?php echo div(FileSize("download/server/sources/silc-server-".$Latest_Server.".tar.gz"),1024); ?> kB&nbsp;</td>
-  <td class="sources50" align="center"><a href="download/server/sources/silc-server-<?php echo $Latest_Server; ?>.tar.gz" class="normal">HTTP</a></td>
-  <td class="sources50" align="center"><a href="ftp://<?php echo $FTP_Site.$FTP_Root ?>/server/sources/silc-server-<?php echo $Latest_Server; ?>.tar.gz" class="normal">FTP</a></td>
-  <td class="sources50" align="center"><a href="download/server/sources/silc-server-<?php echo $Latest_Server; ?>.tar.gz.md5" class="normal">MD5</a></td>
- </tr>
- <tr>
-  <td class="sources">&nbsp;Sources</td>
-  <td class="sources">&nbsp;tar.bz2</td>
-  <td class="sources" align="center"><?php echo $Latest_Server; ?></td>
-  <td class="sources" align="right"><?php echo div(FileSize("download/server/sources/silc-server-".$Latest_Server.".tar.bz2"),1024); ?> kB&nbsp;</td>
-  <td class="sources" align="center"><a href="download/server/sources/silc-server-<?php echo $Latest_Server; ?>.tar.bz2" class="normal">HTTP</a></td>
-  <td class="sources" align="center"><a href="ftp://<?php echo $FTP_Site.$FTP_Root ?>/server/sources/silc-server-<?php echo $Latest_Server; ?>.tar.bz2" class="normal">FTP</a></td>
-  <td class="sources" align="center"><a href="download/server/sources/silc-server-<?php echo $Latest_Server; ?>.tar.bz2.md5" class="normal">MD5</a></td>
- </tr>
- <tr>
-  <td class="sources">&nbsp;Sources</td>
-  <td class="sources">&nbsp;SRPM</td>
-  <td class="sources" align="center"><?php echo $Latest_RPM_Server_src; ?></td>
-  <td class="sources" align="right"><?php echo div(FileSize("download/server/rpm/SRPMS/silc-server-".$Latest_RPM_Server_src.".src.rpm"),1024); ?> kB&nbsp;</td>
-  <td class="sources" align="center"><a href="download/server/rpm/SRPMS/silc-server-<?php echo $Latest_RPM_Server_src; ?>.src.rpm" class="normal">HTTP</a></td>
-  <td class="sources" align="center"><a href="ftp://<?php echo $FTP_Site.$FTP_Root ?>/server/rpm/SRPMS/silc-server-<?php echo $Latest_RPM_Server_src; ?>.src.rpm" class="normal">FTP</a></td>
-  <td class="sources" align="center"><a href="download/server/rpm/SRPMS/silc-server-<?php echo $Latest_RPM_Server_src; ?>.src.rpm.md5" class="normal">MD5</a></td>
- </tr>
- <tr>
-  <td class="sources">&nbsp;Sources</td>
-  <td class="sources">&nbsp;deb-src (<a href="txt/debian.release.txt" class="normal">release notes</a>)</td>
-  <td class="sources" align="center"><?php echo $Latest_DEB_Server_src; ?></td>
-  <td class="sources" align="right"><?php echo div(FileSizeDEB("server",$Latest_DEB_Server_Base,$Latest_DEB_Server_src),1024); ?> kB&nbsp;</td>
-  <td class="sources" align="center"><a href="download/server/deb/<?php echo $Latest_DEB_Server_Base; ?>/" class="normal">HTTP</a></td>
-  <td class="sources" align="center"><a href="ftp://<?php echo $FTP_Site.$FTP_Root ?>/server/deb/<?php echo $Latest_DEB_Server_Base; ?>/" class="normal">FTP</a></td>
-  <td class="sources" align="center"><a href="download/server/deb/<?php echo $Latest_DEB_Server_Base."/silc-server_".$Latest_DEB_Server; ?>_i386.changes" class="normal">MD5</a></td>
- </tr>
- <tr>
-  <td class="sources">&nbsp;Sources</td>
-  <td class="sources">&nbsp;NetBSD pkgsrc</td>
-  <td class="sources" align="center"><?php echo $Latest_NetBSD_Server_src; ?></td>
-  <td class="sources" align="right"><?php echo div(FileSize("download/server/netbsd/pkgsrc/silc-server-".$Latest_NetBSD_Server_src.".tar.gz"),1024); ?> kB&nbsp;</td>
-  <td class="sources" align="center"><a href="download/server/netbsd/pkgsrc/silc-server-<?php echo $Latest_NetBSD_Server_src; ?>.tar.gz" class="normal">HTTP</a></td>
-  <td class="sources" align="center"><a href="ftp://<?php echo $FTP_Site.$FTP_Root ?>/server/netbsd/pkgsrc/silc-server-<?php echo $Latest_NetBSD_Server_src; ?>.tar.gz" class="normal">FTP</a></td>
-  <td class="sources" align="center"><a href="download/server/netbsd/pkgsrc/silc-server-<?php echo $Latest_NetBSD_Server_src; ?>.tar.gz.md5" class="normal">MD5</a></td>
- </tr>
- <tr>
-  <td class="sources">&nbsp;Sources</td>
-  <td class="sources">&nbsp;OpenBSD ports</td>
-  <td class="sources" align="center"><?php echo $Latest_OpenBSD_Server_src; ?></td>
-  <td class="sources" align="right"><?php echo div(FileSize("download/server/openbsd/ports/silc-server-".$Latest_OpenBSD_Server_src.".tar.gz"),1024); ?> kB&nbsp;</td>
-  <td class="sources" align="center"><a href="download/server/openbsd/ports/silc-server-<?php echo $Latest_OpenBSD_Server_src; ?>.tar.gz" class="normal">HTTP</a></td>
-  <td class="sources" align="center"><a href="ftp://<?php echo $FTP_Site.$FTP_Root ?>/server/openbsd/ports/silc-server-<?php echo $Latest_OpenBSD_Server_src; ?>.tar.gz" class="normal">FTP</a></td>
-  <td class="sources" align="center"><a href="download/server/openbsd/ports/silc-server-<?php echo $Latest_OpenBSD_Server_src; ?>.tar.gz.md5" class="normal">MD5</a></td>
- </tr>
- <tr>
-  <td class="binaries">&nbsp;Binaries</td>
-  <td class="binaries">&nbsp;RPM GNU/Linux i386 (<a href="txt/rpm-release-notes.html" class="normal">release notes</a>)</td>
-  <td class="binaries" align="center"><?php echo $Latest_RPM_Server; ?></td>
-  <td class="binaries" align="right"><?php echo div(FileSize("download/server/rpm/i386/silc-server-".$Latest_RPM_Server.".i386.rpm"),1024); ?> kB&nbsp;</td>
-  <td class="binaries" align="center"><a href="download/server/rpm/i386/silc-server-<?php echo $Latest_RPM_Server; ?>.i386.rpm" class="normal">HTTP</a></td>
-  <td class="binaries" align="center"><a href="ftp://<?php echo $FTP_Site.$FTP_Root ?>/server/rpm/i386/silc-server-<?php echo $Latest_RPM_Server; ?>.i386.rpm" class="normal">FTP</a></td>
-  <td class="binaries" align="center"><a href="download/server/rpm/i386/silc-server-<?php echo $Latest_RPM_Server; ?>.i386.rpm.md5" class="normal">MD5</a></td>
-</tr>
- <tr>
-  <td class="binaries">&nbsp;Binaries</td>
-  <td class="binaries">&nbsp;Debian GNU/Linux i386 (<a href="txt/debian.release.txt" class="normal">release notes</a>)</td>
-  <td class="binaries" align="center"><?php echo $Latest_DEB_Server; ?></td>
-  <td class="binaries" align="right"><?php echo div(FileSize("download/server/deb/".$Latest_DEB_Server_Base."/silc-server_".$Latest_DEB_Server."_i386.deb"),1024); ?> kB&nbsp;</td>
-  <td class="binaries"  align="center"><a href="download/server/deb/<?php echo $Latest_DEB_Server_Base."/silc-server_".$Latest_DEB_Server ?>_i386.deb" class="normal">HTTP</a></td>
-  <td class="binaries" align="center"><a href="ftp://<?php echo $FTP_Site.$FTP_Root ?>/server/deb/<?php echo $Latest_DEB_Server_Base."/silc-server_".$Latest_DEB_Server ?>_i386.deb" class="normal">FTP</a></td>
-  <td class="binaries" align="center"><a href="download/server/deb/<?php echo $Latest_DEB_Server_Base."/silc-server_".$Latest_DEB_Server; ?>_i386.changes" class="normal">MD5</a></td>
- </tr>
- <tr>
-  <td colspan="7" class="text">
-&nbsp;<br />
-The SILC Server package is also available in official package bases in <a href="http://www.freebsd.org/ports/" class="normal">FreeBSD</a> (<a href="http://www.freebsd.org/cgi/cvsweb.cgi/ports/net/silc-server/" class="normal">ports/net/silc-server/</a>) and <a href="http://netbsd.org/Documentation/software/packages.html" class="normal">NetBSD</a> (<a href="http://cvsweb.netbsd.org/bsdweb.cgi/pkgsrc/chat/silc-server/" class="normal">pkgsrc/chat/silc-server/</a>).
-  </td>
- </tr>
-</table>
-
-<br />&nbsp;<br />
-
-<table width="600" cellspacing="2" cellpadding="2" border="0">
- <tr>
-  <td colspan="7" class="text">
-
-<b>SILC Toolkit</b>
-<br />&nbsp;<br />
-<b>The latest version of the SILC toolkit is <?php echo $Latest_Toolkit; ?></b>
-<br />&nbsp;<br />
-The SILC Toolkit package is intended for developers and programmers who 
-would like to create their own SILC applications or help in the 
-development of the SILC protocol. The Win32 binary package available 
-includes the entire Toolkit with sources and compiled DLLs.
-<br />&nbsp;<br />
-
-  </td>
- </tr>
- <tr>
-  <td class="title340" colspan="2" align="center"><b>Package</b></td>
-  <td class="title50" align="center"><b>Version</b></td>
-  <td class="title60" align="center"><b>Size</b></td>
-  <td class="title100" colspan="2" align="center"><b>URL</b></td>
-  <td class="title50" align="center"><b>SUM</b></td>
- </tr>
- <tr>
-  <td class="sources60">&nbsp;Sources</td>
-  <td class="sources280">&nbsp;tar.gz</td>
-  <td class="sources50" align="center"><?php echo $Latest_Toolkit; ?></td>
-  <td class="sources60" align="right"><?php echo div(FileSize("download/toolkit/sources/silc-toolkit-".$Latest_Toolkit.".tar.gz"),1024); ?> kB&nbsp;</td>
-  <td class="sources50" align="center"><a href="download/toolkit/sources/silc-toolkit-<?php echo $Latest_Toolkit; ?>.tar.gz" class="normal">HTTP</a></td>
-  <td class="sources50" align="center"><a href="ftp://<?php echo $FTP_Site.$FTP_Root ?>/toolkit/sources/silc-toolkit-<?php echo $Latest_Toolkit; ?>.tar.gz" class="normal">FTP</a></td>
-  <td class="sources50" align="center"><a href="download/toolkit/sources/silc-toolkit-<?php echo $Latest_Toolkit; ?>.tar.gz.md5" class="normal">MD5</a></td>
- </tr>
- <tr>
-  <td class="sources">&nbsp;Sources</td>
-  <td class="sources">&nbsp;tar.bz2</td>
-  <td class="sources" align="center"><?php echo $Latest_Toolkit; ?></td>
-  <td class="sources" align="right"><?php echo div(FileSize("download/toolkit/sources/silc-toolkit-".$Latest_Toolkit.".tar.bz2"),1024); ?> kB&nbsp;</td>
-  <td class="sources" align="center"><a href="download/toolkit/sources/silc-toolkit-<?php echo $Latest_Toolkit; ?>.tar.bz2" class="normal">HTTP</a></td>
-  <td class="sources" align="center"><a href="ftp://<?php echo $FTP_Site.$FTP_Root ?>/toolkit/sources/silc-toolkit-<?php echo $Latest_Toolkit; ?>.tar.bz2" class="normal">FTP</a></td>
-  <td class="sources" align="center"><a href="download/toolkit/sources/silc-toolkit-<?php echo $Latest_Toolkit; ?>.tar.bz2.md5" class="normal">MD5</a></td>
- </tr>
- <tr>
-  <td class="binaries">&nbsp;Binaries</td>
-  <td class="binaries">&nbsp;Win32</td>
-  <td class="binaries" align="center"><?php echo $Latest_Toolkit_Win32; ?></td>
-  <td class="binaries" align="right"><?php echo div(FileSize("download/toolkit/win32/silc-toolkit-".$Latest_Toolkit_Win32.".zip"),1024); ?> kB&nbsp;</td>
-  <td class="binaries" align="center"><a href="download/toolkit/win32/silc-toolkit-<?php echo $Latest_Toolkit_Win32 ?>.zip" class="normal">HTTP</a></td>
-  <td class="binaries" align="center"><a href="ftp://<?php echo $FTP_Site.$FTP_Root ?>/toolkit/win32/silc-toolkit-<?php echo $Latest_Toolkit_Win32; ?>.zip" class="normal">FTP</a></td>
-  <td class="binaries" align="center"><a href="download/toolkit/win32/silc-toolkit-<?php echo $Latest_Toolkit_Win32 ?>.zip.md5" class="normal">MD5</a></td>
- </tr>
-</table>
-
-<br />&nbsp;<br />
-
-<table width="600" cellspacing="2" cellpadding="2" border="0">
- <tr>
-  <td colspan="7" class="text">
-
-<b>CVS Snapshots</b>
-<br />&nbsp;<br />
-Daily CVS snapshots are available. These are generated 22:00 GMT every
-night.  Read the <a href="?page=cvs" class="normal">CVS page</a> for more
-information.
-<br />&nbsp;<br />
-
-  </td>
- </tr>
- <tr>
-  <td class="title340" colspan="2" align="center"><b>Package</b></td>
-  <td class="title50" align="center"><b>Version</b></td>
-  <td class="title60" align="center"><b>Size</b></td>
-  <td class="title100" colspan="2" align="center"><b>URL</b></td>
-  <td class="title50" align="center"><b>SUM</b></td>
- </tr>
- <tr>
-  <td class="sources60">&nbsp;Sources</td>
-  <td class="sources280">&nbsp;tar.gz CVS snapshot</td>
-  <td class="sources50" align="center">CVS</td>
-  <td class="sources60" align="right"><?php echo div(FileSize("download/cvs/silc.tar.gz"),1024); ?> kB&nbsp;</td>
-  <td class="sources50" align="center"><a href="download/cvs/silc.tar.gz" class="normal">HTTP</a></td>
-  <td class="sources50" align="center"><a href="ftp://<?php echo $FTP_Site.$FTP_Root ?>/cvs/silc.tar.gz" class="normal">FTP</a></td>
-  <td class="sources50" align="center"><a href="download/cvs/silc.tar.gz.md5" class="normal">MD5</a></td>
- </tr>
-</table>
-
-<table width="600" cellspacing="2" cellpadding="2" border="0">
- <tr>
-  <td class="text">
-
-<br />&nbsp;<br />
-<b>Portability</b>
-<br />&nbsp;<br />
-The SILC has been reported to work on, at least:
-<br />&nbsp;<br />
-&nbsp;- <a href="http://www.linux.org/" class="normal">GNU/Linux</a><br />
-&nbsp;- <a href="http://www.freebsd.org/" class="normal">FreeBSD</a><br />
-&nbsp;- <a href="http://www.netbsd.org/" class="normal">NetBSD</a><br />
-&nbsp;- <a href="http://www.openbsd.org/" class="normal">OpenBSD</a><br />
-&nbsp;- <a href="http://www.hp.com/products1/unix/operating/" class="normal">HP-UX</a><br />
-&nbsp;- <a href="http://www.sun.com/software/solaris/" class="normal">Solaris</a><br />
-&nbsp;- <a href="http://www.sgi.com/developers/technology/irix.html" class="normal">IRIX</a><br />
-&nbsp;- <a href="http://www.ibm.com/servers/aix/" class="normal">AIX</a><br />
-&nbsp;- <a href="http://www.microsoft.com/windows/" class="normal">Windows</a><br />
-&nbsp;- <a href="http://sources.redhat.com/cygwin/" class="normal">Cygwin</a> &amp; <a href="http://www.mingw.org/" class="normal">MinGW</a><br />
-&nbsp;- <a href="http://www.apple.com/macosx/" class="normal">Mac OS X</a>
-
-  </td>
- </tr>
-</table>
diff --git a/public_html/html/faq.php b/public_html/html/faq.php
deleted file mode 100644 (file)
index cb7bb7a..0000000
+++ /dev/null
@@ -1,1032 +0,0 @@
-&nbsp;<br />
-<b><big>Frequently Asked Questions</big></b>
-<br />&nbsp;<br />
-<a href="#f1_0" class="normal">1. General Questions</a><br />
- &nbsp;&nbsp;&nbsp;&nbsp;<a href="#f1_10" class="normal">
-1.1 What is SILC?</a><br />
- &nbsp;&nbsp;&nbsp;&nbsp;<a href="#f1_20" class="normal">
-1.2 When was SILC Project started?</a><br />
- &nbsp;&nbsp;&nbsp;&nbsp;<a href="#f1_30" class="normal">
-1.3 Why SILC in the first place?</a><br />
- &nbsp;&nbsp;&nbsp;&nbsp;<a href="#f1_40" class="normal">
-1.4 What license covers the SILC release?</a><br />
- &nbsp;&nbsp;&nbsp;&nbsp;<a href="#f1_50" class="normal">
-1.5 Why SILC? Why not IRC3?</a><br />
- &nbsp;&nbsp;&nbsp;&nbsp;<a href="#f1_55" class="normal">
-1.6 What platforms SILC supports?</a><br />
- &nbsp;&nbsp;&nbsp;&nbsp;<a href="#f1_59" class="normal">
-1.7 How do you pronounce SILC?</a><br />
- &nbsp;&nbsp;&nbsp;&nbsp;<a href="#f1_60" class="normal">
-1.8 Where can I find more information?</a><br />
- &nbsp;&nbsp;&nbsp;&nbsp;<a href="#f1_70" class="normal">
-1.9 I would like to help out, what can I do?</a>
-
-<br />&nbsp;<br />
-<a href="#f2_0" class="normal">2. Protocol Questions</a><br />
- &nbsp;&nbsp;&nbsp;&nbsp;<a href="#f2_10" class="normal">
-2.1 What is the status of SILC protocol in the IETF?</a><br />
- &nbsp;&nbsp;&nbsp;&nbsp;<a href="#f2_20" class="normal">
-2.2 How much the SILC protocol is based on IRC?</a><br />
- &nbsp;&nbsp;&nbsp;&nbsp;<a href="#f2_30" class="normal">
-2.3 Why use SILC? Why not IRC with SSL?</a><br />
- &nbsp;&nbsp;&nbsp;&nbsp;<a href="#f2_40" class="normal">
-2.4 Can I talk from SILC network to IRC network?</a><br />
- &nbsp;&nbsp;&nbsp;&nbsp;<a href="#f2_45" class="normal">
-2.5 Does SILC support file transfer?</a><br />
- &nbsp;&nbsp;&nbsp;&nbsp;<a href="#f2_46" class="normal">
-2.6 Does SILC support DCC or alike?</a><br />
- &nbsp;&nbsp;&nbsp;&nbsp;<a href="#f2_47" class="normal">
-2.7 I am behind a firewall, can I use SILC?</a><br />
- &nbsp;&nbsp;&nbsp;&nbsp;<a href="#f2_50" class="normal">
-2.8 How secure SILC really is?</a><br />
- &nbsp;&nbsp;&nbsp;&nbsp;<a href="#f2_60" class="normal">
-2.9 Does SILC support instant messaging?</a><br />
- &nbsp;&nbsp;&nbsp;&nbsp;<a href="#f2_70" class="normal">
-2.10 Why SILC does not have LINKS command like in IRC?</a><br />
- &nbsp;&nbsp;&nbsp;&nbsp;<a href="#f2_80" class="normal">
-2.11 What does the session detaching/resuming mean?</a><br />
- &nbsp;&nbsp;&nbsp;&nbsp;<a href="#f2_90" class="normal">
-2.12 Is anyone outside a channel able to see the channel messages?</a><br />
- &nbsp;&nbsp;&nbsp;&nbsp;<a href="#f2_95" class="normal">
-2.13 How can I register my channel in SILC?</a><br />
- &nbsp;&nbsp;&nbsp;&nbsp;<a href="#f2_100" class="normal">
-2.14 Is it true that all messages are encrypted in SILC?</a><br />
- &nbsp;&nbsp;&nbsp;&nbsp;<a href="#f2_110" class="normal">
-2.15 Can server or SILC operator gain operator mode on a channel?</a><br />
- &nbsp;&nbsp;&nbsp;&nbsp;<a href="#f2_120" class="normal">
-2.16 Channel name doesn't have #-character or does it?</a><br />
- &nbsp;&nbsp;&nbsp;&nbsp;<a href="#f2_130" class="normal">
-2.17 Does SILC support moderated channels?</a><br />
- &nbsp;&nbsp;&nbsp;&nbsp;<a href="#f2_140" class="normal">
-2.18 What does the "watching" mean?</a><br />
- &nbsp;&nbsp;&nbsp;&nbsp;<a href="#f2_150" class="normal">
-2.19 Is it possible to reject watching?</a><br />
- &nbsp;&nbsp;&nbsp;&nbsp;<a href="#f2_160" class="normal">
-2.20 Is it possible to block private messages?</a><br />
- &nbsp;&nbsp;&nbsp;&nbsp;<a href="#f2_170" class="normal">
-2.21 Is it possible to block channel messages?</a><br />
- &nbsp;&nbsp;&nbsp;&nbsp;<a href="#f2_180" class="normal">
-2.22 Is it possible to block invites?</a><br />
- &nbsp;&nbsp;&nbsp;&nbsp;<a href="#f2_190" class="normal">
-2.23 Does SILC support multimedia messages, like video/audio streaming?</a><br />
- &nbsp;&nbsp;&nbsp;&nbsp;<a href="#f2_200" class="normal">
-2.24 Is it possible to send picture/image messages?</a><br />
- &nbsp;&nbsp;&nbsp;&nbsp;<a href="#f2_205" class="normal">
-2.25 What kind of presence modes SILC support?</a><br />
- &nbsp;&nbsp;&nbsp;&nbsp;<a href="#f2_210" class="normal">
-2.26 Does SILC support anonymity?</a><br />
- &nbsp;&nbsp;&nbsp;&nbsp;<a href="#f2_220" class="normal">
-2.27 Does SILC support services?</a><br />
- &nbsp;&nbsp;&nbsp;&nbsp;<a href="#f2_230" class="normal">
-2.28 I have suggestions to SILC Protocol, what can I do?</a>
-
-<br />&nbsp;<br />
-<a href="#f3_0" class="normal">3. Client Questions</a><br />
- &nbsp;&nbsp;&nbsp;&nbsp;<a href="#f3_10" class="normal">
-3.1 Where can I find SILC clients?</a><br />
- &nbsp;&nbsp;&nbsp;&nbsp;<a href="#f3_20" class="normal">
-3.2 Can I use SILC with IRC client and vice versa?</a><br />
- &nbsp;&nbsp;&nbsp;&nbsp;<a href="#f3_25" class="normal">
-3.3 The default theme sucks, where can I find a better one?</a><br />
- &nbsp;&nbsp;&nbsp;&nbsp;<a href="#f3_30" class="normal">
-3.4 How do I send a private message?</a><br />
- &nbsp;&nbsp;&nbsp;&nbsp;<a href="#f3_40" class="normal">
-3.5 How do I negotiate secret key with another user?</a><br />
- &nbsp;&nbsp;&nbsp;&nbsp;<a href="#f3_50" class="normal">
-3.6 How do I negotiate secret keys behind a NAT?</a><br />
- &nbsp;&nbsp;&nbsp;&nbsp;<a href="#f3_60" class="normal">
-3.7 How do I change channel modes?</a><br />
- &nbsp;&nbsp;&nbsp;&nbsp;<a href="#f3_70" class="normal">
-3.8 What does the founder mode on channel mean, and how do I set it?</a><br />
- &nbsp;&nbsp;&nbsp;&nbsp;<a href="#f3_80" class="normal">
-3.9 I am founder of invite only channel, how can I join the channel after I have left it?</a><br />
- &nbsp;&nbsp;&nbsp;&nbsp;<a href="#f3_90" class="normal">
-3.10 How can I op or deop somebody on channel?</a><br />
- &nbsp;&nbsp;&nbsp;&nbsp;<a href="#f3_100" class="normal">
-3.11 How do I set private key for channel, and what does that mean exactly?</a><br />
- &nbsp;&nbsp;&nbsp;&nbsp;<a href="#f3_110" class="normal">
-3.12 How do I transfer a file?</a><br />
- &nbsp;&nbsp;&nbsp;&nbsp;<a href="#f3_120" class="normal">
-3.13 How can I get other users public keys?</a><br />
- &nbsp;&nbsp;&nbsp;&nbsp;<a href="#f3_130" class="normal">
-3.14 How can I see the fingerprint of my public key?</a><br />
- &nbsp;&nbsp;&nbsp;&nbsp;<a href="#f3_140" class="normal">
-3.15 I gave WHOIS to a nick, and it returned multiple replies, why?</a><br />
- &nbsp;&nbsp;&nbsp;&nbsp;<a href="#f3_150" class="normal">
-3.16 Is there a command to see all linked servers?</a><br />
- &nbsp;&nbsp;&nbsp;&nbsp;<a href="#f3_160" class="normal">
-3.17 How do I list the users of a channel?</a><br />
- &nbsp;&nbsp;&nbsp;&nbsp;<a href="#f3_170" class="normal">
-3.18 What is the difference between OPER and SILCOPER commands?</a><br />
- &nbsp;&nbsp;&nbsp;&nbsp;<a href="#f3_180" class="normal">
-3.19 My Cygwin client crashes with message "Couldn't create //.silc directory"</a><br />
- &nbsp;&nbsp;&nbsp;&nbsp;<a href="#f3_190" class="normal">
-3.20 Why /join #silc and /join silc doesn't join the same channel?</a><br />
- &nbsp;&nbsp;&nbsp;&nbsp;<a href="#f3_200" class="normal">
-3.21 How do I detach my session from the server?</a>
-
-<br />&nbsp;<br />
-<a href="#f4_0" class="normal">4. Server Questions</a><br />
- &nbsp;&nbsp;&nbsp;&nbsp;<a href="#f4_10" class="normal">
-4.1 Where can I find SILC servers?</a><br />
- &nbsp;&nbsp;&nbsp;&nbsp;<a href="#f4_20" class="normal">
-4.2 Can I run my own SILC server?</a><br />
- &nbsp;&nbsp;&nbsp;&nbsp;<a href="#f4_30" class="normal">
-4.3 What is the difference between SILC server and SILC router?</a><br />
- &nbsp;&nbsp;&nbsp;&nbsp;<a href="#f4_40" class="normal">
-4.4 Why server says permission denied to write to a log file?</a><br />
- &nbsp;&nbsp;&nbsp;&nbsp;<a href="#f4_50" class="normal">
-4.5 When I connect to to my server, it says "server does not support one of your proposed cipher", what is wrong?</a><br />
- &nbsp;&nbsp;&nbsp;&nbsp;<a href="#f4_60" class="normal">
-4.6 Why SILC server runs on privileged port 706?</a><br />
- &nbsp;&nbsp;&nbsp;&nbsp;<a href="#f4_70" class="normal">
-4.7 I see [Unknown] in the log file, what does it mean?</a><br />
- &nbsp;&nbsp;&nbsp;&nbsp;<a href="#f4_80" class="normal">
-4.8 How can I generate a new server key pair?</a>
-
-<br />&nbsp;<br />
-<a href="#f5_0" class="normal">5. Toolkit Questions</a><br />
- &nbsp;&nbsp;&nbsp;&nbsp;<a href="#f5_10" class="normal">
-5.1 What is SILC Toolkit?</a><br />
- &nbsp;&nbsp;&nbsp;&nbsp;<a href="#f5_20" class="normal">
-5.2 Is the SILC Toolkit Reference Manual Available?</a><br />
- &nbsp;&nbsp;&nbsp;&nbsp;<a href="#f5_30" class="normal">
-5.3 How do I compile the Toolkit on Unix?</a><br />
- &nbsp;&nbsp;&nbsp;&nbsp;<a href="#f5_40" class="normal">
-5.4 How do I compile the Toolkit on Win32?</a><br />
- &nbsp;&nbsp;&nbsp;&nbsp;<a href="#f5_50" class="normal">
-5.5 Does the Toolkit package include any sample code?</a><br />
-<br />&nbsp;<br />
-
-
-<a name="f1_0"></a>
-<b>1. General Questions</b><br />&nbsp;<br />
-
-<a name="f1_10"></a>
-<samp class="highlight">Q: What is SILC?</samp><br />
-A: SILC (Secure Internet Live Conferencing) is a protocol which provides
-secure conferencing services in the Internet over insecure channel. SILC
-is IRC like although internally they are very different. Biggest
-similarity between SILC and IRC is that they both provide conferencing
-services and that SILC has almost same commands as IRC. Other than that
-they are nothing alike.
-<br />&nbsp;<br />
-Biggest differences are that SILC is secure what IRC is not in any way.
-The network model is also entirely different compared to IRC.
-<br />&nbsp;<br />
-
-<a name="f1_20"></a>
-<samp class="highlight">Q: When was SILC Project started?</samp><br />
-A: The SILC development started in 1996 and early 1997. But, for various 
-reasons it suspended many times until it finally got some wind under its 
-wings in 1999. First public release was in summer 2000.
-<br />&nbsp;<br />
-
-<a name="f1_30"></a>
-<samp class="highlight">Q: Why SILC in the first place?</samp><br />
-A: Simply for fun, nothing more. And actually for need back in the days
-when it was started. When SILC was first developed there really did not 
-exist anything like this. SILC has been very interesting and educational 
-project.
-<br />&nbsp;<br />
-
-<a name="f1_40"></a>
-<samp class="highlight">Q: What license covers the SILC release?</samp><br />
-A: The SILC software developed here at silcnet.org, the SILC Client, the 
-SILC Server and the SILC Toolkit are covered by the GNU General Public 
-License.
-<br />&nbsp;<br />
-
-<a name="f1_50"></a>
-<samp class="highlight">Q: Why SILC? Why not IRC3?</samp><br />
-A: Question that is justified no doubt of that. SILC was not started to 
-become a replacement for IRC. SILC was something that didn't exist in 1996 
-or even today except that SILC is now released. However, I did check out 
-the IRC3 project in 1997 when I started coding and planning the SILC protocol.
-<br />&nbsp;<br />
-But, IRC3 is problematic. Why? Because it still doesn't exist. The
-project is almost at the same spot where it was in 1997 when I checked it 
-out. And it was old project back then as well. That's the problem of IRC3 
-project. The same almost happened to SILC as well as I wasn't making real 
-progress over the years. I talked to the original author of IRC, Jarkko 
-Oikarinen, in 1997 and he directed me to the IRC3 project, although he 
-said that IRC3 is a lot of talking and not that much of anything else. I 
-am not trying to put down the IRC3 project but its problem is that no one 
-in the project is able to make a decision what is the best way to go about
-making the IRC3 and I wasn't going to be part of that. The fact is that
-if I would've gone to IRC3 project, nor IRC3 or SILC would exist today. I
-think IRC3 could be something really great if they just would get their
-act together and start coding the thing.
-<br />&nbsp;<br />
-
-<a name="f1_55"></a>
-<samp class="highlight">Q: What platforms SILC supports?</samp><br />
-A: The SILC Client is available on various Unix systems and is reported to 
-work under cygwin on Windows. The SILC Server also works on various Unix 
-systems. However, the server has not been tested under cygwin as far as we 
-know. The SILC Toolkit is distributed for all platforms, Unix, Cygwin 
-and native Windows.
-<br />&nbsp;<br />
-
-<a name="f1_59"></a>
-<samp class="highlight">Q: How do you pronounce SILC?</samp><br />
-A: SILC is usually pronounced as `silk', but you are free to pronounce
-it the way you want.
-<br />&nbsp;<br />
-
-<a name="f1_60"></a>
-<samp class="highlight">Q: Where can I find more information?</samp><br />
-A: For more technical information we suggest reading the SILC Protocol 
-specifications. You might also want to take a look at the <a 
-href="?page=docs" class="normal">documentation </a> page on the web page.
-<br />&nbsp;<br />
-
-<a name="f1_70"></a>
-<samp class="highlight">Q: I would like to help out, what can I do?</samp><br />
-A: You might want to take a look at the <a 
-href="?page=contribute" class="normal">Contributing</a> page and the <a 
-href="?page=todo" class="normal">TODO</a> list. You might also want to join the
-SILC development mailing list.
-<br />&nbsp;<br />
-
-
-<a name="f2_0"></a><br />
-<b>2. Protocol Questions</b><br />&nbsp;<br />
-
-<a name="f2_10"></a>
-<samp class="highlight">Q: What is the status of SILC protocol in the IETF?</samp><br />
-A: The SILC protocol specifications has been submitted currently as 
-individual submissions. There does not currently exist a working group 
-for this sort of project. Our goal is to fully standardize the SILC and 
-thus submit it as RFC to the <a href="http://www.ietf.org/" class="normal">
-IETF</a> at a later time.  This can happen only after we have requested
-the IETF to accept SILC as RFC.  As of today, we have not yet even requested
-this from the IETF.  We want to let the protocol mature a bit more.
-<br />&nbsp;<br />
-
-<a name="f2_20"></a>
-<samp class="highlight">Q: How much SILC Protocol is based on IRC?</samp><br />
-A: SILC is not based on IRC. The client superficially resembles IRC 
-client but everything that happens under the hood is nothing alike IRC. 
-SILC could *never* support IRC because the entire network toppology is 
-different (hopefully more scalable and powerful). So no, SILC protocol 
-(client or server) is not based on IRC. Instead, We've taken good things 
-from IRC and left all the bad things behind and not even tried to burden 
-the SILC with the IRCs problems that will burden IRC and future IRC 
-projects till the end. SILC client resembles IRC client because it is 
-easier for new users to start using SILC when they already know all the 
-commands.
-<br />&nbsp;<br />
-
-<a name="f2_30"></a>
-<samp class="highlight">Q: Why use SILC? Why not IRC with SSL?</samp><br />
-A: Sure, that is possible, although, does that secure the entire IRC
-network? And does that increase or decrease the lags and splits in the 
-IRC network? Does that provide user based security where some specific 
-private message are secured? Does that provide security where some 
-specific channel messages are secured? And I know, you can answer yes to 
-some of these questions. But, security is not just about applying 
-encryption to traffic and SILC is not just about `encrypting the 
-traffic`. You cannot make insecure protocol suddenly secure just by 
-encrypting the traffic. SILC is not meant to be IRC replacement. IRC is 
-good for some things, SILC is good for same and some other things.
-<br />&nbsp;<br />
-
-<a name="f2_40"></a>
-<samp class="highlight">Q: Can I talk from SILC network to IRC network?</samp><br />
-A: Simple answer for this is No. The protocols are not compatible which 
-makes it impossible to directly talk from SILC network to IRC network or 
-vice versa. Developing a gateway between these two networks would 
-technically be possible but from security point of view strongly not 
-recommended. We have no plans for developing such a gateway.
-<br />&nbsp;<br />
-
-<a name="f2_45"></a>
-<samp class="highlight">Q: Does SILC support file transfer?</samp><br />
-A: Yes.  The SILC protocol support SFTP as mandatory file transfer 
-protocol.  It provides simple client to client file transfer, but also
-a possibility for file and directory manipulation.  Even though the SFTP
-is the file transfer protocol the support for file transferring has been 
-done so that practically any file transfer protocol may be used with SILC 
-protocol.
-<br />&nbsp;<br />
-
-<a name="f2_46"></a>
-<samp class="highlight">Q: Does SILC support DCC or alike?</samp><br />
-A: SILC does not support the DCC commonly used in IRC.  It does not need 
-it since it has builtin support for same features that DCC have.  You can 
-transfer files securely and encrypted directly with another client.  You 
-can also negotiate secret key material with another client directly to 
-use it in private message encryption.  The private messages are not, 
-however sent directly between clients.  The protocol, on the other hand 
-does not prohibit sending messages directly between clients if the 
-implementation would support it.  The current SILC Client implementation 
-does not support it.  This means that private messages travel through the 
-SILC Network.  SILC protocol also has a capability to support DCC 
-and CTCP like protocols with SILC.  None of them, however have not been 
-defined to be used with SILC at the present time.
-<br />&nbsp;<br />
-
-<a name="f2_47"></a>
-<samp class="highlight">Q: I am behind a firewall, can I use SILC?</samp><br />
-A: Yes. If your network administrator can open the remote port 706 (TCP) you
-can use SILC without problems. You may also compile your SILC client with 
-SOCKS support which will proxy your SILC session through the firewall.
-<br />&nbsp;<br />
-
-<a name="f2_50"></a>
-<samp class="highlight">Q: How secure SILC really is?</samp><br />
-A: We have tried to make SILC as secure as possible. However, there is
-no security protocol or security software that has not been vulnerable to
-some sort of attacks. SILC is in no means different from this. So, it is
-suspected that there are security holes in the SILC. These holes just need
-to be found so that they can be fixed.  SILC's security features has been
-developed from attacker's point of view, and we've tried to find all the
-possible attacks and guard the protocol against them.
-<br />&nbsp;<br />
-But to give you some parameters of security SILC uses the most secure
-crytographic algorithms such as AES (Rijndael), Twofish, Blowfish, RC5,
-etc. SILC does not have DES or 3DES as DES is insecure and 3DES is just
-too slow. SILC also uses cryptographically strong random number generator
-when it needs random numbers. Public key cryptography uses RSA (PKCS #1)
-and Diffie-Hellman algorithms. Key lengths for ciphers are initially set
-to 256. For public key algorithms the starting key length is 1024 bits.
-<br />&nbsp;<br />
-But the best answer for this question is that SILC is as secure as its
-weakest link. SILC is open and the protocol is open and in public thus
-open for security analysis.
-<br />&nbsp;<br />
-To give a list of attacks that are ineffective against SILC:
-<br />&nbsp;<br />
-- Man-in-the-middle attacks are ineffective if proper public key
-infrastructure is used, and if all public keys are always verified.<br />
-- IP spoofing is ineffective (because of encryption and trusted keys).<br />
-- Attacks that change the contents of the data or add extra data to the
-packets are ineffective (because of encryption and integrity checks).<br />
-- Passive attacks (listenning network traffic) are ineffective (because
-of encryption). Everything is encrypted including authentication data
-such as passwords when they are needed.<br />
-- Any sort of cryptanalytic attacks are tried to make ineffective by
-using the best cryptographic algorithms out there, and by designing the
-protocol to guard against them.
-<br />&nbsp;<br />
-
-<a name="f2_60"></a>
-<samp class="highlight">Q: Does SILC support instant messaging?</samp><br />
-A: Officially SILC is not an instant message (IM) system as people usually
-understands it.  However, SILC supports many of the features that are 
-found in traditional IM systems.  SILC can be implemented in either 
-IRC-style or IM-style system.  Features that are usually found only in IM 
-systems, such as multiple presence settings, persistent sessions etc. are 
-also found in SILC.
-<br />&nbsp;<br />
-
-<a name="f2_70"></a>
-<samp class="highlight">Q: Why SILC does not have LINKS command like in 
-IRC?</samp><br />
-A: It was felt that this information as an own command in SILC is not 
-necessary.  Moreover, the topology of the network might be undisclosed 
-information even though the servers and routers in the network are still 
-open. We feel that the network topology information, if it is wanted to be 
-public, and the list of accessible servers can be made available in other 
-ways than providing command like LINKS, which shows the active server 
-links in IRC.
-<br />&nbsp;<br />
-
-<a name="f2_80"></a>
-<samp class="highlight">Q: What does the session detaching/resuming 
-mean?</samp><br />
-A: The new SILC protocol supports a feature called session detachment. 
-This means that client can detach from the server by giving a DETACH 
-command, but still remain as valid user in the network.  The connection is 
-lost to the server but the user remains in the network.  User can then 
-resume the session back next time it connects a server in the network, and 
-be like he was never gone.
-<br />&nbsp;<br />
-This feature clearly could be used in many cases.  For example, if you 
-want to upgrade your current SILC client, you do not have to quit the 
-network anymore.  You just give DETACH command and still remain in the 
-network.  Then you upgrade your client and reconnect to the server and 
-continue business as is.  If somebody gives WHOIS command to your nickname 
-he will see that you are detached.  Messages that are sent to you when you 
-are detached are dropped by the server.  Nice thing about this feature is 
-also that you can resume the session from any server in the network; you 
-do not have to reconnect to the same server you originally were connected 
-to.
-<br />&nbsp;<br />
-
-<a name="f2_90"></a>
-<samp class="highlight">Q: Is anyone outside a channel able to see the channel 
-messages?</samp><br />
-A: A short answer is simply No.  A longer answer involves assumptions 
-about security conditions.  Initially channel keys are generated by the 
-server, so if the server would get compromised it would be possible for 
-an adversary to see the messages.  However, users on the channel can 
-prevent this even if the server would be compromised.  It is possible to 
-set so called channel private key that only the users on the channel 
-know about.  The servers does not know about the key, and therefore cannot 
-see the messages even if they would be compromised.  So, longer answer 
-results into same as the short one; No.
-<br />&nbsp;<br />
-
-<a name="f2_95"></a>
-<samp class="highlight">Q: How can I register my channel in SILC?</samp><br />
-A: There is not a channel registering service in SILC.  However, SILC does 
-support permanent channels.  When you join a non-existing channel for the 
-first time you will become the founder of the channel.  You can then set a 
-special founder mode on the channel which makes the channel permanent.  
-When the last user leaves the channel when this mode is set, the channel 
-will not be destroyed.  If the founder mode is not set, then empty 
-channels will be destroyed automatically.  When the founder mode is set 
-and you leave the channel you can also reclaim the founder rights back on 
-the channel next time you join it. (see also 
-<a href="#f3_70" class="normal">
-Q: What does the founder mode on channel mean, and how do I set it?</a> and
-<a href="#f3_80" class="normal">
-Q: I am founder of invite only channel, how can I join the channel after
-I have left it?</a>).  You can call this channel registering if you want.
-<br />&nbsp;<br />
-
-<a name="f2_100"></a>
-<samp class="highlight">Q: Is it true that all messages are encrypted in SILC?</samp><br />
-A: Most definitely yes.  The SILC protocol makes it impossible to send
-unencrypted messages or packets to the SILC network.  All messages are
-always encrypted, either using session keys, or other secret keys such as
-channel keys or private message keys.
-<br />&nbsp;<br />
-
-<a name="f2_110"></a>
-<samp class="highlight">Q: Can server or SILC operator gain operator mode on a channel?</samp><br />
-A: They cannot get operator status, founder status, join invite only channels,
-escape active bans, escape user limits or anything alike, without explicitly
-being allowed.  Only way to get channel operator status is that someone
-ops him.  Server and SILC operators in the network are normal users with
-the extra privileges of being able to adminstrate their server.  They cannot
-do anything more than a normal user.
-<br />&nbsp;<br />
-
-<a name="f2_120"></a>
-<samp class="highlight">Q: Channel name doesn't have #-character or does it?</samp><br />
-A: The #-character is not mandatory part of channel name, like it is in 
-IRC.  This means that giving the command /JOIN #silc and /JOIN silc 
-will join to different channels.  This is intentional since the 
-#-character clearly is IRC feature and has nothing to do with SILC.  If 
-you want it to have the character then just join to the channel with 
-#-character in the name.
-<br />&nbsp;<br />
-
-<a name="f2_130"></a>
-<samp class="highlight">Q: Does SILC support moderated channels?</samp><br />
-A: Yes.  Channel founder can moderate both normal users and channel 
-operators so that they cannot talk on the channel.  It is also possible to 
-queit one specific user on the channel if needed.
-<br />&nbsp;<br />
-
-<a name="f2_140"></a>
-<samp class="highlight">Q: What does the "watching" mean?</samp><br />
-A: You can set a "watch" list for yourself in the server.  This means that 
-you can watch for certain nicknames in the network.  For example, if you 
-add a nickname "foo" to the watch list you will be notified when the foo 
-logins to the network, leaves the network, changes its user mode or 
-changes its nickname.  This way you can watch for example when does you 
-friend login to the network.
-<br />&nbsp;<br />
-
-<a name="f2_150"></a>
-<samp class="highlight">Q: Is it possible to reject watching?</samp><br />
-A: Yes.  Since it is clear that not everyone wants to be spied on you can 
-set a mode for yourself which rejects watching you.  Even if someone is 
-watching the nickname you have, your logins, logoffs, mode changes or 
-nickname changes will not be notified to the watcher.
-<br />&nbsp;<br />
-
-<a name="f2_160"></a>
-<samp class="highlight">Q: Is it possible to block private  
-messages?</samp><br />
-A: Yes.  You can block incoming private messages by setting a mode that 
-prevents unwanted private messages.  Only the private messages that are 
-secured with a private message key are delivered to you.  This implies 
-that you have negotiated the private key with the sender of the message, 
-and therefore want to receive messages from that user.  Other private 
-messages that are secured with normal session keys are dropped when the 
-mode is set.
-<br />&nbsp;<br />
-
-<a name="f2_170"></a>
-<samp class="highlight">Q: Is it possible to block channel
-messages?</samp><br />
-A: Yes it is.  By setting a mode that accomplishes this you can prevent 
-the server of sending any channel messages to you.  There is also a mode
-that allows blocking channel messages from normal users.  This means that 
-you will receive channel messages only when it is sent by channel operator 
-or channel founder.  It is also possible to block channel messages sent by 
-robots.  A user on the channel can have a robot mode set (which means that 
-the user is actually a robot program), and messages sent from that user 
-can be blocked with the mode.
-<br />&nbsp;<br />
-
-<a name="f2_180"></a>
-<samp class="highlight">Q: Is it possible to block invites?</samp><br />
-A: It sure is.  You can set a mode that prevents the server of sending 
-invite notifications to you.  This can for example prevent invite 
-flooding.  The downside is that it may make joining to a invite only 
-channels a bit harder.
-<br />&nbsp;<br />
-
-<a name="f2_190"></a>
-<samp class="highlight">Q: Does SILC support multimedia messages, like 
-video/audio streaming?</samp><br />
-A: Yes it does.  The new version of the protocol supports sending of MIME 
-objects as messages.  Since MIME objects can easily represent any kind of 
-data, such as video stream, audio stream, images, etc. it is easy to send 
-these multimedia messages in SILC.  It also makes video conferencing 
-possible with SILC.  It can work by sending the stream(s) to a channel and 
-everybody who joins the channel can receive the stream.  This feature in 
-the protocol surely makes possible many kind of multimedia applications in 
-the future.
-<br />&nbsp;<br />
-
-<a name="f2_200"></a>
-<samp class="highlight">Q: Is it possible to send picture/image messages?
-</samp><br />
-A: Yes.  Since it is possible to send any kind of MIME object as a message
-it is also possible to send pictures and images as messages.  It would be
-possible to for example send a hand/mouse written messages.
-<br />&nbsp;<br />
-
-<a name="f2_205"></a>
-<samp class="highlight">Q: What kind of presence modes SILC 
-support?</samp><br />
-A: By presence we mean indication of presence in the network, and SILC 
-supports several different kinds of presence modes.  They can be changed
-with the UMODE command which changes your user mode in the network.  
-Currently there is the following modes for presence:  GONE (I'm away), 
-INDISPOSED (I cannot be here), BUSY (I'm busy, don't bother me), PAGE 
-(page me if you want to talk), and HYPER (I'm hyper active, talk to me).
-When mode is not set it means you are present in the network.  There are 
-many other user modes as well, but they are not directly related to 
-presence indication.
-<br />&nbsp;<br />
-
-<a name="f2_210"></a>
-<samp class="highlight">Q: Does SILC support anonymity?</samp><br />
-A: The protocol has a user mode which indicates that user is anonymous 
-user.  The user cannot set or unset the mode itself, but a server which 
-provides these anonymous chatting services can set the mode for the user 
-that connects to the server.  User that has the mode set has their 
-username and hostname information scrambled.  There are other ways of 
-making anonymity in SILC but they all are implementational methods, and 
-protocol does not handle those methods.
-<br />&nbsp;<br />
-
-<a name="f2_220"></a>
-<samp class="highlight">Q: Does SILC support services?</samp><br />
-A: Yes it does.  There is command called SERVICE which can be used by 
-clients and servers to negotiate a service agreement with a remote server.  
-The protocol does not however define any services currently.
-<br />&nbsp;<br />
-
-<a name="f2_230"></a>
-<samp class="highlight">Q: I have suggestions to SILC Protocol, what can I do?</samp><br />
-A: All suggestions and improvements are of course welcome. You should read 
-the protocol specifications first to check out whether your idea is 
-covered by them already. The best place to make your idea public is the 
-SILC development mailing list.  You might want to checkout the TODO list
-from the CVS as well.
-<br />&nbsp;<br />
-
-
-<a name="f3_0"></a><br />
-<b>3. Client Questions</b><br />&nbsp;<br />
-
-<a name="f3_10"></a>
-<samp class="highlight">Q: Where can I find SILC clients?</samp><br />
-A: The official SILC client is available for free download from the
-silcnet.org web page.  There is also several independent projects working 
-with the SILC Toolkit to come up with various other clients.           
-<a href="http://bombyx.sourceforge.net" class="normal">Bombyx</a> is a 
-cross-platform GUI client written with FLTK.  <a 
-href="http://milc.sourceforge.net" class="normal">Milc</a> 
-is also a cross-platform GUI client written with WxWindows.  See also
-our <a href="?page=links" class="normal">links page</a> for links to other 
-clients.
-<br />&nbsp;<br />
-
-<a name="f3_20"></a>
-<samp class="highlight">Q: Can I use SILC with IRC client and vice versa?</samp><br />
-A: Generally the answer would be no for both. However, there exist already 
-at least one IRC client that supports SILC, the <a href="http://irssi.org/"
-class="normal">Irssi client</a>. The current SILC client is actually based
-on the user interface of the Irssi client. So, yes it is possible to use
-SILC with some IRC clients and vice versa. You can use SILC plug-in in Irssi
-and have support for both protocols in one client. But, this does not mean
-that you can talk from SILC network to IRC network, that is not possible. 
-<br />&nbsp;<br />
-
-<a name="f3_25"></a>
-<samp class="highlight">Q: The default theme sucks, where can I find a better one?</samp><br />
-A: The Irssi SILC client's theme files are almost 100% compatible with
-the original Irssi IRC client's themes.  You can get those theme files
-from the <a href="http://irssi.org/" class="normal">Irssi project website</a>. 
-You can also try to make a better theme by yourself.
-<br />&nbsp;<br />
-
-<a name="f3_30"></a>
-<samp class="highlight">Q: How do I send a private message?</samp><br />
-A: Sending private message is done by using the MSG command.  For example,
-command: <samp class="highlight">/MSG john hello</samp>, will send a 
-`hello' message to a nickname `john'.  By default private messages are
-secured with session keys, and the message is re-encrypted by the servers
-when the message travels to the receiver.  If you would like to secure the
-private messages with a private key, you can negotiate a secret key with the
-receiver.  Always remember to give WHOIS command before sending a private
-message to assure that you are sending the message to correct person.
-<br />&nbsp;<br />
-
-<a name="f3_40"></a>
-<samp class="highlight">Q: How do I negotiate secret key with another user?</samp><br />
-A: It is important to negotiate secret keys if you cannot trust the servers
-and the network you are using.  By negotiating a key with the user you
-want to talk to assures that no one except you and your friend is able
-to encrypt and decrypt the messages.  The secret key negotiation is done with
-the KEY command.  Here is an example of how to negotiate keys for securing
-private messages.
-<br />&nbsp;<br />
-By giving command: <samp class="highlight">/KEY MSG john agreement 
-192.168.2.100</samp>, you will send a key negotiation request to a nickname
-`john'.  The 192.168.2.100 IP address would be your machine's IP address.
-You can also define an port to the KEY command after the IP address. If
-you do not do that the operating system will bind to a port of its choosing.
-John will receive a notification on the screen that you would like to 
-negotiate secret keys with him, and he will receive the IP address and port
-where you are listenning for the negotiation.  When he gives command: 
-<samp class="highlight">/KEY MSG You negotiate 192.168.2.100 31382</samp>,
-the key negotiation is started.  During the key negotiation you will be
-prompted on the screen to verify and accept John's public key if you do not
-have his public key already.  The John will be prompted to accept your
-public key as well.  After the key negotiation is over all private messages
-sent between you and John are secured with the negotiated secret key.
-Note that you must verify the public key you are prompted for, and this is
-very important since someone could be doing man-in-the-middle attack.
-<br />&nbsp;<br />
-
-<a name="f3_50"></a>
-<samp class="highlight">Q: How do I negotiate secret keys behind a NAT?</samp><br />
-A: If only you are behind a NAT, or firewall then key negotiation works,
-but if both you and your friend are behind a NAT then key negotiation will
-not work, since it is done peer to peer.  If you are behind a NAT then you
-obviously cannot receive key negotiations, and cannot bind to any IP address
-and port.  However, you can still use KEY command to negotiate the keys.
-<br />&nbsp;<br />
-By giving command: <samp class="highlight">/KEY MSG john agreement</samp>, 
-without any other arguments (such as IP address and port) you will send
-a negotiation request to John, but do not provide an address and port for
-the John to connect to.  When John receives the notification on the screen
-that you would like to perform key negotiation, he can give command:
-<samp class="highlight">/KEY MSG You agreement 172.16.100.78</samp>, which
-will send key negotiation request back to you.  You will receive the IP
-address and port where you need to connect in order to perform the negotiation.
-After receiving the notification you can give command: <samp class="highlight">
-/KEY MSG john negotiate 172.16.100.78 31181</samp>, which will start the
-key negotiation with John.  This way you can negotiate the keys if you are
-behind a NAT.
-<br />&nbsp;<br />
-
-<a name="f3_60"></a>
-<samp class="highlight">Q: How do I change channel modes?</samp><br />
-A: The command to manage channel modes is CMODE.  With this command you
-can change the channel status (to change it to secret channel for example),
-set user limit on the channel, passphrase for the channel, set the channel
-to use private keys on channel, and set the founder mode.
-<br />&nbsp;<br />
-
-<a name="f3_70"></a>
-<samp class="highlight">Q: What does the founder mode on channel mean, and how do I set it?</samp><br />
-A: Who ever creates the channel by being the first user to join the channel
-becomes automatically the founder of the channel.  Founder has some extra
-privileges on the channel.  For example, it is not possible to kick the
-founder off the channel, and there are some channel modes that only the
-founder of the channel can change.  If the creator of the channel wishes
-to preserve the channel founder mode even if he leave the channel he
-can set the founder mode for the channel.
-<br />&nbsp;<br />
-The mode is set by giving command: <samp class="highlight">/CMODE #channel
-+f</samp>.  This will set the founder mode and will use the public
-key of the founder as authenticator when the user is reclaiming the mode
-back.  If the founder leaves the channel he will be able to get the founder
-mode back by using JOIN or CUMODE commmands.  Giving command
-<samp class="highlight">/JOIN #channel -founder</samp>,
-will get the founder mode back at the same time he joins the channel, or
-giving commmand <samp class="highlight">/CUMODE #channel +f yournick</samp>,
-will also give the founder mode back on the channel after he has joined
-the channel.
-<br />&nbsp;<br />
-The founder mode also means that the channel becomes permanent when it is 
-set.  This means that when the last client leaves the channel the channel 
-is not destroyed when the founder mode is set.  Next time someone joins 
-the channel he will not become the founder of the channel if the channel 
-already existed (but were empty).  If the founder mode is not set when 
-last user leaves the channel, the channel will be destroyed.  When you set 
-the mode for the channel and leave the channel you can reclaim the founder 
-rights to yourself back at any time when you rejoin the channel.
-<br />&nbsp;<br />
-
-<a name="f3_80"></a>
-<samp class="highlight">Q: I am founder of invite only channel, how can I join the channel after I have left it?</samp><br />
-A: Founder can override the invite only status by reclaiming the founder
-status on the channel using the JOIN command.  The channel must have the
-founder mode set in order for it to work.  Reclaiming founder status using
-JOIN command is important also if the channel has user limit set, and has
-active bans.  Founder can override these conditions as well.  However,
-founder cannot override the passphrase of the channel if it is set.  To
-get the founder mode during JOIN and to override the invite only condition,
-give command: <samp class="highlight">/JOIN #channel -founder</samp>.
-This will join the channel and attempt to reclaim the founder status back
-to you.
-<br />&nbsp;<br />
-
-<a name="f3_90"></a>
-<samp class="highlight">Q: How can I op or deop somebody on channel?</samp><br />
-A: Giving operator status, or removing the operator status on a channel
-requires you to have at least operator status, or founder status on the
-channel.  You can give operator status to another user by using CUMODE
-command.  To give ops give the command: <samp class="highlight">/CUMODE
-#channel +o john</samp>, and to remove ops give command:
-<samp class="highlight">/CUMODE #channel -o john</samp>.  To indicate
-current channel you can also use `*' character in #channel's stead.
-<br />&nbsp;<br />
-
-<a name="f3_100"></a>
-<samp class="highlight">Q: How do I set private key for channel, and what does that mean exactly?</samp><br />
-A: Setting private key for channel requires first to set the private key mode
-for the channel.  You need to be the founder of the channel to be able to
-do this.  Give the command: <samp class="highlight">/CMODE #channel +k</samp>.
-After this mode is set the old channel key will not be used to encrypt and
-decrypt channel messages.  To set the key for the channel use the KEY command.
-Every user on the channel must do the same thing and set the same key.
-If some user on the channel does not set the key (or does not know the key)
-he won't be able to see any messages on the channel.  Give the command: 
-<samp class="highlight">/KEY CHANNEL #channel set verysecretkey</samp>.  
-This  command will set the `verysecretkey' passphrase as key to #channel.
-How exactly other users will know this key is out of scope of the SILC
-protocol.  SILC does not provide yet a possibility of negotiating secret key
-with many users at the same time.  For this reason the secret key on the
-channel is usually a passphrase or a password that all users on the channel
-have to know.  Setting a private key for channel means that only the users
-on the channel who know the key is able to encrypt and decrypt messages.
-Servers do not know the key at all.  If you remove the private key mode
-from the channel, all users will start automatically using a new channel
-key to secure channel messages.
-<br />&nbsp;<br />
-
-<a name="f3_110"></a>
-<samp class="highlight">Q: How do I transfer a file?</samp><br />
-A: You can transfer files securely using the FILE command.  This command
-will automatically negotiate secret key with the remote user and the
-file transfer stream is secured using that key.  The file transfer
-stream is always sent peer to peer.  If you would like to send a file
-to another user you can give command: <samp class="highlight">/FILE
-SEND path/to/the/file john</samp>.  This command sends, or actually
-makes the `path/to/the/file' available for download for the user `john'.
-The John will decide whether he wants to actually download the file.
-When John gives the command: <samp class="highlight">/FILE RECEIVE</samp>,
-the key negotiation is started.  You and John will be prompted to verify
-and accept each other's public key if you do not have it cached already.
-After key negotiation is over the file transfer process starts.
-If you want to cancel the file transfer session, or if John wants to
-reject the file transfer request, giving the command: <samp class="highlight">
-/FILE CLOSE</samp> will close the session.
-<br />&nbsp;<br />
-
-<a name="f3_120"></a>
-<samp class="highlight">Q: How can I get other users public keys?</samp><br />
-A: You can get a user's public key using the GETKEY command.  This command
-will fetch the user's public key from the server where the user has connected
-to.  The server has verified that the user posesses the corresponding private
-key, however, you will be prompted to verify and accept the public key.
-All client public keys are saved in your local key directory in
-~/.silc/clientkeys/.  You can also receive clients public keys during
-key negotiation and file transfers.  The GETKEY command can be used to fetch
-a server's public key as well.  Those keys are saved in ~/.silc/serverkeys/
-directory.
-<br />&nbsp;<br />
-
-<a name="f3_130"></a>
-<samp class="highlight">Q: How can I see the fingerprint of my public key?</samp><br />
-A: You can check out your own fingerprint by giving just WHOIS command without
-any arguments.  Additionally you can also dump the contents of the key file
-using the silc program and giving -S option to it.  Your own public key is
-always saved in ~/.silc/public_key.pub file.  To dump your key run silc as:
-<samp class="highlight">silc -S .silc/public_key.pub</samp>.  The same way
-you can dump the contents of any public key inside ~/.silc/clientkeys/ and
-~/.silc/serverkeys/ directories.  The WHOIS command will also show other
-users public key fingerprints.
-<br />&nbsp;<br />
-
-<a name="f3_140"></a>
-<samp class="highlight">Q: I gave WHOIS to a nick, and it returned multiple replies, why?</samp><br />
-A: This will happen if there are several same nicknames in the network at
-the same time.  As you may already know nicknames are not unique in SILC
-network.  This means there can be multiple same nicknames.  This also means
-that you can always have the nickname you want.  If WHOIS returns multiple
-replies, you can distinguish the users by their realname, username,
-hostname and ultimately by the fingerprint of their public key, which the
-WHOIS will also show.  You will also notice an additional nickname inside a
-parenthesis.  It may show for example: <samp class="highlight">nickname:   John
- (John@otaku)</samp>.  The real nickname is `John', but since there are
-many John's in the network you can access this one using `John@otaku'.
-So, if you were to send private message to this particular John you can do
-it by giving command: <samp class="highlight">/MSG John@otaku hello</samp>. 
-This will send `hello' message to the John@otaku.
-<br />&nbsp;<br />
-
-<a name="f3_150"></a>
-<samp class="highlight">Q: Is there a command to see all linked servers?</samp><br />
-A: No there is not.  For longer answer see also <a href="#f2_70" 
-class="normal">this FAQ</a>.
-<br />&nbsp;<br />
-
-<a name="f3_160"></a>
-<samp class="highlight">Q: How do I list the users of a channel?</samp><br />
-A: The command to list all users on a particular channel is USERS.  It is
-also aliased to WHO command in Irssi SILC Client.  To see the users of the
-current channel give the command: <samp class="highlight">/USERS *</samp>.
-You can replace the `*' with the channel name of your choosing.  If the
-channel is private or secret channel, and you have not joined the channel,
-you cannot list the users of that channel.
-<br />&nbsp;<br />
-
-<a name="f3_170"></a>
-<samp class="highlight">Q: What is the difference between OPER and SILCOPER commands?</samp><br />
-A: The OPER command is used to gain server operator privileges on normal
-SILC server, while SILCOPER is used to gain router operator (also known as
-SILC operator) privileges on router server.  You cannot use SILCOPER command
-on normal SILC server, it works only on router server.
-<br />&nbsp;<br />
-
-<a name="f3_180"></a>
-<samp class="highlight">Q: My Cygwin client crashes with message "Couldn't create //.silc directory"</samp><br />
-A: A solutions should be setting HOME enviroment variable to the directory where you
-have unpacked your SILC Client. Type to your command prompt something like: <br />
-<tt class="normal">c:\&gt;set HOME=c:\silc</tt>
-<br />&nbsp;<br />
-
-<a name="f3_190"></a>
-<samp class="highlight">Q: Why /join #silc and /join silc doesn't join the same channel?</samp><br />
-A: The #-character is not mandatory part of channel name in SILC.  So 
-#silc and silc are two different channels.  The #-character in channel 
-name is IRC feature and has nothing to do with SILC.  If you have 
-#-character in the channel name, then it is part of the channel name, just 
-like %-character, or &-character could be part of channel name.
-<br />&nbsp;<br />
-
-<a name="f3_200"></a>
-<samp class="highlight">Q: How do I detach my session from the
-server?</samp><br />
-A: You can detach your session by simply giving DETACH command.  Your 
-connection to the server will be closed automatically.  Next time you 
-connect any server in the network your session will be automatically 
-resumed.  If there is an error during session resuming your connection 
-will be closed and you need to reconnect to the server.  In this case the 
-old sessionn cannot be resumed anymore.
-<br />&nbsp;<br />
-
-
-<a name="f4_0"></a><br />
-<b>4. Server Questions</b><br />&nbsp;<br />
-
-<a name="f4_10"></a>
-<samp class="highlight">Q: Where can I find SILC servers?</samp><br />
-A: The SILC server is available for free download from the silcnet.org 
-web page. We are not aware of any other SILC server implementations, so far.
-<br />&nbsp;<br />
-
-<a name="f4_20"></a>
-<samp class="highlight">Q: Can I run my own SILC server?</samp><br />
-A: Yes of course. Download the SILC server package, compile and install 
-it. Be sure to check out the installation instructions and the README 
-file. You also should decide whether you want to run SILC server or SILC 
-router.
-<br />&nbsp;<br />
-
-<a name="f4_30"></a>
-<samp class="highlight">Q: What is the difference between SILC 
-server and SILC router?</samp><br />
-A: The topology of the SILC network includes SILC routers and the SILC 
-servers (and SILC clients of course). Normal SILC server does not have 
-direct connections with other SILC servers. They connect directly to the 
-SILC router. SILC Routers may have several server connections and they 
-may connect to several SILC routers. The SILC routers are the servers in 
-the network that know everything about everything. The SILC servers know 
-only local information and query global information from the router when 
-necessary.
-<br />&nbsp;<br />
-If you are running SILC server you want to run it as router only if you 
-want to have server connections in it and are prepared to accept server 
-connections. You also need to get the router connected to some other 
-router to be able to join the SILC network. You may run the server as 
-normal SILC server if you do not want to accept other server connections 
-or cannot run it as router.
-<br />&nbsp;<br />
-
-<a name="f4_40"></a>
-<samp class="highlight">Q: Why server says permission denied to write to a 
-log file?</samp><br />
-A: The owner of the log files must be same user that the server is run 
-under, by default it is user `nobody'.  Just change the permissions and 
-try again.
-<br />&nbsp;<br />
-
-<a name="f4_50"></a>
-<samp class="highlight">Q: When I connect to my server it says "server does 
-not support one of your proposed ciphers", what is wrong?</samp><br />
-A: Most likely the ciphers and others has not been compiled as SIMs 
-(modules) and they are configured as modules in the silcd.conf. If they 
-are not compiled as modules remove the module paths from the ciphers and 
-hash functions from the silcd.conf, so that the server use the builtin 
-ciphers. Then try connecting to the server again. It is also possible 
-that the client IS proposing some ciphers that your server does not support.
-<br />&nbsp;<br />
-
-<a name="f4_60"></a>
-<samp class="highlight">Q: Why SILC server runs on privileged port 706?</samp><br />
-A: Ports 706/tcp and 706/udp have been assigned for the SILC protocol by
-<a href="http://www.iana.org" class="normal">IANA</a>. Server on the network
-listening above privileged ports (&gt;1023) SHOULD NOT be trusted as it could
-have been set up by untrusted party. The server normally drops root privileges
-after startup and then run as user previously defined in silcd.conf.
-<br />&nbsp;<br />
-
-<a name="f4_70"></a>
-<samp class="highlight">Q: I see [Unknown] in the log file, what does it mean?</samp><br />
-A: You can see in the log file for example: <samp class="highlight">
-[Info] Closing connection 192.168.78.139:3214 [Unknown]</samp>.  The [Unknown]
-means that the connection was not authenticated yet, and it is not known
-whether the connection was a client, server or router.  There will appear
-[Client], [Server] or [Router] if the connection is authenticated at that
-point.
-<br />&nbsp;<br />
-
-<a name="f4_80"></a>
-<samp class="highlight">Q: How can I generate a new server key pair?</samp><br />
-A: You can generate a new key pair using the silcd command with the -C 
-option.  When SILC Server is installed a key pair is generated 
-automatically for you.  However, it is suggested that you check the 
-information found in that key and generate a new key pair if the 
-information is incorrect.  You can check the information of your public 
-key by giving command: <samp class="highlight">silc -S file.pub</samp>.
-<br />&nbsp;<br />
-If you want to generate a new key pair then you can give for example 
-command: <samp class="highlight">
-silcd -C . --identifier="UN=silc-oper, HN=silc.silcnet.org, RN=SILC Router 
-Admin, E=silc-oper@silcnet.org, O=SILC Project, C=SK"</samp>. This will 
-create the key pair to current directory, with the specified identifier.  
-Please, give the --help option to the silcd to see usage help for the -C 
-and --identifier options.
-<br />&nbsp;<br />
-
-
-<a name="f5_0"></a><br />
-<b>5. Toolkit Questions</b><br />&nbsp;<br />
-
-<a name="f5_10"></a>
-<samp class="highlight">Q: What is SILC Toolkit?</samp><br />
-A: SILC Toolkit is a package intended for software developers who would 
-like to develope their own SILC based applications or help in the 
-development of the SILC. The Toolkit includes SILC Protocol Core library, 
-SILC Crypto library, SILC Key Exchange (SKE) library, SILC Math 
-library, SILC Modules (SIM) library, SILC Utility library, SILC Client 
-library and few other libraries. 
-<br />&nbsp;<br />
-
-<a name="f5_20"></a>
-<samp class="highlight">Q: Is the SILC Toolkit Reference Manual Available?</samp><br />
-A: Yes, partially completed reference manual is available in the Toolkit 
-releases as HTML package and they are available from the silcnet.org 
-website as well at the <a href="?page=docs" class="normal">documentation </a> page.
-<br />&nbsp;<br />
-
-<a name="f5_30"></a>
-<samp class="highlight">Q: How do I compile the Toolkit on Unix?</samp><br />
-A: You should read the INSTALL file from the package and follow its 
-instructions.  The compilation on Unix is as simple as compiling any other 
-SILC package.  Give, `./configure' command and then `make' command.
-<br />&nbsp;<br />
-
-<a name="f5_40"></a>
-<samp class="highlight">Q: How do I compile the Toolkit on Win32?</samp><br />
-A: We have prepared instructions to compile the Toolkit on Win32 in the 
-Toolkit package.  Please, read the README.WIN32 file from the package for 
-detailed instructions how to compile the Toolkit for Cygwin, MinGW and 
-native Win32 systems.  We have also prepared ready MSVC++ Workspace files 
-in the win32/ directory in the package that will compile automatically 
-the Toolkit.
-<br />&nbsp;<br />
-
-<a name="f5_50"></a>
-<samp class="highlight">Q: Does the Toolkit package include any sample code?</samp><br />
-A: Yes, naturally.  It includes sample codes for two different SILC Client 
-implementations, and SILC Server.  The silcer/ directory includes a simple
-GUI client based on GTK--, and Win32 samples are included in the win32/
-directory, for simple client.
-<br />&nbsp;<br />
diff --git a/public_html/html/features.php b/public_html/html/features.php
deleted file mode 100644 (file)
index e09b683..0000000
+++ /dev/null
@@ -1,90 +0,0 @@
-&nbsp;<br />
-<b><big>Features</big></b>
-<br />&nbsp;<br />
-- Normal conferencing services such as private messages, channels, 
-channel messages, etc. All traffic is secured and authenticated.
-
-<br />&nbsp;<br />
-- No unique nicknames. There can be same nicknames in SILC without 
-collisions. SILC has unique Client ID's, Server ID's and Channel ID's to 
-assure that there are no collisions. The maximum length of the nickname 
-is 128 characters. The maximum length of the channel name is 256 characters.
-
-<br />&nbsp;<br />
-- Channels can have channel operators and a channel founder which is the 
-client who created the channel. Channel founder privileges supersedes the 
-channel operator privileges. Also, channel founder privileges may be 
-regained even if the founder leaves the channel. The requirement for this 
-is that the client is connected to the same server it was originally 
-connected. The channel founder cannot be removed (kicked) from the 
-channel using force.
-
-<br />&nbsp;<br />
-- Channel messages are protected by channel key, generated by the server. 
-The key is re-generated once in an hour. It is possible to set a private 
-key for the channel so that even the servers does not know the key. 
-Actually, it is possible to set several private keys so that only 
-specific users on the channel may decrypt some specific messages. Adding 
-the private key significantly increases the security as nobody else but 
-the users on the channel know the key.
-
-<br />&nbsp;<br />
-- Private messages are protected using session keys, generated when 
-connecting to the server. This means that the private messages are 
-decrypted and re-encrypted enroute to the true receiver of the message. 
-However, it is possible to set a private key between two clients and 
-protect the private messages with that key. In this case no server 
-enroute can decrypt the message since they don't have the key. The SILC 
-protocol provides an automatic key negotiation between two clients using 
-the SKE protocol. This makes it very easy to negotiate a shared secret 
-key with another client in the network.
-
-<br />&nbsp;<br />
-- All the other traffic, like commands between client and the server are 
-protected using the session keys. Session keys are re-generated once in 
-an hour. The re-key may be done with or without the PFS (Perfect Forward 
-Secrecy).
-
-<br />&nbsp;<br />
-- Secure key exchange and authentication protocol. SILC Key Exchange 
-(SKE) protocol provides key material used in the SILC sessions in secure 
-manner. The protocol is immune for example to man-in-the-middle attacks 
-and is based on the Diffie-Hellman key exchange algorithm. The SILC 
-Authentication protocol provides strong authentication. Authentication 
-may be based on passphrase or public key (RSA) authentication. For 
-clients there is an option not to use authentication when connecting to 
-servers.
-
-<br />&nbsp;<br />
-- Supports secure file transferring between clients in the network.  SILC 
-use the SFTP as the main file transfer protocol.
-
-<br />&nbsp;<br />
-- All traffic is encrypted and authenticated using the best cryptographic 
-algorithms out there. Cipher keys are, by default, 256 bits in length and 
-public keys, by default, 1024 bits in length.
-
-<br />&nbsp;<br />
-- Supports the following ciphers: AES(Rijndael), Twofish, Blowfish, Mars, 
-Cast-256, RC5 and RC6. Supports the following hash functions: MD5 and 
-SHA1. Supports the following HMACs: hmac-sha1-96, hmac-md5-96, 
-hmac-sha1 and hmac-md5. Supports the PKCS #1 (RSA) for public key 
-cryptography. 
-
-<br />&nbsp;<br />
-- Supports data compression with GZIP to improve performance.
-
-<br />&nbsp;<br />
-- Supports SOCKS4 and SOCKS5 firewall traversal protocols.
-
-<br />&nbsp;<br />
-- SIM (SILC Module) support. Support for loading of shared objects at 
-run-time that provides new and extended features to both SILC client and 
-server. These can provide extra ciphers and extra features to the software.
-
-<br />&nbsp;<br />
-- SILC client can be installed and used without root privileges.
-
-<br />&nbsp;<br />
-- SILC client can be configured by system wide configuration files but 
-with user specific configuration files as well.
diff --git a/public_html/html/help.php b/public_html/html/help.php
deleted file mode 100644 (file)
index a638794..0000000
+++ /dev/null
@@ -1,67 +0,0 @@
-&nbsp;<br />
-<b><big>Need Help?</big></b>
-<br />&nbsp;<br />
-Are you confused with SILC? Don't quite know where to get some more 
-information? If you answer Yes, then this is the door you're looking for.  
-This page includes introduction to the help resources for SILC Network. 
-There are many places where you can get more information and help 
-regarding SILC in general, using SILC Network, developing SILC and much 
-more.
-
-<br />&nbsp;<br />&nbsp;<br />
-<b>Getting Started with SILC</b>
-<br />&nbsp;<br />
-The very first thing you need to do to get online with SILC is to download 
-the SILC client.  Go to the <a href="?page=download" class="normal">download
-page</a>, and download the latest client.  There are several binary 
-packages available if you do not want to compile the client by yourself.   
-After you have your very own SILC client downloaded then locate the SILC 
-server nearest to you.  Please see our <a href="?page=servers" 
-class="normal">server list</a>, for all servers in the SILC Network.  You 
-can also directly connect to the <samp 
-class="highlight">silc.silcnet.org</samp> server if you like.
-<br />&nbsp;<br />
-You most likely have questions about SILC after you start using it.  The 
-best place to look for questions and answers is the <a 
-href="?page=faq" class="normal">SILC FAQ</a>. Please read it before you 
-start asking more questions.
-
-<br />&nbsp;<br />&nbsp;<br />
-<b>Getting Help Online</b>
-<br />&nbsp;<br />
-The best and quickest way to get assistance is to get online on SILC 
-Network.  If you have questions, or just want to chat about SILC you can 
-join the <samp class="highlight">#silc</samp> channel. This friendly 
-channel includes people who are interested in SILC and ready to answer 
-questions assuming they know the answers.
-<br />&nbsp;<br />
-Give the command <samp class="highlight">/join #silc</samp> to join the 
-channel. Please introduce yourself before asking the question, and wait 
-patiently for your answer.
-
-<br />&nbsp;<br />&nbsp;<br />
-<b>Getting Help On This Website</b>
-<br />&nbsp;<br />
-Reading documentation on SILC is also a good way to learn about SILC.  See 
-the documentation available in the <a href="?page=docs" 
-class="normal">documentation page</a> for more information.
-
-<br />&nbsp;<br />&nbsp;<br />
-<b>Getting Help via Mailing Lists</b>
-<br />&nbsp;<br />
-There is currently one mailing list called silc-devel.  This is 
-general purpose mailing list that includes conversation on SILC 
-development, announcements of new releases and provides help for anyone 
-who ask questions.  You can subscribe to the mailist list on the <a 
-href="?page=lists" class="normal">lists page</a>, and read the archives of 
-the mailing list at <a 
-href="http://www.geocrawler.com/redir-sf.php3?list=silc-devel" 
-class="normal">silc-devel archives</a>.  You can send email to the mailing 
-list by sending it to <samp class="highlight">
-silc-devel@lists.sourceforge.net</samp> email address.
-
-<br />&nbsp;<br />
-Before you go ahead and start sending questions there is a nice document 
-about <a href="http://www.tuxedo.org/~esr/faqs/smart-questions.html" 
-class="normal">How To Ask Questions The Smart Way</a> by Eric S. Raymond, 
-a document you may want to read.
diff --git a/public_html/html/history.php b/public_html/html/history.php
deleted file mode 100644 (file)
index 3a454ae..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-&nbsp;<br />
-<b><big>History</big></b>
-<br />&nbsp;<br />
-SILC was released in the summer 2000 to the public, but the idea and the 
-protocol itself is quite old. The SILC was designed by Pekka Riikonen in 
-the year 1996 and first lines of codes were written in the early 1997. The 
-SILC has been rewritten three times since its very first version in 1997.  
-The first version included SILC client, very preliminary SILC server, RSA 
-implementation and 3DES implementation. The server actually was not 
-usable but the client looked pretty much the same as the first client 
-released in the summer 2000. The first version had also random number 
-generator which were based on the SSH's random number generator. The 
-current RNG is based on the first RNG but has been rewritten twice since 
-the first version.
-<br />&nbsp;<br />
-The development of SILC was suspended in 1997 when Pekka got busy at 
-school and in work. The pause laster several months. The development 
-resumed in 1998 when Juha Räsänen and Pekka implemented the ElGamal 
-algorithm. However, for the same reasons as previously the development 
-stopped again, and was resumed again later in 1998 by doing rewrite of 
-ther SILC in C++. This was obviously a mistake but at that time it seemed 
-like a good idea. Again, in the winter 1999 the development suspended when 
-Pekka got busy writing his thesis and was forced to stop the development.
-<br />&nbsp;<br />
-Later, in 1999, it was decided that this time SILC will be rewritten from 
-scratch in the right way. C++ was obviously a bad choice so plain C 
-language was selected again. The protocol itself faced some rework by 
-redesigning some core parts of the protocol. The protocol was also fully 
-documented and the protocol specifications were submitted to the IETF.  
-The result of this development effort is the release now in public. Since 
-the release in the summer 2000 several other people have contributed to 
-the project as well. And, the development continues.
diff --git a/public_html/html/install.php b/public_html/html/install.php
deleted file mode 100644 (file)
index 0ef0102..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-&nbsp;<br />
-<tt class="normal">
-<?php
-
-if (Is_Readable("docs/INSTALL")) {
-  $fp = FOpen("docs/INSTALL", "r");
-
-  while($line = FGets($fp, 255)) {
-    $newline = Ereg_Replace("^[ ]{2,4}","&nbsp;&nbsp;",$line);
-    $line = Ereg_Replace("^([\t]|[ ][\t])","&nbsp;&nbsp;&nbsp;&nbsp;",$newline);
-    printf("%s", nl2br($line));
-  }
-
-  FClose($fp);
-  }
-?>
-</tt>
diff --git a/public_html/html/links.php b/public_html/html/links.php
deleted file mode 100644 (file)
index 4129360..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-&nbsp;<br />
-<b><big>Links</big></b>
-<br />&nbsp;<br />
-List of links related to Secure Internet Live Conferencing protocol, 
-security or just otherwise related. If you have a link that should be 
-listed here please send email to <a href="mailto:webmaster at silcnet.org" 
-class="normal"> webmaster@silcnet.org</a>.
-
-<br />&nbsp;<br />&nbsp;<br />
-<b>Other SILC Networks</b>
-<br />&nbsp;<br />
-- <a href="http://www.so36.net" class="normal">www.so36.net</a>, has a 
-small SILC network available for free use
-
-<br />&nbsp;<br />&nbsp;<br />
-<b>Other Chat Protocols</b>
-<br />&nbsp;<br />
-- <a href="http://www.irc.org" class="normal">www.irc.org</a>, a centre 
-for Internet Relay Chat protocol<br />
-- <a href="http://jabber.org" class="normal">jabber.org</a>, Open Source
-Instant Messaging protocol using XML<br />
-- <a href="http://www.gale.org" class="normal">www.gale.org</a>, Another 
-Open Source Instant Messaging protocol
-
-<br />&nbsp;<br />&nbsp;<br />
-<b>Organizations</b>
-<br />&nbsp;<br />
-- <a href="http://www.ietf.org" class="normal">www.ietf.org</a>, 
-Internet Engineering Task Force<br />
-- <a href="http://www.iana.org" class="normal">www.iana.org</a>, 
-Internet Assigned Numbers Authority<br />
-- <a href="http://www.iacr.org" class="normal">www.iacr.org</a>, 
-International Association for Cryptologic Research
-
-<br />&nbsp;<br />&nbsp;<br />
-<b>Security & Cryptography</b>
-<br />&nbsp;<br />
-- <a href="http://www.ssh.com/tech/crypto/" class="normal"> Cryptography 
-A-2-Z</a>, a comprehensive introduction to cryptography<br />
-- <a href="http://www.cacr.math.uwaterloo.ca/hac/" class="normal">
-The Hand Book of Applied Cryptography</a>, Free Edition of the book that 
-deals with cryptography, and is mathematically oriented
diff --git a/public_html/html/lists.php b/public_html/html/lists.php
deleted file mode 100644 (file)
index 498afd3..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-&nbsp;<br />
-<b><big>Public SILC Mailing Lists</big></b>
-<br />&nbsp;<br />
-There is currently one mailing list available. The mailing list is the
-main SILC development mailing list. It is currently quite low volume so
-you can safely subscribe on to it. To send email to the list the email 
-must be destined to: <a href="mailto:silc-devel at 
-lists.sourceforge.net" class="normal">silc-devel@lists.sourceforge.net</a> address.
-<br />&nbsp;<br />
-To see prior postings to the list, browse the <a href="http://www.geocrawler.com/redir-sf.php3?list=silc-devel" class="normal">silc-devel archives</a>.
-<br />&nbsp;<br />
-
-<b>Subscribing to silc-devel</b>
-<br />&nbsp;<br />
-To subscribe to silc-devel mailing list send email to the following 
-address:
-<br />
-<a href="mailto:silc-devel-request@lists.sourceforge.net" class="normal">
-silc-devel-request@lists.sourceforge.net</a>, and add the following
-line to the body of the email.
-<br />&nbsp;<br />
-subscribe yourpassword
-<br />&nbsp;<br />
-You must set a password that you can use to modify your settings. It must 
-also be provided if you will unsubscribe from the list. The email address 
-you are using to send the email will be added to the mailing list. You 
-will receive a confirmation email to which you must reply in order to 
-complete the subscribing process.
-<br />&nbsp;<br />
-You can also use the following link to do the subscribing if you want:
-<br />
-<a href="http://lists.sourceforge.net/lists/listinfo/silc-devel" class="normal">
-subscribe to silc-devel</a>
-<br />&nbsp;<br />
-
-<b>Unsubscribing from silc-devel</b>
-<br />&nbsp;<br />
-To unsubcribe from the silc-devel mailing list send email to the following 
-address:
-<br />
-<a href="mailto:silc-devel-request@lists.sourceforge.net" class="normal">
-silc-devel-request@lists.sourceforge.net</a>, and add the following
-line to the body of the email.
-<br />&nbsp;<br />
-unsubscribe yourpassword [address]
-<br />&nbsp;<br />
-You must give the password you set in the subscribing process. If you are 
-unsubscribing from different address you must give the email address too.
-<br />&nbsp;<br />
-You can also use the following link to do the unsubscribing if you want:
-<br />
-<a href="http://lists.sourceforge.net/lists/listinfo/silc-devel" class="normal">
-unsubscribe from silc-devel</a>
-<br />&nbsp;<br />
diff --git a/public_html/html/mirrors.php b/public_html/html/mirrors.php
deleted file mode 100644 (file)
index 8c22719..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-&nbsp;<br />
-<b><big>Mirrors</big></b>
-<br />&nbsp;<br />
-Mirrors synchronize once a day. Currently available mirrors:
-<br />&nbsp;<br />
-
-<a href="http://silcnet.org/" class="normal">Slovakia</a> (main site)
-<br />
-&nbsp; - <a href="http://www.silcnet.org/" class="normal">www site</a>, <a href="ftp://ftp.silcnet.org/pub/silc/" class="normal">ftp archive</a>, <a href="http://ftp.silcnet.org/" class="normal">ftp archive over http</a>, <a href="?page=cvs" class="normal">anonymous cvs</a>, and <a href="http://cvs.silcnet.org/" class="normal">cvs web</a><br />
-&nbsp; - 10Mbps connection, NEXTRA <br />
-&nbsp; - provided by <a href="mailto:salo at silcnet.org" class="normal">Lubomir Sedlacik (salo)</a>
-<br />&nbsp;<br />
-
-<a href="http://au.silcnet.org/" class="normal">Australia</a>
-<br />
-&nbsp; - <a href="http://www.au.silcnet.org" class="normal">www site</a>, <a href="ftp://ftp.au.silcnet.org/pub/silcnet/" class="normal">ftp archive</a> and <a href="http://www.planetmirror.com/pub/silcnet/" class="normal">ftp archive over http</a><br />
-&nbsp; - 155Mbps connection, SCCN <br />
-&nbsp; - provided by <a href="mailto:jason at planetmirror.com" class="normal">Jason Andrade</a>, <a href="http://planetmirror.com" class="normal">Planet Mirror</a>
-<br />&nbsp;<br />
-
-Australia 2
-<br />
-&nbsp; - <a href="ftp://ftp.wiretapped.net/pub/security/network-security/silc/" class="normal">ftp</a> and <a href="http://the.wiretapped.net/security/network-security/silc/" class="normal">ftp archive over http</a><br />
-&nbsp; - 10Mbps, Connect<br />
-&nbsp; - provided by <a href="http://www.wiretapped.net" class="normal">Wiretapped</a>
-<br />&nbsp;<br />
-
-Netherlands
-<br />
-&nbsp; - <a href="http://munitions.vipul.net/software/mirrors/silc/" class="normal">ftp archive over http</a><br />
-&nbsp; - 100Mbps, XS4ALL<br />
-&nbsp; - provided by <a href="mailto:mail at vipul.net" class="normal">Vipul Ved Prakash</a>, <a href="http://munitions.vipul.net" class="normal">Munitions</a>
-<br />&nbsp;<br />
-
-<a href="http://no.silcnet.org/" class="normal">Norway</a>
-<br />
-&nbsp; - <a href="http://www.no.silcnet.org" class="normal">www site</a> and <a href="ftp://ftp.no.silcnet.org/pub/silc/" class="normal">ftp archive</a><br />
-&nbsp; - 34Mbps connection <br />
-&nbsp; - provided by <a href="mailto:debolaz at debolaz.com" class="normal">Anders Nor Berle (Debolaz)</a>
-<br />&nbsp;<br />
-
-If you want to provide mirror of SILC webpage, FTP archive or CVS tree feel free to contact <a href="mailto: salo at silcnet.org" class="normal">me</a> for detailed instructions.
diff --git a/public_html/html/news.php b/public_html/html/news.php
deleted file mode 100644 (file)
index e04b61e..0000000
+++ /dev/null
@@ -1,80 +0,0 @@
-&nbsp;<br />
-<b><big>SILC Client <?php echo $Latest_Client; ?> Is Now Available!</big></b>
-<br /><small class="highlight"><?php echo $Date_Client ?></small>
-<br />&nbsp;<br />
-The new version <?php echo $Latest_Client; ?> of the SILC Client is available!
-Read the README and INSTALL files after downloading for instructions how 
-to compile and use the SILC. Report bugs to the 
-<a href="?page=lists" class="normal">SILC development mailing list</a>.
-<br />&nbsp;<br />
-Download: <a href="?page=download" class="normal">SILC Client <?php echo 
-$Latest_Client; ?> Version</a>
-<br />
-Changes: <a href="txt/changes-client.txt" class="normal">SILC Client <?php echo $Latest_Client; ?> 
-Changes</a>
-<br />
-Release notes: <a href="txt/release-client.txt" class="normal">SILC Client <?php echo $Latest_Client; ?> 
-Release Notes</a>
-
-<br />&nbsp;<br />&nbsp;<br />
-
-<b><big>SILC Server <?php echo $Latest_Server; ?> Is Now Available!</big></b>
-<br /><small class="highlight"><?php echo $Date_Server ?></small>
-<br />&nbsp;<br />
-The new version <?php echo $Latest_Server; ?> of the SILC Server is available!
-Read the README and INSTALL files after downloading for instructions how 
-to compile and use the SILC. Report bugs to the 
-<a href="?page=lists" class="normal">SILC development mailing list</a>.
-<br />&nbsp;<br />
-People who is running SILC servers and are interested to get the server 
-linked to the new router on silc.silcnet.org contact 
-<a href="mailto:priikone at silcnet.org" class="normal">me</a> now.
-<br />&nbsp;<br />
-Download: <a href="?page=download" class="normal">SILC Server <?php echo 
-$Latest_Server; ?> Version</a>
-<br />
-Changes: <a href="txt/changes-server.txt" class="normal">SILC Server <?php echo $Latest_Server; ?> 
-Changes</a>
-<br />
-Release notes: <a href="txt/release-server.txt" class="normal">SILC 
-Server <?php echo $Latest_Server; ?> 
-Release Notes</a>
-
-<br />&nbsp;<br />&nbsp;<br />
-
-<b><big>SILC Toolkit <?php echo $Latest_Toolkit; ?> Is Now Available!</big></b>
-<br /><small class="highlight"><?php echo $Date_Toolkit ?></small>
-<br />&nbsp;<br />
-The new version <?php echo $Latest_Toolkit; ?> of the SILC Toolkit is available!
-This package is intended for developers and programmers who would like to 
-create their own SILC applications or help in the development of the SILC 
-protocol.
-<br />&nbsp;<br />
-Download: <a href="?page=download" class="normal">SILC Toolkit <?php echo 
-$Latest_Toolkit; ?> Version</a>
-<br />
-Changes: <a href="txt/changes.txt" class="normal">SILC Toolkit <?php echo $Latest_Toolkit; ?> 
-Changes</a>
-<br />
-Release notes: <a href="txt/release-toolkit.txt" class="normal">SILC Toolkit <?php echo $Latest_Toolkit; ?> Release Notes</a>
-
-<br />&nbsp;<br />&nbsp;<br />
-
-<b><big>Try out SILC server at silc.silcnet.org</big></b>
-<br />&nbsp;<br />
-Feel free to connect to various SILC servers in the SILC Network.  The 
-network is still quite small but is growing all the time.  To connect 
-to the server type command <i>/server silc.silcnet.org</i>. You might also
-want to try out one of following servers:
-<br />&nbsp;<br />
-
-- <samp class="highlight">silc.silcnet.org (router)</samp> (Slovakia)<br />
-- <samp class="highlight">silc.ytti.fi</samp> (Finland)<br />
-- <samp class="highlight">silc.peelo.com</samp> (Finland)<br />
-- <samp class="highlight">silc.debolaz.com</samp> (Norway)<br />
-- <samp class="highlight">s.slash0.net</samp> (USA)<br />
-- <samp class="highlight">silc.silcnet.org on port 707</samp>
-
-<br />&nbsp;<br />
-There may be some action on channel #silc (unless everybody is sleeping) 
-so you might want to give command <i>/join #silc</i>.
diff --git a/public_html/html/servers.php b/public_html/html/servers.php
deleted file mode 100644 (file)
index e30b2b0..0000000
+++ /dev/null
@@ -1,101 +0,0 @@
-&nbsp;<br />
-<b><big>SILC Servers</big></b>
-<br />&nbsp;<br />
-Please refer to this SILC Servers list when you find the nearest server to 
-you.  You can also check the particular server's public key here.  When 
-you connect to a server for the very first time you will be prompted to 
-accept the server's public key.  You can then come here and verify the key 
-here.
-<br />&nbsp;<br />
-To connect to a server give the command <samp class="highlight">/server 
-servername</samp>.
-
-<br />&nbsp;<br />
-<table width="98%" cellspacing="2" cellpadding="2" border="0">
- <tr>
-  <td class="title100" align="center"><b>Router</b></td>
-  <td class="title100" align="center"><b>Server</b></td>
-  <td class="title50" align="center"><b>Port</b></td>
-  <td class="title50" align="center"><b>Country</b></td>
-  <td class="title50" align="center"><b>Oper</b></td>
-  <td class="title50" align="center"><b>Public Key</b></td>
-  <td class="title50" align="center"><b>URL</b></td>
- </tr>
-
- <tr>
-  <td class="sources" align="center">&nbsp;silc.silcnet.org</td>
-  <td class="sources" align="center">&nbsp;</td>
-  <td class="sources" align="center">706</td>
-  <td class="sources" align="center">Slovakia</td>
-  <td class="sources" align="center">pekka</td>
-  <td class="sources" align="center"><a href="keys/serverkey_silc.silcnet.org_706.pub" class="normal">public key</a></td>
-  <td class="sources" align="center">N/A</td>
- </tr>  
-
- <tr>
-  <td class="sources" align="center">&nbsp;</td>
-  <td class="sources" align="center">&nbsp;silc.ytti.fi</td>
-  <td class="sources" align="center">706</td>
-  <td class="sources" align="center">Finland</td>
-  <td class="sources" align="center">ytti</td>
-  <td class="sources" align="center">N/A</td>
-  <td class="sources" align="center">N/A</td>
- </tr>  
-
- <tr>
-  <td class="sources" align="center">&nbsp;</td>
-  <td class="sources" align="center">&nbsp;silc.peelo.com</td>
-  <td class="sources" align="center">706</td>
-  <td class="sources" align="center">Finland</td>
-  <td class="sources" align="center">Toni</td>
-  <td class="sources" align="center">N/A</td>
-  <td class="sources" align="center">N/A</td>
- </tr>  
-
- <tr>
-  <td class="sources" align="center">&nbsp;</td>
-  <td class="sources" align="center">&nbsp;silc.debolaz.com</td>
-  <td class="sources" align="center">706</td>
-  <td class="sources" align="center">Norway</td>
-  <td class="sources" align="center">Debolaz</td>
-  <td class="sources" align="center">N/A</td>
-  <td class="sources" align="center">N/A</td>
- </tr>  
-
- <tr>
-  <td class="sources" align="center">&nbsp;</td>
-  <td class="sources" align="center">&nbsp;s.slash0.net</td>
-  <td class="sources" align="center">706</td>
-  <td class="sources" align="center">USA</td>
-  <td class="sources" align="center">next</td>
-  <td class="sources" align="center">N/A</td>
-  <td class="sources" align="center">N/A</td>
- </tr>  
-
- <tr>
-  <td class="sources" align="center">&nbsp;</td>
-  <td class="sources" align="center">&nbsp;silc.silcnet.org</td>
-  <td class="sources" align="center">707</td>
-  <td class="sources" align="center">Slovakia</td>
-  <td class="sources" align="center">pekka</td>
-  <td class="sources" align="center"><a href="keys/serverkey_silc.silcnet.org_707.pub" class="normal">public key</a></td>
-  <td class="sources" align="center">N/A</td>
- </tr>  
-
-</table>
-
-<table width="98%" cellspacing="0" cellpadding="0" border="0">
- <tr>
-  <td class="text">
-<br />&nbsp;<br />&nbsp;<br />
-<b>Linking to SILC Network</b>
-<br />&nbsp;<br />
-Would you like to link your server to the SILC Network? Please contact us 
-at <a href="mailto:server-links at silcnet.org" class="normal">
-server-links@silcnet.org</a>, and tell us about your server. It would be 
-nice if you already have existing user base in your server.
-
-  </td>
- </tr> 
-</table>
-
diff --git a/public_html/html/todo.php b/public_html/html/todo.php
deleted file mode 100644 (file)
index 075aeae..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-&nbsp;<br />
-<tt class="normal">
-<?php
-
-if (Is_Readable("txt/todo.txt")) {
-  $fp = FOpen("txt/todo.txt", "r");
-
-  while($line = FGets($fp, 255)) {
-    $newline = Ereg_Replace("^[ ]{2,4}","&nbsp;&nbsp;",$line);
-    $line = Ereg_Replace("^([\t]|[ ][\t])","&nbsp;&nbsp;&nbsp;&nbsp;",$newline);
-    printf("%s", nl2br($line));
-  }
-
-  FClose($fp);
-  }
-?>
-</tt>
diff --git a/public_html/html/whitepaper.php b/public_html/html/whitepaper.php
deleted file mode 100644 (file)
index 9b607a0..0000000
+++ /dev/null
@@ -1,947 +0,0 @@
-<!-- This file is processed with html2ps to generate PostiScript. 
-     Do not edit the HTML syntax unless you know what you are doing. -->
-<html>
-<head>
-<title>SILC Protocol White Paper</title>
-<link rev=made href="mailto:priikone@silcnet.org">
-<meta name="Author" content="Pekka Riikonen - SILC Project">
-<meta name="Description"
- content="SILC - Secure Internet Live Conferencing Protocol">
-<meta name="Created" content="Version 1.0.5 / 15 Jab 2002">
-</head>
-<body bgcolor="#ffffff">
-
-<font face="Helvetica">
-
-<font size="6"><b>SILC Protocol White Paper</b></font><br>
-<font size="2">Version 1.0.5 / 15 Jan 2002</font>
-
-<p>
-<h1>Introduction</h1>
-
-Chat protocols are very popular on the Internet.  They have actually
-been very popular since the very first chat protocols appeared on the net.
-The Internet Relay Chat (IRC) was one of the first chat protocols, and quickly
-gained the status of being the most popular chat on the net.  Today, IRC
-has several competitors from various other so called Instant Messaging (IM)
-protocols, such as ICQ.  However, all of these different chat protocols
-have something in common; they are all insecure.
-<p>
-
-The security is important feature in applications and protocols in 
-contemporary network environment.  The older chat protocols, however have
-failed to meet the growing security requirements on the Internet.
-It is not anymore enough to just provide services, like for example
-chat services. Now, they need to be secure services.
-<p>
-
-The Secure Internet Live Conferencing (SILC) protocol is a new generation
-chat protocol which provides full featured conferencing services, just
-like any other contemporary chat protocol provides.  In addition, it
-provides security by encrypting and authenticating the messages in
-the network.  The security has been the primary goal of the SILC protocol
-and the protocol has been designed from the day one security in mind.
-All packets and messages travelling in the SILC Network are always
-encrypted and authenticated.  The network topology is also different
-from for example IRC network.  The SILC network topology attempts to be
-more powerful and scalable than the IRC network.  The basic purpose
-of the SILC protocol is to provide secure conferencing services.
-<p>
-
-The SILC Protocol have been developed as Open Source project.  The
-protocol specifications are freely available and they have been submitted to
-the IETF.  The very first implementations of the protocol are also already
-available.
-
-<p><br>
-<h1>About This White Paper</h1>
-<p>
-The purpose of this white paper is to give short but deep enough introduction
-to the SILC Protocol.  The document describes the purpose of the protocol
-and how the protocol works in practice.  This document is intended for all
-audience.  This document should be easy to understand for non-technical
-person and still be detailed enough for technically oriented person.  See
-the section <a href="#terms">Terms and Abbreviations</a> for terms used
-in this document.
-<p>
-
-<p>
-(c) Copyright 2001 - 2002 Pekka Riikonen 
-(<a href="mailto:priikone at silcnet.org">priikone at silcnet.org</a>)
-<p>
-This document is free document; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.  This document 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.
-
-
-<p><br>
-<h1>SILC Protocol</h1>
-<p>
-
-The Secure Internet Live Conferencing (SILC) protocol provides secure
-conferencing services over insecure network channel.  The SILC is IRC
-like protocol, however it does not support IRC.  Strong cryptographic
-methods are used to protect SILC packets inside the SILC network.  SILC
-provides all the common conferencing services like channels, channel
-messages, private messages, nicknames, various commands, and secure
-file transfer.  Difference to other chat protocol is in the design of
-the protocol.  The SILC protocol has been designed from the day one
-security in mind and it shows in the protocol design.
-<p>
-
-The packets and messages in the SILC network are always encrypted and
-authenticated.  It is not possible to send unencrypted messages in SILC
-at all.  This assures that end user cannot even accidently send unencrypted
-messages while thinking that it is encrypted.  This is one of the problems 
-of most of the other chat protocols that provide so called plugin encryption.
-They are not secure by default but try to provide security by applying
-external security protocol such as PGP or SSL over the insecure chat
-protocol.  In these cases the security is achieved usually by encrypting the
-data while key management, message authentication and other security issues
-may be left out, leaving the implementation vulnerable to various security
-problems.  The other problem is also that the external protocols tend to
-leave the network only partly secured; usually only two points in the
-network are secured with for example SSL.  While SSL does provide provable
-security it is not enough to provide security for a chat network as a whole.
-<p>
-
-SILC is secure in environment of mutual distrust between entities
-in the network.  It is possible to encrypt messages end to end, so that only
-the sender and the receiver is able to encrypt and decrypt messages.  It
-is also possible to send messages to group of users, so that only the
-specified group of users is able to encrypt and decrypt messages.  Many
-times the protocol use keys that are generated by the servers, so that
-if other external key exchange methods fail the network still remains
-encrypted.  However, it is always possible to negotiate and use locally
-generated keys to secure messages, so that the servers do not know the
-key.
-<p>
-
-Like so many other contemporary chat protocols, SILC too provides
-file transfer.  It is possible to transfer files securely between users
-in the SILC Network.  The actual file transfer stream is always sent
-outside the network peer to peer.  Before the file transfer is started
-a key exchange protocol is executed to negotiate file transfer session
-key.
-<p>
-
-The network topology is also different to various other chat protocols,
-like for example IRC.  IRC has tree style network, but SILC network can be
-described more as an hybrid ring-mesh network.  The routers in the network
-form a ring, but they can also have other direct routers (secondary routes)
-to other routers.  A router in the network is also called a cell, when it
-has multiple servers and clients connected to it.  The cell can also have
-backup routers in case the primary router becomes unresponsive.
-
-<p><br>
-<object data="silc_network.jpg" type="application/postscript">
-<img src="silc_network.png" alt="SILC Network" align="center" border"0">
-</object>
-<p><br>
-
-The diagram above illustrates a portion of the SILC network.  It shows
-two cells that both have several servers, and backup routers and several
-clients.  Clients can connect to server and routers if they want to.
-The following sections will describe the entities of the SILC Network
-in greater detail.
-<p>
-
-
-<p><br>
-<h2>Clients</h2>
-<p>
-
-A client is a piece of software connecting to SILC server.  The software
-is usually run by the end user, a real person that is.  The purpose of the
-clients is to provide the end user an interface to the SILC services.
-They are used to actually engage the conversations on the SILC Network,
-and they can be used to execute various SILC commands.
-<p>
-
-The clients are distinquished from other clients by unique Client ID.
-There cannot be multiple same Client IDs in the SILC Network at the same time.
-The end user, however does not use Client IDs.  The end users usually selects
-a preferred nickname they want to use, and identifies themself with that
-nickname to other users on the network.  The nicknames are not unique in
-the SILC Network.  There can be multiple same nicknames at the same time
-on the network.  The maximum length for the nickname is 128 characters.
-<p>
-
-Most of the other chat protocols have unique nicknames.  This is where SILC
-differs from most of the other chat protocols.  The purpose of this
-feature is to make IRC style nickname wars obsolete, as no one owns their
-nickname; there can always be somene else with the same nickname.
-<p>
-
-When client connects to the server the SILC Key Exchange (SKE) protocol and
-SILC Connection Authentication protocol are executed.  The result of the
-SKE protocol is the session key that the client and server use to secure
-their communication.  All commands, for example, that the client sends
-to the server are secured with the session key.  The session key expires
-periodically and the rekey process can be executed with or without the
-Perfect Forward Secrecy (PFS).  The connection authentication protocol is
-used to authenticate the client to the server.  The server may allow the
-client to connect without authentication, or it may require a passphrase or
-public key based (or certificates) authentication.
-
-
-<p><br>
-<h2>Servers</h2>
-<p>
-
-Servers forms the basis for the SILC Network, by providing a point to which
-clients may connect.  There are two kinds of servers in SILC; normal servers
-and router servers.  The next section describes the function of router
-server.
-<p>
-
-Normal servers connect to router server.  Normal servers cannot directly
-connect to other normal servers.  Messages that are destined outside the
-local server are always sent to the router for further routing.
-The clients usually connect to the normal server, however, clients may
-connect to router servers as well.  The SILC Network diagram above
-illustrates how normal servers connects to the router server.
-<p>
-
-The servers are distinquished by other servers in the network by unique
-Server ID.  There cannot be multiple same Server IDs in the SILC Network
-at the same time.  The servers keep track of local information.  It knows
-all locally connected clients and it knows all channels that its clients
-have joined.  However, it does not know any global information.  It
-usually does not keep track of global clients, however, it may cache
-that information if it was queried.  The reason for this is that the
-server does not need to keep global information up to date and thus
-makes the server faster (and in the end the entire network faster).
-They can always query the information from the router.
-<p>
-
-When server connects to its router the SILC Key Exchange (SKE) protocol
-and the SILC Connection Authentication protocol are executed, just like
-when client connects to server.  The SKE results in to the session key
-that is used to secure the communication between the server and the
-router.  The connection authentication protocol is used to authenticate
-the server to the router.  The authentication is always based in either 
-passphrase or public key (or certificates).
-
-
-<p><br>
-<h2>Routers</h2>
-<p>
-
-The router servers are servers that actually handles the message routing
-in the network.  They are, however also normal servers and they do accept
-client connections.  Each of the router in the network is called a cell.
-A cell can have only one active router and it may have several servers
-and several clients.  The cell, however may have backup routers that can
-take over the tasks of the primary router if it becomes unresponsive.
-The switch to the backup router should be transparent and only local
-connections to the primary router are lost.  Other connections in the
-cell are intact, and clients and servers merely experience some lag in
-the network connection during the switch to the backup router.
-<p>
-
-The normal server knows only local information.  Router server on the
-other hand knows local information and global information.  It considers
-the cell as local and outside cells as global.  It knows all the clients
-connected to the network, all created channels, and all routers and servers
-in the network.  The server may query the global information if it is needed.
-For example, when client sends WHOIS command, the server may query the
-information from the router.  If the router does not know all the details
-that the WHOIS command requires it can query the information from a router
-or a server which knows all the details.  It may then cache that information.
-<p>
-
-The primary purpose of the router server is to route the messages to
-local servers and local clients, and messages that are destined to outside
-the cell are routed to the primary route or some other secondary
-route if it is a faster route.  The routers in the network forms a ring.
-Each router has a primary route to other router in the network.  Finally
-the ring is closed by the last router using the first router in the
-network as its primary route.
-
-<p><br>
-<object data="silc_routers.jpg" type="application/postscript">
-<img src="silc_routers.png" alt="SILC Routers" align="center" border"0">
-</object>
-<p><br>
-
-The diagram above illustrates how the routers forms a ring in the network.
-A router may have several secondary routes which it may use when it
-routes the packets.
-<p>
-
-When routers connect to its primary router the SKE and the SILC Connection
-Authentication protocols are executed just like when normal server connects
-to its router.  The session key is used to secure the communication between
-the routers.  All the secondary routes also have their own session keys.
-
-
-<p><br>
-<h1>SILC Packet Protocol</h1>
-<p>
-
-The basis of SILC protocol relies in the SILC packets and they are with
-out a doubt the most important part of the protocol.  The SILC Packet 
-protocol is a binary packet protocol.  The protocol provides secure
-binary packets and assures that the contents of the packets are secured
-and authenticated.
-<p>
-
-Packets are used in the SILC protocol all the time to send for example
-channel messages, private messages, commands and other information.  All
-packets in SILC network are always encrypted and their integrity is
-assured by computed Message Authentication Codes (MAC).  The protocol
-defines several packet types and packet payloads.  Each packet type
-usually has a specific packet payload that actually defines the contents
-of the packet.  Hence, the actual data in the packet is the packet payload 
-defined in the protocol.
-
-<p><br>
-<object data="silc_packet.jpg" type="application/postscript">
-<img src="silc_packet.png" alt="Typical SILC Packet" align="center" border"0">
-</object>
-<p><br>
-
-As the diagram above illustrates the SILC packet is constructed from the
-SILC Packet Header that is included in all SILC packets, data area that
-includes the packet payloads, and MAC area which assures the integrity of the
-packet.  Entire SILC packet is always encrypted, except for the MAC area
-which is never encrypted.  The encryption process and the key used,
-however depends on the packet payload.  Some of the payloads are encrypted
-with the session key and some are encrypted with other keys, for example
-with channel message keys.  The SILC Packet Header is always encrypted with
-the session key.  The MAC is computed from the SILC Packet Header and the
-data area before encrypting the packet.
-
-
-<p><br>
-<h1>SILC Key Exchange Protocol</h1>
-<p>
-
-SILC Key Exchange Protocol (SKE) is used to exchange shared secret
-between connecting entities.  The result of this protocol is a key material
-used to secure the communication channel.  This protocol is executed when,
-for example client connects to server.  It is also executed when server
-connects to router.  And, there is no reason why it could not be executed
-between two clients too, if two clients would need to create secret key.
-The purpose of the SKE protocol is to create session keys to be used
-in current SILC session.  The SKE is based on the Diffie-Hellman key
-exchange algorithm, and is immune to for example man-in-the-middle attacks 
-by using digital signatures.
-<p>
-
-This is the first protocol that is executed when creating connection to,
-for example SILC server.  All the other protocols are always executed
-after this protocol.  This way all the other protocols are secured since
-the SKE creates the session key that is used to secure all subsequent
-packets.  The session keys created in the SKE are valid only for some
-period of time (usually an hour) or at most until the session ends.
-The rekey process can be executed with or without the Perfect Forward
-Secrecy (PFS).
-<p>
-
-The security properties that are used in the SILC session are also
-negotiated during the SKE.  The protocol has initiator and responder.
-The initator is the one who starts the SKE negotiation and responder is
-the one who receives the SKE negotiation.  When the protocol is started
-initiator sends a list of security properties that it supports.  The
-responder then selects the security properties it supports and sends
-its reply to the initiator.  The security properties includes ciphers,
-hash functions, public key algorithms, HMAC functions and other
-security properties.  The responder can always choose the properties
-it supports.
-<p>
-
-After the security properties are selected the protocol continues
-by performing the Diffie-Hellman key exchange algorithm.  At the same
-time the intiator and responder also sends their public keys or
-certificates to each other.  The initiator and responder also computes a
-signature that the other party will verify.  By default the protocol is
-executed in so called mutual authentication mode, where both of the
-parties computes a signature which are verified by each other
-independently.  This way both of the parties will have prove the
-posession of the private key to the public key they are providing
-in the protocol.  If any of the phases of the protocol are to fail the
-connection is closed immeadiately.
-<p>
-
-The public key or certificate that is received during the SKE protocol
-must be verified.  If it is not verified it would be possible to 
-execute a man-in-the-middle attack against the SKE protocol.  If
-certificates are used they can be verified by a third party Certification
-Authority (CA).  Verifying a public key requires either confirming
-a fingerprint of the public key over phone or email, or the server
-can for example publish the fingerprint (and the public key) on some 
-website.  In real life systems accepting the public key without
-verification, however is often desired.  In many security protocols,
-such as in SSH2, the public key is accepted without verification
-in the first time when the connection is created.  The public key is
-then cached on local hard disk.  When connecting next time to the
-server the public key on local cache is verified against the public
-key server sent.  In real life this works most of the time.  However,
-if client (or server) cannot trust this, it must find some other way
-to verify the received public key or certificate.
-
-
-<p><br>
-<h1>SILC Connection Authentication Protocol</h1>
-<p>
-
-Purpose of SILC Connection Authentication protocol is to authenticate the
-connecting party with server or router.  This protocol is executed when
-for example client connects to server.  It is also executed when server
-connects to router.  Its other purpose is to provide information for the
-server about which type of connection it is.  The type of the connection
-defines whether it is client, server or router.  If it is client then
-the server will create a new Client ID for the client.  If it is server
-then it will except the server to send its Server ID.  Server IDs are
-created by the servers and routers itself.
-<p>
-
-Since the SILC Connection Authentication protocol is always executed after
-the SKE protocol, session keys has been established already.  This means
-that all packets sent in the connection authentication protocol are encrypted 
-and authenticated.
-<p>
-
-The authentication may be based either in passphrase or public key
-encryption.  It is also possible to not require authentication at all.
-If the authentication is based to passphrase the passphrase is sent
-to the server.  As the packet sent by, for example client, is entirely
-encrypted it is safe to send the passphrase inside the packet.
-<p>
-
-If the authentication is based to public key then, for example the client, 
-signs data with its private key and sends it to the server.  The server
-then verifies this signature by using the client's public key.  The
-packet is also encrypted in the case of public key authentication.
-<p>
-
-If the authentication is to fail the connection to the server or router
-will be refused.  If it is successful the connection is granted.  After
-this the client is ready to communicate in the SILC Network.
-
-
-<p><br>
-<h1>Channels</h1>
-<p>
-
-A channel is a named group of one or more clients which will all receive
-messages addressed to that channel.  The channel is created when first
-client joins to it, and the channel ceases to exist when the last client
-leaves it.  When channel exists, any client can reference it using the 
-name of the channel.  Channel is a place where group of people can engage
-conversation.
-<p>
-
-Channel names are unique in the SILC Network.  There cannot be multiple
-same channels in the network at the same time.  However, channel has also
-a Channel ID which is actually used to reference the channel in the
-SILC Network.  The maximum length for the channel name is 256 characters.
-<p>
-
-Channels can have operators that can administrate the channel and operate
-all of its modes.  There are two types of operators on the channel:
-channel founder and channel operator.
-<p>
-
-The channel founder is the client which created the channel.  Channel
-founder is channel operator with some more privileges.  Channel founder
-can operate all of the channel's modes.  Furthermore, channel founder
-privileges cannot be removed by any other operator on channel and channel
-founder cannot be removed from the channel by force.  It is also possible
-for the channel founder to regain its privileges at later time, even if
-they have left the channel.
-<p>
-
-Channel operator is operator that can operate most of the channel's
-modes and administrate the channel.  However, it cannot operate all
-modes which are strictly reserved for channel founder.  Channel operator
-is, however able to adminstrate the channel, set some modes on the
-channel, remove a badly behaving client from the channel, and promote
-other clients to become channel operator.
-
-
-<p><br>
-<h2>Channel Message Delivery</h2>
-<p>
-
-All clients that have joined the channel can send messages to the channel.
-All channel messages are secured and authenticated by channel key.  The
-channel key is generated by the server when the channel is created,
-a client joins the channel, or a client leaves the channel.  The channel
-key is also regenerated periodically.  The reason for the regeneration
-of channel key everytime someone joins or leaves the channel is that
-it prevents new clients joining the channel, and old clients leaving the
-channel, to encrypt or decrypt old or new messages.  They can encrypt
-and decrypt channel messages only when they have joined on the channel.
-<p>
-
-Channel keys are cell specific in the SILC Network.  Each cell that
-have clients joined on a particular channel have also own key for the
-channel.  That key is not shared by other cells in the network.  Inside
-the cell the channel key is known by the router and all servers that
-have clients on the channel and all clients that have joined the channel.
-
-<p><br>
-<object data="silc_channel.jpg" type="application/postscript">
-<img src="silc_channel.png" alt="Channel Message Delivery" align="center" border"0">
-</object>
-<p><br>
-
-The diagram above illustrates typical delivery of channel messages inside
-a cell and between two cells.  Both of the cells have their own channel
-key.  Both cells knows all clients joined on the channel.  When message
-is sent to the channel by an client, it is encrypted with the current
-channel key in that cell.  The servers and the router in the local cell
-then routes the message to all local clients who have joined the channel.
-If the channel has clients that belong to other cell in the network the
-router will route the channel message to that cell.  When channel
-messages are sent between routers they are first decrypted with the
-current channel key, and then re-encrypted with the session key shared
-between the two routers.  The router who receives the channel message
-then decrypts it with the session and re-encrypts it with the
-current channel key in that cell.  It then distributes the channel message
-to all clients on the channel.  The clients who have joined the channel
-always knows the current channel key and can decrypt all channel messages
-they receive.  Note that normal servers in the SILC network never decrypt
-the channel messages even though the have the key.  There is no reason
-for servers to decrypt the message.  The router decrypts the message
-only when sending it between two routers.
-<p>
-
-This method of channel message delivery is the default way to send
-channel messages in the SILC Network.  However, this is not perfect
-solution on all circumstances.  If the clients joined on a particular
-channel cannot trust, or do not want to trust the servers and routers
-in the SILC Network they can consider the fact, that servers and routers
-knows the channel key is actually a breach of security.
-<p>
-
-If the clients on the other hand can trust their servers and routers
-in the SILC Network this is the recommended way of sending channel
-messages.  This method is the simplest method for end user since it
-does not require any special settings before engaging the conversation
-on the channel.  The client merely joins the channel, receives the
-channel key from the server and can start the conversation on the
-channel.
-<p>
-
-In addition of encrypting channel messages it also possible to digitally
-sign all sent channel messages.  The receiver could then verify the
-signature of each of the message using the sender's public key.
-
-
-<p><br>
-<h2>Channel Message Delivery With Channel Private Key</h2>
-<p>
-
-If the clients cannot trust the servers and routers in the SILC Network
-they should not use the default way of sending the channel messages.
-Instead, they should use channel private keys to encrypt and decrypt
-the channel messages.  Channel private keys are keys that are known
-only by the clients who have joined the channel.  Servers and
-routers do not know the key and cannot decrypt the messages.  When
-message is sent between two routers they are merely re-encrypted with
-the session key but not decrypted since the router do not have the
-key to do that.
-<p>
-
-The clients who have joined the channel must first agree on the channel
-private key they are going to use.  The key may generally be anything.
-It may be a passphrase or a random string, or the key may negotiated
-using some key exchange protocol which provides negotiating the
-key for multiple clients at the same time.
-<p>
-
-As the channel private key is actually entirely local setting in the
-client, it is possible to set several channel private keys for one
-channel.  It is possible to have multiple channel private keys that
-are not known by all channel members.  When encrypting messages with
-one channel private key only the clients who have that key can decrypt
-the message.  The other key could be shared for example by all clients
-on the channel and thus all clients can decrypt messages encrypted with
-that key.  In this way it is actually possible to have a private group
-conversation inside the channel while having global conversation at the
-same time.
-
-
-<p><br>
-<h1>Private Messages</h1>
-<p>
-Private messages are messages that are sent from one client to another 
-through the SILC Network.  They are private because they are not sent to
-anyone else except to the true receiver of the message.  Private messages
-can be used to engage private conversation with another client if channels
-are not desired.
-<p>
-
-As all messages in SILC the private message are also encrypted and
-authenticated.  There are several ways to secure private messages.  By
-default private messages are encrypted using the session keys established
-in the SKE protocol.  It is also possible to negotiate a private message
-key between the two clients and encrypt the messages with that key.  It
-is even possible to encrypt the messages with public key cryptosystem,
-if desired.  The next sections will describe all these private message
-delivery methods.
-
-<p>
-The SILC protocol provides these three methods of delivering private messages
-because none of the methods alone can satisfy the security requirements
-of all people.  The end user should decide the acceptable level of risk,
-the required level of security and other security and usability aspects when
-deciding what way of sending private message suites for them.
-<p>
-
-In addition of encrypting private messages it also possible to digitally
-sign all sent private messages.  The receiver could then verify the
-signature of each of the message using the sender's public key.
-
-
-<p><br>
-<h2>Private Message Delivery With Session Keys</h2>
-<p>
-Sending private messages are by default secured with session keys established
-in the SKE protocol.  This means that the private message is always encrypted
-with the session key of the next receiver of the message enroute to the 
-receiving client.  This also means that the message is decrypted and
-re-encrypted everytime it is sent further to the receiving client.
-
-<p><br>
-<object data="silc_priv1.jpg" type="application/postscript">
-<img src="silc_priv1.png" alt="Basic Private Message Delivery" align="center" border"0">
-</object>
-<p><br>
-
-As the diagram above shows the private messages sent by Client A to the
-Client B travels through the SILC Network and is always decrypted and
-re-encrypted with the session key of the next receiver.  The Client B then
-finally decrypts the private messages that is encrypted with the session
-key shared between the Client B and the Server Y.
-<p>
-
-This way of securing private messages is not perfect and cannot be used
-in all circumstances.  If the clients having the conversation cannot trust
-the servers and routers in the SILC Network they should not send private
-messages that are secured in this manner.  Messages secured in this manner
-can be decrypted by the servers and routers that the clients may consider
-to be untrusted.
-<p>
-
-If the clients on the other hand trust the servers and routers in their 
-SILC Network, or they do not care that servers can decrypt their messages,
-sending private messages in this way is very simple from client's point
-of view.  For servers and routers this of course means that they need
-to decrypt and re-encrypt each private message.  Since this way of securing
-private message cannot be used at all times the SILC protocol provides
-other ways of securing private messages.
-
-
-<p><br>
-<h2>Private Message Delivery With Private Message Key</h2>
-<p>
-Private messages can be secured with private message key as well.  This
-key is known only by the sender of the message and the receiver of the
-message.  This way no one else except the sender and the receiver can encrypt
-and decrypt the private messages.  The message is encrypted by the sender
-with the private message key and all the servers and routers pass the message
-through enroute to the receiver.  They cannot decrypt the message since
-they do not have the key.  When sending private messages in this way it
-does not matter whether the clients trust or do not trust the servers and
-routers in the SILC network.
-
-<p><br>
-<object data="silc_priv2.jpg" type="application/postscript">
-<img src="silc_priv2.png" alt="Private Messages with Private Message Key" align="center" border"0">
-</object>
-<p><br>
-
-As the diagram above shows the Client A encrypts the message with private
-message key and sends the message to the SILC Network.  All servers and
-routers merely pass the message through since they cannot decrypt it.
-The Client B then receives the message and decrypts it with the private
-message key.
-<p>
-
-Sending private messages in this manner is always secure since the key is
-shared only by the sender and the receiver.  The problem of this method
-is that the sender and the receiver must somehow agree about the key
-they are going to use.  The private message key can generally be anything.
-It can be a passphrase that only the sender and the receiver knows.  They
-could have been agreed to use some word or phrase as the key sometime
-earlier before they started the conversation.  Or the key maybe from some
-random string from a code book that only the sender and the receiver poses.
-Or it can be a key that is negotiated using some key exchange protocol.
-<p>
-
-The problem however is fundamental.  How to agree to use some key when
-you cannot reach the other person over secure channel?  The SILC protocol
-solves this problem by providing a possiblity to negotiate the key
-between two clients using the SKE protocol.  One or both of the clients
-can set up the SKE server running in their host and ask the other client
-to connect to it.  In this case the SKE is executed outside the SILC
-Network.  As a result of the SKE protocol the clients have now shared
-secret that they can use as private message key.  The key is known only
-by the two clients that executed the SKE protocol.  They can then use
-that key to secure all subsequent private messages.
-<p>
-
-Using this method of private messages delivery is recommended if the
-clients cannot trust the servers and routers in the SILC Network.  The 
-drawback is the extra phase of setting the private message key before
-starting the conversation.  However, using the SKE protocol is the
-recommended way to negotiate the private message key since it can be
-automatized and does not cause any extra tasks for end user.
-
-
-<p><br>
-<h2>Private Message Delivery With Public Key Encryption</h2>
-<p>
-If the clients cannot trust the servers and routers in the SILC Network
-they can use the private message key.  As described in the previous section
-it is easy to set up with the SKE protocol.  However, sometimes the two
-clients do not want to use any passphrases as private message key or
-negotiate the key with SKE, or perhaps they are unable to negotiate the
-key because of some other external problem.  The SILC protocol provides
-yet another way of securing the private messages.  This way does not
-require setting or negotiating private message key.  And, in this method
-also it does not matter whether the clients trust or do not trust the
-servers and routers in the SILC Network.  The method is public key
-encryption.  The clients can encrypt the private messages with the
-receiver's public key and send the message to the network.  The servers
-and routers cannot decrypt the messages since they do not have the
-receiver's private key.  The receiver on the other hand has the private
-key which it uses to decrypt the message.
-<p>
-
-Even this method of private message delivery is not perfect.  The drawbacks
-of this method is that the sender must first assure that the public key
-it is using in the encryption is actually the receiver's public key.
-This is a absolute requirement in this method.  If the sender cannot
-authenticate the receiver's public key this method of private message
-delivery should not be used.  In SILC protocol clients can fetch other
-clients public keys from servers, but the client still must verify the
-key.  Use of certificates can solve the problem.  The receiver's certificate
-could be authenticated by a third party Certification Authority (CA).
-
-<p>
-Usually verifying the public key is not a problem since the receiver
-can provide the public key on some website, or verify the fingerprint of
-the key over email, or phone call.  The clients can also fetch the
-public keys from SILC servers.  If both of the clients trust that the
-public keys are authentic using this method of private message delivery
-is very simple and recommended.
-
-
-<p><br>
-<h1>Secure File Transfers</h1>
-
-The file transfer support in chat protocols are a absolute requirement
-nowadays, and chat protocol without one is no chat protocol at all.  SILC
-also supports file transfer with the addition that the file transfer
-stream is secured.  When a user wants to transfer a file to another
-user, the SILC Key Exchange (SKE) protocol is first executed to negotiate
-a session key for the file transfer stream.  This key is then used to
-protect the peer to peer stream between users.
-<p>
-
-The file transfer protocol used in SILC protocol is the SSH File Transfer
-protocol (SFTP).  Even though the name of the protocol relates to SSH,
-the actual file transfer protocol has nothing to do with Secure Shell.
-The SFTP is totally independent file transfer protocol and its stream
-is secured using SILC.  The SFTP is very good protocol because in addition
-of providing simple file transfer support, it can also support complex
-file and directory manipulation.
-<p>
-
-The support for file transfer in SILC has been designed so that using
-practically any file transfer protocol is possible.  The mandatory protocol
-is SFTP but in the future adding support for other protocols is also
-possible.
-
-
-<p><br>
-<h1>Future of the Protocol</h1>
-
-The current protocol version is 1.0.  This does not mean that the protocol
-is perfect and does not need further development.  There is still features
-that are missing from the protocol, and it is clear that the protocol needs
-to mature a bit more.  There has been a talk about adding features like
-permanent channels, more wide channel founder privileges, and other similar
-features.  The network model of the protocol allows powerful routing
-capabilities, however the routing is not fully defined yet in the protocol
-and requires more in depth work.  The protocol is still in draft phase
-and is open for new features.  However, it is our intention that the
-protocol will be standardized in the future.
-
-
-<p><br>
-<h1>Conclusion</h1>
-
-The Secure Internet Live Conferencing (SILC) protocol is a new generation
-chat protocol that provides all the common conferencing services with
-strong support for security.  It has wide range of security properties
-that should meet the highest levels of security requirements, while not
-forgetting easy of use.  The network topology offers new architectural
-solution with better scalability over traditional chat protocols.
-
-
-<p><br>
-<h1>Further Information</h1>
-<p>
-More detailed information about the SILC protocol is available in the
-SILC protocol specification documents.  There exists currently four
-Internet Drafts that defines the protocol in great detail.  The Internet
-Drafts are available from the following sources but also from the
-<a href="http://www.ietf.org">IETF website</a>.
-<p>
-
-- <a href="http://silcnet.org/docs/draft-riikonen-silc-spec-04.txt">
-Secure Internet Live Conferencing (SILC), Protocol Specification</a>
-<br>
-
-- <a href="http://silcnet.org/docs/draft-riikonen-silc-pp-04.txt">
-SILC Packet Protocol</a>
-<br>
-
-- <a href="http://silcnet.org/docs/draft-riikonen-silc-ke-auth-04.txt">
-SILC Key Exchange and Authentication Protocols</a>
-<br>
-
-- <a href="http://silcnet.org/docs/draft-riikonen-silc-commands-02.txt">
-SILC Commands</a>
-<p>
-
-For comprehensive introduction to cryptography refer to the
-<a href="http://www.ssh.com/tech/crypto/">Cryptography A-2-Z document</a>.
-
-<p><br>
-<a name="terms"></a>
-<h1>Terms and Abbreviations</h1>
-<p>
-
-- Asymmetric cryptosystem
-<p>
-Asymmetric cryptosystem provides public encryption.  It has two keys,
-one public key and one private key (also called as secret key).  The public
-key is publicly available allowing anyone to encrypt messages with the
-public key.  Only the posessor of the private key can decrypt those messages.
-Difference to symmetric cryptosystem is that symmetric cryptosystem use only
-one key, and the key is usually used to both encryption and decryption.  The
-asymmetric cryptosystem is also called as public key encryption, public key
-cryptosystem or public key algorithm.  SILC supports RSA and DSS asymmetric
-cryptosystems.
-<p>
-
-- Authentication
-<p>
-The verification of the identity of a person, host or process in order
-to gain access to a service or prove identity.  In data communications
-it also means verifying the origin of a message.
-<p>
-
-- Certificate
-<p>
-Certificate is a digital document which can be used to verify the 
-identity of a person or host.  In SILC, certificates can be used to prove
-identity of clients, servers and routers.  Basically certificate is a public
-key with subject name.  SILC supports X.509, OpenPGP and SPKI certificates.
-Supported public keys are SILC style public key and SSH2 style public
-key.
-<p>
-
-- Certification Authority (CA)
-<p>
-A third party entity that can verify identity of a person or host.  CA
-is usually external company that provides certificates and their
-verification services.
-<p>
-
-- Diffie-Hellman key exchange
-<p>
-First public key algorithm ever invented.  It is used to generate a secret
-key between two or more parties.  It gets its security from the difficulty
-of calculating discrete logarithms.
-<p>
-
-- Encryption
-<p>
-A mechanism (usually mathematical) to transfer plaintext (or cleartext)
-to ciphertext to provide confidentiality.  A process to transfer
-the ciphertext back to plaintext is called decryption.
-<p>
-
-- Integrity
-<p>
-The verification of data to detect any modifications.  If data is
-modified enroute from the sender to the receiver, the modification will
-be detected.
-<p>
-
-- HMAC
-<p>
-Hash Message Authentication Code.  Also called as keyed hash function.
-It is a secret key authentication algorithm which proves that the message
-is not modified and that the HMAC was computed by the sender of the
-message.
-<p>
-
-- Key management
-<p>
-Key management is a set of processes and mechanisms which support key
-exchange and maintainance of current keying relationships between parties,
-including replacing older keys with new keys as necessary, by executing
-rekey.
-<p>
-
-- Man-in-the-middle attack
-<p>
-An attack against two connecting entities where the attacker executes
-key exchange protocol with both of the parties indepently without
-their knowledge.  Both of the connecting entities will end up having secret
-key with the attacker, and the attacker can encrypt and decrypt all the
-messages that goes between the two entities.
-<p>
-
-- Message Authentication Code (MAC)
-<p>
-MAC provides message integrity by computing the MAC using a secret
-key authentication algorithm (HMAC).
-<p>
-
-- Perfect Forward Secrecy (PFS)
-<p>
-A property of rekey (or key regeneration) which defines whether the
-new key is derived from the old key.  If Perfect Forward Secrecy is
-selected the new key is never dependent of the old key which means
-that if the old key would get compromised at later time it will not
-compromise the new key.  In SILC setting PFS in the SKE protocol means
-executing the SKE protocol again.  If PFS is not selected the new key
-is always derived from the old key.
-<p>
-
-- Rekey
-<p>
-A key regeneration process where the old key has expired or is not
-secure anymore to use.  In this case rekey is performed and new key
-is generated.
-<p>
-
-- Symmetric cryptosystem
-<p>
-Symmetric cryptosystem is one key cryptosystem where one key is used
-usually to both encryption and decryption process.  The symmetric
-cryptosystems are usually significantly faster than asymmetric cryptosystems.
-DES, AES, Twofish and Blowfish are examples of symmetric cryptosystems.
-SILC supports all the common symmetric cryptosystems including AES.
-SILC does not support DES as it is insecure and 3DES as it is too slow.
-
-
-</font>
-
-</body>
-</html>
diff --git a/public_html/img/silc.gif b/public_html/img/silc.gif
deleted file mode 100755 (executable)
index 8e741ba..0000000
Binary files a/public_html/img/silc.gif and /dev/null differ
diff --git a/public_html/index.php b/public_html/index.php
deleted file mode 100644 (file)
index c32506e..0000000
+++ /dev/null
@@ -1,206 +0,0 @@
-<?php
-// 
-// Copyright (c) 2001, Lubomir Sedlacik <salo@silcnet.org>
-// and other members of the SILC Project (http://silcnet.org)
-// All rights reserved.
-// 
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions
-// are met:
-// 
-// 1) Redistributions of source code must retain the above copyright notice,
-//    this list of conditions and the following disclaimer.
-// 2) Redistributions in binary form must reproduce the above copyright
-//    notice, this list of conditions and the following disclaimer in the
-//    documentation and/or other materials provided with the distribution.
-// 3) Neither the name of the SILC Project nor the names of its contributors
-//    may be used to endorse or promote products derived from this software
-//    without specific prior written permission.
-// 
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
-// IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
-// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE
-// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
-// THE POSSIBILITY OF SUCH DAMAGE.
-// 
-
-// Read neccessary stuff if accessible
-  if (@Is_Readable("config.php")) include("config.php");
-  if (@Is_Readable("mirror.php")) include("mirror.php");
-
-?>
-<?xml version="1.0" encoding="iso-8859-1"?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
-"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
- <meta http-equiv="Content-Language" content="en" />
- <meta name="description" content="SILC Secure Internet Live Conferencing" />
- <meta name="keywords" content="SILC silcnet secure chat protocol cipher encrypt encryption SKE private channel conferencing" />
- <meta content="INDEX, FOLLOW" name="ROBOTS" />
- <title> SILC Secure Internet Live Conferencing - 
-<?php
-
-  // sites
-  if ($Country_Code != "")
-    $WWW_Site = $Country_Code.".silcnet.org";
-  else
-    $WWW_Site = "silcnet.org";
-
-  if ($Country_Code != "" && StrToLower($FTP_Archive) == "yes")
-    $FTP_Site = "ftp.".$Country_Code.".silcnet.org";
-  else
-    $FTP_Site = "ftp.silcnet.org";
-
-  if ($Country_Code != "" && StrToLower($CVS_Archive) == "yes"
-                          && $CVS_User && $CVS_Root)
-    $CVS_Site = "cvs.".$Country_Code.".silcnet.org";
-  else {
-    $CVS_Site = "cvs.silcnet.org";
-    $CVS_User = "cvs";
-    $CVS_Root = "/cvs/silc";
-  }
-
-  // find out release dates from release archive files
-  $Date_Toolkit = date("l dS of F Y H:i:s",
-                  filemtime("download/toolkit/sources/silc-toolkit-".$Latest_Toolkit.".tar.gz"));
-  $Date_Client  = date("l dS of F Y H:i:s",
-                  filemtime("download/client/sources/silc-client-".$Latest_Client.".tar.gz"));
-  $Date_Server  = date("l dS of F Y H:i:s",
-                  filemtime("download/server/sources/silc-server-".$Latest_Server.".tar.gz"));
-
-  // remove possibly dangerous characters, only alphanumerical characters are passed
-  function Filter($input) {
-    return EReg_Replace("([^a-zA-Z0-9])*", "", $input);
-  }
-
-  // div();
-  function div($a,$b) {
-    return (int) ($a/$b);
-  }
-
-  $pass = 0;
-  if (@Is_Readable("html/".Filter($page).".php")) {
-    echo $page;
-    $pass = 1;
-  }
-  else
-    echo "news";
-?>
- </title>
- <link href="silc.css" rel="stylesheet" type="text/css" />
-</head>
-<body>
-
-<table width="100%" cellpadding="0" cellspacing ="0" border="0">
-<tr><td align="center">
-
-<table width="700" cellpadding="1" cellspacing="0" border="0">
- <tr>
-  <td class="outline">
-    <table width="100%" cellpadding="0" cellspacing="0" border="0">
-     <tr>
-      <td class="links">
-        <img src="img/silc.gif" width="700" height="100" alt=" " />
-      </td>
-     </tr>
-     <tr>
-      <td class="links" align="center">
-        <table cellspacing="3" cellpadding="10" border="0">
-        <tr><td valign="top" class="links">
-        <b>General</b><br />
-        <small class="normal">o</small> <a href="?page=news" class="normal">SILC News</a><br />
-        <small class="normal">o</small> <a href="?page=about" class="normal">About the SILC</a><br />
-        <small class="normal">o</small> <a href="?page=history" class="normal">History of SILC</a><br />
-        <small class="normal">o</small> <a href="?page=contact" class="normal">Contact Us</a><br />
-        <small class="normal">o</small> <a href="?page=lists" class="normal">SILC Mailing Lists</a><br />
-        </td><td valign="top" class="links">
-        <b>Documentation</b><br />
-        <small class="normal">o</small> <a href="?page=docs" class="normal">SILC Documentation</a><br />
-        <small class="normal">o</small> <a href="?page=whitepaper" class="normal">SILC White Paper</a><br />
-        <small class="normal">o</small> <a href="?page=faq" class="normal">SILC FAQ</a><br />
-        <small class="normal">o</small> <a href="?page=features" class="normal">SILC Features</a><br />
-        <small class="normal">o</small> <a href="?page=todo" class="normal">TODO List</a><br />
-        </td><td valign="top" class="links">
-        <b>Software</b><br />
-        <small class="normal">o</small> <a href="?page=download" class="normal">Download SILC</a><br />
-        <small class="normal">o</small> <a href="?page=mirrors" class="normal">Mirrors Worldwide</a><br />
-        <small class="normal">o</small> <a href="?page=cvs" class="normal">Anonymous CVS</a><br />
-        <small class="normal">o</small> <a href="txt/changes.txt" class="normal">ChangeLog</a><br />
-        <small class="normal">o</small> <a href="?page=copying" class="normal">Licensing</a><br />
-        </td><td valign="top" class="links">
-        <b>Community</b><br />
-        <small class="normal">o</small> <a href="?page=servers" class="normal">Server List</a><br />
-        <small class="normal">o</small> <a href="?page=contribute" class="normal">Contributing</a><br />
-        <small class="normal">o</small> <a href="?page=help" class="normal">Help</a><br />
-        <small class="normal">o</small> <a href="?page=links" class="normal">Links</a><br />
-        <small class="normal">o</small> <a href="txt/credits.txt" class="normal">Credits</a><br />
-        </td></tr></table>
-      </td>
-     </tr>
-     <tr><td class="line"></td></tr>
-     <tr>
-      <td class="<?php if($pass == 1 && $page == "whitepaper") $color="whitepaper"; else $color="text"; echo $color; ?>">
-        <table width="100%" cellpadding="10" cellspacing="0" border="0">
-        <tr><td class="<?php echo $color; ?>">
-<?php
-  // read document, if it is not valid then read opening page
-  if ($pass == 1)
-    include("html/".Filter($page).".php");
-  else
-    include("html/news.php");
-?>
-          </td>
-         </tr>
-<?php
-
-  if ($OS_Type) {
-    switch(StrToLower($OS_Type)) {
-      case "bsd":   $img = "daemon.gif";
-                    $alt = "( daemon powered - IMAGE )";
-                    break;
-      case "linux": $img = "penguin.gif";
-                    $alt = "( penguin powered - IMAGE )";
-                    break;
-      case "sun":   $img = "sun.png";
-                    $alt = "( powered by Sun - IMAGE )";
-                    break;
-    }
-    echo "<tr>";
-    echo "<td align=\"right\" valign=\"bottom\">";
-    echo "&nbsp;<br />";
-    echo "<img src=\"img/".$img."\" alt=\"".$alt."\" />";
-    echo "</td>";
-    echo "</tr>";
-  }
-?>
-        </table>
-      </td>
-     </tr>
-    </table>
-  </td>
- </tr>
-</table>
-<small class="highlight">
-webpage by
-<a href="mailto:salo at silcnet.org" class="small">salo at silcnet.org</a> | 
-<?php
-  // insert counter
-  include("html/counter.php");
-?> | W3C 
-<a href="http://validator.w3.org/check/referer" class="small">XHTML</a> and 
-<a href="http://jigsaw.w3.org/css-validator/check/referer" class="small">CSS</a>
-</small>
-<br /><br />
-
-</td></tr></table>
-
-</body>
-</html>
diff --git a/public_html/silc.css b/public_html/silc.css
deleted file mode 100644 (file)
index a8d8ecf..0000000
+++ /dev/null
@@ -1,115 +0,0 @@
-body {
-  background:      #aaaaaa;
-  color:           #000000;
-  font-family:     Helvetica, Arial, Sans-serif;
-  font-size:       10pt;
-  margin-top:      15px;
-}
-
-a.normal {
-  text-decoration: none;
-  background:      none;
-  color:           #2f486f;
-  font-size:       10pt;
-  font-family:     Helvetica, Arial, Sans-serif;
-}
-
-a.small {
-  text-decoration: none;
-  background:      none;
-  color:           #2f486f;
-  font-size:       8pt;
-  font-family:     Helvetica, Arial, Sans-serif;
-}
-
-td.black {
-  background:      #000000;
-  color:           #ffffff;
-  font-size:       10pt;
-  font-family:     Helvetica, Arial, Sans-serif;
-}
-
-td.grey {
-  background:      #e2e2e2;
-  color:           #000000;
-  font-size:       10pt;
-  font-family:     Helvetica, Arial, Sans-serif;
-}
-
-td.white {
-  background:      #ffffff;
-  color:           #000000;
-  font-size:       10pt;
-  font-family:     Helvetica, Arial, Sans-serif;
-}
-
-td.blackline {
-  background:      #000000;
-  color:           #ffffff;
-  height:          1px;
-}
-
-td.greytext {
-  background:      #e2e2e2;
-  color:           #000000;
-  text-align:      justify;
-  font-size:       10pt;
-  font-family:     Helvetica, Arial, Sans-serif;
-}
-
-td.whitetext {
-  background:      #ffffff;
-  color:           #000000;
-  text-align:      justify;
-  font-size:       10pt;
-  font-family:     Helvetica, Arial, Sans-serif;
-}
-
-small.blue {
-  background:      none;
-  color:           #2f486f;
-  font-size:       8pt;
-  font-family:     Helvetica, Arial, Sans-serif;
-}
-
-small.black {
-  background:      none;
-  color:           #000000;
-  font-size:       8pt;
-  font-family:     Helvetica, Arial, Sans-serif;
-}
-
-big {
-  background:      none;
-  color:           #000000;
-  font-size:       14pt;
-  font-family:     Helvetica, Arial, Sans-serif;
-}
-
-i {
-  background:      none;
-  color:           #2f486f;
-  font-size:       10pt;
-  font-family:     Helvetica, Arial, Sans-serif;
-}
-
-tt.blue {
-  background:      none;
-  color:           #2f486f;
-  font-size:       10pt;
-  font-family:     Courier, monospace;
-}
-
-tt.black {
-  background:      none;
-  color:           #000000;
-  font-size:       10pt;
-  font-family:     Courier, monospace;
-}
-
-samp.blue {
-  background:      none;
-  color:           #2f486f;
-  font-size:       10pt;
-  font-family:     Helvetica, Arial, Sans-serif;
-}
diff --git a/util/robodoc/AUTHORS b/util/robodoc/AUTHORS
deleted file mode 100644 (file)
index 60db402..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-Frans Slothouber <fslothouber@acm.org>
-Jacco van Weert <weertj@xs4all.nl>
-Petteri Kettunen <petterik@iki.fi>   
-Bernd Koesling <KOESSI@CHESSY.aworld.de> 
-Anthon Pang  <apang@mindlink.net>
-Thomas Aglassinger <agi@sbox.tu-graz.ac.at>
-Stefan Kost <kost@imn.htwk-leipzig.de>
-
diff --git a/util/robodoc/COPYING b/util/robodoc/COPYING
deleted file mode 100644 (file)
index 60549be..0000000
+++ /dev/null
@@ -1,340 +0,0 @@
-                   GNU GENERAL PUBLIC LICENSE
-                      Version 2, June 1991
-
- Copyright (C) 1989, 1991 Free Software Foundation, Inc.
-                       59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
-                           Preamble
-
-  The licenses for most software are designed to take away your
-freedom to share and change it.  By contrast, the GNU General Public
-License is intended to guarantee your freedom to share and change free
-software--to make sure the software is free for all its users.  This
-General Public License applies to most of the Free Software
-Foundation's software and to any other program whose authors commit to
-using it.  (Some other Free Software Foundation software is covered by
-the GNU Library General Public License instead.)  You can apply it to
-your programs, too.
-
-  When we speak of free software, we are referring to freedom, not
-price.  Our General Public Licenses are designed to make sure that you
-have the freedom to distribute copies of free software (and charge for
-this service if you wish), that you receive source code or can get it
-if you want it, that you can change the software or use pieces of it
-in new free programs; and that you know you can do these things.
-
-  To protect your rights, we need to make restrictions that forbid
-anyone to deny you these rights or to ask you to surrender the rights.
-These restrictions translate to certain responsibilities for you if you
-distribute copies of the software, or if you modify it.
-
-  For example, if you distribute copies of such a program, whether
-gratis or for a fee, you must give the recipients all the rights that
-you have.  You must make sure that they, too, receive or can get the
-source code.  And you must show them these terms so they know their
-rights.
-
-  We protect your rights with two steps: (1) copyright the software, and
-(2) offer you this license which gives you legal permission to copy,
-distribute and/or modify the software.
-
-  Also, for each author's protection and ours, we want to make certain
-that everyone understands that there is no warranty for this free
-software.  If the software is modified by someone else and passed on, we
-want its recipients to know that what they have is not the original, so
-that any problems introduced by others will not reflect on the original
-authors' reputations.
-
-  Finally, any free program is threatened constantly by software
-patents.  We wish to avoid the danger that redistributors of a free
-program will individually obtain patent licenses, in effect making the
-program proprietary.  To prevent this, we have made it clear that any
-patent must be licensed for everyone's free use or not licensed at all.
-
-  The precise terms and conditions for copying, distribution and
-modification follow.
-\f
-                   GNU GENERAL PUBLIC LICENSE
-   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-
-  0. This License applies to any program or other work which contains
-a notice placed by the copyright holder saying it may be distributed
-under the terms of this General Public License.  The "Program", below,
-refers to any such program or work, and a "work based on the Program"
-means either the Program or any derivative work under copyright law:
-that is to say, a work containing the Program or a portion of it,
-either verbatim or with modifications and/or translated into another
-language.  (Hereinafter, translation is included without limitation in
-the term "modification".)  Each licensee is addressed as "you".
-
-Activities other than copying, distribution and modification are not
-covered by this License; they are outside its scope.  The act of
-running the Program is not restricted, and the output from the Program
-is covered only if its contents constitute a work based on the
-Program (independent of having been made by running the Program).
-Whether that is true depends on what the Program does.
-
-  1. You may copy and distribute verbatim copies of the Program's
-source code as you receive it, in any medium, provided that you
-conspicuously and appropriately publish on each copy an appropriate
-copyright notice and disclaimer of warranty; keep intact all the
-notices that refer to this License and to the absence of any warranty;
-and give any other recipients of the Program a copy of this License
-along with the Program.
-
-You may charge a fee for the physical act of transferring a copy, and
-you may at your option offer warranty protection in exchange for a fee.
-
-  2. You may modify your copy or copies of the Program or any portion
-of it, thus forming a work based on the Program, and copy and
-distribute such modifications or work under the terms of Section 1
-above, provided that you also meet all of these conditions:
-
-    a) You must cause the modified files to carry prominent notices
-    stating that you changed the files and the date of any change.
-
-    b) You must cause any work that you distribute or publish, that in
-    whole or in part contains or is derived from the Program or any
-    part thereof, to be licensed as a whole at no charge to all third
-    parties under the terms of this License.
-
-    c) If the modified program normally reads commands interactively
-    when run, you must cause it, when started running for such
-    interactive use in the most ordinary way, to print or display an
-    announcement including an appropriate copyright notice and a
-    notice that there is no warranty (or else, saying that you provide
-    a warranty) and that users may redistribute the program under
-    these conditions, and telling the user how to view a copy of this
-    License.  (Exception: if the Program itself is interactive but
-    does not normally print such an announcement, your work based on
-    the Program is not required to print an announcement.)
-\f
-These requirements apply to the modified work as a whole.  If
-identifiable sections of that work are not derived from the Program,
-and can be reasonably considered independent and separate works in
-themselves, then this License, and its terms, do not apply to those
-sections when you distribute them as separate works.  But when you
-distribute the same sections as part of a whole which is a work based
-on the Program, the distribution of the whole must be on the terms of
-this License, whose permissions for other licensees extend to the
-entire whole, and thus to each and every part regardless of who wrote it.
-
-Thus, it is not the intent of this section to claim rights or contest
-your rights to work written entirely by you; rather, the intent is to
-exercise the right to control the distribution of derivative or
-collective works based on the Program.
-
-In addition, mere aggregation of another work not based on the Program
-with the Program (or with a work based on the Program) on a volume of
-a storage or distribution medium does not bring the other work under
-the scope of this License.
-
-  3. You may copy and distribute the Program (or a work based on it,
-under Section 2) in object code or executable form under the terms of
-Sections 1 and 2 above provided that you also do one of the following:
-
-    a) Accompany it with the complete corresponding machine-readable
-    source code, which must be distributed under the terms of Sections
-    1 and 2 above on a medium customarily used for software interchange; or,
-
-    b) Accompany it with a written offer, valid for at least three
-    years, to give any third party, for a charge no more than your
-    cost of physically performing source distribution, a complete
-    machine-readable copy of the corresponding source code, to be
-    distributed under the terms of Sections 1 and 2 above on a medium
-    customarily used for software interchange; or,
-
-    c) Accompany it with the information you received as to the offer
-    to distribute corresponding source code.  (This alternative is
-    allowed only for noncommercial distribution and only if you
-    received the program in object code or executable form with such
-    an offer, in accord with Subsection b above.)
-
-The source code for a work means the preferred form of the work for
-making modifications to it.  For an executable work, complete source
-code means all the source code for all modules it contains, plus any
-associated interface definition files, plus the scripts used to
-control compilation and installation of the executable.  However, as a
-special exception, the source code distributed need not include
-anything that is normally distributed (in either source or binary
-form) with the major components (compiler, kernel, and so on) of the
-operating system on which the executable runs, unless that component
-itself accompanies the executable.
-
-If distribution of executable or object code is made by offering
-access to copy from a designated place, then offering equivalent
-access to copy the source code from the same place counts as
-distribution of the source code, even though third parties are not
-compelled to copy the source along with the object code.
-\f
-  4. You may not copy, modify, sublicense, or distribute the Program
-except as expressly provided under this License.  Any attempt
-otherwise to copy, modify, sublicense or distribute the Program is
-void, and will automatically terminate your rights under this License.
-However, parties who have received copies, or rights, from you under
-this License will not have their licenses terminated so long as such
-parties remain in full compliance.
-
-  5. You are not required to accept this License, since you have not
-signed it.  However, nothing else grants you permission to modify or
-distribute the Program or its derivative works.  These actions are
-prohibited by law if you do not accept this License.  Therefore, by
-modifying or distributing the Program (or any work based on the
-Program), you indicate your acceptance of this License to do so, and
-all its terms and conditions for copying, distributing or modifying
-the Program or works based on it.
-
-  6. Each time you redistribute the Program (or any work based on the
-Program), the recipient automatically receives a license from the
-original licensor to copy, distribute or modify the Program subject to
-these terms and conditions.  You may not impose any further
-restrictions on the recipients' exercise of the rights granted herein.
-You are not responsible for enforcing compliance by third parties to
-this License.
-
-  7. If, as a consequence of a court judgment or allegation of patent
-infringement or for any other reason (not limited to patent issues),
-conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License.  If you cannot
-distribute so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you
-may not distribute the Program at all.  For example, if a patent
-license would not permit royalty-free redistribution of the Program by
-all those who receive copies directly or indirectly through you, then
-the only way you could satisfy both it and this License would be to
-refrain entirely from distribution of the Program.
-
-If any portion of this section is held invalid or unenforceable under
-any particular circumstance, the balance of the section is intended to
-apply and the section as a whole is intended to apply in other
-circumstances.
-
-It is not the purpose of this section to induce you to infringe any
-patents or other property right claims or to contest validity of any
-such claims; this section has the sole purpose of protecting the
-integrity of the free software distribution system, which is
-implemented by public license practices.  Many people have made
-generous contributions to the wide range of software distributed
-through that system in reliance on consistent application of that
-system; it is up to the author/donor to decide if he or she is willing
-to distribute software through any other system and a licensee cannot
-impose that choice.
-
-This section is intended to make thoroughly clear what is believed to
-be a consequence of the rest of this License.
-\f
-  8. If the distribution and/or use of the Program is restricted in
-certain countries either by patents or by copyrighted interfaces, the
-original copyright holder who places the Program under this License
-may add an explicit geographical distribution limitation excluding
-those countries, so that distribution is permitted only in or among
-countries not thus excluded.  In such case, this License incorporates
-the limitation as if written in the body of this License.
-
-  9. The Free Software Foundation may publish revised and/or new versions
-of the General Public License from time to time.  Such new versions will
-be similar in spirit to the present version, but may differ in detail to
-address new problems or concerns.
-
-Each version is given a distinguishing version number.  If the Program
-specifies a version number of this License which applies to it and "any
-later version", you have the option of following the terms and conditions
-either of that version or of any later version published by the Free
-Software Foundation.  If the Program does not specify a version number of
-this License, you may choose any version ever published by the Free Software
-Foundation.
-
-  10. If you wish to incorporate parts of the Program into other free
-programs whose distribution conditions are different, write to the author
-to ask for permission.  For software which is copyrighted by the Free
-Software Foundation, write to the Free Software Foundation; we sometimes
-make exceptions for this.  Our decision will be guided by the two goals
-of preserving the free status of all derivatives of our free software and
-of promoting the sharing and reuse of software generally.
-
-                           NO WARRANTY
-
-  11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
-FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
-OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
-PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
-OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS
-TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
-PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
-REPAIR OR CORRECTION.
-
-  12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
-REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
-INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
-OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
-TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
-YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
-PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
-POSSIBILITY OF SUCH DAMAGES.
-
-                    END OF TERMS AND CONDITIONS
-\f
-           How to Apply These Terms to Your New Programs
-
-  If you develop a new program, and you want it to be of the greatest
-possible use to the public, the best way to achieve this is to make it
-free software which everyone can redistribute and change under these terms.
-
-  To do so, attach the following notices to the program.  It is safest
-to attach them to the start of each source file to most effectively
-convey the exclusion of warranty; and each file should have at least
-the "copyright" line and a pointer to where the full notice is found.
-
-    <one line to give the program's name and a brief idea of what it does.>
-    Copyright (C) 19yy  <name of author>
-
-    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; either version 2 of the License, or
-    (at your option) any later version.
-
-    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.
-
-    You should have received a copy of the GNU General Public License
-    along with this program; if not, write to the Free Software
-    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-
-
-Also add information on how to contact you by electronic and paper mail.
-
-If the program is interactive, make it output a short notice like this
-when it starts in an interactive mode:
-
-    Gnomovision version 69, Copyright (C) 19yy name of author
-    Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
-    This is free software, and you are welcome to redistribute it
-    under certain conditions; type `show c' for details.
-
-The hypothetical commands `show w' and `show c' should show the appropriate
-parts of the General Public License.  Of course, the commands you use may
-be called something other than `show w' and `show c'; they could even be
-mouse-clicks or menu items--whatever suits your program.
-
-You should also get your employer (if you work as a programmer) or your
-school, if any, to sign a "copyright disclaimer" for the program, if
-necessary.  Here is a sample; alter the names:
-
-  Yoyodyne, Inc., hereby disclaims all copyright interest in the program
-  `Gnomovision' (which makes passes at compilers) written by James Hacker.
-
-  <signature of Ty Coon>, 1 April 1989
-  Ty Coon, President of Vice
-
-This General Public License does not permit incorporating your program into
-proprietary programs.  If your program is a subroutine library, you may
-consider it more useful to permit linking proprietary applications with the
-library.  If this is what you want to do, use the GNU Library General
-Public License instead of this License.
diff --git a/util/robodoc/ChangeLog b/util/robodoc/ChangeLog
deleted file mode 100644 (file)
index dbc8165..0000000
+++ /dev/null
@@ -1,65 +0,0 @@
-$Id$
-
-This file lists the changes to the archive, not the changes to the 
-ROBODoc source code. These are listed in the main header of 
-Source/robodoc.c.
-
-
-Sep 2000 - Frans Slothouber (V3.2.3)
- o Added a descrip.mms file for compilation under VMS
- o make install installs additional documentation.
-
-July 2000 - Frans Slothouber (V3.2.2)
- o Documentation explains how to use ROBODoc when your sources are
-   in several subdirectories.
- o Documentation explains master index file for LaTeX, how to view
-   the generated documentation, and the new options, NOSOURCE, SINGLEDOC
-   and TITLE.
- o example makefile includes commands to view the
-   generated documentation.
- o Updated the man page
-
-June 2000 - Frans Slothouber (v3.2.1)
-  o Improved documentation, better example makefile.
-
-May 2000 - Frans Slothouber (v3.2)
-  o Added autoconf and automake support.
-
-December 1999 - Frans Slothouber (v3.1e)
-  o Moved the C example in Examples to Examples/C
-  o Added an C++ example in Examples/CPP
-  o Added empty headers for C++ in Headers/ 
-  o More documentation.
-
-December 1999 - Frans Slothouber (v3.1d)
-  o Added list of possible item names to the robodoc man page.
-  o Added list of possible header types to the robodoc man page.
-  o Updated manual with information on the generation of the
-    master index file and new header types.
-
-December 1999 - Frans Slothouber (v3.1c)
-  o Added testheader.c for debug purposes.
-  o Split the source code into serveral files.
-  o Fixed numerous typos in the documentation.
-  o Using m4 to create the html documentation (for table of contents ect).
-  o Added cross links between the documentation and examples.
-
-November 1999 - Frans Slothouber (v3.1b)
-  o Added a man page
-  o Cleaned-up html documentation.
-
-August 1999 - Frans Slothouber:
-  o Added GPL licence
-  o Added INSTALL, README, and TODO
-  o Converted the documentation to HTML
-  o Spell-checked all documentation
-
-
-
-
-
-
-
-
-
-
diff --git a/util/robodoc/Docs/example.c b/util/robodoc/Docs/example.c
deleted file mode 100644 (file)
index 32b1727..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-/****f* Robodoc/RB_Panic [2.0d]
- * NAME
- *   RB_Panic -- Shout panic, free resources, and shut down.
- * SYNOPSIS
- *   RB_Panic (cause, add_info)
- *   RB_Panic (char *, char *)
- * FUNCTION
- *   Prints an error message.
- *   Frees all resources used by robodoc.
- *   Terminates program.
- * INPUTS
- *   cause    - pointer to a string which describes the
- *              cause of the error.
- *   add_info - pointer to a string with additional information.
- * SEE ALSO
- *   RB_Close_The_Shop ()
- * SOURCE
- */
-
-  void RB_Panic (char *cause, char *add_info)
-  {
-    printf ("Robodoc: Error, %s\n",cause) ;
-    printf ("         %s\n", add_info) ;
-    printf ("Robodoc: Panic Fatal error, closing down...\n") ;
-    RB_Close_The_Shop () ; /* Free All Resources */
-    exit(100) ;
-  }
-
-/*******/
diff --git a/util/robodoc/Docs/example_makefile b/util/robodoc/Docs/example_makefile
deleted file mode 100644 (file)
index 30059ff..0000000
+++ /dev/null
@@ -1,121 +0,0 @@
-SHELL = /bin/sh
-.SUFFIXES:
-
-ROBODOC=robodoc
-ROBOOPTS=C SORT 
-
-# Your source files.
-#
-SOURCES=analyser.c generator.c items.c util.c \
-  folds.c headers.c links.c robodoc.c \
-  analyser.h generator.h items.h util.h \
-  folds.h headers.h links.h robodoc.h
-
-# The name of your Project
-#
-PROJECT=ROBODoc
-
-# The various documentation files, derived from the source files.
-# HTML
-#
-HTMLDOCS=$(SOURCES:=.html)
-HTMLXREFS=$(HTMLDOCS:.html=.html.xref)
-HTMLXREFSFILE=$(PROJECT)_html.xrefs
-# LATEX
-#
-LATEXDOCS=$(SOURCES:=.tex)
-LATEXXREFS=$(LATEXDOCS:.tex=.tex.xref)
-LATEXXREFSFILE=$(PROJECT)_tex.xrefs
-# ASCII
-#
-ASCIIDOCS=$(SOURCES:=.txt)
-# RTF
-#
-RTFDOCS=$(SOURCES:=.rtf)
-RTFXREFS=$(RTFDOCS:.rtf=.rtf.xref)
-RTFXREFSFILE=$(PROJECT)_rtf.xrefs
-
-# Some common targets
-xrefall: xrefhtml xreftex xrefrtf
-docall: html tex ascii rtf
-
-# Create the xref files for the various formats.
-xhtml: $(HTMLXREFSFILE) 
-xtex: $(LATEXXREFSFILE) 
-xrtf: $(RTFXREFSFILE)
-
-# Create the documentation files for the various formats.
-html: $(HTMLDOCS) $(PROJECT)_mi.html 
-tex: $(LATEXDOCS) $(PROJECT)_mi.tex
-rtf: $(RTFDOCS)
-ascii: $(ASCIIDOCS)
-
-# master index file, currently works only for html and latex documentation.
-$(PROJECT)_mi.html: $(HTMLXREFSFILE) 
-       $(ROBODOC) $< $@ INDEX HTML TITLE "$(PROJECT) Master Index"
-
-$(PROJECT)_mi.tex: $(LATEXXREFSFILE)
-       $(ROBODOC) $< $@ INDEX LATEX TITLE "$(PROJECT) API Reference"
-
-# create xrefs file (file with the names of all .xref files).
-$(HTMLXREFSFILE) : $(HTMLXREFS)
-       /bin/ls $(HTMLXREFS) > $@
-$(LATEXXREFSFILE) : $(LATEXXREFS)
-       /bin/ls  $(LATEXXREFS) > $@
-$(RTFXREFSFILE) : $(RTFXREFS)
-       /bin/ls  $(RTFXREFS) > $@
-
-# Rule to create an .xref file from a source file for the various formats.
-%.html.xref : %
-       $(ROBODOC) $< $(@:.xref=) $(ROBOOPTS) INTERNAL GENXREF $@
-%.tex.xref : %
-       $(ROBODOC) $< $(@:.xref=) $(ROBOOPTS) INTERNAL GENXREF $@
-%.rtf.xref : %
-       $(ROBODOC) $< $(@:.xref=) $(ROBOOPTS) INTERNAL GENXREF $@
-
-# Rule to create html documentation from a source file.
-%.html : %
-       $(ROBODOC) $< $@ HTML $(ROBOOPTS) XREF $(HTMLXREFSFILE)
-
-# Rule to create latex documentation from a source file.
-# We do not include source items, and generate laxtex documents
-# than can be included in a master document.
-%.tex : %
-       $(ROBODOC) $< $@ LATEX $(ROBOOPTS) NOSOURCE SINGLEDOC XREF $(LATEXXREFSFILE)
-
-# Rule to create ascii documentation from a source file.
-%.txt : %
-       $(ROBODOC) $< $@ ASCII 
-
-# Rule to create rtf documentation from a source file.
-%.rtf : %
-       $(ROBODOC) $< $@ RTF $(ROBOOPTS) XREF $(RTFXREFSFILE)
-
-# Use netscape to view the master index file for our project.
-htmlview: html
-       netscape $(PROJECT)_mi.html
-
-# Use the latex programs to generate a .dvi from the master index file
-# for our prokect. View this .dvi file with xdvi
-texview:  tex
-       latex $(PROJECT)_mi
-       makeindex $(PROJECT)_mi
-       latex $(PROJECT)_mi
-       latex $(PROJECT)_mi
-       xdvi  $(PROJECT)_mi.dvi
-
-# Clean-up the mess we made
-#
-clean:
-       rm -f $(HTMLXREFS) 
-       rm -f $(HTMLDOCS) 
-       rm -f $(LATEXXREFS)
-       rm -f $(LATEXDOCS) 
-       rm -f $(PROJECT)_mi.* *.aux
-       rm -f $(RTFXREFS)
-       rm -f $(RTFDOCS)
-       rm -f $(ASCIIDOCS)
-       rm -f $(HTMLXREFSFILE) 
-       rm -f $(LATEXXREFSFILE) 
-       rm -f $(RTFXREFSFILE)
-
diff --git a/util/robodoc/Docs/general.m4 b/util/robodoc/Docs/general.m4
deleted file mode 100644 (file)
index db7cba7..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-m4_changecom(`/--*--', `--*--/')m4_dnl
-m4_define(`www_docstart', `<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN"><HTML>')m4_dnl
-m4_define(`www_header', `<HEAD><LINK rel=stylesheet href="main.css"><TITLE>$1</TITLE></HEAD>')m4_dnl
-m4_define(`www_link', `<A HREF="$1">$2</A>')m4_dnl
-m4_define(`www_bodystart', `<BODY>')m4_dnl
-m4_define(`www_bodyend', `</BODY>')m4_dnl
-m4_define(`www_docend', `</HTML>')m4_dnl
-m4_define(`www_title', `<H1>$1</H1>')m4_dnl
-m4_define(`www_sectionCounter',0)m4_dnl
-m4_define(`www_subSectionCounter',0)m4_dnl
-m4_define(`www_incrCounter',`m4_define(`$1',m4_incr($1))')m4_dnl
-m4_define(`www_section', `www_incrCounter(`www_sectionCounter') <H2><font color="red">www_sectionCounter  </font><A NAME="$1">$2</A></H2> m4_define(`www_subSectionCounter', 0)')m4_dnl
-m4_define(`www_subSection', `www_incrCounter(`www_subSectionCounter')<H3><font color="red">www_sectionCounter.www_subSectionCounter  </font><A NAME="$1">$2</A></H3>')m4_dnl
-
diff --git a/util/robodoc/Docs/main.css b/util/robodoc/Docs/main.css
deleted file mode 100644 (file)
index 65d0043..0000000
+++ /dev/null
@@ -1,106 +0,0 @@
-BODY { 
-  margin-top: 1em;
-  margin-bottom: 1em;
-  margin-left: 2.5em;
-  margin-right: 2.5em;
-  font-family: sans-serif;
-}
-
-#A:link { 
-#  color: #00FF00; 
-#}
-#A:visited {
-#  color: #003333;  
-#}
-#A:active {
-#  color: #FF00FF;
-#}
-
-p, form {
-  font-family:sans-serif;
-  font-size:12pt; 
-}
-
-#p { text-align: justify; }
-
-B, STRONG, I, EM, CITE, VAR, TT, CODE, KBD, SAMP, IMG
-{ 
- display: inline;
-}
-
-UL {
-  margin-top: 1em;
-  margin-bottom: 1em;
-  list-style-type: disc;
-  display: block;
-}
-
-LI {
-  margin-bottom: 0.2em;
-}
-
-
-B, STRONG { 
-  font-variant: small-caps;
-  font-weight: bold;
-}
-
-I, CITE, EM, VAR, ADDRESS, BLOCKQUOTE { font-style: italic }
-
-PRE, TT, KBD, SAMP { font-family: monospace }
-
-
-TABLE {
-  color: #000000;
-  background-color: #AAAAAA;
-}
-
-TT {
-  white-space: pre;
-}
-
-CODE {
-  font-family: monospace;
-  font-style:none;
-  white-space: pre;
-}
-
-PRE { 
-  white-space: pre;
-  margin-top: 0.5em; 
-}
-
-ADDRESS { 
-  font-family: monospace;
-  font-size: 12pt; 
-  text-align: left;
-  margin-bottom: 0.5em;
-}
-
-
-
-H2, H3 { 
-  margin-top: 0.5em; 
-}
-
-H1, H2, h3 { font-weight: bold }
-
-H1 { 
-  font-family: sans-serif;
-  font-size:24pt; 
-  text-align:right;
-  margin-right:36px;
-  margin-top: 0.5em; 
-  margin-bottom: 0.5em;
-}
-
-H2 { 
-  font-family:sans-serif;
-  font-size:18pt; 
-}
-
-H3 { 
-  font-family:sans-serif;
-  font-size:14pt;  
-}
-
diff --git a/util/robodoc/Docs/makefile.am b/util/robodoc/Docs/makefile.am
deleted file mode 100644 (file)
index 7bed062..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-## Process this file with automake to produce Makefile.in
-
-man_MANS = robodoc.1
-MAINTAINERCLEANFILES = robodoc.html stoc.html stoc.m4
-
-docdir = $(prefix)/doc/$(PACKAGE)-$(VERSION)
-doc_DATA = main.css robodoc.html
-
-#
-# End of automake
-#
-
-#
-# Create the documentation in HTML format
-#
-
-M4=/usr/bin/m4
-
-myclean:
-       rm -f *~ stoc.html stoc.m4 robodoc.html
-       rm -f makefile.in makefile
-
-robodoc.html: robodoc.m4 stoc.html
-       $(M4) -P -DVERSION=$(VERSION) $< > $@  
-stoc.html: stoc.m4 tocgen.m4
-       $(M4) -P $< > $@
-stoc.m4: robodoc.m4
-       echo  "m4_include(tocgen.m4)m4_dnl" > $@
-       egrep "(www).*(ection)" $< >> $@
-
diff --git a/util/robodoc/Docs/makefile.in b/util/robodoc/Docs/makefile.in
deleted file mode 100644 (file)
index 6c71fb1..0000000
+++ /dev/null
@@ -1,260 +0,0 @@
-# makefile.in generated automatically by automake 1.4 from makefile.am
-
-# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
-# This Makefile.in is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
-
-SHELL = @SHELL@
-
-srcdir = @srcdir@
-top_srcdir = @top_srcdir@
-VPATH = @srcdir@
-prefix = @prefix@
-exec_prefix = @exec_prefix@
-
-bindir = @bindir@
-sbindir = @sbindir@
-libexecdir = @libexecdir@
-datadir = @datadir@
-sysconfdir = @sysconfdir@
-sharedstatedir = @sharedstatedir@
-localstatedir = @localstatedir@
-libdir = @libdir@
-infodir = @infodir@
-mandir = @mandir@
-includedir = @includedir@
-oldincludedir = /usr/include
-
-DESTDIR =
-
-pkgdatadir = $(datadir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-
-top_builddir = ..
-
-ACLOCAL = @ACLOCAL@
-AUTOCONF = @AUTOCONF@
-AUTOMAKE = @AUTOMAKE@
-AUTOHEADER = @AUTOHEADER@
-
-INSTALL = @INSTALL@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS)
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-transform = @program_transform_name@
-
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-CC = @CC@
-MAKEINFO = @MAKEINFO@
-PACKAGE = @PACKAGE@
-VERSION = @VERSION@
-
-man_MANS = robodoc.1
-MAINTAINERCLEANFILES = robodoc.html stoc.html stoc.m4
-
-docdir = $(prefix)/doc/$(PACKAGE)-$(VERSION)
-doc_DATA = main.css robodoc.html
-
-#
-# End of automake
-#
-
-#
-# Create the documentation in HTML format
-#
-
-M4 = /usr/bin/m4
-mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
-CONFIG_HEADER = ../Source/config.h
-CONFIG_CLEAN_FILES = 
-man1dir = $(mandir)/man1
-MANS = $(man_MANS)
-
-NROFF = nroff
-DATA =  $(doc_DATA)
-
-DIST_COMMON =  makefile.am makefile.in
-
-
-DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
-
-TAR = gtar
-GZIP_ENV = --best
-all: all-redirect
-.SUFFIXES:
-$(srcdir)/makefile.in: makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) 
-       cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps Docs/makefile
-
-makefile: $(srcdir)/makefile.in  $(top_builddir)/config.status
-       cd $(top_builddir) \
-         && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
-
-
-install-man1:
-       $(mkinstalldirs) $(DESTDIR)$(man1dir)
-       @list='$(man1_MANS)'; \
-       l2='$(man_MANS)'; for i in $$l2; do \
-         case "$$i" in \
-           *.1*) list="$$list $$i" ;; \
-         esac; \
-       done; \
-       for i in $$list; do \
-         if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \
-         else file=$$i; fi; \
-         ext=`echo $$i | sed -e 's/^.*\\.//'`; \
-         inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
-         inst=`echo $$inst | sed '$(transform)'`.$$ext; \
-         echo " $(INSTALL_DATA) $$file $(DESTDIR)$(man1dir)/$$inst"; \
-         $(INSTALL_DATA) $$file $(DESTDIR)$(man1dir)/$$inst; \
-       done
-
-uninstall-man1:
-       @list='$(man1_MANS)'; \
-       l2='$(man_MANS)'; for i in $$l2; do \
-         case "$$i" in \
-           *.1*) list="$$list $$i" ;; \
-         esac; \
-       done; \
-       for i in $$list; do \
-         ext=`echo $$i | sed -e 's/^.*\\.//'`; \
-         inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
-         inst=`echo $$inst | sed '$(transform)'`.$$ext; \
-         echo " rm -f $(DESTDIR)$(man1dir)/$$inst"; \
-         rm -f $(DESTDIR)$(man1dir)/$$inst; \
-       done
-install-man: $(MANS)
-       @$(NORMAL_INSTALL)
-       $(MAKE) $(AM_MAKEFLAGS) install-man1
-uninstall-man:
-       @$(NORMAL_UNINSTALL)
-       $(MAKE) $(AM_MAKEFLAGS) uninstall-man1
-
-install-docDATA: $(doc_DATA)
-       @$(NORMAL_INSTALL)
-       $(mkinstalldirs) $(DESTDIR)$(docdir)
-       @list='$(doc_DATA)'; for p in $$list; do \
-         if test -f $(srcdir)/$$p; then \
-           echo " $(INSTALL_DATA) $(srcdir)/$$p $(DESTDIR)$(docdir)/$$p"; \
-           $(INSTALL_DATA) $(srcdir)/$$p $(DESTDIR)$(docdir)/$$p; \
-         else if test -f $$p; then \
-           echo " $(INSTALL_DATA) $$p $(DESTDIR)$(docdir)/$$p"; \
-           $(INSTALL_DATA) $$p $(DESTDIR)$(docdir)/$$p; \
-         fi; fi; \
-       done
-
-uninstall-docDATA:
-       @$(NORMAL_UNINSTALL)
-       list='$(doc_DATA)'; for p in $$list; do \
-         rm -f $(DESTDIR)$(docdir)/$$p; \
-       done
-tags: TAGS
-TAGS:
-
-
-distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
-
-subdir = Docs
-
-distdir: $(DISTFILES)
-       @for file in $(DISTFILES); do \
-         d=$(srcdir); \
-         if test -d $$d/$$file; then \
-           cp -pr $$d/$$file $(distdir)/$$file; \
-         else \
-           test -f $(distdir)/$$file \
-           || ln $$d/$$file $(distdir)/$$file 2> /dev/null \
-           || cp -p $$d/$$file $(distdir)/$$file || :; \
-         fi; \
-       done
-info-am:
-info: info-am
-dvi-am:
-dvi: dvi-am
-check-am: all-am
-check: check-am
-installcheck-am:
-installcheck: installcheck-am
-install-exec-am:
-install-exec: install-exec-am
-
-install-data-am: install-man install-docDATA
-install-data: install-data-am
-
-install-am: all-am
-       @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-install: install-am
-uninstall-am: uninstall-man uninstall-docDATA
-uninstall: uninstall-am
-all-am: makefile $(MANS) $(DATA)
-all-redirect: all-am
-install-strip:
-       $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install
-installdirs:
-       $(mkinstalldirs)  $(DESTDIR)$(mandir)/man1 $(DESTDIR)$(docdir)
-
-
-mostlyclean-generic:
-
-clean-generic:
-
-distclean-generic:
-       -rm -f Makefile $(CONFIG_CLEAN_FILES)
-       -rm -f config.cache config.log stamp-h stamp-h[0-9]*
-
-maintainer-clean-generic:
-       -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
-mostlyclean-am:  mostlyclean-generic
-
-mostlyclean: mostlyclean-am
-
-clean-am:  clean-generic mostlyclean-am
-
-clean: clean-am
-
-distclean-am:  distclean-generic clean-am
-
-distclean: distclean-am
-
-maintainer-clean-am:  maintainer-clean-generic distclean-am
-       @echo "This command is intended for maintainers to use;"
-       @echo "it deletes files that may require special tools to rebuild."
-
-maintainer-clean: maintainer-clean-am
-
-.PHONY: install-man1 uninstall-man1 install-man uninstall-man \
-uninstall-docDATA install-docDATA tags distdir info-am info dvi-am dvi \
-check check-am installcheck-am installcheck install-exec-am \
-install-exec install-data-am install-data install-am install \
-uninstall-am uninstall all-redirect all-am all installdirs \
-mostlyclean-generic distclean-generic clean-generic \
-maintainer-clean-generic clean mostlyclean distclean maintainer-clean
-
-
-myclean:
-       rm -f *~ stoc.html stoc.m4 robodoc.html
-       rm -f makefile.in makefile
-
-robodoc.html: robodoc.m4 stoc.html
-       $(M4) -P -DVERSION=$(VERSION) $< > $@  
-stoc.html: stoc.m4 tocgen.m4
-       $(M4) -P $< > $@
-stoc.m4: robodoc.m4
-       echo  "m4_include(tocgen.m4)m4_dnl" > $@
-       egrep "(www).*(ection)" $< >> $@
-
-# Tell versions [3.59,3.63) of GNU make to not export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
diff --git a/util/robodoc/Docs/robodoc.1 b/util/robodoc/Docs/robodoc.1
deleted file mode 100644 (file)
index d8814ec..0000000
+++ /dev/null
@@ -1,246 +0,0 @@
-.de EX          \"Begin example
-.ne 5
-.if n .sp 1
-.if t .sp .5
-.nf
-.in +.5i
-..
-.de EE
-.fi
-.in -.5i
-.if n .sp 1
-.if t .sp .5
-..
-
-.TH ROBODoc 1 "V3.2.1 June 1999"
-
-.SH NAME
-
-ROBODoc - Extract documentation from source code.
-
-.SH SYNOPSIS
-.B robodoc
-.I source-file
-.I documentation-file
-.B [options]
-
-.SH DESCRIPTION
-
-ROBODoc extracts specially formated documentation from the source code.
-It allows you to maintain a program and its documentation in a single
-file.
-
-.SH OPTIONS
-
-.IP ASCII
-Generate documentation in ASCII format.
-
-.IP -c
-Show warranty and copyright statement.
-
-.IP C
-Use ANSI C grammar in source items (experimental, HTML only).
-
-.IP FOLD
-Enable folding if HTML output is selected (experimental).
-
-.IP "GENXREF xreffile"
-Generate a xreffile.
-.IP GUIDE
-Generate documentation in Amiga Guide format.
-
-.IP HTML
-Generate documentation in HTML format.
-
-.IP INDEX
-Create a master index file. In this case call robodoc as
-robodoc <xrefsfile> <master index file> INDEX 
-
-.IP INTERNAL
-Also include headers that are marked internal.
-
-.IP INTERNALONLY
-Only extract the headers that are marked internal (that start with ****i*).
-
-.IP NOSOURCE
-Do not include the source items in the documentation.
-
-.IP LATEX
-Generate documentation in LaTeX format.
-
-.IP RTF
-Generate documentation in RTF format.
-
-.IP SINGLEDOC
-Do not create a document header and footer when creating 
-documentation in LaTeX format.  This allows you to include
-the generated documents into big document or 
-master index file.
-
-.IP SORT
-Sort the headers alphabetically.
-
-.IP "TABSIZE <n>"         
-Convert each tab into n spaces.
-
-.IP TITLE 
-Sets the title that is used for the master index file.
-
-.IP TOC
-Generate a table of contents. Is only useful when you select ASCII as
-output mode. With all other output modes the Table of contents is
-generated anyway.
-
-.IP -v
-Verbose mode, robodoc tells what it is doing.
-
-.IP "XREF <xrefsfile>"
-Use the all xref files listed in the file xrefsfile to make
-cross links between documents.
-
-The following abbreviations are also allowed: -s SORT, -t TOC, -x
-XREF, -g GENXREF, -i INTERNAL, -io INTERNALONLY, -ts TABSIZE.
-
-.SH "ITEM NAMES SUPPORTED"
-
-.IP NAME 
-Item's name followed by --, then a short description.
-.IP COPYRIGHT 
-Who own the copyright.
-
-.IP "SYNOPSIS, USAGE"
-How to use it. 
-
-.IP "FUNCTION, DESCRIPTION, PURPOSE"
-What does it do.
-
-.IP AUTHOR 
-Who wrote it.
-
-.IP "CREATION DATE"
-When did the work start.
-
-.IP "MODIFICATION HISTORY, HISTORY"
-Who has done which changes and when.
-
-.IP "INPUTS, ARGUMENTS, OPTIONS, PARAMETERS, SWITCHES"
-What can we feed into it. 
-
-.IP "OUTPUT, SIDE EFFECTS"
-What output is made.
-
-.IP "RESULT, RETURN VALUE"
-What do we get returned.
-
-.IP "EXAMPLE" 
-A clear example of the items use. 
-
-.IP "NOTES"
-Any annotations. 
-
-.IP "DIAGNOSTICS" 
-Diagnostical output. 
-
-.IP "WARNINGS, ERRORS" 
-Warning & error-messages.
-
-.IP BUGS
-Known bugs. 
-
-.IP "TODO, IDEAS" 
-What to implement next & ideas. 
-
-.IP PORTABILITY
-Where does it come from, where will it work.
-
-.IP "SEE ALSO"
-References to other functions, man pages, other documentation.
-
-.IP "METHODS, NEW METHODS"
-OOP methods.
-
-.IP "ATTRIBUTES, NEW ATTRIBUTES"
-OOP attributes, could also be used for structures.
-
-.IP TAGS
-Tagitem description.
-
-.IP COMMANDS
-Command description.
-
-.IP "DERIVED FROM"
-OOP super class.
-
-.IP "DERIVED BY"
-OOP sub class.
-
-.IP "USES, CHILDREN"
-What modules are used by this one.
-
-.IP "USED BY, PARENTS"
-Which modules use this one.
-
-.IP SOURCE
-Source code inclusion.
-
-.SH "HEADER TYPES SUPPORTED"
-
-.IP h
-Header that describes the project.
-
-
-.IP f
-Header for a function.
-
-.IP s
-Header for a structure.
-
-.IP c
-Header for a class.
-
-.IP m
-Header for a method.
-
-.IP v
-Header for a variable
-
-.IP d
-Header for a constant (from define).
-
-.IP i
-Internal header.
-
-.IP *
-Generic header, for everything else.
-
-.SH EXAMPLES
-
-A simple example, you have one tcl source file and want to extract
-the documentation.
-
-.EX
-robodoc wopr.tcl wopr.tcl.html HTML SORT
-.EE
-
-Assume you have a program divided in two source files, gluify.c and
-gluify.h.  To generate the documentation for this program, complete
-with cross links, you would use:
-
-.EX
-echo "gluify.c.xref" > gluify.xrefs
-echo "gluify.h.xref" >> gluify.xrefs
-robodoc gluify.c gluify.c.html HTML GENXREF gluify.c.xref
-robodoc gluify.h gluify.h.html HTML GENXREF gluify.h.xref
-robodoc gluify.c gluify.c.html HTML XREF gluify.xrefs
-robodoc gluify.h gluify.h.html HTML XREF gluify.xrefs
-.EE
-
-.SH SEE ALSO
-
-The documentation in HTML format that comes with ROBODoc.  Latest
-version can be found on http://www.xs4all.nl/~rfsber/Robo/ or on
-http://freshmeat.net/
-
-
diff --git a/util/robodoc/Docs/robodoc.html b/util/robodoc/Docs/robodoc.html
deleted file mode 100644 (file)
index 16a17dd..0000000
+++ /dev/null
@@ -1,1320 +0,0 @@
-
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN"><HTML>
-<HEAD><LINK rel=stylesheet href="main.css"><TITLE>ROBODoc Manual</TITLE></HEAD>
-<BODY>
-<H1>ROBODoc 3.2.3 Manual</H1>
-
-<P><STRONG>Updated July 2000</STRONG></P>
-
-<P>ROBODoc is a documentation tool for C, C++, Java, Assembler, Basic,
-Fortran, LaTeX, Postscript, Tcl/Tk, LISP, Forth, Perl, Shell
-Scripts, Occam, COBOL, HTML and many other languages. Additional
-languages can be supported by a few modifications to the source
-code.</P>
-
-<P>Copyright (C) 1994-2000 Frans Slothouber and Jacco van Weert.</P>
-
-<P>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; either version 2 of
-the License, or (at your option) any later version.</P>
-
-<P>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.</P>
-
-<P>You should have received a copy of the GNU General Public
-License along with this program; if not, write to the Free
-Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-02111-1307 USA</P>
-
-
-
- <H2><font color="red">1  </font><A NAME="creds">Credits</A></H2> 
-
-<UL>
-
-  <LI>Original program and idea: Jacco van Weert</LI> 
-
-  <LI>Versions 2.0 and up: Frans Slothouber, Petteri Kettunen,
-      Bernd Koesling, Anthon Pang, Thomas Aglassinger,
-      and Stefan Kost, Guillaume Etorre, Simo Muinonen,
-      Petter Reinholdtsen.
-  </LI>
-
-  <LI>Maintainer: Frans Slothouber (fslothouber@acm.org),
-      The Netherlands.</LI>
-
-</UL>
-
-
- <H2><font color="red">2  </font><A NAME="toc">Table of Contents</A></H2> 
-
-<STRONG><FONT COLOR="red">01</FONT>......... <A HREF="#creds">Credits</A></STRONG><BR> 
-<STRONG><FONT COLOR="red">02</FONT>......... <A HREF="#toc">Table of Contents</A></STRONG><BR> 
-<STRONG><FONT COLOR="red">03</FONT>......... <A HREF="#INTRO">Introduction</A></STRONG><BR> 
-<STRONG><FONT COLOR="red">04</FONT>......... <A HREF="#HSR">Hardware and software requirements</A></STRONG><BR> 
-<STRONG><FONT COLOR="red">05</FONT>......... <A HREF="#LMT">Goals and Limitations</A></STRONG><BR> 
-<STRONG><FONT COLOR="red">06</FONT>......... <A HREF="#HFCWR">How to Format Your Code for use with ROBODoc</A></STRONG><BR> 
-<STRONG><font color="red">06.01</font>.......... <A HREF="#hname">Header Names</A></STRONG><BR>
-<STRONG><font color="red">06.02</font>.......... <A HREF="#htypes">Header Types</A></STRONG><BR>
-<STRONG><font color="red">06.03</font>.......... <A HREF="#bmar">Begin Marker</A></STRONG><BR>
-<STRONG><font color="red">06.04</font>.......... <A HREF="#rmarker">Remark Marker</A></STRONG><BR>
-<STRONG><font color="red">06.05</font>.......... <A HREF="#emar">End Marker</A></STRONG><BR>
-<STRONG><font color="red">06.06</font>.......... <A HREF="#hitem">Header Items</A></STRONG><BR>
-<STRONG><font color="red">06.07</font>.......... <A HREF="#inlimits">Item Name Limitations</A></STRONG><BR>
-<STRONG><font color="red">06.08</font>.......... <A HREF="#SI">Source Item</A></STRONG><BR>
-<STRONG><FONT COLOR="red">07</FONT>......... <A HREF="#CLD">Creating Cross Links</A></STRONG><BR> 
-<STRONG><font color="red">07.01</font>.......... <A HREF="#limits">Limitations</A></STRONG><BR>
-<STRONG><FONT COLOR="red">08</FONT>......... <A HREF="#MAIND">Master Index File</A></STRONG><BR> 
-<STRONG><font color="red">08.01</font>.......... <A HREF="#MIEXM">examples</A></STRONG><BR>
-<STRONG><FONT COLOR="red">09</FONT>......... <A HREF="#makefile">Automation with <TT>make</TT></A></STRONG><BR> 
-<STRONG><FONT COLOR="red">10</FONT>......... <A HREF="#MDSO">What to do if You have Sources in Multiple Directories</A></STRONG><BR> 
-<STRONG><FONT COLOR="red">11</FONT>......... <A HREF="#RDF">The ROBODoc Defaults File</A></STRONG><BR> 
-<STRONG><FONT COLOR="red">12</FONT>......... <A HREF="#UOB">ROBODoc Command Line Options</A></STRONG><BR> 
-<STRONG><FONT COLOR="red">13</FONT>......... <A HREF="#ADV">Adding New Languages</A></STRONG><BR> 
-<STRONG><FONT COLOR="red">14</FONT>......... <A HREF="#SAB">Suggestions and Bugs</A></STRONG><BR> 
-
-
-
-
- <H2><font color="red">3  </font><A NAME="INTRO">Introduction</A></H2> 
-
-<P>ROBODoc is based on the AutoDocs program written some time ago
-by Commodore.  The idea is to include for every function a
-standard header containing all sorts of information about that
-procedure/function.  An AutoDocs program extracts these headers
-from the source file and puts them in an autodocs file.  This
-allows you to include the program documentation in the source
-code and makes it unnecessary to maintain two documents.</P>
-
-
-<P>ROBODoc is such a program, however ROBODoc has several
-additions.  For one it can generate the documentation in
-different formats, ASCII, HTML, RTF, LaTeX, and AmigaGuide.
-Another feature is that it automatically creates links within the
-document, and to other documents.  It is also possible to include
-parts of the source in you documentation, complete with links.
-For instance it is possible to include the complete source code
-of a function, and have the function names in the source point to
-their documentation. Besides documenting functions, you can also
-document classes, methods, structures, variables, and
-constants.</P>
-
-
-<P>If you never have used AutoDoc or ROBODoc before you might
-take a look at the example in the <TT>Source/</TT>.  Run the
-command:</P>
-
-<PRE>
-  make xhtml
-  make example
-</PRE>
-
-
-<P>This creates the ROBODoc
-<A HREF="../Source/ROBODoc_mi.html">documentation</A> for the
-ROBODoc program itself and then starts netscape to view the
-documentation. Also have a look at the source files, they
-illustrates the use of headers.</P>
-
-<P>ROBODoc can generate documentation in five different
-formats:</P>
-
-<UL>
-  <LI>HTML format complete with hyperlinks and mark-ups.</LI>
-
-  <LI>LaTeX, based on D. Knuth excellent typesetting system.</LI>
-
-  <LI>Plain ASCII text file, this file is very close to what the
-      original AutoDocs program would generate.</LI>
-
-  <LI>RTF, Rich Text Format, mostly used on Windows machines
-      before WWW revolution.</LI>
-
-  <LI>AmigaGuide format, it is the Amiga computer's equivalent
-      HTML. The AmigaGuide program is necessary to view the
-      resulting autodocs-file. (This was the preferred format when the
-      program was written in 1994.)</LI>
-
-</UL>
-
-
- <H2><font color="red">4  </font><A NAME="HSR">Hardware and software requirements</A></H2> 
-
-<P>ROBODoc was developed in 1994 on a standard Amiga 1200, a
-system with a 20MHz 68020 processor and 2 Mbyte of RAM. It should
-therefore be no problem to run it on any of the currently
-available systems :) The complete source code consists of a
-series of file that can be found in the <TT>Source</TT>
-directory.  It is written according (hopefully) to the ANSI C
-standard and uses no special functions, so it should run on every
-system with an ANSI C-compiler.</P>
-
-
- <H2><font color="red">5  </font><A NAME="LMT">Goals and Limitations</A></H2> 
-
-<P>ROBODoc is intended for small to medium sized projects 
-that have a relatively flat structure and especially projects 
-that use a mix of different programming languages.</P>
-
-<P>
-ROBODoc was designed to be easy to use and to work with a lot of
-different programming languages.  It has no knowledge of the
-syntax of a programming languages.  It just some knowledge about
-how remarks start and end in some programming languages. This
-means that you sometimes have to do a little more work compared
-to other tools that have detailed knowledge of the syntax of a
-particular language.  They can use that knowledge to figure out
-some of the information automatically.  This usually also means
-that they work only with one or two languages.
-</P>
-
-<P>ROBODoc operates on one file at a time.  It has no mechanism to
-process whole sets of source files. Makefiles should be used for
-this.  How to do this is explained in this document with various
-example makefiles. Have a look at them.
-</P>
-
-<P>ROBODoc can work with projects where the source code is located
-in different subdirectories. However the generated documentation is
-expected to go into one single directory.</P>
-
-
- <H2><font color="red">6  </font><A NAME="HFCWR">How to Format Your Code for use with ROBODoc</A></H2> 
-
-<P>ROBODoc allows you to mix the program documentation with the
-source code.  It does require though that this documentation has
-a particular layout so ROBODoc can recognize it. The following
-header was taken from the original ROBODoc program (many versions
-back).</P>
-
-<TABLE>
-<TR>
-<TD>
-<PRE>
-           <FONT COLOR="red">------------------------------- Header Name</FONT>
-          <FONT COLOR="red">/                          \</FONT>
-  /****f* financial.library/StealMoney  <FONT COLOR="red">&lt;---- Begin Marker</FONT>
-  *    <FONT COLOR="red">^------- Header Type</FONT>
-  *
-  *  <FONT COLOR="red">&lt;---- Remark Marker</FONT>
-  *  NAME
-  *    StealMoney -- Steal money from the Federal Reserve Bank. (V77)
-  *  SYNOPSIS  <FONT COLOR="red">&lt;---- Item Name</FONT>
-  *    error = StealMoney( userName,amount,destAccount,falseTrail )
-  *    D0,Z                D0       D1.W    A0         [A1]
-  *
-  *    BYTE StealMoney
-  *         ( STRPTR,UWORD,struct AccountSpec *,struct falseTrail *);
-  *  FUNCTION
-  *    Transfer money from the Federal Reserve Bank into the
-  *    specified interest-earning checking account.  No records of
-  *    the transaction will be retained.
-  *  INPUTS
-  *    userName    - name to make the transaction under.  Popular
-  *                  favorites include "Ronald Reagan" and
-  *                  "Mohamar Quadaffi".
-  *    amount      - Number of dollars to transfer (in thousands).
-  *    destAccount - A filled-in AccountSpec structure detailing the
-  *                  destination account (see financial/accounts.h).
-  *                  If NULL, a second Great Depression will be
-  *                  triggered.
-  *    falseTrail  - If the DA_FALSETRAIL bit is set in the
-  *                  destAccount, a falseTrail structure must be
-  *                  provided.
-  *  RESULT
-  *    error - zero for success, else an error code is returned
-  *           (see financial/errors.h).  The Z condition code
-  *           is guaranteed.
-  *  EXAMPLE
-  *    Federal regulations prohibit a demonstration of this function.
-  *  NOTES
-  *    Do not run on Tuesdays!
-  *  BUGS
-  *    Before V88, this function would occasionally print the
-  *    address and home phone number of the caller on local police
-  *    976 terminals.  We are confident that this problem has been
-  *    resolved.
-  *  SEE ALSO
-  *    CreateAccountSpec(),security.device/SCMD_DESTROY_EVIDENCE,
-  *    financial/misc.h
-  *
-  ******  <FONT COLOR="red">&lt;---- End Marker</FONT>
-  *
-  * You can use this space for remarks that should not be included
-  * in the documentation.
-  *
-  */
-</PRE>
-</TD>
-</TR>
-</TABLE>
-
-<P>You would place this headers in front of functions, classes,
-methods, structure definitions, or any of the major components in
-your program.  The header itself contains a number of items that
-provide structured information about the component. </P>
-
-<P>There are a number of special markers in a header (indicated
-in red above).  There are two special markers that mark the begin
-and end of a header.  Each line in a header should start with a
-remark marker.  The starts of each item is marked by an Item Name
-(in all capitals).</P>
-
-
-<H3><font color="red">6.1  </font><A NAME="hname">Header Names</A></H3>
-
-<P>ROBODoc makes some assumptions about the structure a project.
-It assumes that a project consists of a number of modules, and
-that each module consists of a number of components.  These
-components can be anything that you care to document; functions,
-variables, structures, classes, methods etc.</P>
-
-<P> Projects, modules, and components all have names.  The names
-allow ROBODoc to structure the documentation and create
-cross-links. Names are defined in the header name.  It is either
-of the form <TT> &lt;project name&gt;/&lt;module name&gt;</TT>
-for a module header, or of the form <TT>&lt;module
-name&gt;/&lt;component name&gt;</TT> for all other headers.</P>
-
-<H3><font color="red">6.2  </font><A NAME="htypes">Header Types</A></H3>
-
-<P>You can provide ROBODoc with some additional information
-by specifying the header type.  The header type tells ROBODoc
-what kind of component you are documenting. This information
-allows ROBODoc to create more useful index tables.</P>
-
-<P>The type is identified by a single character, as listed in the
-following table</P>
-
-<TABLE>
-<TR><TD>h</TD><TD>Header for a module in a project.</TD></TR>
-<TR><TD>f</TD><TD>Header for a function.</TD></TR>
-<TR><TD>s</TD><TD>Header for a structure.</TD></TR>
-<TR><TD>c</TD><TD>Header for a class.</TD></TR>
-<TR><TD>m</TD><TD>Header for a method.</TD></TR>
-<TR><TD>v</TD><TD>Header for a variable.</TD></TR>
-<TR><TD>d</TD><TD>Header for a constant 
-(from <STRONG>d</STRONG>efine).</TD></TR>
-<TR><TD>*</TD><TD>Generic header for every thing else.</TD></TR>
-<TR><TD>i</TD><TD>Internal header.</TD></TR>
-</TABLE>
-
-<P>Internal headers are special. They can be used to hide certain
-headers. They are only extracted if requested. You could use to
-document internal functions that you do now want clients to
-see.</P>
-
-
-<H3><font color="red">6.3  </font><A NAME="bmar">Begin Marker</A></H3>
-
-<P>The beginning of a header is marked with a special marker.
-The above header is intended for a program in C.  In other
-programming languages the marker looks slightly different, since
-each language has its own convention for starting remarks.
-ROBODoc recognizes the following begin markers:</P>
-
-<TABLE >
-<TR><TD><TT>"/****"</TT>
-    <TD>C, C++</TD>
-</TR>
-<TR><TD><TT>"//****"</TT></TD>
-    <TD>C++</TD>
-</TR>
-<TR><TD><TT>";****"</TT></TD>
-    <TD>Assembler</TD>
-</TR>
-<TR><TD><TT>"****"</TT></TD>
-    <TD>Assembler</TD>
-</TR>
-<TR><TD><TT>"{****"</TT></TD>
-    <TD>Pascal</TD>
-</TR>
-<TR><TD><TT>"REM ****"</TT></TD>
-    <TD>Basic (Rem, rem, or even rEM also works)</TD>
-</TR>
-<TR><TD><TT>"C     ****"</TT></TD>
-    <TD>Fortran (c     **** also works)</TD>
-</TR>
-<TR><TD><TT>"%****"</TT></TD>
-    <TD>LaTeX, TeX, Postscript.</TD>
-</TR>
-<TR><TD><TT>"#****"</TT></TD>
-    <TD>Tcl/Tk, Perl, makefiles, gnuplot etc.</TD>
-</TR>
-<TR><TD><TT>"(****"</TT></TD>
-    <TD>Pascal, Modula-2, LISP</TD>
-</TR>
-<TR><TD><TT>"--****"</TT></TD>
-    <TD>Occam</TD>
-</TR>
-<TR><TD><TT>"&lt;!--****"</TT></TD>
-    <TD>HTML</TD>
-</TR>
-<TR><TD><TT>"&lt;!---****"</TT></TD>
-    <TD>HTML</TD>
-</TR>
-<TR><TD><TT>"|****"</TT></TD>
-    <TD>GNU Assembler</TD>
-</TR>
-<TR><TD><TT>"!!****"</TT></TD>
-    <TD>Fortran 90</TD>
-</TR>
-</TABLE>
-
-<P>After these initial four asterisks, there is the character to
-identify the kind of header, then another asterisks, and then
-header name. After this you can specify a version number
-surrounded by "[]". The version number is stored but not used for
-anything at the moment. All characters after that are
-ignored.</P>
-
-<P>This might sound terribly complicated, it is not. Here are
-some examples:</P>
-
-<P>A header for a module called analyser in a project called ChessMaster
-for C, is has version number 1.0</P>
-<PRE>
-  /****h* ChessMaster/analyser [1.0] *
-</PRE>
-
-<P>In Assembler, a function header, for the function init() in the 
-  module finance.library:</P>
-<PRE>
-  ****f* finance.library/init *
-</PRE>
-
-<P>In C++, a class header for class Puppet, for the module puppetmaster,
-version v2.12</P> 
-<PRE>
-  /****c* puppetMaster/Puppet [v2.12] ******
-</PRE>
-
-<P>For the same class a method called Puppet::Talk</P>
-<PRE>
-  /****m* puppetMaster/Puppet::Talk [v2.12] ******
-</PRE>
-
-<P>A project header, in Fortran</P>
-<PRE>
-  C     ****h* ChessMaster/analyser              C
-</PRE>
-
-<P>In Basic</P>
-<PRE>
-  REM ****h* ChessMaster/analyser
-</PRE>
-
-
-
-<H3><font color="red">6.4  </font><A NAME="rmarker">Remark Marker</A></H3>
-
-<P>Each line in the body of a header should start with a remark
-marker.  This marker is stripped from the line and the remaining
-part is used to generated the documentation.  The following
-markers are recognized by ROBODoc.</P>
-
-<TABLE >
-<TR><TD><TT>"*"</TT></TD>
-    <TD>C, C++, Pascal, Modula-2</TD>
-</TR> 
-<TR><TD><TT>"//"</TT></TD>
-    <TD>C++</TD>
-</TR> 
-<TR><TD><TT>" *"</TT></TD>
-    <TD>C, C++, M68K assembler, Pascal, Modula-2, HTML</TD>
-</TR> 
-<TR><TD><TT>";*"</TT></TD>
-    <TD>M68K assembler</TD>
-</TR> 
-<TR><TD><TT>";"</TT></TD>
-    <TD>M68K assembler</TD>
-</TR> 
-<TR><TD><TT>"C    "</TT></TD>
-    <TD>Fortran</TD>
-</TR> 
-<TR><TD><TT>"REM "</TT></TD>
-    <TD>BASIC</TD>
-</TR> 
-<TR><TD><TT>"%"</TT></TD>
-    <TD>LaTeX, TeX, Postscript</TD>
-</TR> 
-<TR><TD><TT>"#"</TT></TD>
-    <TD>Tcl/Tk, shell scripts, makefiles</TD>
-</TR> 
-<TR><TD><TT>"      *"</TT></TD>
-    <TD>COBOL</TD>
-</TR> 
-<TR><TD><TT>"--"</TT></TD>
-    <TD>Occam</TD>
-</TR> 
-<TR><TD><TT>"|"</TT></TD>
-    <TD>GNU Assembler</TD>
-</TR>
-<TR><TD><TT>"!!"</TT></TD>
-    <TD>Fortan 90</TD>
-</TR>
-</TABLE>
-
-
-
-
-<H3><font color="red">6.5  </font><A NAME="emar">End Marker</A></H3>
-
-<P>A header ends with an end marker.  An end marker is a remark
-marker followed by three asterisks.  ROBODoc recognizes following
-strings as end markers:</P>
-
-<TABLE >
-<TR><TD><TT>"/***"</TT></TD>
-    <TD> C, C++ </TD></TR>
-<TR><TD><TT>"//***"</TT></TD>
-    <TD> C++ </TD></TR>
-<TR><TD><TT>" ****"</TT></TD>
-    <TD> C, C++, Pascal, Modula-2 </TD></TR>
-<TR><TD><TT>"{***"</TT></TD>
-    <TD> Pascal </TD></TR>
-<TR><TD><TT>"(***"</TT></TD>
-    <TD> Pascal, Modula-2, B52 LISP</TD></TR>
-<TR><TD><TT>";***"</TT></TD>
-    <TD> M68K assembler </TD></TR>
-<TR><TD><TT>"****"</TT></TD>
-    <TD> M68K assembler </TD></TR>
-<TR><TD><TT>"C     ***"</TT></TD>
-    <TD> Fortran </TD></TR>
-<TR><TD><TT>"REM ***"</TT></TD>
-    <TD> BASIC </TD></TR>
-<TR><TD><TT>"%***"</TT></TD>
-    <TD> LaTeX, TeX, Postscript </TD></TR>
-<TR><TD><TT>"#***"</TT></TD>
-    <TD> Tcl/Tk, Perl, Makefiles, Shell scripts </TD></TR>
-<TR><TD><TT>"      ****"</TT></TD>
-    <TD> COBOL </TD></TR>
-<TR><TD><TT>"--***"</TT></TD>
-    <TD> Occam </TD></TR>
-<TR><TD><TT>"&lt;!--***"</TT></TD>
-    <TD> HTML </TD></TR>
-<TR><TD><TT>"&lt;!---***"</TT></TD>
-    <TD> HTML </TD></TR>
-<TR><TD><TT>"|***"</TT></TD>
-    <TD>GNU Assembler</TD></TR>
-<TR><TD><TT>"!!***"</TT></TD>
-    <TD>Fortan 90</TD></TR>
-</TABLE>
-
-
-
-
-<H3><font color="red">6.6  </font><A NAME="hitem">Header Items</A></H3>
-
-<P>When ROBODoc has found a header it will try to identify the
-items in this header.  It does this by looking for the item name. The following
-item names are currently supported:</P>
-
-<TABLE >
-<TR><TD> NAME </TD>
-    <TD> Item name plus a short description. </TD> 
-<TR><TD> COPYRIGHT </TD>
-    <TD> Who own the copyright : "(c) &lt;year&gt;-&lt;year&gt; by 
-         &lt;company/person&gt;" </TD>
-<TR><TD> SYNOPSIS, USAGE </TD>
-    <TD> How to use it. </TD>
-<TR><TD> FUNCTION, DESCRIPTION,  PURPOSE </TD>
-    <TD> What does it do. </TD>
-<TR><TD> AUTHOR </TD>
-    <TD>Who wrote it. </TD> 
-<TR><TD> CREATION DATE </TD>
-    <TD> When did the work start. </TD> 
-<TR><TD> MODIFICATION HISTORY,  HISTORY </TD>
-    <TD> Who has done which changes and when. </TD>
-<TR><TD> INPUTS, ARGUMENTS, OPTIONS, PARAMETERS, SWITCHES </TD>
-    <TD> What can we feed into it.  </TD>
-<TR><TD> OUTPUT, SIDE EFFECTS </TD>
-    <TD> What output is made. </TD>
-<TR><TD> RESULT, RETURN VALUE </TD>
-    <TD> What do we get returned. </TD>
-<TR><TD> EXAMPLE  </TD>
-    <TD> A clear example of the items use. </TD> 
-<TR><TD> NOTES </TD>
-    <TD> Any annotations </TD> 
-<TR><TD> DIAGNOSTICS  </TD>
-    <TD>Diagnostical output  </TD>
-<TR><TD> WARNINGS, ERRORS  </TD>
-    <TD> Warning & error-messages. </TD>
-<TR><TD> BUGS </TD>
-    <TD> Known bugs. </TD> 
-<TR><TD> TODO, IDEAS  </TD>
-    <TD> What to implement next & ideas. </TD> 
-<TR><TD> PORTABILITY </TD>
-    <TD> Where does it come from, where will it work. </TD>
-<TR><TD> SEE ALSO </TD>
-    <TD> References to other functions, man pages, other documentation. </TD>
-<TR><TD> METHODS, NEW METHODS </TD>
-    <TD> OOP methods. </TD>
-<TR><TD> ATTRIBUTES, NEW ATTRIBUTES </TD>
-    <TD> OOP attributes  </TD>
-<TR><TD> TAGS </TD>
-    <TD> Tag-item description. </TD>
-<TR><TD> COMMANDS </TD>
-    <TD> Command description. </TD> 
-<TR><TD> DERIVED FROM </TD>            
-    <TD> OOP super class. </TD>
-<TR><TD> DERIVED BY </TD>
-    <TD> OOP sub class. </TD>
-<TR><TD> USES, CHILDREN        </TD>
-    <TD> What modules are used by this one. </TD> 
-<TR><TD> USED BY, PARENTS </TD>
-    <TD> Which modules do use this one. </TD> 
-<TR><TD> SOURCE </TD>
-    <TD> Source code inclusion. </TD> 
-</TABLE>
-
-<P>ROBODoc does this so that it can format each item with a
-different style (colour, font, etc.) if the user want it.  These
-can be specified in the robodoc.defaults file, see the next
-section more information.</P>
-
-
-<H3><font color="red">6.7  </font><A NAME="inlimits">Item Name Limitations</A></H3>
-
-<P>If you happen to have a function which name is in all uppercase,
-this sometimes conflicts with where ROBODoc thinks an item name
-starts and where the item body starts.
-Bernhard Roessmann suggest the following workaround:
-Example header producing this error:</P>
-<PRE>
-/***** basic.c/RETURN
-* NAME
-*  RETURN : Return from subroutine
-* SYNOPSIS
-*  RETURN
-* FUNCTION
-*  Return from subroutine
-******/
-</PRE>
-<P>Here the item name  "FUNCTION" will be interpreted as ordinary text, 
-not as an item name.  Workaround: Add an empty line:</P>
-<PRE>
-/***** basic.c/RETURN
-* NAME
-*  RETURN : Return from subroutine
-* SYNOPSIS
-*  RETURN
-*
-* FUNCTION
-*  Return from subroutine
-******/
-</PRE>
-
-
-
-<H3><font color="red">6.8  </font><A NAME="SI">Source Item</A></H3>
-
-<P>The source item allows you to include part of the source in
-the documentation as is demonstrated by the following
-example.</P>
-
-<TABLE><TR><TD><PRE>
-/****f* Robodoc/RB_Panic [2.0d]
- * NAME
- *   RB_Panic -- Shout panic, free resources, and shut down.
- * SYNOPSIS
- *   RB_Panic (cause, add_info)
- *   RB_Panic (char *, char *)
- * FUNCTION
- *   Prints an error message.
- *   Frees all resources used by robodoc.
- *   Terminates program.
- * INPUTS
- *   cause    - pointer to a string which describes the
- *              cause of the error.
- *   add_info - pointer to a string with additional information.
- * SEE ALSO
- *   RB_Close_The_Shop ()
- * SOURCE
- */
-
-  void RB_Panic (char *cause, char *add_info)
-  {
-    printf ("Robodoc: Error, %s\n",cause) ;
-    printf ("         %s\n", add_info) ;
-    printf ("Robodoc: Panic Fatal error, closing down...\n") ;
-    RB_Close_The_Shop () ; /* Free All Resources */
-    exit(100) ;
-  }
-
-/*******/
-
-</PRE></TD></TABLE>
-
-<P>This would create the following documentation</P>
-
-<TABLE><TR><TD>
-<FONT SIZE="+1">NAME</FONT>
-<PRE><EM>   <B>RB_Panic</B> -- Shout panic, free resources, and shut down.
-</EM></PRE><FONT SIZE="+1">SYNOPSIS</FONT>
-<PRE>   <B>RB_Panic</B> (cause, add_info)
-   <B>RB_Panic</B> (char *, char *)
-</PRE><FONT SIZE="+1">FUNCTION</FONT>
-<PRE>   Prints an error message.
-   Frees all resources used by robodoc.
-   Terminates program.
-</PRE><FONT SIZE="+1">INPUTS</FONT>
-<PRE>   cause    - pointer to a string which describes the
-              cause of the error.
-   add_info - pointer to a string with additional information.
-</PRE><FONT SIZE="+1">SEE ALSO</FONT>
-<PRE>   RB_Close_The_Shop ()
-</PRE><FONT SIZE="+1">SOURCE</FONT>
-<PRE>      void <B>RB_Panic</B> (char *cause, char *add_info)
-      {
-        printf ("Robodoc: Error, %s\n",cause) ;
-        printf ("         %s\n", add_info) ;
-        printf ("Robodoc: Panic Fatal error, closing down...\n") ;
-        RB_Close_The_Shop () ; <FONT COLOR = "#FF0000">/* Free All Resources */</FONT>
-        exit(100) ;
-      }    
-</PRE></TD></TR></TABLE>
-
-
-
-
- <H2><font color="red">7  </font><A NAME="CLD">Creating Cross Links</A></H2> 
-
-<P>Creating hyper links within a document and across documents
-is the most interesting feature of ROBODoc.  A document with such
-links is much more easier to read.  If your source code consists
-of just one file, creating links is easy.  Just tell ROBODoc that
-you want to have the output in HTML or AmigaGuide format, and it
-will automatically generate the links.  That is, at the beginning
-of the document it will create a table of contents that consists
-of links to all your function headers.</P>
-
-<P>ROBODoc will also search the complete text of you
-documentation for reference to function names, and it will create
-a link to the documentation of that function.</P>
-
-<P>In most cases, however, your source code does not consists of
-a single file.  It is also possible, however, to create links to
-other files.  This does require the use of some additional files,
-called xref files. These files can be generated with ROBODoc.
-These files contain information about in which file and where in
-the file references can be found.</P>
-
-<P>Lets assume your project is split up in five different source
-files, and you want to generate links between these five files.
-What you have to do to accomplish this is to create a xref file
-for each of those five files.</P>
-
-<P>With the GENXREF option ROBODoc will generate such a xref file
-from the a source-file.  When you use this option, only the xref
-file is created not the autodocs-file, however you still have to
-specify the name of the autodocs file because this name is needed
-for the creation of the xref file.</P>
-
-<P>When all xref files are created you are ready to create the
-documentation.  To do so you use ROBODOC with the XREF option. It
-needs a parameter which is the name of the file in which the
-names of all xref files are defined.  Notice: this is a file with
-file names, it has to be created it by hand.</P>
-
-<P>An example will make things more clear. In the ROBODoc
-archive, under <TT>examples/C</TT> there are two source files
-<A HREF="../Examples/C/prog1.c">prog1.c</A> and
-<A HREF="../Examples/C/prog2.c">prog2.c</A>.  We can create
-documentation with hyper links from these two files as follows:
-</P>
-
-<P>First create the xref files:</P>
-
-<TABLE>
-<TR>
-<TD>
-<PRE>
-  robodoc prog1.c prog1.c.html GENXREF prog1.c.xref HTML INTERNAL
-  robodoc prog2.c prog2.c.html GENXREF prog2.c.xref HTML INTERNAL
-</PRE>
-</TD>
-</TR>
-</TABLE>
-
-<P>Now there are two xref files: prog1.c.xref and prog2.c.xref.
-Note that ROBODoc did not create any HTML files, just the xref
-files. The name prog1.c.html is needed to create the correct xref
-files.  For prog1.c internal headers were also included. </P>
-
-<P>Now create a file with the xref file names.  This file will
-hold only two lines. You can give it any name, say
-<TT>xref_files</TT>.</P>
-<TABLE>
-<TR>
-<TD>
-<PRE>
-  echo prog1.c.xref &gt;  xref_files 
-  echo prog2.c.xref &gt;&gt; xref_files
-</PRE>
-</TD>
-</TR>
-</TABLE>
-<P>Now generate the final documentation:</P>
-<TABLE>
-<TR>
-<TD>
-<PRE>
-  robodoc prog1.c prog1.c.html XREF xref_files HTML INTERNAL
-  robodoc prog2.c prog2.c.html XREF xref_files HTML INTERNAL
-</PRE>
-</TD>
-</TR>
-</TABLE>
-
-<P>Have a look the the documentation generated:</P>
-<OL>
-  <LI><A HREF="../Examples/C/prog1.c.html">prog1.c.html</A></LI>
-  <LI><A HREF="../Examples/C/prog2.c.html">prog2.c.html</A></LI>
-</OL>
-
-
-
-<H3><font color="red">7.1  </font><A NAME="limits">Limitations</A></H3>
-
-<P> ROBODoc knows very little about the grammar of programming
-languages.  Links are created by looking up words in a table.
-This means that it sometimes creates links where there should be
-none.  For instance if you have a function called usage(); every
-time you use the word usage in any of your documentation a link
-will show up. It also means that sometimes is does not create
-links where you would like it to create a link. Say you include
-the source code of a method using the source item. Your method
-uses other methods of the class. You would like to have links
-pointing to the documentation of these methods each time you use
-one. They will not appear though. Since to ROBODoc stores the
-whole name of a method, ie, <TT>someClass::MethodName</TT>. In
-the method source you will use just <TT>MethodName()</TT>. </P>
-
-
-
- <H2><font color="red">8  </font><A NAME="MAIND">Master Index File</A></H2> 
-
-<P>If your project consists of many source files you might want
-to create a master index file.</P> 
-
-<P>For HTML output this file contains links to the documentation
-generated from each of your source files as well as a list of all
-"objects" that you documented. All "objects" are listed according
-to header type, using the following order: Projects, Classes,
-Methods, Stuctures, Functions, Variables, Constants, Generic,
-Internal.</P>
-
-<P>For LaTeX output this file is one big document that contains
-the documentation generated from all your source files. It also
-includes a table of contents and an index section.  This index
-lists the page number of the page a function's documentation.
-</P>
-
-<P>This index file is generated based on the information found in
-your xrefs file. That is the file with the names of all your xref
-files. So before you can create the master index file you have to
-create all your xref files.</P>
-
-<P>To generate a master index file use:</P>
-<PRE>
-   robodoc &lt;xrefs file&gt; &lt;master index file&gt; INDEX HTML TITLE "Master Index"
-</PRE>
-<P>or</P>
-<PRE>
-   robodoc &lt;xrefs file&gt; &lt;master index file&gt; INDEX LATEX TITLE "ROBODoc API Documentation"
-</PRE>
-<P>The master index file can currently only be generated in HTML or LaTeX.</P>
-
-<P>If you use if for LaTeX documentation you need to use the option
-<TT>SINGLEDOC</TT> when you generate the documentation from your various
-source files.  This ensures that no document preambles are generated.
-The master index file contains command that includes all your documentation
-files and make it into one single document.</P>
-
-
-<H3><font color="red">8.1  </font><A NAME="MIEXM">examples</A></H3>
-
-<P>Here are some examples of master index files</P>
-<UL>
-
-  <LI><A HREF="../Examples/CPP/masterindex.html">Master index for a C++ project</A> to be found in 
-      <TT>Examples/CPP/</TT></LI>
-
-  <LI><A HREF="../Source/ROBODoc_mi.html">Master index for ROBODoc</A> to be found in 
-      <TT>Source/</TT>. 
-  </LI>
-
-</UL>
-
-
-
- <H2><font color="red">9  </font><A NAME="makefile">Automation with <TT>make</TT></A></H2> 
-
-<P>The whole process of creating documentation with ROBODoc is of
-course best automated with <TT>make</TT>.
-Have a look at the following makefile.</P> 
-
-<TABLE><TR><TD><PRE>
-SHELL = /bin/sh
-.SUFFIXES:
-
-ROBODOC=robodoc
-ROBOOPTS=C SORT 
-
-# Your source files.
-#
-SOURCES=analyser.c generator.c items.c util.c \
-  folds.c headers.c links.c robodoc.c \
-  analyser.h generator.h items.h util.h \
-  folds.h headers.h links.h robodoc.h
-
-# The name of your Project
-#
-PROJECT=robodoc
-
-# The various documentation files, derived from the source files.
-# HTML
-#
-HTMLDOCS=$(SOURCES:=.html)
-HTMLXREFS=$(HTMLDOCS:.html=.html.xref)
-HTMLXREFSFILE=$(PROJECT)_html.xrefs
-# LATEX
-#
-LATEXDOCS=$(SOURCES:=.tex)
-LATEXXREFS=$(LATEXDOCS:.tex=.tex.xref)
-LATEXXREFSFILE=$(PROJECT)_tex.xrefs
-# ASCII
-#
-ASCIIDOCS=$(SOURCES:=.txt)
-# RTF
-#
-RTFDOCS=$(SOURCES:=.rtf)
-RTFXREFS=$(RTFDOCS:.rtf=.rtf.xref)
-RTFXREFSFILE=$(PROJECT)_rtf.xrefs
-
-# Some common targets
-xrefall: xrefhtml xreftex xrefrtf
-docall: html tex ascii rtf
-
-# Create the xref files for the various formats.
-xhtml: $(HTMLXREFSFILE) 
-xtex: $(LATEXXREFSFILE) 
-xrtf: $(RTFXREFSFILE)
-
-# Create the documentation files for the various formats.
-html: $(HTMLDOCS) $(PROJECT)_mi.html 
-tex: $(LATEXDOCS) $(PROJECT)_mi.tex
-rtf: $(RTFDOCS)
-ascii: $(ASCIIDOCS)
-
-# master index file, currently works only for html and latex documentation.
-# Note that you can define the title of the document.
-$(PROJECT)_mi.html: $(HTMLXREFSFILE) 
-       $(ROBODOC) $&lt; $@ INDEX HTML TITLE "$(PROJECT) Master Index"
-
-$(PROJECT)_mi.tex: $(LATEXXREFSFILE)
-       $(ROBODOC) $&lt; $@ INDEX LATEX TITLE "$(PROJECT) API Reference"
-
-# create xrefs file (file with the names of all .xref files).
-$(HTMLXREFSFILE) : $(HTMLXREFS)
-       /bin/ls $(HTMLXREFS) &gt; $@
-$(LATEXXREFSFILE) : $(LATEXXREFS)
-       /bin/ls  $(LATEXXREFS) &gt; $@
-$(RTFXREFSFILE) : $(RTFXREFS)
-       /bin/ls  $(RTFXREFS) &gt; $@
-
-# Rule to create an .xref file from a source file for the various formats.
-%.html.xref : %
-       $(ROBODOC) $&lt; $(@:.xref=) $(ROBOOPTS) INTERNAL GENXREF $@
-%.tex.xref : %
-       $(ROBODOC) $&lt; $(@:.xref=) $(ROBOOPTS) INTERNAL GENXREF $@
-%.rtf.xref : %
-       $(ROBODOC) $&lt; $(@:.xref=) $(ROBOOPTS) INTERNAL GENXREF $@
-
-# Rule to create html documentation from a source file.
-%.html : %
-       $(ROBODOC) $&lt; $@ HTML $(ROBOOPTS) XREF $(HTMLXREFSFILE)
-
-# Rule to create latex documentation from a source file.
-# We do not include source items, and generate laxtex documents
-# than can be included in a master document.
-%.tex : %
-       $(ROBODOC) $&lt; $@ LATEX $(ROBOOPTS) NOSOURCE SINGLEDOC XREF $(LATEXXREFSFILE)
-
-# Rule to create ascii documentation from a source file.
-%.txt : %
-       $(ROBODOC) $&lt; $@ ASCII 
-
-# Rule to create rtf documentation from a source file.
-%.rtf : %
-       $(ROBODOC) $&lt; $@ RTF $(ROBOOPTS) XREF $(RTFXREFSFILE)
-
-# Use netscape to view the master index file for our project.
-htmlview: html
-       netscape $(PROJECT)_mi.html
-
-# Use the latex programs to generate a .dvi from the master index file
-# for our prokect. View this .dvi file with xdvi
-texview:  tex
-       latex $(PROJECT)_mi
-       makeindex $(PROJECT)_mi
-       latex $(PROJECT)_mi
-       latex $(PROJECT)_mi
-       xdvi  $(PROJECT)_mi.dvi
-
-# Clean-up the mess we made
-#
-clean:
-       rm -f $(HTMLXREFS) 
-       rm -f $(HTMLDOCS) 
-       rm -f $(LATEXXREFS)
-       rm -f $(LATEXDOCS) 
-       rm -f $(PROJECT)_mi.* *.aux
-       rm -f $(RTFXREFS)
-       rm -f $(RTFDOCS)
-       rm -f $(ASCIIDOCS)
-       rm -f $(HTMLXREFSFILE) 
-       rm -f $(LATEXXREFSFILE) 
-       rm -f $(RTFXREFSFILE)
-</PRE></TD></TR></TABLE>
-
-<P>It includes all the necessary commands to generate and view the documentation for you project. You create documentation in any of the four formats.
-For instance to create documentation in html format use:</P>
-<TABLE><TR><TD><PRE>
-  make xhtml
-  make html
-</PRE></TD></TR></TABLE>
-<P>To make documentation in LaTeX format use:</P>
-<TABLE><TR><TD><PRE>
-  make xtex
-  make tex
-</PRE></TD></TR></TABLE>
-<P>To view your documentation use:</P>
-<TABLE><TR><TD><PRE>
-  make xhtml
-  make texview
-</PRE></TD></TR></TABLE>
-<P>or</P>
-<TABLE><TR><TD><PRE>
-  make xtex
-  make texview
-</PRE></TD></TR></TABLE>
-
-
-<P>To clean up all the documentation files use:</P>
-<PRE>
-  make clean
-</PRE>
-
-<P>To use this make file in project set the variable
-<TT>SOURCE</TT> to the names of your source files and set the
-variable <TT>PROJECT</TT> to the name of your project.</P>
-
-<P>You can find a copy of the above makefile
-<TT>Docs/example_makefile</TT>.  This should get you started in
-no time.</P>
-
- <H2><font color="red">10  </font><A NAME="MDSO">What to do if You have Sources in Multiple Directories</A></H2> 
-
-<P>It is possible to have your sources in multiple
-subdirectories. However the generated documentation is expected
-to be in one single directory. If not the cross references will
-be wrong, at least in the HTML documentation.</P>
-
-<P>Say you have the following directory structure:</P>
-<TABLE><TR><TD><PRE>
-  Project/
-     Dir1/
-        program1.c 
-     Dir2/
-        program2.c 
-</PRE></TD></TR></TABLE>
-
-<P>You can create the documentation for that as follows (assuming
-you are in Project):
-</P>
-<TABLE><TR><TD><PRE>
-  robodoc Dir1/prog1.c prog1.c.html HTML GENXREF Dir1/prog1.xref 
-  robodoc Dir2/prog2.c prog2.c.html HTML GENXREF Dir2/prog2.xref 
-  echo "Dir1/prog1.xref" &gt; xreffiles 
-  echo "Dir2/prog2.xref" &gt;&gt; xreffiles 
-  robodoc Dir1/prog1.c prog1.c.html HTML XREF xreffiles 
-  robodoc Dir2/prog2.c prog2.c.html HTML XREF xreffiles 
-  robodoc xreffiles master_index.html INDEX HTML 
-</PRE></TD></TR></TABLE>
-<P>
-This generates the following files:
-</P>
-<TABLE><TR><TD><PRE>
-   prog1.c.html
-   prog2.c.html
-   master_index.html
-</PRE></TD></TR></TABLE>
-
-
-<P>With some version of make (for instance the gnu version) you
-can strip the directory part of a filename with $(notdir NAME)
-How this can be used is shown in the following example
-makefile.  Here we have the sources for robodoc, the <TT>.c</TT> files are
-in the directory <TT>Sources/</TT> and <TT>.h</TT> files are in the
-directory <TT>Headers/</TT>.</P>
-
-<TABLE><TR><TD><PRE>
-SHELL = /bin/sh
-.SUFFIXES:
-
-ROBODOC=./robodoc
-ROBOOPTS=C SORT 
-
-# Your source files.
-#
-SOURCES=Sources/analyser.c Sources/generator.c Sources/items.c Sources/util.c \
-  Sources/folds.c Sources/headers.c Sources/links.c Sources/robodoc.c \
-  Headers/analyser.h Headers/generator.h Headers/items.h Headers/util.h \
-  Headers/folds.h Headers/headers.h Headers/links.h Headers/robodoc.h
-
-# The name of your Project
-#
-PROJECT=ROBODoc
-
-# The various documentation files, derived from the source files.
-#
-HTMLDOCS=$(SOURCES:=.html)
-HTMLXREFS=$(HTMLDOCS:.html=.html.xref)
-HTMLXREFSFILE=$(PROJECT)_html.xrefs
-
-# Create the xref files for the various formats.
-xhtml: $(HTMLXREFSFILE) 
-
-# Create the documentation 
-html: $(HTMLDOCS) $(PROJECT)_mi.html 
-
-# Create master index file.
-$(PROJECT)_mi.html: $(HTMLXREFSFILE) 
-       $(ROBODOC) $&lt; $@ INDEX HTML TITLE "$(PROJECT) Master Index"
-
-# Create the file with the names of all xref files.
-$(HTMLXREFSFILE) : $(HTMLXREFS)
-       /bin/ls $(HTMLXREFS) &gt; $@
-
-# Rule to create an .xref file from a source file 
-%.html.xref : %
-       $(ROBODOC) $&lt; $(notdir $(@:.xref=)) $(ROBOOPTS) INTERNAL GENXREF $@
-
-# Rule to create html documentation from a source file.
-%.html : %
-       $(ROBODOC) $&lt; $(notdir ${@}) HTML $(ROBOOPTS) XREF $(HTMLXREFSFILE)
-</PRE></TD></TR></TABLE>
-
-
- <H2><font color="red">11  </font><A NAME="RDF">The ROBODoc Defaults File</A></H2> 
-
-<P>The robodoc.default file can be used to change the appearance
-of the documentation. For each item type you can define how the
-corresponding text should be rendered.  Each line in the default
-file consists of two parts, the item type and the item
-attributes. For instance</P>
-
-<PRE>
-AUTHOR                    LARGE ITALICS BOLD UNDERLINE
-</PRE>
-
-<P>Specifies that the AUTHOR item has the attributes LARGE,
-ITALICS, BOLD, and UNDERLINE.  The effect of each attribute is
-listed in the following table.</P>
-
-<TABLE>
-<TR><TD>Item Attributes</TD> 
-    <TD>Effect in HTML</TD>
-</TR>
-<TR><TD>LARGE</TD>
-    <TD>&lt;FONT SIZE=5&gt;,&lt;/FONT&gt;</TD>
-</TR>
-<TR><TD>SMALL</TD>
-    <TD>&lt;FONT SIZE=-1&gt;,&lt;/FONT&gt;</TD>
-</TR>
-<TR><TD>ITALICS</TD>
-    <TD>&lt;I&gt;,&lt;/I&gt;</TD>
-</TR>
-<TR><TD>BOLD</TD>
-    <TD>&lt;B&gt;,&lt;/B&gt;</TD>
-</TR>
-<TR><TD>UNDERLINE</TD>
-    <TD>&lt;U&gt;,&lt;/U&gt;</TD>
-</TR>
-<TR><TD>HIGHLIGHT</TD>
-    <TD>&lt;EM&gt;,&lt;/EM&gt;</TD>
-</TR>
-</TABLE>
-
-
- <H2><font color="red">12  </font><A NAME="UOB">ROBODoc Command Line Options</A></H2> 
-
-<P>When using ROBODoc you should provide at least two
-parameters</P>
-
-<PRE>
-  robodoc &lt;source file&gt; &lt;documentation file&gt; [options]
-</PRE>
-
-<P>Here sourcefile is the file with the program source from which
-the documentation is to be extracted. The documentation file is
-the file that will contain the extracted documentation.  </P>
-
-<P>In case you are creating a master index file you have to
-specify three parameters</P> 
-<PRE>
-  robodoc &lt;xrefs file&gt; &lt;master index file&gt; INDEX [options]
-</PRE>
-
-
-<P>In addition to this you can specify one or more of the
-following options:</P>
-
-<TABLE >
-  <TR><TD><TT>ASCII</TT></TD>
-      <TD>Generate documentation in ASCII format (default)</TD>
-  </TR>
-  <TR><TD><TT>GUIDE</TT></TD>
-      <TD>Generate documentation in AmigaGuide format.</TD>
-  </TR>
-  <TR><TD><TT>HTML</TT></TD>
-      <TD>Generate documentation in HTML format.</TD>
-  </TR>
-  <TR><TD><TT>LATEX</TT></TD>
-      <TD>Generate documentation in LaTeX format. (Experimental)</TD>
-  </TR>
-  <TR><TD><TT>RTF</TT></TD>
-      <TD>Generate documentation in RTF format.</TD>
-  </TR>
-  <TR><TD><TT>C</TT></TD>
-      <TD>Use ANSI C grammar in source items (test, HTML only)</TD>
-  </TR>
-  <TR><TD><TT>FOLD</TT></TD>
-      <TD>Enable folding. (Experimental)</TD>
-  </TR>
-  <TR><TD><TT>GENXREF &lt;xref file&gt;</TT></TD>
-      <TD>Generate a xref file, which can be used to create
-         <A HREF="#CLD">cross links</A> between documents.</TD>
-  </TR>
-  <TR><TD><TT>XREF &lt;xrefs file&gt;</TT></TD>
-      <TD>Use a set of xref files to create references (links) to other
-      documents or within the document. <TT>&lt;xrefs file&gt;</TT>
-      is a file with xref file names.</TD>
-  </TR>
-  <TR><TD><TT>INDEX</TT></TD>
-     <TD>Create a <A HREF="#MAIND">master index file</A>.</TD>
-  </TR>
-  <TR><TD><TT>INTERNAL</TT></TD>
-     <TD>Also include headers that are marked internal.</TD>
-  </TR>
-  <TR><TD><TT>INTERNALONLY</TT></TD>
-      <TD>Only extract the headers marked internal.</TD>
-  </TR>
-  <TR><TD><TT>NOSOURCE</TT></TD>
-      <TD>Do not include the source items in the documentation.</TD>
-  </TR>
-  <TR><TD><TT>SORT</TT></TD>
-      <TD>Sort the headers alphabetically.</TD>
-  </TR>
-  <TR><TD><TT>SINGLEDOC</TT></TD>
-      <TD>Do not create a document header and footer when creating 
-          documentation in LaTeX format.  This allows you to include
-          the generated documents into big document or 
-          <A HREF="#MAIND">master index file</A>.</TD>
-  </TR>
-  <TR><TD><TT>TITLE &lt;title&gt;</TT></TD>
-      <TD>Sets the title that is used for the 
-         <A HREF="#MAIND">master index file</A>.</TD>
-  </TR>
-  <TR><TD><TT>TOC</TT></TD>
-      <TD>Generate a table of contents.  It is only useful when you select
-      ASCII as output mode.  With all other output modes the
-      table of contents is generated anyway.</TD>
-  </TR>
-  <TR><TD><TT>TABSIZE &lt;n&gt;</TT></TD>
-      <TD>Convert each tab into <TT>n</TT> spaces.</TD>
-  </TR>
-  <TR><TD><TT>-v</TT></TD>
-      <TD>Verbose option, ROBODoc will tell you what it is doing.</TD>
-  </TR>
-</TABLE>
-
-<P>If you wonder why all the odd ALL CAPS flags are used instead
-of for instance "-x"; this was how it was done on the Amiga.</P>
-
-<P>The following abbreviations are also allowed:</P>
-<TABLE >
-<TR><TD><TT>-s </TT></TD><TD><TT>SORT</TT></TD></TR>
-<TR><TD><TT>-t </TT></TD><TD><TT>TOC</TT></TD></TR>
-<TR><TD><TT>-x </TT></TD><TD><TT>XREF</TT></TD></TR>
-<TR><TD><TT>-g </TT></TD><TD><TT>GENXREF</TT></TD></TR>
-<TR><TD><TT>-i </TT></TD><TD><TT>INTERNAL</TT></TD></TR>
-<TR><TD><TT>-io</TT></TD><TD><TT>INTERNALONLY</TT></TD></TR>
-<TR><TD><TT>-ts</TT></TD><TD><TT>TABSIZE</TT></TD></TR>
-</TABLE>
-
-
- <H2><font color="red">13  </font><A NAME="ADV">Adding New Languages</A></H2> 
-
-<P>To add a new programming language to ROBODoc you have to edit
-<TT>headers.c</TT>.  Here you find three variables:
-<TT>header_markers</TT>, <TT>remark_markers</TT>, and
-<TT>end_markers</TT>.  There are all arrays, and you have to add
-an new entry to each of these three arrays.</P>
-
-<P>Say your programming language uses the following type of remarks:</P>
-<PRE>
-   $%% This is a remark with some text       
-       and some more and some more  %%$
-</PRE>
-
-<P>That is is starts with three spaces and then <TT>$%%</TT>, and
-has to end with <TT>%%$</TT>. Then you would add to <TT>header_markers</TT>
-</P>
-<PRE>
-   "   $%%****",
-</PRE>
-<P>To <TT>remark_markers</TT> you would add</P>
-<PRE>
-   "   *",
-</PRE>
-<P>And to <TT>end_markers</TT> you would add</P>
-<PRE>
-   "   $%%***",
-</PRE>
-<P>You can then use the following kind of headers in your program:</P>
-<PRE>
-   $%%****f* Test/afunction ***** 
-   * NAME  
-   *   afunction
-   * FUNCTION
-   *   A test.
-   * SOURCE
-   *%%$
-     afunction(test,test) [
-       print hello world ;
-     ]
-   $%%***%%$
-</PRE>
-
-
-
-
-
- <H2><font color="red">14  </font><A NAME="SAB">Suggestions and Bugs</A></H2> 
-
-<P>If you find any bugs, catch them, put them in a jar, and send
-them to:</P> 
-<ADDRESS>fslothouber@acm.org</ADDRESS>  
-<P>Suggestions are also welcome at this address.  Flames can be
-directed to the sun.</P>
-
-</BODY>
-</HTML>
-
diff --git a/util/robodoc/Docs/robodoc.m4 b/util/robodoc/Docs/robodoc.m4
deleted file mode 100644 (file)
index b60b52a..0000000
+++ /dev/null
@@ -1,1269 +0,0 @@
-m4_include(`general.m4')m4_dnl
-www_docstart()
-www_header(`ROBODoc Manual')
-www_bodystart
-www_title(`ROBODoc VERSION Manual')
-
-<P><STRONG>Updated July 2000</STRONG></P>
-
-<P>ROBODoc is a documentation tool for C, C++, Java, Assembler, Basic,
-Fortran, LaTeX, Postscript, Tcl/Tk, LISP, Forth, Perl, Shell
-Scripts, Occam, COBOL, HTML and many other languages. Additional
-languages can be supported by a few modifications to the source
-code.</P>
-
-<P>Copyright (C) 1994-2000 Frans Slothouber and Jacco van Weert.</P>
-
-<P>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; either version 2 of
-the License, or (at your option) any later version.</P>
-
-<P>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.</P>
-
-<P>You should have received a copy of the GNU General Public
-License along with this program; if not, write to the Free
-Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-02111-1307 USA</P>
-
-
-
-www_section(`creds', `Credits')
-
-<UL>
-
-  <LI>Original program and idea: Jacco van Weert</LI> 
-
-  <LI>Versions 2.0 and up: Frans Slothouber, Petteri Kettunen,
-      Bernd Koesling, Anthon Pang, Thomas Aglassinger,
-      and Stefan Kost, Guillaume Etorre, Simo Muinonen,
-      Petter Reinholdtsen.
-  </LI>
-
-  <LI>Maintainer: Frans Slothouber (fslothouber@acm.org),
-      The Netherlands.</LI>
-
-</UL>
-
-
-www_section(`toc', `Table of Contents')
-
-m4_include(stoc.html)
-
-
-
-www_section(`INTRO', `Introduction')
-
-<P>ROBODoc is based on the AutoDocs program written some time ago
-by Commodore.  The idea is to include for every function a
-standard header containing all sorts of information about that
-procedure/function.  An AutoDocs program extracts these headers
-from the source file and puts them in an autodocs file.  This
-allows you to include the program documentation in the source
-code and makes it unnecessary to maintain two documents.</P>
-
-
-<P>ROBODoc is such a program, however ROBODoc has several
-additions.  For one it can generate the documentation in
-different formats, ASCII, HTML, RTF, LaTeX, and AmigaGuide.
-Another feature is that it automatically creates links within the
-document, and to other documents.  It is also possible to include
-parts of the source in you documentation, complete with links.
-For instance it is possible to include the complete source code
-of a function, and have the function names in the source point to
-their documentation. Besides documenting functions, you can also
-document classes, methods, structures, variables, and
-constants.</P>
-
-
-<P>If you never have used AutoDoc or ROBODoc before you might
-take a look at the example in the <TT>Source/</TT>.  Run the
-command:</P>
-
-<PRE>
-  make xhtml
-  make example
-</PRE>
-
-
-<P>This creates the ROBODoc
-www_link(`../Source/ROBODoc_mi.html', `documentation') for the
-ROBODoc program itself and then starts netscape to view the
-documentation. Also have a look at the source files, they
-illustrates the use of headers.</P>
-
-<P>ROBODoc can generate documentation in five different
-formats:</P>
-
-<UL>
-  <LI>HTML format complete with hyperlinks and mark-ups.</LI>
-
-  <LI>LaTeX, based on D. Knuth excellent typesetting system.</LI>
-
-  <LI>Plain ASCII text file, this file is very close to what the
-      original AutoDocs program would generate.</LI>
-
-  <LI>RTF, Rich Text Format, mostly used on Windows machines
-      before WWW revolution.</LI>
-
-  <LI>AmigaGuide format, it is the Amiga computer's equivalent
-      HTML. The AmigaGuide program is necessary to view the
-      resulting autodocs-file. (This was the preferred format when the
-      program was written in 1994.)</LI>
-
-</UL>
-
-
-www_section(`HSR', `Hardware and software requirements')
-
-<P>ROBODoc was developed in 1994 on a standard Amiga 1200, a
-system with a 20MHz 68020 processor and 2 Mbyte of RAM. It should
-therefore be no problem to run it on any of the currently
-available systems :) The complete source code consists of a
-series of file that can be found in the <TT>Source</TT>
-directory.  It is written according (hopefully) to the ANSI C
-standard and uses no special functions, so it should run on every
-system with an ANSI C-compiler.</P>
-
-
-www_section(`LMT', `Goals and Limitations')
-
-<P>ROBODoc is intended for small to medium sized projects 
-that have a relatively flat structure and especially projects 
-that use a mix of different programming languages.</P>
-
-<P>
-ROBODoc was designed to be easy to use and to work with a lot of
-different programming languages.  It has no knowledge of the
-syntax of a programming languages.  It just some knowledge about
-how remarks start and end in some programming languages. This
-means that you sometimes have to do a little more work compared
-to other tools that have detailed knowledge of the syntax of a
-particular language.  They can use that knowledge to figure out
-some of the information automatically.  This usually also means
-that they work only with one or two languages.
-</P>
-
-<P>ROBODoc operates on one file at a time.  It has no mechanism to
-process whole sets of source files. Makefiles should be used for
-this.  How to do this is explained in this document with various
-example makefiles. Have a look at them.
-</P>
-
-<P>ROBODoc can work with projects where the source code is located
-in different subdirectories. However the generated documentation is
-expected to go into one single directory.</P>
-
-
-www_section(`HFCWR', `How to Format Your Code for use with ROBODoc')
-
-<P>ROBODoc allows you to mix the program documentation with the
-source code.  It does require though that this documentation has
-a particular layout so ROBODoc can recognize it. The following
-header was taken from the original ROBODoc program (many versions
-back).</P>
-
-<TABLE>
-<TR>
-<TD>
-<PRE>
-           <FONT COLOR="red">------------------------------- Header Name</FONT>
-          <FONT COLOR="red">/                          \</FONT>
-  /****f* financial.library/StealMoney  <FONT COLOR="red">&lt;---- Begin Marker</FONT>
-  *    <FONT COLOR="red">^------- Header Type</FONT>
-  *
-  *  <FONT COLOR="red">&lt;---- Remark Marker</FONT>
-  *  NAME
-  *    StealMoney -- Steal money from the Federal Reserve Bank. (V77)
-  *  SYNOPSIS  <FONT COLOR="red">&lt;---- Item Name</FONT>
-  *    error = StealMoney( userName,amount,destAccount,falseTrail )
-  *    D0,Z                D0       D1.W    A0         [A1]
-  *
-  *    BYTE StealMoney
-  *         ( STRPTR,UWORD,struct AccountSpec *,struct falseTrail *);
-  *  FUNCTION
-  *    Transfer money from the Federal Reserve Bank into the
-  *    specified interest-earning checking account.  No records of
-  *    the transaction will be retained.
-  *  INPUTS
-  *    userName    - name to make the transaction under.  Popular
-  *                  favorites include "Ronald Reagan" and
-  *                  "Mohamar Quadaffi".
-  *    amount      - Number of dollars to transfer (in thousands).
-  *    destAccount - A filled-in AccountSpec structure detailing the
-  *                  destination account (see financial/accounts.h).
-  *                  If NULL, a second Great Depression will be
-  *                  triggered.
-  *    falseTrail  - If the DA_FALSETRAIL bit is set in the
-  *                  destAccount, a falseTrail structure must be
-  *                  provided.
-  *  RESULT
-  *    error - zero for success, else an error code is returned
-  *           (see financial/errors.h).  The Z condition code
-  *           is guaranteed.
-  *  EXAMPLE
-  *    Federal regulations prohibit a demonstration of this function.
-  *  NOTES
-  *    Do not run on Tuesdays!
-  *  BUGS
-  *    Before V88, this function would occasionally print the
-  *    address and home phone number of the caller on local police
-  *    976 terminals.  We are confident that this problem has been
-  *    resolved.
-  *  SEE ALSO
-  *    CreateAccountSpec(),security.device/SCMD_DESTROY_EVIDENCE,
-  *    financial/misc.h
-  *
-  ******  <FONT COLOR="red">&lt;---- End Marker</FONT>
-  *
-  * You can use this space for remarks that should not be included
-  * in the documentation.
-  *
-  */
-</PRE>
-</TD>
-</TR>
-</TABLE>
-
-<P>You would place this headers in front of functions, classes,
-methods, structure definitions, or any of the major components in
-your program.  The header itself contains a number of items that
-provide structured information about the component. </P>
-
-<P>There are a number of special markers in a header (indicated
-in red above).  There are two special markers that mark the begin
-and end of a header.  Each line in a header should start with a
-remark marker.  The starts of each item is marked by an Item Name
-(in all capitals).</P>
-
-
-www_subSection(`hname', `Header Names')
-
-<P>ROBODoc makes some assumptions about the structure a project.
-It assumes that a project consists of a number of modules, and
-that each module consists of a number of components.  These
-components can be anything that you care to document; functions,
-variables, structures, classes, methods etc.</P>
-
-<P> Projects, modules, and components all have names.  The names
-allow ROBODoc to structure the documentation and create
-cross-links. Names are defined in the header name.  It is either
-of the form <TT> &lt;project name&gt;/&lt;module name&gt;</TT>
-for a module header, or of the form <TT>&lt;module
-name&gt;/&lt;component name&gt;</TT> for all other headers.</P>
-
-www_subSection(`htypes', `Header Types')
-
-<P>You can provide ROBODoc with some additional information
-by specifying the header type.  The header type tells ROBODoc
-what kind of component you are documenting. This information
-allows ROBODoc to create more useful index tables.</P>
-
-<P>The type is identified by a single character, as listed in the
-following table</P>
-
-<TABLE>
-<TR><TD>h</TD><TD>Header for a module in a project.</TD></TR>
-<TR><TD>f</TD><TD>Header for a function.</TD></TR>
-<TR><TD>s</TD><TD>Header for a structure.</TD></TR>
-<TR><TD>c</TD><TD>Header for a class.</TD></TR>
-<TR><TD>m</TD><TD>Header for a method.</TD></TR>
-<TR><TD>v</TD><TD>Header for a variable.</TD></TR>
-<TR><TD>d</TD><TD>Header for a constant 
-(from <STRONG>d</STRONG>efine).</TD></TR>
-<TR><TD>*</TD><TD>Generic header for every thing else.</TD></TR>
-<TR><TD>i</TD><TD>Internal header.</TD></TR>
-</TABLE>
-
-<P>Internal headers are special. They can be used to hide certain
-headers. They are only extracted if requested. You could use to
-document internal functions that you do now want clients to
-see.</P>
-
-
-www_subSection(`bmar', `Begin Marker')
-
-<P>The beginning of a header is marked with a special marker.
-The above header is intended for a program in C.  In other
-programming languages the marker looks slightly different, since
-each language has its own convention for starting remarks.
-ROBODoc recognizes the following begin markers:</P>
-
-<TABLE >
-<TR><TD><TT>"/****"</TT>
-    <TD>C, C++</TD>
-</TR>
-<TR><TD><TT>"//****"</TT></TD>
-    <TD>C++</TD>
-</TR>
-<TR><TD><TT>";****"</TT></TD>
-    <TD>Assembler</TD>
-</TR>
-<TR><TD><TT>"****"</TT></TD>
-    <TD>Assembler</TD>
-</TR>
-<TR><TD><TT>"{****"</TT></TD>
-    <TD>Pascal</TD>
-</TR>
-<TR><TD><TT>"REM ****"</TT></TD>
-    <TD>Basic (Rem, rem, or even rEM also works)</TD>
-</TR>
-<TR><TD><TT>"C     ****"</TT></TD>
-    <TD>Fortran (c     **** also works)</TD>
-</TR>
-<TR><TD><TT>"%****"</TT></TD>
-    <TD>LaTeX, TeX, Postscript.</TD>
-</TR>
-<TR><TD><TT>"#****"</TT></TD>
-    <TD>Tcl/Tk, Perl, makefiles, gnuplot etc.</TD>
-</TR>
-<TR><TD><TT>"(****"</TT></TD>
-    <TD>Pascal, Modula-2, LISP</TD>
-</TR>
-<TR><TD><TT>"--****"</TT></TD>
-    <TD>Occam</TD>
-</TR>
-<TR><TD><TT>"&lt;!--****"</TT></TD>
-    <TD>HTML</TD>
-</TR>
-<TR><TD><TT>"&lt;!---****"</TT></TD>
-    <TD>HTML</TD>
-</TR>
-<TR><TD><TT>"|****"</TT></TD>
-    <TD>GNU Assembler</TD>
-</TR>
-<TR><TD><TT>"!!****"</TT></TD>
-    <TD>Fortran 90</TD>
-</TR>
-</TABLE>
-
-<P>After these initial four asterisks, there is the character to
-identify the kind of header, then another asterisks, and then
-header name. After this you can specify a version number
-surrounded by "[]". The version number is stored but not used for
-anything at the moment. All characters after that are
-ignored.</P>
-
-<P>This might sound terribly complicated, it is not. Here are
-some examples:</P>
-
-<P>A header for a module called analyser in a project called ChessMaster
-for C, is has version number 1.0</P>
-<PRE>
-  /****h* ChessMaster/analyser [1.0] *
-</PRE>
-
-<P>In Assembler, a function header, for the function init() in the 
-  module finance.library:</P>
-<PRE>
-  ****f* finance.library/init *
-</PRE>
-
-<P>In C++, a class header for class Puppet, for the module puppetmaster,
-version v2.12</P> 
-<PRE>
-  /****c* puppetMaster/Puppet [v2.12] ******
-</PRE>
-
-<P>For the same class a method called Puppet::Talk</P>
-<PRE>
-  /****m* puppetMaster/Puppet::Talk [v2.12] ******
-</PRE>
-
-<P>A project header, in Fortran</P>
-<PRE>
-  C     ****h* ChessMaster/analyser              C
-</PRE>
-
-<P>In Basic</P>
-<PRE>
-  REM ****h* ChessMaster/analyser
-</PRE>
-
-
-
-www_subSection(`rmarker', `Remark Marker')
-
-<P>Each line in the body of a header should start with a remark
-marker.  This marker is stripped from the line and the remaining
-part is used to generated the documentation.  The following
-markers are recognized by ROBODoc.</P>
-
-<TABLE >
-<TR><TD><TT>"*"</TT></TD>
-    <TD>C, C++, Pascal, Modula-2</TD>
-</TR> 
-<TR><TD><TT>"//"</TT></TD>
-    <TD>C++</TD>
-</TR> 
-<TR><TD><TT>" *"</TT></TD>
-    <TD>C, C++, M68K assembler, Pascal, Modula-2, HTML</TD>
-</TR> 
-<TR><TD><TT>";*"</TT></TD>
-    <TD>M68K assembler</TD>
-</TR> 
-<TR><TD><TT>";"</TT></TD>
-    <TD>M68K assembler</TD>
-</TR> 
-<TR><TD><TT>"C    "</TT></TD>
-    <TD>Fortran</TD>
-</TR> 
-<TR><TD><TT>"REM "</TT></TD>
-    <TD>BASIC</TD>
-</TR> 
-<TR><TD><TT>"%"</TT></TD>
-    <TD>LaTeX, TeX, Postscript</TD>
-</TR> 
-<TR><TD><TT>"#"</TT></TD>
-    <TD>Tcl/Tk, shell scripts, makefiles</TD>
-</TR> 
-<TR><TD><TT>"      *"</TT></TD>
-    <TD>COBOL</TD>
-</TR> 
-<TR><TD><TT>"--"</TT></TD>
-    <TD>Occam</TD>
-</TR> 
-<TR><TD><TT>"|"</TT></TD>
-    <TD>GNU Assembler</TD>
-</TR>
-<TR><TD><TT>"!!"</TT></TD>
-    <TD>Fortan 90</TD>
-</TR>
-</TABLE>
-
-
-
-
-www_subSection(`emar', `End Marker')
-
-<P>A header ends with an end marker.  An end marker is a remark
-marker followed by three asterisks.  ROBODoc recognizes following
-strings as end markers:</P>
-
-<TABLE >
-<TR><TD><TT>"/***"</TT></TD>
-    <TD> C, C++ </TD></TR>
-<TR><TD><TT>"//***"</TT></TD>
-    <TD> C++ </TD></TR>
-<TR><TD><TT>" ****"</TT></TD>
-    <TD> C, C++, Pascal, Modula-2 </TD></TR>
-<TR><TD><TT>"{***"</TT></TD>
-    <TD> Pascal </TD></TR>
-<TR><TD><TT>"(***"</TT></TD>
-    <TD> Pascal, Modula-2, B52 LISP</TD></TR>
-<TR><TD><TT>";***"</TT></TD>
-    <TD> M68K assembler </TD></TR>
-<TR><TD><TT>"****"</TT></TD>
-    <TD> M68K assembler </TD></TR>
-<TR><TD><TT>"C     ***"</TT></TD>
-    <TD> Fortran </TD></TR>
-<TR><TD><TT>"REM ***"</TT></TD>
-    <TD> BASIC </TD></TR>
-<TR><TD><TT>"%***"</TT></TD>
-    <TD> LaTeX, TeX, Postscript </TD></TR>
-<TR><TD><TT>"#***"</TT></TD>
-    <TD> Tcl/Tk, Perl, Makefiles, Shell scripts </TD></TR>
-<TR><TD><TT>"      ****"</TT></TD>
-    <TD> COBOL </TD></TR>
-<TR><TD><TT>"--***"</TT></TD>
-    <TD> Occam </TD></TR>
-<TR><TD><TT>"&lt;!--***"</TT></TD>
-    <TD> HTML </TD></TR>
-<TR><TD><TT>"&lt;!---***"</TT></TD>
-    <TD> HTML </TD></TR>
-<TR><TD><TT>"|***"</TT></TD>
-    <TD>GNU Assembler</TD></TR>
-<TR><TD><TT>"!!***"</TT></TD>
-    <TD>Fortan 90</TD></TR>
-</TABLE>
-
-
-
-
-www_subSection(`hitem', `Header Items')
-
-<P>When ROBODoc has found a header it will try to identify the
-items in this header.  It does this by looking for the item name. The following
-item names are currently supported:</P>
-
-<TABLE >
-<TR><TD> NAME </TD>
-    <TD> Item name plus a short description. </TD> 
-<TR><TD> COPYRIGHT </TD>
-    <TD> Who own the copyright : "(c) &lt;year&gt;-&lt;year&gt; by 
-         &lt;company/person&gt;" </TD>
-<TR><TD> SYNOPSIS, USAGE </TD>
-    <TD> How to use it. </TD>
-<TR><TD> FUNCTION, DESCRIPTION,  PURPOSE </TD>
-    <TD> What does it do. </TD>
-<TR><TD> AUTHOR </TD>
-    <TD>Who wrote it. </TD> 
-<TR><TD> CREATION DATE </TD>
-    <TD> When did the work start. </TD> 
-<TR><TD> MODIFICATION HISTORY,  HISTORY </TD>
-    <TD> Who has done which changes and when. </TD>
-<TR><TD> INPUTS, ARGUMENTS, OPTIONS, PARAMETERS, SWITCHES </TD>
-    <TD> What can we feed into it.  </TD>
-<TR><TD> OUTPUT, SIDE EFFECTS </TD>
-    <TD> What output is made. </TD>
-<TR><TD> RESULT, RETURN VALUE </TD>
-    <TD> What do we get returned. </TD>
-<TR><TD> EXAMPLE  </TD>
-    <TD> A clear example of the items use. </TD> 
-<TR><TD> NOTES </TD>
-    <TD> Any annotations </TD> 
-<TR><TD> DIAGNOSTICS  </TD>
-    <TD>Diagnostical output  </TD>
-<TR><TD> WARNINGS, ERRORS  </TD>
-    <TD> Warning & error-messages. </TD>
-<TR><TD> BUGS </TD>
-    <TD> Known bugs. </TD> 
-<TR><TD> TODO, IDEAS  </TD>
-    <TD> What to implement next & ideas. </TD> 
-<TR><TD> PORTABILITY </TD>
-    <TD> Where does it come from, where will it work. </TD>
-<TR><TD> SEE ALSO </TD>
-    <TD> References to other functions, man pages, other documentation. </TD>
-<TR><TD> METHODS, NEW METHODS </TD>
-    <TD> OOP methods. </TD>
-<TR><TD> ATTRIBUTES, NEW ATTRIBUTES </TD>
-    <TD> OOP attributes  </TD>
-<TR><TD> TAGS </TD>
-    <TD> Tag-item description. </TD>
-<TR><TD> COMMANDS </TD>
-    <TD> Command description. </TD> 
-<TR><TD> DERIVED FROM </TD>            
-    <TD> OOP super class. </TD>
-<TR><TD> DERIVED BY </TD>
-    <TD> OOP sub class. </TD>
-<TR><TD> USES, CHILDREN        </TD>
-    <TD> What modules are used by this one. </TD> 
-<TR><TD> USED BY, PARENTS </TD>
-    <TD> Which modules do use this one. </TD> 
-<TR><TD> SOURCE </TD>
-    <TD> Source code inclusion. </TD> 
-</TABLE>
-
-<P>ROBODoc does this so that it can format each item with a
-different style (colour, font, etc.) if the user want it.  These
-can be specified in the robodoc.defaults file, see the next
-section more information.</P>
-
-
-www_subSection(`inlimits', `Item Name Limitations')
-
-<P>If you happen to have a function which name is in all uppercase,
-this sometimes conflicts with where ROBODoc thinks an item name
-starts and where the item body starts.
-Bernhard Roessmann suggest the following workaround:
-Example header producing this error:</P>
-<PRE>
-/***** basic.c/RETURN
-* NAME
-*  RETURN : Return from subroutine
-* SYNOPSIS
-*  RETURN
-* FUNCTION
-*  Return from subroutine
-******/
-</PRE>
-<P>Here the item name  "FUNCTION" will be interpreted as ordinary text, 
-not as an item name.  Workaround: Add an empty line:</P>
-<PRE>
-/***** basic.c/RETURN
-* NAME
-*  RETURN : Return from subroutine
-* SYNOPSIS
-*  RETURN
-*
-* FUNCTION
-*  Return from subroutine
-******/
-</PRE>
-
-
-
-www_subSection(`SI', `Source Item')
-
-<P>The source item allows you to include part of the source in
-the documentation as is demonstrated by the following
-example.</P>
-
-<TABLE><TR><TD><PRE>
-m4_include(`example.c')
-</PRE></TD></TABLE>
-
-<P>This would create the following documentation</P>
-
-<TABLE><TR><TD>
-<FONT SIZE="+1">NAME</FONT>
-<PRE><EM>   <B>RB_Panic</B> -- Shout panic, free resources, and shut down.
-</EM></PRE><FONT SIZE="+1">SYNOPSIS</FONT>
-<PRE>   <B>RB_Panic</B> (cause, add_info)
-   <B>RB_Panic</B> (char *, char *)
-</PRE><FONT SIZE="+1">FUNCTION</FONT>
-<PRE>   Prints an error message.
-   Frees all resources used by robodoc.
-   Terminates program.
-</PRE><FONT SIZE="+1">INPUTS</FONT>
-<PRE>   cause    - pointer to a string which describes the
-              cause of the error.
-   add_info - pointer to a string with additional information.
-</PRE><FONT SIZE="+1">SEE ALSO</FONT>
-<PRE>   RB_Close_The_Shop ()
-</PRE><FONT SIZE="+1">SOURCE</FONT>
-<PRE>      void <B>RB_Panic</B> (char *cause, char *add_info)
-      {
-        printf ("Robodoc: Error, %s\n",cause) ;
-        printf ("         %s\n", add_info) ;
-        printf ("Robodoc: Panic Fatal error, closing down...\n") ;
-        RB_Close_The_Shop () ; <FONT COLOR = "#FF0000">/* Free All Resources */</FONT>
-        exit(100) ;
-      }    
-</PRE></TD></TR></TABLE>
-
-
-
-
-www_section(`CLD', `Creating Cross Links')
-
-<P>Creating hyper links within a document and across documents
-is the most interesting feature of ROBODoc.  A document with such
-links is much more easier to read.  If your source code consists
-of just one file, creating links is easy.  Just tell ROBODoc that
-you want to have the output in HTML or AmigaGuide format, and it
-will automatically generate the links.  That is, at the beginning
-of the document it will create a table of contents that consists
-of links to all your function headers.</P>
-
-<P>ROBODoc will also search the complete text of you
-documentation for reference to function names, and it will create
-a link to the documentation of that function.</P>
-
-<P>In most cases, however, your source code does not consists of
-a single file.  It is also possible, however, to create links to
-other files.  This does require the use of some additional files,
-called xref files. These files can be generated with ROBODoc.
-These files contain information about in which file and where in
-the file references can be found.</P>
-
-<P>Lets assume your project is split up in five different source
-files, and you want to generate links between these five files.
-What you have to do to accomplish this is to create a xref file
-for each of those five files.</P>
-
-<P>With the GENXREF option ROBODoc will generate such a xref file
-from the a source-file.  When you use this option, only the xref
-file is created not the autodocs-file, however you still have to
-specify the name of the autodocs file because this name is needed
-for the creation of the xref file.</P>
-
-<P>When all xref files are created you are ready to create the
-documentation.  To do so you use ROBODOC with the XREF option. It
-needs a parameter which is the name of the file in which the
-names of all xref files are defined.  Notice: this is a file with
-file names, it has to be created it by hand.</P>
-
-<P>An example will make things more clear. In the ROBODoc
-archive, under <TT>examples/C</TT> there are two source files
-www_link(`../Examples/C/prog1.c', `prog1.c') and
-www_link(`../Examples/C/prog2.c', `prog2.c').  We can create
-documentation with hyper links from these two files as follows:
-</P>
-
-<P>First create the xref files:</P>
-
-<TABLE>
-<TR>
-<TD>
-<PRE>
-  robodoc prog1.c prog1.c.html GENXREF prog1.c.xref HTML INTERNAL
-  robodoc prog2.c prog2.c.html GENXREF prog2.c.xref HTML INTERNAL
-</PRE>
-</TD>
-</TR>
-</TABLE>
-
-<P>Now there are two xref files: prog1.c.xref and prog2.c.xref.
-Note that ROBODoc did not create any HTML files, just the xref
-files. The name prog1.c.html is needed to create the correct xref
-files.  For prog1.c internal headers were also included. </P>
-
-<P>Now create a file with the xref file names.  This file will
-hold only two lines. You can give it any name, say
-<TT>xref_files</TT>.</P>
-<TABLE>
-<TR>
-<TD>
-<PRE>
-  echo prog1.c.xref &gt;  xref_files 
-  echo prog2.c.xref &gt;&gt; xref_files
-</PRE>
-</TD>
-</TR>
-</TABLE>
-<P>Now generate the final documentation:</P>
-<TABLE>
-<TR>
-<TD>
-<PRE>
-  robodoc prog1.c prog1.c.html XREF xref_files HTML INTERNAL
-  robodoc prog2.c prog2.c.html XREF xref_files HTML INTERNAL
-</PRE>
-</TD>
-</TR>
-</TABLE>
-
-<P>Have a look the the documentation generated:</P>
-<OL>
-  <LI>www_link(`../Examples/C/prog1.c.html',  `prog1.c.html')</LI>
-  <LI>www_link(`../Examples/C/prog2.c.html',  `prog2.c.html')</LI>
-</OL>
-
-
-
-www_subSection(`limits', `Limitations')
-
-<P> ROBODoc knows very little about the grammar of programming
-languages.  Links are created by looking up words in a table.
-This means that it sometimes creates links where there should be
-none.  For instance if you have a function called usage(); every
-time you use the word usage in any of your documentation a link
-will show up. It also means that sometimes is does not create
-links where you would like it to create a link. Say you include
-the source code of a method using the source item. Your method
-uses other methods of the class. You would like to have links
-pointing to the documentation of these methods each time you use
-one. They will not appear though. Since to ROBODoc stores the
-whole name of a method, ie, <TT>someClass::MethodName</TT>. In
-the method source you will use just <TT>MethodName()</TT>. </P>
-
-
-
-www_section(`MAIND', `Master Index File')
-
-<P>If your project consists of many source files you might want
-to create a master index file.</P> 
-
-<P>For HTML output this file contains links to the documentation
-generated from each of your source files as well as a list of all
-"objects" that you documented. All "objects" are listed according
-to header type, using the following order: Projects, Classes,
-Methods, Stuctures, Functions, Variables, Constants, Generic,
-Internal.</P>
-
-<P>For LaTeX output this file is one big document that contains
-the documentation generated from all your source files. It also
-includes a table of contents and an index section.  This index
-lists the page number of the page a function's documentation.
-</P>
-
-<P>This index file is generated based on the information found in
-your xrefs file. That is the file with the names of all your xref
-files. So before you can create the master index file you have to
-create all your xref files.</P>
-
-<P>To generate a master index file use:</P>
-<PRE>
-   robodoc &lt;xrefs file&gt; &lt;master index file&gt; INDEX HTML TITLE "Master Index"
-</PRE>
-<P>or</P>
-<PRE>
-   robodoc &lt;xrefs file&gt; &lt;master index file&gt; INDEX LATEX TITLE "ROBODoc API Documentation"
-</PRE>
-<P>The master index file can currently only be generated in HTML or LaTeX.</P>
-
-<P>If you use if for LaTeX documentation you need to use the option
-<TT>SINGLEDOC</TT> when you generate the documentation from your various
-source files.  This ensures that no document preambles are generated.
-The master index file contains command that includes all your documentation
-files and make it into one single document.</P>
-
-
-www_subSection(`MIEXM', `examples')
-
-<P>Here are some examples of master index files</P>
-<UL>
-
-  <LI>www_link(`../Examples/CPP/masterindex.html', 
-      `Master index for a C++ project') to be found in 
-      <TT>Examples/CPP/</TT></LI>
-
-  <LI>www_link(`../Source/ROBODoc_mi.html', 
-      `Master index for ROBODoc') to be found in 
-      <TT>Source/</TT>. 
-  </LI>
-
-</UL>
-
-
-
-www_section(`makefile', `Automation with <TT>make</TT>')
-
-<P>The whole process of creating documentation with ROBODoc is of
-course best automated with <TT>make</TT>.
-Have a look at the following makefile.</P> 
-
-<TABLE><TR><TD><PRE>
-SHELL = /bin/sh
-.SUFFIXES:
-
-ROBODOC=robodoc
-ROBOOPTS=C SORT 
-
-# Your source files.
-#
-SOURCES=analyser.c generator.c items.c util.c \
-  folds.c headers.c links.c robodoc.c \
-  analyser.h generator.h items.h util.h \
-  folds.h headers.h links.h robodoc.h
-
-# The name of your Project
-#
-PROJECT=robodoc
-
-# The various documentation files, derived from the source files.
-# HTML
-#
-HTMLDOCS=$(SOURCES:=.html)
-HTMLXREFS=$(HTMLDOCS:.html=.html.xref)
-HTMLXREFSFILE=$(PROJECT)_html.xrefs
-# LATEX
-#
-LATEXDOCS=$(SOURCES:=.tex)
-LATEXXREFS=$(LATEXDOCS:.tex=.tex.xref)
-LATEXXREFSFILE=$(PROJECT)_tex.xrefs
-# ASCII
-#
-ASCIIDOCS=$(SOURCES:=.txt)
-# RTF
-#
-RTFDOCS=$(SOURCES:=.rtf)
-RTFXREFS=$(RTFDOCS:.rtf=.rtf.xref)
-RTFXREFSFILE=$(PROJECT)_rtf.xrefs
-
-# Some common targets
-xrefall: xrefhtml xreftex xrefrtf
-docall: html tex ascii rtf
-
-# Create the xref files for the various formats.
-xhtml: $(HTMLXREFSFILE) 
-xtex: $(LATEXXREFSFILE) 
-xrtf: $(RTFXREFSFILE)
-
-# Create the documentation files for the various formats.
-html: $(HTMLDOCS) $(PROJECT)_mi.html 
-tex: $(LATEXDOCS) $(PROJECT)_mi.tex
-rtf: $(RTFDOCS)
-ascii: $(ASCIIDOCS)
-
-# master index file, currently works only for html and latex documentation.
-# Note that you can define the title of the document.
-$(PROJECT)_mi.html: $(HTMLXREFSFILE) 
-       $(ROBODOC) $&lt; $@ INDEX HTML TITLE "$(PROJECT) Master Index"
-
-$(PROJECT)_mi.tex: $(LATEXXREFSFILE)
-       $(ROBODOC) $&lt; $@ INDEX LATEX TITLE "$(PROJECT) API Reference"
-
-# create xrefs file (file with the names of all .xref files).
-$(HTMLXREFSFILE) : $(HTMLXREFS)
-       /bin/ls $(HTMLXREFS) &gt; $@
-$(LATEXXREFSFILE) : $(LATEXXREFS)
-       /bin/ls  $(LATEXXREFS) &gt; $@
-$(RTFXREFSFILE) : $(RTFXREFS)
-       /bin/ls  $(RTFXREFS) &gt; $@
-
-# Rule to create an .xref file from a source file for the various formats.
-%.html.xref : %
-       $(ROBODOC) $&lt; $(@:.xref=) $(ROBOOPTS) INTERNAL GENXREF $@
-%.tex.xref : %
-       $(ROBODOC) $&lt; $(@:.xref=) $(ROBOOPTS) INTERNAL GENXREF $@
-%.rtf.xref : %
-       $(ROBODOC) $&lt; $(@:.xref=) $(ROBOOPTS) INTERNAL GENXREF $@
-
-# Rule to create html documentation from a source file.
-%.html : %
-       $(ROBODOC) $&lt; $@ HTML $(ROBOOPTS) XREF $(HTMLXREFSFILE)
-
-# Rule to create latex documentation from a source file.
-# We do not include source items, and generate laxtex documents
-# than can be included in a master document.
-%.tex : %
-       $(ROBODOC) $&lt; $@ LATEX $(ROBOOPTS) NOSOURCE SINGLEDOC XREF $(LATEXXREFSFILE)
-
-# Rule to create ascii documentation from a source file.
-%.txt : %
-       $(ROBODOC) $&lt; $@ ASCII 
-
-# Rule to create rtf documentation from a source file.
-%.rtf : %
-       $(ROBODOC) $&lt; $@ RTF $(ROBOOPTS) XREF $(RTFXREFSFILE)
-
-# Use netscape to view the master index file for our project.
-htmlview: html
-       netscape $(PROJECT)_mi.html
-
-# Use the latex programs to generate a .dvi from the master index file
-# for our prokect. View this .dvi file with xdvi
-texview:  tex
-       latex $(PROJECT)_mi
-       makeindex $(PROJECT)_mi
-       latex $(PROJECT)_mi
-       latex $(PROJECT)_mi
-       xdvi  $(PROJECT)_mi.dvi
-
-# Clean-up the mess we made
-#
-clean:
-       rm -f $(HTMLXREFS) 
-       rm -f $(HTMLDOCS) 
-       rm -f $(LATEXXREFS)
-       rm -f $(LATEXDOCS) 
-       rm -f $(PROJECT)_mi.* *.aux
-       rm -f $(RTFXREFS)
-       rm -f $(RTFDOCS)
-       rm -f $(ASCIIDOCS)
-       rm -f $(HTMLXREFSFILE) 
-       rm -f $(LATEXXREFSFILE) 
-       rm -f $(RTFXREFSFILE)
-</PRE></TD></TR></TABLE>
-
-<P>It includes all the necessary commands to generate and view the documentation for you project. You create documentation in any of the four formats.
-For instance to create documentation in html format use:</P>
-<TABLE><TR><TD><PRE>
-  make xhtml
-  make html
-</PRE></TD></TR></TABLE>
-<P>To make documentation in LaTeX format use:</P>
-<TABLE><TR><TD><PRE>
-  make xtex
-  make tex
-</PRE></TD></TR></TABLE>
-<P>To view your documentation use:</P>
-<TABLE><TR><TD><PRE>
-  make xhtml
-  make texview
-</PRE></TD></TR></TABLE>
-<P>or</P>
-<TABLE><TR><TD><PRE>
-  make xtex
-  make texview
-</PRE></TD></TR></TABLE>
-
-
-<P>To clean up all the documentation files use:</P>
-<PRE>
-  make clean
-</PRE>
-
-<P>To use this make file in project set the variable
-<TT>SOURCE</TT> to the names of your source files and set the
-variable <TT>PROJECT</TT> to the name of your project.</P>
-
-<P>You can find a copy of the above makefile
-<TT>Docs/example_makefile</TT>.  This should get you started in
-no time.</P>
-
-www_section(`MDSO', `What to do if You have Sources in Multiple Directories')
-
-<P>It is possible to have your sources in multiple
-subdirectories. However the generated documentation is expected
-to be in one single directory. If not the cross references will
-be wrong, at least in the HTML documentation.</P>
-
-<P>Say you have the following directory structure:</P>
-<TABLE><TR><TD><PRE>
-  Project/
-     Dir1/
-        program1.c 
-     Dir2/
-        program2.c 
-</PRE></TD></TR></TABLE>
-
-<P>You can create the documentation for that as follows (assuming
-you are in Project):
-</P>
-<TABLE><TR><TD><PRE>
-  robodoc Dir1/prog1.c prog1.c.html HTML GENXREF Dir1/prog1.xref 
-  robodoc Dir2/prog2.c prog2.c.html HTML GENXREF Dir2/prog2.xref 
-  echo "Dir1/prog1.xref" &gt; xreffiles 
-  echo "Dir2/prog2.xref" &gt;&gt; xreffiles 
-  robodoc Dir1/prog1.c prog1.c.html HTML XREF xreffiles 
-  robodoc Dir2/prog2.c prog2.c.html HTML XREF xreffiles 
-  robodoc xreffiles master_index.html INDEX HTML 
-</PRE></TD></TR></TABLE>
-<P>
-This generates the following files:
-</P>
-<TABLE><TR><TD><PRE>
-   prog1.c.html
-   prog2.c.html
-   master_index.html
-</PRE></TD></TR></TABLE>
-
-
-<P>With some version of make (for instance the gnu version) you
-can strip the directory part of a filename with $(notdir NAME)
-How this can be used is shown in the following example
-makefile.  Here we have the sources for robodoc, the <TT>.c</TT> files are
-in the directory <TT>Sources/</TT> and <TT>.h</TT> files are in the
-directory <TT>Headers/</TT>.</P>
-
-<TABLE><TR><TD><PRE>
-SHELL = /bin/sh
-.SUFFIXES:
-
-ROBODOC=./robodoc
-ROBOOPTS=C SORT 
-
-# Your source files.
-#
-SOURCES=Sources/analyser.c Sources/generator.c Sources/items.c Sources/util.c \
-  Sources/folds.c Sources/headers.c Sources/links.c Sources/robodoc.c \
-  Headers/analyser.h Headers/generator.h Headers/items.h Headers/util.h \
-  Headers/folds.h Headers/headers.h Headers/links.h Headers/robodoc.h
-
-# The name of your Project
-#
-PROJECT=ROBODoc
-
-# The various documentation files, derived from the source files.
-#
-HTMLDOCS=$(SOURCES:=.html)
-HTMLXREFS=$(HTMLDOCS:.html=.html.xref)
-HTMLXREFSFILE=$(PROJECT)_html.xrefs
-
-# Create the xref files for the various formats.
-xhtml: $(HTMLXREFSFILE) 
-
-# Create the documentation 
-html: $(HTMLDOCS) $(PROJECT)_mi.html 
-
-# Create master index file.
-$(PROJECT)_mi.html: $(HTMLXREFSFILE) 
-       $(ROBODOC) $&lt; $@ INDEX HTML TITLE "$(PROJECT) Master Index"
-
-# Create the file with the names of all xref files.
-$(HTMLXREFSFILE) : $(HTMLXREFS)
-       /bin/ls $(HTMLXREFS) &gt; $@
-
-# Rule to create an .xref file from a source file 
-%.html.xref : %
-       $(ROBODOC) $&lt; $(notdir $(@:.xref=)) $(ROBOOPTS) INTERNAL GENXREF $@
-
-# Rule to create html documentation from a source file.
-%.html : %
-       $(ROBODOC) $&lt; $(notdir ${@}) HTML $(ROBOOPTS) XREF $(HTMLXREFSFILE)
-</PRE></TD></TR></TABLE>
-
-
-www_section(`RDF', `The ROBODoc Defaults File')
-
-<P>The robodoc.default file can be used to change the appearance
-of the documentation. For each item type you can define how the
-corresponding text should be rendered.  Each line in the default
-file consists of two parts, the item type and the item
-attributes. For instance</P>
-
-<PRE>
-AUTHOR                    LARGE ITALICS BOLD UNDERLINE
-</PRE>
-
-<P>Specifies that the AUTHOR item has the attributes LARGE,
-ITALICS, BOLD, and UNDERLINE.  The effect of each attribute is
-listed in the following table.</P>
-
-<TABLE>
-<TR><TD>Item Attributes</TD> 
-    <TD>Effect in HTML</TD>
-</TR>
-<TR><TD>LARGE</TD>
-    <TD>&lt;FONT SIZE=5&gt;,&lt;/FONT&gt;</TD>
-</TR>
-<TR><TD>SMALL</TD>
-    <TD>&lt;FONT SIZE=-1&gt;,&lt;/FONT&gt;</TD>
-</TR>
-<TR><TD>ITALICS</TD>
-    <TD>&lt;I&gt;,&lt;/I&gt;</TD>
-</TR>
-<TR><TD>BOLD</TD>
-    <TD>&lt;B&gt;,&lt;/B&gt;</TD>
-</TR>
-<TR><TD>UNDERLINE</TD>
-    <TD>&lt;U&gt;,&lt;/U&gt;</TD>
-</TR>
-<TR><TD>HIGHLIGHT</TD>
-    <TD>&lt;EM&gt;,&lt;/EM&gt;</TD>
-</TR>
-</TABLE>
-
-
-www_section(`UOB', `ROBODoc Command Line Options')
-
-<P>When using ROBODoc you should provide at least two
-parameters</P>
-
-<PRE>
-  robodoc &lt;source file&gt; &lt;documentation file&gt; [options]
-</PRE>
-
-<P>Here sourcefile is the file with the program source from which
-the documentation is to be extracted. The documentation file is
-the file that will contain the extracted documentation.  </P>
-
-<P>In case you are creating a master index file you have to
-specify three parameters</P> 
-<PRE>
-  robodoc &lt;xrefs file&gt; &lt;master index file&gt; INDEX [options]
-</PRE>
-
-
-<P>In addition to this you can specify one or more of the
-following options:</P>
-
-<TABLE >
-  <TR><TD><TT>ASCII</TT></TD>
-      <TD>Generate documentation in ASCII format (default)</TD>
-  </TR>
-  <TR><TD><TT>GUIDE</TT></TD>
-      <TD>Generate documentation in AmigaGuide format.</TD>
-  </TR>
-  <TR><TD><TT>HTML</TT></TD>
-      <TD>Generate documentation in HTML format.</TD>
-  </TR>
-  <TR><TD><TT>LATEX</TT></TD>
-      <TD>Generate documentation in LaTeX format. (Experimental)</TD>
-  </TR>
-  <TR><TD><TT>RTF</TT></TD>
-      <TD>Generate documentation in RTF format.</TD>
-  </TR>
-  <TR><TD><TT>C</TT></TD>
-      <TD>Use ANSI C grammar in source items (test, HTML only)</TD>
-  </TR>
-  <TR><TD><TT>FOLD</TT></TD>
-      <TD>Enable folding. (Experimental)</TD>
-  </TR>
-  <TR><TD><TT>GENXREF &lt;xref file&gt;</TT></TD>
-      <TD>Generate a xref file, which can be used to create
-         www_link(`#CLD', `cross links') between documents.</TD>
-  </TR>
-  <TR><TD><TT>XREF &lt;xrefs file&gt;</TT></TD>
-      <TD>Use a set of xref files to create references (links) to other
-      documents or within the document. <TT>&lt;xrefs file&gt;</TT>
-      is a file with xref file names.</TD>
-  </TR>
-  <TR><TD><TT>INDEX</TT></TD>
-     <TD>Create a www_link(`#MAIND', `master index file').</TD>
-  </TR>
-  <TR><TD><TT>INTERNAL</TT></TD>
-     <TD>Also include headers that are marked internal.</TD>
-  </TR>
-  <TR><TD><TT>INTERNALONLY</TT></TD>
-      <TD>Only extract the headers marked internal.</TD>
-  </TR>
-  <TR><TD><TT>NOSOURCE</TT></TD>
-      <TD>Do not include the source items in the documentation.</TD>
-  </TR>
-  <TR><TD><TT>SORT</TT></TD>
-      <TD>Sort the headers alphabetically.</TD>
-  </TR>
-  <TR><TD><TT>SINGLEDOC</TT></TD>
-      <TD>Do not create a document header and footer when creating 
-          documentation in LaTeX format.  This allows you to include
-          the generated documents into big document or 
-          www_link(`#MAIND', `master index file').</TD>
-  </TR>
-  <TR><TD><TT>TITLE &lt;title&gt;</TT></TD>
-      <TD>Sets the title that is used for the 
-         www_link(`#MAIND', `master index file').</TD>
-  </TR>
-  <TR><TD><TT>TOC</TT></TD>
-      <TD>Generate a table of contents.  It is only useful when you select
-      ASCII as output mode.  With all other output modes the
-      table of contents is generated anyway.</TD>
-  </TR>
-  <TR><TD><TT>TABSIZE &lt;n&gt;</TT></TD>
-      <TD>Convert each tab into <TT>n</TT> spaces.</TD>
-  </TR>
-  <TR><TD><TT>-v</TT></TD>
-      <TD>Verbose option, ROBODoc will tell you what it is doing.</TD>
-  </TR>
-</TABLE>
-
-<P>If you wonder why all the odd ALL CAPS flags are used instead
-of for instance "-x"; this was how it was done on the Amiga.</P>
-
-<P>The following abbreviations are also allowed:</P>
-<TABLE >
-<TR><TD><TT>-s </TT></TD><TD><TT>SORT</TT></TD></TR>
-<TR><TD><TT>-t </TT></TD><TD><TT>TOC</TT></TD></TR>
-<TR><TD><TT>-x </TT></TD><TD><TT>XREF</TT></TD></TR>
-<TR><TD><TT>-g </TT></TD><TD><TT>GENXREF</TT></TD></TR>
-<TR><TD><TT>-i </TT></TD><TD><TT>INTERNAL</TT></TD></TR>
-<TR><TD><TT>-io</TT></TD><TD><TT>INTERNALONLY</TT></TD></TR>
-<TR><TD><TT>-ts</TT></TD><TD><TT>TABSIZE</TT></TD></TR>
-</TABLE>
-
-
-www_section(`ADV', `Adding New Languages')
-
-<P>To add a new programming language to ROBODoc you have to edit
-<TT>headers.c</TT>.  Here you find three variables:
-<TT>header_markers</TT>, <TT>remark_markers</TT>, and
-<TT>end_markers</TT>.  There are all arrays, and you have to add
-an new entry to each of these three arrays.</P>
-
-<P>Say your programming language uses the following type of remarks:</P>
-<PRE>
-   $%% This is a remark with some text       
-       and some more and some more  %%$
-</PRE>
-
-<P>That is is starts with three spaces and then <TT>$%%</TT>, and
-has to end with <TT>%%$</TT>. Then you would add to <TT>header_markers</TT>
-</P>
-<PRE>
-   "   $%%****",
-</PRE>
-<P>To <TT>remark_markers</TT> you would add</P>
-<PRE>
-   "   *",
-</PRE>
-<P>And to <TT>end_markers</TT> you would add</P>
-<PRE>
-   "   $%%***",
-</PRE>
-<P>You can then use the following kind of headers in your program:</P>
-<PRE>
-   $%%****f* Test/afunction ***** 
-   * NAME  
-   *   afunction
-   * FUNCTION
-   *   A test.
-   * SOURCE
-   *%%$
-     afunction(test,test) [
-       print hello world ;
-     ]
-   $%%***%%$
-</PRE>
-
-
-
-
-
-www_section(`SAB', `Suggestions and Bugs')
-
-<P>If you find any bugs, catch them, put them in a jar, and send
-them to:</P> 
-<ADDRESS>fslothouber@acm.org</ADDRESS>  
-<P>Suggestions are also welcome at this address.  Flames can be
-directed to the sun.</P>
-
-www_bodyend
-www_docend
-
diff --git a/util/robodoc/Docs/tocgen.m4 b/util/robodoc/Docs/tocgen.m4
deleted file mode 100644 (file)
index 94d2f51..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-m4_changecom(`/-*', `*-/')m4_dnl
-m4_define(`www_sectionCounter',0)m4_dnl
-m4_define(`www_subSectionCounter',0)m4_dnl
-m4_define(`www_incrCounter',`m4_define(`$1',m4_incr($1))')m4_dnl
-m4_define(`www_section', `www_incrCounter(`www_sectionCounter')<STRONG><FONT COLOR="red">m4_format(`%02d', www_sectionCounter)</FONT>......... <A HREF="#$1">$2</A></STRONG><BR> m4_define(`www_subSectionCounter', 0)')m4_dnl
-m4_define(`www_subSection', `www_incrCounter(`www_subSectionCounter')<STRONG><font color="red">m4_format(`%02d.%02d', www_sectionCounter, www_subSectionCounter)</font>.......... <A HREF="#$1">$2</A></STRONG><BR>')m4_dnl
diff --git a/util/robodoc/Examples/C/makefile b/util/robodoc/Examples/C/makefile
deleted file mode 100644 (file)
index 12dd865..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-#
-# $Id$
-#
-#
-
-myclean:
-       rm -f *~
-       rm -f *.xref
-       rm -f *.html
-       rm -f xref_files
-
-#
-# Creates the example used in the documentation.
-# Assumed robodoc has been installed.
-#
-# It also shows how to make some plain makefile rules to
-# generate documentation.
-#
-
-xref_files : prog1.c.xref prog2.c.xref 
-       echo "prog1.c.xref" >  xref_files
-       echo "prog2.c.xref" >> xref_files
-
-prog1.c.xref : prog1.c 
-       robodoc prog1.c prog1.c.html GENXREF prog1.c.xref HTML INTERNAL
-
-prog2.c.xref : prog2.c
-       robodoc prog2.c prog2.c.html GENXREF prog2.c.xref HTML INTERNAL
-
-prog1.c.html : prog1.c xref_files 
-       robodoc prog1.c prog1.c.html XREF xref_files HTML INTERNAL
-
-prog2.c.html : prog2.c xref_files 
-       robodoc prog2.c prog2.c.html XREF xref_files HTML INTERNAL
diff --git a/util/robodoc/Examples/C/prog1.c b/util/robodoc/Examples/C/prog1.c
deleted file mode 100644 (file)
index ba29eb2..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-/****h* TEST/Prog1 ***
-*  NAME
-*    Prog1 -- Test program 1. (v1.0)
-*  COPYRIGHT
-*    Maverick Software Development (C) 1995
-*  FUNCTION
-*    Totally nothing and useless.
-*  AUTHOR
-*    Jacco van Weert
-*  CREATION DATE
-*    15-Feb-95
-*  MODIFICATION HISTORY
-*    15-Feb-95 - v1.0 - First version
-*  NOTES
-*    Nothing special
-***********
-*/
-
-/****i* Prog1/Proc_Internal1 ***
-*  NAME
-*    Proc_Internal1 -- Internal procedure test program. (v1.0)
-*  SYNOPSIS
-*    Proc_Internal1
-*  FUNCTION
-*    Just for fun.
-*  BUGS
-*    The procedure does not exist :)
-*  PURPOSE
-*    The purpose of the procedure, whatever it is.
-*  SEE ALSO
-*    Proc_Normal1, Proc_Internal2
-*    Proc_Normal2, prog2.c
-*********
-*/
-
-/****** Prog1/Proc_Normal1 **
-*
-* NAME
-*   Proc_Normal1 -- Normal procedure. (v1.0)
-* SYNOPSIS
-*   Proc_Normal1
-* FUNCTION
-*    Useless.
-* SEE ALSO
-*  Proc_Internal1, 
-*  Proc_Normal2,
-*  prog2.c, 
-*  Prog2
-***********
-*/
-
-
-
-
-
diff --git a/util/robodoc/Examples/C/prog1.c.html b/util/robodoc/Examples/C/prog1.c.html
deleted file mode 100644 (file)
index b7cabbb..0000000
+++ /dev/null
@@ -1,69 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
-<HTML><HEAD>
-<TITLE>prog1.c.html</TITLE>
-<!-- Source: prog1.c -->
-<!-- Generated with ROBODoc Version 3.2.2 (Jan 28 2001) -->
-<!-- ROBODoc (c) 1994-2000 by Frans Slothouber and Jacco van Weert. -->
-</HEAD><BODY BGCOLOR="#FFFFFF">
-<A NAME="prog1.c">Generated from prog1.c</A> with ROBODoc v3.2.2 on Mon Apr 02 20:03:02 2001
-<BR>
-<H3 ALIGN="center">TABLE OF CONTENTS</H3>
-<OL>
-<LI><A HREF="#Prog1">TEST/Prog1</A>
-<LI><A HREF="#Proc_Internal1">Prog1/Proc_Internal1</A>
-<LI><A HREF="#Proc_Normal1">Prog1/Proc_Normal1</A>
-</OL>
-<HR>
-
-<H2><A NAME="Prog1">TEST/Prog1</A></H2>
-
-<FONT SIZE="+1">NAME</FONT>
-<PRE><EM>    <B>Prog1</B> -- Test program 1. (v1.0)
-</EM></PRE><FONT SIZE="+1">COPYRIGHT</FONT>
-<PRE>    Maverick Software Development (C) 1995
-</PRE><FONT SIZE="+1">FUNCTION</FONT>
-<PRE>    Totally nothing and useless.
-</PRE><FONT SIZE="+1">AUTHOR</FONT>
-<PRE><B>    Jacco van Weert
-</B></PRE><FONT SIZE="+1">CREATION DATE</FONT>
-<PRE><B>    15-Feb-95
-</B></PRE><FONT SIZE="+1">MODIFICATION HISTORY</FONT>
-<PRE>    15-Feb-95 - v1.0 - First version
-</PRE><FONT SIZE="+1">NOTES</FONT>
-<PRE><EM>    Nothing special
-</EM></PRE>
-<HR>
-
-<H2><A NAME="Proc_Internal1">Prog1/Proc_Internal1</A></H2>
-
-<FONT SIZE="+1">NAME</FONT>
-<PRE><EM>    <B>Proc_Internal1</B> -- Internal procedure test program. (v1.0)
-</EM></PRE><FONT SIZE="+1">SYNOPSIS</FONT>
-<PRE>    <B>Proc_Internal1</B>
-</PRE><FONT SIZE="+1">FUNCTION</FONT>
-<PRE>    Just for fun.
-</PRE><FONT SIZE="+1">BUGS</FONT>
-<PRE><EM>    The procedure does not exist :)
-</EM></PRE><FONT SIZE="+1">PURPOSE</FONT>
-<PRE>    The purpose of the procedure, whatever it is.
-</PRE><FONT SIZE="+1">SEE ALSO</FONT>
-<PRE>    <A HREF="#Proc_Normal1">Proc_Normal1</A>, <A HREF="prog2.c.html#Proc_Internal2">Proc_Internal2</A>
-    <A HREF="prog2.c.html#Proc_Normal2">Proc_Normal2</A>, <A HREF="prog2.c.html#prog2.c">prog2.c</A>
-</PRE>
-<HR>
-
-<H2><A NAME="Proc_Normal1">Prog1/Proc_Normal1</A></H2>
-
-<FONT SIZE="+1">NAME</FONT>
-<PRE><EM>   <B>Proc_Normal1</B> -- Normal procedure. (v1.0)
-</EM></PRE><FONT SIZE="+1">SYNOPSIS</FONT>
-<PRE>   <B>Proc_Normal1</B>
-</PRE><FONT SIZE="+1">FUNCTION</FONT>
-<PRE>    Useless.
-</PRE><FONT SIZE="+1">SEE ALSO</FONT>
-<PRE>  <A HREF="#Proc_Internal1">Proc_Internal1</A>, 
-  <A HREF="prog2.c.html#Proc_Normal2">Proc_Normal2</A>,
-  <A HREF="prog2.c.html#prog2.c">prog2.c</A>, 
-  <A HREF="prog2.c.html#Prog2">Prog2</A>
-</PRE>
-</BODY></HTML>
diff --git a/util/robodoc/Examples/C/prog2.c b/util/robodoc/Examples/C/prog2.c
deleted file mode 100644 (file)
index b712436..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-/****h* TEST/Prog2 *****
-* NAME
-*   Prog2 -- Test program 2. (v1.0)
-* COPYRIGHT
-*   Maverick Software Development (C) 1995
-* FUNCTION
-*  Totally nothing and useless.
-* AUTHOR
-*  Jacco van Weert
-* MODIFICATION HISTORY
-*   15-Feb-95 - v1.0 - First version
-* NOTES
-*   Nothing special
-******
-*/
-
-
-/****i* Prog2/Proc_Internal2 **
-*  NAME
-*    Proc_Internal2 -- Internal procedure test program. (v1.0)
-*  SYNOPSIS
-*    Proc_Internal2
-*  FUNCTION
-*    Just for fun.
-*  INPUTS
-*    No inputs
-*  BUGS
-*    The procedure does not exist :)
-* SEE ALSO
-*  Proc_Normal1, Proc_Internal1, Proc_Normal2, prog1.c
-************
-*/
-
-/****** Prog2/Proc_Normal2 ***
-*  NAME
-*    Proc_Normal2 -- Normal procedure. (v1.0)
-*  SYNOPSIS
-*    Proc_Normal2
-*  FUNCTION
-*    Useless.
-*  SEE ALSO
-*    Proc_Internal1, Proc_Normal1, prog1.c
-******
-*/
-
-
-
-
-
-
diff --git a/util/robodoc/Examples/C/prog2.c.html b/util/robodoc/Examples/C/prog2.c.html
deleted file mode 100644 (file)
index 8410c01..0000000
+++ /dev/null
@@ -1,63 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
-<HTML><HEAD>
-<TITLE>prog2.c.html</TITLE>
-<!-- Source: prog2.c -->
-<!-- Generated with ROBODoc Version 3.2.2 (Jan 28 2001) -->
-<!-- ROBODoc (c) 1994-2000 by Frans Slothouber and Jacco van Weert. -->
-</HEAD><BODY BGCOLOR="#FFFFFF">
-<A NAME="prog2.c">Generated from prog2.c</A> with ROBODoc v3.2.2 on Mon Apr 02 20:03:02 2001
-<BR>
-<H3 ALIGN="center">TABLE OF CONTENTS</H3>
-<OL>
-<LI><A HREF="#Prog2">TEST/Prog2</A>
-<LI><A HREF="#Proc_Internal2">Prog2/Proc_Internal2</A>
-<LI><A HREF="#Proc_Normal2">Prog2/Proc_Normal2</A>
-</OL>
-<HR>
-
-<H2><A NAME="Prog2">TEST/Prog2</A></H2>
-
-<FONT SIZE="+1">NAME</FONT>
-<PRE><EM>   <B>Prog2</B> -- Test program 2. (v1.0)
-</EM></PRE><FONT SIZE="+1">COPYRIGHT</FONT>
-<PRE>   Maverick Software Development (C) 1995
-</PRE><FONT SIZE="+1">FUNCTION</FONT>
-<PRE>  Totally nothing and useless.
-</PRE><FONT SIZE="+1">AUTHOR</FONT>
-<PRE><B>  Jacco van Weert
-</B></PRE><FONT SIZE="+1">MODIFICATION HISTORY</FONT>
-<PRE>   15-Feb-95 - v1.0 - First version
-</PRE><FONT SIZE="+1">NOTES</FONT>
-<PRE><EM>   Nothing special
-</EM></PRE>
-<HR>
-
-<H2><A NAME="Proc_Internal2">Prog2/Proc_Internal2</A></H2>
-
-<FONT SIZE="+1">NAME</FONT>
-<PRE><EM>    <B>Proc_Internal2</B> -- Internal procedure test program. (v1.0)
-</EM></PRE><FONT SIZE="+1">SYNOPSIS</FONT>
-<PRE>    <B>Proc_Internal2</B>
-</PRE><FONT SIZE="+1">FUNCTION</FONT>
-<PRE>    Just for fun.
-</PRE><FONT SIZE="+1">INPUTS</FONT>
-<PRE>    No inputs
-</PRE><FONT SIZE="+1">BUGS</FONT>
-<PRE><EM>    The procedure does not exist :)
-</EM></PRE><FONT SIZE="+1">SEE ALSO</FONT>
-<PRE>  <A HREF="prog1.c.html#Proc_Normal1">Proc_Normal1</A>, <A HREF="prog1.c.html#Proc_Internal1">Proc_Internal1</A>, <A HREF="#Proc_Normal2">Proc_Normal2</A>, <A HREF="prog1.c.html#prog1.c">prog1.c</A>
-</PRE>
-<HR>
-
-<H2><A NAME="Proc_Normal2">Prog2/Proc_Normal2</A></H2>
-
-<FONT SIZE="+1">NAME</FONT>
-<PRE><EM>    <B>Proc_Normal2</B> -- Normal procedure. (v1.0)
-</EM></PRE><FONT SIZE="+1">SYNOPSIS</FONT>
-<PRE>    <B>Proc_Normal2</B>
-</PRE><FONT SIZE="+1">FUNCTION</FONT>
-<PRE>    Useless.
-</PRE><FONT SIZE="+1">SEE ALSO</FONT>
-<PRE>    <A HREF="prog1.c.html#Proc_Internal1">Proc_Internal1</A>, <A HREF="prog1.c.html#Proc_Normal1">Proc_Normal1</A>, <A HREF="prog1.c.html#prog1.c">prog1.c</A>
-</PRE>
-</BODY></HTML>
diff --git a/util/robodoc/Examples/CPP/makefile b/util/robodoc/Examples/CPP/makefile
deleted file mode 100644 (file)
index 7fc75ae..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-# $Id$
-
-ROBODOC=robodoc
-DOCS=muppets.cpp.html muppets.h.html
-XREF=$(DOCS:.html=.xref)
-
-all: masterindex.html
-
-myclean:
-       rm -f *~
-       rm -f *.xref
-       rm -f *.xrefs
-       rm -f *.html
-       rm -f xref_files
-#
-# This makefile shows how with a few rules you can generate
-# the documentation from all your sources.
-#
-
-#
-# create xrefs file (file with the names of all .xref files).
-#
-muppets.xrefs : $(XREF)
-       /bin/ls *.xref > $@
-
-#
-# Rule to create an .xref file.
-#
-%.xref : % muppets.xrefs
-       $(ROBODOC) $< $(@:.xref=.html) INTERNAL -g $@ -v
-
-#
-# Rule to create an .html file.
-#
-%.html : %
-       $(ROBODOC) $< $@ HTML INTERNAL -x muppets.xrefs -v
-
-#
-#
-#
-masterindex.html : muppets.xrefs $(DOCS)
-       $(ROBODOC) $< $@ INDEX HTML
-
-
diff --git a/util/robodoc/Examples/CPP/masterindex.html b/util/robodoc/Examples/CPP/masterindex.html
deleted file mode 100644 (file)
index 396d0aa..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
-<HTML><HEAD>
-<TITLE>Master Index File</TITLE>
-<!-- Source: muppets.xrefs -->
-<!-- Generated with ROBODoc Version 3.2.2 (Jan 28 2001) -->
-<!-- ROBODoc (c) 1994-2000 by Frans Slothouber and Jacco van Weert. -->
-</HEAD><BODY BGCOLOR="#FFFFFF">
-<A NAME="muppets.xrefs">Generated from muppets.xrefs</A> with ROBODoc v3.2.2 on Mon Apr 02 20:03:03 2001
-<BR>
-<H1>Master Index File</H1>
-<H2>Source Files</H2>
-<TABLE>
-<TR>
-<TD><A HREF="muppets.cpp.html#muppets.cpp"><TT>muppets.cpp</TT></A></TD>
-<TD><A HREF="muppets.h.html#muppets.h"><TT>muppets.h</TT></A></TD>
-<TD></TD>
-<TD></TD>
-<TD></TD>
-<TD></TD>
-</TR>
-</TABLE>
-<H2>Classes</H2>
-<TABLE>
-<TR>
-<TD><A HREF="muppets.h.html#puppet"><TT>puppet</TT></A></TD>
-<TD><A HREF="muppets.h.html#stage"><TT>stage</TT></A></TD>
-<TD></TD>
-<TD></TD>
-<TD></TD>
-<TD></TD>
-<TD></TD>
-<TD></TD>
-<TD></TD>
-<TD></TD>
-<TD></TD>
-</TR>
-</TABLE>
-<H2>Methods</H2>
-<TABLE>
-<TR>
-<TD><A HREF="muppets.cpp.html#puppet::act"><TT>puppet::act</TT></A></TD>
-<TD><A HREF="muppets.cpp.html#puppet::talk"><TT>puppet::talk</TT></A></TD>
-<TD><A HREF="muppets.cpp.html#puppet::walk"><TT>puppet::walk</TT></A></TD>
-<TD><A HREF="muppets.cpp.html#stage::lights"><TT>stage::lights</TT></A></TD>
-</TR>
-<TR>
-<TD><A HREF="muppets.cpp.html#stage::open_curtains"><TT>stage::open_curtains</TT></A></TD>
-<TD></TD>
-<TD></TD>
-<TD></TD>
-</TR>
-</TABLE>
-</BODY></HTML>
diff --git a/util/robodoc/Examples/CPP/muppets.cpp b/util/robodoc/Examples/CPP/muppets.cpp
deleted file mode 100644 (file)
index d5a96e1..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-
-/****m* Mupputs/puppet::walk
- * NAME
- *   puppet::walk
- * PURPOSE
- *   Let puppet walk.
- ******
- */
-
-/****m* Mupputs/puppet::talk
- * NAME
- *   puppet::talk
- * PURPOSE
- *   Let puppet talk.
- ******
- */
-
-/****m* Mupputs/puppet::act
- * NAME
- *   puppet::act
- * PURPOSE
- *   Let puppet walk and talk.
- ******
- */
-
-
-/****m* Mupputs/stage::open_curtains
- * NAME
- *   stage::open_curtains -- 
- * PURPOSE
- *   Open the curtains.
- * SOURCE
- */
-
-void stage::open_curtains()
-{
-  lights(ON);
-}
-
-/*********/
-
-
-
-/****m* Mupputs/stage::lights
- * NAME
- *   stage::lights -- switch lights on or off.
- * PURPOSE
- *   Switch lights on or off.
- ******
- */
-
diff --git a/util/robodoc/Examples/CPP/muppets.cpp.html b/util/robodoc/Examples/CPP/muppets.cpp.html
deleted file mode 100644 (file)
index db88b30..0000000
+++ /dev/null
@@ -1,68 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
-<HTML><HEAD>
-<TITLE>muppets.cpp.html</TITLE>
-<!-- Source: muppets.cpp -->
-<!-- Generated with ROBODoc Version 3.2.2 (Jan 28 2001) -->
-<!-- ROBODoc (c) 1994-2000 by Frans Slothouber and Jacco van Weert. -->
-</HEAD><BODY BGCOLOR="#FFFFFF">
-<A NAME="muppets.cpp">Generated from muppets.cpp</A> with ROBODoc v3.2.2 on Mon Apr 02 20:03:03 2001
-<BR>
-<H3 ALIGN="center">TABLE OF CONTENTS</H3>
-<OL>
-<LI><A HREF="#puppet::walk">Mupputs/puppet::walk</A>
-<LI><A HREF="#puppet::talk">Mupputs/puppet::talk</A>
-<LI><A HREF="#puppet::act">Mupputs/puppet::act</A>
-<LI><A HREF="#stage::open_curtains">Mupputs/stage::open_curtains</A>
-<LI><A HREF="#stage::lights">Mupputs/stage::lights</A>
-</OL>
-<HR>
-
-<H2><A NAME="puppet::walk">Mupputs/puppet::walk</A></H2>
-
-<FONT SIZE="+1">NAME</FONT>
-<PRE><EM>   <B>puppet::walk</B>
-</EM></PRE><FONT SIZE="+1">PURPOSE</FONT>
-<PRE>   Let <A HREF="muppets.h.html#puppet">puppet</A> walk.
-</PRE>
-<HR>
-
-<H2><A NAME="puppet::talk">Mupputs/puppet::talk</A></H2>
-
-<FONT SIZE="+1">NAME</FONT>
-<PRE><EM>   <B>puppet::talk</B>
-</EM></PRE><FONT SIZE="+1">PURPOSE</FONT>
-<PRE>   Let <A HREF="muppets.h.html#puppet">puppet</A> talk.
-</PRE>
-<HR>
-
-<H2><A NAME="puppet::act">Mupputs/puppet::act</A></H2>
-
-<FONT SIZE="+1">NAME</FONT>
-<PRE><EM>   <B>puppet::act</B>
-</EM></PRE><FONT SIZE="+1">PURPOSE</FONT>
-<PRE>   Let <A HREF="muppets.h.html#puppet">puppet</A> walk and talk.
-</PRE>
-<HR>
-
-<H2><A NAME="stage::open_curtains">Mupputs/stage::open_curtains</A></H2>
-
-<FONT SIZE="+1">NAME</FONT>
-<PRE><EM>   <B>stage::open_curtains</B> -- 
-</EM></PRE><FONT SIZE="+1">PURPOSE</FONT>
-<PRE>   Open the curtains.
-</PRE><FONT SIZE="+1">SOURCE</FONT>
-<PRE>    void <B>stage::open_curtains</B>()
-    {
-      lights(ON);
-    }    
-</PRE>
-<HR>
-
-<H2><A NAME="stage::lights">Mupputs/stage::lights</A></H2>
-
-<FONT SIZE="+1">NAME</FONT>
-<PRE><EM>   <B>stage::lights</B> -- switch lights on or off.
-</EM></PRE><FONT SIZE="+1">PURPOSE</FONT>
-<PRE>   Switch lights on or off.
-</PRE>
-</BODY></HTML>
diff --git a/util/robodoc/Examples/CPP/muppets.h b/util/robodoc/Examples/CPP/muppets.h
deleted file mode 100644 (file)
index 873cbc9..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-
-/****c* Mupputs/puppet
- * NAME
- *   pupput --
- * PURPOSE
- *   Little monsters that can walk and talk on a stage.
- * METHODS
- *   puppet::walk -- make a puppet walk
- *   puppet::talk -- make a puppet talk
- *   puppet::act  -- make a puppet act
- *******
- */
-
-
-/****c* Mupputs/stage
- * NAME
- *   stage -- the floor on which the puppets act. 
- * METHODS
- *   stage::open_curtains
- *   stage::lights
- ******
- */
-
-
-
diff --git a/util/robodoc/Examples/CPP/muppets.h.html b/util/robodoc/Examples/CPP/muppets.h.html
deleted file mode 100644 (file)
index c91e78e..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
-<HTML><HEAD>
-<TITLE>muppets.h.html</TITLE>
-<!-- Source: muppets.h -->
-<!-- Generated with ROBODoc Version 3.2.2 (Jan 28 2001) -->
-<!-- ROBODoc (c) 1994-2000 by Frans Slothouber and Jacco van Weert. -->
-</HEAD><BODY BGCOLOR="#FFFFFF">
-<A NAME="muppets.h">Generated from muppets.h</A> with ROBODoc v3.2.2 on Mon Apr 02 20:03:03 2001
-<BR>
-<H3 ALIGN="center">TABLE OF CONTENTS</H3>
-<OL>
-<LI><A HREF="#puppet">Mupputs/puppet</A>
-<LI><A HREF="#stage">Mupputs/stage</A>
-</OL>
-<HR>
-
-<H2><A NAME="puppet">Mupputs/puppet</A></H2>
-
-<FONT SIZE="+1">NAME</FONT>
-<PRE><EM>   pupput --
-</EM></PRE><FONT SIZE="+1">PURPOSE</FONT>
-<PRE>   Little monsters that can walk and talk on a <A HREF="#stage">stage</A>.
-</PRE><FONT SIZE="+1">METHODS</FONT>
-<PRE>   <A HREF="muppets.cpp.html#puppet::walk">puppet::walk</A> -- make a <B>puppet</B> walk
-   <A HREF="muppets.cpp.html#puppet::talk">puppet::talk</A> -- make a <B>puppet</B> talk
-   <A HREF="muppets.cpp.html#puppet::act">puppet::act</A>  -- make a <B>puppet</B> act
-</PRE>
-<HR>
-
-<H2><A NAME="stage">Mupputs/stage</A></H2>
-
-<FONT SIZE="+1">NAME</FONT>
-<PRE><EM>   <B>stage</B> -- the floor on which the puppets act. 
-</EM></PRE><FONT SIZE="+1">METHODS</FONT>
-<PRE>   <A HREF="muppets.cpp.html#stage::open_curtains">stage::open_curtains</A>
-   <A HREF="muppets.cpp.html#stage::lights">stage::lights</A>
-</PRE>
-</BODY></HTML>
diff --git a/util/robodoc/Headers/assembler.sample b/util/robodoc/Headers/assembler.sample
deleted file mode 100644 (file)
index dbf066b..0000000
+++ /dev/null
@@ -1,63 +0,0 @@
-****h* main_module/module [1.0] *
-*
-* NAME
-*
-* COPYRIGHT
-*
-* FUNCTION
-*
-* AUTHOR
-*
-* CREATION DATE
-*
-* MODIFICATION HISTORY
-*
-* NOTES
-*
-*******
-
-
-****f* module/procname [1.0] *
-*
-* NAME
-*
-* SYNOPSIS
-*
-* FUNCTION
-*
-* INPUTS
-*
-* RESULT
-*
-* EXAMPLE
-*
-* NOTES
-*
-* BUGS
-*
-* SEE ALSO
-*
-**********
-
-
-****i* module/i_procname [1.0] *
-*
-* NAME
-*
-* SYNOPSIS
-*
-* FUNCTION
-*
-* INPUTS
-*
-* RESULT
-*
-* EXAMPLE
-*
-* NOTES
-*
-* BUGS
-*
-* SEE ALSO
-*
-**********
diff --git a/util/robodoc/Headers/basic.sample b/util/robodoc/Headers/basic.sample
deleted file mode 100644 (file)
index 22fca0c..0000000
+++ /dev/null
@@ -1,63 +0,0 @@
-REM  ****h* main_module/module [1.0] *
-REM
-REM  NAME
-REM
-REM  COPYRIGHT
-REM
-REM  FUNCTION
-REM
-REM  AUTHOR
-REM
-REM  CREATION DATE
-REM
-REM  MODIFICATION HISTORY
-REM
-REM  NOTES
-REM
-REM  *****
-
-
-REM  ***** module/procname [1.0] *
-REM
-REM  NAME
-REM
-REM  SYNOPSIS
-REM
-REM  FUNCTION
-REM
-REM  INPUTS
-REM
-REM  RESULT
-REM
-REM  EXAMPLE
-REM
-REM  NOTES
-REM
-REM  BUGS
-REM
-REM  SEE ALSO
-REM
-REM  ********
-
-
-REM  ****i* module/i_procname [1.0] *
-REM
-REM  NAME
-REM
-REM  SYNOPSIS
-REM
-REM  FUNCTION
-REM
-REM  INPUTS
-REM
-REM  RESULT
-REM
-REM  EXAMPLE
-REM
-REM  NOTES
-REM
-REM  BUGS
-REM
-REM  SEE ALSO
-REM
-REM  ********
diff --git a/util/robodoc/Headers/c.sample b/util/robodoc/Headers/c.sample
deleted file mode 100644 (file)
index beca449..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-/****h* projectname/module_name [1.0]
-*  NAME
-*  COPYRIGHT
-*  FUNCTION
-*  AUTHOR
-*  CREATION DATE
-*  MODIFICATION HISTORY
-*  NOTES
-*******
-*/
-
-
-/****f* module_name/funtion_name [1.0] *
-*  NAME
-*  SYNOPSIS
-*  FUNCTION
-*  INPUTS
-*  RESULT
-*  EXAMPLE
-*  NOTES
-*  BUGS
-*  SEE ALSO
-**********
-*/
-
-
-/****s* module_name/stucture_name [1.0] *
-*  NAME
-*  PURPOSE
-*  ATTRIBUTES
-*  NOTES
-*  BUGS
-*  SEE ALSO
-**********
-*/
-
-
-/****v* module_name/variable_name [1.0] *
-*  NAME
-*  PURPOSE
-*  NOTES
-*  BUGS
-*  SEE ALSO
-**********
-*/
-
diff --git a/util/robodoc/Headers/cpp.sample b/util/robodoc/Headers/cpp.sample
deleted file mode 100644 (file)
index 056d33f..0000000
+++ /dev/null
@@ -1,68 +0,0 @@
-/****h* projectname/module_name [1.0]
-*  NAME
-*  COPYRIGHT
-*  FUNCTION
-*  AUTHOR
-*  CREATION DATE
-*  MODIFICATION HISTORY
-*  NOTES
-*******
-*/
-
-
-/****f* module_name/funtion_name [1.0] *
-*  NAME
-*  SYNOPSIS
-*  FUNCTION
-*  INPUTS
-*  RESULT
-*  EXAMPLE
-*  NOTES
-*  BUGS
-*  SEE ALSO
-**********
-*/
-
-/****f* module_name/funtion_name [1.0] *
-*  NAME
-*  SYNOPSIS
-*  FUNCTION
-*  INPUTS
-*  RESULT
-*  EXAMPLE
-*  NOTES
-*  BUGS
-*  SEE ALSO
-*  SOURCE
-*/
-
-example()
-
-/**********/
-
-
-/****c* module_name/class_name [1.0] *
-*  NAME
-*  PURPOSE
-*  METHODS
-*  DERIVED FROM
-*  DERIVED BY
-*  EXAMPLE
-*  NOTES
-*  BUGS
-*  SEE ALSO
-**********
-*/
-
-
-/****m* module_name/method_name [1.0] *
-*  NAME
-*  SYNOPSIS
-*  PURPOSE
-*  EXAMPLE
-*  NOTES
-*  BUGS
-*  SEE ALSO
-**********
-*/
-
diff --git a/util/robodoc/Headers/fortan.sample b/util/robodoc/Headers/fortan.sample
deleted file mode 100644 (file)
index b646a73..0000000
+++ /dev/null
@@ -1,63 +0,0 @@
-C    ****h* main_module/module [1.0] *
-C
-C    NAME
-C
-C    COPYRIGHT
-C
-C    FUNCTION
-C
-C    AUTHOR
-C
-C    CREATION DATE
-C
-C    MODIFICATION HISTORY
-C
-C    NOTES
-C
-C    *****
-
-
-C    ***** module/procname [1.0] *
-C
-C    NAME
-C
-C    SYNOPSIS
-C
-C    FUNCTION
-C
-C    INPUTS
-C
-C    RESULT
-C
-C    EXAMPLE
-C
-C    NOTES
-C
-C    BUGS
-C
-C    SEE ALSO
-C
-C    ********
-
-
-C    ****i* module/i_procname [1.0] *
-C
-C    NAME
-C
-C    SYNOPSIS
-C
-C    FUNCTION
-C
-C    INPUTS
-C
-C    RESULT
-C
-C    EXAMPLE
-C
-C    NOTES
-C
-C    BUGS
-C
-C    SEE ALSO
-C
-C    ********
diff --git a/util/robodoc/Headers/html.sample b/util/robodoc/Headers/html.sample
deleted file mode 100644 (file)
index 7f3e557..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-<!---****h* projectname/module_name [1.0]
-*  NAME
-*  COPYRIGHT
-*  FUNCTION
-*  AUTHOR
-*  CREATION DATE
-*  MODIFICATION HISTORY
-*  NOTES
-******* --->
-
-
-<!---****f* module_name/funtion_name [1.0] *
-*  NAME
-*  SYNOPSIS
-*  FUNCTION
-*  INPUTS
-*  RESULT
-*  EXAMPLE
-*  NOTES
-*  BUGS
-*  SEE ALSO
-********** --->
-
-<!---****f* module_name/funtion_name [1.0] *
-*  NAME
-*  SYNOPSIS
-*  FUNCTION
-*  INPUTS
-*  RESULT
-*  EXAMPLE
-*  NOTES
-*  BUGS
-*  SOURCE
-* --->
-
-<H1> Example Source </H1>
-
-<!---********---->
diff --git a/util/robodoc/Headers/tcl.sample b/util/robodoc/Headers/tcl.sample
deleted file mode 100644 (file)
index be76e76..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-#****h* main_module/module [1.0] *
-#  NAME
-#  COPYRIGHT
-#  FUNCTION
-#  AUTHOR
-#  CREATION DATE
-#  MODIFICATION HISTORY
-#  NOTES
-#******
-#
-
-#****f* module/procname [1.0] *
-#  NAME
-#  SYNOPSIS
-#  FUNCTION
-#  INPUTS
-#  RESULT
-#  EXAMPLE
-#  NOTES
-#  BUGS
-#  SEE ALSO
-#********
-#
-
-#****f* module/procname [1.0] *
-#  NAME
-#  SYNOPSIS
-#  FUNCTION
-#  INPUTS
-#  RESULT
-#  EXAMPLE
-#  NOTES
-#  BUGS
-#  SEE ALSO
-#  SOURCE
-
-example()
-
-#********
diff --git a/util/robodoc/INSTALL b/util/robodoc/INSTALL
deleted file mode 100644 (file)
index 3a22cdd..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-$Id$
-
-
-There are two possibilities, if you have a system that supports
-auto configuration (most Unix systems), then use:
-
-  ./configure
-  make
-  make docall
-
-become root and do
-
-  make install
-
-
-If your system does not support auto-configuration, then
-have a look at  Source/makefile.plain  
-you can build robodoc with
-
-
-  make -f makefile.plain 
-
-
-Additional documentation is provided in Docs/, in the form of
-robodoc.html.  For a good example of how to use ROBODoc see the
-ROBODoc source code.  To see what kind of documentation can
-generated with ROBODoc, change to Source/ and do a
-
-  make xhtml
-  make example
-
-or
-
-  make -f makefile.plain example
-
-It assumes you have netscape installed.
-
-If you want to see the LaTeX documentation use
-   make xtex
-   make texview
-   gv ROBODoc_mi.ps
-
-
-Also have a look at the example makefile in the Docs/ directory.
-
-
-Have fun,
-Frans.
-
diff --git a/util/robodoc/NEWS b/util/robodoc/NEWS
deleted file mode 100644 (file)
index 0348612..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-V3.2.3  o Bug fix. The crosslink generator did not recognize links that
-          contained a '/' and ended with an '.' or ','.
-        o make install  installs additional documentation.
-
-V3.2.2  o Added a Master Index File for LaTeX output.  
-        o New NOSOURCE option to exclude source items from the documentation.
-        o New SINGLEDOC option to all documentation to be included into one
-          single document.
-        o New TITLE option to set the title for a master index file.
-          example make files includes commands to view the
-          generated documentation.
-        o Made the search for remark markers case insensitive.  So you
-          can use REM and Rem or even rEM.
-
-V3.2.1  Some small bugfixes, support for mailto:... links, and updates
-in the manual.
-
diff --git a/util/robodoc/README b/util/robodoc/README
deleted file mode 100644 (file)
index ed54c74..0000000
+++ /dev/null
@@ -1,63 +0,0 @@
-_______________________________________________________________________________
-
-
-       THIS IS MODIFIED VERSION OF ROBODOC FOR SILC DISTRIBUTION
-
-                   Pekka Riikonen <priikone@silcnet.org>
-
-_______________________________________________________________________________
-
-
-$Id$
-
-ROBODoc  Version 3.2.3 May 2001.
-
-ROBODoc is program documentation tool. The idea is to include for
-every function or procedure a standard header containing all
-sorts of information about the procedure or function.  ROBODoc
-extracts these headers from the source file and puts them in a
-separate autodocs-file.  ROBODoc thus allows you to include the
-program documentation in the source code and avoid having to
-maintain two separate documents.  Or as Petteri puts it: "robodoc
-is very useful - especially for programmers who don't like
-writing documents with Word or some other strange tool."
-
-ROBODoc can format the headers in a number of different formats:
-HTML, ASCII, AmigaGuide, LaTeX, or RTF. In HTML mode it can
-generate cross links between headers. You can even include parts
-of your source code.
-
-ROBODoc works with many programming languages: For instance C,
-Pascal, Shell Scripts, Assembler, COBOL, Occam, Postscript,
-Forth, Tcl/Tk, C++, Java -- basically any program in which you
-can use remarks/comments.
-
-  o For information on how to build and install see INSTALL
-  o For information on how to use ROBODoc see Docs/robodoc.html. 
-  o Blank headers for various languages can be found in Headers/
-  o For an example on how ROBODoc can be used
-    (1) The ROBODoc source code in Source/
-    (2) The C++ example in Examples/CPP/
-  o For licence information see COPYING
-  o For a change log see  Source/robodoc.c
-Many people contributed to ROBODoc, to name a few:
-
-o Petteri Kettunen <petterik@iki.fi>   
-  Bug fixes, FOLD, C features.
-o Bernd Koesling <KOESSI@CHESSY.aworld.de> 
-  Bug fixes, functional improvements, code cleanup.
-o Anthon Pang  <apang@mindlink.net>
-  RTF support, Bug fixes.
-o Thomas Aglassinger <agi@sbox.tu-graz.ac.at>
-  Fixes and cleanup of HTML-output
-o Stefan Kost kost@imn.htwk-leipzig.de
-  Idea of the master index file and different header types.
-
-
-Questions, found a bug or a typo; send an email to <fslothouber@acm.org>
-
-(c) 1994-2000  Frans Slothouber and Jacco van Weert 
-
-
-
diff --git a/util/robodoc/Source/analyser.c b/util/robodoc/Source/analyser.c
deleted file mode 100644 (file)
index 0a6c087..0000000
+++ /dev/null
@@ -1,677 +0,0 @@
-#include <stdlib.h>
-#include <stdio.h>
-#include <ctype.h>
-#include <string.h>
-
-#include "robodoc.h"
-#include "headers.h"
-#include "items.h"
-#include "util.h"
-#include "folds.h"
-#include "links.h"
-#include "analyser.h"
-
-
-/****** ROBODoc/RB_Analyse_Document [3.0i]
- * NAME
- *   RB_Analyse_Document -- scan document for headers and store them
- * SYNOPSIS
- *   RB_Analyse_Document (document)
- *   RB_Analyse_Document (FILE *)
- * FUNCTION
- *   Searches the document for headers. Stores information about
- *   any headers that are found in a linked list. Information
- *   that is stored includes, the name of the header, its version
- *   number, and its contents.
- * INPUTS
- *   document - a pointer to a file with the document to be
- *              analysed
- *   the gobal buffer line_buffer.
- * RESULT
- *   1)   A linked list pointed to by the global variable
- *        first_header that contains information about each
- *        header.
- * NOTES
- *   Using fseek and ftell because gcc doesn't know fgetpos and fsetpos,
- *   on the sun unix system that I use.
- * SEE ALSO
- *   RB_Find_Marker
- * SOURCE
- */
-
-void
-RB_Analyse_Document (FILE * document)
-{
-  int header_type;
-  int real_size;
-  char *name;
-
-  for (;
-       (header_type = RB_Find_Marker (document)) != NO_HEADER;
-       )
-    {
-      struct RB_header *new_header;
-      
-      if (!
-         (
-          ((header_type == INTERNAL_HEADER) &&
-           !(course_of_action & (DO_INCLUDE_INTERNAL | DO_INTERNAL_ONLY)))
-          ||
-          ((header_type != INTERNAL_HEADER) &&
-           (course_of_action & DO_INTERNAL_ONLY))
-          ||
-          (header_type == BLANK_HEADER)
-          )
-         )
-       {
-         long cur_file_pos;
-         
-         new_header = RB_Alloc_Header ();
-         RB_Insert_In_List (&first_header, new_header);
-         new_header->type = header_type;
-         if ((new_header->name = RB_Find_Header_Name ()) != NULL)
-           {
-             RB_Say ("found header [line %5d]: \"%s\"\n",
-                     line_number, new_header->name);
-#if 0
-             if ((new_header->function_name
-                  = RB_Function_Name (new_header->name)) == NULL)
-#endif
-             if ((new_header->function_name
-                  = RB_Function_Name (line_buffer)) == NULL)
-               {
-                 RB_Panic ("Can't determine the \"function\" name.\n");
-               }
-             cur_file_pos = (long) ftell (document);
-             if ((real_size = RB_Find_End_Marker (document,
-                                                  &new_header->size))
-                 != 0)
-               {
-                 char *contents;
-                 
-                 fseek (document, cur_file_pos, 0);
-                 if ((contents = malloc ((new_header->size +
-                                          2) * sizeof (char)))
-                     != NULL)
-                   {
-                     fread (contents, new_header->size, sizeof (char), document);
-                     
-                     contents[real_size] = '\0';
-                     new_header->contents = contents;
-                     new_header->size = real_size;
-                   }
-                 else
-                   RB_Panic ("out of memory! [Alloc Header Contents]\n");
-               }
-             else
-               {
-                 RB_Panic ("found header with no end marker \"%s\"\n",
-                           new_header->name);
-               }
-           }
-         else
-           {
-             RB_Panic ("found header marker but no name [line %d]\n",
-                       line_number);
-           }
-       }
-      else
-       {
-         if (header_type != BLANK_HEADER)
-           {
-             if ((name = RB_Find_Header_Name ()) != NULL)
-               {
-                 new_header = RB_Alloc_Header ();
-                 if ((real_size =
-                      RB_Find_End_Marker (document, &new_header->size))
-                     == 0)
-                   {
-                     RB_Free_Header (new_header);
-                     RB_Panic ("found header with no end marker \"%s\"\n", name);
-                   }
-                 else
-                   {
-                     RB_Free_Header (new_header);
-                   }
-               }
-             else
-               {
-                 RB_Panic ("found header marker but no name [line %d]\n",
-                           line_number);
-               }
-           }
-       }
-    }
-}
-
-/****** END RB_Analyse_Document *******/
-
-
-
-
-/****f* ROBODoc/RB_Function_Name [2.0x]
- * NAME
- *   RB_Function_Name -- get pointer to the function name.
- * SYNOPSIS
- *   char *RB_NamePart(char *header_name)
- * FUNCTION
- *   A header name is consists of two parts. The module name and
- *   the function name. This returns a pointer to the function name.
- *   The name "function name" is a bit obsolete. It is really the name
- *   of any of objects that can be documented; classes, methods,
- *   variables, functions, projects, etc.
- * SOURCE
- */
-
-char *
-RB_Function_Name (char *header_name)
-{
-  char *cur_char;
-  char c;
-  char *name;
-
-  name = NULL;
-  if ((cur_char = header_name) != NULL)
-    {
-      for (; (c = *cur_char) != '\0'; ++cur_char)
-       {
-         if ('/' == *cur_char)
-           {
-             ++cur_char;
-             if (*cur_char)
-               name = cur_char;
-           }
-       }
-    }
-  if (name) {
-     char *temp;
-     temp = malloc((strlen(name) + 1) * sizeof(char));
-     strcpy(temp, name);
-     return temp; 
-  } else {
-     return (name);
-  }
-}
-
-/*** RB_Name_Part ***/
-
-
-
-/****** ROBODoc/RB_Find_Marker [3.0h]
- * NAME
- *   RB_Find_Marker -- Search for header marker in document.
- * SYNOPSIS
- *   header_type = RB_Find_Marker (document)
- *             int RB_Find_Marker (FILE *)
- * FUNCTION
- *   Read document file line by line, and search each line for the
- *   any of the headers defined in the array  header_markers
- * INPUTS
- *   document - pointer to the file to be searched.
- *   the gobal buffer line_buffer.
- * RESULT
- *   header type
- *   can be:
- *    (1) NO_HEADER - no header found, end of file reached
- *    (2) MAIN_HEADER
- *    (3) GENERIC_HEADER
- *    (4) INTERNAL_HEADER
- * BUGS
- *   Bad use of feof(), fgets().
- * SEE ALSO
- *   RB_Find_End_Marker
- * SOURCE
- */
-
-int
-RB_Find_Marker (FILE * document)
-{
-  int found;
-  int marker, marker_type;
-  char *cur_char, *cur_mchar;
-
-  marker_type = NO_HEADER;
-  cur_char = NULL;
-  found = FALSE;
-  while (!feof (document) && !found)
-    {
-      *line_buffer = '\0';
-      fgets (line_buffer, MAX_LINE_LEN, document);
-      if (!feof (document))
-       {
-         line_number++;
-         for (marker = 0;
-              ((cur_mchar = header_markers[marker]) != NULL) && !found;
-              marker++)
-           {
-             for (found = TRUE, cur_char = line_buffer;
-                  *cur_mchar && *cur_char && found;
-                  cur_mchar++, cur_char++)
-               {
-                 if (tolower(*cur_mchar) != tolower(*cur_char))
-                   found = FALSE;
-               }
-           }
-         if (found)
-           {
-             switch (*cur_char)
-               {
-               case 'h':
-                 marker_type = MAIN_HEADER;
-                 break;
-               case '*':
-                 marker_type = GENERIC_HEADER;
-                 break;
-               case 'i':
-                 marker_type = INTERNAL_HEADER;
-                 break;
-               case 'f':
-                 marker_type = FUNCTION_HEADER;
-                 break;
-               case 's':
-                 marker_type = STRUCT_HEADER;
-                 break;
-               case 'c':
-                 marker_type = CLASS_HEADER;
-                 break;
-               case 'm':
-                 marker_type = METHOD_HEADER;
-                 break;
-               case 'd':
-                 marker_type = CONSTANT_HEADER;
-                 break;
-               case 'v':
-                 marker_type = VARIABLE_HEADER;
-                 break;
-               default:
-                 RB_Say ("%s: WARNING, [line %d] undefined headertype,"
-                         " using GENERIC\n", whoami, line_number);
-                 marker_type = GENERIC_HEADER;
-               }
-           }
-       }
-    }
-  if (!found || feof (document))
-    {
-      marker_type = NO_HEADER;
-    }
-  else if (marker_type == GENERIC_HEADER)
-    {
-      skip_while (*cur_char == '*');
-      if (*cur_char == '/')
-       {
-         marker_type = BLANK_HEADER;
-       }
-    }
-  return marker_type;
-}
-
-/******** END RB_Find_Marker ******/
-
-
-/****** ROBODoc/RB_Find_End_Marker [3.0h]
- * NAME
- *   RB_Find_End_Marker -- Search for end marker in document.
- * SYNOPSIS
- *   result = RB_Find_End_Marker (document)
- *        int RB_Find_End_Marker (FILE *)
- * FUNCTION
- *   Searches line by line till any of the markers in the
- *   array: end_markers is found.
- * INPUTS
- *   document   - pointer to the file to be searched.
- *   int *total_size - external size
- *   the gobal buffer line_buffer.
- * RESULT
- *                real_size if end marker was found
- *   0          - no end marker was found
- * SEE ALSO
- *   RB_Find_Marker
- * SOURCE
- */
-
-int
-RB_Find_End_Marker (FILE * document, int *total_size)
-{
-  int real_size = 0;
-  int found = FALSE;
-  int marker;
-  int line_len = 0;
-  char *cur_char, *cur_mchar;
-
-  while (!feof (document) && !found)
-    {
-      cur_char = line_buffer;
-      *cur_char = '\0';
-      fgets (cur_char, MAX_LINE_LEN, document);
-      ++line_number;           /* global linecounter *koessi */
-
-      line_len = strlen (cur_char);
-      real_size += line_len;
-
-      if (!feof (document))
-       {
-         for (marker = 0;
-              ((cur_mchar = end_markers[marker]) != NULL) && !found;
-              marker++)
-           {
-             for (found = TRUE, cur_char = line_buffer;
-                  *cur_mchar && *cur_char && found;
-                  cur_mchar++, cur_char++)
-               {
-                 if (tolower(*cur_mchar) != tolower(*cur_char))
-                   found = FALSE;
-               }
-           }
-       }
-    }
-  if (total_size)
-    *total_size = real_size;
-  if (found)
-    return real_size - line_len;
-  else
-    return 0;
-}
-
-/*****  RB_Find_End_Marker   *****/
-
-
-/****** ROBODoc/RB_Find_Header_Name   [3.0b]
- * NAME
- *   RB_Find_Header_Name -- search for header name
- * SYNOPSIS
- *   result = RB_Find_Header_Name ()
- *      char *RB_Find_Header_Name ()
- * FUNCTION
- *   Searches the line buffer for the header name.
- *   It assumes that the header name follows after the
- *   header marker, seperated by one or more spaces, and terminated
- *   by one or more spaces or a '\n'.
- *   It allocates an array of chars and copies the name to this array.
- * INPUTS
- *   the gobal buffer line_buffer.
- * RESULT
- *   pointer to the allocated array of chars that contains the name,
- *   terminated with a '\0'.
- *   NULL if no header name was found.
- * MODIFICATION HISTORY
- *   8. August 1995      --  optimized by koessi
- * SEE ALSO
- *   RB_Find_Function_Name(), RB_WordLen(), RB_StrDup()
- * SOURCE
- */
-
-char *
-RB_Find_Header_Name (void)
-{
-  char *cur_char;
-
-  cur_char = line_buffer;
-  skip_while (*cur_char != '*');
-  skip_while (!isspace (*cur_char));
-  skip_while (isspace (*cur_char));
-  if (*cur_char)
-    {
-      char *n;
-      int len;
-
-      if (strchr(cur_char, '\n'))
-       *strchr(cur_char, '\n') = '\0';
-
-      len = RB_WordLen(cur_char);
-
-      n = calloc(len + 1, sizeof(*cur_char));
-      strncpy(n, cur_char, len);
-      return n;
-    }
-  return (NULL);
-}
-
-/*****  RB_Find_Header_Name  *****/
-
-
-/****** ROBODoc/RB_Find_Item [3.0b]
- * NAME
- *   RB_Find_Item -- find item in header contents.
- * SYNOPSIS
- *   item_type = RB_Find_Item (next_line,item_line)
- *
- *           int RB_Find_Item (char **,  char **)
- * FUNCTION
- *   Searches the header contents line by line, looking
- *   for an item Indicator.
- * INPUTS
- *   next_line  - pointer to a pointer that points to line
- *                at which the search will start.
- * SIDE-EFFECTS
- *   next_line  - pointer to a pointer that points to begin of the line
- *                after the line the item was found on.
- *   item_line  - pointer to a pointer that points to the line the item
- *                was found on.
- * RESULT
- *   item_type  - one of possible items indicators.
- * SOURCE
- */
-
-int
-RB_Find_Item (char **next_line, char **item_line)
-{
-  char *cur_char = *next_line;
-  int item_type;
-
-  for (item_type = NO_ITEM;
-       *cur_char && (item_type == NO_ITEM);
-    )
-    {
-      *item_line = cur_char;
-      cur_char = RB_Skip_Remark_Marker (cur_char);
-
-      skip_while (isspace (*cur_char) && *cur_char != '\n');
-      if (isupper (*cur_char))
-       {
-         char *item_begin = cur_char;
-         char *item_end;
-
-         skip_while (isupper (*cur_char));
-         item_end = cur_char;
-         if (isspace (*cur_char) && *cur_char)
-           {
-             skip_while (isspace (*cur_char) && *cur_char != '\n');
-
-             /* Item consists of two words ? */
-             if (isupper (*cur_char) && *cur_char)
-               {
-                 skip_while (isupper (*cur_char));
-                 item_end = cur_char;
-                 skip_while (isspace (*cur_char) && *cur_char != '\n');
-               }
-             if (*cur_char == '\n')
-               {
-                 char old_char = *item_end;
-
-                 *item_end = '\0';
-                 item_type = RB_Get_Item_Type (item_begin);
-                 *item_end = old_char;
-                 cur_char++;
-               }
-           }
-       }
-      if (item_type == NO_ITEM)
-       {
-         find_eol;
-         if (*cur_char)
-           cur_char++;
-       }
-    }
-
-  /* advance item_line to end of comment block when we have no more items */
-  if (item_type == NO_ITEM)
-    {
-      *item_line = cur_char;
-    }
-  *next_line = cur_char;
-  return item_type;
-}
-
-/*****  RB_Find_Item    *****/
-
-
-/****** ROBODoc/RRB_Number_Duplicate_Headers 
- * NAME
- *    RB_Number_Duplicate_Headers -- number duplicate headers
- * SYNOPSIS
- *    RB_Number_Duplicate_Headers (void)
- * FUNCTION
- *    Extends the function name with an additional number if there 
- *    are several components with the same name.
- *    Otherwise there will be labels with the same name in HTML
- *    which confuses the browser.
- * SOURCE
- */
-
-void 
-RB_Number_Duplicate_Headers (void)
-{
-  struct RB_header *cur_header;
-  struct RB_header *dup_header;
-  for (cur_header = first_header; 
-       cur_header;
-       cur_header = cur_header->next_header)
-  {  
-    char number[20];
-    int  nr = 0;
-    for (dup_header = cur_header->next_header; 
-         dup_header;
-         dup_header = dup_header->next_header)
-    {
-       if (strcmp(cur_header->function_name,
-                  dup_header->function_name) == 0) {
-          char *new_name;
-          nr++;
-          sprintf(number, "(%d)", nr);
-          new_name = malloc ((strlen(number) + 1 + 
-              strlen(dup_header->function_name) + 1 ) * sizeof(char));
-          if (new_name == NULL) 
-             RB_Panic ("out of memory! [Number Duplicates]\n");
-          sprintf(new_name, "%s%s", dup_header->function_name,
-                  number);
-          free(dup_header->function_name);
-          dup_header->function_name = new_name;
-       }
-    }
-  }
-}
-
-/******/
-
-
-/****** ROBODoc/RB_Make_Index_Tables [3.0b]
- * NAME
- *    RB_Make_Index_Tables
- * SYNOPSIS
- *    void RB_Make_Index_Tables (void)
- * FUNCTION
- *    Creates sorted index tables of headers and links to speed up
- *    matching links later on.
- * INPUTS
- *    none
- * SIDE EFFECTS
- *    Modifies header_index & link_index
- * RESULT
- *    none
- * SOURCE
- */
-
-void
-RB_Make_Index_Tables ()
-{
-  int nr_of_headers, header;
-  int nr_of_links, link;
-  struct RB_link *cur_link;
-  struct RB_header *cur_header;
-
-  for (cur_header = first_header, nr_of_headers = 0;
-       cur_header;
-       cur_header = cur_header->next_header)
-    nr_of_headers++;
-
-  for (cur_link = first_link, nr_of_links = 0;
-       cur_link;
-       cur_link = cur_link->next_link)
-    nr_of_links++;
-
-  if (nr_of_headers)
-    {
-      int sort1, sort2;
-
-      RB_Say ("Allocating Header Index Table\n");
-      header_index = malloc (nr_of_headers * sizeof (struct RB_header **));
-
-      header_index_size = nr_of_headers;
-      if (!header_index)
-       RB_Panic ("out of memory! [Make Index Tables]\n");
-
-      /* Fill Index Table */
-      for (cur_header = first_header, header = 0;
-          cur_header;
-          cur_header = cur_header->next_header, header++)
-       header_index[header] = cur_header;
-
-      /* Sort Index Table */
-      RB_Say ("Sorting Header Index Table\n");
-      for (sort1 = 0; sort1 < nr_of_headers; sort1++)
-       {
-         struct RB_header *temp;
-
-         for (sort2 = sort1; sort2 < nr_of_headers; sort2++)
-           {
-             if (strcmp (header_index[sort1]->function_name,
-                         header_index[sort2]->function_name) > 0)
-               {
-                 temp = header_index[sort1];
-                 header_index[sort1] = header_index[sort2];
-                 header_index[sort2] = temp;
-               }
-           }
-       }
-    }
-  if (nr_of_links)
-    {
-      int sort1, sort2;
-
-      RB_Say ("Allocating Link Index Table\n");
-      link_index = malloc (nr_of_links * sizeof (struct RB_link **));
-
-      link_index_size = nr_of_links;
-      if (!link_index)
-       RB_Panic ("out of memory! [Make Index Tables]\n");
-
-      /* Fill Index Table */
-      for (cur_link = first_link, link = 0;
-          cur_link;
-          cur_link = cur_link->next_link, link++)
-       {
-         link_index[link] = cur_link;
-       }
-
-      /* Sort Index Table */
-      RB_Say ("Sorting Link Index Table\n");
-      for (sort1 = 0; sort1 < nr_of_links; sort1++)
-       {
-         struct RB_link *temp;
-
-         for (sort2 = sort1; sort2 < nr_of_links; sort2++)
-           {
-             if (strcmp (link_index[sort1]->label_name,
-                         link_index[sort2]->label_name) > 0)
-               {
-                 temp = link_index[sort1];
-                 link_index[sort1] = link_index[sort2];
-                 link_index[sort2] = temp;
-               }
-           }
-       }
-    }
-}
-
-/****** RB_Make_Index_Tables  *****/
diff --git a/util/robodoc/Source/analyser.h b/util/robodoc/Source/analyser.h
deleted file mode 100644 (file)
index ce1be2a..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-#ifndef ROBODOC_ANALYSER_H
-#define ROBODOC_ANALYSER_H
-
-void RB_Analyse_Document (FILE *);
-int RB_Find_Marker (FILE *);
-char *RB_Find_Header_Name (void);
-int RB_Find_End_Marker (FILE *, int *);
-int RB_Find_Item (char **, char **);
-void RB_Number_Duplicate_Headers(void);
-void RB_Make_Index_Tables (void);
-char *RB_Function_Name (char *header_name);
-
-#endif /* ROBODOC_ANALYSER_H */
diff --git a/util/robodoc/Source/config.h.in b/util/robodoc/Source/config.h.in
deleted file mode 100644 (file)
index 4465948..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-/* Source/config.h.in.  Generated automatically from configure.in by autoheader.  */
-
-/* Define to empty if the keyword does not work.  */
-#undef const
-
-/* Define if you don't have vprintf but do have _doprnt.  */
-#undef HAVE_DOPRNT
-
-/* Define if you have the strftime function.  */
-#undef HAVE_STRFTIME
-
-/* Define if you have the vprintf function.  */
-#undef HAVE_VPRINTF
-
-/* Define to `unsigned' if <sys/types.h> doesn't define.  */
-#undef size_t
-
-/* Define if you have the ANSI C header files.  */
-#undef STDC_HEADERS
-
-/* Define if you have the strstr function.  */
-#undef HAVE_STRSTR
-
-/* Name of package */
-#undef PACKAGE
-
-/* Version number of package */
-#undef VERSION
-
diff --git a/util/robodoc/Source/folds.c b/util/robodoc/Source/folds.c
deleted file mode 100644 (file)
index 4138b70..0000000
+++ /dev/null
@@ -1,141 +0,0 @@
-#include <stddef.h>
-#include <string.h>
-#include "robodoc.h"
-#include "folds.h"
-
-
-/****v* ROBODoc/fold_start_markers 
- * NAME
- *   fold_start_markers
- * FUNCTION
- *   Strings for fold start.
- * SOURCE
- */
-fold_mark_t     fold_start_markers[] =
-{
-  {"/*{{{", "*/"},     /* C, C++ */
-  {"--{{{", "\n"},     /* Occam, line ends with newline */
-  {"#{{{", "\n"},      /* Various scripts, line ends with newline */
-  {NULL, NULL}
-};
-
-/****/
-
-
-/****v* ROBODoc/fold_end_markers 
- * NAME
- *   fold_start_end
- * FUNCTION
- *   Strings for fold end.
- * SOURCE
- */
-fold_mark_t fold_end_markers[] =
-{
-  {"/*}}}", "*/"},
-  {"--}}}", "\n"},
-  {"#}}}", "\n"},
-  {NULL, NULL}
-};
-
-/****/
-
-int extra_flags = 0;
-
-/****v* ROBODoc/fold 
-* NAME
-*   fold
-* FUNCTION
-*   Fold counter - true global. 
-* SOURCE
-*/
-
-int fold = 0;
-
-/****/
-
-
-
-/****f* ROBODoc/RB_Check_Fold_End [3.0h]
-* NAME
-*  RB_Check_Fold_End
-* AUTHOR
-*  PetteriK
-* FUNCTION
-*  See if a fold end is found.
-* RETURN VALUE
-*   1 if end mark is found
-* SOURCE
-*/
-
-char
-RB_Check_Fold_End (char *cur_char)
-{
-  fold_mark_t *t = fold_end_markers;
-  char found = 0;
-
-  while (found == 0 && t->start != NULL)
-    {
-      if (strncmp (t->start, cur_char, strlen (t->start)) == 0)
-       {
-         found = 1;
-         break;
-       }
-      t++;                     /* try the next fold mark string */
-    }
-  return found;
-}
-
-/*******/
-
-/****f* ROBODoc/RB_Check_Fold_Start 
- * NAME
- *   RB_Check_Fold_Start
- * AUTHOR
- *   PetteriK
- * FUNCTION
- *   Check if a fold start is found.
- * RETURN VALUE
- *   Pointer to the item body, fold mark and name skipped.
- * SIDE EFFECTS
- *   *found = 1 if fold mark is found. Fold name is copied to *foldname.
- *******
- */
-
-char *
-RB_Check_Fold_Start (char *cur_char, char *foldname, char *found)
-{
-  int n = 0;
-  fold_mark_t *t = fold_start_markers;
-
-  *found = 0;
-  while (*found == 0 && t->start != NULL)
-    {
-      if (strncmp (t->start, cur_char, strlen (t->start)) == 0)
-       {
-         *found = 1;
-         break;
-       }
-      t++;                     /* try the next fold mark string */
-    }
-  if (*found == 0)
-    {
-      return cur_char;         /* not found, get out of here */
-    }
-  cur_char += strlen (t->start);       /* skip fold mark */
-  /* get the fold name */
-  while (strncmp (t->end, cur_char, strlen (t->end)) != 0)
-    {
-      foldname[n++] = *cur_char++;
-    }
-  /* if fold mark does not end with newline, skip chars... */
-  if (t->end[0] != '\n')
-    {
-      cur_char += strlen (t->end);
-    }
-  foldname[n] = '\0';
-  while (*cur_char != '\n')
-    {
-      cur_char++;              /* not so sure about this */
-    }
-  return cur_char;
-}
diff --git a/util/robodoc/Source/folds.h b/util/robodoc/Source/folds.h
deleted file mode 100644 (file)
index 93d8df3..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-#ifndef ROBODOC_FOLDS_H
-#define ROBODOC_FOLDS_H
-
-
-
-/****s* ROBODoc/fold_mark_t
- * NAME
- *   fold_mark_t
- * FUNCTION
- *   Handy structure for fold start/end markers.
- * SOURCE
- */
-
-typedef struct _fold_mark_t
-  {
-    char *start;
-    char *end;
-  }
-fold_mark_t;
-
-/*******/
-
-/****d* ROBODoc/extra_flags 
-* NAME
-*   extra_flags
-* AUTHOR
-*   PetteriK
-* FUNCTION
-*   Bitflags for extra controls. 
-* SOURCE
-*/
-
-#define FOLD     (1<<0)
-#define C_MODE   (1<<1)
-
-
-/****/
-
-extern fold_mark_t fold_start_markers[];
-extern fold_mark_t fold_end_markers[];
-extern int extra_flags;
-extern int fold;
-
-char RB_Check_Fold_End (char *cur_char);
-char *RB_Check_Fold_Start (char *cur_char, char *foldname, char *found);
-
-#endif /* ROBODOC_FOLDS_H */
diff --git a/util/robodoc/Source/generator.c b/util/robodoc/Source/generator.c
deleted file mode 100644 (file)
index 632c299..0000000
+++ /dev/null
@@ -1,1729 +0,0 @@
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <ctype.h>
-#include "robodoc.h"
-#include "headers.h"
-#include "items.h"
-#include "folds.h"
-#include "util.h"
-#include "links.h"
-#include "generator.h"
-#include "analyser.h"
-#include <errno.h>
-
-/****f* ROBODoc/RB_Generate_Documentation [3.0h]
- * NAME
- *   RB_Generate_Documentation
- * SYNOPSIS
- *   RB_Generate_Documentation (dest_doc, name, name)
- *
- *   RB_Generate_Documentation (FILE *, char *, char *)
- * FUNCTION
- *   Generates the autodoc documentation from the list of
- *   function headers that has been created by
- *   RB_Analyse_Document.
- * INPUTS
- *   dest_doc   - Pointer to the file to which the output will be written.
- *   src_name   - The name of the source file.
- *   dest_name  - The name of this file.
- * BUGS
- *   There might be plenty.
- * SEE ALSO
- *   RB_Generate_Doc_Start,
- *   RB_Generate_Doc_End,
- *   RB_Generate_Header_Start,
- *   RB_Generate_Header_End,
- *   RB_Generate_Header_Name,
- *   RB_Generate_Item_Name,
- *   RB_Generate_Item_Doc,
- *   RB_Generate_Item_Body .
- * SOURCE
- */
-
-void
-RB_Generate_Documentation (
-                           FILE * dest_doc, char *src_name, char *dest_name)
-{
-  struct RB_header *cur_header;
-  char fname[256];
-  FILE *orig_doc = dest_doc;
-
-  RB_Make_Index_Tables ();
-
-  RB_Generate_Doc_Start (dest_doc, src_name, dest_name, 1);
-
-  for (cur_header = first_header;
-       cur_header;
-       cur_header = cur_header->next_header)
-    {
-      int item_type;
-      char *next_line, *item_line = NULL;
-
-      RB_Say ("generating documentation for \"%s\"\n", cur_header->name);
-
-#if 1
-     /* If MAIN_HEADER, do not create file */
-     if (cur_header->type == MAIN_HEADER)
-       continue;
-#endif
-
-      if (output_mode == HTML)
-        {
-          sprintf(fname, "%s-%s.html", doc_base, cur_header->function_name);
-          dest_doc = fopen(fname, "w");
-          if (!dest_doc)
-            {
-             fprintf(stderr, "%s\n", strerror(errno));
-             exit(1);
-           }
-        }
-
-      RB_Generate_Header_Start (dest_doc, cur_header, src_name);
-
-      next_line = cur_header->contents;
-      item_type = RB_Find_Item (&next_line, &item_line);
-
-      if (item_type != NO_ITEM)
-       {
-         int old_item_type;
-         char *old_next_line;
-
-         do
-           {
-             if (course_of_action & DO_TELL)
-               printf ("[%s] ", item_names[item_type]);
-
-             if (!((item_type == SOURCE_ITEM) &&  
-                 (course_of_action & DO_NOSOURCE)))
-               RB_Generate_Item_Name (dest_doc, item_type);
-             
-             old_next_line = next_line;
-             old_item_type = item_type;
-             
-             item_type = RB_Find_Item (&next_line, &item_line);
-
-             if (!((old_item_type == SOURCE_ITEM) &&  
-                 (course_of_action & DO_NOSOURCE)))
-               RB_Generate_Item_Doc (dest_doc, dest_name,
-                                     old_next_line, item_line,
-                                     cur_header->function_name, 
-                                     old_item_type);
-           }
-         while (item_type != NO_ITEM);
-         if (course_of_action & DO_TELL)
-           putchar ('\n');
-       }
-      else
-       printf ("%s: WARNING, header \"%s\" has no items\n",
-               whoami, cur_header->name);
-
-      RB_Generate_Header_End (dest_doc, cur_header);
-
-      if (output_mode == HTML)
-        fclose(dest_doc);
-    }
-
-  dest_doc = orig_doc;
-  RB_Generate_Doc_End (dest_doc, dest_name);
-}
-
-/***** RB_Generate_Documentation ***/
-
-
-
-
-
-/****f* ROBODoc/RB_Generate_Doc_Start [3.0j]
- * NAME
- *   RB_Generate_Doc_Start -- Generate document header.
- * SYNOPSIS
- *   RB_Generate_Doc_Start (dest_doc, src_name, name, toc)
- *
- *   RB_Generate_Doc_Start (FILE *, char *, char *, char)
- * FUNCTION
- *   Generates for depending on the output_mode the text that
- *   will be at the start of a document.
- *   Including the table of contents.
- * INPUTS
- *   dest_doc - pointer to the file to which the output will
- *              be written.
- *   src_name - the name of the source file.
- *   name     - the name of this file.
- *   output_mode - global variable that indicates the output
- *                 mode.
- *   toc      - generate table of contens
- * SEE ALSO
- *   RB_Generate_Doc_End
- * SOURCE
- */
-
-void
-RB_Generate_Doc_Start (
-                     FILE * dest_doc, char *src_name, char *name, char toc)
-{
-  struct RB_header *cur_header;
-  int cur_len, max_len, header_nr;
-
-  switch (output_mode)
-    {
-    case AMIGAGUIDE:
-      if (strstr (name + 1, ".guide") == NULL)
-       fprintf (dest_doc, "@database %s.guide\n", name);
-      else
-       fprintf (dest_doc, "@database %s\n", name);
-      fprintf (dest_doc, "@rem Source: %s\n", src_name);
-/*      fprintf (dest_doc, "@rem " COMMENT_ROBODOC); */
-      fprintf (dest_doc, "@rem " COMMENT_COPYRIGHT);
-      fprintf (dest_doc, "@node Main %s\n", name);
-      fprintf (dest_doc, "@{jcenter}\n");
-      fprintf (dest_doc,
-              "@{fg highlight}@{b}TABLE OF CONTENTS@{ub}@{fg text}\n\n");
-
-      max_len = 0;
-      for (cur_header = first_header;
-          cur_header;
-          cur_header = cur_header->next_header)
-       {
-         if (cur_header->name)
-           {
-             cur_len = strlen (cur_header->name);
-             if (cur_len > max_len)
-               max_len = cur_len;
-           }
-       }
-
-      for (cur_header = first_header;
-          cur_header;
-          cur_header = cur_header->next_header)
-       {
-         if (cur_header->name && cur_header->function_name)
-           {
-             fprintf (dest_doc, "@{\"%s", cur_header->name);
-
-             for (cur_len = strlen (cur_header->name);
-                  cur_len < max_len;
-                  ++cur_len)
-               fputc (' ', dest_doc);
-             fprintf (dest_doc, "\" Link \"%s\"}\n", cur_header->function_name);
-           }
-       }
-
-      fprintf (dest_doc, "@{jleft}\n");
-      fprintf (dest_doc, "@endnode\n");
-      break;
-
-    case HTML:
-      /* Append document type and title */
-      fprintf (dest_doc,
-              "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 3.2//EN\">\n");
-      fprintf (dest_doc, "<HTML><HEAD>\n<TITLE>%s</TITLE>\n", name);
-
-      /* append SGML-comment with document- and copyright-info. This code
-       * ensures that every line has an own comment to avoid problems with 
-       * buggy browsers */
-      fprintf (dest_doc, "<!-- Source: %s -->\n", src_name);
-      {
-       static const char copyright_text[]
-       = COMMENT_ROBODOC COMMENT_COPYRIGHT;
-       size_t i = 0;
-       char previous_char = '\n';
-       char current_char = copyright_text[i];
-
-       while (current_char)
-         {
-           if (previous_char == '\n')
-             {
-               fprintf (dest_doc, "<!-- ");
-             }
-           if (current_char == '\n')
-             {
-               fprintf (dest_doc, " -->");
-             }
-           else if ((current_char == '-') && (previous_char == '-'))
-             {
-               /* avoid "--" inside SGML-comment, and use "-_" instead; this
-                * looks a bit strange, but one should still be able to figure 
-                * out what is meant when reading the output */
-               current_char = '_';
-             }
-           fputc (current_char, dest_doc);
-           i += 1;
-           previous_char = current_char;
-           current_char = copyright_text[i];
-         }
-      }
-
-      /* append heading and start list of links to functions */
-      fprintf (dest_doc, "</HEAD><BODY BGCOLOR=\"#FFFFFF\">\n");
-#if 0
-      fprintf (dest_doc, "<A NAME=\"%s\">Generated from %s</A> with ROBODoc v"
-              VERSION
-              " on ",
-              src_name, src_name);
-      RB_TimeStamp (dest_doc);
-#endif
-      fprintf (dest_doc, "<BR>\n");
-      if (toc)
-       {
-         char iname[256];
-         FILE *index;
-         int start = 0;
-
-         /* do toc if not in fold */
-#if 0
-         fprintf (dest_doc,
-                  "<H3 ALIGN=\"center\">TABLE OF CONTENTS</H3>\n");
-         fprintf (dest_doc, "<OL>\n");
-#endif
-
-         /* Generate quick index file, for fast referencing */
-         sprintf(iname, "%s-index.tmpl", doc_base);
-          index = fopen(iname, "w");
-          if (!index)
-           {
-             fprintf(stderr, "%s\n", strerror(errno));
-             exit(1);
-           }
-
-         for (cur_header = first_header;
-              cur_header;
-              cur_header = cur_header->next_header)
-           {
-             char fname[256];
-
-             sprintf(fname, "%s-%s.html", RB_FilePart(doc_base), 
-                     cur_header->function_name);
-
-             if (cur_header->name && cur_header->function_name)
-               {
-                 if (start == 0) 
-                   {
-                     int item_type;
-                     char *next_line, *item_line = NULL;
-                   
-                     RB_Generate_Header_Start (dest_doc, cur_header, 
-                                               src_name);
-
-                     next_line = cur_header->contents;
-                     item_type = RB_Find_Item (&next_line, &item_line);
-                     
-                     if (item_type != NO_ITEM)
-                       {
-                         int old_item_type;
-                         char *old_next_line;
-                         
-                         do
-                           {
-                             if (course_of_action & DO_TELL)
-                               printf ("[%s] ", item_names[item_type]);
-                             
-                             if (!((item_type == SOURCE_ITEM) &&
-                                   (course_of_action & DO_NOSOURCE)))
-                               RB_Generate_Item_Name (dest_doc, item_type);
-                             
-                             old_next_line = next_line;
-                             old_item_type = item_type;
-                             
-                             item_type = RB_Find_Item (&next_line, 
-                                                       &item_line);
-                             
-                             if (!((old_item_type == SOURCE_ITEM) &&
-                                   (course_of_action & DO_NOSOURCE)))
-                               RB_Generate_Item_Doc(dest_doc, name,
-                                                    old_next_line, item_line,
-                                                    cur_header->function_name,
-                                                    old_item_type);
-                           }
-                         while (item_type != NO_ITEM);
-                         if (course_of_action & DO_TELL)
-                           putchar ('\n');
-                       }
-
-                     if (index)
-                       {
-                         fprintf (index, "<A HREF=\"%s\"><IMG SRC=\"index_pic.gif\" BORDER=\"0\" ALT=\"\">%s</A><BR>\n",
-                                  name, cur_header->function_name);
-                       }
-
-                     start = 1;
-                   }
-                 else
-                   {
-                     fprintf (dest_doc, "<LI><A HREF=\"%s\">%s</A>\n",
-                              fname, cur_header->function_name);
-                     if (index)
-                       fprintf (index, "<A HREF=\"%s\"><IMG SRC=\"index_pic.gif\" BORDER=\"0\" ALT=\"\">%s</A><BR>\n",
-                                fname, cur_header->function_name);
-                   }
-               }
-           }
-
-#if 0
-         fprintf (dest_doc, "</OL>\n");
-#endif
-
-         if (index)
-           fclose(index);
-       }
-      break;
-
-    case LATEX:
-      fprintf (dest_doc, "%% Document: %s\n", name);
-       fprintf (dest_doc, "%% Source: %s\n", src_name);
-/*      fprintf (dest_doc, "%% " COMMENT_ROBODOC);*/
-      fprintf (dest_doc, "%% " COMMENT_COPYRIGHT);
-      if (course_of_action & DO_SINGLEDOC) {
-        if (!strchr(src_name, '_')) {
-         fprintf (dest_doc, "\\section{%s}\n", src_name);
-       } else {
-         char *tmp = calloc(strlen(src_name) + 2, sizeof(*tmp));
-         *strchr(src_name, '_') = '\\';
-         strncat(tmp, src_name, strcspn(src_name, "\\") + 1);
-         strncat(tmp, "_", 1); 
-         strncat(tmp, src_name + strcspn(src_name, "\\") + 1,
-                 strlen(src_name) - strcspn(src_name, "\\") - 1);
-         fprintf (dest_doc, "\\section{%s}\n", tmp);
-         free(tmp);
-        }
-      } else {
-       fprintf (dest_doc, "\\documentclass{article}\n");
-        fprintf (dest_doc, "\\usepackage{makeidx}\n");
-       fprintf (dest_doc, "\\oddsidemargin  0.15 in\n");
-       fprintf (dest_doc, "\\evensidemargin 0.35 in\n");
-       fprintf (dest_doc, "\\marginparwidth 1 in   \n");
-       fprintf (dest_doc, "\\oddsidemargin 0.25 in \n");
-       fprintf (dest_doc, "\\evensidemargin 0.25 in\n");
-       fprintf (dest_doc, "\\marginparwidth 0.75 in\n");
-       fprintf (dest_doc, "\\textwidth 5.875 in\n");
-       
-       fprintf (dest_doc, "\\setlength{\\parindent}{0in}\n");
-       fprintf (dest_doc, "\\setlength{\\parskip}{.08in}\n\n");
-       
-       /* changed default header to use boldface (vs slant) */
-       fprintf (dest_doc, "\\pagestyle{headings}\n");
-
-       if (document_title) {
-         fprintf (dest_doc, "\\title{%s}\n", 
-                  document_title);
-       } else {
-         fprintf (dest_doc, "\\title{API Reference}\n");
-       }
-/*     fprintf (dest_doc, "\\author{%s}\n", COMMENT_ROBODOC); */
-       fprintf (dest_doc, "\\makeindex\n");
-       fprintf (dest_doc, "\\begin{document}\n");
-       fprintf (dest_doc, "\\maketitle\n");
-       /* autogenerate table of contents! */
-       fprintf (dest_doc, "\\printindex\n");
-       fprintf (dest_doc, "\\tableofcontents\n");
-       fprintf (dest_doc, "\\newpage\n");
-       /* trick to disable the autogenerated \newpage */
-       fprintf (dest_doc, "\n");
-      }
-      break;
-
-    case RTF:
-      {
-       char *cook_link;
-
-       /* RTF header */
-       fprintf (dest_doc, "{\\rtf1\\ansi \\deff0"
-                "{\\fonttbl;"
-                "\\f0\\fswiss MS Sans Serif;"
-                "\\f1\\fmodern Courier New;"
-                "\\f2\\ftech Symbol;"
-                "}"
-                "{\\colortbl;"
-                "\\red255\\green255\\blue255;"
-                "\\red0\\green0\\blue0;"
-                "\\red0\\green0\\blue255;"
-                "}");
-
-       /* RTF document info */
-       fprintf (dest_doc, "{\\info"
-                "{\\title %s}"
-                "{\\comment\n"
-                " Source: %s\n"
-                " " COMMENT_COPYRIGHT
-                "}"
-                "}", name, src_name);
-
-       /* RTF document format */
-       fprintf (dest_doc, "{\\margl1440\\margr1440}\n");
-
-       /* RTF document section */
-       fprintf (dest_doc, "\\f0\\cb1\\cf3\\fs28\\b1\\qc"
-                "{\\super #{\\footnote{\\super #}%s_TOC}}"
-                "{\\super ${\\footnote{\\super $}Contents}}"
-                "{TABLE OF CONTENTS}\\ql\\b0\\fs20\\cf2\\par\n", src_name);
-       for (cur_header = first_header;
-            cur_header;
-            cur_header = cur_header->next_header)
-         {
-           if (cur_header->name && cur_header->function_name)
-             {
-               cook_link = RB_CookStr (cur_header->function_name);
-               fprintf (dest_doc, "{\\uldb %s}{\\v %s}\\line\n",
-                        cur_header->name, cook_link);
-               free (cook_link);
-             }
-         }
-       fprintf (dest_doc, "\\par\n");
-      }
-      break;
-    case ASCII:
-      if (course_of_action & DO_TOC)
-       {
-         fprintf (dest_doc, "TABLE OF CONTENTS\n");
-         for (cur_header = first_header, header_nr = 1;
-              cur_header;
-              cur_header = cur_header->next_header, header_nr++)
-           {
-             if (cur_header->name && cur_header->function_name)
-               {
-                 fprintf (dest_doc, "%4.4d %s\n",
-                          header_nr, cur_header->name);
-               }
-           }
-         fputc ('\f', dest_doc);
-       }
-    default:
-      break;
-    }
-}
-
-/***************/
-
-
-/****f* ROBODoc/RB_Generate_Doc_End [3.0h]
- * NAME
- *   RB_Generate_Doc_End -- generate document trailer.
- * SYNOPSIS
- *   RB_Generate_Doc_End (dest_doc, name)
- *
- *   RB_Generate_Doc_End (FILE *, char *)
- * FUNCTION
- *   Generates for depending on the output_mode the text that
- *   will be at the end of a document.
- * INPUTS
- *   dest_doc - pointer to the file to which the output will
- *              be written.
- *   name     - the name of this file.
- *   output_mode - global variable that indicates the output
- *                 mode.
- * NOTES
- *   Doesn't do anything with its arguments, but that might
- *   change in the future.
- * BUGS
- * SOURCE
- */
-
-void
-RB_Generate_Doc_End (FILE * dest_doc, char *name)
-{
-  switch (output_mode)
-    {
-    case AMIGAGUIDE:
-      fputc ('\n', dest_doc);
-      break;
-    case HTML:
-      fprintf (dest_doc, "</BODY></HTML>\n");
-      break;
-    case LATEX:
-      if (!(course_of_action & DO_SINGLEDOC)) { 
-       fprintf (dest_doc, "\\end{document}\n");
-      }
-      break;
-    case RTF:
-      fputc ('}', dest_doc);
-      break;
-    case ASCII:
-      break;
-    }
-}
-
-/************/
-
-
-/****f* ROBODoc/RB_Generate_Header_Start [3.0h]
- * NAME
- *   RB_Generate_Header_Start -- generate header start text.
- * SYNOPSIS
- *  void RB_Generate_Header_Start (dest_doc, cur_header)
- *
- *  void RB_Generate_Header_Start (FILE *, struct RB_header *)
- * FUNCTION
- *   Generates depending on the output_mode the text that
- *   will be at the end of each header.
- * INPUTS
- *   dest_doc - pointer to the file to which the output will
- *              be written.
- *   cur_header - pointer to a RB_header structure.
- * SEE ALSO
- *   RB_Generate_Header_End
- * SOURCE
- */
-
-void
-RB_Generate_Header_Start (FILE * dest_doc, struct RB_header *cur_header,
-                         const char *src_name)
-{
-  char *cook_link;
-
-  switch (output_mode)
-    {                          /* switch by *koessi */
-    case AMIGAGUIDE:
-      if (cur_header->name && cur_header->function_name)
-       {
-         fprintf (dest_doc, "@Node \"%s\" \"%s\"\n",
-                  cur_header->function_name,
-                  cur_header->name);
-         fprintf (dest_doc, "%s", att_start_command[MAKE_SHINE][output_mode]);
-         fprintf (dest_doc, "%s", cur_header->name);
-         fprintf (dest_doc, "%s", att_stop_command[MAKE_SHINE][output_mode]);
-         fprintf (dest_doc, "\n\n");
-       }
-      break;
-    case HTML:
-      if (cur_header->name && cur_header->function_name)
-       {
-#if 0
-         fprintf (dest_doc, "<HR>\n");
-#endif
-         if (cur_header->type == FUNCTION_HEADER)
-           fprintf (dest_doc, 
-                    "\n<FONT SIZE=\"+2\" COLOR=\"#000055\"><B>"
-                    "Function <A NAME=\"%s\">%s</A>"
-                    "</FONT></B><BR><BR>\n\n",
-                    cur_header->function_name,
-                    cur_header->function_name);
-         else if (cur_header->type == STRUCT_HEADER)
-           fprintf (dest_doc, 
-                    "\n<FONT SIZE=\"+2\" COLOR=\"#000055\"><B>"
-                    "Structure <A NAME=\"%s\">%s</A>"
-                    "</FONT></B><BR><BR>\n\n",
-                    cur_header->function_name,
-                    cur_header->function_name);
-         else if (cur_header->type == VARIABLE_HEADER)
-           fprintf (dest_doc, 
-                    "\n<FONT SIZE=\"+2\" COLOR=\"#000055\"><B>"
-                    "Variable <A NAME=\"%s\">%s</A>"
-                    "</FONT></B><BR><BR>\n\n",
-                    cur_header->function_name,
-                    cur_header->function_name);
-         else if (cur_header->type == MAIN_HEADER)
-           fprintf (dest_doc, 
-                    "\n<FONT SIZE=\"+2\" COLOR=\"#000055\"><B>"
-                    "<A NAME=\"%s\">%s</A>"
-                    "</FONT></B><BR><SMALL>Header: %s</SMALL><BR><BR>\n\n",
-                    cur_header->function_name,
-                    cur_header->function_name, src_name);
-         else
-           fprintf (dest_doc, 
-                    "\n<FONT SIZE=\"+2\" COLOR=\"#000055\"><B>"
-                    "<A NAME=\"%s\">%s</A>"
-                    "</FONT></B><BR><BR>\n\n",
-                    cur_header->function_name,
-                    cur_header->function_name);
-       }
-      break;
-    case LATEX:
-      cook_link = RB_CookStr (cur_header->name);
-      if (!(course_of_action & DO_SINGLEDOC)) {
-       fprintf (dest_doc, "\\newpage\n");
-      }
-      fprintf (dest_doc, "\\subsection{%s}\n", cook_link);
-      free (cook_link);
-      if (cur_header->function_name) {
-       cook_link = RB_CookStr (cur_header->function_name);
-       fprintf (dest_doc, "\\index{unsorted!%s}\\index{%s!%s}\n", cook_link, 
-                RB_header_type_names[cur_header->type], cook_link);
-       free (cook_link);
-      }
-      break;
-    case RTF:
-      if (cur_header->name && cur_header->function_name)
-       {
-         cook_link = RB_CookStr (cur_header->function_name);
-         fprintf (dest_doc, "\\page"
-                  "{\\super #{\\footnote{\\super #}%s}}"
-                  "{\\super ${\\footnote{\\super $}%s}}"
-                  "\\cf3 %s\\cf2\\line\n",
-                  cur_header->function_name,
-                  cur_header->name,
-                  cur_header->name);
-         free (cook_link);
-       }
-      break;
-    case ASCII:
-      {
-       fprintf (dest_doc, "%s", att_start_command[MAKE_SHINE][output_mode]);
-       fprintf (dest_doc, "%s", cur_header->name);
-       fprintf (dest_doc, "%s", att_stop_command[MAKE_SHINE][output_mode]);
-       fprintf (dest_doc, "\n\n");
-      }
-      break;
-    }
-}
-
-/******/
-
-
-/****f* ROBODoc/RB_Generate_Header_End [3.0h]
- * NAME
- *   RB_Generate_Header_End
- * SYNOPSIS
- *   void RB_Generate_Header_End (dest_doc, cur_header)
- *
- *   void RB_Generate_Header_End (FILE *, struct RB_header *)
- * FUNCTION
- *   Generates for depending on the output_mode the text that
- *   will be at the end of a header.
- * INPUTS
- *   dest_doc - pointer to the file to which the output will
- *              be written.
- *   cur_header - pointer to a RB_header structure.
- * SEE ALSO
- *   RB_Generate_Header_Start
- * SOURCE
- */
-
-void
-RB_Generate_Header_End (FILE * dest_doc, struct RB_header *cur_header)
-{
-  switch (output_mode)
-    {                          /* switch by *koessi */
-    case AMIGAGUIDE:
-      if (cur_header->name && cur_header->function_name)
-       fprintf (dest_doc, "@endnode\n");
-      break;
-    case HTML:
-    case LATEX:
-      fputc ('\n', dest_doc);
-      break;
-    case RTF:
-      fprintf (dest_doc, "\\par\n");
-      break;
-    case ASCII:
-      fputc ('\f', dest_doc);
-    default:
-      break;
-    }
-}
-
-/*****/
-
-
-/****f* ROBODoc/RB_Generate_Header_Name [3.0c]
- * NAME
- *   RB_Generate_Header_Name
- * SYNOPSIS
- *   RB_Generate_Header_Name (dest_doc, name)
- *
- *   RB_Generate_Header_Name (FILE *, char *)
- * INPUTS
- *  dest_doc - pointer to the file to which the output will
- *             be written.
- *  name - pointer to the header name.
- * SOURCE
- */
-
-void
-RB_Generate_Header_Name (FILE * dest_doc, char *name)
-{
-  char format_str[] = "%s";
-
-  fprintf (dest_doc, format_str, att_start_command[MAKE_SHINE][output_mode]);
-  fprintf (dest_doc, format_str, name);
-  fprintf (dest_doc, format_str, att_stop_command[MAKE_SHINE][output_mode]);
-  fprintf (dest_doc, "\n\n");
-}
-
-/*** RB_Generate_Header_Name ***/
-
-
-/****** ROBODoc/RB_Generate_Item_Name [2.01]
- * NAME
- *   RB_Generate_Item_Name -- fast&easy
- * SYNOPSIS
- *   void RB_Generate_Item_Name( FILE * dest_doc, int item_type )
- * FUNCTION
- *   write the items name to the doc
- * INPUTS
- *   FILE * dest_doc         -- document in progress
- *   int item_type           -- this leads to the name and makes colors
- * AUTHOR
- *   Koessi
- * NOTES
- *   uses globals: output_mode, item_names[]
- * SOURCE
- */
-
-void
-RB_Generate_Item_Name (FILE * dest_doc, int item_type)
-{
-  char format_str[] = "%s";
-
-  if (item_attributes[item_type] & ITEM_NAME_LARGE_FONT)
-    {
-      fprintf (dest_doc, format_str,
-              att_start_command[MAKE_LARGE][output_mode]);
-      fprintf (dest_doc, format_str,
-              att_start_command[MAKE_BOLD][output_mode]);
-      if (output_mode == HTML)
-       fprintf (dest_doc, "\n<FONT COLOR=\"#000055\">");
-      fprintf (dest_doc, format_str, item_names[item_type]);
-      if (output_mode == HTML)
-       fprintf (dest_doc, "\n</FONT>");
-      fprintf (dest_doc, format_str,
-              att_stop_command[MAKE_BOLD][output_mode]);
-      fprintf (dest_doc, format_str,
-              att_stop_command[MAKE_LARGE][output_mode]);
-    }
-  else
-    fprintf (dest_doc, format_str, item_names[item_type]);
-
-  fputc ('\n', dest_doc);
-}
-
-/*****/
-
-
-
-/****f* ROBODoc/RB_Generate_Item_Doc [3.0j]
- * NAME
- *   RB_Generate_Item_Doc
- * SYNOPSIS
- *   void RB_Generate_Item_Doc(FILE * dest_doc, char *dest_name,
- *                             char *begin_of_item,
- *                             char *end_of_item,
- *                             char *function_name,
- *                             int item_type)
- * FUNCTION
- *   Generates the body text of an item, applying predefined attributes
- *   to the text.
- * NOTES
- *   Body text is always non-proportional for several reasons:
- *   1) text is rarely written with prop spacing and text wrapping
- *      in mind -- e.g., see SYNOPSIS above
- *   2) source code looks better
- *   3) it simplifies LaTeX handling
- * SOURCE
- */
-
-void
-RB_Generate_Item_Doc (FILE * dest_doc, char *dest_name,
-                     char *begin_of_item,
-                     char *end_of_item,
-                     char *function_name,
-                     int item_type)
-{
-  char format_str[] = "%s";
-
-  if (begin_of_item == end_of_item)
-    {
-      switch (output_mode)
-       {
-       case HTML:
-         fprintf (dest_doc, "<BR>\n");
-         break;
-       case LATEX:
-         fprintf (dest_doc, "\\\\\n");
-         break;
-       case RTF:
-         fprintf (dest_doc, "\n");
-         break;
-       default:
-         break;
-       }
-      return;
-    }
-  /* For text body in HTML, change to non-prop _before_ changing font
-   * style. * To conform to DTD, this avoids <B><PRE> and instead uses
-   * <PRE><B> */
-  if (output_mode == HTML)
-    {
-      fprintf (dest_doc, "<PRE>");
-    }
-  /* change font style */
-  if (item_attributes[item_type] & TEXT_BODY_LARGE_FONT)
-    fprintf (dest_doc, format_str,
-            att_start_command[MAKE_LARGE][output_mode]);
-  if (item_attributes[item_type] & TEXT_BODY_ITALICS)
-    fprintf (dest_doc, format_str,
-            att_start_command[MAKE_ITALICS][output_mode]);
-  if (item_attributes[item_type] & TEXT_BODY_NON_PROP)
-    fprintf (dest_doc, format_str,
-            att_start_command[MAKE_NON_PROP][output_mode]);
-  if (item_attributes[item_type] & TEXT_BODY_SMALL_FONT)
-    fprintf (dest_doc, format_str,
-            att_start_command[MAKE_SMALL][output_mode]);
-  if (item_attributes[item_type] & TEXT_BODY_BOLD)
-    fprintf (dest_doc, format_str,
-            att_start_command[MAKE_BOLD][output_mode]);
-  if (item_attributes[item_type] & TEXT_BODY_UNDERLINE)
-    fprintf (dest_doc, format_str,
-            att_start_command[MAKE_UNDERLINE][output_mode]);
-  if (item_attributes[item_type] & TEXT_BODY_SHINE)
-    fprintf (dest_doc, format_str,
-            att_start_command[MAKE_SHINE][output_mode]);
-  if (item_attributes[item_type] & TEXT_BODY_DEFAULT)
-    fprintf (dest_doc, format_str,
-            att_start_command[MAKE_DEFAULT][output_mode]);
-
-  /* 
-   * For some modes, the text body is always non-prop
-   */
-  switch (output_mode)
-    {
-    case LATEX:
-      fprintf (dest_doc, "\\begin{verbatim}\n");
-      break;
-    case RTF:
-      fprintf (dest_doc, "{\\f1{}");
-      break;
-    default:
-      break;
-    }
-
-  RB_Generate_Item_Body (dest_doc, dest_name, begin_of_item, end_of_item,
-                        function_name, item_type, 0);
-
-  switch (output_mode)
-    {
-    case LATEX:
-      /* split the text so LaTeX doesn't get confused ;) */
-      fprintf (dest_doc, "\\" "end{verbatim}\n");
-      break;
-    case RTF:
-      fputc ('}', dest_doc);
-    default:
-      break;
-    }
-
-  /* restore font style */
-  if (item_attributes[item_type] & TEXT_BODY_SHINE)
-    fprintf (dest_doc, format_str,
-            att_stop_command[MAKE_SHINE][output_mode]);
-  if (item_attributes[item_type] & TEXT_BODY_UNDERLINE)
-    fprintf (dest_doc, format_str,
-            att_stop_command[MAKE_UNDERLINE][output_mode]);
-  if (item_attributes[item_type] & TEXT_BODY_BOLD)
-    fprintf (dest_doc, format_str,
-            att_stop_command[MAKE_BOLD][output_mode]);
-  if (item_attributes[item_type] & TEXT_BODY_SMALL_FONT)
-    fprintf (dest_doc, format_str,
-            att_stop_command[MAKE_SMALL][output_mode]);
-  if (item_attributes[item_type] & TEXT_BODY_NON_PROP)
-    fprintf (dest_doc, format_str,
-            att_stop_command[MAKE_NON_PROP][output_mode]);
-  if (item_attributes[item_type] & TEXT_BODY_ITALICS)
-    fprintf (dest_doc, format_str,
-            att_stop_command[MAKE_ITALICS][output_mode]);
-  if (item_attributes[item_type] & TEXT_BODY_LARGE_FONT)
-    fprintf (dest_doc, format_str,
-            att_stop_command[MAKE_LARGE][output_mode]);
-  if (item_attributes[item_type] & TEXT_BODY_DEFAULT)
-    fprintf (dest_doc, format_str,
-            att_stop_command[MAKE_DEFAULT][output_mode]);
-
-  if (output_mode != HTML)
-    {
-      fputc ('\n', dest_doc);
-    }
-  /* for HTML, switch back to prop-font after restoring font style */
-  if (output_mode == HTML)
-    {
-      fprintf (dest_doc, "</PRE>");
-    }
-}
-
-/******/
-
-
-
-/****f* ROBODoc/RB_Generate_Item_Body [3.0h]
- * NAME
- *  RB_Generate_Item_Body
- * SYNOPSIS
- *  char * RB_Generate_Item_Body(FILE * dest_doc, char *dest_name,
- *                             char *begin_of_item, char *end_of_item,
- *                             char *function_name,
- *                             int   item_type, int tabs_to_skip)
- *
- * FUNCTION
- *   Generates body of an item in output-specific form
- * INPUTS
- *   dest_doc      - pointer to the file to which
- *                   the output will be written.
- *   dest_name     - the name of this file.
- *   begin_of_item -
- *   end_of_item   -
- *   function_name -
- *   item_type     -
- *   tabs_to_skip  - how many tabs to skip in this fold.
- * BUGS
- *   o Unbalanced fold marks lead to crash.
- * NOTES
- *   o Almost completely rewritten by koessi
- *   o Almost completely Re-Rewritten by Slothouber :)
- *   o Folding mode by PetteriK.
- *   o Linking fixed inside folds / PetteriK 08.04.2000 
- * SOURCE
- */
-
-char *
-RB_Generate_Item_Body (FILE * dest_doc, char *dest_name,
-                      char *begin_of_item, char *end_of_item,
-                      char *function_name,
-                      int item_type, int tabs_to_skip)
-{
-  char *cur_char, old_char, c;
-  int html_incr;
-  char fname[128], foldname[128];
-  static int in_fold = 0;      /* PetteriK 08.04.2000 */
-
-  cur_char = begin_of_item;
-
-  if (item_type == SOURCE_ITEM)
-    {
-      /* skip end_comment_marker */
-      for (; *cur_char && *cur_char != '\n'; cur_char++);
-
-      /* skip blank lines leading up to source code */
-      while (*cur_char == '\n')
-       cur_char++;
-
-      /* trim blanks following source code */
-      do
-       {
-         end_of_item--;
-       }
-      while (end_of_item > cur_char && isspace (*end_of_item));
-      end_of_item++;           /* advance 1 for placement of the NUL */
-    }
-  old_char = *end_of_item;
-  *end_of_item = '\0';
-
-  for (; *cur_char; cur_char++)
-    {
-      int tb = tab_size;
-      int do_search = TRUE;
-      int was_link = FALSE;
-      int tabs = 0;
-
-      if (item_type != SOURCE_ITEM)
-       {
-          /* Skip empty lines */
-          while (*cur_char == '\n') {
-                cur_char++;
-          }
-         cur_char = RB_Skip_Remark_Marker (cur_char);
-       }
-      else
-       {
-         /* indent source */
-         switch (output_mode)
-           {
-           case RTF:
-             fprintf (dest_doc, "\\tab ");
-             break;
-
-           case AMIGAGUIDE:
-           case HTML:
-           case LATEX:
-           default:
-             fprintf (dest_doc, "    ");
-           }
-       }
-
-      while (((c = *cur_char) != '\0') && (c != '\n'))
-       {
-         char *label_name, *file_name;
-         char found = 0;
-         int tmp;
-
-         if (!do_search)
-           {
-             if (!isalnum (c) && (c != '_'))
-               {
-                 do_search = TRUE;
-               }
-           }
-         else
-           {
-             if (isalpha (c) || (c == '_'))
-               {
-                 if (((was_link = RB_Find_Link (cur_char, &label_name,
-                                                &file_name)) == FALSE))
-                   {
-                     do_search = FALSE;
-                   }
-               }
-             else
-               was_link = FALSE;
-           }
-
-         if (!was_link)
-           {
-             switch (output_mode)
-               {
-               case AMIGAGUIDE:
-                 switch (c)
-                   {
-                   case '\n':
-                     --cur_char;
-                     break;
-                   case '\t':
-                     for (tb %= tab_size; tb < tab_size; ++tb)
-                       fputc (' ', dest_doc);
-                     break;
-                   case '@':
-                     fprintf (dest_doc, "\\@");
-                     tb++;
-                     break;
-                   case '\\':
-                     fprintf (dest_doc, "\\\\");
-                     tb++;
-                     break;
-                   default:
-                     fputc (c, dest_doc);
-                     tb++;
-                   }
-                 break;
-
-               case HTML:
-                 /* PetteriK 26.07.1999 */
-                 if (extra_flags & FOLD)
-                   {
-                     cur_char = RB_Check_Fold_Start (cur_char,
-                                                     foldname, &found);
-                   }
-                 if ((extra_flags & FOLD) && found)
-                   {
-                     FILE *fp;
-
-                     RB_Say ("fold name %s\n", foldname);
-                     RB_Say ("fold begin %d\n", ++fold);
-                     RB_Say ("tabs %d\n", tabs);
-                     sprintf (fname, "%s_fold_%d.html", doc_base, fold);
-                     RB_Say ("opening file %s\n", fname);
-                     fp = fopen (fname, "w");
-                     RB_Generate_Doc_Start (fp, foldname, foldname, 0);
-                     fprintf (fp, "<PRE>\n");
-                     fprintf (dest_doc, "<A HREF=\"%s\">... %s</A>",
-                              fname, foldname);
-                     in_fold++;        /* PetteriK 08.04.2000 */
-                     cur_char = RB_Generate_Item_Body (fp, dest_name,
-                                                     cur_char, end_of_item,
-                                                       function_name,
-                                                       item_type, tabs);
-                     in_fold--;        /* PetteriK 08.04.2000 */
-                     /* skip chars until newline */
-                     while (*cur_char != '\n')
-                       {
-                         cur_char++;
-                       }
-                     cur_char--;
-                     fprintf (fp, "\n</PRE>\n");
-                     RB_Generate_Doc_End (fp, foldname);
-                     fclose (fp);
-                   }
-                 else if ((extra_flags & FOLD) && RB_Check_Fold_End (cur_char))
-                   {
-                     RB_Say ("fold end found\n");
-                     return cur_char;
-                   }
-                 else if ((html_incr = RB_HTML_Extra (dest_doc,
-                                                      item_type, cur_char)))
-                   {
-                     cur_char += html_incr;
-                   }
-                 else
-                   {
-                     switch (c)
-                       {
-                       case '\n':
-                         --cur_char;
-                         break;
-                       case '\t':
-                         if (extra_flags & FOLD)
-                           {
-                             if (tabs >= tabs_to_skip)
-                               {
-                                 for (tb %= tab_size; tb < tab_size; ++tb)
-                                   {
-                                     fputc (' ', dest_doc);
-                                   }
-                               }
-                             tabs++;
-                           }
-                         else
-                           {
-                             for (tb %= tab_size; tb < tab_size; ++tb)
-                               {
-                                 fputc (' ', dest_doc);
-                               }
-                           }
-                         break;
-                       case '<':
-                         fprintf (dest_doc, "&lt;");
-                         tb++;
-                         break;
-                       case '>':
-                         fprintf (dest_doc, "&gt;");
-                         tb++;
-                         break;
-                       case '&':
-                         fprintf (dest_doc, "&amp;");
-                         tb++;
-                         break;
-                       default:
-                         fputc (c, dest_doc);
-                         tb++;
-                       }
-                   }
-                 break;        /* end case HTML */
-
-               case LATEX:
-                 switch (c)
-                   {
-                   case '\n':
-                     --cur_char;
-                     break;
-                   case '\t':
-                     for (tb %= tab_size; tb < tab_size; ++tb)
-                       fputc (' ', dest_doc);
-                     break;
-#if 0
-                     /* not used in LaTeX's verbatim environment */
-                   case '$':
-                   case '&':
-                   case '%':
-                   case '#':
-                   case '_':
-                   case '{':
-                   case '}':
-                     fputc ('\\', dest_doc);
-                     fputc (c, dest_doc);
-                     tb++;
-                     break;
-                   case '\\':
-                     fprintf (dest_doc, "$\\backslash$");
-                     tb++;
-                     break;
-                   case '~':
-                     fprintf (dest_doc, "$\\tilde$");
-                     tb++;
-                     break;
-                   case '^':
-                     fprintf (dest_doc, "$\\,\\!^{\\sim}$");
-                     tb++;
-                     break;
-#endif
-                   default:
-                     fputc (c, dest_doc);
-                     tb++;
-                   }
-                 break;
-
-               case RTF:
-                 switch (c)
-                   {
-                   case '\n':
-                     --cur_char;
-                     break;
-                   case '\t':
-                     for (tb %= tab_size; tb < tab_size; ++tb)
-                       fputc (' ', dest_doc);
-                     break;
-                   case '\\':
-                   case '{':
-                   case '}':
-                     fputc ('\\', dest_doc);
-                     fputc (c, dest_doc);
-                     tb++;
-                     break;
-                   default:
-                     fputc (c, dest_doc);
-                     tb++;
-                   }
-                 break;
-
-               default:
-                 fputc (c, dest_doc);
-                 tb++;
-               }
-             cur_char++;
-           }
-         else
-           {
-             switch (output_mode)
-               {
-               case AMIGAGUIDE:
-                 if (file_name && strcmp (file_name, dest_name))
-                   fprintf (dest_doc, "@{\"%s\" Link \"%s/%s\"}",
-                            label_name, file_name, label_name);
-                 else
-                   {
-                     if (strcmp (label_name, function_name))
-                       fprintf (dest_doc, "@{\"%s\" Link \"%s\"}",
-                                label_name, label_name);
-                     else
-                       {
-                         fprintf (dest_doc, "%s",
-                                att_start_command[MAKE_BOLD][output_mode]);
-                         fprintf (dest_doc, "%s", label_name);
-                         fprintf (dest_doc, "%s",
-                                  att_stop_command[MAKE_BOLD][output_mode]);
-                       }
-                   }
-                 break;
-
-               case HTML:
-                 /* Include the file name in the link if we are in fold
-                  * PetteriK 08.04.2000 
-                  */
-                 if (in_fold)
-                   {
-                     /* We are in fold, always use the file name in the link, 
-                      * in file_name == NULL (i.e. the label is in the current file 
-                      * that we are processing), refer to value in dest_name. 
-                      * This also makes sure that we link correctly if function_name
-                      * is the same as label_name.
-                      */
-                     fprintf (dest_doc, "<A HREF=\"%s#%s\">%s</A>",
-                              (file_name ? file_name : dest_name),
-                              label_name, label_name);
-                   }
-                 else if (file_name && strcmp (file_name, dest_name))
-                   {
-#if 0
-                     fprintf (dest_doc, "<A HREF=\"%s#%s\">%s</A>",
-                              file_name, label_name, label_name);
-#endif
-                     fprintf (dest_doc, "<A HREF=\"%s-%s.html\">%s</A>",
-                              RB_FilePartStart(file_name), label_name, 
-                              label_name);
-                   }
-                 else
-                   {
-                     if (strcmp (label_name, function_name))
-                       {
-#if 0
-                         fprintf (dest_doc, "<A HREF=\"#%s\">%s</A>",
-                                  label_name, label_name);
-#endif
-                         fprintf (dest_doc, "<A HREF=\"%s-%s.html\">%s</A>",
-                                  RB_FilePart(doc_base), label_name, 
-                                              label_name);
-                       }
-                     else
-                       {
-                         fprintf (dest_doc, "%s",
-                                att_start_command[MAKE_BOLD][output_mode]);
-                         fprintf (dest_doc, "%s", label_name);
-                         fprintf (dest_doc, "%s",
-                                  att_stop_command[MAKE_BOLD][output_mode]);
-                       }
-                   }
-                 break;
-
-               case RTF:
-                 if (strcmp (label_name, function_name))
-                   {
-                     char *cook_link;
-
-                     cook_link = RB_CookStr (label_name);
-                     fprintf (dest_doc, "{\\uldb %s}{\\v %s}",
-                              label_name, cook_link);
-                     free (cook_link);
-                   }
-                 else
-                   {
-                     fprintf (dest_doc, "%s",
-                              att_start_command[MAKE_BOLD][output_mode]);
-                     fprintf (dest_doc, "%s", label_name);
-                     fprintf (dest_doc, "%s",
-                              att_stop_command[MAKE_BOLD][output_mode]);
-                   }
-                 break;
-               default:
-                 fprintf (dest_doc, "%s", label_name);
-               }
-             tmp = strlen (label_name);
-             cur_char += tmp;
-             tb += tmp;
-           }                   /* end if */
-       }
-
-      if (*cur_char)
-       {
-         if (output_mode == RTF)
-           fprintf (dest_doc, "\\line");
-         fputc ('\n', dest_doc);
-         tabs = 0;
-       }
-    }
-  *end_of_item = old_char;
-  return (char *) 0;
-}
-
-
-/***************/
-
-
-/****f* ROBODoc/RB_HTML_Extra
-* NAME
-*   RB_HTML_Extra
-* AUTHOR
-*   PetteriK
-* HISTORY
-*   05/15/2000 Added mailto: support (Guillaume Etorre)
-* FUNCTION
-*   Check and process embedded hyperlinks.
-* RETURN VAL* FUNCTION
-*   Check and process embedded hyperlinks.
-* RETURN VALUE
-*   Number of chars processed from *cur_char
-* TODO
-*   Flag for C and other grammars.
-* BUGS
-*   As the documentation generated for this functions shows, if
-*   the C source code contains a string with " / * " in it, this
-*   function fails :)
-* SOURCE
-*/
-
-int
-RB_HTML_Extra (FILE * dest_doc, int item_type, char *cur_char)
-{
-  int res = 0;
-  char link[1024];
-
-  if (strncmp ("http://", cur_char, strlen ("http://")) == 0)
-    {
-      sscanf (cur_char, "%s", link);
-      RB_Say ("found link %s\n", link);
-      res = (strlen (link) - 1);
-      fprintf (dest_doc, "<A HREF=\"%s\">%s</A>", link, link);
-    }
-  else if (strncmp ("href:", cur_char, strlen ("href:")) == 0)
-    {
-      /* handy in relative hyperlink paths, e.g. href:../../modulex/ */
-      sscanf ((cur_char + strlen ("href:")), "%s", link);
-      RB_Say ("found link %s\n", link);
-      res = (strlen (link) + strlen ("href:") - 1);
-      fprintf (dest_doc, "<A HREF=\"%s\">%s</A>", link, link);
-    }
-  else if (strncmp ("mailto:", cur_char, strlen ("mailto:")) == 0)
-    {
-      sscanf ((cur_char + strlen ("mailto:")), "%s", link);
-      RB_Say ("found mail to %s\n", link);
-      res = (strlen (link) + strlen ("mailto:") - 1);
-      fprintf (dest_doc, "<A HREF=\"mailto:%s\">%s</A>", link, link);
-    }
-  else if ((extra_flags & C_MODE) && (item_type == SOURCE_ITEM) &&
-          (strncmp ("/*", cur_char, 2) == 0))
-    {
-      /* start of C comment */
-      fprintf (dest_doc, "<FONT COLOR = \"#FF0000\">/*");
-      res = 1;
-    }
-  else if ((extra_flags & C_MODE) && (item_type == SOURCE_ITEM) &&
-          (strncmp ("*/", cur_char, 2) == 0))
-    {
-      /* end of C comment */
-      fprintf (dest_doc, "*/</FONT>");
-      res = 1;
-    }
-  return res;
-}
-
-/**********/
-
-
-/****f* ROBODoc/RB_Generate_Index
- * NAME
- *   RB_Generate_Index -- generate index file based on xref files.
- * SYNOPSIS
- *   void RB_Generate_Index(FILE *dest, char *name) 
- * FUNCTION
- *   Create a master index file. It contains pointers to the
- *   documentation generated for each source file, as well as all
- *   "objects" found in the source files.
- ********
- */
-
-void
-RB_Generate_Index (FILE * dest, char *source)
-{
-  RB_Slow_Sort_Links ();
-
-  switch (output_mode)
-    {
-    case HTML:
-      {
-       if (document_title) {
-         RB_Generate_Doc_Start (dest, source, document_title, 0);
-         fprintf (dest, "<H1>%s</H1>\n", document_title);
-       } else {
-         RB_Generate_Doc_Start (dest, source, "Master Index File", 0);
-         fprintf (dest, "<H1>Master Index File</H1>\n");
-       }
-       if (RB_Number_Of_Links (MAIN_HEADER, NULL))
-         RB_Generate_Index_Table (dest, MAIN_HEADER, "Modules");
-//     RB_Generate_Index_Table (dest, NO_HEADER, "Source Files");
-       if (RB_Number_Of_Links (CLASS_HEADER, NULL))
-         RB_Generate_Index_Table (dest, CLASS_HEADER, "Classes");
-       if (RB_Number_Of_Links (METHOD_HEADER, NULL))
-         RB_Generate_Index_Table (dest, METHOD_HEADER, "Methods");
-       if (RB_Number_Of_Links (STRUCT_HEADER, NULL))
-         RB_Generate_Index_Table (dest, STRUCT_HEADER, "Structures");
-       if (RB_Number_Of_Links (FUNCTION_HEADER, NULL))
-         RB_Generate_Index_Table (dest, FUNCTION_HEADER, "Functions");
-       if (RB_Number_Of_Links (VARIABLE_HEADER, NULL))
-         RB_Generate_Index_Table (dest, VARIABLE_HEADER, "Global Variables");
-       if (RB_Number_Of_Links (CONSTANT_HEADER, NULL))
-         RB_Generate_Index_Table (dest, CONSTANT_HEADER, "Constants");
-       if (RB_Number_Of_Links (GENERIC_HEADER, NULL))
-         RB_Generate_Index_Table (dest, GENERIC_HEADER, "Generic");
-       if (RB_Number_Of_Links (INTERNAL_HEADER, NULL))
-         RB_Generate_Index_Table (dest, INTERNAL_HEADER, "Internal");
-       RB_Generate_Doc_End (dest, source);
-      } break;
-    case LATEX:
-      {
-       RB_Generate_Doc_Start (dest, source, "Master File", 0);
-       RB_Generate_LaTeX_Includes (dest);
-       RB_Generate_Doc_End (dest, source);
-      }
-    }
-}
-
-
-/****f* ROBODoc/Generate_LaTeX_Includes
- * NAME
- *   Generate_LaTeX_Includes -- generate include commands
- * SYNOPSIS
- *   void RB_Generate_LaTeX_Includes (FILE *dest)
- * FUNCTION
- *   Generates a series of \include commands to include the
- *   documentation generated for each source file into one
- *   big file.
- ****
- */
-
-void
-RB_Generate_LaTeX_Includes (FILE *dest)
-{
-  struct RB_link *cur_link;
-  for (cur_link = first_link;
-       cur_link;
-       cur_link = cur_link->next_link) {
-    {
-      if (cur_link->type == NO_HEADER)
-       fprintf (dest, "\\include{%s}\n", cur_link->label_name);
-    }
-  }
-}
-
-/****f* ROBODoc/RB_Generate_Index_Table
- * NAME
- *   RB_Generate_Index --
- * SYNOPSIS
- *   void RB_Generate_Index_Table(FILE *, int type, char *title)
- *        RB_Generate_Index_Table(dest, type, title)
- * FUNCTION
- *   Creates a table with index items of a particular type.
- *   If the type is NO_HEADER, then the table is a table of
- *   source files. In this case no link is added if the
- *   source file did not contain any documentation.  
- * INPUTS
- *   dest  -- output file
- *   type  -- kind of header index. 
- *   title -- title for the table
- * SOURCE
- */
-
-void
-RB_Generate_Index_Table (FILE * dest, int type, char *title)
-{
-  struct RB_link *cur_link;
-  int number_of_columns;
-  int cur_column;
-
-  number_of_columns = 60 / RB_Max_Name_Length (type, NULL);
-
-  fprintf (dest, "<H2>%s</H2>\n", title);
-  fprintf (dest, "<TABLE>\n");
-  cur_column = 0;
-  for (cur_link = first_link;
-       cur_link;
-       cur_link = cur_link->next_link)
-    {
-      if (cur_link->type == type)
-       {
-         if (cur_column == 0)
-           {
-             fprintf (dest, "<TR>\n");
-           }
-         if (type == NO_HEADER)
-           {
-             if (RB_Number_Of_Links (NO_HEADER, cur_link->file_name) > 1)
-               {
-                 fprintf (dest,
-                          "<TD><A HREF=\"%s-%s.html\"><TT>%s</TT></A></TD>\n",
-                          RB_FilePartStart(cur_link->file_name),
-                          cur_link->label_name,
-                          cur_link->label_name);
-               }
-             else
-               {
-                 fprintf (dest, "<TD>%s</TD>\n", cur_link->label_name);
-               }
-           }
-         else
-           {
-             if (type == MAIN_HEADER)
-               {
-                 fprintf (dest, "<TD><A HREF=\"%s.html\"><TT>%s</TT></A></TD>\n",
-                      RB_FilePartStart(cur_link->file_name), 
-                      cur_link->label_name);
-               }
-             else
-               {
-                 fprintf (dest, "<TD><A HREF=\"%s-%s.html\"><TT>%s</TT></A></TD>\n",
-                      RB_FilePartStart(cur_link->file_name), 
-                      cur_link->label_name,
-                      cur_link->label_name);
-               }
-           };
-         cur_column++;
-         if (cur_column > number_of_columns)
-           {
-             fprintf (dest, "</TR>\n");
-             cur_column = 0;
-           }
-       }
-    }
-  for (; cur_column <= number_of_columns;)
-    {
-      if (cur_column == 0)
-       {
-         fprintf (dest, "<TR>\n");
-       }
-      fprintf (dest, "<TD></TD>\n");
-      cur_column++;
-    }
-  fprintf (dest, "</TR>\n");
-  fprintf (dest, "</TABLE>\n");
-}
-
-/******* END RB_Generate_Index_Table  *****/
-
-
-/****f* ROBODoc/RB_Number_Of_Links
- * NAME
- *   RB_Number_Of_Links -- Count the number of links.
- * FUNCTION
- *   Counts the number of links that are of a particular type
- *   and that can be found in a particular file.
- * INPUTS
- *   type      -- the header type of the header the link is pointing to.
- *                If NO_HEADER, all header types are counted.
- *   file_name -- name of the file the link comes from, can be NULL, in
- *                which case only the type is checked.
- * RESULT
- *   number of links.
- ******
- */
-
-int
-RB_Number_Of_Links (int type, char *file_name)
-{
-  struct RB_link *cur_link;
-  int n = 0;
-
-  for (cur_link = first_link;
-       cur_link;
-       cur_link = cur_link->next_link)
-    {
-      if (cur_link->type == type || (type == NO_HEADER))
-       {
-         if (file_name)
-           {
-             if (strcmp (file_name, cur_link->file_name) == 0)
-               {
-                 n++;
-               }
-           }
-         else
-           {
-             n++;
-           }
-       }
-    }
-
-  return n;
-}
-
-
-/****f* ROBODoc/RB_Max_Name_Length
- * NAME
- *   RB_Max_Name_Length -- find longest label name.
- * FUNCTION
- *   Find the length of the longest label name in a sub list
- *   of the list with links.  This is used to determine how
- *   many columns can be displayed in a table.
- *   The sublist is specified by the type of header the link
- *   should point to, as well as by the name of the documentation 
- *   file.
- * EXAMPLE
- *     RB_Max_Name_Length(CLASS_HEADER, "muppets.c.html")
- *   longest label name in the list of links to class headers 
- *   in muppets.c.html.
- *     RB_Max_Name_Length(CLASS_HEADER, NULL)
- *   longest label name in the list of links to class headers.
- * INPUTS
- *   type      -- type of header
- *   file_name -- file the header come from, can be NULL.
- *                In which links from all files are used.
- * SOURCE
- */
-
-int
-RB_Max_Name_Length (int type, char *file_name)
-{
-  struct RB_link *cur_link;
-  int n = 1;
-
-  for (cur_link = first_link;
-       cur_link;
-       cur_link = cur_link->next_link)
-    {
-      if (cur_link->type == type)
-       {
-         if (file_name)
-           {
-             if (strcmp (file_name, cur_link->file_name) == 0)
-               {
-                 if (strlen (cur_link->label_name) > n)
-                   {
-                     n = strlen (cur_link->label_name);
-                   }
-               }
-           }
-         else
-           {
-             if (strlen (cur_link->label_name) > n)
-               {
-                 n = strlen (cur_link->label_name);
-               }
-           }
-       }
-    }
-  return n;
-}
-
-/*********/
diff --git a/util/robodoc/Source/generator.h b/util/robodoc/Source/generator.h
deleted file mode 100644 (file)
index c886974..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-#ifndef ROBODOC_GENERATOR_H
-#define ROBODOC_GENERATOR_H
-
-void RB_Generate_Documentation (FILE *, char *, char *);
-void RB_Generate_Item_Doc (FILE *, char *, char *, char *, char *, int);
-char *RB_Generate_Item_Body (FILE *, char *, char *, char *, char *, int, int);
-void RB_Generate_Header_Name (FILE *, char *);
-void RB_Generate_Item_Name (FILE *, int);
-void RB_Generate_Doc_Start (FILE *, char *, char *, char);
-void RB_Generate_Doc_End (FILE *, char *);
-void RB_Generate_Header_Start (FILE *, struct RB_header *, const char *);
-void RB_Generate_Header_End (FILE *, struct RB_header *);
-int RB_HTML_Extra (FILE * dest_doc, int item_type, char *cur_char);
-void RB_Generate_Index (FILE * dest, char *name);
-void RB_Generate_LaTeX_Includes (FILE *dest);
-void RB_Generate_Index_Table (FILE * dest, int type, char *source);
-int RB_Max_Name_Length (int type, char *file_name);
-int RB_Number_Of_Links (int type, char *file_name);
-
-#endif /* ROBODOC_GENERATOR_H */
diff --git a/util/robodoc/Source/headers.c b/util/robodoc/Source/headers.c
deleted file mode 100644 (file)
index bb2bf98..0000000
+++ /dev/null
@@ -1,160 +0,0 @@
-#include <stdio.h>
-#include <stddef.h>
-#include "robodoc.h"
-#include "headers.h"
-
-
-/****v* ROBODoc/header_markers [3.0h]
- * NAME
- *   header_markers -- strings that mark the begin of a header.
- * FUNCTION
- *   These specify what robodoc recognizes as the beginning
- *   of a header.
- * SOURCE
- */
-
-char *header_markers[] =
-{
-  "/****",                     /* C, C++ */
-  "//****",                    /* C++ */
-  "(****",                     /* Pascal, Modula-2, B52 */
-  "{****",                     /* Pascal */
-  ";****",                     /* M68K assembler */
-  "****",                      /* M68K assembler */
-  "C     ****",                        /* Fortran */
-  "REM ****",                  /* BASIC */
-  "%****",                     /* LaTeX, TeX, Postscript */
-  "#****",                     /* Tcl/Tk */
-  "      ****",                        /* COBOL */
-  "--****",                    /* Occam */
-  "<!--****",                  /* HTML Code */
-  "<!---****",                 /* HTML Code,  the three-dashed comment 
-                                * tells the [server] pre-processor not 
-                                * to send that comment with the HTML */
-  "|****",                     /* GNU Assembler */
-  "!!****",                    /* FORTAN 90 */
-  NULL};
-
-/****/
-
-
-/****v* ROBODoc/remark_markers [3.0h]
- * NAME
- *   remark_markers
- * FUNCTION
- *   These specify what robodoc recognizes as a comment marker.
- * SOURCE
- */
-
-char *remark_markers[] =
-{
-  " *",                                /* C, C++, Pascal, Modula-2 */
-  "//",                                /* C++ */
-  "*",                         /* C, C++, M68K assembler, Pascal, *
-                                * Modula-2 */
-  ";*",                                /* M68K assembler */
-  ";",                         /* M68K assembler */
-  "C    ",                     /* Fortran */
-  "REM ",                      /* BASIC */
-  "%",                         /* LaTeX, TeX, Postscript */
-  "#",                         /* Tcl/Tk */
-  "      *",                   /* COBOL */
-  "--",                                /* Occam */
-  "|",                         /* GNU Assembler */
-  "!!",                                /* FORTAN 90 */
-  NULL};
-
-/****/
-
-/****v* ROBODoc/end_markers [3.0h]
- * NAME
- *   end_markers -- strings that mark the end of a header.
- * FUNCTION
- *   These specify what robodoc recognizes as the end of a 
- *   documentation header. In most cases this will be
- *   "***" or " ***". If the header contains a SOURCE item
- *   then the end of the source has to be marked, which
- *   is when the other strings in this array are used.
- * SOURCE
- */
-
-char *end_markers[] =
-{
-  "/***",                      /* C, C++ */
-  "//***",                     /* C++ */
-  " ***",                      /* C, C++, Pascal, Modula-2 */
-  "{***",                      /* Pascal */
-  "(***",                      /* Pascal, Modula-2, B52 */
-  ";***",                      /* M68K assembler */
-  "***",                       /* M68K assembler */
-  "C     ***",                 /* Fortran */
-  "REM ***",                   /* BASIC */
-  "%***",                      /* LaTeX, TeX, Postscript */
-  "#***",                      /* Tcl/Tk */
-  "      ***",                 /* COBOL */
-  "--***",                     /* Occam */
-  "<!--***",                   /* HTML */
-  "<!---***",                  /* HTML */
-  "|***",                      /* GNU Assembler */
-  "!!***",                     /* FORTAN 90 */
-  NULL};
-
-/****/
-
-/****v* ROBODoc/RB_header_typenames
- * NAME
- *   RB_header_typename
- * FUNCTION
- *   Handy table to translate a header type number (see RB_header_types)
- *   to an ascii string.
- *****
- */
-
-char *RB_header_type_names[] =
-{
-  "none",
-  "main",
-  "generic",
-  "internal",
-  "function",
-  "struct",
-  "class",
-  "method",
-  "constant",
-  "variable",
-  "blank"
-};
-
-/****v* ROBODoc/first_header
- * NAME
- *   first_header -- pointer to the first header in the list of headers.
- * SOURCE
- */
-
-struct RB_header *first_header = NULL;
-
-/*****/
-
-/****v* ROBODoc/last_header
- * NAME
- *   last_header -- pointer to the last header in the list of headers.
- * SOURCE
- */
-
-struct RB_header *last_header = NULL;
-
-/******/
-
-/****v* ROBODoc/first_link
- * NAME
- *   first_link -- pointer to the first link in the list of links.
- * SOURCE
- */
-
-struct RB_link *first_link = NULL;
-
-/*****/
-
-
-int header_index_size = 0;
-struct RB_header **header_index = NULL;
diff --git a/util/robodoc/Source/headers.h b/util/robodoc/Source/headers.h
deleted file mode 100644 (file)
index 8361d8b..0000000
+++ /dev/null
@@ -1,72 +0,0 @@
-#ifndef ROBODOC_HEADERS_H
-#define ROBODOC_HEADERS_H
-
-/****d* ROBODoc/RB_header_types
- * NAME 
- *   RB_header_types -- symbolic constants for the header types.
- * SOURCE
- */
-
-enum
-  {
-    NO_HEADER = 0,
-    MAIN_HEADER,
-    GENERIC_HEADER,
-    INTERNAL_HEADER,
-    FUNCTION_HEADER,
-    STRUCT_HEADER,
-    CLASS_HEADER,
-    METHOD_HEADER,
-    CONSTANT_HEADER,
-    VARIABLE_HEADER,
-    BLANK_HEADER
-  };
-
-/********/
-
-
-/****s* ROBODoc/RB_header [2.0]
- *  NAME
- *    RB_header -- header data structure
- *  MODIFICATION HISTORY
- *    8. August 1995: Koessi
- *                    changed int version to char *version
- *  ATTRIBUTES
- *    next_header 
- *    prev_header 
- *    name          -- 
- *    version       -- unused
- *    type          -- header type see RB_header_types
- *    size          --
- *    function_name --
- *    contents      --
- *  SOURCE
- */
-
-struct RB_header
-  {
-    struct RB_header *next_header;
-    struct RB_header *prev_header;
-    char *name;
-    char *version;
-    int type;
-    int size;
-    char *function_name;
-    char *contents;
-  };
-
-/*********/
-
-extern char *header_markers[];
-extern char *remark_markers[];
-extern char *end_markers[];
-extern char *RB_header_type_names[];
-extern struct RB_header *first_header;
-extern struct RB_header *last_header;
-extern struct RB_link *first_link;
-extern int header_index_size;
-extern struct RB_header **header_index;
-
-#endif /* ROBODOC_HEADERS_H */
-
-
diff --git a/util/robodoc/Source/items.c b/util/robodoc/Source/items.c
deleted file mode 100644 (file)
index 97457dd..0000000
+++ /dev/null
@@ -1,280 +0,0 @@
-#include <stddef.h>
-#include <string.h>
-#include <stdio.h>
-#include "robodoc.h"
-#include "items.h"
-
-/****v* ROBODoc/item_names [3.0g]
- * NAME
- *   item_names
- * SYNOPSIS
- *   char *item_names[]
- * FUNCTION
- *   Defines the names of items that ROBODoc recognized as
- *   items. For each name their is a corresponding 
- *   item type (see ItemType). So if you add a name here
- *   you have to add an item type to. In addition you
- *   have to add an item attribute (see item_attributes) 
- *   entry too.
- * AUTHOR
- *   Koessi
- * SEE ALSO
- *   RB_Get_Item_Type(), item_attributes, item_attr_names,
- * SOURCE
- */
-
-char *item_names[] =
-{
-  NULL,
-  "NAME",
-  /* Item name + short description */
-  "COPYRIGHT",
-  /* who own the copyright : "(c) <year>-<year> by <company/person>" */
-  "SYNOPSIS", "USAGE",
-  /* how to use it */
-  "FUNCTION", "DESCRIPTION", "PURPOSE",
-  /* what does it */
-  "AUTHOR",
-  /* who wrote it */
-  "CREATION DATE",
-  /* when did the work start */
-  "MODIFICATION HISTORY", "HISTORY",
-  /* who done what changes when */
-  "INPUTS", "ARGUMENTS", "OPTIONS", "PARAMETERS", "SWITCHES",
-  /* what can we feed into it */
-  "OUTPUT", "SIDE EFFECTS",
-  /* what output will be made */
-  "RESULT", "RETURN VALUE",
-  /* what do we get returned */
-  "EXAMPLE",
-  /* a clear example of the items use */
-  "NOTES",
-  /* any annotations */
-  "DIAGNOSTICS",
-  /* diagnostical output */
-  "WARNINGS", "ERRORS",
-  /* warning & error-messages */
-  "BUGS",
-  /* known bugs */
-  "TODO", "IDEAS",
-  /* what to implement next & ideas */
-  "PORTABILITY",
-  /* where does it come from, where will it work */
-  "SEE ALSO",
-  /* references */
-  "SOURCE",
-  /* source code inclusion */
-  "METHODS", "NEW METHODS",
-  /* oop methods */
-  "ATTRIBUTES", "NEW ATTRIBUTES",
-  /* oop attributes */
-  "TAGS",
-  /* tagitem description */
-  "COMMANDS",
-  /* command description */
-  "DERIVED FROM",
-  /* oop super class */
-  "DERIVED BY",
-  /* oop sub class */
-  "USES", "CHILDREN",
-  /* what modules are used by this one */
-  "USED BY", "PARENTS",
-  /* which modules do use this */
-  NULL,
-};
-
-/***********/
-
-
-/****v* ROBODoc/item_attributes [3.0h]
- * NAME
- *   item_attributes -- attributes of the various items
- * FUNCTION
- *   links each item type with a text attribute.
- * SEE ALSO
- *   RB_Get_Item_Type(), item_names, item_attr_names
- * SOURCE
- */
-
-long item_attributes[NUMBER_OF_ITEMS] =
-{
-  0,                           /* NO_ITEM */
-  ITEM_NAME_LARGE_FONT | TEXT_BODY_SHINE,      /* NAME_ITEM */
-  ITEM_NAME_LARGE_FONT,                /* COPYRIGHT_ITEM */
-  ITEM_NAME_LARGE_FONT | TEXT_BODY_SHINE,      /* SYNOPSIS_ITEM */
-  ITEM_NAME_LARGE_FONT,                /* USAGE_ITEM */
-  ITEM_NAME_LARGE_FONT,                /* FUNCTION_ITEM */
-  ITEM_NAME_LARGE_FONT | TEXT_BODY_DEFAULT,            /* DESCRIPTION_ITEM */
-  ITEM_NAME_LARGE_FONT,                /* PURPOSE_ITEM */
-  ITEM_NAME_LARGE_FONT | TEXT_BODY_BOLD,       /* AUTHOR_ITEM */
-  ITEM_NAME_LARGE_FONT | TEXT_BODY_BOLD,       /* CREATION_DATE_ITEM */
-  ITEM_NAME_LARGE_FONT,                /* MODIFICATION_HISTORY_ITEM */
-  ITEM_NAME_LARGE_FONT,                /* HISTORY_ITEM */
-  ITEM_NAME_LARGE_FONT,                /* INPUT_ITEM */
-  ITEM_NAME_LARGE_FONT,                /* ARGUMENT_ITEM */
-  ITEM_NAME_LARGE_FONT,                /* OPTION_ITEM */
-  ITEM_NAME_LARGE_FONT,                /* PARAMETER_ITEM */
-  ITEM_NAME_LARGE_FONT,                /* SWITCH_ITEM */
-  ITEM_NAME_LARGE_FONT,                /* OUTPUT_ITEM */
-  ITEM_NAME_LARGE_FONT,                /* SIDE_EFFECTS_ITEM */
-  ITEM_NAME_LARGE_FONT,                /* RESULT_ITEM */
-  ITEM_NAME_LARGE_FONT,                /* RETURN_VALUE_ITEM */
-  ITEM_NAME_LARGE_FONT | TEXT_BODY_SHINE,              /* EXAMPLE_ITEM */
-  ITEM_NAME_LARGE_FONT | TEXT_BODY_DEFAULT,    /* NOTE_ITEM */
-  ITEM_NAME_LARGE_FONT,                /* DIAGNOSTICS_ITEM */
-  ITEM_NAME_LARGE_FONT,                /* WARNING_ITEM */
-  ITEM_NAME_LARGE_FONT,                /* ERROR_ITEM */
-  ITEM_NAME_LARGE_FONT | TEXT_BODY_SHINE,      /* BUGS_ITEM */
-  ITEM_NAME_LARGE_FONT,                /* TODO_ITEM */
-  ITEM_NAME_LARGE_FONT,                /* IDEAS_ITEM */
-  ITEM_NAME_LARGE_FONT,                /* PORTABILITY_ITEM */
-  ITEM_NAME_LARGE_FONT,                /* SEE_ALSO_ITEM */
-  ITEM_NAME_LARGE_FONT | TEXT_BODY_SHINE,              /* SOURCE_ITEM */
-  ITEM_NAME_LARGE_FONT,                /* METHODS_ITEM */
-  ITEM_NAME_LARGE_FONT,                /* NEW_METHODS_ITEM */
-  ITEM_NAME_LARGE_FONT,                /* ATTRIBUTES_ITEM */
-  ITEM_NAME_LARGE_FONT,                /* NEW_ATTRIBUTES_ITEM */
-  ITEM_NAME_LARGE_FONT,                /* TAGS_ITEM */
-  ITEM_NAME_LARGE_FONT,                /* COMMANDS_ITEM */
-  ITEM_NAME_LARGE_FONT,                /* DERIVED_FROM_ITEM */
-  ITEM_NAME_LARGE_FONT,                /* DERIVED_BY_ITEM */
-  ITEM_NAME_LARGE_FONT,                /* USES_ITEM */
-  ITEM_NAME_LARGE_FONT,                /* CHILDREN */
-  ITEM_NAME_LARGE_FONT,                /* USED_BY_ITEM */
-  ITEM_NAME_LARGE_FONT,                /* PARENTS */
-  0                            /* OTHER_ITEM */
-};
-
-/**********/
-
-
-/****v* ROBODoc/item_attr_names [3.0j]
- * NAME
- *   item_attr_names
- * SYNOPSIS
- *   char *item_attr_names[]
- * FUNCTION
- *   used for strcmp() in RB_Get_Item_Attr()
- * AUTHOR
- *   Koessi
- * SEE ALSO
- *   RB_Get_Item_Attr(), item_attributes, item_names
- * SOURCE
- */
-
-char *item_attr_names[] =
-{
-/* "NORMAL", */
-  "LARGE", "ITALICS", "NONPROP", "SMALL", "BOLD",
-  "UNDERLINE", "SHINE", "HIGHLIGHT", "DEFAULT",
-};
-
-/*************/
-
-
-/* ASCII AMIGAGUIDE HTML LATEX RTF */
-
-char *att_start_command[SIZE_ATTRIBUTES][SIZE_MODES] =
-{
-  {"", "@{b}", "<FONT SIZE=\"+1\">", "{\\large ", "\\par\\fs28 "}, /* Large Font */
-  {"", "@{i}", "<I>", "{\\it ", "\\i1 "},      /* Italics. */
-  {"", "", "", "", ""},                /* NON-Proportional font. */
-  {"", "", "<SMALL>", "{\\small ", "\\fs16 "}, /* Small Font. */
-  {"", "@{b}", "<B>", "{\\bf ", "\\b1 "},      /* Bold. */
-  {"", "@{u}", "<U>", "\\underline{", "\\ul1 "},       /* Underline */
-  {"", "@{fg shine}", "<FONT FACE=\"courier\" size=\"3\">", "{\\em ", ""},/* Shine */
-  {"", "@{fg highlight}", "<EM>", "{\\em ", ""},               /* Highlight */
-  {"", "", "<FONT FACE=\"Helvetiva,Arial,Sans-serif\">", "", ""}               /* Default */
-};
-
-char *att_stop_command[SIZE_ATTRIBUTES][SIZE_MODES] =
-{
-  {"", "@{ub}", "</FONT>", "}", "\\fs20\\line "},      /* Large Font */
-  {"", "@{ui}", "</I>", "}", "\\i0 "}, /* Italics. */
-  {"", "", "", "", ""},                /* NON-Proportional font. */
-  {"", "", "</SMALL>", "}", "\\fs20 "},                /* Small Font. */
-  {"", "@{ub}", "</B>", "}", "\\b0 "}, /* Bold. */
-  {"", "@{uu}", "</U>", "}", "\\ul0 "},                /* Underline */
-  {"", "@{fg text}", "</FONT>", "}", ""},              /* Shine */
-  {"", "@{fg text}", "</EM>", "}", ""},        /* Highlight */
-  {"", "", "</FONT>", "", ""}  /* Normal */
-};
-
-
-
-/****f* ROBODoc/RB_Get_Item_Type [3.0b]
- * NAME
- *   RB_Get_Item_Type -- shortcut
- * SYNOPSIS
- *   int RB_Get_Item_Type( char *cmp_name )
- * FUNCTION
- *   return the item_type represented by the given string
- * INPUTS
- *   char *cmp_name          -- item_name to evaluate
- * RESULT
- *   int                     -- the right item_type or NO_ITEM
- * NOTES
- *   uses global char *item_names[]
- * AUTHOR
- *   Koessi
- * SEE ALSO
- *   RB_Analyse_Defaults_File(), RB_Get_Item_Attr()
- * SOURCE
- */
-
-int
-RB_Get_Item_Type (char *cmp_name)
-{
-  int item_type;
-
-  for (item_type = NAME_ITEM; item_type < OTHER_ITEM; ++item_type)
-    {
-      if (!strncmp (item_names[item_type], cmp_name,
-                   strlen (item_names[item_type])))
-       return (item_type);
-    }
-  return (NO_ITEM);
-}
-
-/*** RB_Get_Item_Type ***/
-
-
-
-/****f* ROBODoc/RB_Get_Item_Attr [3.0b]
- *
- * NAME
- *   RB_Get_Item_Attr -- shortcut
- * SYNOPSIS
- *   int RB_Get_Item_Attr( char *cmp_name )
- * FUNCTION
- *   return the item_attr represented by the given string
- * INPUTS
- *   char *cmp_name  -- item_attr_name to evaluate
- * RESULT
- *   int             -- the right item_attr or NULL
- * NOTES
- *   uses global char *item_attr_names[]
- * AUTHOR
- *   Koessi
- * SEE ALSO
- *   RB_Analyse_Defaults_File(), RB_Get_Item_Type()
- * SOURCE
- */
-
-int
-RB_Get_Item_Attr (char *cmp_name)
-{
-  int item_attr;
-
-  for (item_attr = MAKE_LARGE; item_attr < SIZE_ATTRIBUTES; ++item_attr)
-    if (!strcmp (item_attr_names[item_attr], cmp_name))
-      return (item_attr);
-  if (strcmp ("NORMAL", cmp_name))
-    {
-      fprintf (stderr, "%s: Warning unknown attribute [%s] in defaults file.\n",
-              whoami, cmp_name);
-    }
-  return (MAKE_NORMAL);
-}
-
-/************/
diff --git a/util/robodoc/Source/items.h b/util/robodoc/Source/items.h
deleted file mode 100644 (file)
index 071c768..0000000
+++ /dev/null
@@ -1,83 +0,0 @@
-
-
-
-#ifndef ROBODOC_ITEMS_H
-#define ROBODOC_ITEMS_H
-
-enum
-  {
-    MAKE_NORMAL = -1, MAKE_LARGE, MAKE_ITALICS, MAKE_NON_PROP, MAKE_SMALL,
-    MAKE_BOLD, MAKE_UNDERLINE, MAKE_SHINE, MAKE_HIGH, MAKE_DEFAULT,
-    SIZE_ATTRIBUTES
-  };
-
-#define ITEM_NAME_LARGE_FONT (1<<0)
-#define TEXT_BODY_LARGE_FONT (1<<(MAKE_LARGE     + 1))
-#define TEXT_BODY_ITALICS    (1<<(MAKE_ITALICS   + 1))
-#define TEXT_BODY_NON_PROP   (1<<(MAKE_NON_PROP  + 1))
-#define TEXT_BODY_SMALL_FONT (1<<(MAKE_SMALL     + 1))
-#define TEXT_BODY_BOLD       (1<<(MAKE_BOLD      + 1))
-#define TEXT_BODY_UNDERLINE  (1<<(MAKE_UNDERLINE + 1))
-#define TEXT_BODY_SHINE      (1<<(MAKE_SHINE     + 1))
-#define TEXT_BODY_HIGHLIGHT  (1<<(MAKE_HIGH      + 1))
-#define TEXT_BODY_DEFAULT    (1<<(MAKE_DEFAULT   + 1))
-
-
-/****** ROBODoc/ItemTypes *
- * NAME 
- *   ItemTypes -- enumeration of item types
- * FUNCTION
- *   Give an unique number to each item type. This defines all item types that
- *   are recognized by ROBODoc. The corresponding names (string) of each item
- *   are defined in item_names.  If you add an item here you also should
- *   add an corresponding item name.  
- * SOURCE
- */
-
-enum
-  {
-    NO_ITEM = 0,
-    NAME_ITEM,
-    COPYRIGHT_ITEM,
-    SYNOPSIS_ITEM, USAGE_ITEM,
-    FUNCTION_ITEM, DESCRIPTION_ITEM, PURPOSE_ITEM,
-    AUTHOR_ITEM,
-    CREATION_DATE_ITEM,
-    MODIFICATION_HISTORY_ITEM, HISTORY_ITEM,
-    INPUT_ITEM, ARGUMENT_ITEM, OPTION_ITEM, PARAMETER_ITEM, SWITCH_ITEM,
-    OUTPUT_ITEM, SIDE_EFFECTS_ITEM,
-    RESULT_ITEM, RETURN_VALUE_ITEM,
-    EXAMPLE_ITEM,
-    NOTE_ITEM,
-    DIAGNOSTICS_ITEM,
-    WARNING_ITEM, ERROR_ITEM,
-    BUGS_ITEM,
-    TODO_ITEM, IDEAS_ITEM,
-    PORTABILITY_ITEM,
-    SEE_ALSO_ITEM,
-    SOURCE_ITEM,
-    METHODS_ITEM, NEW_METHODS_ITEM,
-    ATTRIBUTES_ITEM, NEW_ATTRIBUTES_ITEM,
-    TAGS_ITEM,
-    COMMANDS_ITEM,
-    DERIVED_FROM_ITEM,
-    DERIVED_BY_ITEM,
-    USES_ITEM, CHILDREN_ITEM,
-    USED_BY_ITEM, PARENTS_ITEM,
-    OTHER_ITEM,
-    NUMBER_OF_ITEMS
-  };
-
-/****/
-
-extern char *item_names[];
-extern long item_attributes[NUMBER_OF_ITEMS];
-extern char *item_attr_names[];
-extern char *att_start_command[SIZE_ATTRIBUTES][SIZE_MODES];
-extern char *att_stop_command[SIZE_ATTRIBUTES][SIZE_MODES];
-
-int RB_Get_Item_Type (char *);
-int RB_Get_Item_Attr (char *cmp_name);
-
-
-#endif /* ROBODOC_ITEMS_H */
diff --git a/util/robodoc/Source/links.c b/util/robodoc/Source/links.c
deleted file mode 100644 (file)
index 7609a6d..0000000
+++ /dev/null
@@ -1,442 +0,0 @@
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <ctype.h>
-#include "robodoc.h"
-#include "headers.h"
-#include "util.h"
-#include "links.h"
-#include "folds.h"
-
-
-FILE *xreffiles_file = NULL;
-FILE *xref_file = NULL;
-int link_index_size = 0;
-struct RB_link **link_index = NULL;
-
-/****f* ROBODoc/RB_Analyse_Xrefs [3.0b]
- * NAME
- *   RB_Analyse_Xrefs -- scan the xref files.
- * SYNOPSIS
- *   RB_Analyse_Xrefs (xreffiles_file)
- *   RB_Analyse_Xrefs (FILE *)
- * FUNCTION
- *   Scan the file xreffiles_file. This file contains the
- *   names of one or more xref files. All the references in the
- *   files are scaned and stored in a link list of the type
- *   RB_link. These xref files can be generated with robodoc.
- * INPUTS
- *   xreffiles_file - a file pointer to the file with xref file
- *   names.
- * RESULT
- *   none
- * BUGS
- *   Might fail if there are syntax errors in one of the xref
- *   files.
- *   Bad use of feof() and fgets().
- * SEE ALSO
- *   RB_Generate_xrefs, RB_Add_Link
- * SOURCE
- */
-
-void
-RB_Analyse_Xrefs (FILE * xreffiles_file)
-{
-  while (!feof (xreffiles_file))
-    {
-      fgets (line_buffer, MAX_LINE_LEN, xreffiles_file);
-      if (!feof (xreffiles_file))
-       {
-         char *cur_char;
-
-         cur_char = line_buffer;
-         find_eol;
-         if (*cur_char == '\n')
-           *cur_char = '\0';
-         if (strlen (line_buffer) > 1)
-           {
-             for (cur_char--;
-                  (cur_char != line_buffer) && isspace (*cur_char);
-                  cur_char--)
-               *cur_char = '\0';
-             if ((xref_file = fopen (line_buffer, "r")) != NULL)
-               {
-                 int xrefs_found = FALSE;
-                 int end_of_xrefs = FALSE;
-
-                 while (!feof (xref_file) && !xrefs_found)
-                   {
-                     fgets (line_buffer, MAX_LINE_LEN, xref_file);
-                     if (!feof (xref_file) && !strncmp ("XREF:",
-                                                        line_buffer, 5))
-                       xrefs_found = TRUE;
-                   }
-
-                 while (!feof (xref_file) && !end_of_xrefs)
-                   {
-                     fgets (line_buffer, MAX_LINE_LEN, xref_file);
-                     if (!feof (xref_file))
-                       {
-                         cur_char = line_buffer;
-                         find_quote;
-                         if (*cur_char == '\"')
-                           RB_Add_Link ();
-                         else
-                           end_of_xrefs = TRUE;
-                       }
-                   }
-                 fclose (xref_file);
-                 xref_file = NULL;
-               }
-             else
-               RB_Panic ("could not open xref file \"%s\"\n", line_buffer);
-           }
-       }
-    }
-}
-
-/*************/
-
-
-/****f* ROBODoc/RB_Slow_Sort_Links
- * NAME
- *   RB_Slow_Sort_Links -- sort all links according to label name.
- ******
- */
-
-void
-RB_Slow_Sort_Links (void)
-{
-  struct RB_link *cur_link, *unsorted_links, *bigger_link;
-
-  if ((unsorted_links = first_link) != NULL)
-    {                          /* additional check koessi */
-      for (first_link = NULL;
-          unsorted_links->next_link;)
-       {
-         for (bigger_link = unsorted_links,
-              cur_link = bigger_link->next_link;
-              cur_link;
-              cur_link = cur_link->next_link)
-           {
-             if (strcmp (cur_link->label_name, bigger_link->label_name) > 0)
-               bigger_link = cur_link;
-           }
-         RB_Remove_From_List ((struct RB_header **) &unsorted_links,
-                              (struct RB_header *) bigger_link);
-         RB_Insert_In_List ((struct RB_header **) &first_link,
-                            (struct RB_header *) bigger_link);
-       }
-      RB_Insert_In_List ((struct RB_header **) &first_link,
-                        (struct RB_header *) unsorted_links);
-    }
-}
-
-
-/****f* ROBODoc/RB_Add_Link [3.0b]
- * NAME
- *   RB_Add_Link -- add a reference link to the list
- * SYNOPSIS
- *   void RB_Add_Link ()
- * FUNCTION
- *   Adds a reference from a xref file to the linked list
- *   with references.
- * INPUTS
- *   Uses the global variable line_buffer and first_link.
- * NOTES
- *   Makes sneaky use of the function RB_Insert_In_List.
- * SEE ALSO
- *   RB_Analyse_Xrefs, RB_link.
- * SOURCE
- */
-
-void
-RB_Add_Link ()
-{
-  char *label_name, *file_name;
-  struct RB_link *new_link;
-  char *cur_char = line_buffer;
-
-  find_quote;
-  label_name = ++cur_char;
-  find_quote;
-  *cur_char++ = '\0';
-  find_quote;
-  file_name = ++cur_char;
-  find_quote;
-  *cur_char = '\0';
-  ++cur_char;
-
-  RB_Say ("adding xref link \"%s\"->\"%s\"\n", label_name, file_name);
-
-  new_link = RB_Alloc_Link (label_name, file_name);
-  new_link->type = atoi (cur_char);
-  RB_Insert_In_List ((struct RB_header **) &first_link,
-                    (struct RB_header *) new_link);
-}
-
-/*** RB_Add_Link ***/
-
-
-
-/****f* ROBODoc/RB_Generate_xrefs [2.0]
- * NAME
- *   RB_Generate_xrefs
- * SYNOPSIS
- *   RB_Generate_xrefs (dest_doc, source_name, dest_name)
- *
- *   RB_Generate_xrefs (FILE *, char *, char *)
- * FUNCTION
- *   Generates a xref file for the document that has been
- *   analysed by ROBODoc.
- * INPUTS
- *   dest_doc    - pointer to the file to which the xrefs will be
- *                 written.
- *   source_name - pointer to the name of the document that has
- *                 been analysed by robodoc
- *   dest_name   - pointer to the name of the document robodoc will
- *                 write the documentation to.
- *   first_header - global variable, the list with function
- *                 headers.
- * SOURCE
- */
-
-void
-RB_Generate_xrefs (FILE * dest_doc, char *source_name, char *dest_name)
-{
-  struct RB_header *cur_header;
-
-  fprintf (dest_doc, "/* XREF-File generated by ROBODoc v" VERSION
-          " */\n");
-  fprintf (dest_doc, "\nXREF:\n");
-  fprintf (dest_doc, " \"%s\" \"%s\" 0\n", source_name, dest_name);
-  for (cur_header = first_header;
-       cur_header;
-       cur_header = cur_header->next_header
-    )
-    {
-      if (cur_header->function_name)
-       fprintf (dest_doc, " \"%s\" \"%s\" %d\n",
-                cur_header->function_name, dest_name, cur_header->type);
-    }
-  fprintf (dest_doc, "\n/* End of XREF-File */\n");
-}
-
-/*** RB_Generate_xrefs ***/
-
-
-
-/****f* ROBODoc/RB_Find_Link [3.0h]
- * NAME
- *   RB_Find_Link -- try to match word with a link
- * SYNOPSIS
- *   result = RB_Find_Link (word_begin, label_name, file_name)
- *   int      RB_Find_Link (char *,     char **,    char **)
- * FUNCTION
- *   Searches for the given word in the list of links and
- *   headers.  There are three passes (or four, when the C option
- *   is selected). Each pass uses a different definition of "word".
- *   In the first pass it is any thing that ends with a 'space', a '.' 
- *   or a ','.
- *   In the second pass it is any string that consists of alpha
- *   numerics, '_', ':', '.', or '-'.  
- *   In the third pass (for C) it is any string that consists 
- *   of alpha numerics or '_'.
- *   In the last pass it is any string that consists of alpha
- *   numerics.
- * INPUTS
- *   word_begin  - pointer to a word (a string).
- *   label_name  - pointer to a pointer to a string
- *   file_name   - pointer to a pointer to a string
- * SIDE EFFECTS
- *   label_name & file_name are modified
- * RESULT
- *   label_name    -- points to the label if a match was found,
- *                    NULL otherwise.
- *   file_name     -- points to the file name if a match was found,
- *                    NULL otherwise.
- *   TRUE          -- a match was found.
- *   FALSE         -- no match was found.
- * NOTES
- *   This is a rather sensitive algorithm.
- * BUGS
- ******
- */
-
-int
-RB_Find_Link (char *word_begin, char **label_name, char **file_name)
-{
-  char *cur_char, old_char;
-  int low_index, high_index, cur_index, state, pass;
-
-
-  for (pass = 0; pass < 4; pass++)
-    {
-
-      switch (pass)
-       {
-       case 0:
-         {
-           for (cur_char = word_begin;
-                isalnum (*cur_char) || ispunct (*cur_char);
-                cur_char++);
-           if (((*(cur_char-1)) == ',') || ((*(cur_char-1)) == '.')) 
-             cur_char--;
-           break;
-         }
-       case 1:
-         {
-           for (cur_char = word_begin;
-                isalnum (*cur_char) || (*cur_char == '_') ||
-                (*cur_char == '-') || (*cur_char == '.') ||
-                (*cur_char == ':');
-                cur_char++);
-           break;
-         }
-       case 2:
-         {
-           if (extra_flags & C_MODE) {
-          for (cur_char = word_begin;
-                  isalnum(*cur_char) || (*cur_char  == '_');
-                  cur_char++);
-             break;
-               }
-           else continue;
-         }
-       case 3:
-         {
-           for (cur_char = word_begin;
-                isalnum (*cur_char);
-                cur_char++);
-           break;
-         }
-       }
-
-      old_char = *cur_char;
-      *cur_char = '\0';                /* End the word with a '\0' */
-/*      RB_Say ("Testing \"%s\"\n", word_begin); */
-
-      /* Search in header table */
-      for (cur_index = 0, low_index = 0, high_index = header_index_size - 1;
-          high_index >= low_index;)
-       {
-         cur_index = (high_index - low_index) / 2 + low_index;
-         state = strcmp (word_begin, header_index[cur_index]->function_name);
-         if (state < 0)
-           high_index = cur_index - 1;
-         else if (state > 0)
-           low_index = cur_index + 1;
-         else
-           {
-             *label_name = header_index[cur_index]->function_name;
-             *file_name = NULL;
-              RB_Say ("linking \"%s\"->\"%s\"\n", word_begin, *label_name);
-             *cur_char = old_char;
-             return (TRUE);
-           }
-       }
-
-      /* Search in the link table */
-      for (cur_index = 0, low_index = 0, high_index = link_index_size - 1;
-          high_index >= low_index;)
-       {
-         cur_index = (high_index - low_index) / 2 + low_index;
-         state = strcmp (word_begin, link_index[cur_index]->label_name);
-         if (state < 0)
-           {
-             high_index = cur_index - 1;
-           }
-         else if (state == 0)
-           {
-             *label_name = link_index[cur_index]->label_name;
-             *file_name = link_index[cur_index]->file_name;
-              RB_Say ("linking \"%s\"->\"%s\" form \"%s\"\n",
-                              word_begin, *label_name, *file_name);
-             *cur_char = old_char;
-             return (TRUE);
-           }
-         else if (state > 0)
-           {
-             low_index = cur_index + 1;
-           }
-       }
-      *cur_char = old_char;
-      *file_name = NULL;
-      *label_name = NULL;
-    }
-
-  return (FALSE);
-}
-
-
-
-
-
-/****f* ROBODoc/RB_Alloc_Link [2.01]
- * NAME
- *   RB_Alloc_Link              -- oop
- * SYNOPSIS
- *   struct RB_link *RB_Alloc_Link( char *label_name, char *file_name )
- * FUNCTION
- *   allocate struct + strings
- * INPUTS
- *   char *label_name -- strings to copy into the link
- *   char *file_name
- * RESULT
- *   struct RB_link *  -- ready-to-use
- * AUTHOR
- *   Koessi
- * SEE ALSO
- *   RB_StrDup(), RB_Free_Link()
- *******
- */
-
-struct RB_link *
-RB_Alloc_Link (char *label_name, char *file_name)
-{
-  struct RB_link *new_link;
-  if ((new_link = malloc (sizeof (struct RB_link))) != NULL)
-    {
-      memset (new_link, 0, sizeof (struct RB_link));
-
-      if (file_name)
-       new_link->file_name = RB_StrDup (file_name);
-      if (label_name)
-       new_link->label_name = RB_StrDup (label_name);
-    }
-  else
-    RB_Panic ("out of memory! [Alloc Link]\n");
-
-  return (new_link);
-}
-
-
-/****f* ROBODoc/RB_Free_Link [2.01]
- * NAME
- *   RB_Free_Link               -- oop
- * SYNOPSIS
- *   void RB_Free_Link( struct RB_link *link )
- * FUNCTION
- *   free struct + strings
- * INPUTS
- *   struct RB_link *link
- * AUTHOR
- *   Koessi
- * SEE ALSO
- *   RB_Alloc_Link(), RB_Close_The_Shop()
- * SOURCE
- ******
- */
-
-void
-RB_Free_Link (struct RB_link *link)
-{
-  if (link)
-    {
-      if (link->label_name)
-       free (link->label_name);
-      if (link->file_name)
-       free (link->file_name);
-      free (link);
-    }
-}
diff --git a/util/robodoc/Source/links.h b/util/robodoc/Source/links.h
deleted file mode 100644 (file)
index b727a28..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-
-
-#ifndef ROBODOC_LINKS_H
-#define ROBODOC_LINKS_H
-
-/****s* ROBODoc/RB_link [2.0e]
- *  NAME
- *    RB_link -- link data structure
- *  PURPOSE
- *    Structure to store links to the documentation of an component. 
- *  PROPERTIES
- *    next_link
- *    prev_link
- *    label_name  -- the label under which the component can be found.
- *    file_name   -- the file the component can be found in.
- *    type        -- the type of component (the header type).
- *  SOURCE
- */
-
-struct RB_link
-  {
-    struct RB_link *next_link;
-    struct RB_link *prev_link;
-    char *label_name;
-    char *file_name;
-    int type;
-  };
-
-/*********/
-
-extern FILE *xreffiles_file;
-extern FILE *xref_file;
-extern int link_index_size;
-extern struct RB_link **link_index;
-
-void RB_Analyse_Xrefs (FILE * xreffiles_file);
-void RB_Add_Link ();
-void RB_Generate_xrefs (FILE * dest_doc, char *source_name, char *dest_name);
-int RB_Find_Link (char *word_begin, char **label_name, char **file_name);
-struct RB_link *RB_Alloc_Link (char *label_name, char *file_name);
-void RB_Free_Link (struct RB_link *link);
-void RB_Slow_Sort_Links (void);
-
-#endif /* ROBODOC_LINKS_H */
diff --git a/util/robodoc/Source/makefile.am b/util/robodoc/Source/makefile.am
deleted file mode 100644 (file)
index 4e13caa..0000000
+++ /dev/null
@@ -1,140 +0,0 @@
-## Process this file with automake to produce Makefile.in
-#
-#
-
-bin_PROGRAMS = robodoc
-robodoc_SOURCES = analyser.c analyser.h config.h folds.c folds.h \
-     generator.c generator.h headers.c headers.h items.c items.h \
-     links.c links.h robodoc.c robodoc.h util.c util.h
-
-
-###############################################################
-
-ROBODOC=./robodoc
-ROBOOPTS=C SORT -v
-BROWSER=netscape
-
-# Your source files.
-#
-SOURCES=analyser.c generator.c items.c util.c \
-  folds.c headers.c links.c robodoc.c \
-  analyser.h generator.h items.h util.h \
-  folds.h headers.h links.h robodoc.h
-
-# The name of your Project
-#
-PROJECT=ROBODoc
-
-# The various documentation files, derived from the source files.
-# HTML
-#
-HTMLDOCS=$(SOURCES:=.html)
-HTMLXREFS=$(HTMLDOCS:.html=.html.xref)
-HTMLXREFSFILE=$(PROJECT)_html.xrefs
-# LATEX
-#
-LATEXDOCS=$(SOURCES:=.tex)
-LATEXXREFS=$(LATEXDOCS:.tex=.tex.xref)
-LATEXXREFSFILE=$(PROJECT)_tex.xrefs
-# ASCII
-#
-ASCIIDOCS=$(SOURCES:=.txt)
-# RTF
-#
-RTFDOCS=$(SOURCES:=.rtf)
-RTFXREFS=$(RTFDOCS:.rtf=.rtf.xref)
-RTFXREFSFILE=$(PROJECT)_rtf.xrefs
-
-# Some common targets
-xrefall: xrefhtml xreftex xrefrtf
-docall: html tex ascii rtf
-
-# Create the xref files for the various formats.
-xhtml: $(HTMLXREFSFILE) 
-xtex: $(LATEXXREFSFILE) 
-xrtf: $(RTFXREFSFILE)
-
-# Create the documentation files for the various formats.
-html: $(HTMLDOCS) $(PROJECT)_mi.html 
-tex: $(LATEXDOCS) $(PROJECT)_mi.tex
-rtf: $(RTFDOCS)
-ascii: $(ASCIIDOCS)
-
-# master index file, currently works only for html and latex documentation.
-$(PROJECT)_mi.html: $(HTMLXREFSFILE) 
-       $(ROBODOC) $< $@ INDEX HTML TITLE "$(PROJECT) Master Index"
-
-$(PROJECT)_mi.tex: $(LATEXXREFSFILE)
-       $(ROBODOC) $< $@ INDEX LATEX TITLE "$(PROJECT) API Reference"
-
-# create xrefs file (file with the names of all .xref files).
-$(HTMLXREFSFILE) : $(HTMLXREFS)
-       /bin/ls $(HTMLXREFS) > $@
-$(LATEXXREFSFILE) : $(LATEXXREFS)
-       /bin/ls  $(LATEXXREFS) > $@
-$(RTFXREFSFILE) : $(RTFXREFS)
-       /bin/ls  $(RTFXREFS) > $@
-
-# Rule to create an .xref file from a source file for the various formats.
-%.html.xref : %
-       $(ROBODOC) $< $(@:.xref=) $(ROBOOPTS) INTERNAL GENXREF $@
-%.tex.xref : %
-       $(ROBODOC) $< $(@:.xref=) $(ROBOOPTS) INTERNAL GENXREF $@
-%.rtf.xref : %
-       $(ROBODOC) $< $(@:.xref=) $(ROBOOPTS) INTERNAL GENXREF $@
-
-# Rule to create html documentation from a source file.
-%.html : %
-       $(ROBODOC) $< $@ HTML $(ROBOOPTS) XREF $(HTMLXREFSFILE)
-
-# Rule to create latex documentation from a source file.
-# We do not include source items, and generate laxtex documents
-# than can be included in a master document.
-%.tex : %
-       $(ROBODOC) $< $@ LATEX $(ROBOOPTS) NOSOURCE SINGLEDOC XREF $(LATEXXREFSFILE)
-
-# Rule to create ascii documentation from a source file.
-%.txt : %
-       $(ROBODOC) $< $@ ASCII 
-
-# Rule to create rtf documentation from a source file.
-%.rtf : %
-       $(ROBODOC) $< $@ RTF $(ROBOOPTS) XREF $(RTFXREFSFILE)
-
-# Use netscape to view the master index file for our project.
-example: html
-       $(BROWSER) $(PROJECT)_mi.html
-
-# Use the latex programs to generate a .dvi from the master index file
-# for our prokect. View this .dvi file with xdvi
-texview:  tex
-       latex $(PROJECT)_mi
-       makeindex $(PROJECT)_mi
-       latex $(PROJECT)_mi
-       latex $(PROJECT)_mi
-       dvips $(PROJECT)_mi.dvi -o $(PROJECT)_mi.ps
-
-# Clean-up the mess we made
-#
-myclean:
-       rm -f $(HTMLXREFS) 
-       rm -f $(HTMLDOCS) 
-       rm -f $(LATEXXREFS)
-       rm -f $(LATEXDOCS) 
-       rm -f $(PROJECT)_mi.* *.aux
-       rm -f $(RTFXREFS)
-       rm -f $(RTFDOCS)
-       rm -f $(ASCIIDOCS)
-       rm -f $(HTMLXREFSFILE) 
-       rm -f $(LATEXXREFSFILE) 
-       rm -f $(RTFXREFSFILE)
-       rm -f robodoc makefile.in makefile
-       rm -f *~ stamp-h stamp-h.in
-       rm -f *.o *.tex *.toc *.dvi *.aux *.log *.ps
-       rm -f masterindex.html
-       rm -f testheaders.html
-
-tt:
-       cp robodoc $(HOME)/Test
-
-
diff --git a/util/robodoc/Source/makefile.in b/util/robodoc/Source/makefile.in
deleted file mode 100644 (file)
index bce003f..0000000
+++ /dev/null
@@ -1,437 +0,0 @@
-# makefile.in generated automatically by automake 1.4 from makefile.am
-
-# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
-# This Makefile.in is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
-#
-#
-
-
-SHELL = @SHELL@
-
-srcdir = @srcdir@
-top_srcdir = @top_srcdir@
-VPATH = @srcdir@
-prefix = @prefix@
-exec_prefix = @exec_prefix@
-
-bindir = @bindir@
-sbindir = @sbindir@
-libexecdir = @libexecdir@
-datadir = @datadir@
-sysconfdir = @sysconfdir@
-sharedstatedir = @sharedstatedir@
-localstatedir = @localstatedir@
-libdir = @libdir@
-infodir = @infodir@
-mandir = @mandir@
-includedir = @includedir@
-oldincludedir = /usr/include
-
-DESTDIR =
-
-pkgdatadir = $(datadir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-
-top_builddir = ..
-
-ACLOCAL = @ACLOCAL@
-AUTOCONF = @AUTOCONF@
-AUTOMAKE = @AUTOMAKE@
-AUTOHEADER = @AUTOHEADER@
-
-INSTALL = @INSTALL@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS)
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-transform = @program_transform_name@
-
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-CC = @CC@
-MAKEINFO = @MAKEINFO@
-PACKAGE = @PACKAGE@
-VERSION = @VERSION@
-
-bin_PROGRAMS = robodoc
-robodoc_SOURCES = analyser.c analyser.h config.h folds.c folds.h      generator.c generator.h headers.c headers.h items.c items.h      links.c links.h robodoc.c robodoc.h util.c util.h
-
-
-###############################################################
-
-ROBODOC = ./robodoc
-ROBOOPTS = C SORT -v
-BROWSER = netscape
-
-# Your source files.
-#
-SOURCES = analyser.c generator.c items.c util.c   folds.c headers.c links.c robodoc.c   analyser.h generator.h items.h util.h   folds.h headers.h links.h robodoc.h
-
-
-# The name of your Project
-#
-PROJECT = ROBODoc
-
-# The various documentation files, derived from the source files.
-# HTML
-#
-HTMLDOCS = $(SOURCES:=.html)
-HTMLXREFS = $(HTMLDOCS:.html=.html.xref)
-HTMLXREFSFILE = $(PROJECT)_html.xrefs
-# LATEX
-#
-LATEXDOCS = $(SOURCES:=.tex)
-LATEXXREFS = $(LATEXDOCS:.tex=.tex.xref)
-LATEXXREFSFILE = $(PROJECT)_tex.xrefs
-# ASCII
-#
-ASCIIDOCS = $(SOURCES:=.txt)
-# RTF
-#
-RTFDOCS = $(SOURCES:=.rtf)
-RTFXREFS = $(RTFDOCS:.rtf=.rtf.xref)
-RTFXREFSFILE = $(PROJECT)_rtf.xrefs
-mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
-CONFIG_HEADER = config.h
-CONFIG_CLEAN_FILES = 
-PROGRAMS =  $(bin_PROGRAMS)
-
-
-DEFS = @DEFS@ -I. -I$(srcdir) -I.
-CPPFLAGS = @CPPFLAGS@
-LDFLAGS = @LDFLAGS@
-LIBS = @LIBS@
-robodoc_OBJECTS =  analyser.o folds.o generator.o headers.o items.o \
-links.o robodoc.o util.o
-robodoc_LDADD = $(LDADD)
-robodoc_DEPENDENCIES = 
-robodoc_LDFLAGS = 
-CFLAGS = @CFLAGS@
-COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-CCLD = $(CC)
-LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@
-DIST_COMMON =  ./stamp-h.in config.h.in makefile.am makefile.in
-
-
-DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
-
-TAR = gtar
-GZIP_ENV = --best
-SOURCES = $(robodoc_SOURCES)
-OBJECTS = $(robodoc_OBJECTS)
-
-all: all-redirect
-.SUFFIXES:
-.SUFFIXES: .S .c .o .s
-$(srcdir)/makefile.in: makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) 
-       cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps Source/makefile
-
-makefile: $(srcdir)/makefile.in  $(top_builddir)/config.status
-       cd $(top_builddir) \
-         && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
-
-
-config.h: stamp-h
-       @if test ! -f $@; then \
-               rm -f stamp-h; \
-               $(MAKE) stamp-h; \
-       else :; fi
-stamp-h: $(srcdir)/config.h.in $(top_builddir)/config.status
-       cd $(top_builddir) \
-         && CONFIG_FILES= CONFIG_HEADERS=Source/config.h \
-            $(SHELL) ./config.status
-       @echo timestamp > stamp-h 2> /dev/null
-$(srcdir)/config.h.in: $(srcdir)/stamp-h.in
-       @if test ! -f $@; then \
-               rm -f $(srcdir)/stamp-h.in; \
-               $(MAKE) $(srcdir)/stamp-h.in; \
-       else :; fi
-$(srcdir)/stamp-h.in: $(top_srcdir)/configure.in $(ACLOCAL_M4) 
-       cd $(top_srcdir) && $(AUTOHEADER)
-       @echo timestamp > $(srcdir)/stamp-h.in 2> /dev/null
-
-mostlyclean-hdr:
-
-clean-hdr:
-
-distclean-hdr:
-       -rm -f config.h
-
-maintainer-clean-hdr:
-
-mostlyclean-binPROGRAMS:
-
-clean-binPROGRAMS:
-       -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS)
-
-distclean-binPROGRAMS:
-
-maintainer-clean-binPROGRAMS:
-
-install-binPROGRAMS: $(bin_PROGRAMS)
-       @$(NORMAL_INSTALL)
-       $(mkinstalldirs) $(DESTDIR)$(bindir)
-       @list='$(bin_PROGRAMS)'; for p in $$list; do \
-         if test -f $$p; then \
-           echo "  $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`"; \
-            $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \
-         else :; fi; \
-       done
-
-uninstall-binPROGRAMS:
-       @$(NORMAL_UNINSTALL)
-       list='$(bin_PROGRAMS)'; for p in $$list; do \
-         rm -f $(DESTDIR)$(bindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \
-       done
-
-.c.o:
-       $(COMPILE) -c $<
-
-.s.o:
-       $(COMPILE) -c $<
-
-.S.o:
-       $(COMPILE) -c $<
-
-mostlyclean-compile:
-       -rm -f *.o core *.core
-
-clean-compile:
-
-distclean-compile:
-       -rm -f *.tab.c
-
-maintainer-clean-compile:
-
-robodoc: $(robodoc_OBJECTS) $(robodoc_DEPENDENCIES)
-       @rm -f robodoc
-       $(LINK) $(robodoc_LDFLAGS) $(robodoc_OBJECTS) $(robodoc_LDADD) $(LIBS)
-
-tags: TAGS
-
-ID: $(HEADERS) $(SOURCES) $(LISP)
-       list='$(SOURCES) $(HEADERS)'; \
-       unique=`for i in $$list; do echo $$i; done | \
-         awk '    { files[$$0] = 1; } \
-              END { for (i in files) print i; }'`; \
-       here=`pwd` && cd $(srcdir) \
-         && mkid -f$$here/ID $$unique $(LISP)
-
-TAGS:  $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) $(LISP)
-       tags=; \
-       here=`pwd`; \
-       list='$(SOURCES) $(HEADERS)'; \
-       unique=`for i in $$list; do echo $$i; done | \
-         awk '    { files[$$0] = 1; } \
-              END { for (i in files) print i; }'`; \
-       test -z "$(ETAGS_ARGS)config.h.in$$unique$(LISP)$$tags" \
-         || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags config.h.in $$unique $(LISP) -o $$here/TAGS)
-
-mostlyclean-tags:
-
-clean-tags:
-
-distclean-tags:
-       -rm -f TAGS ID
-
-maintainer-clean-tags:
-
-distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
-
-subdir = Source
-
-distdir: $(DISTFILES)
-       @for file in $(DISTFILES); do \
-         d=$(srcdir); \
-         if test -d $$d/$$file; then \
-           cp -pr $$d/$$file $(distdir)/$$file; \
-         else \
-           test -f $(distdir)/$$file \
-           || ln $$d/$$file $(distdir)/$$file 2> /dev/null \
-           || cp -p $$d/$$file $(distdir)/$$file || :; \
-         fi; \
-       done
-
-info-am:
-info: info-am
-dvi-am:
-dvi: dvi-am
-check-am: all-am
-check: check-am
-installcheck-am:
-installcheck: installcheck-am
-all-recursive-am: config.h
-       $(MAKE) $(AM_MAKEFLAGS) all-recursive
-
-install-exec-am: install-binPROGRAMS
-install-exec: install-exec-am
-
-install-data-am:
-install-data: install-data-am
-
-install-am: all-am
-       @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-install: install-am
-uninstall-am: uninstall-binPROGRAMS
-uninstall: uninstall-am
-all-am: makefile $(PROGRAMS) config.h
-all-redirect: all-am
-install-strip:
-       $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install
-installdirs:
-       $(mkinstalldirs)  $(DESTDIR)$(bindir)
-
-
-mostlyclean-generic:
-
-clean-generic:
-
-distclean-generic:
-       -rm -f Makefile $(CONFIG_CLEAN_FILES)
-       -rm -f config.cache config.log stamp-h stamp-h[0-9]*
-
-maintainer-clean-generic:
-mostlyclean-am:  mostlyclean-hdr mostlyclean-binPROGRAMS \
-               mostlyclean-compile mostlyclean-tags \
-               mostlyclean-generic
-
-mostlyclean: mostlyclean-am
-
-clean-am:  clean-hdr clean-binPROGRAMS clean-compile clean-tags \
-               clean-generic mostlyclean-am
-
-clean: clean-am
-
-distclean-am:  distclean-hdr distclean-binPROGRAMS distclean-compile \
-               distclean-tags distclean-generic clean-am
-
-distclean: distclean-am
-
-maintainer-clean-am:  maintainer-clean-hdr maintainer-clean-binPROGRAMS \
-               maintainer-clean-compile maintainer-clean-tags \
-               maintainer-clean-generic distclean-am
-       @echo "This command is intended for maintainers to use;"
-       @echo "it deletes files that may require special tools to rebuild."
-
-maintainer-clean: maintainer-clean-am
-
-.PHONY: mostlyclean-hdr distclean-hdr clean-hdr maintainer-clean-hdr \
-mostlyclean-binPROGRAMS distclean-binPROGRAMS clean-binPROGRAMS \
-maintainer-clean-binPROGRAMS uninstall-binPROGRAMS install-binPROGRAMS \
-mostlyclean-compile distclean-compile clean-compile \
-maintainer-clean-compile tags mostlyclean-tags distclean-tags \
-clean-tags maintainer-clean-tags distdir info-am info dvi-am dvi check \
-check-am installcheck-am installcheck all-recursive-am install-exec-am \
-install-exec install-data-am install-data install-am install \
-uninstall-am uninstall all-redirect all-am all installdirs \
-mostlyclean-generic distclean-generic clean-generic \
-maintainer-clean-generic clean mostlyclean distclean maintainer-clean
-
-
-# Some common targets
-xrefall: xrefhtml xreftex xrefrtf
-docall: html tex ascii rtf
-
-# Create the xref files for the various formats.
-xhtml: $(HTMLXREFSFILE) 
-xtex: $(LATEXXREFSFILE) 
-xrtf: $(RTFXREFSFILE)
-
-# Create the documentation files for the various formats.
-html: $(HTMLDOCS) $(PROJECT)_mi.html 
-tex: $(LATEXDOCS) $(PROJECT)_mi.tex
-rtf: $(RTFDOCS)
-ascii: $(ASCIIDOCS)
-
-# master index file, currently works only for html and latex documentation.
-$(PROJECT)_mi.html: $(HTMLXREFSFILE) 
-       $(ROBODOC) $< $@ INDEX HTML TITLE "$(PROJECT) Master Index"
-
-$(PROJECT)_mi.tex: $(LATEXXREFSFILE)
-       $(ROBODOC) $< $@ INDEX LATEX TITLE "$(PROJECT) API Reference"
-
-# create xrefs file (file with the names of all .xref files).
-$(HTMLXREFSFILE) : $(HTMLXREFS)
-       /bin/ls $(HTMLXREFS) > $@
-$(LATEXXREFSFILE) : $(LATEXXREFS)
-       /bin/ls  $(LATEXXREFS) > $@
-$(RTFXREFSFILE) : $(RTFXREFS)
-       /bin/ls  $(RTFXREFS) > $@
-
-# Rule to create an .xref file from a source file for the various formats.
-%.html.xref : %
-       $(ROBODOC) $< $(@:.xref=) $(ROBOOPTS) INTERNAL GENXREF $@
-%.tex.xref : %
-       $(ROBODOC) $< $(@:.xref=) $(ROBOOPTS) INTERNAL GENXREF $@
-%.rtf.xref : %
-       $(ROBODOC) $< $(@:.xref=) $(ROBOOPTS) INTERNAL GENXREF $@
-
-# Rule to create html documentation from a source file.
-%.html : %
-       $(ROBODOC) $< $@ HTML $(ROBOOPTS) XREF $(HTMLXREFSFILE)
-
-# Rule to create latex documentation from a source file.
-# We do not include source items, and generate laxtex documents
-# than can be included in a master document.
-%.tex : %
-       $(ROBODOC) $< $@ LATEX $(ROBOOPTS) NOSOURCE SINGLEDOC XREF $(LATEXXREFSFILE)
-
-# Rule to create ascii documentation from a source file.
-%.txt : %
-       $(ROBODOC) $< $@ ASCII 
-
-# Rule to create rtf documentation from a source file.
-%.rtf : %
-       $(ROBODOC) $< $@ RTF $(ROBOOPTS) XREF $(RTFXREFSFILE)
-
-# Use netscape to view the master index file for our project.
-example: html
-       $(BROWSER) $(PROJECT)_mi.html
-
-# Use the latex programs to generate a .dvi from the master index file
-# for our prokect. View this .dvi file with xdvi
-texview:  tex
-       latex $(PROJECT)_mi
-       makeindex $(PROJECT)_mi
-       latex $(PROJECT)_mi
-       latex $(PROJECT)_mi
-       dvips $(PROJECT)_mi.dvi -o $(PROJECT)_mi.ps
-
-# Clean-up the mess we made
-#
-myclean:
-       rm -f $(HTMLXREFS) 
-       rm -f $(HTMLDOCS) 
-       rm -f $(LATEXXREFS)
-       rm -f $(LATEXDOCS) 
-       rm -f $(PROJECT)_mi.* *.aux
-       rm -f $(RTFXREFS)
-       rm -f $(RTFDOCS)
-       rm -f $(ASCIIDOCS)
-       rm -f $(HTMLXREFSFILE) 
-       rm -f $(LATEXXREFSFILE) 
-       rm -f $(RTFXREFSFILE)
-       rm -f robodoc makefile.in makefile
-       rm -f *~ stamp-h stamp-h.in
-       rm -f *.o *.tex *.toc *.dvi *.aux *.log *.ps
-       rm -f masterindex.html
-       rm -f testheaders.html
-
-tt:
-       cp robodoc $(HOME)/Test
-
-# Tell versions [3.59,3.63) of GNU make to not export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
diff --git a/util/robodoc/Source/makefile.plain b/util/robodoc/Source/makefile.plain
deleted file mode 100644 (file)
index 8739dcb..0000000
+++ /dev/null
@@ -1,215 +0,0 @@
-#****h* ROBODoc/Makefile.plain
-# NAME
-#   Makefile.plain -- Plain makefile that does not need autoconf 
-# SYNOPSIS
-#   make robodoc
-#   make html   
-#   make example
-#   make count
-#   make test
-#   make clean
-# PURPOSE
-#   The makefile for SAS C compiler v6.x and Dice, and GCC.
-#   You can use it if you are on a non Unix system or a system
-#   that does not support autoconfiguration.
-#
-#
-#
-#   The following targets are the most useful for the user.
-#
-#   robodoc -  makes the robodc executable.
-#   example -  makes robodoc and shows you the autodocs
-#              generated from the ROBODoc source code
-#              using browser.         
-#   html    -  makes autodocs for robodoc in html format.
-#
-#   Developers might try:
-#   test    -
-#   count   -
-#   clean   -  
-# NOTES
-#   This documentation is not complete. It is just a test to see
-#   how to best use ROBODoc with make files.
-#
-#****
-#
-# $Id$
-#
-
-SHELL = /bin/sh
-.SUFFIXES:
-.SUFFIXES: .c .o
-
-#--------------------------------------
-# use DICE C under AmigaOS
-#--------------------------------------
-#CC = dcc
-#CFLAGS =
-
-#--------------------------------------
-# use gcc (optimising for AmigaOS)
-#--------------------------------------
-#CC = gcc
-#CFLAGS = -O2 -fstrength-reduce -s -m68020-40 -noixemul
-
-#--------------------------------------
-# use gcc (generic)
-#--------------------------------------
-
-CC = gcc
-CFLAGS = -Wall -ansi -pedantic
-LIBS=
-
-#
-#
-#
-
-BROWSER=netscape
-ROBODOC=./robodoc
-ETAGS=/usr/bin/etags
-EGREP=/bin/egrep
-RM=/bin/rm
-
-all: robodoc
-
-#--------------------------------------
-# sources for the robodoc executable
-#--------------------------------------
-
-SOURCES=analyser.c generator.c items.c util.c folds.c headers.c \
-        links.c robodoc.c     
-
-OBJECTS=analyser.o generator.o items.o util.o folds.o headers.o \
-        links.o robodoc.o     
-
-#****** makefile.plain/robodoc
-# NAME
-#   robodoc --
-# NOTE
-#   This assumes that you version of make knows how to make an .o file
-#   out of an .c file.
-# SOURCE
-#
-
-robodoc : $(OBJECTS) 
-       $(CC) $(OBJECTS) -o robodoc $(LIBS)
-
-#****
-
-
-#****** makefile.plain/html
-# NAME
-#   html -- ROBODoc HTML autodocs for ROBODoc
-# FUNCTION
-#   
-#****
-
-DOCS=analyser.c.html generator.c.html items.c.html util.c.html \
-  folds.c.html headers.c.html links.c.html robodoc.c.html \
-  analyser.h.html generator.h.html items.h.html util.h.html \
-  folds.h.html headers.h.html links.h.html robodoc.h.html
-
-XREF=$(DOCS:.html=.xref)
-
-XREFSFILE=robodoc.html.xrefs 
-
-html : robodoc masterindex.html 
-
-#
-# create xrefs file (file with the names of all .xref files).
-#
-robodoc.html.xrefs : $(XREF)
-       /bin/ls *.xref > $@
-
-#
-# Rule to create an .xref file from a source file.
-#
-%.xref : %
-       $(ROBODOC) $< $(@:.xref=.html) INTERNAL GENXREF $@
-
-#
-# Rule to create an .html file from a source file.
-#
-%.html : % $(XREFSFILE)
-       $(ROBODOC) $< $@ HTML INTERNAL XREF $(XREFSFILE)
-
-
-masterindex.html : $(XREFSFILE) $(DOCS)
-       $(ROBODOC) $(XREFSFILE) $@ INDEX HTML TITLE "ROBODoc Master Index"
-
-
-#****** makefile.plain/example
-# NAME
-#   example -- create and show autodocs extracted from ROBODoc source.
-# FUNCTION
-#
-#****
-
-example : html 
-       $(BROWSER) masterindex.html
-
-#----------------------------
-# Development
-#----------------------------
-
-tags :
-       $(ETAGS) *.c *.h
-
-#****** makefile.plain/count
-# NAME
-#   count -- count the number of lines of the ROBODoc source.
-#****
-
-count :
-       $(EGREP) -v -G "^ \*" *.c *.h | egrep -v -G "/\*"  | wc
-
-
-#****** makefile.plain/test
-# NAME
-#   test -- run some tests
-# FUNCTION
-#   Runs robodoc on file with a number of different headers.
-#
-#****
-
-test : $(ROBODOC)
-       $(ROBODOC) testheaders.c testheaders.html HTML -v
-
-
-#****** makefile.plain/clean
-# NAME
-#   clean -- Clean up the mess we made.
-# FUNCTION
-#   Cleans up the mess we made.
-#*****
-
-clean :
-       $(RM) -f $(DOCS) $(XREF)
-       $(RM) -f robodoc
-       $(RM) -f *~
-       $(RM) -f *.o *.tex *.toc *.dvi *.aux *.log *.ps
-       $(RM) -f masterindex.html
-       $(RM) -f testheaders.html
-       $(RM) -f stamp-h* makefile.in config.h robodoc.html.xrefs
-
-#------------------------------
-# Construction of the makefile
-#------------------------------
-
-depend :
-       makedepend -Y"" -f makefile.plain *.c *.h
-
-# DO NOT DELETE
-
-analyser.o: config.h.in robodoc.h headers.h items.h util.h folds.h links.h
-analyser.o: analyser.h
-folds.o: config.h.in folds.h robodoc.h
-generator.o: config.h.in robodoc.h headers.h items.h folds.h util.h links.h
-generator.o: generator.h analyser.h
-headers.o: config.h.in robodoc.h headers.h
-items.o: config.h.in robodoc.h items.h
-links.o: config.h.in headers.h robodoc.h util.h links.h
-robodoc.o: config.h.in robodoc.h folds.h headers.h items.h util.h links.h
-robodoc.o: analyser.h generator.h
-util.o: config.h.in robodoc.h links.h headers.h folds.h items.h util.h
-
diff --git a/util/robodoc/Source/robodoc.c b/util/robodoc/Source/robodoc.c
deleted file mode 100644 (file)
index 3274d77..0000000
+++ /dev/null
@@ -1,862 +0,0 @@
-/****h* Autodoc/ROBODoc [3.2]
- * NAME
- *   ROBODoc -- AutoDoc formatter
- * COPYRIGHT
- *  Copyright (C) 1994-2000  Frans Slothouber and Jacco van Weert.
- *
- *  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; either version 2 of the License, or
- *  (at your option) any later version.
- *
- *  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.
- *
- *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- *
- * FUNCTION
- *   ROBODoc is intended to be a replacement for the original AutoDocs
- *   program.  ROBODoc will extract the procedure comment headers
- *   from a source file, and put them into a separate documentation file.
- *   There are five different file output formats:
- *       ASCII
- *       HTML (HyperText Markup Langauge) -- mainly used on the Internet;
- *           thus the files can be viewed with a normal HTML viewer/browser
- *       AmigaGuide -- this format can be viewed by AmigaGuide (Amiga only)
- *       LaTeX - as input to LaTeX to produce .dvi files
- *       RTF (Rich Text Format) -- as input to the Help compiler (Windows only)
- *   For further information read the documentation in the archive.
- * AUTHOR
- *   Frans Slothouber:  <fslothouber@acm.org>.
- *     Source code and additional extensions from version 2.0 and up.
- *
- *   Petteri Kettunen: <petterik@iki.fi>
- *     Bug fixes, FOLD, C features.
- *
- *   Jacco van Weert: <weertj@xs4all.nl>
- *     Original idea and program.
- *
- *   Bernd Koesling:  <KOESSI@CHESSY.aworld.de>
- *     Bug fixes, functional improvements, code cleanup.
- *
- *   Anthon Pang:  <apang@mindlink.net>
- *     RTF support, Bug fixes.
- *
- *   Thomas Aglassinger: <agi@sbox.tu-graz.ac.at>
- *     Fixes and cleanup of HTML-output
- *
- * CREATION DATE
- *   20-Dec-94
- * MODIFICATION HISTORY
- *   Modifications by Jacco van Weert.
- *     19-Jan-95     -  v0.8:   First test beta-version
- *     26-Jan-95     -  v0.92:  2nd test beta-version
- *     2-Feb-95      -  v0.93:  Mungwall hit, solved.
- *                              When item headers, are also available
- *                              in body then parts are duplicated solved.
- *     Mar-95        -  v1.0a:  Final version
- *     2-Apr-95      -  v1.0b:  Bug fixes
- *                              Procedure header search bug solved.
- *                              Print 'created procedure' text
- *     20-Apr-95     -  v1.1a:  INTERNALONLY option added.
- *                              Sort problem solved.
- *   Modifications by FNC Slothouber.
- *     10-May-1995 -  v2.0a  * Program completely rewritten
- *                           * added SOURCE item and LaTeX output.
- *                           * added TAB converter.
- *     11-May-1995 -  v2.0b  * Accepts headers that start with
- *                             any sequence of non-spaces.
- *                             RoboDoc should work with any
- *                             type of programming language now.
- *     12-May-1995 -  v2.0c  * Bug fixes.
- *     15-May-1995 -  v2.0d  * New Defaults file.
- *                           * Added Verbose option.
- *     24-May-1995 -  v2.0e  * Fixed a bug that cause the
- *                             CleanUp Routine to lock up.
- *                           * Improved the HTML output,
- *                             should work faster now.
- *   Modifications by Koessi
- *     01-Aug-1995  - v2.0?  * more robust parsing, less enforcer-hits
- *                           * removed self-referencing links !
- *                           * remarked most changes with *koessi*
- *                           * added GoldEd-foldmarks
- *                           * compiled successfully with SAS-C 6.3
- *     07-Aug-1995   -       * automated foldmarks "\***"
- *                           ! GoldEd's foldmarks == RoboDoc marker !
- *                           * quoted source parsing enhanced
- *     08-Aug-1995   -       * a lot of while instead of for
- *                           * a lot of switch() instead of ifelse
- *                           * version defined
- *                           * RB_Say, RB_Panic now useable like printf()
- *                             new formats for nearly all output-strings
- *                           * char *whoami is global copy of argv[0]
- *                           * BOLD <- MAKE_LARGE && AMIGAGUIDE
- *                           * succesfully compiled&tested on HPUX
- *                           (HP9000/800)
- *                           * optimized listfunctions
- *                           * encapsulated header- and link-
- *                             allocating and freeing
- *                           * RB_Find_Function_Name() replaced
- *                             with RB_FilePart()
- *  Modifications by FNC Slothouber.
- *    18-Aug-1995   -  v3.0  
- *      o New scanner that searches for a set default markers 
- *        that define what is a comment or what is not and that 
- *        define what or what is not a header/end marker.
- *      o Added Beast Support
- *    27-Aug-1995   - v3.0b  
- *      o Fixed a bug with the defaults file
- *      o Improved search algorithm RoboDoc is now 5.8 times faster.
- *    06-Sep-1995   - v3.0c  
- *      o Bug fixes
- *    08-Oct-1995   - v3.0d  
- *      o Bug fixes
- *    04-Feb-1996   - v3.0e  
- *      o fixed the problem with the TOC that included links to headers that
- *                             were not selected. (i.e internal)
- *  Modifications by apang
- *    08-Mar-1996   - v3.0f  
- *      o Cleaner build for Borland C++ 4.52
- *      o Added more markers (C++, Pascal, Modula-2, COBOL)
- *      o Added more item types/names
- *      o Added #defines for the preamble (COMMENT_ROBODOC and 
- *        COMMENT_COPYRIGHT)
- *      o BLANK_HEADER for detection of asterisk'd lines
- *      o RB_Say() the GENERIC header warning instead of using printf()
- *      o Indents SOURCE body in output
- *      o ASCII respects the TOC flag; removed extraneous newline after 
- *        formfeed (so it's more like AutoDoc)
- *      o HTML output fixed to handle '<', '>', and '&'
- *      o LaTeX attributes and '%' handling added; fancied up the output a bit
- *      o RTF support added
- *      o Changed some fprintf()'s to fputc()'s for potentially lower overhead
- *      o Fixed line eater bug
- *      o More general fix to the TOC problem of including internal links 
- *        when it wasn't selected
- *  Modifications by FNC Slothouber.
- *    01-April-1996  - v3.0h 
- *      o Added ';' to &gt and &lt so lynx also recognizes them.
- *      o Fancied up the HTML output.
- *    10-July-1996   - v3.0i 
- *      o Bug Fix, Both the options INTERNAL and INTERNALONLY did not 
- *        work correctly.
- *  Modifications by agi
- *    15-Dec-1997    - v3.0j 
- *      o cleaned the HTML-output, so it now conforms to the DTD for HTML-3.2
- *      o TOC now is an ordered list (<OL> and <LI>)
- *      o added "<!DOCTYPE..>"
- *      o added quotes to values of some HTML-attributes
- *      o more compatible implementation of the SGML-comment containing 
- *        copyright-info replaced all occurrences of <B><PRE>.. by <PRE><B>
- *      o replaced <H2/3> by <H1/2>
- *      o fixed two minor warnings reported by gcc -Wall
- *  Modifications by FNC Slothouber.
- *    14-Aug-1998    - v3.0k * Tcl/Tk '#' handling added;
- *       Feb-1999    - v3.0l * Added function to reverse the header list.
- *  Modifications by Petteri Kettunen
- *    Feb 1999      - v3.0m 
- *      o Changed background color to white
- *      o Changed size of Table of Contents title. (H3 instead of H1)
- *      o The reverse function also reversed the sorted header list, 
- *        fixed this.
- *  Modifications by Petteri Kettunen
- *   August 1999 - v3.0m+ 
- *      o Support for folding in SOURCE items, HTML only.
- *      o indent -kr 
- *      o Added options FOLD and C
- *  Modifications by FNC Slothouber. 
- *   August 1999 - v3.1   
- *      o More documentation and a more informative usage() function. 
- *      o GPL-ed.
- *      o robodoc -c prints licence
- *      o removed a number of Source items from the documentation to reduce 
- *        the size of the robodoc.c.html file...  no fun for people
- *        to download a >100k file.
- *      o removed the warning about not using a robodoc default file.
- *      o indent -orig -i2 -nbc -ncdb -bad -bap
- *      o Fixed the warnings. 
- *      o Fixed some occurrences of (evil cast)malloc  (thou shalt not 
- *        cast malloc :) 
- *      o ROBODoc now returns EXIT_FAILURE or  EXIT_SUCCESS, as defined 
- *        in <stdlib.h>
- *      o Fixed a memory leak in RB_Analyse_Document()
- *   Oct 1999 - v3.1b     
- *      o <A NAME="source code file name"> is generated at the beginning of 
- *        each document. A mention of the source code name in another 
- *        document creates a link to this name (provided you use xrefs).
- *      o Moved most #defines and enums to robodoc.h
- *      o Made ROBODoc more forgiving in reading the xrefs file. Empty 
- *        lines are allowed and also spaces at the end of a file name.
- *   Nov 1999 - v3.1c  -- From patches that I received from Stefan Kost
- *      o renamed BEAST METHODS -> METHODS
- *      o renamed BEAST ATTRIBUTES -> ATTRIBUTES
- *      o added new items useful for object oriented programming; some of 
- *        these items are already used in os3.1 autodocs
- *        TAGS, COMMANDS, DERIVED FROM, DERIVED BY, USES,
- *        CHILDREN, USED BY, PARENTS, USAGE, PURPOSE
- *      o commented the item names
- *      o changed item-type enums to end all with _ITEM
- *      o changed RB_Find_Link to accept names ending with '...'
- *      o changed copyright comment to be a style-guide conform version string.
- *      o changed RB_VER[] to be a style-guide conform version string
- *      o changed AMIGA into _AMIGA, because the first one does not exists, 
- *        when compiling with NOANSI on SAS C/C++
- *   Dec 1999 - v3.1d
- *      o added new header types for, classes, methods, variables, 
- *        functions, strutures and constants. (Idea of Stefan Kost) 
- *      o added a command to create a master index file that contains
- *        sorted pointers to all classes, methods, variables, 
- *        functions, strutures and constants.
- *   Dec 1999 - v3.1e
- *      o added markers for HTML.
- *      o modified the RB_Find_Link() function to also words that include
- *        "::". This is used for C++ methods.
- *      o added a RB_Function_Name() function that correctly extracts the
- *        function name (or the name of any other object that is documented)
- *        from the header name.  The old code used RB_FilePart which failed
- *        on C++ method names. 
- *      o Fixed a core-dumping bug in RB_Set_Doc_Base()
- *   Dec 1999 - v3.1f
- *      o added RB_TimeStamp() to include time stamps in the documentation.
- *      o Documentation is now generated in LaTeX2e format.
- *      o added '|****' as begin marker, '|' as remark marker and '|***' as
- *        end marker for GNU assembler support.
- *      o ran ident on all source. Using the GNU standard now. 
- *      o Added new fold markers provided by Petteri
- *   May 2000 - v3.2
- *      o Using automake and autoconf.
- *      o Added fixes to folding code Petteri.
- *      o Added markers for FORTAN 90
- *   June 2000 - V3.2.1
- *      o Added patch from Simo Muinonen: This solved the following
- *        problem:
- *          When e.g. a field of a structured C variable (with an
- *          underscore in its name) is referred to using the
- *          point notation (e.g. "g_Status.tpstat"), the variable
- *          name is not recognized as a separate keyword.  This
- *          can also happen when a keyword is in a comment at the
- *          end of a sentence with an immediately following ".".
- *      o Fixed the "stuctures" type in the master index file.
- *      o Added mailto: support provided by Guillaume Etorre.
- *    July 2000 - V3.2.2
- *      o Added option SINGLEDOC
- *        For LaTeX output this generates documentation without
- *        the start and end headers.  This way the generated file
- *        can be included in a master file.  
- *      o Added master index file for LaTeX output.  The documentation
- *        gathered from several source files can now be included into
- *        one big file.
- *      o Added the option NOSOURCE.  With this option the SOURCE item
- *        is not included in the documentation.
- *      o Added the TITLE option. This allows to set the title for
- *        the master index file.
- *      o Made the search for headermarkers case insensitve.
- *        REM == Rem == rem  
- *    July 2000 - V3.2.3
- *      o Fixed a bug that caused links of the type
- *        "someword/anotherword," to be ignored, while
- *        "someword/anotherword" was recognized.
- *    Sep 2000 
- *      o Labels with identical names are now numbered.
- *    Apr 2001
- *      o The source file is opened "rb" this I hope will
- *        make it possible to use Robodoc under windows.
- *        (Thanks to Carlo Caminati) 
- *
- * NOTES
- *   Has been succesfully compiled:
- *     On an Amiga with SAS/C, DICE C and gcc (Amiga 1200)
- *     On a Sun Sparc Station with gcc   (under SunOS 4.1)
- *     On a Dec Alpha Station
- *     Under HP/UX on a HP9000/800
- *     Under IRIX
- *     On a Linux box with gcc, Slackware, Redhat, and Debian 2.1.
- * BUGS
- *   - HTML output is not Lynx friendly -- attributes are applied
- *     to leading white space =P ... solution: fix Lynx  >=)
- *   - Can't get the escape character for @ to work in
- *     AmigaGuide format.
- *   - Horrible use of feof() and fgets() 
- *   Other bugs?
- *     Catch them in a jar and send them to fslothouber@acm.org
- *     Latest version can be found on 
- *       http://robodoc.sourceforge.net
- *       http://www.xs4all.nl/~rfsber/Robo/
- *       http://freshmeat.net/ 
- *     
- ****/
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <ctype.h>
-#include "robodoc.h"
-#include "folds.h"
-#include "headers.h"
-#include "items.h"
-#include "util.h"
-#include "links.h"
-#include "analyser.h"
-#include "generator.h"
-
-#ifdef _AMIGA
-char RB_VER[] = "\0$VER: robodoc " VERSION " " __AMIGADATE__ " (c) by Maverick Software Development 1994-2001";
-#else
-char RB_VER[] = "$VER: robodoc " VERSION " (" __DATE__ ") (c) by Maverick Software Development 1994-2001";
-#endif
-
-
-/****v* ROBODoc/source
- * NAME
- *   source -- source code file.
- * PURPOSE
- *   Pointer to the file with source code.   
- * NOTES
- *   This is a global. It is however only used by main() and
- *   RB_Close_The_Shop(). All other functions are passed a copy.
- *
- *   It is a global so that the file can be closed by
- *   RB_Close_The_Shop() when the program exits (normally or
- *   abnormaly).
- *****
- */
-
-FILE *source = NULL;
-
-/****v* ROBODoc/documentation
- * NAME
- *   documentation -- documentation file.
- * PURPOSE
- *   Pointer to the file that will contain the documentation extracted
- *   from the source code.   
- * NOTES
- *   This is a global. It is however only used by main() and
- *   RB_Close_The_Shop(). All other functions are passed a copy.
- *
- *   It is a global so that the file can be closed by
- *   RB_Close_The_Shop() when the program exits (normally or
- *   abnormaly).
- *****
- */
-
-FILE *documentation = NULL;
-
-
-/****v* ROBODoc/document_title
- * NAME
- *   documentat_title -- title for the documentation.
- * PURPOSE
- *   Used as the title for master index files or for latex documentation.
- *****
- */
-
-char *document_title = NULL;
-
-/****v* ROBODoc/output_mode [2.0]
- * NAME
- *   output_mode -- the mode of output
- * FUNCTION
- *   Controls which type of output will be generated.
- * SOURCE
- */
-
-int output_mode = ASCII;
-
-/*******/
-
-
-/****v* ROBODoc/course_of_action [2.0]
- * NAME
- *   course_of_action
- * FUNCTION
- *   Global Variable that defines the course of action.
- * SOURCE
- */
-
-int course_of_action = DO_MAKE_DOCUMENT;
-
-/*******/
-
-
-/****v* ROBODoc/line_buffer [2.0]
- * NAME
- *   line_buffer -- global line buffer
- * FUNCTION
- *   Temporary storage area for lines
- *   that are read from an input file.
- * SOURCE
- */
-
-char line_buffer[MAX_LINE_LEN];
-
-/*******/
-
-
-/****v* ROBODoc/line_number [2.0]
- * NAME
- *   line_number -- global line counter
- * PURPOSE
- *   Keeps track of the number of lines that are read from the source file.
- * AUTHOR
- *   Koessi
- * SOURCE
- */
-
-int line_number = 0;
-
-/*******/
-
-
-/****v* ROBODoc/use [3.0h]
- * NAME
- *   use -- usage string
- * FUNCTION
- *   Inform the user how to use ROBODoc.
- * AUTHOR
- *   Koessi
- * SOURCE
- */
-
-char use[] =
-"ROBODoc Version " VERSION ", autodocs formatter ($Revision$)\n"
-"(c) 1994-2001 Frans Slothouber and Jacco van Weert\n"
-"robodoc comes with ABSOLUTELY NO WARRANTY.\n"
-"This is free software, and you are welcome to redistribute it\n"
-"under certain conditions; type `robodoc -c' for details.\n"
-"\n"
-"Usage:\n"
-"  robodoc <source file> <documentation file> [options]\n"
-"    or\n"
-"  robodoc <xrefs file> <master index file> INDEX [options]\n"
-"\n"
-"You can use one or more of the following options:\n"
-"  GENXREF <xref file>  - to generate an xref file.\n"
-"  XREF    <xrefs file> - if you want to use xref files to create\n"
-"                         cross links.\n"
-"  INDEX           - create a master index file.\n"
-"  TABSIZE <nr_sp> - convert each TAB to nr_sp of spaces.\n"
-"  TOC             - a table of contents will be generated.\n"
-"  SORT            - the headers will be sorted.\n"
-"  -v              - tell robodoc to tell you all about it.\n"
-"  INTERNAL        - headers marked internal will also be included.\n"
-"  INTERNALONLY    - only headers marked internal will be included.\n"
-"  FOLD            - enable folding if HTML output is selected.\n"
-"  C               - Use ANSI C grammar in source items (test, HTML only).\n"
-"The type of output is selected with one of the following switches:\n"
-"  ASCII, GUIDE, HTML, LATEX, or RTF\n"
-"If no type is specified ASCII is used.\n"
-"The following abbreviations are also allowed:\n"
-"  TOC = -t  XREF = -x   SORT = -s  INTERNAL = -i \n"
-"  GENXREF = -g  INTERNALONLY = -io  TABSIZE = -ts\n"
-"Example:\n"
-"  robodoc simulator.c simulator.html HTML -v TOC SORT\n"
-"Authors/Contributors: Frans Slothouber <fslothouber@acm.org>,"
-" Jacco van Weert,\n"
-"  Petteri Kettunen, Bernd Koesling, Thomas Aglassinger, Anthon Pang, and\n"
-"  Stefan Kost\n"
-"For more information, and the lastest version:\n"
-"  http://www.xs4all.nl/~rfsber/Robo/index.html\n"
-"  Send bug reports to <fslothouber@acm.org>.\n";
-
-/********/
-
-
-/****v* ROBODoc/copying [3.1]
- * NAME
- *   copying -- licence information
- * FUNCTION
- *   inform the user how to copy me
- * AUTHOR
- *   Frans
- *******
- */
-
-char copying[] =
-"\n"
-" Distributed under the GNU GENERAL PUBLIC LICENSE\n"
-"   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION\n"
-" See the source archive for a copy of the complete licence\n"
-" If you do not have it you can get it from\n"
-" http://freshmeat.net/appindex/1999/08/30/936003795.html\n";
-
-
-/* Global variables */
-
-char *whoami = NULL;           /* me,myself&i */
-int tab_size = 8;
-char doc_base[1024];           /* PetteriK */
-
-
-/****f* ROBODoc/RB_Set_Doc_Base
- * NAME
- *   RB_Set_Doc_Base -- get file name without extension.
- ******
- */
-
-void
-RB_Set_Doc_Base (char *path)
-{
-  int ptr = 0, n = -1;
-
-  while (path[ptr] != '\0')
-    {
-      if (path[ptr] == '.')
-       {
-         n = ptr;
-       }
-      ptr++;
-    }
-  if (n != -1)
-    {
-      strncpy (doc_base, path, n);
-    }
-  else
-    {
-      strcpy (doc_base, path);
-    }
-  RB_Say ("doc_base is \"%s\"\n", doc_base);
-}
-
-
-
-
-/****f* ROBODoc/main [2.0d]
- * NAME
- *   main -- Entry point of ROBODoc
- * SYNOPSIS
- *   main (int argc, char **argv)
- * FUNCTION
- *   Get and parse the arguments.
- *   Analyse document and generate the documentation.
- * SOURCE
- */
-
-int
-main (int argc, char **argv)
-{
-  char *file_with_xrefs, *output_file_for_xrefs;
-
-  whoami = argv[0];            /* global me,myself&i */
-  if (argc < 2)
-    {
-      printf ("%s", use);
-    }
-  else if (argc < 3)
-    {
-      if (strcmp (argv[1], "-c") == 0)
-       {
-         printf ("%s", copying);
-       }
-      else
-       {
-         printf ("%s", use);
-       }
-    }
-  else
-    {
-      RB_Analyse_Arguments (argc, argv, &file_with_xrefs,
-                           &output_file_for_xrefs);
-
-      RB_Say ("Analysing Defaults File\n");
-      RB_Analyse_Defaults_File ();
-
-      RB_Say ("trying to open source file \"%s\"\n", argv[1]);
-      if ((source = fopen (argv[1], "rb")) != NULL)
-       {
-         if (!(course_of_action & DO_INDEX))
-           {
-             RB_Say ("analysing source file \"%s\"\n", argv[1]);
-             RB_Analyse_Document (source);
-              RB_Number_Duplicate_Headers();
-
-             if (course_of_action & DO_SORT)
-               {
-                 RB_Say ("sorting headers\n");
-                 RB_Slow_Sort ();
-               }
-             else
-               {
-                 RB_Reverse_List ();
-               }
-             if ((course_of_action & DO_USE_XREFS) && file_with_xrefs)
-               {
-                 if ((xreffiles_file = fopen (file_with_xrefs, "r")) != NULL)
-                   {
-                     RB_Analyse_Xrefs (xreffiles_file);
-                   }
-                 else
-                   {
-                     RB_Panic ("can't open file with xref files \"%s\"\n",
-                               file_with_xrefs);
-                   }
-               }
-           }
-         else
-           {                   /* INDEX */
-             if ((xreffiles_file = fopen (argv[1], "r")) != NULL)
-               {
-                 RB_Analyse_Xrefs (xreffiles_file);
-               }
-             else
-               {
-                 RB_Panic ("can't open file with xref files \"%s\"\n",
-                           argv[1]);
-               }
-           }
-         if (course_of_action & DO_MAKE_DOCUMENT)
-           {
-             RB_Say ("trying to open destination file \"%s\"\n", argv[2]);
-             if ((documentation = fopen (argv[2], "w")) != NULL)
-               {
-                 RB_Say ("generating documentation\n");
-                 RB_Set_Doc_Base (argv[2]);
-                 RB_Generate_Documentation (documentation,
-                                            RB_FilePart (argv[1]),
-                                            RB_FilePart (argv[2]));
-                 fclose (documentation);
-                 documentation = NULL;
-               }
-             else
-               RB_Panic ("can't open destination file \"%s\"\n", argv[2]);
-           }
-         else if ((course_of_action & DO_MAKE_XREFS)
-                  && output_file_for_xrefs)
-           {
-             RB_Say ("trying to open xref destination file \"%s\"\n",
-                     output_file_for_xrefs);
-             if ((documentation = fopen (output_file_for_xrefs, "w")) != NULL)
-               {
-                 RB_Say ("generating xref destination file \"%s\"\n",
-                         output_file_for_xrefs);
-                 RB_Generate_xrefs (documentation, argv[1], argv[2]);
-                 fclose (documentation);
-                 documentation = NULL;
-               }
-             else
-               RB_Panic ("can't open xref destination file \"%s\"\n",
-                         output_file_for_xrefs);
-           }
-         else if (course_of_action & DO_INDEX)
-           {
-             if ((documentation = fopen (argv[2], "w")) != NULL)
-               {
-                 RB_Generate_Index (documentation, argv[1]);
-                 fclose (documentation);
-                 documentation = NULL;
-               }
-             else
-               {
-                 RB_Panic ("can't open destination file \"%s\"\n", argv[2]);
-               }
-           }
-       }
-      else
-       RB_Panic ("can't open source file \"%s\"\n", argv[1]);
-    }
-  RB_Say ("Ready\n");
-  RB_Close_The_Shop ();
-  return EXIT_SUCCESS;
-}
-
-/*****/
-
-
-
-
-/****f* ROBODoc/RB_Analyse_Arguments [3.0h]
- * NAME
- *   RB_Analyse_Arguments
- * SYNOPSIS
- *   RB_Analyse_Arguments (argc, argv, file_with_xrefs,
- *                         output_file_for_xrefs)
- *   RB_Analyse_Arguments (int, char **, char **, char **)
- * FUNCTION
- *   Get and parse the arguments. This is a quite complex function.
- *   It assumes that the first and second parameter are the
- *   name of the source file and name of the documentation file
- *   respectively. They are therefore skipped.
- *   May modifie: output_mode, course_of_action, file_with_xrefs, 
- *   output_file_for_xrefs, document_title.
- * SOURCE
- */
-
-void
-RB_Analyse_Arguments (int argc, char **argv,
-                     char **file_with_xrefs,
-                     char **output_file_for_xrefs)
-{
-  char **parameter;
-  int parameter_nr;
-
-  for (parameter_nr = argc - 3, parameter = argv + 3;
-       parameter_nr > 0;
-       parameter++, parameter_nr--)
-    {
-
-      if (!RB_Str_Case_Cmp (*parameter, "HTML"))
-       output_mode = HTML;
-      else if (!RB_Str_Case_Cmp (*parameter, "GUIDE"))
-       output_mode = AMIGAGUIDE;
-      else if (!RB_Str_Case_Cmp (*parameter, "LATEX"))
-       output_mode = LATEX;
-      else if (!RB_Str_Case_Cmp (*parameter, "ASCII"))
-       output_mode = ASCII;
-      else if (!RB_Str_Case_Cmp (*parameter, "RTF"))
-       output_mode = RTF;
-      else if (!RB_Str_Case_Cmp (*parameter, "FOLD"))
-       extra_flags |= FOLD;    /* PetteriK */
-      else if (!RB_Str_Case_Cmp (*parameter, "C"))
-       extra_flags |= C_MODE;  /* PetteriK */
-      else if (!RB_Str_Case_Cmp (*parameter, "SORT") ||
-              !RB_Str_Case_Cmp (*parameter, "-S"))
-       course_of_action |= DO_SORT;
-      else if (!RB_Str_Case_Cmp (*parameter, "INDEX"))
-       {
-         course_of_action |= DO_INDEX;
-         course_of_action &= ~DO_MAKE_DOCUMENT;
-       }
-      else if (!RB_Str_Case_Cmp (*parameter, "INTERNAL") ||
-              !RB_Str_Case_Cmp (*parameter, "-I"))
-       course_of_action |= DO_INCLUDE_INTERNAL;
-      else if (!RB_Str_Case_Cmp (*parameter, "SINGLEDOC"))            
-       course_of_action |= DO_SINGLEDOC;
-      else if (!RB_Str_Case_Cmp (*parameter, "NOSOURCE"))             
-       course_of_action |= DO_NOSOURCE;
-      else if (!RB_Str_Case_Cmp (*parameter, "INTERNALONLY") ||
-              !RB_Str_Case_Cmp (*parameter, "-IO"))
-       course_of_action |= DO_INTERNAL_ONLY;
-      else if (!RB_Str_Case_Cmp (*parameter, "TOC") ||
-              !RB_Str_Case_Cmp (*parameter, "-T"))
-       course_of_action |= DO_TOC;
-      else if (!RB_Str_Case_Cmp (*parameter, "-V"))
-       course_of_action |= DO_TELL;
-      else if (!RB_Str_Case_Cmp (*parameter, "TITLE"))
-       {
-         if (--parameter_nr)
-           {
-             parameter++;
-             document_title = *parameter;
-             RB_Say ("TITLE=\"%s\"\n", *document_title);
-           }
-         else
-           RB_Panic ("you must specify a title with the TITLE option\n");
-       }
-      else if (!RB_Str_Case_Cmp (*parameter, "XREF") ||
-              !RB_Str_Case_Cmp (*parameter, "-X"))
-       {
-         if (--parameter_nr)
-           {
-             parameter++;
-             *file_with_xrefs = *parameter;
-             RB_Say ("XREF=\"%s\"\n", *file_with_xrefs);
-             course_of_action |= DO_USE_XREFS;
-           }
-         else
-           RB_Panic ("you must specify a xref file with the XREF option\n");
-       }
-      else if (!RB_Str_Case_Cmp (*parameter, "TABSIZE") ||
-              !RB_Str_Case_Cmp (*parameter, "-TS"))
-       {
-         if (--parameter_nr)
-           {
-             parameter++;
-             tab_size = atoi (*parameter);
-           }
-         else
-           {
-             RB_Panic ("you must specify the number of spaces with the"
-                       " TABSIZE option\n");
-           }
-       }
-      else if (!RB_Str_Case_Cmp (*parameter, "GENXREF") ||
-              !RB_Str_Case_Cmp (*parameter, "-G"))
-       {
-         if (--parameter_nr)
-           {
-             ++parameter;
-             *output_file_for_xrefs = *parameter;
-             RB_Say ("GENXREF=\"%s\"\n", *output_file_for_xrefs);
-             course_of_action |= DO_MAKE_XREFS;
-             course_of_action &= ~DO_MAKE_DOCUMENT;
-           }
-         else
-           RB_Panic ("you must specify a xref file with the GENXREF option\n");
-       }
-      else
-       {
-         RB_Panic ("unknown option %s\n", *parameter);
-       }
-    }
-  if ((course_of_action & DO_USE_XREFS) &&
-      (output_mode == ASCII) &&
-      !(course_of_action & DO_INDEX))
-    {
-      printf ("%s: WARNING, you can not use xrefs when you generate\n"
-             "\t\tdocumentation in ASCII [discarding switch]\n",
-             argv[0]);
-      course_of_action &= ~DO_USE_XREFS;
-    }
-  if (course_of_action & DO_INDEX)
-    {
-      if ((output_mode != LATEX) && (output_mode != HTML)) { 
-           RB_Panic ("you can only use the INDEX option in combination with LATEX or HTML\n");
-      }
-    }
-}
-
-/******/
-
-
-
-/****i* ROBODoc/RB_Close_The_Shop [3.0b]
- * NAME
- *   RB_Close_The_Shop -- free resources.
- * SYNOPSIS
- *   void RB_Close_The_Shop ()
- * FUNCTION
- *   Frees all resources used by robodoc.
- * SEE ALSO
- *   RB_Free_Header(), RB_Free_Link()
- * SOURCE
- */
-
-void
-RB_Close_The_Shop (void)
-{
-  struct RB_header *cur_header, *tmp_header;
-  struct RB_link *cur_link, *tmp_link;
-
-  if (source)
-    fclose (source);
-  if (documentation)
-    fclose (documentation);
-  if (xreffiles_file)
-    fclose (xreffiles_file);
-  if (xref_file)
-    fclose (xref_file);
-
-  for (cur_header = first_header; cur_header;)
-    {
-      tmp_header = cur_header->next_header;
-      RB_Free_Header (cur_header);
-      cur_header = tmp_header;
-    }
-
-  for (cur_link = first_link; cur_link;)
-    {
-      tmp_link = cur_link->next_link;
-      RB_Free_Link (cur_link);
-      cur_link = tmp_link;
-    }
-
-  if (header_index)
-    free (header_index);
-  if (link_index)
-    free (link_index);
-}
-
-/******/
diff --git a/util/robodoc/Source/robodoc.h b/util/robodoc/Source/robodoc.h
deleted file mode 100644 (file)
index f806a3d..0000000
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- *    ROBODoc - a documentation extraction program for several languages.
- *
- *    Copyright (C) 1994-1999  Frans Slothouber and Jacco van Weert.
- *    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; either version 2 of the License, or
- *    (at your option) any later version.
- *
- *    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.
- *
- *    You should have received a copy of the GNU General Public License
- *    along with this program; if not, write to the Free Software
- *    Foundation, Inc., 59 Temple Place, Suite 330, Boston, 
- *    MA  02111-1307  USA
- *
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#ifndef VERSION
-#define VERSION "unknown"
-#endif
-
-#define COMMENT_ROBODOC \
-    "Generated with ROBODoc Version " VERSION " (" __DATE__ ")\n"
-#define COMMENT_COPYRIGHT\
-    "ROBODoc (c) 1994-2001 by Frans Slothouber and Jacco van Weert.\n"
-
-#define DO_SORT             (1<<0)
-#define DO_MAKE_XREFS       (1<<1)
-#define DO_USE_XREFS        (1<<2)
-#define DO_TOC              (1<<3)
-#define DO_MAKE_DOCUMENT    (1<<4)
-#define DO_INCLUDE_INTERNAL (1<<5)
-#define DO_INTERNAL_ONLY    (1<<6)
-#define DO_TELL             (1<<7)
-#define DO_INDEX            (1<<8)
-#define DO_SINGLEDOC        (1<<9)
-#define DO_NOSOURCE         (1<<10)
-
-/* Output Modes */
-
-enum
-  {
-    ASCII = 0, AMIGAGUIDE, HTML, LATEX, RTF, SIZE_MODES
-  };
-
-/* Reserved for Future Use */
-
-enum
-  {
-    ANSI, GNUINFO, TROFF, XML
-  };
-
-/* Evil macros !! */
-
-#define skip_while(cond) { for (;*cur_char && (cond);cur_char++) ; }
-#define find_eol   { for (;*cur_char && *cur_char!='\n';cur_char++) ; }
-#define find_quote { for (;*cur_char && *cur_char!='\"';cur_char++) ; }
-
-#ifndef FALSE
-#define FALSE 0
-#endif
-
-#ifndef TRUE
-#define TRUE  1
-#endif
-
-/* Prototypes */
-
-void RB_Analyse_Arguments (int, char **, char **, char **);
-void RB_Set_Doc_Base (char *path);
-void RB_Close_The_Shop (void);
-
-
-#define MAX_LINE_LEN 512
-
-extern char *whoami;
-extern char *document_title;
-extern int output_mode;
-extern int course_of_action;
-extern int tab_size;
-extern char doc_base[1024];    /* PetteriK */
-extern int line_number;
-extern char line_buffer[MAX_LINE_LEN];
diff --git a/util/robodoc/Source/stamp-h.in b/util/robodoc/Source/stamp-h.in
deleted file mode 100644 (file)
index 9788f70..0000000
+++ /dev/null
@@ -1 +0,0 @@
-timestamp
diff --git a/util/robodoc/Source/util.c b/util/robodoc/Source/util.c
deleted file mode 100644 (file)
index b663125..0000000
+++ /dev/null
@@ -1,686 +0,0 @@
-#include <stdio.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <ctype.h>
-#include <stdlib.h>
-#include <string.h>
-#include <stdarg.h>            /* for RB_Say() */
-
-#include "robodoc.h"
-#include "links.h"
-#include "headers.h"
-#include "folds.h"
-#include "items.h"
-#include "util.h"
-#include "time.h"
-
-
-
-
-/****f* ROBODoc/RB_FilePart [2.0x]
- * NAME
- *   RB_FilePart
- * SYNOPSIS
- *   char *RB_FilePart(char *file_name)
- * FUNCTION
- *   return the basename (like Amiga/Dos/FilePart())
- * NOTES
- *   koessi
- * SEE ALSO
- * SOURCE
- */
-
-char *
-RB_FilePart (char *file_name)
-{
-  char *cur_char;
-  char c;
-
-  if ((cur_char = file_name) != NULL)
-    {
-      for (; (c = *cur_char) != '\0'; ++cur_char)
-       {
-         if ((c == '/') || (c == ':'))
-           {
-             ++cur_char;
-             while ('/' == *cur_char)
-               ++cur_char;
-
-             if (*cur_char)
-               file_name = cur_char;
-           }
-       }
-    }
-  return (file_name);
-}
-
-/* Same except remove trailing dot (.). -Pekka */
-char *
-RB_FilePartStart (char *file_name)
-{
-  char *cur_char;
-  char c;
-
-  if ((cur_char = file_name) != NULL)
-    {
-      for (; (c = *cur_char) != '\0'; ++cur_char)
-       {
-         if ((c == '/') || (c == ':'))
-           {
-             ++cur_char;
-             while ('/' == *cur_char)
-               ++cur_char;
-
-             if (*cur_char)
-               file_name = cur_char;
-           }
-       }
-    }
-
-  if (strchr(file_name, '.'))
-    *strchr(file_name, '.') = '\0';
-
-  return (file_name);
-}
-
-/*** RB_File_Part ***/
-
-
-
-/****f* ROBODoc/RB_Analyse_Defaults_File [3.0b]
- * NAME
- *   RB_Analyse_Defaults_file -- read default from defaults file
- * SYNOPSIS
- *   RB_Analyse_Defaults_file
- * FUNCTION
- *   Read the default vaules from the default file.
- * NOTES
- *   FS: The use of while (!feof(defaults_file)) {
- *       is wrong here. Should check return value of
- *       fgets().
- * SOURCE
- */
-
-void
-RB_Analyse_Defaults_File ()
-{
-  FILE *defaults_file;
-
-  /* defaults file in working directory? */
-  defaults_file = fopen ("robodoc.defaults", "r");
-  if (defaults_file == NULL)
-    {
-      /* try again from the directory from 
-         which this application was started  */
-#ifdef _MSC_VER
-      /* windows */
-      char path[_MAX_PATH], *c;
-
-      strcpy (path, whoami);
-      if ((c = strrchr (path, '\\')) != NULL)
-       {
-         *c = '\0';
-         strcat (path, "\\");
-       }
-      strcat (path, "robodoc.defaults");
-      defaults_file = fopen (path, "r");
-#else
-      /* non-windows ... to be done */
-#endif /* _MSC_VER */
-    }
-  if (defaults_file != NULL)
-    {
-      while (!feof (defaults_file))
-       {
-         char *cur_char;
-
-         *line_buffer = '\0';
-
-         fgets (line_buffer, MAX_LINE_LEN, defaults_file);
-
-         if (*line_buffer != '\n')
-           {
-             int item_type;
-
-             item_type = RB_Get_Item_Type (line_buffer);
-             if (item_type != NO_ITEM)
-               {
-                 char *values;
-
-                 item_attributes[item_type] = ITEM_NAME_LARGE_FONT;
-
-                 cur_char = line_buffer + strlen (item_names[item_type]);
-                 for (; *cur_char && isspace (*cur_char); cur_char++);
-
-                 while (*cur_char)
-                   {
-                     for (values = cur_char;
-                          *cur_char && !isspace (*cur_char);
-                          cur_char++);
-                     if (*cur_char)
-                       {
-                         int item_attr;
-
-                         *cur_char = '\0';
-                         item_attr = RB_Get_Item_Attr (values);
-                         if (item_attr != MAKE_NORMAL)
-                           {
-                             RB_Say ("Default: %s = %s\n", 
-                                     item_names[item_type],
-                                     item_attr_names[item_attr]);
-                             item_attributes[item_type] |=
-                               (1 << (item_attr + 1));
-                           }
-                       }
-                     for (cur_char++; *cur_char && isspace (*cur_char);
-                          cur_char++);
-                   }
-               }
-           }
-       }
-      fclose (defaults_file);
-    }
-/* else { printf("%s: WARNING, robodoc.defaults file was not found.\n",
- * whoami); printf("\t\tyou should really use one.\n"); } */
-}
-
-/**********/
-
-
-
-/****f* ROBODoc/RB_Skip_Remark_Marker [2.0e]
- * NAME
- *    RB_Skip_Remark_Marker
- * SYNOPSIS
- *     text  = RB_Skip_Remark_Marker (line_buffer)
- *    char *                            char *
- * FUNCTION
- *    Scan and search for a recognized remark marker; skip past the
- *    marker to the body of the text
- * NOTE
- *    This should be in generator.c
- * SOURCE
- */
-
-char *
-RB_Skip_Remark_Marker (char *line_buffer)
-{
-  int marker, found;
-  char *cur_char, *cur_mchar;
-
-  found = FALSE;
-  cur_char = NULL;
-  for (marker = 0;
-       ((cur_mchar = remark_markers[marker]) != NULL) && !found;
-       marker++)
-    {
-      for (found = TRUE, cur_char = line_buffer;
-          *cur_mchar && *cur_char && found;
-          cur_mchar++, cur_char++)
-       {
-         if (tolower(*cur_mchar) != tolower(*cur_char))
-           found = FALSE;
-       }
-    }
-  return (cur_char);
-}
-
-/**************/
-
-
-
-
-/****f* ROBODoc/RB_Slow_Sort [2.0]
- * NAME
- *   RB_Slow_Sort -- sort list of headers alphabetically
- * SYNOPSIS
- *   RB_Slow_Sort ()
- * FUNCTION
- *   Sorts the list of headers according to the header name
- *   in alphabetically fashion.
- * NOTES
- *   This isn't a particularly speedy way of sorting.
- * SOURCE
- */
-
-void
-RB_Slow_Sort (void)
-{
-  struct RB_header *cur_header, *unsorted_headers, *bigger_header;
-
-  if ((unsorted_headers = first_header) != NULL)
-    {                          /* additional
-                                * check *koessi */
-      for (first_header = NULL;
-          unsorted_headers->next_header;)
-       {
-         for (bigger_header = unsorted_headers,
-              cur_header = bigger_header->next_header;
-              cur_header;
-              cur_header = cur_header->next_header)
-           {
-             if (strcmp (cur_header->name, bigger_header->name) > 0)
-               bigger_header = cur_header;
-           }
-         RB_Remove_From_List (&unsorted_headers, bigger_header);
-         RB_Insert_In_List (&first_header, bigger_header);
-       }
-      RB_Insert_In_List (&first_header, unsorted_headers);
-    }
-}
-
-/*********/
-
-
-/****f* ROBODoc/RB_Insert_In_List [2.0]
- * NAME
- *   RB_Insert_In_List -- Insert a header in a list.
- * SYNOPSIS
- *   RB_Insert_In_List (anchor,new_header)
- *
- *   RB_Insert_In_List (struct RB_header **, struct RB_header *)
- * FUNCTION
- *   Insert a node in a doubly linked list.
- * INPUTS
- *   anchor     - pointer to the first node in the list.
- *   new_header - node to be inserted.
- * MODIFICATION HISTORY
- *   8. August 1995      --  optimized by koessi
- * NOTES
- *   
- * SOURCE
- */
-
-void
-RB_Insert_In_List (struct RB_header **anchor,
-                  struct RB_header *new_header)
-{
-  struct RB_header *old_header;
-
-  if ((old_header = *anchor) != NULL)
-    old_header->prev_header = new_header;
-  new_header->next_header = old_header;
-  new_header->prev_header = NULL;
-  *anchor = new_header;
-}
-
-/*** RB_Insert_In_List ***/
-
-/****f* ROBODoc/RB_Reverse_List [2.0]
- * NAME
- *   RB_Reverse_List -- Insert a header in a list.
- * SYNOPSIS
- *   RB_Reverse_List (void)
- * FUNCTION
- *
- * INPUTS
- *
- * MODIFICATION HISTORY
- *
- * NOTES
- *
- * SOURCE
- */
-
-void
-RB_Reverse_List (void)
-{
-  struct RB_header *cur_header;
-  struct RB_header *temp_header;
-
-  for (cur_header = first_header;
-       cur_header;
-    )
-    {
-      first_header = cur_header;
-      temp_header = cur_header->next_header;
-      cur_header->next_header = cur_header->prev_header;
-      cur_header->prev_header = temp_header;
-      cur_header = temp_header;
-    }
-}
-
-/*** ***/
-
-
-/****f* ROBODoc/RB_Remove_From_List [2.0]
- * NAME
- *   RB_Remove_From_List -- remove a header from a list.
- * SYNOPSIS
- *   RB_Remove_From_List (anchor, old_header)
- *   RB_Remove_From_List (struct RB_header **, struct RB_header *)
- * MODIFICATION HISTORY
- *   8. August 1995      --  optimized by koessi
- * SOURCE
- */
-
-void
-RB_Remove_From_List (struct RB_header **anchor,
-                    struct RB_header *old_header)
-{
-  struct RB_header *next_header = old_header->next_header;
-  struct RB_header *prev_header = old_header->prev_header;
-
-  if (next_header)
-    next_header->prev_header = prev_header;
-  if (prev_header)
-    prev_header->next_header = next_header;
-  else
-    *anchor = next_header;
-}
-
-/********/
-
-
-/****f* ROBODoc/RB_Alloc_Header [2.01]
- * NAME
- *   RB_Alloc_Header            -- oop
- * SYNOPSIS
- *   struct RB_header *RB_Alloc_Header( void )
- * FUNCTION
- *   allocate the struct RB_header
- * RESULT
- *   struct RB_header *      -- all attributes/pointers set to zero
- * AUTHOR
- *   Koessi
- * SEE ALSO
- *   RB_Free_Header()
- * SOURCE
- */
-
-struct RB_header *
-RB_Alloc_Header (void)
-{
-  struct RB_header *new_header;
-
-  if ((new_header = malloc (sizeof (struct RB_header))) != NULL)
-      memset (new_header, 0, sizeof (struct RB_header));
-  else
-    RB_Panic ("out of memory! [Alloc Header]\n");
-  return (new_header);
-}
-
-/********/
-
-
-/****f* ROBODoc/RB_Free_Header [2.01]
- * NAME
- *   RB_Free_Header             -- oop
- * SYNOPSIS
- *   void RB_Free_Header( struct RB_header *header )
- * FUNCTION
- *   free struct RB_header and associated strings
- * INPUTS
- *   struct RB_header *header -- this one
- * AUTHOR
- *   Koessi
- * SEE ALSO
- *   RB_Alloc_Header(), RB_Close_The_Shop()
- * SOURCE
- */
-
-void
-RB_Free_Header (struct RB_header *header)
-{
-  if (header)
-    {
-      if (header->version)
-       free (header->version);
-      if (header->name)
-       free (header->name);
-      if (header->contents)
-       free (header->contents);
-      free (header);
-    }
-}
-
-/************/
-
-
-/****i* ROBODoc/RB_WordLen [2.01]
- * NAME
- *   RB_WordLen -- like strlen
- * SYNOPSIS
- *   int RB_WordLen( char *str )
- * FUNCTION
- *   get the amount of bytes until next space
- * INPUTS
- *   char *str -- the word
- * RESULT
- *   int -- length of the next word or 0
- * AUTHOR
- *   Koessi
- * SEE ALSO
- *   RB_Find_Header_Name()
- * SOURCE
- */
-
-int
-RB_WordLen (char *str)
-{
-  int len;
-  char c;
-
-  for (len = 0; ((c = *str) != '\0') && !isspace (c) && (c != '\n');
-       ++str, ++len);
-  return (len);
-}
-
-/*** RB_WordLen ***/
-
-
-/****i* ROBODoc/RB_StrDup [2.01]
- * NAME
- *   RB_StrDup
- * SYNOPSIS
- *   char *RB_StrDup( char *str )
- * FUNCTION
- *   duplicate the given string
- * INPUTS
- *   char *str               -- source
- * RESULT
- *   char *                  -- destination
- * AUTHOR
- *   Koessi
- * SOURCE
- */
-
-char *
-RB_StrDup (char *str)
-{
-  char *dupstr;
-  if ((dupstr = malloc ((strlen (str) + 1) * sizeof (char))) != NULL)
-      strcpy (dupstr, str);
-  else
-    RB_Panic ("out of memory! [StrDup]\n");
-  return (dupstr);
-}
-
-/*** RB_StrDup ***/
-
-
-/****f* ROBODoc/RB_CookStr [3.0h]
- * NAME
- *   RB_CookStr
- * SYNOPSIS
- *   char *RB_CookStr( char *str )
- * FUNCTION
- *   duplicate the given string, massaging it for the current output_mode
- * INPUTS
- *   char *str               -- source
- * RESULT
- *   char *                  -- destination
- * AUTHOR
- *   apang
- * NOTES
- *   Doesn't try/need to be as aggressive as RB_Generate_Item_Body()
- * SOURCE
- */
-
-char *
-RB_CookStr (char *str)
-{
-  static char work_buf[MAX_LINE_LEN];
-  char *cptr, c;
-  int i;
-
-  cptr = work_buf;
-  switch (output_mode)
-    {
-    case LATEX:
-      for (i = 0; ((c = *str++) != '\0') && (i < (MAX_LINE_LEN - 1));)
-       {
-         i++;
-         if (c == '_')
-           {
-             if (i < (MAX_LINE_LEN - 1))
-               {
-                 *cptr++ = '\\';
-                 *cptr++ = '_';
-                 i++;
-               }
-             else
-               {
-                 break;
-               }
-           }
-         else
-           {
-             *cptr++ = c;
-           }
-       }
-      break;
-
-    case RTF:
-      for (; (c = *str++) != '\0';)
-       {
-         if (isalnum (c) || c == '.' || c == '_')
-           {
-             *cptr++ = c;
-           }
-       }
-      break;
-
-    default:
-      return RB_StrDup (str);
-    }
-
-  *cptr = '\0';
-  return RB_StrDup (work_buf);
-}
-
-/*** RB_CookStr ***/
-
-
-/****f* ROBODoc/RB_Say [2.01]
- * NAME
- *   RB_Say                     -- varargs
- * SYNOPSIS
- *   void RB_Say( char *what, char *why, ... )
- * FUNCTION
- *   say what's going on
- * INPUTS
- *   char *format            -- formatstring
- *    ...                    -- parameters
- * AUTHOR
- *   Koessi
- * SOURCE
- */
-
-void
-RB_Say (char *format,...)
-{
-  va_list ap;
-
-  if (course_of_action & DO_TELL)
-    {
-      va_start (ap, format);
-      printf ("%s: ", whoami);
-      vprintf (format, ap);
-      va_end (ap);
-    }
-}
-
-/*** RB_Say ***/
-
-
-/****f* ROBODoc/RB_Panic [2.01]
- * NAME
- *   RB_Panic -- free resources and shut down
- * SYNOPSIS
- *   void RB_Panic( char *format, char *why, ... )
- * FUNCTION
- *   Print error message.
- *   Frees all resources used by robodoc.
- *   Terminates program
- * INPUTS
- *   char *format            -- formatstring
- *   ...                     -- parameters
- * AUTHOR
- *   Koessi
- * SOURCE
- */
-
-void
-RB_Panic (char *format,...)
-{
-  va_list ap;
-
-  va_start (ap, format);
-  printf ("%s: FATAL ERROR - [line %d]\n", whoami, line_number);
-  printf ("%s: %s\n%s: ", whoami, line_buffer, whoami);
-  vprintf (format, ap);
-  printf ("%s: closing down...\n", whoami);
-  va_end (ap);
-  RB_Close_The_Shop ();
-  exit (EXIT_FAILURE);
-}
-
-/*** RB_Panic ***/
-
-
-
-
-/****f* ROBODoc/RB_Str_Case_Cmp
- * NAME
- *   RB_Str_Case_Cmp
- * SYNOPSIS
- *   int      RB_Str_Case_Cmp(char *, char *)
- *   result = RB_Str_Case_Cmp(s, t)
- * FUNCTION
- *   Compare two strings, regardless of the case of the characters.
- * RESULT
- *    0  s == t
- *   -1  s < t
- *    1  s > t
- * SOURCE
- */
-
-int
-RB_Str_Case_Cmp (char *s, char *t)
-{
-  for (; tolower (*s) == tolower (*t); s++, t++)
-    if (*s == '\0')
-      return 0;
-  return (int) (tolower (*s) - tolower (*t));
-}
-
-/*********/
-
-
-/****f* ROBODoc/RB_TimeStamp
- * NAME
- *   RB_TimeStamp -- print a time stamp
- *****
- */
-
-void 
-RB_TimeStamp (FILE * f)
-{
-  time_t ttp;
-  char timeBuffer[255];
-
-  time (&ttp);
-  strftime (timeBuffer, 255, "%a %b %d %H:%M:%S %Y\n", localtime (&ttp));
-  fprintf (f, "%s", timeBuffer);
-}
diff --git a/util/robodoc/Source/util.h b/util/robodoc/Source/util.h
deleted file mode 100644 (file)
index 7f78abe..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-
-
-
-
-
-
-
-#ifndef ROBODOC_UTIL_H
-#define ROBODOC_UTIL_H
-
-char *RB_FilePart (char *);
-void RB_Analyse_Defaults_File (void);
-char *RB_Skip_Remark_Marker (char *line_buffer);
-void RB_Slow_Sort (void);
-void RB_Reverse_List (void);
-void RB_Insert_In_List (struct RB_header **, struct RB_header *);
-void RB_Remove_From_List (struct RB_header **, struct RB_header *);
-struct RB_header *RB_Alloc_Header (void);
-void RB_Free_Header (struct RB_header *);
-int RB_WordLen (char *);
-char *RB_StrDup (char *);
-char *RB_CookStr (char *);
-void RB_Say (char *,...);
-void RB_Panic (char *,...);
-void RB_Close_The_Shop (void);
-int RB_Str_Case_Cmp (char *s, char *t);
-void RB_TimeStamp (FILE * f);
-
-
-#endif /* ROBODOC_UTIL_H */
diff --git a/util/robodoc/TODO b/util/robodoc/TODO
deleted file mode 100644 (file)
index 02bb304..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-My wish list:
-
-o Add XML output
-o Improve the support for LaTeX. Instead of a lot of
-  individual documents robodoc should create one big
-  book with documentation. 
-o Fix the man page so that it also looks good with tkMan
-
diff --git a/util/robodoc/aclocal.m4 b/util/robodoc/aclocal.m4
deleted file mode 100644 (file)
index f244d77..0000000
+++ /dev/null
@@ -1,811 +0,0 @@
-# generated automatically by aclocal 1.7 -*- Autoconf -*-
-
-# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002
-# Free Software Foundation, Inc.
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
-# Like AC_CONFIG_HEADER, but automatically create stamp file. -*- Autoconf -*-
-
-# Copyright 1996, 1997, 2000, 2001 Free Software Foundation, Inc.
-
-# 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; either version 2, or (at your option)
-# any later version.
-
-# 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.
-
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-# 02111-1307, USA.
-
-AC_PREREQ([2.52])
-
-# serial 6
-
-# AM_CONFIG_HEADER is obsolete.  It has been replaced by AC_CONFIG_HEADERS.
-AU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)])
-
-# Do all the work for Automake.                            -*- Autoconf -*-
-
-# This macro actually does too much some checks are only needed if
-# your package does certain things.  But this isn't really a big deal.
-
-# Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002
-# Free Software Foundation, Inc.
-
-# 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; either version 2, or (at your option)
-# any later version.
-
-# 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.
-
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-# 02111-1307, USA.
-
-# serial 8
-
-# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
-# written in clear, in which case automake, when reading aclocal.m4,
-# will think it sees a *use*, and therefore will trigger all it's
-# C support machinery.  Also note that it means that autoscan, seeing
-# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
-
-
-AC_PREREQ([2.54])
-
-# Autoconf 2.50 wants to disallow AM_ names.  We explicitly allow
-# the ones we care about.
-m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
-
-# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
-# AM_INIT_AUTOMAKE([OPTIONS])
-# -----------------------------------------------
-# The call with PACKAGE and VERSION arguments is the old style
-# call (pre autoconf-2.50), which is being phased out.  PACKAGE
-# and VERSION should now be passed to AC_INIT and removed from
-# the call to AM_INIT_AUTOMAKE.
-# We support both call styles for the transition.  After
-# the next Automake release, Autoconf can make the AC_INIT
-# arguments mandatory, and then we can depend on a new Autoconf
-# release and drop the old call support.
-AC_DEFUN([AM_INIT_AUTOMAKE],
-[AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
- AC_REQUIRE([AC_PROG_INSTALL])dnl
-# test to see if srcdir already configured
-if test "`cd $srcdir && pwd`" != "`pwd`" &&
-   test -f $srcdir/config.status; then
-  AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
-fi
-
-# test whether we have cygpath
-if test -z "$CYGPATH_W"; then
-  if (cygpath --version) >/dev/null 2>/dev/null; then
-    CYGPATH_W='cygpath -w'
-  else
-    CYGPATH_W=echo
-  fi
-fi
-AC_SUBST([CYGPATH_W])
-
-# Define the identity of the package.
-dnl Distinguish between old-style and new-style calls.
-m4_ifval([$2],
-[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
- AC_SUBST([PACKAGE], [$1])dnl
- AC_SUBST([VERSION], [$2])],
-[_AM_SET_OPTIONS([$1])dnl
- AC_SUBST([PACKAGE], [AC_PACKAGE_TARNAME])dnl
- AC_SUBST([VERSION], [AC_PACKAGE_VERSION])])dnl
-
-_AM_IF_OPTION([no-define],,
-[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
- AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
-
-# Some tools Automake needs.
-AC_REQUIRE([AM_SANITY_CHECK])dnl
-AC_REQUIRE([AC_ARG_PROGRAM])dnl
-AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
-AM_MISSING_PROG(AUTOCONF, autoconf)
-AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
-AM_MISSING_PROG(AUTOHEADER, autoheader)
-AM_MISSING_PROG(MAKEINFO, makeinfo)
-AM_MISSING_PROG(AMTAR, tar)
-AM_PROG_INSTALL_SH
-AM_PROG_INSTALL_STRIP
-# We need awk for the "check" target.  The system "awk" is bad on
-# some platforms.
-AC_REQUIRE([AC_PROG_AWK])dnl
-AC_REQUIRE([AC_PROG_MAKE_SET])dnl
-
-_AM_IF_OPTION([no-dependencies],,
-[AC_PROVIDE_IFELSE([AC_PROG_CC],
-                  [_AM_DEPENDENCIES(CC)],
-                  [define([AC_PROG_CC],
-                          defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
-AC_PROVIDE_IFELSE([AC_PROG_CXX],
-                  [_AM_DEPENDENCIES(CXX)],
-                  [define([AC_PROG_CXX],
-                          defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
-])
-])
-
-
-# When config.status generates a header, we must update the stamp-h file.
-# This file resides in the same directory as the config header
-# that is generated.  The stamp files are numbered to have different names.
-
-# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
-# loop where config.status creates the headers, so we can generate
-# our stamp files there.
-AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
-[_am_stamp_count=`expr ${_am_stamp_count-0} + 1`
-echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count])
-
-# Copyright 2002  Free Software Foundation, Inc.
-
-# 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; either version 2, or (at your option)
-# any later version.
-
-# 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.
-
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-
-# AM_AUTOMAKE_VERSION(VERSION)
-# ----------------------------
-# Automake X.Y traces this macro to ensure aclocal.m4 has been
-# generated from the m4 files accompanying Automake X.Y.
-AC_DEFUN([AM_AUTOMAKE_VERSION],[am__api_version="1.7"])
-
-# AM_SET_CURRENT_AUTOMAKE_VERSION
-# -------------------------------
-# Call AM_AUTOMAKE_VERSION so it can be traced.
-# This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
-AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
-        [AM_AUTOMAKE_VERSION([1.7])])
-
-# Helper functions for option handling.                    -*- Autoconf -*-
-
-# Copyright 2001, 2002  Free Software Foundation, Inc.
-
-# 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; either version 2, or (at your option)
-# any later version.
-
-# 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.
-
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-# 02111-1307, USA.
-
-# serial 2
-
-# _AM_MANGLE_OPTION(NAME)
-# -----------------------
-AC_DEFUN([_AM_MANGLE_OPTION],
-[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
-
-# _AM_SET_OPTION(NAME)
-# ------------------------------
-# Set option NAME.  Presently that only means defining a flag for this option.
-AC_DEFUN([_AM_SET_OPTION],
-[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
-
-# _AM_SET_OPTIONS(OPTIONS)
-# ----------------------------------
-# OPTIONS is a space-separated list of Automake options.
-AC_DEFUN([_AM_SET_OPTIONS],
-[AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
-
-# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
-# -------------------------------------------
-# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
-AC_DEFUN([_AM_IF_OPTION],
-[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
-
-#
-# Check to make sure that the build environment is sane.
-#
-
-# Copyright 1996, 1997, 2000, 2001 Free Software Foundation, Inc.
-
-# 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; either version 2, or (at your option)
-# any later version.
-
-# 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.
-
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-# 02111-1307, USA.
-
-# serial 3
-
-# AM_SANITY_CHECK
-# ---------------
-AC_DEFUN([AM_SANITY_CHECK],
-[AC_MSG_CHECKING([whether build environment is sane])
-# Just in case
-sleep 1
-echo timestamp > conftest.file
-# Do `set' in a subshell so we don't clobber the current shell's
-# arguments.  Must try -L first in case configure is actually a
-# symlink; some systems play weird games with the mod time of symlinks
-# (eg FreeBSD returns the mod time of the symlink's containing
-# directory).
-if (
-   set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
-   if test "$[*]" = "X"; then
-      # -L didn't work.
-      set X `ls -t $srcdir/configure conftest.file`
-   fi
-   rm -f conftest.file
-   if test "$[*]" != "X $srcdir/configure conftest.file" \
-      && test "$[*]" != "X conftest.file $srcdir/configure"; then
-
-      # If neither matched, then we have a broken ls.  This can happen
-      # if, for instance, CONFIG_SHELL is bash and it inherits a
-      # broken ls alias from the environment.  This has actually
-      # happened.  Such a system could not be considered "sane".
-      AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
-alias in your environment])
-   fi
-
-   test "$[2]" = conftest.file
-   )
-then
-   # Ok.
-   :
-else
-   AC_MSG_ERROR([newly created file is older than distributed files!
-Check your system clock])
-fi
-AC_MSG_RESULT(yes)])
-
-#  -*- Autoconf -*-
-
-
-# Copyright 1997, 1999, 2000, 2001 Free Software Foundation, Inc.
-
-# 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; either version 2, or (at your option)
-# any later version.
-
-# 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.
-
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-# 02111-1307, USA.
-
-# serial 3
-
-# AM_MISSING_PROG(NAME, PROGRAM)
-# ------------------------------
-AC_DEFUN([AM_MISSING_PROG],
-[AC_REQUIRE([AM_MISSING_HAS_RUN])
-$1=${$1-"${am_missing_run}$2"}
-AC_SUBST($1)])
-
-
-# AM_MISSING_HAS_RUN
-# ------------------
-# Define MISSING if not defined so far and test if it supports --run.
-# If it does, set am_missing_run to use it, otherwise, to nothing.
-AC_DEFUN([AM_MISSING_HAS_RUN],
-[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
-test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
-# Use eval to expand $SHELL
-if eval "$MISSING --run true"; then
-  am_missing_run="$MISSING --run "
-else
-  am_missing_run=
-  AC_MSG_WARN([`missing' script is too old or missing])
-fi
-])
-
-# AM_AUX_DIR_EXPAND
-
-# Copyright 2001 Free Software Foundation, Inc.
-
-# 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; either version 2, or (at your option)
-# any later version.
-
-# 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.
-
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-# 02111-1307, USA.
-
-# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
-# $ac_aux_dir to `$srcdir/foo'.  In other projects, it is set to
-# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
-#
-# Of course, Automake must honor this variable whenever it calls a
-# tool from the auxiliary directory.  The problem is that $srcdir (and
-# therefore $ac_aux_dir as well) can be either absolute or relative,
-# depending on how configure is run.  This is pretty annoying, since
-# it makes $ac_aux_dir quite unusable in subdirectories: in the top
-# source directory, any form will work fine, but in subdirectories a
-# relative path needs to be adjusted first.
-#
-# $ac_aux_dir/missing
-#    fails when called from a subdirectory if $ac_aux_dir is relative
-# $top_srcdir/$ac_aux_dir/missing
-#    fails if $ac_aux_dir is absolute,
-#    fails when called from a subdirectory in a VPATH build with
-#          a relative $ac_aux_dir
-#
-# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
-# are both prefixed by $srcdir.  In an in-source build this is usually
-# harmless because $srcdir is `.', but things will broke when you
-# start a VPATH build or use an absolute $srcdir.
-#
-# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
-# iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
-#   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
-# and then we would define $MISSING as
-#   MISSING="\${SHELL} $am_aux_dir/missing"
-# This will work as long as MISSING is not called from configure, because
-# unfortunately $(top_srcdir) has no meaning in configure.
-# However there are other variables, like CC, which are often used in
-# configure, and could therefore not use this "fixed" $ac_aux_dir.
-#
-# Another solution, used here, is to always expand $ac_aux_dir to an
-# absolute PATH.  The drawback is that using absolute paths prevent a
-# configured tree to be moved without reconfiguration.
-
-# Rely on autoconf to set up CDPATH properly.
-AC_PREREQ([2.50])
-
-AC_DEFUN([AM_AUX_DIR_EXPAND], [
-# expand $ac_aux_dir to an absolute path
-am_aux_dir=`cd $ac_aux_dir && pwd`
-])
-
-# AM_PROG_INSTALL_SH
-# ------------------
-# Define $install_sh.
-
-# Copyright 2001 Free Software Foundation, Inc.
-
-# 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; either version 2, or (at your option)
-# any later version.
-
-# 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.
-
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-# 02111-1307, USA.
-
-AC_DEFUN([AM_PROG_INSTALL_SH],
-[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
-install_sh=${install_sh-"$am_aux_dir/install-sh"}
-AC_SUBST(install_sh)])
-
-# AM_PROG_INSTALL_STRIP
-
-# Copyright 2001 Free Software Foundation, Inc.
-
-# 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; either version 2, or (at your option)
-# any later version.
-
-# 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.
-
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-# 02111-1307, USA.
-
-# One issue with vendor `install' (even GNU) is that you can't
-# specify the program used to strip binaries.  This is especially
-# annoying in cross-compiling environments, where the build's strip
-# is unlikely to handle the host's binaries.
-# Fortunately install-sh will honor a STRIPPROG variable, so we
-# always use install-sh in `make install-strip', and initialize
-# STRIPPROG with the value of the STRIP variable (set by the user).
-AC_DEFUN([AM_PROG_INSTALL_STRIP],
-[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
-# Installed binaries are usually stripped using `strip' when the user
-# run `make install-strip'.  However `strip' might not be the right
-# tool to use in cross-compilation environments, therefore Automake
-# will honor the `STRIP' environment variable to overrule this program.
-dnl Don't test for $cross_compiling = yes, because it might be `maybe'.
-if test "$cross_compiling" != no; then
-  AC_CHECK_TOOL([STRIP], [strip], :)
-fi
-INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s"
-AC_SUBST([INSTALL_STRIP_PROGRAM])])
-
-# serial 4                                             -*- Autoconf -*-
-
-# Copyright 1999, 2000, 2001 Free Software Foundation, Inc.
-
-# 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; either version 2, or (at your option)
-# any later version.
-
-# 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.
-
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-# 02111-1307, USA.
-
-
-# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
-# written in clear, in which case automake, when reading aclocal.m4,
-# will think it sees a *use*, and therefore will trigger all it's
-# C support machinery.  Also note that it means that autoscan, seeing
-# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
-
-
-
-# _AM_DEPENDENCIES(NAME)
-# ----------------------
-# See how the compiler implements dependency checking.
-# NAME is "CC", "CXX", "GCJ", or "OBJC".
-# We try a few techniques and use that to set a single cache variable.
-#
-# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
-# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
-# dependency, and given that the user is not expected to run this macro,
-# just rely on AC_PROG_CC.
-AC_DEFUN([_AM_DEPENDENCIES],
-[AC_REQUIRE([AM_SET_DEPDIR])dnl
-AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
-AC_REQUIRE([AM_MAKE_INCLUDE])dnl
-AC_REQUIRE([AM_DEP_TRACK])dnl
-
-ifelse([$1], CC,   [depcc="$CC"   am_compiler_list=],
-       [$1], CXX,  [depcc="$CXX"  am_compiler_list=],
-       [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
-       [$1], GCJ,  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
-                   [depcc="$$1"   am_compiler_list=])
-
-AC_CACHE_CHECK([dependency style of $depcc],
-               [am_cv_$1_dependencies_compiler_type],
-[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
-  # We make a subdir and do the tests there.  Otherwise we can end up
-  # making bogus files that we don't know about and never remove.  For
-  # instance it was reported that on HP-UX the gcc test will end up
-  # making a dummy file named `D' -- because `-MD' means `put the output
-  # in D'.
-  mkdir conftest.dir
-  # Copy depcomp to subdir because otherwise we won't find it if we're
-  # using a relative directory.
-  cp "$am_depcomp" conftest.dir
-  cd conftest.dir
-
-  am_cv_$1_dependencies_compiler_type=none
-  if test "$am_compiler_list" = ""; then
-     am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
-  fi
-  for depmode in $am_compiler_list; do
-    # We need to recreate these files for each test, as the compiler may
-    # overwrite some of them when testing with obscure command lines.
-    # This happens at least with the AIX C compiler.
-    echo '#include "conftest.h"' > conftest.c
-    echo 'int i;' > conftest.h
-    echo "${am__include} ${am__quote}conftest.Po${am__quote}" > confmf
-
-    case $depmode in
-    nosideeffect)
-      # after this tag, mechanisms are not by side-effect, so they'll
-      # only be used when explicitly requested
-      if test "x$enable_dependency_tracking" = xyes; then
-       continue
-      else
-       break
-      fi
-      ;;
-    none) break ;;
-    esac
-    # We check with `-c' and `-o' for the sake of the "dashmstdout"
-    # mode.  It turns out that the SunPro C++ compiler does not properly
-    # handle `-M -o', and we need to detect this.
-    if depmode=$depmode \
-       source=conftest.c object=conftest.o \
-       depfile=conftest.Po tmpdepfile=conftest.TPo \
-       $SHELL ./depcomp $depcc -c conftest.c -o conftest.o >/dev/null 2>&1 &&
-       grep conftest.h conftest.Po > /dev/null 2>&1 &&
-       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
-      am_cv_$1_dependencies_compiler_type=$depmode
-      break
-    fi
-  done
-
-  cd ..
-  rm -rf conftest.dir
-else
-  am_cv_$1_dependencies_compiler_type=none
-fi
-])
-AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
-AM_CONDITIONAL([am__fastdep$1], [
-  test "x$enable_dependency_tracking" != xno \
-  && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
-])
-
-
-# AM_SET_DEPDIR
-# -------------
-# Choose a directory name for dependency files.
-# This macro is AC_REQUIREd in _AM_DEPENDENCIES
-AC_DEFUN([AM_SET_DEPDIR],
-[rm -f .deps 2>/dev/null
-mkdir .deps 2>/dev/null
-if test -d .deps; then
-  DEPDIR=.deps
-else
-  # MS-DOS does not allow filenames that begin with a dot.
-  DEPDIR=_deps
-fi
-rmdir .deps 2>/dev/null
-AC_SUBST([DEPDIR])
-])
-
-
-# AM_DEP_TRACK
-# ------------
-AC_DEFUN([AM_DEP_TRACK],
-[AC_ARG_ENABLE(dependency-tracking,
-[  --disable-dependency-tracking Speeds up one-time builds
-  --enable-dependency-tracking  Do not reject slow dependency extractors])
-if test "x$enable_dependency_tracking" != xno; then
-  am_depcomp="$ac_aux_dir/depcomp"
-  AMDEPBACKSLASH='\'
-fi
-AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
-AC_SUBST([AMDEPBACKSLASH])
-])
-
-# Generate code to set up dependency tracking.   -*- Autoconf -*-
-
-# Copyright 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
-
-# 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; either version 2, or (at your option)
-# any later version.
-
-# 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.
-
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-# 02111-1307, USA.
-
-#serial 2
-
-# _AM_OUTPUT_DEPENDENCY_COMMANDS
-# ------------------------------
-AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
-[for mf in $CONFIG_FILES; do
-  # Strip MF so we end up with the name of the file.
-  mf=`echo "$mf" | sed -e 's/:.*$//'`
-  # Check whether this is an Automake generated Makefile or not.
-  # We used to match only the files named `Makefile.in', but
-  # some people rename them; so instead we look at the file content.
-  # Grep'ing the first line is not enough: some people post-process
-  # each Makefile.in and add a new line on top of each file to say so.
-  # So let's grep whole file.
-  if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then
-    dirpart=`AS_DIRNAME("$mf")`
-  else
-    continue
-  fi
-  grep '^DEP_FILES *= *[[^ @%:@]]' < "$mf" > /dev/null || continue
-  # Extract the definition of DEP_FILES from the Makefile without
-  # running `make'.
-  DEPDIR=`sed -n -e '/^DEPDIR = / s///p' < "$mf"`
-  test -z "$DEPDIR" && continue
-  # When using ansi2knr, U may be empty or an underscore; expand it
-  U=`sed -n -e '/^U = / s///p' < "$mf"`
-  test -d "$dirpart/$DEPDIR" || mkdir "$dirpart/$DEPDIR"
-  # We invoke sed twice because it is the simplest approach to
-  # changing $(DEPDIR) to its actual value in the expansion.
-  for file in `sed -n -e '
-    /^DEP_FILES = .*\\\\$/ {
-      s/^DEP_FILES = //
-      :loop
-       s/\\\\$//
-       p
-       n
-       /\\\\$/ b loop
-      p
-    }
-    /^DEP_FILES = / s/^DEP_FILES = //p' < "$mf" | \
-       sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
-    # Make sure the directory exists.
-    test -f "$dirpart/$file" && continue
-    fdir=`AS_DIRNAME(["$file"])`
-    AS_MKDIR_P([$dirpart/$fdir])
-    # echo "creating $dirpart/$file"
-    echo '# dummy' > "$dirpart/$file"
-  done
-done
-])# _AM_OUTPUT_DEPENDENCY_COMMANDS
-
-
-# AM_OUTPUT_DEPENDENCY_COMMANDS
-# -----------------------------
-# This macro should only be invoked once -- use via AC_REQUIRE.
-#
-# This code is only required when automatic dependency tracking
-# is enabled.  FIXME.  This creates each `.P' file that we will
-# need in order to bootstrap the dependency handling code.
-AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
-[AC_CONFIG_COMMANDS([depfiles],
-     [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
-     [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
-])
-
-# Check to see how 'make' treats includes.     -*- Autoconf -*-
-
-# Copyright (C) 2001, 2002 Free Software Foundation, Inc.
-
-# 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; either version 2, or (at your option)
-# any later version.
-
-# 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.
-
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-# 02111-1307, USA.
-
-# serial 2
-
-# AM_MAKE_INCLUDE()
-# -----------------
-# Check to see how make treats includes.
-AC_DEFUN([AM_MAKE_INCLUDE],
-[am_make=${MAKE-make}
-cat > confinc << 'END'
-doit:
-       @echo done
-END
-# If we don't find an include directive, just comment out the code.
-AC_MSG_CHECKING([for style of include used by $am_make])
-am__include="#"
-am__quote=
-_am_result=none
-# First try GNU make style include.
-echo "include confinc" > confmf
-# We grep out `Entering directory' and `Leaving directory'
-# messages which can occur if `w' ends up in MAKEFLAGS.
-# In particular we don't look at `^make:' because GNU make might
-# be invoked under some other name (usually "gmake"), in which
-# case it prints its new name instead of `make'.
-if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
-   am__include=include
-   am__quote=
-   _am_result=GNU
-fi
-# Now try BSD make style include.
-if test "$am__include" = "#"; then
-   echo '.include "confinc"' > confmf
-   if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
-      am__include=.include
-      am__quote="\""
-      _am_result=BSD
-   fi
-fi
-AC_SUBST(am__include)
-AC_SUBST(am__quote)
-AC_MSG_RESULT($_am_result)
-rm -f confinc confmf
-])
-
-# AM_CONDITIONAL                                              -*- Autoconf -*-
-
-# Copyright 1997, 2000, 2001 Free Software Foundation, Inc.
-
-# 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; either version 2, or (at your option)
-# any later version.
-
-# 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.
-
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-# 02111-1307, USA.
-
-# serial 5
-
-AC_PREREQ(2.52)
-
-# AM_CONDITIONAL(NAME, SHELL-CONDITION)
-# -------------------------------------
-# Define a conditional.
-AC_DEFUN([AM_CONDITIONAL],
-[ifelse([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
-        [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
-AC_SUBST([$1_TRUE])
-AC_SUBST([$1_FALSE])
-if $2; then
-  $1_TRUE=
-  $1_FALSE='#'
-else
-  $1_TRUE='#'
-  $1_FALSE=
-fi
-AC_CONFIG_COMMANDS_PRE(
-[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
-  AC_MSG_ERROR([conditional "$1" was never defined.
-Usually this means the macro was only invoked conditionally.])
-fi])])
-
diff --git a/util/robodoc/configure b/util/robodoc/configure
deleted file mode 100755 (executable)
index da9fd55..0000000
+++ /dev/null
@@ -1,4795 +0,0 @@
-#! /bin/sh
-# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.54.
-#
-# Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002
-# Free Software Foundation, Inc.
-# This configure script is free software; the Free Software Foundation
-# gives unlimited permission to copy, distribute and modify it.
-## --------------------- ##
-## M4sh Initialization.  ##
-## --------------------- ##
-
-# Be Bourne compatible
-if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
-  emulate sh
-  NULLCMD=:
-  # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
-  # is contrary to our usage.  Disable this feature.
-  alias -g '${1+"$@"}'='"$@"'
-elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
-  set -o posix
-fi
-
-# Support unset when possible.
-if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
-  as_unset=unset
-else
-  as_unset=false
-fi
-
-
-# Work around bugs in pre-3.0 UWIN ksh.
-$as_unset ENV MAIL MAILPATH
-PS1='$ '
-PS2='> '
-PS4='+ '
-
-# NLS nuisances.
-for as_var in LANG LANGUAGE LC_ALL LC_COLLATE LC_CTYPE LC_NUMERIC LC_MESSAGES LC_TIME
-do
-  if (set +x; test -n "`(eval $as_var=C; export $as_var) 2>&1`"); then
-    eval $as_var=C; export $as_var
-  else
-    $as_unset $as_var
-  fi
-done
-
-# Required to use basename.
-if expr a : '\(a\)' >/dev/null 2>&1; then
-  as_expr=expr
-else
-  as_expr=false
-fi
-
-if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then
-  as_basename=basename
-else
-  as_basename=false
-fi
-
-
-# Name of the executable.
-as_me=`$as_basename "$0" ||
-$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
-        X"$0" : 'X\(//\)$' \| \
-        X"$0" : 'X\(/\)$' \| \
-        .     : '\(.\)' 2>/dev/null ||
-echo X/"$0" |
-    sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; }
-         /^X\/\(\/\/\)$/{ s//\1/; q; }
-         /^X\/\(\/\).*/{ s//\1/; q; }
-         s/.*/./; q'`
-
-
-# PATH needs CR, and LINENO needs CR and PATH.
-# Avoid depending upon Character Ranges.
-as_cr_letters='abcdefghijklmnopqrstuvwxyz'
-as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
-as_cr_Letters=$as_cr_letters$as_cr_LETTERS
-as_cr_digits='0123456789'
-as_cr_alnum=$as_cr_Letters$as_cr_digits
-
-# The user is always right.
-if test "${PATH_SEPARATOR+set}" != set; then
-  echo "#! /bin/sh" >conftest.sh
-  echo  "exit 0"   >>conftest.sh
-  chmod +x conftest.sh
-  if (PATH="/nonexistent;."; conftest.sh) >/dev/null 2>&1; then
-    PATH_SEPARATOR=';'
-  else
-    PATH_SEPARATOR=:
-  fi
-  rm -f conftest.sh
-fi
-
-
-  as_lineno_1=$LINENO
-  as_lineno_2=$LINENO
-  as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
-  test "x$as_lineno_1" != "x$as_lineno_2" &&
-  test "x$as_lineno_3"  = "x$as_lineno_2"  || {
-  # Find who we are.  Look in the path if we contain no path at all
-  # relative or not.
-  case $0 in
-    *[\\/]* ) as_myself=$0 ;;
-    *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
-done
-
-       ;;
-  esac
-  # We did not find ourselves, most probably we were run as `sh COMMAND'
-  # in which case we are not to be found in the path.
-  if test "x$as_myself" = x; then
-    as_myself=$0
-  fi
-  if test ! -f "$as_myself"; then
-    { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2
-   { (exit 1); exit 1; }; }
-  fi
-  case $CONFIG_SHELL in
-  '')
-    as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for as_base in sh bash ksh sh5; do
-        case $as_dir in
-        /*)
-          if ("$as_dir/$as_base" -c '
-  as_lineno_1=$LINENO
-  as_lineno_2=$LINENO
-  as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
-  test "x$as_lineno_1" != "x$as_lineno_2" &&
-  test "x$as_lineno_3"  = "x$as_lineno_2" ') 2>/dev/null; then
-            $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; }
-            $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; }
-            CONFIG_SHELL=$as_dir/$as_base
-            export CONFIG_SHELL
-            exec "$CONFIG_SHELL" "$0" ${1+"$@"}
-          fi;;
-        esac
-       done
-done
-;;
-  esac
-
-  # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
-  # uniformly replaced by the line number.  The first 'sed' inserts a
-  # line-number line before each line; the second 'sed' does the real
-  # work.  The second script uses 'N' to pair each line-number line
-  # with the numbered line, and appends trailing '-' during
-  # substitution so that $LINENO is not a special case at line end.
-  # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
-  # second 'sed' script.  Blame Lee E. McMahon for sed's syntax.  :-)
-  sed '=' <$as_myself |
-    sed '
-      N
-      s,$,-,
-      : loop
-      s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3,
-      t loop
-      s,-$,,
-      s,^['$as_cr_digits']*\n,,
-    ' >$as_me.lineno &&
-  chmod +x $as_me.lineno ||
-    { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
-   { (exit 1); exit 1; }; }
-
-  # Don't try to exec as it changes $[0], causing all sort of problems
-  # (the dirname of $[0] is not the place where we might find the
-  # original and so on.  Autoconf is especially sensible to this).
-  . ./$as_me.lineno
-  # Exit status is that of the last command.
-  exit
-}
-
-
-case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in
-  *c*,-n*) ECHO_N= ECHO_C='
-' ECHO_T='     ' ;;
-  *c*,*  ) ECHO_N=-n ECHO_C= ECHO_T= ;;
-  *)       ECHO_N= ECHO_C='\c' ECHO_T= ;;
-esac
-
-if expr a : '\(a\)' >/dev/null 2>&1; then
-  as_expr=expr
-else
-  as_expr=false
-fi
-
-rm -f conf$$ conf$$.exe conf$$.file
-echo >conf$$.file
-if ln -s conf$$.file conf$$ 2>/dev/null; then
-  # We could just check for DJGPP; but this test a) works b) is more generic
-  # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
-  if test -f conf$$.exe; then
-    # Don't use ln at all; we don't have any links
-    as_ln_s='cp -p'
-  else
-    as_ln_s='ln -s'
-  fi
-elif ln conf$$.file conf$$ 2>/dev/null; then
-  as_ln_s=ln
-else
-  as_ln_s='cp -p'
-fi
-rm -f conf$$ conf$$.exe conf$$.file
-
-if mkdir -p . 2>/dev/null; then
-  as_mkdir_p=:
-else
-  as_mkdir_p=false
-fi
-
-as_executable_p="test -f"
-
-# Sed expression to map a string onto a valid CPP name.
-as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g"
-
-# Sed expression to map a string onto a valid variable name.
-as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g"
-
-
-# IFS
-# We need space, tab and new line, in precisely that order.
-as_nl='
-'
-IFS="  $as_nl"
-
-# CDPATH.
-$as_unset CDPATH
-
-
-# Name of the host.
-# hostname on some systems (SVR3.2, Linux) returns a bogus exit status,
-# so uname gets run too.
-ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
-
-exec 6>&1
-
-#
-# Initializations.
-#
-ac_default_prefix=/usr/local
-ac_config_libobj_dir=.
-cross_compiling=no
-subdirs=
-MFLAGS=
-MAKEFLAGS=
-SHELL=${CONFIG_SHELL-/bin/sh}
-
-# Maximum number of lines to put in a shell here document.
-# This variable seems obsolete.  It should probably be removed, and
-# only ac_max_sed_lines should be used.
-: ${ac_max_here_lines=38}
-
-# Identity of this package.
-PACKAGE_NAME=
-PACKAGE_TARNAME=
-PACKAGE_VERSION=
-PACKAGE_STRING=
-PACKAGE_BUGREPORT=
-
-ac_unique_file="Source/robodoc.h"
-# Factoring default headers for most tests.
-ac_includes_default="\
-#include <stdio.h>
-#if HAVE_SYS_TYPES_H
-# include <sys/types.h>
-#endif
-#if HAVE_SYS_STAT_H
-# include <sys/stat.h>
-#endif
-#if STDC_HEADERS
-# include <stdlib.h>
-# include <stddef.h>
-#else
-# if HAVE_STDLIB_H
-#  include <stdlib.h>
-# endif
-#endif
-#if HAVE_STRING_H
-# if !STDC_HEADERS && HAVE_MEMORY_H
-#  include <memory.h>
-# endif
-# include <string.h>
-#endif
-#if HAVE_STRINGS_H
-# include <strings.h>
-#endif
-#if HAVE_INTTYPES_H
-# include <inttypes.h>
-#else
-# if HAVE_STDINT_H
-#  include <stdint.h>
-# endif
-#endif
-#if HAVE_UNISTD_H
-# include <unistd.h>
-#endif"
-
-ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO AMTAR install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM AWK SET_MAKE CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE CPP EGREP LIBOBJS LTLIBOBJS'
-ac_subst_files=''
-
-# Initialize some variables set by options.
-ac_init_help=
-ac_init_version=false
-# The variables have the same names as the options, with
-# dashes changed to underlines.
-cache_file=/dev/null
-exec_prefix=NONE
-no_create=
-no_recursion=
-prefix=NONE
-program_prefix=NONE
-program_suffix=NONE
-program_transform_name=s,x,x,
-silent=
-site=
-srcdir=
-verbose=
-x_includes=NONE
-x_libraries=NONE
-
-# Installation directory options.
-# These are left unexpanded so users can "make install exec_prefix=/foo"
-# and all the variables that are supposed to be based on exec_prefix
-# by default will actually change.
-# Use braces instead of parens because sh, perl, etc. also accept them.
-bindir='${exec_prefix}/bin'
-sbindir='${exec_prefix}/sbin'
-libexecdir='${exec_prefix}/libexec'
-datadir='${prefix}/share'
-sysconfdir='${prefix}/etc'
-sharedstatedir='${prefix}/com'
-localstatedir='${prefix}/var'
-libdir='${exec_prefix}/lib'
-includedir='${prefix}/include'
-oldincludedir='/usr/include'
-infodir='${prefix}/info'
-mandir='${prefix}/man'
-
-ac_prev=
-for ac_option
-do
-  # If the previous option needs an argument, assign it.
-  if test -n "$ac_prev"; then
-    eval "$ac_prev=\$ac_option"
-    ac_prev=
-    continue
-  fi
-
-  ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'`
-
-  # Accept the important Cygnus configure options, so we can diagnose typos.
-
-  case $ac_option in
-
-  -bindir | --bindir | --bindi | --bind | --bin | --bi)
-    ac_prev=bindir ;;
-  -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
-    bindir=$ac_optarg ;;
-
-  -build | --build | --buil | --bui | --bu)
-    ac_prev=build_alias ;;
-  -build=* | --build=* | --buil=* | --bui=* | --bu=*)
-    build_alias=$ac_optarg ;;
-
-  -cache-file | --cache-file | --cache-fil | --cache-fi \
-  | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
-    ac_prev=cache_file ;;
-  -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
-  | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
-    cache_file=$ac_optarg ;;
-
-  --config-cache | -C)
-    cache_file=config.cache ;;
-
-  -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
-    ac_prev=datadir ;;
-  -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
-  | --da=*)
-    datadir=$ac_optarg ;;
-
-  -disable-* | --disable-*)
-    ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
-    # Reject names that are not valid shell variable names.
-    expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
-      { echo "$as_me: error: invalid feature name: $ac_feature" >&2
-   { (exit 1); exit 1; }; }
-    ac_feature=`echo $ac_feature | sed 's/-/_/g'`
-    eval "enable_$ac_feature=no" ;;
-
-  -enable-* | --enable-*)
-    ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
-    # Reject names that are not valid shell variable names.
-    expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
-      { echo "$as_me: error: invalid feature name: $ac_feature" >&2
-   { (exit 1); exit 1; }; }
-    ac_feature=`echo $ac_feature | sed 's/-/_/g'`
-    case $ac_option in
-      *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
-      *) ac_optarg=yes ;;
-    esac
-    eval "enable_$ac_feature='$ac_optarg'" ;;
-
-  -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
-  | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
-  | --exec | --exe | --ex)
-    ac_prev=exec_prefix ;;
-  -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
-  | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
-  | --exec=* | --exe=* | --ex=*)
-    exec_prefix=$ac_optarg ;;
-
-  -gas | --gas | --ga | --g)
-    # Obsolete; use --with-gas.
-    with_gas=yes ;;
-
-  -help | --help | --hel | --he | -h)
-    ac_init_help=long ;;
-  -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
-    ac_init_help=recursive ;;
-  -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
-    ac_init_help=short ;;
-
-  -host | --host | --hos | --ho)
-    ac_prev=host_alias ;;
-  -host=* | --host=* | --hos=* | --ho=*)
-    host_alias=$ac_optarg ;;
-
-  -includedir | --includedir | --includedi | --included | --include \
-  | --includ | --inclu | --incl | --inc)
-    ac_prev=includedir ;;
-  -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
-  | --includ=* | --inclu=* | --incl=* | --inc=*)
-    includedir=$ac_optarg ;;
-
-  -infodir | --infodir | --infodi | --infod | --info | --inf)
-    ac_prev=infodir ;;
-  -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
-    infodir=$ac_optarg ;;
-
-  -libdir | --libdir | --libdi | --libd)
-    ac_prev=libdir ;;
-  -libdir=* | --libdir=* | --libdi=* | --libd=*)
-    libdir=$ac_optarg ;;
-
-  -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
-  | --libexe | --libex | --libe)
-    ac_prev=libexecdir ;;
-  -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
-  | --libexe=* | --libex=* | --libe=*)
-    libexecdir=$ac_optarg ;;
-
-  -localstatedir | --localstatedir | --localstatedi | --localstated \
-  | --localstate | --localstat | --localsta | --localst \
-  | --locals | --local | --loca | --loc | --lo)
-    ac_prev=localstatedir ;;
-  -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
-  | --localstate=* | --localstat=* | --localsta=* | --localst=* \
-  | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
-    localstatedir=$ac_optarg ;;
-
-  -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
-    ac_prev=mandir ;;
-  -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
-    mandir=$ac_optarg ;;
-
-  -nfp | --nfp | --nf)
-    # Obsolete; use --without-fp.
-    with_fp=no ;;
-
-  -no-create | --no-create | --no-creat | --no-crea | --no-cre \
-  | --no-cr | --no-c | -n)
-    no_create=yes ;;
-
-  -no-recursion | --no-recursion | --no-recursio | --no-recursi \
-  | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
-    no_recursion=yes ;;
-
-  -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
-  | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
-  | --oldin | --oldi | --old | --ol | --o)
-    ac_prev=oldincludedir ;;
-  -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
-  | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
-  | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
-    oldincludedir=$ac_optarg ;;
-
-  -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
-    ac_prev=prefix ;;
-  -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
-    prefix=$ac_optarg ;;
-
-  -program-prefix | --program-prefix | --program-prefi | --program-pref \
-  | --program-pre | --program-pr | --program-p)
-    ac_prev=program_prefix ;;
-  -program-prefix=* | --program-prefix=* | --program-prefi=* \
-  | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
-    program_prefix=$ac_optarg ;;
-
-  -program-suffix | --program-suffix | --program-suffi | --program-suff \
-  | --program-suf | --program-su | --program-s)
-    ac_prev=program_suffix ;;
-  -program-suffix=* | --program-suffix=* | --program-suffi=* \
-  | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
-    program_suffix=$ac_optarg ;;
-
-  -program-transform-name | --program-transform-name \
-  | --program-transform-nam | --program-transform-na \
-  | --program-transform-n | --program-transform- \
-  | --program-transform | --program-transfor \
-  | --program-transfo | --program-transf \
-  | --program-trans | --program-tran \
-  | --progr-tra | --program-tr | --program-t)
-    ac_prev=program_transform_name ;;
-  -program-transform-name=* | --program-transform-name=* \
-  | --program-transform-nam=* | --program-transform-na=* \
-  | --program-transform-n=* | --program-transform-=* \
-  | --program-transform=* | --program-transfor=* \
-  | --program-transfo=* | --program-transf=* \
-  | --program-trans=* | --program-tran=* \
-  | --progr-tra=* | --program-tr=* | --program-t=*)
-    program_transform_name=$ac_optarg ;;
-
-  -q | -quiet | --quiet | --quie | --qui | --qu | --q \
-  | -silent | --silent | --silen | --sile | --sil)
-    silent=yes ;;
-
-  -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
-    ac_prev=sbindir ;;
-  -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
-  | --sbi=* | --sb=*)
-    sbindir=$ac_optarg ;;
-
-  -sharedstatedir | --sharedstatedir | --sharedstatedi \
-  | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
-  | --sharedst | --shareds | --shared | --share | --shar \
-  | --sha | --sh)
-    ac_prev=sharedstatedir ;;
-  -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
-  | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
-  | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
-  | --sha=* | --sh=*)
-    sharedstatedir=$ac_optarg ;;
-
-  -site | --site | --sit)
-    ac_prev=site ;;
-  -site=* | --site=* | --sit=*)
-    site=$ac_optarg ;;
-
-  -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
-    ac_prev=srcdir ;;
-  -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
-    srcdir=$ac_optarg ;;
-
-  -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
-  | --syscon | --sysco | --sysc | --sys | --sy)
-    ac_prev=sysconfdir ;;
-  -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
-  | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
-    sysconfdir=$ac_optarg ;;
-
-  -target | --target | --targe | --targ | --tar | --ta | --t)
-    ac_prev=target_alias ;;
-  -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
-    target_alias=$ac_optarg ;;
-
-  -v | -verbose | --verbose | --verbos | --verbo | --verb)
-    verbose=yes ;;
-
-  -version | --version | --versio | --versi | --vers | -V)
-    ac_init_version=: ;;
-
-  -with-* | --with-*)
-    ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
-    # Reject names that are not valid shell variable names.
-    expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
-      { echo "$as_me: error: invalid package name: $ac_package" >&2
-   { (exit 1); exit 1; }; }
-    ac_package=`echo $ac_package| sed 's/-/_/g'`
-    case $ac_option in
-      *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
-      *) ac_optarg=yes ;;
-    esac
-    eval "with_$ac_package='$ac_optarg'" ;;
-
-  -without-* | --without-*)
-    ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'`
-    # Reject names that are not valid shell variable names.
-    expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
-      { echo "$as_me: error: invalid package name: $ac_package" >&2
-   { (exit 1); exit 1; }; }
-    ac_package=`echo $ac_package | sed 's/-/_/g'`
-    eval "with_$ac_package=no" ;;
-
-  --x)
-    # Obsolete; use --with-x.
-    with_x=yes ;;
-
-  -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
-  | --x-incl | --x-inc | --x-in | --x-i)
-    ac_prev=x_includes ;;
-  -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
-  | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
-    x_includes=$ac_optarg ;;
-
-  -x-libraries | --x-libraries | --x-librarie | --x-librari \
-  | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
-    ac_prev=x_libraries ;;
-  -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
-  | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
-    x_libraries=$ac_optarg ;;
-
-  -*) { echo "$as_me: error: unrecognized option: $ac_option
-Try \`$0 --help' for more information." >&2
-   { (exit 1); exit 1; }; }
-    ;;
-
-  *=*)
-    ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
-    # Reject names that are not valid shell variable names.
-    expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null &&
-      { echo "$as_me: error: invalid variable name: $ac_envvar" >&2
-   { (exit 1); exit 1; }; }
-    ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`
-    eval "$ac_envvar='$ac_optarg'"
-    export $ac_envvar ;;
-
-  *)
-    # FIXME: should be removed in autoconf 3.0.
-    echo "$as_me: WARNING: you should use --build, --host, --target" >&2
-    expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
-      echo "$as_me: WARNING: invalid host type: $ac_option" >&2
-    : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}
-    ;;
-
-  esac
-done
-
-if test -n "$ac_prev"; then
-  ac_option=--`echo $ac_prev | sed 's/_/-/g'`
-  { echo "$as_me: error: missing argument to $ac_option" >&2
-   { (exit 1); exit 1; }; }
-fi
-
-# Be sure to have absolute paths.
-for ac_var in exec_prefix prefix
-do
-  eval ac_val=$`echo $ac_var`
-  case $ac_val in
-    [\\/$]* | ?:[\\/]* | NONE | '' ) ;;
-    *)  { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
-   { (exit 1); exit 1; }; };;
-  esac
-done
-
-# Be sure to have absolute paths.
-for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \
-              localstatedir libdir includedir oldincludedir infodir mandir
-do
-  eval ac_val=$`echo $ac_var`
-  case $ac_val in
-    [\\/$]* | ?:[\\/]* ) ;;
-    *)  { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
-   { (exit 1); exit 1; }; };;
-  esac
-done
-
-# There might be people who depend on the old broken behavior: `$host'
-# used to hold the argument of --host etc.
-# FIXME: To remove some day.
-build=$build_alias
-host=$host_alias
-target=$target_alias
-
-# FIXME: To remove some day.
-if test "x$host_alias" != x; then
-  if test "x$build_alias" = x; then
-    cross_compiling=maybe
-    echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host.
-    If a cross compiler is detected then cross compile mode will be used." >&2
-  elif test "x$build_alias" != "x$host_alias"; then
-    cross_compiling=yes
-  fi
-fi
-
-ac_tool_prefix=
-test -n "$host_alias" && ac_tool_prefix=$host_alias-
-
-test "$silent" = yes && exec 6>/dev/null
-
-
-# Find the source files, if location was not specified.
-if test -z "$srcdir"; then
-  ac_srcdir_defaulted=yes
-  # Try the directory containing this script, then its parent.
-  ac_confdir=`(dirname "$0") 2>/dev/null ||
-$as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
-         X"$0" : 'X\(//\)[^/]' \| \
-         X"$0" : 'X\(//\)$' \| \
-         X"$0" : 'X\(/\)' \| \
-         .     : '\(.\)' 2>/dev/null ||
-echo X"$0" |
-    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
-         /^X\(\/\/\)[^/].*/{ s//\1/; q; }
-         /^X\(\/\/\)$/{ s//\1/; q; }
-         /^X\(\/\).*/{ s//\1/; q; }
-         s/.*/./; q'`
-  srcdir=$ac_confdir
-  if test ! -r $srcdir/$ac_unique_file; then
-    srcdir=..
-  fi
-else
-  ac_srcdir_defaulted=no
-fi
-if test ! -r $srcdir/$ac_unique_file; then
-  if test "$ac_srcdir_defaulted" = yes; then
-    { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2
-   { (exit 1); exit 1; }; }
-  else
-    { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2
-   { (exit 1); exit 1; }; }
-  fi
-fi
-(cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null ||
-  { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2
-   { (exit 1); exit 1; }; }
-srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'`
-ac_env_build_alias_set=${build_alias+set}
-ac_env_build_alias_value=$build_alias
-ac_cv_env_build_alias_set=${build_alias+set}
-ac_cv_env_build_alias_value=$build_alias
-ac_env_host_alias_set=${host_alias+set}
-ac_env_host_alias_value=$host_alias
-ac_cv_env_host_alias_set=${host_alias+set}
-ac_cv_env_host_alias_value=$host_alias
-ac_env_target_alias_set=${target_alias+set}
-ac_env_target_alias_value=$target_alias
-ac_cv_env_target_alias_set=${target_alias+set}
-ac_cv_env_target_alias_value=$target_alias
-ac_env_CC_set=${CC+set}
-ac_env_CC_value=$CC
-ac_cv_env_CC_set=${CC+set}
-ac_cv_env_CC_value=$CC
-ac_env_CFLAGS_set=${CFLAGS+set}
-ac_env_CFLAGS_value=$CFLAGS
-ac_cv_env_CFLAGS_set=${CFLAGS+set}
-ac_cv_env_CFLAGS_value=$CFLAGS
-ac_env_LDFLAGS_set=${LDFLAGS+set}
-ac_env_LDFLAGS_value=$LDFLAGS
-ac_cv_env_LDFLAGS_set=${LDFLAGS+set}
-ac_cv_env_LDFLAGS_value=$LDFLAGS
-ac_env_CPPFLAGS_set=${CPPFLAGS+set}
-ac_env_CPPFLAGS_value=$CPPFLAGS
-ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set}
-ac_cv_env_CPPFLAGS_value=$CPPFLAGS
-ac_env_CPP_set=${CPP+set}
-ac_env_CPP_value=$CPP
-ac_cv_env_CPP_set=${CPP+set}
-ac_cv_env_CPP_value=$CPP
-
-#
-# Report the --help message.
-#
-if test "$ac_init_help" = "long"; then
-  # Omit some internal or obsolete options to make the list less imposing.
-  # This message is too long to be a string in the A/UX 3.1 sh.
-  cat <<_ACEOF
-\`configure' configures this package to adapt to many kinds of systems.
-
-Usage: $0 [OPTION]... [VAR=VALUE]...
-
-To assign environment variables (e.g., CC, CFLAGS...), specify them as
-VAR=VALUE.  See below for descriptions of some of the useful variables.
-
-Defaults for the options are specified in brackets.
-
-Configuration:
-  -h, --help              display this help and exit
-      --help=short        display options specific to this package
-      --help=recursive    display the short help of all the included packages
-  -V, --version           display version information and exit
-  -q, --quiet, --silent   do not print \`checking...' messages
-      --cache-file=FILE   cache test results in FILE [disabled]
-  -C, --config-cache      alias for \`--cache-file=config.cache'
-  -n, --no-create         do not create output files
-      --srcdir=DIR        find the sources in DIR [configure dir or \`..']
-
-_ACEOF
-
-  cat <<_ACEOF
-Installation directories:
-  --prefix=PREFIX         install architecture-independent files in PREFIX
-                          [$ac_default_prefix]
-  --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
-                          [PREFIX]
-
-By default, \`make install' will install all the files in
-\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc.  You can specify
-an installation prefix other than \`$ac_default_prefix' using \`--prefix',
-for instance \`--prefix=\$HOME'.
-
-For better control, use the options below.
-
-Fine tuning of the installation directories:
-  --bindir=DIR           user executables [EPREFIX/bin]
-  --sbindir=DIR          system admin executables [EPREFIX/sbin]
-  --libexecdir=DIR       program executables [EPREFIX/libexec]
-  --datadir=DIR          read-only architecture-independent data [PREFIX/share]
-  --sysconfdir=DIR       read-only single-machine data [PREFIX/etc]
-  --sharedstatedir=DIR   modifiable architecture-independent data [PREFIX/com]
-  --localstatedir=DIR    modifiable single-machine data [PREFIX/var]
-  --libdir=DIR           object code libraries [EPREFIX/lib]
-  --includedir=DIR       C header files [PREFIX/include]
-  --oldincludedir=DIR    C header files for non-gcc [/usr/include]
-  --infodir=DIR          info documentation [PREFIX/info]
-  --mandir=DIR           man documentation [PREFIX/man]
-_ACEOF
-
-  cat <<\_ACEOF
-
-Program names:
-  --program-prefix=PREFIX            prepend PREFIX to installed program names
-  --program-suffix=SUFFIX            append SUFFIX to installed program names
-  --program-transform-name=PROGRAM   run sed PROGRAM on installed program names
-_ACEOF
-fi
-
-if test -n "$ac_init_help"; then
-
-  cat <<\_ACEOF
-
-Optional Features:
-  --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
-  --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
-  --disable-dependency-tracking Speeds up one-time builds
-  --enable-dependency-tracking  Do not reject slow dependency extractors
-
-Some influential environment variables:
-  CC          C compiler command
-  CFLAGS      C compiler flags
-  LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
-              nonstandard directory <lib dir>
-  CPPFLAGS    C/C++ preprocessor flags, e.g. -I<include dir> if you have
-              headers in a nonstandard directory <include dir>
-  CPP         C preprocessor
-
-Use these variables to override the choices made by `configure' or to help
-it to find libraries and programs with nonstandard names/locations.
-
-_ACEOF
-fi
-
-if test "$ac_init_help" = "recursive"; then
-  # If there are subdirs, report their specific --help.
-  ac_popdir=`pwd`
-  for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
-    test -d $ac_dir || continue
-    ac_builddir=.
-
-if test "$ac_dir" != .; then
-  ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
-  # A "../" for each directory in $ac_dir_suffix.
-  ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
-else
-  ac_dir_suffix= ac_top_builddir=
-fi
-
-case $srcdir in
-  .)  # No --srcdir option.  We are building in place.
-    ac_srcdir=.
-    if test -z "$ac_top_builddir"; then
-       ac_top_srcdir=.
-    else
-       ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
-    fi ;;
-  [\\/]* | ?:[\\/]* )  # Absolute path.
-    ac_srcdir=$srcdir$ac_dir_suffix;
-    ac_top_srcdir=$srcdir ;;
-  *) # Relative path.
-    ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
-    ac_top_srcdir=$ac_top_builddir$srcdir ;;
-esac
-# Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be
-# absolute.
-ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd`
-ac_abs_top_builddir=`cd "$ac_dir" && cd ${ac_top_builddir}. && pwd`
-ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd`
-ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd`
-
-    cd $ac_dir
-    # Check for guested configure; otherwise get Cygnus style configure.
-    if test -f $ac_srcdir/configure.gnu; then
-      echo
-      $SHELL $ac_srcdir/configure.gnu  --help=recursive
-    elif test -f $ac_srcdir/configure; then
-      echo
-      $SHELL $ac_srcdir/configure  --help=recursive
-    elif test -f $ac_srcdir/configure.ac ||
-           test -f $ac_srcdir/configure.in; then
-      echo
-      $ac_configure --help
-    else
-      echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
-    fi
-    cd $ac_popdir
-  done
-fi
-
-test -n "$ac_init_help" && exit 0
-if $ac_init_version; then
-  cat <<\_ACEOF
-
-Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002
-Free Software Foundation, Inc.
-This configure script is free software; the Free Software Foundation
-gives unlimited permission to copy, distribute and modify it.
-_ACEOF
-  exit 0
-fi
-exec 5>config.log
-cat >&5 <<_ACEOF
-This file contains any messages produced by compilers while
-running configure, to aid debugging if configure makes a mistake.
-
-It was created by $as_me, which was
-generated by GNU Autoconf 2.54.  Invocation command line was
-
-  $ $0 $@
-
-_ACEOF
-{
-cat <<_ASUNAME
-## --------- ##
-## Platform. ##
-## --------- ##
-
-hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
-uname -m = `(uname -m) 2>/dev/null || echo unknown`
-uname -r = `(uname -r) 2>/dev/null || echo unknown`
-uname -s = `(uname -s) 2>/dev/null || echo unknown`
-uname -v = `(uname -v) 2>/dev/null || echo unknown`
-
-/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
-/bin/uname -X     = `(/bin/uname -X) 2>/dev/null     || echo unknown`
-
-/bin/arch              = `(/bin/arch) 2>/dev/null              || echo unknown`
-/usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null       || echo unknown`
-/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
-hostinfo               = `(hostinfo) 2>/dev/null               || echo unknown`
-/bin/machine           = `(/bin/machine) 2>/dev/null           || echo unknown`
-/usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null       || echo unknown`
-/bin/universe          = `(/bin/universe) 2>/dev/null          || echo unknown`
-
-_ASUNAME
-
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  echo "PATH: $as_dir"
-done
-
-} >&5
-
-cat >&5 <<_ACEOF
-
-
-## ----------- ##
-## Core tests. ##
-## ----------- ##
-
-_ACEOF
-
-
-# Keep a trace of the command line.
-# Strip out --no-create and --no-recursion so they do not pile up.
-# Also quote any args containing shell meta-characters.
-ac_configure_args=
-ac_sep=
-for ac_arg
-do
-  case $ac_arg in
-  -no-create | --no-create | --no-creat | --no-crea | --no-cre \
-  | --no-cr | --no-c | -n ) continue ;;
-  -no-recursion | --no-recursion | --no-recursio | --no-recursi \
-  | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
-    continue ;;
-  *" "*|*"     "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
-    ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
-  esac
-  ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'"
-  # Get rid of the leading space.
-  ac_sep=" "
-done
-
-# When interrupted or exit'd, cleanup temporary files, and complete
-# config.log.  We remove comments because anyway the quotes in there
-# would cause problems or look ugly.
-# WARNING: Be sure not to use single quotes in there, as some shells,
-# such as our DU 5.0 friend, will then `close' the trap.
-trap 'exit_status=$?
-  # Save into config.log some information that might help in debugging.
-  {
-    echo
-
-    cat <<\_ASBOX
-## ---------------- ##
-## Cache variables. ##
-## ---------------- ##
-_ASBOX
-    echo
-    # The following way of writing the cache mishandles newlines in values,
-{
-  (set) 2>&1 |
-    case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in
-    *ac_space=\ *)
-      sed -n \
-        "s/'"'"'/'"'"'\\\\'"'"''"'"'/g;
-         s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p"
-      ;;
-    *)
-      sed -n \
-        "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
-      ;;
-    esac;
-}
-    echo
-
-    cat <<\_ASBOX
-## ----------------- ##
-## Output variables. ##
-## ----------------- ##
-_ASBOX
-    echo
-    for ac_var in $ac_subst_vars
-    do
-      eval ac_val=$`echo $ac_var`
-      echo "$ac_var='"'"'$ac_val'"'"'"
-    done | sort
-    echo
-
-    if test -n "$ac_subst_files"; then
-      cat <<\_ASBOX
-## ------------- ##
-## Output files. ##
-## ------------- ##
-_ASBOX
-      echo
-      for ac_var in $ac_subst_files
-      do
-       eval ac_val=$`echo $ac_var`
-        echo "$ac_var='"'"'$ac_val'"'"'"
-      done | sort
-      echo
-    fi
-
-    if test -s confdefs.h; then
-      cat <<\_ASBOX
-## ----------- ##
-## confdefs.h. ##
-## ----------- ##
-_ASBOX
-      echo
-      sed "/^$/d" confdefs.h | sort
-      echo
-    fi
-    test "$ac_signal" != 0 &&
-      echo "$as_me: caught signal $ac_signal"
-    echo "$as_me: exit $exit_status"
-  } >&5
-  rm -f core core.* *.core &&
-  rm -rf conftest* confdefs* conf$$* $ac_clean_files &&
-    exit $exit_status
-     ' 0
-for ac_signal in 1 2 13 15; do
-  trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal
-done
-ac_signal=0
-
-# confdefs.h avoids OS command line length limits that DEFS can exceed.
-rm -rf conftest* confdefs.h
-# AIX cpp loses on an empty file, so make sure it contains at least a newline.
-echo >confdefs.h
-
-# Predefined preprocessor variables.
-
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_NAME "$PACKAGE_NAME"
-_ACEOF
-
-
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_TARNAME "$PACKAGE_TARNAME"
-_ACEOF
-
-
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_VERSION "$PACKAGE_VERSION"
-_ACEOF
-
-
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_STRING "$PACKAGE_STRING"
-_ACEOF
-
-
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT"
-_ACEOF
-
-
-# Let the site file select an alternate cache file if it wants to.
-# Prefer explicitly selected file to automatically selected ones.
-if test -z "$CONFIG_SITE"; then
-  if test "x$prefix" != xNONE; then
-    CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
-  else
-    CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
-  fi
-fi
-for ac_site_file in $CONFIG_SITE; do
-  if test -r "$ac_site_file"; then
-    { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5
-echo "$as_me: loading site script $ac_site_file" >&6;}
-    sed 's/^/| /' "$ac_site_file" >&5
-    . "$ac_site_file"
-  fi
-done
-
-if test -r "$cache_file"; then
-  # Some versions of bash will fail to source /dev/null (special
-  # files actually), so we avoid doing that.
-  if test -f "$cache_file"; then
-    { echo "$as_me:$LINENO: loading cache $cache_file" >&5
-echo "$as_me: loading cache $cache_file" >&6;}
-    case $cache_file in
-      [\\/]* | ?:[\\/]* ) . $cache_file;;
-      *)                      . ./$cache_file;;
-    esac
-  fi
-else
-  { echo "$as_me:$LINENO: creating cache $cache_file" >&5
-echo "$as_me: creating cache $cache_file" >&6;}
-  >$cache_file
-fi
-
-# Check that the precious variables saved in the cache have kept the same
-# value.
-ac_cache_corrupted=false
-for ac_var in `(set) 2>&1 |
-               sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do
-  eval ac_old_set=\$ac_cv_env_${ac_var}_set
-  eval ac_new_set=\$ac_env_${ac_var}_set
-  eval ac_old_val="\$ac_cv_env_${ac_var}_value"
-  eval ac_new_val="\$ac_env_${ac_var}_value"
-  case $ac_old_set,$ac_new_set in
-    set,)
-      { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
-echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
-      ac_cache_corrupted=: ;;
-    ,set)
-      { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5
-echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
-      ac_cache_corrupted=: ;;
-    ,);;
-    *)
-      if test "x$ac_old_val" != "x$ac_new_val"; then
-        { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5
-echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
-        { echo "$as_me:$LINENO:   former value:  $ac_old_val" >&5
-echo "$as_me:   former value:  $ac_old_val" >&2;}
-        { echo "$as_me:$LINENO:   current value: $ac_new_val" >&5
-echo "$as_me:   current value: $ac_new_val" >&2;}
-        ac_cache_corrupted=:
-      fi;;
-  esac
-  # Pass precious variables to config.status.
-  if test "$ac_new_set" = set; then
-    case $ac_new_val in
-    *" "*|*"   "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
-      ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
-    *) ac_arg=$ac_var=$ac_new_val ;;
-    esac
-    case " $ac_configure_args " in
-      *" '$ac_arg' "*) ;; # Avoid dups.  Use of quotes ensures accuracy.
-      *) ac_configure_args="$ac_configure_args '$ac_arg'" ;;
-    esac
-  fi
-done
-if $ac_cache_corrupted; then
-  { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5
-echo "$as_me: error: changes in the environment can compromise the build" >&2;}
-  { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
-echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}
-   { (exit 1); exit 1; }; }
-fi
-
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-          ac_config_headers="$ac_config_headers Source/config.h"
-
-
-am__api_version="1.7"
-ac_aux_dir=
-for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
-  if test -f $ac_dir/install-sh; then
-    ac_aux_dir=$ac_dir
-    ac_install_sh="$ac_aux_dir/install-sh -c"
-    break
-  elif test -f $ac_dir/install.sh; then
-    ac_aux_dir=$ac_dir
-    ac_install_sh="$ac_aux_dir/install.sh -c"
-    break
-  elif test -f $ac_dir/shtool; then
-    ac_aux_dir=$ac_dir
-    ac_install_sh="$ac_aux_dir/shtool install -c"
-    break
-  fi
-done
-if test -z "$ac_aux_dir"; then
-  { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5
-echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;}
-   { (exit 1); exit 1; }; }
-fi
-ac_config_guess="$SHELL $ac_aux_dir/config.guess"
-ac_config_sub="$SHELL $ac_aux_dir/config.sub"
-ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure.
-
-# Find a good install program.  We prefer a C program (faster),
-# so one script is as good as another.  But avoid the broken or
-# incompatible versions:
-# SysV /etc/install, /usr/sbin/install
-# SunOS /usr/etc/install
-# IRIX /sbin/install
-# AIX /bin/install
-# AmigaOS /C/install, which installs bootblocks on floppy discs
-# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
-# AFS /usr/afsws/bin/install, which mishandles nonexistent args
-# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
-# ./install, which can be erroneously created by make from ./install.sh.
-echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5
-echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6
-if test -z "$INSTALL"; then
-if test "${ac_cv_path_install+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  # Account for people who put trailing slashes in PATH elements.
-case $as_dir/ in
-  ./ | .// | /cC/* | \
-  /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
-  /usr/ucb/* ) ;;
-  *)
-    # OSF1 and SCO ODT 3.0 have their own names for install.
-    # Don't use installbsd from OSF since it installs stuff as root
-    # by default.
-    for ac_prog in ginstall scoinst install; do
-      for ac_exec_ext in '' $ac_executable_extensions; do
-        if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
-          if test $ac_prog = install &&
-            grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
-            # AIX install.  It has an incompatible calling convention.
-            :
-          elif test $ac_prog = install &&
-            grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
-            # program-specific install script used by HP pwplus--don't use.
-            :
-          else
-            ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
-            break 3
-          fi
-        fi
-      done
-    done
-    ;;
-esac
-done
-
-
-fi
-  if test "${ac_cv_path_install+set}" = set; then
-    INSTALL=$ac_cv_path_install
-  else
-    # As a last resort, use the slow shell script.  We don't cache a
-    # path for INSTALL within a source directory, because that will
-    # break other packages using the cache if that directory is
-    # removed, or if the path is relative.
-    INSTALL=$ac_install_sh
-  fi
-fi
-echo "$as_me:$LINENO: result: $INSTALL" >&5
-echo "${ECHO_T}$INSTALL" >&6
-
-# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
-# It thinks the first close brace ends the variable substitution.
-test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
-
-test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
-
-test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
-
-echo "$as_me:$LINENO: checking whether build environment is sane" >&5
-echo $ECHO_N "checking whether build environment is sane... $ECHO_C" >&6
-# Just in case
-sleep 1
-echo timestamp > conftest.file
-# Do `set' in a subshell so we don't clobber the current shell's
-# arguments.  Must try -L first in case configure is actually a
-# symlink; some systems play weird games with the mod time of symlinks
-# (eg FreeBSD returns the mod time of the symlink's containing
-# directory).
-if (
-   set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
-   if test "$*" = "X"; then
-      # -L didn't work.
-      set X `ls -t $srcdir/configure conftest.file`
-   fi
-   rm -f conftest.file
-   if test "$*" != "X $srcdir/configure conftest.file" \
-      && test "$*" != "X conftest.file $srcdir/configure"; then
-
-      # If neither matched, then we have a broken ls.  This can happen
-      # if, for instance, CONFIG_SHELL is bash and it inherits a
-      # broken ls alias from the environment.  This has actually
-      # happened.  Such a system could not be considered "sane".
-      { { echo "$as_me:$LINENO: error: ls -t appears to fail.  Make sure there is not a broken
-alias in your environment" >&5
-echo "$as_me: error: ls -t appears to fail.  Make sure there is not a broken
-alias in your environment" >&2;}
-   { (exit 1); exit 1; }; }
-   fi
-
-   test "$2" = conftest.file
-   )
-then
-   # Ok.
-   :
-else
-   { { echo "$as_me:$LINENO: error: newly created file is older than distributed files!
-Check your system clock" >&5
-echo "$as_me: error: newly created file is older than distributed files!
-Check your system clock" >&2;}
-   { (exit 1); exit 1; }; }
-fi
-echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6
-test "$program_prefix" != NONE &&
-  program_transform_name="s,^,$program_prefix,;$program_transform_name"
-# Use a double $ so make ignores it.
-test "$program_suffix" != NONE &&
-  program_transform_name="s,\$,$program_suffix,;$program_transform_name"
-# Double any \ or $.  echo might interpret backslashes.
-# By default was `s,x,x', remove it if useless.
-cat <<\_ACEOF >conftest.sed
-s/[\\$]/&&/g;s/;s,x,x,$//
-_ACEOF
-program_transform_name=`echo $program_transform_name | sed -f conftest.sed`
-rm conftest.sed
-
-
-# expand $ac_aux_dir to an absolute path
-am_aux_dir=`cd $ac_aux_dir && pwd`
-
-test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
-# Use eval to expand $SHELL
-if eval "$MISSING --run true"; then
-  am_missing_run="$MISSING --run "
-else
-  am_missing_run=
-  { echo "$as_me:$LINENO: WARNING: \`missing' script is too old or missing" >&5
-echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;}
-fi
-
-for ac_prog in gawk mawk nawk awk
-do
-  # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_AWK+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  if test -n "$AWK"; then
-  ac_cv_prog_AWK="$AWK" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_AWK="$ac_prog"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-done
-
-fi
-fi
-AWK=$ac_cv_prog_AWK
-if test -n "$AWK"; then
-  echo "$as_me:$LINENO: result: $AWK" >&5
-echo "${ECHO_T}$AWK" >&6
-else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
-
-  test -n "$AWK" && break
-done
-
-echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \${MAKE}" >&5
-echo $ECHO_N "checking whether ${MAKE-make} sets \${MAKE}... $ECHO_C" >&6
-set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,./+-,__p_,'`
-if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  cat >conftest.make <<\_ACEOF
-all:
-       @echo 'ac_maketemp="${MAKE}"'
-_ACEOF
-# GNU make sometimes prints "make[1]: Entering...", which would confuse us.
-eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=`
-if test -n "$ac_maketemp"; then
-  eval ac_cv_prog_make_${ac_make}_set=yes
-else
-  eval ac_cv_prog_make_${ac_make}_set=no
-fi
-rm -f conftest.make
-fi
-if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
-  echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6
-  SET_MAKE=
-else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-  SET_MAKE="MAKE=${MAKE-make}"
-fi
-
- # test to see if srcdir already configured
-if test "`cd $srcdir && pwd`" != "`pwd`" &&
-   test -f $srcdir/config.status; then
-  { { echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5
-echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;}
-   { (exit 1); exit 1; }; }
-fi
-
-# test whether we have cygpath
-if test -z "$CYGPATH_W"; then
-  if (cygpath --version) >/dev/null 2>/dev/null; then
-    CYGPATH_W='cygpath -w'
-  else
-    CYGPATH_W=echo
-  fi
-fi
-
-
-# Define the identity of the package.
- PACKAGE=robodoc
- VERSION=3.2.3
-
-
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE "$PACKAGE"
-_ACEOF
-
-
-cat >>confdefs.h <<_ACEOF
-#define VERSION "$VERSION"
-_ACEOF
-
-# Some tools Automake needs.
-
-ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"}
-
-
-AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"}
-
-
-AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"}
-
-
-AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"}
-
-
-MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"}
-
-
-AMTAR=${AMTAR-"${am_missing_run}tar"}
-
-install_sh=${install_sh-"$am_aux_dir/install-sh"}
-
-# Installed binaries are usually stripped using `strip' when the user
-# run `make install-strip'.  However `strip' might not be the right
-# tool to use in cross-compilation environments, therefore Automake
-# will honor the `STRIP' environment variable to overrule this program.
-if test "$cross_compiling" != no; then
-  if test -n "$ac_tool_prefix"; then
-  # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
-set dummy ${ac_tool_prefix}strip; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_STRIP+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  if test -n "$STRIP"; then
-  ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_STRIP="${ac_tool_prefix}strip"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-done
-
-fi
-fi
-STRIP=$ac_cv_prog_STRIP
-if test -n "$STRIP"; then
-  echo "$as_me:$LINENO: result: $STRIP" >&5
-echo "${ECHO_T}$STRIP" >&6
-else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
-
-fi
-if test -z "$ac_cv_prog_STRIP"; then
-  ac_ct_STRIP=$STRIP
-  # Extract the first word of "strip", so it can be a program name with args.
-set dummy strip; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  if test -n "$ac_ct_STRIP"; then
-  ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_ac_ct_STRIP="strip"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-done
-
-  test -z "$ac_cv_prog_ac_ct_STRIP" && ac_cv_prog_ac_ct_STRIP=":"
-fi
-fi
-ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
-if test -n "$ac_ct_STRIP"; then
-  echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5
-echo "${ECHO_T}$ac_ct_STRIP" >&6
-else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
-
-  STRIP=$ac_ct_STRIP
-else
-  STRIP="$ac_cv_prog_STRIP"
-fi
-
-fi
-INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s"
-
-# We need awk for the "check" target.  The system "awk" is bad on
-# some platforms.
-
-
-
-
-echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \${MAKE}" >&5
-echo $ECHO_N "checking whether ${MAKE-make} sets \${MAKE}... $ECHO_C" >&6
-set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,./+-,__p_,'`
-if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  cat >conftest.make <<\_ACEOF
-all:
-       @echo 'ac_maketemp="${MAKE}"'
-_ACEOF
-# GNU make sometimes prints "make[1]: Entering...", which would confuse us.
-eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=`
-if test -n "$ac_maketemp"; then
-  eval ac_cv_prog_make_${ac_make}_set=yes
-else
-  eval ac_cv_prog_make_${ac_make}_set=no
-fi
-rm -f conftest.make
-fi
-if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
-  echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6
-  SET_MAKE=
-else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-  SET_MAKE="MAKE=${MAKE-make}"
-fi
-
-
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-if test -n "$ac_tool_prefix"; then
-  # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
-set dummy ${ac_tool_prefix}gcc; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_CC+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  if test -n "$CC"; then
-  ac_cv_prog_CC="$CC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_CC="${ac_tool_prefix}gcc"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-done
-
-fi
-fi
-CC=$ac_cv_prog_CC
-if test -n "$CC"; then
-  echo "$as_me:$LINENO: result: $CC" >&5
-echo "${ECHO_T}$CC" >&6
-else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
-
-fi
-if test -z "$ac_cv_prog_CC"; then
-  ac_ct_CC=$CC
-  # Extract the first word of "gcc", so it can be a program name with args.
-set dummy gcc; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  if test -n "$ac_ct_CC"; then
-  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_ac_ct_CC="gcc"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-done
-
-fi
-fi
-ac_ct_CC=$ac_cv_prog_ac_ct_CC
-if test -n "$ac_ct_CC"; then
-  echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
-echo "${ECHO_T}$ac_ct_CC" >&6
-else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
-
-  CC=$ac_ct_CC
-else
-  CC="$ac_cv_prog_CC"
-fi
-
-if test -z "$CC"; then
-  if test -n "$ac_tool_prefix"; then
-  # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
-set dummy ${ac_tool_prefix}cc; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_CC+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  if test -n "$CC"; then
-  ac_cv_prog_CC="$CC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_CC="${ac_tool_prefix}cc"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-done
-
-fi
-fi
-CC=$ac_cv_prog_CC
-if test -n "$CC"; then
-  echo "$as_me:$LINENO: result: $CC" >&5
-echo "${ECHO_T}$CC" >&6
-else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
-
-fi
-if test -z "$ac_cv_prog_CC"; then
-  ac_ct_CC=$CC
-  # Extract the first word of "cc", so it can be a program name with args.
-set dummy cc; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  if test -n "$ac_ct_CC"; then
-  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_ac_ct_CC="cc"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-done
-
-fi
-fi
-ac_ct_CC=$ac_cv_prog_ac_ct_CC
-if test -n "$ac_ct_CC"; then
-  echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
-echo "${ECHO_T}$ac_ct_CC" >&6
-else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
-
-  CC=$ac_ct_CC
-else
-  CC="$ac_cv_prog_CC"
-fi
-
-fi
-if test -z "$CC"; then
-  # Extract the first word of "cc", so it can be a program name with args.
-set dummy cc; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_CC+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  if test -n "$CC"; then
-  ac_cv_prog_CC="$CC" # Let the user override the test.
-else
-  ac_prog_rejected=no
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
-       ac_prog_rejected=yes
-       continue
-     fi
-    ac_cv_prog_CC="cc"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-done
-
-if test $ac_prog_rejected = yes; then
-  # We found a bogon in the path, so make sure we never use it.
-  set dummy $ac_cv_prog_CC
-  shift
-  if test $# != 0; then
-    # We chose a different compiler from the bogus one.
-    # However, it has the same basename, so the bogon will be chosen
-    # first if we set CC to just the basename; use the full file name.
-    shift
-    ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@"
-  fi
-fi
-fi
-fi
-CC=$ac_cv_prog_CC
-if test -n "$CC"; then
-  echo "$as_me:$LINENO: result: $CC" >&5
-echo "${ECHO_T}$CC" >&6
-else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
-
-fi
-if test -z "$CC"; then
-  if test -n "$ac_tool_prefix"; then
-  for ac_prog in cl
-  do
-    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
-set dummy $ac_tool_prefix$ac_prog; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_CC+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  if test -n "$CC"; then
-  ac_cv_prog_CC="$CC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-done
-
-fi
-fi
-CC=$ac_cv_prog_CC
-if test -n "$CC"; then
-  echo "$as_me:$LINENO: result: $CC" >&5
-echo "${ECHO_T}$CC" >&6
-else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
-
-    test -n "$CC" && break
-  done
-fi
-if test -z "$CC"; then
-  ac_ct_CC=$CC
-  for ac_prog in cl
-do
-  # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  if test -n "$ac_ct_CC"; then
-  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_ac_ct_CC="$ac_prog"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-done
-
-fi
-fi
-ac_ct_CC=$ac_cv_prog_ac_ct_CC
-if test -n "$ac_ct_CC"; then
-  echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
-echo "${ECHO_T}$ac_ct_CC" >&6
-else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
-
-  test -n "$ac_ct_CC" && break
-done
-
-  CC=$ac_ct_CC
-fi
-
-fi
-
-
-test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH" >&5
-echo "$as_me: error: no acceptable C compiler found in \$PATH" >&2;}
-   { (exit 1); exit 1; }; }
-
-# Provide some information about the compiler.
-echo "$as_me:$LINENO:" \
-     "checking for C compiler version" >&5
-ac_compiler=`set X $ac_compile; echo $2`
-{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version </dev/null >&5\"") >&5
-  (eval $ac_compiler --version </dev/null >&5) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }
-{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v </dev/null >&5\"") >&5
-  (eval $ac_compiler -v </dev/null >&5) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }
-{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V </dev/null >&5\"") >&5
-  (eval $ac_compiler -V </dev/null >&5) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }
-
-cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
-#include "confdefs.h"
-
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-ac_clean_files_save=$ac_clean_files
-ac_clean_files="$ac_clean_files a.out a.exe"
-# Try to create an executable without -o first, disregard a.out.
-# It will help us diagnose broken compilers, and finding out an intuition
-# of exeext.
-echo "$as_me:$LINENO: checking for C compiler default output" >&5
-echo $ECHO_N "checking for C compiler default output... $ECHO_C" >&6
-ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
-if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5
-  (eval $ac_link_default) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; then
-  # Find the output, starting from the most likely.  This scheme is
-# not robust to junk in `.', hence go to wildcards (a.*) only as a last
-# resort.
-
-# Be careful to initialize this variable, since it used to be cached.
-# Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile.
-ac_cv_exeext=
-for ac_file in a_out.exe a.exe conftest.exe a.out conftest a.* conftest.*; do
-  test -f "$ac_file" || continue
-  case $ac_file in
-    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;;
-    a.out ) # We found the default executable, but exeext='' is most
-            # certainly right.
-            break;;
-    *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
-          # FIXME: I believe we export ac_cv_exeext for Libtool --akim.
-          export ac_cv_exeext
-          break;;
-    * ) break;;
-  esac
-done
-else
-  echo "$as_me: failed program was:" >&5
-cat conftest.$ac_ext >&5
-{ { echo "$as_me:$LINENO: error: C compiler cannot create executables
-check \`config.log' for details." >&5
-echo "$as_me: error: C compiler cannot create executables
-check \`config.log' for details." >&2;}
-   { (exit 77); exit 77; }; }
-fi
-
-ac_exeext=$ac_cv_exeext
-echo "$as_me:$LINENO: result: $ac_file" >&5
-echo "${ECHO_T}$ac_file" >&6
-
-# Check the compiler produces executables we can run.  If not, either
-# the compiler is broken, or we cross compile.
-echo "$as_me:$LINENO: checking whether the C compiler works" >&5
-echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6
-# FIXME: These cross compiler hacks should be removed for Autoconf 3.0
-# If not cross compiling, check that we can run a simple program.
-if test "$cross_compiling" != yes; then
-  if { ac_try='./$ac_file'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-    cross_compiling=no
-  else
-    if test "$cross_compiling" = maybe; then
-       cross_compiling=yes
-    else
-       { { echo "$as_me:$LINENO: error: cannot run C compiled programs.
-If you meant to cross compile, use \`--host'." >&5
-echo "$as_me: error: cannot run C compiled programs.
-If you meant to cross compile, use \`--host'." >&2;}
-   { (exit 1); exit 1; }; }
-    fi
-  fi
-fi
-echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6
-
-rm -f a.out a.exe conftest$ac_cv_exeext
-ac_clean_files=$ac_clean_files_save
-# Check the compiler produces executables we can run.  If not, either
-# the compiler is broken, or we cross compile.
-echo "$as_me:$LINENO: checking whether we are cross compiling" >&5
-echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6
-echo "$as_me:$LINENO: result: $cross_compiling" >&5
-echo "${ECHO_T}$cross_compiling" >&6
-
-echo "$as_me:$LINENO: checking for suffix of executables" >&5
-echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; then
-  # If both `conftest.exe' and `conftest' are `present' (well, observable)
-# catch `conftest.exe'.  For instance with Cygwin, `ls conftest' will
-# work properly (i.e., refer to `conftest.exe'), while it won't with
-# `rm'.
-for ac_file in conftest.exe conftest conftest.*; do
-  test -f "$ac_file" || continue
-  case $ac_file in
-    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;;
-    *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
-          export ac_cv_exeext
-          break;;
-    * ) break;;
-  esac
-done
-else
-  { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link" >&5
-echo "$as_me: error: cannot compute suffix of executables: cannot compile and link" >&2;}
-   { (exit 1); exit 1; }; }
-fi
-
-rm -f conftest$ac_cv_exeext
-echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5
-echo "${ECHO_T}$ac_cv_exeext" >&6
-
-rm -f conftest.$ac_ext
-EXEEXT=$ac_cv_exeext
-ac_exeext=$EXEEXT
-echo "$as_me:$LINENO: checking for suffix of object files" >&5
-echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6
-if test "${ac_cv_objext+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
-#include "confdefs.h"
-
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.o conftest.obj
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; then
-  for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do
-  case $ac_file in
-    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg ) ;;
-    *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
-       break;;
-  esac
-done
-else
-  echo "$as_me: failed program was:" >&5
-cat conftest.$ac_ext >&5
-{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile" >&5
-echo "$as_me: error: cannot compute suffix of object files: cannot compile" >&2;}
-   { (exit 1); exit 1; }; }
-fi
-
-rm -f conftest.$ac_cv_objext conftest.$ac_ext
-fi
-echo "$as_me:$LINENO: result: $ac_cv_objext" >&5
-echo "${ECHO_T}$ac_cv_objext" >&6
-OBJEXT=$ac_cv_objext
-ac_objext=$OBJEXT
-echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5
-echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6
-if test "${ac_cv_c_compiler_gnu+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
-#include "confdefs.h"
-
-int
-main ()
-{
-#ifndef __GNUC__
-       choke me
-#endif
-
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_compiler_gnu=yes
-else
-  echo "$as_me: failed program was:" >&5
-cat conftest.$ac_ext >&5
-ac_compiler_gnu=no
-fi
-rm -f conftest.$ac_objext conftest.$ac_ext
-ac_cv_c_compiler_gnu=$ac_compiler_gnu
-
-fi
-echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5
-echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6
-GCC=`test $ac_compiler_gnu = yes && echo yes`
-ac_test_CFLAGS=${CFLAGS+set}
-ac_save_CFLAGS=$CFLAGS
-CFLAGS="-g"
-echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5
-echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6
-if test "${ac_cv_prog_cc_g+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
-#include "confdefs.h"
-
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_prog_cc_g=yes
-else
-  echo "$as_me: failed program was:" >&5
-cat conftest.$ac_ext >&5
-ac_cv_prog_cc_g=no
-fi
-rm -f conftest.$ac_objext conftest.$ac_ext
-fi
-echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5
-echo "${ECHO_T}$ac_cv_prog_cc_g" >&6
-if test "$ac_test_CFLAGS" = set; then
-  CFLAGS=$ac_save_CFLAGS
-elif test $ac_cv_prog_cc_g = yes; then
-  if test "$GCC" = yes; then
-    CFLAGS="-g -O2"
-  else
-    CFLAGS="-g"
-  fi
-else
-  if test "$GCC" = yes; then
-    CFLAGS="-O2"
-  else
-    CFLAGS=
-  fi
-fi
-echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5
-echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6
-if test "${ac_cv_prog_cc_stdc+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  ac_cv_prog_cc_stdc=no
-ac_save_CC=$CC
-cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
-#include "confdefs.h"
-#include <stdarg.h>
-#include <stdio.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-/* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
-struct buf { int x; };
-FILE * (*rcsopen) (struct buf *, struct stat *, int);
-static char *e (p, i)
-     char **p;
-     int i;
-{
-  return p[i];
-}
-static char *f (char * (*g) (char **, int), char **p, ...)
-{
-  char *s;
-  va_list v;
-  va_start (v,p);
-  s = g (p, va_arg (v,int));
-  va_end (v);
-  return s;
-}
-int test (int i, double x);
-struct s1 {int (*f) (int a);};
-struct s2 {int (*f) (double a);};
-int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
-int argc;
-char **argv;
-int
-main ()
-{
-return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
-  ;
-  return 0;
-}
-_ACEOF
-# Don't try gcc -ansi; that turns off useful extensions and
-# breaks some systems' header files.
-# AIX                  -qlanglvl=ansi
-# Ultrix and OSF/1     -std1
-# HP-UX 10.20 and later        -Ae
-# HP-UX older versions -Aa -D_HPUX_SOURCE
-# SVR4                 -Xc -D__EXTENSIONS__
-for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
-do
-  CC="$ac_save_CC $ac_arg"
-  rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_prog_cc_stdc=$ac_arg
-break
-else
-  echo "$as_me: failed program was:" >&5
-cat conftest.$ac_ext >&5
-fi
-rm -f conftest.$ac_objext
-done
-rm -f conftest.$ac_ext conftest.$ac_objext
-CC=$ac_save_CC
-
-fi
-
-case "x$ac_cv_prog_cc_stdc" in
-  x|xno)
-    echo "$as_me:$LINENO: result: none needed" >&5
-echo "${ECHO_T}none needed" >&6 ;;
-  *)
-    echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5
-echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6
-    CC="$CC $ac_cv_prog_cc_stdc" ;;
-esac
-
-# Some people use a C++ compiler to compile C.  Since we use `exit',
-# in C++ we need to declare it.  In case someone uses the same compiler
-# for both compiling C and C++ we need to have the C++ compiler decide
-# the declaration of exit, since it's the most demanding environment.
-cat >conftest.$ac_ext <<_ACEOF
-#ifndef __cplusplus
-  choke me
-#endif
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  for ac_declaration in \
-   ''\
-   '#include <stdlib.h>' \
-   'extern "C" void std::exit (int) throw (); using std::exit;' \
-   'extern "C" void std::exit (int); using std::exit;' \
-   'extern "C" void exit (int) throw ();' \
-   'extern "C" void exit (int);' \
-   'void exit (int);'
-do
-  cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
-#include "confdefs.h"
-#include <stdlib.h>
-$ac_declaration
-int
-main ()
-{
-exit (42);
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  :
-else
-  echo "$as_me: failed program was:" >&5
-cat conftest.$ac_ext >&5
-continue
-fi
-rm -f conftest.$ac_objext conftest.$ac_ext
-  cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
-#include "confdefs.h"
-$ac_declaration
-int
-main ()
-{
-exit (42);
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  break
-else
-  echo "$as_me: failed program was:" >&5
-cat conftest.$ac_ext >&5
-fi
-rm -f conftest.$ac_objext conftest.$ac_ext
-done
-rm -f conftest*
-if test -n "$ac_declaration"; then
-  echo '#ifdef __cplusplus' >>confdefs.h
-  echo $ac_declaration      >>confdefs.h
-  echo '#endif'             >>confdefs.h
-fi
-
-else
-  echo "$as_me: failed program was:" >&5
-cat conftest.$ac_ext >&5
-fi
-rm -f conftest.$ac_objext conftest.$ac_ext
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-rm -f .deps 2>/dev/null
-mkdir .deps 2>/dev/null
-if test -d .deps; then
-  DEPDIR=.deps
-else
-  # MS-DOS does not allow filenames that begin with a dot.
-  DEPDIR=_deps
-fi
-rmdir .deps 2>/dev/null
-
-
-          ac_config_commands="$ac_config_commands depfiles"
-
-
-am_make=${MAKE-make}
-cat > confinc << 'END'
-doit:
-       @echo done
-END
-# If we don't find an include directive, just comment out the code.
-echo "$as_me:$LINENO: checking for style of include used by $am_make" >&5
-echo $ECHO_N "checking for style of include used by $am_make... $ECHO_C" >&6
-am__include="#"
-am__quote=
-_am_result=none
-# First try GNU make style include.
-echo "include confinc" > confmf
-# We grep out `Entering directory' and `Leaving directory'
-# messages which can occur if `w' ends up in MAKEFLAGS.
-# In particular we don't look at `^make:' because GNU make might
-# be invoked under some other name (usually "gmake"), in which
-# case it prints its new name instead of `make'.
-if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
-   am__include=include
-   am__quote=
-   _am_result=GNU
-fi
-# Now try BSD make style include.
-if test "$am__include" = "#"; then
-   echo '.include "confinc"' > confmf
-   if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
-      am__include=.include
-      am__quote="\""
-      _am_result=BSD
-   fi
-fi
-
-
-echo "$as_me:$LINENO: result: $_am_result" >&5
-echo "${ECHO_T}$_am_result" >&6
-rm -f confinc confmf
-
-# Check whether --enable-dependency-tracking or --disable-dependency-tracking was given.
-if test "${enable_dependency_tracking+set}" = set; then
-  enableval="$enable_dependency_tracking"
-
-fi;
-if test "x$enable_dependency_tracking" != xno; then
-  am_depcomp="$ac_aux_dir/depcomp"
-  AMDEPBACKSLASH='\'
-fi
-
-
-if test "x$enable_dependency_tracking" != xno; then
-  AMDEP_TRUE=
-  AMDEP_FALSE='#'
-else
-  AMDEP_TRUE='#'
-  AMDEP_FALSE=
-fi
-
-
-
-
-depcc="$CC"   am_compiler_list=
-
-echo "$as_me:$LINENO: checking dependency style of $depcc" >&5
-echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6
-if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
-  # We make a subdir and do the tests there.  Otherwise we can end up
-  # making bogus files that we don't know about and never remove.  For
-  # instance it was reported that on HP-UX the gcc test will end up
-  # making a dummy file named `D' -- because `-MD' means `put the output
-  # in D'.
-  mkdir conftest.dir
-  # Copy depcomp to subdir because otherwise we won't find it if we're
-  # using a relative directory.
-  cp "$am_depcomp" conftest.dir
-  cd conftest.dir
-
-  am_cv_CC_dependencies_compiler_type=none
-  if test "$am_compiler_list" = ""; then
-     am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
-  fi
-  for depmode in $am_compiler_list; do
-    # We need to recreate these files for each test, as the compiler may
-    # overwrite some of them when testing with obscure command lines.
-    # This happens at least with the AIX C compiler.
-    echo '#include "conftest.h"' > conftest.c
-    echo 'int i;' > conftest.h
-    echo "${am__include} ${am__quote}conftest.Po${am__quote}" > confmf
-
-    case $depmode in
-    nosideeffect)
-      # after this tag, mechanisms are not by side-effect, so they'll
-      # only be used when explicitly requested
-      if test "x$enable_dependency_tracking" = xyes; then
-       continue
-      else
-       break
-      fi
-      ;;
-    none) break ;;
-    esac
-    # We check with `-c' and `-o' for the sake of the "dashmstdout"
-    # mode.  It turns out that the SunPro C++ compiler does not properly
-    # handle `-M -o', and we need to detect this.
-    if depmode=$depmode \
-       source=conftest.c object=conftest.o \
-       depfile=conftest.Po tmpdepfile=conftest.TPo \
-       $SHELL ./depcomp $depcc -c conftest.c -o conftest.o >/dev/null 2>&1 &&
-       grep conftest.h conftest.Po > /dev/null 2>&1 &&
-       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
-      am_cv_CC_dependencies_compiler_type=$depmode
-      break
-    fi
-  done
-
-  cd ..
-  rm -rf conftest.dir
-else
-  am_cv_CC_dependencies_compiler_type=none
-fi
-
-fi
-echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5
-echo "${ECHO_T}$am_cv_CC_dependencies_compiler_type" >&6
-CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type
-
-
-
-if
-  test "x$enable_dependency_tracking" != xno \
-  && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then
-  am__fastdepCC_TRUE=
-  am__fastdepCC_FALSE='#'
-else
-  am__fastdepCC_TRUE='#'
-  am__fastdepCC_FALSE=
-fi
-
-
-
-
-
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5
-echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6
-# On Suns, sometimes $CPP names a directory.
-if test -n "$CPP" && test -d "$CPP"; then
-  CPP=
-fi
-if test -z "$CPP"; then
-  if test "${ac_cv_prog_CPP+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-      # Double quotes because CPP needs to be expanded
-    for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
-    do
-      ac_preproc_ok=false
-for ac_c_preproc_warn_flag in '' yes
-do
-  # Use a header file that comes with gcc, so configuring glibc
-  # with a fresh cross-compiler works.
-  # On the NeXT, cc -E runs the code through the compiler's parser,
-  # not just through cpp. "Syntax error" is here to catch this case.
-  cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
-#include "confdefs.h"
-#include <assert.h>
-                     Syntax error
-_ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
-  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null; then
-  if test -s conftest.err; then
-    ac_cpp_err=$ac_c_preproc_warn_flag
-  else
-    ac_cpp_err=
-  fi
-else
-  ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
-  :
-else
-  echo "$as_me: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  # Broken: fails on valid input.
-continue
-fi
-rm -f conftest.err conftest.$ac_ext
-
-  # OK, works on sane cases.  Now check whether non-existent headers
-  # can be detected and how.
-  cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
-#include "confdefs.h"
-#include <ac_nonexistent.h>
-_ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
-  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null; then
-  if test -s conftest.err; then
-    ac_cpp_err=$ac_c_preproc_warn_flag
-  else
-    ac_cpp_err=
-  fi
-else
-  ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
-  # Broken: success on invalid input.
-continue
-else
-  echo "$as_me: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  # Passes both tests.
-ac_preproc_ok=:
-break
-fi
-rm -f conftest.err conftest.$ac_ext
-
-done
-# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
-rm -f conftest.err conftest.$ac_ext
-if $ac_preproc_ok; then
-  break
-fi
-
-    done
-    ac_cv_prog_CPP=$CPP
-
-fi
-  CPP=$ac_cv_prog_CPP
-else
-  ac_cv_prog_CPP=$CPP
-fi
-echo "$as_me:$LINENO: result: $CPP" >&5
-echo "${ECHO_T}$CPP" >&6
-ac_preproc_ok=false
-for ac_c_preproc_warn_flag in '' yes
-do
-  # Use a header file that comes with gcc, so configuring glibc
-  # with a fresh cross-compiler works.
-  # On the NeXT, cc -E runs the code through the compiler's parser,
-  # not just through cpp. "Syntax error" is here to catch this case.
-  cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
-#include "confdefs.h"
-#include <assert.h>
-                     Syntax error
-_ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
-  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null; then
-  if test -s conftest.err; then
-    ac_cpp_err=$ac_c_preproc_warn_flag
-  else
-    ac_cpp_err=
-  fi
-else
-  ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
-  :
-else
-  echo "$as_me: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  # Broken: fails on valid input.
-continue
-fi
-rm -f conftest.err conftest.$ac_ext
-
-  # OK, works on sane cases.  Now check whether non-existent headers
-  # can be detected and how.
-  cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
-#include "confdefs.h"
-#include <ac_nonexistent.h>
-_ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
-  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null; then
-  if test -s conftest.err; then
-    ac_cpp_err=$ac_c_preproc_warn_flag
-  else
-    ac_cpp_err=
-  fi
-else
-  ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
-  # Broken: success on invalid input.
-continue
-else
-  echo "$as_me: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  # Passes both tests.
-ac_preproc_ok=:
-break
-fi
-rm -f conftest.err conftest.$ac_ext
-
-done
-# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
-rm -f conftest.err conftest.$ac_ext
-if $ac_preproc_ok; then
-  :
-else
-  { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check" >&5
-echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check" >&2;}
-   { (exit 1); exit 1; }; }
-fi
-
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-
-echo "$as_me:$LINENO: checking for egrep" >&5
-echo $ECHO_N "checking for egrep... $ECHO_C" >&6
-if test "${ac_cv_prog_egrep+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  if echo a | (grep -E '(a|b)') >/dev/null 2>&1
-    then ac_cv_prog_egrep='grep -E'
-    else ac_cv_prog_egrep='egrep'
-    fi
-fi
-echo "$as_me:$LINENO: result: $ac_cv_prog_egrep" >&5
-echo "${ECHO_T}$ac_cv_prog_egrep" >&6
- EGREP=$ac_cv_prog_egrep
-
-
-echo "$as_me:$LINENO: checking for ANSI C header files" >&5
-echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
-if test "${ac_cv_header_stdc+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
-#include "confdefs.h"
-#include <stdlib.h>
-#include <stdarg.h>
-#include <string.h>
-#include <float.h>
-
-_ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
-  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null; then
-  if test -s conftest.err; then
-    ac_cpp_err=$ac_c_preproc_warn_flag
-  else
-    ac_cpp_err=
-  fi
-else
-  ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
-  ac_cv_header_stdc=yes
-else
-  echo "$as_me: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  ac_cv_header_stdc=no
-fi
-rm -f conftest.err conftest.$ac_ext
-
-if test $ac_cv_header_stdc = yes; then
-  # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
-  cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
-#include "confdefs.h"
-#include <string.h>
-
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "memchr" >/dev/null 2>&1; then
-  :
-else
-  ac_cv_header_stdc=no
-fi
-rm -f conftest*
-
-fi
-
-if test $ac_cv_header_stdc = yes; then
-  # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
-  cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
-#include "confdefs.h"
-#include <stdlib.h>
-
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "free" >/dev/null 2>&1; then
-  :
-else
-  ac_cv_header_stdc=no
-fi
-rm -f conftest*
-
-fi
-
-if test $ac_cv_header_stdc = yes; then
-  # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
-  if test "$cross_compiling" = yes; then
-  :
-else
-  cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
-#include "confdefs.h"
-#include <ctype.h>
-#if ((' ' & 0x0FF) == 0x020)
-# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
-# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
-#else
-# define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
-                     || ('j' <= (c) && (c) <= 'r') \
-                     || ('s' <= (c) && (c) <= 'z'))
-# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
-#endif
-
-#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
-int
-main ()
-{
-  int i;
-  for (i = 0; i < 256; i++)
-    if (XOR (islower (i), ISLOWER (i))
-        || toupper (i) != TOUPPER (i))
-      exit(2);
-  exit (0);
-}
-_ACEOF
-rm -f conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  :
-else
-  echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
-cat conftest.$ac_ext >&5
-( exit $ac_status )
-ac_cv_header_stdc=no
-fi
-rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
-fi
-fi
-fi
-echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5
-echo "${ECHO_T}$ac_cv_header_stdc" >&6
-if test $ac_cv_header_stdc = yes; then
-
-cat >>confdefs.h <<\_ACEOF
-#define STDC_HEADERS 1
-_ACEOF
-
-fi
-
-
-echo "$as_me:$LINENO: checking for an ANSI C-conforming const" >&5
-echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6
-if test "${ac_cv_c_const+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
-#include "confdefs.h"
-
-int
-main ()
-{
-/* FIXME: Include the comments suggested by Paul. */
-#ifndef __cplusplus
-  /* Ultrix mips cc rejects this.  */
-  typedef int charset[2];
-  const charset x;
-  /* SunOS 4.1.1 cc rejects this.  */
-  char const *const *ccp;
-  char **p;
-  /* NEC SVR4.0.2 mips cc rejects this.  */
-  struct point {int x, y;};
-  static struct point const zero = {0,0};
-  /* AIX XL C 1.02.0.0 rejects this.
-     It does not let you subtract one const X* pointer from another in
-     an arm of an if-expression whose if-part is not a constant
-     expression */
-  const char *g = "string";
-  ccp = &g + (g ? g-g : 0);
-  /* HPUX 7.0 cc rejects these. */
-  ++ccp;
-  p = (char**) ccp;
-  ccp = (char const *const *) p;
-  { /* SCO 3.2v4 cc rejects this.  */
-    char *t;
-    char const *s = 0 ? (char *) 0 : (char const *) 0;
-
-    *t++ = 0;
-  }
-  { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
-    int x[] = {25, 17};
-    const int *foo = &x[0];
-    ++foo;
-  }
-  { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
-    typedef const int *iptr;
-    iptr p = 0;
-    ++p;
-  }
-  { /* AIX XL C 1.02.0.0 rejects this saying
-       "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
-    struct s { int j; const int *ap[3]; };
-    struct s *b; b->j = 5;
-  }
-  { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
-    const int foo = 10;
-  }
-#endif
-
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_c_const=yes
-else
-  echo "$as_me: failed program was:" >&5
-cat conftest.$ac_ext >&5
-ac_cv_c_const=no
-fi
-rm -f conftest.$ac_objext conftest.$ac_ext
-fi
-echo "$as_me:$LINENO: result: $ac_cv_c_const" >&5
-echo "${ECHO_T}$ac_cv_c_const" >&6
-if test $ac_cv_c_const = no; then
-
-cat >>confdefs.h <<\_ACEOF
-#define const
-_ACEOF
-
-fi
-
-# On IRIX 5.3, sys/types and inttypes.h are conflicting.
-
-
-
-
-
-
-
-
-
-for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
-                  inttypes.h stdint.h unistd.h
-do
-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
-#include "confdefs.h"
-$ac_includes_default
-
-#include <$ac_header>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  eval "$as_ac_Header=yes"
-else
-  echo "$as_me: failed program was:" >&5
-cat conftest.$ac_ext >&5
-eval "$as_ac_Header=no"
-fi
-rm -f conftest.$ac_objext conftest.$ac_ext
-fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
-  cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-
-done
-
-
-echo "$as_me:$LINENO: checking for size_t" >&5
-echo $ECHO_N "checking for size_t... $ECHO_C" >&6
-if test "${ac_cv_type_size_t+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
-#include "confdefs.h"
-$ac_includes_default
-int
-main ()
-{
-if ((size_t *) 0)
-  return 0;
-if (sizeof (size_t))
-  return 0;
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_type_size_t=yes
-else
-  echo "$as_me: failed program was:" >&5
-cat conftest.$ac_ext >&5
-ac_cv_type_size_t=no
-fi
-rm -f conftest.$ac_objext conftest.$ac_ext
-fi
-echo "$as_me:$LINENO: result: $ac_cv_type_size_t" >&5
-echo "${ECHO_T}$ac_cv_type_size_t" >&6
-if test $ac_cv_type_size_t = yes; then
-  :
-else
-
-cat >>confdefs.h <<_ACEOF
-#define size_t unsigned
-_ACEOF
-
-fi
-
-
-
-for ac_func in strftime
-do
-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
-if eval "test \"\${$as_ac_var+set}\" = set"; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
-#include "confdefs.h"
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char $ac_func (); below.  */
-#include <assert.h>
-/* Override any gcc2 internal prototype to avoid an error.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
-char $ac_func ();
-char (*f) ();
-
-int
-main ()
-{
-/* The GNU C library defines this for functions which it implements
-    to always fail with ENOSYS.  Some functions are actually named
-    something starting with __ and the normal name is an alias.  */
-#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
-choke me
-#else
-f = $ac_func;
-#endif
-
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  eval "$as_ac_var=yes"
-else
-  echo "$as_me: failed program was:" >&5
-cat conftest.$ac_ext >&5
-eval "$as_ac_var=no"
-fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
-fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
-if test `eval echo '${'$as_ac_var'}'` = yes; then
-  cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
-
-else
-  # strftime is in -lintl on SCO UNIX.
-echo "$as_me:$LINENO: checking for strftime in -lintl" >&5
-echo $ECHO_N "checking for strftime in -lintl... $ECHO_C" >&6
-if test "${ac_cv_lib_intl_strftime+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lintl  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
-#include "confdefs.h"
-
-/* Override any gcc2 internal prototype to avoid an error.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
-char strftime ();
-int
-main ()
-{
-strftime ();
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_lib_intl_strftime=yes
-else
-  echo "$as_me: failed program was:" >&5
-cat conftest.$ac_ext >&5
-ac_cv_lib_intl_strftime=no
-fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-echo "$as_me:$LINENO: result: $ac_cv_lib_intl_strftime" >&5
-echo "${ECHO_T}$ac_cv_lib_intl_strftime" >&6
-if test $ac_cv_lib_intl_strftime = yes; then
-  cat >>confdefs.h <<\_ACEOF
-#define HAVE_STRFTIME 1
-_ACEOF
-
-LIBS="-lintl $LIBS"
-fi
-
-fi
-done
-
-
-for ac_func in vprintf
-do
-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
-if eval "test \"\${$as_ac_var+set}\" = set"; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
-#include "confdefs.h"
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char $ac_func (); below.  */
-#include <assert.h>
-/* Override any gcc2 internal prototype to avoid an error.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
-char $ac_func ();
-char (*f) ();
-
-int
-main ()
-{
-/* The GNU C library defines this for functions which it implements
-    to always fail with ENOSYS.  Some functions are actually named
-    something starting with __ and the normal name is an alias.  */
-#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
-choke me
-#else
-f = $ac_func;
-#endif
-
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  eval "$as_ac_var=yes"
-else
-  echo "$as_me: failed program was:" >&5
-cat conftest.$ac_ext >&5
-eval "$as_ac_var=no"
-fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
-fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
-if test `eval echo '${'$as_ac_var'}'` = yes; then
-  cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
-
-echo "$as_me:$LINENO: checking for _doprnt" >&5
-echo $ECHO_N "checking for _doprnt... $ECHO_C" >&6
-if test "${ac_cv_func__doprnt+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
-#include "confdefs.h"
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char _doprnt (); below.  */
-#include <assert.h>
-/* Override any gcc2 internal prototype to avoid an error.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
-char _doprnt ();
-char (*f) ();
-
-int
-main ()
-{
-/* The GNU C library defines this for functions which it implements
-    to always fail with ENOSYS.  Some functions are actually named
-    something starting with __ and the normal name is an alias.  */
-#if defined (__stub__doprnt) || defined (__stub____doprnt)
-choke me
-#else
-f = _doprnt;
-#endif
-
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_func__doprnt=yes
-else
-  echo "$as_me: failed program was:" >&5
-cat conftest.$ac_ext >&5
-ac_cv_func__doprnt=no
-fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
-fi
-echo "$as_me:$LINENO: result: $ac_cv_func__doprnt" >&5
-echo "${ECHO_T}$ac_cv_func__doprnt" >&6
-if test $ac_cv_func__doprnt = yes; then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_DOPRNT 1
-_ACEOF
-
-fi
-
-fi
-done
-
-
-
-for ac_func in strstr
-do
-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
-if eval "test \"\${$as_ac_var+set}\" = set"; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
-#include "confdefs.h"
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char $ac_func (); below.  */
-#include <assert.h>
-/* Override any gcc2 internal prototype to avoid an error.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
-char $ac_func ();
-char (*f) ();
-
-int
-main ()
-{
-/* The GNU C library defines this for functions which it implements
-    to always fail with ENOSYS.  Some functions are actually named
-    something starting with __ and the normal name is an alias.  */
-#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
-choke me
-#else
-f = $ac_func;
-#endif
-
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  eval "$as_ac_var=yes"
-else
-  echo "$as_me: failed program was:" >&5
-cat conftest.$ac_ext >&5
-eval "$as_ac_var=no"
-fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
-fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
-if test `eval echo '${'$as_ac_var'}'` = yes; then
-  cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-done
-
-
-                              ac_config_files="$ac_config_files makefile Docs/makefile Source/makefile"
-cat >confcache <<\_ACEOF
-# This file is a shell script that caches the results of configure
-# tests run on this system so they can be shared between configure
-# scripts and configure runs, see configure's option --config-cache.
-# It is not useful on other systems.  If it contains results you don't
-# want to keep, you may remove or edit it.
-#
-# config.status only pays attention to the cache file if you give it
-# the --recheck option to rerun configure.
-#
-# `ac_cv_env_foo' variables (set or unset) will be overridden when
-# loading this file, other *unset* `ac_cv_foo' will be assigned the
-# following values.
-
-_ACEOF
-
-# The following way of writing the cache mishandles newlines in values,
-# but we know of no workaround that is simple, portable, and efficient.
-# So, don't put newlines in cache variables' values.
-# Ultrix sh set writes to stderr and can't be redirected directly,
-# and sets the high bit in the cache file unless we assign to the vars.
-{
-  (set) 2>&1 |
-    case `(ac_space=' '; set | grep ac_space) 2>&1` in
-    *ac_space=\ *)
-      # `set' does not quote correctly, so add quotes (double-quote
-      # substitution turns \\\\ into \\, and sed turns \\ into \).
-      sed -n \
-        "s/'/'\\\\''/g;
-         s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
-      ;;
-    *)
-      # `set' quotes correctly as required by POSIX, so do not add quotes.
-      sed -n \
-        "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
-      ;;
-    esac;
-} |
-  sed '
-     t clear
-     : clear
-     s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
-     t end
-     /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
-     : end' >>confcache
-if cmp -s $cache_file confcache; then :; else
-  if test -w $cache_file; then
-    test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file"
-    cat confcache >$cache_file
-  else
-    echo "not updating unwritable cache $cache_file"
-  fi
-fi
-rm -f confcache
-
-test "x$prefix" = xNONE && prefix=$ac_default_prefix
-# Let make expand exec_prefix.
-test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
-
-# VPATH may cause trouble with some makes, so we remove $(srcdir),
-# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
-# trailing colons and then remove the whole line if VPATH becomes empty
-# (actually we leave an empty line to preserve line numbers).
-if test "x$srcdir" = x.; then
-  ac_vpsub='/^[        ]*VPATH[        ]*=/{
-s/:*\$(srcdir):*/:/;
-s/:*\${srcdir}:*/:/;
-s/:*@srcdir@:*/:/;
-s/^\([^=]*=[   ]*\):*/\1/;
-s/:*$//;
-s/^[^=]*=[     ]*$//;
-}'
-fi
-
-DEFS=-DHAVE_CONFIG_H
-
-ac_libobjs=
-ac_ltlibobjs=
-for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
-  # 1. Remove the extension, and $U if already installed.
-  ac_i=`echo "$ac_i" |
-         sed 's/\$U\././;s/\.o$//;s/\.obj$//'`
-  # 2. Add them.
-  ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext"
-  ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo'
-done
-LIBOBJS=$ac_libobjs
-
-LTLIBOBJS=$ac_ltlibobjs
-
-
-if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then
-  { { echo "$as_me:$LINENO: error: conditional \"AMDEP\" was never defined.
-Usually this means the macro was only invoked conditionally." >&5
-echo "$as_me: error: conditional \"AMDEP\" was never defined.
-Usually this means the macro was only invoked conditionally." >&2;}
-   { (exit 1); exit 1; }; }
-fi
-if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then
-  { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCC\" was never defined.
-Usually this means the macro was only invoked conditionally." >&5
-echo "$as_me: error: conditional \"am__fastdepCC\" was never defined.
-Usually this means the macro was only invoked conditionally." >&2;}
-   { (exit 1); exit 1; }; }
-fi
-
-: ${CONFIG_STATUS=./config.status}
-ac_clean_files_save=$ac_clean_files
-ac_clean_files="$ac_clean_files $CONFIG_STATUS"
-{ echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5
-echo "$as_me: creating $CONFIG_STATUS" >&6;}
-cat >$CONFIG_STATUS <<_ACEOF
-#! $SHELL
-# Generated by $as_me.
-# Run this file to recreate the current configuration.
-# Compiler output produced by configure, useful for debugging
-# configure, is in config.log if it exists.
-
-debug=false
-SHELL=\${CONFIG_SHELL-$SHELL}
-_ACEOF
-
-cat >>$CONFIG_STATUS <<\_ACEOF
-## --------------------- ##
-## M4sh Initialization.  ##
-## --------------------- ##
-
-# Be Bourne compatible
-if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
-  emulate sh
-  NULLCMD=:
-  # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
-  # is contrary to our usage.  Disable this feature.
-  alias -g '${1+"$@"}'='"$@"'
-elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
-  set -o posix
-fi
-
-# Support unset when possible.
-if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
-  as_unset=unset
-else
-  as_unset=false
-fi
-
-
-# Work around bugs in pre-3.0 UWIN ksh.
-$as_unset ENV MAIL MAILPATH
-PS1='$ '
-PS2='> '
-PS4='+ '
-
-# NLS nuisances.
-for as_var in LANG LANGUAGE LC_ALL LC_COLLATE LC_CTYPE LC_NUMERIC LC_MESSAGES LC_TIME
-do
-  if (set +x; test -n "`(eval $as_var=C; export $as_var) 2>&1`"); then
-    eval $as_var=C; export $as_var
-  else
-    $as_unset $as_var
-  fi
-done
-
-# Required to use basename.
-if expr a : '\(a\)' >/dev/null 2>&1; then
-  as_expr=expr
-else
-  as_expr=false
-fi
-
-if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then
-  as_basename=basename
-else
-  as_basename=false
-fi
-
-
-# Name of the executable.
-as_me=`$as_basename "$0" ||
-$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
-        X"$0" : 'X\(//\)$' \| \
-        X"$0" : 'X\(/\)$' \| \
-        .     : '\(.\)' 2>/dev/null ||
-echo X/"$0" |
-    sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; }
-         /^X\/\(\/\/\)$/{ s//\1/; q; }
-         /^X\/\(\/\).*/{ s//\1/; q; }
-         s/.*/./; q'`
-
-
-# PATH needs CR, and LINENO needs CR and PATH.
-# Avoid depending upon Character Ranges.
-as_cr_letters='abcdefghijklmnopqrstuvwxyz'
-as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
-as_cr_Letters=$as_cr_letters$as_cr_LETTERS
-as_cr_digits='0123456789'
-as_cr_alnum=$as_cr_Letters$as_cr_digits
-
-# The user is always right.
-if test "${PATH_SEPARATOR+set}" != set; then
-  echo "#! /bin/sh" >conftest.sh
-  echo  "exit 0"   >>conftest.sh
-  chmod +x conftest.sh
-  if (PATH="/nonexistent;."; conftest.sh) >/dev/null 2>&1; then
-    PATH_SEPARATOR=';'
-  else
-    PATH_SEPARATOR=:
-  fi
-  rm -f conftest.sh
-fi
-
-
-  as_lineno_1=$LINENO
-  as_lineno_2=$LINENO
-  as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
-  test "x$as_lineno_1" != "x$as_lineno_2" &&
-  test "x$as_lineno_3"  = "x$as_lineno_2"  || {
-  # Find who we are.  Look in the path if we contain no path at all
-  # relative or not.
-  case $0 in
-    *[\\/]* ) as_myself=$0 ;;
-    *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
-done
-
-       ;;
-  esac
-  # We did not find ourselves, most probably we were run as `sh COMMAND'
-  # in which case we are not to be found in the path.
-  if test "x$as_myself" = x; then
-    as_myself=$0
-  fi
-  if test ! -f "$as_myself"; then
-    { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5
-echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;}
-   { (exit 1); exit 1; }; }
-  fi
-  case $CONFIG_SHELL in
-  '')
-    as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for as_base in sh bash ksh sh5; do
-        case $as_dir in
-        /*)
-          if ("$as_dir/$as_base" -c '
-  as_lineno_1=$LINENO
-  as_lineno_2=$LINENO
-  as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
-  test "x$as_lineno_1" != "x$as_lineno_2" &&
-  test "x$as_lineno_3"  = "x$as_lineno_2" ') 2>/dev/null; then
-            $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; }
-            $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; }
-            CONFIG_SHELL=$as_dir/$as_base
-            export CONFIG_SHELL
-            exec "$CONFIG_SHELL" "$0" ${1+"$@"}
-          fi;;
-        esac
-       done
-done
-;;
-  esac
-
-  # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
-  # uniformly replaced by the line number.  The first 'sed' inserts a
-  # line-number line before each line; the second 'sed' does the real
-  # work.  The second script uses 'N' to pair each line-number line
-  # with the numbered line, and appends trailing '-' during
-  # substitution so that $LINENO is not a special case at line end.
-  # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
-  # second 'sed' script.  Blame Lee E. McMahon for sed's syntax.  :-)
-  sed '=' <$as_myself |
-    sed '
-      N
-      s,$,-,
-      : loop
-      s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3,
-      t loop
-      s,-$,,
-      s,^['$as_cr_digits']*\n,,
-    ' >$as_me.lineno &&
-  chmod +x $as_me.lineno ||
-    { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5
-echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;}
-   { (exit 1); exit 1; }; }
-
-  # Don't try to exec as it changes $[0], causing all sort of problems
-  # (the dirname of $[0] is not the place where we might find the
-  # original and so on.  Autoconf is especially sensible to this).
-  . ./$as_me.lineno
-  # Exit status is that of the last command.
-  exit
-}
-
-
-case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in
-  *c*,-n*) ECHO_N= ECHO_C='
-' ECHO_T='     ' ;;
-  *c*,*  ) ECHO_N=-n ECHO_C= ECHO_T= ;;
-  *)       ECHO_N= ECHO_C='\c' ECHO_T= ;;
-esac
-
-if expr a : '\(a\)' >/dev/null 2>&1; then
-  as_expr=expr
-else
-  as_expr=false
-fi
-
-rm -f conf$$ conf$$.exe conf$$.file
-echo >conf$$.file
-if ln -s conf$$.file conf$$ 2>/dev/null; then
-  # We could just check for DJGPP; but this test a) works b) is more generic
-  # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
-  if test -f conf$$.exe; then
-    # Don't use ln at all; we don't have any links
-    as_ln_s='cp -p'
-  else
-    as_ln_s='ln -s'
-  fi
-elif ln conf$$.file conf$$ 2>/dev/null; then
-  as_ln_s=ln
-else
-  as_ln_s='cp -p'
-fi
-rm -f conf$$ conf$$.exe conf$$.file
-
-if mkdir -p . 2>/dev/null; then
-  as_mkdir_p=:
-else
-  as_mkdir_p=false
-fi
-
-as_executable_p="test -f"
-
-# Sed expression to map a string onto a valid CPP name.
-as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g"
-
-# Sed expression to map a string onto a valid variable name.
-as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g"
-
-
-# IFS
-# We need space, tab and new line, in precisely that order.
-as_nl='
-'
-IFS="  $as_nl"
-
-# CDPATH.
-$as_unset CDPATH
-
-exec 6>&1
-
-# Open the log real soon, to keep \$[0] and so on meaningful, and to
-# report actual input values of CONFIG_FILES etc. instead of their
-# values after options handling.  Logging --version etc. is OK.
-exec 5>>config.log
-{
-  echo
-  sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
-## Running $as_me. ##
-_ASBOX
-} >&5
-cat >&5 <<_CSEOF
-
-This file was extended by $as_me, which was
-generated by GNU Autoconf 2.54.  Invocation command line was
-
-  CONFIG_FILES    = $CONFIG_FILES
-  CONFIG_HEADERS  = $CONFIG_HEADERS
-  CONFIG_LINKS    = $CONFIG_LINKS
-  CONFIG_COMMANDS = $CONFIG_COMMANDS
-  $ $0 $@
-
-_CSEOF
-echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5
-echo >&5
-_ACEOF
-
-# Files that config.status was made for.
-if test -n "$ac_config_files"; then
-  echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS
-fi
-
-if test -n "$ac_config_headers"; then
-  echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS
-fi
-
-if test -n "$ac_config_links"; then
-  echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS
-fi
-
-if test -n "$ac_config_commands"; then
-  echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS
-fi
-
-cat >>$CONFIG_STATUS <<\_ACEOF
-
-ac_cs_usage="\
-\`$as_me' instantiates files from templates according to the
-current configuration.
-
-Usage: $0 [OPTIONS] [FILE]...
-
-  -h, --help       print this help, then exit
-  -V, --version    print version number, then exit
-  -d, --debug      don't remove temporary files
-      --recheck    update $as_me by reconfiguring in the same conditions
-  --file=FILE[:TEMPLATE]
-                   instantiate the configuration file FILE
-  --header=FILE[:TEMPLATE]
-                   instantiate the configuration header FILE
-
-Configuration files:
-$config_files
-
-Configuration headers:
-$config_headers
-
-Configuration commands:
-$config_commands
-
-Report bugs to <bug-autoconf@gnu.org>."
-_ACEOF
-
-cat >>$CONFIG_STATUS <<_ACEOF
-ac_cs_version="\\
-config.status
-configured by $0, generated by GNU Autoconf 2.54,
-  with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
-
-Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
-Free Software Foundation, Inc.
-This config.status script is free software; the Free Software Foundation
-gives unlimited permission to copy, distribute and modify it."
-srcdir=$srcdir
-INSTALL="$INSTALL"
-_ACEOF
-
-cat >>$CONFIG_STATUS <<\_ACEOF
-# If no file are specified by the user, then we need to provide default
-# value.  By we need to know if files were specified by the user.
-ac_need_defaults=:
-while test $# != 0
-do
-  case $1 in
-  --*=*)
-    ac_option=`expr "x$1" : 'x\([^=]*\)='`
-    ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'`
-    ac_shift=:
-    ;;
-  -*)
-    ac_option=$1
-    ac_optarg=$2
-    ac_shift=shift
-    ;;
-  *) # This is not an option, so the user has probably given explicit
-     # arguments.
-     ac_option=$1
-     ac_need_defaults=false;;
-  esac
-
-  case $ac_option in
-  # Handling of the options.
-_ACEOF
-cat >>$CONFIG_STATUS <<_ACEOF
-  -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
-    echo "running $SHELL $0 " $ac_configure_args " --no-create --no-recursion"
-    exec $SHELL $0 $ac_configure_args --no-create --no-recursion ;;
-_ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF
-  --version | --vers* | -V )
-    echo "$ac_cs_version"; exit 0 ;;
-  --he | --h)
-    # Conflict between --help and --header
-    { { echo "$as_me:$LINENO: error: ambiguous option: $1
-Try \`$0 --help' for more information." >&5
-echo "$as_me: error: ambiguous option: $1
-Try \`$0 --help' for more information." >&2;}
-   { (exit 1); exit 1; }; };;
-  --help | --hel | -h )
-    echo "$ac_cs_usage"; exit 0 ;;
-  --debug | --d* | -d )
-    debug=: ;;
-  --file | --fil | --fi | --f )
-    $ac_shift
-    CONFIG_FILES="$CONFIG_FILES $ac_optarg"
-    ac_need_defaults=false;;
-  --header | --heade | --head | --hea )
-    $ac_shift
-    CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg"
-    ac_need_defaults=false;;
-
-  # This is an error.
-  -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1
-Try \`$0 --help' for more information." >&5
-echo "$as_me: error: unrecognized option: $1
-Try \`$0 --help' for more information." >&2;}
-   { (exit 1); exit 1; }; } ;;
-
-  *) ac_config_targets="$ac_config_targets $1" ;;
-
-  esac
-  shift
-done
-
-_ACEOF
-
-cat >>$CONFIG_STATUS <<_ACEOF
-#
-# INIT-COMMANDS section.
-#
-
-AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"
-
-_ACEOF
-
-
-
-cat >>$CONFIG_STATUS <<\_ACEOF
-for ac_config_target in $ac_config_targets
-do
-  case "$ac_config_target" in
-  # Handling of arguments.
-  "makefile" ) CONFIG_FILES="$CONFIG_FILES makefile" ;;
-  "Docs/makefile" ) CONFIG_FILES="$CONFIG_FILES Docs/makefile" ;;
-  "Source/makefile" ) CONFIG_FILES="$CONFIG_FILES Source/makefile" ;;
-  "depfiles" ) CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
-  "Source/config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS Source/config.h" ;;
-  *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5
-echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
-   { (exit 1); exit 1; }; };;
-  esac
-done
-
-# If the user did not use the arguments to specify the items to instantiate,
-# then the envvar interface is used.  Set only those that are not.
-# We use the long form for the default assignment because of an extremely
-# bizarre bug on SunOS 4.1.3.
-if $ac_need_defaults; then
-  test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
-  test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
-  test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
-fi
-
-# Create a temporary directory, and hook for its removal unless debugging.
-$debug ||
-{
-  trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
-  trap '{ (exit 1); exit 1; }' 1 2 13 15
-}
-
-# Create a (secure) tmp directory for tmp files.
-: ${TMPDIR=/tmp}
-{
-  tmp=`(umask 077 && mktemp -d -q "$TMPDIR/csXXXXXX") 2>/dev/null` &&
-  test -n "$tmp" && test -d "$tmp"
-}  ||
-{
-  tmp=$TMPDIR/cs$$-$RANDOM
-  (umask 077 && mkdir $tmp)
-} ||
-{
-   echo "$me: cannot create a temporary directory in $TMPDIR" >&2
-   { (exit 1); exit 1; }
-}
-
-_ACEOF
-
-cat >>$CONFIG_STATUS <<_ACEOF
-
-#
-# CONFIG_FILES section.
-#
-
-# No need to generate the scripts if there are no CONFIG_FILES.
-# This happens for instance when ./config.status config.h
-if test -n "\$CONFIG_FILES"; then
-  # Protect against being on the right side of a sed subst in config.status.
-  sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g;
-   s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF
-s,@SHELL@,$SHELL,;t t
-s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t
-s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t
-s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t
-s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t
-s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t
-s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t
-s,@exec_prefix@,$exec_prefix,;t t
-s,@prefix@,$prefix,;t t
-s,@program_transform_name@,$program_transform_name,;t t
-s,@bindir@,$bindir,;t t
-s,@sbindir@,$sbindir,;t t
-s,@libexecdir@,$libexecdir,;t t
-s,@datadir@,$datadir,;t t
-s,@sysconfdir@,$sysconfdir,;t t
-s,@sharedstatedir@,$sharedstatedir,;t t
-s,@localstatedir@,$localstatedir,;t t
-s,@libdir@,$libdir,;t t
-s,@includedir@,$includedir,;t t
-s,@oldincludedir@,$oldincludedir,;t t
-s,@infodir@,$infodir,;t t
-s,@mandir@,$mandir,;t t
-s,@build_alias@,$build_alias,;t t
-s,@host_alias@,$host_alias,;t t
-s,@target_alias@,$target_alias,;t t
-s,@DEFS@,$DEFS,;t t
-s,@ECHO_C@,$ECHO_C,;t t
-s,@ECHO_N@,$ECHO_N,;t t
-s,@ECHO_T@,$ECHO_T,;t t
-s,@LIBS@,$LIBS,;t t
-s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t
-s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t
-s,@INSTALL_DATA@,$INSTALL_DATA,;t t
-s,@CYGPATH_W@,$CYGPATH_W,;t t
-s,@PACKAGE@,$PACKAGE,;t t
-s,@VERSION@,$VERSION,;t t
-s,@ACLOCAL@,$ACLOCAL,;t t
-s,@AUTOCONF@,$AUTOCONF,;t t
-s,@AUTOMAKE@,$AUTOMAKE,;t t
-s,@AUTOHEADER@,$AUTOHEADER,;t t
-s,@MAKEINFO@,$MAKEINFO,;t t
-s,@AMTAR@,$AMTAR,;t t
-s,@install_sh@,$install_sh,;t t
-s,@STRIP@,$STRIP,;t t
-s,@ac_ct_STRIP@,$ac_ct_STRIP,;t t
-s,@INSTALL_STRIP_PROGRAM@,$INSTALL_STRIP_PROGRAM,;t t
-s,@AWK@,$AWK,;t t
-s,@SET_MAKE@,$SET_MAKE,;t t
-s,@CC@,$CC,;t t
-s,@CFLAGS@,$CFLAGS,;t t
-s,@LDFLAGS@,$LDFLAGS,;t t
-s,@CPPFLAGS@,$CPPFLAGS,;t t
-s,@ac_ct_CC@,$ac_ct_CC,;t t
-s,@EXEEXT@,$EXEEXT,;t t
-s,@OBJEXT@,$OBJEXT,;t t
-s,@DEPDIR@,$DEPDIR,;t t
-s,@am__include@,$am__include,;t t
-s,@am__quote@,$am__quote,;t t
-s,@AMDEP_TRUE@,$AMDEP_TRUE,;t t
-s,@AMDEP_FALSE@,$AMDEP_FALSE,;t t
-s,@AMDEPBACKSLASH@,$AMDEPBACKSLASH,;t t
-s,@CCDEPMODE@,$CCDEPMODE,;t t
-s,@am__fastdepCC_TRUE@,$am__fastdepCC_TRUE,;t t
-s,@am__fastdepCC_FALSE@,$am__fastdepCC_FALSE,;t t
-s,@CPP@,$CPP,;t t
-s,@EGREP@,$EGREP,;t t
-s,@LIBOBJS@,$LIBOBJS,;t t
-s,@LTLIBOBJS@,$LTLIBOBJS,;t t
-CEOF
-
-_ACEOF
-
-  cat >>$CONFIG_STATUS <<\_ACEOF
-  # Split the substitutions into bite-sized pieces for seds with
-  # small command number limits, like on Digital OSF/1 and HP-UX.
-  ac_max_sed_lines=48
-  ac_sed_frag=1 # Number of current file.
-  ac_beg=1 # First line for current file.
-  ac_end=$ac_max_sed_lines # Line after last line for current file.
-  ac_more_lines=:
-  ac_sed_cmds=
-  while $ac_more_lines; do
-    if test $ac_beg -gt 1; then
-      sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
-    else
-      sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
-    fi
-    if test ! -s $tmp/subs.frag; then
-      ac_more_lines=false
-    else
-      # The purpose of the label and of the branching condition is to
-      # speed up the sed processing (if there are no `@' at all, there
-      # is no need to browse any of the substitutions).
-      # These are the two extra sed commands mentioned above.
-      (echo ':t
-  /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed
-      if test -z "$ac_sed_cmds"; then
-       ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
-      else
-       ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
-      fi
-      ac_sed_frag=`expr $ac_sed_frag + 1`
-      ac_beg=$ac_end
-      ac_end=`expr $ac_end + $ac_max_sed_lines`
-    fi
-  done
-  if test -z "$ac_sed_cmds"; then
-    ac_sed_cmds=cat
-  fi
-fi # test -n "$CONFIG_FILES"
-
-_ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF
-for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
-  # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
-  case $ac_file in
-  - | *:- | *:-:* ) # input from stdin
-        cat >$tmp/stdin
-        ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
-        ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
-  *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
-        ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
-  * )   ac_file_in=$ac_file.in ;;
-  esac
-
-  # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
-  ac_dir=`(dirname "$ac_file") 2>/dev/null ||
-$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
-         X"$ac_file" : 'X\(//\)[^/]' \| \
-         X"$ac_file" : 'X\(//\)$' \| \
-         X"$ac_file" : 'X\(/\)' \| \
-         .     : '\(.\)' 2>/dev/null ||
-echo X"$ac_file" |
-    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
-         /^X\(\/\/\)[^/].*/{ s//\1/; q; }
-         /^X\(\/\/\)$/{ s//\1/; q; }
-         /^X\(\/\).*/{ s//\1/; q; }
-         s/.*/./; q'`
-  { if $as_mkdir_p; then
-    mkdir -p "$ac_dir"
-  else
-    as_dir="$ac_dir"
-    as_dirs=
-    while test ! -d "$as_dir"; do
-      as_dirs="$as_dir $as_dirs"
-      as_dir=`(dirname "$as_dir") 2>/dev/null ||
-$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
-         X"$as_dir" : 'X\(//\)[^/]' \| \
-         X"$as_dir" : 'X\(//\)$' \| \
-         X"$as_dir" : 'X\(/\)' \| \
-         .     : '\(.\)' 2>/dev/null ||
-echo X"$as_dir" |
-    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
-         /^X\(\/\/\)[^/].*/{ s//\1/; q; }
-         /^X\(\/\/\)$/{ s//\1/; q; }
-         /^X\(\/\).*/{ s//\1/; q; }
-         s/.*/./; q'`
-    done
-    test ! -n "$as_dirs" || mkdir $as_dirs
-  fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5
-echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;}
-   { (exit 1); exit 1; }; }; }
-
-  ac_builddir=.
-
-if test "$ac_dir" != .; then
-  ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
-  # A "../" for each directory in $ac_dir_suffix.
-  ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
-else
-  ac_dir_suffix= ac_top_builddir=
-fi
-
-case $srcdir in
-  .)  # No --srcdir option.  We are building in place.
-    ac_srcdir=.
-    if test -z "$ac_top_builddir"; then
-       ac_top_srcdir=.
-    else
-       ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
-    fi ;;
-  [\\/]* | ?:[\\/]* )  # Absolute path.
-    ac_srcdir=$srcdir$ac_dir_suffix;
-    ac_top_srcdir=$srcdir ;;
-  *) # Relative path.
-    ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
-    ac_top_srcdir=$ac_top_builddir$srcdir ;;
-esac
-# Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be
-# absolute.
-ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd`
-ac_abs_top_builddir=`cd "$ac_dir" && cd ${ac_top_builddir}. && pwd`
-ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd`
-ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd`
-
-
-  case $INSTALL in
-  [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
-  *) ac_INSTALL=$ac_top_builddir$INSTALL ;;
-  esac
-
-  if test x"$ac_file" != x-; then
-    { echo "$as_me:$LINENO: creating $ac_file" >&5
-echo "$as_me: creating $ac_file" >&6;}
-    rm -f "$ac_file"
-  fi
-  # Let's still pretend it is `configure' which instantiates (i.e., don't
-  # use $as_me), people would be surprised to read:
-  #    /* config.h.  Generated by config.status.  */
-  if test x"$ac_file" = x-; then
-    configure_input=
-  else
-    configure_input="$ac_file.  "
-  fi
-  configure_input=$configure_input"Generated from `echo $ac_file_in |
-                                     sed 's,.*/,,'` by configure."
-
-  # First look for the input files in the build tree, otherwise in the
-  # src tree.
-  ac_file_inputs=`IFS=:
-    for f in $ac_file_in; do
-      case $f in
-      -) echo $tmp/stdin ;;
-      [\\/$]*)
-         # Absolute (can't be DOS-style, as IFS=:)
-         test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
-echo "$as_me: error: cannot find input file: $f" >&2;}
-   { (exit 1); exit 1; }; }
-         echo $f;;
-      *) # Relative
-         if test -f "$f"; then
-           # Build tree
-           echo $f
-         elif test -f "$srcdir/$f"; then
-           # Source tree
-           echo $srcdir/$f
-         else
-           # /dev/null tree
-           { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
-echo "$as_me: error: cannot find input file: $f" >&2;}
-   { (exit 1); exit 1; }; }
-         fi;;
-      esac
-    done` || { (exit 1); exit 1; }
-_ACEOF
-cat >>$CONFIG_STATUS <<_ACEOF
-  sed "$ac_vpsub
-$extrasub
-_ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF
-:t
-/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
-s,@configure_input@,$configure_input,;t t
-s,@srcdir@,$ac_srcdir,;t t
-s,@abs_srcdir@,$ac_abs_srcdir,;t t
-s,@top_srcdir@,$ac_top_srcdir,;t t
-s,@abs_top_srcdir@,$ac_abs_top_srcdir,;t t
-s,@builddir@,$ac_builddir,;t t
-s,@abs_builddir@,$ac_abs_builddir,;t t
-s,@top_builddir@,$ac_top_builddir,;t t
-s,@abs_top_builddir@,$ac_abs_top_builddir,;t t
-s,@INSTALL@,$ac_INSTALL,;t t
-" $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out
-  rm -f $tmp/stdin
-  if test x"$ac_file" != x-; then
-    mv $tmp/out $ac_file
-  else
-    cat $tmp/out
-    rm -f $tmp/out
-  fi
-
-done
-_ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF
-
-#
-# CONFIG_HEADER section.
-#
-
-# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
-# NAME is the cpp macro being defined and VALUE is the value it is being given.
-#
-# ac_d sets the value in "#define NAME VALUE" lines.
-ac_dA='s,^\([  ]*\)#\([        ]*define[       ][      ]*\)'
-ac_dB='[       ].*$,\1#\2'
-ac_dC=' '
-ac_dD=',;t'
-# ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
-ac_uA='s,^\([  ]*\)#\([        ]*\)undef\([    ][      ]*\)'
-ac_uB='$,\1#\2define\3'
-ac_uC=' '
-ac_uD=',;t'
-
-for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue
-  # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
-  case $ac_file in
-  - | *:- | *:-:* ) # input from stdin
-        cat >$tmp/stdin
-        ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
-        ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
-  *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
-        ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
-  * )   ac_file_in=$ac_file.in ;;
-  esac
-
-  test x"$ac_file" != x- && { echo "$as_me:$LINENO: creating $ac_file" >&5
-echo "$as_me: creating $ac_file" >&6;}
-
-  # First look for the input files in the build tree, otherwise in the
-  # src tree.
-  ac_file_inputs=`IFS=:
-    for f in $ac_file_in; do
-      case $f in
-      -) echo $tmp/stdin ;;
-      [\\/$]*)
-         # Absolute (can't be DOS-style, as IFS=:)
-         test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
-echo "$as_me: error: cannot find input file: $f" >&2;}
-   { (exit 1); exit 1; }; }
-         echo $f;;
-      *) # Relative
-         if test -f "$f"; then
-           # Build tree
-           echo $f
-         elif test -f "$srcdir/$f"; then
-           # Source tree
-           echo $srcdir/$f
-         else
-           # /dev/null tree
-           { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
-echo "$as_me: error: cannot find input file: $f" >&2;}
-   { (exit 1); exit 1; }; }
-         fi;;
-      esac
-    done` || { (exit 1); exit 1; }
-  # Remove the trailing spaces.
-  sed 's/[     ]*$//' $ac_file_inputs >$tmp/in
-
-_ACEOF
-
-# Transform confdefs.h into two sed scripts, `conftest.defines' and
-# `conftest.undefs', that substitutes the proper values into
-# config.h.in to produce config.h.  The first handles `#define'
-# templates, and the second `#undef' templates.
-# And first: Protect against being on the right side of a sed subst in
-# config.status.  Protect against being in an unquoted here document
-# in config.status.
-rm -f conftest.defines conftest.undefs
-# Using a here document instead of a string reduces the quoting nightmare.
-# Putting comments in sed scripts is not portable.
-#
-# `end' is used to avoid that the second main sed command (meant for
-# 0-ary CPP macros) applies to n-ary macro definitions.
-# See the Autoconf documentation for `clear'.
-cat >confdef2sed.sed <<\_ACEOF
-s/[\\&,]/\\&/g
-s,[\\$`],\\&,g
-t clear
-: clear
-s,^[   ]*#[    ]*define[       ][      ]*\([^  (][^    (]*\)\(([^)]*)\)[       ]*\(.*\)$,${ac_dA}\1${ac_dB}\1\2${ac_dC}\3${ac_dD},gp
-t end
-s,^[   ]*#[    ]*define[       ][      ]*\([^  ][^     ]*\)[   ]*\(.*\)$,${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD},gp
-: end
-_ACEOF
-# If some macros were called several times there might be several times
-# the same #defines, which is useless.  Nevertheless, we may not want to
-# sort them, since we want the *last* AC-DEFINE to be honored.
-uniq confdefs.h | sed -n -f confdef2sed.sed >conftest.defines
-sed 's/ac_d/ac_u/g' conftest.defines >conftest.undefs
-rm -f confdef2sed.sed
-
-# This sed command replaces #undef with comments.  This is necessary, for
-# example, in the case of _POSIX_SOURCE, which is predefined and required
-# on some systems where configure will not decide to define it.
-cat >>conftest.undefs <<\_ACEOF
-s,^[   ]*#[    ]*undef[        ][      ]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */,
-_ACEOF
-
-# Break up conftest.defines because some shells have a limit on the size
-# of here documents, and old seds have small limits too (100 cmds).
-echo '  # Handle all the #define templates only if necessary.' >>$CONFIG_STATUS
-echo '  if grep "^[    ]*#[    ]*define" $tmp/in >/dev/null; then' >>$CONFIG_STATUS
-echo '  # If there are no defines, we may have an empty if/fi' >>$CONFIG_STATUS
-echo '  :' >>$CONFIG_STATUS
-rm -f conftest.tail
-while grep . conftest.defines >/dev/null
-do
-  # Write a limited-size here document to $tmp/defines.sed.
-  echo '  cat >$tmp/defines.sed <<CEOF' >>$CONFIG_STATUS
-  # Speed up: don't consider the non `#define' lines.
-  echo '/^[    ]*#[    ]*define/!b' >>$CONFIG_STATUS
-  # Work around the forget-to-reset-the-flag bug.
-  echo 't clr' >>$CONFIG_STATUS
-  echo ': clr' >>$CONFIG_STATUS
-  sed ${ac_max_here_lines}q conftest.defines >>$CONFIG_STATUS
-  echo 'CEOF
-  sed -f $tmp/defines.sed $tmp/in >$tmp/out
-  rm -f $tmp/in
-  mv $tmp/out $tmp/in
-' >>$CONFIG_STATUS
-  sed 1,${ac_max_here_lines}d conftest.defines >conftest.tail
-  rm -f conftest.defines
-  mv conftest.tail conftest.defines
-done
-rm -f conftest.defines
-echo '  fi # grep' >>$CONFIG_STATUS
-echo >>$CONFIG_STATUS
-
-# Break up conftest.undefs because some shells have a limit on the size
-# of here documents, and old seds have small limits too (100 cmds).
-echo '  # Handle all the #undef templates' >>$CONFIG_STATUS
-rm -f conftest.tail
-while grep . conftest.undefs >/dev/null
-do
-  # Write a limited-size here document to $tmp/undefs.sed.
-  echo '  cat >$tmp/undefs.sed <<CEOF' >>$CONFIG_STATUS
-  # Speed up: don't consider the non `#undef'
-  echo '/^[    ]*#[    ]*undef/!b' >>$CONFIG_STATUS
-  # Work around the forget-to-reset-the-flag bug.
-  echo 't clr' >>$CONFIG_STATUS
-  echo ': clr' >>$CONFIG_STATUS
-  sed ${ac_max_here_lines}q conftest.undefs >>$CONFIG_STATUS
-  echo 'CEOF
-  sed -f $tmp/undefs.sed $tmp/in >$tmp/out
-  rm -f $tmp/in
-  mv $tmp/out $tmp/in
-' >>$CONFIG_STATUS
-  sed 1,${ac_max_here_lines}d conftest.undefs >conftest.tail
-  rm -f conftest.undefs
-  mv conftest.tail conftest.undefs
-done
-rm -f conftest.undefs
-
-cat >>$CONFIG_STATUS <<\_ACEOF
-  # Let's still pretend it is `configure' which instantiates (i.e., don't
-  # use $as_me), people would be surprised to read:
-  #    /* config.h.  Generated by config.status.  */
-  if test x"$ac_file" = x-; then
-    echo "/* Generated by configure.  */" >$tmp/config.h
-  else
-    echo "/* $ac_file.  Generated by configure.  */" >$tmp/config.h
-  fi
-  cat $tmp/in >>$tmp/config.h
-  rm -f $tmp/in
-  if test x"$ac_file" != x-; then
-    if cmp -s $ac_file $tmp/config.h 2>/dev/null; then
-      { echo "$as_me:$LINENO: $ac_file is unchanged" >&5
-echo "$as_me: $ac_file is unchanged" >&6;}
-    else
-      ac_dir=`(dirname "$ac_file") 2>/dev/null ||
-$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
-         X"$ac_file" : 'X\(//\)[^/]' \| \
-         X"$ac_file" : 'X\(//\)$' \| \
-         X"$ac_file" : 'X\(/\)' \| \
-         .     : '\(.\)' 2>/dev/null ||
-echo X"$ac_file" |
-    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
-         /^X\(\/\/\)[^/].*/{ s//\1/; q; }
-         /^X\(\/\/\)$/{ s//\1/; q; }
-         /^X\(\/\).*/{ s//\1/; q; }
-         s/.*/./; q'`
-      { if $as_mkdir_p; then
-    mkdir -p "$ac_dir"
-  else
-    as_dir="$ac_dir"
-    as_dirs=
-    while test ! -d "$as_dir"; do
-      as_dirs="$as_dir $as_dirs"
-      as_dir=`(dirname "$as_dir") 2>/dev/null ||
-$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
-         X"$as_dir" : 'X\(//\)[^/]' \| \
-         X"$as_dir" : 'X\(//\)$' \| \
-         X"$as_dir" : 'X\(/\)' \| \
-         .     : '\(.\)' 2>/dev/null ||
-echo X"$as_dir" |
-    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
-         /^X\(\/\/\)[^/].*/{ s//\1/; q; }
-         /^X\(\/\/\)$/{ s//\1/; q; }
-         /^X\(\/\).*/{ s//\1/; q; }
-         s/.*/./; q'`
-    done
-    test ! -n "$as_dirs" || mkdir $as_dirs
-  fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5
-echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;}
-   { (exit 1); exit 1; }; }; }
-
-      rm -f $ac_file
-      mv $tmp/config.h $ac_file
-    fi
-  else
-    cat $tmp/config.h
-    rm -f $tmp/config.h
-  fi
-_am_stamp_count=`expr ${_am_stamp_count-0} + 1`
-echo "timestamp for $ac_file" >`(dirname $ac_file) 2>/dev/null ||
-$as_expr X$ac_file : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
-         X$ac_file : 'X\(//\)[^/]' \| \
-         X$ac_file : 'X\(//\)$' \| \
-         X$ac_file : 'X\(/\)' \| \
-         .     : '\(.\)' 2>/dev/null ||
-echo X$ac_file |
-    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
-         /^X\(\/\/\)[^/].*/{ s//\1/; q; }
-         /^X\(\/\/\)$/{ s//\1/; q; }
-         /^X\(\/\).*/{ s//\1/; q; }
-         s/.*/./; q'`/stamp-h$_am_stamp_count
-done
-_ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF
-
-#
-# CONFIG_COMMANDS section.
-#
-for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue
-  ac_dest=`echo "$ac_file" | sed 's,:.*,,'`
-  ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'`
-  ac_dir=`(dirname "$ac_dest") 2>/dev/null ||
-$as_expr X"$ac_dest" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
-         X"$ac_dest" : 'X\(//\)[^/]' \| \
-         X"$ac_dest" : 'X\(//\)$' \| \
-         X"$ac_dest" : 'X\(/\)' \| \
-         .     : '\(.\)' 2>/dev/null ||
-echo X"$ac_dest" |
-    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
-         /^X\(\/\/\)[^/].*/{ s//\1/; q; }
-         /^X\(\/\/\)$/{ s//\1/; q; }
-         /^X\(\/\).*/{ s//\1/; q; }
-         s/.*/./; q'`
-  ac_builddir=.
-
-if test "$ac_dir" != .; then
-  ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
-  # A "../" for each directory in $ac_dir_suffix.
-  ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
-else
-  ac_dir_suffix= ac_top_builddir=
-fi
-
-case $srcdir in
-  .)  # No --srcdir option.  We are building in place.
-    ac_srcdir=.
-    if test -z "$ac_top_builddir"; then
-       ac_top_srcdir=.
-    else
-       ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
-    fi ;;
-  [\\/]* | ?:[\\/]* )  # Absolute path.
-    ac_srcdir=$srcdir$ac_dir_suffix;
-    ac_top_srcdir=$srcdir ;;
-  *) # Relative path.
-    ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
-    ac_top_srcdir=$ac_top_builddir$srcdir ;;
-esac
-# Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be
-# absolute.
-ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd`
-ac_abs_top_builddir=`cd "$ac_dir" && cd ${ac_top_builddir}. && pwd`
-ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd`
-ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd`
-
-
-  { echo "$as_me:$LINENO: executing $ac_dest commands" >&5
-echo "$as_me: executing $ac_dest commands" >&6;}
-  case $ac_dest in
-    depfiles ) test x"$AMDEP_TRUE" != x"" || for mf in $CONFIG_FILES; do
-  # Strip MF so we end up with the name of the file.
-  mf=`echo "$mf" | sed -e 's/:.*$//'`
-  # Check whether this is an Automake generated Makefile or not.
-  # We used to match only the files named `Makefile.in', but
-  # some people rename them; so instead we look at the file content.
-  # Grep'ing the first line is not enough: some people post-process
-  # each Makefile.in and add a new line on top of each file to say so.
-  # So let's grep whole file.
-  if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then
-    dirpart=`(dirname "$mf") 2>/dev/null ||
-$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
-         X"$mf" : 'X\(//\)[^/]' \| \
-         X"$mf" : 'X\(//\)$' \| \
-         X"$mf" : 'X\(/\)' \| \
-         .     : '\(.\)' 2>/dev/null ||
-echo X"$mf" |
-    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
-         /^X\(\/\/\)[^/].*/{ s//\1/; q; }
-         /^X\(\/\/\)$/{ s//\1/; q; }
-         /^X\(\/\).*/{ s//\1/; q; }
-         s/.*/./; q'`
-  else
-    continue
-  fi
-  grep '^DEP_FILES *= *[^ #]' < "$mf" > /dev/null || continue
-  # Extract the definition of DEP_FILES from the Makefile without
-  # running `make'.
-  DEPDIR=`sed -n -e '/^DEPDIR = / s///p' < "$mf"`
-  test -z "$DEPDIR" && continue
-  # When using ansi2knr, U may be empty or an underscore; expand it
-  U=`sed -n -e '/^U = / s///p' < "$mf"`
-  test -d "$dirpart/$DEPDIR" || mkdir "$dirpart/$DEPDIR"
-  # We invoke sed twice because it is the simplest approach to
-  # changing $(DEPDIR) to its actual value in the expansion.
-  for file in `sed -n -e '
-    /^DEP_FILES = .*\\\\$/ {
-      s/^DEP_FILES = //
-      :loop
-       s/\\\\$//
-       p
-       n
-       /\\\\$/ b loop
-      p
-    }
-    /^DEP_FILES = / s/^DEP_FILES = //p' < "$mf" | \
-       sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
-    # Make sure the directory exists.
-    test -f "$dirpart/$file" && continue
-    fdir=`(dirname "$file") 2>/dev/null ||
-$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
-         X"$file" : 'X\(//\)[^/]' \| \
-         X"$file" : 'X\(//\)$' \| \
-         X"$file" : 'X\(/\)' \| \
-         .     : '\(.\)' 2>/dev/null ||
-echo X"$file" |
-    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
-         /^X\(\/\/\)[^/].*/{ s//\1/; q; }
-         /^X\(\/\/\)$/{ s//\1/; q; }
-         /^X\(\/\).*/{ s//\1/; q; }
-         s/.*/./; q'`
-    { if $as_mkdir_p; then
-    mkdir -p $dirpart/$fdir
-  else
-    as_dir=$dirpart/$fdir
-    as_dirs=
-    while test ! -d "$as_dir"; do
-      as_dirs="$as_dir $as_dirs"
-      as_dir=`(dirname "$as_dir") 2>/dev/null ||
-$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
-         X"$as_dir" : 'X\(//\)[^/]' \| \
-         X"$as_dir" : 'X\(//\)$' \| \
-         X"$as_dir" : 'X\(/\)' \| \
-         .     : '\(.\)' 2>/dev/null ||
-echo X"$as_dir" |
-    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
-         /^X\(\/\/\)[^/].*/{ s//\1/; q; }
-         /^X\(\/\/\)$/{ s//\1/; q; }
-         /^X\(\/\).*/{ s//\1/; q; }
-         s/.*/./; q'`
-    done
-    test ! -n "$as_dirs" || mkdir $as_dirs
-  fi || { { echo "$as_me:$LINENO: error: cannot create directory $dirpart/$fdir" >&5
-echo "$as_me: error: cannot create directory $dirpart/$fdir" >&2;}
-   { (exit 1); exit 1; }; }; }
-
-    # echo "creating $dirpart/$file"
-    echo '# dummy' > "$dirpart/$file"
-  done
-done
- ;;
-  esac
-done
-_ACEOF
-
-cat >>$CONFIG_STATUS <<\_ACEOF
-
-{ (exit 0); exit 0; }
-_ACEOF
-chmod +x $CONFIG_STATUS
-ac_clean_files=$ac_clean_files_save
-
-
-# configure is writing to config.log, and then calls config.status.
-# config.status does its own redirection, appending to config.log.
-# Unfortunately, on DOS this fails, as config.log is still kept open
-# by configure, so config.status won't be able to write to it; its
-# output is simply discarded.  So we exec the FD to /dev/null,
-# effectively closing config.log, so it can be properly (re)opened and
-# appended to by config.status.  When coming back to configure, we
-# need to make the FD available again.
-if test "$no_create" != yes; then
-  ac_cs_success=:
-  exec 5>/dev/null
-  $SHELL $CONFIG_STATUS || ac_cs_success=false
-  exec 5>>config.log
-  # Use ||, not &&, to avoid exiting from the if with $? = 1, which
-  # would make configure fail if this is the last instruction.
-  $ac_cs_success || { (exit 1); exit 1; }
-fi
-
-
diff --git a/util/robodoc/configure.in b/util/robodoc/configure.in
deleted file mode 100644 (file)
index 6c0f5af..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-dnl Process this file with autoconf to produce a configure script.
-
-AC_INIT(Source/robodoc.h)
-
-AM_CONFIG_HEADER(Source/config.h)
-
-AM_INIT_AUTOMAKE(robodoc, 3.2.3)
-
-AC_PROG_MAKE_SET
-
-dnl Checks for programs.
-AC_PROG_CC
-
-dnl Checks for libraries.
-
-dnl Checks for header files.
-AC_HEADER_STDC
-
-dnl Checks for typedefs, structures, and compiler characteristics.
-AC_C_CONST
-AC_TYPE_SIZE_T
-
-dnl Checks for library functions.
-AC_FUNC_STRFTIME
-AC_FUNC_VPRINTF
-AC_CHECK_FUNCS(strstr)
-
-AC_OUTPUT(makefile Docs/makefile Source/makefile)
-
diff --git a/util/robodoc/install-sh b/util/robodoc/install-sh
deleted file mode 100755 (executable)
index e9de238..0000000
+++ /dev/null
@@ -1,251 +0,0 @@
-#!/bin/sh
-#
-# install - install a program, script, or datafile
-# This comes from X11R5 (mit/util/scripts/install.sh).
-#
-# Copyright 1991 by the Massachusetts Institute of Technology
-#
-# Permission to use, copy, modify, distribute, and sell this software and its
-# documentation for any purpose is hereby granted without fee, provided that
-# the above copyright notice appear in all copies and that both that
-# copyright notice and this permission notice appear in supporting
-# documentation, and that the name of M.I.T. not be used in advertising or
-# publicity pertaining to distribution of the software without specific,
-# written prior permission.  M.I.T. makes no representations about the
-# suitability of this software for any purpose.  It is provided "as is"
-# without express or implied warranty.
-#
-# Calling this script install-sh is preferred over install.sh, to prevent
-# `make' implicit rules from creating a file called install from it
-# when there is no Makefile.
-#
-# This script is compatible with the BSD install script, but was written
-# from scratch.  It can only install one file at a time, a restriction
-# shared with many OS's install programs.
-
-
-# set DOITPROG to echo to test this script
-
-# Don't use :- since 4.3BSD and earlier shells don't like it.
-doit="${DOITPROG-}"
-
-
-# put in absolute paths if you don't have them in your path; or use env. vars.
-
-mvprog="${MVPROG-mv}"
-cpprog="${CPPROG-cp}"
-chmodprog="${CHMODPROG-chmod}"
-chownprog="${CHOWNPROG-chown}"
-chgrpprog="${CHGRPPROG-chgrp}"
-stripprog="${STRIPPROG-strip}"
-rmprog="${RMPROG-rm}"
-mkdirprog="${MKDIRPROG-mkdir}"
-
-transformbasename=""
-transform_arg=""
-instcmd="$mvprog"
-chmodcmd="$chmodprog 0755"
-chowncmd=""
-chgrpcmd=""
-stripcmd=""
-rmcmd="$rmprog -f"
-mvcmd="$mvprog"
-src=""
-dst=""
-dir_arg=""
-
-while [ x"$1" != x ]; do
-    case $1 in
-       -c) instcmd="$cpprog"
-           shift
-           continue;;
-
-       -d) dir_arg=true
-           shift
-           continue;;
-
-       -m) chmodcmd="$chmodprog $2"
-           shift
-           shift
-           continue;;
-
-       -o) chowncmd="$chownprog $2"
-           shift
-           shift
-           continue;;
-
-       -g) chgrpcmd="$chgrpprog $2"
-           shift
-           shift
-           continue;;
-
-       -s) stripcmd="$stripprog"
-           shift
-           continue;;
-
-       -t=*) transformarg=`echo $1 | sed 's/-t=//'`
-           shift
-           continue;;
-
-       -b=*) transformbasename=`echo $1 | sed 's/-b=//'`
-           shift
-           continue;;
-
-       *)  if [ x"$src" = x ]
-           then
-               src=$1
-           else
-               # this colon is to work around a 386BSD /bin/sh bug
-               :
-               dst=$1
-           fi
-           shift
-           continue;;
-    esac
-done
-
-if [ x"$src" = x ]
-then
-       echo "install:  no input file specified"
-       exit 1
-else
-       true
-fi
-
-if [ x"$dir_arg" != x ]; then
-       dst=$src
-       src=""
-       
-       if [ -d $dst ]; then
-               instcmd=:
-               chmodcmd=""
-       else
-               instcmd=mkdir
-       fi
-else
-
-# Waiting for this to be detected by the "$instcmd $src $dsttmp" command
-# might cause directories to be created, which would be especially bad 
-# if $src (and thus $dsttmp) contains '*'.
-
-       if [ -f $src -o -d $src ]
-       then
-               true
-       else
-               echo "install:  $src does not exist"
-               exit 1
-       fi
-       
-       if [ x"$dst" = x ]
-       then
-               echo "install:  no destination specified"
-               exit 1
-       else
-               true
-       fi
-
-# If destination is a directory, append the input filename; if your system
-# does not like double slashes in filenames, you may need to add some logic
-
-       if [ -d $dst ]
-       then
-               dst="$dst"/`basename $src`
-       else
-               true
-       fi
-fi
-
-## this sed command emulates the dirname command
-dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'`
-
-# Make sure that the destination directory exists.
-#  this part is taken from Noah Friedman's mkinstalldirs script
-
-# Skip lots of stat calls in the usual case.
-if [ ! -d "$dstdir" ]; then
-defaultIFS='   
-'
-IFS="${IFS-${defaultIFS}}"
-
-oIFS="${IFS}"
-# Some sh's can't handle IFS=/ for some reason.
-IFS='%'
-set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'`
-IFS="${oIFS}"
-
-pathcomp=''
-
-while [ $# -ne 0 ] ; do
-       pathcomp="${pathcomp}${1}"
-       shift
-
-       if [ ! -d "${pathcomp}" ] ;
-        then
-               $mkdirprog "${pathcomp}"
-       else
-               true
-       fi
-
-       pathcomp="${pathcomp}/"
-done
-fi
-
-if [ x"$dir_arg" != x ]
-then
-       $doit $instcmd $dst &&
-
-       if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi &&
-       if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi &&
-       if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi &&
-       if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi
-else
-
-# If we're going to rename the final executable, determine the name now.
-
-       if [ x"$transformarg" = x ] 
-       then
-               dstfile=`basename $dst`
-       else
-               dstfile=`basename $dst $transformbasename | 
-                       sed $transformarg`$transformbasename
-       fi
-
-# don't allow the sed command to completely eliminate the filename
-
-       if [ x"$dstfile" = x ] 
-       then
-               dstfile=`basename $dst`
-       else
-               true
-       fi
-
-# Make a temp file name in the proper directory.
-
-       dsttmp=$dstdir/#inst.$$#
-
-# Move or copy the file name to the temp name
-
-       $doit $instcmd $src $dsttmp &&
-
-       trap "rm -f ${dsttmp}" 0 &&
-
-# and set any options; do chmod last to preserve setuid bits
-
-# If any of these fail, we abort the whole thing.  If we want to
-# ignore errors from any of these, just make sure not to ignore
-# errors from the above "$doit $instcmd $src $dsttmp" command.
-
-       if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi &&
-       if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi &&
-       if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi &&
-       if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi &&
-
-# Now rename the file to the real destination.
-
-       $doit $rmcmd -f $dstdir/$dstfile &&
-       $doit $mvcmd $dsttmp $dstdir/$dstfile 
-
-fi &&
-
-
-exit 0
diff --git a/util/robodoc/makefile.am b/util/robodoc/makefile.am
deleted file mode 100644 (file)
index 4fd7cf2..0000000
+++ /dev/null
@@ -1,87 +0,0 @@
-## Process this file with automake to produce Makefile.in
-
-#
-# Information for automake
-#
-
-AUTOMAKE_OPTIONS = dist-zip
-
-SUBDIRS = Docs Source
-
-exampledir = $(prefix)/examples/$(PACKAGE)-$(VERSION)
-
-docdir = $(prefix)/doc/$(PACKAGE)-$(VERSION)
-doc_DATA = AUTHORS COPYING ChangeLog INSTALL NEWS README
-
-EXTRA_DIST = \
-        Docs/robodoc.1 \
-        Docs/robodoc.m4 \
-        Docs/robodoc.html \
-       Docs/general.m4 \
-       Docs/example.c \
-       Docs/tocgen.m4 \
-       Docs/example_makefile \
-        Docs/main.css \
-        Examples/C/prog1.c \
-        Examples/C/prog2.c \
-        Examples/C/prog1.c.html \
-        Examples/C/prog2.c.html \
-       Examples/C/makefile \
-       Examples/CPP/muppets.h \
-       Examples/CPP/muppets.cpp \
-       Examples/CPP/masterindex.html \
-       Examples/CPP/muppets.h.html \
-       Examples/CPP/muppets.cpp.html \
-       Examples/CPP/makefile \
-       Headers/assembler.sample \
-       Headers/basic.sample \
-       Headers/c.sample \
-       Headers/cpp.sample \
-       Headers/fortan.sample \
-       Headers/html.sample \
-       Headers/tcl.sample \
-       Source/makefile.plain
-
-#
-# End of automake stuff
-#
-
-
-myclean:
-       rm -f *~
-       rm -f makefile.in
-       rm -f *.tar.gz *.zip
-       rm -f *.log aclocal.m4 config.cache
-       rm -f install-sh
-       rm -f mkinstalldirs
-       rm -f missing makefile
-       rm -f configure config.status
-       $(MAKE) -f makefile.am -C Docs     myclean
-       $(MAKE) -f makefile.am -C Source   myclean
-       $(MAKE)                -C Examples myclean
-
-Docs/robodoc.html :
-       $(MAKE) -C Docs robodoc.html
-
-Examples/C/prog1.c.html :
-       $(MAKE) -C Examples/C prog1.c.html 
-
-Examples/C/prog2.c.html :
-       $(MAKE) -C Examples/C prog2.c.html 
-
-Examples/CPP/masterindex.html :
-       $(MAKE) -C Examples/CPP masterindex.html 
-
-Examples/CPP/muppets.h.html :
-       $(MAKE) -C Examples/CPP muppets.h.html 
-
-Examples/CPP/muppets.cpp.html :
-       $(MAKE) -C Examples/CPP muppets.cpp.html 
-
-#
-#
-#
-
-docall:
-       $(MAKE) -C Source html
-
diff --git a/util/robodoc/makefile.in b/util/robodoc/makefile.in
deleted file mode 100644 (file)
index e41bbc1..0000000
+++ /dev/null
@@ -1,591 +0,0 @@
-# makefile.in generated by automake 1.7 from makefile.am.
-# @configure_input@
-
-# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002
-# Free Software Foundation, Inc.
-# This Makefile.in is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
-@SET_MAKE@
-
-#
-# Information for automake
-#
-
-srcdir = @srcdir@
-top_srcdir = @top_srcdir@
-VPATH = @srcdir@
-pkgdatadir = $(datadir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-top_builddir = .
-
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-INSTALL = @INSTALL@
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-ACLOCAL = @ACLOCAL@
-AMDEP_FALSE = @AMDEP_FALSE@
-AMDEP_TRUE = @AMDEP_TRUE@
-AMTAR = @AMTAR@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
-CC = @CC@
-CCDEPMODE = @CCDEPMODE@
-CFLAGS = @CFLAGS@
-CPP = @CPP@
-CPPFLAGS = @CPPFLAGS@
-CYGPATH_W = @CYGPATH_W@
-DEFS = @DEFS@
-DEPDIR = @DEPDIR@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-EGREP = @EGREP@
-EXEEXT = @EXEEXT@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-LDFLAGS = @LDFLAGS@
-LIBS = @LIBS@
-LTLIBOBJS = @LTLIBOBJS@
-MAKEINFO = @MAKEINFO@
-OBJEXT = @OBJEXT@
-PACKAGE = @PACKAGE@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PATH_SEPARATOR = @PATH_SEPARATOR@
-SET_MAKE = @SET_MAKE@
-SHELL = @SHELL@
-STRIP = @STRIP@
-VERSION = @VERSION@
-ac_ct_CC = @ac_ct_CC@
-ac_ct_STRIP = @ac_ct_STRIP@
-am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
-am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
-am__include = @am__include@
-am__quote = @am__quote@
-bindir = @bindir@
-build_alias = @build_alias@
-datadir = @datadir@
-exec_prefix = @exec_prefix@
-host_alias = @host_alias@
-includedir = @includedir@
-infodir = @infodir@
-install_sh = @install_sh@
-libdir = @libdir@
-libexecdir = @libexecdir@
-localstatedir = @localstatedir@
-mandir = @mandir@
-oldincludedir = @oldincludedir@
-prefix = @prefix@
-program_transform_name = @program_transform_name@
-sbindir = @sbindir@
-sharedstatedir = @sharedstatedir@
-sysconfdir = @sysconfdir@
-target_alias = @target_alias@
-
-AUTOMAKE_OPTIONS = dist-zip
-
-SUBDIRS = Docs Source
-
-exampledir = $(prefix)/examples/$(PACKAGE)-$(VERSION)
-
-docdir = $(prefix)/doc/$(PACKAGE)-$(VERSION)
-doc_DATA = AUTHORS COPYING ChangeLog INSTALL NEWS README
-
-EXTRA_DIST = \
-        Docs/robodoc.1 \
-        Docs/robodoc.m4 \
-        Docs/robodoc.html \
-       Docs/general.m4 \
-       Docs/example.c \
-       Docs/tocgen.m4 \
-       Docs/example_makefile \
-        Docs/main.css \
-        Examples/C/prog1.c \
-        Examples/C/prog2.c \
-        Examples/C/prog1.c.html \
-        Examples/C/prog2.c.html \
-       Examples/C/makefile \
-       Examples/CPP/muppets.h \
-       Examples/CPP/muppets.cpp \
-       Examples/CPP/masterindex.html \
-       Examples/CPP/muppets.h.html \
-       Examples/CPP/muppets.cpp.html \
-       Examples/CPP/makefile \
-       Headers/assembler.sample \
-       Headers/basic.sample \
-       Headers/c.sample \
-       Headers/cpp.sample \
-       Headers/fortan.sample \
-       Headers/html.sample \
-       Headers/tcl.sample \
-       Source/makefile.plain
-
-subdir = .
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
-CONFIG_HEADER = $(top_builddir)/Source/config.h
-CONFIG_CLEAN_FILES =
-DIST_SOURCES =
-DATA = $(doc_DATA)
-
-
-RECURSIVE_TARGETS = info-recursive dvi-recursive pdf-recursive \
-       ps-recursive install-info-recursive uninstall-info-recursive \
-       all-recursive install-data-recursive install-exec-recursive \
-       installdirs-recursive install-recursive uninstall-recursive \
-       check-recursive installcheck-recursive
-DIST_COMMON = README AUTHORS COPYING ChangeLog INSTALL NEWS TODO \
-       aclocal.m4 configure configure.in install-sh makefile.am \
-       makefile.in missing mkinstalldirs
-DIST_SUBDIRS = $(SUBDIRS)
-all: all-recursive
-
-.SUFFIXES:
-
-am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
- configure.lineno
-$(srcdir)/makefile.in:  makefile.am  $(top_srcdir)/configure.in $(ACLOCAL_M4)
-       cd $(top_srcdir) && \
-         $(AUTOMAKE) --gnu  makefile
-makefile:  $(srcdir)/makefile.in  $(top_builddir)/config.status
-       cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)
-
-$(top_builddir)/config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
-       $(SHELL) ./config.status --recheck
-$(srcdir)/configure:  $(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES)
-       cd $(srcdir) && $(AUTOCONF)
-
-$(ACLOCAL_M4):  configure.in 
-       cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
-uninstall-info-am:
-docDATA_INSTALL = $(INSTALL_DATA)
-install-docDATA: $(doc_DATA)
-       @$(NORMAL_INSTALL)
-       $(mkinstalldirs) $(DESTDIR)$(docdir)
-       @list='$(doc_DATA)'; for p in $$list; do \
-         if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
-         f="`echo $$p | sed -e 's|^.*/||'`"; \
-         echo " $(docDATA_INSTALL) $$d$$p $(DESTDIR)$(docdir)/$$f"; \
-         $(docDATA_INSTALL) $$d$$p $(DESTDIR)$(docdir)/$$f; \
-       done
-
-uninstall-docDATA:
-       @$(NORMAL_UNINSTALL)
-       @list='$(doc_DATA)'; for p in $$list; do \
-         f="`echo $$p | sed -e 's|^.*/||'`"; \
-         echo " rm -f $(DESTDIR)$(docdir)/$$f"; \
-         rm -f $(DESTDIR)$(docdir)/$$f; \
-       done
-
-# This directory's subdirectories are mostly independent; you can cd
-# into them and run `make' without going through this Makefile.
-# To change the values of `make' variables: instead of editing Makefiles,
-# (1) if the variable is set in `config.status', edit `config.status'
-#     (which will cause the Makefiles to be regenerated when you run `make');
-# (2) otherwise, pass the desired values on the `make' command line.
-$(RECURSIVE_TARGETS):
-       @set fnord $$MAKEFLAGS; amf=$$2; \
-       dot_seen=no; \
-       target=`echo $@ | sed s/-recursive//`; \
-       list='$(SUBDIRS)'; for subdir in $$list; do \
-         echo "Making $$target in $$subdir"; \
-         if test "$$subdir" = "."; then \
-           dot_seen=yes; \
-           local_target="$$target-am"; \
-         else \
-           local_target="$$target"; \
-         fi; \
-         (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
-          || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
-       done; \
-       if test "$$dot_seen" = "no"; then \
-         $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
-       fi; test -z "$$fail"
-
-mostlyclean-recursive clean-recursive distclean-recursive \
-maintainer-clean-recursive:
-       @set fnord $$MAKEFLAGS; amf=$$2; \
-       dot_seen=no; \
-       case "$@" in \
-         distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
-         *) list='$(SUBDIRS)' ;; \
-       esac; \
-       rev=''; for subdir in $$list; do \
-         if test "$$subdir" = "."; then :; else \
-           rev="$$subdir $$rev"; \
-         fi; \
-       done; \
-       rev="$$rev ."; \
-       target=`echo $@ | sed s/-recursive//`; \
-       for subdir in $$rev; do \
-         echo "Making $$target in $$subdir"; \
-         if test "$$subdir" = "."; then \
-           local_target="$$target-am"; \
-         else \
-           local_target="$$target"; \
-         fi; \
-         (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
-          || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
-       done && test -z "$$fail"
-tags-recursive:
-       list='$(SUBDIRS)'; for subdir in $$list; do \
-         test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
-       done
-ctags-recursive:
-       list='$(SUBDIRS)'; for subdir in $$list; do \
-         test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
-       done
-
-ETAGS = etags
-ETAGSFLAGS =
-
-CTAGS = ctags
-CTAGSFLAGS =
-
-tags: TAGS
-
-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
-       list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
-       unique=`for i in $$list; do \
-           if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-         done | \
-         $(AWK) '    { files[$$0] = 1; } \
-              END { for (i in files) print i; }'`; \
-       mkid -fID $$unique
-
-TAGS: tags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-               $(TAGS_FILES) $(LISP)
-       tags=; \
-       here=`pwd`; \
-       list='$(SUBDIRS)'; for subdir in $$list; do \
-         if test "$$subdir" = .; then :; else \
-           test -f $$subdir/TAGS && tags="$$tags -i $$here/$$subdir/TAGS"; \
-         fi; \
-       done; \
-       list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-       unique=`for i in $$list; do \
-           if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-         done | \
-         $(AWK) '    { files[$$0] = 1; } \
-              END { for (i in files) print i; }'`; \
-       test -z "$(ETAGS_ARGS)$$tags$$unique" \
-         || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-            $$tags $$unique
-
-ctags: CTAGS
-CTAGS: ctags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-               $(TAGS_FILES) $(LISP)
-       tags=; \
-       here=`pwd`; \
-       list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-       unique=`for i in $$list; do \
-           if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-         done | \
-         $(AWK) '    { files[$$0] = 1; } \
-              END { for (i in files) print i; }'`; \
-       test -z "$(CTAGS_ARGS)$$tags$$unique" \
-         || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
-            $$tags $$unique
-
-GTAGS:
-       here=`$(am__cd) $(top_builddir) && pwd` \
-         && cd $(top_srcdir) \
-         && gtags -i $(GTAGS_ARGS) $$here
-
-distclean-tags:
-       -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-
-top_distdir = .
-distdir = $(PACKAGE)-$(VERSION)
-
-am__remove_distdir = \
-  { test ! -d $(distdir) \
-    || { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \
-         && rm -fr $(distdir); }; }
-
-GZIP_ENV = --best
-distuninstallcheck_listfiles = find . -type f -print
-distcleancheck_listfiles = find . -type f -print
-
-distdir: $(DISTFILES)
-       $(am__remove_distdir)
-       mkdir $(distdir)
-       $(mkinstalldirs) $(distdir)/Docs $(distdir)/Examples/C $(distdir)/Examples/CPP $(distdir)/Headers $(distdir)/Source
-       @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
-       list='$(DISTFILES)'; for file in $$list; do \
-         case $$file in \
-           $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
-         esac; \
-         if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
-         dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
-         if test "$$dir" != "$$file" && test "$$dir" != "."; then \
-           dir="/$$dir"; \
-           $(mkinstalldirs) "$(distdir)$$dir"; \
-         else \
-           dir=''; \
-         fi; \
-         if test -d $$d/$$file; then \
-           if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
-             cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
-           fi; \
-           cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
-         else \
-           test -f $(distdir)/$$file \
-           || cp -p $$d/$$file $(distdir)/$$file \
-           || exit 1; \
-         fi; \
-       done
-       list='$(SUBDIRS)'; for subdir in $$list; do \
-         if test "$$subdir" = .; then :; else \
-           test -d $(distdir)/$$subdir \
-           || mkdir $(distdir)/$$subdir \
-           || exit 1; \
-           (cd $$subdir && \
-             $(MAKE) $(AM_MAKEFLAGS) \
-               top_distdir="$(top_distdir)" \
-               distdir=../$(distdir)/$$subdir \
-               distdir) \
-             || exit 1; \
-         fi; \
-       done
-       -find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \
-         ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
-         ! -type d ! -perm -400 -exec chmod a+r {} \; -o \
-         ! -type d ! -perm -444 -exec $(SHELL) $(install_sh) -c -m a+r {} {} \; \
-       || chmod -R a+r $(distdir)
-dist-gzip: distdir
-       $(AMTAR) chof - $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
-       $(am__remove_distdir)
-
-dist-zip: distdir
-       -rm -f $(distdir).zip
-       zip -rq $(distdir).zip $(distdir)
-       $(am__remove_distdir)
-
-dist dist-all: distdir
-       $(AMTAR) chof - $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
-       -rm -f $(distdir).zip
-       zip -rq $(distdir).zip $(distdir)
-       $(am__remove_distdir)
-
-# This target untars the dist file and tries a VPATH configuration.  Then
-# it guarantees that the distribution is self-contained by making another
-# tarfile.
-distcheck: dist
-       $(am__remove_distdir)
-       GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(AMTAR) xf -
-       chmod -R a-w $(distdir); chmod a+w $(distdir)
-       mkdir $(distdir)/=build
-       mkdir $(distdir)/=inst
-       chmod a-w $(distdir)
-       dc_install_base=`$(am__cd) $(distdir)/=inst && pwd` \
-         && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
-         && $(mkinstalldirs) $$dc_destdir \
-         && cd $(distdir)/=build \
-         && ../configure --srcdir=.. --prefix="$$dc_install_base" \
-           $(DISTCHECK_CONFIGURE_FLAGS) \
-         && $(MAKE) $(AM_MAKEFLAGS) \
-         && $(MAKE) $(AM_MAKEFLAGS) dvi \
-         && $(MAKE) $(AM_MAKEFLAGS) check \
-         && $(MAKE) $(AM_MAKEFLAGS) install \
-         && $(MAKE) $(AM_MAKEFLAGS) installcheck \
-         && $(MAKE) $(AM_MAKEFLAGS) uninstall \
-         && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \
-               distuninstallcheck \
-         && chmod -R a-w "$$dc_install_base" \
-         && ({   $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \
-              && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \
-              && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \
-                   distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \
-             } || { rm -rf "$$dc_destdir"; exit 1; }) \
-         && rm -rf "$$dc_destdir" \
-         && $(MAKE) $(AM_MAKEFLAGS) dist-gzip \
-         && rm -f $(distdir).tar.gz \
-         && $(MAKE) $(AM_MAKEFLAGS) distcleancheck
-       $(am__remove_distdir)
-       @echo "$(distdir).tar.gz is ready for distribution" | \
-         sed 'h;s/./=/g;p;x;p;x'
-distuninstallcheck:
-       cd $(distuninstallcheck_dir) \
-       && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \
-          || { echo "ERROR: files left after uninstall:" ; \
-               if test -n "$(DESTDIR)"; then \
-                 echo "  (check DESTDIR support)"; \
-               fi ; \
-               $(distuninstallcheck_listfiles) ; \
-               exit 1; } >&2
-distcleancheck: distclean
-       if test '$(srcdir)' = . ; then \
-         echo "ERROR: distcleancheck can only run from a VPATH build" ; \
-         exit 1 ; \
-       fi
-       test `$(distcleancheck_listfiles) | wc -l` -eq 0 \
-         || { echo "ERROR: files left in build directory after distclean:" ; \
-              $(distcleancheck_listfiles) ; \
-              exit 1; } >&2
-check-am: all-am
-check: check-recursive
-all-am: makefile $(DATA)
-installdirs: installdirs-recursive
-installdirs-am:
-       $(mkinstalldirs) $(DESTDIR)$(docdir)
-
-install: install-recursive
-install-exec: install-exec-recursive
-install-data: install-data-recursive
-uninstall: uninstall-recursive
-
-install-am: all-am
-       @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-recursive
-install-strip:
-       $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-         INSTALL_STRIP_FLAG=-s \
-         `test -z '$(STRIP)' || \
-           echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
-mostlyclean-generic:
-
-clean-generic:
-
-distclean-generic:
-       -rm -f Makefile $(CONFIG_CLEAN_FILES)
-
-maintainer-clean-generic:
-       @echo "This command is intended for maintainers to use"
-       @echo "it deletes files that may require special tools to rebuild."
-clean: clean-recursive
-
-clean-am: clean-generic mostlyclean-am
-
-distclean: distclean-recursive
-       -rm -f $(am__CONFIG_DISTCLEAN_FILES)
-distclean-am: clean-am distclean-generic distclean-tags
-
-dvi: dvi-recursive
-
-dvi-am:
-
-info: info-recursive
-
-info-am:
-
-install-data-am: install-docDATA
-
-install-exec-am:
-
-install-info: install-info-recursive
-
-install-man:
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-recursive
-       -rm -f $(am__CONFIG_DISTCLEAN_FILES)
-       -rm -rf autom4te.cache
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-recursive
-
-mostlyclean-am: mostlyclean-generic
-
-pdf: pdf-recursive
-
-pdf-am:
-
-ps: ps-recursive
-
-ps-am:
-
-uninstall-am: uninstall-docDATA uninstall-info-am
-
-uninstall-info: uninstall-info-recursive
-
-.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am clean \
-       clean-generic clean-recursive ctags ctags-recursive dist \
-       dist-all dist-gzip dist-zip distcheck distclean \
-       distclean-generic distclean-recursive distclean-tags \
-       distcleancheck distdir distuninstallcheck dvi dvi-am \
-       dvi-recursive info info-am info-recursive install install-am \
-       install-data install-data-am install-data-recursive \
-       install-docDATA install-exec install-exec-am \
-       install-exec-recursive install-info install-info-am \
-       install-info-recursive install-man install-recursive \
-       install-strip installcheck installcheck-am installdirs \
-       installdirs-am installdirs-recursive maintainer-clean \
-       maintainer-clean-generic maintainer-clean-recursive mostlyclean \
-       mostlyclean-generic mostlyclean-recursive pdf pdf-am \
-       pdf-recursive ps ps-am ps-recursive tags tags-recursive \
-       uninstall uninstall-am uninstall-docDATA uninstall-info-am \
-       uninstall-info-recursive uninstall-recursive
-
-
-#
-# End of automake stuff
-#
-
-myclean:
-       rm -f *~
-       rm -f makefile.in
-       rm -f *.tar.gz *.zip
-       rm -f *.log aclocal.m4 config.cache
-       rm -f install-sh
-       rm -f mkinstalldirs
-       rm -f missing makefile
-       rm -f configure config.status
-       $(MAKE) -f makefile.am -C Docs     myclean
-       $(MAKE) -f makefile.am -C Source   myclean
-       $(MAKE)                -C Examples myclean
-
-Docs/robodoc.html :
-       $(MAKE) -C Docs robodoc.html
-
-Examples/C/prog1.c.html :
-       $(MAKE) -C Examples/C prog1.c.html 
-
-Examples/C/prog2.c.html :
-       $(MAKE) -C Examples/C prog2.c.html 
-
-Examples/CPP/masterindex.html :
-       $(MAKE) -C Examples/CPP masterindex.html 
-
-Examples/CPP/muppets.h.html :
-       $(MAKE) -C Examples/CPP muppets.h.html 
-
-Examples/CPP/muppets.cpp.html :
-       $(MAKE) -C Examples/CPP muppets.cpp.html 
-
-#
-#
-#
-
-docall:
-       $(MAKE) -C Source html
-# Tell versions [3.59,3.63) of GNU make to not export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
diff --git a/util/robodoc/missing b/util/robodoc/missing
deleted file mode 100755 (executable)
index 7789652..0000000
+++ /dev/null
@@ -1,190 +0,0 @@
-#! /bin/sh
-# Common stub for a few missing GNU programs while installing.
-# Copyright (C) 1996, 1997 Free Software Foundation, Inc.
-# Franc,ois Pinard <pinard@iro.umontreal.ca>, 1996.
-
-# 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; either version 2, or (at your option)
-# any later version.
-
-# 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.
-
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-# 02111-1307, USA.
-
-if test $# -eq 0; then
-  echo 1>&2 "Try \`$0 --help' for more information"
-  exit 1
-fi
-
-case "$1" in
-
-  -h|--h|--he|--hel|--help)
-    echo "\
-$0 [OPTION]... PROGRAM [ARGUMENT]...
-
-Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an
-error status if there is no known handling for PROGRAM.
-
-Options:
-  -h, --help      display this help and exit
-  -v, --version   output version information and exit
-
-Supported PROGRAM values:
-  aclocal      touch file \`aclocal.m4'
-  autoconf     touch file \`configure'
-  autoheader   touch file \`config.h.in'
-  automake     touch all \`Makefile.in' files
-  bison        create \`y.tab.[ch]', if possible, from existing .[ch]
-  flex         create \`lex.yy.c', if possible, from existing .c
-  lex          create \`lex.yy.c', if possible, from existing .c
-  makeinfo     touch the output file
-  yacc         create \`y.tab.[ch]', if possible, from existing .[ch]"
-    ;;
-
-  -v|--v|--ve|--ver|--vers|--versi|--versio|--version)
-    echo "missing - GNU libit 0.0"
-    ;;
-
-  -*)
-    echo 1>&2 "$0: Unknown \`$1' option"
-    echo 1>&2 "Try \`$0 --help' for more information"
-    exit 1
-    ;;
-
-  aclocal)
-    echo 1>&2 "\
-WARNING: \`$1' is missing on your system.  You should only need it if
-         you modified \`acinclude.m4' or \`configure.in'.  You might want
-         to install the \`Automake' and \`Perl' packages.  Grab them from
-         any GNU archive site."
-    touch aclocal.m4
-    ;;
-
-  autoconf)
-    echo 1>&2 "\
-WARNING: \`$1' is missing on your system.  You should only need it if
-         you modified \`configure.in'.  You might want to install the
-         \`Autoconf' and \`GNU m4' packages.  Grab them from any GNU
-         archive site."
-    touch configure
-    ;;
-
-  autoheader)
-    echo 1>&2 "\
-WARNING: \`$1' is missing on your system.  You should only need it if
-         you modified \`acconfig.h' or \`configure.in'.  You might want
-         to install the \`Autoconf' and \`GNU m4' packages.  Grab them
-         from any GNU archive site."
-    files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' configure.in`
-    test -z "$files" && files="config.h"
-    touch_files=
-    for f in $files; do
-      case "$f" in
-      *:*) touch_files="$touch_files "`echo "$f" |
-                                      sed -e 's/^[^:]*://' -e 's/:.*//'`;;
-      *) touch_files="$touch_files $f.in";;
-      esac
-    done
-    touch $touch_files
-    ;;
-
-  automake)
-    echo 1>&2 "\
-WARNING: \`$1' is missing on your system.  You should only need it if
-         you modified \`Makefile.am', \`acinclude.m4' or \`configure.in'.
-         You might want to install the \`Automake' and \`Perl' packages.
-         Grab them from any GNU archive site."
-    find . -type f -name Makefile.am -print |
-          sed 's/\.am$/.in/' |
-          while read f; do touch "$f"; done
-    ;;
-
-  bison|yacc)
-    echo 1>&2 "\
-WARNING: \`$1' is missing on your system.  You should only need it if
-         you modified a \`.y' file.  You may need the \`Bison' package
-         in order for those modifications to take effect.  You can get
-         \`Bison' from any GNU archive site."
-    rm -f y.tab.c y.tab.h
-    if [ $# -ne 1 ]; then
-        eval LASTARG="\${$#}"
-       case "$LASTARG" in
-       *.y)
-           SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
-           if [ -f "$SRCFILE" ]; then
-                cp "$SRCFILE" y.tab.c
-           fi
-           SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'`
-           if [ -f "$SRCFILE" ]; then
-                cp "$SRCFILE" y.tab.h
-           fi
-         ;;
-       esac
-    fi
-    if [ ! -f y.tab.h ]; then
-       echo >y.tab.h
-    fi
-    if [ ! -f y.tab.c ]; then
-       echo 'main() { return 0; }' >y.tab.c
-    fi
-    ;;
-
-  lex|flex)
-    echo 1>&2 "\
-WARNING: \`$1' is missing on your system.  You should only need it if
-         you modified a \`.l' file.  You may need the \`Flex' package
-         in order for those modifications to take effect.  You can get
-         \`Flex' from any GNU archive site."
-    rm -f lex.yy.c
-    if [ $# -ne 1 ]; then
-        eval LASTARG="\${$#}"
-       case "$LASTARG" in
-       *.l)
-           SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
-           if [ -f "$SRCFILE" ]; then
-                cp "$SRCFILE" lex.yy.c
-           fi
-         ;;
-       esac
-    fi
-    if [ ! -f lex.yy.c ]; then
-       echo 'main() { return 0; }' >lex.yy.c
-    fi
-    ;;
-
-  makeinfo)
-    echo 1>&2 "\
-WARNING: \`$1' is missing on your system.  You should only need it if
-         you modified a \`.texi' or \`.texinfo' file, or any other file
-         indirectly affecting the aspect of the manual.  The spurious
-         call might also be the consequence of using a buggy \`make' (AIX,
-         DU, IRIX).  You might want to install the \`Texinfo' package or
-         the \`GNU make' package.  Grab either from any GNU archive site."
-    file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'`
-    if test -z "$file"; then
-      file=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
-      file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $file`
-    fi
-    touch $file
-    ;;
-
-  *)
-    echo 1>&2 "\
-WARNING: \`$1' is needed, and you do not seem to have it handy on your
-         system.  You might have modified some files without having the
-         proper tools for further handling them.  Check the \`README' file,
-         it often tells you about the needed prerequirements for installing
-         this package.  You may also peek at any GNU archive site, in case
-         some other package would contain this missing \`$1' program."
-    exit 1
-    ;;
-esac
-
-exit 0
diff --git a/util/robodoc/mkinstalldirs b/util/robodoc/mkinstalldirs
deleted file mode 100755 (executable)
index 6b3b5fc..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-#! /bin/sh
-# mkinstalldirs --- make directory hierarchy
-# Author: Noah Friedman <friedman@prep.ai.mit.edu>
-# Created: 1993-05-16
-# Public domain
-
-# $Id$
-
-errstatus=0
-
-for file
-do
-   set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'`
-   shift
-
-   pathcomp=
-   for d
-   do
-     pathcomp="$pathcomp$d"
-     case "$pathcomp" in
-       -* ) pathcomp=./$pathcomp ;;
-     esac
-
-     if test ! -d "$pathcomp"; then
-        echo "mkdir $pathcomp"
-
-        mkdir "$pathcomp" || lasterr=$?
-
-        if test ! -d "$pathcomp"; then
-         errstatus=$lasterr
-        fi
-     fi
-
-     pathcomp="$pathcomp/"
-   done
-done
-
-exit $errstatus
-
-# mkinstalldirs ends here
index d7b97c5ab349638ce11f9bafc196260a0b4a1b8b..a2949c2e55799114372bc19d289f07657c7dd727 100644 (file)
-EXPORTS\r
-       silc_argument_get_arg_num @ 1 ;\r
-       silc_argument_get_arg_type @ 2 ;\r
-       silc_argument_get_decoded @ 3 ;\r
-       silc_argument_get_first_arg @ 4 ;\r
-       silc_argument_get_next_arg @ 5 ;\r
-       silc_argument_list_free @ 6 ;\r
-       silc_argument_list_parse @ 7 ;\r
-       silc_argument_list_parse_decoded @ 8 ;\r
-       silc_argument_payload_encode @ 9 ;\r
-       silc_argument_payload_encode_one @ 10 ;\r
-       silc_argument_payload_encode_payload @ 11 ;\r
-       silc_argument_payload_free @ 12 ;\r
-       silc_argument_payload_parse @ 13 ;\r
-       silc_command_get @ 14 ;\r
-       silc_command_get_args @ 15 ;\r
-       silc_command_get_ident @ 16 ;\r
-       silc_command_get_status @ 17 ;\r
-       silc_command_payload_encode @ 18 ;\r
-       silc_command_payload_encode_payload @ 19 ;\r
-       silc_command_payload_encode_va @ 20 ;\r
-       silc_command_payload_encode_vap @ 21 ;\r
-       silc_command_payload_free @ 22 ;\r
-       silc_command_payload_parse @ 23 ;\r
-       silc_command_reply_payload_encode_va @ 24 ;\r
-       silc_command_reply_payload_encode_vap @ 25 ;\r
-       silc_command_set_command @ 26 ;\r
-       silc_command_set_ident @ 27 ;\r
-       silc_auth_get_data @ 28 ;\r
-       silc_auth_get_method @ 29 ;\r
-       silc_auth_get_public_data @ 30 ;\r
-       silc_auth_payload_encode @ 31 ;\r
-       silc_auth_payload_free @ 32 ;\r
-       silc_auth_payload_parse @ 33 ;\r
-       silc_auth_public_key_auth_generate @ 34 ;\r
-       silc_auth_public_key_auth_generate_wpub @ 35 ;\r
-       silc_auth_public_key_auth_verify @ 36 ;\r
-       silc_auth_public_key_auth_verify_data @ 37 ;\r
-       silc_auth_verify @ 38 ;\r
-       silc_auth_verify_data @ 39 ;\r
-       silc_key_agreement_get_hostname @ 40 ;\r
-       silc_key_agreement_get_port @ 41 ;\r
-       silc_key_agreement_get_protocol @ 42 ;\r
-       silc_key_agreement_payload_encode @ 43 ;\r
-       silc_key_agreement_payload_free @ 44 ;\r
-       silc_key_agreement_payload_parse @ 45 ;\r
-       silc_id_dup @ 46 ;\r
-       silc_id_get_len @ 47 ;\r
-       silc_id_id2str @ 48 ;\r
-       silc_id_payload_encode @ 49 ;\r
-       silc_id_payload_encode_data @ 50 ;\r
-       silc_id_payload_free @ 51 ;\r
-       silc_id_payload_get_data @ 52 ;\r
-       silc_id_payload_get_id @ 53 ;\r
-       silc_id_payload_get_len @ 54 ;\r
-       silc_id_payload_get_type @ 55 ;\r
-       silc_id_payload_parse @ 56 ;\r
-       silc_id_payload_parse_id @ 57 ;\r
-       silc_id_str2id @ 58 ;\r
-       silc_id_str2id2 @ 59 ;\r
-       silc_attribute_get_attribute @ 60 ;\r
-       silc_attribute_get_data @ 61 ;\r
-       silc_attribute_get_flags @ 62 ;\r
-       silc_attribute_get_object @ 63 ;\r
-       silc_attribute_get_verify_data @ 64 ;\r
-       silc_attribute_payload_alloc @ 65 ;\r
-       silc_attribute_payload_encode @ 66 ;\r
-       silc_attribute_payload_encode_data @ 67 ;\r
-       silc_attribute_payload_free @ 68 ;\r
-       silc_attribute_payload_list_free @ 69 ;\r
-       silc_attribute_payload_parse @ 70 ;\r
-       silc_channel_get_id @ 71 ;\r
-       silc_channel_get_id_parse @ 72 ;\r
-       silc_channel_get_mode @ 73 ;\r
-       silc_channel_get_name @ 74 ;\r
-       silc_channel_key_get_cipher @ 75 ;\r
-       silc_channel_key_get_id @ 76 ;\r
-       silc_channel_key_get_key @ 77 ;\r
-       silc_channel_key_payload_encode @ 78 ;\r
-       silc_channel_key_payload_free @ 79 ;\r
-       silc_channel_key_payload_parse @ 80 ;\r
-       silc_channel_payload_encode @ 81 ;\r
-       silc_channel_payload_free @ 82 ;\r
-       silc_channel_payload_list_free @ 83 ;\r
-       silc_channel_payload_parse @ 84 ;\r
-       silc_channel_payload_parse_list @ 85 ;\r
-       silc_packet_engine_get_streams @ 86 ;\r
-       silc_packet_engine_start @ 87 ;\r
-       silc_packet_engine_stop @ 88 ;\r
-       silc_packet_error_string @ 89 ;\r
-       silc_packet_free @ 90 ;\r
-       silc_packet_get_context @ 91 ;\r
-       silc_packet_get_engine @ 92 ;\r
-       silc_packet_get_ids @ 93 ;\r
-       silc_packet_get_keys @ 94 ;\r
-       silc_packet_get_sender @ 95 ;\r
-       silc_packet_send @ 96 ;\r
-       silc_packet_send_ext @ 97 ;\r
-       silc_packet_send_va @ 98 ;\r
-       silc_packet_send_va_ext @ 99 ;\r
-       silc_packet_set_context @ 100 ;\r
-       silc_packet_set_ids @ 101 ;\r
-       silc_packet_set_keys @ 102 ;\r
-       silc_packet_set_sid @ 103 ;\r
-       silc_packet_stream_add_remote @ 104 ;\r
-       silc_packet_stream_create @ 105 ;\r
-       silc_packet_stream_destroy @ 106 ;\r
-       silc_packet_stream_get_stream @ 107 ;\r
-       silc_packet_stream_inject_packet @ 108 ;\r
-       silc_packet_stream_is_udp @ 109 ;\r
-       silc_packet_stream_is_valid @ 110 ;\r
-       silc_packet_stream_link @ 111 ;\r
-       silc_packet_stream_ref @ 112 ;\r
-       silc_packet_stream_set_iv_included @ 113 ;\r
-       silc_packet_stream_set_router @ 114 ;\r
-       silc_packet_stream_set_stream @ 115 ;\r
-       silc_packet_stream_unlink @ 116 ;\r
-       silc_packet_stream_unref @ 117 ;\r
-       silc_packet_stream_wrap @ 118 ;\r
-       silc_packet_wait @ 119 ;\r
-       silc_packet_wait_init @ 120 ;\r
-       silc_packet_wait_uninit @ 121 ;\r
-       silc_packet_wrap_close @ 122 ;\r
-       silc_packet_wrap_destroy @ 123 ;\r
-       silc_packet_wrap_get_schedule @ 124 ;\r
-       silc_packet_wrap_notifier @ 125 ;\r
-       silc_packet_wrap_read @ 126 ;\r
-       silc_packet_wrap_read_more @ 127 ;\r
-       silc_packet_wrap_write @ 128 ;\r
-       silc_notify_get_arg_num @ 129 ;\r
-       silc_notify_get_args @ 130 ;\r
-       silc_notify_get_type @ 131 ;\r
-       silc_notify_payload_encode @ 132 ;\r
-       silc_notify_payload_encode_args @ 133 ;\r
-       silc_notify_payload_free @ 134 ;\r
-       silc_notify_payload_parse @ 135 ;\r
-       silc_status_get_args @ 136 ;\r
-       silc_message_get_data @ 137 ;\r
-       silc_message_get_flags @ 138 ;\r
-       silc_message_get_mac @ 139 ;\r
-       silc_message_payload_decrypt @ 140 ;\r
-       silc_message_payload_encode @ 141 ;\r
-       silc_message_payload_encrypt @ 142 ;\r
-       silc_message_payload_free @ 143 ;\r
-       silc_message_payload_parse @ 144 ;\r
-       silc_message_signed_get_public_key @ 145 ;\r
-       silc_message_signed_verify @ 146 ;\r
-       silc_public_key_payload_decode @ 147 ;\r
-       silc_public_key_payload_encode @ 148 ;\r
-       silc_file_set_nonblock @ 149 ;\r
-       silc_get_real_name @ 150 ;\r
-       silc_get_username @ 151 ;\r
-       silc_gettimeofday @ 152 ;\r
-       silc_cond_alloc @ 153 ;\r
-       silc_cond_broadcast @ 154 ;\r
-       silc_cond_free @ 155 ;\r
-       silc_cond_signal @ 156 ;\r
-       silc_cond_timedwait @ 157 ;\r
-       silc_cond_wait @ 158 ;\r
-       silc_mutex_alloc @ 159 ;\r
-       silc_mutex_assert_locked @ 160 ;\r
-       silc_mutex_free @ 161 ;\r
-       silc_mutex_lock @ 162 ;\r
-       silc_mutex_unlock @ 163 ;\r
-       silc_rwlock_alloc @ 164 ;\r
-       silc_rwlock_free @ 165 ;\r
-       silc_rwlock_rdlock @ 166 ;\r
-       silc_rwlock_unlock @ 167 ;\r
-       silc_rwlock_wrlock @ 168 ;\r
-       silc_thread_create @ 169 ;\r
-       silc_thread_exit @ 170 ;\r
-       silc_thread_self @ 171 ;\r
-       silc_thread_wait @ 172 ;\r
-       silc_thread_yield @ 173 ;\r
-       silc_socket_stream_close @ 174 ;\r
-       silc_socket_stream_destroy @ 175 ;\r
-       silc_socket_stream_notifier @ 176 ;\r
-       silc_socket_stream_read @ 177 ;\r
-       silc_socket_stream_write @ 178 ;\r
-       silc_socket_udp_stream_read @ 179 ;\r
-       silc_socket_udp_stream_write @ 180 ;\r
-       silc_net_accept @ 181 ;\r
-       silc_net_addr2bin @ 182 ;\r
-       silc_net_close_connection @ 183 ;\r
-       silc_net_close_listener @ 184 ;\r
-       silc_net_set_socket_nonblock @ 185 ;\r
-       silc_net_tcp_connect @ 186 ;\r
-       silc_net_tcp_create_listener @ 187 ;\r
-       silc_net_udp_connect @ 188 ;\r
-       silc_net_udp_receive @ 189 ;\r
-       silc_net_udp_send @ 190 ;\r
-       silc_schedule_internal_init @ 191 ;\r
-       silc_schedule_internal_schedule_fd @ 192 ;\r
-       silc_schedule_internal_signal_register @ 193 ;\r
-       silc_schedule_internal_signal_unregister @ 194 ;\r
-       silc_schedule_internal_signals_block @ 195 ;\r
-       silc_schedule_internal_signals_call @ 196 ;\r
-       silc_schedule_internal_signals_unblock @ 197 ;\r
-       silc_schedule_internal_uninit @ 198 ;\r
-       silc_schedule_internal_wakeup @ 199 ;\r
-       silc_fd_stream_close @ 200 ;\r
-       silc_fd_stream_create @ 201 ;\r
-       silc_fd_stream_create2 @ 202 ;\r
-       silc_fd_stream_destroy @ 203 ;\r
-       silc_fd_stream_file @ 204 ;\r
-       silc_fd_stream_file2 @ 205 ;\r
-       silc_fd_stream_get_error @ 206 ;\r
-       silc_fd_stream_get_info @ 207 ;\r
-       silc_fd_stream_get_schedule @ 208 ;\r
-       silc_fd_stream_notifier @ 209 ;\r
-       silc_fd_stream_read @ 210 ;\r
-       silc_fd_stream_write @ 211 ;\r
-       silc_hash_table_add @ 212 ;\r
-       silc_hash_table_add_ext @ 213 ;\r
-       silc_hash_table_alloc @ 214 ;\r
-       silc_hash_table_count @ 215 ;\r
-       silc_hash_table_del @ 216 ;\r
-       silc_hash_table_del_by_context @ 217 ;\r
-       silc_hash_table_del_by_context_ext @ 218 ;\r
-       silc_hash_table_del_ext @ 219 ;\r
-       silc_hash_table_find @ 220 ;\r
-       silc_hash_table_find_by_context @ 221 ;\r
-       silc_hash_table_find_by_context_ext @ 222 ;\r
-       silc_hash_table_find_ext @ 223 ;\r
-       silc_hash_table_find_foreach @ 224 ;\r
-       silc_hash_table_find_foreach_ext @ 225 ;\r
-       silc_hash_table_foreach @ 226 ;\r
-       silc_hash_table_free @ 227 ;\r
-       silc_hash_table_get @ 228 ;\r
-       silc_hash_table_list @ 229 ;\r
-       silc_hash_table_list_reset @ 230 ;\r
-       silc_hash_table_rehash @ 231 ;\r
-       silc_hash_table_rehash_ext @ 232 ;\r
-       silc_hash_table_replace @ 233 ;\r
-       silc_hash_table_replace_ext @ 234 ;\r
-       silc_hash_table_size @ 235 ;\r
-       silc_schedule @ 236 ;\r
-       silc_schedule_get_context @ 237 ;\r
-       silc_schedule_get_fd_events @ 238 ;\r
-       silc_schedule_init @ 239 ;\r
-       silc_schedule_one @ 240 ;\r
-       silc_schedule_set_listen_fd @ 241 ;\r
-       silc_schedule_stop @ 242 ;\r
-       silc_schedule_task_add @ 243 ;\r
-       silc_schedule_task_del @ 244 ;\r
-       silc_schedule_task_del_by_all @ 245 ;\r
-       silc_schedule_task_del_by_callback @ 246 ;\r
-       silc_schedule_task_del_by_context @ 247 ;\r
-       silc_schedule_task_del_by_fd @ 248 ;\r
-       silc_schedule_uninit @ 249 ;\r
-       silc_schedule_unset_listen_fd @ 250 ;\r
-       silc_schedule_wakeup @ 251 ;\r
-       silc_calloc @ 252 ;\r
-       silc_free @ 253 ;\r
-       silc_malloc @ 254 ;\r
-       silc_memdup @ 255 ;\r
-       silc_realloc @ 256 ;\r
-       silc_scalloc @ 257 ;\r
-       silc_smalloc @ 258 ;\r
-       silc_smalloc_ua @ 259 ;\r
-       silc_smemdup @ 260 ;\r
-       silc_srealloc @ 261 ;\r
-       silc_srealloc_ua @ 262 ;\r
-       silc_sstrdup @ 263 ;\r
-       silc_config_close @ 264 ;\r
-       silc_config_get_filename @ 265 ;\r
-       silc_config_get_line @ 266 ;\r
-       silc_config_init @ 267 ;\r
-       silc_config_main @ 268 ;\r
-       silc_config_open @ 269 ;\r
-       silc_config_read_current_line @ 270 ;\r
-       silc_config_read_line @ 271 ;\r
-       silc_config_register @ 272 ;\r
-       silc_config_register_table @ 273 ;\r
-       silc_config_strerror @ 274 ;\r
-       silc_log_debug @ 275 ;\r
-       silc_log_debug_hexdump @ 276 ;\r
-       silc_log_fflush_callback @ 277 ;\r
-       silc_log_flush_all @ 278 ;\r
-       silc_log_flushdelay @ 279 ;\r
-       silc_log_get_file @ 280 ;\r
-       silc_log_output @ 281 ;\r
-       silc_log_output_debug @ 282 ;\r
-       silc_log_output_hexdump @ 283 ;\r
-       silc_log_quick @ 284 ;\r
-       silc_log_reset_all @ 285 ;\r
-       silc_log_reset_callbacks @ 286 ;\r
-       silc_log_reset_debug_callbacks @ 287 ;\r
-       silc_log_set_callback @ 288 ;\r
-       silc_log_set_debug_callbacks @ 289 ;\r
-       silc_log_set_debug_string @ 290 ;\r
-       silc_log_set_file @ 291 ;\r
-       silc_log_timestamp @ 292 ;\r
-       silc_net_accept_connection @ 293 ;\r
-       silc_net_check_host_by_sock @ 294 ;\r
-       silc_net_check_local_by_sock @ 295 ;\r
-       silc_net_get_error_string @ 296 ;\r
-       silc_net_get_local_port @ 297 ;\r
-       silc_net_get_remote_port @ 298 ;\r
-       silc_net_get_socket_opt @ 299 ;\r
-       silc_net_gethostbyaddr @ 300 ;\r
-       silc_net_gethostbyaddr_async @ 301 ;\r
-       silc_net_gethostbyname @ 302 ;\r
-       silc_net_gethostbyname_async @ 303 ;\r
-       silc_net_is_ip @ 304 ;\r
-       silc_net_is_ip4 @ 305 ;\r
-       silc_net_is_ip6 @ 306 ;\r
-       silc_net_listener_get_hostname @ 307 ;\r
-       silc_net_listener_get_ip @ 308 ;\r
-       silc_net_listener_get_port @ 309 ;\r
-       silc_net_localhost @ 310 ;\r
-       silc_net_localip @ 311 ;\r
-       silc_net_resolve_completion @ 312 ;\r
-       silc_net_set_socket_opt @ 313 ;\r
-       silc_stringprep @ 314 ;\r
-       silc_socket_host_lookup_finish @ 315 ;\r
-       silc_socket_stream_get_error @ 316 ;\r
-       silc_socket_stream_get_info @ 317 ;\r
-       silc_socket_stream_get_schedule @ 318 ;\r
-       silc_socket_stream_is_udp @ 319 ;\r
-       silc_socket_stream_set_info @ 320 ;\r
-       silc_socket_stream_set_qos @ 321 ;\r
-       silc_socket_tcp_stream_create @ 322 ;\r
-       silc_socket_udp_stream_create @ 323 ;\r
-       silc_compare_timeval @ 324 ;\r
-       silc_time @ 325 ;\r
-       silc_time_generalized @ 326 ;\r
-       silc_time_generalized_string @ 327 ;\r
-       silc_time_msec @ 328 ;\r
-       silc_time_string @ 329 ;\r
-       silc_time_universal @ 330 ;\r
-       silc_time_universal_string @ 331 ;\r
-       silc_time_usec @ 332 ;\r
-       silc_time_value @ 333 ;\r
-       silc_timezone @ 334 ;\r
-       silc_file_close @ 335 ;\r
-       silc_file_open @ 336 ;\r
-       silc_file_open_mode @ 337 ;\r
-       silc_file_read @ 338 ;\r
-       silc_file_readfile @ 339 ;\r
-       silc_file_size @ 340 ;\r
-       silc_file_write @ 341 ;\r
-       silc_file_writefile @ 342 ;\r
-       silc_file_writefile_mode @ 343 ;\r
-       silc_check_line @ 344 ;\r
-       silc_fingerprint @ 345 ;\r
-       silc_format @ 346 ;\r
-       silc_get_input @ 347 ;\r
-       silc_gets @ 348 ;\r
-       silc_hash_client_id_compare @ 349 ;\r
-       silc_hash_client_id_hash @ 350 ;\r
-       silc_hash_data @ 351 ;\r
-       silc_hash_data_compare @ 352 ;\r
-       silc_hash_id @ 353 ;\r
-       silc_hash_id_compare @ 354 ;\r
-       silc_hash_id_compare_full @ 355 ;\r
-       silc_hash_ptr @ 356 ;\r
-       silc_hash_public_key @ 357 ;\r
-       silc_hash_public_key_compare @ 358 ;\r
-       silc_hash_string @ 359 ;\r
-       silc_hash_string_compare @ 360 ;\r
-       silc_hash_uint @ 361 ;\r
-       silc_hash_utf8_compare @ 362 ;\r
-       silc_hash_utf8_string @ 363 ;\r
-       silc_parse_command_line @ 364 ;\r
-       silc_parse_userfqdn @ 365 ;\r
-       silc_string_is_ascii @ 366 ;\r
-       silc_to_lower @ 367 ;\r
-       silc_to_upper @ 368 ;\r
-       silc_utf8_decode @ 369 ;\r
-       silc_utf8_decoded_len @ 370 ;\r
-       silc_utf8_encode @ 371 ;\r
-       silc_utf8_encoded_len @ 372 ;\r
-       silc_utf8_strcasecmp @ 373 ;\r
-       silc_utf8_strncasecmp @ 374 ;\r
-       silc_utf8_valid @ 375 ;\r
-       silc_base64_decode @ 376 ;\r
-       silc_base64_encode @ 377 ;\r
-       silc_base64_encode_file @ 378 ;\r
-       silc_string_compare @ 379 ;\r
-       silc_string_match @ 380 ;\r
-       silc_string_regex_combine @ 381 ;\r
-       silc_string_regex_match @ 382 ;\r
-       silc_string_regexify @ 383 ;\r
-       silc_string_split @ 384 ;\r
-       silc_strncat @ 385 ;\r
-       silc_fsm_alloc @ 386 ;\r
-       silc_fsm_continue @ 387 ;\r
-       silc_fsm_continue_sync @ 388 ;\r
-       silc_fsm_event_alloc @ 389 ;\r
-       silc_fsm_event_free @ 390 ;\r
-       silc_fsm_event_init @ 391 ;\r
-       silc_fsm_event_signal @ 392 ;\r
-       silc_fsm_event_timedwait @ 393 ;\r
-       silc_fsm_event_wait @ 394 ;\r
-       silc_fsm_finish @ 395 ;\r
-       silc_fsm_free @ 396 ;\r
-       silc_fsm_get_context @ 397 ;\r
-       silc_fsm_get_machine @ 398 ;\r
-       silc_fsm_get_schedule @ 399 ;\r
-       silc_fsm_get_state_context @ 400 ;\r
-       silc_fsm_init @ 401 ;\r
-       silc_fsm_is_started @ 402 ;\r
-       silc_fsm_next @ 403 ;\r
-       silc_fsm_next_later @ 404 ;\r
-       silc_fsm_set_context @ 405 ;\r
-       silc_fsm_set_state_context @ 406 ;\r
-       silc_fsm_signal @ 407 ;\r
-       silc_fsm_start @ 408 ;\r
-       silc_fsm_start_sync @ 409 ;\r
-       silc_fsm_thread @ 410 ;\r
-       silc_fsm_thread_alloc @ 411 ;\r
-       silc_fsm_thread_init @ 412 ;\r
-       silc_fsm_thread_wait @ 413 ;\r
-       silc_buffer_format @ 414 ;\r
-       silc_buffer_format_vp @ 415 ;\r
-       silc_buffer_sformat @ 416 ;\r
-       silc_buffer_sformat_vp @ 417 ;\r
-       silc_buffer_sstrformat @ 418 ;\r
-       silc_buffer_strformat @ 419 ;\r
-       silc_buffer_sunformat @ 420 ;\r
-       silc_buffer_sunformat_vp @ 421 ;\r
-       silc_buffer_unformat @ 422 ;\r
-       silc_buffer_unformat_vp @ 423 ;\r
-       silc_stream_close @ 424 ;\r
-       silc_stream_destroy @ 425 ;\r
-       silc_stream_get_schedule @ 426 ;\r
-       silc_stream_read @ 427 ;\r
-       silc_stream_set_notifier @ 428 ;\r
-       silc_stream_write @ 429 ;\r
-       silc_async_abort @ 430 ;\r
-       silc_async_alloc @ 431 ;\r
-       silc_async_free @ 432 ;\r
-       silc_async_get_context @ 433 ;\r
-       silc_async_halt @ 434 ;\r
-       silc_async_init @ 435 ;\r
-       silc_async_resume @ 436 ;\r
-       silc_asprintf @ 437 ;\r
-       silc_snprintf @ 438 ;\r
-       silc_vasprintf @ 439 ;\r
-       silc_vsnprintf @ 440 ;\r
-       silc_mime_add_data @ 441 ;\r
-       silc_mime_add_field @ 442 ;\r
-       silc_mime_add_multipart @ 443 ;\r
-       silc_mime_alloc @ 444 ;\r
-       silc_mime_assemble @ 445 ;\r
-       silc_mime_assembler_alloc @ 446 ;\r
-       silc_mime_assembler_free @ 447 ;\r
-       silc_mime_decode @ 448 ;\r
-       silc_mime_encode @ 449 ;\r
-       silc_mime_encode_partial @ 450 ;\r
-       silc_mime_free @ 451 ;\r
-       silc_mime_get_data @ 452 ;\r
-       silc_mime_get_field @ 453 ;\r
-       silc_mime_get_multiparts @ 454 ;\r
-       silc_mime_is_multipart @ 455 ;\r
-       silc_mime_is_partial @ 456 ;\r
-       silc_mime_partial_free @ 457 ;\r
-       silc_mime_set_multipart @ 458 ;\r
-       silc_mime_steal_data @ 459 ;\r
-       silc_idcache_add @ 460 ;\r
-       silc_idcache_alloc @ 461 ;\r
-       silc_idcache_del @ 462 ;\r
-       silc_idcache_del_by_context @ 463 ;\r
-       silc_idcache_del_by_id @ 464 ;\r
-       silc_idcache_find_by_context @ 465 ;\r
-       silc_idcache_find_by_id @ 466 ;\r
-       silc_idcache_find_by_id_one @ 467 ;\r
-       silc_idcache_find_by_name @ 468 ;\r
-       silc_idcache_find_by_name_one @ 469 ;\r
-       silc_idcache_free @ 470 ;\r
-       silc_idcache_get_all @ 471 ;\r
-       silc_idcache_update @ 472 ;\r
-       silc_idcache_update_by_context @ 473 ;\r
-       silc_change_private_key_passphrase @ 474 ;\r
-       silc_channel_name_check @ 475 ;\r
-       silc_channel_name_verify @ 476 ;\r
-       silc_client_chmode @ 477 ;\r
-       silc_client_chumode @ 478 ;\r
-       silc_client_chumode_char @ 479 ;\r
-       silc_create_key_pair @ 480 ;\r
-       silc_get_command_name @ 481 ;\r
-       silc_get_mode_list @ 482 ;\r
-       silc_get_packet_name @ 483 ;\r
-       silc_get_status_message @ 484 ;\r
-       silc_id_render @ 485 ;\r
-       silc_identifier_check @ 486 ;\r
-       silc_identifier_verify @ 487 ;\r
-       silc_load_key_pair @ 488 ;\r
-       silc_parse_version_string @ 489 ;\r
-       silc_show_public_key @ 490 ;\r
-       silc_show_public_key_file @ 491 ;\r
-       silc_version_to_num @ 492 ;\r
-       silc_sha256_context_len @ 498 ;\r
-       silc_sha256_final @ 499 ;\r
-       silc_sha256_init @ 500 ;\r
-       silc_sha256_transform @ 501 ;\r
-       silc_sha256_update @ 502 ;\r
-       silc_none_context_len @ 503 ;\r
-       silc_none_decrypt @ 504 ;\r
-       silc_none_encrypt @ 505 ;\r
-       silc_none_set_iv @ 506 ;\r
-       silc_none_set_key @ 507 ;\r
-       silc_sha1_context_len @ 508 ;\r
-       silc_sha1_final @ 509 ;\r
-       silc_sha1_init @ 510 ;\r
-       silc_sha1_transform @ 511 ;\r
-       silc_sha1_update @ 512 ;\r
-       silc_pkcs_algorithm_register @ 513 ;\r
-       silc_pkcs_algorithm_unregister @ 514 ;\r
-       silc_pkcs_decrypt @ 515 ;\r
-       silc_pkcs_encrypt @ 516 ;\r
-       silc_pkcs_find_algorithm @ 517 ;\r
-       silc_pkcs_find_pkcs @ 518 ;\r
-       silc_pkcs_get_algorithm @ 519 ;\r
-       silc_pkcs_get_context @ 520 ;\r
-       silc_pkcs_get_name @ 521 ;\r
-       silc_pkcs_get_pkcs @ 522 ;\r
-       silc_pkcs_get_supported @ 523 ;\r
-       silc_pkcs_get_type @ 524 ;\r
-       silc_pkcs_load_private_key @ 525 ;\r
-       silc_pkcs_load_public_key @ 526 ;\r
-       silc_pkcs_private_key_alloc @ 527 ;\r
-       silc_pkcs_private_key_free @ 528 ;\r
-       silc_pkcs_private_key_get_len @ 529 ;\r
-       silc_pkcs_public_key_alloc @ 530 ;\r
-       silc_pkcs_public_key_compare @ 531 ;\r
-       silc_pkcs_public_key_copy @ 532 ;\r
-       silc_pkcs_public_key_encode @ 533 ;\r
-       silc_pkcs_public_key_free @ 534 ;\r
-       silc_pkcs_public_key_get_len @ 535 ;\r
-       silc_pkcs_register @ 536 ;\r
-       silc_pkcs_register_default @ 537 ;\r
-       silc_pkcs_save_private_key @ 538 ;\r
-       silc_pkcs_save_public_key @ 539 ;\r
-       silc_pkcs_sign @ 540 ;\r
-       silc_pkcs_unregister @ 541 ;\r
-       silc_pkcs_unregister_all @ 542 ;\r
-       silc_pkcs_verify @ 543 ;\r
-       silc_hash_alloc @ 544 ;\r
-       silc_hash_alloc_by_oid @ 545 ;\r
-       silc_hash_babbleprint @ 546 ;\r
-       silc_hash_block_len @ 547 ;\r
-       silc_hash_final @ 548 ;\r
-       silc_hash_fingerprint @ 549 ;\r
-       silc_hash_free @ 550 ;\r
-       silc_hash_get_name @ 551 ;\r
-       silc_hash_get_oid @ 552 ;\r
-       silc_hash_get_supported @ 553 ;\r
-       silc_hash_init @ 554 ;\r
-       silc_hash_is_supported @ 555 ;\r
-       silc_hash_len @ 556 ;\r
-       silc_hash_make @ 557 ;\r
-       silc_hash_register @ 558 ;\r
-       silc_hash_register_default @ 559 ;\r
-       silc_hash_transform @ 560 ;\r
-       silc_hash_unregister @ 561 ;\r
-       silc_hash_unregister_all @ 562 ;\r
-       silc_hash_update @ 563 ;\r
-       silc_aes_cbc_context_len @ 564 ;\r
-       silc_aes_cbc_decrypt @ 565 ;\r
-       silc_aes_cbc_encrypt @ 566 ;\r
-       silc_aes_cbc_set_iv @ 567 ;\r
-       silc_aes_cbc_set_key @ 568 ;\r
-       silc_aes_ctr_context_len @ 569 ;\r
-       silc_aes_ctr_decrypt @ 570 ;\r
-       silc_aes_ctr_encrypt @ 571 ;\r
-       silc_aes_ctr_set_iv @ 572 ;\r
-       silc_aes_ctr_set_key @ 573 ;\r
-       silc_pkcs1_decode @ 574 ;\r
-       silc_pkcs1_decrypt @ 575 ;\r
-       silc_pkcs1_encode @ 576 ;\r
-       silc_pkcs1_encrypt @ 577 ;\r
-       silc_pkcs1_export_private_key @ 578 ;\r
-       silc_pkcs1_export_public_key @ 579 ;\r
-       silc_pkcs1_generate_key @ 580 ;\r
-       silc_pkcs1_import_private_key @ 581 ;\r
-       silc_pkcs1_import_public_key @ 582 ;\r
-       silc_pkcs1_private_key_bitlen @ 583 ;\r
-       silc_pkcs1_private_key_free @ 584 ;\r
-       silc_pkcs1_public_key_bitlen @ 585 ;\r
-       silc_pkcs1_public_key_compare @ 586 ;\r
-       silc_pkcs1_public_key_copy @ 587 ;\r
-       silc_pkcs1_public_key_free @ 588 ;\r
-       silc_pkcs1_sign @ 589 ;\r
-       silc_pkcs1_sign_no_oid @ 590 ;\r
-       silc_pkcs1_verify @ 591 ;\r
-       silc_pkcs1_verify_no_oid @ 592 ;\r
-       silc_cipher_alloc @ 598 ;\r
-       silc_cipher_decrypt @ 599 ;\r
-       silc_cipher_encrypt @ 600 ;\r
-       silc_cipher_free @ 601 ;\r
-       silc_cipher_get_block_len @ 602 ;\r
-       silc_cipher_get_iv @ 603 ;\r
-       silc_cipher_get_iv_len @ 604 ;\r
-       silc_cipher_get_key_len @ 605 ;\r
-       silc_cipher_get_mode @ 606 ;\r
-       silc_cipher_get_name @ 607 ;\r
-       silc_cipher_get_supported @ 608 ;\r
-       silc_cipher_is_supported @ 609 ;\r
-       silc_cipher_register @ 610 ;\r
-       silc_cipher_register_default @ 611 ;\r
-       silc_cipher_set_iv @ 612 ;\r
-       silc_cipher_set_key @ 613 ;\r
-       silc_cipher_unregister @ 614 ;\r
-       silc_cipher_unregister_all @ 615 ;\r
-       silc_md5_context_len @ 616 ;\r
-       silc_md5_final @ 617 ;\r
-       silc_md5_init @ 618 ;\r
-       silc_md5_transform @ 619 ;\r
-       silc_md5_update @ 620 ;\r
-       silc_rsa_generate_keys @ 621 ;\r
-       silc_rsa_private_operation @ 622 ;\r
-       silc_rsa_public_operation @ 623 ;\r
-       silc_blowfish_cbc_context_len @ 624 ;\r
-       silc_blowfish_cbc_decrypt @ 625 ;\r
-       silc_blowfish_cbc_encrypt @ 626 ;\r
-       silc_blowfish_cbc_set_iv @ 627 ;\r
-       silc_blowfish_cbc_set_key @ 628 ;\r
-       silc_twofish_cbc_context_len @ 629 ;\r
-       silc_twofish_cbc_decrypt @ 630 ;\r
-       silc_twofish_cbc_encrypt @ 631 ;\r
-       silc_twofish_cbc_set_iv @ 632 ;\r
-       silc_twofish_cbc_set_key @ 633 ;\r
-       silc_hmac_alloc @ 634 ;\r
-       silc_hmac_final @ 635 ;\r
-       silc_hmac_free @ 636 ;\r
-       silc_hmac_get_hash @ 637 ;\r
-       silc_hmac_get_key @ 638 ;\r
-       silc_hmac_get_name @ 639 ;\r
-       silc_hmac_get_supported @ 640 ;\r
-       silc_hmac_init @ 641 ;\r
-       silc_hmac_init_with_key @ 642 ;\r
-       silc_hmac_is_supported @ 643 ;\r
-       silc_hmac_len @ 644 ;\r
-       silc_hmac_make @ 645 ;\r
-       silc_hmac_make_truncated @ 646 ;\r
-       silc_hmac_make_with_key @ 647 ;\r
-       silc_hmac_register @ 648 ;\r
-       silc_hmac_register_default @ 649 ;\r
-       silc_hmac_set_key @ 650 ;\r
-       silc_hmac_unregister @ 651 ;\r
-       silc_hmac_unregister_all @ 652 ;\r
-       silc_hmac_update @ 653 ;\r
-       silc_rng_add_noise @ 654 ;\r
-       silc_rng_alloc @ 655 ;\r
-       silc_rng_free @ 656 ;\r
-       silc_rng_get_byte @ 657 ;\r
-       silc_rng_get_byte_fast @ 658 ;\r
-       silc_rng_get_rn16 @ 659 ;\r
-       silc_rng_get_rn32 @ 660 ;\r
-       silc_rng_get_rn_data @ 661 ;\r
-       silc_rng_get_rn_string @ 662 ;\r
-       silc_rng_global_add_noise @ 663 ;\r
-       silc_rng_global_get_byte @ 664 ;\r
-       silc_rng_global_get_byte_fast @ 665 ;\r
-       silc_rng_global_get_rn16 @ 666 ;\r
-       silc_rng_global_get_rn32 @ 667 ;\r
-       silc_rng_global_get_rn_data @ 668 ;\r
-       silc_rng_global_get_rn_string @ 669 ;\r
-       silc_rng_global_init @ 670 ;\r
-       silc_rng_global_uninit @ 671 ;\r
-       silc_rng_init @ 672 ;\r
-       silc_pkcs_silc_decode_identifier @ 673 ;\r
-       silc_pkcs_silc_decrypt @ 674 ;\r
-       silc_pkcs_silc_encode_identifier @ 675 ;\r
-       silc_pkcs_silc_encrypt @ 676 ;\r
-       silc_pkcs_silc_export_private_key @ 677 ;\r
-       silc_pkcs_silc_export_private_key_file @ 678 ;\r
-       silc_pkcs_silc_export_public_key @ 679 ;\r
-       silc_pkcs_silc_export_public_key_file @ 680 ;\r
-       silc_pkcs_silc_generate_key @ 681 ;\r
-       silc_pkcs_silc_get_algorithm @ 682 ;\r
-       silc_pkcs_silc_import_private_key @ 683 ;\r
-       silc_pkcs_silc_import_private_key_file @ 684 ;\r
-       silc_pkcs_silc_import_public_key @ 685 ;\r
-       silc_pkcs_silc_import_public_key_file @ 686 ;\r
-       silc_pkcs_silc_private_key_bitlen @ 687 ;\r
-       silc_pkcs_silc_private_key_free @ 688 ;\r
-       silc_pkcs_silc_public_key_bitlen @ 689 ;\r
-       silc_pkcs_silc_public_key_compare @ 690 ;\r
-       silc_pkcs_silc_public_key_copy @ 691 ;\r
-       silc_pkcs_silc_public_key_free @ 692 ;\r
-       silc_pkcs_silc_public_key_version @ 693 ;\r
-       silc_pkcs_silc_sign @ 694 ;\r
-       silc_pkcs_silc_verify @ 695 ;\r
-       silc_skr_add_public_key @ 696 ;\r
-       silc_skr_add_public_key_simple @ 697 ;\r
-       silc_skr_alloc @ 698 ;\r
-       silc_skr_del_public_key @ 699 ;\r
-       silc_skr_find @ 700 ;\r
-       silc_skr_find_alloc @ 701 ;\r
-       silc_skr_find_free @ 702 ;\r
-       silc_skr_find_set_context @ 703 ;\r
-       silc_skr_find_set_country @ 704 ;\r
-       silc_skr_find_set_email @ 705 ;\r
-       silc_skr_find_set_host @ 706 ;\r
-       silc_skr_find_set_org @ 707 ;\r
-       silc_skr_find_set_pkcs_type @ 708 ;\r
-       silc_skr_find_set_public_key @ 709 ;\r
-       silc_skr_find_set_realname @ 710 ;\r
-       silc_skr_find_set_usage @ 711 ;\r
-       silc_skr_find_set_username @ 712 ;\r
-       silc_skr_free @ 713 ;\r
-       silc_skr_init @ 714 ;\r
-       silc_skr_ref_public_key @ 715 ;\r
-       silc_skr_uninit @ 716 ;\r
-       silc_skr_unref_public_key @ 717 ;\r
-       silc_mp_abs @ 718 ;\r
-       silc_mp_add @ 719 ;\r
-       silc_mp_add_ui @ 720 ;\r
-       silc_mp_and @ 721 ;\r
-       silc_mp_cmp @ 722 ;\r
-       silc_mp_cmp_si @ 723 ;\r
-       silc_mp_cmp_ui @ 724 ;\r
-       silc_mp_div @ 725 ;\r
-       silc_mp_div_2exp @ 726 ;\r
-       silc_mp_div_2exp_qr @ 727 ;\r
-       silc_mp_div_qr @ 728 ;\r
-       silc_mp_div_ui @ 729 ;\r
-       silc_mp_gcd @ 730 ;\r
-       silc_mp_gcdext @ 731 ;\r
-       silc_mp_get_str @ 732 ;\r
-       silc_mp_get_ui @ 733 ;\r
-       silc_mp_init @ 734 ;\r
-       silc_mp_mod @ 735 ;\r
-       silc_mp_mod_2exp @ 736 ;\r
-       silc_mp_mod_ui @ 737 ;\r
-       silc_mp_mul @ 738 ;\r
-       silc_mp_mul_2exp @ 739 ;\r
-       silc_mp_mul_ui @ 740 ;\r
-       silc_mp_neg @ 741 ;\r
-       silc_mp_or @ 742 ;\r
-       silc_mp_pow @ 743 ;\r
-       silc_mp_pow_mod @ 744 ;\r
-       silc_mp_pow_mod_ui @ 745 ;\r
-       silc_mp_pow_ui @ 746 ;\r
-       silc_mp_set @ 747 ;\r
-       silc_mp_set_si @ 748 ;\r
-       silc_mp_set_str @ 749 ;\r
-       silc_mp_set_ui @ 750 ;\r
-       silc_mp_sinit @ 751 ;\r
-       silc_mp_size @ 752 ;\r
-       silc_mp_sizeinbase @ 753 ;\r
-       silc_mp_sqrt @ 754 ;\r
-       silc_mp_sub @ 755 ;\r
-       silc_mp_sub_ui @ 756 ;\r
-       silc_mp_uninit @ 757 ;\r
-       silc_mp_xor @ 758 ;\r
-       silc_math_gen_prime @ 759 ;\r
-       silc_math_prime_test @ 760 ;\r
-       silc_mp_bin2mp @ 761 ;\r
-       silc_mp_mp2bin @ 762 ;\r
-       silc_mp_mp2bin_noalloc @ 763 ;\r
-       silc_mp_modinv @ 764 ;\r
-       silc_asn1_encode @ 772 ;\r
-       silc_asn1_alloc @ 773 ;\r
-       silc_asn1_free @ 775 ;\r
-       silc_asn1_init @ 776 ;\r
-       silc_asn1_uninit @ 778 ;\r
-       silc_asn1_decode @ 779 ;\r
-       silc_ber_decode @ 780 ;\r
-       silc_ber_encode @ 781 ;\r
-       silc_ber_encoded_len @ 782 ;\r
-       silc_connauth_alloc @ 783 ;\r
-       silc_connauth_free @ 784 ;\r
-       silc_connauth_get_ske @ 785 ;\r
-       silc_connauth_initiator @ 786 ;\r
-       silc_connauth_responder @ 787 ;\r
-       silc_connauth_timeout @ 788 ;\r
-       silc_ske_alloc @ 789 ;\r
-       silc_ske_free @ 790 ;\r
-       silc_ske_free_key_material @ 791 ;\r
-       silc_ske_free_rekey_material @ 792 ;\r
-       silc_ske_get_context @ 793 ;\r
-       silc_ske_get_key_material @ 794 ;\r
-       silc_ske_get_security_properties @ 795 ;\r
-       silc_ske_initiator @ 796 ;\r
-       silc_ske_map_status @ 797 ;\r
-       silc_ske_packet_send_retry @ 798 ;\r
-       silc_ske_parse_version @ 799 ;\r
-       silc_ske_process_key_material @ 800 ;\r
-       silc_ske_process_key_material_data @ 801 ;\r
-       silc_ske_rekey_initiator @ 802 ;\r
-       silc_ske_rekey_responder @ 803 ;\r
-       silc_ske_responder @ 804 ;\r
-       silc_ske_set_callbacks @ 805 ;\r
-       silc_ske_set_keys @ 806 ;\r
-       silc_ske_payload_ke_decode @ 807 ;\r
-       silc_ske_payload_ke_encode @ 808 ;\r
-       silc_ske_payload_ke_free @ 809 ;\r
-       silc_ske_payload_start_decode @ 810 ;\r
-       silc_ske_payload_start_encode @ 811 ;\r
-       silc_ske_payload_start_free @ 812 ;\r
-       silc_ske_get_supported_groups @ 813 ;\r
-       silc_ske_group_free @ 814 ;\r
-       silc_ske_group_get_by_name @ 815 ;\r
-       silc_ske_group_get_by_number @ 816 ;\r
-       silc_ske_group_get_name @ 817 ;\r
-       silc_ske_group_get_number @ 818 ;\r
-       silc_http_php @ 819 ;\r
-       silc_http_php_file @ 820 ;\r
-       silc_http_server_add_header @ 821 ;\r
-       silc_http_server_alloc @ 822 ;\r
-       silc_http_server_free @ 823 ;\r
-       silc_http_server_get_header @ 824 ;\r
-       silc_http_server_send @ 825 ;\r
-       silc_http_server_send_error @ 826 ;\r
-       silc_sftp_fs_memory_add_dir @ 827 ;\r
-       silc_sftp_fs_memory_add_file @ 828 ;\r
-       silc_sftp_fs_memory_alloc @ 829 ;\r
-       silc_sftp_fs_memory_del_dir @ 830 ;\r
-       silc_sftp_fs_memory_del_file @ 831 ;\r
-       silc_sftp_fs_memory_free @ 832 ;\r
-       silc_sftp_attr_decode @ 833 ;\r
-       silc_sftp_attr_encode @ 834 ;\r
-       silc_sftp_attr_free @ 835 ;\r
-       silc_sftp_map_errno @ 836 ;\r
-       silc_sftp_name_add @ 837 ;\r
-       silc_sftp_name_decode @ 838 ;\r
-       silc_sftp_name_encode @ 839 ;\r
-       silc_sftp_name_free @ 840 ;\r
-       silc_sftp_packet_decode @ 841 ;\r
-       silc_sftp_packet_encode @ 842 ;\r
-       silc_sftp_packet_encode_vp @ 843 ;\r
-       silc_sftp_client_shutdown @ 844 ;\r
-       silc_sftp_client_start @ 845 ;\r
-       silc_sftp_close @ 846 ;\r
-       silc_sftp_extended @ 847 ;\r
-       silc_sftp_fsetstat @ 848 ;\r
-       silc_sftp_fstat @ 849 ;\r
-       silc_sftp_lstat @ 850 ;\r
-       silc_sftp_mkdir @ 851 ;\r
-       silc_sftp_open @ 852 ;\r
-       silc_sftp_opendir @ 853 ;\r
-       silc_sftp_read @ 854 ;\r
-       silc_sftp_readdir @ 855 ;\r
-       silc_sftp_readlink @ 856 ;\r
-       silc_sftp_realpath @ 857 ;\r
-       silc_sftp_remove @ 858 ;\r
-       silc_sftp_rename @ 859 ;\r
-       silc_sftp_rmdir @ 860 ;\r
-       silc_sftp_setstat @ 861 ;\r
-       silc_sftp_stat @ 862 ;\r
-       silc_sftp_symlink @ 863 ;\r
-       silc_sftp_write @ 864 ;\r
-       silc_sftp_server_set_monitor @ 865 ;\r
-       silc_sftp_server_shutdown @ 866 ;\r
-       silc_sftp_server_start @ 867 ;\r
-       silc_vcard_alloc @ 868 ;\r
-       silc_vcard_decode @ 869 ;\r
-       silc_vcard_encode @ 870 ;\r
-       silc_vcard_fprintf @ 871 ;\r
-       silc_vcard_free @ 872 ;\r
-       silc_utf8_c2w @ 873 ;\r
-       silc_utf8_w2c @ 874 ;\r
-       silc_packet_engine_free_streams_list @ 875 ;\r
-       silc_schedule_set_notify @ 876 ;\r
-\r
+EXPORTS
+       silc_argument_get_arg_num @ 1 ;
+       silc_argument_get_arg_type @ 2 ;
+       silc_argument_get_decoded @ 3 ;
+       silc_argument_get_first_arg @ 4 ;
+       silc_argument_get_next_arg @ 5 ;
+       silc_argument_list_free @ 6 ;
+       silc_argument_list_parse @ 7 ;
+       silc_argument_list_parse_decoded @ 8 ;
+       silc_argument_payload_encode @ 9 ;
+       silc_argument_payload_encode_one @ 10 ;
+       silc_argument_payload_encode_payload @ 11 ;
+       silc_argument_payload_free @ 12 ;
+       silc_argument_payload_parse @ 13 ;
+       silc_command_get @ 14 ;
+       silc_command_get_args @ 15 ;
+       silc_command_get_ident @ 16 ;
+       silc_command_get_status @ 17 ;
+       silc_command_payload_encode @ 18 ;
+       silc_command_payload_encode_payload @ 19 ;
+       silc_command_payload_encode_va @ 20 ;
+       silc_command_payload_encode_vap @ 21 ;
+       silc_command_payload_free @ 22 ;
+       silc_command_payload_parse @ 23 ;
+       silc_command_reply_payload_encode_va @ 24 ;
+       silc_command_reply_payload_encode_vap @ 25 ;
+       silc_command_set_command @ 26 ;
+       silc_command_set_ident @ 27 ;
+       silc_auth_get_data @ 28 ;
+       silc_auth_get_method @ 29 ;
+       silc_auth_get_public_data @ 30 ;
+       silc_auth_payload_encode @ 31 ;
+       silc_auth_payload_free @ 32 ;
+       silc_auth_payload_parse @ 33 ;
+       silc_auth_public_key_auth_generate @ 34 ;
+       silc_auth_public_key_auth_generate_wpub @ 35 ;
+       silc_auth_public_key_auth_verify @ 36 ;
+       silc_auth_public_key_auth_verify_data @ 37 ;
+       silc_auth_verify @ 38 ;
+       silc_auth_verify_data @ 39 ;
+       silc_key_agreement_get_hostname @ 40 ;
+       silc_key_agreement_get_port @ 41 ;
+       silc_key_agreement_get_protocol @ 42 ;
+       silc_key_agreement_payload_encode @ 43 ;
+       silc_key_agreement_payload_free @ 44 ;
+       silc_key_agreement_payload_parse @ 45 ;
+       silc_id_dup @ 46 ;
+       silc_id_get_len @ 47 ;
+       silc_id_id2str @ 48 ;
+       silc_id_payload_encode @ 49 ;
+       silc_id_payload_encode_data @ 50 ;
+       silc_id_payload_free @ 51 ;
+       silc_id_payload_get_data @ 52 ;
+       silc_id_payload_get_id @ 53 ;
+       silc_id_payload_get_len @ 54 ;
+       silc_id_payload_get_type @ 55 ;
+       silc_id_payload_parse @ 56 ;
+       silc_id_payload_parse_id @ 57 ;
+       silc_id_str2id @ 58 ;
+       silc_id_str2id2 @ 59 ;
+       silc_attribute_get_attribute @ 60 ;
+       silc_attribute_get_data @ 61 ;
+       silc_attribute_get_flags @ 62 ;
+       silc_attribute_get_object @ 63 ;
+       silc_attribute_get_verify_data @ 64 ;
+       silc_attribute_payload_alloc @ 65 ;
+       silc_attribute_payload_encode @ 66 ;
+       silc_attribute_payload_encode_data @ 67 ;
+       silc_attribute_payload_free @ 68 ;
+       silc_attribute_payload_list_free @ 69 ;
+       silc_attribute_payload_parse @ 70 ;
+       silc_channel_get_id @ 71 ;
+       silc_channel_get_id_parse @ 72 ;
+       silc_channel_get_mode @ 73 ;
+       silc_channel_get_name @ 74 ;
+       silc_channel_key_get_cipher @ 75 ;
+       silc_channel_key_get_id @ 76 ;
+       silc_channel_key_get_key @ 77 ;
+       silc_channel_key_payload_encode @ 78 ;
+       silc_channel_key_payload_free @ 79 ;
+       silc_channel_key_payload_parse @ 80 ;
+       silc_channel_payload_encode @ 81 ;
+       silc_channel_payload_free @ 82 ;
+       silc_channel_payload_list_free @ 83 ;
+       silc_channel_payload_parse @ 84 ;
+       silc_channel_payload_parse_list @ 85 ;
+       silc_packet_engine_get_streams @ 86 ;
+       silc_packet_engine_start @ 87 ;
+       silc_packet_engine_stop @ 88 ;
+       silc_packet_error_string @ 89 ;
+       silc_packet_free @ 90 ;
+       silc_packet_get_context @ 91 ;
+       silc_packet_get_engine @ 92 ;
+       silc_packet_get_ids @ 93 ;
+       silc_packet_get_keys @ 94 ;
+       silc_packet_get_sender @ 95 ;
+       silc_packet_send @ 96 ;
+       silc_packet_send_ext @ 97 ;
+       silc_packet_send_va @ 98 ;
+       silc_packet_send_va_ext @ 99 ;
+       silc_packet_set_context @ 100 ;
+       silc_packet_set_ids @ 101 ;
+       silc_packet_set_keys @ 102 ;
+       silc_packet_set_sid @ 103 ;
+       silc_packet_stream_add_remote @ 104 ;
+       silc_packet_stream_create @ 105 ;
+       silc_packet_stream_destroy @ 106 ;
+       silc_packet_stream_get_stream @ 107 ;
+       silc_packet_stream_inject_packet @ 108 ;
+       silc_packet_stream_is_udp @ 109 ;
+       silc_packet_stream_is_valid @ 110 ;
+       silc_packet_stream_link @ 111 ;
+       silc_packet_stream_ref @ 112 ;
+       silc_packet_stream_set_iv_included @ 113 ;
+       silc_packet_stream_set_router @ 114 ;
+       silc_packet_stream_set_stream @ 115 ;
+       silc_packet_stream_unlink @ 116 ;
+       silc_packet_stream_unref @ 117 ;
+       silc_packet_stream_wrap @ 118 ;
+       silc_packet_wait @ 119 ;
+       silc_packet_wait_init @ 120 ;
+       silc_packet_wait_uninit @ 121 ;
+       silc_packet_wrap_close @ 122 ;
+       silc_packet_wrap_destroy @ 123 ;
+       silc_packet_wrap_get_schedule @ 124 ;
+       silc_packet_wrap_notifier @ 125 ;
+       silc_packet_wrap_read @ 126 ;
+       silc_packet_wrap_read_more @ 127 ;
+       silc_packet_wrap_write @ 128 ;
+       silc_notify_get_arg_num @ 129 ;
+       silc_notify_get_args @ 130 ;
+       silc_notify_get_type @ 131 ;
+       silc_notify_payload_encode @ 132 ;
+       silc_notify_payload_encode_args @ 133 ;
+       silc_notify_payload_free @ 134 ;
+       silc_notify_payload_parse @ 135 ;
+       silc_status_get_args @ 136 ;
+       silc_message_get_data @ 137 ;
+       silc_message_get_flags @ 138 ;
+       silc_message_get_mac @ 139 ;
+       silc_message_payload_decrypt @ 140 ;
+       silc_message_payload_encode @ 141 ;
+       silc_message_payload_encrypt @ 142 ;
+       silc_message_payload_free @ 143 ;
+       silc_message_payload_parse @ 144 ;
+       silc_message_signed_get_public_key @ 145 ;
+       silc_message_signed_verify @ 146 ;
+       silc_public_key_payload_decode @ 147 ;
+       silc_public_key_payload_encode @ 148 ;
+       silc_file_set_nonblock @ 149 ;
+       silc_get_real_name @ 150 ;
+       silc_get_username @ 151 ;
+       silc_gettimeofday @ 152 ;
+       silc_cond_alloc @ 153 ;
+       silc_cond_broadcast @ 154 ;
+       silc_cond_free @ 155 ;
+       silc_cond_signal @ 156 ;
+       silc_cond_timedwait @ 157 ;
+       silc_cond_wait @ 158 ;
+       silc_mutex_alloc @ 159 ;
+       silc_mutex_assert_locked @ 160 ;
+       silc_mutex_free @ 161 ;
+       silc_mutex_lock @ 162 ;
+       silc_mutex_unlock @ 163 ;
+       silc_rwlock_alloc @ 164 ;
+       silc_rwlock_free @ 165 ;
+       silc_rwlock_rdlock @ 166 ;
+       silc_rwlock_unlock @ 167 ;
+       silc_rwlock_wrlock @ 168 ;
+       silc_thread_create @ 169 ;
+       silc_thread_exit @ 170 ;
+       silc_thread_self @ 171 ;
+       silc_thread_wait @ 172 ;
+       silc_thread_yield @ 173 ;
+       silc_socket_stream_close @ 174 ;
+       silc_socket_stream_destroy @ 175 ;
+       silc_socket_stream_notifier @ 176 ;
+       silc_socket_stream_read @ 177 ;
+       silc_socket_stream_write @ 178 ;
+       silc_socket_udp_stream_read @ 179 ;
+       silc_socket_udp_stream_write @ 180 ;
+       silc_net_accept @ 181 ;
+       silc_net_addr2bin @ 182 ;
+       silc_net_close_connection @ 183 ;
+       silc_net_close_listener @ 184 ;
+       silc_net_set_socket_nonblock @ 185 ;
+       silc_net_tcp_connect @ 186 ;
+       silc_net_tcp_create_listener @ 187 ;
+       silc_net_udp_connect @ 188 ;
+       silc_net_udp_receive @ 189 ;
+       silc_net_udp_send @ 190 ;
+       silc_schedule_internal_init @ 191 ;
+       silc_schedule_internal_schedule_fd @ 192 ;
+       silc_schedule_internal_signal_register @ 193 ;
+       silc_schedule_internal_signal_unregister @ 194 ;
+       silc_schedule_internal_signals_block @ 195 ;
+       silc_schedule_internal_signals_call @ 196 ;
+       silc_schedule_internal_signals_unblock @ 197 ;
+       silc_schedule_internal_uninit @ 198 ;
+       silc_schedule_internal_wakeup @ 199 ;
+       silc_fd_stream_close @ 200 ;
+       silc_fd_stream_create @ 201 ;
+       silc_fd_stream_create2 @ 202 ;
+       silc_fd_stream_destroy @ 203 ;
+       silc_fd_stream_file @ 204 ;
+       silc_fd_stream_file2 @ 205 ;
+       silc_fd_stream_get_error @ 206 ;
+       silc_fd_stream_get_info @ 207 ;
+       silc_fd_stream_get_schedule @ 208 ;
+       silc_fd_stream_notifier @ 209 ;
+       silc_fd_stream_read @ 210 ;
+       silc_fd_stream_write @ 211 ;
+       silc_hash_table_add @ 212 ;
+       silc_hash_table_add_ext @ 213 ;
+       silc_hash_table_alloc @ 214 ;
+       silc_hash_table_count @ 215 ;
+       silc_hash_table_del @ 216 ;
+       silc_hash_table_del_by_context @ 217 ;
+       silc_hash_table_del_by_context_ext @ 218 ;
+       silc_hash_table_del_ext @ 219 ;
+       silc_hash_table_find @ 220 ;
+       silc_hash_table_find_by_context @ 221 ;
+       silc_hash_table_find_by_context_ext @ 222 ;
+       silc_hash_table_find_ext @ 223 ;
+       silc_hash_table_find_foreach @ 224 ;
+       silc_hash_table_find_foreach_ext @ 225 ;
+       silc_hash_table_foreach @ 226 ;
+       silc_hash_table_free @ 227 ;
+       silc_hash_table_get @ 228 ;
+       silc_hash_table_list @ 229 ;
+       silc_hash_table_list_reset @ 230 ;
+       silc_hash_table_rehash @ 231 ;
+       silc_hash_table_rehash_ext @ 232 ;
+       silc_hash_table_replace @ 233 ;
+       silc_hash_table_replace_ext @ 234 ;
+       silc_hash_table_size @ 235 ;
+       silc_schedule @ 236 ;
+       silc_schedule_get_context @ 237 ;
+       silc_schedule_get_fd_events @ 238 ;
+       silc_schedule_init @ 239 ;
+       silc_schedule_one @ 240 ;
+       silc_schedule_set_listen_fd @ 241 ;
+       silc_schedule_stop @ 242 ;
+       silc_schedule_task_add @ 243 ;
+       silc_schedule_task_del @ 244 ;
+       silc_schedule_task_del_by_all @ 245 ;
+       silc_schedule_task_del_by_callback @ 246 ;
+       silc_schedule_task_del_by_context @ 247 ;
+       silc_schedule_task_del_by_fd @ 248 ;
+       silc_schedule_uninit @ 249 ;
+       silc_schedule_unset_listen_fd @ 250 ;
+       silc_schedule_wakeup @ 251 ;
+       silc_calloc @ 252 ;
+       silc_free @ 253 ;
+       silc_malloc @ 254 ;
+       silc_memdup @ 255 ;
+       silc_realloc @ 256 ;
+       silc_scalloc @ 257 ;
+       silc_smalloc @ 258 ;
+       silc_smemdup @ 260 ;
+       silc_srealloc @ 261 ;
+       silc_sstrdup @ 263 ;
+       silc_config_close @ 264 ;
+       silc_config_get_filename @ 265 ;
+       silc_config_get_line @ 266 ;
+       silc_config_init @ 267 ;
+       silc_config_main @ 268 ;
+       silc_config_open @ 269 ;
+       silc_config_read_current_line @ 270 ;
+       silc_config_read_line @ 271 ;
+       silc_config_register @ 272 ;
+       silc_config_register_table @ 273 ;
+       silc_config_strerror @ 274 ;
+       silc_log_debug @ 275 ;
+       silc_log_debug_hexdump @ 276 ;
+       silc_log_fflush_callback @ 277 ;
+       silc_log_flush_all @ 278 ;
+       silc_log_flushdelay @ 279 ;
+       silc_log_get_file @ 280 ;
+       silc_log_output @ 281 ;
+       silc_log_output_debug @ 282 ;
+       silc_log_output_hexdump @ 283 ;
+       silc_log_quick @ 284 ;
+       silc_log_reset_all @ 285 ;
+       silc_log_reset_callbacks @ 286 ;
+       silc_log_reset_debug_callbacks @ 287 ;
+       silc_log_set_callback @ 288 ;
+       silc_log_set_debug_callbacks @ 289 ;
+       silc_log_set_debug_string @ 290 ;
+       silc_log_set_file @ 291 ;
+       silc_log_timestamp @ 292 ;
+       silc_net_accept_connection @ 293 ;
+       silc_net_check_host_by_sock @ 294 ;
+       silc_net_check_local_by_sock @ 295 ;
+       silc_net_get_error_string @ 296 ;
+       silc_net_get_local_port @ 297 ;
+       silc_net_get_remote_port @ 298 ;
+       silc_net_get_socket_opt @ 299 ;
+       silc_net_gethostbyaddr @ 300 ;
+       silc_net_gethostbyaddr_async @ 301 ;
+       silc_net_gethostbyname @ 302 ;
+       silc_net_gethostbyname_async @ 303 ;
+       silc_net_is_ip @ 304 ;
+       silc_net_is_ip4 @ 305 ;
+       silc_net_is_ip6 @ 306 ;
+       silc_net_listener_get_hostname @ 307 ;
+       silc_net_listener_get_ip @ 308 ;
+       silc_net_listener_get_port @ 309 ;
+       silc_net_localhost @ 310 ;
+       silc_net_localip @ 311 ;
+       silc_net_resolve_completion @ 312 ;
+       silc_net_set_socket_opt @ 313 ;
+       silc_stringprep @ 314 ;
+       silc_socket_host_lookup_finish @ 315 ;
+       silc_socket_stream_get_error @ 316 ;
+       silc_socket_stream_get_info @ 317 ;
+       silc_socket_stream_get_schedule @ 318 ;
+       silc_socket_stream_is_udp @ 319 ;
+       silc_socket_stream_set_info @ 320 ;
+       silc_socket_stream_set_qos @ 321 ;
+       silc_socket_tcp_stream_create @ 322 ;
+       silc_socket_udp_stream_create @ 323 ;
+       silc_compare_timeval @ 324 ;
+       silc_time @ 325 ;
+       silc_time_generalized @ 326 ;
+       silc_time_generalized_string @ 327 ;
+       silc_time_msec @ 328 ;
+       silc_time_string @ 329 ;
+       silc_time_universal @ 330 ;
+       silc_time_universal_string @ 331 ;
+       silc_time_usec @ 332 ;
+       silc_time_value @ 333 ;
+       silc_timezone @ 334 ;
+       silc_file_close @ 335 ;
+       silc_file_open @ 336 ;
+       silc_file_open_mode @ 337 ;
+       silc_file_read @ 338 ;
+       silc_file_readfile @ 339 ;
+       silc_file_size @ 340 ;
+       silc_file_write @ 341 ;
+       silc_file_writefile @ 342 ;
+       silc_file_writefile_mode @ 343 ;
+       silc_fingerprint @ 345 ;
+       silc_format @ 346 ;
+       silc_get_input @ 347 ;
+       silc_gets @ 348 ;
+       silc_hash_client_id_compare @ 349 ;
+       silc_hash_client_id_hash @ 350 ;
+       silc_hash_data @ 351 ;
+       silc_hash_data_compare @ 352 ;
+       silc_hash_id @ 353 ;
+       silc_hash_id_compare @ 354 ;
+       silc_hash_id_compare_full @ 355 ;
+       silc_hash_ptr @ 356 ;
+       silc_hash_public_key @ 357 ;
+       silc_hash_public_key_compare @ 358 ;
+       silc_hash_string @ 359 ;
+       silc_hash_string_compare @ 360 ;
+       silc_hash_uint @ 361 ;
+       silc_hash_utf8_compare @ 362 ;
+       silc_hash_utf8_string @ 363 ;
+       silc_parse_command_line @ 364 ;
+       silc_parse_userfqdn @ 365 ;
+       silc_string_is_ascii @ 366 ;
+       silc_to_lower @ 367 ;
+       silc_to_upper @ 368 ;
+       silc_utf8_decode @ 369 ;
+       silc_utf8_decoded_len @ 370 ;
+       silc_utf8_encode @ 371 ;
+       silc_utf8_encoded_len @ 372 ;
+       silc_utf8_strcasecmp @ 373 ;
+       silc_utf8_strncasecmp @ 374 ;
+       silc_utf8_valid @ 375 ;
+       silc_base64_decode @ 376 ;
+       silc_base64_encode @ 377 ;
+       silc_base64_encode_file @ 378 ;
+       silc_string_compare @ 379 ;
+       silc_string_match @ 380 ;
+       silc_string_regex_combine @ 381 ;
+       silc_string_regex_match @ 382 ;
+       silc_string_regexify @ 383 ;
+       silc_string_split @ 384 ;
+       silc_strncat @ 385 ;
+       silc_fsm_alloc @ 386 ;
+       silc_fsm_continue @ 387 ;
+       silc_fsm_continue_sync @ 388 ;
+       silc_fsm_event_alloc @ 389 ;
+       silc_fsm_event_free @ 390 ;
+       silc_fsm_event_init @ 391 ;
+       silc_fsm_event_signal @ 392 ;
+       silc_fsm_event_timedwait @ 393 ;
+       silc_fsm_event_wait @ 394 ;
+       silc_fsm_finish @ 395 ;
+       silc_fsm_free @ 396 ;
+       silc_fsm_get_context @ 397 ;
+       silc_fsm_get_machine @ 398 ;
+       silc_fsm_get_schedule @ 399 ;
+       silc_fsm_get_state_context @ 400 ;
+       silc_fsm_init @ 401 ;
+       silc_fsm_is_started @ 402 ;
+       silc_fsm_next @ 403 ;
+       silc_fsm_next_later @ 404 ;
+       silc_fsm_set_context @ 405 ;
+       silc_fsm_set_state_context @ 406 ;
+       silc_fsm_signal @ 407 ;
+       silc_fsm_start @ 408 ;
+       silc_fsm_start_sync @ 409 ;
+       silc_fsm_thread @ 410 ;
+       silc_fsm_thread_alloc @ 411 ;
+       silc_fsm_thread_init @ 412 ;
+       silc_fsm_thread_wait @ 413 ;
+       silc_buffer_format @ 414 ;
+       silc_buffer_format_vp @ 415 ;
+       silc_buffer_sformat @ 416 ;
+       silc_buffer_sformat_vp @ 417 ;
+       silc_buffer_sstrformat @ 418 ;
+       silc_buffer_strformat @ 419 ;
+       silc_buffer_sunformat @ 420 ;
+       silc_buffer_sunformat_vp @ 421 ;
+       silc_buffer_unformat @ 422 ;
+       silc_buffer_unformat_vp @ 423 ;
+       silc_stream_close @ 424 ;
+       silc_stream_destroy @ 425 ;
+       silc_stream_get_schedule @ 426 ;
+       silc_stream_read @ 427 ;
+       silc_stream_set_notifier @ 428 ;
+       silc_stream_write @ 429 ;
+       silc_async_abort @ 430 ;
+       silc_async_alloc @ 431 ;
+       silc_async_free @ 432 ;
+       silc_async_get_context @ 433 ;
+       silc_async_halt @ 434 ;
+       silc_async_init @ 435 ;
+       silc_async_resume @ 436 ;
+       silc_asprintf @ 437 ;
+       silc_snprintf @ 438 ;
+       silc_vasprintf @ 439 ;
+       silc_vsnprintf @ 440 ;
+       silc_mime_add_data @ 441 ;
+       silc_mime_add_field @ 442 ;
+       silc_mime_add_multipart @ 443 ;
+       silc_mime_alloc @ 444 ;
+       silc_mime_assemble @ 445 ;
+       silc_mime_assembler_alloc @ 446 ;
+       silc_mime_assembler_free @ 447 ;
+       silc_mime_decode @ 448 ;
+       silc_mime_encode @ 449 ;
+       silc_mime_encode_partial @ 450 ;
+       silc_mime_free @ 451 ;
+       silc_mime_get_data @ 452 ;
+       silc_mime_get_field @ 453 ;
+       silc_mime_get_multiparts @ 454 ;
+       silc_mime_is_multipart @ 455 ;
+       silc_mime_is_partial @ 456 ;
+       silc_mime_partial_free @ 457 ;
+       silc_mime_set_multipart @ 458 ;
+       silc_mime_steal_data @ 459 ;
+       silc_idcache_add @ 460 ;
+       silc_idcache_alloc @ 461 ;
+       silc_idcache_del @ 462 ;
+       silc_idcache_del_by_context @ 463 ;
+       silc_idcache_del_by_id @ 464 ;
+       silc_idcache_find_by_context @ 465 ;
+       silc_idcache_find_by_id @ 466 ;
+       silc_idcache_find_by_id_one @ 467 ;
+       silc_idcache_find_by_name @ 468 ;
+       silc_idcache_find_by_name_one @ 469 ;
+       silc_idcache_free @ 470 ;
+       silc_idcache_get_all @ 471 ;
+       silc_idcache_update @ 472 ;
+       silc_idcache_update_by_context @ 473 ;
+       silc_change_private_key_passphrase @ 474 ;
+       silc_channel_name_check @ 475 ;
+       silc_channel_name_verify @ 476 ;
+       silc_client_chmode @ 477 ;
+       silc_client_chumode @ 478 ;
+       silc_client_chumode_char @ 479 ;
+       silc_create_key_pair @ 480 ;
+       silc_get_command_name @ 481 ;
+       silc_get_mode_list @ 482 ;
+       silc_get_packet_name @ 483 ;
+       silc_get_status_message @ 484 ;
+       silc_id_render @ 485 ;
+       silc_identifier_check @ 486 ;
+       silc_identifier_verify @ 487 ;
+       silc_load_key_pair @ 488 ;
+       silc_parse_version_string @ 489 ;
+       silc_show_public_key @ 490 ;
+       silc_show_public_key_file @ 491 ;
+       silc_version_to_num @ 492 ;
+       silc_sha256_context_len @ 498 ;
+       silc_sha256_final @ 499 ;
+       silc_sha256_init @ 500 ;
+       silc_sha256_transform @ 501 ;
+       silc_sha256_update @ 502 ;
+       silc_none_context_len @ 503 ;
+       silc_none_decrypt @ 504 ;
+       silc_none_encrypt @ 505 ;
+       silc_none_set_iv @ 506 ;
+       silc_none_set_key @ 507 ;
+       silc_sha1_context_len @ 508 ;
+       silc_sha1_final @ 509 ;
+       silc_sha1_init @ 510 ;
+       silc_sha1_transform @ 511 ;
+       silc_sha1_update @ 512 ;
+       silc_pkcs_algorithm_register @ 513 ;
+       silc_pkcs_algorithm_unregister @ 514 ;
+       silc_pkcs_decrypt @ 515 ;
+       silc_pkcs_encrypt @ 516 ;
+       silc_pkcs_find_algorithm @ 517 ;
+       silc_pkcs_find_pkcs @ 518 ;
+       silc_pkcs_get_algorithm @ 519 ;
+       silc_pkcs_get_context @ 520 ;
+       silc_pkcs_get_name @ 521 ;
+       silc_pkcs_get_pkcs @ 522 ;
+       silc_pkcs_get_supported @ 523 ;
+       silc_pkcs_get_type @ 524 ;
+       silc_pkcs_load_private_key @ 525 ;
+       silc_pkcs_load_public_key @ 526 ;
+       silc_pkcs_private_key_alloc @ 527 ;
+       silc_pkcs_private_key_free @ 528 ;
+       silc_pkcs_private_key_get_len @ 529 ;
+       silc_pkcs_public_key_alloc @ 530 ;
+       silc_pkcs_public_key_compare @ 531 ;
+       silc_pkcs_public_key_copy @ 532 ;
+       silc_pkcs_public_key_encode @ 533 ;
+       silc_pkcs_public_key_free @ 534 ;
+       silc_pkcs_public_key_get_len @ 535 ;
+       silc_pkcs_register @ 536 ;
+       silc_pkcs_register_default @ 537 ;
+       silc_pkcs_save_private_key @ 538 ;
+       silc_pkcs_save_public_key @ 539 ;
+       silc_pkcs_sign @ 540 ;
+       silc_pkcs_unregister @ 541 ;
+       silc_pkcs_unregister_all @ 542 ;
+       silc_pkcs_verify @ 543 ;
+       silc_hash_alloc @ 544 ;
+       silc_hash_alloc_by_oid @ 545 ;
+       silc_hash_babbleprint @ 546 ;
+       silc_hash_block_len @ 547 ;
+       silc_hash_final @ 548 ;
+       silc_hash_fingerprint @ 549 ;
+       silc_hash_free @ 550 ;
+       silc_hash_get_name @ 551 ;
+       silc_hash_get_oid @ 552 ;
+       silc_hash_get_supported @ 553 ;
+       silc_hash_init @ 554 ;
+       silc_hash_is_supported @ 555 ;
+       silc_hash_len @ 556 ;
+       silc_hash_make @ 557 ;
+       silc_hash_register @ 558 ;
+       silc_hash_register_default @ 559 ;
+       silc_hash_transform @ 560 ;
+       silc_hash_unregister @ 561 ;
+       silc_hash_unregister_all @ 562 ;
+       silc_hash_update @ 563 ;
+       silc_aes_cbc_context_len @ 564 ;
+       silc_aes_cbc_decrypt @ 565 ;
+       silc_aes_cbc_encrypt @ 566 ;
+       silc_aes_cbc_set_iv @ 567 ;
+       silc_aes_cbc_set_key @ 568 ;
+       silc_aes_ctr_context_len @ 569 ;
+       silc_aes_ctr_decrypt @ 570 ;
+       silc_aes_ctr_encrypt @ 571 ;
+       silc_aes_ctr_set_iv @ 572 ;
+       silc_aes_ctr_set_key @ 573 ;
+       silc_pkcs1_decode @ 574 ;
+       silc_pkcs1_decrypt @ 575 ;
+       silc_pkcs1_encode @ 576 ;
+       silc_pkcs1_encrypt @ 577 ;
+       silc_pkcs1_export_private_key @ 578 ;
+       silc_pkcs1_export_public_key @ 579 ;
+       silc_pkcs1_generate_key @ 580 ;
+       silc_pkcs1_import_private_key @ 581 ;
+       silc_pkcs1_import_public_key @ 582 ;
+       silc_pkcs1_private_key_bitlen @ 583 ;
+       silc_pkcs1_private_key_free @ 584 ;
+       silc_pkcs1_public_key_bitlen @ 585 ;
+       silc_pkcs1_public_key_compare @ 586 ;
+       silc_pkcs1_public_key_copy @ 587 ;
+       silc_pkcs1_public_key_free @ 588 ;
+       silc_pkcs1_sign @ 589 ;
+       silc_pkcs1_sign_no_oid @ 590 ;
+       silc_pkcs1_verify @ 591 ;
+       silc_pkcs1_verify_no_oid @ 592 ;
+       silc_cipher_alloc @ 598 ;
+       silc_cipher_decrypt @ 599 ;
+       silc_cipher_encrypt @ 600 ;
+       silc_cipher_free @ 601 ;
+       silc_cipher_get_block_len @ 602 ;
+       silc_cipher_get_iv @ 603 ;
+       silc_cipher_get_iv_len @ 604 ;
+       silc_cipher_get_key_len @ 605 ;
+       silc_cipher_get_mode @ 606 ;
+       silc_cipher_get_name @ 607 ;
+       silc_cipher_get_supported @ 608 ;
+       silc_cipher_is_supported @ 609 ;
+       silc_cipher_register @ 610 ;
+       silc_cipher_register_default @ 611 ;
+       silc_cipher_set_iv @ 612 ;
+       silc_cipher_set_key @ 613 ;
+       silc_cipher_unregister @ 614 ;
+       silc_cipher_unregister_all @ 615 ;
+       silc_md5_context_len @ 616 ;
+       silc_md5_final @ 617 ;
+       silc_md5_init @ 618 ;
+       silc_md5_transform @ 619 ;
+       silc_md5_update @ 620 ;
+       silc_rsa_generate_keys @ 621 ;
+       silc_rsa_private_operation @ 622 ;
+       silc_rsa_public_operation @ 623 ;
+       silc_blowfish_cbc_context_len @ 624 ;
+       silc_blowfish_cbc_decrypt @ 625 ;
+       silc_blowfish_cbc_encrypt @ 626 ;
+       silc_blowfish_cbc_set_iv @ 627 ;
+       silc_blowfish_cbc_set_key @ 628 ;
+       silc_twofish_cbc_context_len @ 629 ;
+       silc_twofish_cbc_decrypt @ 630 ;
+       silc_twofish_cbc_encrypt @ 631 ;
+       silc_twofish_cbc_set_iv @ 632 ;
+       silc_twofish_cbc_set_key @ 633 ;
+       silc_hmac_alloc @ 634 ;
+       silc_hmac_final @ 635 ;
+       silc_hmac_free @ 636 ;
+       silc_hmac_get_hash @ 637 ;
+       silc_hmac_get_key @ 638 ;
+       silc_hmac_get_name @ 639 ;
+       silc_hmac_get_supported @ 640 ;
+       silc_hmac_init @ 641 ;
+       silc_hmac_init_with_key @ 642 ;
+       silc_hmac_is_supported @ 643 ;
+       silc_hmac_len @ 644 ;
+       silc_hmac_make @ 645 ;
+       silc_hmac_make_truncated @ 646 ;
+       silc_hmac_make_with_key @ 647 ;
+       silc_hmac_register @ 648 ;
+       silc_hmac_register_default @ 649 ;
+       silc_hmac_set_key @ 650 ;
+       silc_hmac_unregister @ 651 ;
+       silc_hmac_unregister_all @ 652 ;
+       silc_hmac_update @ 653 ;
+       silc_rng_add_noise @ 654 ;
+       silc_rng_alloc @ 655 ;
+       silc_rng_free @ 656 ;
+       silc_rng_get_byte @ 657 ;
+       silc_rng_get_byte_fast @ 658 ;
+       silc_rng_get_rn16 @ 659 ;
+       silc_rng_get_rn32 @ 660 ;
+       silc_rng_get_rn_data @ 661 ;
+       silc_rng_get_rn_string @ 662 ;
+       silc_rng_global_add_noise @ 663 ;
+       silc_rng_global_get_byte @ 664 ;
+       silc_rng_global_get_byte_fast @ 665 ;
+       silc_rng_global_get_rn16 @ 666 ;
+       silc_rng_global_get_rn32 @ 667 ;
+       silc_rng_global_get_rn_data @ 668 ;
+       silc_rng_global_get_rn_string @ 669 ;
+       silc_rng_global_init @ 670 ;
+       silc_rng_global_uninit @ 671 ;
+       silc_rng_init @ 672 ;
+       silc_pkcs_silc_decode_identifier @ 673 ;
+       silc_pkcs_silc_decrypt @ 674 ;
+       silc_pkcs_silc_encode_identifier @ 675 ;
+       silc_pkcs_silc_encrypt @ 676 ;
+       silc_pkcs_silc_export_private_key @ 677 ;
+       silc_pkcs_silc_export_private_key_file @ 678 ;
+       silc_pkcs_silc_export_public_key @ 679 ;
+       silc_pkcs_silc_export_public_key_file @ 680 ;
+       silc_pkcs_silc_generate_key @ 681 ;
+       silc_pkcs_silc_get_algorithm @ 682 ;
+       silc_pkcs_silc_import_private_key @ 683 ;
+       silc_pkcs_silc_import_private_key_file @ 684 ;
+       silc_pkcs_silc_import_public_key @ 685 ;
+       silc_pkcs_silc_import_public_key_file @ 686 ;
+       silc_pkcs_silc_private_key_bitlen @ 687 ;
+       silc_pkcs_silc_private_key_free @ 688 ;
+       silc_pkcs_silc_public_key_bitlen @ 689 ;
+       silc_pkcs_silc_public_key_compare @ 690 ;
+       silc_pkcs_silc_public_key_copy @ 691 ;
+       silc_pkcs_silc_public_key_free @ 692 ;
+       silc_pkcs_silc_public_key_version @ 693 ;
+       silc_pkcs_silc_sign @ 694 ;
+       silc_pkcs_silc_verify @ 695 ;
+       silc_skr_add_public_key @ 696 ;
+       silc_skr_add_public_key_simple @ 697 ;
+       silc_skr_alloc @ 698 ;
+       silc_skr_del_public_key @ 699 ;
+       silc_skr_find @ 700 ;
+       silc_skr_find_alloc @ 701 ;
+       silc_skr_find_free @ 702 ;
+       silc_skr_find_set_context @ 703 ;
+       silc_skr_find_set_country @ 704 ;
+       silc_skr_find_set_email @ 705 ;
+       silc_skr_find_set_host @ 706 ;
+       silc_skr_find_set_org @ 707 ;
+       silc_skr_find_set_pkcs_type @ 708 ;
+       silc_skr_find_set_public_key @ 709 ;
+       silc_skr_find_set_realname @ 710 ;
+       silc_skr_find_set_usage @ 711 ;
+       silc_skr_find_set_username @ 712 ;
+       silc_skr_free @ 713 ;
+       silc_skr_init @ 714 ;
+       silc_skr_ref_public_key @ 715 ;
+       silc_skr_uninit @ 716 ;
+       silc_skr_unref_public_key @ 717 ;
+       silc_mp_abs @ 718 ;
+       silc_mp_add @ 719 ;
+       silc_mp_add_ui @ 720 ;
+       silc_mp_and @ 721 ;
+       silc_mp_cmp @ 722 ;
+       silc_mp_cmp_si @ 723 ;
+       silc_mp_cmp_ui @ 724 ;
+       silc_mp_div @ 725 ;
+       silc_mp_div_2exp @ 726 ;
+       silc_mp_div_2exp_qr @ 727 ;
+       silc_mp_div_qr @ 728 ;
+       silc_mp_div_ui @ 729 ;
+       silc_mp_gcd @ 730 ;
+       silc_mp_gcdext @ 731 ;
+       silc_mp_get_str @ 732 ;
+       silc_mp_get_ui @ 733 ;
+       silc_mp_init @ 734 ;
+       silc_mp_mod @ 735 ;
+       silc_mp_mod_2exp @ 736 ;
+       silc_mp_mod_ui @ 737 ;
+       silc_mp_mul @ 738 ;
+       silc_mp_mul_2exp @ 739 ;
+       silc_mp_mul_ui @ 740 ;
+       silc_mp_neg @ 741 ;
+       silc_mp_or @ 742 ;
+       silc_mp_pow @ 743 ;
+       silc_mp_pow_mod @ 744 ;
+       silc_mp_pow_mod_ui @ 745 ;
+       silc_mp_pow_ui @ 746 ;
+       silc_mp_set @ 747 ;
+       silc_mp_set_si @ 748 ;
+       silc_mp_set_str @ 749 ;
+       silc_mp_set_ui @ 750 ;
+       silc_mp_sinit @ 751 ;
+       silc_mp_size @ 752 ;
+       silc_mp_sizeinbase @ 753 ;
+       silc_mp_sqrt @ 754 ;
+       silc_mp_sub @ 755 ;
+       silc_mp_sub_ui @ 756 ;
+       silc_mp_uninit @ 757 ;
+       silc_mp_xor @ 758 ;
+       silc_math_gen_prime @ 759 ;
+       silc_math_prime_test @ 760 ;
+       silc_mp_bin2mp @ 761 ;
+       silc_mp_mp2bin @ 762 ;
+       silc_mp_mp2bin_noalloc @ 763 ;
+       silc_mp_modinv @ 764 ;
+       silc_asn1_encode @ 772 ;
+       silc_asn1_alloc @ 773 ;
+       silc_asn1_free @ 775 ;
+       silc_asn1_init @ 776 ;
+       silc_asn1_uninit @ 778 ;
+       silc_asn1_decode @ 779 ;
+       silc_ber_decode @ 780 ;
+       silc_ber_encode @ 781 ;
+       silc_ber_encoded_len @ 782 ;
+       silc_connauth_alloc @ 783 ;
+       silc_connauth_free @ 784 ;
+       silc_connauth_get_ske @ 785 ;
+       silc_connauth_initiator @ 786 ;
+       silc_connauth_responder @ 787 ;
+       silc_connauth_timeout @ 788 ;
+       silc_ske_alloc @ 789 ;
+       silc_ske_free @ 790 ;
+       silc_ske_free_key_material @ 791 ;
+       silc_ske_free_rekey_material @ 792 ;
+       silc_ske_get_context @ 793 ;
+       silc_ske_get_key_material @ 794 ;
+       silc_ske_get_security_properties @ 795 ;
+       silc_ske_initiator @ 796 ;
+       silc_ske_map_status @ 797 ;
+       silc_ske_packet_send_retry @ 798 ;
+       silc_ske_parse_version @ 799 ;
+       silc_ske_process_key_material @ 800 ;
+       silc_ske_process_key_material_data @ 801 ;
+       silc_ske_rekey_initiator @ 802 ;
+       silc_ske_rekey_responder @ 803 ;
+       silc_ske_responder @ 804 ;
+       silc_ske_set_callbacks @ 805 ;
+       silc_ske_set_keys @ 806 ;
+       silc_ske_payload_ke_decode @ 807 ;
+       silc_ske_payload_ke_encode @ 808 ;
+       silc_ske_payload_ke_free @ 809 ;
+       silc_ske_payload_start_decode @ 810 ;
+       silc_ske_payload_start_encode @ 811 ;
+       silc_ske_payload_start_free @ 812 ;
+       silc_ske_get_supported_groups @ 813 ;
+       silc_ske_group_free @ 814 ;
+       silc_ske_group_get_by_name @ 815 ;
+       silc_ske_group_get_by_number @ 816 ;
+       silc_ske_group_get_name @ 817 ;
+       silc_ske_group_get_number @ 818 ;
+       silc_http_php @ 819 ;
+       silc_http_php_file @ 820 ;
+       silc_http_server_add_header @ 821 ;
+       silc_http_server_alloc @ 822 ;
+       silc_http_server_free @ 823 ;
+       silc_http_server_get_header @ 824 ;
+       silc_http_server_send @ 825 ;
+       silc_http_server_send_error @ 826 ;
+       silc_sftp_fs_memory_add_dir @ 827 ;
+       silc_sftp_fs_memory_add_file @ 828 ;
+       silc_sftp_fs_memory_alloc @ 829 ;
+       silc_sftp_fs_memory_del_dir @ 830 ;
+       silc_sftp_fs_memory_del_file @ 831 ;
+       silc_sftp_fs_memory_free @ 832 ;
+       silc_sftp_attr_decode @ 833 ;
+       silc_sftp_attr_encode @ 834 ;
+       silc_sftp_attr_free @ 835 ;
+       silc_sftp_map_errno @ 836 ;
+       silc_sftp_name_add @ 837 ;
+       silc_sftp_name_decode @ 838 ;
+       silc_sftp_name_encode @ 839 ;
+       silc_sftp_name_free @ 840 ;
+       silc_sftp_packet_decode @ 841 ;
+       silc_sftp_packet_encode @ 842 ;
+       silc_sftp_packet_encode_vp @ 843 ;
+       silc_sftp_client_shutdown @ 844 ;
+       silc_sftp_client_start @ 845 ;
+       silc_sftp_close @ 846 ;
+       silc_sftp_extended @ 847 ;
+       silc_sftp_fsetstat @ 848 ;
+       silc_sftp_fstat @ 849 ;
+       silc_sftp_lstat @ 850 ;
+       silc_sftp_mkdir @ 851 ;
+       silc_sftp_open @ 852 ;
+       silc_sftp_opendir @ 853 ;
+       silc_sftp_read @ 854 ;
+       silc_sftp_readdir @ 855 ;
+       silc_sftp_readlink @ 856 ;
+       silc_sftp_realpath @ 857 ;
+       silc_sftp_remove @ 858 ;
+       silc_sftp_rename @ 859 ;
+       silc_sftp_rmdir @ 860 ;
+       silc_sftp_setstat @ 861 ;
+       silc_sftp_stat @ 862 ;
+       silc_sftp_symlink @ 863 ;
+       silc_sftp_write @ 864 ;
+       silc_sftp_server_set_monitor @ 865 ;
+       silc_sftp_server_shutdown @ 866 ;
+       silc_sftp_server_start @ 867 ;
+       silc_vcard_alloc @ 868 ;
+       silc_vcard_decode @ 869 ;
+       silc_vcard_encode @ 870 ;
+       silc_vcard_fprintf @ 871 ;
+       silc_vcard_free @ 872 ;
+       silc_utf8_c2w @ 873 ;
+       silc_utf8_w2c @ 874 ;
+       silc_packet_engine_free_streams_list @ 875 ;
+       silc_schedule_set_notify @ 876 ;
+       silc_sfree @ 877 ;
+       silc_thread_pool_alloc @ 878 ;
+       silc_thread_pool_free @ 879 ;
+       silc_thread_pool_run @ 880 ;
+       silc_thread_pool_set_max_threads @ 881 ;
+       silc_thread_pool_num_max_threads @ 882 ;
+       silc_thread_pool_num_free_threads @ 883 ;
+       silc_thread_pool_purge @ 884 ;
+