From 46bf0fa17681cde1e4c7bd32f0fd9f7e9a268128 Mon Sep 17 00:00:00 2001 From: Pekka Riikonen Date: Mon, 25 Mar 2002 19:33:56 +0000 Subject: [PATCH] Added cross-reference support for document generator. Created silctypes.h. --- CHANGES | 11 + includes/Makefile.am | 2 - includes/bitmove.h | 87 ------- includes/silcincludes.h | 73 +----- lib/silcutil/DIRECTORY | 1 + lib/silcutil/Makefile.am | 3 +- lib/silcutil/silctypes.h | 399 ++++++++++++++++++++++++++++++++ prepare | 2 +- scripts/silcdoc/silcdoc | 15 +- util/robodoc/Source/generator.c | 5 + util/robodoc/Source/util.c | 29 +++ 11 files changed, 463 insertions(+), 164 deletions(-) delete mode 100644 includes/bitmove.h create mode 100644 lib/silcutil/silctypes.h diff --git a/CHANGES b/CHANGES index 1af5295f..63c7053e 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,14 @@ +Mon Mar 25 21:11:35 EET 2002 Pekka Riikonen + + * Added cross-reference support to the SILC Documentation + generator. All types across all HTML files are now cross- + referenced. Affected files util/robodoc/generator.c and + scripts/silcdoc/silcdoc. + + * Added file lib/silcutil/silctypes.h to include all the + arithmetic type definitions and some macros. Removed + includes/bitmove.h and moved macros to silctypes.h. + Mon Mar 25 17:19:46 EET 2002 Pekka Riikonen * Merged bugfixes for Irssi SILC client from irssi.org CVS. diff --git a/includes/Makefile.am b/includes/Makefile.am index f1bb7535..947145ca 100644 --- a/includes/Makefile.am +++ b/includes/Makefile.am @@ -23,7 +23,6 @@ all: if SILC_DIST_TOOLKIT include_HEADERS = \ - bitmove.h \ silcincludes.h \ silcwin32.h \ silcepoc.h \ @@ -35,7 +34,6 @@ include_HEADERS = \ endif EXTRA_DIST = \ - bitmove.h \ silcincludes.h \ silcwin32.h \ silcepoc.h \ diff --git a/includes/bitmove.h b/includes/bitmove.h deleted file mode 100644 index 4d3dfd50..00000000 --- a/includes/bitmove.h +++ /dev/null @@ -1,87 +0,0 @@ -/* - - bitmove.h - - Author: Pekka Riikonen - - Copyright (C) 1997 - 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 BITMOVE_H -#define BITMOVE_H - -#define GET_WORD(cp) ((SilcUInt32)(SilcUInt8)(cp)[0]) << 24 \ - | ((SilcUInt32)(SilcUInt8)(cp)[1] << 16) \ - | ((SilcUInt32)(SilcUInt8)(cp)[2] << 8) \ - | ((SilcUInt32)(SilcUInt8)(cp)[3]) - -/* Returns eight 8-bit bytes, most significant bytes first. */ -#define SILC_GET64_MSB(l, cp) \ - (l) = ((((SilcUInt64)GET_WORD((cp))) << 32) | \ - ((SilcUInt64)GET_WORD((cp) + 4))) -#define SILC_PUT64_MSB(l, cp) \ -do { \ - SILC_PUT32_MSB((SilcUInt32)((SilcUInt64)(l) >> 32), (cp)); \ - SILC_PUT32_MSB((SilcUInt32)(l), (cp) + 4); \ -} while(0) - - -/* Returns four 8-bit bytes, most significant bytes first. */ -#define SILC_GET32_MSB(l, cp) \ - (l) = ((SilcUInt32)(SilcUInt8)(cp)[0]) << 24 \ - | ((SilcUInt32)(SilcUInt8)(cp)[1] << 16) \ - | ((SilcUInt32)(SilcUInt8)(cp)[2] << 8) \ - | ((SilcUInt32)(SilcUInt8)(cp)[3]) -#define SILC_PUT32_MSB(l, cp) \ - (cp)[0] = l >> 24; \ - (cp)[1] = l >> 16; \ - (cp)[2] = l >> 8; \ - (cp)[3] = l; - - -/* Returns four 8-bit bytes, less significant bytes first. */ -#define SILC_GET32_LSB(l, cp) \ - (l) = ((SilcUInt32)(SilcUInt8)(cp)[0]) \ - | ((SilcUInt32)(SilcUInt8)(cp)[1] << 8) \ - | ((SilcUInt32)(SilcUInt8)(cp)[2] << 16) \ - | ((SilcUInt32)(SilcUInt8)(cp)[3] << 24) -/* same as upper but XOR the result always */ -#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) -#define SILC_PUT32_LSB(l, cp) \ - (cp)[0] = l; \ - (cp)[1] = l >> 8; \ - (cp)[2] = l >> 16; \ - (cp)[3] = l >> 24; - - -/* Returns two 8-bit bytes, most significant bytes first. */ -#define SILC_GET16_MSB(l, cp) \ - (l) = ((SilcUInt32)(SilcUInt8)(cp)[0] << 8) \ - | ((SilcUInt32)(SilcUInt8)(cp)[1]) -#define SILC_PUT16_MSB(l, cp) \ - (cp)[0] = l >> 8; \ - (cp)[1] = l; - -/* Returns two 8-bit bytes, less significant bytes first. */ -#define SILC_GET16_LSB(l, cp) \ - (l) = ((SilcUInt32)(SilcUInt8)(cp)[0]) \ - | ((SilcUInt32)(SilcUInt8)(cp)[1] << 8) -#define SILC_PUT16_LSB(l, cp) \ - (cp)[0] = l; \ - (cp)[1] = l >> 8; - -#endif diff --git a/includes/silcincludes.h b/includes/silcincludes.h index 67a8b6c1..0c72f406 100644 --- a/includes/silcincludes.h +++ b/includes/silcincludes.h @@ -203,77 +203,8 @@ extern "C" { #include "../lib/contrib/getopt.h" #endif -#ifndef TRUE -#define TRUE 1 -#endif -#ifndef FALSE -#define FALSE 0 -#endif - -/* Define offsetof */ -#ifndef offsetof -#define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER) -#endif - -/* Define types. The types must be at least of the specified size */ - -typedef unsigned char SilcUInt8; -typedef signed char SilcInt8; - -#if SILC_SIZEOF_SHORT > 2 -#error "size of the short must be 2 bytes" -#endif - -typedef unsigned short SilcUInt16; -typedef signed short SilcInt16; - -#if SILC_SIZEOF_LONG == 4 -typedef unsigned long SilcUInt32; -typedef signed long SilcInt32; -#else -#if SILC_SIZEOF_INT == 4 -typedef unsigned int SilcUInt32; -typedef signed int SilcInt32; -#else -#if SILC_SIZEOF_LONG_LONG >= 4 -#ifndef WIN32 -typedef unsigned long long SilcUInt32; -typedef signed long long SilcInt32; -#endif -#endif -#endif -#endif - -#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 SilcUInt32 SilcUInt64; /* XXX Use Windows's own 64 bit types */ -typedef SilcInt32 SilcInt64; -#endif -#else -typedef SilcUInt32 SilcUInt64; -typedef SilcInt32 SilcInt64; -#endif -#endif - -#if SILC_SIZEOF_VOID_P < 4 -typedef SilcUInt32 * void *; -#endif - -#ifndef __cplusplus -#ifndef bool -#define bool unsigned char -#endif -#endif - -/* Generic global SILC includes */ -#include "bitmove.h" +/* Include generic SILC type definitions */ +#include "silctypes.h" /* Math library includes */ #include "silcmp.h" diff --git a/lib/silcutil/DIRECTORY b/lib/silcutil/DIRECTORY index a0362fb2..66e1d3a6 100644 --- a/lib/silcutil/DIRECTORY +++ b/lib/silcutil/DIRECTORY @@ -1,6 +1,7 @@