From c785133269067fa6f5f70bffe15f87a495ab1e53 Mon Sep 17 00:00:00 2001 From: Johannes Markert Date: Tue, 10 Oct 2023 10:28:29 +0200 Subject: [PATCH] Adding package id getter function. --- doc/author_markert.txt | 1 + src/p4est_base.c | 6 ++++++ src/p4est_base.h | 6 ++++++ 3 files changed, 13 insertions(+) create mode 100644 doc/author_markert.txt diff --git a/doc/author_markert.txt b/doc/author_markert.txt new file mode 100644 index 000000000..4963b3f63 --- /dev/null +++ b/doc/author_markert.txt @@ -0,0 +1 @@ +I place my contributions to p4est under the FreeBSD license. Johannes Markert (johannes.markert@dlr.de) diff --git a/src/p4est_base.c b/src/p4est_base.c index c56d82491..76730474b 100644 --- a/src/p4est_base.c +++ b/src/p4est_base.c @@ -56,6 +56,12 @@ p4est_is_initialized (void) return p4est_initialized; } +int +p4est_get_package_id (void) +{ + return p4est_package_id; +} + #ifndef __cplusplus #undef P4EST_GLOBAL_LOGF #undef P4EST_LOGF diff --git a/src/p4est_base.h b/src/p4est_base.h index e846c59c9..724ae5d06 100644 --- a/src/p4est_base.h +++ b/src/p4est_base.h @@ -358,6 +358,12 @@ void p4est_init (sc_log_handler_t log_handler, */ int p4est_is_initialized (void); +/** Query the package identity as registered in libsc. + * \return This is -1 before \ref p4est_init has been called + * and a proper package identifier (>= 0) afterwards. + */ +int p4est_get_package_id (void); + /** Compute hash value for two p4est_topidx_t integers. * \param [in] tt Array of (at least) two values. * \return An unsigned hash value.