Skip to content

Commit 2292f11

Browse files
committed
Move public symbols to a public header
Our header file src/common/util.h deifned both public and private symbols. If they are used in probes, they can be made private. Previously the probes used to be separated binaries, so all the functions used in probes had to be made public. However, this is no longer true, so these comments are not relevant anymore and they should be removed. On the other hand, if some of the functions is used in oscap utility, they need to be kept public. This commit moves the symbols that need to be kept public to a new header file src/common/oscap_helpers.h Moreover, the symbols that doesn't have to be public won't be public anymore.
1 parent 3c692c7 commit 2292f11

40 files changed

+115
-52
lines changed

src/CPE/cpe_session.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
#include "OVAL/public/oval_agent_api.h"
3535
#include "source/public/oscap_source.h"
3636
#include "source/oscap_source_priv.h"
37+
#include "oscap_helpers.h"
3738

3839
static inline bool cpe_session_add_default_cpe(struct cpe_session *session)
3940
{

src/CPE/cpename.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242

4343
#include "cpe_name.h"
4444
#include "common/util.h"
45+
#include "oscap_helpers.h"
4546

4647
#define CPE_URI_SUPPORTED "2.3"
4748

src/CVRF/cvrf_priv.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949

5050
#include "source/oscap_source_priv.h"
5151
#include "source/public/oscap_source.h"
52+
#include "oscap_helpers.h"
5253

5354

5455
/***************************************************************************

src/CVSS/cvss.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
#include "public/cvss_score.h"
4242
#include "cvss_priv.h"
4343
#include "common/elements.h"
44+
#include "oscap_helpers.h"
4445

4546
#define CVSS_SUPPORTED "2.0"
4647
#define NS_VULN_STR BAD_CAST "vuln"

src/DS/ds_common.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
#include "common/oscap_acquire.h"
3131
#include "source/oscap_source_priv.h"
3232
#include "source/public/oscap_source.h"
33+
#include "oscap_helpers.h"
3334

3435
#include <libxml/tree.h>
3536

src/DS/ds_sds_session.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
#include "source/public/oscap_source.h"
4242
#include "source/xslt_priv.h"
4343
#include <libxml/tree.h>
44+
#include "oscap_helpers.h"
4445

4546
struct ds_sds_session {
4647
struct oscap_source *source; ///< Source DataStream raw representation

src/DS/rds.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@
4848
#include <libxml/tree.h>
4949
#include <libxml/xpath.h>
5050
#include <libxml/xpathInternals.h>
51+
#include "oscap_helpers.h"
5152

5253
static const char* arf_ns_uri = "http://scap.nist.gov/schema/asset-reporting-format/1.1";
5354
static const char* core_ns_uri = "http://scap.nist.gov/schema/reporting-core/1.1";

src/DS/sds.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
#include "common/oscap_acquire.h"
4343
#include "source/oscap_source_priv.h"
4444
#include "source/public/oscap_source.h"
45+
#include "oscap_helpers.h"
4546

4647
#include <sys/stat.h>
4748
#include <time.h>

src/OVAL/probes/independent/system_info_probe.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@
8383
#include <errno.h>
8484
#include <limits.h>
8585
#include "system_info_probe.h"
86+
#include "oscap_helpers.h"
8687

8788
#if defined(OS_LINUX)
8889
#include <sys/socket.h>

src/OVAL/probes/probe-api.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@
5353
#include "probe/entcmp.h"
5454
#include "probe/probe.h"
5555
#include "SEAP/generic/strto.h"
56+
#include "oscap_helpers.h"
5657

5758
extern probe_rcache_t *OSCAP_GSYM(pcache);
5859
extern probe_ncache_t *OSCAP_GSYM(ncache);

0 commit comments

Comments
 (0)