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
1bc33397
Commit
1bc33397
authored
Oct 28, 2009
by
Jonathan Beck
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix build for MSVC9.
parent
a129688a
Hide whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
44 additions
and
10 deletions
+44
-10
Date.h
include/plist/Date.h
+4
-0
plutil.c
plutil/plutil.c
+5
-0
Array.cpp
src/Array.cpp
+3
-2
Boolean.cpp
src/Boolean.cpp
+2
-1
Data.cpp
src/Data.cpp
+1
-0
Date.cpp
src/Date.cpp
+1
-0
Dictionary.cpp
src/Dictionary.cpp
+1
-0
Integer.cpp
src/Integer.cpp
+1
-0
Node.cpp
src/Node.cpp
+2
-1
Real.cpp
src/Real.cpp
+1
-0
String.cpp
src/String.cpp
+1
-0
bplist.c
src/bplist.c
+1
-1
plist.c
src/plist.c
+7
-4
plist.h
src/plist.h
+5
-0
plist_cmp.c
test/plist_cmp.c
+4
-0
plist_test.c
test/plist_test.c
+5
-1
No files found.
include/plist/Date.h
View file @
1bc33397
...
...
@@ -25,6 +25,10 @@
#include <plist/Node.h>
#include <ctime>
#ifdef _MSC_VER
#include <Winsock2.h>
#endif
namespace
PList
{
...
...
plutil/plutil.c
View file @
1bc33397
...
...
@@ -28,6 +28,11 @@
#include <string.h>
#include <sys/stat.h>
#ifdef _MSC_VER
#pragma warning(disable:4996)
#endif
int
main
(
int
argc
,
char
*
argv
[])
{
FILE
*
iplist
=
NULL
;
...
...
src/Array.cpp
View file @
1bc33397
...
...
@@ -58,7 +58,7 @@ Array::Array(PList::Array& a) : Structure()
Array
&
Array
::
operator
=
(
PList
::
Array
&
a
)
{
plist_free
(
_node
);
for
(
int
it
=
0
;
it
<
_array
.
size
();
it
++
)
for
(
unsigned
int
it
=
0
;
it
<
_array
.
size
();
it
++
)
{
delete
_array
.
at
(
it
);
}
...
...
@@ -72,11 +72,12 @@ Array& Array::operator=(PList::Array& a)
plist_t
subnode
=
plist_array_get_item
(
_node
,
i
);
_array
.
push_back
(
Utils
::
FromPlist
(
subnode
,
this
)
);
}
return
*
this
;
}
Array
::~
Array
()
{
for
(
int
it
=
0
;
it
<
_array
.
size
();
it
++
)
for
(
unsigned
int
it
=
0
;
it
<
_array
.
size
();
it
++
)
{
delete
(
_array
.
at
(
it
));
}
...
...
src/Boolean.cpp
View file @
1bc33397
...
...
@@ -41,6 +41,7 @@ Boolean& Boolean::operator=(PList::Boolean& b)
{
plist_free
(
_node
);
_node
=
plist_copy
(
b
.
GetPlist
());
return
*
this
;
}
Boolean
::
Boolean
(
bool
b
)
:
Node
(
PLIST_BOOLEAN
)
...
...
@@ -66,7 +67,7 @@ bool Boolean::GetValue()
{
uint8_t
b
=
0
;
plist_get_bool_val
(
_node
,
&
b
);
return
b
;
return
b
!=
0
;
}
};
src/Data.cpp
View file @
1bc33397
...
...
@@ -42,6 +42,7 @@ Data& Data::operator=(PList::Data& b)
{
plist_free
(
_node
);
_node
=
plist_copy
(
b
.
GetPlist
());
return
*
this
;
}
Data
::
Data
(
const
std
::
vector
<
char
>&
buff
)
:
Node
(
PLIST_DATA
)
...
...
src/Date.cpp
View file @
1bc33397
...
...
@@ -42,6 +42,7 @@ Date& Date::operator=(PList::Date& d)
{
plist_free
(
_node
);
_node
=
plist_copy
(
d
.
GetPlist
());
return
*
this
;
}
Date
::
Date
(
timeval
t
)
:
Node
(
PLIST_DATE
)
...
...
src/Dictionary.cpp
View file @
1bc33397
...
...
@@ -104,6 +104,7 @@ Dictionary& Dictionary::operator=(PList::Dictionary& d)
plist_dict_next_item
(
_node
,
it
,
NULL
,
&
subnode
);
}
free
(
it
);
return
*
this
;
}
Dictionary
::~
Dictionary
()
...
...
src/Integer.cpp
View file @
1bc33397
...
...
@@ -41,6 +41,7 @@ Integer& Integer::operator=(PList::Integer& i)
{
plist_free
(
_node
);
_node
=
plist_copy
(
i
.
GetPlist
());
return
*
this
;
}
Integer
::
Integer
(
uint64_t
i
)
:
Node
(
PLIST_UINT
)
...
...
src/Node.cpp
View file @
1bc33397
...
...
@@ -79,8 +79,9 @@ plist_type Node::GetType()
{
if
(
_node
)
{
return
plist_get_node_type
(
_node
);
return
plist_get_node_type
(
_node
);
}
return
PLIST_NONE
;
}
plist_t
Node
::
GetPlist
()
...
...
src/Real.cpp
View file @
1bc33397
...
...
@@ -41,6 +41,7 @@ Real& Real::operator=(PList::Real& d)
{
plist_free
(
_node
);
_node
=
plist_copy
(
d
.
GetPlist
());
return
*
this
;
}
Real
::
Real
(
double
d
)
:
Node
(
PLIST_REAL
)
...
...
src/String.cpp
View file @
1bc33397
...
...
@@ -41,6 +41,7 @@ String& String::operator=(PList::String& s)
{
plist_free
(
_node
);
_node
=
plist_copy
(
s
.
GetPlist
());
return
*
this
;
}
String
::
String
(
const
std
::
string
&
s
)
:
Node
(
PLIST_STRING
)
...
...
src/bplist.c
View file @
1bc33397
...
...
@@ -24,7 +24,7 @@
#include <stdio.h>
#include <string.h>
#include <libxml/
tree
.h>
#include <libxml/
encoding
.h>
#include <plist/plist.h>
#include "plist.h"
...
...
src/plist.c
View file @
1bc33397
...
...
@@ -64,8 +64,9 @@ static void plist_free_data(plist_data_t data)
static
void
plist_free_node
(
GNode
*
node
,
gpointer
none
)
{
plist_data_t
data
=
NULL
;
g_node_unlink
(
node
);
plist_data_t
data
=
plist_get_data
(
node
);
data
=
plist_get_data
(
node
);
plist_free_data
(
data
);
node
->
data
=
NULL
;
g_node_children_foreach
(
node
,
G_TRAVERSE_ALL
,
plist_free_node
,
NULL
);
...
...
@@ -161,6 +162,7 @@ void plist_free(plist_t plist)
static
void
plist_copy_node
(
GNode
*
node
,
gpointer
parent_node_ptr
)
{
plist_type
node_type
=
PLIST_NONE
;
plist_t
newnode
=
NULL
;
plist_data_t
data
=
plist_get_data
(
node
);
plist_data_t
newdata
=
plist_new_plist_data
();
...
...
@@ -169,7 +171,7 @@ static void plist_copy_node(GNode * node, gpointer parent_node_ptr)
memcpy
(
newdata
,
data
,
sizeof
(
struct
plist_data_s
));
plist_type
node_type
=
plist_get_node_type
(
node
);
node_type
=
plist_get_node_type
(
node
);
if
(
node_type
==
PLIST_DATA
||
node_type
==
PLIST_STRING
||
node_type
==
PLIST_KEY
)
{
switch
(
node_type
)
{
case
PLIST_DATA
:
...
...
@@ -225,6 +227,7 @@ uint32_t plist_array_get_item_index(plist_t node)
if
(
PLIST_ARRAY
==
plist_get_node_type
(
father
))
{
return
g_node_child_position
(
father
,
node
);
}
return
0
;
}
void
plist_array_set_item
(
plist_t
node
,
plist_t
item
,
uint32_t
n
)
...
...
@@ -330,8 +333,8 @@ plist_t plist_dict_get_item(plist_t node, const char* key)
current
;
current
=
(
plist_t
)
g_node_next_sibling
(
g_node_next_sibling
(
current
)))
{
assert
(
PLIST_KEY
==
plist_get_node_type
(
current
)
);
plist_data_t
data
=
plist_get_data
(
current
);
assert
(
PLIST_KEY
==
plist_get_node_type
(
current
)
);
if
(
data
&&
!
strcmp
(
key
,
data
->
strval
))
{
ret
=
(
plist_t
)
g_node_next_sibling
(
current
);
...
...
@@ -623,7 +626,7 @@ char plist_compare_node_value(plist_t node_l, plist_t node_r)
return
plist_data_compare
(
node_l
,
node_r
);
}
static
plist_t
plist_set_element_val
(
plist_t
node
,
plist_type
type
,
const
void
*
value
,
uint64_t
length
)
static
void
plist_set_element_val
(
plist_t
node
,
plist_type
type
,
const
void
*
value
,
uint64_t
length
)
{
//free previous allocated buffer
plist_data_t
data
=
plist_get_data
(
node
);
...
...
src/plist.h
View file @
1bc33397
...
...
@@ -29,6 +29,11 @@
#include <sys/stat.h>
#include <glib.h>
#ifdef _MSC_VER
#pragma warning(disable:4996)
#pragma warning(disable:4244)
#endif
struct
plist_data_s
{
union
{
...
...
test/plist_cmp.c
View file @
1bc33397
...
...
@@ -27,6 +27,10 @@
#include <string.h>
#include <sys/stat.h>
#ifdef _MSC_VER
#pragma warning(disable:4996)
#endif
char
compare_plist
(
plist_t
node_l
,
plist_t
node_r
)
{
plist_t
cur_l
=
NULL
;
...
...
test/plist_test.c
View file @
1bc33397
...
...
@@ -27,6 +27,11 @@
#include <string.h>
#include <sys/stat.h>
#ifdef _MSC_VER
#pragma warning(disable:4996)
#endif
int
main
(
int
argc
,
char
*
argv
[])
{
FILE
*
iplist
=
NULL
;
...
...
@@ -40,7 +45,6 @@ int main(int argc, char *argv[])
int
size_out
=
0
;
int
size_out2
=
0
;
char
*
file_in
=
NULL
;
char
*
file_out
[
512
];
struct
stat
*
filestats
=
(
struct
stat
*
)
malloc
(
sizeof
(
struct
stat
));
if
(
argc
!=
2
)
{
printf
(
"Wrong input
\n
"
);
...
...
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