From af6cc96530593986fd7f16e1f7afc41bdca2bbd7 Mon Sep 17 00:00:00 2001 From: axxel Date: Tue, 8 Oct 2024 00:08:09 +0200 Subject: [PATCH] ptp2: rename MTPProperties struct and members... ... to be consistent with specification and also with the names of similar symbols in the rest of the code. --- camlibs/ptp2/library.c | 34 ++++---- camlibs/ptp2/ptp-pack.c | 34 ++++---- camlibs/ptp2/ptp.c | 170 ++++++++++++++++++++-------------------- camlibs/ptp2/ptp.h | 32 ++++---- 4 files changed, 135 insertions(+), 135 deletions(-) diff --git a/camlibs/ptp2/library.c b/camlibs/ptp2/library.c index 1e1f3cc67..34b8d38a7 100644 --- a/camlibs/ptp2/library.c +++ b/camlibs/ptp2/library.c @@ -8327,7 +8327,7 @@ ptp_mtp_render_metadata ( uint16_t ret, *props = NULL; uint32_t propcnt = 0; unsigned int j; - MTPProperties *mprops; + MTPObjectProp *mprops; PTPObject *ob; C_PTP (ptp_object_want (params, object_id, PTPOBJECT_MTPPROPLIST_LOADED, &ob)); @@ -8343,10 +8343,10 @@ ptp_mtp_render_metadata ( unsigned int i, n; for (j=0;jmtp_props_len;j++) { - MTPProperties *xpl = &mprops[j]; + MTPObjectProp *xpl = &mprops[j]; for (i=0;iproperty) + if (uninteresting_props[i] == xpl->PropCode) break; /* Is uninteresting. */ if (i != ARRAYSIZE(uninteresting_props)) @@ -8354,28 +8354,28 @@ ptp_mtp_render_metadata ( for(i=0;iproperty) { + if (props[i] == xpl->PropCode) { props[i]=0; break; } } - n = ptp_render_mtp_propname(xpl->property, sizeof(propname), propname); + n = ptp_render_mtp_propname(xpl->PropCode, sizeof(propname), propname); gp_file_append (file, "<", 1); gp_file_append (file, propname, n); gp_file_append (file, ">", 1); - switch (xpl->datatype) { - case PTP_DTC_STR: snprintf (text, sizeof(text), "%s", xpl->propval.str?xpl->propval.str:""); break; - case PTP_DTC_INT64: sprintf (text, "%ld", xpl->propval.i64); break; - case PTP_DTC_INT32: sprintf (text, "%d", xpl->propval.i32); break; - case PTP_DTC_INT16: sprintf (text, "%d", xpl->propval.i16); break; - case PTP_DTC_INT8: sprintf (text, "%d", xpl->propval.i8); break; - case PTP_DTC_UINT64: sprintf (text, "%lu", xpl->propval.u64); break; - case PTP_DTC_UINT32: sprintf (text, "%u", xpl->propval.u32); break; - case PTP_DTC_UINT16: sprintf (text, "%u", xpl->propval.u16); break; - case PTP_DTC_UINT8: sprintf (text, "%u", xpl->propval.u8); break; - default: sprintf (text, "Unknown type %d", xpl->datatype); break; + switch (xpl->DataType) { + case PTP_DTC_STR: snprintf (text, sizeof(text), "%s", xpl->Value.str?xpl->Value.str:""); break; + case PTP_DTC_INT64: sprintf (text, "%ld", xpl->Value.i64); break; + case PTP_DTC_INT32: sprintf (text, "%d", xpl->Value.i32); break; + case PTP_DTC_INT16: sprintf (text, "%d", xpl->Value.i16); break; + case PTP_DTC_INT8: sprintf (text, "%d", xpl->Value.i8); break; + case PTP_DTC_UINT64: sprintf (text, "%lu", xpl->Value.u64); break; + case PTP_DTC_UINT32: sprintf (text, "%u", xpl->Value.u32); break; + case PTP_DTC_UINT16: sprintf (text, "%u", xpl->Value.u16); break; + case PTP_DTC_UINT8: sprintf (text, "%u", xpl->Value.u8); break; + default: sprintf (text, "Unknown type %d", xpl->DataType); break; } gp_file_append (file, text, strlen(text)); gp_file_append (file, "ObjectHandle; totalsize += sizeof(uint32_t); /* Object ID */ /* Metadata type */ - packedpropsids[noitems]=propitr->property; + packedpropsids[noitems]=propitr->PropCode; totalsize += sizeof(uint16_t); /* Data type */ - packedpropstypes[noitems]= propitr->datatype; + packedpropstypes[noitems]= propitr->DataType; totalsize += sizeof(uint16_t); /* Add each property to be sent. */ - packedpropslens[noitems] = ptp_pack_DPV (params, &propitr->propval, &packedprops[noitems], propitr->datatype); + packedpropslens[noitems] = ptp_pack_DPV (params, &propitr->Value, &packedprops[noitems], propitr->DataType); totalsize += packedpropslens[noitems]; noitems ++; propitr ++; @@ -1194,17 +1194,17 @@ ptp_pack_OPL (PTPParams *params, MTPProperties *props, int nrofprops, unsigned c static int _compare_func(const void* x, const void *y) { - const MTPProperties *px = x; - const MTPProperties *py = y; + const MTPObjectProp *px = x; + const MTPObjectProp *py = y; return px->ObjectHandle - py->ObjectHandle; } static inline int -ptp_unpack_OPL (PTPParams *params, const unsigned char* data, MTPProperties **pprops, unsigned int len) +ptp_unpack_OPL (PTPParams *params, const unsigned char* data, MTPObjectProp **pprops, unsigned int len) { uint32_t prop_count; - MTPProperties *props = NULL; + MTPObjectProp *props = NULL; unsigned int offset = 0, i; if (len < sizeof(uint32_t)) { @@ -1217,37 +1217,37 @@ ptp_unpack_OPL (PTPParams *params, const unsigned char* data, MTPProperties **pp if (prop_count == 0) return 0; - if (prop_count >= INT_MAX/sizeof(MTPProperties)) { + if (prop_count >= INT_MAX/sizeof(MTPObjectProp)) { ptp_debug (params ,"prop_count %d is too large", prop_count); return 0; } ptp_debug (params ,"Unpacking MTP OPL, size %d (prop_count %d)", len, prop_count); - props = calloc(prop_count , sizeof(MTPProperties)); + props = calloc(prop_count , sizeof(MTPObjectProp)); if (!props) return 0; for (i = 0; i < prop_count; i++) { if (len <= offset + 4 + 2 + 2) { ptp_debug (params ,"short MTP Object Property List at property %d (of %d)", i, prop_count); ptp_debug (params ,"device probably needs DEVICE_FLAG_BROKEN_MTPGETOBJPROPLIST_ALL"); ptp_debug (params ,"or even DEVICE_FLAG_BROKEN_MTPGETOBJPROPLIST"); - qsort (props, i, sizeof(MTPProperties),_compare_func); + qsort (props, i, sizeof(MTPObjectProp),_compare_func); *pprops = props; return i; } props[i].ObjectHandle = dtoh32o(data, offset); - props[i].property = dtoh16o(data, offset); - props[i].datatype = dtoh16o(data, offset); + props[i].PropCode = dtoh16o(data, offset); + props[i].DataType = dtoh16o(data, offset); - if (!ptp_unpack_DPV(params, data, &offset, len, &props[i].propval, props[i].datatype)) { + if (!ptp_unpack_DPV(params, data, &offset, len, &props[i].Value, props[i].DataType)) { ptp_debug (params ,"unpacking DPV of property %d encountered insufficient buffer. attack?", i); - qsort (props, i, sizeof(MTPProperties),_compare_func); + qsort (props, i, sizeof(MTPObjectProp),_compare_func); *pprops = props; return i; } } - qsort (props, prop_count, sizeof(MTPProperties),_compare_func); + qsort (props, prop_count, sizeof(MTPObjectProp),_compare_func); *pprops = props; return prop_count; } diff --git a/camlibs/ptp2/ptp.c b/camlibs/ptp2/ptp.c index e438d0ac8..3ac4ef047 100644 --- a/camlibs/ptp2/ptp.c +++ b/camlibs/ptp2/ptp.c @@ -5446,7 +5446,7 @@ ptp_mtp_setobjectreferences (PTPParams* params, uint32_t handle, uint32_t* ohArr } uint16_t -ptp_mtp_getobjectproplist_generic (PTPParams* params, uint32_t handle, uint32_t formats, uint32_t properties, uint32_t propertygroups, uint32_t level, MTPProperties **props, int *nrofprops) +ptp_mtp_getobjectproplist_generic (PTPParams* params, uint32_t handle, uint32_t formats, uint32_t properties, uint32_t propertygroups, uint32_t level, MTPObjectProp **props, int *nrofprops) { PTPContainer ptp; unsigned char *data = NULL; @@ -5460,7 +5460,7 @@ ptp_mtp_getobjectproplist_generic (PTPParams* params, uint32_t handle, uint32_t } uint16_t -ptp_mtp_getobjectproplist_level (PTPParams* params, uint32_t handle, uint32_t level, MTPProperties **props, int *nrofprops) +ptp_mtp_getobjectproplist_level (PTPParams* params, uint32_t handle, uint32_t level, MTPObjectProp **props, int *nrofprops) { return ptp_mtp_getobjectproplist_generic (params, handle, 0x00000000U, /* 0x00000000U should be "all formats" */ @@ -5474,20 +5474,20 @@ ptp_mtp_getobjectproplist_level (PTPParams* params, uint32_t handle, uint32_t le uint16_t -ptp_mtp_getobjectproplist (PTPParams* params, uint32_t handle, MTPProperties **props, int *nrofprops) +ptp_mtp_getobjectproplist (PTPParams* params, uint32_t handle, MTPObjectProp **props, int *nrofprops) { return ptp_mtp_getobjectproplist_level(params, handle, 0xFFFFFFFFU, props, nrofprops); } uint16_t -ptp_mtp_getobjectproplist_single (PTPParams* params, uint32_t handle, MTPProperties **props, int *nrofprops) +ptp_mtp_getobjectproplist_single (PTPParams* params, uint32_t handle, MTPObjectProp **props, int *nrofprops) { return ptp_mtp_getobjectproplist_level(params, handle, 0, props, nrofprops); } uint16_t ptp_mtp_sendobjectproplist (PTPParams* params, uint32_t* store, uint32_t* parenthandle, uint32_t* handle, - uint16_t objecttype, uint64_t objectsize, MTPProperties *props, int nrofprops) + uint16_t objecttype, uint64_t objectsize, MTPObjectProp *props, int nrofprops) { PTPContainer ptp; uint16_t ret; @@ -5510,7 +5510,7 @@ ptp_mtp_sendobjectproplist (PTPParams* params, uint32_t* store, uint32_t* parent } uint16_t -ptp_mtp_setobjectproplist (PTPParams* params, MTPProperties *props, int nrofprops) +ptp_mtp_setobjectproplist (PTPParams* params, MTPObjectProp *props, int nrofprops) { PTPContainer ptp; uint16_t ret; @@ -9440,20 +9440,20 @@ ptp_render_mtp_propname(uint16_t propid, int spaceleft, char *txt) /* * Allocate and default-initialize a few object properties. */ -MTPProperties * -ptp_get_new_object_prop_entry(MTPProperties **props, int *nrofprops) +MTPObjectProp * +ptp_get_new_object_prop_entry(MTPObjectProp **props, int *nrofprops) { - MTPProperties *newprops; - MTPProperties *prop; + MTPObjectProp *newprops; + MTPObjectProp *prop; - newprops = realloc(*props,sizeof(MTPProperties)*(*nrofprops+1)); + newprops = realloc(*props,sizeof(MTPObjectProp)*(*nrofprops+1)); if (newprops == NULL) return NULL; prop = &newprops[*nrofprops]; - prop->property = PTP_OPC_StorageID; /* Should be "unknown" */ - prop->datatype = PTP_DTC_UNDEF; + prop->PropCode = PTP_OPC_StorageID; /* Should be "unknown" */ + prop->DataType = PTP_DTC_UNDEF; prop->ObjectHandle = 0x00000000U; - prop->propval.str = NULL; + prop->Value.str = NULL; (*props) = newprops; (*nrofprops)++; @@ -9461,26 +9461,26 @@ ptp_get_new_object_prop_entry(MTPProperties **props, int *nrofprops) } void -ptp_destroy_object_prop(MTPProperties *prop) +ptp_destroy_object_prop(MTPObjectProp *prop) { if (!prop) return; - if (prop->datatype == PTP_DTC_STR && prop->propval.str != NULL) - free(prop->propval.str); - else if ((prop->datatype == PTP_DTC_AINT8 || prop->datatype == PTP_DTC_AINT16 || - prop->datatype == PTP_DTC_AINT32 || prop->datatype == PTP_DTC_AINT64 || prop->datatype == PTP_DTC_AINT128 || - prop->datatype == PTP_DTC_AUINT8 || prop->datatype == PTP_DTC_AUINT16 || - prop->datatype == PTP_DTC_AUINT32 || prop->datatype == PTP_DTC_AUINT64 || prop->datatype == PTP_DTC_AUINT128) - && prop->propval.a.v != NULL) - free(prop->propval.a.v); + if (prop->DataType == PTP_DTC_STR && prop->Value.str != NULL) + free(prop->Value.str); + else if ((prop->DataType == PTP_DTC_AINT8 || prop->DataType == PTP_DTC_AINT16 || + prop->DataType == PTP_DTC_AINT32 || prop->DataType == PTP_DTC_AINT64 || prop->DataType == PTP_DTC_AINT128 || + prop->DataType == PTP_DTC_AUINT8 || prop->DataType == PTP_DTC_AUINT16 || + prop->DataType == PTP_DTC_AUINT32 || prop->DataType == PTP_DTC_AUINT64 || prop->DataType == PTP_DTC_AUINT128) + && prop->Value.a.v != NULL) + free(prop->Value.a.v); } void -ptp_destroy_object_prop_list(MTPProperties *props, int nrofprops) +ptp_destroy_object_prop_list(MTPObjectProp *props, int nrofprops) { int i; - MTPProperties *prop = props; + MTPObjectProp *prop = props; for (i=0;imtp_props; for (i=0;imtp_props_len;i++) { - if (attribute_id == prop->property) + if (attribute_id == prop->PropCode) return prop; prop++; } @@ -9723,7 +9723,7 @@ read64bit: ; (!(ob->flags & PTPOBJECT_MTPPROPLIST_LOADED)) ) { int nrofprops = 0; - MTPProperties *props = NULL; + MTPObjectProp *props = NULL; if (params->device_flags & DEVICE_FLAG_BROKEN_MTPGETOBJPROPLIST) { want &= ~PTPOBJECT_MTPPROPLIST_LOADED; @@ -9746,62 +9746,62 @@ read64bit: ; /* Override the ObjectInfo data with data from properties */ if (params->device_flags & DEVICE_FLAG_PROPLIST_OVERRIDES_OI) { unsigned int i; - MTPProperties *prop = ob->mtp_props; + MTPObjectProp *prop = ob->mtp_props; for (i=0;imtp_props_len;i++,prop++) { /* in case we got all subtree objects */ if (prop->ObjectHandle != handle) continue; - switch (prop->property) { + switch (prop->PropCode) { case PTP_OPC_StorageID: - ob->oi.StorageID = prop->propval.u32; + ob->oi.StorageID = prop->Value.u32; break; case PTP_OPC_ObjectFormat: - ob->oi.ObjectFormat = prop->propval.u16; + ob->oi.ObjectFormat = prop->Value.u16; break; case PTP_OPC_ProtectionStatus: - ob->oi.ProtectionStatus = prop->propval.u16; + ob->oi.ProtectionStatus = prop->Value.u16; break; case PTP_OPC_ObjectSize: - if (prop->datatype == PTP_DTC_UINT64) { - ob->oi.ObjectSize = prop->propval.u64; - } else if (prop->datatype == PTP_DTC_UINT32) { - ob->oi.ObjectSize = prop->propval.u32; + if (prop->DataType == PTP_DTC_UINT64) { + ob->oi.ObjectSize = prop->Value.u64; + } else if (prop->DataType == PTP_DTC_UINT32) { + ob->oi.ObjectSize = prop->Value.u32; } break; case PTP_OPC_AssociationType: - ob->oi.AssociationType = prop->propval.u16; + ob->oi.AssociationType = prop->Value.u16; break; case PTP_OPC_AssociationDesc: - ob->oi.AssociationDesc = prop->propval.u32; + ob->oi.AssociationDesc = prop->Value.u32; break; case PTP_OPC_ObjectFileName: - if (prop->propval.str) { + if (prop->Value.str) { free(ob->oi.Filename); - ob->oi.Filename = strdup(prop->propval.str); + ob->oi.Filename = strdup(prop->Value.str); } break; case PTP_OPC_DateCreated: - ob->oi.CaptureDate = ptp_unpack_PTPTIME(prop->propval.str); + ob->oi.CaptureDate = ptp_unpack_PTPTIME(prop->Value.str); break; case PTP_OPC_DateModified: - ob->oi.ModificationDate = ptp_unpack_PTPTIME(prop->propval.str); + ob->oi.ModificationDate = ptp_unpack_PTPTIME(prop->Value.str); break; case PTP_OPC_Keywords: - if (prop->propval.str) { + if (prop->Value.str) { free(ob->oi.Keywords); - ob->oi.Keywords = strdup(prop->propval.str); + ob->oi.Keywords = strdup(prop->Value.str); } break; case PTP_OPC_ParentObject: - ob->oi.ParentObject = prop->propval.u32; + ob->oi.ParentObject = prop->Value.u32; break; } } } #if 0 - MTPProperties *xpl; + MTPObjectProp *xpl; int j; PTPObjectInfo oinfo; @@ -9809,84 +9809,84 @@ read64bit: ; /* hmm, not necessary ... only if we would use it */ for (j=0;jproperty) { + switch (xpl->PropCode) { case PTP_OPC_ParentObject: - if (xpl->datatype != PTP_DTC_UINT32) { - ptp_debug (params, "ptp2/mtpfast: parentobject has type 0x%x???", xpl->datatype); + if (xpl->DataType != PTP_DTC_UINT32) { + ptp_debug (params, "ptp2/mtpfast: parentobject has type 0x%x???", xpl->DataType); break; } - oinfo.ParentObject = xpl->propval.u32; - ptp_debug (params, "ptp2/mtpfast: parent 0x%x", xpl->propval.u32); + oinfo.ParentObject = xpl->Value.u32; + ptp_debug (params, "ptp2/mtpfast: parent 0x%x", xpl->Value.u32); break; case PTP_OPC_ObjectFormat: - if (xpl->datatype != PTP_DTC_UINT16) { - ptp_debug (params, "ptp2/mtpfast: objectformat has type 0x%x???", xpl->datatype); + if (xpl->DataType != PTP_DTC_UINT16) { + ptp_debug (params, "ptp2/mtpfast: objectformat has type 0x%x???", xpl->DataType); break; } - oinfo.ObjectFormat = xpl->propval.u16; - ptp_debug (params, "ptp2/mtpfast: ofc 0x%x", xpl->propval.u16); + oinfo.ObjectFormat = xpl->Value.u16; + ptp_debug (params, "ptp2/mtpfast: ofc 0x%x", xpl->Value.u16); break; case PTP_OPC_ObjectSize: - switch (xpl->datatype) { + switch (xpl->DataType) { case PTP_DTC_UINT32: - oinfo.ObjectSize = xpl->propval.u32; + oinfo.ObjectSize = xpl->Value.u32; break; case PTP_DTC_UINT64: - oinfo.ObjectSize = xpl->propval.u64; + oinfo.ObjectSize = xpl->Value.u64; break; default: - ptp_debug (params, "ptp2/mtpfast: objectsize has type 0x%x???", xpl->datatype); + ptp_debug (params, "ptp2/mtpfast: objectsize has type 0x%x???", xpl->DataType); break; } - ptp_debug (params, "ptp2/mtpfast: objectsize %u", xpl->propval.u32); + ptp_debug (params, "ptp2/mtpfast: objectsize %u", xpl->Value.u32); break; case PTP_OPC_StorageID: - if (xpl->datatype != PTP_DTC_UINT32) { - ptp_debug (params, "ptp2/mtpfast: storageid has type 0x%x???", xpl->datatype); + if (xpl->DataType != PTP_DTC_UINT32) { + ptp_debug (params, "ptp2/mtpfast: storageid has type 0x%x???", xpl->DataType); break; } - oinfo.StorageID = xpl->propval.u32; - ptp_debug (params, "ptp2/mtpfast: storageid 0x%x", xpl->propval.u32); + oinfo.StorageID = xpl->Value.u32; + ptp_debug (params, "ptp2/mtpfast: storageid 0x%x", xpl->Value.u32); break; case PTP_OPC_ProtectionStatus:/*UINT16*/ - if (xpl->datatype != PTP_DTC_UINT16) { - ptp_debug (params, "ptp2/mtpfast: protectionstatus has type 0x%x???", xpl->datatype); + if (xpl->DataType != PTP_DTC_UINT16) { + ptp_debug (params, "ptp2/mtpfast: protectionstatus has type 0x%x???", xpl->DataType); break; } - oinfo.ProtectionStatus = xpl->propval.u16; - ptp_debug (params, "ptp2/mtpfast: protection 0x%x", xpl->propval.u16); + oinfo.ProtectionStatus = xpl->Value.u16; + ptp_debug (params, "ptp2/mtpfast: protection 0x%x", xpl->Value.u16); break; case PTP_OPC_ObjectFileName: - if (xpl->datatype != PTP_DTC_STR) { - ptp_debug (params, "ptp2/mtpfast: filename has type 0x%x???", xpl->datatype); + if (xpl->DataType != PTP_DTC_STR) { + ptp_debug (params, "ptp2/mtpfast: filename has type 0x%x???", xpl->DataType); break; } - if (xpl->propval.str) { - ptp_debug (params, "ptp2/mtpfast: filename %s", xpl->propval.str); - oinfo.Filename = strdup(xpl->propval.str); + if (xpl->Value.str) { + ptp_debug (params, "ptp2/mtpfast: filename %s", xpl->Value.str); + oinfo.Filename = strdup(xpl->Value.str); } else { oinfo.Filename = NULL; } break; case PTP_OPC_DateCreated: - if (xpl->datatype != PTP_DTC_STR) { - ptp_debug (params, "ptp2/mtpfast: datecreated has type 0x%x???", xpl->datatype); + if (xpl->DataType != PTP_DTC_STR) { + ptp_debug (params, "ptp2/mtpfast: datecreated has type 0x%x???", xpl->DataType); break; } - ptp_debug (params, "ptp2/mtpfast: capturedate %s", xpl->propval.str); - oinfo.CaptureDate = ptp_unpack_PTPTIME (xpl->propval.str); + ptp_debug (params, "ptp2/mtpfast: capturedate %s", xpl->Value.str); + oinfo.CaptureDate = ptp_unpack_PTPTIME (xpl->Value.str); break; case PTP_OPC_DateModified: - if (xpl->datatype != PTP_DTC_STR) { - ptp_debug (params, "ptp2/mtpfast: datemodified has type 0x%x???", xpl->datatype); + if (xpl->DataType != PTP_DTC_STR) { + ptp_debug (params, "ptp2/mtpfast: datemodified has type 0x%x???", xpl->DataType); break; } - ptp_debug (params, "ptp2/mtpfast: moddate %s", xpl->propval.str); - oinfo.ModificationDate = ptp_unpack_PTPTIME (xpl->propval.str); + ptp_debug (params, "ptp2/mtpfast: moddate %s", xpl->Value.str); + oinfo.ModificationDate = ptp_unpack_PTPTIME (xpl->Value.str); break; default: - if ((xpl->property & 0xfff0) == 0xdc00) - ptp_debug (params, "ptp2/mtpfast:case %x type %x unhandled", xpl->property, xpl->datatype); + if ((xpl->PropCode & 0xfff0) == 0xdc00) + ptp_debug (params, "ptp2/mtpfast:case %x type %x unhandled", xpl->PropCode, xpl->DataType); break; } } diff --git a/camlibs/ptp2/ptp.h b/camlibs/ptp2/ptp.h index 1c6a4e9f3..04c4cd14d 100644 --- a/camlibs/ptp2/ptp.h +++ b/camlibs/ptp2/ptp.h @@ -1706,13 +1706,13 @@ union _PTPPropValue { typedef union _PTPPropValue PTPPropValue; /* Metadata lists for MTP operations */ -struct _MTPProperties { - uint16_t property; - uint16_t datatype; +struct _MTPObjectProp { + uint16_t PropCode; + uint16_t DataType; uint32_t ObjectHandle; - PTPPropValue propval; + PTPPropValue Value; }; -typedef struct _MTPProperties MTPProperties; +typedef struct _MTPObjectProp MTPObjectProp; struct _PTPPropDescRangeForm { PTPPropValue MinValue; @@ -3804,7 +3804,7 @@ struct _PTPObject { PTPObjectInfo oi; uint32_t canon_flags; - MTPProperties *mtp_props; + MTPObjectProp *mtp_props; unsigned int mtp_props_len; }; typedef struct _PTPObject PTPObject; @@ -4183,13 +4183,13 @@ uint16_t ptp_mtp_setobjectpropvalue (PTPParams* params, uint32_t oid, uint16_t o PTPPropValue *value, uint16_t datatype); uint16_t ptp_mtp_getobjectreferences (PTPParams* params, uint32_t handle, uint32_t** ohArray, uint32_t* arraylen); uint16_t ptp_mtp_setobjectreferences (PTPParams* params, uint32_t handle, uint32_t* ohArray, uint32_t arraylen); -uint16_t ptp_mtp_getobjectproplist_generic (PTPParams* params, uint32_t handle, uint32_t formats, uint32_t properties, uint32_t propertygroups, uint32_t level, MTPProperties **props, int *nrofprops); -uint16_t ptp_mtp_getobjectproplist_level (PTPParams* params, uint32_t handle, uint32_t level, MTPProperties **props, int *nrofprops); -uint16_t ptp_mtp_getobjectproplist (PTPParams* params, uint32_t handle, MTPProperties **props, int *nrofprops); -uint16_t ptp_mtp_getobjectproplist_single (PTPParams* params, uint32_t handle, MTPProperties **props, int *nrofprops); +uint16_t ptp_mtp_getobjectproplist_generic (PTPParams* params, uint32_t handle, uint32_t formats, uint32_t properties, uint32_t propertygroups, uint32_t level, MTPObjectProp **props, int *nrofprops); +uint16_t ptp_mtp_getobjectproplist_level (PTPParams* params, uint32_t handle, uint32_t level, MTPObjectProp **props, int *nrofprops); +uint16_t ptp_mtp_getobjectproplist (PTPParams* params, uint32_t handle, MTPObjectProp **props, int *nrofprops); +uint16_t ptp_mtp_getobjectproplist_single (PTPParams* params, uint32_t handle, MTPObjectProp **props, int *nrofprops); uint16_t ptp_mtp_sendobjectproplist (PTPParams* params, uint32_t* store, uint32_t* parenthandle, uint32_t* handle, - uint16_t objecttype, uint64_t objectsize, MTPProperties *props, int nrofprops); -uint16_t ptp_mtp_setobjectproplist (PTPParams* params, MTPProperties *props, int nrofprops); + uint16_t objecttype, uint64_t objectsize, MTPObjectProp *props, int nrofprops); +uint16_t ptp_mtp_setobjectproplist (PTPParams* params, MTPObjectProp *props, int nrofprops); /* Microsoft MTPZ (Zune) extensions */ uint16_t ptp_mtpz_sendwmdrmpdapprequest (PTPParams*, unsigned char *, uint32_t); @@ -4903,10 +4903,10 @@ ptp_render_property_value(PTPParams* params, uint16_t dpc, PTPDevicePropDesc *dpd, unsigned int length, char *out); int ptp_render_ofc(PTPParams* params, uint16_t ofc, int spaceleft, char *txt); int ptp_render_mtp_propname(uint16_t propid, int spaceleft, char *txt); -MTPProperties *ptp_get_new_object_prop_entry(MTPProperties **props, int *nrofprops); -void ptp_destroy_object_prop(MTPProperties *prop); -void ptp_destroy_object_prop_list(MTPProperties *props, int nrofprops); -MTPProperties *ptp_find_object_prop_in_cache(PTPParams *params, uint32_t const handle, uint32_t const attribute_id); +MTPObjectProp *ptp_get_new_object_prop_entry(MTPObjectProp **props, int *nrofprops); +void ptp_destroy_object_prop(MTPObjectProp *prop); +void ptp_destroy_object_prop_list(MTPObjectProp *props, int nrofprops); +MTPObjectProp *ptp_find_object_prop_in_cache(PTPParams *params, uint32_t const handle, uint32_t const attribute_id); uint16_t ptp_remove_object_from_cache(PTPParams *params, uint32_t handle); uint16_t ptp_add_object_to_cache(PTPParams *params, uint32_t handle); uint16_t ptp_object_want (PTPParams *, uint32_t handle, unsigned int want, PTPObject**retob);