Skip to content

Commit

Permalink
libselinux: hide regex_data_create()
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
cgzones committed Apr 4, 2024
1 parent b8530c6 commit 8647894
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
10 changes: 8 additions & 2 deletions libselinux/src/regex.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down Expand Up @@ -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));
Expand Down Expand Up @@ -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));
}
Expand Down
5 changes: 0 additions & 5 deletions libselinux/src/regex.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 8647894

Please sign in to comment.