From 7e139e65193402b89de6a8cb0fd762670e508b98 Mon Sep 17 00:00:00 2001
From: Eliah REBSTOCK <eliah.rebstock@ensiie.fr>
Date: Fri, 25 Jan 2019 10:39:55 +0100
Subject: [PATCH] Convert already existing comments to doxygen format

---
 Doxyfile                   |   4 +-
 include/ana/capfloat.h     |   2 +-
 include/ana/devtechn.h     |   2 +-
 include/ana/devtechp.h     |   2 +-
 include/ana/diode1.h       |   2 +-
 include/ana/ganglion.h     |   2 +-
 include/ana/globals.h      | 496 ++++++++++------------
 include/ana/hres.h         |   2 +-
 include/ana/idiff.h        |   2 +-
 include/ana/inter.h        |   3 +-
 include/ana/iscope.h       |   2 +-
 include/ana/iswitch1.h     |   3 +-
 include/ana/iswitch2.h     |   2 +-
 include/ana/main.h         |   3 +-
 include/ana/mmeter.h       |   3 +-
 include/ana/moscap.h       |   2 +-
 include/ana/nfet4.h        |   2 +-
 include/ana/nfet5.h        |   2 +-
 include/ana/nfet7f.h       |   2 +-
 include/ana/nfet7t.h       |   2 +-
 include/ana/npn1.h         |   2 +-
 include/ana/npn2.h         |   2 +-
 include/ana/nsolver.h      |   2 +-
 include/ana/nspc1.h        |   2 +-
 include/ana/numbers.h      |   2 +-
 include/ana/pfet4.h        |   2 +-
 include/ana/pfet5.h        |   2 +-
 include/ana/pfet6.h        |   2 +-
 include/ana/pfet7f.h       |   2 +-
 include/ana/pfet7t.h       |   2 +-
 include/ana/physical.h     |   2 +-
 include/ana/pnp1.h         |   2 +-
 include/ana/pnp2.h         |   2 +-
 include/ana/pspc1.h        |   2 +-
 include/ana/pwl.h          |   2 +-
 include/ana/resfloat.h     |   3 +-
 include/ana/rtd.h          |   2 +-
 include/ana/runspec.h      |   2 +-
 include/ana/stairs.h       |   2 +-
 include/ana/tc.h           |   2 +-
 include/ana/thermal.h      |   2 +-
 include/ana/vdiff.h        |   3 +-
 include/ana/vswitch.h      |   3 +-
 include/graphics/mylib.h   |   2 +-
 include/graphics/newci.h   |   4 +-
 include/graphics/newcrt.h  |  83 ++--
 include/graphics/newkbd.h  |   2 +-
 include/log_action.h       |  10 +-
 include/logcom.h           |   2 +-
 include/logdef.h           |   2 +-
 include/logdig.h           |   2 +-
 include/loghier.h          |   2 +-
 include/logntk.h           |   2 +-
 include/logsim.h           |   2 +-
 include/logsima.h          |   2 +-
 include/logsimed.h         |   2 +-
 include/logsimh.h          |   2 +-
 include/logspc.h           |   2 +-
 include/mygates.h          |   2 +-
 include/utils/filepack.h   |   2 +-
 include/utils/iodecl.h     |   2 +-
 include/utils/misc.h       |   2 +-
 include/utils/newasm.h     |   2 +-
 include/utils/p2c.h        |   2 +-
 include/utils/regex.h      |   2 +-
 include/utils/strings.h    |   6 +-
 include/utils/sysdevs.h    |   3 +-
 include/utils/sysglobals.h |   2 +-
 src/ana/capfloat.c         |  27 +-
 src/ana/devtechn.c         |   2 +-
 src/ana/devtechp.c         |   2 +-
 src/ana/diode1.c           |   2 +-
 src/ana/ganglion.c         |   2 +-
 src/ana/globals.c          |   2 +-
 src/ana/hres.c             |   2 +-
 src/ana/idiff.c            |   2 +-
 src/ana/inter.c            |   2 +-
 src/ana/iscope.c           |   2 +-
 src/ana/iswitch1.c         |   2 +-
 src/ana/iswitch2.c         |   2 +-
 src/ana/main.c             |   2 +-
 src/ana/mmeter.c           |   2 +-
 src/ana/moscap.c           |   2 +-
 src/ana/nfet4.c            |   2 +-
 src/ana/nfet5.c            |   2 +-
 src/ana/nfet7f.c           |   2 +-
 src/ana/nfet7t.c           |   2 +-
 src/ana/npn1.c             |   2 +-
 src/ana/npn2.c             |   2 +-
 src/ana/nsolver.c          |   2 +-
 src/ana/nspc1.c            |   2 +-
 src/ana/numbers.c          |   2 +-
 src/ana/pfet4.c            |   2 +-
 src/ana/pfet5.c            |   2 +-
 src/ana/pfet6.c            |   2 +-
 src/ana/pfet7f.c           |   2 +-
 src/ana/pfet7t.c           |   2 +-
 src/ana/physical.c         |   2 +-
 src/ana/pnp1.c             |   2 +-
 src/ana/pnp2.c             |   2 +-
 src/ana/pspc1.c            |   2 +-
 src/ana/pwl.c              |   2 +-
 src/ana/resfloat.c         |   2 +-
 src/ana/rtd.c              |   2 +-
 src/ana/runspec.c          |   2 +-
 src/ana/stairs.c           |   2 +-
 src/ana/tc.c               |   2 +-
 src/ana/thermal.c          |   2 +-
 src/ana/vdiff.c            |   2 +-
 src/ana/vswitch.c          |   2 +-
 src/diggates.c             |   2 +-
 src/gate.c                 | 101 +----
 src/graphics/mylib.c       |  12 +-
 src/label.c                |  35 +-
 src/log.c                  | 849 +++++++++++++------------------------
 src/logcom.c               |   2 +-
 src/logdef.c               |   2 +-
 src/logdig.c               |   2 +-
 src/loged.c                |   2 +-
 src/loghier.c              |   2 +-
 src/logntk.c               |   2 +-
 src/logsim.c               |   2 +-
 src/logsimed.c             |   2 +-
 src/logsimh.c              |   2 +-
 src/logspc.c               |   4 +-
 src/node.c                 |  40 +-
 src/page.c                 |   7 +-
 src/screen.c               | 386 +++--------------
 src/utils.c                |   8 +-
 src/utils/newasm.c         |   2 +-
 src/utils/p2c.c            |   2 +-
 src/utils/regex.c          |   2 +-
 src/wire.c                 | 114 ++---
 133 files changed, 811 insertions(+), 1615 deletions(-)

diff --git a/Doxyfile b/Doxyfile
index 96d0830..90a01c5 100644
--- a/Doxyfile
+++ b/Doxyfile
@@ -150,7 +150,7 @@ INLINE_INHERITED_MEMB  = NO
 # shortest path that makes the file name unique will be used
 # The default value is: YES.
 
-FULL_PATH_NAMES        = NO
+FULL_PATH_NAMES        = YES
 
 # The STRIP_FROM_PATH tag can be used to strip a user-defined part of the path.
 # Stripping is only done if one of the specified strings matches the left-hand
@@ -2431,7 +2431,7 @@ PLANTUML_INCLUDE_PATH  =
 # Minimum value: 0, maximum value: 10000, default value: 50.
 # This tag requires that the tag HAVE_DOT is set to YES.
 
-DOT_GRAPH_MAX_NODES    = 50
+DOT_GRAPH_MAX_NODES    = 100
 
 # The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the graphs
 # generated by dot. A depth value of 3 means that only nodes reachable from the
diff --git a/include/ana/capfloat.h b/include/ana/capfloat.h
index 9e1ffe8..12178f3 100644
--- a/include/ana/capfloat.h
+++ b/include/ana/capfloat.h
@@ -13,4 +13,4 @@ void Log_capfloat_initlib_32 (Analog_32_action *act);
 
 #endif /*CAPFLOAT_H*/
 
-/* End. */
+
diff --git a/include/ana/devtechn.h b/include/ana/devtechn.h
index ccc8328..deefc4f 100644
--- a/include/ana/devtechn.h
+++ b/include/ana/devtechn.h
@@ -13,4 +13,4 @@ extern void Log_DEVTECHN_initlib_32 (Analog_32_action *act);
 
 #endif /*DEVTECHN_H*/
 
-/* End. */
+
diff --git a/include/ana/devtechp.h b/include/ana/devtechp.h
index 03a14bb..08252ac 100644
--- a/include/ana/devtechp.h
+++ b/include/ana/devtechp.h
@@ -14,4 +14,4 @@ extern void Log_DEVTECHP_initlib_32 (Analog_32_action *act);
 
 #endif /*DEVTECHP_H*/
 
-/* End. */
+
diff --git a/include/ana/diode1.h b/include/ana/diode1.h
index 13aa613..68f5702 100644
--- a/include/ana/diode1.h
+++ b/include/ana/diode1.h
@@ -12,4 +12,4 @@ extern void Log_Diode1_INITLIB_32 (Analog_32_action *act);
 
 #endif /*DIODE1_H*/
 
-/* End. */
+
diff --git a/include/ana/ganglion.h b/include/ana/ganglion.h
index a93407f..57e3e6a 100644
--- a/include/ana/ganglion.h
+++ b/include/ana/ganglion.h
@@ -13,4 +13,4 @@ extern void Log_ganglion_initlib_32 (Analog_32_action *act);
 
 #endif /*GANGLION_H*/
 
-/* End. */
+
diff --git a/include/ana/globals.h b/include/ana/globals.h
index 6f750e2..5049978 100644
--- a/include/ana/globals.h
+++ b/include/ana/globals.h
@@ -1,4 +1,3 @@
-/* Header for module Globals, generated by p2c */
 #ifndef GLOBALS_H
 #define GLOBALS_H
 
@@ -17,8 +16,6 @@
 
 /*T*/
 
-
-
 #define AnaUsingAlarm   false
 
 /*Floating point hardware flag*/
@@ -165,118 +162,103 @@
 #define AnaMessGate5    7
 
 
-/*============================================================================*/
-/* This first block represents simulation and extraction information for
-   each of the cells in the cell library.  The information is help in an
-   array of all cells, indexed by identification number, which is initialized
-   by program at runtime                                                      */
-/*============================================================================*/
-
+/**
+	This first block represents simulation and extraction information for
+	each of the cells in the cell library.  The information is help in an
+	array of all cells, indexed by identification number, which is initialized
+	by program at runtime.
+*/
 typedef enum {
-	ANALOG_ACT_NEWKIND,    /**< Initialize a new kind */
-	ANALOG_ACT_EX,         /**< Contribute to matrix */
-	ANALOG_ACT_PREUPDATE,  /**< Calculations before updating */
-	ANALOG_ACT_UPDATE,     /**< Update memory elements */
-	ANALOG_ACT_DISPLAY,    /**< Update display */
-	ANALOG_ACT_IIN,        /**< Relate current of a pin */
-	ANALOG_ACT_PASS1,      /**< First pass of guess */
-	ANALOG_ACT_PASS2,      /**< econd pass of guess */
-	ANALOG_ACT_ATTRCHANGE, /**< Checks attribute changes */
-	ANALOG_ACT_RESET,      /**< Resets memory elements */
-	ANALOG_ACT_SET,        /**< Sets state at reset */
-	ANALOG_ACT_CLEAR,      /**< Clears state at reset */
-    ANALOG_ACT_REFRESH,    /**< Refresh display */
-	ANALOG_ACT_ERASE,      /**< Erase display */
-	ANALOG_ACT_TOUCH,      /**< Touch a gate*/
-	ANALOG_ACT_DISCONNECT, /**< Twiddle meters*/
-	ANALOG_ACT_NEWGATE,    /**< Make a new instance*/
-	ANALOG_ACT_COPYGATE,   /**< Copy an instance*/
-	ANALOG_ACT_OPENCONFIG, /**< To load in config values*/
-	ANALOG_ACT_READGATE,   /**< to read in a gate description*/
-	ANALOG_ACT_WRITEGATE,  /**< to write out a gate description*/
-	ANALOG_ACT_MESSAGE,    /**< display a message*/
-	ANALOG_ACT_PROBE,      /**< contribute to probe display*/
-	ANALOG_ACT_DISPOSEGATE /**< Dispose an old instance*/
+	ANALOG_ACT_NEWKIND,    ///< Initialize a new kind
+	ANALOG_ACT_EX,         ///< Contribute to matrix
+	ANALOG_ACT_PREUPDATE,  ///< Calculations before updating
+	ANALOG_ACT_UPDATE,     ///< Update memory elements
+	ANALOG_ACT_DISPLAY,    ///< Update display
+	ANALOG_ACT_IIN,        ///< Relate current of a pin
+	ANALOG_ACT_PASS1,      ///< First pass of guess
+	ANALOG_ACT_PASS2,      ///< econd pass of guess
+	ANALOG_ACT_ATTRCHANGE, ///< Checks attribute changes
+	ANALOG_ACT_RESET,      ///< Resets memory elements
+	ANALOG_ACT_SET,        ///< Sets state at reset
+	ANALOG_ACT_CLEAR,      ///< Clears state at reset
+    ANALOG_ACT_REFRESH,    ///< Refresh display
+	ANALOG_ACT_ERASE,      ///< Erase display
+	ANALOG_ACT_TOUCH,      ///< Touch a gate
+	ANALOG_ACT_DISCONNECT, ///< Twiddle meters
+	ANALOG_ACT_NEWGATE,    ///< Make a new instance
+	ANALOG_ACT_COPYGATE,   ///< Copy an instance
+	ANALOG_ACT_OPENCONFIG, ///< To load in config values
+	ANALOG_ACT_READGATE,   ///< to read in a gate description
+	ANALOG_ACT_WRITEGATE,  ///< to write out a gate description
+	ANALOG_ACT_MESSAGE,    ///< display a message
+	ANALOG_ACT_PROBE,      ///< contribute to probe display
+	ANALOG_ACT_DISPOSEGATE ///< Dispose an old instance
 } Analog_32_actionkinds;
 
 
 typedef struct Analog_32_action {
-  Analog_32_actionkinds action;   /**< Desired Action */
-  log_krec *kind;                 /**< Kind of interest */
-  log_grec *inst;                 /**< Gate of interest */
-  long pin;                       /**< Pin of interest */
-  long page;                      /**< Page of interest */
-  double Iin;                     /**< Current of pin of interest */
-  int ok;                         /**< An error flag */
-  int accepted;                   /**< Another error flag */
-  char message[256];              /**< A scoreboard message */
-  long messagenum;                /**< purpose of message */
+  Analog_32_actionkinds action;   ///< Desired Action
+  log_krec *kind;                 ///< Kind of interest
+  log_grec *inst;                 ///< Gate of interest
+  long pin;                       ///< Pin of interest
+  long page;                      ///< Page of interest
+  double Iin;                     ///< Current of pin of interest
+  int ok;                         ///< An error flag
+  int accepted;                   ///< Another error flag
+  char message[256];              ///< A scoreboard message
+  long messagenum;                ///< purpose of message
 } Analog_32_action;
 
 
-/******************************************************************************/
-/* Each pin of a standard cell will have pin-specific information which will
-   involve initital guessing, syntax checking, and simulation. The plist_cell
-   structure is an array, dynamically configured to be (# of pins) at
-   initialization, which will hold these values.
-
-        Fields:
-               standalone: Says if a pin is allowed to be unconnected without
-                           underconstraining the system. For example, an
-                           inverter would have standalone=true, while a
-                           source grounded NMOS transistor's current input
-                           would have a value standalone=false. Used for
-                           syntax checking
-
-               active:    Says  the pin counts as a connection for syntax
-                          checking of other gates.
-
-
-
- {*****************************************************************************/
-
+/**
+ * Each pin of a standard cell will have pin-specific information which will
+ * involve initital guessing, syntax checking, and simulation. The plist_cell
+ * structure is an array, dynamically configured to be (# of pins) at
+ * initialization, which will hold these values.
+ */
 typedef struct Anapinrec {
-  int standalone;
-  int active;
+  int standalone; /**< @brief Says if a pin is allowed to be unconnected without
+						underconstraining the system.
+
+						For example, an inverter would have standalone=true, while a
+						source grounded NMOS transistor's current input
+						would have a value standalone=false. Used for
+						syntax checking */
+  int active; ///< Says if the pin counts as a connection for syntax checking of other gates. */
 } Anapinrec;
 
 typedef Anapinrec Anaparray[AnaLarge];
 
 
 
-/******************************************************************************/
-/* After a successful simulation, all cells that store energy must be allowed
-   to update its state. Thus each cell has an procedure pointer for update,
-   which may be set to nil for memoryless procedures. This is how cells like
-   scopes will communicate its information back to LOG in the final version
-   The parameters are the same as for ex_proc. Update phase takes into account
-   the ordering of updates; first-phase updates are non-destructive, i.e current
-   meters, while second-phase updates are destructive, like system memory.   */
-/******************************************************************************/
 
+/** After a successful simulation, all cells that store energy must be allowed
+	to update its state. Thus each cell has an procedure pointer for update,
+	which may be set to nil for memoryless procedures. This is how cells like
+	scopes will communicate its information back to LOG in the final version
+	The parameters are the same as for ex_proc. Update phase takes into account
+	the ordering of updates; first-phase updates are non-destructive, i.e current
+	meters, while second-phase updates are destructive, like system memory.
+*/
 typedef enum {
   Anasimple, Anacomplex
 } Anaupdate_phase;
 
-/*******************************************************************************/
-/* A current meter arrow may be pointed at any pin of any gate. To enable
-   the operation of this feature, each gate type must have a procedure that
-   can return the current into any node a pin is connected to,
-   given the nodemap aand attr fields.
- {******************************************************************************/
-
-/******************************************************************************/
-/*                    The complete cell descriptor                            */
-/******************************************************************************/
 
+/** @brief The complete cell descriptor
 
+	A current meter arrow may be pointed at any pin of any gate. To enable
+	the operation of this feature, each gate type must have a procedure that
+	can return the current into any node a pin is connected to,
+	given the nodemap aand attr fields.
+*/
 typedef struct AnaCell_rec {
-  int simulatable;   /*Can this gate be simulated?*/
+  int simulatable;   ///< Can this gate be simulated?
   void (*proc_cell) (Analog_32_action *act);
-      /*Procedure for cell execution*/
-  long intr_cell;   /*Number of internal variables in cell*/
-  Anaupdate_phase phase;   /*Phase of update*/
-  Anapinrec *plist_cell;   /*Pin description array of length:pins_cell*/
+      ///< Procedure for cell execution
+  long intr_cell;   ///< Number of internal variables in cell
+  Anaupdate_phase phase;   ///< Phase of update
+  Anapinrec *plist_cell;   ///< Pin description array of length:pins_cell
   void *Ainfo;
 } AnaCell_rec;
 
@@ -284,70 +266,60 @@ typedef struct AnaCell_rec {
 /*                    Procedure Type for initialization procedure             */
 /******************************************************************************/
 
-
 /*******************************************************************************/
 /*In addition to the list of cell definitions, a list of cell instances
   is also required.                                                            */
 /*******************************************************************************/
 
-
-
 /*=============================================================================*/
 /*  Log keeps a node structure which has an analog node anyptr. In addition,
     gates have an anyptr for analog simulation, a subptr of which will have
     internal node storage. The following ptrs fit in those pages               */
 /*=============================================================================*/
 
-
+/// Internal Nodes
 typedef struct AnaInt_rec {
-  /*Internal Nodes*/
-  double ltimestep;   /*Value of last simulation*/
-  double last;   /*last value of a simulation*/
-  double now;   /*present value of a simulation*/
-  long nodenum;   /*Node number for array indexing*/
-  struct AnaInt_rec *next;   /*Next internal node*/
+  double ltimestep;   ///< Value of last simulation
+  double last;   ///< last value of a simulation
+  double now;   ///< present value of a simulation
+  long nodenum;   ///< Node number for array indexing
+  struct AnaInt_rec *next;   ///< Next internal node
 } AnaInt_rec;
 
-
+/// External Nodes
 typedef struct AnaExt_rec {
-  /*External Nodes*/
-  long refcnt;   /*Marker for syntax checking*/
-  int Ok_Alone;   /*Marker for syntax checking*/
-  double ltimestep;   /*Value of last simulation*/
-  double last;   /*last value of a simulation*/
-  double now;   /*present value of a simulation*/
-  long nodenum;   /*Node number for array indexing*/
-  long col_now;   /*color for glow mode*/
-  long col_ltimestep;   /*color for glow mode*/
-  int changed_now;   /*changed flag for glowmode*/
+  long refcnt;   ///< Marker for syntax checking
+  int Ok_Alone;   ///< Marker for syntax checking
+  double ltimestep;   ///< Value of last simulation
+  double last;   ///< last value of a simulation
+  double now;   ///< present value of a simulation
+  long nodenum;   ///< Node number for array indexing
+  long col_now;   ///< color for glow mode
+  long col_ltimestep;   ///< color for glow mode
+  int changed_now;   ///< changed flag for glowmode
 } AnaExt_rec;
 
 /* Each gate also has analog-specific information. */
 
-/*Internal nodelist for each gate*/
-
-
+/// Internal nodelist for each gate
 typedef struct AnaGate_intnoderec {
   AnaInt_rec *Int_Node;
   struct AnaGate_intnoderec *Next;
 } AnaGate_intnoderec;
 
 
-/* Pin specific information is held in a variable length array.*/
-
-
 typedef struct AnaInstpinrec {
-  double Cap;   /*The capacitance of a pin*/
-  double Tau;   /*The last tau of the pin*/
-  double Vmem;   /*The voltage memory of a pin*/
-  double Vreset;   /*The new voltage for a reset*/
+  double Cap;   ///< The capacitance of a pin
+  double Tau;   ///< The last tau of the pin
+  double Vmem;   ///< The voltage memory of a pin
+  double Vreset;   ///< The new voltage for a reset
 } AnaInstpinrec;
 
+// Pin specific information is held in a variable length array.
 typedef AnaInstpinrec Anapininstarray[AnaLarge];
 
 
-/*Pointer to list of cells instances*/
-
+/// Pointer to list of cells instances.
 typedef struct Anainstlist {
   AnaGate_intnoderec *Gate_nodelist;
   void *InstVar;
@@ -355,41 +327,33 @@ typedef struct Anainstlist {
   int NotReady;
 } Anainstlist;
 
-/* **************************************************************************/
-/*   To insure swift pen movement regardless of circuit size, I am breaking
-     the execution up into units. The following variable deals with this  */
-/* **************************************************************************/
-
+/** @brief To insure swift pen movement regardless of circuit size, I am breaking
+			the execution up into units. The following variable deals with this */
 typedef enum {
   AnaE_Evaluate, AnaE_Solve, AnaE_Calculate, AnaE_Refresh, AnaE_Adapt,
   AnaE_Memory1, AnaE_Memory2, AnaE_Update
 } Anaepochs_type;
 
 
-/*handles the handshaking for system clock*/
-
-
+/// handles the handshaking for system clock
 typedef enum {
   Anasettime, Anawait, Anacontinue
 } Anatimetype;
 
 
-/*The color map*/
-
+/// The color map
 typedef struct AnaAnalog_Colors {
   short C_Vmeter, C_Imeter, C_Switchon, C_Switchoff, C_Limiton, C_Probe,
 	C_Glow1, C_Glow2, C_Glow3, C_Glow4, C_Glow5, C_Glow6;
 } AnaAnalog_Colors;
 
 
-/*Levels for glow mode*/
-
+/// Levels for glow mode
 typedef struct AnaAnalog_Levels {
   long Level_a, Level_b, Level_c, Level_d, Level_e, Level_sum;
 } AnaAnalog_Levels;
 
-/*Structure for checking limits of simulation variables*/
-
+/// Structure for checking limits of simulation variables
 typedef union AnaLimcheck {
   long i;
   double r;
@@ -401,18 +365,16 @@ typedef enum {
 
 typedef AnaLimcheck AnaCheckarray[AnaParamnum][2];
 
-/*structures for handling commands - Clist is head of list*/
-
-
+/// structures for handling commands - Clist is head of list
 typedef struct AnaCommand_rec {
   char Command[17];
   char Arguments[256];
   struct AnaCommand_rec *Next;
 } AnaCommand_rec;
 
-/*Types for equation solvers*/
-/*Array position 0 is a 'bit-bucket' for vdd & gnd only*/
 
+/// Types for equation solvers
+/** Array position 0 is a 'bit-bucket' for vdd & gnd only */
 typedef double AnaMatArray[AnaRowbound + 1][AnaColbound + 1];
 typedef int AnaMatFlags[AnaRowbound + 1][AnaColbound + 1];
 
@@ -425,9 +387,7 @@ typedef enum {
   AnaS_Start, AnaS_Bestrow, AnaS_Divide, AnaS_Subtract, AnaS_Finish
 } AnaSolve_Type;
 
-/*Types for log.cnf interface*/
-
-
+/// Types for log.cnf interface
 typedef struct AnaKlistnode {
   log_krec *NodeKind;
   struct AnaKlistnode *Nextnode;
@@ -439,86 +399,78 @@ typedef struct AnaKlistnode {
 /*******************************************************************************/
 /*System data structures*/
 
-vextern log_action_t *AnaLogglobals;   /*Log's global variables*/
-vextern log_action_t *AnaLogIglobals;   /*Log's global variables*/
-vextern AnaInt_rec *AnaInt_nodelist;   /*List of current internal pointers*/
-vextern AnaAnalog_Colors AnaColormap;   /*The color map*/
-vextern AnaAnalog_Levels AnaLevelmap;   /*The glow mode level map*/
-vextern AnaCheckarray AnaLimits;   /*Array for checking system parameters*/
-vextern AnaCommand_rec *AnaClist;   /*Structure for holding cnf commands*/
-vextern AnaKlistnode *AnaKlist;   /*Structure for tracking analog gates*/
+vextern log_action_t *AnaLogglobals;   ///< Log's global variables
+vextern log_action_t *AnaLogIglobals;   ///< Log's global variables
+vextern AnaInt_rec *AnaInt_nodelist;   ///< List of current internal pointers
+vextern AnaAnalog_Colors AnaColormap;   ///< The color map
+vextern AnaAnalog_Levels AnaLevelmap;   ///< The glow mode level map
+vextern AnaCheckarray AnaLimits;   ///< Array for checking system parameters
+vextern AnaCommand_rec *AnaClist;   ///< Structure for holding cnf commands
+vextern AnaKlistnode *AnaKlist;   ///< Structure for tracking analog gates
 vextern log_sigrec *AnaVddsig, *Anagndsig;
-    /*Signal pointers for Vdd and Gnd*/
+    ///< Signal pointers for Vdd and Gnd
 vextern log_nrec *AnaVddnode, *Anagndnode;
-    /*Signal pointers for Vdd and Gnd*/
-/*******************************************************************************/
+    ///< Signal pointers for Vdd and Gnd
 
 
 
-/*******************************************************************************/
-vextern char AnaCh;   /*Used for 'press any key' debugging*/
-/*******************************************************************************/
+vextern char AnaCh;   ///< Used for 'press any key' debugging
 
 
 /*******************************************************************************/
 /*Variables that show the state of my simulation and state machine*/
 
-/*Holds state of entire pass procedure*/
-
-vextern int AnaReady;   /*Says That a circuit is ready to simulate*/
-vextern int AnaChanged;   /*Says That a change has been made*/
+vextern int AnaReady;   ///< Says That a circuit is ready to simulate
+vextern int AnaChanged;   ///< Says That a change has been made
 
 /*Holds state of simulation proper*/
 
-vextern int AnaStart;   /*Indicates whether this is initial timestep*/
-vextern int AnaError;   /*Simulation flag*/
-vextern int AnaDone, AnaOverflow;   /*Simulation flags*/
-vextern int AnaToobig;   /*Simulation flag*/
-vextern int AnaToosmall;   /*Simulation flag*/
-vextern int AnaSuccess;   /*Simulation flag*/
-vextern long AnaItercount, AnaItermax;
-    /*Variables for adaptive iteration watchdog*/
-vextern double AnaAccum;   /*Total accumulated timed*/
-vextern double AnaDt, AnaDtlast;   /*Present and last timestep of system*/
-vextern int AnaChangedDt;   /*A new dt has happened*/
-vextern int AnaChangedP;   /*A transistor parameter has changed*/
-vextern int AnaInuse;   /*At least one analog gate exists*/
-vextern long AnaDtcount;   /*Counting variable to prevent roundoff*/
+vextern int AnaStart;   ///< Indicates whether this is initial timestep
+vextern int AnaError;   ///< Simulation flag
+vextern int AnaDone;    ///< Simulation flags
+vextern int AnaOverflow;   ///< Simulation flags
+vextern int AnaToobig;   ///< Simulation flag
+vextern int AnaToosmall;   ///< Simulation flag
+vextern int AnaSuccess;   ///< Simulation flag
+vextern long AnaItercount; ///< Variables for adaptive iteration watchdog
+vextern long AnaItermax; ///< Variables for adaptive iteration watchdog
+vextern double AnaAccum;   ///< Total accumulated timed
+vextern double AnaDt; ///< Present timestep of system
+vextern double AnaDtlast;   ///< Last timestep of system
+vextern int AnaChangedDt;   ///< A new dt has happened
+vextern int AnaChangedP;   ///< A transistor parameter has changed
+vextern int AnaInuse;   ///< At least one analog gate exists
+vextern long AnaDtcount;   ///< Counting variable to prevent roundoff
 vextern long AnaRelaxcount;
-    /*Comparison variable for Dtcount for relaxation*/
-vextern int AnaExact;   /*Flag for doing accuracy checking*/
-vextern int AnaDifficult;   /*Flag for a difficult simulation*/
-vextern int AnaToomany;   /*Flag for too many iterations*/
-vextern int AnaErase;   /*State of reset memory*/
-vextern int AnaOldmodel;   /*Model selection when loading in gates*/
-vextern int AnaDebugset;   /*Flag used in debugging mode*/
-vextern long AnaDebugsize;   /*Number of significant digits for debug mode*/
-vextern int AnaTimermode;   /*Mode selection for benchmarking*/
-vextern int AnaTimerstate;   /*State bit for timer state machine*/
-vextern long AnaTimerval;   /*Benchmark memory location*/
-vextern double AnaVshift;   /*Smallest voltage not requiring a gearshift*/
-vextern int AnaDimgate;   /*Switch for dimming unconnected gates*/
-
-vextern int AnaProbeOn;   /*State of probe mode*/
-vextern char AnaLastnodeStr[256];   /*last node voltage displayed*/
-vextern char AnaLastGate1Str[256];   /*last gate1 message displayed*/
-vextern char AnaLastGate2Str[256];   /*last gate2 message displayed*/
-vextern char AnaLastGate3Str[256];   /*last gate3 message displayed*/
-vextern char AnaLastGate4Str[256];   /*last gate3 message displayed*/
-vextern char AnaLastGate5Str[256];   /*last gate3 message displayed*/
-
-vextern long AnaGateHystercount;   /*Hysteresis counter for probemode*/
-vextern long AnaNodeHystercount;   /*Hysteresis counter for probemode*/
-
-
-/*holds state of state machine*/
-
-vextern Anaepochs_type AnaEpoch;   /*Holds present epoch of simulator*/
-vextern long AnaLastpage;   /*Lastpage evaluated;  0->Clear array*/
-vextern log_grec *AnaLastgate;   /*Lastgate evaluated*/
-vextern Anatimetype AnaTimestate;   /*Present time state of system*/
-
-/*******************************************************************************/
+    ///< Comparison variable for Dtcount for relaxation
+vextern int AnaExact;   ///< Flag for doing accuracy checking
+vextern int AnaDifficult;   ///< Flag for a difficult simulation
+vextern int AnaToomany;   ///< Flag for too many iterations
+vextern int AnaErase;   ///< State of reset memory
+vextern int AnaOldmodel;   ///< Model selection when loading in gates
+vextern int AnaDebugset;   ///< Flag used in debugging mode
+vextern long AnaDebugsize;   ///< Number of significant digits for debug mode
+vextern int AnaTimermode;   ///< Mode selection for benchmarking
+vextern int AnaTimerstate;   ///< State bit for timer state machine
+vextern long AnaTimerval;   ///< Benchmark memory location
+vextern double AnaVshift;   ///< Smallest voltage not requiring a gearshift
+vextern int AnaDimgate;   ///< Switch for dimming unconnected gates
+
+vextern int AnaProbeOn;   ///< State of probe mode
+vextern char AnaLastnodeStr[256];   ///< last node voltage displayed
+vextern char AnaLastGate1Str[256];   ///< last gate1 message displayed
+vextern char AnaLastGate2Str[256];   ///< last gate2 message displayed
+vextern char AnaLastGate3Str[256];   ///< last gate3 message displayed
+vextern char AnaLastGate4Str[256];   ///< last gate3 message displayed
+vextern char AnaLastGate5Str[256];   ///< last gate3 message displayed
+
+vextern long AnaGateHystercount;   ///< Hysteresis counter for probemode
+vextern long AnaNodeHystercount;   ///< Hysteresis counter for probemode
+
+vextern Anaepochs_type AnaEpoch;   ///< Holds present epoch of simulator
+vextern long AnaLastpage;   ///< Lastpage evaluated;  0->Clear array
+vextern log_grec *AnaLastgate;   ///< Lastgate evaluated
+vextern Anatimetype AnaTimestate;   ///< Present time state of system
 
 
 /*******************************************************************************/
@@ -529,37 +481,36 @@ vextern Anatimetype AnaTimestate;   /*Present time state of system*/
     Quit:Boolean;              {Variable for watchdog}
 $end$*/
 
-vextern long AnaStoptime;   /*Variable for 'slow' watchdog*/
+vextern long AnaStoptime;   ///< Variable for 'slow' watchdog
 /*******************************************************************************/
 
 
 /*******************************************************************************/
 /*simulation variables open to the public*/
 
+vextern double AnaVdd;   ///< System Power
+vextern double AnaDtmax;   ///< largest allowable timestep
+vextern double AnaVstep;   ///< Maximum voltage step allowed in simulation
 
-vextern double AnaVdd;   /*System Power*/
-vextern double AnaDtmax;   /*largest allowable timestep*/
-vextern double AnaVstep;   /*Maximum voltage step allowed in simulation*/
-
-vextern double AnaHighest;   /*Highest voltage allowed in simulation*/
-vextern double AnaLowest;   /*Lowest voltage allowed in simulation*/
-vextern double AnaSmall;   /*Guess on a capacitor when Vc=0*/
+vextern double AnaHighest;   ///< Highest voltage allowed in simulation
+vextern double AnaLowest;   ///< Lowest voltage allowed in simulation
+vextern double AnaSmall;   ///< Guess on a capacitor when Vc=0
 
-vextern double AnaTol;   /*Maximum percentage difference for convergance*/
-vextern double AnaEqn_Epsilon;   /*epsilon for equation solver*/
-vextern double AnaVardone_Epsilon;   /*epsilon for eqn zero test*/
+vextern double AnaTol;   ///< Maximum percentage difference for convergance
+vextern double AnaEqn_Epsilon;   ///< epsilon for equation solver
+vextern double AnaVardone_Epsilon;   ///< epsilon for eqn zero test
 
-vextern double AnaTimefactor;   /*How much to scale timestep */
-vextern double AnaTimemin;   /*lowest allowable timestep */
-vextern long AnaIterfirstmax;   /*Number of iterations for first try*/
-vextern long AnaTimeincrease;   /*Factor to increase maximum interation by*/
-vextern double AnaSrange;   /*Range of optimal voltage steps in simulation*/
+vextern double AnaTimefactor;   ///< How much to scale timestep
+vextern double AnaTimemin;   ///< lowest allowable timestep
+vextern long AnaIterfirstmax;   ///< Number of iterations for first try
+vextern long AnaTimeincrease;   ///< Factor to increase maximum interation by
+vextern double AnaSrange;   ///< Range of optimal voltage steps in simulation
 
-vextern double AnaTimerelax;   /*Minimum time to relax accuracy checking*/
-vextern double AnaNodecap;   /*Capacitance on a node*/
+vextern double AnaTimerelax;   ///< Minimum time to relax accuracy checking
+vextern double AnaNodecap;   ///< Capacitance on a node
 
-vextern long AnaProbeprec;   /*Precision of probe mode displays*/
-vextern long AnaHysteresis;   /*Amount of Hysteresis in probe mode*/
+vextern long AnaProbeprec;   ///< Precision of probe mode displays
+vextern long AnaHysteresis;   ///< Amount of Hysteresis in probe mode
 
 /*******************************************************************************/
 
@@ -571,7 +522,6 @@ vextern AnaMatRec *AnaSystem;
 vextern AnaSolve_Type AnaS_Section;
 vextern long AnaLastJ;
 
-
 /*******************************************************************************/
 
 
@@ -623,56 +573,56 @@ extern int AnaVrange (log_grec *Inst, long Attrnum);
 /* NFET7/PFET7 series of gates, and related circuits.                      */
 /*=========================================================================*/
 
-/* Physical constants, independent of fabrication process */
+/// Physical constants, independent of fabrication process
 typedef struct AnaPhysicalConstants {
 
-  double      T;   /* Temperature (degree K)                  */
-  double      k;   /* Boltzmann's Constant  (Joules/degree K) */
-  double      q;   /* Charge on an electron (Coulombs)        */
-  double    e_v;   /* Permittivity of vacumn (F/m)            */
-  double    e_s;   /* Permittivity of Si     (F/m)            */
-  double   e_ox;   /* Permittivity of SiO2   (F/m)            */
+  double      T;   ///<  Temperature (degree K)
+  double      k;   ///<  Boltzmann's Constant  (Joules/degree K)
+  double      q;   ///<  Charge on an electron (Coulombs)
+  double    e_v;   ///<  Permittivity of vacumn (F/m)
+  double    e_s;   ///<  Permittivity of Si     (F/m)
+  double   e_ox;   ///<  Permittivity of SiO2   (F/m)
 
-  double     Ut;   /* k*T/q                                   */
+  double     Ut;   ///<  k*T/q
 } AnaPhysicalConstants;
 
-/* Fabrication parameters, independent of device type         */
+/// Fabrication parameters, independent of device type.
 typedef struct AnaFabParameters {
-  double phi_ms;   /* silicon-oxide interface charge          */
+  double phi_ms;   ///<  silicon-oxide interface charge
 
-  double     Eg;     /* Bandgap voltage, temperature-dependent  */
-  double     ni;     /* ni, temperature-dependent               */
-  double lambda;     /* lithography scaling factor              */
-  char fabrun[256];  /* name of fabrication run                 */
-  char process[256]; /* name of fabrication process             */
+  double     Eg;     ///<  Bandgap voltage, temperature-dependent
+  double     ni;     ///<  ni, temperature-dependent
+  double lambda;     ///<  lithography scaling factor
+  char fabrun[256];  ///<  name of fabrication run
+  char process[256]; ///<  name of fabrication process
 
 }AnaFabParameters;
 
-/* Fabrication parameters, different for N/P channel devices  */
+/// Fabrication parameters, different for N/P channel devices
 typedef struct AnaChannelParameters {
-  short     nsign;  /* 1 for nchannel, -1 for pchannel        */
-
-  double      Tox;  /* oxide thickness -- meters              */
-  double      psi;  /* potential at depletion edge -- V       */
-  double       Na;  /* bulk doping concentration -- 1/cm^3    */
-  double      mu0;  /* carrier mobility -- cm^2/(V*s)         */
-  double   deltaW;  /* W drawn-->effective correction -- um   */
-  double   deltaL;  /* L drawn-->effective correction -- um   */
-  double  del_NaS;  /* slope for Na offset dependence         */
-  double  Early_s;  /* slope term for Early Effect            */
-  double      L_0;  /* intercept term for Early Effect        */
-
-  double      Qss;  /* fixed oxide charge -- C                */
-  double  del_Na0;  /* intercept for Na offset dependence     */
-  double   del_mu;  /* offset for mobility (unitless)         */
-
-  double aCactive;  /* Capacitance/um^2, active               */
-  double   aCwell;  /* Capacitance/um^2, well                 */
-  double   linCgs;  /* Capacitance/um, gate-source/drain      */
-  double     aCgw;  /* Capacitance/um^2, equiv linear gate C  */
-
-  double      Cox;  /* e_ox/Tox F/m^2                         */
-  double       mu;  /* temperature-dependent mobility         */
+  short     nsign;  ///<  1 for nchannel, -1 for pchannel
+
+  double      Tox;  ///<  oxide thickness -- meters
+  double      psi;  ///<  potential at depletion edge -- V
+  double       Na;  ///<  bulk doping concentration -- 1/cm^3
+  double      mu0;  ///<  carrier mobility -- cm^2/(V*s)
+  double   deltaW;  ///<  W drawn-->effective correction -- um
+  double   deltaL;  ///<  L drawn-->effective correction -- um
+  double  del_NaS;  ///<  slope for Na offset dependence
+  double  Early_s;  ///<  slope term for Early Effect
+  double      L_0;  ///<  intercept term for Early Effect
+
+  double      Qss;  ///<  fixed oxide charge -- C
+  double  del_Na0;  ///<  intercept for Na offset dependence
+  double   del_mu;  ///<  offset for mobility (unitless)
+
+  double aCactive;  ///<  Capacitance/um^2, active
+  double   aCwell;  ///<  Capacitance/um^2, well
+  double   linCgs;  ///<  Capacitance/um, gate-source/drain
+  double     aCgw;  ///<  Capacitance/um^2, equiv linear gate C
+
+  double      Cox;  ///<  e_ox/Tox F/m^2
+  double       mu;  ///<  temperature-dependent mobility
 }AnaChannelParameters;
 
 
@@ -692,5 +642,3 @@ vextern AnaChannelParameters AnaMinPFab;
 #undef vextern
 
 #endif /*GLOBALS_H*/
-
-/* End. */
diff --git a/include/ana/hres.h b/include/ana/hres.h
index 422bd0e..62c6956 100644
--- a/include/ana/hres.h
+++ b/include/ana/hres.h
@@ -13,4 +13,4 @@ extern void Log_hres_initlib_32 (Analog_32_action *act);
 
 #endif /*HRES_H*/
 
-/* End. */
+
diff --git a/include/ana/idiff.h b/include/ana/idiff.h
index 33f3da8..4fa185c 100644
--- a/include/ana/idiff.h
+++ b/include/ana/idiff.h
@@ -15,4 +15,4 @@ extern void Log_idiff_initlib_32 (Analog_32_action *act);
 
 #endif /*IDIFF_H*/
 
-/* End. */
+
diff --git a/include/ana/inter.h b/include/ana/inter.h
index 7d4a696..371e308 100644
--- a/include/ana/inter.h
+++ b/include/ana/inter.h
@@ -1,4 +1,3 @@
-/* Header for module INTER, generated by p2c */
 #ifndef INTER_H
 #define INTER_H
 
@@ -19,4 +18,4 @@ extern void Log_33_proc (log_action_t *act);
 
 #endif /*INTER_H*/
 
-/* End. */
+
diff --git a/include/ana/iscope.h b/include/ana/iscope.h
index 6fc0570..ece18ec 100644
--- a/include/ana/iscope.h
+++ b/include/ana/iscope.h
@@ -14,4 +14,4 @@ extern void Log_iscope_initlib_32 (Analog_32_action *act);
 
 #endif /*ISCOPE_H*/
 
-/* End. */
+
diff --git a/include/ana/iswitch1.h b/include/ana/iswitch1.h
index 15c8817..1ee2268 100644
--- a/include/ana/iswitch1.h
+++ b/include/ana/iswitch1.h
@@ -1,4 +1,3 @@
-/* Header for module Iswitch1, generated by p2c */
 #ifndef ISWITCH1_H
 #define ISWITCH1_H
 
@@ -15,4 +14,4 @@ extern void Log_iswitch1_initlib_32 (Analog_32_action *act);
 
 #endif /*ISWITCH1_H*/
 
-/* End. */
+
diff --git a/include/ana/iswitch2.h b/include/ana/iswitch2.h
index 2152595..4c7f11c 100644
--- a/include/ana/iswitch2.h
+++ b/include/ana/iswitch2.h
@@ -14,4 +14,4 @@ extern void Log_iswitch2_initlib_32 (Analog_32_action *act);
 
 #endif /*ISWITCH2_H*/
 
-/* End. */
+
diff --git a/include/ana/main.h b/include/ana/main.h
index 9e25f18..833e21e 100644
--- a/include/ana/main.h
+++ b/include/ana/main.h
@@ -1,4 +1,3 @@
-/* Header for module Main, generated by p2c */
 #ifndef MAIN_H
 #define MAIN_H
 
@@ -28,4 +27,4 @@ extern void Analog_Tstep ();
 
 #endif /*MAIN_H*/
 
-/* End. */
+
diff --git a/include/ana/mmeter.h b/include/ana/mmeter.h
index 0a880e2..0d5960a 100644
--- a/include/ana/mmeter.h
+++ b/include/ana/mmeter.h
@@ -1,4 +1,3 @@
-/* Header for module Mmeter, generated by p2c */
 #ifndef MMETER_H
 #define MMETER_H
 
@@ -16,4 +15,4 @@ extern void Log_mmeter_initlib_32 (Analog_32_action *act);
 
 #endif /*MMETER_H*/
 
-/* End. */
+
diff --git a/include/ana/moscap.h b/include/ana/moscap.h
index 280a5cd..1c4dd56 100644
--- a/include/ana/moscap.h
+++ b/include/ana/moscap.h
@@ -13,4 +13,4 @@ extern void Log_moscap_initlib_32 (Analog_32_action *act);
 
 #endif /*MOSCAP_H*/
 
-/* End. */
+
diff --git a/include/ana/nfet4.h b/include/ana/nfet4.h
index 5f58cc6..3fe278b 100644
--- a/include/ana/nfet4.h
+++ b/include/ana/nfet4.h
@@ -13,4 +13,4 @@ extern void Log_nfet4_initlib_32 (Analog_32_action *act);
 
 #endif /*NFET4_H*/
 
-/* End. */
+
diff --git a/include/ana/nfet5.h b/include/ana/nfet5.h
index 4a44e13..fe853cd 100644
--- a/include/ana/nfet5.h
+++ b/include/ana/nfet5.h
@@ -14,4 +14,4 @@ extern void Log_NFET5_INITLIB_32 (Analog_32_action *act);
 
 #endif /*NFET5_H*/
 
-/* End. */
+
diff --git a/include/ana/nfet7f.h b/include/ana/nfet7f.h
index a379fc9..3f9ee9f 100644
--- a/include/ana/nfet7f.h
+++ b/include/ana/nfet7f.h
@@ -13,4 +13,4 @@ extern void Log_NFET7F_INITLIB_32 (Analog_32_action *act);
 
 #endif /*NFET7F_H*/
 
-/* End. */
+
diff --git a/include/ana/nfet7t.h b/include/ana/nfet7t.h
index 475cf3b..20ac966 100644
--- a/include/ana/nfet7t.h
+++ b/include/ana/nfet7t.h
@@ -13,4 +13,4 @@ extern void Log_NFET7T_INITLIB_32 (Analog_32_action *act);
 
 #endif /*NFET7T_H*/
 
-/* End. */
+
diff --git a/include/ana/npn1.h b/include/ana/npn1.h
index 4ffb868..87fc2a9 100644
--- a/include/ana/npn1.h
+++ b/include/ana/npn1.h
@@ -13,4 +13,4 @@ extern void Log_NPN1_INITLIB_32 (Analog_32_action *act);
 
 #endif /*NPN1_H*/
 
-/* End. */
+
diff --git a/include/ana/npn2.h b/include/ana/npn2.h
index dbffbdd..32abe5a 100644
--- a/include/ana/npn2.h
+++ b/include/ana/npn2.h
@@ -13,4 +13,4 @@ extern void Log_NPN2_INITLIB_32 (Analog_32_action *act);
 
 #endif /*NPN2_H*/
 
-/* End. */
+
diff --git a/include/ana/nsolver.h b/include/ana/nsolver.h
index 4d52ac9..c2792fb 100644
--- a/include/ana/nsolver.h
+++ b/include/ana/nsolver.h
@@ -9,4 +9,4 @@ void Solve ();
 
 #endif /*NSOLVER_H*/
 
-/* End. */
+
diff --git a/include/ana/nspc1.h b/include/ana/nspc1.h
index 18626e5..bbbc487 100644
--- a/include/ana/nspc1.h
+++ b/include/ana/nspc1.h
@@ -13,4 +13,4 @@ extern void Log_NSPC1_INITLIB_32 (Analog_32_action *act);
 
 #endif /*NFET7_H*/
 
-/* End. */
+
diff --git a/include/ana/numbers.h b/include/ana/numbers.h
index 37a9237..313f841 100644
--- a/include/ana/numbers.h
+++ b/include/ana/numbers.h
@@ -15,4 +15,4 @@ extern void Log_numbers_initlib_32 (Analog_32_action *act);
 
 #endif /*NUMBERS_H*/
 
-/* End. */
+
diff --git a/include/ana/pfet4.h b/include/ana/pfet4.h
index 39105dd..71b3e5e 100644
--- a/include/ana/pfet4.h
+++ b/include/ana/pfet4.h
@@ -14,4 +14,4 @@ extern void Log_pfet4_initlib_32 (Analog_32_action *act);
 
 #endif /*PFET4_H*/
 
-/* End. */
+
diff --git a/include/ana/pfet5.h b/include/ana/pfet5.h
index 11f05bb..c374d72 100644
--- a/include/ana/pfet5.h
+++ b/include/ana/pfet5.h
@@ -14,4 +14,4 @@ extern void Log_PFET5_INITLIB_32 (Analog_32_action *act);
 
 #endif /*PFET5_H*/
 
-/* End. */
+
diff --git a/include/ana/pfet6.h b/include/ana/pfet6.h
index f7f22c2..c50d17e 100644
--- a/include/ana/pfet6.h
+++ b/include/ana/pfet6.h
@@ -14,4 +14,4 @@ extern void Log_PFET6_INITLIB_32 (Analog_32_action *act);
 
 #endif /*PFET6_H*/
 
-/* End. */
+
diff --git a/include/ana/pfet7f.h b/include/ana/pfet7f.h
index fdd8f05..54fd124 100644
--- a/include/ana/pfet7f.h
+++ b/include/ana/pfet7f.h
@@ -13,4 +13,4 @@ extern void Log_PFET7F_INITLIB_32 (Analog_32_action *act);
 
 #endif /*PFET7F_H*/
 
-/* End. */
+
diff --git a/include/ana/pfet7t.h b/include/ana/pfet7t.h
index 17901e1..89bd728 100644
--- a/include/ana/pfet7t.h
+++ b/include/ana/pfet7t.h
@@ -13,4 +13,4 @@ extern void Log_PFET7T_INITLIB_32 (Analog_32_action *act);
 
 #endif /*PFET7T_H*/
 
-/* End. */
+
diff --git a/include/ana/physical.h b/include/ana/physical.h
index d40db55..4ad8180 100644
--- a/include/ana/physical.h
+++ b/include/ana/physical.h
@@ -13,4 +13,4 @@ extern void Log_PHYSICAL_initlib_32 (Analog_32_action *act);
 
 #endif /*PHYSICAL_H*/
 
-/* End. */
+
diff --git a/include/ana/pnp1.h b/include/ana/pnp1.h
index bb11892..b0add96 100644
--- a/include/ana/pnp1.h
+++ b/include/ana/pnp1.h
@@ -13,4 +13,4 @@ extern void Log_PNP1_INITLIB_32 (Analog_32_action *act);
 
 #endif /*PNP1_H*/
 
-/* End. */
+
diff --git a/include/ana/pnp2.h b/include/ana/pnp2.h
index 109f486..c1925b8 100644
--- a/include/ana/pnp2.h
+++ b/include/ana/pnp2.h
@@ -14,4 +14,4 @@ extern void Log_PNP2_INITLIB_32 (Analog_32_action *act);
 
 #endif /*PNP2_H*/
 
-/* End. */
+
diff --git a/include/ana/pspc1.h b/include/ana/pspc1.h
index aece7c5..405124e 100644
--- a/include/ana/pspc1.h
+++ b/include/ana/pspc1.h
@@ -14,4 +14,4 @@ extern void Log_PSPC1_INITLIB_32 (Analog_32_action *act);
 
 #endif /*PSPC1_H*/
 
-/* End. */
+
diff --git a/include/ana/pwl.h b/include/ana/pwl.h
index 0e94921..9256555 100644
--- a/include/ana/pwl.h
+++ b/include/ana/pwl.h
@@ -13,4 +13,4 @@ extern void Log_pwl_initlib_32 (Analog_32_action *act);
 
 #endif /*PWL_H*/
 
-/* End. */
+
diff --git a/include/ana/resfloat.h b/include/ana/resfloat.h
index d409955..27f288e 100644
--- a/include/ana/resfloat.h
+++ b/include/ana/resfloat.h
@@ -1,4 +1,3 @@
-/* Header for module RESFLOAT, generated by p2c */
 #ifndef RESFLOAT_H
 #define RESFLOAT_H
 
@@ -16,4 +15,4 @@ extern void Log_resfloat_initlib_32 (Analog_32_action *act);
 
 #endif /*RESFLOAT_H*/
 
-/* End. */
+
diff --git a/include/ana/rtd.h b/include/ana/rtd.h
index 112f168..801e974 100644
--- a/include/ana/rtd.h
+++ b/include/ana/rtd.h
@@ -13,4 +13,4 @@ extern void Log_rtd_initlib_32 (Analog_32_action *act);
 
 #endif /*RTD_H*/
 
-/* End. */
+
diff --git a/include/ana/runspec.h b/include/ana/runspec.h
index 396f7d5..f8684ef 100644
--- a/include/ana/runspec.h
+++ b/include/ana/runspec.h
@@ -13,4 +13,4 @@ extern void Log_RUNSPEC_initlib_32 (Analog_32_action *act);
 
 #endif /*RUNSPEC_H*/
 
-/* End. */
+
diff --git a/include/ana/stairs.h b/include/ana/stairs.h
index 26ac275..4e6f71e 100644
--- a/include/ana/stairs.h
+++ b/include/ana/stairs.h
@@ -14,4 +14,4 @@ extern void Log_stairs_initlib_32 (Analog_32_action *act);
 
 #endif /*STAIRS_H*/
 
-/* End. */
+
diff --git a/include/ana/tc.h b/include/ana/tc.h
index 38ffd90..680a3df 100644
--- a/include/ana/tc.h
+++ b/include/ana/tc.h
@@ -17,4 +17,4 @@ extern void Log_fwr_initlib_32 (Analog_32_action *act);
 
 #endif /*TC_H*/
 
-/* End. */
+
diff --git a/include/ana/thermal.h b/include/ana/thermal.h
index 10cf2cb..d932f04 100644
--- a/include/ana/thermal.h
+++ b/include/ana/thermal.h
@@ -13,4 +13,4 @@ extern void Log_THERMAL_initlib_32 (Analog_32_action *act);
 
 #endif /*THERMAL_H*/
 
-/* End. */
+
diff --git a/include/ana/vdiff.h b/include/ana/vdiff.h
index 46ded4b..267d61b 100644
--- a/include/ana/vdiff.h
+++ b/include/ana/vdiff.h
@@ -1,4 +1,3 @@
-/* Header for module Vdiff, generated by p2c */
 #ifndef VDIFF_H
 #define VDIFF_H
 
@@ -15,4 +14,4 @@ extern void Log_vdiff_initlib_32 (Analog_32_action *act);
 
 #endif /*VDIFF_H*/
 
-/* End. */
+
diff --git a/include/ana/vswitch.h b/include/ana/vswitch.h
index 3d46a42..5599b5c 100644
--- a/include/ana/vswitch.h
+++ b/include/ana/vswitch.h
@@ -1,4 +1,3 @@
-/* Header for module VSWITCH, generated by p2c */
 #ifndef VSWITCH_H
 #define VSWITCH_H
 
@@ -15,4 +14,4 @@ extern void Log_vswitch_initlib_32 (Analog_32_action *act);
 
 #endif /*VSWITCH_H*/
 
-/* End. */
+
diff --git a/include/graphics/mylib.h b/include/graphics/mylib.h
index d98589d..8032e77 100644
--- a/include/graphics/mylib.h
+++ b/include/graphics/mylib.h
@@ -169,5 +169,5 @@ uchar m_testkey();
 
 #endif /*MYLIB_H*/
 
-/* End. */
+
 
diff --git a/include/graphics/newci.h b/include/graphics/newci.h
index b8e9c00..1dccde8 100644
--- a/include/graphics/newci.h
+++ b/include/graphics/newci.h
@@ -4,7 +4,7 @@
 typedef struct newci_parserec {
 	char switch_[4];
 	size_t used;
-	char kind; /* kind of union below */
+	char kind; ///< kind of the next union
 	union {
 		long i;
 		double r;
@@ -32,5 +32,5 @@ long newci_fullseconds ();
 
 #endif /*NEWCI_H*/
 
-/* End. */
+
 
diff --git a/include/graphics/newcrt.h b/include/graphics/newcrt.h
index 2b24451..43afffe 100644
--- a/include/graphics/newcrt.h
+++ b/include/graphics/newcrt.h
@@ -8,46 +8,42 @@
 
 short XPOS, YPOS;
 
-/* Window stuff */
-/* Maybe use this info?? */
-/* Graphics window */
-/* Clip region */
-/* Offsets to add for gLine */
-/* Saved values of xpos, ypos */
-/*Number of bytes needed to save window*/
-/*NIL or pointer to save area*/
-
+/// Window record
 typedef struct nc_windowRec {
-    short top, height, left, width;
+    short top; /// @todo Clip region or window dimensions ?
+	short height;
+	short left;
+	short width;
     long area;
-    short font, gcolor, gtop, gheight, gleft, gwidth, gminx, gmaxx, gminy,
-	  gmaxy, goffx, goffy, savex, savey, saveHigh;
-    long saveSize;
-    void* *saveArea;
+    short font;
+	short gcolor;
+	short gtop;
+	short gheight;
+	short gleft;
+	short gwidth;
+	short gminx;
+	short gmaxx;
+	short gminy;
+	short gmaxy;
+	short goffx; ///< X Offset to add for gLine
+	short goffy; ///< Y Offset to add for gLine
+	short savex; ///< Saved value of xpos
+	short savey; ///< Saved value of ypos
+	short saveHigh;
+    long saveSize; ///< Number of bytes needed to save window
+    void* *saveArea; ///< NIL or pointer to save area
 } nc_windowRec;
 
-
-
-/* newCrt-4  */
-/* newCrt-8  */
-/* newCrt-12 */
-/* newCrt-16 */
-/* newCrt-20 */
-/* Character re-mapping stuff */
-
+/// Character re-mapping stuff
 typedef short nc_maparray[256];
 
 
 
-/* newCrt-22  NOT USED ANY MORE */
-/* newCrt-26  NOT USED ANY MORE */
-/* newCrt-28 */
-/* newCrt-30 */
-/* Font information */
 #define nc_maxFonts     4
 
 
 
+/// Font information
 typedef struct nc_fontRec {
     short foffset, fwidth, fheight;
 } nc_fontRec;
@@ -78,7 +74,7 @@ typedef struct nc_fontRec {
 #define nc_g300         6
 
 /* #define nc_fontwidth 8 */
-#define nc_fontwidth 8 
+#define nc_fontwidth 8
 #define nc_fontheight 13
 
 
@@ -88,17 +84,6 @@ typedef char nc_commandArray[256];
 
 
 
-/* Things to deal with graphics junk left on screen */
-/* Information about graphics VS alpha screen stuff */
-/* left edge of main window */
-/* top of main window */
-/* pixels/character in X */
-/* pixels/character in Y */
-/* real width of hardware */
-/* real height of hardware */
-/* number of graphics colors */
-/* number of available graphics colors */
-
 typedef union nc_crtword {
     struct {
       char h, c;
@@ -130,14 +115,22 @@ nc_windowRec *nc_tempWindow;
 nc_fontRec nc_fonts[nc_maxFonts + 1];
 char *nc_commands;
 _PROCEDURE nc_startAlphaHook, nc_endAlphaHook;
+
 struct {
-    short left, top, xincr, yincr, width, height, colors, gColors;
+    short left; ///< left edge of main window
+	short top; ///< top of main window
+	short xincr; ///< pixels/character in X
+	short yincr; ///< pixels/character in Y
+	short width; ///< real width of hardware
+	short height; ///< real height of hardware
+	short colors; ///< number of graphics colors
+	short gColors; ///< number of available graphics colors
 } nc_g;
+
 nc_crtword *nc_screen;
 uchar (*nc_colors)[256];
 
 
-
 /* Simulation routines.  Should GO AWAY. */
 void nc_scrollDown ();
 void nc_scrollUp ();
@@ -229,8 +222,8 @@ void nc_fputs (char * s, FILE *outfile);
 void nc_printf (char * fmt, ...);
 void nc_fprintf (FILE * outfile, char * fmt, ...);
 
-#define printf nc_printf 
-#define fprintf nc_fprintf 
+#define printf nc_printf
+#define fprintf nc_fprintf
 #define puts nc_puts
 #undef putchar
 #define putchar nc_putchar
@@ -242,5 +235,5 @@ void nc_fprintf (FILE * outfile, char * fmt, ...);
 
 #endif /*NEWCRT_H*/
 
-/* End. */
+
 
diff --git a/include/graphics/newkbd.h b/include/graphics/newkbd.h
index 0ec873d..2ff50b8 100644
--- a/include/graphics/newkbd.h
+++ b/include/graphics/newkbd.h
@@ -54,5 +54,5 @@ void nk_settransarray (int opcode, nk_keytransinfo **table);
 
 #endif /*NEWKBD_H*/
 
-/* End. */
+
 
diff --git a/include/log_action.h b/include/log_action.h
index fc2084f..81523cf 100644
--- a/include/log_action.h
+++ b/include/log_action.h
@@ -210,11 +210,11 @@ typedef struct log_action_t
 	log_kattrrec *actkattr;
 	unsigned char *actproc;
 
-	log_page *pages[log_maxpages]; /* TODO use a variable size array or a list */
-	size_t numpages; /**< number of pages */
+	log_page *pages[log_maxpages]; /** \TODO use a variable size array or a list */
+	size_t numpages; ///< number of pages
 	log_nrec *nbase;
-	long curpage;  /**< current page number */
-	long showpage; /**< currenctly displayed page number */
+	long curpage;  ///< current page number
+	long showpage; ///< currenctly displayed page number
 
 
 	log_sigrec *signaltab;
@@ -223,7 +223,7 @@ typedef struct log_action_t
 
 	short scale;
 	short hscale;
-	long xoff;	   /**< screen_x = grid_x * scale - xoff */
+	long xoff;	   ///< screen_x = grid_x * scale - xoff
 	long yoff;
 
 	char func[17];
diff --git a/include/logcom.h b/include/logcom.h
index a97ea45..fa86416 100644
--- a/include/logcom.h
+++ b/include/logcom.h
@@ -22,4 +22,4 @@ extern void Log_7_time (log_action_t *act);
 
 #endif /*LOGCOM_H*/
 
-/* End. */
+
diff --git a/include/logdef.h b/include/logdef.h
index b13f04c..1585c59 100644
--- a/include/logdef.h
+++ b/include/logdef.h
@@ -269,4 +269,4 @@ typedef struct log_tool {
 #include <log_action.h>
 #endif /*LOGDEF_H*/
 
-/* End. */
+
diff --git a/include/logdig.h b/include/logdig.h
index abda1e3..825f8b6 100644
--- a/include/logdig.h
+++ b/include/logdig.h
@@ -57,4 +57,4 @@ vextern const log_16_bvarr log_16_bv;
 
 #endif /*LOGDIG_H*/
 
-/* End. */
+
diff --git a/include/loghier.h b/include/loghier.h
index 6ff42d9..225c329 100644
--- a/include/loghier.h
+++ b/include/loghier.h
@@ -31,4 +31,4 @@ extern void Log_7_ginst (log_action_t *act);
 
 #endif /*LOGHIER_H*/
 
-/* End. */
+
diff --git a/include/logntk.h b/include/logntk.h
index b719020..429c06d 100644
--- a/include/logntk.h
+++ b/include/logntk.h
@@ -14,4 +14,4 @@ extern void Log_logntk_proc (log_action_t *act);
 
 #endif /*LOGNTK_H*/
 
-/* End. */
+
diff --git a/include/logsim.h b/include/logsim.h
index c66da07..0c03576 100644
--- a/include/logsim.h
+++ b/include/logsim.h
@@ -32,4 +32,4 @@ extern void log_16_noprog (log_16_action *act);
 
 #endif /*LOGSIM_H*/
 
-/* End. */
+
diff --git a/include/logsima.h b/include/logsima.h
index 03d2797..ee394b9 100644
--- a/include/logsima.h
+++ b/include/logsima.h
@@ -47,4 +47,4 @@ extern void callgate (log_16_actionkinds action);
 
 #endif /*LOGSIMA_H*/
 
-/* End. */
+
diff --git a/include/logsimed.h b/include/logsimed.h
index 2b08862..3f4701d 100644
--- a/include/logsimed.h
+++ b/include/logsimed.h
@@ -23,4 +23,4 @@ extern long assem_16 (char *buf, uchar *proc, long *pc);
 
 #endif /*LOGSIMED_H*/
 
-/* End. */
+
diff --git a/include/logsimh.h b/include/logsimh.h
index 89a940d..82164c8 100644
--- a/include/logsimh.h
+++ b/include/logsimh.h
@@ -19,4 +19,4 @@ extern void Log_16_digh (log_16_action *act);
 
 #endif /*LOGSIMH_H*/
 
-/* End. */
+
diff --git a/include/logspc.h b/include/logspc.h
index 6f18ad3..81fc2c3 100644
--- a/include/logspc.h
+++ b/include/logspc.h
@@ -14,4 +14,4 @@ extern void Log_logspc_proc (log_action_t *act);
 
 #endif /*LOGSPC_H*/
 
-/* End. */
+
diff --git a/include/mygates.h b/include/mygates.h
index f857963..a4c03b9 100644
--- a/include/mygates.h
+++ b/include/mygates.h
@@ -16,4 +16,4 @@ extern void Log_mygates_asckbd (log_16_action *act);
 
 #endif /*MYGATES_H*/
 
-/* End. */
+
diff --git a/include/utils/filepack.h b/include/utils/filepack.h
index c9324c2..f08265d 100644
--- a/include/utils/filepack.h
+++ b/include/utils/filepack.h
@@ -9,4 +9,4 @@ int fp_getwd (char *path, char *rootname);
 
 #endif /*FILEPACK_H*/
 
-/* End. */
+
diff --git a/include/utils/iodecl.h b/include/utils/iodecl.h
index 50d2758..f06c8a1 100644
--- a/include/utils/iodecl.h
+++ b/include/utils/iodecl.h
@@ -235,5 +235,5 @@ uchar io_find_isc (void* *iod_temp);
 
 #endif /*IODECLARATIONS_H*/
 
-/* End. */
+
 
diff --git a/include/utils/misc.h b/include/utils/misc.h
index 972bbe6..4e8ee95 100644
--- a/include/utils/misc.h
+++ b/include/utils/misc.h
@@ -10,5 +10,5 @@ char *tilde_expand  (char *s);
 
 #endif /*MISC_H*/
 
-/* End. */
+
 
diff --git a/include/utils/newasm.h b/include/utils/newasm.h
index 7f60a17..2a0418b 100644
--- a/include/utils/newasm.h
+++ b/include/utils/newasm.h
@@ -25,4 +25,4 @@ double na_srtor (void* sr);
 
 #endif /*NEWASM_H*/
 
-/* End. */
+
diff --git a/include/utils/p2c.h b/include/utils/p2c.h
index 4e20a6a..5e2add3 100644
--- a/include/utils/p2c.h
+++ b/include/utils/p2c.h
@@ -184,4 +184,4 @@ long    *P_expset     (long *, long) DEPRECATED;
 char * cuserid(char *);
 #endif
 
-/* End. */
+
diff --git a/include/utils/regex.h b/include/utils/regex.h
index 88554d2..e12adbb 100644
--- a/include/utils/regex.h
+++ b/include/utils/regex.h
@@ -22,5 +22,5 @@ void re_grepl (char *s, char *pat, char *rpl);
 
 #endif /*REGEX_H*/
 
-/* End. */
+
 
diff --git a/include/utils/strings.h b/include/utils/strings.h
index 678c6fa..85c32b3 100644
--- a/include/utils/strings.h
+++ b/include/utils/strings.h
@@ -6,7 +6,7 @@
 /**
  * Append the second string to the first.
  *
- * DEPRECATED : use strcat instead
+ * \deprecated use strcat instead
  */
 void strsafeappend(char *s, char *s2) DEPRECATED;
 
@@ -51,6 +51,10 @@ void strcomment (char *s, char* bracket);
 void strcompress (char *s, char *chars, int all);
 void strdispose (char **sp);
 void strchange (char** sp, char *);
+
+/**
+ * \deprecated
+ */
 char *strcpy_overlap(char *dst, char *src) DEPRECATED;
 
 #endif
diff --git a/include/utils/sysdevs.h b/include/utils/sysdevs.h
index 292677f..51f4a33 100644
--- a/include/utils/sysdevs.h
+++ b/include/utils/sysdevs.h
@@ -3,7 +3,6 @@
 
 #include <utils/sysglobals.h>
 
-/** CLOCK ************************************************/
 long sysclock ();
 void sysdate (daterec *thedate);
 void systime (timerec *thetime);
@@ -12,5 +11,5 @@ void setsystime (timerec thetime);
 
 #endif /*SYSDEVS_H*/
 
-/* End. */
+
 
diff --git a/include/utils/sysglobals.h b/include/utils/sysglobals.h
index 3f9f942..7769eff 100644
--- a/include/utils/sysglobals.h
+++ b/include/utils/sysglobals.h
@@ -49,5 +49,5 @@ typedef struct datetimerec {
 
 #endif /*SYSGLOBALS_H*/
 
-/* End. */
+
 
diff --git a/src/ana/capfloat.c b/src/ana/capfloat.c
index 464c61a..0ecd6a3 100644
--- a/src/ana/capfloat.c
+++ b/src/ana/capfloat.c
@@ -43,12 +43,7 @@ typedef struct ICCapfloat {
 } ICCapfloat;
 
 
-
-/****************************************************************************/
-/*            Procedure To Simulate Cell In Algorithm                        */
-/****************************************************************************/
-
-
+/// Procedure To Simulate Cell In Algorithm 
 static void Ex_Capfloat(Analog_32_action *act)
 {
   double MinI1, MinI2, dI1dV1, dI1dV2, dI2dV1, dI2dV2;
@@ -100,12 +95,7 @@ static void Ex_Capfloat(Analog_32_action *act)
   AnaCapex(act->inst);   /*Does execution of node capacitors*/
 }  /*Ex_Capfloat*/
 
-
-/****************************************************************************/
-/*          Procedure To Supply Current  Out of a Cell To Current Meters    */
-/****************************************************************************/
-
-
+/// Procedure To Supply Current  Out of a Cell To Current Meters
 static void Iin_Capfloat(Analog_32_action *act)
 {
   AnaExt_rec *Pin1Ptr;
@@ -171,10 +161,7 @@ static void GetCnf_Capfloat(ICCapfloat *NewIC)
 }
 
 
-/****************************************************************************/
-/*                          Installation Procedure                           */
-/****************************************************************************/
-
+/// Installation Procedure
 static void initlib_Capfloat(Analog_32_action *act)
 {
   AnaCell_rec *NewCell;
@@ -340,11 +327,7 @@ static void Probe_Capfloat(Analog_32_action *act)
 }
 
 
-/*==========================================================================*/
-/*                 Library Listing For  Cell Capfloat                    */
-/*==========================================================================*/
-
-
+/// Library Listing For  Cell Capfloat
 void Log_capfloat_initlib_32(Analog_32_action *act)
 {
   /*Main Procedure*/
@@ -418,5 +401,3 @@ void Log_capfloat_initlib_32(Analog_32_action *act)
 #undef N_Cap
 #undef Cstart
 #undef GateName
-
-/* End. */
diff --git a/src/ana/devtechn.c b/src/ana/devtechn.c
index 2f9ea76..ff8dd67 100644
--- a/src/ana/devtechn.c
+++ b/src/ana/devtechn.c
@@ -501,4 +501,4 @@ Analog_32_action *act;
 
 
 
-/* End. */
+
diff --git a/src/ana/devtechp.c b/src/ana/devtechp.c
index 6244c2f..7959c59 100644
--- a/src/ana/devtechp.c
+++ b/src/ana/devtechp.c
@@ -501,4 +501,4 @@ Analog_32_action *act;
 
 
 
-/* End. */
+
diff --git a/src/ana/diode1.c b/src/ana/diode1.c
index 9c3e1f7..e178744 100644
--- a/src/ana/diode1.c
+++ b/src/ana/diode1.c
@@ -705,4 +705,4 @@ Analog_32_action *act;
 #undef Cstart
 #undef Gatename
 
-/* End. */
+
diff --git a/src/ana/ganglion.c b/src/ana/ganglion.c
index 755519a..880a633 100644
--- a/src/ana/ganglion.c
+++ b/src/ana/ganglion.c
@@ -1109,4 +1109,4 @@ Analog_32_action *act;
 
 
 
-/* End. */
+
diff --git a/src/ana/globals.c b/src/ana/globals.c
index 497527b..e08d004 100644
--- a/src/ana/globals.c
+++ b/src/ana/globals.c
@@ -1143,4 +1143,4 @@ void AnaParamUpdate()
 
 
 
-/* End. */
+
diff --git a/src/ana/hres.c b/src/ana/hres.c
index c67fd97..4fcde0f 100644
--- a/src/ana/hres.c
+++ b/src/ana/hres.c
@@ -1418,4 +1418,4 @@ Analog_32_action *act;
 
 
 
-/* End. */
+
diff --git a/src/ana/idiff.c b/src/ana/idiff.c
index 7761a5a..63fb833 100644
--- a/src/ana/idiff.c
+++ b/src/ana/idiff.c
@@ -1189,4 +1189,4 @@ Analog_32_action *act;
 
 
 
-/* End. */
+
diff --git a/src/ana/inter.c b/src/ana/inter.c
index b8e5dbe..d60ef3a 100644
--- a/src/ana/inter.c
+++ b/src/ana/inter.c
@@ -1072,4 +1072,4 @@ void Log_33_proc(log_action_t *act)
 
 
 
-/* End. */
+
diff --git a/src/ana/iscope.c b/src/ana/iscope.c
index 777cde4..2e29010 100644
--- a/src/ana/iscope.c
+++ b/src/ana/iscope.c
@@ -775,4 +775,4 @@ Analog_32_action *act;
 
 
 
-/* End. */
+
diff --git a/src/ana/iswitch1.c b/src/ana/iswitch1.c
index 4425272..3b0d139 100644
--- a/src/ana/iswitch1.c
+++ b/src/ana/iswitch1.c
@@ -1033,4 +1033,4 @@ Analog_32_action *act;
 
 
 
-/* End. */
+
diff --git a/src/ana/iswitch2.c b/src/ana/iswitch2.c
index 6fb4323..97d55d3 100644
--- a/src/ana/iswitch2.c
+++ b/src/ana/iswitch2.c
@@ -1034,4 +1034,4 @@ Analog_32_action *act;
 
 
 
-/* End. */
+
diff --git a/src/ana/main.c b/src/ana/main.c
index 6d7aa65..e6ebcf3 100644
--- a/src/ana/main.c
+++ b/src/ana/main.c
@@ -2677,4 +2677,4 @@ void Analog_Simulate()
 
 
 
-/* End. */
+
diff --git a/src/ana/mmeter.c b/src/ana/mmeter.c
index 8c8f21e..e6b4ce2 100644
--- a/src/ana/mmeter.c
+++ b/src/ana/mmeter.c
@@ -851,4 +851,4 @@ Analog_32_action *act;
 
 
 
-/* End. */
+
diff --git a/src/ana/moscap.c b/src/ana/moscap.c
index 12e9b61..972bf48 100644
--- a/src/ana/moscap.c
+++ b/src/ana/moscap.c
@@ -587,4 +587,4 @@ Analog_32_action *act;
 
 
 
-/* End. */
+
diff --git a/src/ana/nfet4.c b/src/ana/nfet4.c
index bee234e..1bcc6aa 100644
--- a/src/ana/nfet4.c
+++ b/src/ana/nfet4.c
@@ -1013,4 +1013,4 @@ Analog_32_action *act;
 
 
 
-/* End. */
+
diff --git a/src/ana/nfet5.c b/src/ana/nfet5.c
index 71f5bce..ec5b0ee 100644
--- a/src/ana/nfet5.c
+++ b/src/ana/nfet5.c
@@ -919,4 +919,4 @@ Analog_32_action *act;
 
 
 
-/* End. */
+
diff --git a/src/ana/nfet7f.c b/src/ana/nfet7f.c
index 976277c..41d7c4f 100644
--- a/src/ana/nfet7f.c
+++ b/src/ana/nfet7f.c
@@ -1175,4 +1175,4 @@ Analog_32_action *act;
 
 
 
-/* End. */
+
diff --git a/src/ana/nfet7t.c b/src/ana/nfet7t.c
index aed1abd..7126daf 100644
--- a/src/ana/nfet7t.c
+++ b/src/ana/nfet7t.c
@@ -1087,4 +1087,4 @@ Analog_32_action *act;
 
 
 
-/* End. */
+
diff --git a/src/ana/npn1.c b/src/ana/npn1.c
index e586954..af7336d 100644
--- a/src/ana/npn1.c
+++ b/src/ana/npn1.c
@@ -1049,4 +1049,4 @@ Analog_32_action *act;
 
 
 
-/* End. */
+
diff --git a/src/ana/npn2.c b/src/ana/npn2.c
index c09b52e..3da4aca 100644
--- a/src/ana/npn2.c
+++ b/src/ana/npn2.c
@@ -1081,4 +1081,4 @@ Analog_32_action *act;
 #undef N_Va
 #undef Gatename
 
-/* End. */
+
diff --git a/src/ana/nsolver.c b/src/ana/nsolver.c
index f961f06..4e837f8 100644
--- a/src/ana/nsolver.c
+++ b/src/ana/nsolver.c
@@ -249,4 +249,4 @@ void Solve()
     AnaEpoch = AnaE_Calculate;
 }
 
-/* End. */
+
diff --git a/src/ana/nspc1.c b/src/ana/nspc1.c
index 2c8df81..7fdc5d1 100644
--- a/src/ana/nspc1.c
+++ b/src/ana/nspc1.c
@@ -1262,4 +1262,4 @@ Analog_32_action *act;
 
 
 
-/* End. */
+
diff --git a/src/ana/numbers.c b/src/ana/numbers.c
index 7426b17..4916f6b 100644
--- a/src/ana/numbers.c
+++ b/src/ana/numbers.c
@@ -1141,4 +1141,4 @@ void Log_numbers_initlib_32(Analog_32_action *act)
 
 
 
-/* End. */
+
diff --git a/src/ana/pfet4.c b/src/ana/pfet4.c
index 7cb09eb..a123cb5 100644
--- a/src/ana/pfet4.c
+++ b/src/ana/pfet4.c
@@ -1008,4 +1008,4 @@ Analog_32_action *act;
 
 
 
-/* End. */
+
diff --git a/src/ana/pfet5.c b/src/ana/pfet5.c
index 1144fb7..845ddbc 100644
--- a/src/ana/pfet5.c
+++ b/src/ana/pfet5.c
@@ -920,4 +920,4 @@ Analog_32_action *act;
 
 
 
-/* End. */
+
diff --git a/src/ana/pfet6.c b/src/ana/pfet6.c
index 5d7bf45..03ed6fe 100644
--- a/src/ana/pfet6.c
+++ b/src/ana/pfet6.c
@@ -1015,4 +1015,4 @@ Analog_32_action *act;
 
 
 
-/* End. */
+
diff --git a/src/ana/pfet7f.c b/src/ana/pfet7f.c
index e954f42..81065d2 100644
--- a/src/ana/pfet7f.c
+++ b/src/ana/pfet7f.c
@@ -1177,4 +1177,4 @@ Analog_32_action *act;
 
 
 
-/* End. */
+
diff --git a/src/ana/pfet7t.c b/src/ana/pfet7t.c
index 696415b..153d8b3 100644
--- a/src/ana/pfet7t.c
+++ b/src/ana/pfet7t.c
@@ -1095,4 +1095,4 @@ Analog_32_action *act;
 
 
 
-/* End. */
+
diff --git a/src/ana/physical.c b/src/ana/physical.c
index f80f368..e2f96df 100644
--- a/src/ana/physical.c
+++ b/src/ana/physical.c
@@ -309,4 +309,4 @@ Analog_32_action *act;
 
 
 
-/* End. */
+
diff --git a/src/ana/pnp1.c b/src/ana/pnp1.c
index 8291ef9..7baa96f 100644
--- a/src/ana/pnp1.c
+++ b/src/ana/pnp1.c
@@ -1051,4 +1051,4 @@ Analog_32_action *act;
 
 
 
-/* End. */
+
diff --git a/src/ana/pnp2.c b/src/ana/pnp2.c
index 8f00d98..5108204 100644
--- a/src/ana/pnp2.c
+++ b/src/ana/pnp2.c
@@ -1085,4 +1085,4 @@ Analog_32_action *act;
 #undef N_Va
 #undef Gatename
 
-/* End. */
+
diff --git a/src/ana/pspc1.c b/src/ana/pspc1.c
index 8a57e38..9d4a1c1 100644
--- a/src/ana/pspc1.c
+++ b/src/ana/pspc1.c
@@ -1223,4 +1223,4 @@ Analog_32_action *act;
 
 
 
-/* End. */
+
diff --git a/src/ana/pwl.c b/src/ana/pwl.c
index c2e7e7a..f7c19d9 100644
--- a/src/ana/pwl.c
+++ b/src/ana/pwl.c
@@ -1032,4 +1032,4 @@ Analog_32_action *act;
 
 
 
-/* End. */
+
diff --git a/src/ana/resfloat.c b/src/ana/resfloat.c
index 8406d65..d798d16 100644
--- a/src/ana/resfloat.c
+++ b/src/ana/resfloat.c
@@ -445,4 +445,4 @@ Analog_32_action *act;
 
 
 
-/* End. */
+
diff --git a/src/ana/rtd.c b/src/ana/rtd.c
index e5b71b5..7b21a28 100644
--- a/src/ana/rtd.c
+++ b/src/ana/rtd.c
@@ -1019,4 +1019,4 @@ Analog_32_action *act;
 
 
 
-/* End. */
+
diff --git a/src/ana/runspec.c b/src/ana/runspec.c
index 8e537da..cfecb5b 100644
--- a/src/ana/runspec.c
+++ b/src/ana/runspec.c
@@ -302,4 +302,4 @@ Analog_32_action *act;
 #undef N_P_Mu
 #undef N_P_Qss
 
-/* End. */
+
diff --git a/src/ana/stairs.c b/src/ana/stairs.c
index ef00d45..c46abd5 100644
--- a/src/ana/stairs.c
+++ b/src/ana/stairs.c
@@ -956,4 +956,4 @@ Analog_32_action *act;
 
 
 
-/* End. */
+
diff --git a/src/ana/tc.c b/src/ana/tc.c
index 89b3d4c..3f5237b 100644
--- a/src/ana/tc.c
+++ b/src/ana/tc.c
@@ -2622,4 +2622,4 @@ Analog_32_action *act;
 
 
 
-/* End. */
+
diff --git a/src/ana/thermal.c b/src/ana/thermal.c
index 78bc26a..2962006 100644
--- a/src/ana/thermal.c
+++ b/src/ana/thermal.c
@@ -464,4 +464,4 @@ Analog_32_action *act;
 
 
 
-/* End. */
+
diff --git a/src/ana/vdiff.c b/src/ana/vdiff.c
index a276ea5..dd4a638 100644
--- a/src/ana/vdiff.c
+++ b/src/ana/vdiff.c
@@ -1132,4 +1132,4 @@ void Log_vdiff_initlib_32(Analog_32_action *act)
 
 
 
-/* End. */
+
diff --git a/src/ana/vswitch.c b/src/ana/vswitch.c
index e530697..eae0039 100644
--- a/src/ana/vswitch.c
+++ b/src/ana/vswitch.c
@@ -978,4 +978,4 @@ void Log_vswitch_initlib_32(Analog_32_action *act)
 
 
 
-/* End. */
+
diff --git a/src/diggates.c b/src/diggates.c
index 89d214f..42d3e23 100644
--- a/src/diggates.c
+++ b/src/diggates.c
@@ -756,4 +756,4 @@ void Log_mygates_asckbd(log_16_action *act)
 #undef map_c
 
 
-/* End. */
+
diff --git a/src/gate.c b/src/gate.c
index 71efb9a..ea6e95b 100644
--- a/src/gate.c
+++ b/src/gate.c
@@ -14,14 +14,8 @@
 #include "page.h"
 #include "tool.h"
 
-/*================  INSIDEGATE  ==================*/
-/*=                                              =*/
-/*=  Check if inside a gate's "yellow box."      =*/
-/*=                                              =*/
-/*================================================*/
-
-/* new version by Tim Edwards, Dec 1996 */
-
+/// Check if inside a gate's "yellow box."
+/** new version by Tim Edwards, Dec 1996 */
 int insidegate(log_grec *gate, short x, short y)
 {
 	short xx1, xx2, yy1, yy2, z;
@@ -69,13 +63,7 @@ int insidegate(log_grec *gate, short x, short y)
 	}
 }
 
-/*==================  ERAGATE  ===================*/
-/*=                                              =*/
-/*=  Erase a gate (including LED's and other     =*/
-/*=     "magic" stuff) using grid coordinates.   =*/
-/*=                                              =*/
-/*================================================*/
-
+/// Erase a gate (including LED's and other "magic" stuff) using grid coordinates.
 void eragate(log_grec *gate)
 {
 	log_grec *g1, *g2;
@@ -102,10 +90,10 @@ void eragate(log_grec *gate)
 		gate->conflict2 = false;
 		gate->oconflict = false;
 	}
-	
+
 	drawgatec(gate->x, gate->y, gate->g, gg.color.backgr);
 	gsignallabel(gate->x, gate->y, gate, gg.color.backgr);
-	
+
 	if (gate->kind->numpnums > 0)
 		drawpnums(gate, gg.color.backgr);
 
@@ -113,12 +101,7 @@ void eragate(log_grec *gate)
 	calltoolgate(gate, act_erasegate);
 }
 
-/*==================  LINKGATE  ==================*/
-/*=                                              =*/
-/*=  Add a gate to the gate list.                =*/
-/*=                                              =*/
-/*================================================*/
-
+/// Add a gate to the gate list.
 void linkgate(log_grec **gate)
 {
 	(*gate)->next = gg.pages[gg.curpage - 1]->gbase;
@@ -128,12 +111,6 @@ void linkgate(log_grec **gate)
 			(*gate)->y + (*gate)->kind->bbmax);
 }
 
-/*===================  NEWGATE  ==================*/
-/*=                                              =*/
-/*=  Create a gate.                              =*/
-/*=                                              =*/
-/*================================================*/
-
 void newgptr(log_grec **gate)
 {
 	*gate = (log_grec *)Malloc(sizeof(log_grec));
@@ -188,19 +165,14 @@ void newgate2(log_grec **gate, short gt, short sig, log_gattrrec *attrs)
 	calltoolgate(*gate, act_newgate);
 }
 
-
+/// Creates a gate.
 void newgate(log_grec **gate, short gt)
 {
 	newgate2(gate, gt, 0, NULL);
 }
 
 
-/*================  COPYGATE  ====================*/
-/*=                                              =*/
-/*=  Make a copy of a gate (unlinked).           =*/
-/*=                                              =*/
-/*================================================*/
-
+/// Make a copy of a gate (unlinked).
 void copygate(log_grec *old, log_grec **gate)
 {
 	newgptr(gate);
@@ -211,11 +183,11 @@ void copygate(log_grec *old, log_grec **gate)
 		gateconflictbase = *gate;
 	}
 	(*gate)->pin = (log_nrec **)Malloc((*gate)->kind->numpins * sizeof(log_nrec *));
-	
+
 	long numpins = (*gate)->kind->numpins;
 	for (long i = 0; i < numpins; i++)
 		(*gate)->pin[i] = old->pin[i];
-	
+
 	(*gate)->pinpos = (log_pinposrec *)
 		Malloc((*gate)->kind->numpins * sizeof(log_pinposrec));
 
@@ -230,12 +202,7 @@ void copygate(log_grec *old, log_grec **gate)
 }
 
 
-/*==================  UNLKGATE  ==================*/
-/*=                                              =*/
-/*=  Remove a gate from gate list.               =*/
-/*=                                              =*/
-/*================================================*/
-
+/// Remove a gate from gate list.
 void unlkgate(log_grec **gate)
 {
 	log_grec *g1;
@@ -253,12 +220,7 @@ void unlkgate(log_grec **gate)
 }
 
 
-/*===============  DISPOSEGATE  ==================*/
-/*=                                              =*/
-/*=  Dispose of a gate.                          =*/
-/*=                                              =*/
-/*================================================*/
-
+/// Dispose of a gate in memory.
 void disposegptr(log_grec **gate)
 {
 	free(*gate);
@@ -295,13 +257,9 @@ void disposegate(log_grec **gate)
 	disposegptr(gate);
 }
 
-/*================  CLOSERGATE  ==================*/
-/*=                                              =*/
-/*=  Find which gate (if any) is under cursor.   =*/
-/*=  Also checks for textual labels.             =*/
-/*=                                              =*/
-/*================================================*/
-
+/** @brief Find which gate (if any) is under cursor.
+			Also checks for textual labels.
+*/
 void closergate(short x, short y)
 {
 	if (gg.textinvisible)
@@ -539,13 +497,6 @@ void frygate(log_grec *gate)
 	refreshsoon();
 }
 
-/*================  CONNECTGATE  =================*/
-/*=                                              =*/
-/*=  Check each pin of a gate and connect to     =*/
-/*=     wires, other pins as necessary.          =*/
-/*=                                              =*/
-/*================================================*/
-
 void initpinpos(log_grec *gate)
 {
 	short i, rxx, rxy, ryx, ryy;
@@ -565,7 +516,9 @@ void initpinpos(log_grec *gate)
 	}
 }
 
-
+/** @brief Check each pin of a gate and
+			connect to wires, other pins as necessary.
+*/
 int connectgate(log_grec *gate)
 {
 	int Result;
@@ -687,13 +640,6 @@ void pconnectgate(log_grec *gate, int *success)
 	*success = connectgate(gate);
 }
 
-/*=================  ADDGATE1  ===================*/
-/*=                                              =*/
-/*=  Add a gate to the circuit.  Initialize all  =*/
-/*=     gate variables, etc.                     =*/
-/*=                                              =*/
-/*================================================*/
-
 void addgate2(short x, short y, short gtype, short sig, log_gattrrec *attrs)
 {
 	log_grec *g, *g1;
@@ -739,7 +685,7 @@ void addgate2(short x, short y, short gtype, short sig, log_gattrrec *attrs)
 	gg.neargate = g;
 }
 
-
+/// Add a gate to the circuit. Initialize all gate variables, etc.
 void addgate1(short x, short y, short gtype)
 {
 	addgate2(x, y, gtype, 0, NULL);
@@ -775,13 +721,6 @@ void uaddgate(short x, short y, short gtype)
 	addgate1(xx, yy, gtype);
 }
 
-/*==================  ADDGATE  ===================*/
-/*=                                              =*/
-/*=  Move a gate into position, then add to      =*/
-/*=     circuit or menu area.                    =*/
-/*=                                              =*/
-/*================================================*/
-
 void movexorgate(short x, short y, short g, short sig, short yy)
 {
 	clipoff();
@@ -803,7 +742,7 @@ void movexorgate(short x, short y, short g, short sig, short yy)
 	m_colormode((long)m_normal);
 }
 
-
+/// Move a gate into position, then add to circuit or menu area.
 int addgate(short gtype, short sig, log_gattrrec *attrs)
 {
 	int Result;
diff --git a/src/graphics/mylib.c b/src/graphics/mylib.c
index e712c92..0070194 100644
--- a/src/graphics/mylib.c
+++ b/src/graphics/mylib.c
@@ -667,8 +667,7 @@ printf("log_color: %s visual_table: %d %d %d %d %d %d %d\n", log_color, visual_t
         }
     }
     else {
-                /*   code for HIRES goes here. */
-                /* ========================================= */
+					/*   code for HIRES goes here. */
           basepixel = 0;
           usableColors = colorCount;
 	  colormap = XCreateColormap(m_display, DefaultRootWindow(m_display),
@@ -1377,10 +1376,8 @@ int hpib_address;
   Mfprintf(stderr, "m_init_pen(%d)\n", hpib_address);
 }
 
-/*****************************************************************************/
-/*            These are internal routines to do better buffering             */
-
 
+/// These are internal routines to do better buffering
 #ifdef EXTRA_BUFFERING
 #define BUF_SIZE 1024
 
@@ -1516,11 +1513,6 @@ static void flush_buffers()
 }
 #endif /* EXTRA_BUFFERING */
 
-
-/*                                                                           */
-/*****************************************************************************/
-
-
 void m_clear()
 {
   Mfprintf(stderr, "m_clear()\n");
diff --git a/src/label.c b/src/label.c
index d24422d..3df1b34 100644
--- a/src/label.c
+++ b/src/label.c
@@ -12,9 +12,9 @@
 
 
 /**
- *  @param lbl: list of character to parse
- *  @param numattrs: number of found attributs
- *  @param attr: vector containing parsed attributs
+	@param lbl: list of character to parse
+	@param numattrs: number of found attributs
+	@param attr: vector containing parsed attributs
  */
 void parselabel(strlist_t **lbl, short *numattrs, log_kattrrec **attr)
 {
@@ -317,12 +317,7 @@ void parselabel(strlist_t **lbl, short *numattrs, log_kattrrec **attr)
 		(*attr)[j].x = maxx + 1;
 }
 
-/*==================  ERALABEL  ==================*/
-/*=                                              =*/
-/*=  Erase a text label from the screen.         =*/
-/*=                                              =*/
-/*================================================*/
-
+/// Erase a text label from the screen.
 void eralabel(log_lrec *l)
 {
 	m_color((long)gg.color.backgr);
@@ -331,12 +326,7 @@ void eralabel(log_lrec *l)
 }
 
 
-/*==================  XORLABEL  ==================*/
-/*=                                              =*/
-/*=  XOR a text label onto the screen.           =*/
-/*=                                              =*/
-/*================================================*/
-
+/// XOR a text label onto the screen.
 void xorlabel(short x, short y, log_lrec *l)
 {
 	m_colormode((long)m_xor);
@@ -346,12 +336,6 @@ void xorlabel(short x, short y, log_lrec *l)
 	m_colormode((long)m_normal);
 }
 
-/*==================  NEWLABEL  ==================*/
-/*=                                              =*/
-/*=  Create a Label.                             =*/
-/*=                                              =*/
-/*================================================*/
-
 void linklabel(log_lrec *l)
 {
 	l->next = gg.pages[gg.curpage - 1]->lbase;
@@ -359,7 +343,7 @@ void linklabel(log_lrec *l)
 	stamp(&gg.labelstamp);
 }
 
-
+/// Create a Label.
 void newlabel(log_lrec **l)
 {
 	*l = (log_lrec *)Malloc(sizeof(log_lrec));
@@ -368,12 +352,7 @@ void newlabel(log_lrec **l)
 }
 
 
-/*================  DISPLABEL  ===================*/
-/*=                                              =*/
-/*=  Dispose of a text label.                    =*/
-/*=                                              =*/
-/*================================================*/
-
+/// Dispose of a text label.
 void unlinklabel(log_lrec *l)
 {
 	log_lrec *l1;
diff --git a/src/log.c b/src/log.c
index f75e5b6..95364ff 100644
--- a/src/log.c
+++ b/src/log.c
@@ -44,8 +44,6 @@
 #include <utils/sysglobals.h>
 #include <utils/sysdevs.h>
 
-/*homeless orphans*/
-
 #include <utils/misc.h>
 #include "help.h"
 #include <graphics/newci.h>
@@ -60,7 +58,6 @@
 #include <utils/newasm.h>
 #include <graphics/newcrt.h>
 
-/* @ home */
 #include "settings.h"
 #include "logstructs.h"
 #include "logglobals.h"
@@ -82,32 +79,6 @@ char *GetChipmunkPath();
 enum cursors;
 enum cursors cursortype;
 enum cursors oldcursortype;
-/* 0*/
-/* If the pen is in "this" sector, */
-/* 1*/
-/*   switch to "this" state.       */
-/* 2*/
-/* 3*/
-/* 4*/
-/* 5*/
-/* 6*/
-/* 7*/
-/* 8*/
-/* 9*/
-/*10*/
-/*11*/
-/*12*/
-/*13*/
-/*14*/
-/*15*/
-/*16*/
-/*17*/
-/*18*/
-/*19*/
-/*20*/
-/*21*/
-/*22*/
-/*23*/
 
 const rablisttype rablist = {
 			     { 0, 0, 1 },
@@ -172,174 +143,209 @@ const rabmustype discomadness = {
 };
 
 
-log_action_t gg;   /* External global variables */
-
-short cursx, cursy;   /* Current position of cursor */
-short cursx1, cursy1;   /* Wire starting point */
-short cursx2, cursy2;   /* Wire ending point */
-short chairx, chairy;   /* Current position of crosshair */
-
-int cursorflag;   /* Cursor is displayed */
-int prevcursorflag;
-/* Cursor was displayed before operation began */
-int chairflag;   /* Crosshair is on screen */
-int chairflag2;   /* Crosshair will be on screen */
-int rbandflag;   /* Rubber-band wire is on screen */
-int rabbits, rabflag;   /* Rabbit mode */
-int avoidrabbits;
-
-short txacross, txdown, across, down, baseline, line1, line2,
-	kindgroupbase, kindgroupleft, kindgroupright, kindgroupstart,
-	kindgroupsize, histdown;
-
-int entrycapslock;   /* Capslock status on entry */
-int oldcapslock;   /* Previous capslock status */
-
-int signalcaps;   /* Capslock flag for signal-name entry */
-int labelcaps;   /* Capslock flag for label entry */
-
-char (*index_)[9];   /* Index into gate library */
-short *indexoffset;   /* Offset of each gate */
-uchar *indexfile;   /* File number of each gate */
-uchar *indexgroup;   /* Group number of each gate */
-uchar *loadedgates;   /* Tells whether a gate is in the catalog */
-log_krec *kind[maxmaxkinds];   /* Kind of gate in each catalog space */
-kindgrouptype kindgroup;   /* Kind of gate in each menu-area space */
+log_action_t gg;   ///< External global variables
+
+short cursx;   ///< Current X position of cursor
+short cursy;   ///< Current Y position of cursor
+short cursx1;  ///< X position of wire starting point
+short cursy1;  ///< Y position of wire starting point
+short cursx2;  ///< X position of wire end point
+short cursy2;  ///< Y position of wire end point
+short chairx;  ///< X position of crosshair
+short chairy;  ///< Y position of crosshair
+
+int cursorflag;   ///< If cursor is displayed
+int prevcursorflag; ///< If cursor was displayed before operation began
+int chairflag;   ///< If crosshair is on screen
+int chairflag2;   ///< If crosshair will be on screen
+int rbandflag;   ///< If Rubber-band wire is on screen
+int rabbits;   ///< A plushy animal
+int rabflag;   ///< If Rabbit mode
+int avoidrabbits; ///< Should repel rabbits
+
+short txacross;
+short txdown;
+short across;
+short down;
+short baseline;
+short line1;
+short line2;
+short kindgroupbase;
+short kindgroupleft;
+short kindgroupright;
+short kindgroupstart;
+short kindgroupsize;
+short histdown;
+
+int entrycapslock;   ///< Capslock status on entry
+int oldcapslock;   ///< Previous capslock status
+
+int signalcaps;   ///< Capslock flag for signal-name entry
+int labelcaps;   ///< Capslock flag for label entry
+
+char (*index_)[9];   ///< Index into gate library
+short *indexoffset;   ///< Offset of each gate
+uchar *indexfile;   ///< File number of each gate
+uchar *indexgroup;   ///< Group number of each gate
+uchar *loadedgates;   ///< Tells whether a gate is in the catalog
+log_krec *kind[maxmaxkinds];   ///< Kind of gate in each catalog space
+kindgrouptype kindgroup;   ///< Kind of gate in each menu-area space
 kindgrouptype kindsig;
 kindattrtype kindattr;
 strlist_t *gatefilenames;
-short maxkinds, catwidth;
+short maxkinds;
+short catwidth;
 catboxrec *catboxes;
 librstrrec *librstrs;
 
 char *gatesname[maxgatesfiles];
-char *loghelpname, *lognewsname;   /* Names of system files */
+char *loghelpname;   ///< Name of help file
+char *lognewsname;   ///< Name of news file
 
-short zoom;   /* Zooming level */
-int ospointflag;   /* Starting point was touched */
+short zoom;   ///< Zooming level
+int ospointflag;   ///< Starting point was touched
 
-long xoff0, yoff0;   /* Old XOFF, YOFF */
+long xoff0;   ///< Good ol' XOFF
+long yoff0;   ///< Good ol' YOFF
 
-short curwcolor;   /* Current VLSI wire color */
-char cureditmode;   /* Current editing (gate-tapping) mode */
-short curlistgroup;   /* Current group in library list */
+short curwcolor;   ///< Current VLSI wire color
+char cureditmode;   ///< Current editing (gate-tapping) mode
+short curlistgroup;   ///< Current group in library list
 
-int vlsimode[log_maxpages];   /* Page contains VLSI circuits */
-long xoffp[log_maxpages], yoffp[log_maxpages];
-/* XOFF, YOFF for non-current pages */
-short gatecount[log_maxpages];   /* Highest used gate-ID number */
-char *curfilename[log_maxpages];   /* Name of last-loaded file */
+int vlsimode[log_maxpages];   ///< Page contains VLSI circuits
+long xoffp[log_maxpages];  ///< XOFF for non-current pages
+long yoffp[log_maxpages];  ///< YOFF for non-current pages
+short gatecount[log_maxpages];   ///< Highest used gate-ID number
+char *curfilename[log_maxpages];   ///< Name of last-loaded file
 long realcurpage;
 
-baseptrs copybuf;   /* Del/Copy/Paste buffer */
+baseptrs copybuf;   ///< Del/Copy/Paste buffer
 
-long htcount;   /* Number of timesteps in list */
-short hncount;   /* Number of names in list */
-short hnocount;   /* Old number of names in list */
-short histtrig;   /* Number of signal which triggers history */
+long htcount;   ///< Number of timesteps in list
+short hncount;   ///< Number of names in list
+short hnocount;   ///< Old number of names in list
+short histtrig;   ///< Number of signal which triggers history
 strlist_t *histlbl;
 short histnumattrs;
 log_kattrrec *histkattr;
 log_gattrrec *histgattr;
-short histgridmode, histgridwhich;
+short histgridmode;
+short histgridwhich;
 log_hnrec *histgridhn;
-double histvalrange, histdivsacross;
-int histonscreen;   /* Leading edge of trace is visible */
-int histreset;   /* Clear the history memory */
-double histtime;   /* Current time for history mode */
-
-int probeflag;   /* Has the probe been checked? */
-
-log_nrec *nodeconflictbase;   /* Node conflict list */
-log_grec *gateconflictbase;   /* Gate conflict list */
-
-cnfrec *cnfbase;   /* List of tool configuration lines */
-strlist_t *colorbase;   /* List of configured colors */
-macrorec *macrobase;   /* List of macro keys */
-strlist_t *thingstodo, *nexttodo;   /* List of delayed commands */
-strlist_t *messages;   /* List of delayed messages */
-strlist_t *commandlist;   /* List of tool-activation commands */
-
-char modename[9];   /* Word in 'mode' area of menu */
-int modeflag;   /* Mode area contains a word */
-long modetime;   /* Time (in minutes) in mode display */
+double histvalrange;
+double histdivsacross;
+int histonscreen;   ///< Leading edge of trace is visible
+int histreset;   ///< Clear the history memory
+double histtime;   ///< Current time for history mode
+
+int probeflag;   ///< Has the probe been checked?
+
+log_nrec *nodeconflictbase;   ///< Node conflict list
+log_grec *gateconflictbase;   ///< Gate conflict list
+
+cnfrec *cnfbase;   ///< List of tool configuration lines
+strlist_t *colorbase;   ///< List of configured colors
+macrorec *macrobase;   ///< List of macro keys
+strlist_t *thingstodo; ///< List of delayed commands
+strlist_t *nexttodo;   ///< List of delayed commands
+strlist_t *messages;   ///< List of delayed messages
+strlist_t *commandlist;   ///< List of tool-activation commands
+
+char modename[9];   ///< Word in 'mode' area of menu
+int modeflag;   ///< Mode area contains a word
+long modetime;   ///< Time (in minutes) in mode display
 log_krec *modeprobekind;
 
-nk_keytransinfo *curkeytrans;   /* Current keyboard definitions */
+nk_keytransinfo *curkeytrans;   ///< Current keyboard definitions
 
 
 /*  menupicture, errorpicture : m_picturevar;              { Various saved images */
-short bottomcount;   /* How many nested BEGINBOTTOMs */
+short bottomcount;   ///< How many nested BEGINBOTTOMs
 
-uchar rcolormap[16], gcolormap[16], bcolormap[16];
+uchar rcolormap[16];
+uchar gcolormap[16];
+uchar bcolormap[16];
 
-short gategreen, gateyellow, gatered, gateorange, gateblack, gatewhite;
+short gategreen;
+short gateyellow;
+short gatered;
+short gateorange;
+short gateblack;
+short gatewhite;
 
-short defineboxcolor, definebackcolor, definetextcolor, catboxcolor;
+short defineboxcolor;
+short definebackcolor;
+short definetextcolor;
+short catboxcolor;
 
-short messagepos;   /* Position of next message */
-short messageright;   /* Maximum width of messages */
+short messagepos;   ///< Position of next message
+short messageright;   ///< Maximum width of messages
 
 long fastsavetime;
 
-long watchdog, rabtime;   /* Miscellaneous timers */
+long watchdog;  ///< Miscellaneous timers
+long rabtime;   ///< Miscellaneous timers
 
-log_tool *simtype_ignore;   /* Non-simulated type */
-log_tool *simtype_common;   /* Common-pin type */
+log_tool *simtype_ignore;   ///< Non-simulated type
+log_tool *simtype_common;   ///< Common-pin type
 
-double status_oldtime, status_oldtstep;
+double status_oldtime;
+double status_oldtstep;
 long status_oldmem;
 
-short rabstate;   /* Rabbit recognizer state */
+short rabstate;   ///< Rabbit recognizer state
 
-long helpptr;   /* Help descriptor */
+long helpptr;   ///< Help descriptor
 
-int popup_grid;   /* Pop-up menus */
+int popup_grid;   ///< Pop-up menus
 logmenurec *popupmenus[4];
 
-filerecfilerec *libf1[maxgatesfiles];   /* Library files */
-short libfstart[maxgatesfiles];
-/* First descriptor record in LIBF1 */
-short libptr;   /* Most recently replaced catalog item */
-short idxsize;   /* Number of gates in library */
+filerecfilerec *libf1[maxgatesfiles];   ///< Library files
+short libfstart[maxgatesfiles]; ///< First descriptor record in LIBF1
+short libptr;   ///< Most recently replaced catalog item
+short idxsize;   ///< Number of gates in library
 char *librgroupnames[9];
 
-short refrtimer, refrtimer0;   /* Time until screen is refreshed */
+short refrtimer;    ///< Time until screen is refreshed
+short refrtimer0;   ///< Time until screen is refreshed
 
 long tabletaddr;
 
-char *dumpfname, *tracefname;
-FILE *dumpfile, *tracefile;
+char *dumpfname;
+char *tracefname;
+FILE *dumpfile;
+FILE *tracefile;
 
-char pushedbackkey, realkey;
+char pushedbackkey;
+char realkey;
 
-long EXCP_LINE;   /* Line number of last error */
+long EXCP_LINE;   ///< Line number of last error
 long excpline;
 
 short conflictdelay;
 
-int eightcolors;   /* Has only 8 colors */
-int onescreen;   /* Has only one screen */
-int doingcnffunction;   /* This is an ACT_CNF, not an ACT_FUNC */
-int justonecommand;   /* LOG -R mode, so exit after first cmd */
-int displaynews;   /* LOGNEWS has not yet been displayed */
-int immedscroll;   /* Don't need to defer 'REFR' function */
-int tempverbose;   /* Verbose mode temporarily on */
-int commandfound;   /* Function name was acknowledged */
-int cursorhide;   /* Cursor is hidden */
-int reportnowait;   /* Don't wait for key on bug reports */
-int firsttraining;   /* Training used for first time */
-int training;   /* Training mode for Help command */
-int snapflag;   /* Snap-to-grid cursor */
-int showsolder;   /* Display solder points */
-int briefprobe;   /* Temporary probe mode */
-int conflictenbl;   /* Conflict checking enabled */
-int conflictstop;   /* Conflict stopping mode */
-int anyconflicts;   /* Any active, reported conflicts? */
-int steppingoff;   /* Single-step is turning simulation off */
-int suppressdots;   /* Temporarily suppressing red dots */
-int glowsolder;   /* Display solder dots in Glow mode */
-int vlsi;   /* Current page is VLSI mode */
+int eightcolors;   ///< Has only 8 colors
+int onescreen;   ///< Has only one screen
+int doingcnffunction;   ///< This is an ACT_CNF, not an ACT_FUNC
+int justonecommand;   ///< LOG -R mode, so exit after first cmd
+int displaynews;   ///< LOGNEWS has not yet been displayed
+int immedscroll;   ///< Don't need to defer 'REFR' function
+int tempverbose;   ///< Verbose mode temporarily on
+int commandfound;   ///< Function name was acknowledged
+int cursorhide;   ///< Cursor is hidden
+int reportnowait;   ///< Don't wait for key on bug reports
+int firsttraining;   ///< Training used for first time
+int training;   ///< Training mode for Help command
+int snapflag;   ///< Snap-to-grid cursor
+int showsolder;   ///< Display solder points
+int briefprobe;   ///< Temporary probe mode
+int conflictenbl;   ///< Conflict checking enabled
+int conflictstop;   ///< Conflict stopping mode
+int anyconflicts;   ///< Any active, reported conflicts?
+int steppingoff;   ///< Single-step is turning simulation off
+int suppressdots;   ///< Temporarily suppressing red dots
+int glowsolder;   ///< Display solder dots in Glow mode
+int vlsi;   ///< Current page is VLSI mode
 
 
 void m_saveclip ();
@@ -357,15 +363,9 @@ static char *ioresult_message(char *Result, long iores)
 	return strcpy(Result, s);
 }
 
-/*===================  REPORT  ===================*/
-/*=                                              =*/
-/*=  Report an internal error.                   =*/
-/*=                                              =*/
-/*================================================*/
-
 void message (char *msg);
 
-
+/// Report an internal error.
 void report(int num, char *s)
 {
 	char ch;
@@ -391,13 +391,7 @@ void report(int num, char *s)
 }
 
 
-/*==================  SETMODE  ===================*/
-/*=                                              =*/
-/*=  Draw a word in the "mode" location of       =*/
-/*=     the menu area.                           =*/
-/*=                                              =*/
-/*================================================*/
-
+/// Draw a word in the "mode" location of the menu area.
 void log_setmode(const char *s)
 {
 	time_t h;
@@ -551,15 +545,6 @@ static void getbool(char *buf, int *b)
 		*b = !*b;
 }
 
-
-/*=================  TESTPROBE  ==================*/
-/*=                                              =*/
-/*=  Find which wire, pin, or gate the Probe     =*/
-/*=     is touching and set PROBENODE or         =*/
-/*=     PROBEGATE to its address.                =*/
-/*=                                              =*/
-/*================================================*/
-
 static void unprobe()
 {
 	gg.probenode = NULL;
@@ -588,7 +573,9 @@ static log_krec *peninkind(short xx, short yy)
 	return Result;
 }
 
-
+/** @brief Find which wire, pin, or gate the Probe is touching
+			and set PROBENODE or PROBEGATE to its address.
+*/
 static void testprobe(short xx, short yy)
 {
 	log_grec *g;
@@ -848,58 +835,50 @@ void resetmessages()
 	}
 }
 
-
-/*====================  PEN  =====================*/
-/*=                                              =*/
-/*=  Find the position of the pen.  Returns:     =*/
-/*=     D, D0 if the pen is/was down;            =*/
-/*=     N, N0 if the pen is/was near;            =*/
-/*=     DN, UP if the pen is pressed/released;   =*/
-/*=     NR if pen remains near;                  =*/
-/*=     OFFSCREEN if pen is off the screen edge; =*/
-/*=     PX, PY, PX0, PY0 = new/old position;     =*/
-/*=     FX, FY = position in grid coordinates;   =*/
-/*=     MENUBOX = menu box number (0-15);        =*/
-/*=                                              =*/
-/*=  Also draws the cursor, runs logic probe,    =*/
-/*=     and handles Rabbit mode.                 =*/
-/*=                                              =*/
-/*================================================*/
-
+/** @brief Debug function to show current number of events received
+			and current simulation time.
+*/
 static void show_events()
 {
 	/*zEMBED
-	  char buf[30];
-	  int m_events_received;
-	  static int old_events, old_serial, old_time;
-	  int serial, time = timers_sysclock() / 200;
-	  sprintf(buf, "%d", m_events_received);
-	  m_color(log_red);
-	  if (m_events_received > old_events)
-	  drawstr2(5, 20, buf);
-	  old_events = m_events_received;
-	  sprintf(buf, "%d", serial = XNextRequest(m_display));
-	  if (serial > old_serial && time != old_time)
-	  drawstr2(5, 29, buf),
-	  old_serial = serial + 2,
-	  old_time = time;
-	  */
-}
-
-
-/*==================  POLLKBD2  ==================*/
-/*=                                              =*/
-/*=  Return TRUE if a key has been pressed       =*/
-/*=     (via keyboard or menu boxes).            =*/
-/*=                                              =*/
-/*================================================*/
-
+		char buf[30];
+		int m_events_received;
+		static int old_events, old_serial, old_time;
+		int serial, time = timers_sysclock() / 200;
+		sprintf(buf, "%d", m_events_received);
+		m_color(log_red);
+		if (m_events_received > old_events)
+		drawstr2(5, 20, buf);
+		old_events = m_events_received;
+		sprintf(buf, "%d", serial = XNextRequest(m_display));
+		if (serial > old_serial && time != old_time)
+		drawstr2(5, 29, buf),
+		old_serial = serial + 2,
+		old_time = time;
+	*/
+}
+
+
+/// Return TRUE if a key has been pressed (via keyboard or menu boxes).
 static int pollkbd2()
 {
 	return (nk_keybufsize() != 0 || pushedbackkey != '\0');
 }
 
 
+/** @brief Find the position of the pen.
+			Also draws the cursor, runs logic probe and handles Rabbit mode.
+
+	Returns:
+		- D, D0 if the pen is/was down;
+		- N, N0 if the pen is/was near;
+		- DN, UP if the pen is pressed/released;
+		- NR if pen remains near;
+		- OFFSCREEN if pen is off the screen edge;
+		- PX, PY, PX0, PY0 = new/old position;
+		- FX, FY = position in grid coordinates;
+		- MENUBOX = menu box number (0-15);
+*/
 void pen()
 {
 
@@ -1070,13 +1049,7 @@ void pen()
 }
 
 
-/*=================  JUSTTAP  ====================*/
-/*=                                              =*/
-/*=  Return TRUE if pen was tapped.  Return      =*/
-/*=     FALSE if pen was held and/or moved.      =*/
-/*=                                              =*/
-/*================================================*/
-
+///  Return TRUE if pen was tapped. Return FALSE if pen was held and/or moved.
 static int justtap()
 {
 	long t0;
@@ -1093,13 +1066,7 @@ static int justtap()
 	return (!gg.t.depressed);
 }
 
-
-/*==================  TESTKEY2  ==================*/
-/*=                                              =*/
-/*=  Return the most recently pressed key.       =*/
-/*=                                              =*/
-/*================================================*/
-
+/// Return the most recently pressed key.
 static char testkey2()
 {
 	if (pushedbackkey != '\0')
@@ -1111,13 +1078,7 @@ static char testkey2()
 }
 
 
-/*==================  INKEY2  ====================*/
-/*=                                              =*/
-/*=  Return a keystroke.  Key is removed from    =*/
-/*=     the buffer.                              =*/
-/*=                                              =*/
-/*================================================*/
-
+/// Return a keystroke. Key is removed from the buffer.
 static char inkey2()
 {
 	char ch;
@@ -1177,13 +1138,7 @@ static void ungetkey2(char ch)
 	pushedbackkey = ch;
 }
 
-
-/*===============  WAITFORKEY  ===================*/
-/*=                                              =*/
-/*=  Wait until a key is pressed (but ignore it) =*/
-/*=                                              =*/
-/*================================================*/
-
+/// Wait until a key is pressed (but ignore it).
 static void waitforkey()
 {
 	char ch;
@@ -1199,13 +1154,7 @@ static void waitforkey()
 }
 
 
-/*===================  INBOX  ====================*/
-/*=                                              =*/
-/*=  Return TRUE if cursor is inside a certain   =*/
-/*=     rectangular area (screen coordinates).   =*/
-/*=                                              =*/
-/*================================================*/
-
+/// Return TRUE if cursor is inside a certain rectangular area (screen coordinates).
 static int inbox(short x, short y, short x1, short y1)
 {
 	return (gg.t.x >= x && gg.t.y >= y && gg.t.x <= x + x1 && gg.t.y <= y + y1);
@@ -1388,12 +1337,7 @@ static void closedumpfiles()
 }
 
 
-/*=================  BEGINERROR  =================*/
-/*=                                              =*/
-/*=  Clear the menu area for an error message.   =*/
-/*=                                              =*/
-/*================================================*/
-
+/// Clear the menu area for an error message.
 void beginerror()
 {
 	beginbottom();
@@ -1401,12 +1345,7 @@ void beginerror()
 }
 
 
-/*==================  ENDERROR  ==================*/
-/*=                                              =*/
-/*=  Clean up after displaying an error message. =*/
-/*=                                              =*/
-/*================================================*/
-
+/// Clean up after displaying an error message.
 void enderror()
 {
 	printf("  Press any key to continue.");
@@ -1516,17 +1455,9 @@ static void getnodeval(log_nrec *n, double *val, char *opts)
 	*val = gg.actval;
 }
 
-
-/*===================  PASS  =====================*/
-/*=                                              =*/
-/*=  Make one simulation pass through the        =*/
-/*=     circuit.                                 =*/
-/*=                                              =*/
-/*=  For each page, call the simulator(s) and    =*/
-/*=     do other simulation-related chores.      =*/
-/*=                                              =*/
-/*================================================*/
-
+/** @brief Make one simulation pass through the circuit.
+			For each page, call the simulator(s) and do other simulation-related chores.
+*/
 void pass()
 {
 	log_grec *g, *g1, *g2;
@@ -2125,13 +2056,7 @@ void copyattrs(log_gattrrec **gattr, log_gattrrec *oldattr, short numattrs, log_
 	}
 }
 
-
-/*===================  NEWBOX  ===================*/
-/*=                                              =*/
-/*=  Create a Box.                               =*/
-/*=                                              =*/
-/*================================================*/
-
+/// Link box to the current page.
 static void linkbox(log_brec *b)
 {
 	b->next = gg.pages[gg.curpage - 1]->bbase;
@@ -2139,6 +2064,7 @@ static void linkbox(log_brec *b)
 	stamp(&gg.boxstamp);
 }
 
+/// Creates a Box
 void newbox(log_brec **b)
 {
 	*b = (log_brec *)Malloc(sizeof(log_brec));
@@ -2146,12 +2072,7 @@ void newbox(log_brec **b)
 	linkbox(*b);
 }
 
-/*=================  DISPBOX  ====================*/
-/*=                                              =*/
-/*=  Dispose of a dashed box.                    =*/
-/*=                                              =*/
-/*================================================*/
-
+/// Unlink box from the pages.
 static void unlinkbox(log_brec *b)
 {
 	log_brec *b1;
@@ -2167,7 +2088,7 @@ static void unlinkbox(log_brec *b)
 	stamp(&gg.boxstamp);
 }
 
-
+/// Dispose of a dashed box.
 static void dispbox(log_brec **b)
 {
 	unlinkbox(*b);
@@ -2347,13 +2268,7 @@ static void purgesignaltab()
 }
 
 
-/*=================  GARBAGECOLL  ================*/
-/*=                                              =*/
-/*=  Check each node and get rid of ones that    =*/
-/*=  are no longer used.                         =*/
-/*=                                              =*/
-/*================================================*/
-
+/// Check each node and get rid of ones that are no longer used.
 void garbagecoll()
 {
 	log_nrec *node;
@@ -2415,15 +2330,12 @@ void garbagecoll()
 }
 
 
-/*=================  GETTOFROM  ==================*/
-/*=                                              =*/
-/*=  Find the number associated with a signal    =*/
-/*=     name.  If it doesn't exist, create it.   =*/
-/*=     If not enough room, issue an error and   =*/
-/*=     return zero.                             =*/
-/*=                                              =*/
-/*================================================*/
+/** @brief Find the number associated with a signal name.
 
+	If it doesn't exist, create it.
+	If not enough room, issue an error and
+	return zero.
+*/
 short getsignal(int d, char *n_)
 {
 	char n[256];
@@ -2492,12 +2404,7 @@ static void getsigname(char *name, log_sigrec **sig)
 }
 
 
-/*==================  SETSCALE  ==================*/
-/*=                                              =*/
-/*=  Set the scaling (zoom) factor.              =*/
-/*=                                              =*/
-/*================================================*/
-
+/// Set the scaling (zoom) factor.
 void setscale(short s)
 {
 	zoom = s;
@@ -2542,14 +2449,7 @@ static void setupregion(log_regrec **r, short pagenum)
 	gg.pages[pagenum - 1]->pageregions = *r;
 }
 
-
-/*=================  COLORNAME  ==================*/
-/*=                                              =*/
-/*=  Return a string containing the name of      =*/
-/*=     VLSI wire color C.                       =*/
-/*=                                              =*/
-/*================================================*/
-
+/// Return a string containing the name of VLSI wire color C.
 char *colorname(char *Result, short c)
 {
 	if (c == log_wcol_normal)
@@ -2568,13 +2468,7 @@ char *colorname(char *Result, short c)
 	}
 }
 
-
-/*===================  GETHELP  ==================*/
-/*=                                              =*/
-/*=  Display program Help information.           =*/
-/*=                                              =*/
-/*================================================*/
-
+/// Display program Help information.
 static void gethelp(char *s)
 {
 	char cmdline[256];
@@ -2595,14 +2489,7 @@ static void gethelp(char *s)
 	system(cmdline);
 }
 
-
-/*==================  READLNPASS  ================*/
-/*=                                              =*/
-/*=  Simulate READLN, but keep the circuit       =*/
-/*=     running by calling PASS.                 =*/
-/*=                                              =*/
-/*================================================*/
-
+/// Simulate READLN, but keep the circuit running by calling PASS.
 static void readlnpass(char *s, short mode)
 {
 	uchar ch;
@@ -3138,12 +3025,7 @@ static void assertfunc(char *name_)
 }
 
 
-/*===================  TRYKBD  ===================*/
-/*=                                              =*/
-/*=  Check the keyboard for macros.              =*/
-/*=                                              =*/
-/*================================================*/
-
+/// Check the keyboard for macros.
 void trykbd()
 {
 	long t;
@@ -3423,12 +3305,6 @@ void dispblobs(blobrec **blbase)
 }
 
 
-/*=================  CLEARBUF  ===================*/
-/*=                                              =*/
-/*=  Clear a copy buffer.                        =*/
-/*=                                              =*/
-/*================================================*/
-
 static void initbuf(baseptrs *bases)
 {
 	bases->gcopy = NULL;
@@ -3441,7 +3317,7 @@ static void initbuf(baseptrs *bases)
 	bases->valid = false;
 }
 
-
+/// Clear a copy buffer.
 static void clearbuf(baseptrs *bases)
 {
 	log_grec *g;
@@ -3524,14 +3400,9 @@ static int bufissmall(baseptrs *bases)
 }
 
 
-/*==================  CUTCOPY  ===================*/
-/*=                                              =*/
-/*=  Cut or Copy all gates/wires/solder points   =*/
-/*=     in a rectangular area.  Previous         =*/
-/*=     contents of Copy buffer are lost.        =*/
-/*=                                              =*/
-/*================================================*/
-
+/** @brief Cut or Copy all gates/wires/solder points in a rectangular area.
+			Previous contents of Copy buffer are lost.
+*/
 static void cutcopy(baseptrs *bases, short x1, short y1, short x2, short y2, int cut, int tap)
 {
 	log_grec *g, *g1, *g2;
@@ -3860,14 +3731,7 @@ static int getrectangle(short *x1, short *y1, short *x2, short *y2, int first)
 			timers_sysclock() - time < tapdelay);
 }
 
-
-/*==================  DELOBJECT  =================*/
-/*=                                              =*/
-/*=  Delete the object touched, or all objects   =*/
-/*=     in a specific area.                      =*/
-/*=                                              =*/
-/*================================================*/
-
+/// Delete the object touched, or all objects in a specific area.
 static void delcommand()
 {
 	short x1, y1, x2, y2;
@@ -3894,13 +3758,6 @@ static void deleverything()
 }
 
 
-/*================  CHANGEKIND  ==================*/
-/*=                                              =*/
-/*=  Drop a new gate type into one of the slots  =*/
-/*=     in the menu area.                        =*/
-/*=                                              =*/
-/*================================================*/
-
 static void changekind2(short i, short gtype, short sig, log_gattrrec *attrs)
 {
 	log_krec *k;
@@ -3923,7 +3780,7 @@ static void changekind2(short i, short gtype, short sig, log_gattrrec *attrs)
 	kdrawgatec(i, gg.color.kindgate);
 }
 
-
+/// Drop a new gate type into one of the slots in the menu area.
 void changekind(short gtype, short sig, log_gattrrec *attrs)
 {
 	short i;
@@ -4070,13 +3927,7 @@ static int abortit(struct LOC_xorcopybuf *LINK)
 	}
 }
 
-
-/*=================  XORCOPYBUF  =================*/
-/*=                                              =*/
-/*=  XOR a picture of gates to be pasted.        =*/
-/*=                                              =*/
-/*================================================*/
-
+/// XOR a picture of gates to be pasted.
 static void xorcopybuf(baseptrs *bases, short x, short y, long *count_)
 {
 	struct LOC_xorcopybuf V;
@@ -4141,13 +3992,7 @@ static void xorcopybuf(baseptrs *bases, short x, short y, long *count_)
 }
 
 
-
-/*==================  PASTEBUF  ==================*/
-/*=                                              =*/
-/*=  Paste a group of objects into the page.     =*/
-/*=                                              =*/
-/*================================================*/
-
+/// Paste a group of objects into the page.
 static void pastebuf(baseptrs *bases, short x, short y)
 {
 	log_grec *g, *g1;
@@ -4271,17 +4116,12 @@ static void xororiginal()
 	clipoff();
 }
 
+/** @brief Enter Paste mode.
 
-/*=================  PASTEOBJECT  ================*/
-/*=                                              =*/
-/*=  Enter Paste mode.  When cursor is pressed,  =*/
-/*=     add a copy of all gates/wires in Copy    =*/
-/*=     buffer at the pen position.              =*/
-/*=  If the pen is held still, XOR a picture of  =*/
-/*=     what would be added if pen is pressed.   =*/
-/*=                                              =*/
-/*================================================*/
+	When cursor is pressed,a dd a copy of all gates/wires in Copy buffer at the pen position.
 
+	If the pen is held still, XOR a picture of what would be added if pen is pressed.
+*/
 static void pastecommand(long movemode)
 {
 	short thepage;
@@ -4419,12 +4259,7 @@ static void extract()
 	clearfunc();
 }
 
-/*=================  COPYCOMMAND  ================*/
-/*=                                              =*/
-/*=  Enter Copy mode.                            =*/
-/*=                                              =*/
-/*================================================*/
-
+/// Enter Copy mode.
 static void copycommand()
 {
 	short x1, y1, x2, y2;
@@ -4443,15 +4278,10 @@ static void copycommand()
 	} while (true);
 }
 
+/** @brief Enter Move mode.
 
-/*=================  MOVECOMMAND  ================*/
-/*=                                              =*/
-/*=  Enter Move mode.  Sweep out an area, then   =*/
-/*=     move all objects in that area to a new   =*/
-/*=     position.                                =*/
-/*=                                              =*/
-/*================================================*/
-
+	Sweep out an area, then move all objects in that area to a new position.
+*/
 static void movecommand(int waitflag)
 {
 	short x1, y1, x2, y2;
@@ -4482,13 +4312,7 @@ static int near_(short x, short y)
 	return (abs(x - y) < 2);
 }
 
-
-/*================  MOVEOBJECT  ==================*/
-/*=                                              =*/
-/*=  Move a gate, wire, label, or dashed box.    =*/
-/*=                                              =*/
-/*================================================*/
-
+/// Move a gate, wire, label, or dashed box.
 static void moveobject()
 {
 	short gtype, x1, y1, yy, hx1, hx2, hy, vx, vy1, vy2, hc, vc, oldpg, newpg,
@@ -5061,13 +4885,10 @@ static void xorrect(short x1, short y1, short x2, short y2)
 	m_colormode((long)m_normal);
 }
 
-
-/*==================  OPENHORIZ  =================*/
-/*=                                              =*/
-/*=  Open space horizontally.                    =*/
-/*=                                              =*/
-/*================================================*/
-
+/// Open space horizontally.
+/**
+	This means "put everything aside horizontally."
+*/
 static void openhoriz()
 {
 	log_grec *g;
@@ -5232,13 +5053,10 @@ static void xorrect_(short x1, short y1, short x2, short y2)
 	m_colormode((long)m_normal);
 }
 
-
-/*==================  OPENVERT  ==================*/
-/*=                                              =*/
-/*=  Open space vertically.                      =*/
-/*=                                              =*/
-/*================================================*/
-
+/// Open space vertically.
+/**
+	This means "put everything aside vertically."
+*/
 static void openvert()
 {
 	log_grec *g;
@@ -5400,13 +5218,7 @@ static void xorrect__(short x1, short y1, short x2, short y2)
 	m_colormode((long)m_normal);
 }
 
-
-/*==================  CLOSEHORIZ  ================*/
-/*=                                              =*/
-/*=  Close space horizontally.                   =*/
-/*=                                              =*/
-/*================================================*/
-
+/// Close space horizontally.
 static void closehoriz()
 {
 	log_grec *g, *g1;
@@ -5644,13 +5456,7 @@ static void xorrect___(short x1, short y1, short x2, short y2)
 	m_colormode((long)m_normal);
 }
 
-
-/*==================  CLOSEVERT  =================*/
-/*=                                              =*/
-/*=  Close space vertically.                     =*/
-/*=                                              =*/
-/*================================================*/
-
+/// Close space vertically.
 static void closevert()
 {
 	log_grec *g, *g1;
@@ -5945,18 +5751,14 @@ static void centercommand()
 	refrfunc();
 }
 
+/** @brief Compare string S with template string T.
 
-/*================  COMPARESTR  ==================*/
-/*=                                              =*/
-/*=  Compare string S with template string T.    =*/
-/*=  T allows wildcards:                         =*/
-/*=     % matches any character in S.            =*/
-/*=     * matches zero or more characters in S.  =*/
-/*=     ? and = are equivalent to *.             =*/
-/*=     ; precedes group number(s).              =*/
-/*=                                              =*/
-/*================================================*/
-
+	T allows wildcards:
+		- % matches any character in S.
+		- * matches zero or more characters in S.
+		- ? and = are equivalent to *.
+		- ; precedes group number(s).
+*/
 static int comparestr(char *s_, uchar g, char *t_)
 {
 	int Result;
@@ -6120,15 +5922,11 @@ static log_pnumrec readpnum(char *rec)
 }
 
 
-/*==================  READLIBRARY  ===============*/
-/*=                                              =*/
-/*=  Read gate(s) named from library and enter   =*/
-/*=     into the catalog.  If catalog is full,   =*/
-/*=     attempt to replace a gate-kind which is  =*/
-/*=     no longer used.                          =*/
-/*=                                              =*/
-/*================================================*/
+/** @brief Read gate(s) named from library and enter into the catalog.
 
+	If catalog is full, attempt to replace a gate-kind which is
+	no longer used.
+*/
 static short readlibrary_at(char *n_, short where, int loadit)
 {
 	struct LOC_readlibrary_at V;
@@ -6961,15 +6759,6 @@ static void gatedefinitioncommand()
 }
 
 
-/*================  LISTLIBRARY  =================*/
-/*=                                              =*/
-/*=  List the gates available in the library.    =*/
-/*=     + or space bar displays next page;       =*/
-/*=     - displays previous page;                =*/
-/*=     anything else returns to Instructions.   =*/
-/*=                                              =*/
-/*================================================*/
-
 static librstrrec *findlibrstr(char *name_)
 {
 	size_t name_length = strlen(name_);
@@ -7034,7 +6823,12 @@ static short kfunc(short *i, short *j, struct LOC_listlibrary *LINK)
 	}
 }
 
+/** @brief List the gates available in the library.
 
+	- + or space bar displays next page;
+	- - displays previous page;
+	- anything else returns to Instructions.
+*/
 static void listlibrary()
 {
 	struct LOC_listlibrary V;
@@ -7260,13 +7054,7 @@ static void listlibrary()
 #undef huge_
 
 
-/*=================  GATECATALOG  ================*/
-/*=                                              =*/
-/*=  Process CAT menu item.  Display catalog,    =*/
-/*=     call ADDGATE if a gate is touched.       =*/
-/*=                                              =*/
-/*================================================*/
-
+/// Process CAT menu item. Display catalog, call ADDGATE if a gate is touched.
 static void gatecatalog(int librmode)
 {
 	short x, y, x0, y0, x00, y00, w, x1, y1;
@@ -7449,12 +7237,7 @@ static void gatecatalog(int librmode)
 }
 
 
-/*==================  VLSIMODE  ==================*/
-/*=                                              =*/
-/*=  Turn VLSI mode on or off.                   =*/
-/*=                                              =*/
-/*================================================*/
-
+/// Turn VLSI mode on or off.
 void setvlsimode(int flag)
 {
 	if (flag)
@@ -7474,12 +7257,7 @@ void setvlsimode(int flag)
 }
 
 
-/*==================  REALSTR  ===================*/
-/*=                                              =*/
-/*=  Convert a real number to a string.          =*/
-/*=                                              =*/
-/*================================================*/
-
+/// Convert a real number to a string.
 char *realstr(char *Result, double r, short p)
 {
 	long i, j;
@@ -7532,12 +7310,7 @@ char *realstr(char *Result, double r, short p)
 }
 
 
-/*=================  REALUNIT  ===================*/
-/*=                                              =*/
-/*=  Convert a unitted real number to a string.  =*/
-/*=                                              =*/
-/*================================================*/
-
+/// Convert a unitted real number to a string.
 static char *realunit(char *Result, double r, short p, char *u, int mu)
 {
 	char s[81], STR1[81];
@@ -8931,12 +8704,7 @@ static short doflip(short rot, short mode)
 }
 
 
-/*==================  FLIPGATE  ==================*/
-/*=                                              =*/
-/*=  Flip a gate in the circuit.                 =*/
-/*=                                              =*/
-/*================================================*/
-
+/// Flip a gate in the circuit.
 static void flipgate(log_grec *g)
 {
 	short i;
@@ -8986,12 +8754,7 @@ static void flipgate(log_grec *g)
 }
 
 
-/*==================  FLIPKIND  ==================*/
-/*=                                              =*/
-/*=  Flip a gate in menu area.                   =*/
-/*=                                              =*/
-/*================================================*/
-
+/// Flip a gate in menu area.
 static void flipkind()
 {
 	short i, z, k;
@@ -9030,11 +8793,6 @@ static void flipkind()
 	restorecursor();
 }
 
-/*==============  ADJUSTSIGNAL  ==================*/
-/*=                                              =*/
-/*=  Enter a new name for nameable gate.         =*/
-/*=                                              =*/
-/*================================================*/
 
 void settofrom(log_grec **g, char *name)
 {
@@ -9057,7 +8815,7 @@ void settofrom(log_grec **g, char *name)
 	*g = NULL;
 }
 
-
+/// Enter a new name for nameable gate.
 static void adjustsignal(log_grec *g)
 {
 	char n[256];
@@ -9441,12 +9199,7 @@ static void addlabel(log_lrec **l, char *s)
 #define blinkrate       25
 
 
-/*================  EDITLABEL  ===================*/
-/*=                                              =*/
-/*=  Edit or create a label.                     =*/
-/*=                                              =*/
-/*================================================*/
-
+/// Edit or create a label.
 static void editlabel(log_lrec *l)
 {
 	short i, x1, y1;
@@ -9626,12 +9379,7 @@ static void editlabel(log_lrec *l)
 #undef blinkrate
 
 
-/*==================  ADDBOX  ====================*/
-/*=                                              =*/
-/*=  Create a new dashed box.                    =*/
-/*=                                              =*/
-/*================================================*/
-
+/// Create a new dashed box.
 void addboxat(short x1, short y1, short x2, short y2)
 {
 	log_brec *b;
@@ -9803,12 +9551,6 @@ static void dumphistory()
 }
 
 
-/*================  SHOWHISTORY  =================*/
-/*=                                              =*/
-/*=  Enter History (Scope) display mode.         =*/
-/*=                                              =*/
-/*================================================*/
-
 static void reshuffle()
 {
 	log_hnrec *hn;
@@ -10810,7 +10552,7 @@ static void measurecmd(struct LOC_historycommand *LINK)
 	} while (gg.t.depressed);
 }
 
-
+/// Enter History (Scope) display mode.
 static void historycommand()
 {
 	struct LOC_historycommand V;
@@ -11435,14 +11177,7 @@ static void namecommand()
 #define maxdirmax       45
 #define maxdircol       8
 
-
-/*=================  LOADCOMMAND  ================*/
-/*=                                              =*/
-/*=  Load circuit page from disk.  Previous      =*/
-/*=     contents of current page are lost.       =*/
-/*=                                              =*/
-/*================================================*/
-
+/// Load circuit page from disk. Previous contents of current page are lost.
 static void loadcommand()
 {
 	short i, j, x, y, x1, y1, dirmax, dircol;
@@ -12359,14 +12094,11 @@ static void statusdisplay(char *name_)
 #define cols            4
 
 
-/*==================  POPUPMENU  =================*/
-/*=                                              =*/
-/*=  Process a pop-up menu selection.  Menu      =*/
-/*=     items are named in MENU.  Use result to  =*/
-/*=     look up in table S to find a char.       =*/
-/*=                                              =*/
-/*================================================*/
+/** @brief Process a pop-up menu selection.
 
+	Menu items are named in MENU.
+	Use result to look up in table S to find a char.
+*/
 static void popupmenu(short num)
 {
 	short i, j, x, y, xx, x0, y0, x1, y1, x00, y00;
@@ -13924,14 +13656,11 @@ static void readcnf(char *fn_, struct LOC_initialize *LINK)
 	/*obsolete*/
 }
 
-/*==================  INITIALIZE  ================*/
-/*=                                              =*/
-/*=  Initialize all variables.  Read basic gates =*/
-/*=     from library.  Clear Catalog screen.     =*/
-/*=     Initialize data structures.              =*/
-/*=                                              =*/
-/*================================================*/
-
+/** @brief Initialize all variables.
+			Read basic gates from library.
+			Clear catalog screen.
+			Initialize global data structures.
+*/
 static void initialize()
 {
 	struct LOC_initialize V;
@@ -14550,16 +14279,11 @@ static void shownews()
 }
 
 
-/*================  MAIN PROGRAM  ================*/
-/*=                                              =*/
-/*=  Initialize.                                 =*/
-/*=  Process pen:                                =*/
-/*=     Add gates.  Add wires.  Solder wires.    =*/
-/*=  Refresh screen when necessary.              =*/
-/*=  Process keyboard/menu areas.                =*/
-/*=                                              =*/
-/*================================================*/
-
+/** @brief Initialize.
+			Then Process pen: Add gates. Add wires and solder them.
+			Refresh screen when necessary.
+			Process keyboard and menu areas.
+*/
 int main(int argc, char * argv[])
 {
 	char str1[81];
@@ -14964,4 +14688,3 @@ int main(int argc, char * argv[])
 }
 
 
-/* End. */
diff --git a/src/logcom.c b/src/logcom.c
index 50bfa21..efd694b 100644
--- a/src/logcom.c
+++ b/src/logcom.c
@@ -826,4 +826,4 @@ log_action_t *act;
 }
 
 
-/* End. */
+
diff --git a/src/logdef.c b/src/logdef.c
index b2733c1..34694bc 100644
--- a/src/logdef.c
+++ b/src/logdef.c
@@ -74,4 +74,4 @@ const log_zoomtab zoomscales = {
   2, 3, 5, 8, 12
 };
 
-/* End. */
+
diff --git a/src/logdig.c b/src/logdig.c
index aef4132..ef5a930 100644
--- a/src/logdig.c
+++ b/src/logdig.c
@@ -69,4 +69,4 @@ const log_16_bvarr log_16_bv = {
 
 
 
-/* End. */
+
diff --git a/src/loged.c b/src/loged.c
index d673e6d..320c96c 100644
--- a/src/loged.c
+++ b/src/loged.c
@@ -6908,4 +6908,4 @@ int main(int argc, char * argv[])
   exit(0);
 }
 
-/* End. */
+
diff --git a/src/loghier.c b/src/loghier.c
index 1553717..d1d398d 100644
--- a/src/loghier.c
+++ b/src/loghier.c
@@ -606,4 +606,4 @@ log_action_t *act;
 
 
 
-/* End. */
+
diff --git a/src/logntk.c b/src/logntk.c
index db7b695..b54777b 100644
--- a/src/logntk.c
+++ b/src/logntk.c
@@ -1742,4 +1742,4 @@ log_action_t *act_;
 }
 
 
-/* End. */
+
diff --git a/src/logsim.c b/src/logsim.c
index a16bc26..65f689d 100644
--- a/src/logsim.c
+++ b/src/logsim.c
@@ -1964,4 +1964,4 @@ void Log_16_proc(log_action_t *lact)
 }
 
 
-/* End. */
+
diff --git a/src/logsimed.c b/src/logsimed.c
index bdbedd4..307dcea 100644
--- a/src/logsimed.c
+++ b/src/logsimed.c
@@ -1867,4 +1867,4 @@ strlist_t *sl;
 
 
 
-/* End. */
+
diff --git a/src/logsimh.c b/src/logsimh.c
index 3dd1b61..2da6725 100644
--- a/src/logsimh.c
+++ b/src/logsimh.c
@@ -5685,4 +5685,4 @@ void Log_16_digh(log_16_action *act)
 }
 
 
-/* End. */
+
diff --git a/src/logspc.c b/src/logspc.c
index d2571fa..c4c9708 100644
--- a/src/logspc.c
+++ b/src/logspc.c
@@ -1901,7 +1901,7 @@ struct LOC_dologspc *LINK;
   fprintf(LINK->outf, ".ENDS %s\n\n", cellname);
   i = 0;
   l1 = ports;
-/***************************************************/
+
   x_ctr = 1;
   sprintf(STR1, "X%ld", x_ctr);         /* Instance main cell defn. */
   fprintf(LINK->outf, "%s", STR1);
@@ -2438,4 +2438,4 @@ log_action_t *act_;
 }
 
 
-/* End. */
+
diff --git a/src/node.c b/src/node.c
index 38f63e4..5e01e8f 100644
--- a/src/node.c
+++ b/src/node.c
@@ -7,18 +7,12 @@
 #include "log.h"
 #include "tool.h"
 
-/*==================  ADDNODE  ===================*/
-/*=                                              =*/
-/*=  Create a new node.                          =*/
-/*=                                              =*/
-/*================================================*/
-
 void newnptr(log_nrec **node)
 {
 	*node = (log_nrec *)Malloc(sizeof(log_nrec));
 }
 
-
+/// Create a new node.
 void newnode(log_nrec **node, uchar st)
 {
 	newnptr(node);
@@ -42,12 +36,7 @@ void newnode(log_nrec **node, uchar st)
 		fprintf(tracefile, "Make node %p\n", *node);
 }
 
-/*==================  COPYNODE  ==================*/
-/*=                                              =*/
-/*=  Create a new node, copied from another.     =*/
-/*=                                              =*/
-/*================================================*/
-
+/// Create a new node, copied from another.
 void copynode(log_nrec *old, log_nrec **node)
 {
 	newnptr(node);
@@ -69,12 +58,7 @@ void copynode(log_nrec *old, log_nrec **node)
 }
 
 
-/*===================  DISPNODE  =================*/
-/*=                                              =*/
-/*=  Dispose of a node.                          =*/
-/*=                                              =*/
-/*================================================*/
-
+/// Dispose of a node.
 void disposenptr(log_nrec **node)
 {
 	free(*node);
@@ -195,13 +179,9 @@ void switchnode(log_nrec **node, log_nrec *n2)
 	}
 }
 
-/*=================  DUMPNODES  ==================*/
-/*=                                              =*/
-/*=  Print a detailed dissection of the major    =*/
-/*=     data structures.  For debugging only.    =*/
-/*=                                              =*/
-/*================================================*/
-
+/** @brief Print a detailed dissection of the major data structures.
+			For debugging only.
+*/
 void dumpnodes()
 {
 	log_nrec *n, *n1;
@@ -372,13 +352,7 @@ void delgetnode(log_nrec **save, log_nrec **old, log_nrec **node)
 #define rtn             "COMBINENODES"
 
 
-/*================  COMBINENODES  ================*/
-/*=                                              =*/
-/*=  Combine node N1 into N2.  Adjust all        =*/
-/*=     references accordingly.                  =*/
-/*=                                              =*/
-/*================================================*/
-
+/// Combine node N1 into N2. Adjust all references accordingly.
 void combinenodes(log_nrec **n2, log_nrec **n1, cnrec *cnbase)
 {
 	log_nrec *nn1, *nn2, *n3;
diff --git a/src/page.c b/src/page.c
index d499857..3a29f82 100644
--- a/src/page.c
+++ b/src/page.c
@@ -71,12 +71,7 @@ int anychanged()
 	return (i <= gg.numpages);
 }
 
-/*==================  NEWPAGE  ===================*/
-/*=                                              =*/
-/*=  Switch to a new page.                       =*/
-/*=                                              =*/
-/*================================================*/
-
+/// Switch to a new page.
 void newpage(short pg)
 {
 	short i;
diff --git a/src/screen.c b/src/screen.c
index 81102a9..a008c86 100644
--- a/src/screen.c
+++ b/src/screen.c
@@ -39,14 +39,7 @@
 #include "screen.h"
 #include "node.h"
 
-static rablistrec rabtable[rabtabsize];   /* Positions of rabbits */
-
-/*=================  INITSCREEN  =================*/
-/*=                                              =*/
-/*=  Initialize color graphics, graphics tablet, =*/
-/*=     low-level flags & variables              =*/
-/*=                                              =*/
-/*================================================*/
+static rablistrec rabtable[rabtabsize];   ///< Positions of rabbits
 
 void initcolormap()
 {
@@ -82,7 +75,7 @@ void fixcolormap()
 }
 
 
-
+/// Initialize color graphics, graphics tablet, low-level flags & variables.
 void initscreen()
 {
 	m_init_screen();
@@ -124,12 +117,7 @@ void initscreen2()
 	m_graphics_on();
 }
 
-/*==================  NOBLINK  ===================*/
-/*=                                              =*/
-/*=  Turn off the stupid blinking Alpha cursor.  =*/
-/*=                                              =*/
-/*================================================*/
-
+/// Turn off the stupid *blinking* Alpha cursor.
 void noblink()
 {
 	nc_cursXY(-1, -1);
@@ -161,12 +149,7 @@ void showalpha()
 	m_alpha_on();
 }
 
-/*===================  LINE  =====================*/
-/*=                                              =*/
-/*=  Draw a line in grid coordinates.            =*/
-/*=                                              =*/
-/*================================================*/
-
+/// Draw a line in grid coordinates.
 void line(short x1, short y1, short x2, short y2)
 {
 	m_drawline(x1 * gg.scale - gg.xoff, y1 * gg.scale - gg.yoff,
@@ -174,13 +157,7 @@ void line(short x1, short y1, short x2, short y2)
 }
 
 
-/*===================  HLINE  ====================*/
-/*=                                              =*/
-/*=  Draw a horizontal line in grid coordinates. =*/
-/*=                                              =*/
-/*=                                              =*/
-/*================================================*/
-
+/// Draw a horizontal line in grid coordinates.
 void hline(short x1, short x2, short y)
 {
 	short yy;
@@ -190,13 +167,7 @@ void hline(short x1, short x2, short y)
 }
 
 
-/*===================  VLINE  ====================*/
-/*=                                              =*/
-/*=  Draw a vertical line in grid coordinates.   =*/
-/*=                                              =*/
-/*=                                              =*/
-/*================================================*/
-
+/// Draw a vertical line in grid coordinates.
 void vline(short x, short y1, short y2)
 {
 	short xx;
@@ -207,48 +178,28 @@ void vline(short x, short y1, short y2)
 }
 
 
-/*===================  POINT  ====================*/
-/*=                                              =*/
-/*=  Draw a point in grid coordinates.           =*/
-/*=                                              =*/
-/*================================================*/
-
+/// Draw a point in grid coordinates.
 void point(short x, short y)
 {
 	m_drawpoint(x * gg.scale - gg.xoff, y * gg.scale - gg.yoff);
 }
 
 
-/*===================  RECT  =====================*/
-/*=                                              =*/
-/*=  Draw a rectangle in grid coordinates.       =*/
-/*=                                              =*/
-/*================================================*/
-
+/// Draw a rectangle in grid coordinates.
 void rect(short x1, short y1, short x2, short y2)
 {
 	m_drawrect(x1 * gg.scale - gg.xoff, y1 * gg.scale - gg.yoff,
 			x2 * gg.scale - gg.xoff, y2 * gg.scale - gg.yoff);
 }
 
-/*====================  BOX  =====================*/
-/*=                                              =*/
-/*=  Draw a filled rectangle in grid coords.     =*/
-/*=                                              =*/
-/*================================================*/
-
+/// Draw a filled rectangle in grid coords.
 void box(short x1, short y1, short x2, short y2)
 {
 	m_fillrect(x1 * gg.scale - gg.xoff, y1 * gg.scale - gg.yoff,
 			x2 * gg.scale - gg.xoff, y2 * gg.scale - gg.yoff);
 }
 
-/*=================  DRAWSTR2  ===================*/
-/*=                                              =*/
-/*=  Draw a text string.                         =*/
-/*=                                              =*/
-/*================================================*/
-
+/// Draw a text string.
 void drawstr2(int x, int y, char *s)
 {
 	long save;
@@ -297,13 +248,7 @@ void centerstr2(int x, int y, char *s)
 }
 
 
-/*=================  DRAWNUM1  ===================*/
-/*=                                              =*/
-/*=  Draw a single digit at the specified        =*/
-/*=     position (screen coordinates).           =*/
-/*=                                              =*/
-/*================================================*/
-
+/// Draw a single digit at the specified position (screen coordinates).
 void drawnum1(short x, short y, short n)
 {
 	char s[2];
@@ -315,13 +260,7 @@ void drawnum1(short x, short y, short n)
 }
 
 
-/*=================  DRAWNUM2  ===================*/
-/*=                                              =*/
-/*=  Draw a two-digit number at the specified    =*/
-/*=     position (screen coordinates).           =*/
-/*=                                              =*/
-/*================================================*/
-
+/// Draw a two-digit number at the specified position (screen coordinates).
 void drawnum2(short x, short y, short n)
 {
 	char s[3];
@@ -370,36 +309,20 @@ void plainxformcoords(log_grec *g, short *x, short *y)
 }
 
 
-/*==================  CLIPON  ====================*/
-/*=                                              =*/
-/*=  Allow drawing only in the working area.     =*/
-/*=                                              =*/
-/*================================================*/
-
+/// Allow drawing only in the working area.
 void clipon()
 {
 	m_clip(0L, 0L, (long)across, baseline - 1L);
 }
 
 
-/*==================  CLIPOFF  ===================*/
-/*=                                              =*/
-/*=  Allow drawing in working area and menus.    =*/
-/*=                                              =*/
-/*================================================*/
-
+/// Allow drawing in working area and menus.
 void clipoff()
 {
 	m_noclip();
 }
 
-/*==================  UERASE  ====================*/
-/*=                                              =*/
-/*=  Erase a rectangular area of the screen      =*/
-/*=     using screen coordinates.                =*/
-/*=                                              =*/
-/*================================================*/
-
+/// Erase a rectangular area of the screen using screen coordinates.
 void uerase(short x1, short y1, short x2, short y2)
 {
 	m_color((long)gg.color.backgr);
@@ -407,13 +330,7 @@ void uerase(short x1, short y1, short x2, short y2)
 }
 
 
-/*===================  ERASE  ====================*/
-/*=                                              =*/
-/*=  Erase a rectangular area of the screen      =*/
-/*=     using grid coordinates.                  =*/
-/*=                                              =*/
-/*================================================*/
-
+/// Erase a rectangular area of the screen using grid coordinates.
 void erase(short x1, short y1, short x2, short y2)
 {
 	m_color((long)gg.color.backgr);
@@ -421,13 +338,7 @@ void erase(short x1, short y1, short x2, short y2)
 }
 
 
-/*================  NORABBITS  ===================*/
-/*=                                              =*/
-/*=  Make sure there are no rabbits on the       =*/
-/*=     screen.                                  =*/
-/*=                                              =*/
-/*================================================*/
-
+/// Make sure there are no rabbits on the screen.
 void norabbits()
 {
 	short i;
@@ -445,12 +356,7 @@ void norabbits()
 }
 
 
-/*================  ADDRABBIT  ===================*/
-/*=                                              =*/
-/*=  Draw a rabbit on the screen.                =*/
-/*=                                              =*/
-/*================================================*/
-
+/// Draw a rabbit on the screen.
 void addrabbit()
 {
 	short i, j, rx, ry;
@@ -494,17 +400,12 @@ void addrabbit()
 	rabtime = sysclock();
 }
 
+/** @brief Attempt to force a line to be horizontal
+			or vertical.  If possible, second pair
+			of coordinates is changed appropriately.
 
-/*==================  HVLINE  ====================*/
-/*=                                              =*/
-/*=  Attempt to force a line to be horizontal    =*/
-/*=     or vertical.  If possible, second pair   =*/
-/*=     of coordinates is changed appropriately. =*/
-/*=                                              =*/
-/*=  Returns true if possible, false if not.     =*/
-/*=                                              =*/
-/*================================================*/
-
+	@returns true if possible, false if not.
+*/
 int hvline(short x1, short y1, short *x2, short *y2)
 {
 	int Result;
@@ -525,40 +426,21 @@ int hvline(short x1, short y1, short *x2, short *y2)
 	return Result;
 }
 
-
-/*===================  FIXXY  ====================*/
-/*=                                              =*/
-/*=  Adjust screen coordinates so that they are  =*/
-/*=     aligned to the nearest grid point.       =*/
-/*=                                              =*/
-/*================================================*/
-
+/// Adjust screen coordinates so that they are aligned to the nearest grid point.
 void fixxy(short *x, short *y)
 {
 	*x = (*x + gg.xoff + gg.hscale) / gg.scale * gg.scale - gg.xoff;
 	*y = (*y + gg.yoff + gg.hscale) / gg.scale * gg.scale - gg.yoff;
 }
 
-/*================  NOCROSSHAIR  =================*/
-/*=                                              =*/
-/*=  Turn off crosshair (no effect until next    =*/
-/*=     call of CURSOR).                         =*/
-/*=                                              =*/
-/*================================================*/
-
+/// Turn off crosshair (no effect until next call of CURSOR).
 void nocrosshair()
 {
 	chairflag2 = false;
 }
 
 
-/*=================  CROSSHAIR  ==================*/
-/*=                                              =*/
-/*=  Move the crosshair to a particular position =*/
-/*=     in grid coordinates.                     =*/
-/*=                                              =*/
-/*================================================*/
-
+/// Move the crosshair to a particular position in grid coordinates.
 void crosshair(short x, short y)
 {
 	chairx = x * gg.scale - gg.xoff;
@@ -566,26 +448,22 @@ void crosshair(short x, short y)
 	chairflag2 = true;
 }
 
-/*=================  XORCURSOR  ==================*/
-/*=                                              =*/
-/*=  Draw the cursor on the screen.              =*/
-/*=  The exact shape drawn depends upon the      =*/
-/*=     current mode.                            =*/
-/*=  If the cursor is already on the screen, it  =*/
-/*=     is removed.                              =*/
-/*=                                              =*/
-/*=  Possible cursors:                           =*/
-/*=     Arrow (normal).                          =*/
-/*=     Probe (if Logic Probe mode).             =*/
-/*=     Big crosshair (if "Grid" mode on).       =*/
-/*=     Long arrow (if Copy command).            =*/
-/*=     Scissors (if Delete command).            =*/
-/*=     Rectangle (if Paste command).            =*/
-/*=     Green line (if drawing a wire).          =*/
-/*=     Rabbit (if Rabbit mode).                 =*/
-/*=                                              =*/
-/*================================================*/
-
+/** @brief Draw the cursor on the screen.
+			The exact shape drawn depends upon the
+			current mode.
+			If the cursor is already on the screen, it
+			is removed.
+
+	Possible cursors:
+		- Arrow (normal).
+		- Probe (if Logic Probe mode).
+		- Big crosshair (if "Grid" mode on).
+		- Long arrow (if Copy command).
+		- Scissors (if Delete command).
+		- Rectangle (if Paste command).
+		- Green line (if drawing a wire).
+		- Rabbit (if Rabbit mode).
+*/
 void xorcursor()
 {
 	long curcm;
@@ -690,13 +568,7 @@ void xorcursor()
 }
 
 
-/*=================  HIDECURSOR  =================*/
-/*=                                              =*/
-/*=  Used to remove cursor from screen while     =*/
-/*=     drawing graphics.                        =*/
-/*=                                              =*/
-/*================================================*/
-
+/// Used to remove cursor from screen while drawing graphics.
 void hidecursor()
 {
 	if (cursorflag)
@@ -727,14 +599,7 @@ void hidecursorrect_hook(long x1, long y1, long x2, long y2)
 		hidecursor_hook();
 }
 
-
-/*================  DRAWCURSOR  ==================*/
-/*=                                              =*/
-/*=  Position the cursor to a particular point   =*/
-/*=     (screen coordinates).                    =*/
-/*=                                              =*/
-/*================================================*/
-
+/// Position the cursor to a particular point (screen coordinates).
 void drawcursor(short x, short y)
 {
 	if (x != cursx || y != cursy || !cursorflag || cursortype != oldcursortype)
@@ -766,12 +631,7 @@ void drawcursor(short x, short y)
 	cursorhide = false;
 }
 
-/*=================  REMCURSOR  ==================*/
-/*=                                              =*/
-/*=  Take the cursor off the screen.             =*/
-/*=                                              =*/
-/*================================================*/
-
+/// Take the cursor off the screen.
 void remcursor()
 {
 	prevcursorflag = cursorflag;
@@ -781,14 +641,7 @@ void remcursor()
 	cursorhide = false;
 }
 
-
-/*================  RESTORECURSOR  ===============*/
-/*=                                              =*/
-/*=  Restore the cursor to its previous on/off   =*/
-/*=     status.                                  =*/
-/*=                                              =*/
-/*================================================*/
-
+/// Restore the cursor to its previous on/off status.
 void restorecursor()
 {
 	if (prevcursorflag != cursorflag)
@@ -796,12 +649,7 @@ void restorecursor()
 	cursorflag = prevcursorflag;
 }
 
-/*================  CLEARSCREEN  =================*/
-/*=                                              =*/
-/*=  Clear the screen.                           =*/
-/*=                                              =*/
-/*================================================*/
-
+/// Clear the screen.
 void clearscreen()
 {
 	remcursor();
@@ -827,12 +675,6 @@ void clearshowalpha()
 	showalpha();
 }
 
-/*================  UDRAWGATEC  ==================*/
-/*=                                              =*/
-/*=  Draw a gate of specified color at a         =*/
-/*=     certain position (screen coordinates).   =*/
-/*=                                              =*/
-/*================================================*/
 
 void drawvector2(log_vectorrec *v, long x1, long y1, long x2, long y2)
 {
@@ -1315,7 +1157,7 @@ void plaindrawgatec(short x, short y, short g, short c)
 	hidecursor();
 }
 
-
+/// Draw a gate of specified color at a certain position (screen coordinates).
 void udrawgatec(int x, int y, int g, int c)
 {
 	short i, z, rxx, rxy, ryx, ryy;
@@ -1426,13 +1268,6 @@ void udrawgatec(int x, int y, int g, int c)
 }
 
 
-/*=================  DRAWGATEC  ==================*/
-/*=                                              =*/
-/*=  Draw a gate of specified color at a         =*/
-/*=     certain position (grid coordinates).     =*/
-/*=                                              =*/
-/*================================================*/
-
 void drawgatedotsc(short x, short y, short g, short c)
 {
 	short i, z, rxx, rxy, ryx, ryy;
@@ -1462,7 +1297,7 @@ void drawgatedotsc(short x, short y, short g, short c)
 		point(x + WITH->pin[i].x, y + WITH->pin[i].y);
 }
 
-
+/// Draw a gate of specified color at a certain position (grid coordinates).
 void drawgatec(int x, int y, int g, int c)
 {
 	short i, xx, yy, z, rxx, rxy, ryx, ryy;
@@ -1747,13 +1582,6 @@ void kdrawgatec(short i, short c)
 }
 
 
-/*=================  DRAWGATEX  ==================*/
-/*=                                              =*/
-/*=  Draw a gate.  If it is a TO or FROM gate,   =*/
-/*=     draw its name as well.                   =*/
-/*=                                              =*/
-/*================================================*/
-
 void drawgatexc(log_grec *g, short c)
 {
 	if (g->dimcolor && c == gg.color.gate)
@@ -1765,7 +1593,7 @@ void drawgatexc(log_grec *g, short c)
 		drawpnums(g, gg.color.pinnum);
 }
 
-
+/// Draw a gate.  If it is a TO or FROM gate, draw its name as well.
 void drawgatex(log_grec *g)
 {
 	drawgatexc(g, gg.color.gate);
@@ -1792,13 +1620,7 @@ void setdimgate(log_grec *g, int dim)
 	m_unclip();
 }
 
-/*================  DRAWSOLDERC  =================*/
-/*=                                              =*/
-/*=  Draw a solder point at a certain position   =*/
-/*=     (grid coordinates).                      =*/
-/*=                                              =*/
-/*================================================*/
-
+/// Draw a solder point at a certain position (grid coordinates).
 void drawsolderc(short x, short y, short c)
 {
 	if (!showsolder)
@@ -1828,13 +1650,7 @@ void drawsolderc(short x, short y, short c)
 }
 
 
-/*=================  DRAWTRANSC  =================*/
-/*=                                              =*/
-/*=  Draw a VLSI transistor at a certain         =*/
-/*=     position (grid coordinates).             =*/
-/*=                                              =*/
-/*================================================*/
-
+/// Draw a VLSI transistor at a certain position (grid coordinates).
 void drawtransc(short x, short y, short c)
 {
 	if (!vlsi)
@@ -1848,12 +1664,6 @@ void drawtransc(short x, short y, short c)
 	m_circle((long)x, (long)y, 4L);
 }
 
-/*==================  DRAWBOXC  ==================*/
-/*=                                              =*/
-/*=  Draw a dashed box on the screen.            =*/
-/*=                                              =*/
-/*================================================*/
-
 void drawboxc0(short x1, short y1, short x2, short y2, short c)
 {
 	m_color((long)c);
@@ -1862,19 +1672,14 @@ void drawboxc0(short x1, short y1, short x2, short y2, short c)
 	m_linestyle(0L);
 }
 
-
+/// Draw a dashed box on the screen.
 void drawboxc(log_brec *b, short  c)
 {
 	drawboxc0(b->x1, b->y1, b->x2, b->y2, c);
 }
 
 
-/*================  DRAWMARKERSC  ================*/
-/*=                                              =*/
-/*=  Draw the printing markers on the screen.    =*/
-/*=                                              =*/
-/*================================================*/
-
+/// Draw the printing markers on the screen.
 void drawmarkersc(short c)
 {
 	clipon();
@@ -1887,13 +1692,7 @@ void drawmarkersc(short c)
 }
 
 
-/*=================  DRAWNODEC  ==================*/
-/*=                                              =*/
-/*=  Draw all wires and solder points in a       =*/
-/*=     particular node, in color C.             =*/
-/*=                                              =*/
-/*================================================*/
-
+/// Draw all wires and solder points in a particular node, in color C.
 void drawnodec(log_nrec *n, int c)
 {
 	log_hwrec *hw;
@@ -1966,24 +1765,14 @@ void drawnodec(log_nrec *n, int c)
 }
 
 
-/*=================  DRAWNODE  ===================*/
-/*=                                              =*/
-/*=  Draw all wires and solder points in a       =*/
-/*=     particular node.                         =*/
-/*=                                              =*/
-/*================================================*/
-
+/// Draw all wires and solder points in a particular node.
 void drawnode(log_nrec *n)
 {
 	drawnodec(n, -1);
 }
 
-/*================  REFRPAGEDISP  ================*/
-/*=                                              =*/
-/*=  Refresh the page-number display.            =*/
-/*=                                              =*/
-/*================================================*/
 
+/// Refresh the page-number display.
 void refrpagedisp()
 {
 	short num;
@@ -2002,12 +1791,7 @@ void refrpagedisp()
 }
 
 
-/*================  REFREDITMODE  ================*/
-/*=                                              =*/
-/*=  Refresh the editing mode in the menus.      =*/
-/*=                                              =*/
-/*================================================*/
-
+/// Refresh the editing mode in the menus.
 void refreditmode()
 {
 	hidecursor();
@@ -2041,12 +1825,7 @@ void refreditmode()
 }
 
 
-/*===============  REFRBASELINE  =================*/
-/*=                                              =*/
-/*=  Refresh the baseline to the correct color.  =*/
-/*=                                              =*/
-/*================================================*/
-
+/// Refresh the baseline to the correct color.
 void refrbaseline(int always)
 {
 	short c;
@@ -2070,14 +1849,7 @@ void refrbaseline(int always)
 
 #define rtn             "REFRESH"
 
-
-/*===================  REFRESH  ==================*/
-/*=                                              =*/
-/*=  Refresh the screen (does not clear, so may  =*/
-/*=     be used to "clean up" existing screen).  =*/
-/*=                                              =*/
-/*================================================*/
-
+/// Refresh the screen (does not clear, so may be used to "clean up" existing screen).
 void refresh()
 {
 	long x1, y1, x2, y2;
@@ -2239,14 +2011,7 @@ void refresh()
 
 #undef rtn
 
-
-/*=================  REFRESHSOON  ================*/
-/*=                                              =*/
-/*=  Screen is messed up, so refresh it as soon  =*/
-/*=     as the user stops moving around.         =*/
-/*=                                              =*/
-/*================================================*/
-
+/// Screen is messed up, so refresh it as soon as the user stops moving around.
 void refreshsoon()
 {
 	refrtimer0 = refrdelay;
@@ -2254,12 +2019,7 @@ void refreshsoon()
 	gg.refrflag = true;
 }
 
-/*==================  REFRMENU  ==================*/
-/*=                                              =*/
-/*=  Clear and redraw menu area of screen.       =*/
-/*=                                              =*/
-/*================================================*/
-
+/// Clear and redraw menu area of screen.
 void refrmenu()
 {
 	short i, FORLIM;
@@ -2325,12 +2085,7 @@ void endbottom()
 	clearalpha();
 }
 
-/*================  REFRSCREEN1  =================*/
-/*=                                              =*/
-/*=  Clear and redraw working area of screen.    =*/
-/*=                                              =*/
-/*================================================*/
-
+/// Clear and redraw working area of screen.
 void refrscreen1()
 {
 	m_colormode((long)m_normal);
@@ -2343,12 +2098,7 @@ void refrscreen1()
 }
 
 
-/*=================  REFRSCREEN  =================*/
-/*=                                              =*/
-/*=  Clear and redraw entire screen.             =*/
-/*=                                              =*/
-/*================================================*/
-
+/// Clear and redraw entire screen.
 void refrscreen()
 {
 	gg.showpage = gg.curpage;
@@ -2368,13 +2118,7 @@ void resize_screen()
 	initscreen();
 }
 
-/*=================  SHOWCATALOG  ================*/
-/*=                                              =*/
-/*=  Switch screen to catalog (TRUE) or circuit  =*/
-/*=     (FALSE).                                 =*/
-/*=                                              =*/
-/*================================================*/
-
+//// Switch screen to catalog (TRUE) or circuit (FALSE).
 void showcatalog()
 {
 	short i;
diff --git a/src/utils.c b/src/utils.c
index 1a6d126..3f424b3 100644
--- a/src/utils.c
+++ b/src/utils.c
@@ -106,13 +106,7 @@ void readreal(char *s_, double *r)
 	dounits(s, r);
 }
 
-/*=================  SORTSHINTS  =================*/
-/*=                                              =*/
-/*=  Put two shortint variables into increasing  =*/
-/*=     numerical order.                         =*/
-/*=                                              =*/
-/*================================================*/
-
+/// Put two shortint variables into increasing numerical order.
 void sortshints(short *x, short *y)
 {
 	short temp;
diff --git a/src/utils/newasm.c b/src/utils/newasm.c
index ca23ee5..c1dd0b0 100644
--- a/src/utils/newasm.c
+++ b/src/utils/newasm.c
@@ -217,4 +217,4 @@ void* na_rtosr(double x)
   return(*((void* *) &x));
 }
 
-/* End. */
+
diff --git a/src/utils/p2c.c b/src/utils/p2c.c
index ef192cf..6d6cef2 100644
--- a/src/utils/p2c.c
+++ b/src/utils/p2c.c
@@ -85,7 +85,7 @@ char *strsub(char *ret, char *s, size_t pos, size_t len)
 
 
 /** Return the index of the first occurrence of "pat" as a substring of "s",
-    starting at index "pos" (1-based).  Result is 1-based, 0 if not found. */
+	starting at index "pos" (1-based).  Result is 1-based, 0 if not found. */
 size_t strpos2(char *s, char *pat, size_t pos)
 {
 	char *cp, ch;
diff --git a/src/utils/regex.c b/src/utils/regex.c
index 0d24072..c49eb66 100644
--- a/src/utils/regex.c
+++ b/src/utils/regex.c
@@ -1137,4 +1137,4 @@ void re_grepl(char *s, char *pat, char *rpl)
 	} while (pos != 0);
 }
 
-/* End. */
+
diff --git a/src/wire.c b/src/wire.c
index ef4408e..ec21274 100644
--- a/src/wire.c
+++ b/src/wire.c
@@ -42,12 +42,7 @@ void markcolor(log_hwrec **hw, struct LOC_wantsolder *LINK)
 }
 
 
-/*===================  NEWHW  ====================*/
-/*=                                              =*/
-/*=  Create a Horizontal Wire.                   =*/
-/*=                                              =*/
-/*================================================*/
-
+/// Create a Horizontal Wire.
 void newhw(log_hwrec **hw)
 {
 	*hw = (log_hwrec *)Malloc(sizeof(log_hwrec));
@@ -60,12 +55,7 @@ void newhw(log_hwrec **hw)
 #define rtn             "DISPHW"
 
 
-/*==================  DISPHW  ====================*/
-/*=                                              =*/
-/*=  Dispose of a Horizontal Wire.               =*/
-/*=                                              =*/
-/*================================================*/
-
+/// Dispose of a Horizontal Wire.
 void disphw(log_hwrec **hw)
 {
 	log_hwrec *hw1;
@@ -95,12 +85,7 @@ void disphw(log_hwrec **hw)
 #undef rtn
 
 
-/*===================  NEWVW  ====================*/
-/*=                                              =*/
-/*=  Create a Vertical Wire.                     =*/
-/*=                                              =*/
-/*================================================*/
-
+/// Create a Vertical Wire.
 void newvw(log_vwrec **vw)
 {
 	*vw = (log_vwrec *)Malloc(sizeof(log_vwrec));
@@ -113,12 +98,7 @@ void newvw(log_vwrec **vw)
 #define rtn             "DISW"
 
 
-/*==================  DISW  ====================*/
-/*=                                              =*/
-/*=  Dispose of a Vertical Wire.                 =*/
-/*=                                              =*/
-/*================================================*/
-
+/// Dispose of a Vertical Wire.
 void dispvw(log_vwrec **vw)
 {
 	log_vwrec *vw1;
@@ -147,12 +127,7 @@ void dispvw(log_vwrec **vw)
 
 #undef rtn
 
-/*==================  NEWSOLDER  =================*/
-/*=                                              =*/
-/*=  Create a solder point.                      =*/
-/*=                                              =*/
-/*================================================*/
-
+/// Create a solder point.
 void newsolder(log_srec **s)
 {
 	*s = (log_srec *)Malloc(sizeof(log_srec));
@@ -169,12 +144,7 @@ void newsolder(log_srec **s)
 #define rtn             "DISPSOLDER"
 
 
-/*================  DISPSOLDER  ==================*/
-/*=                                              =*/
-/*=  Dispose of a solder point.                  =*/
-/*=                                              =*/
-/*================================================*/
-
+/// Dispose of a solder point.
 void dispsolder(log_srec **s)
 {
 	log_srec *s1;
@@ -203,13 +173,7 @@ void dispsolder(log_srec **s)
 
 #undef rtn
 
-/*================  CLOSERWIRE  ==================*/
-/*=                                              =*/
-/*=  Find which wire(s) are under the cursor,    =*/
-/*=     if any.                                  =*/
-/*=                                              =*/
-/*================================================*/
-
+/// Find which wire(s) are under the cursor, if any.
 void closerwire(short x, short y)
 {
 	if (gg.invisible || gg.showconflicts)
@@ -233,12 +197,7 @@ void closerwire(short x, short y)
 #define rtn             "ADDSOLDER"
 
 
-/*=================  ADDSOLDER  ==================*/
-/*=                                              =*/
-/*=  Add a solder point between two wires.       =*/
-/*=                                              =*/
-/*================================================*/
-
+/// Add a solder point between two wires.
 void addsolder(short x, short y, log_hwrec *hw, log_hwrec *hw2, log_vwrec *vw, log_vwrec *vw2)
 {
 	log_srec *s;
@@ -307,12 +266,7 @@ void addsolder(short x, short y, log_hwrec *hw, log_hwrec *hw2, log_vwrec *vw, l
 #undef rtn
 
 
-/*=================  FINDSOLDER  =================*/
-/*=                                              =*/
-/*=  Find a solder point at specified position.  =*/
-/*=                                              =*/
-/*================================================*/
-
+/// Find a solder point at specified position.
 log_srec *findsolder(short x, short y)
 {
 	log_srec *s;
@@ -324,13 +278,7 @@ log_srec *findsolder(short x, short y)
 }
 
 
-/*=================  ADDSOLDERT  =================*/
-/*=                                              =*/
-/*=  Add a solder point at a T-intersection of   =*/
-/*=     two wires.                               =*/
-/*=                                              =*/
-/*================================================*/
-
+/// Add a solder point at a T-intersection of two wires.
 void addsoldert(log_hwrec *hw, log_vwrec *vw)
 {
 	if (hw->x1 == vw->x && hw->y != vw->y1 && hw->y != vw->y2)
@@ -350,12 +298,6 @@ void addsoldert(log_hwrec *hw, log_vwrec *vw)
 }
 
 
-/*==================  CHGHW/VW  ==================*/
-/*=                                              =*/
-/*=  Used for deleting wires (see DELHWIRE).     =*/
-/*=                                              =*/
-/*================================================*/
-
 void chggate (log_grec *g, int i, log_nrec *oldnode, log_nrec *n);
 
 void chgvw (log_vwrec *vw, log_nrec *oldnode, log_nrec *n);
@@ -363,7 +305,7 @@ void chgvw (log_vwrec *vw, log_nrec *oldnode, log_nrec *n);
 
 #define rtn             "CHGHW"
 
-
+/// Used for deleting wires (see DELHWIRE).
 void chghw(log_hwrec *hw, log_nrec *oldnode, log_nrec *n)
 {
 	log_vwrec *vw;
@@ -431,7 +373,7 @@ void chghw(log_hwrec *hw, log_nrec *oldnode, log_nrec *n)
 
 #define rtn             "CHGVW"
 
-
+// Used for deleting wires (see DELHWIRE).
 void chgvw(log_vwrec *vw, log_nrec *oldnode, log_nrec *n)
 {
 	log_hwrec *hw;
@@ -493,12 +435,6 @@ void chgvw(log_vwrec *vw, log_nrec *oldnode, log_nrec *n)
 
 #undef rtn
 
-/*=================  DELVWIRE  ===================*/
-/*=                                              =*/
-/*=  Delete a horizontal or vertical wire.       =*/
-/*=                                              =*/
-/*================================================*/
-
 int wantsolder(log_srec *s)
 {
 	struct LOC_wantsolder V;
@@ -514,6 +450,7 @@ int wantsolder(log_srec *s)
 	return (V.hasblue && (V.hasgreen || V.hasyellow || V.hasred));
 }
 
+/// Deletes a horizontal wire.
 void delhwire(log_hwrec *hw)
 {
 	log_vwrec *vw;
@@ -606,7 +543,7 @@ void delhwire(log_hwrec *hw)
 	clipoff();
 }
 
-
+/// Deletes a vertical wire.
 void delvwire(log_vwrec *vw)
 {
 	log_hwrec *hw;
@@ -703,18 +640,13 @@ void delvwire(log_vwrec *vw)
 
 #define rtn             "ADDHWIRE"
 
-/*==================  ADDVWIRE  ==================*/
-/*=                                              =*/
-/*=  ADDHWIRE:                                   =*/
-/*=     Add a Horizontal wire.  Merge with other =*/
-/*=     horizontal wires if touching; solder to  =*/
-/*=     other vertical wires in T-intersections; =*/
-/*=     connect to gate pins as necessary.       =*/
-/*=     VLSI-mode rules are more complex!        =*/
-/*=  ADDVWIRE works similarly.                   =*/
-/*=                                              =*/
-/*================================================*/
+/** @brief Add a Horizontal wire.
 
+	Merge with other horizontal wires if touching;
+	solder to other vertical wires in T-intersections;
+	connect to gate pins as necessary.
+	VLSI-mode rules are more complex!
+*/
 void addhwire(short x1, short x2, short y, short colr)
 {
 	cnrec *cnbase;
@@ -857,7 +789,13 @@ void addhwire2(short x1, short x2, short y)
 
 #define rtn             "ADDHWIRE"
 
+/** @brief Add a vertical wire.
 
+	Merge with other vertical wires if touching;
+	solder to other horizontal wires in T-intersections;
+	connect to gate pins as necessary.
+	VLSI-mode rules are more complex!
+*/
 void addvwire(short x, short y1, short y2, short colr)
 {
 	cnrec *cnbase;
-- 
GitLab