(* * If you get a linker error: sudo aptitude install libmtp *) Unit ulibmtp_static; {$MODE objfpc}{$H+} Interface Uses ulibmtp_common, ctypes; Const LibName = 'libmtp'; Procedure LIBMTP_Init(); cdecl; external LibName; Function LIBMTP_Detect_Raw_Devices(Var rawdevices: PLIBMTP_raw_device_t; Var numrawdevices: cint): LIBMTP_error_number_t; cdecl; external LibName; Function LIBMTP_Open_Raw_Device_Uncached(rawdevice: PLIBMTP_raw_device_t): PLIBMTP_mtpdevice_t; cdecl; external LibName; Procedure LIBMTP_Release_Device(device: PLIBMTP_mtpdevice_t); cdecl; external LibName; Function LIBMTP_Get_Friendlyname(device: PLIBMTP_mtpdevice_t): Pchar; cdecl; external LibName; Procedure LIBMTP_Clear_Errorstack(device: PLIBMTP_mtpdevice_t); cdecl; external LibName; Procedure LIBMTP_Dump_Errorstack(device: PLIBMTP_mtpdevice_t); cdecl; external LibName; Function LIBMTP_Get_Files_And_Folders(device: PLIBMTP_mtpdevice_t; storageid: uint32_t; leaf: uint32_t): PLIBMTP_file_t; cdecl; external LibName; Procedure LIBMTP_destroy_file_t(File_: PLIBMTP_file_t); cdecl; external LibName; Function LIBMTP_Get_Filetype_Description(File_: LIBMTP_filetype_t): Pchar; cdecl; external LibName; Implementation End.