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
07c1d3c9
Commit
07c1d3c9
authored
Jul 18, 2009
by
Jonathan Beck
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add function to get parent node in API and python bindings.
parent
f605777d
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
0 deletions
+20
-0
plist.h
include/plist/plist.h
+7
-0
plist.c
src/plist.c
+5
-0
plist.i
swig/plist.i
+8
-0
No files found.
include/plist/plist.h
View file @
07c1d3c9
...
@@ -147,6 +147,13 @@ extern "C" {
...
@@ -147,6 +147,13 @@ extern "C" {
*/
*/
PLIST_API
plist_t
plist_get_prev_sibling
(
plist_t
node
);
PLIST_API
plist_t
plist_get_prev_sibling
(
plist_t
node
);
/**
* Get the parent of a node
*
* @param node the parent (NULL if node is root)
*/
PLIST_API
plist_t
plist_get_parent
(
plist_t
node
);
/**
/**
* Get the nth child of a #PLIST_ARRAY node.
* Get the nth child of a #PLIST_ARRAY node.
*
*
...
...
src/plist.c
View file @
07c1d3c9
...
@@ -195,6 +195,11 @@ plist_t plist_get_prev_sibling(plist_t node)
...
@@ -195,6 +195,11 @@ plist_t plist_get_prev_sibling(plist_t node)
return
(
plist_t
)
g_node_prev_sibling
((
GNode
*
)
node
);
return
(
plist_t
)
g_node_prev_sibling
((
GNode
*
)
node
);
}
}
plist_t
plist_get_parent
(
plist_t
node
)
{
return
node
?
(
plist_t
)
((
GNode
*
)
node
)
->
parent
:
NULL
;
}
plist_t
plist_get_array_nth_el
(
plist_t
node
,
uint32_t
n
)
plist_t
plist_get_array_nth_el
(
plist_t
node
,
uint32_t
n
)
{
{
plist_t
ret
=
NULL
;
plist_t
ret
=
NULL
;
...
...
swig/plist.i
View file @
07c1d3c9
...
@@ -141,6 +141,14 @@ typedef struct {
...
@@ -141,6 +141,14 @@ typedef struct {
return NULL;
return NULL;
}
}
PListNode* get_parent() {
plist_t node = plist_get_parent( $self->node );
if (node) {
return allocate_wrapper(node, 1);
}
return NULL;
}
%newobject as_key;
%newobject as_key;
char* as_key() {
char* as_key() {
char* k = NULL;
char* k = 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