2
0

NULL if marshal content can't be understood.

This commit is contained in:
Maarten Billemont 2020-01-23 16:03:02 -05:00
parent 2af541a4d7
commit 0bbc6de2ab
2 changed files with 7 additions and 2 deletions

View File

@ -986,6 +986,11 @@ MPMarshalInfo *mpw_marshal_read_info(
}
}
if (info->format == MPMarshalFormatNone) {
mpw_marshal_info_free( &info );
return NULL;
}
return info;
}

View File

@ -125,8 +125,8 @@ typedef struct MPMarshalInfo {
* @return A string (allocated), or NULL if the format is unrecognized, does not support marshalling or a format error occurred. */
const char *mpw_marshal_write(
const MPMarshalFormat outFormat, const MPMarshalledUser *user, MPMarshalError *error);
/** Try to read metadata on the sites in the input buffer.
* @return A metadata object (allocated), or NULL if the object could not be allocated or a format error occurred. */
/** Best effort parse of metadata on the sites in the input buffer. Fields that could not be parsed remain at their type's initial value.
* @return A metadata object (allocated); NULL if the object could not be allocated or the format was not understood. */
MPMarshalInfo *mpw_marshal_read_info(
const char *in);
/** Unmarshall sites in the given input buffer by parsing it using the given marshalling format.