Initial revision
authorPekka Riikonen <priikone@silcnet.org>
Wed, 8 Aug 2001 19:47:04 +0000 (19:47 +0000)
committerPekka Riikonen <priikone@silcnet.org>
Wed, 8 Aug 2001 19:47:04 +0000 (19:47 +0000)
65 files changed:
util/robodoc/AUTHORS [new file with mode: 0644]
util/robodoc/COPYING [new file with mode: 0644]
util/robodoc/ChangeLog [new file with mode: 0644]
util/robodoc/Docs/example.c [new file with mode: 0644]
util/robodoc/Docs/example_makefile [new file with mode: 0644]
util/robodoc/Docs/general.m4 [new file with mode: 0644]
util/robodoc/Docs/main.css [new file with mode: 0644]
util/robodoc/Docs/makefile.am [new file with mode: 0644]
util/robodoc/Docs/makefile.in [new file with mode: 0644]
util/robodoc/Docs/robodoc.1 [new file with mode: 0644]
util/robodoc/Docs/robodoc.html [new file with mode: 0644]
util/robodoc/Docs/robodoc.m4 [new file with mode: 0644]
util/robodoc/Docs/tocgen.m4 [new file with mode: 0644]
util/robodoc/Examples/C/makefile [new file with mode: 0644]
util/robodoc/Examples/C/prog1.c [new file with mode: 0644]
util/robodoc/Examples/C/prog1.c.html [new file with mode: 0644]
util/robodoc/Examples/C/prog2.c [new file with mode: 0644]
util/robodoc/Examples/C/prog2.c.html [new file with mode: 0644]
util/robodoc/Examples/CPP/makefile [new file with mode: 0644]
util/robodoc/Examples/CPP/masterindex.html [new file with mode: 0644]
util/robodoc/Examples/CPP/muppets.cpp [new file with mode: 0644]
util/robodoc/Examples/CPP/muppets.cpp.html [new file with mode: 0644]
util/robodoc/Examples/CPP/muppets.h [new file with mode: 0644]
util/robodoc/Examples/CPP/muppets.h.html [new file with mode: 0644]
util/robodoc/Headers/assembler.sample [new file with mode: 0644]
util/robodoc/Headers/basic.sample [new file with mode: 0644]
util/robodoc/Headers/c.sample [new file with mode: 0644]
util/robodoc/Headers/cpp.sample [new file with mode: 0644]
util/robodoc/Headers/fortan.sample [new file with mode: 0644]
util/robodoc/Headers/html.sample [new file with mode: 0644]
util/robodoc/Headers/tcl.sample [new file with mode: 0644]
util/robodoc/INSTALL [new file with mode: 0644]
util/robodoc/NEWS [new file with mode: 0644]
util/robodoc/README [new file with mode: 0644]
util/robodoc/Source/analyser.c [new file with mode: 0644]
util/robodoc/Source/analyser.h [new file with mode: 0644]
util/robodoc/Source/config.h [new file with mode: 0644]
util/robodoc/Source/config.h.in [new file with mode: 0644]
util/robodoc/Source/folds.c [new file with mode: 0644]
util/robodoc/Source/folds.h [new file with mode: 0644]
util/robodoc/Source/generator.c [new file with mode: 0644]
util/robodoc/Source/generator.h [new file with mode: 0644]
util/robodoc/Source/headers.c [new file with mode: 0644]
util/robodoc/Source/headers.h [new file with mode: 0644]
util/robodoc/Source/items.c [new file with mode: 0644]
util/robodoc/Source/items.h [new file with mode: 0644]
util/robodoc/Source/links.c [new file with mode: 0644]
util/robodoc/Source/links.h [new file with mode: 0644]
util/robodoc/Source/makefile.am [new file with mode: 0644]
util/robodoc/Source/makefile.in [new file with mode: 0644]
util/robodoc/Source/makefile.plain [new file with mode: 0644]
util/robodoc/Source/robodoc.c [new file with mode: 0644]
util/robodoc/Source/robodoc.h [new file with mode: 0644]
util/robodoc/Source/stamp-h.in [new file with mode: 0644]
util/robodoc/Source/util.c [new file with mode: 0644]
util/robodoc/Source/util.h [new file with mode: 0644]
util/robodoc/TODO [new file with mode: 0644]
util/robodoc/aclocal.m4 [new file with mode: 0644]
util/robodoc/configure [new file with mode: 0755]
util/robodoc/configure.in [new file with mode: 0644]
util/robodoc/install-sh [new file with mode: 0755]
util/robodoc/makefile.am [new file with mode: 0644]
util/robodoc/makefile.in [new file with mode: 0644]
util/robodoc/missing [new file with mode: 0755]
util/robodoc/mkinstalldirs [new file with mode: 0755]

diff --git a/util/robodoc/AUTHORS b/util/robodoc/AUTHORS
new file mode 100644 (file)
index 0000000..60db402
--- /dev/null
@@ -0,0 +1,8 @@
+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
new file mode 100644 (file)
index 0000000..60549be
--- /dev/null
@@ -0,0 +1,340 @@
+                   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
new file mode 100644 (file)
index 0000000..dbc8165
--- /dev/null
@@ -0,0 +1,65 @@
+$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
new file mode 100644 (file)
index 0000000..32b1727
--- /dev/null
@@ -0,0 +1,29 @@
+/****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
new file mode 100644 (file)
index 0000000..30059ff
--- /dev/null
@@ -0,0 +1,121 @@
+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
new file mode 100644 (file)
index 0000000..db7cba7
--- /dev/null
@@ -0,0 +1,14 @@
+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
new file mode 100644 (file)
index 0000000..65d0043
--- /dev/null
@@ -0,0 +1,106 @@
+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
new file mode 100644 (file)
index 0000000..7bed062
--- /dev/null
@@ -0,0 +1,30 @@
+## 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
new file mode 100644 (file)
index 0000000..6c71fb1
--- /dev/null
@@ -0,0 +1,260 @@
+# 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
new file mode 100644 (file)
index 0000000..d8814ec
--- /dev/null
@@ -0,0 +1,246 @@
+.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
new file mode 100644 (file)
index 0000000..16a17dd
--- /dev/null
@@ -0,0 +1,1320 @@
+
+<!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
new file mode 100644 (file)
index 0000000..b60b52a
--- /dev/null
@@ -0,0 +1,1269 @@
+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
new file mode 100644 (file)
index 0000000..94d2f51
--- /dev/null
@@ -0,0 +1,6 @@
+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
new file mode 100644 (file)
index 0000000..12dd865
--- /dev/null
@@ -0,0 +1,34 @@
+#
+# $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
new file mode 100644 (file)
index 0000000..ba29eb2
--- /dev/null
@@ -0,0 +1,55 @@
+/****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
new file mode 100644 (file)
index 0000000..b7cabbb
--- /dev/null
@@ -0,0 +1,69 @@
+<!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
new file mode 100644 (file)
index 0000000..b712436
--- /dev/null
@@ -0,0 +1,50 @@
+/****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
new file mode 100644 (file)
index 0000000..8410c01
--- /dev/null
@@ -0,0 +1,63 @@
+<!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
new file mode 100644 (file)
index 0000000..7fc75ae
--- /dev/null
@@ -0,0 +1,44 @@
+# $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
new file mode 100644 (file)
index 0000000..396d0aa
--- /dev/null
@@ -0,0 +1,53 @@
+<!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
new file mode 100644 (file)
index 0000000..d5a96e1
--- /dev/null
@@ -0,0 +1,51 @@
+
+/****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
new file mode 100644 (file)
index 0000000..db88b30
--- /dev/null
@@ -0,0 +1,68 @@
+<!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
new file mode 100644 (file)
index 0000000..873cbc9
--- /dev/null
@@ -0,0 +1,25 @@
+
+/****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
new file mode 100644 (file)
index 0000000..c91e78e
--- /dev/null
@@ -0,0 +1,38 @@
+<!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
new file mode 100644 (file)
index 0000000..dbf066b
--- /dev/null
@@ -0,0 +1,63 @@
+****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
new file mode 100644 (file)
index 0000000..22fca0c
--- /dev/null
@@ -0,0 +1,63 @@
+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
new file mode 100644 (file)
index 0000000..beca449
--- /dev/null
@@ -0,0 +1,46 @@
+/****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
new file mode 100644 (file)
index 0000000..056d33f
--- /dev/null
@@ -0,0 +1,68 @@
+/****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
new file mode 100644 (file)
index 0000000..b646a73
--- /dev/null
@@ -0,0 +1,63 @@
+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
new file mode 100644 (file)
index 0000000..7f3e557
--- /dev/null
@@ -0,0 +1,38 @@
+<!---****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
new file mode 100644 (file)
index 0000000..be76e76
--- /dev/null
@@ -0,0 +1,39 @@
+#****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
new file mode 100644 (file)
index 0000000..3a22cdd
--- /dev/null
@@ -0,0 +1,49 @@
+$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
new file mode 100644 (file)
index 0000000..0348612
--- /dev/null
@@ -0,0 +1,17 @@
+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
new file mode 100644 (file)
index 0000000..ed54c74
--- /dev/null
@@ -0,0 +1,63 @@
+_______________________________________________________________________________
+
+
+       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
new file mode 100644 (file)
index 0000000..50af048
--- /dev/null
@@ -0,0 +1,670 @@
+#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 ((new_header->function_name
+                  = RB_Function_Name (new_header->name)) == 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 *end_char, old_char;
+
+      end_char = cur_char + RB_WordLen (cur_char);
+      old_char = *end_char;
+      *end_char = '\0';
+      cur_char = RB_StrDup (cur_char);
+      *end_char = old_char;
+      return (cur_char);
+    }
+  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
new file mode 100644 (file)
index 0000000..ce1be2a
--- /dev/null
@@ -0,0 +1,13 @@
+#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 b/util/robodoc/Source/config.h
new file mode 100644 (file)
index 0000000..6304664
--- /dev/null
@@ -0,0 +1,30 @@
+/* Source/config.h.  Generated automatically by configure.  */
+/* 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.  */
+#define HAVE_STRFTIME 1
+
+/* Define if you have the vprintf function.  */
+#define HAVE_VPRINTF 1
+
+/* Define to `unsigned' if <sys/types.h> doesn't define.  */
+/* #undef size_t */
+
+/* Define if you have the ANSI C header files.  */
+#define STDC_HEADERS 1
+
+/* Define if you have the strstr function.  */
+#define HAVE_STRSTR 1
+
+/* Name of package */
+#define PACKAGE "robodoc"
+
+/* Version number of package */
+#define VERSION "3.2.3"
+
diff --git a/util/robodoc/Source/config.h.in b/util/robodoc/Source/config.h.in
new file mode 100644 (file)
index 0000000..4465948
--- /dev/null
@@ -0,0 +1,29 @@
+/* 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
new file mode 100644 (file)
index 0000000..4138b70
--- /dev/null
@@ -0,0 +1,141 @@
+#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
new file mode 100644 (file)
index 0000000..93d8df3
--- /dev/null
@@ -0,0 +1,47 @@
+#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
new file mode 100644 (file)
index 0000000..6727202
--- /dev/null
@@ -0,0 +1,1662 @@
+#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"
+
+
+/****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;
+  int expc = 0;
+  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 (output_mode == HTML)
+        {
+          sprintf(fname, "%s_exp_%d.html", doc_base, expc++);
+          dest_doc = fopen(fname, "w");
+        }
+
+      RB_Generate_Header_Start (dest_doc, cur_header);
+
+      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);
+    }
+
+  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)
+       {
+         int expc = 0;
+         char iname[256];
+         FILE *index;
+
+         /* do toc if not in fold */
+#if 0
+         fprintf (dest_doc,
+                  "<H3 ALIGN=\"center\">TABLE OF CONTENTS</H3>\n");
+#endif
+         fprintf (dest_doc, "<OL>\n");
+
+         /* Generate quick index file, for fast referencing */
+         sprintf(iname, "%s_index.html", doc_base);
+          index = fopen(iname, "w");
+
+         for (cur_header = first_header;
+              cur_header;
+              cur_header = cur_header->next_header)
+           {
+             char fname[256];
+
+             sprintf(fname, "%s_exp_%d.html", doc_base, expc);
+
+             if (cur_header->name && cur_header->function_name)
+               {
+                 if (expc == 0) 
+                   {
+                     int item_type;
+                     char *next_line, *item_line = NULL;
+                   
+                     RB_Generate_Header_Start (dest_doc, cur_header);
+
+                     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\">%s</A><BR>\n",
+                                  name, cur_header->function_name);
+                       }
+                   }
+                 else
+                   {
+                     fprintf (dest_doc, "<LI><A HREF=\"%s\">%s</A>\n",
+                              fname, cur_header->name);
+                     if (index)
+                       fprintf (index, "<A HREF=\"%s\">%s</A><BR>\n",
+                                fname, cur_header->function_name);
+                   }
+
+                 expc++;
+               }
+           }
+
+         fprintf (dest_doc, "</OL>\n");
+
+         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) {
+       fprintf (dest_doc, "\\section{%s}\n", src_name);
+      } 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_ROBODOC
+                " " 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)
+{
+  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=\"+3\" COLOR=\"#000044\"><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=\"+3\" COLOR=\"#000044\"><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=\"+3\" COLOR=\"#000044\"><B>"
+                    "Variable <A NAME=\"%s\">%s</A>"
+                    "</FONT></B><BR><BR>\n\n",
+                    cur_header->function_name,
+                    cur_header->function_name);
+         else
+           fprintf (dest_doc, 
+                    "\n<FONT SIZE=\"+3\" COLOR=\"#000044\"><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=\"#000044\">");
+      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]);
+
+  /* 
+   * 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 (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))
+                   {
+                     fprintf (dest_doc, "<A HREF=\"%s#%s\">%s</A>",
+                              file_name, label_name, label_name);
+                   }
+                 else
+                   {
+                     if (strcmp (label_name, function_name))
+                       {
+                         fprintf (dest_doc, "<A HREF=\"#%s\">%s</A>",
+                                  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, "Project 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, "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\"><TT>%s</TT></A></TD>\n",
+                          cur_link->file_name, cur_link->label_name,
+                          cur_link->label_name);
+               }
+             else
+               {
+                 fprintf (dest, "<TD>%s</TD>\n", cur_link->label_name);
+               }
+           }
+         else
+           {
+             fprintf (dest, "<TD><A HREF=\"%s#%s\"><TT>%s</TT></A></TD>\n",
+                      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
new file mode 100644 (file)
index 0000000..2460fb4
--- /dev/null
@@ -0,0 +1,20 @@
+#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 *);
+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
new file mode 100644 (file)
index 0000000..bb2bf98
--- /dev/null
@@ -0,0 +1,160 @@
+#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
new file mode 100644 (file)
index 0000000..8361d8b
--- /dev/null
@@ -0,0 +1,72 @@
+#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
new file mode 100644 (file)
index 0000000..747ee7a
--- /dev/null
@@ -0,0 +1,279 @@
+#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,                /* 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,                /* EXAMPLE_ITEM */
+  ITEM_NAME_LARGE_FONT | TEXT_BODY_SHINE,      /* 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,                /* 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"
+};
+
+/*************/
+
+
+/* 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 */
+};
+
+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 */
+};
+
+
+
+/****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
new file mode 100644 (file)
index 0000000..738a673
--- /dev/null
@@ -0,0 +1,81 @@
+
+
+
+#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, 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))
+
+
+/****** 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
new file mode 100644 (file)
index 0000000..7609a6d
--- /dev/null
@@ -0,0 +1,442 @@
+#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
new file mode 100644 (file)
index 0000000..b727a28
--- /dev/null
@@ -0,0 +1,44 @@
+
+
+#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
new file mode 100644 (file)
index 0000000..4e13caa
--- /dev/null
@@ -0,0 +1,140 @@
+## 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
new file mode 100644 (file)
index 0000000..bce003f
--- /dev/null
@@ -0,0 +1,437 @@
+# 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
new file mode 100644 (file)
index 0000000..8739dcb
--- /dev/null
@@ -0,0 +1,215 @@
+#****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
new file mode 100644 (file)
index 0000000..3274d77
--- /dev/null
@@ -0,0 +1,862 @@
+/****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
new file mode 100644 (file)
index 0000000..f806a3d
--- /dev/null
@@ -0,0 +1,91 @@
+/*
+ *    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
new file mode 100644 (file)
index 0000000..9788f70
--- /dev/null
@@ -0,0 +1 @@
+timestamp
diff --git a/util/robodoc/Source/util.c b/util/robodoc/Source/util.c
new file mode 100644 (file)
index 0000000..18ff5f3
--- /dev/null
@@ -0,0 +1,657 @@
+#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);
+}
+
+/*** 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
new file mode 100644 (file)
index 0000000..7f78abe
--- /dev/null
@@ -0,0 +1,30 @@
+
+
+
+
+
+
+
+#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
new file mode 100644 (file)
index 0000000..02bb304
--- /dev/null
@@ -0,0 +1,8 @@
+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
new file mode 100644 (file)
index 0000000..bd4779c
--- /dev/null
@@ -0,0 +1,127 @@
+dnl aclocal.m4 generated automatically by aclocal 1.4
+
+dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl This program is distributed in the hope that it will be useful,
+dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+dnl PARTICULAR PURPOSE.
+
+# Like AC_CONFIG_HEADER, but automatically create stamp file.
+
+AC_DEFUN(AM_CONFIG_HEADER,
+[AC_PREREQ([2.12])
+AC_CONFIG_HEADER([$1])
+dnl When config.status generates a header, we must update the stamp-h file.
+dnl This file resides in the same directory as the config header
+dnl that is generated.  We must strip everything past the first ":",
+dnl and everything past the last "/".
+AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl
+ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>,
+<<test -z "<<$>>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>,
+<<am_indx=1
+for am_file in <<$1>>; do
+  case " <<$>>CONFIG_HEADERS " in
+  *" <<$>>am_file "*<<)>>
+    echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx
+    ;;
+  esac
+  am_indx=`expr "<<$>>am_indx" + 1`
+done<<>>dnl>>)
+changequote([,]))])
+
+# Do all the work for Automake.  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.
+
+# serial 1
+
+dnl Usage:
+dnl AM_INIT_AUTOMAKE(package,version, [no-define])
+
+AC_DEFUN(AM_INIT_AUTOMAKE,
+[AC_REQUIRE([AC_PROG_INSTALL])
+PACKAGE=[$1]
+AC_SUBST(PACKAGE)
+VERSION=[$2]
+AC_SUBST(VERSION)
+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
+ifelse([$3],,
+AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
+AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package]))
+AC_REQUIRE([AM_SANITY_CHECK])
+AC_REQUIRE([AC_ARG_PROGRAM])
+dnl FIXME This is truly gross.
+missing_dir=`cd $ac_aux_dir && pwd`
+AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
+AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
+AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
+AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
+AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
+AC_REQUIRE([AC_PROG_MAKE_SET])])
+
+#
+# Check to make sure that the build environment is sane.
+#
+
+AC_DEFUN(AM_SANITY_CHECK,
+[AC_MSG_CHECKING([whether build environment is sane])
+# Just in case
+sleep 1
+echo timestamp > conftestfile
+# 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 conftestfile 2> /dev/null`
+   if test "[$]*" = "X"; then
+      # -L didn't work.
+      set X `ls -t $srcdir/configure conftestfile`
+   fi
+   if test "[$]*" != "X $srcdir/configure conftestfile" \
+      && test "[$]*" != "X conftestfile $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" = conftestfile
+   )
+then
+   # Ok.
+   :
+else
+   AC_MSG_ERROR([newly created file is older than distributed files!
+Check your system clock])
+fi
+rm -f conftest*
+AC_MSG_RESULT(yes)])
+
+dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
+dnl The program must properly implement --version.
+AC_DEFUN(AM_MISSING_PROG,
+[AC_MSG_CHECKING(for working $2)
+# Run test in a subshell; some versions of sh will print an error if
+# an executable is not found, even if stderr is redirected.
+# Redirect stdin to placate older versions of autoconf.  Sigh.
+if ($2 --version) < /dev/null > /dev/null 2>&1; then
+   $1=$2
+   AC_MSG_RESULT(found)
+else
+   $1="$3/missing $2"
+   AC_MSG_RESULT(missing)
+fi
+AC_SUBST($1)])
+
diff --git a/util/robodoc/configure b/util/robodoc/configure
new file mode 100755 (executable)
index 0000000..bc022a5
--- /dev/null
@@ -0,0 +1,1952 @@
+#! /bin/sh
+
+# Guess values for system-dependent variables and create Makefiles.
+# Generated automatically using autoconf version 2.13 
+# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
+#
+# This configure script is free software; the Free Software Foundation
+# gives unlimited permission to copy, distribute and modify it.
+
+# Defaults:
+ac_help=
+ac_default_prefix=/usr/local
+# Any additions from configure.in:
+
+# Initialize some variables set by options.
+# The variables have the same names as the options, with
+# dashes changed to underlines.
+build=NONE
+cache_file=./config.cache
+exec_prefix=NONE
+host=NONE
+no_create=
+nonopt=NONE
+no_recursion=
+prefix=NONE
+program_prefix=NONE
+program_suffix=NONE
+program_transform_name=s,x,x,
+silent=
+site=
+srcdir=
+target=NONE
+verbose=
+x_includes=NONE
+x_libraries=NONE
+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'
+
+# Initialize some other variables.
+subdirs=
+MFLAGS= MAKEFLAGS=
+SHELL=${CONFIG_SHELL-/bin/sh}
+# Maximum number of lines to put in a shell here document.
+ac_max_here_lines=12
+
+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
+
+  case "$ac_option" in
+  -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
+  *) ac_optarg= ;;
+  esac
+
+  # 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 ;;
+  -build=* | --build=* | --buil=* | --bui=* | --bu=*)
+    build="$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" ;;
+
+  -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
+    ac_prev=datadir ;;
+  -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
+  | --da=*)
+    datadir="$ac_optarg" ;;
+
+  -disable-* | --disable-*)
+    ac_feature=`echo $ac_option|sed -e 's/-*disable-//'`
+    # Reject names that are not valid shell variable names.
+    if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then
+      { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
+    fi
+    ac_feature=`echo $ac_feature| sed 's/-/_/g'`
+    eval "enable_${ac_feature}=no" ;;
+
+  -enable-* | --enable-*)
+    ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'`
+    # Reject names that are not valid shell variable names.
+    if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then
+      { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
+    fi
+    ac_feature=`echo $ac_feature| sed 's/-/_/g'`
+    case "$ac_option" in
+      *=*) ;;
+      *) 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)
+    # 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 << EOF
+Usage: configure [options] [host]
+Options: [defaults in brackets after descriptions]
+Configuration:
+  --cache-file=FILE       cache test results in FILE
+  --help                  print this message
+  --no-create             do not create output files
+  --quiet, --silent       do not print \`checking...' messages
+  --version               print the version of autoconf that created configure
+Directory and file names:
+  --prefix=PREFIX         install architecture-independent files in PREFIX
+                          [$ac_default_prefix]
+  --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
+                          [same as prefix]
+  --bindir=DIR            user executables in DIR [EPREFIX/bin]
+  --sbindir=DIR           system admin executables in DIR [EPREFIX/sbin]
+  --libexecdir=DIR        program executables in DIR [EPREFIX/libexec]
+  --datadir=DIR           read-only architecture-independent data in DIR
+                          [PREFIX/share]
+  --sysconfdir=DIR        read-only single-machine data in DIR [PREFIX/etc]
+  --sharedstatedir=DIR    modifiable architecture-independent data in DIR
+                          [PREFIX/com]
+  --localstatedir=DIR     modifiable single-machine data in DIR [PREFIX/var]
+  --libdir=DIR            object code libraries in DIR [EPREFIX/lib]
+  --includedir=DIR        C header files in DIR [PREFIX/include]
+  --oldincludedir=DIR     C header files for non-gcc in DIR [/usr/include]
+  --infodir=DIR           info documentation in DIR [PREFIX/info]
+  --mandir=DIR            man documentation in DIR [PREFIX/man]
+  --srcdir=DIR            find the sources in DIR [configure dir or ..]
+  --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
+EOF
+    cat << EOF
+Host type:
+  --build=BUILD           configure for building on BUILD [BUILD=HOST]
+  --host=HOST             configure for HOST [guessed]
+  --target=TARGET         configure for TARGET [TARGET=HOST]
+Features and packages:
+  --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
+  --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
+  --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
+  --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
+  --x-includes=DIR        X include files are in DIR
+  --x-libraries=DIR       X library files are in DIR
+EOF
+    if test -n "$ac_help"; then
+      echo "--enable and --with options recognized:$ac_help"
+    fi
+    exit 0 ;;
+
+  -host | --host | --hos | --ho)
+    ac_prev=host ;;
+  -host=* | --host=* | --hos=* | --ho=*)
+    host="$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)
+    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 ;;
+  -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
+    target="$ac_optarg" ;;
+
+  -v | -verbose | --verbose | --verbos | --verbo | --verb)
+    verbose=yes ;;
+
+  -version | --version | --versio | --versi | --vers)
+    echo "configure generated by autoconf version 2.13"
+    exit 0 ;;
+
+  -with-* | --with-*)
+    ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'`
+    # Reject names that are not valid shell variable names.
+    if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then
+      { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
+    fi
+    ac_package=`echo $ac_package| sed 's/-/_/g'`
+    case "$ac_option" in
+      *=*) ;;
+      *) ac_optarg=yes ;;
+    esac
+    eval "with_${ac_package}='$ac_optarg'" ;;
+
+  -without-* | --without-*)
+    ac_package=`echo $ac_option|sed -e 's/-*without-//'`
+    # Reject names that are not valid shell variable names.
+    if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then
+      { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
+    fi
+    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 "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; }
+    ;;
+
+  *)
+    if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then
+      echo "configure: warning: $ac_option: invalid host type" 1>&2
+    fi
+    if test "x$nonopt" != xNONE; then
+      { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; }
+    fi
+    nonopt="$ac_option"
+    ;;
+
+  esac
+done
+
+if test -n "$ac_prev"; then
+  { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; }
+fi
+
+trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
+
+# File descriptor usage:
+# 0 standard input
+# 1 file creation
+# 2 errors and warnings
+# 3 some systems may open it to /dev/tty
+# 4 used on the Kubota Titan
+# 6 checking for... messages and results
+# 5 compiler messages saved in config.log
+if test "$silent" = yes; then
+  exec 6>/dev/null
+else
+  exec 6>&1
+fi
+exec 5>./config.log
+
+echo "\
+This file contains any messages produced by compilers while
+running configure, to aid debugging if configure makes a mistake.
+" 1>&5
+
+# Strip out --no-create and --no-recursion so they do not pile up.
+# Also quote any args containing shell metacharacters.
+ac_configure_args=
+for ac_arg
+do
+  case "$ac_arg" in
+  -no-create | --no-create | --no-creat | --no-crea | --no-cre \
+  | --no-cr | --no-c) ;;
+  -no-recursion | --no-recursion | --no-recursio | --no-recursi \
+  | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
+  *" "*|*"     "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
+  ac_configure_args="$ac_configure_args '$ac_arg'" ;;
+  *) ac_configure_args="$ac_configure_args $ac_arg" ;;
+  esac
+done
+
+# NLS nuisances.
+# Only set these to C if already set.  These must not be set unconditionally
+# because not all systems understand e.g. LANG=C (notably SCO).
+# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
+# Non-C LC_CTYPE values break the ctype check.
+if test "${LANG+set}"   = set; then LANG=C;   export LANG;   fi
+if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
+if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
+if test "${LC_CTYPE+set}"    = set; then LC_CTYPE=C;    export LC_CTYPE;    fi
+
+# 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
+
+# A filename unique to this package, relative to the directory that
+# configure is in, which we can look for to find out if srcdir is correct.
+ac_unique_file=Source/robodoc.h
+
+# 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_prog=$0
+  ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'`
+  test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
+  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 "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; }
+  else
+    { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; }
+  fi
+fi
+srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
+
+# 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 "loading site script $ac_site_file"
+    . "$ac_site_file"
+  fi
+done
+
+if test -r "$cache_file"; then
+  echo "loading cache $cache_file"
+  . $cache_file
+else
+  echo "creating cache $cache_file"
+  > $cache_file
+fi
+
+ac_ext=c
+# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cc_cross
+
+ac_exeext=
+ac_objext=o
+if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
+  # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
+  if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
+    ac_n= ac_c='
+' ac_t='       '
+  else
+    ac_n=-n ac_c= ac_t=
+  fi
+else
+  ac_n= ac_c='\c' ac_t=
+fi
+
+
+
+
+
+
+
+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
+  fi
+done
+if test -z "$ac_aux_dir"; then
+  { echo "configure: error: can not find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." 1>&2; exit 1; }
+fi
+ac_config_guess=$ac_aux_dir/config.guess
+ac_config_sub=$ac_aux_dir/config.sub
+ac_configure=$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
+# 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 $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
+echo "configure:561: checking for a BSD compatible install" >&5
+if test -z "$INSTALL"; then
+if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+    IFS="${IFS=        }"; ac_save_IFS="$IFS"; IFS=":"
+  for ac_dir in $PATH; do
+    # Account for people who put trailing slashes in PATH elements.
+    case "$ac_dir/" in
+    /|./|.//|/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
+        if test -f $ac_dir/$ac_prog; then
+         if test $ac_prog = install &&
+            grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
+           # AIX install.  It has an incompatible calling convention.
+           :
+         else
+           ac_cv_path_install="$ac_dir/$ac_prog -c"
+           break 2
+         fi
+       fi
+      done
+      ;;
+    esac
+  done
+  IFS="$ac_save_IFS"
+
+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 "$ac_t""$INSTALL" 1>&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_PROGRAM}'
+
+test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
+
+echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6
+echo "configure:614: checking whether build environment is sane" >&5
+# Just in case
+sleep 1
+echo timestamp > conftestfile
+# 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 conftestfile 2> /dev/null`
+   if test "$*" = "X"; then
+      # -L didn't work.
+      set X `ls -t $srcdir/configure conftestfile`
+   fi
+   if test "$*" != "X $srcdir/configure conftestfile" \
+      && test "$*" != "X conftestfile $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 "configure: error: ls -t appears to fail.  Make sure there is not a broken
+alias in your environment" 1>&2; exit 1; }
+   fi
+
+   test "$2" = conftestfile
+   )
+then
+   # Ok.
+   :
+else
+   { echo "configure: error: newly created file is older than distributed files!
+Check your system clock" 1>&2; exit 1; }
+fi
+rm -f conftest*
+echo "$ac_t""yes" 1>&6
+if test "$program_transform_name" = s,x,x,; then
+  program_transform_name=
+else
+  # Double any \ or $.  echo might interpret backslashes.
+  cat <<\EOF_SED > conftestsed
+s,\\,\\\\,g; s,\$,$$,g
+EOF_SED
+  program_transform_name="`echo $program_transform_name|sed -f conftestsed`"
+  rm -f conftestsed
+fi
+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"
+
+# sed with no file args requires a program.
+test "$program_transform_name" = "" && program_transform_name="s,x,x,"
+
+echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
+echo "configure:671: checking whether ${MAKE-make} sets \${MAKE}" >&5
+set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  cat > conftestmake <<\EOF
+all:
+       @echo 'ac_maketemp="${MAKE}"'
+EOF
+# GNU make sometimes prints "make[1]: Entering...", which would confuse us.
+eval `${MAKE-make} -f conftestmake 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 conftestmake
+fi
+if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+  SET_MAKE=
+else
+  echo "$ac_t""no" 1>&6
+  SET_MAKE="MAKE=${MAKE-make}"
+fi
+
+
+PACKAGE=robodoc
+
+VERSION=3.2.3
+
+if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
+  { echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; }
+fi
+cat >> confdefs.h <<EOF
+#define PACKAGE "$PACKAGE"
+EOF
+
+cat >> confdefs.h <<EOF
+#define VERSION "$VERSION"
+EOF
+
+
+
+missing_dir=`cd $ac_aux_dir && pwd`
+echo $ac_n "checking for working aclocal""... $ac_c" 1>&6
+echo "configure:717: checking for working aclocal" >&5
+# Run test in a subshell; some versions of sh will print an error if
+# an executable is not found, even if stderr is redirected.
+# Redirect stdin to placate older versions of autoconf.  Sigh.
+if (aclocal --version) < /dev/null > /dev/null 2>&1; then
+   ACLOCAL=aclocal
+   echo "$ac_t""found" 1>&6
+else
+   ACLOCAL="$missing_dir/missing aclocal"
+   echo "$ac_t""missing" 1>&6
+fi
+
+echo $ac_n "checking for working autoconf""... $ac_c" 1>&6
+echo "configure:730: checking for working autoconf" >&5
+# Run test in a subshell; some versions of sh will print an error if
+# an executable is not found, even if stderr is redirected.
+# Redirect stdin to placate older versions of autoconf.  Sigh.
+if (autoconf --version) < /dev/null > /dev/null 2>&1; then
+   AUTOCONF=autoconf
+   echo "$ac_t""found" 1>&6
+else
+   AUTOCONF="$missing_dir/missing autoconf"
+   echo "$ac_t""missing" 1>&6
+fi
+
+echo $ac_n "checking for working automake""... $ac_c" 1>&6
+echo "configure:743: checking for working automake" >&5
+# Run test in a subshell; some versions of sh will print an error if
+# an executable is not found, even if stderr is redirected.
+# Redirect stdin to placate older versions of autoconf.  Sigh.
+if (automake --version) < /dev/null > /dev/null 2>&1; then
+   AUTOMAKE=automake
+   echo "$ac_t""found" 1>&6
+else
+   AUTOMAKE="$missing_dir/missing automake"
+   echo "$ac_t""missing" 1>&6
+fi
+
+echo $ac_n "checking for working autoheader""... $ac_c" 1>&6
+echo "configure:756: checking for working autoheader" >&5
+# Run test in a subshell; some versions of sh will print an error if
+# an executable is not found, even if stderr is redirected.
+# Redirect stdin to placate older versions of autoconf.  Sigh.
+if (autoheader --version) < /dev/null > /dev/null 2>&1; then
+   AUTOHEADER=autoheader
+   echo "$ac_t""found" 1>&6
+else
+   AUTOHEADER="$missing_dir/missing autoheader"
+   echo "$ac_t""missing" 1>&6
+fi
+
+echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6
+echo "configure:769: checking for working makeinfo" >&5
+# Run test in a subshell; some versions of sh will print an error if
+# an executable is not found, even if stderr is redirected.
+# Redirect stdin to placate older versions of autoconf.  Sigh.
+if (makeinfo --version) < /dev/null > /dev/null 2>&1; then
+   MAKEINFO=makeinfo
+   echo "$ac_t""found" 1>&6
+else
+   MAKEINFO="$missing_dir/missing makeinfo"
+   echo "$ac_t""missing" 1>&6
+fi
+
+
+
+echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
+echo "configure:784: checking whether ${MAKE-make} sets \${MAKE}" >&5
+set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  cat > conftestmake <<\EOF
+all:
+       @echo 'ac_maketemp="${MAKE}"'
+EOF
+# GNU make sometimes prints "make[1]: Entering...", which would confuse us.
+eval `${MAKE-make} -f conftestmake 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 conftestmake
+fi
+if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+  SET_MAKE=
+else
+  echo "$ac_t""no" 1>&6
+  SET_MAKE="MAKE=${MAKE-make}"
+fi
+
+
+# Extract the first word of "gcc", so it can be a program name with args.
+set dummy gcc; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:814: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+  IFS="${IFS=  }"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      ac_cv_prog_CC="gcc"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+fi
+fi
+CC="$ac_cv_prog_CC"
+if test -n "$CC"; then
+  echo "$ac_t""$CC" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+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 $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:844: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+  IFS="${IFS=  }"; ac_save_ifs="$IFS"; IFS=":"
+  ac_prog_rejected=no
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
+        ac_prog_rejected=yes
+       continue
+      fi
+      ac_cv_prog_CC="cc"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+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 $# -gt 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
+    set dummy "$ac_dir/$ac_word" "$@"
+    shift
+    ac_cv_prog_CC="$@"
+  fi
+fi
+fi
+fi
+CC="$ac_cv_prog_CC"
+if test -n "$CC"; then
+  echo "$ac_t""$CC" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+  if test -z "$CC"; then
+    case "`uname -s`" in
+    *win32* | *WIN32*)
+      # Extract the first word of "cl", so it can be a program name with args.
+set dummy cl; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:895: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+  IFS="${IFS=  }"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      ac_cv_prog_CC="cl"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+fi
+fi
+CC="$ac_cv_prog_CC"
+if test -n "$CC"; then
+  echo "$ac_t""$CC" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+ ;;
+    esac
+  fi
+  test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
+fi
+
+echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
+echo "configure:927: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+
+ac_ext=c
+# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cc_cross
+
+cat > conftest.$ac_ext << EOF
+
+#line 938 "configure"
+#include "confdefs.h"
+
+main(){return(0);}
+EOF
+if { (eval echo configure:943: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  ac_cv_prog_cc_works=yes
+  # If we can't run a trivial program, we are probably using a cross compiler.
+  if (./conftest; exit) 2>/dev/null; then
+    ac_cv_prog_cc_cross=no
+  else
+    ac_cv_prog_cc_cross=yes
+  fi
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  ac_cv_prog_cc_works=no
+fi
+rm -fr conftest*
+ac_ext=c
+# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cc_cross
+
+echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
+if test $ac_cv_prog_cc_works = no; then
+  { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
+fi
+echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
+echo "configure:969: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
+cross_compiling=$ac_cv_prog_cc_cross
+
+echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
+echo "configure:974: checking whether we are using GNU C" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  cat > conftest.c <<EOF
+#ifdef __GNUC__
+  yes;
+#endif
+EOF
+if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:983: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+  ac_cv_prog_gcc=yes
+else
+  ac_cv_prog_gcc=no
+fi
+fi
+
+echo "$ac_t""$ac_cv_prog_gcc" 1>&6
+
+if test $ac_cv_prog_gcc = yes; then
+  GCC=yes
+else
+  GCC=
+fi
+
+ac_test_CFLAGS="${CFLAGS+set}"
+ac_save_CFLAGS="$CFLAGS"
+CFLAGS=
+echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
+echo "configure:1002: checking whether ${CC-cc} accepts -g" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  echo 'void f(){}' > conftest.c
+if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
+  ac_cv_prog_cc_g=yes
+else
+  ac_cv_prog_cc_g=no
+fi
+rm -f conftest*
+
+fi
+
+echo "$ac_t""$ac_cv_prog_cc_g" 1>&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 $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
+echo "configure:1036: checking how to run the C preprocessor" >&5
+# On Suns, sometimes $CPP names a directory.
+if test -n "$CPP" && test -d "$CPP"; then
+  CPP=
+fi
+if test -z "$CPP"; then
+if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+    # This must be in double quotes, not single quotes, because CPP may get
+  # substituted into the Makefile and "${CC-cc}" will confuse make.
+  CPP="${CC-cc} -E"
+  # On the NeXT, cc -E runs the code through the compiler's parser,
+  # not just through cpp.
+  cat > conftest.$ac_ext <<EOF
+#line 1051 "configure"
+#include "confdefs.h"
+#include <assert.h>
+Syntax Error
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:1057: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if test -z "$ac_err"; then
+  :
+else
+  echo "$ac_err" >&5
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  CPP="${CC-cc} -E -traditional-cpp"
+  cat > conftest.$ac_ext <<EOF
+#line 1068 "configure"
+#include "confdefs.h"
+#include <assert.h>
+Syntax Error
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:1074: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if test -z "$ac_err"; then
+  :
+else
+  echo "$ac_err" >&5
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  CPP="${CC-cc} -nologo -E"
+  cat > conftest.$ac_ext <<EOF
+#line 1085 "configure"
+#include "confdefs.h"
+#include <assert.h>
+Syntax Error
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:1091: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if test -z "$ac_err"; then
+  :
+else
+  echo "$ac_err" >&5
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  CPP=/lib/cpp
+fi
+rm -f conftest*
+fi
+rm -f conftest*
+fi
+rm -f conftest*
+  ac_cv_prog_CPP="$CPP"
+fi
+  CPP="$ac_cv_prog_CPP"
+else
+  ac_cv_prog_CPP="$CPP"
+fi
+echo "$ac_t""$CPP" 1>&6
+
+echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
+echo "configure:1116: checking for ANSI C header files" >&5
+if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  cat > conftest.$ac_ext <<EOF
+#line 1121 "configure"
+#include "confdefs.h"
+#include <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+#include <float.h>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:1129: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if test -z "$ac_err"; then
+  rm -rf conftest*
+  ac_cv_header_stdc=yes
+else
+  echo "$ac_err" >&5
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+if test $ac_cv_header_stdc = yes; then
+  # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
+cat > conftest.$ac_ext <<EOF
+#line 1146 "configure"
+#include "confdefs.h"
+#include <string.h>
+EOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  egrep "memchr" >/dev/null 2>&1; then
+  :
+else
+  rm -rf conftest*
+  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 <<EOF
+#line 1164 "configure"
+#include "confdefs.h"
+#include <stdlib.h>
+EOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  egrep "free" >/dev/null 2>&1; then
+  :
+else
+  rm -rf conftest*
+  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 <<EOF
+#line 1185 "configure"
+#include "confdefs.h"
+#include <ctype.h>
+#define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
+#define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
+#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); }
+
+EOF
+if { (eval echo configure:1196: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+then
+  :
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -fr conftest*
+  ac_cv_header_stdc=no
+fi
+rm -fr conftest*
+fi
+
+fi
+fi
+
+echo "$ac_t""$ac_cv_header_stdc" 1>&6
+if test $ac_cv_header_stdc = yes; then
+  cat >> confdefs.h <<\EOF
+#define STDC_HEADERS 1
+EOF
+
+fi
+
+
+echo $ac_n "checking for working const""... $ac_c" 1>&6
+echo "configure:1221: checking for working const" >&5
+if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  cat > conftest.$ac_ext <<EOF
+#line 1226 "configure"
+#include "confdefs.h"
+
+int main() {
+
+/* 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;
+}
+
+; return 0; }
+EOF
+if { (eval echo configure:1275: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  rm -rf conftest*
+  ac_cv_c_const=yes
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  ac_cv_c_const=no
+fi
+rm -f conftest*
+fi
+
+echo "$ac_t""$ac_cv_c_const" 1>&6
+if test $ac_cv_c_const = no; then
+  cat >> confdefs.h <<\EOF
+#define const 
+EOF
+
+fi
+
+echo $ac_n "checking for size_t""... $ac_c" 1>&6
+echo "configure:1296: checking for size_t" >&5
+if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  cat > conftest.$ac_ext <<EOF
+#line 1301 "configure"
+#include "confdefs.h"
+#include <sys/types.h>
+#if STDC_HEADERS
+#include <stdlib.h>
+#include <stddef.h>
+#endif
+EOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  egrep "(^|[^a-zA-Z_0-9])size_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
+  rm -rf conftest*
+  ac_cv_type_size_t=yes
+else
+  rm -rf conftest*
+  ac_cv_type_size_t=no
+fi
+rm -f conftest*
+
+fi
+echo "$ac_t""$ac_cv_type_size_t" 1>&6
+if test $ac_cv_type_size_t = no; then
+  cat >> confdefs.h <<\EOF
+#define size_t unsigned
+EOF
+
+fi
+
+
+echo $ac_n "checking for strftime""... $ac_c" 1>&6
+echo "configure:1330: checking for strftime" >&5
+if eval "test \"`echo '$''{'ac_cv_func_strftime'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  cat > conftest.$ac_ext <<EOF
+#line 1335 "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char strftime(); below.  */
+#include <assert.h>
+/* Override any gcc2 internal prototype to avoid an error.  */
+/* 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() {
+
+/* 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_strftime) || defined (__stub___strftime)
+choke me
+#else
+strftime();
+#endif
+
+; return 0; }
+EOF
+if { (eval echo configure:1358: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  eval "ac_cv_func_strftime=yes"
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_func_strftime=no"
+fi
+rm -f conftest*
+fi
+
+if eval "test \"`echo '$ac_cv_func_'strftime`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+  cat >> confdefs.h <<\EOF
+#define HAVE_STRFTIME 1
+EOF
+
+else
+  echo "$ac_t""no" 1>&6
+# strftime is in -lintl on SCO UNIX.
+echo $ac_n "checking for strftime in -lintl""... $ac_c" 1>&6
+echo "configure:1380: checking for strftime in -lintl" >&5
+ac_lib_var=`echo intl'_'strftime | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  ac_save_LIBS="$LIBS"
+LIBS="-lintl  $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 1388 "configure"
+#include "confdefs.h"
+/* Override any gcc2 internal prototype to avoid an error.  */
+/* 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; }
+EOF
+if { (eval echo configure:1399: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  eval "ac_cv_lib_$ac_lib_var=yes"
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_lib_$ac_lib_var=no"
+fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
+
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+  cat >> confdefs.h <<\EOF
+#define HAVE_STRFTIME 1
+EOF
+
+LIBS="-lintl $LIBS"
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+fi
+
+echo $ac_n "checking for vprintf""... $ac_c" 1>&6
+echo "configure:1426: checking for vprintf" >&5
+if eval "test \"`echo '$''{'ac_cv_func_vprintf'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  cat > conftest.$ac_ext <<EOF
+#line 1431 "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char vprintf(); below.  */
+#include <assert.h>
+/* Override any gcc2 internal prototype to avoid an error.  */
+/* We use char because int might match the return type of a gcc2
+    builtin and then its argument prototype would still apply.  */
+char vprintf();
+
+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_vprintf) || defined (__stub___vprintf)
+choke me
+#else
+vprintf();
+#endif
+
+; return 0; }
+EOF
+if { (eval echo configure:1454: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  eval "ac_cv_func_vprintf=yes"
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_func_vprintf=no"
+fi
+rm -f conftest*
+fi
+
+if eval "test \"`echo '$ac_cv_func_'vprintf`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+  cat >> confdefs.h <<\EOF
+#define HAVE_VPRINTF 1
+EOF
+
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+if test "$ac_cv_func_vprintf" != yes; then
+echo $ac_n "checking for _doprnt""... $ac_c" 1>&6
+echo "configure:1478: checking for _doprnt" >&5
+if eval "test \"`echo '$''{'ac_cv_func__doprnt'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  cat > conftest.$ac_ext <<EOF
+#line 1483 "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.  */
+/* We use char because int might match the return type of a gcc2
+    builtin and then its argument prototype would still apply.  */
+char _doprnt();
+
+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
+_doprnt();
+#endif
+
+; return 0; }
+EOF
+if { (eval echo configure:1506: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  eval "ac_cv_func__doprnt=yes"
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_func__doprnt=no"
+fi
+rm -f conftest*
+fi
+
+if eval "test \"`echo '$ac_cv_func_'_doprnt`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+  cat >> confdefs.h <<\EOF
+#define HAVE_DOPRNT 1
+EOF
+
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+fi
+
+for ac_func in strstr
+do
+echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
+echo "configure:1533: checking for $ac_func" >&5
+if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  cat > conftest.$ac_ext <<EOF
+#line 1538 "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.  */
+/* 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();
+
+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
+$ac_func();
+#endif
+
+; return 0; }
+EOF
+if { (eval echo configure:1561: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  eval "ac_cv_func_$ac_func=yes"
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_func_$ac_func=no"
+fi
+rm -f conftest*
+fi
+
+if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+    ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
+  cat >> confdefs.h <<EOF
+#define $ac_tr_func 1
+EOF
+else
+  echo "$ac_t""no" 1>&6
+fi
+done
+
+
+trap '' 1 2 15
+cat > confcache <<\EOF
+# 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.  It is not useful on other systems.
+# If it contains results you don't want to keep, you may remove or edit it.
+#
+# By default, configure uses ./config.cache as the cache file,
+# creating it if it does not exist already.  You can give configure
+# the --cache-file=FILE option to use a different cache file; that is
+# what configure does when it calls configure scripts in
+# subdirectories, so they share the cache.
+# Giving --cache-file=/dev/null disables caching, for debugging configure.
+# config.status only pays attention to the cache file if you give it the
+# --recheck option to rerun configure.
+#
+EOF
+# 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 \
+      -e "s/'/'\\\\''/g" \
+      -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p"
+    ;;
+  *)
+    # `set' quotes correctly as required by POSIX, so do not add quotes.
+    sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p'
+    ;;
+  esac >> confcache
+if cmp -s $cache_file confcache; then
+  :
+else
+  if test -w $cache_file; then
+    echo "updating cache $cache_file"
+    cat confcache > $cache_file
+  else
+    echo "not updating unwritable cache $cache_file"
+  fi
+fi
+rm -f confcache
+
+trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
+
+test "x$prefix" = xNONE && prefix=$ac_default_prefix
+# Let make expand exec_prefix.
+test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
+
+# Any assignment to VPATH causes Sun make to only execute
+# the first set of double-colon rules, so remove it if not needed.
+# If there is a colon in the path, we need to keep it.
+if test "x$srcdir" = x.; then
+  ac_vpsub='/^[        ]*VPATH[        ]*=[^:]*$/d'
+fi
+
+trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
+
+DEFS=-DHAVE_CONFIG_H
+
+# Without the "./", some shells look in PATH for config.status.
+: ${CONFIG_STATUS=./config.status}
+
+echo creating $CONFIG_STATUS
+rm -f $CONFIG_STATUS
+cat > $CONFIG_STATUS <<EOF
+#! /bin/sh
+# Generated automatically by configure.
+# Run this file to recreate the current configuration.
+# This directory was configured as follows,
+# on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+#
+# $0 $ac_configure_args
+#
+# Compiler output produced by configure, useful for debugging
+# configure, is in ./config.log if it exists.
+
+ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
+for ac_option
+do
+  case "\$ac_option" in
+  -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
+    echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
+    exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
+  -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
+    echo "$CONFIG_STATUS generated by autoconf version 2.13"
+    exit 0 ;;
+  -help | --help | --hel | --he | --h)
+    echo "\$ac_cs_usage"; exit 0 ;;
+  *) echo "\$ac_cs_usage"; exit 1 ;;
+  esac
+done
+
+ac_given_srcdir=$srcdir
+ac_given_INSTALL="$INSTALL"
+
+trap 'rm -fr `echo "makefile Docs/makefile Source/makefile Source/config.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
+EOF
+cat >> $CONFIG_STATUS <<EOF
+
+# Protect against being on the right side of a sed subst in config.status.
+sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
+ s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
+$ac_vpsub
+$extrasub
+s%@SHELL@%$SHELL%g
+s%@CFLAGS@%$CFLAGS%g
+s%@CPPFLAGS@%$CPPFLAGS%g
+s%@CXXFLAGS@%$CXXFLAGS%g
+s%@FFLAGS@%$FFLAGS%g
+s%@DEFS@%$DEFS%g
+s%@LDFLAGS@%$LDFLAGS%g
+s%@LIBS@%$LIBS%g
+s%@exec_prefix@%$exec_prefix%g
+s%@prefix@%$prefix%g
+s%@program_transform_name@%$program_transform_name%g
+s%@bindir@%$bindir%g
+s%@sbindir@%$sbindir%g
+s%@libexecdir@%$libexecdir%g
+s%@datadir@%$datadir%g
+s%@sysconfdir@%$sysconfdir%g
+s%@sharedstatedir@%$sharedstatedir%g
+s%@localstatedir@%$localstatedir%g
+s%@libdir@%$libdir%g
+s%@includedir@%$includedir%g
+s%@oldincludedir@%$oldincludedir%g
+s%@infodir@%$infodir%g
+s%@mandir@%$mandir%g
+s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
+s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g
+s%@INSTALL_DATA@%$INSTALL_DATA%g
+s%@PACKAGE@%$PACKAGE%g
+s%@VERSION@%$VERSION%g
+s%@ACLOCAL@%$ACLOCAL%g
+s%@AUTOCONF@%$AUTOCONF%g
+s%@AUTOMAKE@%$AUTOMAKE%g
+s%@AUTOHEADER@%$AUTOHEADER%g
+s%@MAKEINFO@%$MAKEINFO%g
+s%@SET_MAKE@%$SET_MAKE%g
+s%@CC@%$CC%g
+s%@CPP@%$CPP%g
+
+CEOF
+EOF
+
+cat >> $CONFIG_STATUS <<\EOF
+
+# 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_cmds=90 # Maximum number of lines to put in a sed script.
+ac_file=1 # Number of current file.
+ac_beg=1 # First line for current file.
+ac_end=$ac_max_sed_cmds # 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" conftest.subs > conftest.s$ac_file
+  else
+    sed "${ac_end}q" conftest.subs > conftest.s$ac_file
+  fi
+  if test ! -s conftest.s$ac_file; then
+    ac_more_lines=false
+    rm -f conftest.s$ac_file
+  else
+    if test -z "$ac_sed_cmds"; then
+      ac_sed_cmds="sed -f conftest.s$ac_file"
+    else
+      ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
+    fi
+    ac_file=`expr $ac_file + 1`
+    ac_beg=$ac_end
+    ac_end=`expr $ac_end + $ac_max_sed_cmds`
+  fi
+done
+if test -z "$ac_sed_cmds"; then
+  ac_sed_cmds=cat
+fi
+EOF
+
+cat >> $CONFIG_STATUS <<EOF
+
+CONFIG_FILES=\${CONFIG_FILES-"makefile Docs/makefile Source/makefile"}
+EOF
+cat >> $CONFIG_STATUS <<\EOF
+for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
+  # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
+  case "$ac_file" in
+  *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
+       ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
+  *) ac_file_in="${ac_file}.in" ;;
+  esac
+
+  # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
+
+  # Remove last slash and all that follows it.  Not all systems have dirname.
+  ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
+  if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
+    # The file is in a subdirectory.
+    test ! -d "$ac_dir" && mkdir "$ac_dir"
+    ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
+    # A "../" for each directory in $ac_dir_suffix.
+    ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
+  else
+    ac_dir_suffix= ac_dots=
+  fi
+
+  case "$ac_given_srcdir" in
+  .)  srcdir=.
+      if test -z "$ac_dots"; then top_srcdir=.
+      else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
+  /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
+  *) # Relative path.
+    srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
+    top_srcdir="$ac_dots$ac_given_srcdir" ;;
+  esac
+
+  case "$ac_given_INSTALL" in
+  [/$]*) INSTALL="$ac_given_INSTALL" ;;
+  *) INSTALL="$ac_dots$ac_given_INSTALL" ;;
+  esac
+
+  echo creating "$ac_file"
+  rm -f "$ac_file"
+  configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
+  case "$ac_file" in
+  *Makefile*) ac_comsub="1i\\
+# $configure_input" ;;
+  *) ac_comsub= ;;
+  esac
+
+  ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
+  sed -e "$ac_comsub
+s%@configure_input@%$configure_input%g
+s%@srcdir@%$srcdir%g
+s%@top_srcdir@%$top_srcdir%g
+s%@INSTALL@%$INSTALL%g
+" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
+fi; done
+rm -f conftest.s*
+
+# 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='\3'
+ac_dD='%g'
+# ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
+ac_uA='s%^\([  ]*\)#\([        ]*\)undef\([    ][      ]*\)'
+ac_uB='\([     ]\)%\1#\2define\3'
+ac_uC=' '
+ac_uD='\4%g'
+# ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
+ac_eA='s%^\([  ]*\)#\([        ]*\)undef\([    ][      ]*\)'
+ac_eB='$%\1#\2define\3'
+ac_eC=' '
+ac_eD='%g'
+
+if test "${CONFIG_HEADERS+set}" != set; then
+EOF
+cat >> $CONFIG_STATUS <<EOF
+  CONFIG_HEADERS="Source/config.h"
+EOF
+cat >> $CONFIG_STATUS <<\EOF
+fi
+for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then
+  # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
+  case "$ac_file" in
+  *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
+       ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
+  *) ac_file_in="${ac_file}.in" ;;
+  esac
+
+  echo creating $ac_file
+
+  rm -f conftest.frag conftest.in conftest.out
+  ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
+  cat $ac_file_inputs > conftest.in
+
+EOF
+
+# Transform confdefs.h into a sed script conftest.vals that substitutes
+# the proper values into config.h.in to produce config.h.  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.vals
+cat > conftest.hdr <<\EOF
+s/[\\&%]/\\&/g
+s%[\\$`]%\\&%g
+s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp
+s%ac_d%ac_u%gp
+s%ac_u%ac_e%gp
+EOF
+sed -n -f conftest.hdr confdefs.h > conftest.vals
+rm -f conftest.hdr
+
+# 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.vals <<\EOF
+s%^[   ]*#[    ]*undef[        ][      ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */%
+EOF
+
+# Break up conftest.vals because some shells have a limit on
+# the size of here documents, and old seds have small limits too.
+
+rm -f conftest.tail
+while :
+do
+  ac_lines=`grep -c . conftest.vals`
+  # grep -c gives empty output for an empty file on some AIX systems.
+  if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi
+  # Write a limited-size here document to conftest.frag.
+  echo '  cat > conftest.frag <<CEOF' >> $CONFIG_STATUS
+  sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS
+  echo 'CEOF
+  sed -f conftest.frag conftest.in > conftest.out
+  rm -f conftest.in
+  mv conftest.out conftest.in
+' >> $CONFIG_STATUS
+  sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
+  rm -f conftest.vals
+  mv conftest.tail conftest.vals
+done
+rm -f conftest.vals
+
+cat >> $CONFIG_STATUS <<\EOF
+  rm -f conftest.frag conftest.h
+  echo "/* $ac_file.  Generated automatically by configure.  */" > conftest.h
+  cat conftest.in >> conftest.h
+  rm -f conftest.in
+  if cmp -s $ac_file conftest.h 2>/dev/null; then
+    echo "$ac_file is unchanged"
+    rm -f conftest.h
+  else
+    # Remove last slash and all that follows it.  Not all systems have dirname.
+      ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
+      if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
+      # The file is in a subdirectory.
+      test ! -d "$ac_dir" && mkdir "$ac_dir"
+    fi
+    rm -f $ac_file
+    mv conftest.h $ac_file
+  fi
+fi; done
+
+EOF
+cat >> $CONFIG_STATUS <<EOF
+
+
+EOF
+cat >> $CONFIG_STATUS <<\EOF
+test -z "$CONFIG_HEADERS" || echo timestamp > Source/stamp-h
+
+exit 0
+EOF
+chmod +x $CONFIG_STATUS
+rm -fr confdefs* $ac_clean_files
+test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1
+
+
diff --git a/util/robodoc/configure.in b/util/robodoc/configure.in
new file mode 100644 (file)
index 0000000..6c0f5af
--- /dev/null
@@ -0,0 +1,29 @@
+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
new file mode 100755 (executable)
index 0000000..e9de238
--- /dev/null
@@ -0,0 +1,251 @@
+#!/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
new file mode 100644 (file)
index 0000000..4fd7cf2
--- /dev/null
@@ -0,0 +1,87 @@
+## 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
new file mode 100644 (file)
index 0000000..0d3a54b
--- /dev/null
@@ -0,0 +1,430 @@
+# 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.
+
+#
+# Information for automake
+#
+
+
+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@
+
+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
+
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
+CONFIG_HEADER = ./Source/config.h
+CONFIG_CLEAN_FILES = 
+DATA =  $(doc_DATA)
+
+DIST_COMMON =  README AUTHORS COPYING ChangeLog INSTALL NEWS \
+Source/config.h.in Source/stamp-h.in TODO aclocal.m4 configure \
+configure.in install-sh makefile.am makefile.in missing mkinstalldirs
+
+
+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 makefile
+
+makefile: $(srcdir)/makefile.in  $(top_builddir)/config.status
+       cd $(top_builddir) \
+         && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status
+
+$(ACLOCAL_M4):  configure.in 
+       cd $(srcdir) && $(ACLOCAL)
+
+config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+       $(SHELL) ./config.status --recheck
+$(srcdir)/configure: $(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES)
+       cd $(srcdir) && $(AUTOCONF)
+
+Source/config.h: Source/stamp-h
+       @if test ! -f $@; then \
+               rm -f Source/stamp-h; \
+               $(MAKE) Source/stamp-h; \
+       else :; fi
+Source/stamp-h: $(srcdir)/Source/config.h.in $(top_builddir)/config.status
+       cd $(top_builddir) \
+         && CONFIG_FILES= CONFIG_HEADERS=Source/config.h \
+            $(SHELL) ./config.status
+       @echo timestamp > Source/stamp-h 2> /dev/null
+$(srcdir)/Source/config.h.in: $(srcdir)/Source/stamp-h.in
+       @if test ! -f $@; then \
+               rm -f $(srcdir)/Source/stamp-h.in; \
+               $(MAKE) $(srcdir)/Source/stamp-h.in; \
+       else :; fi
+$(srcdir)/Source/stamp-h.in: $(top_srcdir)/configure.in $(ACLOCAL_M4) 
+       cd $(top_srcdir) && $(AUTOHEADER)
+       @echo timestamp > $(srcdir)/Source/stamp-h.in 2> /dev/null
+
+mostlyclean-hdr:
+
+clean-hdr:
+
+distclean-hdr:
+       -rm -f Source/config.h
+
+maintainer-clean-hdr:
+
+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
+
+# 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.
+
+@SET_MAKE@
+
+all-recursive install-data-recursive install-exec-recursive \
+installdirs-recursive install-recursive uninstall-recursive  \
+check-recursive installcheck-recursive info-recursive dvi-recursive:
+       @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; \
+       rev=''; list='$(SUBDIRS)'; for subdir in $$list; do \
+         rev="$$subdir $$rev"; \
+         test "$$subdir" = "." && dot_seen=yes; \
+       done; \
+       test "$$dot_seen" = "no" && 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
+
+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: tags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) $(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)'; \
+       unique=`for i in $$list; do echo $$i; done | \
+         awk '    { files[$$0] = 1; } \
+              END { for (i in files) print i; }'`; \
+       test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \
+         || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags  $$unique $(LISP) -o $$here/TAGS)
+
+mostlyclean-tags:
+
+clean-tags:
+
+distclean-tags:
+       -rm -f TAGS ID
+
+maintainer-clean-tags:
+
+distdir = $(PACKAGE)-$(VERSION)
+top_distdir = $(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
+       -rm -rf $(distdir)
+       GZIP=$(GZIP_ENV) $(TAR) zxf $(distdir).tar.gz
+       mkdir $(distdir)/=build
+       mkdir $(distdir)/=inst
+       dc_install_base=`cd $(distdir)/=inst && pwd`; \
+       cd $(distdir)/=build \
+         && ../configure --srcdir=.. --prefix=$$dc_install_base \
+         && $(MAKE) $(AM_MAKEFLAGS) \
+         && $(MAKE) $(AM_MAKEFLAGS) dvi \
+         && $(MAKE) $(AM_MAKEFLAGS) check \
+         && $(MAKE) $(AM_MAKEFLAGS) install \
+         && $(MAKE) $(AM_MAKEFLAGS) installcheck \
+         && $(MAKE) $(AM_MAKEFLAGS) dist
+       -rm -rf $(distdir)
+       @banner="$(distdir).tar.gz is ready for distribution"; \
+       dashes=`echo "$$banner" | sed s/./=/g`; \
+       echo "$$dashes"; \
+       echo "$$banner"; \
+       echo "$$dashes"
+dist: distdir
+       -chmod -R a+r $(distdir)
+       GZIP=$(GZIP_ENV) $(TAR) chozf $(distdir).tar.gz $(distdir)
+       -rm -rf $(distdir)
+dist-zip: distdir
+       -chmod -R a+r $(distdir)
+       zip -rq $(distdir).zip $(distdir)
+       -rm -rf $(distdir)
+dist-all: distdir
+       -chmod -R a+r $(distdir)
+       GZIP=$(GZIP_ENV) $(TAR) chozf $(distdir).tar.gz $(distdir)
+       zip -rq $(distdir).zip $(distdir)
+       -rm -rf $(distdir)
+distdir: $(DISTFILES)
+       -rm -rf $(distdir)
+       mkdir $(distdir)
+       -chmod 777 $(distdir)
+       $(mkinstalldirs) $(distdir)/Docs $(distdir)/Examples/C \
+          $(distdir)/Examples/CPP $(distdir)/Headers $(distdir)/Source
+       @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
+       for subdir in $(SUBDIRS); do \
+         if test "$$subdir" = .; then :; else \
+           test -d $(distdir)/$$subdir \
+           || mkdir $(distdir)/$$subdir \
+           || exit 1; \
+           chmod 777 $(distdir)/$$subdir; \
+           (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir=../$(distdir) distdir=../$(distdir)/$$subdir distdir) \
+             || exit 1; \
+         fi; \
+       done
+info-am:
+info: info-recursive
+dvi-am:
+dvi: dvi-recursive
+check-am: all-am
+check: check-recursive
+installcheck-am:
+installcheck: installcheck-recursive
+install-exec-am:
+install-exec: install-exec-recursive
+
+install-data-am: install-docDATA
+install-data: install-data-recursive
+
+install-am: all-am
+       @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+install: install-recursive
+uninstall-am: uninstall-docDATA
+uninstall: uninstall-recursive
+all-am: makefile $(DATA)
+all-redirect: all-recursive
+install-strip:
+       $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install
+installdirs: installdirs-recursive
+installdirs-am:
+       $(mkinstalldirs)  $(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:
+mostlyclean-am:  mostlyclean-hdr mostlyclean-tags mostlyclean-generic
+
+mostlyclean: mostlyclean-recursive
+
+clean-am:  clean-hdr clean-tags clean-generic mostlyclean-am
+
+clean: clean-recursive
+
+distclean-am:  distclean-hdr distclean-tags distclean-generic clean-am
+
+distclean: distclean-recursive
+       -rm -f config.status
+
+maintainer-clean-am:  maintainer-clean-hdr 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-recursive
+       -rm -f config.status
+
+.PHONY: mostlyclean-hdr distclean-hdr clean-hdr maintainer-clean-hdr \
+uninstall-docDATA install-docDATA install-data-recursive \
+uninstall-data-recursive install-exec-recursive \
+uninstall-exec-recursive installdirs-recursive uninstalldirs-recursive \
+all-recursive check-recursive installcheck-recursive info-recursive \
+dvi-recursive mostlyclean-recursive distclean-recursive clean-recursive \
+maintainer-clean-recursive tags tags-recursive mostlyclean-tags \
+distclean-tags clean-tags maintainer-clean-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-am \
+installdirs mostlyclean-generic distclean-generic clean-generic \
+maintainer-clean-generic clean mostlyclean distclean maintainer-clean
+
+
+#
+# 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
new file mode 100755 (executable)
index 0000000..7789652
--- /dev/null
@@ -0,0 +1,190 @@
+#! /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
new file mode 100755 (executable)
index 0000000..6b3b5fc
--- /dev/null
@@ -0,0 +1,40 @@
+#! /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