commit 91418f36240474c872eb6b4131161721ce3b8e3e
parent 92e106dd06eb49079132b7ea1877ffaec88f28e2
Author: Vincent Forest <vincent.forest@meso-star.com>
Date: Tue, 31 Oct 2023 11:44:44 +0100
Merge branch 'release_0.1'
Diffstat:
16 files changed, 437 insertions(+), 210 deletions(-)
diff --git a/.gitignore b/.gitignore
@@ -1,12 +1,13 @@
.gitignore
-CMakeCache.txt
-CMakeFiles
-Makefile
-tmp
[Bb]uild*
*.sw[po]
-*.[ao]
-*.orig
+*.[aod]
+*.so
*~
+test*
+!test*.[ch]
+.config
+.test
tags
-
+*.pc
+file.txt
diff --git a/Makefile b/Makefile
@@ -0,0 +1,153 @@
+# Copyright (C) 2022, 2023 Centre National de la Recherche Scientifique
+# Copyright (C) 2022, 2023 Institut Pierre-Simon Laplace
+# Copyright (C) 2022, 2023 Institut de Physique du Globe de Paris
+# Copyright (C) 2022, 2023 |Méso|Star> (contact@meso-star.com)
+# Copyright (C) 2022, 2023 Observatoire de Paris
+# Copyright (C) 2022, 2023 Université de Reims Champagne-Ardenne
+# Copyright (C) 2022, 2023 Université de Versaille Saint-Quentin
+# Copyright (C) 2022, 2023 Université Paul Sabatier
+#
+# 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/>.
+
+.POSIX:
+.SUFFIXES: # Clean up default inference rules
+
+include config.mk
+
+LIBNAME_STATIC = librnsl.a
+LIBNAME_SHARED = librnsl.so
+LIBNAME = $(LIBNAME_$(LIB_TYPE))
+
+################################################################################
+# Library building
+################################################################################
+SRC = src/rnsl.c src/rnsl_log.c
+OBJ = $(SRC:.c=.o)
+DEP = $(SRC:.c=.d)
+
+build_library: .config $(DEP)
+ @$(MAKE) -fMakefile $$(for i in $(DEP); do echo -f $${i}; done) \
+ $$(if [ -n "$(LIBNAME)" ]; then \
+ echo "$(LIBNAME)"; \
+ else \
+ echo "$(LIBNAME_SHARED)"; \
+ fi)
+
+$(DEP) $(OBJ): config.mk
+
+$(LIBNAME_SHARED): $(OBJ)
+ $(CC) $(CFLAGS_SO) $(RSYS_CFLAGS) -o $@ $(OBJ) $(LDFLAGS_SO) $(RSYS_LIBS)
+
+$(LIBNAME_STATIC): librnsl.o
+ $(AR) -rc $@ $?
+ $(RANLIB) $@
+
+librnsl.o: $(OBJ)
+ $(LD) -r $(OBJ) -o $@
+ $(OBJCOPY) $(OCPFLAGS) $@
+
+.config: config.mk
+ @if ! $(PKG_CONFIG) --atleast-version $(RSYS_VERSION) rsys; then \
+ echo "rsys $(RSYS_VERSION) not found" >&2; exit 1; fi
+ @echo "config done" > $@
+
+.SUFFIXES: .c .d .o
+.c.d:
+ @$(CC) $(CFLAGS_SO) $(RSYS_CFLAGS) -MM -MT "$(@:.d=.o) $@" $< -MF $@
+
+.c.o:
+ $(CC) $(CFLAGS_SO) $(RSYS_CFLAGS) -DRNSL_SHARED_BUILD -c $< -o $@
+
+################################################################################
+# Installation
+################################################################################
+pkg:
+ sed -e 's#@PREFIX@#$(PREFIX)#g'\
+ -e 's#@VERSION@#$(VERSION)#g'\
+ -e 's#@RSYS_VERSION@#$(RSYS_VERSION)#g'\
+ rnsl.pc.in > rnsl.pc
+
+rnsl-local.pc: rnsl.pc.in
+ sed -e '1d'\
+ -e 's#^includedir=.*#includedir=./src/#'\
+ -e 's#^libdir=.*#libdir=./#'\
+ -e 's#@VERSION@#$(VERSION)#g'\
+ -e 's#@RSYS_VERSION@#$(RSYS_VERSION)#g'\
+ rnsl.pc.in > $@
+
+install: build_library pkg
+ @$(SHELL) make.sh install "$(DESTDIR)$(PREFIX)/lib" $(LIBNAME)
+ @$(SHELL) make.sh install "$(DESTDIR)$(PREFIX)/lib/pkgconfig" rnsl.pc
+ @$(SHELL) make.sh install "$(DESTDIR)$(PREFIX)/include/rad-net" src/rnsl.h
+ @$(SHELL) make.sh install "$(DESTDIR)$(PREFIX)/share/doc/rnsl" COPYING README.md
+ @$(SHELL) make.sh install "$(DESTDIR)$(PREFIX)/share/man/man5" rnsl.5
+
+uninstall:
+ rm -f "$(DESTDIR)$(PREFIX)/lib/$(LIBNAME)"
+ rm -f "$(DESTDIR)$(PREFIX)/lib/pkgconfig/rnsl.pc"
+ rm -f "$(DESTDIR)$(PREFIX)/share/doc/rnsl/COPYING"
+ rm -f "$(DESTDIR)$(PREFIX)/share/doc/rnsl/README.md"
+ rm -f "$(DESTDIR)$(PREFIX)/include/rad-net/rnsl.h"
+ rm -f "$(DESTDIR)$(PREFIX)/share/man/man5/rnsl.5"
+
+################################################################################
+# Miscellaneous targets
+################################################################################
+all: build_library build_tests
+
+clean: clean_test
+ rm -f $(OBJ) $(TEST_OBJ) $(LIBNAME)
+ rm -f .config .test librnsl.o rnsl.pc rnsl-local.pc
+
+distclean: clean
+ rm -f $(DEP) $(TEST_DEP)
+
+lint:
+ shellcheck -o all make.sh
+ mandoc -Tlint -Wall rnsl.5 || [ $$? -le 1 ]
+
+################################################################################
+# Tests
+################################################################################
+TEST_SRC =\
+ src/test_rnsl.c\
+ src/test_rnsl_load.c
+TEST_OBJ = $(TEST_SRC:.c=.o)
+TEST_DEP = $(TEST_SRC:.c=.d)
+
+PKG_CONFIG_LOCAL = PKG_CONFIG_PATH="./:$${PKG_CONFIG_PATH}" $(PKG_CONFIG)
+RNSL_CFLAGS = $$($(PKG_CONFIG_LOCAL) $(PCFLAGS) --cflags rnsl-local.pc)
+RNSL_LIBS = $$($(PKG_CONFIG_LOCAL) $(PCFLAGS) --libs rnsl-local.pc)
+
+test: build_tests
+ @$(SHELL) make.sh run_test $(TEST_SRC)
+
+build_tests: build_library $(TEST_DEP) .test
+ @$(MAKE) -fMakefile -f.test $$(for i in $(TEST_DEP); do echo -f"$${i}"; done) test_bin
+
+.test: Makefile make.sh
+ @$(SHELL) make.sh config_test $(TEST_SRC) > $@
+
+clean_test:
+ $(SHELL) make.sh clean_test $(TEST_SRC) file.txt
+
+$(TEST_DEP): config.mk rnsl-local.pc
+ @$(CC) $(CFLAGS_EXE) $(RNSL_CFLAGS) $(RSYS_CFLAGS) \
+ -MM -MT "$(@:.d=.o) $@" $(@:.d=.c) -MF $@
+
+$(TEST_OBJ): config.mk rnsl-local.pc
+ $(CC) $(CFLAGS_EXE) $(RNSL_CFLAGS) $(RSYS_CFLAGS) -c $(@:.o=.c) -o $@
+
+test_rnsl test_rnsl_load: config.mk rnsl-local.pc $(LIBNAME)
+ $(CC) $(CFLAGS_EXE) -o $@ src/$@.o $(LDFLAGS_EXE) $(RNSL_LIBS) $(RSYS_LIBS)
diff --git a/README.md b/README.md
@@ -1,35 +1,47 @@
# Rad-Net String List
-This C library loads a set of file names listed according to the rnsl file format
+This C library loads a set of strings listed according to the rnsl file
+format. See `rnsl.5` for format specification.
-## How to build
+## Requirements
-This library is compatible with 64-bits POSIX systems. It relies the
-[CMake](http://www.cmake.org) and the
-[RCMake](https://gitlab.com/vaplv/rcmake/) packages to build. It also depends
-on the [RSys](https://gitlab.com/vaplv/rsys/) library. It optionally depends on
-[scdoc](https://sr.ht/~sircmpwn/scdoc/) which, if available, is used to
-generate the man page of the Star-CK file format.
+- C compiler
+- POSIX make
+- pkg-config
+- [RSys](https://gitlab.com/vaplv/rsys)
+- [mandoc](https://mandoc.bsd.lv)
-First ensure that CMake is installed on your system. Then install the RCMake
-package as well as the aforementioned prerequisites. Finally generate the
-project from the `cmake/CMakeLists.txt` file by appending to the
-`CMAKE_PREFIX_PATH` variable the install directories of its dependencies. The
-resulting project can be edited, built, tested and installed as any CMake
-project. Refer to the [CMake documentation](https://cmake.org/documentation)
-for further informations on CMake.
+## Installation
-## Copyright notice
+Edit config.mk as needed, then run:
+
+ make clean install
+
+## Release notes
+
+### Version 0.1
+
+- Write the man page directly in mdoc's roff macros, instead of using
+ the scdoc markup language as a source for man pages.
+- Replace CMake by Makefile as build system.
+- Update compiler and linker flags to increase the security and
+ robustness of generated binaries.
+- Provide a pkg-config file to link the library as an external
+ dependency.
+
+## Copyrights
Copyright (C) 2022, 2023 Centre National de la Recherche Scientifique
+Copyright (C) 2022, 2023 Institut Pierre-Simon Laplace
Copyright (C) 2022, 2023 Institut de Physique du Globe de Paris
-Copyright (C) 2022, 2023 [|Méso|Star>](https://www.meso-star.com) (<contact@meso-star.com>)
+Copyright (C) 2022, 2023 [|Méso|Star>](https://www.meso-star.com) (contact@meso-star.com)
+Copyright (C) 2022, 2023 Observatoire de Paris
Copyright (C) 2022, 2023 Université de Reims Champagne-Ardenne
Copyright (C) 2022, 2023 Université de Versaille Saint-Quentin
-Copyright (C) 2022, 2023 Université Paul Sabatier (<contact@laplace.univ-tlse.fr>)
+Copyright (C) 2022, 2023 Université Paul Sabatier
## License
-Rad-Net String List is free software released under the GPL v3+ license: GNU GPL
-version 3 or later. You are welcome to redistribute it under certain
-conditions; refer to the COPYING file for details.
+Rad-Net String List is free software released under the GPL v3+ license:
+GNU GPL version 3 or later. You are welcome to redistribute it under
+certain conditions; refer to the COPYING file for details.
diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt
@@ -1,122 +0,0 @@
-# Copyright (C) 2022, 2023 Centre National de la Recherche Scientifique
-# Copyright (C) 2022, 2023 Institut de Physique du Globe de Paris
-# Copyright (C) 2022, 2023 |Méso|Star> (contact@meso-star.com)
-# Copyright (C) 2022, 2023 Université de Reims Champagne-Ardenne
-# Copyright (C) 2022, 2023 Université de Versaille Saint-Quentin
-# Copyright (C) 2022, 2023 Université Paul Sabatier (contact@laplace.univ-tlse.fr)
-#
-# 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/>.
-
-cmake_minimum_required(VERSION 3.1)
-project(rnsl C)
-enable_testing()
-
-set(RNSL_SOURCE_DIR ${PROJECT_SOURCE_DIR}/../src)
-option(NO_TEST "Do not build tests" OFF)
-
-################################################################################
-# Check dependencies
-################################################################################
-find_package(RCMake 0.4 REQUIRED)
-find_package(RSys 0.13 REQUIRED)
-
-set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${RCMAKE_SOURCE_DIR})
-include(rcmake)
-include(rcmake_runtime)
-
-include_directories(${RSys_INCLUDE_DIR})
-
-################################################################################
-# Configure and define targets
-################################################################################
-set(VERSION_MAJOR 0)
-set(VERSION_MINOR 0)
-set(VERSION_PATCH 0)
-set(VERSION ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH})
-
-set(RNSL_FILES_SRC
- rnsl.c
- rnsl_log.c)
-set(RNSL_FILES_INC
- rnsl_c.h
- rnsl_log.h)
-set(RNSL_FILES_INC_API
- rnsl.h)
-
-set(RNSL_FILES_DOC COPYING README.md)
-
-# Prepend each file in the `RNSL_FILES_<SRC|INC>' list by `RNSL_SOURCE_DIR'
-rcmake_prepend_path(RNSL_FILES_SRC ${RNSL_SOURCE_DIR})
-rcmake_prepend_path(RNSL_FILES_INC ${RNSL_SOURCE_DIR})
-rcmake_prepend_path(RNSL_FILES_INC_API ${RNSL_SOURCE_DIR})
-rcmake_prepend_path(RNSL_FILES_DOC ${PROJECT_SOURCE_DIR}/../)
-
-add_library(rnsl SHARED ${RNSL_FILES_SRC} ${RNSL_FILES_INC} ${RNSL_FILES_INC_API})
-target_link_libraries(rnsl RSys)
-
-if(CMAKE_COMPILER_IS_GNUCC)
- target_link_libraries(rnsl m)
-endif()
-
-set_target_properties(rnsl PROPERTIES
- DEFINE_SYMBOL RNSL_SHARED_BUILD
- VERSION ${VERSION}
- SOVERSION ${VERSION_MAJOR})
-
-rcmake_setup_devel(rnsl RNSL ${VERSION} rad-net/rnsl_version.h)
-
-################################################################################
-# Add tests
-################################################################################
-if(NOT NO_TEST)
- function(new_test _name)
- add_executable(${_name} ${RNSL_SOURCE_DIR}/${_name}.c)
- target_link_libraries(${_name} rnsl RSys ${ARGN})
- add_test(${_name} ${_name})
- endfunction()
-
- new_test(test_rnsl)
- new_test(test_rnsl_load)
-endif()
-
-################################################################################
-# Man page
-###############################################################################
-find_program(SCDOC NAMES scdoc)
-if(NOT SCDOC)
- message(WARNING
- "The `scdoc' program is missing. "
- "The Rad-Net File List man page cannot be generated.")
-else()
- set(_src ${PROJECT_SOURCE_DIR}/../doc/rnsl.5.scd)
- add_custom_command(
- OUTPUT rnsl.5
- COMMAND ${SCDOC} < ${_src} > rnsl.5
- DEPENDS ${_src}
- WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
- COMMENT "Buid ROFF man page rnsl.5"
- VERBATIM)
- add_custom_target(man-roff ALL DEPENDS rnsl.5)
- install(FILES ${CMAKE_CURRENT_BINARY_DIR}/rnsl.5 DESTINATION share/man/man5)
-endif()
-
-################################################################################
-# Define output & install directories
-################################################################################
-install(TARGETS rnsl
- ARCHIVE DESTINATION bin
- LIBRARY DESTINATION lib
- RUNTIME DESTINATION bin)
-install(FILES ${RNSL_FILES_INC_API} DESTINATION include/rad-net)
-install(FILES ${RNSL_FILES_DOC} DESTINATION share/doc/rnsl)
diff --git a/config.mk b/config.mk
@@ -0,0 +1,77 @@
+VERSION = 0.1.0
+PREFIX = /usr/local
+
+LIB_TYPE = SHARED
+#LIB_TYPE = STATIC
+
+BUILD_TYPE = RELEASE
+#BUILD_TYPE = DEBUG
+
+################################################################################
+# Tools
+################################################################################
+AR = ar
+CC = cc
+LD = ld
+OBJCOPY = objcopy
+PKG_CONFIG = pkg-config
+RANLIB = ranlib
+
+################################################################################
+# Dependencies
+################################################################################
+PCFLAGS_SHARED =
+PCFLAGS_STATIC = --static
+PCFLAGS = $(PCFLAGS_$(LIB_TYPE))
+
+RSYS_VERSION = 0.14
+RSYS_CFLAGS = $$($(PKG_CONFIG) $(PCFLAGS) --cflags rsys)
+RSYS_LIBS = $$($(PKG_CONFIG) $(PCFLAGS) --libs rsys)
+
+################################################################################
+# Compilation options
+################################################################################
+WFLAGS =\
+ -Wall\
+ -Wcast-align\
+ -Wconversion\
+ -Wextra\
+ -Wmissing-declarations\
+ -Wmissing-prototypes\
+ -Wshadow
+
+CFLAGS_HARDENED =\
+ -D_FORTIFY_SOURCES=2\
+ -fcf-protection=full\
+ -fstack-clash-protection\
+ -fstack-protector-strong
+
+CFLAGS_COMMON =\
+ -std=c89\
+ -pedantic\
+ -fvisibility=hidden\
+ -fstrict-aliasing\
+ $(CFLAGS_HARDENED)\
+ $(WFLAGS)
+
+CFLAGS_RELEASE = -O2 -DNDEBUG $(CFLAGS_COMMON)
+CFLAGS_DEBUG = -g $(CFLAGS_COMMON)
+CFLAGS = $(CFLAGS_$(BUILD_TYPE))
+
+CFLAGS_SO = $(CFLAGS) -fPIC
+CFLAGS_EXE = $(CFLAGS) -fPIE
+
+################################################################################
+# Linker options
+################################################################################
+LDFLAGS_HARDENED = -Wl,-z,relro,-z,now
+LDFLAGS_DEBUG = $(LDFLAGS_HARDENED)
+LDFLAGS_RELEASE = -s $(LDFLAGS_HARDENED)
+LDFLAGS = $(LDFLAGS_$(BUILD_TYPE))
+
+LDFLAGS_SO = $(LDFLAGS) -shared -Wl,--no-undefined
+LDFLAGS_EXE = $(LDFLAGS) -pie
+
+OCPFLAGS_DEBUG = --localize-hidden
+OCPFLAGS_RELEASE = --localize-hidden --strip-unneeded
+OCPFLAGS = $(OCPFLAGS_$(BUILD_TYPE))
diff --git a/doc/rnsl.5.scd b/doc/rnsl.5.scd
@@ -1,53 +0,0 @@
-rnsl(5)
-
-; Copyright (C) 2022, 2023 Centre National de la Recherche Scientifique
-; Copyright (C) 2022, 2023 Institut de Physique du Globe de Paris
-; Copyright (C) 2022, 2023 |Méso|Star> (contact@meso-star.com)
-; Copyright (C) 2022, 2023 Université de Reims Champagne-Ardenne
-; Copyright (C) 2022, 2023 Université de Versaille Saint-Quentin
-; Copyright (C) 2022, 2023 Université Paul Sabatier (contact@laplace.univ-tlse.fr)
-;
-; 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
-
-rnsl - Rad-Net String List file format
-
-# DESCRIPTION
-
-*rnsl* is a text file format that lists strings. Each string is expanded
-and therefore can be composed of variables (e.g. _"${MY_PATH}/file.txt"_)
-
-Characters behind the hash mark (#) are considered comments and are therefore
-ignored, as well as empty lines, i.e. lines without characters or composed
-only of spaces and tabs.
-
-# GRAMMAR
-
-```
-<rnsl> ::= <strings-count>
- STRING
- [ STRING ... ]
-
-<strings-count> ::= INTGER
-```
-
-# EXEMPLE
-
-```
-3
-string0
-"string 1"
-"${MY_VARIABLE}/string 2"
-```
diff --git a/make.sh b/make.sh
@@ -0,0 +1,77 @@
+#!/bin/sh
+
+# Copyright (C) 2022, 2023 Centre National de la Recherche Scientifique
+# Copyright (C) 2022, 2023 Institut Pierre-Simon Laplace
+# Copyright (C) 2022, 2023 Institut de Physique du Globe de Paris
+# Copyright (C) 2022, 2023 |Méso|Star> (contact@meso-star.com)
+# Copyright (C) 2022, 2023 Observatoire de Paris
+# Copyright (C) 2022, 2023 Université de Reims Champagne-Ardenne
+# Copyright (C) 2022, 2023 Université de Versaille Saint-Quentin
+# Copyright (C) 2022, 2023 Université Paul Sabatier
+#
+# 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/>.
+
+set -e
+
+config_test()
+{
+ for i in "$@"; do
+ test=$(basename "${i}" ".c")
+ test_list="${test_list} ${test}"
+ printf "%s: %s\n" "${test}" "src/${test}.o"
+ done
+ printf "test_bin: %s\n" "${test_list}"
+}
+
+run_test()
+{
+ for i in "$@"; do
+ test=$(basename "${i}" ".c")
+
+ printf "%s " "${test}"
+ if "./${test}" > /dev/null 2>&1; then
+ printf "\033[1;32mOK\033[m\n"
+ else
+ printf "\033[1;31mError\033[m\n"
+ fi
+ done 2> /dev/null
+}
+
+clean_test()
+{
+ for i in "$@"; do
+ rm -f "$(basename "${i}" ".c")"
+ done
+}
+
+install()
+{
+ prefix=$1
+ shift 1
+
+ mkdir -p "${prefix}"
+
+ for i in "$@"; do
+ dst="${prefix}/${i##*/}"
+
+ if cmp -s "${i}" "${dst}"; then
+ printf "Up to date %s\n" "${dst}"
+ else
+ printf "Installing %s\n" "${dst}"
+ cp "${i}" "${prefix}"
+ fi
+ done
+}
+
+"$@"
diff --git a/rnsl.5 b/rnsl.5
@@ -0,0 +1,58 @@
+.\" Copyright (C) 2022, 2023 Centre National de la Recherche Scientifique
+.\" Copyright (C) 2022, 2023 Institut Pierre-Simon Laplace
+.\" Copyright (C) 2022, 2023 Institut de Physique du Globe de Paris
+.\" Copyright (C) 2022, 2023 |Méso|Star> (contact@meso-star.com)
+.\" Copyright (C) 2022, 2023 Observatoire de Paris
+.\" Copyright (C) 2022, 2023 Université de Reims Champagne-Ardenne
+.\" Copyright (C) 2022, 2023 Université de Versaille Saint-Quentin
+.\" Copyright (C) 2022, 2023 Université Paul Sabatier
+.\"
+.\" 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/>.
+.Dd September 15, 2023
+.Dt RNSL 5
+.Os
+.Sh NAME
+.Nm rnsl
+.Nd Rad-Net String List file format
+.Sh DESCRIPTION
+.Nm
+is a text file format that lists strings.
+Each string is expanded and therefore can be composed of variables
+.Pq e.g. Pa ${MY_PATH}/file.txt .
+.Pp
+Characters behind the hash mark
+.Pq Li #
+are considered comments and are therefore ignored, as well as empty lines,
+i.e. lines without characters or composed only of spaces and tabs.
+.Pp
+The file format is as follows:
+.Bl -column (strings-count) (::=) ()
+.It Ao Va rnsl Ac Ta ::= Ta Ao Va strings-count Ac
+.It Ta Ta Va string
+.It Ta Ta Va ...
+.It Ao Va strings-count Ac Ta ::= Ta Va integer
+.El
+.Sh EXAMPLES
+.Bd -literal
+3
+string0
+"string 1"
+"${MY_VARIABLE}/string 2"
+.Ed
+.Sh HISTORY
+The
+.Nm
+format was first developed for the
+.Xr htrdr-planeto 1
+program.
diff --git a/rnsl.pc.in b/rnsl.pc.in
@@ -0,0 +1,10 @@
+prefix=@PREFIX@
+includedir=${prefix}/include
+libdir=${prefix}/lib
+
+Requires: rsys >= @RSYS_VERSION@
+Name: rnsl
+Description: Rad-Net String List
+Version: @VERSION@
+Libs: -L${libdir} -lrnsl
+CFlags: -I${includedir}
diff --git a/src/rnsl.c b/src/rnsl.c
@@ -1,9 +1,11 @@
/* Copyright (C) 2022, 2023 Centre National de la Recherche Scientifique
+ * Copyright (C) 2022, 2023 Institut Pierre-Simon Laplace
* Copyright (C) 2022, 2023 Institut de Physique du Globe de Paris
* Copyright (C) 2022, 2023 |Méso|Star> (contact@meso-star.com)
+ * Copyright (C) 2022, 2023 Observatoire de Paris
* Copyright (C) 2022, 2023 Université de Reims Champagne-Ardenne
* Copyright (C) 2022, 2023 Université de Versaille Saint-Quentin
- * Copyright (C) 2022, 2023 Université Paul Sabatier (contact@laplace.univ-tlse.fr)
+ * Copyright (C) 2022, 2023 Université Paul Sabatier
*
* 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
diff --git a/src/rnsl.h b/src/rnsl.h
@@ -1,9 +1,11 @@
/* Copyright (C) 2022, 2023 Centre National de la Recherche Scientifique
+ * Copyright (C) 2022, 2023 Institut Pierre-Simon Laplace
* Copyright (C) 2022, 2023 Institut de Physique du Globe de Paris
* Copyright (C) 2022, 2023 |Méso|Star> (contact@meso-star.com)
+ * Copyright (C) 2022, 2023 Observatoire de Paris
* Copyright (C) 2022, 2023 Université de Reims Champagne-Ardenne
* Copyright (C) 2022, 2023 Université de Versaille Saint-Quentin
- * Copyright (C) 2022, 2023 Université Paul Sabatier (contact@laplace.univ-tlse.fr)
+ * Copyright (C) 2022, 2023 Université Paul Sabatier
*
* 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
diff --git a/src/rnsl_c.h b/src/rnsl_c.h
@@ -1,9 +1,11 @@
/* Copyright (C) 2022, 2023 Centre National de la Recherche Scientifique
+ * Copyright (C) 2022, 2023 Institut Pierre-Simon Laplace
* Copyright (C) 2022, 2023 Institut de Physique du Globe de Paris
* Copyright (C) 2022, 2023 |Méso|Star> (contact@meso-star.com)
+ * Copyright (C) 2022, 2023 Observatoire de Paris
* Copyright (C) 2022, 2023 Université de Reims Champagne-Ardenne
* Copyright (C) 2022, 2023 Université de Versaille Saint-Quentin
- * Copyright (C) 2022, 2023 Université Paul Sabatier (contact@laplace.univ-tlse.fr)
+ * Copyright (C) 2022, 2023 Université Paul Sabatier
*
* 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
diff --git a/src/rnsl_log.c b/src/rnsl_log.c
@@ -1,9 +1,11 @@
/* Copyright (C) 2022, 2023 Centre National de la Recherche Scientifique
+ * Copyright (C) 2022, 2023 Institut Pierre-Simon Laplace
* Copyright (C) 2022, 2023 Institut de Physique du Globe de Paris
* Copyright (C) 2022, 2023 |Méso|Star> (contact@meso-star.com)
+ * Copyright (C) 2022, 2023 Observatoire de Paris
* Copyright (C) 2022, 2023 Université de Reims Champagne-Ardenne
* Copyright (C) 2022, 2023 Université de Versaille Saint-Quentin
- * Copyright (C) 2022, 2023 Université Paul Sabatier (contact@laplace.univ-tlse.fr)
+ * Copyright (C) 2022, 2023 Université Paul Sabatier
*
* 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
diff --git a/src/rnsl_log.h b/src/rnsl_log.h
@@ -1,9 +1,11 @@
/* Copyright (C) 2022, 2023 Centre National de la Recherche Scientifique
+ * Copyright (C) 2022, 2023 Institut Pierre-Simon Laplace
* Copyright (C) 2022, 2023 Institut de Physique du Globe de Paris
* Copyright (C) 2022, 2023 |Méso|Star> (contact@meso-star.com)
+ * Copyright (C) 2022, 2023 Observatoire de Paris
* Copyright (C) 2022, 2023 Université de Reims Champagne-Ardenne
* Copyright (C) 2022, 2023 Université de Versaille Saint-Quentin
- * Copyright (C) 2022, 2023 Université Paul Sabatier (contact@laplace.univ-tlse.fr)
+ * Copyright (C) 2022, 2023 Université Paul Sabatier
*
* 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
diff --git a/src/test_rnsl.c b/src/test_rnsl.c
@@ -1,9 +1,11 @@
/* Copyright (C) 2022, 2023 Centre National de la Recherche Scientifique
+ * Copyright (C) 2022, 2023 Institut Pierre-Simon Laplace
* Copyright (C) 2022, 2023 Institut de Physique du Globe de Paris
* Copyright (C) 2022, 2023 |Méso|Star> (contact@meso-star.com)
+ * Copyright (C) 2022, 2023 Observatoire de Paris
* Copyright (C) 2022, 2023 Université de Reims Champagne-Ardenne
* Copyright (C) 2022, 2023 Université de Versaille Saint-Quentin
- * Copyright (C) 2022, 2023 Université Paul Sabatier (contact@laplace.univ-tlse.fr)
+ * Copyright (C) 2022, 2023 Université Paul Sabatier
*
* 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
diff --git a/src/test_rnsl_load.c b/src/test_rnsl_load.c
@@ -1,9 +1,11 @@
/* Copyright (C) 2022, 2023 Centre National de la Recherche Scientifique
+ * Copyright (C) 2022, 2023 Institut Pierre-Simon Laplace
* Copyright (C) 2022, 2023 Institut de Physique du Globe de Paris
* Copyright (C) 2022, 2023 |Méso|Star> (contact@meso-star.com)
+ * Copyright (C) 2022, 2023 Observatoire de Paris
* Copyright (C) 2022, 2023 Université de Reims Champagne-Ardenne
* Copyright (C) 2022, 2023 Université de Versaille Saint-Quentin
- * Copyright (C) 2022, 2023 Université Paul Sabatier (contact@laplace.univ-tlse.fr)
+ * Copyright (C) 2022, 2023 Université Paul Sabatier
*
* 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