LIBMTP_mtpdevice_struct(3)

✨ LIBMTP_mtpdevice_struct(3) ✨

okay bestie, so this whole page lives in the Library Functions Manual, and it's the glow-up guide to one extremely important struct. no cap, it's the main character of the whole library. let's get into it 🫢


🌸 NAME 🌸

  • libmtp β€” (that's literally it, the original is just a dash and a vibe. iconic minimalism honestly)

πŸ¦‹ SYNOPSIS πŸ¦‹

#include <libmtp.h>

✨ Data Fields ✨

here's the full roster of fields, no skips, no cuts, we do not gatekeep πŸ’…

  • uint8_t object_bitsize
  • void * params
  • void * usbinfo
  • LIBMTP_devicestorage_t * storage
  • LIBMTP_error_t * errorstack
  • uint8_t maximum_battery_level
  • uint32_t default_music_folder
  • uint32_t default_playlist_folder
  • uint32_t default_picture_folder
  • uint32_t default_video_folder
  • uint32_t default_organizer_folder
  • uint32_t default_zencast_folder
  • uint32_t default_album_folder
  • uint32_t default_text_folder
  • void * cd
  • LIBMTP_device_extension_t * extensions
  • int cached
  • LIBMTP_mtpdevice_t * next

πŸ‘‘ Detailed Description πŸ‘‘

Main MTP device object struct β€” that's the whole description and honestly? it said what it said. this is THE struct, the blueprint, the main character energy itself πŸŽ€


πŸ’– Field Documentation πŸ’–

fields listed alphabetically like a good little library. every single one, every single reference, all here for you πŸ“

int LIBMTP_mtpdevice_struct::cached

whether the device uses caching β€” only used internally, so don't come for it, it's not for you πŸ™ˆ

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 β€” again, only used internally, hands off bestie πŸ’…

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...) yep, just those ones, niche queen behavior 🧚

Referenced by LIBMTP_Dump_Device_Info(), and LIBMTP_Open_Raw_Device_Uncached().

LIBMTP_error_t* LIBMTP_mtpdevice_struct::errorstack

the error stack πŸ’€βš οΈ listen up because this one matters: this shall be handled using the error getting and clearing functions, not by dereferencing this list. do not poke the list directly, i am so serious, that is not the move.

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 πŸ”‹βœ¨

Referenced by LIBMTP_Get_Batterylevel(), and LIBMTP_Open_Raw_Device_Uncached().

LIBMTP_mtpdevice_t* LIBMTP_mtpdevice_struct::next

pointer to next device in the linked list; NULL if this is the last device πŸšΆβ™€οΈβž‘οΈ and if it's NULL, congrats, that's the end of the line, no more devices after this one.

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 πŸ”’

Referenced by LIBMTP_Dump_Device_Info(), and LIBMTP_Open_Raw_Device_Uncached().

void* LIBMTP_mtpdevice_struct::params

parameters for this device β€” you must cast this into (PTPParams*) before internal use, do not freestyle it 🫠

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().

(that list is a whole stan army omg πŸ”₯)

LIBMTP_devicestorage_t* LIBMTP_mtpdevice_struct::storage

the storage for this device. real talk: do not use strings in here without copying them first, and beware that this list may be rebuilt at any time. it is not stable, it will move on you, do not get attached πŸ’€

See also LIBMTP_Get_Storage()

Examples detect.c, files.c, folders.c, sendtr.c, and tracks.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 β€” and again, you must cast it into (PTP_USB*) before internal use 🚨

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. yeah, a robot wrote it, and it ate ✨


⭐ tiny reminder bestie: this page ships with libmtp, Version 1.1.23, and it's filed under LIBMTP_mtpdevice_struct(3). that's the whole vibe check, you're all caught up, go forth and slay πŸ’–πŸŽ€πŸ¦‹
πŸ“¦ where this page comes from