Commit 62813daf authored by Nikias Bassen's avatar Nikias Bassen

Avoid exporting non-public symbols

parent eab599c1
...@@ -102,9 +102,14 @@ fi ...@@ -102,9 +102,14 @@ fi
AM_CONDITIONAL([HAVE_CYTHON],[test "x$CYTHON_SUB" = "xcython"]) AM_CONDITIONAL([HAVE_CYTHON],[test "x$CYTHON_SUB" = "xcython"])
AC_SUBST([CYTHON_SUB]) AC_SUBST([CYTHON_SUB])
AS_COMPILER_FLAGS(GLOBAL_CFLAGS, "-Wall -Wextra -Wmissing-declarations -Wredundant-decls -Wshadow -Wpointer-arith -Wwrite-strings -Wswitch-default -Wno-unused-parameter") AS_COMPILER_FLAGS(GLOBAL_CFLAGS, "-Wall -Wextra -Wmissing-declarations -Wredundant-decls -Wshadow -Wpointer-arith -Wwrite-strings -Wswitch-default -Wno-unused-parameter -fvisibility=hidden")
AC_SUBST(GLOBAL_CFLAGS) AC_SUBST(GLOBAL_CFLAGS)
case "$GLOBAL_CFLAGS" in
*-fvisibility=hidden*)
AC_DEFINE([HAVE_FVISIBILITY], [1], [Define if compiled with -fvisibility=hidden])
esac
m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])]) m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
AC_OUTPUT([ AC_OUTPUT([
......
This diff is collapsed.
...@@ -21,9 +21,8 @@ ...@@ -21,9 +21,8 @@
#ifndef BASE64_H #ifndef BASE64_H
#define BASE64_H #define BASE64_H
#include <stdlib.h> #include <stdlib.h>
#include "common.h"
_PLIST_INTERNAL char *base64encode(const unsigned char *buf, size_t *size); char *base64encode(const unsigned char *buf, size_t *size);
_PLIST_INTERNAL unsigned char *base64decode(const char *buf, size_t *size); unsigned char *base64decode(const char *buf, size_t *size);
#endif #endif
...@@ -599,7 +599,7 @@ static void* copy_plist_data(const void* src) ...@@ -599,7 +599,7 @@ static void* copy_plist_data(const void* src)
return dstdata; return dstdata;
} }
void plist_from_bin(const char *plist_bin, uint32_t length, plist_t * plist) PLIST_API void plist_from_bin(const char *plist_bin, uint32_t length, plist_t * plist)
{ {
char *trailer = NULL; char *trailer = NULL;
...@@ -1095,7 +1095,7 @@ static uint16_t *plist_utf8_to_utf16(char *unistr, long size, long *items_read, ...@@ -1095,7 +1095,7 @@ static uint16_t *plist_utf8_to_utf16(char *unistr, long size, long *items_read,
} }
void plist_to_bin(plist_t plist, char **plist_bin, uint32_t * length) PLIST_API void plist_to_bin(plist_t plist, char **plist_bin, uint32_t * length)
{ {
ptrarray_t* objects = NULL; ptrarray_t* objects = NULL;
hashtable_t* ref_table = NULL; hashtable_t* ref_table = NULL;
......
...@@ -21,7 +21,6 @@ ...@@ -21,7 +21,6 @@
#ifndef BYTEARRAY_H #ifndef BYTEARRAY_H
#define BYTEARRAY_H #define BYTEARRAY_H
#include <stdlib.h> #include <stdlib.h>
#include "common.h"
typedef struct bytearray_t { typedef struct bytearray_t {
void *data; void *data;
...@@ -29,8 +28,8 @@ typedef struct bytearray_t { ...@@ -29,8 +28,8 @@ typedef struct bytearray_t {
size_t capacity; size_t capacity;
} bytearray_t; } bytearray_t;
_PLIST_INTERNAL bytearray_t *byte_array_new(); bytearray_t *byte_array_new();
_PLIST_INTERNAL void byte_array_free(bytearray_t *ba); void byte_array_free(bytearray_t *ba);
_PLIST_INTERNAL void byte_array_append(bytearray_t *ba, void *buf, size_t len); void byte_array_append(bytearray_t *ba, void *buf, size_t len);
#endif #endif
...@@ -17,12 +17,4 @@ ...@@ -17,12 +17,4 @@
#endif #endif
#endif #endif
#if defined(__GNUC__) && (__GNUC__ >= 4) && !defined(__CYGWIN__) && !defined(WIN32)
# define _PLIST_INTERNAL __attribute__((visibility("hidden")))
#elif defined(__SUNPRO_C) && (__SUNPRO_C >= 0x550)
# define _PLIST_INTERNAL __hidden
#else /* not gcc >= 4 and not Sun Studio >= 8 */
# define _PLIST_INTERNAL
#endif /* GNUC >= 4 */
#endif #endif
...@@ -21,7 +21,6 @@ ...@@ -21,7 +21,6 @@
#ifndef HASHTABLE_H #ifndef HASHTABLE_H
#define HASHTABLE_H #define HASHTABLE_H
#include <stdlib.h> #include <stdlib.h>
#include "common.h"
typedef struct hashentry_t { typedef struct hashentry_t {
void *key; void *key;
...@@ -39,10 +38,10 @@ typedef struct hashtable_t { ...@@ -39,10 +38,10 @@ typedef struct hashtable_t {
compare_func_t compare_func; compare_func_t compare_func;
} hashtable_t; } hashtable_t;
_PLIST_INTERNAL hashtable_t* hash_table_new(hash_func_t hash_func, compare_func_t compare_func); hashtable_t* hash_table_new(hash_func_t hash_func, compare_func_t compare_func);
_PLIST_INTERNAL void hash_table_destroy(hashtable_t *ht); void hash_table_destroy(hashtable_t *ht);
_PLIST_INTERNAL void hash_table_insert(hashtable_t* ht, void *key, void *value); void hash_table_insert(hashtable_t* ht, void *key, void *value);
_PLIST_INTERNAL void* hash_table_lookup(hashtable_t* ht, void *key); void* hash_table_lookup(hashtable_t* ht, void *key);
#endif #endif
This diff is collapsed.
...@@ -22,8 +22,11 @@ ...@@ -22,8 +22,11 @@
#ifndef PLIST_H #ifndef PLIST_H
#define PLIST_H #define PLIST_H
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include "plist/plist.h" #include "plist/plist.h"
#include "common.h"
#include <sys/types.h> #include <sys/types.h>
#include <sys/stat.h> #include <sys/stat.h>
...@@ -34,6 +37,15 @@ ...@@ -34,6 +37,15 @@
#pragma warning(disable:4244) #pragma warning(disable:4244)
#endif #endif
#ifdef WIN32
#define PLIST_API __declspec( dllexport )
#else
#ifdef HAVE_FVISIBILITY
#define PLIST_API __attribute__((visibility("default")))
#else
#define PLIST_API
#endif
#endif
struct plist_data_s struct plist_data_s
{ {
...@@ -52,10 +64,10 @@ struct plist_data_s ...@@ -52,10 +64,10 @@ struct plist_data_s
typedef struct plist_data_s *plist_data_t; typedef struct plist_data_s *plist_data_t;
_PLIST_INTERNAL plist_t plist_new_node(plist_data_t data); plist_t plist_new_node(plist_data_t data);
_PLIST_INTERNAL plist_data_t plist_get_data(const plist_t node); plist_data_t plist_get_data(const plist_t node);
_PLIST_INTERNAL plist_data_t plist_new_plist_data(void); plist_data_t plist_new_plist_data(void);
_PLIST_INTERNAL int plist_data_compare(const void *a, const void *b); int plist_data_compare(const void *a, const void *b);
#endif #endif
...@@ -21,7 +21,6 @@ ...@@ -21,7 +21,6 @@
#ifndef PTRARRAY_H #ifndef PTRARRAY_H
#define PTRARRAY_H #define PTRARRAY_H
#include <stdlib.h> #include <stdlib.h>
#include "common.h"
typedef struct ptrarray_t { typedef struct ptrarray_t {
void **pdata; void **pdata;
...@@ -30,8 +29,8 @@ typedef struct ptrarray_t { ...@@ -30,8 +29,8 @@ typedef struct ptrarray_t {
size_t capacity_step; size_t capacity_step;
} ptrarray_t; } ptrarray_t;
_PLIST_INTERNAL ptrarray_t *ptr_array_new(int capacity); ptrarray_t *ptr_array_new(int capacity);
_PLIST_INTERNAL void ptr_array_free(ptrarray_t *pa); void ptr_array_free(ptrarray_t *pa);
_PLIST_INTERNAL void ptr_array_add(ptrarray_t *pa, void *data); void ptr_array_add(ptrarray_t *pa, void *data);
_PLIST_INTERNAL void* ptr_array_index(ptrarray_t *pa, size_t index); void* ptr_array_index(ptrarray_t *pa, size_t index);
#endif #endif
...@@ -513,7 +513,7 @@ static void xml_to_node(xmlNodePtr xml_node, plist_t * plist_node) ...@@ -513,7 +513,7 @@ static void xml_to_node(xmlNodePtr xml_node, plist_t * plist_node)
} }
} }
void plist_to_xml(plist_t plist, char **plist_xml, uint32_t * length) PLIST_API void plist_to_xml(plist_t plist, char **plist_xml, uint32_t * length)
{ {
xmlDocPtr plist_doc = NULL; xmlDocPtr plist_doc = NULL;
xmlNodePtr root_node = NULL; xmlNodePtr root_node = NULL;
...@@ -555,7 +555,7 @@ void plist_to_xml(plist_t plist, char **plist_xml, uint32_t * length) ...@@ -555,7 +555,7 @@ void plist_to_xml(plist_t plist, char **plist_xml, uint32_t * length)
} }
} }
void plist_from_xml(const char *plist_xml, uint32_t length, plist_t * plist) PLIST_API void plist_from_xml(const char *plist_xml, uint32_t length, plist_t * plist)
{ {
xmlDocPtr plist_doc = xmlParseMemory(plist_xml, length); xmlDocPtr plist_doc = xmlParseMemory(plist_xml, length);
xmlNodePtr root_node = xmlDocGetRootElement(plist_doc); xmlNodePtr root_node = xmlDocGetRootElement(plist_doc);
......
...@@ -4,7 +4,7 @@ AM_LDFLAGS = ...@@ -4,7 +4,7 @@ AM_LDFLAGS =
noinst_PROGRAMS = plist_cmp plist_test noinst_PROGRAMS = plist_cmp plist_test
plist_cmp_SOURCES = plist_cmp.c plist_cmp_SOURCES = plist_cmp.c
plist_cmp_LDADD = $(top_builddir)/src/libplist.la plist_cmp_LDADD = $(top_builddir)/src/libplist.la $(top_builddir)/libcnary/libcnary.la
plist_test_SOURCES = plist_test.c plist_test_SOURCES = plist_test.c
plist_test_LDADD = $(top_builddir)/src/libplist.la plist_test_LDADD = $(top_builddir)/src/libplist.la
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment