libtiff: doc: Correct types and cross-references

From 107070b9abd03a4e47aa897669439e023d171b71 Mon Sep 17 00:00:00 2001
From: Roger Leigh <[EMAIL REDACTED]>
Date: Fri, 24 Jun 2022 15:17:51 +0100
Subject: [PATCH] doc: Correct types and cross-references

---
 doc/addingtags.rst                    |  14 +--
 doc/build.rst                         |   2 +-
 doc/conf.py                           |   2 +-
 doc/contrib.rst                       |   2 +-
 doc/functions/TIFFFieldWriteCount.rst |   4 +-
 doc/functions/TIFFGetField.rst        | 150 ++++++++++++-------------
 doc/functions/TIFFRGBAImage.rst       |   1 -
 doc/functions/TIFFReadDirectory.rst   |   1 -
 doc/functions/TIFFReadRawStrip.rst    |   2 +-
 doc/functions/TIFFReadRawTile.rst     |   2 +-
 doc/functions/TIFFReadTile.rst        |   3 +-
 doc/functions/TIFFSetDirectory.rst    |   4 +-
 doc/functions/TIFFSetField.rst        | 152 +++++++++++++-------------
 doc/functions/TIFFWriteTile.rst       |   3 +-
 doc/functions/TIFFmemory.rst          |   2 +-
 doc/functions/TIFFquery.rst           |   1 -
 doc/internals.rst                     |  16 +--
 doc/libtiff.rst                       |   6 +-
 doc/releases/v3.5.5.rst               |   2 +-
 doc/releases/v3.5.6beta.rst           |   4 +-
 doc/releases/v3.5.7.rst               |   2 +-
 doc/releases/v3.6.0.rst               |   2 +-
 doc/releases/v3.6.1.rst               |   4 +-
 doc/releases/v3.7.1.rst               |   2 +-
 doc/releases/v3.7.2.rst               |   2 +-
 doc/releases/v3.7.3.rst               |   6 +-
 doc/releases/v3.7.4.rst               |   4 +-
 doc/releases/v3.8.2.rst               |   2 +-
 doc/releases/v3.9.0.rst               |   2 +-
 doc/releases/v3.9.3.rst               |   2 +-
 doc/releases/v3.9.5.rst               |   2 +-
 doc/releases/v4.0.4.rst               |   2 +-
 doc/releases/v4.0.4beta.rst           |   2 +-
 doc/releases/v4.0.5.rst               |   4 +-
 doc/releases/v4.0.7.rst               |   2 +-
 doc/releases/v4.0.8.rst               |  14 +--
 doc/releases/v4.0.9.rst               |  18 +--
 doc/releases/v4.1.0.rst               |   6 +-
 38 files changed, 224 insertions(+), 227 deletions(-)

diff --git a/doc/addingtags.rst b/doc/addingtags.rst
index 8d190cc2..d3f2d8a9 100644
--- a/doc/addingtags.rst
+++ b/doc/addingtags.rst
@@ -171,7 +171,7 @@ desired TIFF handle with the list of :c:struct:`TIFFFieldInfo`.
 
 The tags need to be defined for each TIFF file opened - and when reading
 they should be defined before the tags of the file are read, yet a valid
-:c:type:`TIFF *` is needed to merge the tags against.  In order to get them
+:c:expr:`TIFF *` is needed to merge the tags against.  In order to get them
 registered at the appropriate part of the setup process, it is necessary
 to register our merge function as an extender callback with libtiff. 
 This is done with :c:func:`TIFFSetTagExtender`.  We also keep track of the
@@ -225,7 +225,7 @@ Adding New Builtin Tags
 -----------------------
 
 A similar approach is taken to the above.  However, the :c:struct:`TIFFFieldInfo`
-should be added to the :c:var:`tiffFieldInfo[]` list in :file:`tif_dirinfo.c`.
+should be added to the :c:expr:`tiffFieldInfo[]` list in :file:`tif_dirinfo.c`.
 Ensure that new tags are added in sorted order by the tag number.
 
 Normally new built-in tags should be defined with :c:macro:`FIELD_CUSTOM`; however, if
@@ -235,7 +235,7 @@ add appropriate handling as follows:
 
 #. Define the tag in :file:`tiff.h`.
 #. Add a field to the directory structure in :file:`tif_dir.h`
-   and define a :c:macro:`FIELD_*` bit (also update the definition of
+   and define a ``FIELD_*`` bit (also update the definition of
    :c:macro:`FIELD_CODEC` to reflect your addition).
 #. Add an entry in the :c:struct:`TIFFFieldInfo` array defined at the top of
    :file:`tif_dirinfo.c`.
@@ -258,7 +258,7 @@ add appropriate handling as follows:
 
 If you want to maintain portability, beware of making assumptions
 about data types.  Use the typedefs (:c:type:`uint16_t`, etc. when dealing with
-data on disk and :c:type:`t*_t` when stuff is in memory) and be careful about
+data on disk and ``t*_t`` when stuff is in memory) and be careful about
 passing items through printf or similar vararg interfaces.
 
 Adding New Codec-private Tags
@@ -297,15 +297,15 @@ algorithm is used* follow these steps:
 
 #. Fill in the get and set routines.  Be sure to call the parent method
    for tags that you are not handled directly.  Also be sure to set the
-   :c:macro:`FIELD_*` bits for tags that are to be written to the file.  Note that
+   ``FIELD_*`` bits for tags that are to be written to the file.  Note that
    you can create "pseudo-tags" by defining tags that are processed
    exclusively in the get/set routines and never written to file (see
    the handling of :c:macro:`TIFFTAG_FAXMODE` in :file:`tif_fax3.c`
    for an example of this).
 #. Fill in the print routine, if appropriate.
 
-Note that space has been allocated in the :c:macro:`FIELD_*` bit space for
-codec-private tags.  Define your bits as :c:macro:`FIELD_CODEC+<offset>` to
+Note that space has been allocated in the ``FIELD_*`` bit space for
+codec-private tags.  Define your bits as ``FIELD_CODEC+<offset>`` to
 keep them away from the core tags.  If you need more tags than there
 is room for, just increase :c:macro:`FIELD_SETLONGS` at the top of
 :file:`tiffiop.h`.
diff --git a/doc/build.rst b/doc/build.rst
index 96b3af5f..6853b867 100644
--- a/doc/build.rst
+++ b/doc/build.rst
@@ -622,7 +622,7 @@ it to view any of the sample images available for testing, or try
 :doc:`/tools/tiffinfo` to display the file metadata.  See the
 :doc:`images` section on obtaining the test images.  Otherwise, you can
 do a cursory check of the library with the :doc:`/tools/tiffcp` and
-:doc:`/tools.tiffcmp` programs. For example,
+:doc:`/tools/tiffcmp` programs. For example,
 
 .. code-block:: shell
 
diff --git a/doc/conf.py b/doc/conf.py
index 52547740..9cafcd32 100644
--- a/doc/conf.py
+++ b/doc/conf.py
@@ -83,7 +83,7 @@
 # so a file named "default.css" will overwrite the builtin "default.css".
 html_static_path = ['_static']
 
-html_extra_path = ['static']
+html_extra_path = []
 
 # -- Options for manual page output --------------------------------------------
 
diff --git a/doc/contrib.rst b/doc/contrib.rst
index ba687efb..58617b89 100644
--- a/doc/contrib.rst
+++ b/doc/contrib.rst
@@ -64,7 +64,7 @@ aren't directly TIFF related).
 
     * - :file:`contrib/pds`
       - various routines from Conrad Poelman; a TIFF image iterator and
-        code to support ``private sub-directories''
+        code to support "private sub-directories"
 
     * - :file:`contrib/iptcutil`
       - A utility by `Bill Radcliffe <billr@corbis.com>`_ to
diff --git a/doc/functions/TIFFFieldWriteCount.rst b/doc/functions/TIFFFieldWriteCount.rst
index d03a2a62..7a2a4a5e 100644
--- a/doc/functions/TIFFFieldWriteCount.rst
+++ b/doc/functions/TIFFFieldWriteCount.rst
@@ -25,8 +25,8 @@ but there are some special values:
   :c:type:`uint16_t` *count* argument and a pointer *data* argument must be supplied to
   :c:func:`TIFFSetField`.
 * :c:macro:`TIFF_VARIABLE2` is the same as :c:macro:`TIFF_VARIABLE` except that the
-  *count* argument must have type :c:type:`uint32_t`. (On most modern machines, this makes
-  no practical difference, and the *count* argument can simply be an :c:type:`int` in
+  *count* argument must have type :c:expr:`uint32_t`. (On most modern machines, this makes
+  no practical difference, and the *count* argument can simply be an :c:expr:`int` in
   either case.)
 * :c:type:`TIFF_SPP` indicates that the number of arguments must be equal to the image's
   number of samples per pixel.
diff --git a/doc/functions/TIFFGetField.rst b/doc/functions/TIFFGetField.rst
index 8acac264..cec88e09 100644
--- a/doc/functions/TIFFGetField.rst
+++ b/doc/functions/TIFFGetField.rst
@@ -62,377 +62,377 @@ information on the meaning of each tag and their possible values.
 
     * - :c:macro:`TIFFTAG_ARTIST`
       - 1
-      - :c:type:`const char**`
+      - :c:expr:`const char**`
       -
 
     * - :c:macro:`TIFFTAG_BADFAXLINES`
       - 1
-      - :c:type:`uint32_t*`
+      - :c:expr:`uint32_t*`
       -
 
     * - :c:macro:`TIFFTAG_BITSPERSAMPLE`
       - 1
-      - :c:type:`uint16_t*`
+      - :c:expr:`uint16_t*`
       -
 
     * - :c:macro:`TIFFTAG_CLEANFAXDATA`
       - 1
-      - :c:type:`uint16_t*`
+      - :c:expr:`uint16_t*`
       -
 
     * - :c:macro:`TIFFTAG_COLORMAP`
       - 3
-      - :c:type:`const uint16_t**`
+      - :c:expr:`const uint16_t**`
       - :c:expr:`1<<BitsPerSample` arrays
 
     * - :c:macro:`TIFFTAG_COMPRESSION`
       - 1
-      - :c:type:`uint16_t*`
+      - :c:expr:`uint16_t*`
       -
 
     * - :c:macro:`TIFFTAG_CONSECUTIVEBADFAXLINES`
       - 1
-      - :c:type:`uint32_t*`
+      - :c:expr:`uint32_t*`
       -
 
     * - :c:macro:`TIFFTAG_COPYRIGHT`
       - 1
-      - :c:type:`const char**`
+      - :c:expr:`const char**`
       -
 
     * - :c:macro:`TIFFTAG_DATATYPE`
       - 1
-      - :c:type:`uint16_t*`
+      - :c:expr:`uint16_t*`
       -
 
     * - :c:macro:`TIFFTAG_DATETIME`
       - 1
-      - :c:type:`const char**`
+      - :c:expr:`const char**`
       -
 
     * - :c:macro:`TIFFTAG_DOCUMENTNAME`
       - 1
-      - :c:type:`const char**`
+      - :c:expr:`const char**`
       -
 
     * - :c:macro:`TIFFTAG_DOTRANGE`
       - 2
-      - :c:type:`uint16_t*`
+      - :c:expr:`uint16_t*`
       -
 
     * - :c:macro:`TIFFTAG_EXTRASAMPLES`
       - 2
-      - :c:type:`uint16_t*`, :c:type:`const uint16_t**`
+      - :c:expr:`uint16_t*`, :c:expr:`const uint16_t**`
       - count, types array
 
     * - :c:macro:`TIFFTAG_FAXFILLFUNC`
       - 1
-      - :c:type:`TIFFFaxFillFunc*`
+      - :c:expr:`TIFFFaxFillFunc*`
       - G3/G4 compression pseudo-tag
 
     * - :c:macro:`TIFFTAG_FAXMODE`
       - 1
-      - :c:type:`int*`
+      - :c:expr:`int*`
       - G3/G4 compression pseudo-tag
 
     * - :c:macro:`TIFFTAG_FILLORDER`
       - 1
-      - :c:type:`uint16_t*`
+      - :c:expr:`uint16_t*`
       -
 
     * - :c:macro:`TIFFTAG_GROUP3OPTIONS`
       - 1
-      - :c:type:`uint32_t*`
+      - :c:expr:`uint32_t*`
       -
 
     * - :c:macro:`TIFFTAG_GROUP4OPTIONS`
       - 1
-      - :c:type:`uint32_t*`
+      - :c:expr:`uint32_t*`
       -
 
     * - :c:macro:`TIFFTAG_HALFTONEHINTS`
       - 2
-      - :c:type:`uint16_t*`
+      - :c:expr:`uint16_t*`
       -
 
     * - :c:macro:`TIFFTAG_HOSTCOMPUTER`
       - 1
-      - :c:type:`const char**`
+      - :c:expr:`const char**`
       -
 
     * - :c:macro:`TIFFTAG_ICCPROFILE`
       - 2
-      - :c:type:`const uint32_t*`, :c:type:`const void**`
+      - :c:expr:`const uint32_t*`, :c:expr:`const void**`
       - count, profile data‡
 
     * - :c:macro:`TIFFTAG_IMAGEDEPTH`
       - 1
-      - :c:type:`uint32_t*`
+      - :c:expr:`uint32_t*`
       -
 
     * - :c:macro:`TIFFTAG_IMAGEDESCRIPTION`
       - 1
-      - :c:type:`const char**`
+      - :c:expr:`const char**`
       -
 
     * - :c:macro:`TIFFTAG_IMAGELENGTH`
       - 1
-      - :c:type:`uint32_t*`
+      - :c:expr:`uint32_t*`
       -
 
     * - :c:macro:`TIFFTAG_IMAGEWIDTH`
       - 1
-      - :c:type:`uint32_t*`
+      - :c:expr:`uint32_t*`
       -
 
     * - :c:macro:`TIFFTAG_INKNAMES`
       - 1
-      - :c:type:`const char**`
+      - :c:expr:`const char**`
       -
 
     * - :c:macro:`TIFFTAG_INKSET`
       - 1
-      - :c:type:`uint16_t*`
+      - :c:expr:`uint16_t*`
       -
 
     * - :c:macro:`TIFFTAG_JPEGCOLORMODE`
       - 1
-      - :c:type:`int*`
+      - :c:expr:`int*`
       - JPEG pseudo-tag
 
     * - :c:macro:`TIFFTAG_JPEGQUALITY`
       - 1
-      - :c:type:`int*`
+      - :c:expr:`int*`
       - JPEG pseudo-tag
 
     * - :c:macro:`TIFFTAG_JPEGTABLES`
       - 2
-      - :c:type:`uint32_t*`, :c:type:`const void**`
+      - :c:expr:`uint32_t*`, :c:expr:`const void**`
       - count, tables
 
     * - :c:macro:`TIFFTAG_JPEGTABLESMODE`
       - 1
-      - :c:type:`int*`
+      - :c:expr:`int*`
       - JPEG pseudo-tag
 
     * - :c:macro:`TIFFTAG_MAKE`
       - 1
-      - :c:type:`const char**`
+      - :c:expr:`const char**`
       -
 
     * - :c:macro:`TIFFTAG_MATTEING`
       - 1
-      - :c:type:`uint16_t*`
+      - :c:expr:`uint16_t*`
       -
 
     * - :c:macro:`TIFFTAG_MAXSAMPLEVALUE`
       - 1
-      - :c:type:`uint16_t*`
+      - :c:expr:`uint16_t*`
       -
 
     * - :c:macro:`TIFFTAG_MINSAMPLEVALUE`
       - 1
-      - :c:type:`uint16_t*`
+      - :c:expr:`uint16_t*`
       -
 
     * - :c:macro:`TIFFTAG_MODEL`
       - 1
-      - :c:type:`const char**`
+      - :c:expr:`const char**`
       -
 
     * - :c:macro:`TIFFTAG_ORIENTATION`
       - 1
-      - :c:type:`uint16_t*`
+      - :c:expr:`uint16_t*`
       -
 
     * - :c:macro:`TIFFTAG_PAGENAME`
       - 1
-      - :c:type:`const char**`
+      - :c:expr:`const char**`
       -
 
     * - :c:macro:`TIFFTAG_PAGENUMBER`
       - 2
-      - :c:type:`uint16_t*`
+      - :c:expr:`uint16_t*`
       -
 
     * - :c:macro:`TIFFTAG_PHOTOMETRIC`
       - 1
-      - :c:type:`uint16_t*`
+      - :c:expr:`uint16_t*`
       -
 
     * - :c:macro:`TIFFTAG_PHOTOSHOP`
       - 2
-      - :c:type:`uint32_t*`, :c:type:`const void**`
+      - :c:expr:`uint32_t*`, :c:expr:`const void**`
       - count, data
 
     * - :c:macro:`TIFFTAG_PLANARCONFIG`
       - 1
-      - :c:type:`uint16_t*`
+      - :c:expr:`uint16_t*`
       -
 
     * - :c:macro:`TIFFTAG_PREDICTOR`
       - 1
-      - :c:type:`uint16_t*`
+      - :c:expr:`uint16_t*`
       -
 
     * - :c:macro:`TIFFTAG_PRIMARYCHROMATICITIES`
       - 1
-      - :c:type:`const float**`
+      - :c:expr:`const float**`
       - 6-entry array
 
     * - :c:macro:`TIFFTAG_REFERENCEBLACKWHITE`
       - 1
-      - :c:type:`const float**`
+      - :c:expr:`const float**`
       - 6-entry array
 
     * - :c:macro:`TIFFTAG_RESOLUTIONUNIT`
       - 1
-      - :c:type:`uint16_t*`
+      - :c:expr:`uint16_t*`
       -
 
     * - :c:macro:`TIFFTAG_RICHTIFFIPTC`
       - 2
-      - :c:type:`uint32_t*`, :c:type:`const void**`
+      - :c:expr:`uint32_t*`, :c:expr:`const void**`
       - count, data
 
     * - :c:macro:`TIFFTAG_ROWSPERSTRIP`
       - 1
-      - :c:type:`uint32_t*`
+      - :c:expr:`uint32_t*`
       -
 
     * - :c:macro:`TIFFTAG_SAMPLEFORMAT`
       - 1
-      - :c:type:`uint16_t*`
+      - :c:expr:`uint16_t*`
       -
 
     * - :c:macro:`TIFFTAG_SAMPLESPERPIXEL`
       - 1
-      - :c:type:`uint16_t*`
+      - :c:expr:`uint16_t*`
       -
 
     * - :c:macro:`TIFFTAG_SMAXSAMPLEVALUE`
       - 1
-      - :c:type:`double*`
+      - :c:expr:`double*`
       -
 
     * - :c:macro:`TIFFTAG_SMINSAMPLEVALUE`
       - 1
-      - :c:type:`double*`
+      - :c:expr:`double*`
       -
 
     * - :c:macro:`TIFFTAG_SOFTWARE`
       - 1
-      - :c:type:`const char**`
+      - :c:expr:`const char**`
       -
 
     * - :c:macro:`TIFFTAG_STONITS`
       - 1
-      - :c:type:`const double**`
+      - :c:expr:`const double**`
       -
 
     * - :c:macro:`TIFFTAG_STRIPBYTECOUNTS`
       - 1
-      - :c:type:`const uint64_t**`
+      - :c:expr:`const uint64_t**`
       -
 
     * - :c:macro:`TIFFTAG_STRIPOFFSETS`
       - 1
-      - :c:type:`const uint64_t**`
+      - :c:expr:`const uint64_t**`
       -
 
     * - :c:macro:`TIFFTAG_SUBFILETYPE`
       - 1
-      - :c:type:`uint32_t*`
+      - :c:expr:`uint32_t*`
       -
 
     * - :c:macro:`TIFFTAG_SUBIFD`
       - 2
-      - :c:type:`uint16_t*`, :c:type:`const uint64_t**`
+      - :c:expr:`uint16_t*`, :c:expr:`const uint64_t**`
       - count, offsets array
 
     * - :c:macro:`TIFFTAG_TARGETPRINTER`
       - 1
-      - :c:type:`const char**`
+      - :c:expr:`const char**`
       -
 
     * - :c:macro:`TIFFTAG_THRESHHOLDING`
       - 1
-      - :c:type:`uint16_t*`
+      - :c:expr:`uint16_t*`
       -
 
     * - :c:macro:`TIFFTAG_TILEBYTECOUNTS`
       - 1
-      - :c:type:`const uint64_t**`
+      - :c:expr:`const uint64_t**`
       -
 
     * - :c:macro:`TIFFTAG_TILEDEPTH`
       - 1
-      - :c:type:`uint32_t*`
+      - :c:expr:`uint32_t*`
       -
 
     * - :c:macro:`TIFFTAG_TILELENGTH`
       - 1
-      - :c:type:`uint32_t*`
+      - :c:expr:`uint32_t*`
       -
 
     * - :c:macro:`TIFFTAG_TILEOFFSETS`
       - 1
-      - :c:type:`const uint64_t**`
+      - :c:expr:`const uint64_t**`
       -
 
     * - :c:macro:`TIFFTAG_TILEWIDTH`
       - 1
-      - :c:type:`uint32_t*`
+      - :c:expr:`uint32_t*`
       -
 
     * - :c:macro:`TIFFTAG_TRANSFERFUNCTION`
       - 1 or 3†
-      - :c:type:`const uint16_t**`
+      - :c:expr:`const uint16_t**`
       - :c:expr:`1<<BitsPerSample` entry arrays
 
     * - :c:macro:`TIFFTAG_WHITEPOINT`
       - 1
-      - :c:type:`const float**`
+      - :c:expr:`const float**`
       - 2-entry array
 
     * - :c:macro:`TIFFTAG_XMLPACKET`
       - 2
-      - :c:type:`uint32_t*,const void**`
+      - :c:expr:`uint32_t*`, :c:expr:`const void**`
       - count, data
 
     * - :c:macro:`TIFFTAG_XPOSITION`
       - 1
-      - :c:type:`float*`
+      - :c:expr:`float*`
       -
 
     * - :c:macro:`TIFFTAG_XRESOLUTION`
       - 1
-      - :c:type:`float*`
+      - :c:expr:`float*`
       -
 
     * - :c:macro:`TIFFTAG_YCBCRCOEFFICIENTS`
       - 1
-      - :c:type:`const float**`
+      - :c:expr:`const float**`
       - 3-entry array
 
     * - :c:macro:`TIFFTAG_YCBCRPOSITIONING`
       - 1
-      - :c:type:`uint16_t*`
+      - :c:expr:`uint16_t*`
       -
 
     * - :c:macro:`TIFFTAG_YCBCRSUBSAMPLING`
       - 2
-      - :c:type:`uint16_t*`
+      - :c:expr:`uint16_t*`
       -
 
     * - :c:macro:`TIFFTAG_YPOSITION`
       - 1
-      - :c:type:`float*`
+      - :c:expr:`float*`
       -
 
     * - :c:macro:`TIFFTAG_YRESOLUTION`
       - 1
-      - :c:type:`float*`
+      - :c:expr:`float*`
       -
 
 †:
diff --git a/doc/functions/TIFFRGBAImage.rst b/doc/functions/TIFFRGBAImage.rst
index f61d314e..cd4ea0b1 100644
--- a/doc/functions/TIFFRGBAImage.rst
+++ b/doc/functions/TIFFRGBAImage.rst
@@ -229,7 +229,6 @@ See also
 
 :doc:`TIFFOpen` (3tiff),
 :doc:`TIFFReadRGBAImage` (3tiff),
-:doc:`TIFFReadRGBAImageOriented` (3tiff),
 :doc:`TIFFReadRGBAStrip` (3tiff),
 :doc:`TIFFReadRGBATile` (3tiff),
 :doc:`libtiff` (3tiff)
diff --git a/doc/functions/TIFFReadDirectory.rst b/doc/functions/TIFFReadDirectory.rst
index db07b601..751b2701 100644
--- a/doc/functions/TIFFReadDirectory.rst
+++ b/doc/functions/TIFFReadDirectory.rst
@@ -139,5 +139,4 @@ See also
 :doc:`TIFFOpen` (3tiff),
 :doc:`TIFFWriteDirectory` (3tiff),
 :doc:`TIFFSetDirectory` (3tiff),
-:doc:`TIFFSetSubDirectory` (3tiff),
 :doc:`libtiff` (3tiff),
diff --git a/doc/functions/TIFFReadRawStrip.rst b/doc/functions/TIFFReadRawStrip.rst
index 82214d21..bd235636 100644
--- a/doc/functions/TIFFReadRawStrip.rst
+++ b/doc/functions/TIFFReadRawStrip.rst
@@ -39,5 +39,5 @@ See also
 :doc:`TIFFOpen` (3tiff),
 :doc:`TIFFReadEncodedStrip` (3tiff),
 :doc:`TIFFReadScanline` (3tiff),
-:doc:`TIFFStripSize` (3tiff),
+:doc:`TIFFstrip` (3tiff),
 :doc:`libtiff` (3tiff)
diff --git a/doc/functions/TIFFReadRawTile.rst b/doc/functions/TIFFReadRawTile.rst
index 68af1e7d..90e4d599 100644
--- a/doc/functions/TIFFReadRawTile.rst
+++ b/doc/functions/TIFFReadRawTile.rst
@@ -41,5 +41,5 @@ See also
 :doc:`TIFFOpen` (3tiff),
 :doc:`TIFFReadEncodedTile` (3tiff),
 :doc:`TIFFReadTile` (3tiff),
-:doc:`TIFFTileSize` (3tiff),
+:doc:`TIFFtile` (3tiff),
 :doc:`libtiff` (3tiff),
diff --git a/doc/functions/TIFFReadTile.rst b/doc/functions/TIFFReadTile.rst
index b7d6c31f..22c47832 100644
--- a/doc/functions/TIFFReadTile.rst
+++ b/doc/functions/TIFFReadTile.rst
@@ -50,8 +50,7 @@ All error messages are directed to the :c:func:`TIFFError` routine.
 See also
 --------
 
-:doc:`TIFFCheckTile` (3tiff),
-:doc:`TIFFComputeTile` (3tiff),
+:doc:`TIFFtile` (3tiff),
 :doc:`TIFFOpen` (3tiff),
 :doc:`TIFFReadEncodedTile` (3tiff),
 :doc:`TIFFReadRawTile` (3tiff),
diff --git a/doc/functions/TIFFSetDirectory.rst b/doc/functions/TIFFSetDirectory.rst
index a1382700..2d49c12d 100644
--- a/doc/functions/TIFFSetDirectory.rst
+++ b/doc/functions/TIFFSetDirectory.rst
@@ -12,7 +12,7 @@ Synopsis
 
 .. c:function:: int TIFFSetDirectory(TIFF* tif, tdir_t dirnum)
 
-.. c:fucntion:: int TIFFSetSubDirectory(TIFF* tif, uint64_t diroff)
+.. c:function:: int TIFFSetSubDirectory(TIFF* tif, uint64_t diroff)
 
 Description
 -----------
@@ -51,7 +51,7 @@ All error messages are directed to the :c:func:`TIFFError` routine.
 See also
 --------
 
-:doc:`TIFFCurrentDirectory` (3tiff),
+:doc:`TIFFquery` (3tiff),
 :doc:`TIFFOpen` (3tiff),
 :doc:`TIFFReadDirectory` (3tiff),
 :doc:`TIFFWriteDirectory` (3tiff),
diff --git a/doc/functions/TIFFSetField.rst b/doc/functions/TIFFSetField.rst
index fff7252f..b3bf1616 100644
--- a/doc/functions/TIFFSetField.rst
+++ b/doc/functions/TIFFSetField.rst
@@ -46,16 +46,16 @@ The data types are:
     * - Type
       - Description
 
-    * - char*
+    * - :c:expr:`char*`
       - a null-terminated string corresponding to the ``ASCII`` data type
-    * - uint16_t
+    * - :c:expr:`uint16_t`
       - an unsigned 16-bit value
-    * - uint32_t
+    * - :c:expr:`uint32_t`
       - an unsigned 32-bit value;
-    * - uint16_t*
+    * - :c:expr:`uint16_t*`
       - an array of unsigned 16-bit values.
-    * - void*
-        an array of data values of unspecified type.
+    * - :c:expr:`void*`
+      - an array of data values of unspecified type.
 
 Consult the TIFF specification for information on the meaning of each tag.
 
@@ -71,283 +71,283 @@ Consult the TIFF specification for information on the meaning of each tag.
 
     * - :c:macro:`TIFFTAG_ARTIST`
       - 1
-      - :c:type:`char*`
+      - :c:expr:`char*`
       -
     * - :c:macro:`TIFFTAG_BADFAXLINES`
       - 1
-      - :c:type:`uint32_t`
+      - :c:expr:`uint32_t`
       -
     * - :c:macro:`TIFFTAG_BITSPERSAMPLE`
       - 1
-      - :c:type:`uint16_t`
+      - :c:expr:`uint16_t`
       - †
     * - :c:macro:`TIFFTAG_CLEANFAXDATA`
       - 1
-      - :c:type:`uint16_t`
+      - :c:expr:`uint16_t`
       -
     * - :c:macro:`TIFFTAG_COLORMAP`
       - 3
-      - :c:type:`uint16_t*`
+      - :c:expr:`uint16_t*`
       - :c:expr:`1<<BitsPerSample` arrays
     * - :c:macro:`TIFFTAG_COMPRESSION`
       - 1
-      - :c:type:`uint16_t`
+      - :c:expr:`uint16_t`
       - †
     * - :c:macro:`TIFFTAG_CONSECUTIVEBADFAXLINES`
       - 1
-      - :c:type:`uint32_t`
+      - :c:expr:`uint32_t`
       -
     * - :c:macro:`TIFFTAG_COPYRIGHT`
       - 1
-      - :c:type:`char*`
+      - :c:expr:`char*`
       -
     * - :c:macro:`TIFFTAG_DATETIME`
       - 1
-      - :c:type:`char*`
+      - :c:expr:`char*`
       -
     * - :c:macro:`TIFFTAG_DOCUMENTNAME`
       - 1
-      - :c:type:`char*`
+      - :c:expr:`char*`
       -
     * - :c:macro:`TIFFTAG_DOTRANGE`
       - 2
-      - :c:type:`uint16_t`
+      - :c:expr:`uint16_t`
       -
     * - :c:macro:`TIFFTAG_EXTRASAMPLES`
       - 2
-      - :c:type:`uint16_t`, :c:type:`uint16_t*`
+      - :c:expr:`uint16_t`, :c:expr:`uint16_t*`
       - † count, types array
     * - :c:macro:`TIFFTAG_FAXFILLFUNC`
       - 1
-      - :c:type:`TIFFFaxFillFunc`
+      - :c:expr:`TIFFFaxFillFunc`
       - G3/G4 compression pseudo-tag
     * - :c:macro:`TIFFTAG_FAXMODE`
       - 1
-      - :c:type:`int`
+      - :c:expr:`int`
       - † G3/G4 compression pseudo-tag
     * - :c:macro:`TIFFTAG_FILLORDER`
       - 1
-      - :c:type:`uint16_t`
+      - :c:expr:`uint16_t`
       - †
     * - :c:macro:`TIFFTAG_GROUP3OPTIONS`
       - 1
-      - :c:type:`uint32_t`
+      - :c:expr:`uint32_t`
       - †
     * - :c:macro:`TIFFTAG_GROUP4OPTIONS`
       - 1
-      - :c:type:`uint32_t`
+      - :c:expr:`uint32_t`
       - †
     * - :c:macro:`TIFFTAG_HALFTONEHINTS`
       - 2
-      - :c:type:`uint16_t`
+      - :c:expr:`uint16_t`
       -
     * - :c:macro:`TIFFTAG_HOSTCOMPUTER`
       - 1
-      - :c:type:`char*`
+      - :c:expr:`char*`
       -
     * - :c:macro:`TIFFTAG_ICCPROFILE`
       - 2
-      - :c:type:`uint32_t`, :c:type:`void*`
+      - :c:expr:`uint32_t`, :c:expr:`void*`
       - count, profile data*
     * - :c:macro:`TIFFTAG_IMAGEDEPTH`
       - 1
-      - :c:type:`uint32_t`
+      - :c:expr:`uint32_t`
       - †
     * - :c:macro:`TIFFTAG_IMAGEDESCRIPTION`
       - 1
-      - :c:type:`char*`
+      - :c:expr:`char*`
       -
     * - :c:macro:`TIFFTAG_IMAGELENGTH`
       - 1
-      - :c:type:`uint32_t`
+      - :c:expr:`uint32_t`
       -
     * - :c:macro:`TIFFTAG_IMAGEWIDTH`
       - 1
-      - :c:type:`uint32_t`
+      - :c:expr:`uint32_t`
       - †
     * - :c:macro:`TIFFTAG_INKNAMES`
       - 2
-      - :c:type:`uint16_t`, :c:type:`char*`
+      - :c:expr:`uint16_t`, :c:expr:`char*`
       -
     * - :c:macro:`TIFFTAG_INKSET`
       - 1
-      - :c:type:`uint16_t`
+      - :c:expr:`uint16_t`
       - †
     * - :c:macro:`TIFFTAG_JPEGCOLORMODE`
       - 1
-      - :c:type:`int`
+      - :c:expr:`int`
       - † JPEG pseudo-tag
     * - :c:macro:`TIFFTAG_JPEGQUALITY`
       - 1
-      - :c:type:`int`
+      - :c:expr:`int`
       - JPEG pseudo-tag
     * - :c:macro:`TIFFTAG_JPEGTABLES`
       - 2
-      - :c:type:`uint32_t*`, :c:type:`void*`
+      - :c:expr:`uint32_t*`, :c:expr:`void*`
       - † count, tables
     * - :c:macro:`TIFFTAG_JPEGTABLESMODE`
       - 1
-      - :c:type:`int`
+      - :c:expr:`int`
       - † JPEG pseudo-tag
     * - :c:macro:`TIFFTAG_MAKE`
       - 1
-      - :c:type:`char*`
+      - :c:expr:`char*`
       -
     * - :c:macro:`TIFFTAG_MATTEING`
       - 1
-      - :c:type:`uint16_t`
+      - :c:expr:`uint16_t`
       - †
     * - :c:macro:`TIFFTAG_MAXSAMPLEVALUE`
       - 1
-      - :c:type:`uint16_t`
+      - :c:expr:`uint16_t`
       -
     * - :c:macro:`TIFFTAG_MINSAMPLEVALUE`
       - 1
-      - :c:type:`uint16_t`
+      - :c:expr:`uint16_t`
       -
     * - :c:macro:`TIFFTAG_MODEL`
       - 1
-      - :c:type:`char*`
+      - :c:expr:`char*`
       -
     * - :c:macro:`TIFFTAG_ORIENTATION`
       - 1
-      - :c:type:`uint16_t`
+      - :c:expr:`uint16_t`
       -
     * - :c:macro:`TIFFTAG_PAGENAME`
       - 1
-      - :c:type:`char*`
+      - :c:expr:`char*`
       -
     * - :c:macro:`TIFFTAG_PAGENUMBER`
       - 2
-      - :c:type:`uint16_t`
+      - :c:expr:`uint16_t`
       -
     * - :c:macro:`TIFFTAG_PHOTOMETRIC`
       - 1
-      - :c:type:`uint16_t`
+      - :c:expr:`uint16_t`
       -
     * - :c:macro:`TIFFTAG_PHOTOSHOP`
       - ?
-      - :c:type:`uint32_t`, :c:type:`void*`
+      - :c:expr:`uint32_t`, :c:expr:`void*`
       - count, data
     * - :c:macro:`TIFFTAG_PLANARCONFIG`
       - 1
-      - :c:type:`uint16_t`
+      - :c:expr:`uint16_t`
       - †
     * - :c:macro:`TIFFTAG_PREDICTOR`
       - 1
-      - :c:type:`uint16_t`
+      - :c:expr:`uint16_t`
       - †
     * - :c:macro:`TIFFTAG_PRIMARYCHROMATICITIES`
       - 1
-      - :c:type:`float*`
+      - :c:expr:`float*`
       - 6-entry array
     * - :c:macro:`TIFFTAG_REFERENCEBLACKWHITE`
       - 1
-      - :c:type:`float*`
+      - :c:expr:`float*`
       - † 6-entry array
     * - :c:macro:`TIFFTAG_RESOLUTIONUNIT`
       - 1
-      - :c:type:`uint16_t`
+      - :c:expr:`uint16_t`
       -
     * - :c:macro:`TIFFTAG_RICHTIFFIPTC`
       - 2
-      - :c:type:`uint32_t`, :c:type:`void*`
+      - :c:expr:`uint32_t`, :c:expr:`void*`
       - count, data
     * - :c:macro:`TIFFTAG_ROWSPERSTRIP`
       - 1
-      - :c:type:`uint32_t`
+      - :c:expr:`uint32_t`
       - † must be > 0
     * - :c:macro:`TIFFTAG_SAMPLEFORMAT`
       - 1
-      - :c:type:`uint16_t`
+      - :c:expr:`uint16_t`
       - †
     * - :c:macro:`TIFFTAG_SAMPLESPERPIXEL`
       - 1
-      - :c:type:`uint16_t`
+      - :c:expr:`uint16_t`
       - † value must be ≤ 4
     * - :c:macro:`TIFFTAG_SMAXSAMPLEVALUE`
       - 1
-      - :c:type:`double`
+      - :c:expr:`double`
       -
     * - :c:macro:`TIFFTAG_SMINSAMPLEVALUE`
       - 1
-      - :c:type:`double`
+      - :c:expr:`double`
       -
     * - :c:macro:`TIFFTAG_SOFTWARE`
       - 1
-      - :c:type:`char*`
+      - :c:expr:`char*`
       -
     * - :c:macro:`TIFFTAG_STONITS`
       - 1
-      - :c:type:`double`
+      - :c:expr:`double`
       - †
     * - :c:macro:`TIFFTAG_SUBFILETYPE`
       - 1
-      - :c:type:`uint32_t`
+      - :c:expr:`uint32_t`
       -
     * - :c:macro:`TIFFTAG_SUBIFD`
       - 2
-      - :c:type:`uint16_t`, :c:type:`uint64_t*`
+      - :c:expr:`uint16_t`, :c:expr:`uint64_t*`
       - count, offsets array
     * - :c:macro:`TIFFTAG_TARGETPRINTER`
       - 1
-      - :c:type:`char*`
+      - :c:expr:`char*`
       -
     * - :c:macro:`TIFFTAG_THRESHHOLDING`
       - 1
-      - :c:type:`uint16_t`
+      - :c:expr:`uint16_t`
       -
     * - :c:macro:`TIFFTAG_TILEDEPTH`
       - 1
-      - :c:type:`uint32_t`
+      - :c:expr:`uint32_t`
       - †
     * - :c:macro:`TIFFTAG_TILELENGTH`
       - 1
-      - :c:type:`uint32_t`
+      - :c:expr:`uint32_t`
       - † must be a multiple of 8
     * - :c:macro:`TIFFTAG_TILEWIDTH`
       - 1
-      - :c:type:`uint32_t`
+      - :c:expr:`uint32_t`
       - † must be a multiple of 8
     * - :c:macro:`TIFFTAG_TRANSFERFUNCTION`
       - 1 or 3‡
-      - :c:type:`uint16_t*`
+      - :c:expr:`uint16_t*`
       - :c:expr:`1<<BitsPerSample` entry arrays
     * - :c:macro:`TIFFTAG_WHITEPOINT`
       - 1
-      - :c:type:`float*`
+      - :c:expr:`float*`
       - 2-entry array
     * - :c:macro:`TIFFTAG_XMLPACKET`
       - 2
-      - :c:type:`uint32_t`, :c:type:`void*`
+      - :c:expr:`uint32_t`, :c:expr:`void*`
       - count, data
     * - :c:macro:`TIFFTAG_XPOSITION`
       - 1
-      - :c:type:`float`
+      - :c:expr:`float`
       -
     * - :c:macro:`TIFFTAG_XRESOLUTION`
       - 1
-      - :c:type:`float`
+      - :c:expr:`float`
       -
     * - :c:macro:`TIFFTAG_YCBCRCOEFFICIENTS`
       - 1
-      - :c:type:`float*`
+      - :c:expr:`float*`
       - † 3-entry array
     * - :c:macro:`TIFFTAG_YCBCRPOSITIONING`
       - 1
-      - :c:type:`uint16_t`
+      - :c:expr:`uint16_t`
       - †
     * - :c:macro:`TIFFTAG_YCBCRSAMPLING`
       - 2
-      - :c:type:`uint16_t`
+      - :c:expr:`uint16_t`
       - †
     * - :c:macro:`TIFFTAG_YPOSITION`
       - 1
-      - :c:type:`float`
+      - :c:expr:`float`
       -
     * - :c:macro:`TIFFTAG_YRESOLUTION`
       - 1
-      - :c:type:`float`
+      - :c:expr:`float`
       -
 
 †:
diff --git a/doc/functions/TIFFWriteTile.rst b/doc/functions/TIFFWriteTile.rst
index 3e25d2c1..5044d0e0 100644
--- a/doc/functions/TIFFWriteTile.rst
+++ b/doc/functions/TIFFWriteTile.rst
@@ -42,8 +42,7 @@ All error messages are directed to the :c:func:`TIFFError` routine.
 See also
 --------
 
-:doc:`TIFFCheckTile` (3tiff),
-:doc:`TIFFComputeTile` (3tiff),
+:doc:`TIFFtile` (3tiff),
 :doc:`TIFFOpen` (3tiff),
 :doc:`TIFFReadTile` (3tiff),
 :doc:`TIFFWriteScanline` (3tiff),
diff --git a/doc/functions/TIFFmemory.rst b/doc/functions/TIFFmemory.rst
index 169a9681..826d6d22 100644
--- a/doc/functions/TIFFmemory.rst
+++ b/doc/functions/TIFFmemory.rst
@@ -14,7 +14,7 @@ Synopsis
 
 .. c:function:: tdata_t _TIFFrealloc(tdata_t buffer, tsize_t size)
 
-.. c:function:: void _TIFFfree(tdata_t " buffer ")
+.. c:function:: void _TIFFfree(tdata_t buffer)
 
 .. c:function:: void _TIFFmemset(tdata_t s, int c, tsize_t n)
 
diff --git a/doc/functions/TIFFquery.rst b/doc/functions/TIFFquery.rst
index bf146f76..fc55c91a 100644
--- a/doc/functions/TIFFquery.rst
+++ b/doc/functions/TIFFquery.rst
@@ -92,4 +92,3 @@ See also
 
 :doc:`libtiff` (3tiff),
 :doc:`TIFFOpen` (3tiff),
-:doc:`TIFFFdOpen` (3tiff)
diff --git a/doc/internals.rst b/doc/internals.rst
index 21b60417..86014d9f 100644

(Patch may be truncated, please check the link at the top of this post.)