Skip to content

Commit 8647894

Browse files
committed
libselinux: hide regex_data_create()
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 <[email protected]>
1 parent b8530c6 commit 8647894

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

libselinux/src/regex.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,12 @@
2929

3030
#endif
3131

32+
/**
33+
* This constructor function allocates a buffer for a regex_data structure.
34+
* The buffer is being initialized with zeroes.
35+
*/
36+
static struct regex_data *regex_data_create(void);
37+
3238
#ifdef USE_PCRE2
3339
char const *regex_arch_string(void)
3440
{
@@ -283,7 +289,7 @@ int regex_cmp(const struct regex_data *regex1, const struct regex_data *regex2)
283289
return SELABEL_EQUAL;
284290
}
285291

286-
struct regex_data *regex_data_create(void)
292+
static struct regex_data *regex_data_create(void)
287293
{
288294
struct regex_data *regex_data =
289295
(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)
524530
return SELABEL_EQUAL;
525531
}
526532

527-
struct regex_data *regex_data_create(void)
533+
static struct regex_data *regex_data_create(void)
528534
{
529535
return (struct regex_data *)calloc(1, sizeof(struct regex_data));
530536
}

libselinux/src/regex.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,6 @@ char const *regex_arch_string(void) ;
5555
* It may return NULL on error.
5656
*/
5757
char const *regex_version(void) ;
58-
/**
59-
* This constructor function allocates a buffer for a regex_data structure.
60-
* The buffer is being initialized with zeroes.
61-
*/
62-
struct regex_data *regex_data_create(void) ;
6358
/**
6459
* This complementary destructor function frees the a given regex_data buffer.
6560
* It also frees any non NULL member pointers with the appropriate pcreX_X_free

0 commit comments

Comments
 (0)