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
009274f4
Commit
009274f4
authored
Oct 10, 2009
by
Jonathan Beck
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Reverse argument for dicts to make it clearer.
parent
77b02c94
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
9 deletions
+9
-9
plist.h
include/plist/plist.h
+2
-3
plist.c
src/plist.c
+7
-6
No files found.
include/plist/plist.h
View file @
009274f4
...
...
@@ -262,7 +262,7 @@ extern "C" {
* @param item the new item associated to key
* @param key the identifier of the item to get. Assert if identifier is not present.
*/
PLIST_API
void
plist_dict_set_item
(
plist_t
node
,
plist_t
item
,
const
char
*
key
);
PLIST_API
void
plist_dict_set_item
(
plist_t
node
,
const
char
*
key
,
plist_t
item
);
/**
* Insert a new item at position n in a #PLIST_DICT node.
...
...
@@ -271,7 +271,7 @@ extern "C" {
* @param item the new item to insert
* @param key The identifier of the item to insert. Assert if identifier already present.
*/
PLIST_API
void
plist_dict_insert_item
(
plist_t
node
,
plist_t
item
,
const
char
*
key
);
PLIST_API
void
plist_dict_insert_item
(
plist_t
node
,
const
char
*
key
,
plist_t
item
);
/**
* Remove an existing position in a #PLIST_DICT node.
...
...
@@ -658,7 +658,6 @@ extern "C" {
*/
PLIST_API
void
plist_add_sub_date_el
(
plist_t
node
,
int32_t
sec
,
int32_t
usec
);
/*@}*/
...
...
src/plist.c
View file @
009274f4
...
...
@@ -268,15 +268,15 @@ plist_t plist_dict_get_item(plist_t node, const char* key)
if
(
node
&&
PLIST_DICT
==
plist_get_node_type
(
node
))
{
plist_t
current
=
NULL
;
for
(
current
=
plist_get
_first_child
(
node
);
for
(
current
=
(
plist_t
)
g_node
_first_child
(
node
);
current
;
current
=
plist_get_next_sibling
(
plist_get
_next_sibling
(
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
);
if
(
data
&&
!
strcmp
(
key
,
data
->
strval
))
{
ret
=
plist_get
_next_sibling
(
current
);
ret
=
(
plist_t
)
g_node
_next_sibling
(
current
);
break
;
}
}
...
...
@@ -284,7 +284,7 @@ plist_t plist_dict_get_item(plist_t node, const char* key)
return
ret
;
}
void
plist_dict_set_item
(
plist_t
node
,
plist_t
item
,
const
char
*
key
)
void
plist_dict_set_item
(
plist_t
node
,
const
char
*
key
,
plist_t
item
)
{
if
(
node
&&
PLIST_DICT
==
plist_get_node_type
(
node
))
{
plist_t
old_item
=
plist_dict_get_item
(
node
,
key
);
...
...
@@ -297,7 +297,7 @@ void plist_dict_set_item(plist_t node, plist_t item, const char* key)
return
;
}
void
plist_dict_insert_item
(
plist_t
node
,
plist_t
item
,
const
char
*
key
)
void
plist_dict_insert_item
(
plist_t
node
,
const
char
*
key
,
plist_t
item
)
{
if
(
node
&&
PLIST_DICT
==
plist_get_node_type
(
node
))
{
g_node_append
(
node
,
plist_new_key
(
key
));
...
...
@@ -357,7 +357,7 @@ static plist_t plist_find_node(plist_t plist, plist_type type, const void *value
if
(
!
plist
)
return
NULL
;
for
(
current
=
plist_get_first_child
(
plist
);
current
;
current
=
plist_get
_next_sibling
(
current
))
{
for
(
current
=
(
plist_t
)
g_node_first_child
(
plist
);
current
;
current
=
(
plist_t
)
g_node
_next_sibling
(
current
))
{
plist_data_t
data
=
plist_get_data
(
current
);
...
...
@@ -658,6 +658,7 @@ void plist_set_date_val(plist_t node, int32_t sec, int32_t usec)
//DEPRECATED API BELOW
static
plist_t
plist_add_sub_element
(
plist_t
node
,
plist_type
type
,
const
void
*
value
,
uint64_t
length
)
{
//only structured types can have children
...
...
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