commit 713dee20aacbd7d12d5f385b943149b0af1b2dbb
parent c54cac68ad7c056dcf816c098411059a41017c89
Author: Vincent Forest <vincent.forest@meso-star.com>
Date: Tue, 10 Feb 2026 10:49:20 +0100
Finalize a first version of the sphin library man
Add only a reference to the API documentation, which is currently
limited to the library header file. Provide the path to this file,
taking into account the library installation directory.
The sources for the manual page thus become a template (suffixed by
".in"), with a generic path to the header file, automatically resolved
by the makefile when generating the manual page, based on the values of
the DESTDIR and INCPREFIX macros.
Diffstat:
| M | Makefile | | | 7 | +++++-- |
| D | doc/sphin.3.scd | | | 71 | ----------------------------------------------------------------------- |
| A | doc/sphin.3.scd.in | | | 80 | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
3 files changed, 85 insertions(+), 73 deletions(-)
diff --git a/Makefile b/Makefile
@@ -124,12 +124,15 @@ pkg:
sphin.pc.in > sphin.pc
sphin-lint.1: doc/sphin-lint.1.scd
-sphin.3: doc/sphin.3.scd
+sphin.3: doc/sphin.3.scd.in
star-phor-input.5: doc/star-phor-input.5.scd
-sphin-lint.1 sphin.3 star-phor-input.5:
+sphin-lint.1 star-phor-input.5:
scdoc < doc/$@.scd > $@
+sphin.3:
+ sed -e 's;@INCPREFIX@;$(DESTDIR)$(INCPREFIX);g' doc/$@.scd.in | scdoc > $@
+
sphin-local.pc: sphin.pc.in
sed -e '1d'\
-e 's#^includedir=.*#includedir=./src/#'\
diff --git a/doc/sphin.3.scd b/doc/sphin.3.scd
@@ -1,71 +0,0 @@
-sphin(3) "UNIX"
-
-; Copyright (C) 2024-2026 Centre National de la Recherche Scientifique
-; Copyright (C) 2024-2026 Clermont Auvergne INP
-; Copyright (C) 2024-2026 INSA Lyon
-; Copyright (C) 2024-2026 Institut Mines Télécom Albi-Carmaux
-; Copyright (C) 2024-2026 Institut National Polytechnique de Toulouse
-; Copyright (C) 2024-2026 |Méso|Star> (contact@meso-star.com)
-; Copyright (C) 2024-2026 PhotonLyX (info@photonlyx.com)
-; Copyright (C) 2024-2026 Université de Lorraine
-; Copyright (C) 2024-2026 Université Paul Sabatier
-; Copyright (C) 2024-2026 Université Toulouse - Jean Jaurès
-;
-; This program is free software: you can redistribute it and/or modify
-; it under the terms of the GNU General Public License as published by
-; the Free Software Foundation, either version 3 of the License, or
-; (at your option) any later version.
-;
-; This program is distributed in the hope that it will be useful,
-; but WITHOUT ANY WARRANTY; without even the implied warranty of
-; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-; GNU General Public License for more details.
-;
-; You should have received a copy of the GNU General Public License
-; along with this program. If not, see <http://www.gnu.org/licenses/>.
-
-# NAME
-
-sphin - sphin library definitions
-
-# SYNOPSIS
-
-*#include <sphin.h>*
-
-# DESCRIPTION
-
-The *sphin* C library provides functions to parse, load and expose data of a
-photoreactive system as described in the *star-phor-input*(5) file format.
-
-It provides a unified data representation that abstract original format used
-to saved data on disk.
-For example, geometries are all stored in a consistent structure - primarly
-using one-dimensional arrays - regardless of their original file format.
-
-Once loaded, the data is intended to be independent of any specific numerical
-method.
-In other words, the library is designed to be independent of a solver but
-nevertheless aims to provide all the data (geometric and physical) necessary for
-a numerical simulation.
-The data is thus said to be unstructured with regard to a resolution method.
-A deterministic solver would therefore be responsible for meshing the
-integration domains, while a statistical solver would have to build structures
-capable of accelerating random access to the system data.
-
-The library's dynamic memory management is based on reference counting.
-Each API object allocated by the library has a reference counter, initialized
-when it is created: the caller is therefore the owner.
-The caller can then obtain other references or release them as needed.
-However, other dynamically allocated API objects can also obtain additional
-references to the API objects on which they depend and which they need
-throughout their lifetime.
-An object is effectively released once all its references have been released,
-either by the caller or by the other objects that depend on it.
-Thus, unlike a manual allocation/deallocation policy, the caller can release the
-references it holds without having to worry about the order of release;
-the actual deallocation of an object only occurs once all references have been
-released.
-
-# SEE ALSO
-
-*star-phor-input*(5)
diff --git a/doc/sphin.3.scd.in b/doc/sphin.3.scd.in
@@ -0,0 +1,80 @@
+sphin(3) "UNIX"
+
+; Copyright (C) 2024-2026 Centre National de la Recherche Scientifique
+; Copyright (C) 2024-2026 Clermont Auvergne INP
+; Copyright (C) 2024-2026 INSA Lyon
+; Copyright (C) 2024-2026 Institut Mines Télécom Albi-Carmaux
+; Copyright (C) 2024-2026 Institut National Polytechnique de Toulouse
+; Copyright (C) 2024-2026 |Méso|Star> (contact@meso-star.com)
+; Copyright (C) 2024-2026 PhotonLyX (info@photonlyx.com)
+; Copyright (C) 2024-2026 Université de Lorraine
+; Copyright (C) 2024-2026 Université Paul Sabatier
+; Copyright (C) 2024-2026 Université Toulouse - Jean Jaurès
+;
+; This program is free software: you can redistribute it and/or modify
+; it under the terms of the GNU General Public License as published by
+; the Free Software Foundation, either version 3 of the License, or
+; (at your option) any later version.
+;
+; This program is distributed in the hope that it will be useful,
+; but WITHOUT ANY WARRANTY; without even the implied warranty of
+; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+; GNU General Public License for more details.
+;
+; You should have received a copy of the GNU General Public License
+; along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+# NAME
+
+sphin - sphin library definitions
+
+# SYNOPSIS
+
+*#include <sphin.h>*
+
+# DESCRIPTION
+
+The *sphin* C library provides functions to parse, load and expose data of a
+photoreactive system as described in the *star-phor-input*(5) file format.
+
+It provides a unified data representation that abstract original format used
+to saved data on disk.
+For example, geometries are all stored in a consistent structure - primarly
+using one-dimensional arrays - regardless of their original file format.
+
+Once loaded, the data is intended to be independent of any specific numerical
+method.
+In other words, the library is designed to be independent of a solver but
+nevertheless aims to provide all the data (geometric and physical) necessary for
+a numerical simulation.
+The data is thus said to be unstructured with regard to a resolution method.
+A deterministic solver would therefore be responsible for meshing the
+integration domains, while a statistical solver would have to build structures
+capable of accelerating random access to the system data.
+
+The library's dynamic memory management is based on reference counting.
+Each API object allocated by the library has a reference counter, initialized
+when it is created: the caller is therefore the owner.
+The caller can then obtain other references or release them as needed.
+However, other dynamically allocated API objects can also obtain additional
+references to the API objects on which they depend and which they need
+throughout their lifetime.
+An object is effectively released once all its references have been released,
+either by the caller or by the other objects that depend on it.
+Thus, unlike a manual allocation/deallocation policy, the caller can release the
+references it holds without having to worry about the order of release;
+the actual deallocation of an object only occurs once all references have been
+released.
+
+There is currently no manual page documenting the API of the *sphin* library.
+Users are therefore invited to consult its header *@INCPREFIX@/sphin.h* as the
+primary reference documentation and index of the functions it offers.
+
+# SEE ALSO
+
+*star-phor-input*(5)
+
+# HISTORY
+
+The *sphin* library been developed thanks to the funding of the ECOCHEM
+project (ProjetIA-22-PESP-0006) belonging to the *PEPR SPLEEN*.