From fc1e86f0cad58729afc6b8fa16507946f5920fe9 Mon Sep 17 00:00:00 2001 From: Maarten Billemont Date: Thu, 25 Jul 2019 12:52:22 -0400 Subject: [PATCH] File holds data. --- platform-independent/c/core/src/mpw-marshal.c | 8 ++++---- platform-independent/c/core/src/mpw-marshal.h | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/platform-independent/c/core/src/mpw-marshal.c b/platform-independent/c/core/src/mpw-marshal.c index b95fc3ab..521d759e 100644 --- a/platform-independent/c/core/src/mpw-marshal.c +++ b/platform-independent/c/core/src/mpw-marshal.c @@ -99,7 +99,7 @@ MPMarshalledQuestion *mpw_marshal_question( } MPMarshalledFile *mpw_marshal_file( - MPMarshalledUser *user) { + MPMarshalledUser *user, MPMarshalledData *data) { MPMarshalledFile *file; if (!user || !(file = malloc( sizeof( MPMarshalledFile ) ))) @@ -107,8 +107,8 @@ MPMarshalledFile *mpw_marshal_file( *file = (MPMarshalledFile){ .info = NULL, - .data = NULL, .user = user, + .data = data, }; return file; } @@ -770,7 +770,7 @@ static MPMarshalledFile *mpw_marshal_read_flat( mpw_free_strings( &fullName, &keyID, NULL ); mpw_free( &masterKey, MPMasterKeySize ); - MPMarshalledFile *file = mpw_marshal_file( user ); + MPMarshalledFile *file = mpw_marshal_file( user, NULL ); if (!file) { *error = (MPMarshalError){ MPMarshalErrorInternal, "Couldn't allocate a new marshal file." }; mpw_marshal_user_free( &user ); @@ -1018,7 +1018,7 @@ static MPMarshalledFile *mpw_marshal_read_json( mpw_free( &masterKey, MPMasterKeySize ); json_object_put( json_file ); - MPMarshalledFile *file = mpw_marshal_file( user ); + MPMarshalledFile *file = mpw_marshal_file( user, NULL ); if (!file) { *error = (MPMarshalError){ MPMarshalErrorInternal, "Couldn't allocate a new marshal file." }; mpw_marshal_user_free( &user ); diff --git a/platform-independent/c/core/src/mpw-marshal.h b/platform-independent/c/core/src/mpw-marshal.h index 27d57438..794edaaf 100644 --- a/platform-independent/c/core/src/mpw-marshal.h +++ b/platform-independent/c/core/src/mpw-marshal.h @@ -179,7 +179,7 @@ MPMarshalledQuestion *mpw_marshal_question( /** Create a new file to marshal a user into. * @return A file object (allocated), or NULL if the user is missing or the marshalled file couldn't be allocated. */ MPMarshalledFile *mpw_marshal_file( - MPMarshalledUser *user); + MPMarshalledUser *user, MPMarshalledData *data); /** Free the given user object and all associated data. */ bool mpw_marshal_info_free(