# --- T2-COPYRIGHT-BEGIN --- # t2/package/*/libmtp/cross.diff # Copyright (C) 2026 The T2 SDE Project # SPDX-License-Identifier: GPL-2.0 or patched project license # --- T2-COPYRIGHT-END --- --- libmtp-1.1.23/util/mtp-hotplug.c.vanilla 2026-05-02 12:31:29.915572562 +0200 +++ libmtp-1.1.23/util/mtp-hotplug.c 2026-05-02 12:55:46.631222776 +0200 @@ -21,11 +21,35 @@ * Boston, MA 02111-1307, USA. */ #include "config.h" -#include #include #include #include #include +#include + + +/** + * A data structure to hold MTP device entries. + */ +struct LIBMTP_device_entry_struct { + char *vendor; /**< The vendor of this device */ + uint16_t vendor_id; /**< Vendor ID for this device */ + char *product; /**< The product name of this device */ + uint16_t product_id; /**< Product ID for this device */ + uint32_t device_flags; /**< Bugs, device specifics etc */ +}; + +typedef struct LIBMTP_device_entry_struct LIBMTP_device_entry_t; + + +#include "../src/device-flags.h" + +static const LIBMTP_device_entry_t entries[] = { +/* We include an .h file which is shared between us and libgphoto2 */ +#include "../src/music-players.h" +}; +static const int numentries = sizeof(entries) / sizeof(*entries); + static void usage(void) { @@ -58,8 +82,6 @@ int main (int argc, char **argv) { - LIBMTP_device_entry_t *entries; - int numentries; int i, j, k; int ret; enum style style = style_usbmap; @@ -136,8 +158,7 @@ } } - LIBMTP_Init(); - ret = LIBMTP_Get_Supported_Devices_List(&entries, &numentries); + ret = 0; if (ret == 0) { /* sort codes numerically */ sorted_codes = malloc(numentries * sizeof(int));