Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions msvscpp/pypff/pypff.vcproj
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,18 @@
RelativePath="..\..\pypff\pypff_message.c"
>
</File>
<File
RelativePath="..\..\pypff\pypff_message_store.c"
>
</File>
<File
RelativePath="..\..\pypff\pypff_multi_value.c"
>
</File>
<File
RelativePath="..\..\pypff\pypff_name_to_id_map_entry.c"
>
</File>
<File
RelativePath="..\..\pypff\pypff_recipients.c"
>
Expand All @@ -253,6 +265,10 @@
RelativePath="..\..\pypff\pypff_record_sets.c"
>
</File>
<File
RelativePath="..\..\pypff\pypff_task.c"
>
</File>
</Filter>
<Filter
Name="Header Files"
Expand Down Expand Up @@ -339,6 +355,18 @@
RelativePath="..\..\pypff\pypff_message.h"
>
</File>
<File
RelativePath="..\..\pypff\pypff_message_store.h"
>
</File>
<File
RelativePath="..\..\pypff\pypff_multi_value.h"
>
</File>
<File
RelativePath="..\..\pypff\pypff_name_to_id_map_entry.h"
>
</File>
<File
RelativePath="..\..\pypff\pypff_python.h"
>
Expand All @@ -363,6 +391,10 @@
RelativePath="..\..\pypff\pypff_record_sets.h"
>
</File>
<File
RelativePath="..\..\pypff\pypff_task.h"
>
</File>
<File
RelativePath="..\..\pypff\pypff_unused.h"
>
Expand Down
4 changes: 4 additions & 0 deletions pypff/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,16 @@ pypff_la_SOURCES = \
pypff_libclocale.h \
pypff_libpff.h \
pypff_message.c pypff_message.h \
pypff_message_store.c pypff_message_store.h \
pypff_multi_value.c pypff_multi_value.h \
pypff_name_to_id_map_entry.c pypff_name_to_id_map_entry.h \
pypff_python.h \
pypff_recipients.c pypff_recipients.h \
pypff_record_entry.c pypff_record_entry.h \
pypff_record_entries.c pypff_record_entries.h \
pypff_record_set.c pypff_record_set.h \
pypff_record_sets.c pypff_record_sets.h \
pypff_task.c pypff_task.h \
pypff_unused.h

pypff_la_LIBADD = \
Expand Down
72 changes: 72 additions & 0 deletions pypff/pypff.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,16 @@
#include "pypff_libcerror.h"
#include "pypff_libpff.h"
#include "pypff_message.h"
#include "pypff_message_store.h"
#include "pypff_multi_value.h"
#include "pypff_name_to_id_map_entry.h"
#include "pypff_python.h"
#include "pypff_recipients.h"
#include "pypff_record_entries.h"
#include "pypff_record_entry.h"
#include "pypff_record_set.h"
#include "pypff_record_sets.h"
#include "pypff_task.h"
#include "pypff_unused.h"

#if !defined( LIBPFF_HAVE_BFIO )
Expand Down Expand Up @@ -681,6 +685,23 @@ PyMODINIT_FUNC initpypff(
"item",
(PyObject *) &pypff_item_type_object );

/* Setup the message_store type object
*/
pypff_message_store_type_object.tp_new = PyType_GenericNew;

if( PyType_Ready(
&pypff_message_store_type_object ) < 0 )
{
goto on_error;
}
Py_IncRef(
(PyObject *) &pypff_message_store_type_object );

PyModule_AddObject(
module,
"message_store",
(PyObject *) &pypff_message_store_type_object );

/* Setup the items type object
*/
pypff_items_type_object.tp_new = PyType_GenericNew;
Expand Down Expand Up @@ -715,6 +736,23 @@ PyMODINIT_FUNC initpypff(
"message",
(PyObject *) &pypff_message_type_object );

/* Setup the task type object
*/
pypff_task_type_object.tp_new = PyType_GenericNew;

if( PyType_Ready(
&pypff_task_type_object ) < 0 )
{
goto on_error;
}
Py_IncRef(
(PyObject *) &pypff_task_type_object );

PyModule_AddObject(
module,
"task",
(PyObject *) &pypff_task_type_object );

/* Setup the recipients type object
*/
pypff_recipients_type_object.tp_new = PyType_GenericNew;
Expand All @@ -732,6 +770,40 @@ PyMODINIT_FUNC initpypff(
"recipients",
(PyObject *) &pypff_recipients_type_object );

/* Setup the multi_value type object
*/
pypff_multi_value_type_object.tp_new = PyType_GenericNew;

if( PyType_Ready(
&pypff_multi_value_type_object ) < 0 )
{
goto on_error;
}
Py_IncRef(
(PyObject *) &pypff_multi_value_type_object );

PyModule_AddObject(
module,
"multi_value",
(PyObject *) &pypff_multi_value_type_object );

/* Setup the name_to_id_map_entry type object
*/
pypff_name_to_id_map_entry_type_object.tp_new = PyType_GenericNew;

if( PyType_Ready(
&pypff_name_to_id_map_entry_type_object ) < 0 )
{
goto on_error;
}
Py_IncRef(
(PyObject *) &pypff_name_to_id_map_entry_type_object );

PyModule_AddObject(
module,
"name_to_id_map_entry",
(PyObject *) &pypff_name_to_id_map_entry_type_object );

/* Setup the record_entries type object
*/
pypff_record_entries_type_object.tp_new = PyType_GenericNew;
Expand Down
28 changes: 11 additions & 17 deletions pypff/pypff_file.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,10 @@
#include "pypff_libclocale.h"
#include "pypff_libpff.h"
#include "pypff_message.h"
#include "pypff_message_store.h"
#include "pypff_python.h"
#include "pypff_recipients.h"
#include "pypff_task.h"
#include "pypff_unused.h"

#if !defined( LIBPFF_HAVE_BFIO )
Expand Down Expand Up @@ -1458,19 +1461,23 @@ PyTypeObject *pypff_file_get_item_type_object(
case LIBPFF_ITEM_TYPE_RSS_FEED:
case LIBPFF_ITEM_TYPE_SHARING:
case LIBPFF_ITEM_TYPE_SMS:
case LIBPFF_ITEM_TYPE_TASK:
case LIBPFF_ITEM_TYPE_TASK_REQUEST:
case LIBPFF_ITEM_TYPE_VOICEMAIL:
return( &pypff_message_type_object );

case LIBPFF_ITEM_TYPE_TASK:
case LIBPFF_ITEM_TYPE_TASK_REQUEST:
return( &pypff_task_type_object );

case LIBPFF_ITEM_TYPE_ATTACHMENT:
return( &pypff_attachment_type_object );

case LIBPFF_ITEM_TYPE_FOLDER:
return( &pypff_folder_type_object );

case LIBPFF_ITEM_TYPE_ATTACHMENTS:
case LIBPFF_ITEM_TYPE_RECIPIENTS:
return( &pypff_recipients_type_object );

case LIBPFF_ITEM_TYPE_ATTACHMENTS:
case LIBPFF_ITEM_TYPE_SUB_ASSOCIATED_CONTENTS:
case LIBPFF_ITEM_TYPE_SUB_FOLDERS:
case LIBPFF_ITEM_TYPE_SUB_MESSAGES:
Expand Down Expand Up @@ -1562,7 +1569,6 @@ PyObject *pypff_file_get_message_store(
PyObject *arguments PYPFF_ATTRIBUTE_UNUSED )
{
PyObject *message_store_object = NULL;
PyTypeObject *type_object = NULL;
libcerror_error_t *error = NULL;
libpff_item_t *message_store = NULL;
static char *function = "pypff_file_get_message_store";
Expand Down Expand Up @@ -1608,20 +1614,8 @@ PyObject *pypff_file_get_message_store(

return( Py_None );
}
type_object = pypff_file_get_item_type_object(
message_store );

if( type_object == NULL )
{
PyErr_Format(
PyExc_IOError,
"%s: unable to retrieve message store type object.",
function );

goto on_error;
}
message_store_object = pypff_item_new(
type_object,
&pypff_message_store_type_object,
message_store,
(PyObject *) pypff_file );

Expand Down
17 changes: 13 additions & 4 deletions pypff/pypff_item.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
#include <stdlib.h>
#endif

#include "pypff_attachment.h"
#include "pypff_error.h"
#include "pypff_folder.h"
#include "pypff_item.h"
Expand All @@ -34,8 +35,10 @@
#include "pypff_libpff.h"
#include "pypff_message.h"
#include "pypff_python.h"
#include "pypff_recipients.h"
#include "pypff_record_set.h"
#include "pypff_record_sets.h"
#include "pypff_task.h"
#include "pypff_unused.h"

PyMethodDef pypff_item_object_methods[] = {
Expand Down Expand Up @@ -887,17 +890,23 @@ PyTypeObject *pypff_item_get_item_type_object(
case LIBPFF_ITEM_TYPE_RSS_FEED:
case LIBPFF_ITEM_TYPE_SHARING:
case LIBPFF_ITEM_TYPE_SMS:
case LIBPFF_ITEM_TYPE_TASK:
case LIBPFF_ITEM_TYPE_TASK_REQUEST:
case LIBPFF_ITEM_TYPE_VOICEMAIL:
return( &pypff_message_type_object );

case LIBPFF_ITEM_TYPE_TASK:
case LIBPFF_ITEM_TYPE_TASK_REQUEST:
return( &pypff_task_type_object );

case LIBPFF_ITEM_TYPE_ATTACHMENT:
return( &pypff_attachment_type_object );

case LIBPFF_ITEM_TYPE_FOLDER:
return( &pypff_folder_type_object );

case LIBPFF_ITEM_TYPE_ATTACHMENT:
case LIBPFF_ITEM_TYPE_ATTACHMENTS:
case LIBPFF_ITEM_TYPE_RECIPIENTS:
return( &pypff_recipients_type_object );

case LIBPFF_ITEM_TYPE_ATTACHMENTS:
case LIBPFF_ITEM_TYPE_SUB_ASSOCIATED_CONTENTS:
case LIBPFF_ITEM_TYPE_SUB_FOLDERS:
case LIBPFF_ITEM_TYPE_SUB_MESSAGES:
Expand Down
Loading
Loading