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
0f69774f
Commit
0f69774f
authored
Oct 16, 2009
by
Jonathan Beck
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Change python binding to be based on libplist++ object model.
Deprecate old binding.
parent
7ba9a543
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
3 deletions
+34
-3
CMakeLists.txt
swig/CMakeLists.txt
+2
-1
plist.i
swig/plist.i
+32
-2
No files found.
swig/CMakeLists.txt
View file @
0f69774f
...
@@ -4,8 +4,9 @@ SET(CMAKE_SWIG_FLAGS -Werror -Wall -modern)
...
@@ -4,8 +4,9 @@ SET(CMAKE_SWIG_FLAGS -Werror -Wall -modern)
INCLUDE_DIRECTORIES
(
${
PYTHON_INCLUDE_PATH
}
)
INCLUDE_DIRECTORIES
(
${
PYTHON_INCLUDE_PATH
}
)
SET_SOURCE_FILES_PROPERTIES
(
plist.i PROPERTIES CPLUSPLUS ON
)
SWIG_ADD_MODULE
(
PList python plist.i
)
SWIG_ADD_MODULE
(
PList python plist.i
)
SWIG_LINK_LIBRARIES
(
PList plist
${
PYTHON_LIBRARIES
}
)
SWIG_LINK_LIBRARIES
(
PList plist
plist++
${
PYTHON_LIBRARIES
}
)
EXEC_PROGRAM
(
"
${
PYTHON_EXECUTABLE
}
"
EXEC_PROGRAM
(
"
${
PYTHON_EXECUTABLE
}
"
ARGS
"-c 'try:
\n
import distutils.sysconfig; print distutils.sysconfig.get_python_lib()
\n
except: pass
\n
'"
ARGS
"-c 'try:
\n
import distutils.sysconfig; print distutils.sysconfig.get_python_lib()
\n
except: pass
\n
'"
...
...
swig/plist.i
View file @
0f69774f
...
@@ -4,6 +4,8 @@
...
@@ -4,6 +4,8 @@
%{
%{
/* Includes the header in the wrapper code */
/* Includes the header in the wrapper code */
#include <plist/plist.h>
#include <plist/plist.h>
#include <plist/plist++.h>
typedef struct {
typedef struct {
plist_t node;
plist_t node;
char should_keep_plist;
char should_keep_plist;
...
@@ -21,6 +23,34 @@ PListNode *allocate_plist_wrapper(plist_t plist, char should_keep_plist) {
...
@@ -21,6 +23,34 @@ PListNode *allocate_plist_wrapper(plist_t plist, char should_keep_plist) {
}
}
%}
%}
%include "stl.i"
%rename(__assign__) *::operator=;
%rename(__getitem__) *::operator[];
%ignore Boolean(plist_t);
%ignore Integer(plist_t);
%ignore Real(plist_t);
%ignore String(plist_t);
%ignore Data(plist_t);
%ignore Date(plist_t);
%ignore Array(plist_t);
%ignore Dictionary(plist_t);
%include <plist/Node.h>
%include <plist/Boolean.h>
%include <plist/Integer.h>
%include <plist/Real.h>
%include <plist/String.h>
%include <plist/Data.h>
%include <plist/Date.h>
%include <plist/Structure.h>
%include <plist/Array.h>
%include <plist/Dictionary.h>
%include <plist/Utils.h>
//deprecated wrapper below
%include "stdint.i"
%include "stdint.i"
%include "cstring.i"
%include "cstring.i"
...
@@ -189,9 +219,9 @@ typedef struct {
...
@@ -189,9 +219,9 @@ typedef struct {
}
}
char as_bool() {
char as_bool() {
char
b;
uint8_t
b;
plist_get_bool_val($self->node, &b);
plist_get_bool_val($self->node, &b);
return b;
return
(char)
b;
}
}
uint64_t as_uint() {
uint64_t as_uint() {
...
...
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