Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
L
libplist
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
pwn
libplist
Commits
62813daf
Commit
62813daf
authored
Oct 03, 2014
by
Nikias Bassen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Avoid exporting non-public symbols
parent
eab599c1
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
141 additions
and
143 deletions
+141
-143
configure.ac
configure.ac
+6
-1
plist.h
include/plist/plist.h
+52
-59
base64.h
src/base64.h
+2
-3
bplist.c
src/bplist.c
+2
-2
bytearray.h
src/bytearray.h
+3
-4
common.h
src/common.h
+0
-8
hashtable.h
src/hashtable.h
+4
-5
plist.c
src/plist.c
+48
-48
plist.h
src/plist.h
+17
-5
ptrarray.h
src/ptrarray.h
+4
-5
xplist.c
src/xplist.c
+2
-2
Makefile.am
test/Makefile.am
+1
-1
No files found.
configure.ac
View file @
62813daf
...
...
@@ -102,9 +102,14 @@ fi
AM_CONDITIONAL([HAVE_CYTHON],[test "x$CYTHON_SUB" = "xcython"])
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)
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])])
AC_OUTPUT([
...
...
include/plist/plist.h
View file @
62813daf
This diff is collapsed.
Click to expand it.
src/base64.h
View file @
62813daf
...
...
@@ -21,9 +21,8 @@
#ifndef BASE64_H
#define BASE64_H
#include <stdlib.h>
#include "common.h"
_PLIST_INTERNAL
char
*
base64encode
(
const
unsigned
char
*
buf
,
size_t
*
size
);
_PLIST_INTERNAL
unsigned
char
*
base64decode
(
const
char
*
buf
,
size_t
*
size
);
char
*
base64encode
(
const
unsigned
char
*
buf
,
size_t
*
size
);
unsigned
char
*
base64decode
(
const
char
*
buf
,
size_t
*
size
);
#endif
src/bplist.c
View file @
62813daf
...
...
@@ -599,7 +599,7 @@ static void* copy_plist_data(const void* src)
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
;
...
...
@@ -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
;
hashtable_t
*
ref_table
=
NULL
;
...
...
src/bytearray.h
View file @
62813daf
...
...
@@ -21,7 +21,6 @@
#ifndef BYTEARRAY_H
#define BYTEARRAY_H
#include <stdlib.h>
#include "common.h"
typedef
struct
bytearray_t
{
void
*
data
;
...
...
@@ -29,8 +28,8 @@ typedef struct bytearray_t {
size_t
capacity
;
}
bytearray_t
;
_PLIST_INTERNAL
bytearray_t
*
byte_array_new
();
_PLIST_INTERNAL
void
byte_array_free
(
bytearray_t
*
ba
);
_PLIST_INTERNAL
void
byte_array_append
(
bytearray_t
*
ba
,
void
*
buf
,
size_t
len
);
bytearray_t
*
byte_array_new
();
void
byte_array_free
(
bytearray_t
*
ba
);
void
byte_array_append
(
bytearray_t
*
ba
,
void
*
buf
,
size_t
len
);
#endif
src/common.h
View file @
62813daf
...
...
@@ -17,12 +17,4 @@
#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
src/hashtable.h
View file @
62813daf
...
...
@@ -21,7 +21,6 @@
#ifndef HASHTABLE_H
#define HASHTABLE_H
#include <stdlib.h>
#include "common.h"
typedef
struct
hashentry_t
{
void
*
key
;
...
...
@@ -39,10 +38,10 @@ typedef struct hashtable_t {
compare_func_t
compare_func
;
}
hashtable_t
;
_PLIST_INTERNAL
hashtable_t
*
hash_table_new
(
hash_func_t
hash_func
,
compare_func_t
compare_func
);
_PLIST_INTERNAL
void
hash_table_destroy
(
hashtable_t
*
ht
);
hashtable_t
*
hash_table_new
(
hash_func_t
hash_func
,
compare_func_t
compare_func
);
void
hash_table_destroy
(
hashtable_t
*
ht
);
_PLIST_INTERNAL
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_insert
(
hashtable_t
*
ht
,
void
*
key
,
void
*
value
);
void
*
hash_table_lookup
(
hashtable_t
*
ht
,
void
*
key
);
#endif
src/plist.c
View file @
62813daf
This diff is collapsed.
Click to expand it.
src/plist.h
View file @
62813daf
...
...
@@ -22,8 +22,11 @@
#ifndef PLIST_H
#define PLIST_H
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include "plist/plist.h"
#include "common.h"
#include <sys/types.h>
#include <sys/stat.h>
...
...
@@ -34,6 +37,15 @@
#pragma warning(disable:4244)
#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
{
...
...
@@ -52,10 +64,10 @@ struct plist_data_s
typedef
struct
plist_data_s
*
plist_data_t
;
_PLIST_INTERNAL
plist_t
plist_new_node
(
plist_data_t
data
);
_PLIST_INTERNAL
plist_data_t
plist_get_data
(
const
plist_t
node
);
_PLIST_INTERNAL
plist_data_t
plist_new_plist_data
(
void
);
_PLIST_INTERNAL
int
plist_data_compare
(
const
void
*
a
,
const
void
*
b
);
plist_t
plist_new_node
(
plist_data_t
data
);
plist_data_t
plist_get_data
(
const
plist_t
node
);
plist_data_t
plist_new_plist_data
(
void
);
int
plist_data_compare
(
const
void
*
a
,
const
void
*
b
);
#endif
src/ptrarray.h
View file @
62813daf
...
...
@@ -21,7 +21,6 @@
#ifndef PTRARRAY_H
#define PTRARRAY_H
#include <stdlib.h>
#include "common.h"
typedef
struct
ptrarray_t
{
void
**
pdata
;
...
...
@@ -30,8 +29,8 @@ typedef struct ptrarray_t {
size_t
capacity_step
;
}
ptrarray_t
;
_PLIST_INTERNAL
ptrarray_t
*
ptr_array_new
(
int
capacity
);
_PLIST_INTERNAL
void
ptr_array_free
(
ptrarray_t
*
pa
);
_PLIST_INTERNAL
void
ptr_array_add
(
ptrarray_t
*
pa
,
void
*
data
);
_PLIST_INTERNAL
void
*
ptr_array_index
(
ptrarray_t
*
pa
,
size_t
index
);
ptrarray_t
*
ptr_array_new
(
int
capacity
);
void
ptr_array_free
(
ptrarray_t
*
pa
);
void
ptr_array_add
(
ptrarray_t
*
pa
,
void
*
data
);
void
*
ptr_array_index
(
ptrarray_t
*
pa
,
size_t
index
);
#endif
src/xplist.c
View file @
62813daf
...
...
@@ -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
;
xmlNodePtr
root_node
=
NULL
;
...
...
@@ -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
);
xmlNodePtr
root_node
=
xmlDocGetRootElement
(
plist_doc
);
...
...
test/Makefile.am
View file @
62813daf
...
...
@@ -4,7 +4,7 @@ AM_LDFLAGS =
noinst_PROGRAMS
=
plist_cmp plist_test
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_LDADD
=
$(top_builddir)
/src/libplist.la
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment