From 8647894beeac974b84d54469435378b729b8e315 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20G=C3=B6ttsche?= Date: Thu, 4 Apr 2024 17:59:48 +0200 Subject: [PATCH] libselinux: hide regex_data_create() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The function regex_data_create() is only used inside of regex.c, thus do not expose it in the header file regex.h. Signed-off-by: Christian Göttsche --- libselinux/src/regex.c | 10 ++++++++-- libselinux/src/regex.h | 5 ----- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/libselinux/src/regex.c b/libselinux/src/regex.c index 56694d1ee..69d40044c 100644 --- a/libselinux/src/regex.c +++ b/libselinux/src/regex.c @@ -29,6 +29,12 @@ #endif +/** + * This constructor function allocates a buffer for a regex_data structure. + * The buffer is being initialized with zeroes. + */ +static struct regex_data *regex_data_create(void); + #ifdef USE_PCRE2 char const *regex_arch_string(void) { @@ -283,7 +289,7 @@ int regex_cmp(const struct regex_data *regex1, const struct regex_data *regex2) return SELABEL_EQUAL; } -struct regex_data *regex_data_create(void) +static struct regex_data *regex_data_create(void) { struct regex_data *regex_data = (struct regex_data *)calloc(1, sizeof(struct regex_data)); @@ -524,7 +530,7 @@ int regex_cmp(const struct regex_data *regex1, const struct regex_data *regex2) return SELABEL_EQUAL; } -struct regex_data *regex_data_create(void) +static struct regex_data *regex_data_create(void) { return (struct regex_data *)calloc(1, sizeof(struct regex_data)); } diff --git a/libselinux/src/regex.h b/libselinux/src/regex.h index d449b1e70..0bff344de 100644 --- a/libselinux/src/regex.h +++ b/libselinux/src/regex.h @@ -55,11 +55,6 @@ char const *regex_arch_string(void) ; * It may return NULL on error. */ char const *regex_version(void) ; -/** - * This constructor function allocates a buffer for a regex_data structure. - * The buffer is being initialized with zeroes. - */ -struct regex_data *regex_data_create(void) ; /** * This complementary destructor function frees the a given regex_data buffer. * It also frees any non NULL member pointers with the appropriate pcreX_X_free