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
ea37ed01
Commit
ea37ed01
authored
May 19, 2019
by
Nikias Bassen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add plist_dict_item_get_key() to allow retrieving the key node for a given item of a #PLIST_DICT
parent
9555e71d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
2 deletions
+21
-2
plist.h
include/plist/plist.h
+10
-2
plist.c
src/plist.c
+11
-0
No files found.
include/plist/plist.h
View file @
ea37ed01
...
...
@@ -353,9 +353,9 @@ extern "C"
void
plist_dict_next_item
(
plist_t
node
,
plist_dict_iter
iter
,
char
**
key
,
plist_t
*
val
);
/**
* Get key associated
to an item. Item must be member of a dictionary
* Get key associated
key to an item. Item must be member of a dictionary.
*
* @param node the
node
* @param node the
item
* @param key a location to store the key. The caller is responsible for freeing the returned string.
*/
void
plist_dict_get_item_key
(
plist_t
node
,
char
**
key
);
...
...
@@ -370,6 +370,14 @@ extern "C"
*/
plist_t
plist_dict_get_item
(
plist_t
node
,
const
char
*
key
);
/**
* Get key node associated to an item. Item must be member of a dictionary.
*
* @param node the item
* @return the key node of the given item, or NULL.
*/
plist_t
plist_dict_item_get_key
(
plist_t
node
);
/**
* Set item identified by key in a #PLIST_DICT node.
* The previous item identified by key will be freed using #plist_free.
...
...
src/plist.c
View file @
ea37ed01
...
...
@@ -618,6 +618,17 @@ PLIST_API void plist_dict_get_item_key(plist_t node, char **key)
}
}
PLIST_API
plist_t
plist_dict_item_get_key
(
plist_t
node
)
{
plist_t
ret
=
NULL
;
plist_t
father
=
plist_get_parent
(
node
);
if
(
PLIST_DICT
==
plist_get_node_type
(
father
))
{
ret
=
(
plist_t
)
node_prev_sibling
(
node
);
}
return
ret
;
}
PLIST_API
plist_t
plist_dict_get_item
(
plist_t
node
,
const
char
*
key
)
{
plist_t
ret
=
NULL
;
...
...
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