LIBMTP_mtpdevice_struct(3)
๐ LIBMTP_mtpdevice_struct โ the main character struct ๐
So bestie, this is a page from the libmtp Library Functions Manual, and it's all about LIBMTP_mtpdevice_struct โ like, the actual struct that holds your whole MTP device together. Think of it as the group chat where every device in your life lives. Let's get into it ๐
โจ SYNOPSIS โจ
#include <libmtp.h>
๐ฆ Data Fields
uint8_t object_bitsizevoid * paramsvoid * usbinfoLIBMTP_devicestorage_t * storageLIBMTP_error_t * errorstackuint8_t maximum_battery_leveluint32_t default_music_folderuint32_t default_playlist_folderuint32_t default_picture_folderuint32_t default_video_folderuint32_t default_organizer_folderuint32_t default_zencast_folderuint32_t default_album_folderuint32_t default_text_foldervoid * cdLIBMTP_device_extension_t * extensionsint cachedLIBMTP_mtpdevice_t * next
๐ธ Detailed Description ๐ธ
Main MTP device object struct โ that's the whole vibe โจ This is the big one, the main character energy of the whole library ๐
๐ Field Documentation ๐
๐ซถ int LIBMTP_mtpdevice_struct::cached
Whether the device uses caching, only used internally ๐ Like, it's an internal thing, not for you to poke at, bestie.
Referenced by LIBMTP_Get_Children(), LIBMTP_Get_Filemetadata(), LIBMTP_Get_Files_And_Folders(), and LIBMTP_Open_Raw_Device_Uncached().
๐ void* LIBMTP_mtpdevice_struct::cd
Per device iconv() converters, only used internally โ again, internal business only ๐
โญ uint32_t LIBMTP_mtpdevice_struct::default_album_folder
Default Album folder ๐
Referenced by LIBMTP_Create_New_Album(), LIBMTP_Dump_Device_Info(), and LIBMTP_Open_Raw_Device_Uncached().
๐ต uint32_t LIBMTP_mtpdevice_struct::default_music_folder
Default music folder ๐ถ
Referenced by LIBMTP_Create_New_Album(), LIBMTP_Create_New_Playlist(), LIBMTP_Dump_Device_Info(), and LIBMTP_Open_Raw_Device_Uncached().
๐๏ธ uint32_t LIBMTP_mtpdevice_struct::default_organizer_folder
Default organizer folder ๐
Referenced by LIBMTP_Dump_Device_Info(), and LIBMTP_Open_Raw_Device_Uncached().
๐ธ uint32_t LIBMTP_mtpdevice_struct::default_picture_folder
Default picture folder ๐ผ๏ธ
Referenced by LIBMTP_Dump_Device_Info(), and LIBMTP_Open_Raw_Device_Uncached().
๐ง uint32_t LIBMTP_mtpdevice_struct::default_playlist_folder
Default playlist folder ๐ผ
Referenced by LIBMTP_Create_New_Playlist(), LIBMTP_Dump_Device_Info(), and LIBMTP_Open_Raw_Device_Uncached().
๐ uint32_t LIBMTP_mtpdevice_struct::default_text_folder
Default Text folder โ๏ธ
Referenced by LIBMTP_Dump_Device_Info(), and LIBMTP_Open_Raw_Device_Uncached().
๐ฌ uint32_t LIBMTP_mtpdevice_struct::default_video_folder
Default video folder ๐น
Referenced by LIBMTP_Dump_Device_Info(), and LIBMTP_Open_Raw_Device_Uncached().
๐ง uint32_t LIBMTP_mtpdevice_struct::default_zencast_folder
Default ZENcast folder (only Creative devices...) โ yeah, only the Creative ones get this one, iykyk ๐ซ
Referenced by LIBMTP_Dump_Device_Info(), and LIBMTP_Open_Raw_Device_Uncached().
๐ LIBMTP_error_t* LIBMTP_mtpdevice_struct::errorstack
The error stack. This shall be handled using the error getting and clearing functions, not by dereferencing this list. No cap, do not dereference it directly, bestie ๐ โโ๏ธ
Referenced by LIBMTP_Clear_Errorstack(), LIBMTP_Dump_Errorstack(), LIBMTP_Get_Errorstack(), and LIBMTP_Open_Raw_Device_Uncached().
๐ LIBMTP_device_extension_t* LIBMTP_mtpdevice_struct::extensions
Extension list ๐งฉ
Referenced by LIBMTP_Dump_Device_Info(), LIBMTP_Open_Raw_Device_Uncached(), and LIBMTP_Release_Device().
๐ uint8_t LIBMTP_mtpdevice_struct::maximum_battery_level
The maximum battery level for this device โ gotta know what full looks like ๐โจ
Referenced by LIBMTP_Get_Batterylevel(), and LIBMTP_Open_Raw_Device_Uncached().
๐ LIBMTP_mtpdevice_t* LIBMTP_mtpdevice_struct::next
Pointer to next device in linked list; NULL if this is the last device โ so if it's NULL, you've hit the end of the queue, periodt ๐
Referenced by LIBMTP_Number_Devices_In_List(), and LIBMTP_Release_Device_List().
๐งฎ uint8_t LIBMTP_mtpdevice_struct::object_bitsize
Object bitsize, typically 32 or 64. Literally just the bit size of objects, ngl ๐ข
Referenced by LIBMTP_Dump_Device_Info(), and LIBMTP_Open_Raw_Device_Uncached().
๐ ๏ธ void* LIBMTP_mtpdevice_struct::params
Parameters for this device, must be cast into (PTPParams*) before internal use. So like, cast it before you use it internally, fr fr ๐
Referenced by LIBMTP_Check_Capability(), LIBMTP_Copy_Object(), LIBMTP_Create_Folder(), LIBMTP_Custom_Operation(), LIBMTP_Delete_Object(), LIBMTP_Dump_Device_Info(), LIBMTP_Format_Storage(), LIBMTP_Get_Album(), LIBMTP_Get_Album_List_For_Storage(), LIBMTP_Get_Allowed_Property_Values(), LIBMTP_Get_Batterylevel(), LIBMTP_Get_Children(), LIBMTP_Get_Device_By_SerialNumber(), LIBMTP_Get_Deviceversion(), LIBMTP_Get_File_To_File_Descriptor(), LIBMTP_Get_File_To_Handler(), LIBMTP_Get_Filelisting_With_Callback(), LIBMTP_Get_Filemetadata(), LIBMTP_Get_Files_And_Folders(), LIBMTP_Get_Folder_List_For_Storage(), LIBMTP_Get_Friendlyname(), LIBMTP_Get_Manufacturername(), LIBMTP_Get_Modelname(), LIBMTP_Get_Playlist(), LIBMTP_Get_Playlist_List(), LIBMTP_Get_Representative_Sample(), LIBMTP_Get_Representative_Sample_Format(), LIBMTP_Get_Serialnumber(), LIBMTP_Get_Storage(), LIBMTP_Get_Supported_Filetypes(), LIBMTP_Get_Syncpartner(), LIBMTP_Get_Thumbnail(), LIBMTP_Get_Tracklisting_With_Callback_For_Storage(), LIBMTP_Get_Trackmetadata(), LIBMTP_Is_Property_Supported(), LIBMTP_Move_Object(), LIBMTP_Open_Raw_Device_Uncached(), LIBMTP_Read_Event(), LIBMTP_Read_Event_Async(), LIBMTP_Release_Device(), LIBMTP_Reset_Device(), LIBMTP_Send_File_From_File_Descriptor(), LIBMTP_Send_File_From_Handler(), LIBMTP_Send_Representative_Sample(), LIBMTP_Send_Track_From_File_Descriptor(), LIBMTP_Send_Track_From_Handler(), LIBMTP_Set_Friendlyname(), LIBMTP_Set_Syncpartner(), LIBMTP_Track_Exists(), LIBMTP_Update_Track_Metadata(), utf16_to_utf8(), and utf8_to_utf16().
๐พ LIBMTP_devicestorage_t* LIBMTP_mtpdevice_struct::storage
The storage for this device, do not use strings in here without copying them first, and beware that this list may be rebuilt at any time. โ ๏ธ Okay this one's important: copy your strings before you touch them, and don't get attached โ the list can be rebuilt at literally any moment ๐ญ
See also:
LIBMTP_Get_Storage()
Examples:
detect.c,files.c,folders.c,sendtr.c, andtracks.c.
Referenced by LIBMTP_Dump_Device_Info(), LIBMTP_Get_Storage(), and LIBMTP_Open_Raw_Device_Uncached().
๐ void* LIBMTP_mtpdevice_struct::usbinfo
USB device for this device, must be cast into (PTP_USB*) before internal use โ cast before internal use, same deal as params ๐ซก
Referenced by LIBMTP_Create_Folder(), LIBMTP_Create_New_Playlist(), LIBMTP_Dump_Device_Info(), LIBMTP_Get_Batterylevel(), LIBMTP_Get_File_To_File_Descriptor(), LIBMTP_Get_File_To_Handler(), LIBMTP_Get_Playlist(), LIBMTP_Get_Playlist_List(), LIBMTP_Get_Supported_Filetypes(), LIBMTP_Get_Tracklisting_With_Callback_For_Storage(), LIBMTP_Get_Trackmetadata(), LIBMTP_Open_Raw_Device_Uncached(), LIBMTP_Release_Device(), LIBMTP_Send_File_From_File_Descriptor(), LIBMTP_Send_File_From_Handler(), LIBMTP_Send_Representative_Sample(), LIBMTP_Send_Track_From_File_Descriptor(), LIBMTP_Send_Track_From_Handler(), LIBMTP_Update_Playlist(), and LIBMTP_Update_Track_Metadata().
๐ Author ๐
Generated automatically by Doxygen for libmtp from the source code โ so like, a robot wrote this, slay ๐คโจ
That's the whole page, bestie! This one's from libmtp, Version 1.1.23, dated alongside LIBMTP_mtpdevice_struct(3). Go forth and struct responsibly ๐๐ฆ
๐ฆ where this page comes from
- arch rolling: libmtp 1.1.23-1 ยท LGPL-2.1-or-later
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms