LIBMTP_file_struct(3)

πŸ“¦ version 1.1.23, in arch rolling

πŸ’… LIBMTP_file_struct β€” a whole manual page for one lil' struct

okay so bestie, welcome to LIBMTP_file_struct(3) from the libmtp library functions manual. yes, this entire page is about one struct. and honestly? it's kind of the main character of MTP file handling, so let's get into it 🫢


✨ NAME ✨

LIBMTP_file_struct β€” that's it, that's the name. slay.


🌸 SYNOPSIS 🌸

first things first, you gotta let the compiler know what's up:

#include <libmtp.h>

πŸŽ€ Data Fields πŸŽ€

here's the whole squad that lives inside this struct β€” every single one, no skips:

  • uint32_t item_id
  • uint32_t parent_id
  • uint32_t storage_id
  • char * filename
  • uint64_t filesize
  • time_t modificationdate
  • LIBMTP_filetype_t filetype
  • LIBMTP_file_t * next

like, that's the entire roster. cute, right? πŸ’–


πŸ¦‹ Detailed Description πŸ¦‹

it's the MTP file struct. that's the whole vibe. it's the thing that holds the deets about a file on your MTP device so the library can actually do stuff with it. periodt.


πŸ’… Field Documentation πŸ’…

okay now the fun part β€” every field, broken down, with receipts on where it shows up. lowkey this is the section you actually came for. πŸ‘‘

🌈 char* LIBMTP_file_struct::filename

Filename of this file β€” literally just what it's called. the name. of the file. πŸ“

examples: detect.c, and files.c.

referenced by LIBMTP_destroy_file_t(), LIBMTP_Send_Track_From_File_Descriptor(), LIBMTP_Send_Track_From_Handler(), and LIBMTP_Set_File_Name().


✨ uint64_t LIBMTP_file_struct::filesize

Size of file in bytes β€” how thicc it is, in bytes. that's the unit, bestie, don't forget it πŸŽ€

examples: files.c.

referenced by LIBMTP_Get_File_To_File_Descriptor(), LIBMTP_Get_File_To_Handler(), LIBMTP_Send_File_From_File_Descriptor(), LIBMTP_Send_File_From_Handler(), LIBMTP_Send_Track_From_File_Descriptor(), and LIBMTP_Send_Track_From_Handler().


πŸ¦‹ LIBMTP_filetype_t LIBMTP_file_struct::filetype

Filetype used for the current file β€” like, what kind of file are we even dealing with here πŸ”₯

examples: files.c, and tracks.c.

referenced by LIBMTP_Get_File_To_File_Descriptor(), LIBMTP_Get_File_To_Handler(), LIBMTP_Send_Track_From_File_Descriptor(), LIBMTP_Send_Track_From_Handler(), LIBMTP_Set_File_Name(), and LIBMTP_Set_Object_Filename().


πŸŽ€ uint32_t LIBMTP_file_struct::item_id

Unique item ID β€” the ID. it's unique. it's an item's. you get it πŸ’œ

examples: detect.c, files.c, and tracks.c.

referenced by LIBMTP_Send_File_From_File_Descriptor(), LIBMTP_Send_File_From_Handler(), LIBMTP_Send_Track_From_File_Descriptor(), LIBMTP_Send_Track_From_Handler(), and LIBMTP_Set_File_Name().


🧚 time_t LIBMTP_file_struct::modificationdate

Date of last alteration of the file β€” when it was last touched, changed, messed with. the timestamp of "bestie did something to me" πŸ•°οΈ

(no examples and no referencers listed for this one β€” it's giving mysterious. still iconic tho.)


⭐ LIBMTP_file_t* LIBMTP_file_struct::next

Next file in list or NULL if last file β€” it's a linked list moment!! if this is NULL, congrats, you've reached the end 🫢

examples: detect.c, files.c, and tracks.c.

referenced by LIBMTP_Get_Filelisting_With_Callback(), LIBMTP_Get_Files_And_Folders(), LIBMTP_Send_Track_From_File_Descriptor(), and LIBMTP_Send_Track_From_Handler().


🌸 uint32_t LIBMTP_file_struct::parent_id

ID of parent folder β€” who's your mother? this field knows. it's the folder this file lives inside πŸ’–

examples: files.c.

referenced by LIBMTP_Send_File_From_File_Descriptor(), LIBMTP_Send_File_From_Handler(), LIBMTP_Send_Track_From_File_Descriptor(), and LIBMTP_Send_Track_From_Handler().


πŸ‘‘ uint32_t LIBMTP_file_struct::storage_id

ID of storage holding this file β€” which storage the file is chillin' on. the address of the house, basically 🏠

examples: files.c.

referenced by LIBMTP_Send_File_From_File_Descriptor(), LIBMTP_Send_File_From_Handler(), LIBMTP_Send_Track_From_File_Descriptor(), and LIBMTP_Send_Track_From_Handler().


πŸ’€ Author πŸ’€

Generated automatically by Doxygen for libmtp from the source code.

like, no human wrote this page, it was Doxygen doing its little robot thing. ngl that's kind of iconic of it πŸ€–


heads up bestie: this whole page is auto-generated by Doxygen straight from the libmtp source, so if something looks dry, blame the generator, not me πŸ’…

and that's the vibe check, we're done!! ty for reading my whole ted talk about a struct. this was libmtp Version 1.1.23, and the page is LIBMTP_file_struct(3) β€” mwah, see you in the next manpage πŸ’œβœ¨πŸŽ€

πŸ“¦ where this page comes from