Added cross-reference support for document generator. silc.toolkit.0.8.2
authorPekka Riikonen <priikone@silcnet.org>
Mon, 25 Mar 2002 19:33:56 +0000 (19:33 +0000)
committerPekka Riikonen <priikone@silcnet.org>
Mon, 25 Mar 2002 19:33:56 +0000 (19:33 +0000)
Created silctypes.h.

CHANGES
includes/Makefile.am
includes/bitmove.h [deleted file]
includes/silcincludes.h
lib/silcutil/DIRECTORY
lib/silcutil/Makefile.am
lib/silcutil/silctypes.h [new file with mode: 0644]
prepare
scripts/silcdoc/silcdoc
util/robodoc/Source/generator.c
util/robodoc/Source/util.c

diff --git a/CHANGES b/CHANGES
index 1af5295f0222ff88a8f14e91624d5dda997074ce..63c7053e5dd8b903b0bde0a44ae9866483e2c05f 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,14 @@
+Mon Mar 25 21:11:35 EET 2002  Pekka Riikonen <priikone@silcnet.org>
+
+       * 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 <priikone@silcnet.org>
 
        * Merged bugfixes for Irssi SILC client from irssi.org CVS.
index f1bb7535925000d8892bc03c7aa1048d9512ac63..947145ca80925c410a74c12ef28c7adb02eec2ae 100644 (file)
@@ -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 (file)
index 4d3dfd5..0000000
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
-
-  bitmove.h 
-
-  Author: Pekka Riikonen <priikone@silcnet.org>
-
-  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
index 67a8b6c1c14dabe6519d088fa55eb8f14793db82..0c72f406c9d326154a8623470fc1c02750a07517 100644 (file)
@@ -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"
index a0362fb2fceb48f4ef7a7d0f6ae4f843a0ffd3dd..66e1d3a6933cb5ecb30fc5463c98de01218439f4 100644 (file)
@@ -1,6 +1,7 @@
 <!--
 @LIBRARY=SILC Utility Library
 @FILENAME=silcutillib.html
+@LINK=silctypes.html:Basic SILC Types
 @LINK=silcbuffer.html:SILC Buffer Interface
 @LINK=silcbuffmt.html:SILC Buffer Format Interface
 @LINK=silchashtable.html:SILC Hash Table Interface
index 3d97b28f4596fb1234618f2474a4dd82991ead99..5b7f020e0d5aef7749c220f1dfdc74769d2222c2 100644 (file)
@@ -67,7 +67,8 @@ include_HEADERS =     \
        silclist.h      \
        silcdlist.h     \
        silcfileutil.h  \
-       silcutil.h
+       silcutil.h      \
+       silctypes.h
 endif
 
 EXTRA_DIST = *.h
diff --git a/lib/silcutil/silctypes.h b/lib/silcutil/silctypes.h
new file mode 100644 (file)
index 0000000..21b3abd
--- /dev/null
@@ -0,0 +1,399 @@
+/*
+
+  silctypes.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.
+
+*/
+
+/****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
+
+#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
+
+#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_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
+/***/
+
+/****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 SilcUInt32 SilcUInt64; /* XXX Use Windows's own 64 bit types */
+typedef SilcInt32 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
+
+#ifndef __cplusplus
+#ifndef bool
+#define bool unsigned char
+#endif
+#endif
+
+#define 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)                          \
+       (l) = ((SilcUInt32)(SilcUInt8)(cp)[0] << 8)     \
+           | ((SilcUInt32)(SilcUInt8)(cp)[1])
+/***/
+
+/****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)                  \
+       (cp)[0] = l >> 8;                       \
+       (cp)[1] = l;
+/***/
+
+/****d* silcutil/SILCTypes/SILC_GET16_LSB
+ *
+ * NAME
+ *
+ *    #define SILC_GET16_MSB ...
+ *
+ * DESCRIPTION
+ *
+ *    Return two 8-bit bytes, least significant bytes first.
+ *
+ * SOURCE
+ */
+#define SILC_GET16_LSB(l, cp)                          \
+       (l) = ((SilcUInt32)(SilcUInt8)(cp)[0])          \
+           | ((SilcUInt32)(SilcUInt8)(cp)[1] << 8)
+/***/
+
+/****d* silcutil/SILCTypes/SILC_PUT16_LSB
+ *
+ * NAME
+ *
+ *    #define SILC_PUT16_LSB ...
+ *
+ * DESCRIPTION
+ *
+ *    Put two 8-bit bytes, least significant bytes first.
+ *
+ * SOURCE
+ */
+#define SILC_PUT16_LSB(l, cp)                  \
+       (cp)[0] = l;                            \
+       (cp)[1] = l >> 8;
+/***/
+
+/****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)                          \
+       (l) = ((SilcUInt32)(SilcUInt8)(cp)[0]) << 24    \
+           | ((SilcUInt32)(SilcUInt8)(cp)[1] << 16)    \
+           | ((SilcUInt32)(SilcUInt8)(cp)[2] << 8)     \
+           | ((SilcUInt32)(SilcUInt8)(cp)[3])
+/***/
+
+/****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)                  \
+       (cp)[0] = l >> 24;                      \
+       (cp)[1] = l >> 16;                      \
+       (cp)[2] = l >> 8;                       \
+       (cp)[3] = l;
+/***/
+
+/****d* silcutil/SILCTypes/SILC_GET32_LSB
+ *
+ * NAME
+ *
+ *    #define SILC_GET32_LSB ...
+ *
+ * DESCRIPTION
+ *
+ *    Return four 8-bit bytes, least significant bytes first.
+ *
+ * SOURCE
+ */
+#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. Special purpose macro. */
+#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)
+/***/
+
+/****d* silcutil/SILCTypes/SILC_PUT32_LSB
+ *
+ * NAME
+ *
+ *    #define SILC_PUT32_LSB ...
+ *
+ * DESCRIPTION
+ *
+ *    Put four 8-bit bytes, least significant bytes first.
+ *
+ * SOURCE
+ */
+#define SILC_PUT32_LSB(l, cp)                  \
+       (cp)[0] = l;                            \
+       (cp)[1] = l >> 8;                       \
+       (cp)[2] = l >> 16;                      \
+       (cp)[3] = l >> 24;
+/***/
+
+/****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)                          \
+       (l) = ((((SilcUInt64)GET_WORD((cp))) << 32) |   \
+             ((SilcUInt64)GET_WORD((cp) + 4)))
+/***/
+
+/****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)
+/***/
+
+#endif /* SILCTYPES_H */
diff --git a/prepare b/prepare
index d3fc25bd10c83c936cae66a8ae9af30ab627ac2b..71c75d6343baa58f0f573ca2a8ecf06a2dca4e47 100755 (executable)
--- a/prepare
+++ b/prepare
@@ -37,7 +37,7 @@
 # SILC Distribution versions. Set here or give the version on the command
 # line as argument.
 #
-SILC_VERSION=0.8.1                     # Base version
+SILC_VERSION=0.8.2                     # Base version
 
 #############################################################################
 
index 0405a7fa6ec2c8ccb8c9ef45ed5fbe631f599e35..61851b89030ffc15debb8ab8b41b55b9d72b05de 100755 (executable)
@@ -94,7 +94,18 @@ if [ "$TYPE" = "HTML" ]; then
     f="/tmp/silcdoc_html.html/$i"
     sh gen.sh $DST gen_index.php 1 $f $f
     cp /tmp/silcdoc_html.html/$i $DST
-echo $f
+  done
+
+  # Generate cross reference files
+  path=`pwd`
+  cd /tmp/silcdoc.html
+  headers=`find . -name "silc*.h" |cut -d/  -f2 |cut -d.  -f1`
+  cd $path
+  touch $DST/silcdoc_xref
+  for i in $headers
+  do
+    $ROBO /tmp/silcdoc.html/$i.h $DST/$i.html $TYPE GENXREF $DST/$i.xref
+    echo $DST/$i.xref >>$DST/silcdoc_xref
   done
 
   # Generate the actual detailed documentation
@@ -104,7 +115,7 @@ echo $f
   cd $path
   for i in $headers
   do
-    $ROBO /tmp/silcdoc.html/$i.h $DST/$i.html $TYPE
+    $ROBO /tmp/silcdoc.html/$i.h $DST/$i.html XREF $DST/silcdoc_xref $TYPE
 
     # Generate the TOC file
     sh gen.sh $DST gen_index.php 1 $DST/$i.html $DST/$i.html
index bbc5b666572f071a59d9390044319ce633a83188..e057f077cab913bd71e92a5b99bb5265470cba9a 100644 (file)
@@ -1282,8 +1282,13 @@ RB_Generate_Item_Body (FILE * dest_doc, char *dest_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
                    {
index 18ff5f3d6b8083a289070acfe85a73943712a159..b6631253bd69e3c612fa66c04154fe7d64b147d0 100644 (file)
@@ -54,6 +54,35 @@ RB_FilePart (char *file_name)
   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 ***/